Peach: Local-first video metadata scraper and media manager.
feat(ui): 补齐 Board 控件与历史时间分析
longmeidao3228cd7959bd
diff --git a/docs/BOARD_UI.md b/docs/BOARD_UI.mdindex 7c4a66662..187636e62 100644--- a/docs/BOARD_UI.md+++ b/docs/BOARD_UI.md@@ -71,7 +71,11 @@ Agent Progress 的公开演示使用定时步骤。Peach 的作业由服务端| 添加关注 | 共享后台作业数量进度 || 版本更新 | 已有下载、校验与安装阶段;由版本分支负责 |-Charts 已核对 Stat Cards、Bar List、Radar、Radial,以及 Orders、Revenue、Contributions、Heatmap、Funnel、Sankey 的数据需求。当前统计查询是快照,`last_played` 不是完整播放事件序列,因此不据此伪造时间热图或月度涨跌;非互斥口味标签不进入漏斗或流向图。+Charts 已核对 Stat Cards、Bar List、Radar、Radial、Contributions、Heatmap 和 Sankey 的公开行为。馆藏统计使用当前快照;浏览历史按去重后的真实访问时间生成星期/小时热图与每日活跃格,支持 7、30、90、365 天和全部时间。`last_played` 不充当完整播放事件序列。创作者流向使用来源网站与创作者线索的实际关联计数;非互斥口味标签不进入漏斗或流向图。++Slider、Notification、Tooltip、Carousel、Checkbox、Chip、Dropdown、Link Button、Button Group 已取得官方公开注册表,文件位于验收目录的 `board-reference`。范围控件保留原生键盘操作,Checkbox 支持部分选中,通知悬停与聚焦暂停计时,图片查看复用 Swiper 的缩放及键盘导航。排名默认展示五项,通过底部渐隐和按钮展开当前排名数据。++Radial Chart Card、Bar List Card、Heatmap 与 Sankey 的 Pro 源码**未取得**;当前为依据公开文档实现的 Peach 适配,不是安装 Pro 组件。环形图连接媒体库及网盘计数,支持加载、聚焦与选中反馈;Sankey 使用 d3-sankey 的成熟布局计算,保留来源颜色、流线聚焦与数值联动。补充公开参考文件 SHA-256:diff --git a/docs/PRODUCT_BACKLOG.md b/docs/PRODUCT_BACKLOG.mdindex 12c9f3e55..c6a5cd5a3 100644--- a/docs/PRODUCT_BACKLOG.md+++ b/docs/PRODUCT_BACKLOG.md@@ -8,7 +8,7 @@正式工作树已实现共享视觉层、管理与详情卡片、设置布局、数值输入和旧版隔离;18984 直接读取该工作树用于只读验收。生产尚未切换。Remix Icon 候选审查在预览 `/icon-review.html`,现有已选图标保留至用户筛选。迁移不包含版本号或其他分支发布工作。-统计与口味已接入 Stat Cards、独立实现的排名条、雷达与分布环;侧栏使用同一导航的 60/260px 宽窄态,手机从左侧滑入。设置滚动渐隐、手机输入字号、焦点环留白及登录保持时长已接入。业务进度的适配范围与不适用图表见 [Board 适配](BOARD_UI.md)。+统计与口味已接入 Stat Cards、可展开排名、雷达、媒体库与网盘环形卡;浏览历史支持时间范围、真实访问热图和网站到创作者线索的流向。侧栏使用同一导航的 60/260px 宽窄态,手机从左侧滑入。设置滚动渐隐、手机输入字号、焦点环留白及登录保持时长已接入。Pro 组件使用公开行为的独立适配,范围见 [Board 适配](BOARD_UI.md)。侧栏底部固定设置和明暗开关,顶部独立按钮控制展开;媒体库图标负责打开选择面板,首页入口使用 Peach logo。路径可命名分组并选择图标,网盘默认图标由本机提供;库选择限定作品列表与筛选项。统计、口味和维护任务保持全局。关注提供宽松与紧凑排版,共享作者分组、排序、多选和批量删除;宽松模式可收起作者,最近观看标题可跳转视频。详情优先响应 Esc,手机排序栏可横向滚动。预览不保存真实配置。diff --git a/docs/REUSE.md b/docs/REUSE.mdindex 65173df4c..858f6c717 100644--- a/docs/REUSE.md+++ b/docs/REUSE.md@@ -5,6 +5,7 @@- 组件映射、官方公开注册表证据与许可证见 [Board 界面](BOARD_UI.md)。`web/board.css` 共用正式页面结构,设置可关闭该视觉层;登录和首启页共用 `board_entry_style()`。- `frontend/src/number-setting.ts` 共用带单位输入、可选 Switch、整数边界和锚定错误提示。关闭保留上次合法值,异步读取后切换也恢复实际值;业务保存仍由调用方负责。- 图标按钮统一清除浏览器内边距并居中 SVG,不覆盖业务显隐。Remix Icon 由 `vendor_web_dependencies.mjs` 生成设置导航 symbol;随机按钮保留原有双路径动画。+- `frontend/src/board-sankey.ts` 使用 d3-sankey 0.12.3(BSD-3-Clause;类型包 0.12.5)计算来源网站到创作者线索的流向。布局依赖不读取浏览历史;Peach 提供去重聚合值并负责隐私边界。分发许可随 `web/vendor/d3-LICENSE.txt` 保留。复核复用 Checkbox、Button、Badge、Select 与 `/api/review/decision`,默认勾选并沿用馆藏页 Shift 连选语义;支持跨组通过/拒绝与无歧义的共同来源选择。按候选数量、来源组合或字段分组,每项仅出现一次,切组保留选择;成功移出、失败保留,页面离开后停止后续提交。正文使用不占宽度的 Scroller,完成结果复用成功 Note。身份候选复用创作者页、作品详情与 revealSource 核对样本;来源图片和缺图占位共用 220px 预览区,加载失败保留占位。样本读取支持无缩略图作品,回收站不参与。diff --git a/docs/STATUS.md b/docs/STATUS.mdindex b2923d0af..59cf38ebc 100644--- a/docs/STATUS.md+++ b/docs/STATUS.md@@ -6,7 +6,7 @@## 运行态-- BoardUI:只读验收 18984;生产未切换,见 `BOARD_UI.md`。+- BoardUI:只读验收 18984,统计与关注内容正常加载;前端构建与源码同步后再刷新。生产未切换,见 `BOARD_UI.md`。- 设置与反馈已部署;预览 18976。骨架桌面及 390px 验收通过,生产浏览器超时。diff --git a/frontend/package-lock.json b/frontend/package-lock.jsonindex 690e7cca4..6e22170dc 100644--- a/frontend/package-lock.json+++ b/frontend/package-lock.json@@ -7,9 +7,11 @@"name": "peach-frontend","dependencies": {"@preact/signals": "2.11.1",+ "d3-sankey": "0.12.3","preact": "10.29.8"},"devDependencies": {+ "@types/d3-sankey": "0.12.5","happy-dom": "20.14.0","typescript": "7.0.2","vite": "8.2.2",@@ -374,6 +376,33 @@"assertion-error": "^2.0.1"}},+ "node_modules/@types/d3-path": {+ "version": "1.0.11",+ "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-1.0.11.tgz",+ "integrity": "sha512-4pQMp8ldf7UaB/gR8Fvvy69psNHkTpD/pVw3vmEi8iZAB9EPMBruB1JvHO4BIq9QkUUd2lV1F5YXpMNj7JPBpw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/d3-sankey": {+ "version": "0.12.5",+ "resolved": "https://registry.npmjs.org/@types/d3-sankey/-/d3-sankey-0.12.5.tgz",+ "integrity": "sha512-/3RZSew0cLAtzGQ+C89hq/Rp3H20QJuVRSqFy6RKLe7E0B8kd2iOS1oBsodrgds4PcNVpqWhdUEng/SHvBcJ6Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/d3-shape": "^1"+ }+ },+ "node_modules/@types/d3-shape": {+ "version": "1.3.12",+ "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-1.3.12.tgz",+ "integrity": "sha512-8oMzcd4+poSLGgV0R1Q1rOlx/xdmozS4Xab7np0eamFFUYq71AU9pOCJEFnkXW2aI/oXdVYJzw6pssbSut7Z9Q==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/d3-path": "^1"+ }+ },"node_modules/@types/deep-eql": {"version": "4.0.2","resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",@@ -826,6 +855,40 @@"node": ">=18"}},+ "node_modules/d3-array": {+ "version": "2.12.1",+ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz",+ "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "internmap": "^1.0.0"+ }+ },+ "node_modules/d3-path": {+ "version": "1.0.9",+ "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz",+ "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==",+ "license": "BSD-3-Clause"+ },+ "node_modules/d3-sankey": {+ "version": "0.12.3",+ "resolved": "https://registry.npmjs.org/d3-sankey/-/d3-sankey-0.12.3.tgz",+ "integrity": "sha512-nQhsBRmM19Ax5xEIPLMY9ZmJ/cDvd1BG3UVvt5h3WRxKg5zGRbvnteTyWAbzeSvlh3tW7ZEmq4VwR5mB3tutmQ==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "d3-array": "1 - 2",+ "d3-shape": "^1.2.0"+ }+ },+ "node_modules/d3-shape": {+ "version": "1.3.7",+ "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz",+ "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "d3-path": "1"+ }+ },"node_modules/detect-libc": {"version": "2.1.2","resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",@@ -928,6 +991,12 @@"node": ">=20.0.0"}},+ "node_modules/internmap": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz",+ "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==",+ "license": "ISC"+ },"node_modules/lightningcss": {"version": "1.33.0","resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",diff --git a/frontend/package.json b/frontend/package.jsonindex d13613e12..eb5dc5a23 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -14,9 +14,11 @@},"dependencies": {"@preact/signals": "2.11.1",+ "d3-sankey": "0.12.3","preact": "10.29.8"},"devDependencies": {+ "@types/d3-sankey": "0.12.5","happy-dom": "20.14.0","typescript": "7.0.2","vite": "8.2.2",diff --git a/frontend/src/board-analytics.ts b/frontend/src/board-analytics.tsnew file mode 100644index 000000000..3b4434411--- /dev/null+++ b/frontend/src/board-analytics.ts@@ -0,0 +1,69 @@+import { esc } from '@peach/legacy/core';++export interface RadialMetric { name:string; value:number; detail?:string }+const valid=(value:number)=>Number.isFinite(value)&&value>=0;++/** 环与读数使用同一份聚合值;max 对应完整一圈。 */+export function radialCardHtml(rows:RadialMetric[],title:string,unit='个视频') {+ const data=rows.filter(row=>valid(row.value));+ if(!data.length)return '';+ const total=data.reduce((sum,row)=>sum+row.value,0),max=Math.max(1,...data.map(row=>row.value))*1.1;+ const step=Math.min(22,110/Math.max(1,data.length)),width=Math.min(15,step*.68);+ const rings=data.map((row,index)=>{+ const radius=32+index*step,length=row.value/max*100;+ return `<g style="--ring-color:var(--board-chart-${index%6});--ring-delay:${index*60}ms"><circle class="board-ring-track" cx="160" cy="160" r="${radius}" stroke-width="${width}"/><circle class="board-ring-value" data-radial-ring="${index}" tabindex="0" role="button" aria-label="${esc(row.name)}:${row.value.toLocaleString()} ${esc(unit)}" aria-pressed="false" cx="160" cy="160" r="${radius}" stroke-width="${width}" pathLength="100" stroke-dasharray="${length} ${100-length}" style="--ring-length:${length}" transform="rotate(-90 160 160)"/></g>`;+ }).join('');+ return `<section class="board-radial-card" data-radial-card data-radial-total="${total}" data-radial-title="${esc(title)}"><header><span data-radial-label>${esc(title)}</span><b data-radial-number>${total.toLocaleString()}</b><small>${esc(unit)}</small></header><svg class="board-rings" viewBox="0 0 320 320" aria-label="${esc(title)}">${rings}</svg><div class="board-radial-tiles">${data.map((row,index)=>`<button type="button" data-radial-tile="${index}" data-radial-value="${row.value}" data-radial-name="${esc(row.name)}" aria-pressed="false" style="--ring-color:var(--board-chart-${index%6})"><span><i aria-hidden="true"></i>${esc(row.name)}</span><b>${row.value.toLocaleString()}</b>${row.detail?`<small>${esc(row.detail)}</small>`:''}</button>`).join('')}</div></section>`;+}++export function wireRadialCards(root:ParentNode) {+ root.querySelectorAll<HTMLElement>('[data-radial-card]').forEach(card=>{+ const tiles=[...card.querySelectorAll<HTMLButtonElement>('[data-radial-tile]')],rings=[...card.querySelectorAll<SVGCircleElement>('[data-radial-ring]')];+ const headline=card.querySelector<HTMLElement>('[data-radial-number]')!,label=card.querySelector<HTMLElement>('[data-radial-label]')!;+ let selected=-1,current=0,animation=0;+ const paint=(index:number)=>{+ card.dataset.radialFocus=String(index);+ tiles.forEach((tile,i)=>{tile.dataset.active=String(i===index);tile.setAttribute('aria-pressed',String(i===selected));rings[i]?.setAttribute('aria-pressed',String(i===selected));if(rings[i])rings[i]!.dataset.active=String(i===index)});+ const value=index<0?Number(card.dataset.radialTotal):Number(tiles[index]?.dataset.radialValue);+ label.textContent=index<0?card.dataset.radialTitle!:tiles[index]!.dataset.radialName!;+ cancelAnimationFrame(animation);const start=current,time=performance.now();+ const frame=(now:number)=>{const progress=matchMedia('(prefers-reduced-motion: reduce)').matches?1:Math.min(1,(now-time)/300);current=start+(value-start)*(1-(1-progress)**3);headline.textContent=Math.round(current).toLocaleString();if(progress<1)animation=requestAnimationFrame(frame)};+ animation=requestAnimationFrame(frame);+ };+ const toggle=(index:number)=>{selected=selected===index?-1:index;paint(selected)};+ [...tiles,...rings].forEach(control=>{+ const index=Number(control.getAttribute('data-radial-tile')??control.getAttribute('data-radial-ring'));+ control.addEventListener('pointerenter',()=>paint(index));control.addEventListener('pointerleave',()=>paint(selected));+ control.addEventListener('focus',()=>paint(index));control.addEventListener('blur',()=>paint(selected));control.addEventListener('click',()=>toggle(index));+ if(control instanceof SVGElement)control.addEventListener('keydown',event=>{if(event.key==='Enter'||event.key===' '){event.preventDefault();toggle(index)}});+ });+ paint(-1);+ });+}++export interface HistoryActivity { timezone?:string; days:{date:string;count:number}[]; hours:{weekday:number;hour:number;count:number}[] }+const weekdays=['周一','周二','周三','周四','周五','周六','周日'];+export function activityChartsHtml(activity:HistoryActivity|undefined) {+ if(!activity?.days?.length)return '<section class="board-activity-empty"><h3>浏览活跃时间</h3><p>还没有可用于分析的口味网站访问记录。</p></section>';+ const hours=Array.from({length:7},()=>Array<number>(24).fill(0));+ for(const item of activity.hours||[])if(Number.isInteger(item.weekday)&&item.weekday>=0&&item.weekday<7&&Number.isInteger(item.hour)&&item.hour>=0&&item.hour<24&&valid(item.count))hours[item.weekday]![item.hour]=(hours[item.weekday]![item.hour]||0)+item.count;+ const max=Math.max(1,...hours.flat()),total=hours.flat().reduce((a,b)=>a+b,0);+ const cells=hours.map((row,day)=>`<span class="board-heat-axis">${weekdays[day]}</span>${row.map((count,hour)=>`<button type="button" data-heat-value="${count}" data-heat-label="${weekdays[day]} ${hour}:00" aria-label="${weekdays[day]} ${hour}:00,${count} 次访问" style="--heat:${count?Math.max(12,count/max*100):0}%"></button>`).join('')}`).join('');+ const days=activity.days.filter(row=>/^\d{4}-\d{2}-\d{2}$/.test(row.date)&&valid(row.count)).sort((a,b)=>a.date.localeCompare(b.date));+ if(!days.length)return '';+ const end=new Date(`${days.at(-1)!.date}T00:00:00Z`),start=new Date(end);start.setUTCDate(start.getUTCDate()-90);+ const daily=new Map(days.map(row=>[row.date,row.count])),dayMax=Math.max(1,...days.map(row=>row.count));+ const calendar=Array.from({length:91},(_,index)=>{const date=new Date(start);date.setUTCDate(start.getUTCDate()+index);const key=date.toISOString().slice(0,10),count=daily.get(key)||0;return `<button type="button" data-heat-value="${count}" data-heat-label="${key}" aria-label="${key},${count} 次访问" style="--heat:${count?Math.max(12,count/dayMax*100):0}%"></button>`}).join('');+ return `<div class="board-activity-charts"><section class="board-heat-card" data-heat-card><header><h3>浏览活跃时间</h3><b data-heat-number>${total.toLocaleString()}</b><span data-heat-title data-heat-default="口味网站访问">口味网站访问</span></header><div class="board-heat-scroll"><div class="board-hour-grid"><span></span>${Array.from({length:24},(_,hour)=>`<span class="board-heat-axis">${hour%2?'':hour}</span>`).join('')}${cells}</div></div><footer>星期 × 小时<span>${esc(activity.timezone||'UTC+08:00')}</span></footer></section><section class="board-heat-card" data-heat-card><header><h3>每日活跃</h3><b data-heat-number>${days.filter(row=>row.date>=start.toISOString().slice(0,10)).reduce((sum,row)=>sum+row.count,0).toLocaleString()}</b><span data-heat-title data-heat-default="口味网站访问">口味网站访问</span></header><div class="board-day-grid">${calendar}</div><footer>${start.toISOString().slice(0,10)}<span>${days.at(-1)!.date}</span></footer></section></div>`;+}++export function wireActivityCharts(root:ParentNode) {+ root.querySelectorAll<HTMLElement>('[data-heat-card]').forEach(card=>{+ const number=card.querySelector<HTMLElement>('[data-heat-number]')!,title=card.querySelector<HTMLElement>('[data-heat-title]')!,total=number.textContent;+ card.querySelectorAll<HTMLElement>('[data-heat-value]').forEach(cell=>{+ const show=()=>{number.textContent=Number(cell.dataset.heatValue).toLocaleString();title.textContent=cell.dataset.heatLabel!};+ const reset=()=>{number.textContent=total;title.textContent=title.dataset.heatDefault!};+ cell.addEventListener('pointerenter',show);cell.addEventListener('pointerleave',reset);cell.addEventListener('focus',show);cell.addEventListener('blur',reset);+ });+ });+}diff --git a/frontend/src/board-controls.ts b/frontend/src/board-controls.tsnew file mode 100644index 000000000..bbb9cf57b--- /dev/null+++ b/frontend/src/board-controls.ts@@ -0,0 +1,54 @@+/** Board 控件的共享展示层;范围输入保留浏览器原生键盘语义。 */+export function syncBoardRange(input: HTMLInputElement) {+ const min=Number(input.min)||0,max=Number(input.max)||100,value=Number(input.value);+ const percent=max>min?Math.max(0,Math.min(100,(value-min)/(max-min)*100)):0;+ input.style.setProperty('--board-range-value',`${percent}%`);+ const group=input.closest('.dual-range');+ if(!group)return;+ const end=input.id==='durMax'?'max':'min';+ let tip=group.querySelector<HTMLElement>(`[data-range-end="${end}"]`);+ if(!tip){tip=document.createElement('output');tip.className='board-range-tip';tip.dataset.rangeEnd=end;tip.setAttribute('aria-hidden','true');group.append(tip)}+ tip.textContent=value>=max&&end==='max'?'不限':`${value} 分钟`;+ tip.style.left=`${percent}%`;+}++export function initBoardControls() {+ const scan=(root:ParentNode)=>root.querySelectorAll<HTMLInputElement>('input[type=range]').forEach(syncBoardRange);+ scan(document);+ const observer=new MutationObserver(records=>{for(const record of records)for(const node of record.addedNodes)if(node instanceof Element){if(node.matches('input[type=range]'))syncBoardRange(node as HTMLInputElement);scan(node)}});+ observer.observe(document.body,{subtree:true,childList:true});+ document.addEventListener('input',event=>{if(event.target instanceof HTMLInputElement&&event.target.type==='range')syncBoardRange(event.target)});+ const tip=document.createElement('div');tip.className='board-tooltip';tip.id='board-control-tooltip';tip.role='tooltip';tip.hidden=true;document.body.append(tip);+ let target:HTMLElement|null=null,title='',described:string|null=null,timer:ReturnType<typeof setTimeout>|undefined;+ const hide=()=>{clearTimeout(timer);tip.hidden=true;if(target){if(!target.hasAttribute('title'))target.title=title;if(described===null)target.removeAttribute('aria-describedby');else target.setAttribute('aria-describedby',described)}target=null};+ const show=(node:EventTarget|null,delay:number)=>{+ const next=node instanceof Element?node.closest<HTMLElement>('[title]'):null;+ if(!next||next===target||next.closest('.vjs-control')||!next.title.trim())return;+ hide();target=next;title=next.title;described=next.getAttribute('aria-describedby');next.removeAttribute('title');+ timer=setTimeout(()=>{if(target!==next||!next.isConnected)return;tip.textContent=title;tip.hidden=false;+ const rect=next.getBoundingClientRect(),box=tip.getBoundingClientRect();+ tip.style.left=`${Math.max(8,Math.min(innerWidth-box.width-8,rect.left+(rect.width-box.width)/2))}px`;+ tip.style.top=`${rect.top>=box.height+16?rect.top-box.height-8:Math.min(innerHeight-box.height-8,rect.bottom+8)}px`;+ next.setAttribute('aria-describedby',[described,tip.id].filter(Boolean).join(' '));+ },delay);+ };+ document.addEventListener('pointerover',event=>show(event.target,400));+ document.addEventListener('pointerout',event=>{if(target&&!target.contains(event.relatedTarget as Node|null))hide()});+ document.addEventListener('focusin',event=>show(event.target,0));+ document.addEventListener('focusout',hide);+ document.addEventListener('keydown',event=>{if(event.key==='Escape')hide()});+ document.addEventListener('scroll',hide,true);window.addEventListener('resize',hide);+}++export function wireExpandableRanks(root:ParentNode) {+ root.querySelectorAll<HTMLElement>('.tasteranks,.insightranking').forEach((list,index)=>{+ if(list.children.length<=5||list.parentElement?.hasAttribute('data-expandable-ranks'))return;+ const outer=document.createElement('div');outer.className='board-expand-ranks';outer.dataset.expandableRanks='';list.before(outer);outer.append(list);+ list.id=list.id||`board-rank-list-${index}`;list.classList.add('board-rank-list');+ const button=document.createElement('button');button.type='button';button.className='board-rank-expand';button.setAttribute('aria-controls',list.id);button.setAttribute('aria-expanded','false');button.setAttribute('aria-label','展开更多排名');button.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-chevron-down"/></svg>';outer.append(button);+ const size=()=>{const row=list.children[4] as HTMLElement;if(!list.offsetWidth)return;outer.style.setProperty('--rank-collapsed-height',`${row.offsetTop-list.offsetTop+row.offsetHeight+20}px`);outer.style.setProperty('--rank-expanded-height',`${list.scrollHeight}px`)};+ const update=()=>{const expanded=button.getAttribute('aria-expanded')==='true';outer.classList.toggle('expanded',expanded);[...list.children].forEach((child,i)=>(child as HTMLElement).inert=!expanded&&i>=5);size()};+ button.onclick=()=>{const expanded=button.getAttribute('aria-expanded')!=='true';button.setAttribute('aria-expanded',String(expanded));button.setAttribute('aria-label',expanded?'收起排名':'展开更多排名');update()};+ new ResizeObserver(size).observe(list);update();+ });+}diff --git a/frontend/src/board-sankey.ts b/frontend/src/board-sankey.tsnew file mode 100644index 000000000..f7719e763--- /dev/null+++ b/frontend/src/board-sankey.ts@@ -0,0 +1,36 @@+import { sankey, sankeyLinkHorizontal } from 'd3-sankey';+import { esc } from '@peach/legacy/core';+export interface CreatorFlow { source:string; target:string; value:number }++export function creatorSankeyHtml(rows:CreatorFlow[] = []) {+ const flows=rows.filter(row=>row.source&&row.target&&Number.isFinite(row.value)&&row.value>0);+ if(!flows.length)return '';+ const sources=[...new Set(flows.map(row=>row.source))],targets=[...new Set(flows.map(row=>row.target))];+ const graph=sankey<{id:string;name:string;side:string},{}>().nodeId(node=>node.id).nodeWidth(10).nodePadding(22).extent([[155,16],[535,404]])({+ nodes:[...sources.map(name=>({id:`source:${name}`,name,side:'source'})),...targets.map(name=>({id:`target:${name}`,name,side:'target'}))],+ links:flows.map(row=>({source:`source:${row.source}`,target:`target:${row.target}`,value:row.value})),+ });+ const total=flows.reduce((sum,row)=>sum+row.value,0),path=sankeyLinkHorizontal();+ const links=graph.links.map(link=>{+ const source=link.source as typeof graph.nodes[number],target=link.target as typeof graph.nodes[number];+ return `<path d="${path(link)}" stroke-width="${Math.max(.5,link.width||0)}" style="--flow-color:var(--board-chart-${sources.indexOf(source.name)%6})" data-flow-source="${source.index}" data-flow-target="${target.index}" data-flow-value="${link.value}" data-flow-label="${esc(source.name)} → ${esc(target.name)}" tabindex="0" role="img" aria-label="${esc(source.name)} → ${esc(target.name)}:${link.value} 条线索"/>`;+ }).join('');+ const nodes=graph.nodes.map(node=>`<g data-flow-node="${node.index}" data-flow-value="${node.value}" data-flow-label="${esc(node.name)}" tabindex="0" role="img" aria-label="${esc(node.name)}:${node.value} 条线索"><rect x="${node.x0}" y="${node.y0}" width="10" height="${Math.max(1,(node.y1||0)-(node.y0||0))}" rx="5" fill="${node.side==='source'?`var(--board-chart-${sources.indexOf(node.name)%6})`:'var(--color-text-secondary)'}"/><text x="${node.side==='source'?145:545}" y="${((node.y0||0)+(node.y1||0))/2}" text-anchor="${node.side==='source'?'end':'start'}" dominant-baseline="middle">${esc(node.name.length>18?node.name.slice(0,16)+'…':node.name)}<tspan x="${node.side==='source'?145:545}" dy="15">${node.side==='source'?node.value?.toLocaleString():((node.value||0)/total*100).toFixed(1)+'%'}</tspan></text></g>`).join('');+ return `<section class="board-sankey-card" data-sankey-card><header><h3>创作者线索来源</h3><b data-sankey-number>${total.toLocaleString()}</b><span data-sankey-label>条线索</span></header><div class="board-sankey-scroll"><svg viewBox="0 0 720 435" aria-label="来源网站与创作者线索"><g class="board-sankey-links">${links}</g><g class="board-sankey-nodes">${nodes}</g></svg></div><footer><span>来源网站</span><span>创作者 · 线索占比</span></footer></section>`;+}++export function wireCreatorSankey(root:ParentNode) {+ root.querySelectorAll<HTMLElement>('[data-sankey-card]').forEach(card=>{+ const links=[...card.querySelectorAll<SVGElement>('[data-flow-source]')],nodes=[...card.querySelectorAll<SVGElement>('[data-flow-node]')];+ const headline=card.querySelector('[data-sankey-number]')!,label=card.querySelector('[data-sankey-label]')!,total=headline.textContent;+ const reset=()=>{links.forEach(link=>link.style.opacity='');nodes.forEach(node=>node.style.opacity='');headline.textContent=total;label.textContent='条线索'};+ [...links,...nodes].forEach(element=>{+ const show=()=>{const node=element.dataset.flowNode;+ links.forEach(link=>link.style.opacity=String((node!==undefined?link.dataset.flowSource===node||link.dataset.flowTarget===node:link===element)? .7:.08));+ nodes.forEach(item=>item.style.opacity=String(node!==undefined?(item===element||links.some(link=>(link.dataset.flowSource===node&&link.dataset.flowTarget===item.dataset.flowNode)||(link.dataset.flowTarget===node&&link.dataset.flowSource===item.dataset.flowNode))?1:.3):(item.dataset.flowNode===element.dataset.flowSource||item.dataset.flowNode===element.dataset.flowTarget?1:.3)));+ headline.textContent=Number(element.dataset.flowValue).toLocaleString();label.textContent=element.dataset.flowLabel!;+ };+ element.addEventListener('pointerenter',show);element.addEventListener('pointerleave',reset);element.addEventListener('focus',show);element.addEventListener('blur',reset);+ });+ });+}diff --git a/frontend/src/islands.ts b/frontend/src/islands.tsindex 77c1063a2..413c87d40 100644--- a/frontend/src/islands.ts+++ b/frontend/src/islands.ts@@ -16,6 +16,9 @@ import { h, render } from 'preact';export { preferredDirection } from './sort-preferences';export { boundedPreference, mountNumberSetting, syncNumberSetting } from './number-setting';export { statCardBody, rankedChart, radarChart, distributionChart, jobProgressHtml } from './board-metrics';+export { initBoardControls, syncBoardRange, wireExpandableRanks } from './board-controls';+export { creatorSankeyHtml, wireCreatorSankey } from './board-sankey';+export { radialCardHtml, wireRadialCards, activityChartsHtml, wireActivityCharts } from './board-analytics';export { sidebarSectionHtml, wireSidebarGroups, transitionTheme } from './sidebar-groups';import type { Attributes, ComponentType } from 'preact';diff --git a/frontend/src/legacy/ui.d.ts b/frontend/src/legacy/ui.d.tsindex 9ae5cd897..4670ad504 100644--- a/frontend/src/legacy/ui.d.ts+++ b/frontend/src/legacy/ui.d.ts@@ -23,7 +23,7 @@ export declare function confirmModal(options: {title: string; body: string; confexport declare function selectFieldHtml(items: string[][], current: string,options?: { label?: string; attr?: string; className?: string }): string;export declare function wireSelectField(root: Element): HTMLElement & { value: string; disabled: boolean };-export declare function wireCollapse(root: ParentNode, selector: string, idPrefix: string): void;+export declare function wireCollapse(root: ParentNode, selector: string, idPrefix: string, triggerSelector?: string): void;export declare const MEDIA_SOURCE_ICONS: Record<string, string>;export declare function selectOptionIconHtml(mark?: string): string;diff --git a/frontend/test/board-analytics.test.ts b/frontend/test/board-analytics.test.tsnew file mode 100644index 000000000..9eb8ba2cb--- /dev/null+++ b/frontend/test/board-analytics.test.ts@@ -0,0 +1,32 @@+import { describe,it,expect,vi } from 'vitest';+import { radialCardHtml,wireRadialCards,activityChartsHtml,wireActivityCharts } from '../src/board-analytics';++describe('统计与口味交互图表',()=>{+ it('环形图保留零读数、排除无效值并转义库名',()=>{+ document.body.innerHTML=radialCardHtml([{name:'<库>',value:4},{name:'空库',value:0},{name:'错误',value:NaN}],'媒体库');+ expect(document.querySelectorAll('[data-radial-tile]')).toHaveLength(2);+ expect(document.querySelector('[data-radial-tile]')?.textContent).toContain('<库>');+ expect(document.querySelector('[data-radial-total]')?.getAttribute('data-radial-total')).toBe('4');+ });+ it('底部读数与对应圆环双向选择,重复点击可取消',()=>{+ vi.stubGlobal('matchMedia',()=>({matches:true}));+ document.body.innerHTML=radialCardHtml([{name:'本地',value:4},{name:'网盘',value:8}],'来源');+ wireRadialCards(document);+ const tile=document.querySelector<HTMLButtonElement>('[data-radial-tile="1"]')!,ring=document.querySelector('[data-radial-ring="1"]')!;+ tile.click();expect(tile.getAttribute('aria-pressed')).toBe('true');expect(ring.getAttribute('aria-pressed')).toBe('true');+ ring.dispatchEvent(new KeyboardEvent('keydown',{key:'Enter'}));expect(tile.getAttribute('aria-pressed')).toBe('false');+ vi.unstubAllGlobals();+ });+ it('热图使用真实读数,填充零值并排除非法坐标',()=>{+ document.body.innerHTML=activityChartsHtml({days:[{date:'2026-09-08',count:3}],hours:[{weekday:1,hour:12,count:3},{weekday:10,hour:99,count:200}]});+ expect(document.querySelectorAll('.board-hour-grid button')).toHaveLength(168);+ expect(document.querySelectorAll('.board-day-grid button')).toHaveLength(91);+ wireActivityCharts(document);+ const cell=document.querySelector<HTMLButtonElement>('[data-heat-label="周二 12:00"]')!;cell.focus();+ expect(document.querySelector('[data-heat-number]')?.textContent).toBe('3');+ expect(document.querySelector('[data-heat-title]')?.textContent).toBe('周二 12:00');+ });+ it('没有历史时给出空态,不生成假活动',()=>{+ expect(activityChartsHtml(undefined)).toContain('还没有');expect(activityChartsHtml(undefined)).not.toContain('data-heat-value');+ });+});diff --git a/frontend/test/board-controls.test.ts b/frontend/test/board-controls.test.tsnew file mode 100644index 000000000..6e3868d66--- /dev/null+++ b/frontend/test/board-controls.test.ts@@ -0,0 +1,21 @@+import { describe,it,expect } from 'vitest';+import { syncBoardRange, wireExpandableRanks } from '../src/board-controls';++describe('范围控件',()=>{+ it('折叠排名退出键盘导航,展开后恢复,重复接线不重复按钮',()=>{+ document.body.innerHTML='<div class="tasteranks">'+Array.from({length:7},()=>'<button>排名</button>').join('')+'</div>';+ wireExpandableRanks(document);wireExpandableRanks(document);+ const toggle=document.querySelector<HTMLButtonElement>('.board-rank-expand')!;+ const sixth=document.querySelector('.board-rank-list')!.children[5] as HTMLElement;+ expect(document.querySelectorAll('.board-rank-expand')).toHaveLength(1);+ expect(sixth.inert).toBe(true);toggle.click();expect(sixth.inert).toBe(false);+ expect(toggle.getAttribute('aria-expanded')).toBe('true');toggle.click();expect(sixth.inert).toBe(true);+ });+ it('两个端点分别保留数值与不限状态,重复接线不增加气泡',()=>{+ document.body.innerHTML='<div class="dual-range"><input id="durMin" type="range" min="0" max="180" value="20"><input id="durMax" type="range" min="0" max="180" value="180"></div>';+ const inputs=[...document.querySelectorAll('input')];inputs.forEach(syncBoardRange);inputs.forEach(syncBoardRange);+ expect(document.querySelectorAll('output')).toHaveLength(2);expect(document.querySelector('[data-range-end="min"]')?.textContent).toBe('20 分钟');+ expect(document.querySelector('[data-range-end="max"]')?.textContent).toBe('不限');+ inputs[1]!.value='60';syncBoardRange(inputs[1]!);expect(document.querySelector('[data-range-end="max"]')?.textContent).toBe('60 分钟');+ });+});diff --git a/frontend/test/board-sankey.test.ts b/frontend/test/board-sankey.test.tsnew file mode 100644index 000000000..52d15571e--- /dev/null+++ b/frontend/test/board-sankey.test.ts@@ -0,0 +1,20 @@+import { describe, it, expect } from 'vitest';+import { creatorSankeyHtml, wireCreatorSankey } from '../src/board-sankey';++describe('创作者线索流向',()=>{+ it('同名来源与创作者独立计量,聚焦联动并恢复总量',()=>{+ document.body.innerHTML=creatorSankeyHtml([{source:'alice',target:'alice',value:3},{source:'site',target:'alice',value:2}]);+ wireCreatorSankey(document);+ expect(document.querySelectorAll('[data-flow-node]')).toHaveLength(3);+ expect(document.querySelector('[data-sankey-number]')?.textContent).toBe('5');+ const link=document.querySelector<SVGElement>('[data-flow-source]')!;+ expect(link.getAttribute('d')).not.toMatch(/NaN|undefined/);+ link.dispatchEvent(new Event('focus'));+ expect(document.querySelector('[data-sankey-number]')?.textContent).toBe('3');+ link.dispatchEvent(new Event('blur'));+ expect(document.querySelector('[data-sankey-number]')?.textContent).toBe('5');+ });+ it('无有效计数时不绘制虚构流量',()=>{+ expect(creatorSankeyHtml([{source:'a',target:'b',value:NaN},{source:'a',target:'b',value:0}])).toBe('');+ });+});diff --git a/src/peach/taste_history.py b/src/peach/taste_history.pyindex faee23222..919e4b85e 100644--- a/src/peach/taste_history.py+++ b/src/peach/taste_history.py@@ -583,7 +583,7 @@ def _history_dashboard_evidence(store_path: Path, since: str | None) -> dict[strempty = {"visits": 0, "sources": [], "range_start": None, "range_end": None,"tags": Counter(), "creators": Counter(), "categories": Counter(),- "domains": Counter(), "creator_domains": {},+ "domains": Counter(), "creator_domains": {}, "activity": {"days": [], "hours": []},}if not store_path.is_file():return empty@@ -617,6 +617,8 @@ def _history_dashboard_evidence(store_path: Path, since: str | None) -> dict[strrange_start: str | None = Nonerange_end: str | None = Nonevisits = 0+ activity_days: Counter[str] = Counter()+ activity_hours: Counter[tuple[int, int]] = Counter()for row in rows:visited_at, url = str(row["visited_at"]), str(row["url"])try:@@ -632,6 +634,12 @@ def _history_dashboard_evidence(store_path: Path, since: str | None) -> dict[strdomain, row_tags, row_creators = _url_candidates(url)if domain and _is_taste_domain(domain):domains[domain] += 1+ moment = datetime.fromisoformat(visited_at)+ if moment.tzinfo is None:+ moment = moment.replace(tzinfo=UTC)+ moment = moment.astimezone(HONG_KONG_TIMEZONE)+ activity_days[moment.date().isoformat()] += 1+ activity_hours[(moment.weekday(), moment.hour)] += 1tags.update(row_tags)creators.update(row_creators)if domain:@@ -652,6 +660,12 @@ def _history_dashboard_evidence(store_path: Path, since: str | None) -> dict[str"creator_domains": creator_domains,"categories": categories,"domains": domains,+ "activity": {+ "timezone": "UTC+08:00",+ "days": [{"date": day, "count": count} for day, count in sorted(activity_days.items())],+ "hours": [{"weekday": day, "hour": hour, "count": count}+ for (day, hour), count in sorted(activity_hours.items())],+ },}@@ -986,6 +1000,15 @@ def build_taste_dashboard(analysis = _taste_analysis(history, peach, all_tags, all_creators, _tag_inventory(ledger_connection),)+ creator_flows: Counter[tuple[str, str]] = Counter()+ top_creators = {name.casefold().strip() for name, _ in history["creators"].most_common(8)}+ top_domains = {name for name, _ in history["domains"].most_common(6)}+ for creator, domains in history["creator_domains"].items():+ for domain, count in domains.items():+ if not _is_taste_domain(domain):+ continue+ creator_flows[(domain if domain in top_domains else "其他网站",+ creator if creator in top_creators else "其他创作者")] += countreturn {"summary": {"history_visits": history["visits"],@@ -998,7 +1021,12 @@ def build_taste_dashboard("range_end": history["range_end"],},"sources": history["sources"],+ "activity": history["activity"],+ "creator_flows": [{"source": source, "target": target, "value": count}+ for (source, target), count in creator_flows.most_common()],"rankings": {+ "browser_categories": [{"name": name, "score": score}+ for name, score in history["categories"].most_common(20)],"categories": [{"name": name, "score": score}for name, score in category_scores.most_common(20)],"tags": tags,diff --git a/src/peach/web_stats.py b/src/peach/web_stats.pyindex cb5754808..849f68d8a 100644--- a/src/peach/web_stats.py+++ b/src/peach/web_stats.py@@ -17,6 +17,7 @@ import timefrom datetime import UTC, datetime, timedeltafrom .catalog_rules import tag_cat+from . import media_libraries, settings_filefrom .config import LOCATION_ROOT_DECLARATIONSfrom .platform import is_unmapped, root_online, system_volume, translate_ledger_pathfrom .taste_history import (@@ -41,7 +42,7 @@ def q_search_history(contract: WebContract, limit: int = 10):return {"items": [row["query"] for row in rows]}-TASTE_WINDOWS = {"all": None, "90d": 90, "365d": 365}+TASTE_WINDOWS = {"all": None, "7d": 7, "30d": 30, "90d": 90, "365d": 365}def _taste_since(window: str) -> str | None:@@ -224,6 +225,16 @@ def q_stats(contract: WebContract):out["by_medium"] = [dict(r) for r in c.execute("SELECT medium k, count(*) n, COALESCE(sum(size),0) bytes ""FROM asset GROUP BY medium ORDER BY bytes DESC")]+ config = settings_file.active()+ out["by_library"] = []+ for library in media_libraries.libraries(config):+ clause, params = media_libraries.predicate(config, library["id"])+ counts = c.execute(+ "SELECT count(*) videos,COALESCE(sum(a.size),0) bytes FROM asset a "+ "WHERE a.medium='video' AND " + clause, params,+ ).fetchone()+ out["by_library"].append({"k": library["id"], "name": library["name"],+ "icon": library["icon"], **dict(counts)})v = c.execute("SELECT count(*) FROM asset WHERE medium='video'").fetchone()[0]def one(sql, *a):r = c.execute(sql, a).fetchone()diff --git a/tests/test_taste_history.py b/tests/test_taste_history.pyindex e024ef1aa..4352ff6f5 100644--- a/tests/test_taste_history.py+++ b/tests/test_taste_history.py@@ -258,6 +258,12 @@ class TasteHistoryTests(unittest.TestCase):future = build_taste_dashboard(store, db, since="2099-01-01T00:00:00+00:00")self.assertEqual(dashboard["summary"]["history_visits"], 2)+ self.assertEqual(dashboard["activity"]["days"], [{"date": "2023-11-15", "count": 2}])+ self.assertEqual(dashboard["activity"]["hours"], [{"weekday": 2, "hour": 6, "count": 2}])+ self.assertEqual(dashboard["creator_flows"], [{"source": "onlyfans.com", "target": "alice", "value": 1}])+ self.assertEqual(future["activity"]["days"], [])+ self.assertEqual(future["creator_flows"], [])+ self.assertEqual(future["rankings"]["browser_categories"], [])self.assertGreater(dashboard["summary"]["history_sources"], 0)self.assertEqual(future["summary"]["history_visits"], 0)self.assertEqual(future["summary"]["history_sources"], dashboard["summary"]["history_sources"])diff --git a/web/app.js b/web/app.jsindex 6a54105b3..4e8e65fa9 100644--- a/web/app.js+++ b/web/app.js@@ -2,7 +2,8 @@ import { resourceScanHtml, boundedPreference, mountNumberSetting, syncNumberSettimport {$, ENTITY_ROUTES, LOC, ROUTE_ENTITIES, ROUTE_STATES, SITE_FAVICONS, STATE_LABELS, STATE_ROUTES, api, isAbort, mapLimit, brandIcon, entityPath, esc, faviconFallbackUrl, faviconUrl, linkHost, linkMarkUrl, fmtClock, fmtDur, fmtSize, foldName, icon, isCatalogPath, realDuration} from './js/core.js';import { faceFrame } from './js/face-frame.js';import { MEDIA_SOURCE_ICONS } from './js/media-source-icons.js';-import { boardPageSkeleton } from './dist/peach-ui.js';+import { boardPageSkeleton, initBoardControls, syncBoardRange, wireExpandableRanks, creatorSankeyHtml, wireCreatorSankey } from './dist/peach-ui.js';+import { radialCardHtml, wireRadialCards, activityChartsHtml, wireActivityCharts } from './dist/peach-ui.js';import { imageFallbackAttrs, wireImageFallbacks } from './js/image-fallback.js';import { javDisplayName, javTitleHtml } from './js/jav-title.js';import { matchRoute, routeLabel } from './js/routes.js';@@ -20,6 +21,7 @@ import {} from './js/ui-components.js';initMiddleTruncate(document);+if(localStorage.getItem('peach.legacy-ui')!=='true')initBoardControls();wireBusyActions(document);attachOverlayScrollbar(document.documentElement,{variant:'page'});attachOverlayScrollbar($('#drawerScroll'));@@ -664,30 +666,37 @@ const toast=(message,{timeout=6000,warn=false,action=null}={})=>{const root=$('#toasts');const item=document.createElement('div');item.className='toast'+(warn?' warn':'');+ const board=localStorage.getItem('peach.legacy-ui')!=='true';const initial=toastBody(message);const paint=(body,alert)=>{item.classList.toggle('warn',!!alert);- item.innerHTML=`${alert?icon('alert'):''}<p>${body}</p>${+ item.setAttribute('role',alert?'alert':'status');+ item.innerHTML=`${board?`<span class="board-notification-icon" aria-hidden="true">${icon(alert?'alert':'check')}</span>`:alert?icon('alert'):''}<p>${body}</p>${action&&!alert&&body===initial?`<button class="tact">${esc(action.label)}</button>`:''}<button class="tclose" title="关闭" aria-label="关闭提示">${icon('x')}</button>`;item.querySelector('.tclose').onclick=close;const act=item.querySelector('.tact');if(act)act.onclick=()=>{setActionBusy(act);action.run()};};- let timer=null;+ let timer=null,remaining=timeout,started=0,hovered=false,focused=false;/* 收起前先把当前高度写死再过渡到 0。直接 remove() 会让这一格瞬间消失,栈里剩下的 toast 一次跳过来,正是撤销那一下最明显的抖动。 */const close=()=>{clearTimeout(timer);item.style.height=`${item.offsetHeight}px`;item.getBoundingClientRect();item.classList.add('leaving');setTimeout(()=>item.remove(),200)};- const arm=()=>{if(timeout)timer=setTimeout(close,timeout)};+ const arm=()=>{if(timeout&&!hovered&&!focused&&timer===null){started=Date.now();timer=setTimeout(close,remaining)}};+ const pause=()=>{if(timer!==null){clearTimeout(timer);timer=null;remaining=Math.max(0,remaining-(Date.now()-started))}};+ const progress=()=>{if(board&&timeout){const bar=document.createElement('span');bar.className='board-notification-timer';bar.setAttribute('aria-hidden','true');bar.style.setProperty('--notification-duration',`${timeout}ms`);item.append(bar)}};/* 结果就写在同一条 toast 上。「关掉回执 + 另发一条已撤销」会让两条在同一个底部对齐的栈里一进一出,看上去就是整块跳了一下。 */item.replaceMessage=(body,{warn:alert=false,timeout:next=4000}={})=>{- clearTimeout(timer);paint(toastBody(body),alert);timeout=next;arm()};+ clearTimeout(timer);timer=null;paint(toastBody(body),alert);timeout=next;remaining=next;progress();arm()};paint(initial,warn);- item.addEventListener('mouseenter',()=>clearTimeout(timer));- item.addEventListener('mouseleave',arm);+ progress();+ item.addEventListener('mouseenter',()=>{hovered=true;pause()});+ item.addEventListener('mouseleave',()=>{hovered=false;arm()});+ item.addEventListener('focusin',()=>{focused=true;pause()});+ item.addEventListener('focusout',event=>{focused=item.contains(event.relatedTarget);arm()});root.prepend(item);arm();while(root.children.length>4)root.lastElementChild.remove();return item;@@ -3397,8 +3406,7 @@ async function openStats(push=true){</div><section class="insightdetail"><div id="stats-detail-inventory" role="tabpanel" data-stats-detail="inventory" class="insightdetailbody">- <div class="insightcopy"><span>库存</span>${distributionChart(d.by_loc.map(row=>({name:LOC[row.k]||row.k,score:row.videos})),'视频分布')}</div>- <div class="insightvisual">${totalVideos?locationRows:catalogEmptyHtml({configurable:runtimeConfigurable})}</div></div>+ ${totalVideos?`<div class="board-inventory-charts">${radialCardHtml(d.by_loc.map(row=>({name:LOC[row.k]||row.k,value:row.videos,detail:gb(row.bytes)})),'网盘与本地')}${radialCardHtml((d.by_library||[]).map(row=>({name:row.name,value:row.videos,detail:gb(row.bytes)})),'媒体库')}</div>`:catalogEmptyHtml({configurable:runtimeConfigurable})}</div><div id="stats-detail-viewing" role="tabpanel" data-stats-detail="viewing" class="insightdetailbody" hidden><div class="insightcopy"><span>观看</span><h2>${cs.played.toLocaleString()}</h2><b>个作品有播放记录</b><p>累计 ${hrs(cs.play_seconds)}</p></div>@@ -3427,6 +3435,8 @@ async function openStats(push=true){</section></div>`;const statsRoot=$('#stats');+ wireRadialCards(statsRoot);+ if(localStorage.getItem('peach.legacy-ui')!=='true')wireExpandableRanks(statsRoot);statsRoot.querySelectorAll('[data-stats-metric]').forEach(button=>button.onclick=()=>{statsRoot.querySelectorAll('[data-stats-metric]').forEach(tab=>{const selected=tab===button;tab.setAttribute('aria-selected',String(selected));tab.tabIndex=selected?0:-1});@@ -3625,8 +3635,8 @@ async function openResourceSync(push=true){/* 口味仪表按窗口持久缓存:刷新页面也先显示上次结果。24 小时内不重读;过期后仍先显示旧结果,再在后台更新。导入、移除数据源和显式「读取」会立即写回缓存。缓存只含页面已经展示的聚合结果,不含原始历史。 */-const TASTE_CACHE_KEY='peach-taste-dashboard-v3',TASTE_CACHE_FRESH_MS=24*60*60*1000;-const TASTE_CACHE_WINDOWS=new Set(['all','365d','90d']);+const TASTE_CACHE_KEY='peach-taste-dashboard-v6',TASTE_CACHE_FRESH_MS=24*60*60*1000;+const TASTE_CACHE_WINDOWS=new Set(['all','365d','90d','30d','7d']);function readTasteCache(){try{const stored=JSON.parse(localStorage.getItem(TASTE_CACHE_KEY)||'{}');@@ -3635,7 +3645,7 @@ function readTasteCache(){entry.dashboard&&typeof entry.dashboard==='object'))}catch(_error){return new Map()}}-const TASTE_WINDOWS=[['all','全部时间'],['365d','最近一年'],['90d','最近 90 天']];+const TASTE_WINDOWS=[['7d','最近 7 天'],['30d','最近 30 天'],['90d','最近 90 天'],['365d','最近一年'],['all','全部时间']];let tasteWindow='all',tasteEvidence='browser',tasteDimension={browser:'tags',peach:'tags'};let tasteCache=readTasteCache(),tasteRequest=0;function tasteCacheSet(window,dashboard){@@ -3711,7 +3721,7 @@ function renderTaste(d){<button data-taste-remove="${source.source_key}" title="移除分析记录" aria-label="移除 ${esc(source.profile)}">${icon('trash')}</button></div>`).join('');const gapRows=(d.gaps||[]).map(row=>({...row,evidence:['浏览记录']}));const domainRows=(rank.domains||[]).map(row=>({name:row.name,score:row.visits}));- const categoryRows=(rank.categories||[]).map(row=>({name:row.name,score:row.score}));+ const categoryRows=(rank.browser_categories||[]).map(row=>({name:row.name,score:row.score}));const categoryBars=categoryRows.length?rankedChart(categoryRows,'口味维度排名'):emptyStateHtml('search','暂无口味维度','采集浏览记录后,这里会显示聚合后的口味证据。');const rankPanel=(source,key,rows,kind='',empty='暂无足够证据',visual='')=>`<div id="taste-${source}-${key}" role="tabpanel"@@ -3725,7 +3735,7 @@ function renderTaste(d){<label><input type="radio" name="taste-evidence" value="browser"${tasteEvidence==='browser'?' checked':''}><span>浏览器记录</span></label><label><input type="radio" name="taste-evidence" value="peach"${tasteEvidence==='peach'?' checked':''}><span>Peach 内部</span></label></div><div class="tasteactions">${selectFieldHtml(TASTE_WINDOWS,d.window||tasteWindow,{label:'分析范围',attr:'data-taste-window'})}- <div class="splitbutton" data-taste-history-menu>+ <div class="splitbutton board-button-group" data-taste-history-menu><button class="splitmain" data-taste-refresh title="读取运行 Peach 的这台电脑上的浏览记录">${icon('compass')}读取浏览器历史</button><button type="button" class="splittoggle" data-taste-history-toggle aria-haspopup="menu"aria-expanded="false" aria-controls="tasteHistoryMenu"@@ -3758,6 +3768,7 @@ function renderTaste(d){${coverageMetric('有身份',Number(coverage.identified||0).toLocaleString(),`${coverage.unidentified||0} 项待补`,coverage.identified||0,(coverage.identified||0)+(coverage.unidentified||0))}</div></section>${tasteAnalysisSection(d.analysis)}+ <div data-taste-evidence-panel="browser"${tasteEvidence==='browser'?'':' hidden'}>${activityChartsHtml(d.activity)}${creatorSankeyHtml(d.creator_flows)}</div><section class="insightpanel tasteanalysis" data-taste-evidence-panel="browser"${tasteEvidence==='browser'?'':' hidden'}><header>${sourceTabs('browser',[['tags','标签'],['creators','创作者'],['domains','常访问网站'],['gaps','浏览候选']])}</header><div class="insightpanelbody">@@ -3777,6 +3788,9 @@ function renderTaste(d){<div class="insightpanelbody"><div>${sourceRows||emptyStateHtml('database','还没有数据源','导入或读取浏览记录后,这里会列出已采集设备。')}</div></div></section></div>`;const root=$('#stats'),stateEl=root.querySelector('[data-taste-state]'),file=root.querySelector('[data-taste-file]');+ wireActivityCharts(root);+ wireCreatorSankey(root);+ if(localStorage.getItem('peach.legacy-ui')!=='true')wireExpandableRanks(root);wireTasteHistoryGuide(root,localStorage);root.querySelectorAll('input[name="taste-evidence"]').forEach(input=>input.onchange=()=>{tasteEvidence=input.value;@@ -5501,9 +5515,9 @@ function followAuthorBlock(group){const sourceRows=group.map(source=>followSourceRow(source,!legacy)).join('');const sources=localStorage.getItem('peach.legacy-ui')==='true'?scrollerHtml(sourceRows,{className:'fauthorsources',label:`${name} 的关注来源`})- :`<div class="fauthorsources" id="follow-author-${group[0].id}" aria-label="${esc(name)} 的关注来源"${collapsed?' hidden':''}>${sourceRows}</div>`;- return `<div class="fauthor${bad?' bad':''}">- <div class="fauthorhead">${followAuthorAvatar(group)}+ :`<div class="fauthorsources" id="follow-author-${group[0].id}" aria-label="${esc(name)} 的关注来源">${sourceRows}</div>`;+ return `<${legacy?'div':'details'} class="fauthor${bad?' bad':''}"${!legacy&&!collapsed?' open':''}>+ <${legacy?'div':'summary'} class="fauthorhead">${followAuthorAvatar(group)}<b>${esc(name)}</b><button type="button" class="frowicon" data-follow-check="" data-follow-sources="${group.filter(s=>s.enabled).map(s=>s.id).join(',')}"${group.some(s=>s.enabled)?'':'disabled'} title="检查此作者" aria-label="检查 ${esc(name)} 的全部来源">${icon('refresh-cw')}</button>@@ -5511,19 +5525,18 @@ function followAuthorBlock(group){? group.map(source=>sourceIcon(source.provider)).join(''): sourceIcon(group[0].provider)+esc(group[0].provider_label)}</span>${bad?`<span class="fmeta warn">${bad} 个失败</span>`:''}- ${legacy?'':`<button type="button" class="frowicon board-author-toggle" data-follow-author-toggle="${esc(key)}" aria-controls="follow-author-${group[0].id}" aria-expanded="${!collapsed}" aria-label="${collapsed?'展开':'收起'} ${esc(name)} 的来源">${icon('chevron-down')}</button>`}- </div>- ${sources}</div>`;+ ${legacy?'':`<span class="board-author-actions"><button type="button" class="fbtn small" data-follow-author-select aria-pressed="false" aria-label="全选 ${esc(name)} 的来源">全选该作者</button><button type="button" class="frowicon board-author-toggle" data-follow-author-toggle="${esc(key)}" aria-controls="follow-author-${group[0].id}" aria-expanded="${!collapsed}" aria-label="${collapsed?'展开':'收起'} ${esc(name)} 的来源">${icon('chevron-down')}</button></span>`}+ </${legacy?'div':'summary'}>+ ${sources}</${legacy?'div':'details'}>`;}const followSourceSelection=new Set();function followSourceRow(source,selectable=false){const state=source.last_status||'未检查';const bad=state==='error'||state==='unauthorized';- /* 状态用 Geist 的低饱和徽章(取证 vercel-geist-semantics-measured.md):- 行级状态不上实底彩色,ok 绿 tint、失败红 tint、未检查灰。 */- const badge=state==='ok'?'ok':bad?'error':'none';- const stateTitle=source.history_exhausted?'没有更多历史内容':state;+ const badge=!source.enabled?'none':state==='ok'?'ok':bad?'error':'none';+ const stateTitle=source.history_exhausted?'没有更多':!source.enabled?'已暂停':state==='ok'?'正常':bad?'检查失败':'未检查';+ const statusChip=`<span class="sbadge ${badge}" title="${esc(stateTitle)}"><i aria-hidden="true"></i><span>${esc(stateTitle)}</span></span>`;return `<div class="frow fsource${bad?' bad':''}${source.enabled?'':' disabled'}">${selectable?`<label class="fchannelcheck">${checkboxHtml(`data-follow-select="${source.id}" ${followSourceSelection.has(source.id)?'checked':''} aria-label="选择 ${esc(source.label)}"`)}</label>`:`<label class="fchannelcheck" title="${source.enabled?'参与检查更新':'暂停检查更新'}">${checkboxHtml(`data-follow-enabled="${source.id}" ${source.enabled?'checked':''}`@@ -5531,10 +5544,9 @@ function followSourceRow(source,selectable=false){<b><a class="fsourcelink externallink" href="${esc(source.url)}" target="_blank"rel="noreferrer noopener" title="打开原来源">${esc(source.label)}${icon('external-link','externalmark')}</a></b><span class="fmeta fprovider" title="${esc(source.provider_label)}">${sourceIcon(source.provider)- }<span>${esc(source.provider_label)}</span></span>+ }<span>${esc(source.provider_label)}</span>${selectable?statusChip:''}</span><span class="fmeta fchecked">${source.last_checked_at?localTimeHtml(source.last_checked_at):'未检查'}</span>- <span class="sbadge ${badge}" title="${esc(stateTitle)}"><i aria-hidden="true"></i>- ${source.history_exhausted?'<span>没有更多</span>':''}</span>+ ${selectable?'':statusChip}<span class="fsourceactions"><button class="frowicon" data-follow-check="${source.id}" title="检查更新"${source.enabled?'':'disabled'}@@ -5641,8 +5653,11 @@ function setFollowListLayout(value){root.querySelectorAll('.fsources').forEach(node=>node.dataset.layout=followListLayout());root.querySelectorAll('[data-follow-author-toggle]').forEach(button=>{const expanded=value==='compact'||!collapsedFollowAuthors.has(button.dataset.followAuthorToggle);- button.setAttribute('aria-expanded',String(expanded));- root.querySelector(`#${button.getAttribute('aria-controls')}`).hidden=!expanded;+ if((button.getAttribute('aria-expanded')==='true')!==expanded){+ const wasCollapsed=collapsedFollowAuthors.has(button.dataset.followAuthorToggle);+ button.click();+ if(wasCollapsed)collapsedFollowAuthors.add(button.dataset.followAuthorToggle);else collapsedFollowAuthors.delete(button.dataset.followAuthorToggle);+ }});}@@ -5790,11 +5805,11 @@ function wireFollowItems(){function wireFollowManage(creds=[]){void wireResolveProgress();const root=$('#stats'),form=root.querySelector('#followAdd');- root.querySelectorAll('[data-follow-author-toggle]').forEach(button=>button.onclick=()=>{- const expanded=button.getAttribute('aria-expanded')!=='true';- button.setAttribute('aria-expanded',String(expanded));+ wireCollapse(root,'details.fauthor','follow-author-collapse','[data-follow-author-toggle]');+ root.querySelectorAll('[data-follow-author-toggle]').forEach(button=>button.onclick=event=>{+ event.stopPropagation();+ const expanded=button.getAttribute('aria-expanded')==='true';button.setAttribute('aria-label',button.getAttribute('aria-label').replace(/^(展开|收起)/,expanded?'收起':'展开'));- root.querySelector(`#${button.getAttribute('aria-controls')}`).hidden=!expanded;if(expanded)collapsedFollowAuthors.delete(button.dataset.followAuthorToggle);else collapsedFollowAuthors.add(button.dataset.followAuthorToggle);});const selectable=[...root.querySelectorAll('[data-follow-select]')];@@ -5806,8 +5821,17 @@ function wireFollowManage(creds=[]){if(all){all.checked=ids.length>0&&ids.length===selectable.length;all.indeterminate=ids.length>0&&ids.length < selectable.length}root.querySelectorAll('[data-follow-selection-action]').forEach(button=>{button.disabled=!ids.length||!!followRuntime?.ledger_read_only;if(button.hasAttribute('data-follow-check'))button.dataset.followSources=ids.join(',')});selectable.forEach(field=>field.closest('.fsource').classList.toggle('selected',field.checked));+ root.querySelectorAll('[data-follow-author-select]').forEach(button=>{+ const fields=[...button.closest('.fauthor').querySelectorAll('[data-follow-select]')],count=fields.filter(field=>field.checked).length;+ button.textContent=count===fields.length?'取消全选':'全选该作者';button.setAttribute('aria-pressed',count===fields.length?'true':count?'mixed':'false');+ });};selectable.forEach(field=>field.onchange=()=>{const id=Number(field.dataset.followSelect);if(field.checked)followSourceSelection.add(id);else followSourceSelection.delete(id);syncSelection()});+ root.querySelectorAll('[data-follow-author-select]').forEach(button=>button.onclick=event=>{+ event.preventDefault();event.stopPropagation();+ const fields=[...button.closest('.fauthor').querySelectorAll('[data-follow-select]')],checked=!fields.every(field=>field.checked);+ fields.forEach(field=>{field.checked=checked;const id=Number(field.dataset.followSelect);if(checked)followSourceSelection.add(id);else followSourceSelection.delete(id)});syncSelection();+ });const selectAll=root.querySelector('[data-follow-select-all]');if(selectAll)selectAll.onchange=()=>{selectable.forEach(field=>{field.checked=selectAll.checked;const id=Number(field.dataset.followSelect);if(field.checked)followSourceSelection.add(id);else followSourceSelection.delete(id)});syncSelection()};root.querySelectorAll('[data-follow-selection-enabled]').forEach(button=>button.onclick=async()=>{@@ -6816,7 +6840,7 @@ function wirePhotoZoom(box, main){if(!img?.naturalWidth||!img.naturalHeight)return 100;return Math.min(100,img.offsetWidth/img.naturalWidth*100,img.offsetHeight/img.naturalHeight*100)};- const show=percent=>{const value=Math.round(percent);slider.value=value;label.textContent=value+'%'};+ const show=percent=>{const value=Math.round(percent);slider.value=value;label.textContent=value+'%';syncBoardRange(slider)};const apply=raw=>{const fit=fitPercent();const percent=raw==='fit'?fit:Math.min(PHOTO_ZOOM_MAX,Math.max(PHOTO_ZOOM_MIN,Number(raw)||fit));@@ -6900,7 +6924,7 @@ async function openPhotoLightbox(index,source=null){const box=document.createElement('div');box.className='photolight'+(items.length>1?' has-strip':'');box.innerHTML=`<button class="media-circle media-overlay photoclose" type="button" aria-label="关闭">${icon('x')}</button>- <div class="swiper photomain"><div class="swiper-wrapper">${items.map(item=>+ <div class="swiper photomain" role="region" aria-roledescription="轮播" aria-label="图片浏览"><div class="swiper-wrapper">${items.map(item=>`<div class="swiper-slide"><div class="swiper-zoom-container"><img src="${esc(item.src)}"alt="${esc(item.name)}" loading="lazy" referrerpolicy="no-referrer"></div></div>`).join('')}</div><button class="media-circle media-overlay photonav back" type="button" aria-label="上一张">${icon('chevron-left')}</button>@@ -6909,7 +6933,7 @@ async function openPhotoLightbox(index,source=null){<button class="photodetailtoggle" type="button" aria-expanded="false" aria-controls="photoDetail"aria-haspopup="dialog"aria-label="图片详情" title="图片详情">${icon('info')}</button>- <div class="photocount mono" aria-live="polite">${index+1} / ${items.length}</div>+ <div><div class="photocount mono" aria-live="polite">${index+1} / ${items.length}</div>${items.length>1?'<div class="board-carousel-pagination" aria-label="选择图片"></div>':''}</div><div class="photozoom"><button type="button" data-zoom-step="-1" aria-label="缩小">${icon('zoom-out')}</button><input type="range" min="${PHOTO_ZOOM_MIN}" max="${PHOTO_ZOOM_MAX}" step="1" value="100" aria-label="缩放">@@ -6938,6 +6962,7 @@ async function openPhotoLightbox(index,source=null){// 上下滚也翻页:看图时手在滚轮上,没人愿意为了换一张去够左右键或按钮。mousewheel:{enabled:true,forceToAxis:false},thumbs:{swiper:strip},+ pagination:localStorage.getItem('peach.legacy-ui')==='true'?undefined:{el:box.querySelector('.board-carousel-pagination'),clickable:true,dynamicBullets:true,dynamicMainBullets:3,renderBullet:(at,className)=>`<button type="button" class="${className}" aria-label="查看第 ${at+1} 张图片"></button>`},navigation:{prevEl:box.querySelector('.photonav.back'),nextEl:box.querySelector('.photonav.fwd')},on:{slideChange(){counter.textContent=`${this.activeIndex+1} / ${items.length}`;centerThumb(this.activeIndex)}}});diff --git a/web/board.css b/web/board.cssindex 89ba9e851..6046c23f8 100644--- a/web/board.css+++ b/web/board.css@@ -223,7 +223,7 @@ body::before{display:none}.settingscard .board-number-error:not(:empty){position:absolute;z-index:10;right:0;top:calc(100% + 6px);width:max-content;max-width:240px;padding:6px 10px;background:var(--ground);border:1px solid color-mix(in srgb,var(--error,#e5484d) 35%,var(--line));border-radius:8px;box-shadow:0 4px 14px #0002;color:var(--error,#e5484d);font-size:12px;line-height:18px;margin:0}.settingscard .board-number-error[hidden]{display:none}.settingscard .board-optional-number{position:relative}-.ptoggle{width:42px;height:24px;background:var(--surface);border:0;border-radius:999px;transition:background .2s}+.ptoggle{width:42px;height:24px;background:var(--color-background-tertiary-default);border:0;border-radius:999px;transition:background .2s}.ptoggle::after{width:18px;height:18px;top:3px;left:3px;background:linear-gradient(#fff 44%,#f3f3f3);box-shadow:0 3px 3px #00000008;transition:transform .2s;transform:none}.ptoggle::before{content:'';position:absolute;z-index:1;left:8.25px;top:8.25px;width:7.5px;height:7.5px;border-radius:50%;background:var(--surface);box-shadow:inset 0 0 0 .375px var(--line);transition:transform .2s}.ptoggle:checked{background:linear-gradient(#3986ff,#1760ef);box-shadow:inset 0 1.5px 0 #ffffff40,inset 0 0 0 .75px #3986ff}@@ -346,7 +346,7 @@ button,input,select,textarea{font-family:inherit}.board-theme-toggle.is-dark .board-theme-thumb{transform:translateX(36px)}@media(min-width:761px){.drawer:not(.open) .board-sidebar-foot{flex-direction:column;padding:12px 10px}.drawer:not(.open) .board-theme-toggle{padding:2px;background:transparent}.drawer:not(.open) .board-theme-toggle button[aria-pressed=true],.drawer:not(.open) .board-theme-thumb{display:none}}@media(prefers-reduced-motion:reduce){.board-theme-thumb{transition:none}}-.drawer .sec[data-sidebar-group]{border:0;padding:0;margin:20px 0 0}+.drawer .sec[data-sidebar-group]{border:0;padding:0;margin:4px 0 0}.drawer .sec[data-sidebar-group]>h3{margin:0 0 4px;letter-spacing:0;text-transform:none;color:var(--muted);font-size:14px;line-height:20px;font-weight:400;gap:4px}.board-section-toggle{display:flex;align-items:center;gap:8px;flex:1;min-width:0;padding:8px;border:0;border-radius:10px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.board-section-toggle:hover{background:var(--hover)}@@ -501,3 +501,58 @@ body button.danger:not(.frowicon):hover:not(:disabled){filter:brightness(.95)}.drawer .sec[data-sidebar-group]>.board-section-toggle{box-sizing:border-box;display:flex;width:100%;min-height:36px;margin:0 0 4px;padding:8px 10px;gap:8px;border-radius:8px;list-style:none;color:var(--color-text-secondary);font:var(--board-caption)}.board-section-toggle::-webkit-details-marker{display:none}.drawer .sec[data-sidebar-group]>.board-section-toggle:hover{background:var(--picked)}.board-section-toggle>span{flex:1;min-width:0}.board-section-toggle>svg{order:3;flex:none;margin-left:auto}.drawer .sec[data-sidebar-group]>.fcollapse>.fcollapsebody{padding:0 0 0 10px}.card:hover .pic::after,.card.selected .pic::after{box-sizing:border-box;border-radius:inherit}.card.selected .pic::after{content:"";position:absolute;inset:0;z-index:6;pointer-events:none;border:2px solid var(--on-media)}.card.selected .pic,.card.selected:hover .pic{box-shadow:none}++/* Board 公开基础控件:尺寸与来源登记在 docs/BOARD_UI.md。 */+.pcheck{vertical-align:middle;align-self:center}.pcheck>span{position:relative;width:16px;height:16px;border:1px solid var(--color-border-button-default);border-radius:4px;background:var(--color-background-primary-default);box-shadow:0 1px 2px #0000000d;transition:background .15s,border-color .15s,box-shadow .15s}+.pcheck input:is(:checked,:indeterminate)+span{color:#fff;border-color:transparent;background:linear-gradient(#3986ff,#1760ef);box-shadow:inset 0 1px 0 #ffffff40,0 1px 2px #0450e229}+.pcheck input:indeterminate+span svg{visibility:hidden}.pcheck input:indeterminate+span::after{content:'';position:absolute;top:6px;left:3px;width:8px;height:2px;border-radius:1px;background:#fff}+.pcheck input:disabled+span{opacity:.5}.pcheck>span svg{width:14px;height:14px;stroke-width:2}.pcheck:hover>span{border-color:var(--color-border-button-hover)}+input[type=checkbox]:not(.ptoggle):not(.pcheck input){accent-color:#1760ef;width:16px;height:16px;vertical-align:middle;margin:0;flex:none}+.dual-range .range-base,.dual-range .range-fill{height:6px;top:11px}.dual-range .range-base{background:var(--color-background-tertiary-default);box-shadow:inset 0 1px 1px #0000000f}.dual-range .range-fill{background:linear-gradient(90deg,#3986ff,#1760ef);box-shadow:inset 0 1px 0 #ffffff3d,0 1px 2px #0450e229}+body :is(.dual-range input,.photozoom input,.vjs-peach-speed-range)::-webkit-slider-thumb{appearance:none;width:20px;height:20px;border:1px solid var(--color-border-button-default);border-radius:50%;background:radial-gradient(circle at center,#fff 3px,#e5e5e5 3.5px,#fff 4px);box-shadow:0 2px 4px #0000001a,inset 0 1px 0 #ffffffcc;cursor:grab;transition:scale .15s,box-shadow .15s}+body :is(.dual-range input,.photozoom input,.vjs-peach-speed-range)::-moz-range-thumb{width:18px;height:18px;border:1px solid var(--color-border-button-default);border-radius:50%;background:radial-gradient(circle at center,#fff 3px,#e5e5e5 3.5px,#fff 4px);box-shadow:0 2px 4px #0000001a}+body :is(.photozoom input,.vjs-peach-speed-range)::-webkit-slider-runnable-track{height:6px;border-radius:999px;background:linear-gradient(90deg,#3986ff var(--board-range-value,var(--peach-speed-percent,0%)),var(--color-background-tertiary-default) 0);box-shadow:inset 0 1px 1px #0000000f}+body :is(.photozoom input,.vjs-peach-speed-range)::-webkit-slider-thumb{margin-top:-7px}+body :is(.photozoom input,.vjs-peach-speed-range)::-moz-range-track{height:6px;border-radius:999px;background:linear-gradient(90deg,#3986ff var(--board-range-value,var(--peach-speed-percent,0%)),var(--color-background-tertiary-default) 0)}+.board-range-tip{position:absolute;bottom:calc(100% + 4px);transform:translateX(-50%);padding:4px 8px;border:1px solid var(--color-border-button-default);border-radius:8px;background:var(--color-background-primary-default);color:var(--color-text-primary);font:var(--board-caption);white-space:nowrap;box-shadow:0 1px 2px #0000000d;pointer-events:none}+.dual-range{margin-top:36px}.dual-range .board-range-tip[data-range-end=max]{transform:translateX(-100%)}.dual-range .board-range-tip[data-range-end=min]{transform:none}+.toast{position:relative;align-items:flex-start;gap:12px;width:min(400px,calc(100vw - 32px));padding:16px 44px 16px 16px;border-radius:16px;background:var(--color-background-primary-default);border-color:var(--color-border-button-default);color:var(--color-text-primary);font:var(--board-body);box-shadow:0 12px 24px -4px #0000001a,0 4px 8px -2px #0000000d;overflow:hidden}+.toast.warn{border-color:var(--color-border-button-default)}.toast .board-notification-icon{display:grid;place-items:center;width:40px;height:40px;flex:none;border-radius:50%;background:color-mix(in srgb,#3986ff 12%,var(--color-background-primary-default));color:#1760ef}.toast.warn .board-notification-icon{background:color-mix(in srgb,#f04452 12%,var(--color-background-primary-default));color:var(--drop)}.board-notification-icon svg{width:20px;height:20px}.toast p{padding-block:8px}.toast .tclose{position:absolute;right:12px;top:12px}.toast .tact{align-self:center;font-weight:500;color:var(--tungsten)}+.board-notification-timer{position:absolute;bottom:0;left:0;right:0;height:3px;background:#1760ef;transform-origin:left;animation:board-notification-countdown var(--notification-duration) linear forwards}.toast:hover .board-notification-timer,.toast:focus-within .board-notification-timer{animation-play-state:paused}@keyframes board-notification-countdown{to{transform:scaleX(0)}}+.board-tooltip,.vjs-peach-tooltip{box-sizing:border-box;max-width:240px;padding:6px 10px;border:1px solid var(--color-border-button-default);border-radius:8px;background:var(--color-background-primary-default);color:var(--color-text-primary);font:var(--board-caption);white-space:normal;box-shadow:0 12px 24px -4px #0000001a,0 4px 8px -2px #0000000d}+.board-tooltip{position:fixed;z-index:var(--layer-tooltip);pointer-events:none}.board-tooltip[hidden]{display:none}+body :is(.popmenu,.gselectmenu,.cardmenupanel){box-sizing:border-box;padding:10px;border:1px solid var(--color-border-button-default);border-radius:16px;background:var(--color-background-primary-default);color:var(--color-text-primary);box-shadow:0 12px 24px -4px #0000001a,0 4px 8px -2px #0000000d}+body :is(.popmenu,.gselectmenu,.cardmenupanel)>:is(button,[role=option],[role=menuitem]){min-height:36px;padding:8px;gap:8px;border:0;border-radius:10px;background:transparent;color:var(--color-text-secondary);font:var(--board-body);box-shadow:none}+body :is(.popmenu,.gselectmenu,.cardmenupanel)>:is(button,[role=option],[role=menuitem]):is(:hover,:focus-visible,[aria-selected=true]){background:var(--color-background-primary-hover);color:var(--color-text-primary)}+body a:is(.externallink,[target=_blank]):not(:has(img)):not(.cardlink){display:inline-flex;align-items:center;gap:4px;min-height:20px;padding:0;border:0;border-radius:4px;background:transparent;box-shadow:none;color:var(--tungsten);font-weight:500;text-decoration:none;text-underline-offset:3px}+body a:is(.externallink,[target=_blank]):not(:has(img)):hover{background:transparent;text-decoration:underline;box-shadow:none}.externallink .externalmark{width:18px;height:18px;flex:none}+body :is(.sbadge,.faliasbadge,.tasteconfidence,.board-chip,.badge){display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 6px;min-height:24px;box-sizing:border-box;border:0;border-radius:6px;background:var(--color-background-tertiary-default);color:var(--color-text-secondary);font:var(--board-caption);white-space:nowrap}+body :is(.sbadge.ok,.board-chip.success){background:color-mix(in srgb,#84cc16 16%,var(--color-background-primary-default));color:#4d7c0f}body :is(.sbadge.error,.board-chip.error){background:color-mix(in srgb,#f43f5e 12%,var(--color-background-primary-default));color:#e11d48}.sbadge i,.tasteconfidence i{display:none}+.fprovider{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.fprovider .sbadge{flex:none}.followmanage .fsource.frow{grid-template-columns:20px minmax(120px,1fr) minmax(100px,auto) auto auto}.followmanage .fchannelcheck{align-self:start;margin-top:2px}+.board-button-group{display:inline-flex;align-items:center;overflow:hidden;border:1px solid var(--color-border-button-default);border-radius:10px;background:var(--color-background-primary-default);box-shadow:0 1px 2px #0000000d}.board-button-group>button{height:34px;padding:0 12px;border:0;border-radius:0;box-shadow:none;background:transparent;color:var(--color-text-secondary);font:var(--board-body)}.board-button-group>button+button{border-left:1px solid var(--color-border-button-default)}.board-button-group>button:is(:hover,[aria-pressed=true]){background:var(--color-background-primary-hover);color:var(--color-text-primary)}+.followmanage .fpickactions .fbtn{height:36px;min-height:36px;padding:8px 12px}+.photolight .photonav{width:36px;height:36px;border:1px solid var(--color-border-button-default);border-radius:10px;background:var(--color-background-primary-default);color:var(--color-text-secondary);box-shadow:0 1px 2px #0000000d}.photolight .photonav:hover{background:var(--color-background-primary-hover)}.photolight .photonav svg{width:20px;height:20px}.photolight .photonav.swiper-button-disabled{opacity:.4;pointer-events:none}+.board-carousel-pagination{display:flex;align-items:center;justify-content:center;gap:8px;max-width:160px;margin-inline:auto;overflow:hidden;height:28px}.board-carousel-pagination .swiper-pagination-bullet{width:6px;height:6px;flex:none;margin:0!important;border:0;padding:0;border-radius:999px;background:#a3a3a3;opacity:1;transition:width .2s ease-out,background .2s ease-out}.board-carousel-pagination .swiper-pagination-bullet-active{width:16px;background:#fafafa}+@media(max-width:760px){.followmanage .fsource.frow{grid-template-columns:20px minmax(0,1fr) auto}.board-follow-list .fprovider{grid-column:2;grid-row:2}.board-follow-list .fchecked{grid-column:2;grid-row:3}}+@container(max-width:520px){.followmanage .fauthor .fsource.frow{grid-template-columns:20px minmax(0,1fr) auto}.followmanage .fauthor .fprovider{grid-column:2;grid-row:2}.followmanage .fauthor .fchecked{grid-column:2;grid-row:3}}+@media(prefers-reduced-motion:reduce){.board-tooltip,.board-carousel-pagination .swiper-pagination-bullet{transition:none}}+:root{--board-chart-0:#94e000;--board-chart-1:#3493ff;--board-chart-2:#bc74f9;--board-chart-3:#f657bd;--board-chart-4:#ffc600;--board-chart-5:#2dcbb8}+.fauthorhead{list-style:none}.fauthorhead::-webkit-details-marker{display:none}.board-author-actions{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none}.board-author-actions .board-author-toggle{margin:0}.followmanage details.fauthor>.fcollapse>.fcollapsebody{padding:0}.followmanage details.fauthor:not([open]) .fauthorhead{margin-bottom:0}+.followmanage .fsource.selected{background:color-mix(in srgb,#3986ff 9%,var(--color-background-primary-default));box-shadow:inset 3px 0 #3986ff}.followmanage .fsource.selected.disabled{opacity:1}+.metricstrip>button[aria-selected=true]{background:var(--color-background-primary-default);box-shadow:none}.metricstrip>button[aria-selected=true]::after{box-sizing:border-box}.metricstrip>button[aria-selected=true] .board-stat-footer{background:var(--board-card-foot)}+body .gselectmenu [role=option][aria-selected=true],body .popmenu [aria-checked=true]{background:color-mix(in srgb,var(--color-text-primary) 10%,var(--color-background-primary-default));color:var(--color-text-primary)}+.insightswitch{display:inline-flex;align-items:center;gap:2px;padding:3px;border:1px solid var(--line);border-radius:10px;background:var(--color-background-primary-default);box-shadow:0 1px 2px #0000000d}.insightswitch label>span{display:flex;align-items:center;min-height:28px;padding:4px 10px;border-radius:7px;color:var(--color-text-secondary);font:var(--board-body-medium)}.insightswitch label:has(input:checked)>span{background:var(--color-background-primary-hover);color:var(--color-text-primary);box-shadow:0 1px 2px #0000001a}+.board-inventory-charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;width:100%;grid-column:1/-1}.board-radial-card{min-width:0;padding:20px;border-radius:20px;background:var(--color-background-primary-default);overflow:hidden}.board-radial-card>header{display:grid;grid-template-columns:1fr auto;gap:4px;color:var(--color-text-secondary)}.board-radial-card>header>b{grid-row:2;font:var(--board-title);color:var(--color-text-primary);font-variant-numeric:tabular-nums}.board-radial-card>header>small{align-self:end;grid-column:2;grid-row:2;font:var(--board-caption)}+.board-rings{display:block;width:100%;height:300px;overflow:visible}.board-rings circle{fill:none;stroke-linecap:round}.board-ring-track{stroke:var(--color-background-secondary-default)}.board-ring-value{stroke:var(--ring-color);cursor:pointer;transition:filter .18s,opacity .18s,stroke-width .18s;animation:board-ring-enter .9s cubic-bezier(.16,1,.3,1) var(--ring-delay) backwards;outline:none}.board-ring-value[data-active=true]{filter:brightness(.88);stroke-width:18}.board-ring-value:focus-visible{filter:drop-shadow(0 0 2px var(--color-border-focus-ring))}.board-radial-card:not([data-radial-focus="-1"]) .board-ring-value:not([data-active=true]){opacity:.4}+@keyframes board-ring-enter{from{stroke-dasharray:0 100;opacity:0}to{stroke-dasharray:var(--ring-length) calc(100 - var(--ring-length));opacity:1}}+.board-radial-tiles{display:flex;flex-wrap:wrap;gap:8px;padding:8px;border-radius:16px;background:var(--color-background-secondary-default)}.board-radial-tiles>button{display:flex;flex:1 1 calc(33.333% - 8px);min-width:0;flex-direction:column;align-items:flex-start;gap:4px;padding:10px;border:0;border-radius:12px;background:var(--color-background-primary-default);text-align:left;color:var(--color-text-primary);font:var(--board-body);transition:background .18s,box-shadow .18s}.board-radial-tiles>button>span{display:flex;align-items:center;gap:6px;min-width:0;color:var(--color-text-secondary);overflow-wrap:anywhere}.board-radial-tiles i{width:12px;height:12px;flex:none;border-radius:4px;background:var(--ring-color)}.board-radial-tiles b{font:var(--board-heading);font-variant-numeric:tabular-nums}.board-radial-tiles small{font:var(--board-caption);color:var(--color-text-secondary)}.board-radial-tiles>button:is([data-active=true],[aria-pressed=true]){background:color-mix(in srgb,var(--ring-color) 10%,var(--color-background-primary-default));box-shadow:inset 0 0 0 1px var(--ring-color)}+.board-activity-charts{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:20px;margin:20px 0}.board-heat-card,.board-activity-empty{min-width:0;padding:20px;border-radius:20px;background:var(--color-background-secondary-default)}.board-heat-card header{display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:24px}.board-heat-card h3{margin:0;font:var(--board-heading)}.board-heat-card header b{grid-row:2;font:var(--board-title);font-variant-numeric:tabular-nums}.board-heat-card header span{grid-column:2;grid-row:2;align-self:end;color:var(--muted);font:var(--board-caption)}.board-heat-scroll{overflow-x:auto;padding:3px}.board-hour-grid{display:grid;grid-template-columns:32px repeat(24,minmax(10px,1fr));gap:4px;min-width:360px}.board-heat-axis{font:var(--board-caption);color:var(--muted);align-self:center}.board-day-grid{display:grid;grid-auto-flow:column;grid-template-rows:repeat(7,1fr);grid-template-columns:repeat(13,1fr);gap:5px;padding:3px}+.board-heat-card [data-heat-value]{display:block;aspect-ratio:1;min-width:0;padding:0;border:0;border-radius:3px;background:color-mix(in srgb,#3493ff var(--heat),var(--color-background-tertiary-default));animation:board-heat-enter .4s ease-out both}.board-heat-card [data-heat-value]:is(:hover,:focus-visible){outline:2px solid var(--color-border-focus-ring);outline-offset:1px;filter:brightness(.9)}.board-heat-card footer{display:flex;justify-content:space-between;gap:8px;margin-top:16px;font:var(--board-caption);color:var(--muted)}@keyframes board-heat-enter{from{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}+@media(max-width:1000px){.board-inventory-charts,.board-activity-charts{grid-template-columns:1fr}.board-rings{height:260px}}+@media(max-width:600px){.board-author-actions{width:100%;justify-content:flex-end}.followmanage .fauthorhead{flex-wrap:wrap}.board-radial-card,.board-heat-card{padding:16px}.board-radial-tiles>button{flex-basis:calc(50% - 8px)}}+@media(prefers-reduced-motion:reduce){.board-ring-value,.board-heat-card [data-heat-value]{animation:none;transition:none}.board-radial-tiles>button{transition:none}}+.board-expand-ranks{position:relative;padding-bottom:36px}.board-rank-list{position:relative;display:grid;grid-template-columns:1fr;max-height:var(--rank-collapsed-height,300px);overflow:hidden;transition:max-height .24s ease}.board-expand-ranks:not(.expanded)::after{content:'';position:absolute;bottom:30px;left:0;right:0;height:48px;background:linear-gradient(transparent,var(--color-background-primary-default));pointer-events:none}.board-expand-ranks.expanded>.board-rank-list{max-height:var(--rank-expanded-height)}.board-rank-expand{position:absolute;z-index:1;bottom:4px;left:50%;transform:translateX(-50%);display:grid;place-items:center;width:40px;height:24px;padding:0;border:1px solid var(--line);border-radius:999px;background:var(--surface);box-shadow:0 1px 3px #0000001a;color:var(--muted)}.board-rank-expand svg{width:16px;height:16px;transition:transform .2s}.board-rank-expand[aria-expanded=true] svg{transform:rotate(180deg)}+.board-rank-list .tasterank{position:relative;isolation:isolate;border:0;border-radius:10px;background:transparent;overflow:hidden;min-height:44px}.board-rank-list .taste-rank-track{position:absolute;inset:0;height:100%;margin:0;z-index:-1;background:none;opacity:.16}.board-rank-list .taste-rank-track i{height:100%;border-radius:10px}.board-rank-list .tasterank:hover{background:var(--color-background-primary-hover)}+.board-sankey-card{padding:20px;border-radius:20px;margin-bottom:20px;background:var(--color-background-secondary-default);min-width:0}.board-sankey-card header{display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:20px}.board-sankey-card h3{margin:0;font:var(--board-heading)}.board-sankey-card header b{grid-row:2;font:var(--board-title);font-variant-numeric:tabular-nums}.board-sankey-card header span{grid-column:2;grid-row:2;color:var(--muted);align-self:end;font:var(--board-caption)}.board-sankey-scroll{overflow-x:auto}.board-sankey-scroll svg{display:block;width:100%;min-width:640px;max-height:520px}.board-sankey-links path{fill:none;stroke:var(--flow-color);opacity:.3;transition:opacity .2s;animation:board-heat-enter .6s ease-out}.board-sankey-nodes g{transition:opacity .2s}.board-sankey-nodes text{fill:var(--color-text-primary);font:var(--board-caption)}.board-sankey-nodes tspan{fill:var(--muted);font-size:11px}.board-sankey-card footer{display:flex;justify-content:space-between;color:var(--muted);font:var(--board-caption);margin-top:12px}+.tasteactions [data-taste-window] .gselectfield::before{content:'';width:16px;height:16px;flex:none;background:currentColor;mask:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2"%3E%3Crect x="3" y="5" width="18" height="16" rx="2"/%3E%3Cpath d="M16 3v4M8 3v4M3 11h18"/%3E%3C/svg%3E') center/contain no-repeat}+@media(prefers-reduced-motion:reduce){.board-sankey-links path{animation:none;transition:none}.board-rank-list,.board-rank-expand svg{transition:none}}diff --git a/web/dist/peach-ui.js b/web/dist/peach-ui.jsindex 6816d6218..aeacacbef 100644--- a/web/dist/peach-ui.js+++ b/web/dist/peach-ui.js@@ -1,21 +1,21 @@-import { MEDIA_SOURCE_ICONS as e, checkboxHtml as t, confirmModal as n, emptyStateHtml as r, fieldsetTitle as i, loadingDotsHtml as a, noteHtml as o, progressHtml as s, projectBannerHtml as c, selectFieldHtml as l, selectOptionIconHtml as u, setActionBusy as d, wireCollapse as f, wireSelectField as p } from "/js/ui-components.js";-import { LOC as m, esc as h, faviconUrl as g, fmtDur as _, fmtSize as v, icon as y, requestErrorMessage as b } from "/js/core.js";+import { LOC as e, esc as t, faviconUrl as n, fmtDur as r, fmtSize as i, icon as a, requestErrorMessage as o } from "/js/core.js";+import { MEDIA_SOURCE_ICONS as s, checkboxHtml as c, confirmModal as l, emptyStateHtml as u, fieldsetTitle as d, loadingDotsHtml as f, noteHtml as p, progressHtml as m, projectBannerHtml as h, selectFieldHtml as g, selectOptionIconHtml as _, setActionBusy as v, wireCollapse as y, wireSelectField as b } from "/js/ui-components.js";//#region node_modules/preact/dist/preact.module.js-var x, S, C, w, T, E, D, O, k, A, j, ee, M, N, P, F = {}, te = [], ne = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, re = Array.isArray;-function I(e, t) {+var x, S, C, w, T, E, D, O, k, A, j, ee, M, N, P, te = {}, ne = [], re = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ie = Array.isArray;+function F(e, t) {for (var n in t) e[n] = t[n];return e;}-function ie(e) {+function ae(e) {e && e.parentNode && e.parentNode.removeChild(e);}-function ae(e, t, n) {+function oe(e, t, n) {var r, i, a, o = {};for (a in t) a == "key" ? r = t[a] : a == "ref" ? i = t[a] : o[a] = t[a];if (arguments.length > 2 && (o.children = arguments.length > 3 ? x.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (a in e.defaultProps) o[a] === void 0 && (o[a] = e.defaultProps[a]);- return oe(e, o, r, i, null);+ return se(e, o, r, i, null);}-function oe(e, t, n, r, i) {+function se(e, t, n, r, i) {var a = {type: e,props: t,@@ -33,62 +33,62 @@ function oe(e, t, n, r, i) {};return i == null && S.vnode != null && S.vnode(a), a;}-function L(e) {+function I(e) {return e.children;}-function se(e, t) {+function ce(e, t) {this.props = e, this.context = t;}-function R(e, t) {- if (t == null) return e.__ ? R(e.__, e.__i + 1) : null;+function L(e, t) {+ if (t == null) return e.__ ? L(e.__, e.__i + 1) : null;for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;- return typeof e.type == "function" ? R(e) : null;+ return typeof e.type == "function" ? L(e) : null;}-function ce(e) {+function le(e) {if (e.__P && e.__d) {- var t = e.__v, n = t.__e, r = [], i = [], a = I({}, t);- a.__v = t.__v + 1, S.vnode && S.vnode(a), ye(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? R(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, xe(r, a, i), t.__e = t.__ = null, a.__e != n && le(a);+ var t = e.__v, n = t.__e, r = [], i = [], a = F({}, t);+ a.__v = t.__v + 1, S.vnode && S.vnode(a), be(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? L(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, Se(r, a, i), t.__e = t.__ = null, a.__e != n && ue(a);}}-function le(e) {+function ue(e) {if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;- }), le(e);+ }), ue(e);}-function ue(e) {- (!e.__d && (e.__d = !0) && T.push(e) && !de.__r++ || E != S.debounceRendering) && ((E = S.debounceRendering) || D)(de);+function de(e) {+ (!e.__d && (e.__d = !0) && T.push(e) && !fe.__r++ || E != S.debounceRendering) && ((E = S.debounceRendering) || D)(fe);}-function de() {+function fe() {try {- for (var e, t = 1; T.length;) T.length > t && T.sort(O), e = T.shift(), t = T.length, ce(e);+ for (var e, t = 1; T.length;) T.length > t && T.sort(O), e = T.shift(), t = T.length, le(e);} finally {- T.length = de.__r = 0;+ T.length = fe.__r = 0;}}-function fe(e, t, n, r, i, a, o, s, c, l, u) {- var d, f, p, m, h, g, _ = r && r.__k || te, v = t.length;- for (c = pe(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || F, p.__i = d, g = ye(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && we(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = me(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);+function pe(e, t, n, r, i, a, o, s, c, l, u) {+ var d, f, p, m, h, g, _ = r && r.__k || ne, v = t.length;+ for (c = me(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || te, p.__i = d, g = be(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && Te(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = he(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);return n.__e = h, c;}-function pe(e, t, n, r, i) {+function me(e, t, n, r, i) {var a, o, s, c, l, u = n.length, d = u, f = 0;- for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = oe(null, o, null, null, null) : re(o) ? o = e.__k[a] = oe(L, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = oe(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = he(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;- if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = R(s)), Te(s, s));+ for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = se(null, o, null, null, null) : ie(o) ? o = e.__k[a] = se(I, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = se(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = ge(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;+ if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = L(s)), Ee(s, s));return r;}-function me(e, t, n) {+function he(e, t, n) {var r, i;if (typeof e.type == "function") {- for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = me(r[i], t, n));+ for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = he(r[i], t, n));return t;}- e.__e != t && (t && e.type && !t.parentNode && (t = R(e)), t = n.insertBefore(e.__e, t || null));+ e.__e != t && (t && e.type && !t.parentNode && (t = L(e)), t = n.insertBefore(e.__e, t || null));dot &&= t.nextSibling;while (t != null && t.nodeType == 8);return t;}-function he(e, t, n, r) {+function ge(e, t, n, r) {var i, a, o, s = e.key, c = e.type, l = t[n], u = l != null && !(2 & l.__u);if (l === null && s == null || u && s == l.key && c == l.type) return n;if (r > +!!u) {@@ -96,16 +96,16 @@ function he(e, t, n, r) {}return -1;}-function ge(e, t, n) {- t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || ne.test(t) ? n : n + "px";+function _e(e, t, n) {+ t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || re.test(t) ? n : n + "px";}-function _e(e, t, n, r, i) {+function ve(e, t, n, r, i) {var a, o;n: if (t == "style") {if (typeof n == "string") e.style.cssText = n;else {- if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || ge(e.style, t, "");- if (n) for (t in n) r && n[t] == r[t] || ge(e.style, t, n[t]);+ if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || _e(e.style, t, "");+ if (n) for (t in n) r && n[t] == r[t] || _e(e.style, t, n[t]);}} else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(ee, "$1")), o = t.toLowerCase(), t = o in e || t == "onFocusOut" || t == "onFocusIn" ? o.slice(2) : t.slice(2), e.l ||= {}, e.l[t + a] = n, n ? r ? n[j] = r[j] : (n[j] = M, e.addEventListener(t, a ? P : N, a)) : e.removeEventListener(t, a ? P : N, a);else {@@ -117,7 +117,7 @@ function _e(e, t, n, r, i) {typeof n == "function" || (n == null || !1 === n && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));}}-function ve(e) {+function ye(e) {return function(t) {if (this.l) {var n = this.l[t.type + e];@@ -127,47 +127,47 @@ function ve(e) {}};}-function ye(e, t, n, r, i, a, o, s, c, l) {+function be(e, t, n, r, i, a, o, s, c, l) {var u, d, f, p, m, h, g, _, v, y, b, x, C, w, T, E, D = t.type;if (t.constructor !== void 0) return null;128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = S.__b) && u(t);n: if (typeof D == "function") {d = o.length;try {- if (v = t.props, y = D.prototype && D.prototype.render, b = (u = D.contextType) && r[u.__c], x = u ? b ? b.props.value : u.__ : r, n.__c ? _ = (f = t.__c = n.__c).__ = f.__E : (y ? t.__c = f = new D(v, x) : (t.__c = f = new se(v, x), f.constructor = D, f.render = Ee), b && b.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), y && f.__s == null && (f.__s = f.state), y && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = I({}, f.__s)), I(f.__s, D.getDerivedStateFromProps(v, f.__s))), m = f.props, h = f.state, f.__v = t, p) y && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), y && f.componentDidMount != null && f.__h.push(f.componentDidMount);+ if (v = t.props, y = D.prototype && D.prototype.render, b = (u = D.contextType) && r[u.__c], x = u ? b ? b.props.value : u.__ : r, n.__c ? _ = (f = t.__c = n.__c).__ = f.__E : (y ? t.__c = f = new D(v, x) : (t.__c = f = new ce(v, x), f.constructor = D, f.render = De), b && b.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), y && f.__s == null && (f.__s = f.state), y && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = F({}, f.__s)), F(f.__s, D.getDerivedStateFromProps(v, f.__s))), m = f.props, h = f.state, f.__v = t, p) y && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), y && f.componentDidMount != null && f.__h.push(f.componentDidMount);else {if (y && D.getDerivedStateFromProps == null && v !== m && f.componentWillReceiveProps != null && f.componentWillReceiveProps(v, x), t.__v == n.__v || !f.__e && f.shouldComponentUpdate != null && !1 === f.shouldComponentUpdate(v, f.__s, x)) {t.__v != n.__v && (f.props = v, f.state = f.__s, f.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {e && (e.__ = t);- }), te.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = R(n);+ }), ne.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = L(n);break n;}f.componentWillUpdate != null && f.componentWillUpdate(v, f.__s, x), y && f.componentDidUpdate != null && f.__h.push(function() {f.componentDidUpdate(m, h, g);});}- if (f.context = x, f.props = v, f.__P = e, f.__e = !1, C = S.__r, w = 0, y) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), te.push.apply(f.__h, f._sb), f._sb = [];+ if (f.context = x, f.props = v, f.__P = e, f.__e = !1, C = S.__r, w = 0, y) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), ne.push.apply(f.__h, f._sb), f._sb = [];else dof.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), f.state = f.__s;while (f.__d && ++w < 25);- f.state = f.__s, f.getChildContext != null && (r = I(I({}, r), f.getChildContext())), y && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === L && u.key == null ? Se(u.props.children) : u, s = fe(e, re(T) ? T : [T], t, n, r, i, a, o, s, c, l), f.base = t.__e, t.__u &= -161, f.__h.length && o.push(f), _ && (f.__E = f.__ = null);+ f.state = f.__s, f.getChildContext != null && (r = F(F({}, r), f.getChildContext())), y && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === I && u.key == null ? Ce(u.props.children) : u, s = pe(e, ie(T) ? T : [T], t, n, r, i, a, o, s, c, l), f.base = t.__e, t.__u &= -161, f.__h.length && o.push(f), _ && (f.__E = f.__ = null);} catch (e) {if (o.length = d, t.__v = null, c || a != null) {if (e.then) {for (t.__u |= c ? 160 : 128; s && s.nodeType == 8 && s.nextSibling;) s = s.nextSibling;a != null && (a[a.indexOf(s)] = null), t.__e = s;- } else if (a != null) for (E = a.length; E--;) ie(a[E]);+ } else if (a != null) for (E = a.length; E--;) ae(a[E]);} else t.__e = n.__e;- t.__k ??= n.__k || [], e.then || be(t), S.__e(e, t, n);+ t.__k ??= n.__k || [], e.then || xe(t), S.__e(e, t, n);}- } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = Ce(n.__e, t, n, r, i, a, o, c, l);+ } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = we(n.__e, t, n, r, i, a, o, c, l);return (u = S.diffed) && u(t), 128 & t.__u ? void 0 : s;}-function be(e) {- e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(be));+function xe(e) {+ e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(xe));}-function xe(e, t, n) {- for (var r = 0; r < n.length; r++) we(n[r], n[++r], n[++r]);+function Se(e, t, n) {+ for (var r = 0; r < n.length; r++) Te(n[r], n[++r], n[++r]);S.__c && S.__c(t, e), e.some(function(t) {try {e = t.__h, t.__h = [], e.some(function(e) {@@ -178,11 +178,11 @@ function xe(e, t, n) {}});}-function Se(e) {- return typeof e != "object" || !e || e.__b > 0 ? e : re(e) ? e.map(Se) : e.constructor === void 0 ? I({}, e) : null;+function Ce(e) {+ return typeof e != "object" || !e || e.__b > 0 ? e : ie(e) ? e.map(Ce) : e.constructor === void 0 ? F({}, e) : null;}-function Ce(e, t, n, r, i, a, o, s, c) {- var l, u, d, f, p, m, h, g = n.props || F, _ = t.props, v = t.type;+function we(e, t, n, r, i, a, o, s, c) {+ var l, u, d, f, p, m, h, g = n.props || te, _ = t.props, v = t.type;if (v == "svg" ? i = "http://www.w3.org/2000/svg" : v == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i ||= "http://www.w3.org/1999/xhtml", a != null) {for (l = 0; l < a.length; l++) if ((p = a[l]) && "setAttribute" in p == !!v && (v ? p.localName == v : p.nodeType == 3)) {e = p, a[l] = null;@@ -196,15 +196,15 @@ function Ce(e, t, n, r, i, a, o, s, c) {if (v == null) g === _ || s && e.data == _ || (e.data = _);else {if (a = v == "textarea" && _.defaultValue != null ? null : a && x.call(e.childNodes), !s && a != null) for (g = {}, l = 0; l < e.attributes.length; l++) g[(p = e.attributes[l]).name] = p.value;- for (l in g) p = g[l], l == "dangerouslySetInnerHTML" ? d = p : l == "children" || l in _ || l == "value" && "defaultValue" in _ || l == "checked" && "defaultChecked" in _ || _e(e, l, null, p, i);- for (l in _) p = _[l], l == "children" ? f = p : l == "dangerouslySetInnerHTML" ? u = p : l == "value" ? m = p : l == "checked" ? h = p : s && typeof p != "function" || g[l] === p || _e(e, l, p, g[l], i);+ for (l in g) p = g[l], l == "dangerouslySetInnerHTML" ? d = p : l == "children" || l in _ || l == "value" && "defaultValue" in _ || l == "checked" && "defaultChecked" in _ || ve(e, l, null, p, i);+ for (l in _) p = _[l], l == "children" ? f = p : l == "dangerouslySetInnerHTML" ? u = p : l == "value" ? m = p : l == "checked" ? h = p : s && typeof p != "function" || g[l] === p || ve(e, l, p, g[l], i);if (u) s || d && (u.__html == d.__html || u.__html == e.innerHTML) || (e.innerHTML = u.__html), t.__k = [];- else if (d && (e.innerHTML = ""), fe(t.type == "template" ? e.content : e, re(f) ? f : [f], t, n, r, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && R(n, 0), s, c), a != null) for (l = a.length; l--;) ie(a[l]);- s && v != "textarea" || (l = "value", v == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[l] || v == "progress" && !m || v == "option" && m != g[l]) && _e(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && _e(e, l, h, g[l], i));+ else if (d && (e.innerHTML = ""), pe(t.type == "template" ? e.content : e, ie(f) ? f : [f], t, n, r, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && L(n, 0), s, c), a != null) for (l = a.length; l--;) ae(a[l]);+ s && v != "textarea" || (l = "value", v == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[l] || v == "progress" && !m || v == "option" && m != g[l]) && ve(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && ve(e, l, h, g[l], i));}return e;}-function we(e, t, n) {+function Te(e, t, n) {try {if (typeof e == "function") {var r = typeof e.__u == "function";@@ -214,9 +214,9 @@ function we(e, t, n) {S.__e(e, n);}}-function Te(e, t, n) {+function Ee(e, t, n) {var r, i;- if (S.unmount && S.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || we(r, null, t)), (r = e.__c) != null) {+ if (S.unmount && S.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || Te(r, null, t)), (r = e.__c) != null) {if (r.componentWillUnmount) try {r.componentWillUnmount();} catch (e) {@@ -224,17 +224,17 @@ function Te(e, t, n) {}r.base = r.__P = r.__n = null;}- if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Te(r[i], t, n || typeof e.type != "function");- n || ie(e.__e), e.__c = e.__ = e.__e = void 0;+ if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Ee(r[i], t, n || typeof e.type != "function");+ n || ae(e.__e), e.__c = e.__ = e.__e = void 0;}-function Ee(e, t, n) {+function De(e, t, n) {return this.constructor(e, n);}-function De(e, t, n) {+function Oe(e, t, n) {var r, i, a, o;- t == document && (t = document.documentElement), S.__ && S.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], ye(t, e = (!r && n || t).__k = ae(L, null, [e]), i || F, F, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? x.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), xe(a, e, o), e.props.children = null;+ t == document && (t = document.documentElement), S.__ && S.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], be(t, e = (!r && n || t).__k = oe(I, null, [e]), i || te, te, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? x.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), Se(a, e, o), e.props.children = null;}-x = te.slice, S = { __e: function(e, t, n, r) {+x = ne.slice, S = { __e: function(e, t, n, r) {for (var i, a, o; t = t.__;) if ((i = t.__c) && !i.__) try {if ((a = i.constructor) && a.getDerivedStateFromError != null && (i.setState(a.getDerivedStateFromError(e)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(e, r || {}), o = i.__d), o) return i.__E = i;} catch (t) {@@ -243,22 +243,22 @@ x = te.slice, S = { __e: function(e, t, n, r) {throw e;} }, C = 0, w = function(e) {return e != null && e.constructor === void 0;-}, se.prototype.setState = function(e, t) {- var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = I({}, this.state);- typeof e == "function" && (e = e(I({}, n), this.props)), e && I(n, e), e != null && this.__v && (t && this._sb.push(t), ue(this));-}, se.prototype.forceUpdate = function(e) {- this.__v && (this.__e = !0, e && this.__h.push(e), ue(this));-}, se.prototype.render = L, T = [], D = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, O = function(e, t) {+}, ce.prototype.setState = function(e, t) {+ var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = F({}, this.state);+ typeof e == "function" && (e = e(F({}, n), this.props)), e && F(n, e), e != null && this.__v && (t && this._sb.push(t), de(this));+}, ce.prototype.forceUpdate = function(e) {+ this.__v && (this.__e = !0, e && this.__h.push(e), de(this));+}, ce.prototype.render = I, T = [], D = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, O = function(e, t) {return e.__v.__b - t.__v.__b;-}, de.__r = 0, k = Math.random().toString(8), A = "__d" + k, j = "__a" + k, ee = /(PointerCapture)$|Capture$/i, M = 0, N = ve(!1), P = ve(!0);+}, fe.__r = 0, k = Math.random().toString(8), A = "__d" + k, j = "__a" + k, ee = /(PointerCapture)$|Capture$/i, M = 0, N = ye(!1), P = ye(!0);//#endregion//#region src/sort-preferences.ts-function Oe(e, t, n) {+function ke(e, t, n) {return e === "seed" ? "" : e === t && n === "asc" ? "asc" : "desc";}//#endregion//#region src/number-setting.ts-var ke = {+var Ae = {loginDaysSetting: {min: 1,max: 365,@@ -306,17 +306,17 @@ var ke = {fallback: 60}};-function Ae(e, t, n, r) {+function je(e, t, n, r) {return Number.isInteger(e) && e >= t && e <= n ? e : r;}-function je(e, t, n) {+function Me(e, t, n) {let r = e.querySelector("input[type=number]"), i = e.querySelector("[role=switch]"), a = e.querySelector(".board-number-fields");r && (r.disabled = n, t !== null && t > 0 && (r.value = String(t))), i && (i.disabled = n, t !== null && (i.checked = t > 0)), a && t !== null && (a.hidden = t === 0);}-function Me(e, t, n, r, i) {- let a = ke[t];+function Ne(e, t, n, r, i) {+ let a = Ae[t];if (!a) return !1;- let { min: o, max: s, unit: c, optional: l, fallback: u } = a, d = `peach.number.${t}`, f = Ae(Number(localStorage.getItem(d)), o, s, r > 0 ? r : u), p = document.createElement("div");+ let { min: o, max: s, unit: c, optional: l, fallback: u } = a, d = `peach.number.${t}`, f = je(Number(localStorage.getItem(d)), o, s, r > 0 ? r : u), p = document.createElement("div");p.className = "board-optional-number";let m = document.createElement("div");m.className = "board-number-fields", m.hidden = !!l && r === 0;@@ -351,37 +351,37 @@ function Me(e, t, n, r, i) {}//#endregion//#region src/board-metrics.ts-var z = (e) => String(e ?? "").replace(/[&<>"']/g, (e) => ({+var R = (e) => String(e ?? "").replace(/[&<>"']/g, (e) => ({"&": "&","<": "<",">": ">","\"": ""","'": "'"})[e]);-function Ne(e, t, n, r = "chart-no-axes-combined") {- return `<span class="board-stat-label"><span class="board-stat-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><use href="#i-${/^[a-z0-9-]+$/.test(r) ? r : "database"}"/></svg></span>${z(e)}</span><b class="board-stat-value">${z(t)}</b><small class="board-stat-footer">${z(n || "当前记录")}</small>`;+function Pe(e, t, n, r = "chart-no-axes-combined") {+ return `<span class="board-stat-label"><span class="board-stat-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><use href="#i-${/^[a-z0-9-]+$/.test(r) ? r : "database"}"/></svg></span>${R(e)}</span><b class="board-stat-value">${R(t)}</b><small class="board-stat-footer">${R(n || "当前记录")}</small>`;}-function Pe(e, t, n) {+function Fe(e, t, n) {if (!Number.isFinite(n) || n <= 0) return "";let r = Math.max(0, Math.min(n, Number.isFinite(t) ? t : 0)), i = r / n * 100;- return `<div class="board-job-progress" role="progressbar" aria-label="${z(e)}" aria-valuemin="0" aria-valuemax="${n}" aria-valuenow="${r}"><svg width="36" height="36" viewBox="0 0 36 36" aria-hidden="true"><circle class="board-job-track" cx="18" cy="18" r="15"/><circle class="board-job-fill" cx="18" cy="18" r="15" pathLength="100" stroke-dasharray="${i} ${100 - i}" transform="rotate(-90 18 18)"/></svg><span>${z(e)}<small>${Math.round(i)}%</small></span></div>`;+ return `<div class="board-job-progress" role="progressbar" aria-label="${R(e)}" aria-valuemin="0" aria-valuemax="${n}" aria-valuenow="${r}"><svg width="36" height="36" viewBox="0 0 36 36" aria-hidden="true"><circle class="board-job-track" cx="18" cy="18" r="15"/><circle class="board-job-fill" cx="18" cy="18" r="15" pathLength="100" stroke-dasharray="${i} ${100 - i}" transform="rotate(-90 18 18)"/></svg><span>${R(e)}<small>${Math.round(i)}%</small></span></div>`;}-function Fe(e, t) {+function Ie(e, t) {let n = e.filter((e) => Number.isFinite(e.score) && e.score > 0), r = n.reduce((e, t) => e + t.score, 0);if (!r) return "";let i = 0, a = n.map((e, t) => {- let n = e.score / r * 100, a = `<circle cx="100" cy="100" r="72" pathLength="100" fill="none" stroke="var(--chart-${t % 4})" stroke-width="22" stroke-dasharray="${n} ${100 - n}" stroke-dashoffset="${-i}"><title>${z(e.name)}:${e.score.toLocaleString()}</title></circle>`;+ let n = e.score / r * 100, a = `<circle cx="100" cy="100" r="72" pathLength="100" fill="none" stroke="var(--chart-${t % 4})" stroke-width="22" stroke-dasharray="${n} ${100 - n}" stroke-dashoffset="${-i}"><title>${R(e.name)}:${e.score.toLocaleString()}</title></circle>`;return i += n, a;}).join("");- return `<svg class="board-distribution" viewBox="0 0 200 200" role="img" aria-label="${z(t)}"><g transform="rotate(-90 100 100)">${a}</g><text x="100" y="100" text-anchor="middle" dominant-baseline="middle">${z(t)}</text></svg>`;+ return `<svg class="board-distribution" viewBox="0 0 200 200" role="img" aria-label="${R(t)}"><g transform="rotate(-90 100 100)">${a}</g><text x="100" y="100" text-anchor="middle" dominant-baseline="middle">${R(t)}</text></svg>`;}-function Ie(e, t) {+function Le(e, t) {let n = e.filter((e) => Number.isFinite(e.score) && e.score > 0).slice().sort((e, t) => t.score - e.score).slice(0, 8);if (!n.length) return "";- let r = n[0].score, i = n.map((e) => `<li><span class="board-rank-fill" style="width:${(e.score / r * 100).toFixed(2)}%"></span><span>${z(e.name)}</span><b>${e.score.toLocaleString()}</b></li>`).join("");- return `<ol class="board-ranked-chart" aria-label="${z(t)}">${i}</ol>`;+ let r = n[0].score, i = n.map((e) => `<li><span class="board-rank-fill" style="width:${(e.score / r * 100).toFixed(2)}%"></span><span>${R(e.name)}</span><b>${e.score.toLocaleString()}</b></li>`).join("");+ return `<ol class="board-ranked-chart" aria-label="${R(t)}">${i}</ol>`;}-function Le(e, t) {+function Re(e, t) {let n = e.filter((e) => Number.isFinite(e.score) && e.score > 0).slice().sort((e, t) => t.score - e.score).slice(0, 6);if (n.length < 3) return "";let r = Math.max(...n.map((e) => e.score)), i = n.length, a = (e, t) => {@@ -394,25 +394,576 @@ function Le(e, t) {100].map((e) => `<polygon points="${o(() => e)}" class="board-radar-grid"/>`).join(""), c = n.map((e, t) => {let [n, r] = a(t, 116);- return `<text x="${n}" y="${r}" text-anchor="${n < 145 ? "end" : n > 175 ? "start" : "middle"}">${z(e.name)}</text>`;+ return `<text x="${n}" y="${r}" text-anchor="${n < 145 ? "end" : n > 175 ? "start" : "middle"}">${R(e.name)}</text>`;+ }).join("");+ return `<svg class="board-radar" viewBox="0 0 320 280" role="img" aria-label="${R(t)}"><title>${R(n.map((e) => `${e.name} ${e.score}`).join(","))}</title>${s}<polygon points="${o((e) => n[e].score / r * 100)}" class="board-radar-value"/>${c}</svg>`;+}+//#endregion+//#region src/board-controls.ts+function ze(e) {+ let t = Number(e.min) || 0, n = Number(e.max) || 100, r = Number(e.value), i = n > t ? Math.max(0, Math.min(100, (r - t) / (n - t) * 100)) : 0;+ e.style.setProperty("--board-range-value", `${i}%`);+ let a = e.closest(".dual-range");+ if (!a) return;+ let o = e.id === "durMax" ? "max" : "min", s = a.querySelector(`[data-range-end="${o}"]`);+ s || (s = document.createElement("output"), s.className = "board-range-tip", s.dataset.rangeEnd = o, s.setAttribute("aria-hidden", "true"), a.append(s)), s.textContent = r >= n && o === "max" ? "不限" : `${r} 分钟`, s.style.left = `${i}%`;+}+function Be() {+ let e = (e) => e.querySelectorAll("input[type=range]").forEach(ze);+ e(document), new MutationObserver((t) => {+ for (let n of t) for (let t of n.addedNodes) t instanceof Element && (t.matches("input[type=range]") && ze(t), e(t));+ }).observe(document.body, {+ subtree: !0,+ childList: !0+ }), document.addEventListener("input", (e) => {+ e.target instanceof HTMLInputElement && e.target.type === "range" && ze(e.target);+ });+ let t = document.createElement("div");+ t.className = "board-tooltip", t.id = "board-control-tooltip", t.role = "tooltip", t.hidden = !0, document.body.append(t);+ let n = null, r = "", i = null, a, o = () => {+ clearTimeout(a), t.hidden = !0, n && (n.hasAttribute("title") || (n.title = r), i === null ? n.removeAttribute("aria-describedby") : n.setAttribute("aria-describedby", i)), n = null;+ }, s = (e, s) => {+ let c = e instanceof Element ? e.closest("[title]") : null;+ !c || c === n || c.closest(".vjs-control") || !c.title.trim() || (o(), n = c, r = c.title, i = c.getAttribute("aria-describedby"), c.removeAttribute("title"), a = setTimeout(() => {+ if (n !== c || !c.isConnected) return;+ t.textContent = r, t.hidden = !1;+ let e = c.getBoundingClientRect(), a = t.getBoundingClientRect();+ t.style.left = `${Math.max(8, Math.min(innerWidth - a.width - 8, e.left + (e.width - a.width) / 2))}px`, t.style.top = `${e.top >= a.height + 16 ? e.top - a.height - 8 : Math.min(innerHeight - a.height - 8, e.bottom + 8)}px`, c.setAttribute("aria-describedby", [i, t.id].filter(Boolean).join(" "));+ }, s));+ };+ document.addEventListener("pointerover", (e) => s(e.target, 400)), document.addEventListener("pointerout", (e) => {+ n && !n.contains(e.relatedTarget) && o();+ }), document.addEventListener("focusin", (e) => s(e.target, 0)), document.addEventListener("focusout", o), document.addEventListener("keydown", (e) => {+ e.key === "Escape" && o();+ }), document.addEventListener("scroll", o, !0), window.addEventListener("resize", o);+}+function Ve(e) {+ e.querySelectorAll(".tasteranks,.insightranking").forEach((e, t) => {+ if (e.children.length <= 5 || e.parentElement?.hasAttribute("data-expandable-ranks")) return;+ let n = document.createElement("div");+ n.className = "board-expand-ranks", n.dataset.expandableRanks = "", e.before(n), n.append(e), e.id = e.id || `board-rank-list-${t}`, e.classList.add("board-rank-list");+ let r = document.createElement("button");+ r.type = "button", r.className = "board-rank-expand", r.setAttribute("aria-controls", e.id), r.setAttribute("aria-expanded", "false"), r.setAttribute("aria-label", "展开更多排名"), r.innerHTML = "<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><use href=\"#i-chevron-down\"/></svg>", n.append(r);+ let i = () => {+ let t = e.children[4];+ e.offsetWidth && (n.style.setProperty("--rank-collapsed-height", `${t.offsetTop - e.offsetTop + t.offsetHeight + 20}px`), n.style.setProperty("--rank-expanded-height", `${e.scrollHeight}px`));+ }, a = () => {+ let t = r.getAttribute("aria-expanded") === "true";+ n.classList.toggle("expanded", t), [...e.children].forEach((e, n) => e.inert = !t && n >= 5), i();+ };+ r.onclick = () => {+ let e = r.getAttribute("aria-expanded") !== "true";+ r.setAttribute("aria-expanded", String(e)), r.setAttribute("aria-label", e ? "收起排名" : "展开更多排名"), a();+ }, new ResizeObserver(i).observe(e), a();+ });+}+//#endregion+//#region node_modules/d3-array/src/max.js+function He(e, t) {+ let n;+ if (t === void 0) for (let t of e) t != null && (n < t || n === void 0 && t >= t) && (n = t);+ else {+ let r = -1;+ for (let i of e) (i = t(i, ++r, e)) != null && (n < i || n === void 0 && i >= i) && (n = i);+ }+ return n;+}+//#endregion+//#region node_modules/d3-array/src/min.js+function Ue(e, t) {+ let n;+ if (t === void 0) for (let t of e) t != null && (n > t || n === void 0 && t >= t) && (n = t);+ else {+ let r = -1;+ for (let i of e) (i = t(i, ++r, e)) != null && (n > i || n === void 0 && i >= i) && (n = i);+ }+ return n;+}+//#endregion+//#region node_modules/d3-array/src/sum.js+function We(e, t) {+ let n = 0;+ if (t === void 0) for (let t of e) (t = +t) && (n += t);+ else {+ let r = -1;+ for (let i of e) (i = +t(i, ++r, e)) && (n += i);+ }+ return n;+}+//#endregion+//#region node_modules/d3-sankey/src/align.js+function Ge(e, t) {+ return e.sourceLinks.length ? e.depth : t - 1;+}+//#endregion+//#region node_modules/d3-sankey/src/constant.js+function Ke(e) {+ return function() {+ return e;+ };+}+//#endregion+//#region node_modules/d3-sankey/src/sankey.js+function qe(e, t) {+ return Ye(e.source, t.source) || e.index - t.index;+}+function Je(e, t) {+ return Ye(e.target, t.target) || e.index - t.index;+}+function Ye(e, t) {+ return e.y0 - t.y0;+}+function Xe(e) {+ return e.value;+}+function Ze(e) {+ return e.index;+}+function Qe(e) {+ return e.nodes;+}+function $e(e) {+ return e.links;+}+function et(e, t) {+ let n = e.get(t);+ if (!n) throw Error("missing: " + t);+ return n;+}+function tt({ nodes: e }) {+ for (let t of e) {+ let e = t.y0, n = e;+ for (let n of t.sourceLinks) n.y0 = e + n.width / 2, e += n.width;+ for (let e of t.targetLinks) e.y1 = n + e.width / 2, n += e.width;+ }+}+function nt() {+ let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = Ze, c = Ge, l, u, d = Qe, f = $e, p = 6;+ function m() {+ let e = {+ nodes: d.apply(null, arguments),+ links: f.apply(null, arguments)+ };+ return h(e), g(e), _(e), v(e), x(e), tt(e), e;+ }+ m.update = function(e) {+ return tt(e), e;+ }, m.nodeId = function(e) {+ return arguments.length ? (s = typeof e == "function" ? e : Ke(e), m) : s;+ }, m.nodeAlign = function(e) {+ return arguments.length ? (c = typeof e == "function" ? e : Ke(e), m) : c;+ }, m.nodeSort = function(e) {+ return arguments.length ? (l = e, m) : l;+ }, m.nodeWidth = function(e) {+ return arguments.length ? (i = +e, m) : i;+ }, m.nodePadding = function(e) {+ return arguments.length ? (a = o = +e, m) : a;+ }, m.nodes = function(e) {+ return arguments.length ? (d = typeof e == "function" ? e : Ke(e), m) : d;+ }, m.links = function(e) {+ return arguments.length ? (f = typeof e == "function" ? e : Ke(e), m) : f;+ }, m.linkSort = function(e) {+ return arguments.length ? (u = e, m) : u;+ }, m.size = function(i) {+ return arguments.length ? (e = t = 0, n = +i[0], r = +i[1], m) : [n - e, r - t];+ }, m.extent = function(i) {+ return arguments.length ? (e = +i[0][0], n = +i[1][0], t = +i[0][1], r = +i[1][1], m) : [[e, t], [n, r]];+ }, m.iterations = function(e) {+ return arguments.length ? (p = +e, m) : p;+ };+ function h({ nodes: e, links: t }) {+ for (let [t, n] of e.entries()) n.index = t, n.sourceLinks = [], n.targetLinks = [];+ let n = new Map(e.map((t, n) => [s(t, n, e), t]));+ for (let [e, r] of t.entries()) {+ r.index = e;+ let { source: t, target: i } = r;+ typeof t != "object" && (t = r.source = et(n, t)), typeof i != "object" && (i = r.target = et(n, i)), t.sourceLinks.push(r), i.targetLinks.push(r);+ }+ if (u != null) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(u), n.sort(u);+ }+ function g({ nodes: e }) {+ for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(We(t.sourceLinks, Xe), We(t.targetLinks, Xe)) : t.fixedValue;+ }+ function _({ nodes: e }) {+ let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;+ for (; n.size;) {+ for (let e of n) {+ e.depth = i;+ for (let { target: t } of e.sourceLinks) r.add(t);+ }+ if (++i > t) throw Error("circular link");+ n = r, r = /* @__PURE__ */ new Set();+ }+ }+ function v({ nodes: e }) {+ let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;+ for (; n.size;) {+ for (let e of n) {+ e.height = i;+ for (let { source: t } of e.targetLinks) r.add(t);+ }+ if (++i > t) throw Error("circular link");+ n = r, r = /* @__PURE__ */ new Set();+ }+ }+ function y({ nodes: t }) {+ let r = He(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);+ for (let n of t) {+ let t = Math.max(0, Math.min(r - 1, Math.floor(c.call(null, n, r))));+ n.layer = t, n.x0 = e + t * a, n.x1 = n.x0 + i, o[t] ? o[t].push(n) : o[t] = [n];+ }+ if (l) for (let e of o) e.sort(l);+ return o;+ }+ function b(e) {+ let n = Ue(e, (e) => (r - t - (e.length - 1) * o) / We(e, Xe));+ for (let i of e) {+ let e = t;+ for (let t of i) {+ t.y0 = e, t.y1 = e + t.value * n, e = t.y1 + o;+ for (let e of t.sourceLinks) e.width = e.value * n;+ }+ e = (r - e + o) / (i.length + 1);+ for (let t = 0; t < i.length; ++t) {+ let n = i[t];+ n.y0 += e * (t + 1), n.y1 += e * (t + 1);+ }+ O(i);+ }+ }+ function x(e) {+ let n = y(e);+ o = Math.min(a, (r - t) / (He(n, (e) => e.length) - 1)), b(n);+ for (let e = 0; e < p; ++e) {+ let t = .99 ** e, r = Math.max(1 - t, (e + 1) / p);+ C(n, t, r), S(n, t, r);+ }+ }+ function S(e, t, n) {+ for (let r = 1, i = e.length; r < i; ++r) {+ let i = e[r];+ for (let e of i) {+ let n = 0, r = 0;+ for (let { source: t, value: i } of e.targetLinks) {+ let a = i * (e.layer - t.layer);+ n += k(t, e) * a, r += a;+ }+ if (!(r > 0)) continue;+ let i = (n / r - e.y0) * t;+ e.y0 += i, e.y1 += i, D(e);+ }+ l === void 0 && i.sort(Ye), w(i, n);+ }+ }+ function C(e, t, n) {+ for (let r = e.length - 2; r >= 0; --r) {+ let i = e[r];+ for (let e of i) {+ let n = 0, r = 0;+ for (let { target: t, value: i } of e.sourceLinks) {+ let a = i * (t.layer - e.layer);+ n += A(e, t) * a, r += a;+ }+ if (!(r > 0)) continue;+ let i = (n / r - e.y0) * t;+ e.y0 += i, e.y1 += i, D(e);+ }+ l === void 0 && i.sort(Ye), w(i, n);+ }+ }+ function w(e, n) {+ let i = e.length >> 1, a = e[i];+ E(e, a.y0 - o, i - 1, n), T(e, a.y1 + o, i + 1, n), E(e, r, e.length - 1, n), T(e, t, 0, n);+ }+ function T(e, t, n, r) {+ for (; n < e.length; ++n) {+ let i = e[n], a = (t - i.y0) * r;+ a > 1e-6 && (i.y0 += a, i.y1 += a), t = i.y1 + o;+ }+ }+ function E(e, t, n, r) {+ for (; n >= 0; --n) {+ let i = e[n], a = (i.y1 - t) * r;+ a > 1e-6 && (i.y0 -= a, i.y1 -= a), t = i.y0 - o;+ }+ }+ function D({ sourceLinks: e, targetLinks: t }) {+ if (u === void 0) {+ for (let { source: { sourceLinks: e } } of t) e.sort(Je);+ for (let { target: { targetLinks: t } } of e) t.sort(qe);+ }+ }+ function O(e) {+ if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(Je), n.sort(qe);+ }+ function k(e, t) {+ let n = e.y0 - (e.sourceLinks.length - 1) * o / 2;+ for (let { target: r, width: i } of e.sourceLinks) {+ if (r === t) break;+ n += i + o;+ }+ for (let { source: r, width: i } of t.targetLinks) {+ if (r === e) break;+ n -= i;+ }+ return n;+ }+ function A(e, t) {+ let n = t.y0 - (t.targetLinks.length - 1) * o / 2;+ for (let { source: r, width: i } of t.targetLinks) {+ if (r === e) break;+ n += i + o;+ }+ for (let { target: r, width: i } of e.sourceLinks) {+ if (r === t) break;+ n -= i;+ }+ return n;+ }+ return m;+}+//#endregion+//#region node_modules/d3-path/src/path.js+var rt = Math.PI, it = 2 * rt, z = 1e-6, at = it - z;+function ot() {+ this._x0 = this._y0 = this._x1 = this._y1 = null, this._ = "";+}+function st() {+ return new ot();+}+ot.prototype = st.prototype = {+ constructor: ot,+ moveTo: function(e, t) {+ this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +t);+ },+ closePath: function() {+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");+ },+ lineTo: function(e, t) {+ this._ += "L" + (this._x1 = +e) + "," + (this._y1 = +t);+ },+ quadraticCurveTo: function(e, t, n, r) {+ this._ += "Q" + +e + "," + +t + "," + (this._x1 = +n) + "," + (this._y1 = +r);+ },+ bezierCurveTo: function(e, t, n, r, i, a) {+ this._ += "C" + +e + "," + +t + "," + +n + "," + +r + "," + (this._x1 = +i) + "," + (this._y1 = +a);+ },+ arcTo: function(e, t, n, r, i) {+ e = +e, t = +t, n = +n, r = +r, i = +i;+ var a = this._x1, o = this._y1, s = n - e, c = r - t, l = a - e, u = o - t, d = l * l + u * u;+ if (i < 0) throw Error("negative radius: " + i);+ if (this._x1 === null) this._ += "M" + (this._x1 = e) + "," + (this._y1 = t);+ else if (d > z) {+ if (!(Math.abs(u * s - c * l) > z) || !i) this._ += "L" + (this._x1 = e) + "," + (this._y1 = t);+ else {+ var f = n - a, p = r - o, m = s * s + c * c, h = f * f + p * p, g = Math.sqrt(m), _ = Math.sqrt(d), v = i * Math.tan((rt - Math.acos((m + d - h) / (2 * g * _))) / 2), y = v / _, b = v / g;+ Math.abs(y - 1) > z && (this._ += "L" + (e + y * l) + "," + (t + y * u)), this._ += "A" + i + "," + i + ",0,0," + +(u * f > l * p) + "," + (this._x1 = e + b * s) + "," + (this._y1 = t + b * c);+ }+ }+ },+ arc: function(e, t, n, r, i, a) {+ e = +e, t = +t, n = +n, a = !!a;+ var o = n * Math.cos(r), s = n * Math.sin(r), c = e + o, l = t + s, u = 1 ^ a, d = a ? r - i : i - r;+ if (n < 0) throw Error("negative radius: " + n);+ this._x1 === null ? this._ += "M" + c + "," + l : (Math.abs(this._x1 - c) > z || Math.abs(this._y1 - l) > z) && (this._ += "L" + c + "," + l), n && (d < 0 && (d = d % it + it), d > at ? this._ += "A" + n + "," + n + ",0,1," + u + "," + (e - o) + "," + (t - s) + "A" + n + "," + n + ",0,1," + u + "," + (this._x1 = c) + "," + (this._y1 = l) : d > z && (this._ += "A" + n + "," + n + ",0," + +(d >= rt) + "," + u + "," + (this._x1 = e + n * Math.cos(i)) + "," + (this._y1 = t + n * Math.sin(i))));+ },+ rect: function(e, t, n, r) {+ this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +t) + "h" + +n + "v" + +r + "h" + -n + "Z";+ },+ toString: function() {+ return this._;+ }+};+//#endregion+//#region node_modules/d3-shape/src/constant.js+function ct(e) {+ return function() {+ return e;+ };+}+//#endregion+//#region node_modules/d3-shape/src/point.js+function lt(e) {+ return e[0];+}+function ut(e) {+ return e[1];+}+//#endregion+//#region node_modules/d3-shape/src/array.js+var dt = Array.prototype.slice;+//#endregion+//#region node_modules/d3-shape/src/link/index.js+function ft(e) {+ return e.source;+}+function pt(e) {+ return e.target;+}+function mt(e) {+ var t = ft, n = pt, r = lt, i = ut, a = null;+ function o() {+ var o, s = dt.call(arguments), c = t.apply(this, s), l = n.apply(this, s);+ if (a ||= o = st(), e(a, +r.apply(this, (s[0] = c, s)), +i.apply(this, s), +r.apply(this, (s[0] = l, s)), +i.apply(this, s)), o) return a = null, o + "" || null;+ }+ return o.source = function(e) {+ return arguments.length ? (t = e, o) : t;+ }, o.target = function(e) {+ return arguments.length ? (n = e, o) : n;+ }, o.x = function(e) {+ return arguments.length ? (r = typeof e == "function" ? e : ct(+e), o) : r;+ }, o.y = function(e) {+ return arguments.length ? (i = typeof e == "function" ? e : ct(+e), o) : i;+ }, o.context = function(e) {+ return arguments.length ? (a = e ?? null, o) : a;+ }, o;+}+function ht(e, t, n, r, i) {+ e.moveTo(t, n), e.bezierCurveTo(t = (t + r) / 2, n, t, i, r, i);+}+function gt() {+ return mt(ht);+}+//#endregion+//#region node_modules/d3-sankey/src/sankeyLinkHorizontal.js+function _t(e) {+ return [e.source.x1, e.y0];+}+function vt(e) {+ return [e.target.x0, e.y1];+}+function yt() {+ return gt().source(_t).target(vt);+}+//#endregion+//#region src/board-sankey.ts+function bt(e = []) {+ let n = e.filter((e) => e.source && e.target && Number.isFinite(e.value) && e.value > 0);+ if (!n.length) return "";+ let r = [...new Set(n.map((e) => e.source))], i = [...new Set(n.map((e) => e.target))], a = nt().nodeId((e) => e.id).nodeWidth(10).nodePadding(22).extent([[155, 16], [535, 404]])({+ nodes: [...r.map((e) => ({+ id: `source:${e}`,+ name: e,+ side: "source"+ })), ...i.map((e) => ({+ id: `target:${e}`,+ name: e,+ side: "target"+ }))],+ links: n.map((e) => ({+ source: `source:${e.source}`,+ target: `target:${e.target}`,+ value: e.value+ }))+ }), o = n.reduce((e, t) => e + t.value, 0), s = yt(), c = a.links.map((e) => {+ let n = e.source, i = e.target;+ return `<path d="${s(e)}" stroke-width="${Math.max(.5, e.width || 0)}" style="--flow-color:var(--board-chart-${r.indexOf(n.name) % 6})" data-flow-source="${n.index}" data-flow-target="${i.index}" data-flow-value="${e.value}" data-flow-label="${t(n.name)} → ${t(i.name)}" tabindex="0" role="img" aria-label="${t(n.name)} → ${t(i.name)}:${e.value} 条线索"/>`;+ }).join(""), l = a.nodes.map((e) => `<g data-flow-node="${e.index}" data-flow-value="${e.value}" data-flow-label="${t(e.name)}" tabindex="0" role="img" aria-label="${t(e.name)}:${e.value} 条线索"><rect x="${e.x0}" y="${e.y0}" width="10" height="${Math.max(1, (e.y1 || 0) - (e.y0 || 0))}" rx="5" fill="${e.side === "source" ? `var(--board-chart-${r.indexOf(e.name) % 6})` : "var(--color-text-secondary)"}"/><text x="${e.side === "source" ? 145 : 545}" y="${((e.y0 || 0) + (e.y1 || 0)) / 2}" text-anchor="${e.side === "source" ? "end" : "start"}" dominant-baseline="middle">${t(e.name.length > 18 ? e.name.slice(0, 16) + "…" : e.name)}<tspan x="${e.side === "source" ? 145 : 545}" dy="15">${e.side === "source" ? e.value?.toLocaleString() : ((e.value || 0) / o * 100).toFixed(1) + "%"}</tspan></text></g>`).join("");+ return `<section class="board-sankey-card" data-sankey-card><header><h3>创作者线索来源</h3><b data-sankey-number>${o.toLocaleString()}</b><span data-sankey-label>条线索</span></header><div class="board-sankey-scroll"><svg viewBox="0 0 720 435" aria-label="来源网站与创作者线索"><g class="board-sankey-links">${c}</g><g class="board-sankey-nodes">${l}</g></svg></div><footer><span>来源网站</span><span>创作者 · 线索占比</span></footer></section>`;+}+function xt(e) {+ e.querySelectorAll("[data-sankey-card]").forEach((e) => {+ let t = [...e.querySelectorAll("[data-flow-source]")], n = [...e.querySelectorAll("[data-flow-node]")], r = e.querySelector("[data-sankey-number]"), i = e.querySelector("[data-sankey-label]"), a = r.textContent, o = () => {+ t.forEach((e) => e.style.opacity = ""), n.forEach((e) => e.style.opacity = ""), r.textContent = a, i.textContent = "条线索";+ };+ [...t, ...n].forEach((e) => {+ let a = () => {+ let a = e.dataset.flowNode;+ t.forEach((t) => t.style.opacity = String((a === void 0 ? t === e : t.dataset.flowSource === a || t.dataset.flowTarget === a) ? .7 : .08)), n.forEach((n) => n.style.opacity = String(a === void 0 ? n.dataset.flowNode === e.dataset.flowSource || n.dataset.flowNode === e.dataset.flowTarget ? 1 : .3 : n === e || t.some((e) => e.dataset.flowSource === a && e.dataset.flowTarget === n.dataset.flowNode || e.dataset.flowTarget === a && e.dataset.flowSource === n.dataset.flowNode) ? 1 : .3)), r.textContent = Number(e.dataset.flowValue).toLocaleString(), i.textContent = e.dataset.flowLabel;+ };+ e.addEventListener("pointerenter", a), e.addEventListener("pointerleave", o), e.addEventListener("focus", a), e.addEventListener("blur", o);+ });+ });+}+//#endregion+//#region src/board-analytics.ts+var St = (e) => Number.isFinite(e) && e >= 0;+function Ct(e, n, r = "个视频") {+ let i = e.filter((e) => St(e.value));+ if (!i.length) return "";+ let a = i.reduce((e, t) => e + t.value, 0), o = Math.max(1, ...i.map((e) => e.value)) * 1.1, s = Math.min(22, 110 / Math.max(1, i.length)), c = Math.min(15, s * .68), l = i.map((e, n) => {+ let i = 32 + n * s, a = e.value / o * 100;+ return `<g style="--ring-color:var(--board-chart-${n % 6});--ring-delay:${n * 60}ms"><circle class="board-ring-track" cx="160" cy="160" r="${i}" stroke-width="${c}"/><circle class="board-ring-value" data-radial-ring="${n}" tabindex="0" role="button" aria-label="${t(e.name)}:${e.value.toLocaleString()} ${t(r)}" aria-pressed="false" cx="160" cy="160" r="${i}" stroke-width="${c}" pathLength="100" stroke-dasharray="${a} ${100 - a}" style="--ring-length:${a}" transform="rotate(-90 160 160)"/></g>`;}).join("");- return `<svg class="board-radar" viewBox="0 0 320 280" role="img" aria-label="${z(t)}"><title>${z(n.map((e) => `${e.name} ${e.score}`).join(","))}</title>${s}<polygon points="${o((e) => n[e].score / r * 100)}" class="board-radar-value"/>${c}</svg>`;+ return `<section class="board-radial-card" data-radial-card data-radial-total="${a}" data-radial-title="${t(n)}"><header><span data-radial-label>${t(n)}</span><b data-radial-number>${a.toLocaleString()}</b><small>${t(r)}</small></header><svg class="board-rings" viewBox="0 0 320 320" aria-label="${t(n)}">${l}</svg><div class="board-radial-tiles">${i.map((e, n) => `<button type="button" data-radial-tile="${n}" data-radial-value="${e.value}" data-radial-name="${t(e.name)}" aria-pressed="false" style="--ring-color:var(--board-chart-${n % 6})"><span><i aria-hidden="true"></i>${t(e.name)}</span><b>${e.value.toLocaleString()}</b>${e.detail ? `<small>${t(e.detail)}</small>` : ""}</button>`).join("")}</div></section>`;+}+function wt(e) {+ e.querySelectorAll("[data-radial-card]").forEach((e) => {+ let t = [...e.querySelectorAll("[data-radial-tile]")], n = [...e.querySelectorAll("[data-radial-ring]")], r = e.querySelector("[data-radial-number]"), i = e.querySelector("[data-radial-label]"), a = -1, o = 0, s = 0, c = (c) => {+ e.dataset.radialFocus = String(c), t.forEach((e, t) => {+ e.dataset.active = String(t === c), e.setAttribute("aria-pressed", String(t === a)), n[t]?.setAttribute("aria-pressed", String(t === a)), n[t] && (n[t].dataset.active = String(t === c));+ });+ let l = Number(c < 0 ? e.dataset.radialTotal : t[c]?.dataset.radialValue);+ i.textContent = c < 0 ? e.dataset.radialTitle : t[c].dataset.radialName, cancelAnimationFrame(s);+ let u = o, d = performance.now(), f = (e) => {+ let t = matchMedia("(prefers-reduced-motion: reduce)").matches ? 1 : Math.min(1, (e - d) / 300);+ o = u + (l - u) * (1 - (1 - t) ** 3), r.textContent = Math.round(o).toLocaleString(), t < 1 && (s = requestAnimationFrame(f));+ };+ s = requestAnimationFrame(f);+ }, l = (e) => {+ a = a === e ? -1 : e, c(a);+ };+ [...t, ...n].forEach((e) => {+ let t = Number(e.getAttribute("data-radial-tile") ?? e.getAttribute("data-radial-ring"));+ e.addEventListener("pointerenter", () => c(t)), e.addEventListener("pointerleave", () => c(a)), e.addEventListener("focus", () => c(t)), e.addEventListener("blur", () => c(a)), e.addEventListener("click", () => l(t)), e instanceof SVGElement && e.addEventListener("keydown", (e) => {+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), l(t));+ });+ }), c(-1);+ });+}+var Tt = [+ "周一",+ "周二",+ "周三",+ "周四",+ "周五",+ "周六",+ "周日"+];+function Et(e) {+ if (!e?.days?.length) return "<section class=\"board-activity-empty\"><h3>浏览活跃时间</h3><p>还没有可用于分析的口味网站访问记录。</p></section>";+ let n = Array.from({ length: 7 }, () => Array(24).fill(0));+ for (let t of e.hours || []) Number.isInteger(t.weekday) && t.weekday >= 0 && t.weekday < 7 && Number.isInteger(t.hour) && t.hour >= 0 && t.hour < 24 && St(t.count) && (n[t.weekday][t.hour] = (n[t.weekday][t.hour] || 0) + t.count);+ let r = Math.max(1, ...n.flat()), i = n.flat().reduce((e, t) => e + t, 0), a = n.map((e, t) => `<span class="board-heat-axis">${Tt[t]}</span>${e.map((e, n) => `<button type="button" data-heat-value="${e}" data-heat-label="${Tt[t]} ${n}:00" aria-label="${Tt[t]} ${n}:00,${e} 次访问" style="--heat:${e ? Math.max(12, e / r * 100) : 0}%"></button>`).join("")}`).join(""), o = e.days.filter((e) => /^\d{4}-\d{2}-\d{2}$/.test(e.date) && St(e.count)).sort((e, t) => e.date.localeCompare(t.date));+ if (!o.length) return "";+ let s = /* @__PURE__ */ new Date(`${o.at(-1).date}T00:00:00Z`), c = new Date(s);+ c.setUTCDate(c.getUTCDate() - 90);+ let l = new Map(o.map((e) => [e.date, e.count])), u = Math.max(1, ...o.map((e) => e.count)), d = Array.from({ length: 91 }, (e, t) => {+ let n = new Date(c);+ n.setUTCDate(c.getUTCDate() + t);+ let r = n.toISOString().slice(0, 10), i = l.get(r) || 0;+ return `<button type="button" data-heat-value="${i}" data-heat-label="${r}" aria-label="${r},${i} 次访问" style="--heat:${i ? Math.max(12, i / u * 100) : 0}%"></button>`;+ }).join("");+ return `<div class="board-activity-charts"><section class="board-heat-card" data-heat-card><header><h3>浏览活跃时间</h3><b data-heat-number>${i.toLocaleString()}</b><span data-heat-title data-heat-default="口味网站访问">口味网站访问</span></header><div class="board-heat-scroll"><div class="board-hour-grid"><span></span>${Array.from({ length: 24 }, (e, t) => `<span class="board-heat-axis">${t % 2 ? "" : t}</span>`).join("")}${a}</div></div><footer>星期 × 小时<span>${t(e.timezone || "UTC+08:00")}</span></footer></section><section class="board-heat-card" data-heat-card><header><h3>每日活跃</h3><b data-heat-number>${o.filter((e) => e.date >= c.toISOString().slice(0, 10)).reduce((e, t) => e + t.count, 0).toLocaleString()}</b><span data-heat-title data-heat-default="口味网站访问">口味网站访问</span></header><div class="board-day-grid">${d}</div><footer>${c.toISOString().slice(0, 10)}<span>${o.at(-1).date}</span></footer></section></div>`;+}+function Dt(e) {+ e.querySelectorAll("[data-heat-card]").forEach((e) => {+ let t = e.querySelector("[data-heat-number]"), n = e.querySelector("[data-heat-title]"), r = t.textContent;+ e.querySelectorAll("[data-heat-value]").forEach((e) => {+ let i = () => {+ t.textContent = Number(e.dataset.heatValue).toLocaleString(), n.textContent = e.dataset.heatLabel;+ }, a = () => {+ t.textContent = r, n.textContent = n.dataset.heatDefault;+ };+ e.addEventListener("pointerenter", i), e.addEventListener("pointerleave", a), e.addEventListener("focus", i), e.addEventListener("blur", a);+ });+ });}//#endregion//#region src/sidebar-groups.ts-var Re = (e) => e.replace(/[&<>"']/g, (e) => ({+var Ot = (e) => e.replace(/[&<>"']/g, (e) => ({"&": "&","<": "<",">": ">","\"": ""","'": "'"})[e]);-function ze(e, t, n = "", r = "") {+function kt(e, t, n = "", r = "") {if (!t) return "";let i = `sidebar-group-${encodeURIComponent(e)}`;- return `<details class="sec${r ? " cat-" + Re(r) : ""}" data-sidebar-group="${Re(e)}"><summary role="button" class="board-section-toggle"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-chevron-right"/></svg><span>${Re(e)}</span>${n}</summary><div class="board-sidebar-body" id="${i}">${t}</div></details>`;+ return `<details class="sec${r ? " cat-" + Ot(r) : ""}" data-sidebar-group="${Ot(e)}"><summary role="button" class="board-section-toggle"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-chevron-right"/></svg><span>${Ot(e)}</span>${n}</summary><div class="board-sidebar-body" id="${i}">${t}</div></details>`;}-function Be(e) {+function At(e) {e.querySelectorAll("[data-sidebar-group]").forEach((e) => {if (e.dataset.sidebarWired) return;e.dataset.sidebarWired = "true";@@ -422,7 +973,7 @@ function Be(e) {} catch {}let a = !!n.querySelector("[aria-pressed=true]");e.open = i === null ? a || e.classList.contains("cat-src") || e.dataset.sidebarGroup === "时长" : i === "open", t.querySelectorAll("button").forEach((e) => e.addEventListener("click", (e) => e.stopPropagation()));- }), f(e, "details[data-sidebar-group]", "sidebar-collapse"), e.querySelectorAll(".board-section-toggle").forEach((e) => {+ }), y(e, "details[data-sidebar-group]", "sidebar-collapse"), e.querySelectorAll(".board-section-toggle").forEach((e) => {e.dataset.persistWired || (e.dataset.persistWired = "true", e.addEventListener("click", () => {let t = `peach.sidebar.group.${e.closest("[data-sidebar-group]").dataset.sidebarGroup}`;try {@@ -431,32 +982,32 @@ function Be(e) {}));});}-var Ve = !1;-async function He(e, t) {- if (Ve) return;+var jt = !1;+async function Mt(e, t) {+ if (jt) return;if (!document.startViewTransition || matchMedia("(prefers-reduced-motion: reduce)").matches) {t();return;}let n = e.getBoundingClientRect(), r = n.left + n.width / 2, i = n.top + n.height / 2, a = Math.hypot(Math.max(r, innerWidth - r), Math.max(i, innerHeight - i)) * 2.5, o = document.createElement("style");- o.textContent = `::view-transition-old(root){animation:none}::view-transition-new(root){mix-blend-mode:normal;mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22b%22%20x%3D%22-50%25%22%20y%3D%22-50%25%22%20width%3D%22200%25%22%20height%3D%22200%25%22%3E%3CfeGaussianBlur%20stdDeviation%3D%222%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2242%22%20fill%3D%22white%22%20filter%3D%22url(%23b)%22%2F%3E%3C%2Fsvg%3E");mask-repeat:no-repeat;animation:peach-theme-reveal 820ms cubic-bezier(.16,1,.3,1) both}@keyframes peach-theme-reveal{from{mask-position:${r}px ${i}px;mask-size:0px 0px}to{mask-position:${r - a / 2}px ${i - a / 2}px;mask-size:${a}px ${a}px}}`, Ve = !0, document.head.append(o);+ o.textContent = `::view-transition-old(root){animation:none}::view-transition-new(root){mix-blend-mode:normal;mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22b%22%20x%3D%22-50%25%22%20y%3D%22-50%25%22%20width%3D%22200%25%22%20height%3D%22200%25%22%3E%3CfeGaussianBlur%20stdDeviation%3D%222%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2242%22%20fill%3D%22white%22%20filter%3D%22url(%23b)%22%2F%3E%3C%2Fsvg%3E");mask-repeat:no-repeat;animation:peach-theme-reveal 820ms cubic-bezier(.16,1,.3,1) both}@keyframes peach-theme-reveal{from{mask-position:${r}px ${i}px;mask-size:0px 0px}to{mask-position:${r - a / 2}px ${i - a / 2}px;mask-size:${a}px ${a}px}}`, jt = !0, document.head.append(o);try {await document.startViewTransition(t).finished;} catch {t();} finally {- o.remove(), Ve = !1;+ o.remove(), jt = !1;}}//#endregion//#region src/api.ts-var Ue = class extends Error {+var Nt = class extends Error {status;body;constructor(e, t, n = null) {- super(b(e, t)), this.name = "ApiError", this.status = t, this.body = n;+ super(o(e, t)), this.name = "ApiError", this.status = t, this.body = n;}-}, We = (e) => {+}, Pt = (e) => {if (!e || typeof e != "object") return "";let t = e;for (let e of [@@ -468,7 +1019,7 @@ var Ue = class extends Error {if (typeof n == "string" && n) return n;}return "";-}, B = (e) => b(e);+}, B = (e) => o(e);async function V(e, t) {let n = await fetch(e, {headers: { Accept: "application/json" },@@ -478,7 +1029,7 @@ async function V(e, t) {try {r = await n.json();} catch {}- if (!n.ok) throw new Ue(We(r) || `请求失败(${n.status})`, n.status);+ if (!n.ok) throw new Nt(Pt(r) || `请求失败(${n.status})`, n.status);return r;}async function H(e, t, n = "POST", r) {@@ -495,14 +1046,14 @@ async function H(e, t, n = "POST", r) {try {a = await i.json();} catch {}- if (!i.ok) throw new Ue(We(a) || `请求失败(${i.status})`, i.status, a);+ if (!i.ok) throw new Nt(Pt(a) || `请求失败(${i.status})`, i.status, a);return a;}//#endregion//#region node_modules/preact/hooks/dist/hooks.module.js-var Ge, U, Ke, qe, Je = 0, Ye = [], W = S, Xe = W.__b, Ze = W.__r, Qe = W.diffed, $e = W.__c, et = W.unmount, tt = W.__;-function nt(e, t) {- W.__h && W.__h(U, e, Je || t), Je = 0;+var Ft, U, It, Lt, Rt = 0, zt = [], W = S, Bt = W.__b, Vt = W.__r, Ht = W.diffed, Ut = W.__c, Wt = W.unmount, Gt = W.__;+function Kt(e, t) {+ W.__h && W.__h(U, e, Rt || t), Rt = 0;var n = U.__H || (U.__H = {__: [],__h: []@@ -510,11 +1061,11 @@ function nt(e, t) {return e >= n.__.length && n.__.push({}), n.__[e];}function G(e) {- return Je = 1, rt(dt, e);+ return Rt = 1, qt(tn, e);}-function rt(e, t, n) {- var r = nt(Ge++, 2);- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : dt(void 0, t), function(e) {+function qt(e, t, n) {+ var r = Kt(Ft++, 2);+ if (r.t = e, !r.__c && (r.__ = [n ? n(t) : tn(void 0, t), function(e) {var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));}], r.__c = U, !U.__f)) {@@ -546,97 +1097,97 @@ function rt(e, t, n) {return r.__N || r.__;}function K(e, t) {- var n = nt(Ge++, 3);- !W.__s && ut(n.__H, t) && (n.__ = e, n.u = t, U.__H.__h.push(n));+ var n = Kt(Ft++, 3);+ !W.__s && en(n.__H, t) && (n.__ = e, n.u = t, U.__H.__h.push(n));}function q(e, t) {- var n = nt(Ge++, 4);- !W.__s && ut(n.__H, t) && (n.__ = e, n.u = t, U.__h.push(n));+ var n = Kt(Ft++, 4);+ !W.__s && en(n.__H, t) && (n.__ = e, n.u = t, U.__h.push(n));}function J(e) {- return Je = 5, it(function() {+ return Rt = 5, Jt(function() {return { current: e };}, []);}-function it(e, t) {- var n = nt(Ge++, 7);- return ut(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;+function Jt(e, t) {+ var n = Kt(Ft++, 7);+ return en(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;}-function at() {- for (var e; e = Ye.shift();) {+function Yt() {+ for (var e; e = zt.shift();) {var t = e.__H;if (e.__P && t) try {- t.__h.some(ct), t.__h.some(lt), t.__h = [];+ t.__h.some(Qt), t.__h.some($t), t.__h = [];} catch (n) {t.__h = [], W.__e(n, e.__v);}}}W.__b = function(e) {- U = null, Xe && Xe(e);+ U = null, Bt && Bt(e);}, W.__ = function(e, t) {- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), tt && tt(e, t);+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Gt && Gt(e, t);}, W.__r = function(e) {- Ze && Ze(e), Ge = 0;+ Vt && Vt(e), Ft = 0;var t = (U = e.__c).__H;- t && (Ke === U ? (t.__h = [], U.__h = [], t.__.some(function(e) {+ t && (It === U ? (t.__h = [], U.__h = [], t.__.some(function(e) {e.__N && (e.__ = e.__N), e.u = e.__N = void 0;- })) : (t.__h.some(ct), t.__h.some(lt), t.__h = [], Ge = 0)), Ke = U;+ })) : (t.__h.some(Qt), t.__h.some($t), t.__h = [], Ft = 0)), It = U;}, W.diffed = function(e) {- Qe && Qe(e);+ Ht && Ht(e);var t = e.__c;- t && t.__H && (t.__H.__h.length && (Ye.push(t) !== 1 && qe === W.requestAnimationFrame || ((qe = W.requestAnimationFrame) || st)(at)), t.__H.__.some(function(e) {+ t && t.__H && (t.__H.__h.length && (zt.push(t) !== 1 && Lt === W.requestAnimationFrame || ((Lt = W.requestAnimationFrame) || Zt)(Yt)), t.__H.__.some(function(e) {e.u &&= (e.__H = e.u, void 0);- })), Ke = U = null;+ })), It = U = null;}, W.__c = function(e, t) {t.some(function(e) {try {- e.__h.some(ct), e.__h = e.__h.filter(function(e) {- return !e.__ || lt(e);+ e.__h.some(Qt), e.__h = e.__h.filter(function(e) {+ return !e.__ || $t(e);});} catch (n) {t.some(function(e) {e.__h &&= [];}), t = [], W.__e(n, e.__v);}- }), $e && $e(e, t);+ }), Ut && Ut(e, t);}, W.unmount = function(e) {- et && et(e);+ Wt && Wt(e);var t, n = e.__c;n && n.__H && (n.__H.__.some(function(e) {try {- ct(e);+ Qt(e);} catch (e) {t = e;}}), n.__H = void 0, t && W.__e(t, n.__v));};-var ot = typeof requestAnimationFrame == "function";-function st(e) {+var Xt = typeof requestAnimationFrame == "function";+function Zt(e) {var t, n = function() {- clearTimeout(r), ot && cancelAnimationFrame(t), setTimeout(e);+ clearTimeout(r), Xt && cancelAnimationFrame(t), setTimeout(e);}, r = setTimeout(n, 35);- ot && (t = requestAnimationFrame(n));+ Xt && (t = requestAnimationFrame(n));}-function ct(e) {+function Qt(e) {var t = U, n = e.__c;typeof n == "function" && (e.__c = void 0, n()), U = t;}-function lt(e) {+function $t(e) {var t = U;e.__c = e.__(), U = t;}-function ut(e, t) {+function en(e, t) {return !e || e.length !== t.length || t.some(function(t, n) {return t !== e[n];});}-function dt(e, t) {+function tn(e, t) {return typeof t == "function" ? t(e) : t;}//#endregion//#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js-var ft = 0;+var nn = 0;Array.isArray;function Y(e, t, n, r, i, a) {t ||= {};@@ -653,7 +1204,7 @@ function Y(e, t, n, r, i, a) {__e: null,__c: null,constructor: void 0,- __v: --ft,+ __v: --nn,__i: -1,__u: 0,__source: i,@@ -664,7 +1215,7 @@ function Y(e, t, n, r, i, a) {}//#endregion//#region src/islands/access-settings.tsx-function pt({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1, disabled: s = !1 }) {+function rn({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1, disabled: s = !1 }) {return /* @__PURE__ */ Y("div", {class: "configfield",children: [@@ -694,35 +1245,35 @@ function pt({ id: e, label: t, value: n, onInput: r, error: i, help: a, current:]});}-function mt({ initial: e, receipt: t }) {- let [n, r] = G(e), [a, s] = G(""), [c, l] = G(""), [u, f] = G(""), [p, m] = G(!1), [h, g] = G(""), [_, v] = G({}), y = J(null), b = J(!1), x = J(null);+function an({ initial: e, receipt: t }) {+ let [n, r] = G(e), [i, a] = G(""), [o, s] = G(""), [c, l] = G(""), [u, f] = G(!1), [m, h] = G(""), [g, _] = G({}), y = J(null), b = J(!1), x = J(null);return /* @__PURE__ */ Y("form", {class: "configfieldset",- "data-fieldset-type": p ? "warning" : void 0,+ "data-fieldset-type": u ? "warning" : void 0,onSubmit: async (e) => {if (e.preventDefault(), b.current) return;- g("");- let i = {};- if (n.mode === "password" && !a && (i.current_password = "请输入当前访问密码"), p || ((c.length < 8 || c.length > 256) && (i.password = "访问密码需为 8–256 个字符"), c !== u && (i.confirmation = "两次输入的密码不一致")), v(i), Object.keys(i).length) {+ h("");+ let d = {};+ if (n.mode === "password" && !i && (d.current_password = "请输入当前访问密码"), u || ((o.length < 8 || o.length > 256) && (d.password = "访问密码需为 8–256 个字符"), o !== c && (d.confirmation = "两次输入的密码不一致")), _(d), Object.keys(d).length) {requestAnimationFrame(() => y.current?.querySelector("[aria-invalid=\"true\"]")?.focus());return;}- b.current = !0, d(x.current, !0);+ b.current = !0, v(x.current, !0);try {let e = await H("/api/configuration/access", {revision: n.revision,- action: p ? "disable" : "set",- confirm_disable: p,- current_password: a,- password: p ? "" : c,- confirmation: p ? "" : u+ action: u ? "disable" : "set",+ confirm_disable: u,+ current_password: i,+ password: u ? "" : o,+ confirmation: u ? "" : c});- r(e), s(""), l(""), f(""), m(!1), v({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存访问密码");+ r(e), a(""), s(""), l(""), f(!1), _({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存访问密码");} catch (e) {- let t = e instanceof Ue ? e.body : null, n = t?.errors || t?.detail?.errors;- n ? v(n) : g(B(e));+ let t = e instanceof Nt ? e.body : null, n = t?.errors || t?.detail?.errors;+ n ? _(n) : h(B(e));} finally {- b.current = !1, d(x.current, !1);+ b.current = !1, v(x.current, !1);}},"aria-labelledby": "accessTitle",@@ -733,7 +1284,7 @@ function mt({ initial: e, receipt: t }) {children: [/* @__PURE__ */ Y("div", {class: "configfieldset-heading",- children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: i("accessTitle", "访问密码") } }), /* @__PURE__ */ Y("p", {+ children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("accessTitle", "访问密码") } }), /* @__PURE__ */ Y("p", {class: "confighelp",children: n.mode === "open" ? "未设置密码,能连接到 Peach 的设备可直接访问。" : n.mode === "legacy" ? "当前使用系统生成的访问口令。你可以设置自己的密码,或关闭登录要求。" : n.mode === "locked" ? "访问设置无法读取,请在本机检查配置文件。" : "已设置密码。新设备需要登录,保持登录时间在登录页选择。"})]@@ -744,8 +1295,8 @@ function mt({ initial: e, receipt: t }) {class: "pcheck",children: [/* @__PURE__ */ Y("input", {type: "checkbox",- checked: p,- onChange: (e) => m(e.currentTarget.checked)+ checked: u,+ onChange: (e) => f(e.currentTarget.checked)}), /* @__PURE__ */ Y("span", {"aria-hidden": "true",children: /* @__PURE__ */ Y("svg", {@@ -755,38 +1306,38 @@ function mt({ initial: e, receipt: t }) {})]}), /* @__PURE__ */ Y("span", { children: "关闭访问密码,允许能连接到 Peach 的设备直接访问" })]}) : null,- n.mode === "password" ? /* @__PURE__ */ Y(pt, {+ n.mode === "password" ? /* @__PURE__ */ Y(rn, {id: "access-current",label: "当前访问密码",- value: a,- onInput: s,- error: _.current_password,+ value: i,+ onInput: a,+ error: g.current_password,current: !0}) : null,- n.mode === "locked" ? null : /* @__PURE__ */ Y(L, { children: [/* @__PURE__ */ Y(pt, {+ n.mode === "locked" ? null : /* @__PURE__ */ Y(I, { children: [/* @__PURE__ */ Y(rn, {id: "access-password",label: n.mode === "password" ? "新访问密码" : "设置访问密码",- value: c,- onInput: l,- disabled: p,- error: p ? void 0 : _.password,- help: p ? "关闭访问密码时无需填写。" : "至少 8 个字符。保存后其他设备需要重新登录。"- }), /* @__PURE__ */ Y(pt, {+ value: o,+ onInput: s,+ disabled: u,+ error: u ? void 0 : g.password,+ help: u ? "关闭访问密码时无需填写。" : "至少 8 个字符。保存后其他设备需要重新登录。"+ }), /* @__PURE__ */ Y(rn, {id: "access-confirm",label: "确认访问密码",- value: u,- onInput: f,- disabled: p,- error: p ? void 0 : _.confirmation+ value: c,+ onInput: l,+ disabled: u,+ error: u ? void 0 : g.confirmation})] }),- p && /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: o("保存后,能连接到 Peach 的设备将直接访问馆藏。", {+ u && /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: p("保存后,能连接到 Peach 的设备将直接访问馆藏。", {variant: "warning",label: "访问范围"}) } }),- h ? /* @__PURE__ */ Y("p", {+ m ? /* @__PURE__ */ Y("p", {class: "configbad",role: "alert",- children: h+ children: m}) : null]}), n.mode === "locked" ? null : /* @__PURE__ */ Y("div", {@@ -802,7 +1353,7 @@ function mt({ initial: e, receipt: t }) {}//#endregion//#region src/islands/release-updates.tsx-var ht = /* @__PURE__ */ new Set([+var on = /* @__PURE__ */ new Set(["downloading","verifying","extracting",@@ -810,74 +1361,74 @@ var ht = /* @__PURE__ */ new Set(["restarting","installing"]);-function gt({ initial: e, initialJob: t }) {- let [r, a] = G(e), [c, l] = G(t || {+function sn({ initial: e, initialJob: t }) {+ let [n, r] = G(e), [i, a] = G(t || {state: "idle",progress: 0- }), [u, f] = G(""), p = J(null), m = J(!0), h = J(!1), g = J(null);+ }), [o, s] = G(""), c = J(null), u = J(!0), f = J(!1), h = J(null);K(() => {- d(g.current, ht.has(c.state));- }, [c.state]), K(() => () => {- m.current = !1, p.current?.abort();+ v(h.current, on.has(i.state));+ }, [i.state]), K(() => () => {+ u.current = !1, c.current?.abort();}, []);- let _ = async () => {+ let g = async () => {let e = await H("/api/configuration/update-restart", {});- m.current && l(e);+ u.current && a(e);};K(() => {- c.state !== "ready" || h.current || (h.current = !0, n({+ i.state !== "ready" || f.current || (f.current = !0, l({title: "更新已准备好",- body: `Peach ${c.version || ""} 将在重启后安装。`,+ body: `Peach ${i.version || ""} 将在重启后安装。`,confirmLabel: "立即重启",cancelLabel: "稍后",- onConfirm: _+ onConfirm: g}));- }, [c.state]), K(() => {- if (!ht.has(c.state)) return;- let e = new AbortController(), t, n = 0, r = async () => {+ }, [i.state]), K(() => {+ if (!on.has(i.state)) return;+ let e = new AbortController(), t, n = 0, o = async () => {try {let t = await V("/api/configuration/update-status", e.signal);- e.signal.aborted || (l(t), n = 0, t.state === "complete" && a((e) => ({+ e.signal.aborted || (a(t), n = 0, t.state === "complete" && r((e) => ({...e,current_version: t.version || e.current_version,state: "current",message: "已是最新测试版。"})));} catch {- ++n >= 120 && !e.signal.aborted && f("尚未连接到 Peach,请检查托盘后刷新页面。");+ ++n >= 120 && !e.signal.aborted && s("尚未连接到 Peach,请检查托盘后刷新页面。");}- !e.signal.aborted && n < 120 && (t = setTimeout(r, 1e3));+ !e.signal.aborted && n < 120 && (t = setTimeout(o, 1e3));};- return t = setTimeout(r, 1e3), () => {+ return t = setTimeout(o, 1e3), () => {e.abort(), clearTimeout(t);};- }, [c.state]);- let v = async (e) => {- if (p.current || ht.has(c.state)) return;+ }, [i.state]);+ let _ = async (e) => {+ if (c.current || on.has(i.state)) return;let t = new AbortController();- p.current = t, h.current = !1, f(""), d(e, !0);+ c.current = t, f.current = !1, s(""), v(e, !0);try {let e = await H("/api/configuration/update", {}, "POST", t.signal);- t.signal.aborted || l(e);+ t.signal.aborted || a(e);} catch (e) {- t.signal.aborted || f(B(e));+ t.signal.aborted || s(B(e));} finally {- p.current = null, d(e, !1);+ c.current = null, v(e, !1);}}, y = async (t) => {- if (p.current) return;+ if (c.current) return;let n = new AbortController();- p.current = n, d(t, !0), f("");+ c.current = n, v(t, !0), s("");try {let e = await V("/api/configuration/updates", n.signal);- n.signal.aborted || a(e);+ n.signal.aborted || r(e);} catch (t) {- n.signal.aborted || (a({+ n.signal.aborted || (r({...e,state: "error"- }), f(B(t)));+ }), s(B(t)));} finally {- p.current = null, d(t, !1);+ c.current = null, v(t, !1);}};return /* @__PURE__ */ Y("section", {@@ -887,35 +1438,35 @@ function gt({ initial: e, initialJob: t }) {children: [/* @__PURE__ */ Y("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: i("configUpdatesTitle", "检查更新") } }),+ /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("configUpdatesTitle", "检查更新") } }),/* @__PURE__ */ Y("dl", {class: "configfacts",children: [/* @__PURE__ */ Y("dt", { children: "当前版本" }),- /* @__PURE__ */ Y("dd", { children: r.current_version }),+ /* @__PURE__ */ Y("dd", { children: n.current_version }),/* @__PURE__ */ Y("dt", { children: "安装方式" }),- /* @__PURE__ */ Y("dd", { children: r.installation }),+ /* @__PURE__ */ Y("dd", { children: n.installation }),/* @__PURE__ */ Y("dt", { children: "更新通道" }),- /* @__PURE__ */ Y("dd", { children: r.channel }),+ /* @__PURE__ */ Y("dd", { children: n.channel }),/* @__PURE__ */ Y("dt", { children: "最新版本" }),- /* @__PURE__ */ Y("dd", { children: r.latest_version || (r.state === "unchecked" ? "尚未检查" : "未取得") })+ /* @__PURE__ */ Y("dd", { children: n.latest_version || (n.state === "unchecked" ? "尚未检查" : "未取得") })]}),- r.state === "available" && !u ? /* @__PURE__ */ Y("div", {+ n.state === "available" && !o ? /* @__PURE__ */ Y("div", {role: "status",- dangerouslySetInnerHTML: { __html: o(r.message, { label: "有可用更新" }) }+ dangerouslySetInnerHTML: { __html: p(n.message, { label: "有可用更新" }) }}) : /* @__PURE__ */ Y("p", {- class: u || r.state === "error" ? "configbad" : "confighelp",- role: u || r.state === "error" ? "alert" : "status",- children: u || r.message+ class: o || n.state === "error" ? "configbad" : "confighelp",+ role: o || n.state === "error" ? "alert" : "status",+ children: o || n.message}),- c.state === "idle" ? null : /* @__PURE__ */ Y("div", {+ i.state === "idle" ? null : /* @__PURE__ */ Y("div", {"aria-live": "polite",children: [/* @__PURE__ */ Y("p", {- class: c.state === "error" ? "configbad" : "confighelp",- children: c.message- }), c.state === "error" ? null : /* @__PURE__ */ Y(L, { children: [- /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: s("更新准备进度:下载、校验、解压、准备安装", c.progress, 100, { stops: [+ class: i.state === "error" ? "configbad" : "confighelp",+ children: i.message+ }), i.state === "error" ? null : /* @__PURE__ */ Y(I, { children: [+ /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: m("更新准备进度:下载、校验、解压、准备安装", i.progress, 100, { stops: [{value: 65,label: "下载结束"@@ -931,11 +1482,11 @@ function gt({ initial: e, initialJob: t }) {] }) } }),/* @__PURE__ */ Y("p", {class: "confighelp",- children: ["下载 → 校验 → 解压 → 准备安装 · ", c.message]+ children: ["下载 → 校验 → 解压 → 准备安装 · ", i.message]}),/* @__PURE__ */ Y("p", {class: "confighelp",- children: c.state === "downloading" && c.total ? `${((c.downloaded || 0) / 1048576).toFixed(1)} / ${(c.total / 1048576).toFixed(1)} MB` : `${c.progress}%`+ children: i.state === "downloading" && i.total ? `${((i.downloaded || 0) / 1048576).toFixed(1)} / ${(i.total / 1048576).toFixed(1)} MB` : `${i.progress}%`})] })]})@@ -946,7 +1497,7 @@ function gt({ initial: e, initialJob: t }) {children: [/* @__PURE__ */ Y("a", {class: "geist-button externallink",- href: r.release_url,+ href: n.release_url,target: "_blank",rel: "noreferrer",children: ["查看发布页", /* @__PURE__ */ Y("svg", {@@ -956,31 +1507,31 @@ function gt({ initial: e, initialJob: t }) {children: /* @__PURE__ */ Y("use", { href: "#i-external-link" })})]}),- c.state === "ready" ? /* @__PURE__ */ Y("button", {+ i.state === "ready" ? /* @__PURE__ */ Y("button", {type: "button",class: "geist-button primary",onClick: () => {- n({+ l({title: "更新已准备好",- body: `Peach ${c.version || ""} 将在重启后安装。`,+ body: `Peach ${i.version || ""} 将在重启后安装。`,confirmLabel: "立即重启",cancelLabel: "稍后",- onConfirm: _+ onConfirm: g});},children: "重启安装"}) : null,- r.state === "available" && r.installation === "独立测试包" && c.state !== "ready" ? /* @__PURE__ */ Y("button", {- ref: g,+ n.state === "available" && n.installation === "独立测试包" && i.state !== "ready" ? /* @__PURE__ */ Y("button", {+ ref: h,type: "button",class: "geist-button primary",- onClick: (e) => v(e.currentTarget),+ onClick: (e) => _(e.currentTarget),children: "下载并安装"}) : null,/* @__PURE__ */ Y("button", {type: "button",class: "geist-button",- disabled: ht.has(c.state),+ disabled: on.has(i.state),onClick: (e) => y(e.currentTarget),children: "检查更新"})@@ -990,11 +1541,11 @@ function gt({ initial: e, initialJob: t }) {}//#endregion//#region src/islands/peach-proxy.tsx-function _t({ initial: e, receipt: t }) {- let [n, r] = G(e), [a, o] = G(e.mode), [s, c] = G(""), [u, f] = G(""), m = J(!1), h = J(null), g = J(null), _ = J(new AbortController());- K(() => () => _.current.abort(), []), q(() => {- let t = h.current;- t.innerHTML = l([+function cn({ initial: e, receipt: t }) {+ let [n, r] = G(e), [i, a] = G(e.mode), [o, s] = G(""), [c, l] = G(""), u = J(!1), f = J(null), p = J(null), m = J(new AbortController());+ K(() => () => m.current.abort(), []), q(() => {+ let t = f.current;+ t.innerHTML = g([["environment", "系统代理"],["direct", "直连"],["proxy", "自定义"]@@ -1003,24 +1554,24 @@ function _t({ initial: e, receipt: t }) {className: "configselect",attr: "data-fixed-width"});- let n = p(t.firstElementChild), r = () => o(n.value);+ let n = b(t.firstElementChild), r = () => a(n.value);return n.addEventListener("change", r), () => {n.removeEventListener("change", r), t.replaceChildren();};}, []);- async function v() {- if (!m.current) {- m.current = !0, d(g.current, !0), f("");+ async function h() {+ if (!u.current) {+ u.current = !0, v(p.current, !0), l("");try {let e = await H("/api/configuration/peach-proxy", {- mode: a,- proxy: s- }, "POST", _.current.signal);- _.current.signal.aborted || (r(e), c(""), t("已保存 Peach 代理"));+ mode: i,+ proxy: o+ }, "POST", m.current.signal);+ m.current.signal.aborted || (r(e), s(""), t("已保存 Peach 代理"));} catch (e) {- _.current.signal.aborted || f(B(e));+ m.current.signal.aborted || l(B(e));} finally {- m.current = !1, d(g.current, !1);+ u.current = !1, v(p.current, !1);}}}@@ -1029,20 +1580,20 @@ function _t({ initial: e, receipt: t }) {class: "configfieldset","data-geist-fieldset": !0,onSubmit: (e) => {- e.preventDefault(), v();+ e.preventDefault(), h();},children: [/* @__PURE__ */ Y("div", {class: "geist-fieldset-content",children: [/* @__PURE__ */ Y("div", {class: "configfieldset-heading",- children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: i("peachProxyTitle", "Peach 代理") } }), /* @__PURE__ */ Y("p", {+ children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("peachProxyTitle", "Peach 代理") } }), /* @__PURE__ */ Y("p", {class: "confighelp",children: "采集来源选择“Peach 代理”时共用此设置。"})]}),- /* @__PURE__ */ Y("div", { ref: h }),- a === "proxy" && /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ Y("div", { ref: f }),+ i === "proxy" && /* @__PURE__ */ Y("div", {class: "configfield",children: [/* @__PURE__ */ Y("label", {htmlFor: "peachProxyAddress",@@ -1052,26 +1603,26 @@ function _t({ initial: e, receipt: t }) {class: "geist-input",type: "password",autoComplete: "off",- value: s,+ value: o,placeholder: n.proxy_saved ? "已保存,留空保留" : "http://127.0.0.1:7890",- onInput: (e) => c(e.currentTarget.value)+ onInput: (e) => s(e.currentTarget.value)})]}),n.needs_selection && /* @__PURE__ */ Y("p", {class: "configbad",children: "已有来源的代理地址不同,请选择公共连接方式。"}),- u && /* @__PURE__ */ Y("p", {+ c && /* @__PURE__ */ Y("p", {class: "configbad",role: "alert",- children: u+ children: c})]}), /* @__PURE__ */ Y("footer", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,children: /* @__PURE__ */ Y("button", {- ref: g,+ ref: p,class: "geist-button primary",type: "submit",children: "保存代理"@@ -1081,7 +1632,7 @@ function _t({ initial: e, receipt: t }) {}//#endregion//#region src/islands/desktop-settings.tsx-function vt({ label: e, checked: t, disabled: n, change: r }) {+function ln({ label: e, checked: t, disabled: n, change: r }) {return /* @__PURE__ */ Y("label", {class: "configcheck",children: [/* @__PURE__ */ Y("span", {@@ -1101,7 +1652,7 @@ function vt({ label: e, checked: t, disabled: n, change: r }) {}), /* @__PURE__ */ Y("span", { children: e })]});}-function yt({ label: e, checked: t, disabled: n, change: r }) {+function un({ label: e, checked: t, disabled: n, change: r }) {return /* @__PURE__ */ Y("label", {class: "configtoggle",children: [/* @__PURE__ */ Y("span", { children: e }), /* @__PURE__ */ Y("input", {@@ -1114,21 +1665,21 @@ function yt({ label: e, checked: t, disabled: n, change: r }) {})]});}-function bt({ startup: e, receipt: t }) {- let [n, r] = G(e.enabled), [a, o] = G(e.silent), [s, c] = G(e.desktop), [l, u] = G(""), f = J(!1), p = J(null), m = e.available && !e.desktop_message;- async function h() {- if (!f.current) {- f.current = !0, d(p.current, !0), u("");+function dn({ startup: e, receipt: t }) {+ let [n, r] = G(e.enabled), [i, a] = G(e.silent), [o, s] = G(e.desktop), [c, l] = G(""), u = J(!1), f = J(null), p = e.available && !e.desktop_message;+ async function m() {+ if (!u.current) {+ u.current = !0, v(f.current, !0), l("");try {await H("/api/configuration/startup", {enabled: n,- silent: a,- desktop: s+ silent: i,+ desktop: o}), t("已保存开机自启");} catch (e) {- u(B(e));+ l(B(e));} finally {- f.current = !1, d(p.current, !1);+ u.current = !1, v(f.current, !1);}}}@@ -1136,18 +1687,18 @@ function bt({ startup: e, receipt: t }) {class: "configfieldset","data-geist-fieldset": !0,onSubmit: (e) => {- e.preventDefault(), h();+ e.preventDefault(), m();},children: [/* @__PURE__ */ Y("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: i("startupTitle", "开机自启") } }),+ /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("startupTitle", "开机自启") } }),/* @__PURE__ */ Y("div", {class: "configoptions",role: "group","aria-labelledby": "startupTitle",children: [- /* @__PURE__ */ Y(yt, {+ /* @__PURE__ */ Y(un, {label: "开机后启动 Peach",checked: n,disabled: !e.available,@@ -1155,11 +1706,11 @@ function bt({ startup: e, receipt: t }) {}),/* @__PURE__ */ Y("div", {class: "configoption",- children: [/* @__PURE__ */ Y(yt, {+ children: [/* @__PURE__ */ Y(un, {label: "静默启动",- checked: a,+ checked: i,disabled: !e.available || !n,- change: o+ change: a}), /* @__PURE__ */ Y("p", {class: "confighelp",children: "静默启动仅显示托盘,开机后启动 Peach 打开时生效。"@@ -1167,11 +1718,11 @@ function bt({ startup: e, receipt: t }) {}),/* @__PURE__ */ Y("div", {class: "configoption",- children: [/* @__PURE__ */ Y(yt, {+ children: [/* @__PURE__ */ Y(un, {label: "在桌面创建快捷方式",- checked: s,- disabled: !m,- change: c+ checked: o,+ disabled: !p,+ change: s}), /* @__PURE__ */ Y("p", {class: "confighelp",children: e.desktop_message || "双击图标打开 Peach 网页;卸载时一并移除。"@@ -1183,17 +1734,17 @@ function bt({ startup: e, receipt: t }) {class: "confighelp",children: e.message}),- l && /* @__PURE__ */ Y("p", {+ c && /* @__PURE__ */ Y("p", {class: "configbad",role: "alert",- children: l+ children: c})]}), /* @__PURE__ */ Y("footer", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,children: /* @__PURE__ */ Y("button", {- ref: p,+ ref: f,type: "submit",class: "geist-button primary",disabled: !e.available,@@ -1202,24 +1753,24 @@ function bt({ startup: e, receipt: t }) {})]});}-function xt({ data: e }) {+function fn({ data: e }) {let t = J(null);return q(() => {let n = t.current, r = document.createElement("details");r.className = "configdirectories";let i = document.createElement("summary");- i.innerHTML = y("chevron-right") + "<span>数据目录</span>", r.append(i);+ i.innerHTML = a("chevron-right") + "<span>数据目录</span>", r.append(i);for (let t of [.../* @__PURE__ */ new Set([e.data_root, ...e.directories])]) {let e = document.createElement("p");e.className = "confighelp", e.textContent = t, r.append(e);}- return n.replaceChildren(r), f(n, "details", "uninstall-data"), () => n.replaceChildren();+ return n.replaceChildren(r), y(n, "details", "uninstall-data"), () => n.replaceChildren();}, [e]), /* @__PURE__ */ Y("div", { ref: t });}-function St({ uninstall: e }) {- let [t, r] = G(!1), [a, o] = G("");- async function s() {- await n({+function pn({ uninstall: e }) {+ let [t, n] = G(!1), [r, i] = G("");+ async function a() {+ await l({title: "卸载 Peach",danger: !0,body: t ? "将退出 Peach,移除程序、开机自启、桌面图标、设置、本地数据库、观看记录、凭据和缓存。原始媒体文件保留。" : "将退出 Peach 并移除程序、开机自启和桌面图标。设置、本地数据库、观看记录与缓存保留。",@@ -1229,7 +1780,7 @@ function St({ uninstall: e }) {delete_data: t,confirmation: "卸载 Peach"});- o(e.message);+ i(e.message);}});}@@ -1243,26 +1794,26 @@ function St({ uninstall: e }) {children: [/* @__PURE__ */ Y("div", {class: "configfieldset-heading",- children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: i("uninstallTitle", "卸载 Peach") } }), e.available && /* @__PURE__ */ Y("p", {+ children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("uninstallTitle", "卸载 Peach") } }), e.available && /* @__PURE__ */ Y("p", {class: "confighelp",children: "卸载会退出 Peach、移除程序、开机自启和桌面图标。原始媒体文件保留。"})]}),- /* @__PURE__ */ Y(vt, {+ /* @__PURE__ */ Y(ln, {label: "完全卸载:同时删除设置、本地数据库、观看记录、凭据和缓存",checked: t,- disabled: !e.full_available || !!a,- change: r+ disabled: !e.full_available || !!r,+ change: n}),- /* @__PURE__ */ Y(xt, { data: e }),+ /* @__PURE__ */ Y(fn, { data: e }),e.message && /* @__PURE__ */ Y("p", {class: "confighelp",children: e.message}),- a && /* @__PURE__ */ Y("p", {+ r && /* @__PURE__ */ Y("p", {class: "confighelp",role: "status",- children: a+ children: r})]}), /* @__PURE__ */ Y("footer", {@@ -1271,8 +1822,8 @@ function St({ uninstall: e }) {children: /* @__PURE__ */ Y("button", {type: "button",class: "geist-button danger",- disabled: !e.available || !!a,- onClick: () => void s(),+ disabled: !e.available || !!r,+ onClick: () => void a(),children: "卸载 Peach"})})]@@ -1280,7 +1831,7 @@ function St({ uninstall: e }) {}//#endregion//#region src/islands/clouddrive-guide.tsx-var Ct = [+var mn = [{name: "机械硬盘,或内存 8 GB 以内",cache: "10–20 GiB",@@ -1300,10 +1851,10 @@ var Ct = [task: "2 个起步"}];-function wt() {+function hn() {let e = J(null);return q(() => {- e.current && f(e.current, "details", "clouddrive-guide");+ e.current && y(e.current, "details", "clouddrive-guide");}, []), /* @__PURE__ */ Y("div", {ref: e,class: "cloudguide",@@ -1352,7 +1903,7 @@ function wt() {scope: "col",children: "同时处理视频"})- ] }) }), /* @__PURE__ */ Y("tbody", { children: Ct.map((e) => /* @__PURE__ */ Y("tr", { children: [+ ] }) }), /* @__PURE__ */ Y("tbody", { children: mn.map((e) => /* @__PURE__ */ Y("tr", { children: [/* @__PURE__ */ Y("th", {scope: "row",children: e.name@@ -1396,20 +1947,20 @@ function wt() {}//#endregion//#region src/islands/configuration.tsx-var Tt = "/api/configuration", Et = "/api/pick-folder", Dt = 8e3, Ot = (e, t) => V(Tt, t), kt = ({ html: e, class: t }) => /* @__PURE__ */ Y("div", {+var gn = "/api/configuration", _n = "/api/pick-folder", vn = 8e3, yn = (e, t) => V(gn, t), bn = ({ html: e, class: t }) => /* @__PURE__ */ Y("div", {class: t,dangerouslySetInnerHTML: { __html: e }-}), At = (e) => !(e instanceof Ue) || e.status !== 400 ? null : e.body?.errors ?? null;-function jt({ facts: e }) {+}), xn = (e) => !(e instanceof Nt) || e.status !== 400 ? null : e.body?.errors ?? null;+function Sn({ facts: e }) {return /* @__PURE__ */ Y("section", {class: "configfieldset","data-geist-fieldset": !0,"aria-labelledby": "configFactsTitle",children: /* @__PURE__ */ Y("div", {class: "geist-fieldset-content",- children: [/* @__PURE__ */ Y(kt, { html: i("configFactsTitle", "运行信息") }), /* @__PURE__ */ Y("dl", {+ children: [/* @__PURE__ */ Y(bn, { html: d("configFactsTitle", "运行信息") }), /* @__PURE__ */ Y("dl", {class: "configfacts",- children: e.map((e) => /* @__PURE__ */ Y(L, { children: [/* @__PURE__ */ Y("dt", { children: e.term }), /* @__PURE__ */ Y("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ Y("span", {+ children: e.map((e) => /* @__PURE__ */ Y(I, { children: [/* @__PURE__ */ Y("dt", { children: e.term }), /* @__PURE__ */ Y("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ Y("span", {class: "confighelp",children: [" ", /* @__PURE__ */ Y("a", {class: "externallink",@@ -1428,51 +1979,51 @@ function jt({ facts: e }) {})});}-function Mt({ data: t }) {- let [n, r] = G(t.media_sources), [a, o] = G(""), s = J(null);- K(() => () => s.current?.abort(), []);- let c = async (e) => {- if (s.current) return;+function Cn({ data: e }) {+ let [t, n] = G(e.media_sources), [r, i] = G(""), a = J(null);+ K(() => () => a.current?.abort(), []);+ let o = async (e) => {+ if (a.current) return;let t = new AbortController();- s.current = t, d(e, !0), o("");+ a.current = t, v(e, !0), i("");try {- let e = await V(Tt, t.signal);- t.signal.aborted || r(e.media_sources);+ let e = await V(gn, t.signal);+ t.signal.aborted || n(e.media_sources);} catch (e) {- t.signal.aborted || o(B(e));+ t.signal.aborted || i(B(e));} finally {- s.current = null, d(e, !1);+ a.current = null, v(e, !1);}};- return n ? /* @__PURE__ */ Y("section", {+ return t ? /* @__PURE__ */ Y("section", {class: "configfieldset","aria-labelledby": "configMountsTitle",children: [/* @__PURE__ */ Y("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ Y(kt, { html: i("configMountsTitle", "挂载状态") }),+ /* @__PURE__ */ Y(bn, { html: d("configMountsTitle", "挂载状态") }),/* @__PURE__ */ Y("dl", {class: "configfacts",- children: n.map((t) => /* @__PURE__ */ Y(L, { children: [/* @__PURE__ */ Y("dt", { children: [/* @__PURE__ */ Y("span", {+ children: t.map((e) => /* @__PURE__ */ Y(I, { children: [/* @__PURE__ */ Y("dt", { children: [/* @__PURE__ */ Y("span", {"aria-hidden": "true",- dangerouslySetInnerHTML: { __html: u(e[t.location]) }+ dangerouslySetInnerHTML: { __html: _(s[e.location]) }}), {local: "本地磁盘",115: "CloudDrive · 115",pikpak: "CloudDrive · PikPak"- }[t.location] || t.location] }), /* @__PURE__ */ Y("dd", { children: [- t.path || "未配置挂载点",+ }[e.location] || e.location] }), /* @__PURE__ */ Y("dd", { children: [+ e.path || "未配置挂载点"," ",/* @__PURE__ */ Y("span", {- class: `configstatus ${t.online === !0 ? "online" : t.online === !1 ? "offline" : "unknown"}`,- children: t.online === !0 ? "在线" : t.online === !1 ? "离线" : "未检测"+ class: `configstatus ${e.online === !0 ? "online" : e.online === !1 ? "offline" : "unknown"}`,+ children: e.online === !0 ? "在线" : e.online === !1 ? "离线" : "未检测"})] })] }))}),- a ? /* @__PURE__ */ Y("p", {+ r ? /* @__PURE__ */ Y("p", {class: "configbad",role: "alert",- children: a+ children: r}) : null]}), /* @__PURE__ */ Y("div", {@@ -1481,17 +2032,17 @@ function Mt({ data: t }) {children: /* @__PURE__ */ Y("button", {type: "button",class: "geist-button",- onClick: (e) => c(e.currentTarget),+ onClick: (e) => o(e.currentTarget),children: "刷新挂载状态"})})]}) : null;}-function Nt({ value: t, label: n, onChange: r, libraryIcon: i = !1 }) {- let a = J(null), o = J(null), s = J(r);- return s.current = r, q(() => {- let r = a.current;- r.innerHTML = l((i ? [+function wn({ value: e, label: t, onChange: n, libraryIcon: r = !1 }) {+ let i = J(null), a = J(null), o = J(n);+ return o.current = n, q(() => {+ let n = i.current;+ n.innerHTML = g((r ? [["", "自动识别"],["hard-drive", "磁盘"],["database", "资料库"],@@ -1504,59 +2055,59 @@ function Nt({ value: t, label: n, onChange: r, libraryIcon: i = !1 }) {["local", "本地磁盘"],["115", "CloudDrive · 115"],["pikpak", "CloudDrive · PikPak"]- ]).map(([t, n]) => [+ ]).map(([e, t]) => [+ e,t,- n,- e[t] || t || "database"- ]), t, { label: n });- let c = p(r.firstElementChild);- o.current = c;- let u = () => s.current(c.value);- return c.addEventListener("change", u), () => {- o.current = null, c.disabled = !0, c.removeEventListener("change", u), r.replaceChildren();+ s[e] || e || "database"+ ]), e, { label: t });+ let c = b(n.firstElementChild);+ a.current = c;+ let l = () => o.current(c.value);+ return c.addEventListener("change", l), () => {+ a.current = null, c.disabled = !0, c.removeEventListener("change", l), n.replaceChildren();};- }, [n, i]), q(() => {- o.current && (o.current.value = t);- }, [t]), /* @__PURE__ */ Y("div", {- ref: a,+ }, [t, r]), q(() => {+ a.current && (a.current.value = e);+ }, [e]), /* @__PURE__ */ Y("div", {+ ref: i,class: "configsourcecontrol"});}-function Pt({ data: e, receipt: t }) {+function Tn({ data: e, receipt: t }) {let n = e.media_sources?.filter((e) => ["local","115","pikpak"- ].includes(e.location)), [r, a] = G(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [s, c] = G(n?.map((e) => e.location) ?? []), [l, u] = G(n?.map((e) => e.root) ?? []), [f, p] = G(n?.map((e) => e.library || "") ?? []), [m, h] = G(n?.map((e) => e.library_icon || "") ?? []), [g, _] = G(String(e.port)), [v, y] = G(!1), [b, x] = G([]), [S, C] = G(""), [w, T] = G(""), [E, D] = G(null), [O, k] = G(null), A = J(!1), j = J(e.revision), ee = J([]), M = J(null);+ ].includes(e.location)), [r, i] = G(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [a, o] = G(n?.map((e) => e.location) ?? []), [s, c] = G(n?.map((e) => e.root) ?? []), [l, u] = G(n?.map((e) => e.library || "") ?? []), [f, m] = G(n?.map((e) => e.library_icon || "") ?? []), [h, g] = G(String(e.port)), [_, y] = G(!1), [b, x] = G([]), [S, C] = G(""), [w, T] = G(""), [E, D] = G(null), [O, k] = G(null), A = J(!1), j = J(e.revision), ee = J([]), M = J(null);q(() => {O !== null && (ee.current[O]?.focus(), k(null));}, [O]), K(() => {if (!E) return;- let e = setTimeout(() => location.assign(E.url), Dt);+ let e = setTimeout(() => location.assign(E.url), vn);return () => clearTimeout(e);}, [E]);let N = (e, t) => {- a((n) => n.map((n, r) => r === e ? t : n));+ i((n) => n.map((n, r) => r === e ? t : n));}, P = () => {- k(r.length), a((e) => [...e, ""]);- }, F = (e) => {- c((t) => t.filter((t, n) => n !== e)), u((t) => t.filter((t, n) => n !== e)), p((t) => t.filter((t, n) => n !== e)), h((t) => t.filter((t, n) => n !== e)), a((t) => t.filter((t, n) => n !== e)), x((t) => t.filter((t, n) => n !== e));- }, te = (e, t) => {+ k(r.length), i((e) => [...e, ""]);+ }, te = (e) => {+ o((t) => t.filter((t, n) => n !== e)), c((t) => t.filter((t, n) => n !== e)), u((t) => t.filter((t, n) => n !== e)), m((t) => t.filter((t, n) => n !== e)), i((t) => t.filter((t, n) => n !== e)), x((t) => t.filter((t, n) => n !== e));+ }, ne = (e, t) => {x((n) => {let r = [...n];for (; r.length <= e;) r.push("");return r[e] = t, r;});- }, ne = async (e, t) => {+ }, re = async (e, t) => {if (t.getAttribute("aria-busy") !== "true") {- d(t, !0);+ v(t, !0);try {- let { path: t } = await H(Et, { initial: r[e] ?? "" });- t && (N(e, t), te(e, ""));+ let { path: t } = await H(_n, { initial: r[e] ?? "" });+ t && (N(e, t), ne(e, ""));} catch (t) {- te(e, B(t));+ ne(e, B(t));} finally {- d(t, !1);+ v(t, !1);}}};@@ -1585,27 +2136,27 @@ function Pt({ data: e, receipt: t }) {"aria-labelledby": "configTitle",onSubmit: async (n) => {if (n.preventDefault(), !A.current) {- A.current = !0, d(M.current, !0), T("");+ A.current = !0, v(M.current, !0), T("");try {- let n = await H(Tt, {+ let n = await H(gn, {revision: j.current,media_dirs: r,...e.media_sources ? { media_sources: r.map((e, t) => ({path: e,- location: s[t] || "local",- root: l[t] || "",- library: f[t] || "",- library_icon: m[t] || ""+ location: a[t] || "local",+ root: s[t] || "",+ library: l[t] || "",+ library_icon: f[t] || ""})) } : {},- port: g,- scan_now: v+ port: h,+ scan_now: _});j.current = n.revision, x([]), C(""), t("已保存配置"), D(n);} catch (e) {- let t = At(e);+ let t = xn(e);t ? (x(t.media_dirs ?? []), C(t.port ?? "")) : (x([]), C(""), T(B(e)));} finally {- A.current = !1, d(M.current, !1);+ A.current = !1, v(M.current, !1);}}},@@ -1613,7 +2164,7 @@ function Pt({ data: e, receipt: t }) {children: [/* @__PURE__ */ Y("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ Y(kt, { html: i("configTitle", "这台电脑") }),+ /* @__PURE__ */ Y(bn, { html: d("configTitle", "这台电脑") }),/* @__PURE__ */ Y("div", {class: "configfield",children: [@@ -1648,7 +2199,7 @@ function Pt({ data: e, receipt: t }) {type: "button",class: "geist-button configpick","aria-label": "选择文件夹",- onClick: (e) => ne(n, e.currentTarget),+ onClick: (e) => re(n, e.currentTarget),children: /* @__PURE__ */ Y("svg", {viewBox: "0 0 24 24","aria-hidden": "true",@@ -1659,7 +2210,7 @@ function Pt({ data: e, receipt: t }) {type: "button",class: "geist-button configrm danger","aria-label": "移除这个文件夹",- onClick: () => F(n),+ onClick: () => te(n),children: /* @__PURE__ */ Y("svg", {viewBox: "0 0 24 24","aria-hidden": "true",@@ -1673,44 +2224,44 @@ function Pt({ data: e, receipt: t }) {class: "geist-input","aria-label": `媒体库 ${n + 1}`,maxLength: 80,- value: f[n] || "",+ value: l[n] || "",placeholder: "同名文件夹归入同一个媒体库",onInput: (e) => {- let t = [...f];- t[n] = e.currentTarget.value, p(t);+ let t = [...l];+ t[n] = e.currentTarget.value, u(t);}})] }),/* @__PURE__ */ Y("div", {class: "configsourcelabel",- children: ["媒体库图标", /* @__PURE__ */ Y(Nt, {+ children: ["媒体库图标", /* @__PURE__ */ Y(wn, {libraryIcon: !0,label: `媒体库图标 ${n + 1}`,- value: m[n] || "",+ value: f[n] || "",onChange: (e) => {- let t = [...m];- t[n] = e, h(t);+ let t = [...f];+ t[n] = e, m(t);}})]}),/* @__PURE__ */ Y("div", {class: "configsourcelabel",- children: ["媒体来源", /* @__PURE__ */ Y(Nt, {+ children: ["媒体来源", /* @__PURE__ */ Y(wn, {label: `媒体来源 ${n + 1}`,- value: s[n] || "local",+ value: a[n] || "local",onChange: (e) => {- let t = [...s];- t[n] = e, c(t);+ let t = [...a];+ t[n] = e, o(t);}})]}),e.windows === !1 ? /* @__PURE__ */ Y("label", { children: ["Windows 中的对应路径", /* @__PURE__ */ Y("input", {class: "geist-input","aria-label": `Windows 中的对应路径 ${n + 1}`,- value: l[n] || "",+ value: s[n] || "",placeholder: "例如 B:\\\\",onInput: (e) => {- let t = [...l];- t[n] = e.currentTarget.value, u(t);+ let t = [...s];+ t[n] = e.currentTarget.value, c(t);}})] }) : null]@@ -1729,8 +2280,8 @@ function Pt({ data: e, receipt: t }) {onClick: P,children: "添加文件夹"}),- s.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ Y(wt, {}) : null,- s.some((e) => e === "115" || e === "pikpak") ? e.mount_dependencies?.filter((e) => !e.available).map((e) => /* @__PURE__ */ Y("p", {+ a.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ Y(hn, {}) : null,+ a.some((e) => e === "115" || e === "pikpak") ? e.mount_dependencies?.filter((e) => !e.available).map((e) => /* @__PURE__ */ Y("p", {class: "confighelp",children: ["未检测到 ",@@ -1772,9 +2323,9 @@ function Pt({ data: e, receipt: t }) {class: "geist-input",type: "text",inputMode: "numeric",- value: g,+ value: h,"aria-invalid": S ? "true" : void 0,- onInput: (e) => _(e.currentTarget.value)+ onInput: (e) => g(e.currentTarget.value)}),S ? /* @__PURE__ */ Y("p", {class: "configbad",@@ -1793,7 +2344,7 @@ function Pt({ data: e, receipt: t }) {class: "pcheck",children: [/* @__PURE__ */ Y("input", {type: "checkbox",- checked: v,+ checked: _,onChange: (e) => y(e.currentTarget.checked)}), /* @__PURE__ */ Y("span", {"aria-hidden": "true",@@ -1804,7 +2355,7 @@ function Pt({ data: e, receipt: t }) {})]}), /* @__PURE__ */ Y("span", { children: "保存后扫描并补全资料" })]}),- w ? /* @__PURE__ */ Y(kt, { html: o(w, {+ w ? /* @__PURE__ */ Y(bn, { html: p(w, {variant: "error",label: "没有保存"}) }) : null@@ -1821,10 +2372,10 @@ function Pt({ data: e, receipt: t }) {})]});}-function Ft({ receipt: e, data: t, error: n }) {- return n || !t ? /* @__PURE__ */ Y(kt, {+function En({ receipt: e, data: t, error: n }) {+ return n || !t ? /* @__PURE__ */ Y(bn, {class: "configpage",- html: o(n || "没有读到配置", {+ html: p(n || "没有读到配置", {variant: "error",label: "打不开配置"})@@ -1835,7 +2386,7 @@ function Ft({ receipt: e, data: t, error: n }) {class: "configgroup",children: "通用"}) : null,- t.startup ? /* @__PURE__ */ Y(bt, {+ t.startup ? /* @__PURE__ */ Y(dn, {startup: t.startup,receipt: e}) : null,@@ -1843,23 +2394,23 @@ function Ft({ receipt: e, data: t, error: n }) {class: "configgroup",children: "媒体"}),- t.editable ? /* @__PURE__ */ Y(Pt, {+ t.editable ? /* @__PURE__ */ Y(Tn, {data: t,receipt: e- }) : /* @__PURE__ */ Y(kt, { html: o(t.notice, {+ }) : /* @__PURE__ */ Y(bn, { html: p(t.notice, {variant: "secondary",label: "只读"}) }),- /* @__PURE__ */ Y(Mt, { data: t }),+ /* @__PURE__ */ Y(Cn, { data: t }),t.peach_proxy || t.access ? /* @__PURE__ */ Y("h2", {class: "configgroup",children: "网络与访问"}) : null,- t.peach_proxy ? /* @__PURE__ */ Y(_t, {+ t.peach_proxy ? /* @__PURE__ */ Y(cn, {initial: t.peach_proxy,receipt: e}) : null,- t.access ? /* @__PURE__ */ Y(mt, {+ t.access ? /* @__PURE__ */ Y(an, {initial: t.access,receipt: e}) : null,@@ -1867,34 +2418,34 @@ function Ft({ receipt: e, data: t, error: n }) {class: "configgroup",children: "更新与维护"}),- t.updates ? /* @__PURE__ */ Y(gt, {+ t.updates ? /* @__PURE__ */ Y(sn, {initial: t.updates,initialJob: t.update_job}) : null,- /* @__PURE__ */ Y(jt, { facts: t.facts }),- t.uninstall ? /* @__PURE__ */ Y(St, { uninstall: t.uninstall }) : null+ /* @__PURE__ */ Y(Sn, { facts: t.facts }),+ t.uninstall ? /* @__PURE__ */ Y(pn, { uninstall: t.uninstall }) : null]});}//#endregion//#region node_modules/@preact/signals-core/dist/signals-core.module.js-var It = Symbol.for("preact-signals");-function Lt() {+var Dn = Symbol.for("preact-signals");+function On() {if (Z > 1) Z--;else {var e, t = !1;for ((function() {- var e = Gt;- for (Gt = void 0; e !== void 0;) {+ var e = In;+ for (In = void 0; e !== void 0;) {var t = e.S;if (t.v === e.v) for (var n = t.t; n !== void 0; n = n.x) n.i === e.i && (n.i = t.i);e = e.o;}- })(); Vt !== void 0;) {- var n = Vt;- for (Vt = void 0, Ht++; n !== void 0;) {+ })(); Mn !== void 0;) {+ var n = Mn;+ for (Mn = void 0, Nn++; n !== void 0;) {var r = n.u;- if (n.u = void 0, n.f &= -3, !(8 & n.f) && Yt(n)) try {+ if (n.u = void 0, n.f &= -3, !(8 & n.f) && Bn(n)) try {n.c();} catch (n) {t ||= (e = n, !0);@@ -1902,30 +2453,30 @@ function Lt() {n = r;}}- if (Ht = 0, Z--, t) throw e;+ if (Nn = 0, Z--, t) throw e;}}-function Rt(e) {+function kn(e) {if (Z > 0) return e();- Wt = ++Ut, Z++;+ Fn = ++Pn, Z++;try {return e();} finally {- Lt();+ On();}}-var zt, X = void 0;-function Bt(e) {- var t = X, n = zt;- X = void 0, zt = void 0;+var An, X = void 0;+function jn(e) {+ var t = X, n = An;+ X = void 0, An = void 0;try {return e();} finally {- X = t, zt = n;+ X = t, An = n;}}-var Vt = void 0, Z = 0, Ht = 0, Ut = 0, Wt = 0, Gt = void 0, Kt = 0;-function qt(e) {+var Mn = void 0, Z = 0, Nn = 0, Pn = 0, Fn = 0, In = void 0, Ln = 0;+function Rn(e) {if (X !== void 0) {var t = e.n;if (t === void 0 || t.t !== X) return t = {@@ -1944,11 +2495,11 @@ function qt(e) {function Q(e, t) {this.v = e, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = t?.watched, this.Z = t?.unwatched, this.name = t?.name;}-Q.prototype.brand = It, Q.prototype.h = function() {+Q.prototype.brand = Dn, Q.prototype.h = function() {return !0;}, Q.prototype.S = function(e) {var t = this, n = this.t;- n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? Bt(function() {+ n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? jn(function() {var e;(e = t.W) == null || e.call(t);}) : n.e = e);@@ -1956,16 +2507,16 @@ Q.prototype.brand = It, Q.prototype.h = function() {var t = this;if (this.t !== void 0) {var n = e.e, r = e.x;- n !== void 0 && (n.x = r, e.e = void 0), r !== void 0 && (r.e = n, e.x = void 0), e === this.t && (this.t = r, r === void 0 && Bt(function() {+ n !== void 0 && (n.x = r, e.e = void 0), r !== void 0 && (r.e = n, e.x = void 0), e === this.t && (this.t = r, r === void 0 && jn(function() {var e;(e = t.Z) == null || e.call(t);}));}}, Q.prototype.subscribe = function(e) {var t = this;- return an(function() {+ return Yn(function() {var n = t.value;- Bt(function() {+ jn(function() {return e(n);});}, { name: "sub" });@@ -1977,41 +2528,41 @@ Q.prototype.brand = It, Q.prototype.h = function() {return this.value;}, Q.prototype.peek = function() {var e = this;- return Bt(function() {+ return jn(function() {return e.value;});}, Object.defineProperty(Q.prototype, "value", {get: function() {- var e = qt(this);+ var e = Rn(this);return e !== void 0 && (e.i = this.i), this.v;},set: function(e) {if (e !== this.v) {- if (Ht > 100) throw Error("Cycle detected");+ if (Nn > 100) throw Error("Cycle detected");(function(e) {- Z !== 0 && Ht === 0 && e.l !== Wt && (e.l = Wt, Gt = {+ Z !== 0 && Nn === 0 && e.l !== Fn && (e.l = Fn, In = {S: e,v: e.v,i: e.i,- o: Gt+ o: In});- })(this), this.v = e, this.i++, Kt++, Z++;+ })(this), this.v = e, this.i++, Ln++, Z++;try {for (var t = this.t; t !== void 0; t = t.x) t.t.N();} finally {- Lt();+ On();}}}});-function Jt(e, t) {+function zn(e, t) {return new Q(e, t);}-function Yt(e) {+function Bn(e) {for (var t = e.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;return !1;}-function Xt(e) {+function Vn(e) {for (var t = e.s; t !== void 0; t = t.n) {var n = t.S.n;if (n !== void 0 && (t.r = n), t.S.n = t, t.i = -1, t.n === void 0) {@@ -2020,55 +2571,55 @@ function Xt(e) {}}}-function Zt(e) {+function Hn(e) {for (var t = e.s, n = void 0; t !== void 0;) {var r = t.p;t.i === -1 ? (t.S.U(t), r !== void 0 && (r.n = t.n), t.n !== void 0 && (t.n.p = r)) : n = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = r;}e.s = n;}-function Qt(e, t) {- Q.call(this, void 0, t), this.x = e, this.s = void 0, this.g = Kt - 1, this.f = 4;+function Un(e, t) {+ Q.call(this, void 0, t), this.x = e, this.s = void 0, this.g = Ln - 1, this.f = 4;}-Qt.prototype = new Q(), Qt.prototype.h = function() {+Un.prototype = new Q(), Un.prototype.h = function() {if (this.f &= -3, 1 & this.f) return !1;- if ((36 & this.f) == 32 || (this.f &= -5, this.g === Kt)) return !0;- if (this.g = Kt, this.f |= 1, this.i > 0 && !Yt(this)) return this.f &= -2, !0;+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === Ln)) return !0;+ if (this.g = Ln, this.f |= 1, this.i > 0 && !Bn(this)) return this.f &= -2, !0;var e = X;try {- Xt(this), X = this;+ Vn(this), X = this;var t = this.x();(16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);} catch (e) {this.v = e, this.f |= 16, this.i++;}- return X = e, Zt(this), this.f &= -2, !0;-}, Qt.prototype.S = function(e) {+ return X = e, Hn(this), this.f &= -2, !0;+}, Un.prototype.S = function(e) {if (this.t === void 0) {this.f |= 36;for (var t = this.s; t !== void 0; t = t.n) t.S.S(t);}Q.prototype.S.call(this, e);-}, Qt.prototype.U = function(e) {+}, Un.prototype.U = function(e) {if (this.t !== void 0 && (Q.prototype.U.call(this, e), this.t === void 0)) {this.f &= -33;for (var t = this.s; t !== void 0; t = t.n) t.S.U(t);}-}, Qt.prototype.N = function() {+}, Un.prototype.N = function() {if (!(2 & this.f)) {this.f |= 6;for (var e = this.t; e !== void 0; e = e.x) e.t.N();}-}, Object.defineProperty(Qt.prototype, "value", { get: function() {+}, Object.defineProperty(Un.prototype, "value", { get: function() {if (1 & this.f) throw Error("Cycle detected");- var e = qt(this);+ var e = Rn(this);if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;return this.v;} });-function $t(e, t) {- return new Qt(e, t);+function Wn(e, t) {+ return new Un(e, t);}-function en(e) {+function Gn(e) {var t = e.m;if (e.m = void 0, typeof t == "function") {Z++;@@ -2077,24 +2628,24 @@ function en(e) {try {t();} catch (t) {- throw e.f &= -2, e.f |= 8, tn(e), t;+ throw e.f &= -2, e.f |= 8, Kn(e), t;} finally {- X = n, Lt();+ X = n, On();}}}-function tn(e) {+function Kn(e) {for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);- e.x = void 0, e.s = void 0, en(e);+ e.x = void 0, e.s = void 0, Gn(e);}-function nn(e) {+function qn(e) {if (X !== this) throw Error("Out-of-order effect");- Zt(this), X = e, this.f &= -2, 8 & this.f && tn(this), Lt();+ Hn(this), X = e, this.f &= -2, 8 & this.f && Kn(this), On();}-function rn(e, t) {- this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, zt && zt.push(this);+function Jn(e, t) {+ this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, An && An.push(this);}-rn.prototype.c = function() {+Jn.prototype.c = function() {var e = this.S();try {if (8 & this.f || this.x === void 0) return;@@ -2103,20 +2654,20 @@ rn.prototype.c = function() {} finally {e();}-}, rn.prototype.S = function() {+}, Jn.prototype.S = function() {if (1 & this.f) throw Error("Cycle detected");- this.f |= 1, this.f &= -9, en(this), Xt(this), Z++;+ this.f |= 1, this.f &= -9, Gn(this), Vn(this), Z++;var e = X;- return X = this, nn.bind(this, e);-}, rn.prototype.N = function() {- 2 & this.f || (this.f |= 2, this.u = Vt, Vt = this);-}, rn.prototype.d = function() {- this.f |= 8, 1 & this.f || tn(this);-}, rn.prototype.dispose = function() {+ return X = this, qn.bind(this, e);+}, Jn.prototype.N = function() {+ 2 & this.f || (this.f |= 2, this.u = Mn, Mn = this);+}, Jn.prototype.d = function() {+ this.f |= 8, 1 & this.f || Kn(this);+}, Jn.prototype.dispose = function() {this.d();};-function an(e, t) {- var n = new rn(e, t);+function Yn(e, t) {+ var n = new Jn(e, t);try {n.c();} catch (e) {@@ -2127,35 +2678,35 @@ function an(e, t) {}//#endregion//#region node_modules/@preact/signals/dist/signals.module.js-var on, sn, cn = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, ln = [];-an(function() {- on = this.N;+var Xn, Zn, Qn = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, $n = [];+Yn(function() {+ Xn = this.N;})();-function un(e, t) {+function er(e, t) {S[e] = t.bind(null, S[e] || function() {});}-function dn(e) {- if (sn) {- var t = sn;- sn = void 0, t();+function tr(e) {+ if (Zn) {+ var t = Zn;+ Zn = void 0, t();}- sn = e && e.S();+ Zn = e && e.S();}-function fn(e) {- var t = this, n = e.data, r = mn(n);+function nr(e) {+ var t = this, n = e.data, r = ir(n);r.name = "ReactiveDom", r.value = n;- var i = it(function() {+ var i = Jt(function() {for (var e = t, n = t.__v; n = n.__;) if (n.__c) {n.__c.__$f |= 4;break;}- var i = $t(function() {+ var i = Wn(function() {var e = r.value.value;return e === 0 ? 0 : !0 === e ? "" : e || "";- }), a = $t(function() {+ }), a = Wn(function() {return !Array.isArray(i.value) && !w(i.value);- }), o = an(function() {- if (this.N = _n, a.value) {+ }), o = Yn(function() {+ if (this.N = sr, a.value) {var t = i.value;e.__v && e.__v.__e && e.__v.__e.nodeType === 3 && (e.__v.__e.data = t);}@@ -2166,14 +2717,14 @@ function fn(e) {}, []), a = i[0], o = i[1];return a.value ? o.peek() : o.value;}-fn.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {+nr.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {constructor: {configurable: !0,value: void 0},type: {configurable: !0,- value: fn+ value: nr},props: {configurable: !0,@@ -2188,7 +2739,7 @@ fn.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {configurable: !0,value: 1}-}), un("__b", function(e, t) {+}), er("__b", function(e, t) {if (typeof t.type == "string") {var n, r = t.props;for (var i in r) if (i !== "children") {@@ -2197,26 +2748,26 @@ fn.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {}}e(t);-}), un("__r", function(e, t) {- if (e(t), t.type !== L) {- dn();+}), er("__r", function(e, t) {+ if (e(t), t.type !== I) {+ tr();var n, r = t.__c;r && (r.__$f &= -2, (n = r.__$u) === void 0 && (r.__$u = n = function(e, t) {var n;- return an(function() {+ return Yn(function() {n = this;}, { name: t }), n.c = e, n;}(function(e) {return function() {var t;- cn && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});+ Qn && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});};- }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), dn(n);+ }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), tr(n);}-}), un("__e", function(e, t, n, r) {- dn(), e(t, n, r);-}), un("diffed", function(e, t) {- dn();+}), er("__e", function(e, t, n, r) {+ tr(), e(t, n, r);+}), er("diffed", function(e, t) {+ tr();var n;if (typeof t.type == "string" && (n = t.__e)) {var r = t.__np, i = t.props, a = n.U;@@ -2226,25 +2777,25 @@ fn.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {}if (r) for (var c in a || (a = {}, n.U = a), r) {var l = a[c], u = r[c];- l === void 0 ? (l = pn(n, c, u, i), a[c] = l) : l.o(u, i);+ l === void 0 ? (l = rr(n, c, u, i), a[c] = l) : l.o(u, i);}}e(t);});-function pn(e, t, n, r) {- var i = t in e && e.ownerSVGElement === void 0, a = Jt(n);+function rr(e, t, n, r) {+ var i = t in e && e.ownerSVGElement === void 0, a = zn(n);return {o: function(e, t) {a.value = e, r = t;},- d: an(function() {- this.N = _n;+ d: Yn(function() {+ this.N = sr;var n = a.value.value;r[t] !== n && (r[t] = n, i ? e[t] = n : n != null && (!1 !== n || t[4] === "-") ? e.setAttribute(t, n) : e.removeAttribute(t));})};}-un("unmount", function(e, t) {+er("unmount", function(e, t) {if (typeof t.type == "string") {var n = t.__e;if (n) {@@ -2268,9 +2819,9 @@ un("unmount", function(e, t) {}}e(t);-}), un("__h", function(e, t, n, r) {+}), er("__h", function(e, t, n, r) {r < 3 && (t.__$f |= 2), e(t, n, r);-}), se.prototype.shouldComponentUpdate = function(e, t) {+}), ce.prototype.shouldComponentUpdate = function(e, t) {if (this.__R) return !0;var n = this.__$u, r = n && n.s !== void 0;for (var i in t) return !0;@@ -2282,44 +2833,44 @@ un("unmount", function(e, t) {for (var s in this.props) if (!(s in e)) return !0;return !1;};-function mn(e, t) {- return it(function() {- return Jt(e, t);+function ir(e, t) {+ return Jt(function() {+ return zn(e, t);}, []);}-var hn = function(e) {+var ar = function(e) {queueMicrotask(function() {queueMicrotask(e);});};-function gn() {- Rt(function() {- for (var e; e = ln.shift();) on.call(e);+function or() {+ kn(function() {+ for (var e; e = $n.shift();) Xn.call(e);});}-function _n() {- ln.push(this) === 1 && (S.requestAnimationFrame || hn)(gn);+function sr() {+ $n.push(this) === 1 && (S.requestAnimationFrame || ar)(or);}//#endregion//#region src/state/quality-goals.ts-var vn = "/api/quality-goals?limit=200", yn = {+var cr = "/api/quality-goals?limit=200", lr = {data: null,error: ""-}, bn = Jt(yn), xn = 0, Sn = $t(() => bn.value);-$t(() => bn.value.data?.total ?? null);-function Cn() {- xn += 1, bn.value = yn;+}, ur = zn(lr), dr = 0, fr = Wn(() => ur.value);+Wn(() => ur.value.data?.total ?? null);+function pr() {+ dr += 1, ur.value = lr;}-async function wn(e) {- let t = xn += 1;+async function mr(e) {+ let t = dr += 1;try {- let n = await V(vn, e);- return t === xn && (bn.value = {+ let n = await V(cr, e);+ return t === dr && (ur.value = {data: n,error: ""}), n;} catch (n) {- throw !e?.aborted && t === xn && (bn.value = {+ throw !e?.aborted && t === dr && (ur.value = {data: null,error: B(n)}), n;@@ -2327,28 +2878,28 @@ async function wn(e) {}//#endregion//#region src/islands/quality-goals.tsx-var Tn = (e, t) => wn(t), En = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;-function Dn({ openItem: e, javTitleHtml: t, javDisplayName: n, srcBadge: i }) {- let { data: a, error: s } = Sn.value;- if (s) return /* @__PURE__ */ Y("div", {+var hr = (e, t) => mr(t), gr = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;+function _r({ openItem: t, javTitleHtml: n, javDisplayName: a, srcBadge: o }) {+ let { data: s, error: c } = fr.value;+ if (c) return /* @__PURE__ */ Y("div", {class: "qualitylist",- dangerouslySetInnerHTML: { __html: o(s, {+ dangerouslySetInnerHTML: { __html: p(c, {variant: "error",label: "读取失败"}) }});- let c = a?.items ?? [];- return c.length ? /* @__PURE__ */ Y("div", {+ let l = s?.items ?? [];+ return l.length ? /* @__PURE__ */ Y("div", {class: "qualitylist",- children: c.map((r) => /* @__PURE__ */ Y("article", {+ children: l.map((s) => /* @__PURE__ */ Y("article", {class: "qualityitem",children: [/* @__PURE__ */ Y("button", {class: "qualitycover",type: "button",- "aria-label": `打开 ${n(r)}`,- onClick: () => e(r.id),+ "aria-label": `打开 ${a(s)}`,+ onClick: () => t(s.id),children: /* @__PURE__ */ Y("img", {- src: En(r),+ src: gr(s),alt: "",loading: "lazy",onError: (e) => e.currentTarget.remove()@@ -2357,32 +2908,32 @@ function Dn({ openItem: e, javTitleHtml: t, javDisplayName: n, srcBadge: i }) {/* @__PURE__ */ Y("h3", { children: /* @__PURE__ */ Y("button", {type: "button","data-middle-truncate": !0,- onClick: () => e(r.id),- dangerouslySetInnerHTML: { __html: t(r) }+ onClick: () => t(s.id),+ dangerouslySetInnerHTML: { __html: n(s) }}) }),/* @__PURE__ */ Y("p", {class: "mono",children: [/* @__PURE__ */ Y("span", {style: "display:contents",- dangerouslySetInnerHTML: { __html: i(r.location, r.cost) }+ dangerouslySetInnerHTML: { __html: o(s.location, s.cost) }}),- /* @__PURE__ */ Y("span", { children: m[r.location] ?? r.location }),- /* @__PURE__ */ Y("span", { children: _(r.duration) }),- /* @__PURE__ */ Y("span", { children: v(r.size ?? 0) })+ /* @__PURE__ */ Y("span", { children: e[s.location] ?? s.location }),+ /* @__PURE__ */ Y("span", { children: r(s.duration) }),+ /* @__PURE__ */ Y("span", { children: i(s.size ?? 0) })]}),- r.reason ? /* @__PURE__ */ Y("p", { children: r.reason }) : null+ s.reason ? /* @__PURE__ */ Y("p", { children: s.reason }) : null] })]- }, r.id))+ }, s.id))}) : /* @__PURE__ */ Y("div", {class: "qualitylist",- dangerouslySetInnerHTML: { __html: r("sparkles", "没有标记中的高清版目标", "现有版本都已满足条件,或还没有加入追踪。") }+ dangerouslySetInnerHTML: { __html: u("sparkles", "没有标记中的高清版目标", "现有版本都已满足条件,或还没有加入追踪。") }});}//#endregion//#region src/jobs.ts-async function On(e) {+async function vr(e) {let t = e.pause || ((e) => new Promise((t) => setTimeout(t, e))), n = 0;for (; e.active();) {let r;@@ -2397,11 +2948,11 @@ async function On(e) {await t(2e3);}}-function kn(e) {+function yr(e) {let t = document.createElement("div");e.host.hidden = !0, t.dataset.followJob = "", t.setAttribute("aria-live", "polite"), e.host.prepend(t);let n = e.storageKey || "peach-follow-job", r = sessionStorage.getItem(n) || void 0, i = !1;- On({+ vr({read: e.read,active: () => !i && e.active() && t.isConnected,keepWatching: e.watchIdle !== !1,@@ -2427,13 +2978,13 @@ function kn(e) {}//#endregion//#region src/islands/scraping.tsx-var An = (e, t) => V("/api/scraping", t);-function jn({ value: e, onChange: t }) {+var br = (e, t) => V("/api/scraping", t);+function xr({ value: e, onChange: t }) {let n = J(null), r = J(t);return r.current = t, q(() => {let t = n.current;- t.innerHTML = l([["peach", "Peach 代理"], ["direct", "直接连接"]], e, { label: "连接方式" });- let i = p(t.firstElementChild), a = () => r.current(i.value);+ t.innerHTML = g([["peach", "Peach 代理"], ["direct", "直接连接"]], e, { label: "连接方式" });+ let i = b(t.firstElementChild), a = () => r.current(i.value);return i.addEventListener("change", a), () => {i.disabled = !0, i.removeEventListener("change", a), t.replaceChildren();};@@ -2442,29 +2993,29 @@ function jn({ value: e, onChange: t }) {class: "scraping-network"});}-function Mn({ source: e, toast: t }) {- let [n, r] = G(e), [a, s] = G(e.network), [c, l] = G(""), [u, f] = G(""), [p, m] = G("paste"), [h, _] = G(""), [v, y] = G(!1), [b, x] = G(""), [S, C] = G([]), w = J(null), T = J(null);+function Sr({ source: e, toast: t }) {+ let [r, i] = G(e), [a, o] = G(e.network), [s, c] = G(""), [l, u] = G(""), [f, m] = G("paste"), [h, g] = G(""), [_, y] = G(!1), [b, x] = G(""), [S, C] = G([]), w = J(null), T = J(null);q(() => {- T.current?.querySelectorAll("footer button").forEach((e) => d(e, v));- }, [v]);+ T.current?.querySelectorAll("footer button").forEach((e) => v(e, _));+ }, [_]);let E = J(new AbortController());K(() => () => E.current.abort(), []);async function D(n) {- if (!v) {+ if (!_) {y(!0), x(""), C([]);try {if (n === "check") {let t = await H("/api/scraping/check", { source: e.source }, "POST", E.current.signal);E.current.signal.aborted || C(t.results);} else {- let i = await H("/api/scraping/settings", {+ let r = await H("/api/scraping/settings", {source: e.source,network: a,- cookie: c,- cookies_text: u,+ cookie: s,+ cookies_text: l,revoke: n === "revoke"}, "POST", E.current.signal);- E.current.signal.aborted || (r(i.saved), l(""), f(""), _(""), w.current && (w.current.value = ""), t(n === "revoke" ? "Cookie 已撤销" : "来源设置已保存"));+ E.current.signal.aborted || (i(r.saved), c(""), u(""), g(""), w.current && (w.current.value = ""), t(n === "revoke" ? "Cookie 已撤销" : "来源设置已保存"));}} catch (e) {E.current.signal.aborted || x(B(e));@@ -2487,14 +3038,14 @@ function Mn({ source: e, toast: t }) {children: [/* @__PURE__ */ Y("div", {class: "geist-fieldset-heading",- children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: i(`scraping-${e.source}`, e.label) } }), /* @__PURE__ */ Y("a", {+ children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d(`scraping-${e.source}`, e.label) } }), /* @__PURE__ */ Y("a", {class: "scraping-url externallink",href: e.login,target: "_blank",rel: "noopener noreferrer",children: [/* @__PURE__ */ Y("img", {- src: g(e.login),+ src: n(e.login),alt: "",width: "16",height: "16",@@ -2513,9 +3064,9 @@ function Mn({ source: e, toast: t }) {}),/* @__PURE__ */ Y("div", {class: "scraping-label",- children: ["连接方式", /* @__PURE__ */ Y(jn, {+ children: ["连接方式", /* @__PURE__ */ Y(xr, {value: a,- onChange: s+ onChange: o})]}),a === "peach" && /* @__PURE__ */ Y("a", {@@ -2523,8 +3074,8 @@ function Mn({ source: e, toast: t }) {href: "/configuration#peachProxy",children: "配置 Peach 代理"}),- e.accepts_cookie && /* @__PURE__ */ Y(L, { children: [- /* @__PURE__ */ Y("p", { children: n.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),+ e.accepts_cookie && /* @__PURE__ */ Y(I, { children: [+ /* @__PURE__ */ Y("p", { children: r.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),/* @__PURE__ */ Y("div", {class: "insightswitch scraping-cookie-method",role: "radiogroup",@@ -2533,19 +3084,19 @@ function Mn({ source: e, toast: t }) {type: "radio",name: `cookie-method-${e.source}`,value: t,- checked: p === t,+ checked: f === t,onChange: () => {- m(t), l(""), f(""), _("");+ m(t), c(""), u(""), g("");}}), /* @__PURE__ */ Y("span", { children: n })] }, t))}),- p === "paste" ? /* @__PURE__ */ Y("label", { children: ["Cookie", /* @__PURE__ */ Y("input", {+ f === "paste" ? /* @__PURE__ */ Y("label", { children: ["Cookie", /* @__PURE__ */ Y("input", {class: "geist-input",type: "password",autoComplete: "off",- value: c,- disabled: v,- onInput: (e) => l(e.currentTarget.value)+ value: s,+ disabled: _,+ onInput: (e) => c(e.currentTarget.value)})] }) : /* @__PURE__ */ Y("label", {class: "scraping-file",children: ["Netscape Cookie 文件(.txt)", /* @__PURE__ */ Y("span", {@@ -2563,21 +3114,21 @@ function Mn({ source: e, toast: t }) {ref: w,type: "file",accept: ".txt",- disabled: v,+ disabled: _,onChange: async (e) => {let t = e.currentTarget.files?.[0];if (!t) {- f(""), _("");+ u(""), g("");return;}- if (f(""), t.size > 262144) {+ if (u(""), t.size > 262144) {x("Cookie 文本超过 256 KiB"), e.currentTarget.value = "";return;}y(!0);try {let e = await t.text();- E.current.signal.aborted || (f(e), _(t.name));+ E.current.signal.aborted || (u(e), g(t.name));} catch {E.current.signal.aborted || x("Cookie 文件未读取,请重新选择");} finally {@@ -2591,18 +3142,18 @@ function Mn({ source: e, toast: t }) {] }),b && /* @__PURE__ */ Y("div", {role: "alert",- dangerouslySetInnerHTML: { __html: o(b, { variant: "error" }) }+ dangerouslySetInnerHTML: { __html: p(b, { variant: "error" }) }}),S.map((t) => /* @__PURE__ */ Y("div", {role: "status",- dangerouslySetInnerHTML: { __html: o(`${e.label}${t.label === "来源页面" ? "" : " 高清图片"}:${t.ok ? "可连接" : "不能连接"}` + (t.width ? ` · ${t.width} × ${t.height}` : "") + (t.message ? `。${t.message}` : ""), { variant: t.ok ? "success" : "error" }) }+ dangerouslySetInnerHTML: { __html: p(`${e.label}${t.label === "来源页面" ? "" : " 高清图片"}:${t.ok ? "可连接" : "不能连接"}` + (t.width ? ` · ${t.width} × ${t.height}` : "") + (t.message ? `。${t.message}` : ""), { variant: t.ok ? "success" : "error" }) }}, t.label))]}), /* @__PURE__ */ Y("footer", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,children: [- e.accepts_cookie && n.cookie_saved && /* @__PURE__ */ Y("button", {+ e.accepts_cookie && r.cookie_saved && /* @__PURE__ */ Y("button", {class: "geist-button",type: "button",onClick: () => void D("revoke"),@@ -2624,35 +3175,35 @@ function Mn({ source: e, toast: t }) {})});}-function Nn({ data: e, error: t, toast: n }) {- let [r, a] = G(""), [s, c] = G(!1), [l, u] = G(""), f = J(null);- q(() => d(f.current, s), [s]);- let p = J(new AbortController()), m = J(0);- async function h(e = !1) {- let t = ++m.current;- await On({+function Cr({ data: e, error: t, toast: n }) {+ let [r, i] = G(""), [a, o] = G(!1), [s, c] = G(""), l = J(null);+ q(() => v(l.current, a), [a]);+ let u = J(new AbortController()), f = J(0);+ async function m(e = !1) {+ let t = ++f.current;+ await vr({read: (e) => V("/api/scraping/cover", e),- active: () => !p.current.signal.aborted && t === m.current,+ active: () => !u.current.signal.aborted && t === f.current,render: (t) => {- c(t.status === "running"), t.status === "running" && (e = !1), t.status === "failed" && !e && u(t.error || "采集未取得"), t.status === "complete" && !e && n(t.result || "封面采集完成");+ o(t.status === "running"), t.status === "running" && (e = !1), t.status === "failed" && !e && c(t.error || "采集未取得"), t.status === "complete" && !e && n(t.result || "封面采集完成");},- disconnected: () => u("连接中断,正在重新读取后台进度")+ disconnected: () => c("连接中断,正在重新读取后台进度")});}- K(() => (h(!0), () => p.current.abort()), []);- async function g() {- if (!s) {- m.current++, c(!0), u("");+ K(() => (m(!0), () => u.current.abort()), []);+ async function h() {+ if (!a) {+ f.current++, o(!0), c("");try {- await H("/api/scraping/cover", { code: r }, "POST", p.current.signal), await h();+ await H("/api/scraping/cover", { code: r }, "POST", u.current.signal), await m();} catch (e) {- p.current.signal.aborted || (c(!1), u(B(e)));+ u.current.signal.aborted || (o(!1), c(B(e)));}}}return t ? /* @__PURE__ */ Y("div", {role: "alert",- dangerouslySetInnerHTML: { __html: o(t, { variant: "error" }) }+ dangerouslySetInnerHTML: { __html: p(t, { variant: "error" }) }}) : /* @__PURE__ */ Y("div", {class: "scraping-page",children: [@@ -2663,35 +3214,35 @@ function Nn({ data: e, error: t, toast: n }) {children: /* @__PURE__ */ Y("div", {class: "geist-fieldset-content scraping-fields",children: [- /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: i("scraping-cover", "高清封面") } }),+ /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("scraping-cover", "高清封面") } }),/* @__PURE__ */ Y("form", {class: "scraping-cover-form",onSubmit: (e) => {- e.preventDefault(), g();+ e.preventDefault(), h();},children: [/* @__PURE__ */ Y("input", {class: "geist-input","aria-label": "馆藏番号",required: !0,value: r,- disabled: s,+ disabled: a,placeholder: "输入馆藏番号,如 ABW-232",- onInput: (e) => a(e.currentTarget.value)+ onInput: (e) => i(e.currentTarget.value)}), /* @__PURE__ */ Y("button", {- ref: f,+ ref: l,class: "geist-button primary",type: "submit",children: "抓取封面"})]}),- l && /* @__PURE__ */ Y("div", {+ s && /* @__PURE__ */ Y("div", {role: "alert",- dangerouslySetInnerHTML: { __html: o(l, { variant: "error" }) }+ dangerouslySetInnerHTML: { __html: p(s, { variant: "error" }) }})]})}),- e?.sources.map((e) => /* @__PURE__ */ Y(Mn, {+ e?.sources.map((e) => /* @__PURE__ */ Y(Sr, {source: e,toast: n}, e.source))@@ -2700,67 +3251,67 @@ function Nn({ data: e, error: t, toast: n }) {}//#endregion//#region src/islands/library-processing.tsx-var Pn = (e, t) => V("/api/library-processing", t);-function Fn({ data: e, error: t, toast: n, onComplete: r, mode: s, monitor: l }) {- let [u, f] = G(e || { status: "idle" }), [p, m] = G(t), [h, g] = G(!1), [_, v] = G(!1), y = J(new AbortController()), b = J(0), x = J(u.status), S = J(null), C = h || u.status === "running";- q(() => d(S.current, C), [C]);+var wr = (e, t) => V("/api/library-processing", t);+function Tr({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a }) {+ let [o, s] = G(e || { status: "idle" }), [c, l] = G(t), [u, m] = G(!1), [g, _] = G(!1), y = J(new AbortController()), b = J(0), x = J(o.status), S = J(null), C = u || o.status === "running";+ q(() => v(S.current, C), [C]);async function w() {let e = ++b.current;- await On({+ await vr({read: (e) => V("/api/library-processing", e),active: () => !y.current.signal.aborted && b.current === e,- keepWatching: s === "notice" || !!l,+ keepWatching: i === "notice" || !!a,render: (e) => {- f(e), m(""), e.status === "complete" && x.current === "running" && s !== "notice" && (v(!0), n("已完成扫描与资料采集")), x.current === "running" && (e.status === "complete" || e.status === "failed") && r?.(), x.current = e.status;+ s(e), l(""), e.status === "complete" && x.current === "running" && i !== "notice" && (_(!0), n("已完成扫描与资料采集")), x.current === "running" && (e.status === "complete" || e.status === "failed") && r?.(), x.current = e.status;},- disconnected: () => m("连接中断,正在重新读取处理进度")+ disconnected: () => l("连接中断,正在重新读取处理进度")});}- K(() => ((u.status === "running" || s === "notice" || l) && w(), () => y.current.abort()), []);+ K(() => ((o.status === "running" || i === "notice" || a) && w(), () => y.current.abort()), []);async function T() {if (!C) {- g(!0), m(""), v(!1);+ m(!0), l(""), _(!1);try {let e = await H("/api/library-processing", {}, "POST", y.current.signal);if (y.current.signal.aborted) return;- x.current = e.status, f(e), g(!1), await w();+ x.current = e.status, s(e), m(!1), await w();} catch (e) {- y.current.signal.aborted || (m(B(e)), g(!1));+ y.current.signal.aborted || (l(B(e)), m(!1));}}}- if (s === "notice") {- if (!p && u.status !== "running" && u.status !== "failed") return null;- let e = p || (u.status === "failed" ? "扫描与资料采集未完成" : `${u.stage || "正在整理馆藏"}${u.total ? ` · ${u.checked || 0} / ${u.total}` : ""}`);- return /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: c(e, {- variant: u.status === "failed" ? "error" : p ? "warning" : "gray",+ if (i === "notice") {+ if (!c && o.status !== "running" && o.status !== "failed") return null;+ let e = c || (o.status === "failed" ? "扫描与资料采集未完成" : `${o.stage || "正在整理馆藏"}${o.total ? ` · ${o.checked || 0} / ${o.total}` : ""}`);+ return /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: h(e, {+ variant: o.status === "failed" ? "error" : c ? "warning" : "gray",href: "/data-cleanup#libraryProcessing",- label: p || u.status === "failed" ? "查看并处理" : "查看进度",- value: u.checked || 0,- ...u.status === "running" && u.total !== void 0 ? { max: u.total } : {}+ label: c || o.status === "failed" ? "查看并处理" : "查看进度",+ value: o.checked || 0,+ ...o.status === "running" && o.total !== void 0 ? { max: o.total } : {}}) } });}- return /* @__PURE__ */ Y(L, { children: [/* @__PURE__ */ Y("div", {+ return /* @__PURE__ */ Y(I, { children: [/* @__PURE__ */ Y("div", {class: "geist-fieldset-content library-processing",children: [- /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: i("cleanupScrapingTitle", "扫描与采集") } }),+ /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("cleanupScrapingTitle", "扫描与采集") } }),/* @__PURE__ */ Y("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),/* @__PURE__ */ Y("div", {"aria-live": "polite",children: [- u.status === "running" && /* @__PURE__ */ Y(L, { children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: a(`${u.stage || "正在处理"}${u.total ? ` · ${u.checked || 0} / ${u.total}` : ""}`) } }), !!u.total && /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: Pe(`已处理 ${u.checked || 0} / ${u.total} 个视频`, u.checked || 0, u.total) } })] }),- (p || u.status === "failed") && /* @__PURE__ */ Y("div", {+ o.status === "running" && /* @__PURE__ */ Y(I, { children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: f(`${o.stage || "正在处理"}${o.total ? ` · ${o.checked || 0} / ${o.total}` : ""}`) } }), !!o.total && /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: Fe(`已处理 ${o.checked || 0} / ${o.total} 个视频`, o.checked || 0, o.total) } })] }),+ (c || o.status === "failed") && /* @__PURE__ */ Y("div", {role: "alert",onClick: (e) => {e.target.closest("[data-note-action]") && T();},- dangerouslySetInnerHTML: { __html: o(p || u.error || "处理未完成,请重试", {+ dangerouslySetInnerHTML: { __html: p(c || o.error || "处理未完成,请重试", {variant: "error",filled: !0,- actionLabel: u.status === "failed" ? "重试未完成项" : ""+ actionLabel: o.status === "failed" ? "重试未完成项" : ""}) }}),- u.status === "failed" && !!u.issues?.length && /* @__PURE__ */ Y("ul", { children: u.issues.slice(0, 20).map((e) => /* @__PURE__ */ Y("li", { children: [+ o.status === "failed" && !!o.issues?.length && /* @__PURE__ */ Y("ul", { children: o.issues.slice(0, 20).map((e) => /* @__PURE__ */ Y("li", { children: [e.asset_id ? /* @__PURE__ */ Y("a", {href: `/item/${e.asset_id}`,children: "查看视频"@@ -2768,9 +3319,9 @@ function Fn({ data: e, error: t, toast: n, onComplete: r, mode: s, monitor: l })e.asset_id ? ":" : "",e.message] })) }),- _ && /* @__PURE__ */ Y("div", {+ g && /* @__PURE__ */ Y("div", {class: "library-processing-result",- dangerouslySetInnerHTML: { __html: o(`已扫描 ${u.scanned || 0} 个文件,识别 ${u.identified || 0} 个番号,整理 ${u.candidates || 0} 组资料候选。`, {+ dangerouslySetInnerHTML: { __html: p(`已扫描 ${o.scanned || 0} 个文件,识别 ${o.identified || 0} 个番号,整理 ${o.candidates || 0} 组资料候选。`, {variant: "success",label: "处理完成"}) }@@ -2787,12 +3338,12 @@ function Fn({ data: e, error: t, toast: n, onComplete: r, mode: s, monitor: l })href: "/scraping",children: "采集来源"}),- !!u.candidates && /* @__PURE__ */ Y("a", {+ !!o.candidates && /* @__PURE__ */ Y("a", {class: "geist-button",href: "/review",children: "复核资料"}),- u.status !== "failed" && /* @__PURE__ */ Y("button", {+ o.status !== "failed" && /* @__PURE__ */ Y("button", {ref: S,type: "button",class: "geist-button primary",@@ -2804,12 +3355,12 @@ function Fn({ data: e, error: t, toast: n, onComplete: r, mode: s, monitor: l })}//#endregion//#region src/state/index.ts-var In = { "quality-goals": {- refresh: wn,- reset: Cn-} }, Ln = () => Object.keys(In);-async function Rn(e) {- let t = In[e];+var Er = { "quality-goals": {+ refresh: mr,+ reset: pr+} }, Dr = () => Object.keys(Er);+async function Or(e) {+ let t = Er[e];if (!t) throw Error(`未登记的共享 store:${String(e)}`);try {return await t.refresh(), !0;@@ -2819,24 +3370,24 @@ async function Rn(e) {}//#endregion//#region src/review-evidence.ts-var zn = (e = "") => /^https?:\/\//i.test(e) ? e : "";-function Bn(e = "") {- let t = zn(e) || (e.startsWith("/") && !e.startsWith("//") ? e : "");- return `<div class="reviewimage" data-review-picture><span class="reviewimageempty"${t ? " hidden" : ""}>未取得来源图片</span>${t ? `<img src="${h(t)}" alt="来源候选图片" loading="lazy">` : ""}</div>`;-}-function Vn(e) {- let t = zn(e.profile_url), n = (e.preview_assets || []).slice(0, 6), r = Math.max(0, Number(e.video_count || e.videos || 0));- return `<section class="reviewidentityevidence"><h5>候选身份:${h(e.babepedia_name || "未标注")}</h5>- <div class="reviewevidenceactions">${t ? `<a class="geist-button externallink" href="${h(t)}" target="_blank" rel="noopener noreferrer">来源资料<svg class="externalmark" viewBox="0 0 24 24" aria-hidden="true"><use href="#i-external-link" /></svg></a>` : ""}- <button type="button" class="geist-button" data-entity-kind="creator" data-entity-name="${h(e.creator || "")}">查看全部 ${r.toLocaleString()} 部作品</button></div>- ${Bn(e.preview_url)}+var kr = (e = "") => /^https?:\/\//i.test(e) ? e : "";+function Ar(e = "") {+ let n = kr(e) || (e.startsWith("/") && !e.startsWith("//") ? e : "");+ return `<div class="reviewimage" data-review-picture><span class="reviewimageempty"${n ? " hidden" : ""}>未取得来源图片</span>${n ? `<img src="${t(n)}" alt="来源候选图片" loading="lazy">` : ""}</div>`;+}+function jr(e) {+ let n = kr(e.profile_url), r = (e.preview_assets || []).slice(0, 6), i = Math.max(0, Number(e.video_count || e.videos || 0));+ return `<section class="reviewidentityevidence"><h5>候选身份:${t(e.babepedia_name || "未标注")}</h5>+ <div class="reviewevidenceactions">${n ? `<a class="geist-button externallink" href="${t(n)}" target="_blank" rel="noopener noreferrer">来源资料<svg class="externalmark" viewBox="0 0 24 24" aria-hidden="true"><use href="#i-external-link" /></svg></a>` : ""}+ <button type="button" class="geist-button" data-entity-kind="creator" data-entity-name="${t(e.creator || "")}">查看全部 ${i.toLocaleString()} 部作品</button></div>+ ${Ar(e.preview_url)}<p>通过后记录身份判断。</p>- ${n.length ? `<h5>本地作品样本</h5><div class="reviewevidencesamples">${n.map((e) => `<div class="reviewevidencesample">- <button class="geist-button" type="button" data-review-open-item="${e.id}"><span data-middle-truncate title="${h(e.name)}">${h(e.name)}</span></button>- <button class="geist-button" type="button" data-review-reveal="${e.id}" aria-label="打开 ${h(e.name)} 的文件位置">文件位置</button>+ ${r.length ? `<h5>本地作品样本</h5><div class="reviewevidencesamples">${r.map((e) => `<div class="reviewevidencesample">+ <button class="geist-button" type="button" data-review-open-item="${e.id}"><span data-middle-truncate title="${t(e.name)}">${t(e.name)}</span></button>+ <button class="geist-button" type="button" data-review-reveal="${e.id}" aria-label="打开 ${t(e.name)} 的文件位置">文件位置</button></div>`).join("")}</div>` : "<p>暂无本地作品样本,打开全部作品核对。</p>"}</section>`;}-function Hn(e) {+function Mr(e) {for (let t of e.querySelectorAll("[data-review-picture] img")) {let e = () => {t.hidden = !0;@@ -2848,7 +3399,7 @@ function Hn(e) {}//#endregion//#region src/review-bulk.ts-var Un = () => ({+var Nr = () => ({busy: !1,category: "",filter: "",@@ -2859,7 +3410,7 @@ var Un = () => ({assets: /* @__PURE__ */ new Map(),errors: /* @__PURE__ */ new Map()});-function Wn(e) {+function Pr(e) {let t = e?.querySelector(".reviewcontrols");if (!e || !t || t.offsetParent === null) return;let n = e.closest("main");@@ -2869,7 +3420,7 @@ function Wn(e) {n.classList.toggle("is-stuck", n.offsetParent !== null && window.scrollY > 0 && Number.isFinite(e) && Math.abs(n.getBoundingClientRect().top - e) <= 1);}}-function Gn(e, t) {+function Fr(e, t) {let n = [["candidates",t ? "按候选数量" : "全部待复核",@@ -2885,7 +3436,7 @@ function Gn(e, t) {"list-filter"]), n;}-function Kn(e, t) {+function Ir(e, t) {let n = /* @__PURE__ */ new Map();for (let r of e) {let e, i;@@ -2902,11 +3453,11 @@ function Kn(e, t) {}return [...n.values()];}-function qn(e, t, n, r, i) {+function Lr(e, t, n, r, i) {let a = e.anchor === null ? -1 : t.indexOf(e.anchor), o = t.indexOf(n);r && a >= 0 && o >= 0 ? t.slice(Math.min(a, o), Math.max(a, o) + 1).forEach((t) => e.selected.add(t)) : i ? e.selected.add(n) : e.selected.delete(n), e.anchor = n;}-async function Jn(e, t, n, r) {+async function Rr(e, t, n, r) {let i = [], a = 0;for (let o of e) {if (!r()) break;@@ -2926,164 +3477,164 @@ async function Jn(e, t, n, r) {failures: i};}-function Yn(e) {+function zr(e) {return e.length ? [...new Set(e.flatMap((e) => e.candidates?.map((e) => e.source || "") || []))].filter((t) => t && e.every((e) => e.candidates?.filter((e) => e.source === t).length === 1)) : [];}-function Xn(e, n) {- let r = e.querySelector(".reviewlist");- if (!r || !n.rows.length || n.locked) return;- let i = n.state, a = [...r.querySelectorAll("[data-review-key]")];- n.category !== void 0 && i.category !== n.category && (i.category = n.category, i.filter = "", i.groupBy = "candidates", i.anchor = null);- let o = Gn(n.rows, n.metadata);- o.some((e) => e[0] === i.groupBy) || (i.groupBy = "candidates", i.filter = "");- let s = Kn(n.rows, i.groupBy);- s.some((e) => e.key === i.filter) || (i.filter = "");- let c = () => [...r.querySelectorAll("[data-review-key]")].filter((e) => !e.closest("[hidden]")), u = () => c().filter((e) => i.selected.has(e.dataset.reviewKey)), f = () => n.rows.filter((e) => u().some((t) => t.dataset.reviewKey === e.item_key)), m = (e) => !e.querySelector("[data-review-status=\"approved\"]")?.disabled, h = (e, t = "") => {+function Br(e, t) {+ let n = e.querySelector(".reviewlist");+ if (!n || !t.rows.length || t.locked) return;+ let r = t.state, i = [...n.querySelectorAll("[data-review-key]")];+ t.category !== void 0 && r.category !== t.category && (r.category = t.category, r.filter = "", r.groupBy = "candidates", r.anchor = null);+ let a = Fr(t.rows, t.metadata);+ a.some((e) => e[0] === r.groupBy) || (r.groupBy = "candidates", r.filter = "");+ let o = Ir(t.rows, r.groupBy);+ o.some((e) => e.key === r.filter) || (r.filter = "");+ let s = () => [...n.querySelectorAll("[data-review-key]")].filter((e) => !e.closest("[hidden]")), l = () => s().filter((e) => r.selected.has(e.dataset.reviewKey)), u = () => t.rows.filter((e) => l().some((t) => t.dataset.reviewKey === e.item_key)), d = (e) => !e.querySelector("[data-review-status=\"approved\"]")?.disabled, f = (e, t = "") => {let n = document.createElement("button");return n.type = "button", n.className = `geist-button ${t}`.trim(), n.textContent = e, n;- }, g = document.createElement("div");- g.className = "reviewbulkbar reviewbulktoolbar", g.setAttribute("role", "group"), g.setAttribute("aria-label", "复核批量操作");- let _ = document.createElement("div");- _.className = "reviewgroupby", _.innerHTML = l(o, i.groupBy, { label: "筛选分组方式" });- let v = p(_.firstElementChild);- _.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), v.addEventListener("change", () => {- if (i.busy || !o.some((e) => e[0] === v.value)) return;- i.groupBy = v.value, i.filter = "", i.anchor = null;- let t = e.parentElement;- n.refresh(), t?.querySelector(".reviewgroupby button")?.focus({ preventScroll: !0 });+ }, p = document.createElement("div");+ p.className = "reviewbulkbar reviewbulktoolbar", p.setAttribute("role", "group"), p.setAttribute("aria-label", "复核批量操作");+ let m = document.createElement("div");+ m.className = "reviewgroupby", m.innerHTML = g(a, r.groupBy, { label: "筛选分组方式" });+ let h = b(m.firstElementChild);+ m.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), h.addEventListener("change", () => {+ if (r.busy || !a.some((e) => e[0] === h.value)) return;+ r.groupBy = h.value, r.filter = "", r.anchor = null;+ let n = e.parentElement;+ t.refresh(), n?.querySelector(".reviewgroupby button")?.focus({ preventScroll: !0 });});- let y = document.createElement("div");- y.className = "reviewcategoryfilter", y.hidden = s.length < 2, y.innerHTML = l([[+ let _ = document.createElement("div");+ _.className = "reviewcategoryfilter", _.hidden = o.length < 2, _.innerHTML = g([["","全部分类","list-filter"- ], ...s.map((e) => [+ ], ...o.map((e) => [e.key,`${e.title} · ${e.rows.length}`,"list-filter"- ])], i.filter, { label: i.groupBy === "field" ? "筛选字段分类" : "筛选当前分类" });- let b = y.querySelector("[data-select-menu]");- if (b) {+ ])], r.filter, { label: r.groupBy === "field" ? "筛选字段分类" : "筛选当前分类" });+ let y = _.querySelector("[data-select-menu]");+ if (y) {let e = document.createElement("div");- e.setAttribute("role", "group"), e.setAttribute("aria-label", i.groupBy === "field" ? "字段分类" : "当前分类");+ e.setAttribute("role", "group"), e.setAttribute("aria-label", r.groupBy === "field" ? "字段分类" : "当前分类");let t = document.createElement("div");- t.className = "reviewfilterheading", t.textContent = e.getAttribute("aria-label"), t.setAttribute("aria-hidden", "true"), e.append(t, ...Array.from(b.children).slice(1)), b.append(e);- }- let x = p(y.firstElementChild);- y.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), x.addEventListener("change", () => {- if (i.busy || x.value && !s.some((e) => e.key === x.value)) return;- i.filter = x.value, i.anchor = null;- let t = e.parentElement;- n.refresh(), t?.querySelector(".reviewcategoryfilter button")?.focus({ preventScroll: !0 });+ t.className = "reviewfilterheading", t.textContent = e.getAttribute("aria-label"), t.setAttribute("aria-hidden", "true"), e.append(t, ...Array.from(y.children).slice(1)), y.append(e);+ }+ let x = b(_.firstElementChild);+ _.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), x.addEventListener("change", () => {+ if (r.busy || x.value && !o.some((e) => e.key === x.value)) return;+ r.filter = x.value, r.anchor = null;+ let n = e.parentElement;+ t.refresh(), n?.querySelector(".reviewcategoryfilter button")?.focus({ preventScroll: !0 });});- let S = h("全选本页"), C = h("通过所选", "primary"), w = h("拒绝所选", "error"), T = document.createElement("span");+ let S = f("全选本页"), C = f("通过所选", "primary"), w = f("拒绝所选", "error"), T = document.createElement("span");T.className = "reviewselectedcount selectiondockcount", T.setAttribute("role", "status");let E = document.createElement("div");- E.className = "reviewbulksource", E.hidden = !n.metadata;+ E.className = "reviewbulksource", E.hidden = !t.metadata;let D = document.createElement("p");D.className = "reviewstate reviewbulkfeedback", D.setAttribute("role", "status");let O = document.createElement("div");O.className = "reviewbulkdecisions", O.append(C, w);let k = document.createElement("div");k.className = "selectiondock reviewdock", k.setAttribute("role", "group"), k.setAttribute("aria-label", "复核所选项目");- let A = h("取消选择");- k.append(T, E, O, A, D), g.append(_, y, S);+ let A = f("取消选择");+ k.append(T, E, O, A, D), p.append(m, _, S);let j = e.querySelector(".reviewcontrols");- j ? j.append(g) : r.before(g), e.append(k), r.classList.add("reviewgroups");+ j ? j.append(p) : n.before(p), e.append(k), n.classList.add("reviewgroups");let ee = () => {- i.selected.clear(), i.anchor = null, P();+ r.selected.clear(), r.anchor = null, P();};A.onclick = () => {- i.busy || (ee(), S.focus({ preventScroll: !0 }));+ r.busy || (ee(), S.focus({ preventScroll: !0 }));}, S.onclick = () => {- if (i.busy) return;- let e = c(), t = u().length === e.length;- e.forEach((e) => t ? i.selected.delete(e.dataset.reviewKey) : i.selected.add(e.dataset.reviewKey)), P();- }, C.onclick = () => F("approved", C), w.onclick = () => F("rejected", w);+ if (r.busy) return;+ let e = s(), t = l().length === e.length;+ e.forEach((e) => t ? r.selected.delete(e.dataset.reviewKey) : r.selected.add(e.dataset.reviewKey)), P();+ }, C.onclick = () => te("approved", C), w.onclick = () => te("rejected", w);let M = [];- for (let e of s) {- let n = e.rows.map((e) => a.find((t) => t.dataset.reviewKey === e.item_key)).filter((e) => !!e), o = document.createElement("section");- o.className = "reviewgroup", o.hidden = !!i.filter && e.key !== i.filter;- let s = document.createElement("div");- s.className = "reviewbulkbar reviewgroupbar";+ for (let e of o) {+ let t = e.rows.map((e) => i.find((t) => t.dataset.reviewKey === e.item_key)).filter((e) => !!e), a = document.createElement("section");+ a.className = "reviewgroup", a.hidden = !!r.filter && e.key !== r.filter;+ let o = document.createElement("div");+ o.className = "reviewbulkbar reviewgroupbar";let l = document.createElement("h3");- l.textContent = `${e.title} · ${n.length}`;- let u = h("全选本组"), d = document.createElement("div");- d.className = "reviewlist", s.append(l, u), o.append(s, d), r.append(o), u.onclick = () => {- if (i.busy) return;- let e = n.every((e) => i.selected.has(e.dataset.reviewKey));- n.forEach((t) => e ? i.selected.delete(t.dataset.reviewKey) : i.selected.add(t.dataset.reviewKey)), P();+ l.textContent = `${e.title} · ${t.length}`;+ let u = f("全选本组"), d = document.createElement("div");+ d.className = "reviewlist", o.append(l, u), a.append(o, d), n.append(a), u.onclick = () => {+ if (r.busy) return;+ let e = t.every((e) => r.selected.has(e.dataset.reviewKey));+ t.forEach((t) => e ? r.selected.delete(t.dataset.reviewKey) : r.selected.add(t.dataset.reviewKey)), P();}, M.push(() => {- u.textContent = n.every((e) => i.selected.has(e.dataset.reviewKey)) ? "清空本组" : "全选本组";+ u.textContent = t.every((e) => r.selected.has(e.dataset.reviewKey)) ? "清空本组" : "全选本组";});- for (let e of n) {+ for (let e of t) {d.append(e);- let n = e.dataset.reviewKey;- i.errors.has(n) && (e.querySelector(".reviewstate").textContent = i.errors.get(n));- let r = e.querySelector("h4,.reviewentity b") || e, a = document.createElement("label");- a.className = "reviewpickitem", a.innerHTML = t();- let o = a.querySelector("input");- if (o.setAttribute("aria-label", `选择 ${e.querySelector("legend")?.textContent || r.textContent || n}`), r !== e) {+ let t = e.dataset.reviewKey;+ r.errors.has(t) && (e.querySelector(".reviewstate").textContent = r.errors.get(t));+ let n = e.querySelector("h4,.reviewentity b") || e, i = document.createElement("label");+ i.className = "reviewpickitem", i.innerHTML = c();+ let a = i.querySelector("input");+ if (a.setAttribute("aria-label", `选择 ${e.querySelector("legend")?.textContent || n.textContent || t}`), n !== e) {let e = document.createElement("span");- e.className = "reviewpickname", e.append(...r.childNodes), r.classList.add("reviewpickheading"), r.append(a, e);- } else e.prepend(a);- let s = (e, t) => {- qn(i, c().map((e) => e.dataset.reviewKey), n, e, t), P();+ e.className = "reviewpickname", e.append(...n.childNodes), n.classList.add("reviewpickheading"), n.append(i, e);+ } else e.prepend(i);+ let o = (e, n) => {+ Lr(r, s().map((e) => e.dataset.reviewKey), t, e, n), P();};- if (a.addEventListener("mousedown", (e) => {+ if (i.addEventListener("mousedown", (e) => {e.shiftKey && e.preventDefault();+ }), i.addEventListener("click", (e) => {+ e.target !== a && (e.preventDefault(), r.busy || (a.focus(), o(e.shiftKey, !a.checked)));}), a.addEventListener("click", (e) => {- e.target !== o && (e.preventDefault(), i.busy || (o.focus(), s(e.shiftKey, !o.checked)));- }), o.addEventListener("click", (e) => {- i.busy || s(e.shiftKey, o.checked);- }), o.addEventListener("keydown", (t) => {- if (!(i.busy || !t.shiftKey)) {- if (t.key === " ") t.preventDefault(), s(!0, !0);- else if (t.key === "ArrowDown" || t.key === "ArrowUp") {- t.preventDefault();- let r = c(), a = r[r.indexOf(e) + (t.key === "ArrowDown" ? 1 : -1)];- a && (i.anchor === null && (i.anchor = n), qn(i, r.map((e) => e.dataset.reviewKey), a.dataset.reviewKey, !0, !0), P(), a.querySelector(".reviewpickitem input")?.focus());+ r.busy || o(e.shiftKey, a.checked);+ }), a.addEventListener("keydown", (n) => {+ if (!(r.busy || !n.shiftKey)) {+ if (n.key === " ") n.preventDefault(), o(!0, !0);+ else if (n.key === "ArrowDown" || n.key === "ArrowUp") {+ n.preventDefault();+ let i = s(), a = i[i.indexOf(e) + (n.key === "ArrowDown" ? 1 : -1)];+ a && (r.anchor === null && (r.anchor = t), Lr(r, i.map((e) => e.dataset.reviewKey), a.dataset.reviewKey, !0, !0), P(), a.querySelector(".reviewpickitem input")?.focus());}}}), M.push(() => {- o.checked = i.selected.has(n);- }), i.assets.has(n)) {- let t = i.assets.get(n), r = [...e.querySelectorAll("[data-review-asset]")];- r.forEach((e) => {- let n = t.includes(Number(e.dataset.reviewAsset));- e.setAttribute("aria-pressed", String(n)), e.classList.toggle("picked", n);+ a.checked = r.selected.has(t);+ }), r.assets.has(t)) {+ let n = r.assets.get(t), i = [...e.querySelectorAll("[data-review-asset]")];+ i.forEach((e) => {+ let t = n.includes(Number(e.dataset.reviewAsset));+ e.setAttribute("aria-pressed", String(t)), e.classList.toggle("picked", t);});let a = e.querySelector("[data-picked-count]");- a && (a.textContent = `已选 ${t.length} / ${r.length}`);+ a && (a.textContent = `已选 ${n.length} / ${i.length}`);}- e.addEventListener("click", (t) => {- t.target.closest("[data-review-asset],[data-pick-all],[data-pick-none]") && i.assets.set(n, [...e.querySelectorAll("[data-review-asset][aria-pressed=\"true\"]")].map((e) => Number(e.dataset.reviewAsset)));+ e.addEventListener("click", (n) => {+ n.target.closest("[data-review-asset],[data-pick-all],[data-pick-none]") && r.assets.set(t, [...e.querySelectorAll("[data-review-asset][aria-pressed=\"true\"]")].map((e) => Number(e.dataset.reviewAsset)));});- for (let t of e.querySelectorAll("input[type=\"radio\"]")) i.choices.has(n) && (t.checked = i.choices.get(n) === t.value), t.addEventListener("change", () => {- t.checked && i.choices.set(n, t.value), P();+ for (let n of e.querySelectorAll("input[type=\"radio\"]")) r.choices.has(t) && (n.checked = r.choices.get(t) === n.value), n.addEventListener("change", () => {+ n.checked && r.choices.set(t, n.value), P();});}}e.addEventListener("keydown", (t) => {- i.busy || !e.contains(r) || (t.key === "Escape" && i.selected.size && (t.preventDefault(), t.stopPropagation(), ee()), (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a" && !t.target.matches("textarea,input:not([type=\"checkbox\"]):not([type=\"radio\"])") && (t.preventDefault(), t.stopPropagation(), c().forEach((e) => i.selected.add(e.dataset.reviewKey)), P()));+ r.busy || !e.contains(n) || (t.key === "Escape" && r.selected.size && (t.preventDefault(), t.stopPropagation(), ee()), (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a" && !t.target.matches("textarea,input:not([type=\"checkbox\"]):not([type=\"radio\"])") && (t.preventDefault(), t.stopPropagation(), s().forEach((e) => r.selected.add(e.dataset.reviewKey)), P()));});let N = "";function P() {- let e = u();- S.textContent = e.length === c().length ? "清空当前选择" : i.filter ? "全选当前分类" : "全选本页", k.hidden = !e.length, T.textContent = `已选 ${e.length} 项`, C.disabled = !e.length || e.some((e) => !m(e)), w.disabled = !e.length;- let t = Yn(f());- E.hidden = !n.metadata || !f().some((e) => (e.candidates?.length || 0) > 1);- let r = e.length && !t.length ? "所选项目无共同来源" : "统一选择来源", a = JSON.stringify([r, t]);+ let e = l();+ S.textContent = e.length === s().length ? "清空当前选择" : r.filter ? "全选当前分类" : "全选本页", k.hidden = !e.length, T.textContent = `已选 ${e.length} 项`, C.disabled = !e.length || e.some((e) => !d(e)), w.disabled = !e.length;+ let n = zr(u());+ E.hidden = !t.metadata || !u().some((e) => (e.candidates?.length || 0) > 1);+ let i = e.length && !n.length ? "所选项目无共同来源" : "统一选择来源", a = JSON.stringify([i, n]);if (a !== N) {- N = a, E.innerHTML = l([["", r], ...t.map((e) => [e, e])], "", { label: "统一选择来源" });- let e = p(E.firstElementChild);- e.disabled = !t.length, e.addEventListener("change", () => {- if (!(i.busy || !Yn(f()).includes(e.value))) {- for (let t of u()) {- let r = n.rows.find((e) => e.item_key === t.dataset.reviewKey).candidates.find((t) => t.source === e.value);- t.querySelectorAll("input[type=\"radio\"]").forEach((e) => {- e.checked = e.value === r.candidate_key;- }), i.choices.set(t.dataset.reviewKey, r.candidate_key);+ N = a, E.innerHTML = g([["", i], ...n.map((e) => [e, e])], "", { label: "统一选择来源" });+ let e = b(E.firstElementChild);+ e.disabled = !n.length, e.addEventListener("change", () => {+ if (!(r.busy || !zr(u()).includes(e.value))) {+ for (let n of l()) {+ let i = t.rows.find((e) => e.item_key === n.dataset.reviewKey).candidates.find((t) => t.source === e.value);+ n.querySelectorAll("input[type=\"radio\"]").forEach((e) => {+ e.checked = e.value === i.candidate_key;+ }), r.choices.set(n.dataset.reviewKey, i.candidate_key);}D.textContent = `已选择 ${e.value},点击通过所选采用。`;}@@ -3091,51 +3642,51 @@ function Xn(e, n) {}M.forEach((e) => e());}- async function F(t, r) {- if (i.busy || !u().length) return;- let a = u().map((e) => ({+ async function te(n, i) {+ if (r.busy || !l().length) return;+ let a = l().map((e) => ({key: e.dataset.reviewKey,payload: {- ...n.payload(e),- status: t+ ...t.payload(e),+ status: n}}));- if (t === "approved" && n.metadata && a.some((e) => !e.payload.candidate_key)) {- D.textContent = "请先为所选的多来源候选选择来源。", u().find((e) => !e.querySelector("input[type=\"radio\"]:checked"))?.querySelector("input[type=\"radio\"]")?.focus();+ if (n === "approved" && t.metadata && a.some((e) => !e.payload.candidate_key)) {+ D.textContent = "请先为所选的多来源候选选择来源。", l().find((e) => !e.querySelector("input[type=\"radio\"]:checked"))?.querySelector("input[type=\"radio\"]")?.focus();return;}- i.busy = !0, D.textContent = `正在处理 0 / ${a.length}`, d(r, !0);+ r.busy = !0, D.textContent = `正在处理 0 / ${a.length}`, v(i, !0);let o = [...e.querySelectorAll("button,input")], s = o.map((e) => e.getAttribute("aria-disabled"));o.forEach((e) => e.setAttribute("aria-disabled", "true"));let c = (e) => {e instanceof KeyboardEvent && e.key === "Tab" || (e.preventDefault(), e.stopImmediatePropagation());};e.addEventListener("click", c, !0), e.addEventListener("keydown", c, !0);- let l = 0, f = await Jn(a, async (e) => {+ let u = 0, d = await Rr(a, async (e) => {try {- return await n.submit(e);+ return await t.submit(e);} finally {- l++, n.active() && (D.textContent = `正在处理 ${l} / ${a.length}`);+ u++, t.active() && (D.textContent = `正在处理 ${u} / ${a.length}`);}}, (e) => {- i.selected.delete(e), i.errors.delete(e), n.applied(e);- }, n.active);- if (i.busy = !1, e.removeEventListener("click", c, !0), e.removeEventListener("keydown", c, !0), o.forEach((e, t) => {+ r.selected.delete(e), r.errors.delete(e), t.applied(e);+ }, t.active);+ if (r.busy = !1, e.removeEventListener("click", c, !0), e.removeEventListener("keydown", c, !0), o.forEach((e, t) => {let n = s[t];n === null ? e.removeAttribute("aria-disabled") : e.setAttribute("aria-disabled", n);- }), d(r, !1), !n.active()) return;- n.notify(`已${t === "approved" ? "通过" : "拒绝"} ${f.completed} 项${f.failures.length ? `,${f.failures.length} 项未完成` : ""}`), f.failures.forEach((e) => i.errors.set(e.key, e.message));- let p = e.parentElement;- n.refresh(), p?.querySelector(".reviewbulktoolbar button")?.focus({ preventScroll: !0 });+ }), v(i, !1), !t.active()) return;+ t.notify(`已${n === "approved" ? "通过" : "拒绝"} ${d.completed} 项${d.failures.length ? `,${d.failures.length} 项未完成` : ""}`), d.failures.forEach((e) => r.errors.set(e.key, e.message));+ let f = e.parentElement;+ t.refresh(), f?.querySelector(".reviewbulktoolbar button")?.focus({ preventScroll: !0 });}- P(), Wn(e);+ P(), Pr(e);}//#endregion//#region src/native-image.ts-function Zn(e, t, n, r) {+function Vr(e, t, n, r) {return e > 0 && t > 0 && e === n && t === r;}-function Qn(e, t, n, r, i = 1) {+function Hr(e, t, n, r, i = 1) {let a = Number.isFinite(i) && i > 0 ? i : 1;e /= a, t /= a;let o = [@@ -3152,7 +3703,7 @@ function Qn(e, t, n, r, i = 1) {}//#endregion//#region src/entity-skeleton.ts-function $n(e, t) {+function Ur(e, t) {return `<section data-skeleton="entity/${e}" role="status" aria-label="正在读取资料"><span class="sr-only">正在读取资料</span><div aria-hidden="true"><div class="entityhero"><div class="entityportrait ${e === "studio" || e === "agency" ? "square " : ""}skeleton"></div>@@ -3164,7 +3715,7 @@ function $n(e, t) {}//#endregion//#region src/board-skeleton.ts-function er(e) {+function Wr(e) {let t = (e = "60%") => `<i class="skeleton" style="width:${e}"></i>`, n = () => `<div class="board-skeleton-row">${t("36%")}${t("24%")}</div>`, r = "";if (e === "/stats" || e === "/taste") r = `${e === "/taste" ? `<div class="board-skeleton-row">${t("26%")}${t("32%")}</div>` : ""}<div class="metricstrip board-skeleton-metrics">${Array.from({ length: 4 }, () => `<div class="tastesummary">${t()}<b class="skeleton"></b><small class="board-stat-footer">${t("48%")}</small></div>`).join("")}</div><div class="board-skeleton-chart"><div class="board-skeleton-ring skeleton"></div><div>${n().repeat(4)}</div></div><div class="board-skeleton-section">${t("32%")}${n().repeat(5)}</div>`;else if (e === "/follow-manage") r = `<div class="board-skeleton-section">${t("20%")}<div class="skeleton board-skeleton-input"></div>${t("72%")}</div><div class="board-skeleton-row">${t("24%")}${t("40%")}</div><div class="board-skeleton-section">${n().repeat(6)}</div><div class="board-skeleton-row">${t("30%")}${t("30%")}</div>`;@@ -3174,7 +3725,7 @@ function er(e) {}//#endregion//#region src/catalog-onboarding.ts-var tr = [+var Gr = ["loc","creator","performer",@@ -3191,16 +3742,16 @@ var tr = ["jav","thumb"];-function nr() {+function Kr() {let e = (e) => Array(64).fill(e).join("");return {tiers: "<div class=\"tier catalog-placeholder\" aria-hidden=\"true\">" + e("<span class=\"av\"><span class=\"ring\"></span><span class=\"nm\"> </span></span>") + "</div><div class=\"tier catalog-placeholder\" aria-hidden=\"true\">" + e("<span class=\"brandpill\"><span class=\"mk\"></span><span class=\"placeholder-name\"> </span></span>") + "</div>",tags: "<span class=\"catalog-placeholder placeholder-tags\" aria-hidden=\"true\">" + e("<span class=\"pill\"> </span>") + "</span>"};}-async function rr(e, t) {+async function qr(e, t) {let n = new URLSearchParams();- for (let t of tr) e[t] && n.set(t, e[t]);+ for (let t of Gr) e[t] && n.set(t, e[t]);let [r, i] = await Promise.all([t("/api/facets?" + n), t("/api/items?" + n + "&limit=5")]), a = [...new Set([...r.creators || [],...r.tagperformers || [],@@ -3211,20 +3762,20 @@ async function rr(e, t) {return r.set("q", e), r.set("limit", "1"), (await t("/api/items?" + r)).total > 0 ? e : "";}))).filter(Boolean);}-function ir({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable: i = !1, online: a = !1 } = {}) {- let o = i ? "<a class=\"geist-button primary\" href=\"/configuration\">添加内容</a>" : "", s = "<a class=\"geist-button\" href=\"/follow-manage\">添加来源</a>";- return t || n ? r("search", n ? "还没有符合条件的 JAV 作品" : "没有符合条件的内容", n ? "已扫描但尚未补充发行资料的视频可在全部内容中查看。" : "清除筛选或搜索条件后查看全部内容。", { actions: "<a class=\"geist-button primary\" href=\"/?loc=&thumb=0\">查看全部内容</a>" }) : e === "catalog" ? r("play", "还没有视频", "添加媒体文件夹或关注来源,开始建立你的馆藏。", { actions: o + s }) : r(e === "tags" ? "tags" : "user-round", "还没有" + ({+function Jr({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable: r = !1, online: i = !1 } = {}) {+ let a = r ? "<a class=\"geist-button primary\" href=\"/configuration\">添加内容</a>" : "", o = "<a class=\"geist-button\" href=\"/follow-manage\">添加来源</a>";+ return t || n ? u("search", n ? "还没有符合条件的 JAV 作品" : "没有符合条件的内容", n ? "已扫描但尚未补充发行资料的视频可在全部内容中查看。" : "清除筛选或搜索条件后查看全部内容。", { actions: "<a class=\"geist-button primary\" href=\"/?loc=&thumb=0\">查看全部内容</a>" }) : e === "catalog" ? u("play", "还没有视频", "添加媒体文件夹或关注来源,开始建立你的馆藏。", { actions: a + o }) : u(e === "tags" ? "tags" : "user-round", "还没有" + ({tags: "标签",performers: "艺人",creators: "创作者",studios: "厂牌",agencies: "事务所",series: "系列"- }[e] || "资料"), a ? "添加关注来源并获取内容后,这里会显示对应标签。" : "添加内容并补充资料后,这里会显示对应信息。", { actions: a ? s : o + s });+ }[e] || "资料"), i ? "添加关注来源并获取内容后,这里会显示对应标签。" : "添加内容并补充资料后,这里会显示对应信息。", { actions: i ? o : a + o });}//#endregion//#region src/sidebar.ts-function ar(e) {+function Yr(e) {return ["/","/unseen",@@ -3234,23 +3785,23 @@ function ar(e) {"/junk-files"].includes(e) || /^\/(item|mix|parts|editions)\//.test(e) || /^\/playlists\/\d+\/\d+$/.test(e) || /^\/(performers|studios|creators|series|agencies)\/.+/.test(e);}-function or(e, t) {+function Xr(e, t) {return e.dataset.surface === t && e.querySelector(".dnav") ? !1 : (e.dataset.surface = t, e.replaceChildren(), !0);}-function sr(e) {+function Zr(e) {let t = /* @__PURE__ */ new Map();for (let n of e) for (let e of new Set(n.tags || [])) t.set(e, (t.get(e) || 0) + 1);return [...t].sort((e, t) => t[1] - e[1]).slice(0, 30);}//#endregion//#region src/management.ts-function cr(e) {+function Qr(e) {return e.filter((e) => ["115", "pikpak"].includes(e.location) && (e.roots === void 0 || e.roots.length > 0)).map((e) => e.location);}-function lr(e, t) {+function $r(e, t) {return t.filter((t) => e.some((e) => e.location === t));}-function ur() {+function ei() {return `<div class="cleanuppage" data-skeleton="cleanup" aria-busy="true" aria-label="正在读取数据管理状态"><div class="cleanupgrid">${[[@@ -3296,7 +3847,7 @@ function ur() {<footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button"${r === 3 ? " class=\"danger\"" : ""} disabled>${r === 3 ? "<svg aria-hidden=\"true\"><use href=\"#i-trash\"></use></svg><span>" + t + "</span>" : t}</button></footer></section>`).join("")}</div></div>`;}-function dr(e, t = !1, n = !1) {+function ti(e, t = !1, n = !1) {if (t || n) return "";let r = "<svg class=\"externalmark\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><use href=\"#i-external-link\"></use></svg>";return `<details class="taste-history-guide"${e ? " open" : ""}>@@ -3310,92 +3861,92 @@ function dr(e, t = !1, n = !1) {<button type="button" class="geist-button taste-guide-skip">跳过</button></div></details>`;}-var fr = "peach-taste-guide-dismissed";-function pr(e, t) {- f(e, ".taste-history-guide", "taste-guide-collapse");+var ni = "peach-taste-guide-dismissed";+function ri(e, t) {+ y(e, ".taste-history-guide", "taste-guide-collapse");let n = e.querySelector(".taste-history-guide");n?.querySelector(".taste-guide-skip")?.addEventListener("click", () => {- t.setItem(fr, "1"), n.remove();+ t.setItem(ni, "1"), n.remove();});}//#endregion//#region src/resource-sync.ts-var $ = (e = 0) => Number(e).toLocaleString(), mr = {+var $ = (e = 0) => Number(e).toLocaleString(), ii = {local: "本地磁盘",115: "115",pikpak: "PikPak"};-function hr(e, t) {+function ai(e, t) {let n = e.cache || {files: 0,bytes: 0}, r = !!(e.missing || n.files);return `<div class="resourcepanel" data-geist-fieldset><div class="resourcesources">${(e.sources || []).map((e) => `<article>- <div class="resourcesourcetitle"><b>${mr[e.location] || "媒体来源"}</b><span class="${e.online ? "online" : "offline"}">${e.online ? "可访问" : "离线,已跳过"}</span></div>+ <div class="resourcesourcetitle"><b>${ii[e.location] || "媒体来源"}</b><span class="${e.online ? "online" : "offline"}">${e.online ? "可访问" : "离线,已跳过"}</span></div><strong>${e.online ? `${$(e.missing)} 项` : "—"}</strong><small>${e.online ? `找不到文件 · 已检查 ${$(e.checked)} 项` : `馆藏中有 ${$(e.total)} 项`}</small>${e.unreadable ? `<small>${$(e.unreadable)} 项读取失败,已跳过</small>` : ""}</article>`).join("")}</div><div class="resourcecache"><div><span>可清理的缓存</span><b>${$(n.files)} 个</b><small>${t(n.bytes)}</small></div><div><span>待移入回收站</span><b>${$(e.missing)} 项</b></div></div>- ${r ? o(`将把找不到文件的 ${$(e.missing)} 项馆藏记录移入回收站,并清理 ${$(n.files)} 个闲置缓存。`, { label: "清理内容" }) : ""}+ ${r ? p(`将把找不到文件的 ${$(e.missing)} 项馆藏记录移入回收站,并清理 ${$(n.files)} 个闲置缓存。`, { label: "清理内容" }) : ""}<div class="resourceapplyrow geist-fieldset-footer" data-geist-fieldset-footer>${r ? "<button class=\"geist-button primary\" type=\"button\" id=\"resourceApply\">清理失效记录与缓存</button>" : "<p class=\"resourcesyncok\">已检查可访问的来源,没有待清理的记录或缓存。</p>"}</div></div>`;}//#endregion//#region src/jav-artwork.ts-function gr(e) {+function oi(e) {return ["small","sleeve","preview"].includes(String(e)) ? "small" : "big";}-function _r(e) {+function si(e) {return {- javLayout: gr(e.javLayout),- javImage: vr(e.javLayout === "preview" ? "thumbnail" : e.javImage)+ javLayout: oi(e.javLayout),+ javImage: ci(e.javLayout === "preview" ? "thumbnail" : e.javImage)};}-function vr(e) {+function ci(e) {return e === "thumbnail" ? "thumbnail" : "cover";}-function yr(e, t) {- return e.is_jav && e.code && e.has_cover && (vr(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";+function li(e, t) {+ return e.is_jav && e.code && e.has_cover && (ci(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";}-function br(e, t) {+function ui(e, t) {e.querySelectorAll("img[data-jav-image]").forEach((e) => {- let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (vr(t) === "cover" || !r)), a = i ? n : r;+ let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (ci(t) === "cover" || !r)), a = i ? n : r;e.classList.toggle("cover", i), e.classList.toggle("whole", i && e.dataset.javImageLayout !== "big"), e.classList.toggle("front", i && e.dataset.javImageLayout === "big"), e.removeAttribute("style"), a && e.getAttribute("src") !== a && (e.src = a);});}//#endregion//#region src/islands.ts-var xr = {+var di = {"library-processing": {- load: Pn,- component: Fn+ load: wr,+ component: Tr},scraping: {- load: An,- component: Nn+ load: br,+ component: Cr},"quality-goals": {- load: Tn,- component: Dn+ load: hr,+ component: _r},configuration: {- load: Ot,- component: Ft+ load: yn,+ component: En}-}, Sr = () => Object.keys(xr), Cr = /* @__PURE__ */ new Map();-async function wr(e, t, n, r = {}) {- let i = xr[e];+}, fi = () => Object.keys(di), pi = /* @__PURE__ */ new Map();+async function mi(e, t, n, r = {}) {+ let i = di[e];if (!i) throw Error(`未注册的 island:${String(e)}`);- Tr(t);+ hi(t);let a = {controller: new AbortController(),painted: !1};- Cr.set(t, a);+ pi.set(t, a);let o;try {o = {@@ -3409,9 +3960,9 @@ async function wr(e, t, n, r = {}) {error: B(e)};}- if (Cr.get(t) !== a) return;+ if (pi.get(t) !== a) return;if (r.isCurrent && !r.isCurrent()) {- Cr.delete(t);+ pi.delete(t);return;}t.textContent = "", a.painted = !0;@@ -3419,11 +3970,11 @@ async function wr(e, t, n, r = {}) {...n,...o};- De(ae(i.component, s), t);+ Oe(oe(i.component, s), t);}-function Tr(e) {- let t = Cr.get(e);- t && (t.controller.abort(), Cr.delete(e), t.painted && De(null, e));+function hi(e) {+ let t = pi.get(e);+ t && (t.controller.abort(), pi.delete(e), t.painted && Oe(null, e));}//#endregion-export { fr as TASTE_GUIDE_KEY, er as boardPageSkeleton, Ae as boundedPreference, ir as catalogEmptyHtml, rr as catalogSuggestions, ur as cleanupSkeletonHtml, cr as cloudLocations, lr as cloudPreferenceLocations, Un as createReviewSelection, Fe as distributionChart, nr as emptyCatalogLayout, $n as entitySkeletonHtml, kn as followJobProgress, Vn as identityEvidenceHtml, Sr as islandNames, yr as javImageKind, Pe as jobProgressHtml, Zn as matchesFaceSource, wr as mountIsland, Me as mountNumberSetting, Qn as nativeImageFit, vr as normalizeJavImage, gr as normalizeJavLayout, _r as normalizeJavPreferences, Oe as preferredDirection, Le as radarChart, Ie as rankedChart, Rn as refreshStore, hr as resourceScanHtml, Bn as reviewImageHtml, ar as sidebarHasCatalogContent, ze as sidebarSectionHtml, sr as sidebarTagCounts, Ne as statCardBody, Ln as storeNames, br as syncJavImages, je as syncNumberSetting, or as syncSidebarSurface, dr as tasteHistoryGuideHtml, He as transitionTheme, Tr as unmountIsland, Wn as updateReviewSticky, On as watchJob, Hn as wireReviewPictures, Xn as wireReviewSelection, Be as wireSidebarGroups, pr as wireTasteHistoryGuide };+export { ni as TASTE_GUIDE_KEY, Et as activityChartsHtml, Wr as boardPageSkeleton, je as boundedPreference, Jr as catalogEmptyHtml, qr as catalogSuggestions, ei as cleanupSkeletonHtml, Qr as cloudLocations, $r as cloudPreferenceLocations, Nr as createReviewSelection, bt as creatorSankeyHtml, Ie as distributionChart, Kr as emptyCatalogLayout, Ur as entitySkeletonHtml, yr as followJobProgress, jr as identityEvidenceHtml, Be as initBoardControls, fi as islandNames, li as javImageKind, Fe as jobProgressHtml, Vr as matchesFaceSource, mi as mountIsland, Ne as mountNumberSetting, Hr as nativeImageFit, ci as normalizeJavImage, oi as normalizeJavLayout, si as normalizeJavPreferences, ke as preferredDirection, Re as radarChart, Ct as radialCardHtml, Le as rankedChart, Or as refreshStore, ai as resourceScanHtml, Ar as reviewImageHtml, Yr as sidebarHasCatalogContent, kt as sidebarSectionHtml, Zr as sidebarTagCounts, Pe as statCardBody, Dr as storeNames, ze as syncBoardRange, ui as syncJavImages, Me as syncNumberSetting, Xr as syncSidebarSurface, ti as tasteHistoryGuideHtml, Mt as transitionTheme, hi as unmountIsland, Pr as updateReviewSticky, vr as watchJob, Dt as wireActivityCharts, xt as wireCreatorSankey, Ve as wireExpandableRanks, wt as wireRadialCards, Mr as wireReviewPictures, Br as wireReviewSelection, At as wireSidebarGroups, ri as wireTasteHistoryGuide };diff --git a/web/js/ui-components.js b/web/js/ui-components.jsindex bb7119213..c5cfbbd93 100644--- a/web/js/ui-components.js+++ b/web/js/ui-components.js@@ -460,7 +460,7 @@ export function checkboxHtml(inputAttrs=''){** 同一个 `details` 只接一次,重绘后原样再调用是安全的。*/-export function wireCollapse(root,selector,idPrefix){+export function wireCollapse(root,selector,idPrefix,triggerSelector='summary'){root?.querySelectorAll(selector).forEach((details,index)=>{if(details.querySelector(':scope > .fcollapse'))return;const body=document.createElement('div');body.className='fcollapse';@@ -472,7 +472,8 @@ export function wireCollapse(root,selector,idPrefix){inner.appendChild(child);});body.appendChild(inner);details.appendChild(body);- const summary=details.querySelector('summary');+ const summary=details.querySelector(triggerSelector);+ if(triggerSelector!=='summary')details.querySelector('summary').addEventListener('click',event=>event.preventDefault());let expanded=details.open,transitionRun=0;body.id=`${idPrefix}-${index}`;body.inert=!expanded;diff --git a/web/vendor/d3-LICENSE.txt b/web/vendor/d3-LICENSE.txtnew file mode 100644index 000000000..22fc62790--- /dev/null+++ b/web/vendor/d3-LICENSE.txt@@ -0,0 +1,123 @@+d3-sankey++Copyright 2015, Mike Bostock+All rights reserved.++Redistribution and use in source and binary forms, with or without modification,+are permitted provided that the following conditions are met:++* Redistributions of source code must retain the above copyright notice, this+ list of conditions and the following disclaimer.++* Redistributions in binary form must reproduce the above copyright notice,+ this list of conditions and the following disclaimer in the documentation+ and/or other materials provided with the distribution.++* Neither the name of the author nor the names of contributors may be used to+ endorse or promote products derived from this software without specific prior+ written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+++d3-array++Copyright 2010-2020 Mike Bostock+All rights reserved.++Redistribution and use in source and binary forms, with or without modification,+are permitted provided that the following conditions are met:++* Redistributions of source code must retain the above copyright notice, this+ list of conditions and the following disclaimer.++* Redistributions in binary form must reproduce the above copyright notice,+ this list of conditions and the following disclaimer in the documentation+ and/or other materials provided with the distribution.++* Neither the name of the author nor the names of contributors may be used to+ endorse or promote products derived from this software without specific prior+ written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+++d3-path++Copyright 2015-2016 Mike Bostock+All rights reserved.++Redistribution and use in source and binary forms, with or without modification,+are permitted provided that the following conditions are met:++* Redistributions of source code must retain the above copyright notice, this+ list of conditions and the following disclaimer.++* Redistributions in binary form must reproduce the above copyright notice,+ this list of conditions and the following disclaimer in the documentation+ and/or other materials provided with the distribution.++* Neither the name of the author nor the names of contributors may be used to+ endorse or promote products derived from this software without specific prior+ written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+++d3-shape++Copyright 2010-2015 Mike Bostock+All rights reserved.++Redistribution and use in source and binary forms, with or without modification,+are permitted provided that the following conditions are met:++* Redistributions of source code must retain the above copyright notice, this+ list of conditions and the following disclaimer.++* Redistributions in binary form must reproduce the above copyright notice,+ this list of conditions and the following disclaimer in the documentation+ and/or other materials provided with the distribution.++* Neither the name of the author nor the names of contributors may be used to+ endorse or promote products derived from this software without specific prior+ written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+