diff --git a/plugins/newsnow/CHANGELOG.md b/plugins/newsnow/CHANGELOG.md new file mode 100644 index 00000000..e0dff078 --- /dev/null +++ b/plugins/newsnow/CHANGELOG.md @@ -0,0 +1,33 @@ +# Changelog + +## 2.0.0 + +### Added + +- 风格样式切换:支持风格1(侧栏)、风格2(卡片)、风格3(占位,即将推出) +- **风格1** 侧栏布局:左侧频道 Tab + 右侧资讯列表 +- 风格1 搜索:支持模糊搜索频道名称与当前频道内资讯 +- 风格1 关注:频道标题关注按钮、左侧「关注」分组展开已关注频道 +- 风格1 交互:右下角刷新 / 回到顶部悬浮按钮,资讯悬停蓝色高亮动效 +- 风格1 收藏:热搜与实时新闻列表均支持收藏 +- 设置项 `uiStyle`、`lastStyle1Source` 持久化 + +### Changed + +- 默认风格由风格2(卡片)调整为 **风格1(侧栏)** +- 共享逻辑集中于 `lib/newsnow/`(设置、元数据、收藏、栏目配置等) + +### Fixed + +- 风格1 搜索框输入时失焦(改为局部 DOM 更新) +- 侧栏无法滚动、设置入口被遮挡(底部固定悬浮设置栏) +- GitHub、百度、Freebuf 等频道热度/标题显示异常(修正 `extra` 字段解析与 HTML 转义) +- 模块初始化时 `style1SelectedSource` 暂时性死区导致页面空白 + +## 1.0.0 + +### Added + +- NewsNow 插件首版:多平台热搜与实时新闻订阅 +- 风格2 卡片网格布局,支持关注、收藏、搜索、数据源配置 +- ZTools preload 代理请求与本地调试(Vite HMR) diff --git a/plugins/newsnow/assets/main-BZwbOKIC.css b/plugins/newsnow/assets/main-BZwbOKIC.css new file mode 100644 index 00000000..728b96e4 --- /dev/null +++ b/plugins/newsnow/assets/main-BZwbOKIC.css @@ -0,0 +1 @@ +:root{--color-base: #27272a;--color-text: #d4d4d8;--color-accent: #71717a;--color-accent-hover: #a1a1aa;--color-highlight: #3b82f6;--radius-card: 12px;--card-height: 248px;--font-brand: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace}html.dark{color-scheme:dark;--color-base: #27272a;--color-text: #d4d4d8;--bg-page: #3f3f46}html.light{color-scheme:light;--color-base: #e4e4e7;--color-text: #27272a;--bg-page: #e4e4e7}*{box-sizing:border-box;margin:0;padding:0}html,body{width:100%;height:100%;overflow:hidden}body{font-family:system-ui,-apple-system,PingFang SC,Microsoft YaHei,sans-serif;font-size:13px;background:var(--bg-page);color:var(--color-text);-webkit-user-select:none;user-select:none}button,a{cursor:default;border:none;background:none;color:inherit;font:inherit;text-decoration:none}#app{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;background:var(--bg-page)}#overlay-root{position:fixed;top:0;right:0;bottom:0;left:0;z-index:300;pointer-events:none}#overlay-root:not(:empty){pointer-events:auto}.btn-icon{opacity:.55;transition:opacity .2s;font-size:1.1rem;line-height:1;padding:2px}.btn-icon:hover{opacity:.9;cursor:pointer}.btn-icon.active{opacity:1;color:#fbbf24}.btn-icon.is-spinning{opacity:1;animation:nn-spin .8s linear infinite;pointer-events:none}@keyframes nn-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.nn-header{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;padding:8px 12px 6px;flex-shrink:0;gap:8px}.nn-logo-wrap{display:flex;align-items:center;gap:6px;justify-self:start;min-width:0}.nn-logo-img{width:32px;height:32px;border-radius:8px;object-fit:cover;flex-shrink:0}.nn-logo{width:32px;height:32px;border-radius:8px;background:linear-gradient(135deg,#71717a,#a1a1aa);display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;color:#fff;flex-shrink:0}.nn-brand{font-family:var(--font-brand);font-size:1rem;line-height:1.05}.nn-brand .accent{color:var(--color-highlight)}.nn-version{font-size:.65rem;font-family:monospace;opacity:.55;margin-left:2px;align-self:flex-start;margin-top:2px}.nn-navbar{display:flex;flex-wrap:wrap;justify-content:center;padding:6px 8px;border-radius:var(--radius-card);background:#71717a1f;box-shadow:0 1px 4px #0000001f;font-size:.75rem;gap:2px}.nn-navbar button{padding:3px 6px;border-radius:5px;opacity:.8;cursor:pointer;transition:background .15s;white-space:nowrap}.nn-navbar button:hover{background:#71717a2e}.nn-navbar button.active{color:var(--color-highlight);font-weight:600;opacity:1}.nn-header-actions{justify-self:end;display:flex;gap:6px;align-items:center;color:var(--color-accent);font-size:1.05rem}.nn-main{flex:1;overflow-x:hidden;overflow-y:auto;padding:0 12px 12px;display:flex;flex-direction:column;min-height:0}.nn-cards-wrap{position:relative;flex:1;min-height:0;min-width:0}.nn-cards{display:flex;flex-wrap:wrap;gap:10px;align-content:start}.nn-card{height:var(--card-height);flex:1 1 calc(33.333% - 7px);min-width:220px;max-width:100%;border-radius:var(--radius-card);padding:10px;display:flex;flex-direction:column;position:relative;background:#64748b59}.nn-cards.has-custom-width .nn-card{flex:0 0 var(--card-width);width:var(--card-width);min-width:0;max-width:none}.nn-card-resize-e{position:absolute;right:0;top:28px;bottom:6px;width:6px;cursor:ew-resize;opacity:0;border-radius:3px;z-index:2}.nn-card-resize-s{position:absolute;left:6px;right:6px;bottom:0;height:6px;cursor:ns-resize;opacity:0;border-radius:3px;z-index:2}.nn-card:hover .nn-card-resize-e,.nn-card:hover .nn-card-resize-s,.nn-card-resize-e:hover,.nn-card-resize-s:hover{opacity:.45;background:#3b82f659}.nn-item-star-inline{margin-left:6px;font-size:.7rem;vertical-align:middle;cursor:pointer}.nn-card[data-color=green]{background:#22c55e59}.nn-card[data-color=red]{background:#ef444459}.nn-card[data-color=blue]{background:#3b82f659}.nn-card[data-color=indigo]{background:#6366f159}.nn-card[data-color=slate]{background:#64748b59}.nn-card[data-color=orange]{background:#f9731659}.nn-card[data-color=gray]{background:#6b728059}.nn-card[data-color=emerald]{background:#10b98159}.nn-card[data-color=teal]{background:#14b8a659}.nn-card[data-color=yellow]{background:#eab30859}.nn-card[data-color=purple]{background:#a855f759}.nn-card[data-color=pink]{background:#ec489959}.nn-card[data-color=cyan]{background:#06b6d459}.nn-card.is-highlight{outline:2px solid var(--color-highlight)}.nn-card-head{display:flex;justify-content:space-between;align-items:flex-start;margin:0 4px 6px;gap:4px}.nn-card-source{display:flex;gap:6px;align-items:center;min-width:0}.nn-card-icon-img{width:28px;height:28px;border-radius:50%;object-fit:cover;background:var(--color-base);flex-shrink:0}.nn-card-title{font-size:.95rem;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nn-card-badge{font-size:.65rem;padding:1px 4px;border-radius:4px;background:#ffffff26;margin-left:4px}.nn-card-updated{font-size:.65rem;opacity:.65}.nn-card-actions{display:flex;gap:4px;flex-shrink:0}.nn-drag-handle{cursor:grab;touch-action:none}.nn-drag-handle:active{cursor:grabbing}.nn-card-body{flex:1;overflow-y:auto;border-radius:var(--radius-card);background:#27272ab3;padding:6px;margin-top:2px;min-height:0}html.light .nn-card-body{background:#ffffffbf}.nn-list-hot{list-style:none;display:flex;flex-direction:column;gap:4px}.nn-list-hot li a{display:flex;gap:6px;align-items:flex-start;padding:2px 3px;border-radius:5px;cursor:pointer;font-size:.8rem;line-height:1.35}.nn-list-hot li a:hover{background:#a3a3a326}.nn-rank{min-width:20px;height:20px;display:flex;align-items:center;justify-content:center;background:#a3a3a326;border-radius:5px;font-size:.75rem;flex-shrink:0}.nn-list-timeline{list-style:none;border-left:1px solid rgba(163,163,163,.5);margin-left:3px}.nn-list-timeline li{padding-left:6px;margin-bottom:6px}.nn-list-timeline .meta{font-size:.65rem;opacity:.5;display:flex;gap:4px;align-items:center}.nn-list-timeline .meta:before{content:"-";margin-left:-8px;margin-right:2px}.nn-list-timeline a{display:block;padding:2px 3px;margin-left:3px;border-radius:5px;cursor:pointer;line-height:1.35;font-size:.8rem}.nn-list-timeline a:hover{background:#a3a3a326}.nn-item-star{opacity:.35;font-size:.7rem;margin-left:auto;flex-shrink:0;cursor:pointer}.nn-item-star.active{opacity:1;color:#fbbf24}.nn-menu-wrap{position:relative}.nn-dropdown{position:absolute;right:0;top:calc(100% + 4px);z-index:150;min-width:168px;max-height:min(320px,50vh);overflow-y:auto}.nn-dropdown-inner{background:#27272af5;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-radius:8px;padding:4px;box-shadow:0 6px 20px #00000059;border:1px solid rgba(163,163,163,.15)}html.light .nn-dropdown-inner{background:#fffffffa}.nn-dropdown li{list-style:none;padding:5px 8px;border-radius:6px;display:flex;gap:6px;align-items:center;cursor:pointer;font-size:.75rem;color:var(--color-text)}.nn-dropdown li:hover{background:#a3a3a326}.nn-dropdown li.disabled{opacity:.45;cursor:not-allowed}.nn-card.dragging{opacity:.35;transform:scale(.96);transition:transform .12s ease,opacity .12s ease;pointer-events:none}.nn-card-ghost{position:fixed;z-index:400;pointer-events:none;flex:none;transform:scale(1.05) rotate(-2deg);box-shadow:0 16px 36px #00000073;opacity:.95;transition:none;overflow:hidden}.nn-card-ghost .nn-card-body{display:none}.nn-card.drag-over{outline:2px dashed var(--color-highlight)}.nn-webview{position:fixed;top:0;right:0;bottom:0;left:0;z-index:350;display:flex;flex-direction:column;background:var(--bg-page)}.nn-webview-toolbar{display:flex;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid rgba(163,163,163,.2);flex-shrink:0}.nn-webview-toolbar button{padding:4px 10px;border-radius:6px;background:#71717a33;cursor:pointer;font-size:.75rem;flex-shrink:0}.nn-webview-title{flex:1;font-size:.7rem;opacity:.65;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nn-webview-frame{flex:1;width:100%;border:none;background:#fff}.nn-empty{grid-column:1 / -1;width:100%;padding:32px 16px;text-align:center;opacity:.6;font-size:.85rem}.nn-overlay{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:16px;z-index:300}.nn-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;background:#00000073;cursor:pointer}.nn-modal{position:relative;width:min(480px,100%);max-height:min(480px,calc(100vh - 32px));overflow:auto;background:var(--bg-page);border-radius:10px;padding:14px;box-shadow:0 12px 40px #00000059;z-index:1}.nn-modal h2{font-size:.9rem;margin-bottom:10px;font-weight:600}.nn-modal input[type=search],.nn-modal input[type=text]{width:100%;padding:7px 9px;border-radius:7px;border:1px solid rgba(163,163,163,.35);background:var(--color-base);color:var(--color-text);margin-bottom:10px;font-size:.85rem}.nn-modal-list{list-style:none;display:flex;flex-direction:column;gap:2px;max-height:320px;overflow-y:auto}.nn-modal-list li{padding:7px 8px;border-radius:7px;cursor:pointer;display:flex;justify-content:space-between;gap:8px;font-size:.8rem;align-items:center}.nn-modal-list li:hover{background:#a3a3a326}.nn-modal-list li.is-selected{background:#3b82f62e;color:var(--color-highlight)}.nn-modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px}.nn-modal-actions button{padding:5px 10px;border-radius:7px;background:#71717a33;cursor:pointer;font-size:.8rem}.nn-modal-actions button:hover{background:#71717a52}.nn-row-link{cursor:pointer;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nn-card.is-loading .nn-card-body{opacity:.45}.nn-card-error{padding:8px;font-size:.75rem;color:#f87171;word-break:break-word}.nn-settings-tabs{display:flex;gap:4px;margin-bottom:10px}.nn-settings-tab{padding:4px 10px;border-radius:6px;font-size:.75rem;cursor:pointer;background:#71717a26}.nn-settings-tab.active{background:#3b82f638;color:var(--color-highlight);font-weight:600}.nn-settings-list{list-style:none;display:flex;flex-direction:column;gap:4px;max-height:320px;overflow-y:auto}.nn-settings-list li{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:7px;background:#71717a14}.nn-settings-list li.dragging{opacity:.45;pointer-events:none}.nn-settings-list li.drag-over{outline:1px dashed var(--color-highlight)}.nn-settings-drag{cursor:grab;opacity:.45;flex-shrink:0}.nn-settings-icon{width:22px;height:22px;border-radius:50%;object-fit:cover;background:var(--color-base);flex-shrink:0}.nn-settings-name{flex:1;min-width:0;font-size:.8rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nn-settings-toggle{display:none}.nn-switch{position:relative;display:inline-flex;align-items:center;width:34px;height:18px;flex-shrink:0;cursor:pointer}.nn-switch input{opacity:0;width:0;height:0;position:absolute}.nn-switch-slider{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:999px;background:#71717a73;transition:background .2s}.nn-switch-slider:before{content:"";position:absolute;width:14px;height:14px;left:2px;top:2px;border-radius:50%;background:#fff;transition:transform .2s}.nn-switch input:checked+.nn-switch-slider{background:#22c55ebf}.nn-switch input:checked+.nn-switch-slider:before{transform:translate(16px)}.nn-settings-ghost{position:fixed;z-index:500;pointer-events:none;list-style:none;opacity:.92;box-shadow:0 12px 28px #00000059;transform:scale(1.02);background:var(--bg-page);border-radius:7px;display:flex;align-items:center;gap:8px;padding:6px 8px;box-sizing:border-box}.nn-settings-hint{font-size:11px;opacity:.55;margin-top:8px}.nn-fav-header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.nn-fav-header h2{margin:0;font-size:.9rem;font-weight:600;flex-shrink:0}.nn-fav-header input[type=text],.nn-fav-header input[type=search]{flex:1;max-width:200px;margin:0;padding:5px 8px;border-radius:6px;border:1px solid rgba(163,163,163,.35);background:var(--color-base);color:var(--color-text);font-size:.8rem}.nn-fav-modal-wrap{width:min(520px,calc(100vw - 32px))!important;height:min(480px,calc(100vh - 32px))!important;min-height:min(480px,calc(100vh - 32px))!important;max-height:min(480px,calc(100vh - 32px))!important;display:flex;flex-direction:column;overflow:hidden!important}.nn-fav-modal-wrap .nn-modal-list{max-height:none;flex:1;min-height:0}.nn-fav-body{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column}.nn-fav-body #fav-empty{flex:1;display:flex;align-items:center;justify-content:center;min-height:120px;margin:0}.nn-fav-list li{flex-direction:column;align-items:stretch;gap:6px}.nn-fav-row{display:flex;align-items:center;gap:6px;width:100%}.nn-tag-editor{width:100%;padding:6px 8px;border-radius:6px;background:#71717a1a}.nn-tag-input{width:100%;margin:0 0 6px;padding:5px 8px;border-radius:6px;border:1px solid rgba(163,163,163,.35);background:var(--color-base);color:var(--color-text);font-size:.75rem}.nn-tag-picks{display:flex;flex-wrap:wrap;gap:4px}.nn-tag-pick{cursor:pointer;border:none;font:inherit}.nn-tag-pick:hover{filter:brightness(1.1)}.nn-tag-empty{font-size:.7rem;opacity:.5}.nn-fav-tag{font-size:.65rem;padding:2px 7px;border-radius:999px;background:#3b82f633;color:var(--color-highlight);flex-shrink:0;line-height:1.4}.nn-fav-toolbar{display:flex;gap:6px;margin-bottom:8px;flex-wrap:wrap}.nn-fav-toolbar select{flex:1;min-width:90px;padding:4px 6px;border-radius:6px;border:1px solid rgba(163,163,163,.35);background:var(--color-base);color:var(--color-text);font-size:.75rem}.nn-fav-manage-btn{padding:4px 8px;border-radius:6px;font-size:.72rem;cursor:pointer;background:#71717a33;white-space:nowrap}.nn-fav-meta-panel{margin-bottom:8px;padding:8px;border-radius:7px;background:#71717a1a}.nn-fav-meta-row{display:flex;gap:6px;margin-bottom:6px}.nn-fav-meta-row:last-child{margin-bottom:0}.nn-fav-meta-row input{flex:1;margin:0;padding:5px 8px;border-radius:6px;border:1px solid rgba(163,163,163,.35);background:var(--color-base);color:var(--color-text);font-size:.75rem}.nn-fav-meta-row button{padding:4px 8px;border-radius:6px;font-size:.72rem;cursor:pointer;background:#71717a33;white-space:nowrap}.nn-settings-modal-wrap{width:min(480px,calc(100vw - 32px))!important}.nn-search-modal-wrap{width:min(680px,calc(100vw - 32px))!important;height:min(480px,calc(100vh - 32px))!important;max-height:min(480px,calc(100vh - 32px))!important;display:flex!important;flex-direction:column;overflow:hidden!important;padding:12px!important}.nn-search-modal-wrap>input[type=search]{flex-shrink:0;margin-bottom:10px;padding:10px 14px;border-radius:999px;border:none;background:#71717a38;font-size:.85rem}html.light .nn-search-modal-wrap>input[type=search]{background:#0000000f}.nn-search-body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,38%) minmax(0,1fr);gap:10px}.nn-search-sidebar{overflow-y:auto;min-height:0;padding-right:4px}.nn-search-group{margin-bottom:10px}.nn-search-group-title{font-size:.7rem;font-weight:600;opacity:.45;margin-bottom:4px;padding:0 6px}.nn-search-list{list-style:none;display:flex;flex-direction:column;gap:2px}.nn-search-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:10px;cursor:pointer;transition:background .12s}.nn-search-item:hover{background:#a3a3a31f}.nn-search-item.is-selected{background:#a3a3a333}.nn-search-icon{width:24px;height:24px;border-radius:50%;object-fit:cover;background:var(--color-base);flex-shrink:0}.nn-search-item-text{flex:1;min-width:0;display:flex;align-items:baseline;gap:6px}.nn-search-name{font-size:.82rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nn-search-tag{font-size:.68rem;opacity:.45;white-space:nowrap;flex-shrink:0}.nn-search-star{flex-shrink:0;font-size:.95rem}.nn-search-empty,.nn-search-preview-empty{display:flex;align-items:center;justify-content:center;height:100%;opacity:.5;font-size:.8rem;text-align:center;padding:16px}.nn-search-preview{min-height:0;overflow:hidden;display:flex;flex-direction:column}.nn-search-preview-inner{flex:1;min-height:0;display:flex;flex-direction:column}.nn-search-preview .nn-card.is-preview{flex:1;min-height:0;height:auto;max-width:none;width:100%}.nn-fav-date{font-size:.68rem;opacity:.4;flex-shrink:0;font-family:ui-monospace,monospace}.nn-fav-group{display:none}.nn-fav-edit{padding:2px 5px;border-radius:4px;font-size:.7rem;cursor:pointer;background:#71717a26;flex-shrink:0}.nn-fav-list button[data-remove]{padding:2px 6px;border-radius:4px;font-size:.7rem;cursor:pointer;background:#ef444426;color:#f87171;flex-shrink:0}.nn-s1{display:flex;width:100%;height:100%;min-height:0;overflow:hidden;background:#fff}html.dark .nn-s1{background:#1f1f23}.nn-s1-sidebar{width:168px;flex-shrink:0;display:flex;flex-direction:column;background:#f5f5f5;border-right:1px solid rgba(0,0,0,.06);position:relative;min-height:0;overflow:hidden}html.dark .nn-s1-sidebar{background:#2a2a2e;border-right-color:#ffffff14}.nn-s1-search-wrap{padding:10px 10px 6px;flex-shrink:0}.nn-s1-search{width:100%;padding:6px 10px;border-radius:8px;border:1px solid rgba(0,0,0,.08);background:#fff;color:#333;font-size:.78rem;outline:none}html.dark .nn-s1-search{background:#1f1f23;border-color:#ffffff1a;color:var(--color-text)}.nn-s1-search:focus{border-color:#1677ff;box-shadow:0 0 0 2px #1677ff1f}.nn-s1-focus-block{flex-shrink:0}.nn-s1-focus-toggle,.nn-s1-group-title{width:100%;display:flex;align-items:center;gap:6px;padding:7px 12px;font-size:.78rem;color:#666;cursor:pointer;text-align:left}html.dark .nn-s1-focus-toggle,html.dark .nn-s1-group-title{color:#a1a1aa}.nn-s1-focus-toggle:hover,.nn-s1-group-title:hover{background:#0000000a}html.dark .nn-s1-focus-toggle:hover,html.dark .nn-s1-group-title:hover{background:#ffffff0d}.nn-s1-focus-icon{color:#f59e0b;font-size:.85rem}.nn-s1-focus-count{font-size:.65rem;padding:0 5px;border-radius:999px;background:#1677ff1f;color:#1677ff;line-height:1.5}.nn-s1-chevron{margin-left:auto;font-size:.65rem;opacity:.55}.nn-s1-focus-list,.nn-s1-group-items{display:flex;flex-direction:column;gap:1px;padding:0 6px 4px}.nn-s1-sidebar-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding-bottom:8px}.nn-s1-groups{padding-bottom:4px}.nn-s1-group{margin-top:2px}.nn-s1-nav-item{width:100%;display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:8px;font-size:.8rem;color:#333;cursor:pointer;text-align:left;transition:background .15s,color .15s}html.dark .nn-s1-nav-item{color:var(--color-text)}.nn-s1-nav-item:hover{background:#1677ff0f}.nn-s1-nav-item.active{background:#e6f4ff;color:#1677ff;font-weight:600}html.dark .nn-s1-nav-item.active{background:#1677ff2e;color:#60a5fa}.nn-s1-nav-icon{width:20px;height:20px;border-radius:50%;object-fit:cover;flex-shrink:0;background:#fff}.nn-s1-nav-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nn-s1-settings{width:100%;display:flex;align-items:center;gap:6px;padding:10px 14px;font-size:.8rem;color:#666;cursor:pointer;background:#f5f5f5}.nn-s1-footer{flex-shrink:0;position:relative;z-index:2;border-top:1px solid rgba(0,0,0,.06);background:#f5f5f5;box-shadow:0 -4px 12px #0000000a}html.dark .nn-s1-footer{background:#2a2a2e;border-top-color:#ffffff14;box-shadow:0 -4px 12px #0003}html.dark .nn-s1-settings{background:#2a2a2e;color:#a1a1aa}.nn-s1-settings:hover{color:#1677ff;background:#1677ff0d}.nn-s1-settings-icon{font-size:.95rem}.nn-s1-menu-wrap{position:absolute;left:10px;bottom:calc(100% + 4px)}.nn-s1-dropdown{left:0;right:auto;bottom:calc(100% + 4px);top:auto}.nn-s1-main{flex:1;min-width:0;display:flex;flex-direction:column;position:relative;background:#fff}html.dark .nn-s1-main{background:#1f1f23}.nn-s1-content-head{flex-shrink:0;padding:14px 18px 8px;border-bottom:1px solid rgba(0,0,0,.05);display:flex;align-items:center;justify-content:space-between;gap:10px}.nn-s1-focus-btn{flex-shrink:0;font-size:1.1rem}html.dark .nn-s1-content-head{border-bottom-color:#ffffff0f}.nn-s1-source{display:flex;align-items:center;gap:10px}.nn-s1-source-icon{width:32px;height:32px;border-radius:50%;object-fit:cover}.nn-s1-source-name{font-size:1rem;font-weight:700;color:#222}html.dark .nn-s1-source-name{color:var(--color-text)}.nn-s1-source-tag{margin-left:6px;font-size:.68rem;font-weight:400;opacity:.55}.nn-s1-source-updated{font-size:.68rem;opacity:.5;margin-top:2px}.nn-s1-content-body{flex:1;overflow-y:auto;padding:8px 18px 64px;min-height:0}.nn-s1-content-body.is-loading{opacity:.55}.nn-s1-list{list-style:none;display:flex;flex-direction:column;gap:2px}.nn-s1-item{display:flex;align-items:flex-start;gap:10px;padding:9px 10px;border-radius:8px;cursor:pointer;line-height:1.45;font-size:.88rem;color:#222;transition:color .2s ease,background .2s ease,transform .15s ease}html.dark .nn-s1-item{color:var(--color-text)}.nn-s1-item:hover{color:#1677ff;background:#1677ff14;transform:translate(3px)}html.dark .nn-s1-item:hover{color:#60a5fa;background:#60a5fa1f}.nn-s1-rank{min-width:24px;font-size:.82rem;color:#999;flex-shrink:0}.nn-s1-item:hover .nn-s1-rank{color:#1677ff}.nn-s1-title{flex:1;min-width:0}.nn-s1-heat{flex-shrink:0;font-size:.75rem;color:#f97316;white-space:nowrap}.nn-s1-list-timeline .nn-s1-item{align-items:flex-start}.nn-s1-item-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.nn-s1-list-timeline .nn-s1-meta{font-size:.68rem;opacity:.5}.nn-s1-empty,.nn-s1-empty-side{padding:24px 12px;text-align:center;opacity:.5;font-size:.8rem}.nn-s1-error{padding:16px;color:#f87171;font-size:.8rem}.nn-s1-fabs{position:absolute;right:18px;bottom:18px;display:flex;flex-direction:column;gap:10px;z-index:5}.nn-s1-fab{width:40px;height:40px;border-radius:50%;background:#fff;box-shadow:0 2px 12px #0000001f;display:flex;align-items:center;justify-content:center;font-size:1.1rem;color:#666;cursor:pointer;transition:box-shadow .2s,color .2s,transform .15s}html.dark .nn-s1-fab{background:#2a2a2e;color:#a1a1aa;box-shadow:0 2px 12px #00000059}.nn-s1-fab:hover{color:#1677ff;box-shadow:0 4px 16px #1677ff33;transform:translateY(-1px)}.nn-s1-fab.is-spinning{animation:nn-spin .8s linear infinite;pointer-events:none}.nn-s1-fab-top[hidden]{display:none!important} diff --git a/plugins/newsnow/assets/main-D8qa8V4m.js b/plugins/newsnow/assets/main-D8qa8V4m.js new file mode 100644 index 00000000..3c5150d6 --- /dev/null +++ b/plugins/newsnow/assets/main-D8qa8V4m.js @@ -0,0 +1,251 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function Q(e){const t=String(e||"").trim();return t?t.replace(/\/+$/,""):""}function ye(e,t,n={}){const o=Q(e);if(!o)throw new Error("API 基址不能为空");if(!t)throw new Error("sourceId 不能为空");const r=new URL("/api/s",`${o}/`);return r.searchParams.set("id",t),n.latest&&r.searchParams.set("latest","true"),r.toString()}function tt(e,t,n={}){if(!n.isDev)return e;try{const o=new URL(e),r=Q(t),s=Q("https://newsnow.busiyi.world");if(r===s&&o.pathname.startsWith("/api/"))return`${o.pathname}${o.search}`}catch{}return e}function xe(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}const nt=["focus","hottest","realtime","updated"],ot=[{id:"focus",label:"关注",kind:"column"},{id:"hottest",label:"热搜",kind:"column"},{id:"realtime",label:"新闻",kind:"column"},{id:"search",label:"搜索",kind:"action"}],st={focus:"关注",hottest:"热搜",realtime:"新闻",updated:"更新"},rt={tech:"科技",china:"国内",world:"国际",finance:"财经",sports:"体育",other:"其他"},at=["tech","china","world","finance","sports","other"],it={"newsnow-news":"realtime","newsnow-hot":"hottest","newsnow-browse":"focus"},ct=["internal","ubrowser","external"],lt=["style1","style2","style3"],be={style1:"风格1(侧栏)",style2:"风格2(卡片)",style3:"风格3(即将支持)"};function ut(e){return it[e]??"realtime"}function Ae(e){return e==="updated"?"realtime":nt.includes(e)?e:"realtime"}const dt={redirect:"v2ex-share",name:"V2EX",column:"tech",home:"https://v2ex.com/",color:"slate",interval:6e5,title:"最新分享"},ft={name:"知乎",type:"hottest",column:"china",home:"https://www.zhihu.com",color:"blue",interval:6e5},pt={title:"实时热搜",name:"微博",type:"hottest",column:"china",home:"https://weibo.com",color:"red",interval:12e4},ht={name:"联合早报",type:"realtime",desc:"来自第三方网站: 早晨报",column:"world",home:"https://www.zaobao.com",color:"red",interval:18e5},mt={title:"今日最热",name:"酷安",type:"hottest",column:"tech",home:"https://coolapk.com",color:"green",interval:6e5},gt={redirect:"mktnews-flash",name:"MKTNews",column:"finance",home:"https://mktnews.net",color:"indigo",interval:12e4,title:"快讯"},vt={redirect:"wallstreetcn-quick",name:"华尔街见闻",type:"realtime",column:"finance",home:"https://wallstreetcn.com/",color:"blue",interval:3e5,title:"快讯"},yt={name:"抖音",type:"hottest",column:"china",home:"https://www.douyin.com",color:"gray",interval:6e5},bt={title:"主干道热帖",name:"虎扑",type:"hottest",column:"sports",home:"https://hupu.com",color:"red",interval:6e5},St={title:"头条",name:"懂球帝",type:"realtime",column:"sports",home:"https://www.dongqiudi.com",color:"green",interval:6e5},wt={name:"AIHOT",type:"realtime",column:"tech",home:"https://aihot.virxact.com/all",color:"blue",interval:3e5},$t={title:"热议",name:"百度贴吧",type:"hottest",column:"china",home:"https://tieba.baidu.com",color:"blue",interval:6e5},Lt={name:"今日头条",type:"hottest",column:"china",home:"https://www.toutiao.com",color:"red",interval:6e5},Et={name:"IT之家",type:"realtime",column:"tech",home:"https://www.ithome.com",color:"red",interval:6e5},qt={title:"热榜",name:"澎湃新闻",type:"hottest",column:"china",home:"https://www.thepaper.cn",color:"gray",interval:18e5},kt={name:"卫星通讯社",column:"world",home:"https://sputniknews.cn",color:"orange",interval:6e5},Ct={name:"参考消息",column:"world",home:"https://china.cankaoxiaoxi.com",color:"red",interval:18e5},Tt={redirect:"pcbeta-windows11",name:"远景论坛",type:"realtime",column:"tech",home:"https://bbs.pcbeta.com",color:"blue",interval:3e5,title:"Win11"},xt={redirect:"cls-telegraph",name:"财联社",type:"realtime",column:"finance",home:"https://www.cls.cn",color:"red",interval:3e5,title:"电报"},At={redirect:"xueqiu-hotstock",name:"雪球",type:"hottest",column:"finance",home:"https://xueqiu.com",color:"blue",interval:12e4,title:"热门股票"},Mt={title:"事件",name:"格隆汇",type:"realtime",column:"finance",home:"https://www.gelonghui.com",color:"blue",interval:12e4},Ot={redirect:"fastbull-express",name:"法布财经",type:"realtime",column:"finance",home:"https://www.fastbull.cn",color:"emerald",interval:12e4,title:"快讯"},Pt={name:"Solidot",column:"tech",home:"https://solidot.org",color:"teal",interval:36e5},Ut={name:"Hacker News",type:"hottest",column:"tech",home:"https://news.ycombinator.com/",color:"orange",interval:6e5},Ft={name:"Product Hunt",type:"hottest",column:"tech",home:"https://www.producthunt.com/",color:"red",interval:6e5},Dt={redirect:"github-trending-today",name:"Github",type:"hottest",column:"tech",home:"https://github.com/",color:"gray",interval:6e5,title:"Today"},Ht={redirect:"bilibili-hot-search",name:"哔哩哔哩",type:"hottest",column:"china",home:"https://www.bilibili.com",color:"blue",interval:6e5,title:"热搜"},Nt={name:"快手",type:"hottest",disable:"cf",column:"china",home:"https://www.kuaishou.com",color:"orange",interval:6e5},jt={name:"靠谱新闻",desc:"不一定靠谱,多看多思考",column:"world",home:"https://kaopu.news/",color:"gray",interval:18e5},Rt={name:"金十数据",type:"realtime",column:"finance",home:"https://www.jin10.com",color:"blue",interval:6e5},Bt={name:"百度热搜",type:"hottest",column:"china",home:"https://www.baidu.com",color:"blue",interval:6e5},_t={name:"牛客",type:"hottest",column:"china",home:"https://www.nowcoder.com",color:"blue",interval:6e5},Kt={name:"少数派",type:"hottest",column:"tech",home:"https://sspai.com",color:"red",interval:6e5},Gt={name:"稀土掘金",type:"hottest",column:"tech",home:"https://juejin.cn",color:"blue",interval:6e5},It={title:"热点资讯",name:"凤凰网",type:"hottest",column:"china",home:"https://www.ifeng.com",color:"red",interval:6e5},zt={redirect:"chongbuluo-latest",name:"虫部落",column:"china",home:"https://www.chongbuluo.com/forum.php?mod=guide&view=newthread",color:"green",interval:18e5,title:"最新"},Yt={title:"热门电影",name:"豆瓣",type:"hottest",column:"china",home:"https://www.douban.com",color:"green",interval:6e5},Xt={title:"在线人数",name:"Steam",type:"hottest",column:"world",home:"https://store.steampowered.com",color:"blue",interval:6e5},Wt={redirect:"tencent-hot",name:"腾讯新闻",type:"hottest",column:"china",home:"https://news.qq.com/tag/aEWqxLtdgmQ=",color:"blue",interval:18e5,title:"综合早报"},Vt={title:"网络安全",name:"Freebuf",type:"hottest",column:"china",home:"https://www.freebuf.com/",color:"green",interval:6e5},Qt={redirect:"qqvideo-tv-hotsearch",name:"腾讯视频",type:"hottest",column:"china",home:"https://v.qq.com/channel/tv",color:"blue",interval:18e5,title:"热搜榜"},Jt={redirect:"iqiyi-hot-ranklist",name:"爱奇艺",type:"hottest",column:"china",home:"https://www.iqiyi.com",color:"green",interval:18e5,title:"热播榜"},k={v2ex:dt,"v2ex-share":{name:"V2EX",column:"tech",home:"https://v2ex.com/",color:"slate",interval:6e5,title:"最新分享"},zhihu:ft,weibo:pt,zaobao:ht,coolapk:mt,mktnews:gt,"mktnews-flash":{name:"MKTNews",column:"finance",home:"https://mktnews.net",color:"indigo",interval:12e4,title:"快讯"},wallstreetcn:vt,"wallstreetcn-quick":{name:"华尔街见闻",type:"realtime",column:"finance",home:"https://wallstreetcn.com/",color:"blue",interval:3e5,title:"快讯"},"wallstreetcn-news":{name:"华尔街见闻",column:"finance",home:"https://wallstreetcn.com/",color:"blue",interval:18e5,title:"最新"},"wallstreetcn-hot":{name:"华尔街见闻",type:"hottest",column:"finance",home:"https://wallstreetcn.com/",color:"blue",interval:18e5,title:"最热"},"36kr":{redirect:"36kr-quick",name:"36氪",type:"realtime",disable:"cf",column:"tech",home:"https://36kr.com",color:"blue",interval:6e5,title:"快讯"},"36kr-quick":{name:"36氪",type:"realtime",disable:"cf",column:"tech",home:"https://36kr.com",color:"blue",interval:6e5,title:"快讯"},"36kr-renqi":{name:"36氪",type:"hottest",disable:"cf",column:"tech",home:"https://36kr.com",color:"blue",interval:6e5,title:"人气榜"},douyin:yt,hupu:bt,dongqiudi:St,aihot:wt,tieba:$t,toutiao:Lt,ithome:Et,thepaper:qt,sputniknewscn:kt,cankaoxiaoxi:Ct,pcbeta:Tt,"pcbeta-windows11":{name:"远景论坛",type:"realtime",column:"tech",home:"https://bbs.pcbeta.com",color:"blue",interval:3e5,title:"Win11"},cls:xt,"cls-telegraph":{name:"财联社",type:"realtime",column:"finance",home:"https://www.cls.cn",color:"red",interval:3e5,title:"电报"},"cls-depth":{name:"财联社",column:"finance",home:"https://www.cls.cn",color:"red",interval:6e5,title:"深度"},"cls-hot":{name:"财联社",type:"hottest",column:"finance",home:"https://www.cls.cn",color:"red",interval:6e5,title:"热门"},xueqiu:At,"xueqiu-hotstock":{name:"雪球",type:"hottest",column:"finance",home:"https://xueqiu.com",color:"blue",interval:12e4,title:"热门股票"},gelonghui:Mt,fastbull:Ot,"fastbull-express":{name:"法布财经",type:"realtime",column:"finance",home:"https://www.fastbull.cn",color:"emerald",interval:12e4,title:"快讯"},"fastbull-news":{name:"法布财经",column:"finance",home:"https://www.fastbull.cn",color:"emerald",interval:18e5,title:"头条"},solidot:Pt,hackernews:Ut,producthunt:Ft,github:Dt,"github-trending-today":{name:"Github",type:"hottest",column:"tech",home:"https://github.com/",color:"gray",interval:6e5,title:"Today"},bilibili:Ht,"bilibili-hot-search":{name:"哔哩哔哩",type:"hottest",column:"china",home:"https://www.bilibili.com",color:"blue",interval:6e5,title:"热搜"},"bilibili-hot-video":{name:"哔哩哔哩",type:"hottest",disable:"cf",column:"china",home:"https://www.bilibili.com",color:"blue",interval:6e5,title:"热门视频"},"bilibili-ranking":{name:"哔哩哔哩",type:"hottest",disable:"cf",column:"china",home:"https://www.bilibili.com",color:"blue",interval:18e5,title:"排行榜"},kuaishou:Nt,kaopu:jt,jin10:Rt,baidu:Bt,nowcoder:_t,sspai:Kt,juejin:Gt,ifeng:It,chongbuluo:zt,"chongbuluo-latest":{name:"虫部落",column:"china",home:"https://www.chongbuluo.com/forum.php?mod=guide&view=newthread",color:"green",interval:18e5,title:"最新"},"chongbuluo-hot":{name:"虫部落",type:"hottest",column:"china",home:"https://www.chongbuluo.com/forum.php?mod=guide&view=hot",color:"green",interval:18e5,title:"最热"},douban:Yt,steam:Xt,tencent:Wt,"tencent-hot":{name:"腾讯新闻",type:"hottest",column:"china",home:"https://news.qq.com/tag/aEWqxLtdgmQ=",color:"blue",interval:18e5,title:"综合早报"},freebuf:Vt,qqvideo:Qt,"qqvideo-tv-hotsearch":{name:"腾讯视频",type:"hottest",column:"china",home:"https://v.qq.com/channel/tv",color:"blue",interval:18e5,title:"热搜榜"},iqiyi:Jt,"iqiyi-hot-ranklist":{name:"爱奇艺",type:"hottest",column:"china",home:"https://www.iqiyi.com",color:"green",interval:18e5,title:"热播榜"}},Zt=["dongqiudi","producthunt","aihot","36kr-quick","36kr-renqi","cankaoxiaoxi","cls-telegraph","cls-depth","cls-hot","fastbull-express","fastbull-news","freebuf","jin10","kaopu","mktnews-flash","solidot","weibo","bilibili-hot-search","bilibili-hot-video","bilibili-ranking","kuaishou","toutiao"];function Z(e){return!(!e||e.redirect||e.disable===!0||e.disable==="cf")}function Se(e,t){return Object.entries(t).filter(([,n])=>n.type===e&&Z(n)).map(([n])=>n).sort((n,o)=>n.localeCompare(o))}function X(e,t){return Object.entries(t).filter(([,n])=>n.column===e&&Z(n)).map(([n])=>n)}function en(e=k){return{focus:[],hottest:Se("hottest",e),realtime:Se("realtime",e),updated:Zt.filter(t=>Z(e[t])),china:X("china",e),world:X("world",e),tech:X("tech",e),finance:X("finance",e),sports:X("sports",e)}}function H(e,t){return e.includes(t)?e.filter(n=>n!==t):[...e,t]}function tn(e=k){return Object.entries(e).filter(([,t])=>Z(t)).map(([t,n])=>({id:t,name:n.name,title:n.title,column:n.column,color:n.color,type:n.type}))}function Me(e,t=rt){const n=new Map;for(const o of e){const r=o.column||"other";n.has(r)||n.set(r,[]),n.get(r).push(o)}return at.filter(o=>n.has(o)).map(o=>({key:o,label:t[o]??o,items:n.get(o)}))}const nn=["focus","hottest","realtime"];function on(e){return st[e]??e}function Oe(e,t,n){return e==="focus"?[...t]:[...n[e]??[]]}function sn(e,t){if(!(t!=null&&t.length))return e;const n=new Set(t);return e.filter(o=>!n.has(o))}function pe(e,t){if(!(t!=null&&t.length))return e;const n=new Map(t.map((o,r)=>[o,r]));return[...e].sort((o,r)=>{const s=n.has(o)?n.get(o):Number.MAX_SAFE_INTEGER,i=n.has(r)?n.get(r):Number.MAX_SAFE_INTEGER;return s!==i?s-i:o.localeCompare(r)})}function we(e,t,n){const o=[...e[t]??[]],r=o.indexOf(n);return r===-1?o.push(n):o.splice(r,1),{...e,[t]:o}}function Pe(e,t,n){const o=e.filter(s=>s!==t),r=o.indexOf(n);return r===-1?(o.push(t),o):(o.splice(r,0,t),o)}function $e(e,t,n,o){const r=Oe(e,t,n),s=new Set(r),i=Object.entries(o).filter(([,c])=>Z(c)?e==="focus"?!0:c.type===e:!1).map(([c])=>c).filter(c=>!s.has(c));return[...r,...i]}function U(e,t,n,o,r){const s=Oe(e,t,n),i=sn(s,o[e]??[]),c=r[e];return c!=null&&c.length?pe(i,c):i}function rn(e,t,n){const o={focus:[],hottest:[],realtime:[]};if(!Array.isArray(e))return o;const r=new Set(e);for(const s of n)r.has(s)||o.focus.push(s);for(const s of t.hottest??[])r.has(s)||o.hottest.push(s);for(const s of t.realtime??[])r.has(s)||o.realtime.push(s);return o}function an(e,t=Date.now()){return{id:String(e.id),sourceId:e.sourceId,title:e.title,url:e.url,savedAt:e.savedAt??t,tags:Array.isArray(e.tags)?[...e.tags]:[]}}function Ue(e){if(!e)return"";const t=typeof e=="number"?e:Date.parse(String(e));if(Number.isNaN(t))return"";const n=new Date(t),o=n.getFullYear(),r=String(n.getMonth()+1).padStart(2,"0"),s=String(n.getDate()).padStart(2,"0");return`${o}-${r}-${s}`}function cn(e,t={}){var r,s;const n=((r=t.query)==null?void 0:r.trim().toLowerCase())??"",o=((s=t.tag)==null?void 0:s.trim())??"";return e.filter(i=>o&&!(i.tags??[]).includes(o)?!1:n?[i.title,i.url,i.sourceId,...i.tags??[],Ue(i.savedAt)].join(" ").toLowerCase().includes(n):!0)}function ln(e){const t=new Set;for(const n of e)for(const o of n.tags??[])t.add(o);return[...t].sort((n,o)=>n.localeCompare(o))}function un(e,t){const n=t.trim();return!n||e.includes(n)?e:[...e,n].sort((o,r)=>o.localeCompare(r))}function dn(e,t,n){const o=n.trim();return o?e.map(r=>{if(E(r)!==t)return r;const s=r.tags??[];return s.includes(o)?r:{...r,tags:[...s,o]}}):e}function K(e,t){return e.some(n=>E(n)===t)}function E(e){return`${e.sourceId}:${e.id}`}function Fe(e,t){const n=E(t);return e.some(o=>E(o)===n)?e:[an(t),...e]}function De(e,t){return e.filter(n=>E(n)!==t)}function fn(e,t){const n=E(t);return K(e,n)?De(e,n):Fe(e,t)}const Le={baseUrl:"https://newsnow.busiyi.world",theme:"dark",uiStyle:"style1",lastStyle1Source:null,openMode:"external",focusSources:[],enabledSources:null,disabledSources:{focus:[],hottest:[],realtime:[]},sourceOrder:{},cardLayout:{},cardSizes:{},favoriteTags:[],favorites:[],lastColumn:"updated"};function pn(e){if(!e||typeof e!="object")return{...Le,disabledSources:{focus:[],hottest:[],realtime:[]},sourceOrder:{},cardLayout:{},cardSizes:{},favoriteTags:[],favorites:[]};const t=e.disabledSources&&typeof e.disabledSources=="object"?{focus:Array.isArray(e.disabledSources.focus)?[...e.disabledSources.focus]:[],hottest:Array.isArray(e.disabledSources.hottest)?[...e.disabledSources.hottest]:[],realtime:Array.isArray(e.disabledSources.realtime)?[...e.disabledSources.realtime]:[]}:{focus:[],hottest:[],realtime:[]},n=e.uiStyle==="style2"||e.uiStyle==="style3"?e.uiStyle:"style1";return{...Le,...e,uiStyle:n,lastStyle1Source:typeof e.lastStyle1Source=="string"&&e.lastStyle1Source?e.lastStyle1Source:null,focusSources:Array.isArray(e.focusSources)?[...e.focusSources]:[],enabledSources:Array.isArray(e.enabledSources)?[...e.enabledSources]:e.enabledSources,disabledSources:t,sourceOrder:e.sourceOrder&&typeof e.sourceOrder=="object"?{...e.sourceOrder}:{},cardLayout:hn(e),cardSizes:mn(e),favoriteTags:Array.isArray(e.favoriteTags)?[...e.favoriteTags]:[],favorites:Array.isArray(e.favorites)?e.favorites.map(o=>({...o,tags:Array.isArray(o.tags)?[...o.tags]:[]})):[]}}function hn(e){return e!=null&&e.cardLayout&&typeof e.cardLayout=="object"?{...e.cardLayout}:{}}function mn(e){if(!(e!=null&&e.cardSizes)||typeof e.cardSizes!="object")return{};const t={};for(const[n,o]of Object.entries(e.cardSizes)){if(!o||typeof o!="object")continue;const r={};typeof o.width=="number"&&o.width>0&&(r.width=o.width),typeof o.height=="number"&&o.height>0&&(r.height=o.height),(r.width||r.height)&&(t[n]=r)}return t}function N(){return typeof ztools<"u"?ztools:null}function gn(e){try{const t=N();if(t!=null&&t.dbStorage)return t.dbStorage.getItem(e);const n=localStorage.getItem(e);return n?JSON.parse(n):null}catch{return null}}function vn(e,t){const n=N();n!=null&&n.dbStorage?n.dbStorage.setItem(e,t):localStorage.setItem(e,JSON.stringify(t))}function ee(e){const t=N();if(t!=null&&t.showNotification){t.showNotification(e);return}}function yn(e){const t=N();if(t!=null&&t.shellOpenExternal){t.shellOpenExternal(e);return}window.open(e,"_blank")}function bn(e){const t=N();if(!(t!=null&&t.createBrowserWindow)||!xe(e))return!1;const n=`./viewer.html?url=${encodeURIComponent(e)}`;try{return!!t.createBrowserWindow(n,{width:1024,height:720,center:!0,minWidth:480,minHeight:360})}catch{return!1}}function Sn(e,t,n){if(!e||e==="#")return;const o=N();if(!o){window.open(e,"_blank");return}if(t==="external"){o.shellOpenExternal(e);return}if(t==="ubrowser"){if(bn(e))return;if(o.shellOpenExternal){o.shellOpenExternal(e),ee("独立窗口打开失败,已改用系统浏览器");return}window.open(e,"_blank");return}n(e)}function wn(e){const t=N();t!=null&&t.onPluginEnter&&t.onPluginEnter(e)}const He="newsnow-settings",$n="2.0.0",C=en(),Ee=tn(),p=document.getElementById("app"),P=document.getElementById("overlay-root");let $=null,M="";const ae=new Set;let F=!0,ce=!1,a=Ln(),L=Ae(a.lastColumn),j=null;const m=new Map;let D=null;function Ln(){const e=pn(gn(He));return $=e.lastStyle1Source,e}function y(){a.lastColumn=L,a.uiStyle==="style1"&&$&&(a.lastStyle1Source=$),vn(He,a)}function te(){const e=a.disabledSources,t=!e.focus.length&&!e.hottest.length&&!e.realtime.length;Array.isArray(a.enabledSources)&&t&&(a.disabledSources=rn(a.enabledSources,C,a.focusSources),a.enabledSources=null,y())}function Ne(){const e=p.querySelector("#nn-main"),t={mainTop:(e==null?void 0:e.scrollTop)??0,mainLeft:(e==null?void 0:e.scrollLeft)??0,bodies:new Map};return p.querySelectorAll(".nn-card").forEach(n=>{const o=n.querySelector(".nn-card-body");o&&n.dataset.sourceId&&t.bodies.set(n.dataset.sourceId,o.scrollTop)}),t}function je(e){requestAnimationFrame(()=>{const t=p.querySelector("#nn-main");t&&(t.scrollTop=e.mainTop,t.scrollLeft=e.mainLeft),e.bodies.forEach((n,o)=>{const r=p.querySelector(`.nn-card[data-source-id="${o}"] .nn-card-body`);r&&(r.scrollTop=n)})})}function En(){if(a.cardLayout.width||a.cardLayout.height)return;const e=Object.values(a.cardSizes).find(t=>(t==null?void 0:t.width)||(t==null?void 0:t.height));e&&(a.cardLayout={width:e.width,height:e.height},a.cardSizes={},y())}function le(){const{width:e,height:t}=a.cardLayout,n=document.documentElement,o=p.querySelector("#nn-cards");t?n.style.setProperty("--card-height",`${t}px`):n.style.removeProperty("--card-height"),e?(n.style.setProperty("--card-width",`${e}px`),o==null||o.classList.add("has-custom-width")):(n.style.removeProperty("--card-width"),o==null||o.classList.remove("has-custom-width"))}function Re(){const e=document.documentElement;e.classList.toggle("dark",a.theme==="dark"),e.classList.toggle("light",a.theme==="light")}function ue(e){if(!e)return"";const t=typeof e=="number"?e:Date.parse(String(e));if(Number.isNaN(t))return"";const n=Date.now()-t,o=Math.floor(n/6e4);if(o<1)return"刚刚";if(o<60)return`${o}分钟前`;const r=Math.floor(o/60);return r<24?`${r}小时前`:`${Math.floor(r/24)}天前`}function Be(e){return!e.favId||!e.favSource?null:{id:e.favId,sourceId:e.favSource,title:decodeURIComponent(e.favTitle||""),url:decodeURIComponent(e.favUrl||"")}}function qn(e){const t=Be(e);if(t)return a.favorites=fn(a.favorites,t),y(),E(t)}function kn(e){const t=Be(e);if(!t)return;const n=E(t);return K(a.favorites,n)||(a.favorites=Fe(a.favorites,t),y()),n}function qe(e){if(!e.dataset.favId)return;const t=K(a.favorites,E({sourceId:e.dataset.favSource,id:e.dataset.favId}));e.classList.contains("nn-item-star")&&(e.classList.toggle("active",t),e.textContent=t?"★":"☆")}function de(e){e.querySelectorAll("[data-fav-id]").forEach(t=>{t.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),qn(t.dataset),qe(t)})}),e.querySelectorAll(".nn-fav-link").forEach(t=>{t.addEventListener("auxclick",n=>{if(n.button!==1)return;n.preventDefault(),n.stopPropagation(),kn(t.dataset);const o=t.querySelector(".nn-item-star");o?qe(o):ee("已收藏")})})}function me(){return te(),U(L,a.focusSources,C,a.disabledSources,a.sourceOrder)}function ne(e){const t=Q(a.baseUrl),n=e.split("-")[0];return`${t}/icons/${n}.png`}function Cn(e){T(),P.innerHTML=` +
暂无收藏资讯
+拖拽调整顺序;开关切换启用状态。各栏目与首页 Tab 一致。
`,t.querySelectorAll("[data-settings-tab]").forEach(u=>{u.addEventListener("click",()=>{e=u.dataset.settingsTab,o()})}),n(r)};o()})}function Un(){I("API 基址",` +风格1 为默认侧栏布局;风格3 即将推出。
`,e=>{var t;(t=e.querySelector("#style-list"))==null||t.addEventListener("click",n=>{const o=n.target.closest("li[data-style]");if(!o||o.classList.contains("disabled"))return;n.stopPropagation();const r=o.dataset.style;!r||r===a.uiStyle||(a.uiStyle=r,m.clear(),y(),T(),A(),a.uiStyle==="style1"?(z(),Y($)):O(),ee(`已切换为:${be[r]}`))})})}function In(){return ot.map(e=>e.kind==="action"?``:``).join("")}function zn(){const e=a.theme==="dark"?"浅色模式":"深色模式";return` +