Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

feat(web): 重设计数据管理子页面

longmeidao6f218a421d89
diff --git a/docs/BOARD_UI.md b/docs/BOARD_UI.md
index b7103cb6b..066d61aba 100644
--- a/docs/BOARD_UI.md
+++ b/docs/BOARD_UI.md
@@ -1,5 +1,39 @@
# BoardUI 适配
+## 数据整理子页
+
+2026-09-09 使用内置浏览器读取组件目录及 Dashboard 侧栏的八个模板。线上 CSS 资源版本为
+`dpl_3cjHNDgN6SsY8bTxSfXGACCCc8Zp`,样式资源为 `0pj0_xn8e6w4j.css`、
+`0i-yg_o67~u3a.css`、`0z54_bq~~57b~.css`。
+
+| 当前参考 | 实际观察与采用范围 |
+| --- | --- |
+| `/components` | 检查 Foundations、Base、Blocks、Charts、Templates 完整目录;目录覆盖不等于逐组件全部状态验收 |
+| `/components/segmented-control` | 单选滑块、方向键移动、Space 选择;适合短的局部视图选择 |
+| `/components/tabs` | 下划线面板切换与 PillTab 局部筛选区分;Peach 复核十类采用纵向分类,保留面板关联和键盘操作 |
+| `/components/data-table` | 结果数、筛选、逐行操作、部分选择状态、分页分层;复用 Peach 已有选择与分页逻辑 |
+| `/components/stat-cards` | 紧凑统计与底部比较栏两种结构;子页只有当前任务读数,不引入无实际数据的趋势 |
+| `/templates/dashboard` | 面包屑、标题动作、统计与结果工具行;radio 轨道 padding 4px、radius 10px |
+| `/templates/marketing` | 分类筛选与结果表独立;采用局部筛选结构 |
+| `/templates/calendar` | 月份导航与日期网格;五个子页不采用日历 |
+| `/templates/finance` | 汇总指标与交易结果表分层;采用结果标题与操作区归属 |
+| `/templates/medical-profile` | 主体信息、指标与提醒分区;复核保留主体、证据、动作分区 |
+| `/templates/ai-chat` | 项目侧栏与 Code、Changes、Browser 局部切换;不把局部切换当第二层页面导航 |
+| `/templates/ai-image-generation` | Gallery、Styles 与图像网格;采用预览优先的卡片结构 |
+| `/templates/ai-profile` | 身份概要与指标卡;不引入与文件整理无关的数据面板 |
+
+模板已逐页读取实时 DOM;没有宣称八个模板的所有交互、动画和响应式状态均已验证。
+Pro 模板只作为公开外观和信息层级参考。实现使用现有 Preact、共享 HTML 控件及 Board token,无新增依赖。
+
+作用范围是 `/review`、`/quality-goals`、`/duplicates`、`/junk-files`、`/trash`。
+数据管理入口保持卡片导航。复核分类在桌面纵向排列,窄屏自动换行;分组、候选、批量动作和分页沿用既有实现。
+重复组提供文件预览及尺寸、时长、位置比较;高清版、垃圾文件和回收站共用预览卡片的版式。
+
+预览来源核对:8095 的 `app.js` 和 `board.css` 匹配 `claude-entity-float-and-settings`,
+其提交已包含于当前 master;8097 的 `app.js` 匹配本次工作树基线 `f09fc8b6`,
+`board.css` 匹配 master。18984 使用当前 `codex-data-pages-board` 的源码和构建,写入请求由只读预览拒绝。
+生产入口、真实 ledger 和凭据未修改。
+
Peach 使用 Board 的视觉与组件语义,保留 Vite、Preact、FastAPI 和现有媒体行为。Board 的公开实现依赖 React Aria,不能把组件名称相同当作 Preact 可直接替换的证明。本次由共享 HTML 控件、原生键盘行为与 Preact 数值控件适配;没有新增 React 运行时。
## 控件对应
diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md
index 70b678b64..92ebc8566 100644
--- a/docs/HANDOFF.md
+++ b/docs/HANDOFF.md
@@ -71,7 +71,7 @@
## 参考产品证据登记
-- [Board 适配、控件映射与取证](BOARD_UI.md)。
+- [Board 组件与模板取证](BOARD_UI.md#数据整理子页)。
- [Geist 控件](reference-snapshots/vercel-geist-controls-measured.md);[复核操作](reference-snapshots/vercel-review-actions.md);[README 维护](README_MAINTENANCE.md)。
diff --git a/frontend/src/islands/quality-goals.tsx b/frontend/src/islands/quality-goals.tsx
index 7f1a05ec5..47b0f16bb 100644
--- a/frontend/src/islands/quality-goals.tsx
+++ b/frontend/src/islands/quality-goals.tsx
@@ -14,7 +14,7 @@
* 它们是全站语义契约的唯一实现,抄一份就会漂。等下一批页面迁移时再把它们提升成
* TS 组件,那时 props 一起收窄。 */
import { LOC, fmtDur, fmtSize } from '@peach/legacy/core';
-import { emptyStateHtml, noteHtml } from '@peach/legacy/ui';
+import { collectionSummaryHtml, emptyStateHtml, noteHtml } from '@peach/legacy/ui';
import { qualityGoals, refreshQualityGoals } from '../state/quality-goals';
import type { QualityGoal, QualityGoalsData } from '../state/quality-goals';
@@ -71,7 +71,9 @@ export function QualityGoals(
);
}
return (
- <div class="qualitylist">
+ <div class="quality-workspace">
+ <div dangerouslySetInnerHTML={{ __html: collectionSummaryHtml('待升级', `${data?.total ?? items.length} 部作品`) }} />
+ <div class="qualitylist">
{items.map(item => (
<article class="qualityitem" key={item.id}>
<button
@@ -80,6 +82,7 @@ export function QualityGoals(
aria-label={`打开 ${javDisplayName(item)}`}
onClick={() => openItem(item.id)}
>
+ <span class="qualityfallback">暂无预览</span>
<img
src={previewUrl(item)}
alt=""
@@ -87,7 +90,7 @@ export function QualityGoals(
onError={event => event.currentTarget.remove()}
/>
</button>
- <div>
+ <div class="qualitybody">
<h3>
<button
type="button"
@@ -105,10 +108,12 @@ export function QualityGoals(
<span>{fmtDur(item.duration)}</span>
<span>{fmtSize(item.size ?? 0)}</span>
</p>
- {item.reason ? <p>{item.reason}</p> : null}
+ {item.reason ? <p class="qualityreason">{item.reason}</p> : null}
</div>
+ <footer class="qualityactions"><button type="button" class="geist-button" onClick={() => openItem(item.id)}>查看版本</button></footer>
</article>
))}
+ </div>
</div>
);
}
diff --git a/frontend/src/legacy/ui.d.ts b/frontend/src/legacy/ui.d.ts
index b7a5e4f2f..aa0641ca8 100644
--- a/frontend/src/legacy/ui.d.ts
+++ b/frontend/src/legacy/ui.d.ts
@@ -14,6 +14,7 @@ export declare function emptyStateHtml(
/** Geist Fieldset 的标题:放在框体里的 h3,不用原生 legend。 */
export declare function fieldsetTitle(id: string, title: string): string;
+export declare function collectionSummaryHtml(label: string, value: string, detail?: string): string;
export declare function badgeHtml(text: string): string;
export declare function checkboxHtml(inputAttrs?: string): string;
export declare function loadingDotsHtml(label?: string, options?: { className?: string }): string;
diff --git a/frontend/test/quality-goals.test.tsx b/frontend/test/quality-goals.test.tsx
index adbf1dc16..760289bcb 100644
--- a/frontend/test/quality-goals.test.tsx
+++ b/frontend/test/quality-goals.test.tsx
@@ -28,6 +28,12 @@ afterEach(() => {
});
describe('高清版目标列表', () => {
+ it('版本入口打开所属作品,汇总保留服务端总数', async () => {
+ const { el, props } = await mountGoals([goal({ id: 42 })]);
+ expect(el.querySelector('.collection-summary')?.textContent).toContain('1 部作品');
+ el.querySelector<HTMLButtonElement>('.qualityactions button')!.click();
+ expect(props.openItem).toHaveBeenCalledWith(42);
+ });
it('每条目标一张卡片,读数走遗留层同一套格式化口径', async () => {
const { el } = await mountGoals([goal({
id: 42, name: 'one.mp4', location: '115', cost: 'metered',
diff --git a/frontend/test/stubs/legacy-ui.ts b/frontend/test/stubs/legacy-ui.ts
index 61d8a20c2..5c71c4729 100644
--- a/frontend/test/stubs/legacy-ui.ts
+++ b/frontend/test/stubs/legacy-ui.ts
@@ -13,7 +13,7 @@ export const emptyStateHtml = (
+ `<div class="es-copy"><h3>${title}</h3><p>${description}</p></div>${options.actions || ''}</div>`;
// @ts-expect-error 横幅复用正式模板。
-export {projectBannerHtml} from '../../../web/js/ui-components.js';
+export {projectBannerHtml, collectionSummaryHtml} from '../../../web/js/ui-components.js';
export const fieldsetTitle = (id: string, title: string): string =>
`<h3 class="geist-fieldset-title" id="${id}">${title}</h3>`;
export const loadingDotsHtml = (label: string): string => `<span>${label}</span>`;
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index e5a21bbe3..fedcc3b0c 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -5020,13 +5020,13 @@ class WebUiSourceTests(unittest.TestCase):
# 外观一样不代表语义一样。复核那条切的是 10 个互不相同的候选数据集,每个分类换掉
# 整个面板的数据模型,也没有独立 URL,所以是真 tablist:方向键漫游焦点,tabindex
# 只留在选中项上。
- self.assertPageContains('<div class="reviewtabs" role="tablist" aria-label="复核分类">')
+ self.assertPageContains('<div class="reviewtabs" role="tablist" aria-label="复核分类" aria-orientation="vertical">')
self.assertPageContains('<button role="tab" id="reviewtab-${key}" aria-controls="reviewpanel"')
self.assertPageContains('aria-selected="${on}" tabindex="${on?' + repr('0') + ':' + repr('-1') + '}"')
self.assertPageContains('<section class="reviewsection" id="reviewpanel" role="tabpanel" '
'aria-labelledby="reviewtab-${reviewCategory}">')
self.assertPageLacks('<button data-review-tab="${key}" aria-pressed=')
- self.assertPageContains("const step=event.key==='ArrowRight'?1:event.key==='ArrowLeft'?-1:0;")
+ self.assertPageContains("const step=event.key==='ArrowRight'||event.key==='ArrowDown'?1:event.key==='ArrowLeft'||event.key==='ArrowUp'?-1:0;")
self.assertPageContains(
":event.key==='Home'?reviewTabs[0]:event.key==='End'?reviewTabs[reviewTabs.length-1]:null;")
# 垃圾文件那条是同一批候选按 type 收窄,数据模型不变,当前项落在 URL 上,所以是
@@ -8248,7 +8248,7 @@ class WebUiSourceTests(unittest.TestCase):
# 药丸也不跟洞察页那组维度共用一条规则:那边是带滑块的分段控件。
self.assertNotIn(".insighttabs,.reviewtabs{", board)
# 键盘行为仍是 tablist:方向键在同一条里移动焦点。
- self.assertPageContains('<div class="reviewtabs" role="tablist" aria-label="复核分类">')
+ self.assertPageContains('<div class="reviewtabs" role="tablist" aria-label="复核分类" aria-orientation="vertical">')
def test_the_review_queue_is_paged_on_the_client(self):
"""复核队列一页 20 张,翻页只重画这一屏。
diff --git a/web/app.js b/web/app.js
index df48d969b..8ced0dc7a 100644
--- a/web/app.js
+++ b/web/app.js
@@ -14,7 +14,7 @@ import { mountIsland, unmountIsland, islandMounted, createReviewSelection, wireR
import { catalogSuggestions, catalogEmptyHtml, emptyCatalogLayout, syncSidebarSurface, sidebarTagCounts, sidebarHasCatalogContent, cleanupSkeletonHtml, cloudLocations, cloudPreferenceLocations, tasteHistoryGuideHtml, wireTasteHistoryGuide, TASTE_GUIDE_KEY } from './dist/peach-ui.js';
import { javImageKind, normalizeJavImage, normalizeJavLayout, normalizeJavPreferences, syncJavImages, nativeImageFit, matchesFaceSource, entitySkeletonHtml } from './dist/peach-ui.js';
import {
- attachOverlayScrollbar, breadcrumbHtml, checkboxHtml, closeAnchoredMenu, confirmModal, dismissMenu, emptyStateHtml, fieldsetTitle,
+ attachOverlayScrollbar, breadcrumbHtml, checkboxHtml, collectionSummaryHtml, closeAnchoredMenu, confirmModal, dismissMenu, emptyStateHtml, fieldsetTitle,
fillSkeletonTier, fitSkeleton, formModal, iconSwitchHtml, indexSkeletonHtml, loadingDotsHtml,
mediaViewButtonsHtml, mountFilterFrame, filterChipHtml, sortControlsHtml, collectionHeaderHtml, wireHorizontalScroller, noteHtml, presentMenu, progressHtml, gaugeHtml, scrollerHtml, searchInputHtml, selectFieldHtml,
setActionBusy, skeletonHtml, spinnerHtml, wireAnchoredMenu, wireBusyActions, wireCollapse, wireDragReorder,
@@ -2749,7 +2749,7 @@ function renderJunkNavigation(data){
return `<a href="${junkPath(key,junkView)}" data-junk-kind-link="${esc(key)}"${current?' aria-current="page"':''}>${icon(glyph)}${esc(label)}${count?` <span class="n mono">${count.toLocaleString()}</span>`:''}</a>`;
}).join('');
$('#count').removeAttribute('aria-busy');
- $('#count').innerHTML=`<div class="junksummary" aria-live="polite">显示 ${Number(data.total||0).toLocaleString()} 个</div>
+ $('#count').innerHTML=`<div class="junksummary" aria-live="polite">${collectionSummaryHtml(junkView==='dismissed'?'已排除':'待判断',`${Number(data.total||0).toLocaleString()} 个`)}</div>
<nav class="junkfilters" aria-label="垃圾文件分类">${categoryLinks}<i aria-hidden="true"></i>
<a href="${junkPath('',junkView==='dismissed'?'pending':'dismissed')}" data-junk-view-link="${junkView==='dismissed'?'pending':'dismissed'}"${junkView==='dismissed'?' aria-current="page"':''}>${icon(junkView==='dismissed'?'rotate-ccw':'eye-off')}${junkView==='dismissed'?'返回待判断':'已排除'}${dismissedTotal?` <span class="n mono">${dismissedTotal.toLocaleString()}</span>`:''}</a>
</nav>`;
@@ -4629,7 +4629,8 @@ function renderDuplicates(){
const groups=d.groups||[];
paintManageLede(`${d.total} 组 · ${d.files} 个文件 · 可回收 ${fmtSize(d.reclaimable)}`);
$('#stats').innerHTML=`<div class="review">
- ${groups.length?`<div class="fsechead dupactions"><h3>操作</h3>
+ ${collectionSummaryHtml('重复内容',`${Number(d.total||0).toLocaleString()} 组`,`${d.files} 个文件 · 可回收 ${fmtSize(d.reclaimable)}`)}
+ ${groups.length?`<div class="fsechead dupactions"><h3>批量保留</h3>
<button data-dup-all="largest">全部保留最大</button>
<button data-dup-all="longest">全部保留最长</button>
${cloudPreferenceLocations(groups.flatMap(g=>g.files),d.cloudLocations||[]).map(loc=>`<button data-dup-all="${loc}">全部优先 ${esc(LOC[loc])}</button>`).join('')}</div>`:''}
@@ -4643,6 +4644,7 @@ function renderDuplicates(){
${cloudPreferenceLocations(g.files,d.cloudLocations||[]).map(loc=>`<button data-dup-keep="${loc}" data-dup-i="${gi}">留 ${esc(LOC[loc])}</button>`).join('')}
<button class="danger" data-dup-keep="all" data-dup-i="${gi}">整组回收</button></span></div>
<div class="duplist">${g.files.map(f=>`<div class="duprow">
+ <button type="button" class="dupcover" data-open-dup="${f.id}" aria-label="预览 ${esc(f.name)}"><img src="/thumb?id=${f.id}&c=4" alt="" loading="lazy" data-drop="self">${icon('play')}</button>
<span class="dupmarks">${f.is_largest?'<i class="big">最大</i>':''}${f.is_longest?'<i class="long">最长</i>':''}</span>
<button class="dupname" data-middle-truncate data-open-dup="${f.id}" title="${esc(f.name)}">${esc(f.name)}</button>
<span class="mono">${esc(LOC[f.location]||f.location||f.drive||'')}</span>
@@ -4734,10 +4736,10 @@ async function openReview(push=true){
:mirror?.state==='cached'?`写入端暂时不可达,显示 ${localTime(mirror.fetched_at)} 的缓存`
:mirror?.error||reviewRuntime.ledger_read_only_message||'';
const value=row=>row.tags||row.japanese_name||row.path||row.suggested_query||'';
- $('#stats').innerHTML=`<div class="review">
+ $('#stats').innerHTML=`<div class="review review-workspace">
${locked?`<div class="runtimegate">${icon('info')}<span>${esc(mirrorText)}</span>${writer
?`<a href="${esc(writer)}">前往写入端复核</a>`:''}</div>`:''}
- <div class="reviewcontrols"><div class="reviewtabs" role="tablist" aria-label="复核分类">${Object.entries(REVIEW_LABELS).map(([key,label])=>{
+ <div class="reviewcontrols"><h2 class="review-category-title">复核分类</h2><div class="reviewtabs" role="tablist" aria-label="复核分类" aria-orientation="vertical">${Object.entries(REVIEW_LABELS).map(([key,label])=>{
/* Geist Tabs(vercel.com/geist/tabs):计数走独立徽标,为 0 时整枚去掉,不留一个
「0」占位;tabindex 只留在选中项上,方向键负责在同一条里移动焦点。 */
const on=key===reviewCategory,count=Number(reviewData.counts[key]||0);
@@ -4844,7 +4846,7 @@ async function openReview(push=true){
reviewTabs.forEach((button,index)=>{
button.onclick=()=>{if(selection.busy)return;selection.selected.clear();selection.anchor=null;selection.choices.clear();selection.assets.clear();selection.errors.clear();reviewCategory=button.dataset.reviewTab;render()};
button.onkeydown=event=>{
- const step=event.key==='ArrowRight'?1:event.key==='ArrowLeft'?-1:0;
+ const step=event.key==='ArrowRight'||event.key==='ArrowDown'?1:event.key==='ArrowLeft'||event.key==='ArrowUp'?-1:0;
const target=step?reviewTabs[(index+step+reviewTabs.length)%reviewTabs.length]
:event.key==='Home'?reviewTabs[0]:event.key==='End'?reviewTabs[reviewTabs.length-1]:null;
if(!target)return;
diff --git a/web/board.css b/web/board.css
index b55b3fc6c..391089817 100644
--- a/web/board.css
+++ b/web/board.css
@@ -1239,6 +1239,75 @@ body .review :is(.reviewbulktoolbar,.reviewgroupbar).is-stuck{background:transpa
html.board-high-contrast .review.review-is-stuck::before{background:var(--ground);backdrop-filter:none;-webkit-backdrop-filter:none;animation:none}
@media(prefers-reduced-transparency:reduce){body .review.review-is-stuck::before{background:var(--ground);backdrop-filter:none;-webkit-backdrop-filter:none;animation:none}}
@media(prefers-reduced-motion:reduce){body .review.review-is-stuck::before{animation:none}}
+
+/* 数据管理子页:结果标题、证据区域和操作栏各有固定归属。 */
+.collection-summary{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;padding:20px 24px;margin-bottom:20px;border-radius:var(--surface-radius);background:var(--color-background-primary-default)}
+.collection-summary>div{display:grid;gap:8px;min-width:0}
+.collection-summary span{font:var(--board-body);color:var(--color-text-secondary)}
+.collection-summary strong{font:var(--board-title);color:var(--color-text-primary);font-variant-numeric:tabular-nums}
+.collection-summary p{margin:0;color:var(--color-text-secondary);font:var(--board-body)}
+body[data-surface="/review"] .review-workspace{display:grid;grid-template-columns:184px minmax(0,1fr);column-gap:24px;align-items:start}
+body[data-surface="/review"] .review-workspace>.reviewcontrols{grid-column:1;grid-row:1 / span 4;position:sticky;top:var(--topH);padding:16px 8px;background:var(--color-background-primary-default);border-radius:var(--surface-radius)}
+body[data-surface="/review"] .review-category-title{font:var(--board-caption);color:var(--muted);margin:0 12px 12px}
+body[data-surface="/review"] .reviewtabs{display:flex;flex-direction:column;gap:4px;align-items:stretch;white-space:normal}
+body[data-surface="/review"] .reviewtabs button{height:auto;min-height:40px;text-align:left;justify-content:space-between;padding:10px 12px;white-space:normal}
+body[data-surface="/review"] .review-workspace>:is(.reviewsection,.reviewbulktoolbar,.board-pagination){grid-column:2;min-width:0}
+body[data-surface="/review"] .review-workspace>.runtimegate{grid-column:1/-1;grid-row:1}
+body[data-surface="/review"] .review-workspace:has(>.runtimegate)>.reviewcontrols{grid-row:2 / span 4}
+body[data-surface="/review"] .reviewitem{border:1px solid var(--line-soft);border-radius:var(--surface-radius);background:var(--color-background-primary-default)}
+body[data-surface="/review"] :is(.reviewlist:not(.reviewgroups),.reviewgroupitems){grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr));gap:20px}
+body[data-surface="/review"] .reviewitem .reviewactions{border-radius:0 0 var(--surface-radius) var(--surface-radius)}
+body[data-surface="/duplicates"] #manageLede{display:none}
+body[data-surface="/duplicates"] .dupactions{padding:16px 20px;border-radius:var(--surface-radius);background:var(--color-background-primary-default);flex-wrap:wrap}
+body[data-surface="/duplicates"] .dupgroup{margin-bottom:24px;border-color:var(--line-soft);background:var(--color-background-primary-default)}
+body[data-surface="/duplicates"] .duphead{padding:20px;gap:12px;background:var(--color-background-secondary-default)}
+body[data-surface="/duplicates"] .duphead>b{font:var(--board-heading)}
+body[data-surface="/duplicates"] .duphead .dupbtns{flex-wrap:wrap;gap:8px}
+body[data-surface="/duplicates"] .duprow{grid-template-columns:112px 90px minmax(0,1fr) 64px 84px 84px;padding:16px 20px;gap:12px}
+.dupcover{grid-row:span 2;position:relative;aspect-ratio:16/10;padding:0;overflow:hidden;border:0;border-radius:var(--control-radius);background:var(--color-background-tertiary-default);color:var(--muted);cursor:pointer;display:grid;place-items:center}
+.dupcover img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
+.dupcover svg{width:24px;height:24px}
+body[data-surface="/duplicates"] .duppath{grid-column:2/-1}
+.quality-workspace{max-width:var(--board-content);margin:auto}
+body[data-surface="/quality-goals"] .qualitylist{grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:20px}
+body[data-surface="/quality-goals"] .qualityitem{display:flex;flex-direction:column;gap:0;padding:0;overflow:hidden;border:1px solid var(--line-soft);border-radius:var(--surface-radius)}
+body[data-surface="/quality-goals"] .qualitycover{position:relative;display:grid;place-items:center;width:100%;aspect-ratio:16/10;border-radius:0;background:var(--color-background-tertiary-default)}
+.qualityfallback{color:var(--muted);font:var(--board-body)}
+body[data-surface="/quality-goals"] .qualitycover img{position:absolute;inset:0;background:var(--color-background-tertiary-default)}
+.qualitybody{padding:20px;flex:1;min-width:0}
+.qualityreason{padding-top:12px;border-top:1px solid var(--line-soft)}
+.qualityactions{display:flex;justify-content:flex-end;padding:12px 20px;background:var(--color-background-secondary-default)}
+body[data-surface="/junk-files"] .junksummary{width:100%}
+body[data-surface="/junk-files"] .collection-summary{margin:0}
+body[data-surface="/junk-files"] .junkfilters{width:100%;padding:12px;gap:8px;border-radius:var(--surface-radius);background:var(--color-background-primary-default)}
+body:is([data-surface="/junk-files"],[data-surface="/trash"]) .gridstack>.grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:20px}
+body:is([data-surface="/junk-files"],[data-surface="/trash"]) .gridstack .card{border:1px solid var(--line-soft);border-radius:var(--surface-radius);background:var(--color-background-primary-default);overflow:hidden;gap:0}
+body[data-surface="/trash"] .gridstack .card .pic{border-radius:0}
+body[data-surface="/trash"] .gridstack .card>.meta{padding:16px 20px}
+body[data-surface="/trash"] #manageLede{padding:20px 24px;background:var(--color-background-primary-default);border-radius:var(--surface-radius);gap:16px;flex-wrap:wrap}
+body[data-surface="/trash"] #manageLede>span{font:var(--board-heading)}
+body[data-surface="/junk-files"] .junkmeta{padding:20px}
+body[data-surface="/junk-files"] .junkactions{padding:12px;background:var(--color-background-secondary-default);flex-wrap:wrap}
+@media(max-width:900px){
+ body[data-surface="/review"] .review-workspace{grid-template-columns:1fr}
+ body[data-surface="/review"] .review-workspace>.reviewcontrols{position:static;grid-column:1;grid-row:auto!important;margin-bottom:16px}
+ body[data-surface="/review"] .reviewtabs{flex-direction:row;flex-wrap:wrap}
+ body[data-surface="/review"] .review-workspace>:is(.reviewsection,.reviewbulktoolbar,.board-pagination){grid-column:1}
+ body[data-surface="/duplicates"] .duprow{grid-template-columns:88px minmax(0,1fr) auto}
+ body[data-surface="/duplicates"] .dupcover{grid-row:span 3}
+ body[data-surface="/duplicates"] .dupmarks{grid-column:2/-1}
+ body[data-surface="/duplicates"] .dupname{grid-column:2/-1}
+ body[data-surface="/duplicates"] .duppath{grid-column:1/-1}
+}
+@media(max-width:600px){
+ .collection-summary{padding:16px;align-items:flex-start;flex-direction:column;gap:12px}
+ body[data-surface="/review"] .reviewtabs button{min-height:36px;padding:8px}
+ body[data-surface="/duplicates"] .duphead{padding:16px}
+ body[data-surface="/duplicates"] .duphead .dupbtns{margin:0;width:100%}
+ body[data-surface="/duplicates"] .duprow{padding:16px}
+ body[data-surface="/review"] .board-pagination{display:flex;flex-wrap:wrap;gap:8px;max-width:100%;overflow:hidden}
+ body[data-surface="/review"] .board-pagination>.geist-button{max-width:calc(50% - 4px);overflow:hidden}
+}
/* 批量条:隐藏的键真的隐藏(Board 的 inline-flex 曾压过 hidden);「加入回收站」用 error 按钮的红色渐变。 */
body .batchbar button.danger{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:4px;height:36px;min-height:36px;padding:8px 12px;border:1px solid transparent;border-radius:10px;background:linear-gradient(180deg,#ff3347,#e60012);color:#fff;font:var(--board-body-medium);transition:background-color .15s ease}
body .batchbar button.danger:hover{background:linear-gradient(180deg,#ff6471,#ff3347);color:#fff}
diff --git a/web/dist/peach-ui.js b/web/dist/peach-ui.js
index 33474202b..1bf3545ba 100644
--- a/web/dist/peach-ui.js
+++ b/web/dist/peach-ui.js
@@ -1,21 +1,21 @@
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";
+import { MEDIA_SOURCE_ICONS as s, checkboxHtml as c, collectionSummaryHtml as l, confirmModal as u, emptyStateHtml as d, fieldsetTitle as f, loadingDotsHtml as p, noteHtml as m, progressHtml as h, projectBannerHtml as g, selectFieldHtml as _, selectOptionIconHtml as v, setActionBusy as y, wireCollapse as b, wireSelectField as x } 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, te, P = {}, F = [], ne = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, re = Array.isArray;
+var S, C, w, T, E, D, O, k, A, j, M, ee, N, te, P, F = {}, ne = [], re = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ie = Array.isArray;
function I(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);
+ if (arguments.length > 2 && (o.children = arguments.length > 3 ? S.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 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,
@@ -27,68 +27,68 @@ function oe(e, t, n, r, i) {
__e: null,
__c: null,
constructor: void 0,
- __v: i ?? ++C,
+ __v: i ?? ++w,
__i: -1,
__u: 0
};
- return i == null && S.vnode != null && S.vnode(a), a;
+ return i == null && C.vnode != null && C.vnode(a), a;
}
function L(e) {
return e.children;
}
-function se(e, t) {
+function ce(e, t) {
this.props = e, this.context = t;
}
-function ce(e, t) {
- if (t == null) return e.__ ? ce(e.__, e.__i + 1) : null;
+function le(e, t) {
+ if (t == null) return e.__ ? le(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" ? ce(e) : null;
+ return typeof e.type == "function" ? le(e) : null;
}
-function le(e) {
+function ue(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), be(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? ce(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);
+ a.__v = t.__v + 1, C.vnode && C.vnode(a), xe(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? le(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, Ce(r, a, i), t.__e = t.__ = null, a.__e != n && de(a);
}
}
-function ue(e) {
+function de(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;
- }), ue(e);
+ }), de(e);
}
-function de(e) {
- (!e.__d && (e.__d = !0) && T.push(e) && !fe.__r++ || E != S.debounceRendering) && ((E = S.debounceRendering) || D)(fe);
+function fe(e) {
+ (!e.__d && (e.__d = !0) && E.push(e) && !pe.__r++ || D != C.debounceRendering) && ((D = C.debounceRendering) || O)(pe);
}
-function fe() {
+function pe() {
try {
- for (var e, t = 1; T.length;) T.length > t && T.sort(O), e = T.shift(), t = T.length, le(e);
+ for (var e, t = 1; E.length;) E.length > t && E.sort(k), e = E.shift(), t = E.length, ue(e);
} finally {
- T.length = fe.__r = 0;
+ E.length = pe.__r = 0;
}
}
-function pe(e, t, n, r, i, a, o, s, c, l, u) {
- var d, f, p, m, h, g, _ = r && r.__k || F, 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] || P, 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);
+function me(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 = he(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 = xe(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && Ee(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = ge(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 me(e, t, n, r, i) {
+function he(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 = 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 = ce(s)), Ee(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(L, { 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 = _e(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 = le(s)), De(s, s));
return r;
}
-function he(e, t, n) {
+function ge(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 = he(r[i], t, n));
+ for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = ge(r[i], t, n));
return t;
}
- e.__e != t && (t && e.type && !t.parentNode && (t = ce(e)), t = n.insertBefore(e.__e, t || null));
+ e.__e != t && (t && e.type && !t.parentNode && (t = le(e)), t = n.insertBefore(e.__e, t || null));
do
t &&= t.nextSibling;
while (t != null && t.nodeType == 8);
return t;
}
-function ge(e, t, n, r) {
+function _e(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,18 +96,18 @@ function ge(e, t, n, r) {
}
return -1;
}
-function _e(e, t, n) {
- t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || ne.test(t) ? n : n + "px";
+function ve(e, t, n) {
+ t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || re.test(t) ? n : n + "px";
}
-function ve(e, t, n, r, i) {
+function ye(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 || _e(e.style, t, "");
- if (n) for (t in n) r && n[t] == r[t] || _e(e.style, t, n[t]);
+ if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || ve(e.style, t, "");
+ if (n) for (t in n) r && n[t] == r[t] || ve(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 ? te : N, a)) : e.removeEventListener(t, a ? te : N, a);
+ } 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[M] = r[M] : (n[M] = N, e.addEventListener(t, a ? P : te, a)) : e.removeEventListener(t, a ? P : te, a);
else {
if (i == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
@@ -117,72 +117,72 @@ function ve(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 ye(e) {
+function be(e) {
return function(t) {
if (this.l) {
var n = this.l[t.type + e];
- if (t[A] == null) t[A] = M++;
- else if (t[A] < n[j]) return;
- return n(S.event ? S.event(t) : t);
+ if (t[j] == null) t[j] = N++;
+ else if (t[j] < n[M]) return;
+ return n(C.event ? C.event(t) : t);
}
};
}
-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;
+function xe(e, t, n, r, i, a, o, s, c, l) {
+ var u, d, f, p, m, h, g, _, v, y, b, x, S, 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);
+ 128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = C.__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 = 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 = 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 = Oe), 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);
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);
- }), F.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = ce(n);
+ }), ne.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = le(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), F.push.apply(f.__h, f._sb), f._sb = [];
+ if (f.context = x, f.props = v, f.__P = e, f.__e = !1, S = C.__r, w = 0, y) f.state = f.__s, f.__d = !1, S && S(t), u = f.render(f.props, f.state, f.context), ne.push.apply(f.__h, f._sb), f._sb = [];
else do
- f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), f.state = f.__s;
+ f.__d = !1, S && S(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 ? Ce(u.props.children) : u, s = pe(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 = I(I({}, r), f.getChildContext())), y && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === L && u.key == null ? we(u.props.children) : u, s = me(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 || xe(t), S.__e(e, t, n);
+ t.__k ??= n.__k || [], e.then || Se(t), C.__e(e, t, n);
}
- } 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;
+ } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = Te(n.__e, t, n, r, i, a, o, c, l);
+ return (u = C.diffed) && u(t), 128 & t.__u ? void 0 : s;
}
-function xe(e) {
- e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(xe));
+function Se(e) {
+ e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(Se));
}
-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) {
+function Ce(e, t, n) {
+ for (var r = 0; r < n.length; r++) Ee(n[r], n[++r], n[++r]);
+ C.__c && C.__c(t, e), e.some(function(t) {
try {
e = t.__h, t.__h = [], e.some(function(e) {
e.call(t);
});
} catch (e) {
- S.__e(e, t.__v);
+ C.__e(e, t.__v);
}
});
}
-function Ce(e) {
- return typeof e != "object" || !e || e.__b > 0 ? e : re(e) ? e.map(Ce) : e.constructor === void 0 ? I({}, e) : null;
+function we(e) {
+ return typeof e != "object" || !e || e.__b > 0 ? e : ie(e) ? e.map(we) : e.constructor === void 0 ? I({}, e) : null;
}
-function we(e, t, n, r, i, a, o, s, c) {
- var l, u, d, f, p, m, h, g = n.props || P, _ = t.props, v = t.type;
+function Te(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;
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;
@@ -191,74 +191,74 @@ function we(e, t, n, r, i, a, o, s, c) {
}
if (e == null) {
if (v == null) return document.createTextNode(_);
- e = document.createElementNS(i, v, _.is && _), s &&= (S.__m && S.__m(t, a), !1), a = null;
+ e = document.createElementNS(i, v, _.is && _), s &&= (C.__m && C.__m(t, a), !1), a = null;
}
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 _ || 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 (a = v == "textarea" && _.defaultValue != null ? null : a && S.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 _ || ye(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 || ye(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 = ""), pe(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 && ce(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]) && ve(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && ve(e, l, h, g[l], i));
+ else if (d && (e.innerHTML = ""), me(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 && le(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]) && ye(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && ye(e, l, h, g[l], i));
}
return e;
}
-function Te(e, t, n) {
+function Ee(e, t, n) {
try {
if (typeof e == "function") {
var r = typeof e.__u == "function";
r && e.__u(), r && t == null || (e.__u = e(t));
} else e.current = t;
} catch (e) {
- S.__e(e, n);
+ C.__e(e, n);
}
}
-function Ee(e, t, n) {
+function De(e, t, n) {
var r, i;
- if (S.unmount && S.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || Te(r, null, t)), (r = e.__c) != null) {
+ if (C.unmount && C.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || Ee(r, null, t)), (r = e.__c) != null) {
if (r.componentWillUnmount) try {
r.componentWillUnmount();
} catch (e) {
- S.__e(e, t);
+ C.__e(e, t);
}
r.base = r.__P = r.__n = null;
}
- if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Ee(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] && De(r[i], t, n || typeof e.type != "function");
+ n || ae(e.__e), e.__c = e.__ = e.__e = void 0;
}
-function De(e, t, n) {
+function Oe(e, t, n) {
return this.constructor(e, n);
}
-function Oe(e, t, n) {
+function ke(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 = [], be(t, e = (!r && n || t).__k = ae(L, null, [e]), i || P, P, 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;
+ t == document && (t = document.documentElement), C.__ && C.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], xe(t, e = (!r && n || t).__k = oe(L, null, [e]), i || F, F, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? S.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), Ce(a, e, o), e.props.children = null;
}
-x = F.slice, S = { __e: function(e, t, n, r) {
+S = ne.slice, C = { __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) {
e = t;
}
throw e;
-} }, C = 0, w = function(e) {
+} }, w = 0, T = function(e) {
return e != null && e.constructor === void 0;
-}, se.prototype.setState = function(e, t) {
+}, ce.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), de(this));
-}, se.prototype.forceUpdate = function(e) {
- this.__v && (this.__e = !0, e && this.__h.push(e), de(this));
-}, se.prototype.render = L, T = [], D = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, O = function(e, t) {
+ typeof e == "function" && (e = e(I({}, n), this.props)), e && I(n, e), e != null && this.__v && (t && this._sb.push(t), fe(this));
+}, ce.prototype.forceUpdate = function(e) {
+ this.__v && (this.__e = !0, e && this.__h.push(e), fe(this));
+}, ce.prototype.render = L, E = [], O = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, k = function(e, t) {
return e.__v.__b - t.__v.__b;
-}, fe.__r = 0, k = Math.random().toString(8), A = "__d" + k, j = "__a" + k, ee = /(PointerCapture)$|Capture$/i, M = 0, N = ye(!1), te = ye(!0);
+}, pe.__r = 0, A = Math.random().toString(8), j = "__d" + A, M = "__a" + A, ee = /(PointerCapture)$|Capture$/i, N = 0, te = be(!1), P = be(!0);
//#endregion
//#region src/sort-preferences.ts
-function ke(e, t, n) {
+function Ae(e, t, n) {
return e === "seed" ? "" : e === t && n === "asc" ? "asc" : "desc";
}
//#endregion
//#region src/number-setting.ts
-var Ae = {
+var je = {
loginDaysSetting: {
min: 1,
max: 365,
@@ -306,17 +306,17 @@ var Ae = {
fallback: 60
}
};
-function je(e, t, n, r) {
+function Me(e, t, n, r) {
return Number.isInteger(e) && e >= t && e <= n ? e : r;
}
-function Me(e, t, n) {
+function Ne(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 Ne(e, t, n, r, i) {
- let a = Ae[t];
+function Pe(e, t, n, r, i) {
+ let a = je[t];
if (!a) return !1;
- 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");
+ let { min: o, max: s, unit: c, optional: l, fallback: u } = a, d = `peach.number.${t}`, f = Me(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;
@@ -358,15 +358,15 @@ var R = (e) => String(e ?? "").replace(/[&<>"']/g, (e) => ({
"\"": "&quot;",
"'": "&#39;"
})[e]);
-function Pe(e, t, n, r = "chart-no-axes-combined") {
+function Fe(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 Fe(e, t, n) {
+function Ie(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="${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 Ie(e, t) {
+function Le(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) => {
@@ -375,13 +375,13 @@ function Ie(e, t) {
}).join("");
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 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, 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>${R(e.name)}</span><b>${e.score.toLocaleString()}</b></li>`).join("");
return `<ol class="board-ranked-chart" aria-label="${R(t)}">${i}</ol>`;
}
-function Re(e, t) {
+function ze(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) => {
@@ -400,9 +400,9 @@ function Re(e, t) {
}
//#endregion
//#region node_modules/preact/hooks/dist/hooks.module.js
-var ze, z, Be, Ve, He = 0, Ue = [], B = S, We = B.__b, Ge = B.__r, Ke = B.diffed, qe = B.__c, Je = B.unmount, Ye = B.__;
-function Xe(e, t) {
- B.__h && B.__h(z, e, He || t), He = 0;
+var Be, z, Ve, He, Ue = 0, We = [], B = C, Ge = B.__b, Ke = B.__r, qe = B.diffed, Je = B.__c, Ye = B.unmount, Xe = B.__;
+function Ze(e, t) {
+ B.__h && B.__h(z, e, Ue || t), Ue = 0;
var n = z.__H || (z.__H = {
__: [],
__h: []
@@ -410,11 +410,11 @@ function Xe(e, t) {
return e >= n.__.length && n.__.push({}), n.__[e];
}
function V(e) {
- return He = 1, Ze(at, e);
+ return Ue = 1, Qe(ot, e);
}
-function Ze(e, t, n) {
- var r = Xe(ze++, 2);
- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : at(void 0, t), function(e) {
+function Qe(e, t, n) {
+ var r = Ze(Be++, 2);
+ if (r.t = e, !r.__c && (r.__ = [n ? n(t) : ot(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 = z, !z.__f)) {
@@ -446,103 +446,103 @@ function Ze(e, t, n) {
return r.__N || r.__;
}
function H(e, t) {
- var n = Xe(ze++, 3);
- !B.__s && it(n.__H, t) && (n.__ = e, n.u = t, z.__H.__h.push(n));
+ var n = Ze(Be++, 3);
+ !B.__s && at(n.__H, t) && (n.__ = e, n.u = t, z.__H.__h.push(n));
}
function U(e, t) {
- var n = Xe(ze++, 4);
- !B.__s && it(n.__H, t) && (n.__ = e, n.u = t, z.__h.push(n));
+ var n = Ze(Be++, 4);
+ !B.__s && at(n.__H, t) && (n.__ = e, n.u = t, z.__h.push(n));
}
function W(e) {
- return He = 5, Qe(function() {
+ return Ue = 5, $e(function() {
return { current: e };
}, []);
}
-function Qe(e, t) {
- var n = Xe(ze++, 7);
- return it(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
+function $e(e, t) {
+ var n = Ze(Be++, 7);
+ return at(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
}
-function $e() {
- for (var e; e = Ue.shift();) {
+function et() {
+ for (var e; e = We.shift();) {
var t = e.__H;
if (e.__P && t) try {
- t.__h.some(nt), t.__h.some(rt), t.__h = [];
+ t.__h.some(rt), t.__h.some(it), t.__h = [];
} catch (n) {
t.__h = [], B.__e(n, e.__v);
}
}
}
B.__b = function(e) {
- z = null, We && We(e);
+ z = null, Ge && Ge(e);
}, B.__ = function(e, t) {
- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Ye && Ye(e, t);
+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Xe && Xe(e, t);
}, B.__r = function(e) {
- Ge && Ge(e), ze = 0;
+ Ke && Ke(e), Be = 0;
var t = (z = e.__c).__H;
- t && (Be === z ? (t.__h = [], z.__h = [], t.__.some(function(e) {
+ t && (Ve === z ? (t.__h = [], z.__h = [], t.__.some(function(e) {
e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
- })) : (t.__h.some(nt), t.__h.some(rt), t.__h = [], ze = 0)), Be = z;
+ })) : (t.__h.some(rt), t.__h.some(it), t.__h = [], Be = 0)), Ve = z;
}, B.diffed = function(e) {
- Ke && Ke(e);
+ qe && qe(e);
var t = e.__c;
- t && t.__H && (t.__H.__h.length && (Ue.push(t) !== 1 && Ve === B.requestAnimationFrame || ((Ve = B.requestAnimationFrame) || tt)($e)), t.__H.__.some(function(e) {
+ t && t.__H && (t.__H.__h.length && (We.push(t) !== 1 && He === B.requestAnimationFrame || ((He = B.requestAnimationFrame) || nt)(et)), t.__H.__.some(function(e) {
e.u &&= (e.__H = e.u, void 0);
- })), Be = z = null;
+ })), Ve = z = null;
}, B.__c = function(e, t) {
t.some(function(e) {
try {
- e.__h.some(nt), e.__h = e.__h.filter(function(e) {
- return !e.__ || rt(e);
+ e.__h.some(rt), e.__h = e.__h.filter(function(e) {
+ return !e.__ || it(e);
});
} catch (n) {
t.some(function(e) {
e.__h &&= [];
}), t = [], B.__e(n, e.__v);
}
- }), qe && qe(e, t);
+ }), Je && Je(e, t);
}, B.unmount = function(e) {
- Je && Je(e);
+ Ye && Ye(e);
var t, n = e.__c;
n && n.__H && (n.__H.__.some(function(e) {
try {
- nt(e);
+ rt(e);
} catch (e) {
t = e;
}
}), n.__H = void 0, t && B.__e(t, n.__v));
};
-var et = typeof requestAnimationFrame == "function";
-function tt(e) {
+var tt = typeof requestAnimationFrame == "function";
+function nt(e) {
var t, n = function() {
- clearTimeout(r), et && cancelAnimationFrame(t), setTimeout(e);
+ clearTimeout(r), tt && cancelAnimationFrame(t), setTimeout(e);
}, r = setTimeout(n, 35);
- et && (t = requestAnimationFrame(n));
+ tt && (t = requestAnimationFrame(n));
}
-function nt(e) {
+function rt(e) {
var t = z, n = e.__c;
typeof n == "function" && (e.__c = void 0, n()), z = t;
}
-function rt(e) {
+function it(e) {
var t = z;
e.__c = e.__(), z = t;
}
-function it(e, t) {
+function at(e, t) {
return !e || e.length !== t.length || t.some(function(t, n) {
return t !== e[n];
});
}
-function at(e, t) {
+function ot(e, t) {
return typeof t == "function" ? t(e) : t;
}
//#endregion
//#region src/api.ts
-var ot = class extends Error {
+var st = class extends Error {
status;
body;
constructor(e, t, n = null) {
super(o(e, t)), this.name = "ApiError", this.status = t, this.body = n;
}
-}, st = (e) => {
+}, ct = (e) => {
if (!e || typeof e != "object") return "";
let t = e;
for (let e of [
@@ -564,7 +564,7 @@ async function K(e, t) {
try {
r = await n.json();
} catch {}
- if (!n.ok) throw new ot(st(r) || `请求失败(${n.status})`, n.status);
+ if (!n.ok) throw new st(ct(r) || `请求失败(${n.status})`, n.status);
return r;
}
async function q(e, t, n = "POST", r) {
@@ -581,15 +581,15 @@ async function q(e, t, n = "POST", r) {
try {
a = await i.json();
} catch {}
- if (!i.ok) throw new ot(st(a) || `请求失败(${i.status})`, i.status, a);
+ if (!i.ok) throw new st(ct(a) || `请求失败(${i.status})`, i.status, a);
return a;
}
//#endregion
//#region src/jobs.ts
-function ct(e, t = 0, n = 0) {
- return n > 0 ? Fe(e, t, n) : f(e);
+function lt(e, t = 0, n = 0) {
+ return n > 0 ? Ie(e, t, n) : p(e);
}
-async function lt(e) {
+async function ut(e) {
let t = e.pause || ((e) => new Promise((t) => setTimeout(t, e))), n = 0;
for (; e.active();) {
let r;
@@ -604,14 +604,14 @@ async function lt(e) {
await t(2e3);
}
}
-function ut(e) {
- let t = e.note || ((e) => p(e, {
+function dt(e) {
+ let t = e.note || ((e) => m(e, {
label: "任务状态",
variant: "error"
- })), n = e.loading || f, r = e.progress || ((e, t, n) => ct(n || `已处理 ${e} / ${t}`, e, t)), i = e.container || ((e) => `<section class="followtask" data-geist-fieldset aria-label="任务进度"><div class="geist-fieldset-content">${e}</div></section>`), a = document.createElement("div");
+ })), n = e.loading || p, r = e.progress || ((e, t, n) => lt(n || `已处理 ${e} / ${t}`, e, t)), i = e.container || ((e) => `<section class="followtask" data-geist-fieldset aria-label="任务进度"><div class="geist-fieldset-content">${e}</div></section>`), a = document.createElement("div");
e.host.hidden = !0, a.dataset.followJob = "", a.setAttribute("aria-live", "polite"), e.host.prepend(a);
let o = e.storageKey || "peach-follow-job", s = sessionStorage.getItem(o) || void 0, c = !1;
- lt({
+ ut({
read: e.read,
active: () => !c && e.active() && a.isConnected,
keepWatching: e.watchIdle !== !1,
@@ -637,7 +637,7 @@ function ut(e) {
}
//#endregion
//#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
-var dt = 0;
+var ft = 0;
Array.isArray;
function J(e, t, n, r, i, a) {
t ||= {};
@@ -654,35 +654,35 @@ function J(e, t, n, r, i, a) {
__e: null,
__c: null,
constructor: void 0,
- __v: --dt,
+ __v: --ft,
__i: -1,
__u: 0,
__source: i,
__self: a
};
if (typeof e == "function" && (o = e.defaultProps)) for (s in o) c[s] === void 0 && (c[s] = o[s]);
- return S.vnode && S.vnode(l), l;
+ return C.vnode && C.vnode(l), l;
}
//#endregion
//#region src/islands/library-processing.tsx
-var ft = (e, t) => K("/api/library-processing", t), pt = {
+var pt = (e, t) => K("/api/library-processing", t), mt = {
reading_local: "读取本地资料",
querying_metadata: "查询外部资料",
fetching_cover: "采集缺失封面",
writing_candidates: "保存资料候选"
};
-function mt(e) {
- let t = pt[e.current_action || ""] || e.stage || "正在处理", n = e.waited_seconds ? ` · 已等待 ${e.waited_seconds} 秒` : "";
+function ht(e) {
+ let t = mt[e.current_action || ""] || e.stage || "正在处理", n = e.waited_seconds ? ` · 已等待 ${e.waited_seconds} 秒` : "";
return e.current_asset_name ? `当前:${e.current_asset_name} · ${t}${n}` : t + n;
}
-function ht({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a, preview: o }) {
- let [s, c] = V(e || { status: "idle" }), [l, u] = V(t), [f, m] = V(!1), [g, _] = V(!1), y = W(new AbortController()), b = W(0), x = W(s.status), S = W(null), C = f || s.status === "running";
- U(() => v(S.current, C), [C]);
+function gt({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a, preview: o }) {
+ let [s, c] = V(e || { status: "idle" }), [l, u] = V(t), [d, p] = V(!1), [h, _] = V(!1), v = W(new AbortController()), b = W(0), x = W(s.status), S = W(null), C = d || s.status === "running";
+ U(() => y(S.current, C), [C]);
async function w() {
let e = ++b.current;
- await lt({
+ await ut({
read: (e) => K("/api/library-processing", e),
- active: () => !y.current.signal.aborted && b.current === e,
+ active: () => !v.current.signal.aborted && b.current === e,
keepWatching: i === "notice" || !!a,
render: (e) => {
c(e), u(""), e.status === "complete" && x.current === "running" && i !== "notice" && (_(!0), n("已完成扫描与资料采集")), x.current === "running" && (e.status === "complete" || e.status === "failed") && r?.(), x.current = e.status;
@@ -690,16 +690,16 @@ function ht({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a, p
disconnected: () => u("连接中断,正在重新读取处理进度")
});
}
- H(() => (!o && (s.status === "running" || i === "notice" || a) && w(), () => y.current.abort()), []);
+ H(() => (!o && (s.status === "running" || i === "notice" || a) && w(), () => v.current.abort()), []);
async function T(e) {
if (!(C || o)) {
- m(!0), u(""), _(!1);
+ p(!0), u(""), _(!1);
try {
- let t = await q("/api/library-processing", e, "POST", y.current.signal);
- if (y.current.signal.aborted) return;
- x.current = t.status, c(t), m(!1), await w();
+ let t = await q("/api/library-processing", e, "POST", v.current.signal);
+ if (v.current.signal.aborted) return;
+ x.current = t.status, c(t), p(!1), await w();
} catch (e) {
- y.current.signal.aborted || (u(G(e)), m(!1));
+ v.current.signal.aborted || (u(G(e)), p(!1));
}
}
}
@@ -711,8 +711,8 @@ function ht({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a, p
};
if (i === "notice") {
if (!l && s.status !== "running" && s.status !== "failed") return null;
- let e = l || (s.status === "failed" ? "扫描与资料采集未完成" : mt(s) + (s.total ? ` · ${s.checked || 0} / ${s.total}` : ""));
- return /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: h(e, {
+ let e = l || (s.status === "failed" ? "扫描与资料采集未完成" : ht(s) + (s.total ? ` · ${s.checked || 0} / ${s.total}` : ""));
+ return /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: g(e, {
variant: s.status === "failed" ? "error" : l || s.stalled ? "warning" : "gray",
href: "/data-cleanup#libraryProcessing",
label: l || s.status === "failed" ? "查看并处理" : "查看进度",
@@ -737,11 +737,11 @@ function ht({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a, p
children: [/* @__PURE__ */ J("div", {
class: "geist-fieldset-content library-processing",
children: [
- /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("cleanupScrapingTitle", "扫描与采集") } }),
+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: f("cleanupScrapingTitle", "扫描与采集") } }),
/* @__PURE__ */ J("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),
s.status === "running" && /* @__PURE__ */ J("div", {
"aria-live": "polite",
- dangerouslySetInnerHTML: { __html: ct(s.total ? `${mt(s)} · ${s.checked || 0} / ${s.total} 个视频` : mt(s), s.checked, s.total) }
+ dangerouslySetInnerHTML: { __html: lt(s.total ? `${ht(s)} · ${s.checked || 0} / ${s.total} 个视频` : ht(s), s.checked, s.total) }
})
]
}), /* @__PURE__ */ J("footer", {
@@ -773,7 +773,7 @@ function ht({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a, p
children: [
s.status === "running" && s.stalled && /* @__PURE__ */ J("div", {
class: "library-processing-stalled",
- dangerouslySetInnerHTML: { __html: p("这个项目处理时间较长,暂时没有新进展。可以继续等待,或在任务结束后重试未完成项。", {
+ dangerouslySetInnerHTML: { __html: m("这个项目处理时间较长,暂时没有新进展。可以继续等待,或在任务结束后重试未完成项。", {
variant: "warning",
label: "处理较慢",
filled: !0
@@ -784,16 +784,16 @@ function ht({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a, p
onClick: (e) => {
e.target.closest("[data-note-action]") && D();
},
- dangerouslySetInnerHTML: { __html: p(l || s.error || "处理未完成,请重试", {
+ dangerouslySetInnerHTML: { __html: m(l || s.error || "处理未完成,请重试", {
variant: "error",
filled: !0,
actionLabel: k ? "重试未完成项" : "",
details: A
}) }
}),
- g && /* @__PURE__ */ J("div", {
+ h && /* @__PURE__ */ J("div", {
class: "library-processing-result",
- dangerouslySetInnerHTML: { __html: p(`已扫描 ${s.scanned || 0} 个文件,识别 ${s.identified || 0} 个番号,整理 ${s.candidates || 0} 组资料候选。`, {
+ dangerouslySetInnerHTML: { __html: m(`已扫描 ${s.scanned || 0} 个文件,识别 ${s.identified || 0} 个番号,整理 ${s.candidates || 0} 组资料候选。`, {
variant: "success",
label: "处理完成"
}) }
@@ -803,13 +803,13 @@ function ht({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a, p
}
//#endregion
//#region src/management.ts
-function gt(e) {
+function _t(e) {
return e.filter((e) => ["115", "pikpak"].includes(e.location) && (e.roots === void 0 || e.roots.length > 0)).map((e) => e.location);
}
-function _t(e, t) {
+function vt(e, t) {
return t.filter((t) => e.some((e) => e.location === t));
}
-function vt() {
+function yt() {
let e = [
["人工复核", "square-check-big"],
["高清版", "sparkles"],
@@ -834,7 +834,7 @@ function vt() {
<footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button" disabled><svg aria-hidden="true"><use href="#i-scan-search"></use></svg><span>扫描空文件夹</span></button></footer>
</section></div></div>`;
}
-function yt(e, t = !1, n = !1) {
+function bt(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" : ""}>
@@ -848,17 +848,17 @@ function yt(e, t = !1, n = !1) {
<button type="button" class="geist-button taste-guide-skip">跳过</button>
</div></details>`;
}
-var bt = "peach-taste-guide-dismissed";
-function xt(e, t) {
- y(e, ".taste-history-guide", "taste-guide-collapse");
+var xt = "peach-taste-guide-dismissed";
+function St(e, t) {
+ b(e, ".taste-history-guide", "taste-guide-collapse");
let n = e.querySelector(".taste-history-guide");
n?.querySelector(".taste-guide-skip")?.addEventListener("click", () => {
- t.setItem(bt, "1"), n.remove();
+ t.setItem(xt, "1"), n.remove();
});
}
//#endregion
//#region src/board-state-preview.tsx
-var St = [
+var Ct = [
["idle", "待开始"],
["loading", "页面加载"],
["preparing", "准备任务"],
@@ -871,7 +871,7 @@ var St = [
["expired", "状态已失效"],
["paused", "来源已暂停"]
], Y = ({ html: e }) => /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: e } });
-function Ct() {
+function wt() {
let [e, t] = V("running"), [n, r] = V(0), [i, a] = V(document.documentElement.dataset.theme === "dark"), [o, s] = V(38), c = {
status: e === "failed" ? "failed" : [
"running",
@@ -906,7 +906,7 @@ function Ct() {
})] }),
/* @__PURE__ */ J("nav", {
"aria-label": "演示状态",
- children: St.map(([i, a]) => /* @__PURE__ */ J("button", {
+ children: Ct.map(([i, a]) => /* @__PURE__ */ J("button", {
class: "geist-button",
"aria-pressed": e === i,
onClick: () => {
@@ -937,7 +937,7 @@ function Ct() {
"aria-label": "页面横幅",
children: [
/* @__PURE__ */ J("h2", { children: "全局任务横幅" }),
- /* @__PURE__ */ J(ht, {
+ /* @__PURE__ */ J(gt, {
data: c,
error: l,
mode: "notice",
@@ -956,12 +956,12 @@ function Ct() {
}),
/* @__PURE__ */ J("section", { children: [
/* @__PURE__ */ J("h2", { children: "数据管理 · 扫描与采集" }),
- e === "loading" ? /* @__PURE__ */ J(Y, { html: vt() }) : /* @__PURE__ */ J("div", {
+ e === "loading" ? /* @__PURE__ */ J(Y, { html: yt() }) : /* @__PURE__ */ J("div", {
class: "cleanupgrid",
children: /* @__PURE__ */ J("div", {
id: "libraryProcessing",
class: "cleanupscraping",
- children: /* @__PURE__ */ J(ht, {
+ children: /* @__PURE__ */ J(gt, {
data: c,
error: l,
preview: !0,
@@ -969,11 +969,11 @@ function Ct() {
}, `${e}-${n}-${o}`)
})
}),
- e === "complete" && /* @__PURE__ */ J(Y, { html: p("已完成扫描与资料采集", {
+ e === "complete" && /* @__PURE__ */ J(Y, { html: m("已完成扫描与资料采集", {
variant: "success",
label: "任务完成"
}) }),
- e === "expired" && /* @__PURE__ */ J(Y, { html: p("任务状态已失效,请重新发起任务", { variant: "warning" }) }),
+ e === "expired" && /* @__PURE__ */ J(Y, { html: m("任务状态已失效,请重新发起任务", { variant: "warning" }) }),
e === "paused" && /* @__PURE__ */ J("span", {
class: "sbadge paused",
children: "已暂停"
@@ -981,12 +981,12 @@ function Ct() {
] }),
/* @__PURE__ */ J("section", { children: [/* @__PURE__ */ J("h2", { children: "关注检查与资源同步" }), /* @__PURE__ */ J("div", {
class: "board-preview-grid",
- children: [/* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "检查更新" }), /* @__PURE__ */ J(Y, { html: e === "disconnected" ? p("暂时无法读取进度,正在重新连接…", { label: "任务状态" }) : e === "failed" ? p("检查失败:来源连接超时", {
+ children: [/* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "检查更新" }), /* @__PURE__ */ J(Y, { html: e === "disconnected" ? m("暂时无法读取进度,正在重新连接…", { label: "任务状态" }) : e === "failed" ? m("检查失败:来源连接超时", {
variant: "error",
actionLabel: "重试"
- }) : e === "running" || e === "retrying" || e === "reconnected" ? Fe(`${e === "retrying" ? "第 2/3 次尝试,8 秒后重试 · " : ""}已完成 ${o}/100 个来源`, o, 100) : e === "preparing" ? f("正在准备检查任务…") : p(e === "complete" ? "已完成检查" : e === "paused" ? "已暂停自动检查" : e === "expired" ? "任务状态已失效,请重新发起任务" : "等待开始", { variant: e === "complete" ? "success" : "secondary" }) })] }), /* @__PURE__ */ J("article", { children: [
+ }) : e === "running" || e === "retrying" || e === "reconnected" ? Ie(`${e === "retrying" ? "第 2/3 次尝试,8 秒后重试 · " : ""}已完成 ${o}/100 个来源`, o, 100) : e === "preparing" ? p("正在准备检查任务…") : m(e === "complete" ? "已完成检查" : e === "paused" ? "已暂停自动检查" : e === "expired" ? "任务状态已失效,请重新发起任务" : "等待开始", { variant: e === "complete" ? "success" : "secondary" }) })] }), /* @__PURE__ */ J("article", { children: [
/* @__PURE__ */ J("h3", { children: "连接与恢复" }),
- /* @__PURE__ */ J(Y, { html: h(e === "disconnected" ? "暂时无法连接服务器,正在重连" : e === "reconnected" ? "连接已恢复,继续读取任务进度" : "连接正常", {
+ /* @__PURE__ */ J(Y, { html: g(e === "disconnected" ? "暂时无法连接服务器,正在重连" : e === "reconnected" ? "连接已恢复,继续读取任务进度" : "连接正常", {
variant: e === "disconnected" ? "warning" : "gray",
href: "#",
label: "查看状态"
@@ -997,24 +997,24 @@ function Ct() {
/* @__PURE__ */ J("section", { children: [/* @__PURE__ */ J("h2", { children: "错误与加载状态一览" }), /* @__PURE__ */ J("div", {
class: "board-preview-grid",
children: [
- /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "读取失败" }), /* @__PURE__ */ J(Y, { html: p("无法读取状态,请重试", {
+ /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "读取失败" }), /* @__PURE__ */ J(Y, { html: m("无法读取状态,请重试", {
variant: "error",
actionLabel: "重试"
}) })] }),
- /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "来源离线" }), /* @__PURE__ */ J(Y, { html: p("媒体来源离线,请检查挂载状态", { variant: "warning" }) })] }),
- /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "没有待处理内容" }), /* @__PURE__ */ J(Y, { html: p("没有待处理内容", { variant: "secondary" }) })] }),
- /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "等待响应" }), /* @__PURE__ */ J(Y, { html: f("正在读取来源状态") })] })
+ /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "来源离线" }), /* @__PURE__ */ J(Y, { html: m("媒体来源离线,请检查挂载状态", { variant: "warning" }) })] }),
+ /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "没有待处理内容" }), /* @__PURE__ */ J(Y, { html: m("没有待处理内容", { variant: "secondary" }) })] }),
+ /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "等待响应" }), /* @__PURE__ */ J(Y, { html: p("正在读取来源状态") })] })
]
})] })
]
});
}
-function wt(e) {
- Oe(ae(Ct, {}), e);
+function Tt(e) {
+ ke(oe(wt, {}), e);
}
//#endregion
//#region src/board-controls.ts
-function Tt(e) {
+function Et(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");
@@ -1022,17 +1022,17 @@ function Tt(e) {
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}%`, a.querySelectorAll(".board-range-tip").forEach((e) => e.toggleAttribute("data-range-active", e === s));
}
-function Et() {
+function Dt() {
let e = (e) => {
- e.querySelectorAll("input[type=range]").forEach(Tt), kt(e), Ot(e), At(e);
+ e.querySelectorAll("input[type=range]").forEach(Et), At(e), kt(e), jt(e);
};
e(document), new MutationObserver((t) => {
- for (let n of t) for (let t of n.addedNodes) t instanceof Element && (t.matches("input[type=range]") && Tt(t), e(t));
+ for (let n of t) for (let t of n.addedNodes) t instanceof Element && (t.matches("input[type=range]") && Et(t), e(t));
}).observe(document.body, {
subtree: !0,
childList: !0
}), document.addEventListener("input", (e) => {
- e.target instanceof HTMLInputElement && e.target.type === "range" && Tt(e.target);
+ e.target instanceof HTMLInputElement && e.target.type === "range" && Et(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);
@@ -1053,8 +1053,8 @@ function Et() {
e.key === "Escape" && o();
}), document.addEventListener("scroll", o, !0), window.addEventListener("resize", o);
}
-var Dt = /* @__PURE__ */ new Map();
-function Ot(e) {
+var Ot = /* @__PURE__ */ new Map();
+function kt(e) {
let t = ".managebar-menu,.board-local-nav:not(.settingscard>.board-local-nav)", n = [...e.querySelectorAll(t)];
e instanceof HTMLElement && e.matches(t) && n.push(e), n.forEach((e) => {
if (e.hasAttribute("data-board-tabs")) return;
@@ -1068,8 +1068,8 @@ function Ot(e) {
left: r.offsetLeft,
width: r.offsetWidth
};
- n(i), Dt.set(t, i);
- }, i = Dt.get(t);
+ n(i), Ot.set(t, i);
+ }, i = Ot.get(t);
i ? n(i) : r(), requestAnimationFrame(() => {
e.classList.add("board-tabs-ready"), requestAnimationFrame(r);
});
@@ -1089,7 +1089,7 @@ function Ot(e) {
o.observe(e);
});
}
-function kt(e) {
+function At(e) {
let t = ".iconswitch,.insightswitch,.insighttabs,.follow-workspace-switch", n = [...e.querySelectorAll(t)];
e instanceof HTMLElement && e.matches(t) && n.push(e), n.forEach((e) => {
if (e.hasAttribute("data-board-segments")) return;
@@ -1117,7 +1117,7 @@ function kt(e) {
i.observe(e), n(), requestAnimationFrame(() => e.classList.add("board-segments-ready"));
});
}
-function At(e) {
+function jt(e) {
let t = ".board-ranked-chart,.board-radar,.tasteranks,.board-heat-card,.board-sankey-card", n = [...e.querySelectorAll(t)];
e instanceof HTMLElement && e.matches(t) && n.push(e), n.forEach((e) => {
if (e.hasAttribute("data-board-chart")) return;
@@ -1135,7 +1135,7 @@ function At(e) {
n.observe(e);
});
}
-function jt(e) {
+function Mt(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");
@@ -1157,7 +1157,7 @@ function jt(e) {
}
//#endregion
//#region node_modules/d3-array/src/max.js
-function Mt(e, t) {
+function Nt(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 {
@@ -1168,7 +1168,7 @@ function Mt(e, t) {
}
//#endregion
//#region node_modules/d3-array/src/min.js
-function Nt(e, t) {
+function Pt(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 {
@@ -1179,7 +1179,7 @@ function Nt(e, t) {
}
//#endregion
//#region node_modules/d3-array/src/sum.js
-function Pt(e, t) {
+function Ft(e, t) {
let n = 0;
if (t === void 0) for (let t of e) (t = +t) && (n += t);
else {
@@ -1190,66 +1190,66 @@ function Pt(e, t) {
}
//#endregion
//#region node_modules/d3-sankey/src/align.js
-function Ft(e, t) {
+function It(e, t) {
return e.sourceLinks.length ? e.depth : t - 1;
}
//#endregion
//#region node_modules/d3-sankey/src/constant.js
-function It(e) {
+function Lt(e) {
return function() {
return e;
};
}
//#endregion
//#region node_modules/d3-sankey/src/sankey.js
-function Lt(e, t) {
- return zt(e.source, t.source) || e.index - t.index;
-}
function Rt(e, t) {
- return zt(e.target, t.target) || e.index - t.index;
+ return Bt(e.source, t.source) || e.index - t.index;
}
function zt(e, t) {
+ return Bt(e.target, t.target) || e.index - t.index;
+}
+function Bt(e, t) {
return e.y0 - t.y0;
}
-function Bt(e) {
+function Vt(e) {
return e.value;
}
-function Vt(e) {
+function Ht(e) {
return e.index;
}
-function Ht(e) {
+function Ut(e) {
return e.nodes;
}
-function Ut(e) {
+function Wt(e) {
return e.links;
}
-function Wt(e, t) {
+function Gt(e, t) {
let n = e.get(t);
if (!n) throw Error("missing: " + t);
return n;
}
-function Gt({ nodes: e }) {
+function Kt({ 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 Kt() {
- let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = Vt, c = Ft, l, u, d = Ht, f = Ut, p = 6;
+function qt() {
+ let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = Ht, c = It, l, u, d = Ut, f = Wt, 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), Gt(e), e;
+ return h(e), g(e), _(e), v(e), x(e), Kt(e), e;
}
m.update = function(e) {
- return Gt(e), e;
+ return Kt(e), e;
}, m.nodeId = function(e) {
- return arguments.length ? (s = typeof e == "function" ? e : It(e), m) : s;
+ return arguments.length ? (s = typeof e == "function" ? e : Lt(e), m) : s;
}, m.nodeAlign = function(e) {
- return arguments.length ? (c = typeof e == "function" ? e : It(e), m) : c;
+ return arguments.length ? (c = typeof e == "function" ? e : Lt(e), m) : c;
}, m.nodeSort = function(e) {
return arguments.length ? (l = e, m) : l;
}, m.nodeWidth = function(e) {
@@ -1257,9 +1257,9 @@ function Kt() {
}, m.nodePadding = function(e) {
return arguments.length ? (a = o = +e, m) : a;
}, m.nodes = function(e) {
- return arguments.length ? (d = typeof e == "function" ? e : It(e), m) : d;
+ return arguments.length ? (d = typeof e == "function" ? e : Lt(e), m) : d;
}, m.links = function(e) {
- return arguments.length ? (f = typeof e == "function" ? e : It(e), m) : f;
+ return arguments.length ? (f = typeof e == "function" ? e : Lt(e), m) : f;
}, m.linkSort = function(e) {
return arguments.length ? (u = e, m) : u;
}, m.size = function(i) {
@@ -1275,12 +1275,12 @@ function Kt() {
for (let [e, r] of t.entries()) {
r.index = e;
let { source: t, target: i } = r;
- typeof t != "object" && (t = r.source = Wt(n, t)), typeof i != "object" && (i = r.target = Wt(n, i)), t.sourceLinks.push(r), i.targetLinks.push(r);
+ typeof t != "object" && (t = r.source = Gt(n, t)), typeof i != "object" && (i = r.target = Gt(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(Pt(t.sourceLinks, Bt), Pt(t.targetLinks, Bt)) : t.fixedValue;
+ for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(Ft(t.sourceLinks, Vt), Ft(t.targetLinks, Vt)) : t.fixedValue;
}
function _({ nodes: e }) {
let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;
@@ -1305,7 +1305,7 @@ function Kt() {
}
}
function y({ nodes: t }) {
- let r = Mt(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);
+ let r = Nt(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];
@@ -1314,7 +1314,7 @@ function Kt() {
return o;
}
function b(e) {
- let n = Nt(e, (e) => (r - t - (e.length - 1) * o) / Pt(e, Bt));
+ let n = Pt(e, (e) => (r - t - (e.length - 1) * o) / Ft(e, Vt));
for (let i of e) {
let e = t;
for (let t of i) {
@@ -1331,7 +1331,7 @@ function Kt() {
}
function x(e) {
let n = y(e);
- o = Math.min(a, (r - t) / (Mt(n, (e) => e.length) - 1)), b(n);
+ o = Math.min(a, (r - t) / (Nt(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);
@@ -1350,7 +1350,7 @@ function Kt() {
let i = (n / r - e.y0) * t;
e.y0 += i, e.y1 += i, D(e);
}
- l === void 0 && i.sort(zt), w(i, n);
+ l === void 0 && i.sort(Bt), w(i, n);
}
}
function C(e, t, n) {
@@ -1366,7 +1366,7 @@ function Kt() {
let i = (n / r - e.y0) * t;
e.y0 += i, e.y1 += i, D(e);
}
- l === void 0 && i.sort(zt), w(i, n);
+ l === void 0 && i.sort(Bt), w(i, n);
}
}
function w(e, n) {
@@ -1387,12 +1387,12 @@ function Kt() {
}
function D({ sourceLinks: e, targetLinks: t }) {
if (u === void 0) {
- for (let { source: { sourceLinks: e } } of t) e.sort(Rt);
- for (let { target: { targetLinks: t } } of e) t.sort(Lt);
+ for (let { source: { sourceLinks: e } } of t) e.sort(zt);
+ for (let { target: { targetLinks: t } } of e) t.sort(Rt);
}
}
function O(e) {
- if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(Rt), n.sort(Lt);
+ if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(zt), n.sort(Rt);
}
function k(e, t) {
let n = e.y0 - (e.sourceLinks.length - 1) * o / 2;
@@ -1422,15 +1422,15 @@ function Kt() {
}
//#endregion
//#region node_modules/d3-path/src/path.js
-var qt = Math.PI, Jt = 2 * qt, Yt = 1e-6, Xt = Jt - Yt;
-function Zt() {
+var Jt = Math.PI, Yt = 2 * Jt, Xt = 1e-6, Zt = Yt - Xt;
+function Qt() {
this._x0 = this._y0 = this._x1 = this._y1 = null, this._ = "";
}
-function Qt() {
- return new Zt();
+function $t() {
+ return new Qt();
}
-Zt.prototype = Qt.prototype = {
- constructor: Zt,
+Qt.prototype = $t.prototype = {
+ constructor: Qt,
moveTo: function(e, t) {
this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +t);
},
@@ -1451,11 +1451,11 @@ Zt.prototype = Qt.prototype = {
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 > Yt) {
- if (!(Math.abs(u * s - c * l) > Yt) || !i) this._ += "L" + (this._x1 = e) + "," + (this._y1 = t);
+ else if (d > Xt) {
+ if (!(Math.abs(u * s - c * l) > Xt) || !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((qt - Math.acos((m + d - h) / (2 * g * _))) / 2), y = v / _, b = v / g;
- Math.abs(y - 1) > Yt && (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);
+ 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((Jt - Math.acos((m + d - h) / (2 * g * _))) / 2), y = v / _, b = v / g;
+ Math.abs(y - 1) > Xt && (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);
}
}
},
@@ -1463,7 +1463,7 @@ Zt.prototype = Qt.prototype = {
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) > Yt || Math.abs(this._y1 - l) > Yt) && (this._ += "L" + c + "," + l), n && (d < 0 && (d = d % Jt + Jt), d > Xt ? this._ += "A" + n + "," + n + ",0,1," + u + "," + (e - o) + "," + (t - s) + "A" + n + "," + n + ",0,1," + u + "," + (this._x1 = c) + "," + (this._y1 = l) : d > Yt && (this._ += "A" + n + "," + n + ",0," + +(d >= qt) + "," + u + "," + (this._x1 = e + n * Math.cos(i)) + "," + (this._y1 = t + n * Math.sin(i))));
+ this._x1 === null ? this._ += "M" + c + "," + l : (Math.abs(this._x1 - c) > Xt || Math.abs(this._y1 - l) > Xt) && (this._ += "L" + c + "," + l), n && (d < 0 && (d = d % Yt + Yt), d > Zt ? this._ += "A" + n + "," + n + ",0,1," + u + "," + (e - o) + "," + (t - s) + "A" + n + "," + n + ",0,1," + u + "," + (this._x1 = c) + "," + (this._y1 = l) : d > Xt && (this._ += "A" + n + "," + n + ",0," + +(d >= Jt) + "," + 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";
@@ -1474,71 +1474,71 @@ Zt.prototype = Qt.prototype = {
};
//#endregion
//#region node_modules/d3-shape/src/constant.js
-function $t(e) {
+function en(e) {
return function() {
return e;
};
}
//#endregion
//#region node_modules/d3-shape/src/point.js
-function en(e) {
+function tn(e) {
return e[0];
}
-function tn(e) {
+function nn(e) {
return e[1];
}
//#endregion
//#region node_modules/d3-shape/src/array.js
-var nn = Array.prototype.slice;
+var rn = Array.prototype.slice;
//#endregion
//#region node_modules/d3-shape/src/link/index.js
-function rn(e) {
+function an(e) {
return e.source;
}
-function an(e) {
+function on(e) {
return e.target;
}
-function on(e) {
- var t = rn, n = an, r = en, i = tn, a = null;
+function sn(e) {
+ var t = an, n = on, r = tn, i = nn, a = null;
function o() {
- var o, s = nn.call(arguments), c = t.apply(this, s), l = n.apply(this, s);
- if (a ||= o = Qt(), 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;
+ var o, s = rn.call(arguments), c = t.apply(this, s), l = n.apply(this, s);
+ if (a ||= o = $t(), 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 : $t(+e), o) : r;
+ return arguments.length ? (r = typeof e == "function" ? e : en(+e), o) : r;
}, o.y = function(e) {
- return arguments.length ? (i = typeof e == "function" ? e : $t(+e), o) : i;
+ return arguments.length ? (i = typeof e == "function" ? e : en(+e), o) : i;
}, o.context = function(e) {
return arguments.length ? (a = e ?? null, o) : a;
}, o;
}
-function sn(e, t, n, r, i) {
+function cn(e, t, n, r, i) {
e.moveTo(t, n), e.bezierCurveTo(t = (t + r) / 2, n, t, i, r, i);
}
-function cn() {
- return on(sn);
+function ln() {
+ return sn(cn);
}
//#endregion
//#region node_modules/d3-sankey/src/sankeyLinkHorizontal.js
-function ln(e) {
+function un(e) {
return [e.source.x1, e.y0];
}
-function un(e) {
+function dn(e) {
return [e.target.x0, e.y1];
}
-function dn() {
- return cn().source(ln).target(un);
+function fn() {
+ return ln().source(un).target(dn);
}
//#endregion
//#region src/board-sankey.ts
-function fn(e = []) {
+function pn(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 = Kt().nodeId((e) => e.id).nodeWidth(10).nodePadding(22).extent([[155, 16], [535, 404]])({
+ let r = [...new Set(n.map((e) => e.source))], i = [...new Set(n.map((e) => e.target))], a = qt().nodeId((e) => e.id).nodeWidth(10).nodePadding(22).extent([[155, 16], [535, 404]])({
nodes: [...r.map((e) => ({
id: `source:${e}`,
name: e,
@@ -1553,13 +1553,13 @@ function fn(e = []) {
target: `target:${e.target}`,
value: e.value
}))
- }), o = n.reduce((e, t) => e + t.value, 0), s = dn(), c = a.links.map((e) => {
+ }), o = n.reduce((e, t) => e + t.value, 0), s = fn(), 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 pn(e) {
+function mn(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 = "条线索";
@@ -1575,9 +1575,9 @@ function pn(e) {
}
//#endregion
//#region src/board-analytics.ts
-var mn = (e) => Number.isFinite(e) && e >= 0;
-function hn(e, n, r = "个视频") {
- let i = e.filter((e) => mn(e.value));
+var hn = (e) => Number.isFinite(e) && e >= 0;
+function gn(e, n, r = "个视频") {
+ let i = e.filter((e) => hn(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;
@@ -1585,7 +1585,7 @@ function hn(e, n, r = "个视频") {
}).join("");
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 gn(e) {
+function _n(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, l = 300) => {
e.dataset.radialFocus = String(c), t.forEach((e, t) => {
@@ -1622,7 +1622,7 @@ function gn(e) {
}
});
}
-var _n = [
+var vn = [
"周一",
"周二",
"周三",
@@ -1631,11 +1631,11 @@ var _n = [
"周六",
"周日"
];
-function vn(e) {
+function yn(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 && mn(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">${_n[t]}</span>${e.map((e, n) => `<button type="button" data-heat-value="${e}" data-heat-label="${_n[t]} ${n}:00" aria-label="${_n[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) && mn(e.count)).sort((e, t) => e.date.localeCompare(t.date));
+ 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 && hn(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">${vn[t]}</span>${e.map((e, n) => `<button type="button" data-heat-value="${e}" data-heat-label="${vn[t]} ${n}:00" aria-label="${vn[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) && hn(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);
@@ -1647,7 +1647,7 @@ function vn(e) {
}).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 yn(e) {
+function bn(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) => {
@@ -1662,19 +1662,19 @@ function yn(e) {
}
//#endregion
//#region src/sidebar-groups.ts
-var bn = (e) => e.replace(/[&<>"']/g, (e) => ({
+var xn = (e) => e.replace(/[&<>"']/g, (e) => ({
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
"\"": "&quot;",
"'": "&#39;"
})[e]);
-function xn(e, t, n = "", r = "") {
+function Sn(e, t, n = "", r = "") {
if (!t) return "";
let i = `sidebar-group-${encodeURIComponent(e)}`;
- return `<details class="sec${r ? " cat-" + bn(r) : ""}" data-sidebar-group="${bn(e)}"><summary role="button" class="board-section-toggle"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-chevron-right"/></svg><span>${bn(e)}</span></summary><div class="board-sidebar-body" id="${i}">${t}${n}</div></details>`;
+ return `<details class="sec${r ? " cat-" + xn(r) : ""}" data-sidebar-group="${xn(e)}"><summary role="button" class="board-section-toggle"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-chevron-right"/></svg><span>${xn(e)}</span></summary><div class="board-sidebar-body" id="${i}">${t}${n}</div></details>`;
}
-function Sn(e) {
+function Cn(e) {
e.querySelectorAll("[data-sidebar-group]").forEach((e) => {
if (e.dataset.sidebarWired) return;
e.dataset.sidebarWired = "true";
@@ -1684,7 +1684,7 @@ function Sn(e) {
} catch {}
let i = !!t.querySelector("[aria-pressed=true]");
e.open = r === null ? i : r === "open";
- }), y(e, "details[data-sidebar-group]", "sidebar-collapse"), e.querySelectorAll(".board-section-toggle").forEach((e) => {
+ }), b(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 {
@@ -1693,37 +1693,37 @@ function Sn(e) {
}));
});
}
-var Cn = !1;
-async function wn(e, t) {
- if (Cn) return;
+var wn = !1;
+async function Tn(e, t) {
+ if (wn) 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:radial-gradient(circle closest-side,#000 78%,#0006 88%,transparent);mask-repeat:no-repeat;will-change:mask-position,mask-size;animation:peach-theme-reveal 560ms 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}}`, Cn = !0, document.head.append(o);
+ o.textContent = `::view-transition-old(root){animation:none}::view-transition-new(root){mix-blend-mode:normal;mask-image:radial-gradient(circle closest-side,#000 78%,#0006 88%,transparent);mask-repeat:no-repeat;will-change:mask-position,mask-size;animation:peach-theme-reveal 560ms 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}}`, wn = !0, document.head.append(o);
try {
await document.startViewTransition(t).finished;
} catch {
t();
} finally {
- o.remove(), Cn = !1;
+ o.remove(), wn = !1;
}
}
//#endregion
//#region src/settings-controls.tsx
-function Tn({ value: e, options: t, label: n, onChange: r, disabled: i = !1, className: a = "", fixed: o = !1 }) {
+function En({ value: e, options: t, label: n, onChange: r, disabled: i = !1, className: a = "", fixed: o = !1 }) {
let s = W(null), c = W(null), l = W(r);
l.current = r;
let u = JSON.stringify(t);
return U(() => {
let r = s.current;
- r.innerHTML = g(t, e, {
+ r.innerHTML = _(t, e, {
label: n,
className: "configselect",
attr: o ? "data-fixed-width" : ""
});
- let i = b(r.firstElementChild);
+ let i = x(r.firstElementChild);
c.current = i;
let a = () => l.current(i.value);
return i.addEventListener("change", a), () => {
@@ -1746,19 +1746,19 @@ function Tn({ value: e, options: t, label: n, onChange: r, disabled: i = !1, cla
class: a
});
}
-function En(e, t = "") {
+function Dn(e, t = "") {
let n = W(!1), r = W(new AbortController()), [i, a] = V(t);
H(() => () => r.current.abort(), []);
async function o(t, i, o) {
if (!(n.current || r.current.signal.aborted)) {
- n.current = !0, a(""), v(e.current, !0);
+ n.current = !0, a(""), y(e.current, !0);
try {
let e = await t(r.current.signal);
r.current.signal.aborted || i(e);
} catch (e) {
r.current.signal.aborted || (o ? o(e) : a(G(e)));
} finally {
- n.current = !1, r.current.signal.aborted || v(e.current, !1);
+ n.current = !1, r.current.signal.aborted || y(e.current, !1);
}
}
}
@@ -1769,7 +1769,7 @@ function En(e, t = "") {
busy: n
};
}
-function Dn({ id: e, titleId: t, title: n, help: r, error: i, children: a, footer: o, onSubmit: s, formRef: c, noValidate: l, warning: u }) {
+function On({ id: e, titleId: t, title: n, help: r, error: i, children: a, footer: o, onSubmit: s, formRef: c, noValidate: l, warning: u }) {
return /* @__PURE__ */ J("form", {
id: e,
class: "configfieldset",
@@ -1784,7 +1784,7 @@ function Dn({ id: e, titleId: t, title: n, help: r, error: i, children: a, foote
children: [
/* @__PURE__ */ J("div", {
class: "configfieldset-heading",
- children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d(t, n) } }), r && /* @__PURE__ */ J("p", {
+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: f(t, n) } }), r && /* @__PURE__ */ J("p", {
class: "confighelp",
children: r
})]
@@ -1805,7 +1805,7 @@ function Dn({ id: e, titleId: t, title: n, help: r, error: i, children: a, foote
}
//#endregion
//#region src/islands/access-settings.tsx
-function On({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1, disabled: s = !1 }) {
+function kn({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1, disabled: s = !1 }) {
return /* @__PURE__ */ J("div", {
class: "configfield",
children: [
@@ -1835,9 +1835,9 @@ function On({ id: e, label: t, value: n, onInput: r, error: i, help: a, current:
]
});
}
-function kn({ initial: e, receipt: t }) {
- let [n, r] = V(e), [i, a] = V(""), [o, s] = V(""), [c, l] = V(""), [u, d] = V(!1), [f, m] = V({}), h = W(null), g = W(null), { run: _, error: v, setError: y, busy: b } = En(g);
- return /* @__PURE__ */ J(Dn, {
+function An({ initial: e, receipt: t }) {
+ let [n, r] = V(e), [i, a] = V(""), [o, s] = V(""), [c, l] = V(""), [u, d] = V(!1), [f, p] = V({}), h = W(null), g = W(null), { run: _, error: v, setError: y, busy: b } = Dn(g);
+ return /* @__PURE__ */ J(On, {
titleId: "accessTitle",
title: "访问密码",
warning: u,
@@ -1845,7 +1845,7 @@ function kn({ initial: e, receipt: t }) {
if (e.preventDefault(), b.current) return;
y("");
let f = {};
- if (n.mode === "password" && !i && (f.current_password = "请输入当前访问密码"), u || ((o.length < 8 || o.length > 256) && (f.password = "访问密码需为 8–256 个字符"), o !== c && (f.confirmation = "两次输入的密码不一致")), m(f), Object.keys(f).length) {
+ if (n.mode === "password" && !i && (f.current_password = "请输入当前访问密码"), u || ((o.length < 8 || o.length > 256) && (f.password = "访问密码需为 8–256 个字符"), o !== c && (f.confirmation = "两次输入的密码不一致")), p(f), Object.keys(f).length) {
requestAnimationFrame(() => h.current?.querySelector("[aria-invalid=\"true\"]")?.focus());
return;
}
@@ -1857,10 +1857,10 @@ function kn({ initial: e, receipt: t }) {
password: u ? "" : o,
confirmation: u ? "" : c
}, "POST", e), (e) => {
- r(e), a(""), s(""), l(""), d(!1), m({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存访问密码");
+ r(e), a(""), s(""), l(""), d(!1), p({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存访问密码");
}, (e) => {
- let t = e instanceof ot ? e.body : null, n = t?.errors || t?.detail?.errors;
- n ? m(n) : y(G(e));
+ let t = e instanceof st ? e.body : null, n = t?.errors || t?.detail?.errors;
+ n ? p(n) : y(G(e));
});
},
noValidate: !0,
@@ -1891,7 +1891,7 @@ function kn({ initial: e, receipt: t }) {
})]
}), /* @__PURE__ */ J("span", { children: "关闭访问密码,允许能连接到 Peach 的设备直接访问" })]
}) : null,
- n.mode === "password" ? /* @__PURE__ */ J(On, {
+ n.mode === "password" ? /* @__PURE__ */ J(kn, {
id: "access-current",
label: "当前访问密码",
value: i,
@@ -1899,7 +1899,7 @@ function kn({ initial: e, receipt: t }) {
error: f.current_password,
current: !0
}) : null,
- n.mode === "locked" ? null : /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J(On, {
+ n.mode === "locked" ? null : /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J(kn, {
id: "access-password",
label: n.mode === "password" ? "新访问密码" : "设置访问密码",
value: o,
@@ -1907,7 +1907,7 @@ function kn({ initial: e, receipt: t }) {
disabled: u,
error: u ? void 0 : f.password,
help: u ? "关闭访问密码时无需填写。" : "至少 8 个字符。保存后其他设备需要重新登录。"
- }), /* @__PURE__ */ J(On, {
+ }), /* @__PURE__ */ J(kn, {
id: "access-confirm",
label: "确认访问密码",
value: c,
@@ -1915,7 +1915,7 @@ function kn({ initial: e, receipt: t }) {
disabled: u,
error: u ? void 0 : f.confirmation
})] }),
- u && /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: p("保存后,能连接到 Peach 的设备将直接访问馆藏。", {
+ u && /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: m("保存后,能连接到 Peach 的设备将直接访问馆藏。", {
variant: "warning",
label: "访问范围"
}) } })
@@ -1924,7 +1924,7 @@ function kn({ initial: e, receipt: t }) {
}
//#endregion
//#region src/islands/release-updates.tsx
-var An = /* @__PURE__ */ new Set([
+var jn = /* @__PURE__ */ new Set([
"downloading",
"verifying",
"extracting",
@@ -1932,22 +1932,22 @@ var An = /* @__PURE__ */ new Set([
"restarting",
"installing"
]);
-function jn({ initial: e, initialJob: t }) {
+function Mn({ initial: e, initialJob: t }) {
let [n, r] = V(e), [i, a] = V(t || {
state: "idle",
progress: 0
- }), [o, s] = V(""), c = W(null), u = W(!0), f = W(!1), h = W(null);
+ }), [o, s] = V(""), c = W(null), l = W(!0), d = W(!1), p = W(null);
H(() => {
- v(h.current, An.has(i.state));
+ y(p.current, jn.has(i.state));
}, [i.state]), H(() => () => {
- u.current = !1, c.current?.abort();
+ l.current = !1, c.current?.abort();
}, []);
let g = async () => {
let e = await q("/api/configuration/update-restart", {});
- u.current && a(e);
+ l.current && a(e);
};
H(() => {
- i.state !== "ready" || f.current || (f.current = !0, l({
+ i.state !== "ready" || d.current || (d.current = !0, u({
title: "更新已准备好",
body: `Peach ${i.version || ""} 将在重启后安装。`,
confirmLabel: "立即重启",
@@ -1971,28 +1971,28 @@ function jn({ initial: e, initialJob: t }) {
} catch {
++n >= 120 && !e.signal.aborted && s("尚未连接到 Peach,请检查托盘后刷新页面。");
}
- !e.signal.aborted && n < 120 && (t = setTimeout(o, An.has(i.state) ? 1e3 : 3e4));
+ !e.signal.aborted && n < 120 && (t = setTimeout(o, jn.has(i.state) ? 1e3 : 3e4));
};
- return t = setTimeout(o, An.has(i.state) ? 1e3 : 3e4), () => {
+ return t = setTimeout(o, jn.has(i.state) ? 1e3 : 3e4), () => {
e.abort(), clearTimeout(t);
};
}, [i.state]);
let _ = async (e) => {
- if (c.current || An.has(i.state)) return;
+ if (c.current || jn.has(i.state)) return;
let t = new AbortController();
- c.current = t, f.current = !1, s(""), v(e, !0);
+ c.current = t, d.current = !1, s(""), y(e, !0);
try {
let e = await q("/api/configuration/update", {}, "POST", t.signal);
t.signal.aborted || a(e);
} catch (e) {
t.signal.aborted || s(G(e));
} finally {
- c.current = null, v(e, !1);
+ c.current = null, y(e, !1);
}
- }, y = async (t) => {
+ }, v = async (t) => {
if (c.current) return;
let n = new AbortController();
- c.current = n, v(t, !0), s("");
+ c.current = n, y(t, !0), s("");
try {
let e = await K("/api/configuration/updates", n.signal);
n.signal.aborted || r(e);
@@ -2002,7 +2002,7 @@ function jn({ initial: e, initialJob: t }) {
state: "error"
}), s(G(t)));
} finally {
- c.current = null, v(t, !1);
+ c.current = null, y(t, !1);
}
};
return /* @__PURE__ */ J("section", {
@@ -2012,7 +2012,7 @@ function jn({ initial: e, initialJob: t }) {
children: [/* @__PURE__ */ J("div", {
class: "geist-fieldset-content",
children: [
- /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("configUpdatesTitle", "检查更新") } }),
+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: f("configUpdatesTitle", "检查更新") } }),
/* @__PURE__ */ J("dl", {
class: "configfacts",
children: [
@@ -2032,7 +2032,7 @@ function jn({ initial: e, initialJob: t }) {
}) : null,
n.state === "available" && !o ? /* @__PURE__ */ J("div", {
role: "status",
- dangerouslySetInnerHTML: { __html: p(n.message, { label: "有可用更新" }) }
+ dangerouslySetInnerHTML: { __html: m(n.message, { label: "有可用更新" }) }
}) : /* @__PURE__ */ J("p", {
class: o || n.state === "error" ? "configbad" : "confighelp",
role: o || n.state === "error" ? "alert" : "status",
@@ -2044,7 +2044,7 @@ function jn({ initial: e, initialJob: t }) {
class: i.state === "error" ? "configbad" : "confighelp",
children: i.message
}), i.state === "error" ? null : /* @__PURE__ */ J(L, { children: [
- /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: m("更新准备进度:下载、校验、解压、准备安装", i.progress, 100, { stops: [
+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: h("更新准备进度:下载、校验、解压、准备安装", i.progress, 100, { stops: [
{
value: 65,
label: "下载结束"
@@ -2089,7 +2089,7 @@ function jn({ initial: e, initialJob: t }) {
type: "button",
class: "geist-button primary",
onClick: () => {
- l({
+ u({
title: "更新已准备好",
body: `Peach ${i.version || ""} 将在重启后安装。`,
confirmLabel: "立即重启",
@@ -2100,7 +2100,7 @@ function jn({ initial: e, initialJob: t }) {
children: "重启安装"
}) : null,
n.state === "available" && n.installation === "独立测试包" && i.state !== "ready" ? /* @__PURE__ */ J("button", {
- ref: h,
+ ref: p,
type: "button",
class: "geist-button primary",
onClick: (e) => _(e.currentTarget),
@@ -2109,8 +2109,8 @@ function jn({ initial: e, initialJob: t }) {
/* @__PURE__ */ J("button", {
type: "button",
class: "geist-button",
- disabled: An.has(i.state),
- onClick: (e) => y(e.currentTarget),
+ disabled: jn.has(i.state),
+ onClick: (e) => v(e.currentTarget),
children: "检查更新"
})
]
@@ -2119,12 +2119,12 @@ function jn({ initial: e, initialJob: t }) {
}
//#endregion
//#region src/islands/automatic-updates.tsx
-function Mn({ initial: e, receipt: t }) {
- let [n, r] = V(e.mode), [i, a] = V(e.interval_hours), o = W(null), s = En(o, e.error), c = () => s.run((e) => q("/api/configuration/automatic-updates", {
+function Nn({ initial: e, receipt: t }) {
+ let [n, r] = V(e.mode), [i, a] = V(e.interval_hours), o = W(null), s = Dn(o, e.error), c = () => s.run((e) => q("/api/configuration/automatic-updates", {
mode: n,
interval_hours: i
}, "POST", e), () => t("已保存自动更新设置"));
- return /* @__PURE__ */ J(Dn, {
+ return /* @__PURE__ */ J(On, {
titleId: "automaticUpdatesTitle",
title: "自动更新",
error: s.error,
@@ -2165,7 +2165,7 @@ function Mn({ initial: e, receipt: t }) {
})]
})]
}),
- /* @__PURE__ */ J(Tn, {
+ /* @__PURE__ */ J(En, {
value: String(i),
onChange: (e) => a(Number(e)),
label: "检查频率",
@@ -2185,14 +2185,14 @@ function Mn({ initial: e, receipt: t }) {
}
//#endregion
//#region src/islands/peach-proxy.tsx
-function Nn({ initial: e, receipt: t }) {
- let [n, r] = V(e), [i, a] = V(e.mode), [o, s] = V(""), c = W(null), l = En(c), u = () => l.run((e) => q("/api/configuration/peach-proxy", {
+function Pn({ initial: e, receipt: t }) {
+ let [n, r] = V(e), [i, a] = V(e.mode), [o, s] = V(""), c = W(null), l = Dn(c), u = () => l.run((e) => q("/api/configuration/peach-proxy", {
mode: i,
proxy: o
}, "POST", e), (e) => {
r(e), s(""), t("已保存 Peach 代理");
});
- return /* @__PURE__ */ J(Dn, {
+ return /* @__PURE__ */ J(On, {
id: "peachProxy",
titleId: "peachProxyTitle",
title: "Peach 代理",
@@ -2208,7 +2208,7 @@ function Nn({ initial: e, receipt: t }) {
children: "保存代理"
}),
children: [
- /* @__PURE__ */ J(Tn, {
+ /* @__PURE__ */ J(En, {
value: i,
onChange: a,
label: "Peach 代理",
@@ -2243,7 +2243,7 @@ function Nn({ initial: e, receipt: t }) {
}
//#endregion
//#region src/islands/desktop-settings.tsx
-function Pn({ label: e, checked: t, disabled: n, change: r }) {
+function Fn({ label: e, checked: t, disabled: n, change: r }) {
return /* @__PURE__ */ J("label", {
class: "configcheck",
children: [/* @__PURE__ */ J("span", {
@@ -2263,7 +2263,7 @@ function Pn({ label: e, checked: t, disabled: n, change: r }) {
}), /* @__PURE__ */ J("span", { children: e })]
});
}
-function Fn({ label: e, checked: t, disabled: n, change: r }) {
+function In({ label: e, checked: t, disabled: n, change: r }) {
return /* @__PURE__ */ J("label", {
class: "configtoggle",
children: [/* @__PURE__ */ J("span", { children: e }), /* @__PURE__ */ J("input", {
@@ -2276,11 +2276,11 @@ function Fn({ label: e, checked: t, disabled: n, change: r }) {
})]
});
}
-function In({ startup: e, receipt: t }) {
- let [n, r] = V(e.enabled), [i, a] = V(e.silent), [o, s] = V(e.desktop), [c, l] = V(""), u = W(!1), f = W(null), p = e.available && !e.desktop_message;
+function Ln({ startup: e, receipt: t }) {
+ let [n, r] = V(e.enabled), [i, a] = V(e.silent), [o, s] = V(e.desktop), [c, l] = V(""), u = W(!1), d = W(null), p = e.available && !e.desktop_message;
async function m() {
if (!u.current) {
- u.current = !0, v(f.current, !0), l("");
+ u.current = !0, y(d.current, !0), l("");
try {
await q("/api/configuration/startup", {
enabled: n,
@@ -2290,7 +2290,7 @@ function In({ startup: e, receipt: t }) {
} catch (e) {
l(G(e));
} finally {
- u.current = !1, v(f.current, !1);
+ u.current = !1, y(d.current, !1);
}
}
}
@@ -2303,13 +2303,13 @@ function In({ startup: e, receipt: t }) {
children: [/* @__PURE__ */ J("div", {
class: "geist-fieldset-content",
children: [
- /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("startupTitle", "开机自启") } }),
+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: f("startupTitle", "开机自启") } }),
/* @__PURE__ */ J("div", {
class: "configoptions",
role: "group",
"aria-labelledby": "startupTitle",
children: [
- /* @__PURE__ */ J(Fn, {
+ /* @__PURE__ */ J(In, {
label: "开机后启动 Peach",
checked: n,
disabled: !e.available,
@@ -2317,7 +2317,7 @@ function In({ startup: e, receipt: t }) {
}),
/* @__PURE__ */ J("div", {
class: "configoption",
- children: [/* @__PURE__ */ J(Fn, {
+ children: [/* @__PURE__ */ J(In, {
label: "静默启动",
checked: i,
disabled: !e.available || !n,
@@ -2329,7 +2329,7 @@ function In({ startup: e, receipt: t }) {
}),
/* @__PURE__ */ J("div", {
class: "configoption",
- children: [/* @__PURE__ */ J(Fn, {
+ children: [/* @__PURE__ */ J(In, {
label: "在桌面创建快捷方式",
checked: o,
disabled: !p,
@@ -2355,7 +2355,7 @@ function In({ startup: e, receipt: t }) {
class: "geist-fieldset-footer",
"data-geist-fieldset-footer": !0,
children: /* @__PURE__ */ J("button", {
- ref: f,
+ ref: d,
type: "submit",
class: "geist-button primary",
disabled: !e.available,
@@ -2364,7 +2364,7 @@ function In({ startup: e, receipt: t }) {
})]
});
}
-function Ln({ data: e }) {
+function Rn({ data: e }) {
let t = W(null);
return U(() => {
let n = t.current, r = document.createElement("details");
@@ -2375,13 +2375,13 @@ function Ln({ data: e }) {
let e = document.createElement("p");
e.className = "confighelp", e.textContent = t, r.append(e);
}
- return n.replaceChildren(r), y(n, "details", "uninstall-data"), () => n.replaceChildren();
+ return n.replaceChildren(r), b(n, "details", "uninstall-data"), () => n.replaceChildren();
}, [e]), /* @__PURE__ */ J("div", { ref: t });
}
-function Rn({ uninstall: e }) {
+function zn({ uninstall: e }) {
let [t, n] = V(!1), [r, i] = V("");
async function a() {
- await l({
+ await u({
title: "卸载 Peach",
danger: !0,
body: t ? "将退出 Peach,移除程序、开机自启、桌面图标、设置、本地数据库、观看记录、凭据和缓存。原始媒体文件保留。" : "将退出 Peach 并移除程序、开机自启和桌面图标。设置、本地数据库、观看记录与缓存保留。",
@@ -2405,18 +2405,18 @@ function Rn({ uninstall: e }) {
children: [
/* @__PURE__ */ J("div", {
class: "configfieldset-heading",
- children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("uninstallTitle", "卸载 Peach") } }), e.available && /* @__PURE__ */ J("p", {
+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: f("uninstallTitle", "卸载 Peach") } }), e.available && /* @__PURE__ */ J("p", {
class: "confighelp",
children: "卸载会退出 Peach、移除程序、开机自启和桌面图标。原始媒体文件保留。"
})]
}),
- /* @__PURE__ */ J(Pn, {
+ /* @__PURE__ */ J(Fn, {
label: "完全卸载:同时删除设置、本地数据库、观看记录、凭据和缓存",
checked: t,
disabled: !e.full_available || !!r,
change: n
}),
- /* @__PURE__ */ J(Ln, { data: e }),
+ /* @__PURE__ */ J(Rn, { data: e }),
e.message && /* @__PURE__ */ J("p", {
class: "confighelp",
children: e.message
@@ -2442,7 +2442,7 @@ function Rn({ uninstall: e }) {
}
//#endregion
//#region src/islands/clouddrive-guide.tsx
-var zn = [
+var Bn = [
{
name: "机械硬盘,或内存 8 GB 以内",
cache: "10–20 GiB",
@@ -2462,10 +2462,10 @@ var zn = [
task: "2 个起步"
}
];
-function Bn() {
+function Vn() {
let e = W(null);
return U(() => {
- e.current && y(e.current, "details", "clouddrive-guide");
+ e.current && b(e.current, "details", "clouddrive-guide");
}, []), /* @__PURE__ */ J("div", {
ref: e,
class: "cloudguide",
@@ -2514,7 +2514,7 @@ function Bn() {
scope: "col",
children: "同时处理视频"
})
- ] }) }), /* @__PURE__ */ J("tbody", { children: zn.map((e) => /* @__PURE__ */ J("tr", { children: [
+ ] }) }), /* @__PURE__ */ J("tbody", { children: Bn.map((e) => /* @__PURE__ */ J("tr", { children: [
/* @__PURE__ */ J("th", {
scope: "row",
children: e.name
@@ -2558,7 +2558,7 @@ function Bn() {
}
//#endregion
//#region src/library-icon-picker.tsx
-var Vn = [
+var Hn = [
["", "自动识别"],
["hard-drive", "磁盘"],
["database", "资料库"],
@@ -2602,14 +2602,14 @@ var Vn = [
["star", "收藏"],
["tags", "主题"]
];
-function Hn(e) {
+function Un(e) {
let t = e === "local" ? "" : s[e];
return t ? [t, "自动识别"] : ["hard-drive", "默认"];
}
-function Un({ value: e, label: t, kind: n = "local", onChange: r }) {
- let [i, a] = V(e), o = W(null), s = W(null), [c, l] = Hn(n), u = (e) => /* @__PURE__ */ J("span", {
+function Wn({ value: e, label: t, kind: n = "local", onChange: r }) {
+ let [i, a] = V(e), o = W(null), s = W(null), [c, l] = Un(n), u = (e) => /* @__PURE__ */ J("span", {
"aria-hidden": "true",
- dangerouslySetInnerHTML: { __html: _(e || c) }
+ dangerouslySetInnerHTML: { __html: v(e || c) }
}), d = (e, t) => e ? t : l;
return /* @__PURE__ */ J("div", {
class: "board-icon-picker",
@@ -2626,7 +2626,7 @@ function Un({ value: e, label: t, kind: n = "local", onChange: r }) {
let r = t.getBoundingClientRect();
t.style.left = `${Math.max(8, Math.min(innerWidth - r.width - 8, n.left))}px`, t.style.top = `${n.bottom + r.height + 8 <= innerHeight ? n.bottom + 4 : Math.max(8, n.top - r.height - 4)}px`;
},
- children: [u(e), /* @__PURE__ */ J("span", { children: d(e, Vn.find(([t]) => t === e)?.[1] || l) })]
+ children: [u(e), /* @__PURE__ */ J("span", { children: d(e, Hn.find(([t]) => t === e)?.[1] || l) })]
}), /* @__PURE__ */ J("dialog", {
ref: o,
class: "board-icon-popover",
@@ -2641,7 +2641,7 @@ function Un({ value: e, label: t, kind: n = "local", onChange: r }) {
role: "radiogroup",
"aria-label": "候选图标",
class: "board-icon-grid",
- children: Vn.map(([e, n]) => /* @__PURE__ */ J("label", {
+ children: Hn.map(([e, n]) => /* @__PURE__ */ J("label", {
title: d(e, n),
class: i === e ? "selected" : "",
children: [/* @__PURE__ */ J("input", {
@@ -2675,18 +2675,18 @@ function Un({ value: e, label: t, kind: n = "local", onChange: r }) {
}
//#endregion
//#region src/islands/configuration.tsx
-var Wn = "/api/configuration", Gn = "/api/pick-folder", Kn = 8e3, qn = (e, t) => K(Wn, t), Jn = ({ html: e, class: t }) => /* @__PURE__ */ J("div", {
+var Gn = "/api/configuration", Kn = "/api/pick-folder", qn = 8e3, Jn = (e, t) => K(Gn, t), Yn = ({ html: e, class: t }) => /* @__PURE__ */ J("div", {
class: t,
dangerouslySetInnerHTML: { __html: e }
-}), Yn = (e) => !(e instanceof ot) || e.status !== 400 ? null : e.body?.errors ?? null;
-function Xn({ facts: e }) {
+}), Xn = (e) => !(e instanceof st) || e.status !== 400 ? null : e.body?.errors ?? null;
+function Zn({ facts: e }) {
return /* @__PURE__ */ J("section", {
class: "configfieldset",
"data-geist-fieldset": !0,
"aria-labelledby": "configFactsTitle",
children: /* @__PURE__ */ J("div", {
class: "geist-fieldset-content",
- children: [/* @__PURE__ */ J(Jn, { html: d("configFactsTitle", "运行信息") }), /* @__PURE__ */ J("dl", {
+ children: [/* @__PURE__ */ J(Yn, { html: f("configFactsTitle", "运行信息") }), /* @__PURE__ */ J("dl", {
class: "configfacts",
children: e.map((e) => /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("dt", { children: e.term }), /* @__PURE__ */ J("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ J("span", {
class: "confighelp",
@@ -2707,20 +2707,20 @@ function Xn({ facts: e }) {
})
});
}
-function Zn({ data: e }) {
+function Qn({ data: e }) {
let [t, n] = V(e.media_sources), [r, i] = V(""), a = W(null);
H(() => () => a.current?.abort(), []);
let o = async (e) => {
if (a.current) return;
let t = new AbortController();
- a.current = t, v(e, !0), i("");
+ a.current = t, y(e, !0), i("");
try {
- let e = await K(Wn, t.signal);
+ let e = await K(Gn, t.signal);
t.signal.aborted || n(e.media_sources);
} catch (e) {
t.signal.aborted || i(G(e));
} finally {
- a.current = null, v(e, !1);
+ a.current = null, y(e, !1);
}
};
return t ? /* @__PURE__ */ J("section", {
@@ -2729,12 +2729,12 @@ function Zn({ data: e }) {
children: [/* @__PURE__ */ J("div", {
class: "geist-fieldset-content",
children: [
- /* @__PURE__ */ J(Jn, { html: d("configMountsTitle", "挂载状态") }),
+ /* @__PURE__ */ J(Yn, { html: f("configMountsTitle", "挂载状态") }),
/* @__PURE__ */ J("dl", {
class: "configfacts",
children: t.map((e) => /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("dt", { children: [/* @__PURE__ */ J("span", {
"aria-hidden": "true",
- dangerouslySetInnerHTML: { __html: _(s[e.location]) }
+ dangerouslySetInnerHTML: { __html: v(s[e.location]) }
}), {
local: "本地磁盘",
115: "CloudDrive · 115",
@@ -2766,8 +2766,8 @@ function Zn({ data: e }) {
})]
}) : null;
}
-function Qn({ value: e, label: t, onChange: n }) {
- return /* @__PURE__ */ J(Tn, {
+function $n({ value: e, label: t, onChange: n }) {
+ return /* @__PURE__ */ J(En, {
value: e,
label: t,
onChange: n,
@@ -2783,17 +2783,17 @@ function Qn({ value: e, label: t, onChange: n }) {
])
});
}
-function $n({ data: e, receipt: t }) {
+function er({ data: e, receipt: t }) {
let n = e.media_sources?.filter((e) => [
"local",
"115",
"pikpak"
- ].includes(e.location)), [r, i] = V(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [a, o] = V(n?.map((e) => e.location) ?? []), [s, c] = V(n?.map((e) => e.root) ?? []), [l, u] = V(n?.map((e) => e.library || "") ?? []), [f, m] = V(n?.map((e) => e.library_icon || "") ?? []), [h, g] = V(String(e.port)), [_, y] = V(!1), [b, x] = V([]), [S, C] = V(""), [w, T] = V(""), [E, D] = V(null), [O, k] = V(null), A = W(!1), j = W(e.revision), ee = W([]), M = W(null);
+ ].includes(e.location)), [r, i] = V(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [a, o] = V(n?.map((e) => e.location) ?? []), [s, c] = V(n?.map((e) => e.root) ?? []), [l, u] = V(n?.map((e) => e.library || "") ?? []), [d, p] = V(n?.map((e) => e.library_icon || "") ?? []), [h, g] = V(String(e.port)), [_, v] = V(!1), [b, x] = V([]), [S, C] = V(""), [w, T] = V(""), [E, D] = V(null), [O, k] = V(null), A = W(!1), j = W(e.revision), M = W([]), ee = W(null);
U(() => {
- O !== null && (ee.current[O]?.focus(), k(null));
+ O !== null && (M.current[O]?.focus(), k(null));
}, [O]), H(() => {
if (!E) return;
- let e = setTimeout(() => location.assign(E.url), Kn);
+ let e = setTimeout(() => location.assign(E.url), qn);
return () => clearTimeout(e);
}, [E]);
let N = (e, t) => {
@@ -2801,7 +2801,7 @@ function $n({ data: e, receipt: t }) {
}, te = () => {
k(r.length), i((e) => [...e, ""]);
}, P = (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));
+ o((t) => t.filter((t, n) => n !== 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)), i((t) => t.filter((t, n) => n !== e)), x((t) => t.filter((t, n) => n !== e));
}, F = (e, t) => {
x((n) => {
let r = [...n];
@@ -2810,14 +2810,14 @@ function $n({ data: e, receipt: t }) {
});
}, ne = async (e, t) => {
if (t.getAttribute("aria-busy") !== "true") {
- v(t, !0);
+ y(t, !0);
try {
- let { path: t } = await q(Gn, { initial: r[e] ?? "" });
+ let { path: t } = await q(Kn, { initial: r[e] ?? "" });
t && (N(e, t), F(e, ""));
} catch (t) {
F(e, G(t));
} finally {
- v(t, !1);
+ y(t, !1);
}
}
};
@@ -2846,9 +2846,9 @@ function $n({ data: e, receipt: t }) {
"aria-labelledby": "configTitle",
onSubmit: async (n) => {
if (n.preventDefault(), !A.current) {
- A.current = !0, v(M.current, !0), T("");
+ A.current = !0, y(ee.current, !0), T("");
try {
- let n = await q(Wn, {
+ let n = await q(Gn, {
revision: j.current,
media_dirs: r,
...e.media_sources ? { media_sources: r.map((e, t) => ({
@@ -2856,17 +2856,17 @@ function $n({ data: e, receipt: t }) {
location: a[t] || "local",
root: s[t] || "",
library: l[t] || "",
- library_icon: f[t] || ""
+ library_icon: d[t] || ""
})) } : {},
port: h,
scan_now: _
});
j.current = n.revision, x([]), C(""), t("已保存配置"), D(n);
} catch (e) {
- let t = Yn(e);
+ let t = Xn(e);
t ? (x(t.media_dirs ?? []), C(t.port ?? "")) : (x([]), C(""), T(G(e)));
} finally {
- A.current = !1, v(M.current, !1);
+ A.current = !1, y(ee.current, !1);
}
}
},
@@ -2874,7 +2874,7 @@ function $n({ data: e, receipt: t }) {
children: [/* @__PURE__ */ J("div", {
class: "geist-fieldset-content",
children: [
- /* @__PURE__ */ J(Jn, { html: d("configTitle", "这台电脑") }),
+ /* @__PURE__ */ J(Yn, { html: f("configTitle", "这台电脑") }),
/* @__PURE__ */ J("div", {
class: "configfield",
children: [
@@ -2902,7 +2902,7 @@ function $n({ data: e, receipt: t }) {
"aria-invalid": b[n] ? "true" : void 0,
onInput: (e) => N(n, e.currentTarget.value),
ref: (e) => {
- ee.current[n] = e;
+ M.current[n] = e;
}
}),
/* @__PURE__ */ J("button", {
@@ -2943,19 +2943,19 @@ function $n({ data: e, receipt: t }) {
})] }),
/* @__PURE__ */ J("div", {
class: "configsourcelabel",
- children: ["媒体库图标", /* @__PURE__ */ J(Un, {
+ children: ["媒体库图标", /* @__PURE__ */ J(Wn, {
label: `媒体库图标 ${n + 1}`,
- value: f[n] || "",
+ value: d[n] || "",
kind: a[n] || "local",
onChange: (e) => {
- let t = [...f];
- t[n] = e, m(t);
+ let t = [...d];
+ t[n] = e, p(t);
}
})]
}),
/* @__PURE__ */ J("div", {
class: "configsourcelabel",
- children: ["媒体来源", /* @__PURE__ */ J(Qn, {
+ children: ["媒体来源", /* @__PURE__ */ J($n, {
label: `媒体来源 ${n + 1}`,
value: a[n] || "local",
onChange: (e) => {
@@ -2990,7 +2990,7 @@ function $n({ data: e, receipt: t }) {
onClick: te,
children: "添加文件夹"
}),
- a.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ J(Bn, {}) : null,
+ a.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ J(Vn, {}) : null,
a.some((e) => e === "115" || e === "pikpak") ? e.mount_dependencies?.filter((e) => !e.available).map((e) => /* @__PURE__ */ J("p", {
class: "confighelp",
children: [
@@ -3055,7 +3055,7 @@ function $n({ data: e, receipt: t }) {
children: [/* @__PURE__ */ J("input", {
type: "checkbox",
checked: _,
- onChange: (e) => y(e.currentTarget.checked)
+ onChange: (e) => v(e.currentTarget.checked)
}), /* @__PURE__ */ J("span", {
"aria-hidden": "true",
children: /* @__PURE__ */ J("svg", {
@@ -3065,7 +3065,7 @@ function $n({ data: e, receipt: t }) {
})]
}), /* @__PURE__ */ J("span", { children: "保存后扫描并补全资料" })]
}),
- w ? /* @__PURE__ */ J(Jn, { html: p(w, {
+ w ? /* @__PURE__ */ J(Yn, { html: m(w, {
variant: "error",
label: "没有保存"
}) }) : null
@@ -3076,16 +3076,16 @@ function $n({ data: e, receipt: t }) {
children: [/* @__PURE__ */ J("p", { children: e.port_editable === !1 ? "保存后 Peach 会重新载入配置。" : "保存后 Peach 会重新启动,端口改了就用新地址打开。" }), /* @__PURE__ */ J("button", {
type: "submit",
class: "geist-button primary",
- ref: M,
+ ref: ee,
children: "保存配置"
})]
})]
});
}
-function er({ receipt: e, data: t, error: n }) {
- return n || !t ? /* @__PURE__ */ J(Jn, {
+function tr({ receipt: e, data: t, error: n }) {
+ return n || !t ? /* @__PURE__ */ J(Yn, {
class: "configpage",
- html: p(n || "没有读到配置", {
+ html: m(n || "没有读到配置", {
variant: "error",
label: "打不开配置"
})
@@ -3096,7 +3096,7 @@ function er({ receipt: e, data: t, error: n }) {
class: "configgroup",
children: "通用"
}) : null,
- t.startup ? /* @__PURE__ */ J(In, {
+ t.startup ? /* @__PURE__ */ J(Ln, {
startup: t.startup,
receipt: e
}) : null,
@@ -3104,23 +3104,23 @@ function er({ receipt: e, data: t, error: n }) {
class: "configgroup",
children: "媒体"
}),
- t.editable ? /* @__PURE__ */ J($n, {
+ t.editable ? /* @__PURE__ */ J(er, {
data: t,
receipt: e
- }) : /* @__PURE__ */ J(Jn, { html: p(t.notice, {
+ }) : /* @__PURE__ */ J(Yn, { html: m(t.notice, {
variant: "secondary",
label: "只读"
}) }),
- /* @__PURE__ */ J(Zn, { data: t }),
+ /* @__PURE__ */ J(Qn, { data: t }),
t.peach_proxy || t.access ? /* @__PURE__ */ J("h2", {
class: "configgroup",
children: "网络与访问"
}) : null,
- t.peach_proxy ? /* @__PURE__ */ J(Nn, {
+ t.peach_proxy ? /* @__PURE__ */ J(Pn, {
initial: t.peach_proxy,
receipt: e
}) : null,
- t.access ? /* @__PURE__ */ J(kn, {
+ t.access ? /* @__PURE__ */ J(An, {
initial: t.access,
receipt: e
}) : null,
@@ -3128,38 +3128,38 @@ function er({ receipt: e, data: t, error: n }) {
class: "configgroup",
children: "更新与维护"
}),
- t.automatic_updates ? /* @__PURE__ */ J(Mn, {
+ t.automatic_updates ? /* @__PURE__ */ J(Nn, {
initial: t.automatic_updates,
receipt: e
}) : null,
- t.updates ? /* @__PURE__ */ J(jn, {
+ t.updates ? /* @__PURE__ */ J(Mn, {
initial: t.updates,
initialJob: t.update_job
}) : null,
- /* @__PURE__ */ J(Xn, { facts: t.facts }),
- t.uninstall ? /* @__PURE__ */ J(Rn, { uninstall: t.uninstall }) : null
+ /* @__PURE__ */ J(Zn, { facts: t.facts }),
+ t.uninstall ? /* @__PURE__ */ J(zn, { uninstall: t.uninstall }) : null
]
});
}
//#endregion
//#region node_modules/@preact/signals-core/dist/signals-core.module.js
-var tr = Symbol.for("preact-signals");
-function nr() {
+var nr = Symbol.for("preact-signals");
+function rr() {
if (Z > 1) Z--;
else {
var e, t = !1;
for ((function() {
- var e = ur;
- for (ur = void 0; e !== void 0;) {
+ var e = dr;
+ for (dr = 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;
}
- })(); or !== void 0;) {
- var n = or;
- for (or = void 0, sr++; n !== void 0;) {
+ })(); sr !== void 0;) {
+ var n = sr;
+ for (sr = void 0, cr++; n !== void 0;) {
var r = n.u;
- if (n.u = void 0, n.f &= -3, !(8 & n.f) && mr(n)) try {
+ if (n.u = void 0, n.f &= -3, !(8 & n.f) && hr(n)) try {
n.c();
} catch (n) {
t ||= (e = n, !0);
@@ -3167,30 +3167,30 @@ function nr() {
n = r;
}
}
- if (sr = 0, Z--, t) throw e;
+ if (cr = 0, Z--, t) throw e;
}
}
-function rr(e) {
+function ir(e) {
if (Z > 0) return e();
- lr = ++cr, Z++;
+ ur = ++lr, Z++;
try {
return e();
} finally {
- nr();
+ rr();
}
}
-var ir, X = void 0;
-function ar(e) {
- var t = X, n = ir;
- X = void 0, ir = void 0;
+var ar, X = void 0;
+function or(e) {
+ var t = X, n = ar;
+ X = void 0, ar = void 0;
try {
return e();
} finally {
- X = t, ir = n;
+ X = t, ar = n;
}
}
-var or = void 0, Z = 0, sr = 0, cr = 0, lr = 0, ur = void 0, dr = 0;
-function fr(e) {
+var sr = void 0, Z = 0, cr = 0, lr = 0, ur = 0, dr = void 0, fr = 0;
+function pr(e) {
if (X !== void 0) {
var t = e.n;
if (t === void 0 || t.t !== X) return t = {
@@ -3209,11 +3209,11 @@ function fr(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 = tr, Q.prototype.h = function() {
+Q.prototype.brand = nr, 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 ? ar(function() {
+ n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? or(function() {
var e;
(e = t.W) == null || e.call(t);
}) : n.e = e);
@@ -3221,16 +3221,16 @@ Q.prototype.brand = tr, 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 && ar(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 && or(function() {
var e;
(e = t.Z) == null || e.call(t);
}));
}
}, Q.prototype.subscribe = function(e) {
var t = this;
- return Cr(function() {
+ return wr(function() {
var n = t.value;
- ar(function() {
+ or(function() {
return e(n);
});
}, { name: "sub" });
@@ -3242,41 +3242,41 @@ Q.prototype.brand = tr, Q.prototype.h = function() {
return this.value;
}, Q.prototype.peek = function() {
var e = this;
- return ar(function() {
+ return or(function() {
return e.value;
});
}, Object.defineProperty(Q.prototype, "value", {
get: function() {
- var e = fr(this);
+ var e = pr(this);
return e !== void 0 && (e.i = this.i), this.v;
},
set: function(e) {
if (e !== this.v) {
- if (sr > 100) throw Error("Cycle detected");
+ if (cr > 100) throw Error("Cycle detected");
(function(e) {
- Z !== 0 && sr === 0 && e.l !== lr && (e.l = lr, ur = {
+ Z !== 0 && cr === 0 && e.l !== ur && (e.l = ur, dr = {
S: e,
v: e.v,
i: e.i,
- o: ur
+ o: dr
});
- })(this), this.v = e, this.i++, dr++, Z++;
+ })(this), this.v = e, this.i++, fr++, Z++;
try {
for (var t = this.t; t !== void 0; t = t.x) t.t.N();
} finally {
- nr();
+ rr();
}
}
}
});
-function pr(e, t) {
+function mr(e, t) {
return new Q(e, t);
}
-function mr(e) {
+function hr(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 hr(e) {
+function gr(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) {
@@ -3285,55 +3285,55 @@ function hr(e) {
}
}
}
-function gr(e) {
+function _r(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 _r(e, t) {
- Q.call(this, void 0, t), this.x = e, this.s = void 0, this.g = dr - 1, this.f = 4;
+function vr(e, t) {
+ Q.call(this, void 0, t), this.x = e, this.s = void 0, this.g = fr - 1, this.f = 4;
}
-_r.prototype = new Q(), _r.prototype.h = function() {
+vr.prototype = new Q(), vr.prototype.h = function() {
if (this.f &= -3, 1 & this.f) return !1;
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === dr)) return !0;
- if (this.g = dr, this.f |= 1, this.i > 0 && !mr(this)) return this.f &= -2, !0;
+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === fr)) return !0;
+ if (this.g = fr, this.f |= 1, this.i > 0 && !hr(this)) return this.f &= -2, !0;
var e = X;
try {
- hr(this), X = this;
+ gr(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, gr(this), this.f &= -2, !0;
-}, _r.prototype.S = function(e) {
+ return X = e, _r(this), this.f &= -2, !0;
+}, vr.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);
-}, _r.prototype.U = function(e) {
+}, vr.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);
}
-}, _r.prototype.N = function() {
+}, vr.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(_r.prototype, "value", { get: function() {
+}, Object.defineProperty(vr.prototype, "value", { get: function() {
if (1 & this.f) throw Error("Cycle detected");
- var e = fr(this);
+ var e = pr(this);
if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;
return this.v;
} });
-function vr(e, t) {
- return new _r(e, t);
+function yr(e, t) {
+ return new vr(e, t);
}
-function yr(e) {
+function br(e) {
var t = e.m;
if (e.m = void 0, typeof t == "function") {
Z++;
@@ -3342,24 +3342,24 @@ function yr(e) {
try {
t();
} catch (t) {
- throw e.f &= -2, e.f |= 8, br(e), t;
+ throw e.f &= -2, e.f |= 8, xr(e), t;
} finally {
- X = n, nr();
+ X = n, rr();
}
}
}
-function br(e) {
+function xr(e) {
for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
- e.x = void 0, e.s = void 0, yr(e);
+ e.x = void 0, e.s = void 0, br(e);
}
-function xr(e) {
+function Sr(e) {
if (X !== this) throw Error("Out-of-order effect");
- gr(this), X = e, this.f &= -2, 8 & this.f && br(this), nr();
+ _r(this), X = e, this.f &= -2, 8 & this.f && xr(this), rr();
}
-function Sr(e, t) {
- this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, ir && ir.push(this);
+function Cr(e, t) {
+ this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, ar && ar.push(this);
}
-Sr.prototype.c = function() {
+Cr.prototype.c = function() {
var e = this.S();
try {
if (8 & this.f || this.x === void 0) return;
@@ -3368,20 +3368,20 @@ Sr.prototype.c = function() {
} finally {
e();
}
-}, Sr.prototype.S = function() {
+}, Cr.prototype.S = function() {
if (1 & this.f) throw Error("Cycle detected");
- this.f |= 1, this.f &= -9, yr(this), hr(this), Z++;
+ this.f |= 1, this.f &= -9, br(this), gr(this), Z++;
var e = X;
- return X = this, xr.bind(this, e);
-}, Sr.prototype.N = function() {
- 2 & this.f || (this.f |= 2, this.u = or, or = this);
-}, Sr.prototype.d = function() {
- this.f |= 8, 1 & this.f || br(this);
-}, Sr.prototype.dispose = function() {
+ return X = this, Sr.bind(this, e);
+}, Cr.prototype.N = function() {
+ 2 & this.f || (this.f |= 2, this.u = sr, sr = this);
+}, Cr.prototype.d = function() {
+ this.f |= 8, 1 & this.f || xr(this);
+}, Cr.prototype.dispose = function() {
this.d();
};
-function Cr(e, t) {
- var n = new Sr(e, t);
+function wr(e, t) {
+ var n = new Cr(e, t);
try {
n.c();
} catch (e) {
@@ -3392,35 +3392,35 @@ function Cr(e, t) {
}
//#endregion
//#region node_modules/@preact/signals/dist/signals.module.js
-var wr, Tr, Er = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Dr = [];
-Cr(function() {
- wr = this.N;
+var Tr, Er, Dr = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Or = [];
+wr(function() {
+ Tr = this.N;
})();
-function Or(e, t) {
- S[e] = t.bind(null, S[e] || function() {});
+function kr(e, t) {
+ C[e] = t.bind(null, C[e] || function() {});
}
-function kr(e) {
- if (Tr) {
- var t = Tr;
- Tr = void 0, t();
+function Ar(e) {
+ if (Er) {
+ var t = Er;
+ Er = void 0, t();
}
- Tr = e && e.S();
+ Er = e && e.S();
}
-function Ar(e) {
- var t = this, n = e.data, r = Mr(n);
+function jr(e) {
+ var t = this, n = e.data, r = Nr(n);
r.name = "ReactiveDom", r.value = n;
- var i = Qe(function() {
+ var i = $e(function() {
for (var e = t, n = t.__v; n = n.__;) if (n.__c) {
n.__c.__$f |= 4;
break;
}
- var i = vr(function() {
+ var i = yr(function() {
var e = r.value.value;
return e === 0 ? 0 : !0 === e ? "" : e || "";
- }), a = vr(function() {
- return !Array.isArray(i.value) && !w(i.value);
- }), o = Cr(function() {
- if (this.N = Fr, a.value) {
+ }), a = yr(function() {
+ return !Array.isArray(i.value) && !T(i.value);
+ }), o = wr(function() {
+ if (this.N = Ir, a.value) {
var t = i.value;
e.__v && e.__v.__e && e.__v.__e.nodeType === 3 && (e.__v.__e.data = t);
}
@@ -3431,14 +3431,14 @@ function Ar(e) {
}, []), a = i[0], o = i[1];
return a.value ? o.peek() : o.value;
}
-Ar.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {
+jr.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {
constructor: {
configurable: !0,
value: void 0
},
type: {
configurable: !0,
- value: Ar
+ value: jr
},
props: {
configurable: !0,
@@ -3453,7 +3453,7 @@ Ar.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {
configurable: !0,
value: 1
}
-}), Or("__b", function(e, t) {
+}), kr("__b", function(e, t) {
if (typeof t.type == "string") {
var n, r = t.props;
for (var i in r) if (i !== "children") {
@@ -3462,26 +3462,26 @@ Ar.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {
}
}
e(t);
-}), Or("__r", function(e, t) {
+}), kr("__r", function(e, t) {
if (e(t), t.type !== L) {
- kr();
+ Ar();
var n, r = t.__c;
r && (r.__$f &= -2, (n = r.__$u) === void 0 && (r.__$u = n = function(e, t) {
var n;
- return Cr(function() {
+ return wr(function() {
n = this;
}, { name: t }), n.c = e, n;
}(function(e) {
return function() {
var t;
- Er && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});
+ Dr && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});
};
- }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), kr(n);
+ }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), Ar(n);
}
-}), Or("__e", function(e, t, n, r) {
- kr(), e(t, n, r);
-}), Or("diffed", function(e, t) {
- kr();
+}), kr("__e", function(e, t, n, r) {
+ Ar(), e(t, n, r);
+}), kr("diffed", function(e, t) {
+ Ar();
var n;
if (typeof t.type == "string" && (n = t.__e)) {
var r = t.__np, i = t.props, a = n.U;
@@ -3491,25 +3491,25 @@ Ar.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 = jr(n, c, u, i), a[c] = l) : l.o(u, i);
+ l === void 0 ? (l = Mr(n, c, u, i), a[c] = l) : l.o(u, i);
}
}
e(t);
});
-function jr(e, t, n, r) {
- var i = t in e && e.ownerSVGElement === void 0, a = pr(n);
+function Mr(e, t, n, r) {
+ var i = t in e && e.ownerSVGElement === void 0, a = mr(n);
return {
o: function(e, t) {
a.value = e, r = t;
},
- d: Cr(function() {
- this.N = Fr;
+ d: wr(function() {
+ this.N = Ir;
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));
})
};
}
-Or("unmount", function(e, t) {
+kr("unmount", function(e, t) {
if (typeof t.type == "string") {
var n = t.__e;
if (n) {
@@ -3533,9 +3533,9 @@ Or("unmount", function(e, t) {
}
}
e(t);
-}), Or("__h", function(e, t, n, r) {
+}), kr("__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;
@@ -3547,44 +3547,44 @@ Or("unmount", function(e, t) {
for (var s in this.props) if (!(s in e)) return !0;
return !1;
};
-function Mr(e, t) {
- return Qe(function() {
- return pr(e, t);
+function Nr(e, t) {
+ return $e(function() {
+ return mr(e, t);
}, []);
}
-var Nr = function(e) {
+var Pr = function(e) {
queueMicrotask(function() {
queueMicrotask(e);
});
};
-function Pr() {
- rr(function() {
- for (var e; e = Dr.shift();) wr.call(e);
+function Fr() {
+ ir(function() {
+ for (var e; e = Or.shift();) Tr.call(e);
});
}
-function Fr() {
- Dr.push(this) === 1 && (S.requestAnimationFrame || Nr)(Pr);
+function Ir() {
+ Or.push(this) === 1 && (C.requestAnimationFrame || Pr)(Fr);
}
//#endregion
//#region src/state/quality-goals.ts
-var Ir = "/api/quality-goals?limit=200", Lr = {
+var Lr = "/api/quality-goals?limit=200", Rr = {
data: null,
error: ""
-}, Rr = pr(Lr), zr = 0, Br = vr(() => Rr.value);
-vr(() => Rr.value.data?.total ?? null);
-function Vr() {
- zr += 1, Rr.value = Lr;
+}, zr = mr(Rr), Br = 0, Vr = yr(() => zr.value);
+yr(() => zr.value.data?.total ?? null);
+function Hr() {
+ Br += 1, zr.value = Rr;
}
-async function Hr(e) {
- let t = zr += 1;
+async function Ur(e) {
+ let t = Br += 1;
try {
- let n = await K(Ir, e);
- return t === zr && (Rr.value = {
+ let n = await K(Lr, e);
+ return t === Br && (zr.value = {
data: n,
error: ""
}), n;
} catch (n) {
- throw !e?.aborted && t === zr && (Rr.value = {
+ throw !e?.aborted && t === Br && (zr.value = {
data: null,
error: G(n)
}), n;
@@ -3592,68 +3592,92 @@ async function Hr(e) {
}
//#endregion
//#region src/islands/quality-goals.tsx
-var Ur = (e, t) => Hr(t), Wr = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;
-function Gr({ openItem: t, javTitleHtml: n, javDisplayName: a, srcBadge: o }) {
- let { data: s, error: c } = Br.value;
+var Wr = (e, t) => Ur(t), Gr = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;
+function Kr({ openItem: t, javTitleHtml: n, javDisplayName: a, srcBadge: o }) {
+ let { data: s, error: c } = Vr.value;
if (c) return /* @__PURE__ */ J("div", {
class: "qualitylist",
- dangerouslySetInnerHTML: { __html: p(c, {
+ dangerouslySetInnerHTML: { __html: m(c, {
variant: "error",
label: "读取失败"
}) }
});
- let l = s?.items ?? [];
- return l.length ? /* @__PURE__ */ J("div", {
- class: "qualitylist",
- children: l.map((s) => /* @__PURE__ */ J("article", {
- class: "qualityitem",
- children: [/* @__PURE__ */ J("button", {
- class: "qualitycover",
- type: "button",
- "aria-label": `打开 ${a(s)}`,
- onClick: () => t(s.id),
- children: /* @__PURE__ */ J("img", {
- src: Wr(s),
- alt: "",
- loading: "lazy",
- onError: (e) => e.currentTarget.remove()
- })
- }), /* @__PURE__ */ J("div", { children: [
- /* @__PURE__ */ J("h3", { children: /* @__PURE__ */ J("button", {
- type: "button",
- "data-middle-truncate": !0,
- onClick: () => t(s.id),
- dangerouslySetInnerHTML: { __html: n(s) }
- }) }),
- /* @__PURE__ */ J("p", {
- class: "mono",
- children: [
- /* @__PURE__ */ J("span", {
- style: "display:contents",
- dangerouslySetInnerHTML: { __html: o(s.location, s.cost) }
- }),
- /* @__PURE__ */ J("span", { children: e[s.location] ?? s.location }),
- /* @__PURE__ */ J("span", { children: r(s.duration) }),
- /* @__PURE__ */ J("span", { children: i(s.size ?? 0) })
- ]
- }),
- s.reason ? /* @__PURE__ */ J("p", { children: s.reason }) : null
- ] })]
- }, s.id))
+ let u = s?.items ?? [];
+ return u.length ? /* @__PURE__ */ J("div", {
+ class: "quality-workspace",
+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: l("待升级", `${s?.total ?? u.length} 部作品`) } }), /* @__PURE__ */ J("div", {
+ class: "qualitylist",
+ children: u.map((s) => /* @__PURE__ */ J("article", {
+ class: "qualityitem",
+ children: [
+ /* @__PURE__ */ J("button", {
+ class: "qualitycover",
+ type: "button",
+ "aria-label": `打开 ${a(s)}`,
+ onClick: () => t(s.id),
+ children: [/* @__PURE__ */ J("span", {
+ class: "qualityfallback",
+ children: "暂无预览"
+ }), /* @__PURE__ */ J("img", {
+ src: Gr(s),
+ alt: "",
+ loading: "lazy",
+ onError: (e) => e.currentTarget.remove()
+ })]
+ }),
+ /* @__PURE__ */ J("div", {
+ class: "qualitybody",
+ children: [
+ /* @__PURE__ */ J("h3", { children: /* @__PURE__ */ J("button", {
+ type: "button",
+ "data-middle-truncate": !0,
+ onClick: () => t(s.id),
+ dangerouslySetInnerHTML: { __html: n(s) }
+ }) }),
+ /* @__PURE__ */ J("p", {
+ class: "mono",
+ children: [
+ /* @__PURE__ */ J("span", {
+ style: "display:contents",
+ dangerouslySetInnerHTML: { __html: o(s.location, s.cost) }
+ }),
+ /* @__PURE__ */ J("span", { children: e[s.location] ?? s.location }),
+ /* @__PURE__ */ J("span", { children: r(s.duration) }),
+ /* @__PURE__ */ J("span", { children: i(s.size ?? 0) })
+ ]
+ }),
+ s.reason ? /* @__PURE__ */ J("p", {
+ class: "qualityreason",
+ children: s.reason
+ }) : null
+ ]
+ }),
+ /* @__PURE__ */ J("footer", {
+ class: "qualityactions",
+ children: /* @__PURE__ */ J("button", {
+ type: "button",
+ class: "geist-button",
+ onClick: () => t(s.id),
+ children: "查看版本"
+ })
+ })
+ ]
+ }, s.id))
+ })]
}) : /* @__PURE__ */ J("div", {
class: "qualitylist",
- dangerouslySetInnerHTML: { __html: u("sparkles", "没有标记中的高清版目标", "现有版本都已满足条件,或还没有加入追踪。") }
+ dangerouslySetInnerHTML: { __html: d("sparkles", "没有标记中的高清版目标", "现有版本都已满足条件,或还没有加入追踪。") }
});
}
//#endregion
//#region src/islands/scraping.tsx
-var Kr = (e, t) => K("/api/scraping", t);
-function qr({ value: e, onChange: t }) {
+var qr = (e, t) => K("/api/scraping", t);
+function Jr({ value: e, onChange: t }) {
let n = W(null), r = W(t);
return r.current = t, U(() => {
let t = n.current;
- t.innerHTML = g([["peach", "Peach 代理"], ["direct", "直接连接"]], e, { label: "连接方式" });
- let i = b(t.firstElementChild), a = () => r.current(i.value);
+ t.innerHTML = _([["peach", "Peach 代理"], ["direct", "直接连接"]], e, { label: "连接方式" });
+ let i = x(t.firstElementChild), a = () => r.current(i.value);
return i.addEventListener("change", a), () => {
i.disabled = !0, i.removeEventListener("change", a), t.replaceChildren();
};
@@ -3662,16 +3686,16 @@ function qr({ value: e, onChange: t }) {
class: "scraping-network"
});
}
-function Jr({ source: e, toast: t }) {
- let [r, i] = V(e), [a, o] = V(e.network), [s, c] = V(""), [l, u] = V(""), [f, m] = V("paste"), [h, g] = V(""), [_, y] = V(!1), [b, x] = V(""), [S, C] = V([]), w = W(null), T = W(null);
+function Yr({ source: e, toast: t }) {
+ let [r, i] = V(e), [a, o] = V(e.network), [s, c] = V(""), [l, u] = V(""), [d, p] = V("paste"), [h, g] = V(""), [_, v] = V(!1), [b, x] = V(""), [S, C] = V([]), w = W(null), T = W(null);
U(() => {
- T.current?.querySelectorAll("footer button").forEach((e) => v(e, _));
+ T.current?.querySelectorAll("footer button").forEach((e) => y(e, _));
}, [_]);
let E = W(new AbortController());
H(() => () => E.current.abort(), []);
async function D(n) {
if (!_) {
- y(!0), x(""), C([]);
+ v(!0), x(""), C([]);
try {
if (n === "check") {
let t = await q("/api/scraping/check", { source: e.source }, "POST", E.current.signal);
@@ -3689,7 +3713,7 @@ function Jr({ source: e, toast: t }) {
} catch (e) {
E.current.signal.aborted || x(G(e));
} finally {
- E.current.signal.aborted || y(!1);
+ E.current.signal.aborted || v(!1);
}
}
}
@@ -3707,7 +3731,7 @@ function Jr({ source: e, toast: t }) {
children: [
/* @__PURE__ */ J("div", {
class: "geist-fieldset-heading",
- children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d(`scraping-${e.source}`, e.label) } }), /* @__PURE__ */ J("a", {
+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: f(`scraping-${e.source}`, e.label) } }), /* @__PURE__ */ J("a", {
class: "scraping-url externallink",
href: e.login,
target: "_blank",
@@ -3733,7 +3757,7 @@ function Jr({ source: e, toast: t }) {
}),
/* @__PURE__ */ J("div", {
class: "scraping-label",
- children: ["连接方式", /* @__PURE__ */ J(qr, {
+ children: ["连接方式", /* @__PURE__ */ J(Jr, {
value: a,
onChange: o
})]
@@ -3753,13 +3777,13 @@ function Jr({ source: e, toast: t }) {
type: "radio",
name: `cookie-method-${e.source}`,
value: t,
- checked: f === t,
+ checked: d === t,
onChange: () => {
- m(t), c(""), u(""), g("");
+ p(t), c(""), u(""), g("");
}
}), /* @__PURE__ */ J("span", { children: n })] }, t))
}),
- f === "paste" ? /* @__PURE__ */ J("label", { children: ["Cookie", /* @__PURE__ */ J("input", {
+ d === "paste" ? /* @__PURE__ */ J("label", { children: ["Cookie", /* @__PURE__ */ J("input", {
class: "geist-input",
type: "password",
autoComplete: "off",
@@ -3794,14 +3818,14 @@ function Jr({ source: e, toast: t }) {
x("Cookie 文本超过 256 KiB"), e.currentTarget.value = "";
return;
}
- y(!0);
+ v(!0);
try {
let e = await t.text();
E.current.signal.aborted || (u(e), g(t.name));
} catch {
E.current.signal.aborted || x("Cookie 文件未读取,请重新选择");
} finally {
- E.current.signal.aborted || y(!1);
+ E.current.signal.aborted || v(!1);
}
}
})
@@ -3811,11 +3835,11 @@ function Jr({ source: e, toast: t }) {
] }),
b && /* @__PURE__ */ J("div", {
role: "alert",
- dangerouslySetInnerHTML: { __html: p(b, { variant: "error" }) }
+ dangerouslySetInnerHTML: { __html: m(b, { variant: "error" }) }
}),
S.map((t) => /* @__PURE__ */ J("div", {
role: "status",
- dangerouslySetInnerHTML: { __html: p(`${e.label}${t.label === "来源页面" ? "" : " 高清图片"}:${t.ok ? "可连接" : "不能连接"}` + (t.width ? ` · ${t.width} × ${t.height}` : "") + (t.message ? `。${t.message}` : ""), { variant: t.ok ? "success" : "error" }) }
+ dangerouslySetInnerHTML: { __html: m(`${e.label}${t.label === "来源页面" ? "" : " 高清图片"}:${t.ok ? "可连接" : "不能连接"}` + (t.width ? ` · ${t.width} × ${t.height}` : "") + (t.message ? `。${t.message}` : ""), { variant: t.ok ? "success" : "error" }) }
}, t.label))
]
}), /* @__PURE__ */ J("footer", {
@@ -3844,15 +3868,15 @@ function Jr({ source: e, toast: t }) {
})
});
}
-function Yr({ data: e, error: t, toast: n }) {
+function Xr({ data: e, error: t, toast: n }) {
let [r, i] = V(""), [a, o] = V(!1), [s, c] = V(""), l = W(null);
- U(() => v(l.current, a), [a]);
- let u = W(new AbortController()), m = W(0);
+ U(() => y(l.current, a), [a]);
+ let u = W(new AbortController()), d = W(0);
async function h(e = !1) {
- let t = ++m.current;
- await lt({
+ let t = ++d.current;
+ await ut({
read: (e) => K("/api/scraping/cover", e),
- active: () => !u.current.signal.aborted && t === m.current,
+ active: () => !u.current.signal.aborted && t === d.current,
render: (t) => {
o(t.status === "running"), t.status === "running" && (e = !1), t.status === "failed" && !e && c(t.error || "采集未取得"), t.status === "complete" && !e && n(t.result || "封面采集完成");
},
@@ -3862,7 +3886,7 @@ function Yr({ data: e, error: t, toast: n }) {
H(() => (h(!0), () => u.current.abort()), []);
async function g() {
if (!a) {
- m.current++, o(!0), c("");
+ d.current++, o(!0), c("");
try {
await q("/api/scraping/cover", { code: r }, "POST", u.current.signal), await h();
} catch (e) {
@@ -3872,7 +3896,7 @@ function Yr({ data: e, error: t, toast: n }) {
}
return t ? /* @__PURE__ */ J("div", {
role: "alert",
- dangerouslySetInnerHTML: { __html: p(t, { variant: "error" }) }
+ dangerouslySetInnerHTML: { __html: m(t, { variant: "error" }) }
}) : /* @__PURE__ */ J("div", {
class: "scraping-page",
children: [
@@ -3883,7 +3907,7 @@ function Yr({ data: e, error: t, toast: n }) {
children: /* @__PURE__ */ J("div", {
class: "geist-fieldset-content scraping-fields",
children: [
- /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("scraping-cover", "高清封面") } }),
+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: f("scraping-cover", "高清封面") } }),
/* @__PURE__ */ J("form", {
class: "scraping-cover-form",
onSubmit: (e) => {
@@ -3906,16 +3930,16 @@ function Yr({ data: e, error: t, toast: n }) {
}),
a && /* @__PURE__ */ J("div", {
"aria-live": "polite",
- dangerouslySetInnerHTML: { __html: f("正在抓取封面") }
+ dangerouslySetInnerHTML: { __html: p("正在抓取封面") }
}),
s && /* @__PURE__ */ J("div", {
role: "alert",
- dangerouslySetInnerHTML: { __html: p(s, { variant: "error" }) }
+ dangerouslySetInnerHTML: { __html: m(s, { variant: "error" }) }
})
]
})
}),
- e?.sources.map((e) => /* @__PURE__ */ J(Jr, {
+ e?.sources.map((e) => /* @__PURE__ */ J(Yr, {
source: e,
toast: n
}, e.source))
@@ -3924,12 +3948,12 @@ function Yr({ data: e, error: t, toast: n }) {
}
//#endregion
//#region src/state/index.ts
-var Xr = { "quality-goals": {
- refresh: Hr,
- reset: Vr
-} }, Zr = () => Object.keys(Xr);
-async function Qr(e) {
- let t = Xr[e];
+var Zr = { "quality-goals": {
+ refresh: Ur,
+ reset: Hr
+} }, Qr = () => Object.keys(Zr);
+async function $r(e) {
+ let t = Zr[e];
if (!t) throw Error(`未登记的共享 store:${String(e)}`);
try {
return await t.refresh(), !0;
@@ -3939,24 +3963,24 @@ async function Qr(e) {
}
//#endregion
//#region src/review-evidence.ts
-var $r = (e = "") => /^https?:\/\//i.test(e) ? e : "";
-function ei(e = "") {
- let n = $r(e) || (e.startsWith("/") && !e.startsWith("//") ? e : "");
+var ei = (e = "") => /^https?:\/\//i.test(e) ? e : "";
+function ti(e = "") {
+ let n = ei(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 ti(e) {
- let n = $r(e.profile_url), r = (e.preview_assets || []).slice(0, 6), i = Math.max(0, Number(e.video_count || e.videos || 0));
+function ni(e) {
+ let n = ei(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>
- ${ei(e.preview_url)}
+ ${ti(e.preview_url)}
<p>通过后记录身份判断。</p>
${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 ni(e) {
+function ri(e) {
for (let t of e.querySelectorAll("[data-review-picture] img")) {
let e = () => {
t.hidden = !0;
@@ -3968,11 +3992,11 @@ function ni(e) {
}
//#endregion
//#region src/selection.ts
-function ri(e, t, n, r, i, a = i || !e.has(r)) {
+function ii(e, t, n, r, i, a = i || !e.has(r)) {
let o = n === null ? -1 : t.indexOf(n), s = t.indexOf(r);
return i && o >= 0 && s >= 0 ? t.slice(Math.min(o, s), Math.max(o, s) + 1).forEach((t) => e.add(t)) : a ? e.add(r) : e.delete(r), r;
}
-function ii(e, t) {
+function ai(e, t) {
let n = t.filter((t) => e.has(t)).length;
return {
count: n,
@@ -3980,16 +4004,16 @@ function ii(e, t) {
mixed: n > 0 && n < t.length
};
}
-function ai(e, t, n) {
+function oi(e, t, n) {
t.forEach((t) => n ? e.add(t) : e.delete(t));
}
-function oi({ count: e, label: t, all: n, summary: r, actions: i, locked: a = !1 }) {
+function si({ count: e, label: t, all: n, summary: r, actions: i, locked: a = !1 }) {
e && (e.textContent = t), n && (n.checked = r.all, n.indeterminate = r.mixed);
for (let e of i) e.disabled = !r.count || a;
}
//#endregion
//#region src/review-bulk.ts
-var si = () => ({
+var ci = () => ({
busy: !1,
category: "",
filter: "",
@@ -4000,7 +4024,7 @@ var si = () => ({
assets: /* @__PURE__ */ new Map(),
errors: /* @__PURE__ */ new Map()
});
-function ci(e) {
+function li(e) {
let t = e?.querySelector(".reviewbulktoolbar");
if (!e || !t || t.offsetParent === null) return;
e.style.setProperty("--review-controls-height", `${t.getBoundingClientRect().height}px`);
@@ -4016,7 +4040,7 @@ function ci(e) {
let o = i.getBoundingClientRect(), s = a.getBoundingClientRect();
e.style.setProperty("--review-pane-left", `${o.left}px`), e.style.setProperty("--review-pane-width", `${o.width}px`), e.style.setProperty("--review-pane-height", `${s.bottom - o.top}px`);
}
-function li(e, t) {
+function ui(e, t) {
let n = [[
"candidates",
t ? "按候选数量" : "全部待复核",
@@ -4032,7 +4056,7 @@ function li(e, t) {
"list-filter"
]), n;
}
-function ui(e, t) {
+function di(e, t) {
let n = /* @__PURE__ */ new Map();
for (let r of e) {
let e, i;
@@ -4049,10 +4073,10 @@ function ui(e, t) {
}
return [...n.values()];
}
-function di(e, t, n, r, i) {
- e.anchor = ri(e.selected, t, e.anchor, n, r, i);
+function fi(e, t, n, r, i) {
+ e.anchor = ii(e.selected, t, e.anchor, n, r, i);
}
-async function fi(e, t, n, r) {
+async function pi(e, t, n, r) {
let i = [], a = 0;
for (let o of e) {
if (!r()) break;
@@ -4072,17 +4096,17 @@ async function fi(e, t, n, r) {
failures: i
};
}
-function pi(e) {
+function mi(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 mi(e, t) {
+function hi(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 = t.catalog || t.rows, o = li(a, t.metadata);
+ let a = t.catalog || t.rows, o = ui(a, t.metadata);
o.some((e) => e[0] === r.groupBy) || (r.groupBy = "candidates", r.filter = "");
- let s = ui(a, r.groupBy);
+ let s = di(a, r.groupBy);
s.some((e) => e.key === r.filter) || (r.filter = "");
let l = () => [...n.querySelectorAll("[data-review-key]")].filter((e) => !e.closest("[hidden]")), u = () => l().filter((e) => r.selected.has(e.dataset.reviewKey)), d = () => t.rows.filter((e) => u().some((t) => t.dataset.reviewKey === e.item_key)), f = (e) => !e.querySelector("[data-review-status=\"approved\"]")?.disabled, p = (e, t = "") => {
let n = document.createElement("button");
@@ -4090,16 +4114,16 @@ function mi(e, t) {
}, m = document.createElement("div");
m.className = "reviewbulkbar reviewbulktoolbar", m.setAttribute("role", "group"), m.setAttribute("aria-label", "复核批量操作");
let h = document.createElement("div");
- h.className = "reviewgroupby", h.innerHTML = g(o, r.groupBy, { label: "筛选分组方式" });
- let _ = b(h.firstElementChild);
- h.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), _.addEventListener("change", () => {
- if (r.busy || !o.some((e) => e[0] === _.value)) return;
- r.groupBy = _.value, r.filter = "", r.anchor = null;
+ h.className = "reviewgroupby", h.innerHTML = _(o, r.groupBy, { label: "筛选分组方式" });
+ let g = x(h.firstElementChild);
+ h.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), g.addEventListener("change", () => {
+ if (r.busy || !o.some((e) => e[0] === g.value)) return;
+ r.groupBy = g.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 = g([[
+ let v = document.createElement("div");
+ v.className = "reviewcategoryfilter", v.hidden = s.length < 2, v.innerHTML = _([[
"",
"全部分类",
"list-filter"
@@ -4108,15 +4132,15 @@ function mi(e, t) {
`${e.title} · ${e.rows.length}`,
"list-filter"
])], r.filter, { label: r.groupBy === "field" ? "筛选字段分类" : "筛选当前分类" });
- let x = y.querySelector("[data-select-menu]");
- if (x) {
+ let b = v.querySelector("[data-select-menu]");
+ if (b) {
let e = document.createElement("div");
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(x.children).slice(1)), x.append(e);
+ 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 S = b(y.firstElementChild);
- y.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), S.addEventListener("change", () => {
+ let S = x(v.firstElementChild);
+ v.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), S.addEventListener("change", () => {
if (r.busy || S.value && !s.some((e) => e.key === S.value)) return;
r.filter = S.value, r.anchor = null;
let n = e.parentElement;
@@ -4133,14 +4157,14 @@ function mi(e, t) {
let A = document.createElement("div");
A.className = "selectiondock reviewdock", A.setAttribute("role", "group"), A.setAttribute("aria-label", "复核所选项目");
let j = p("取消选择");
- A.append(E, D, k, j, O), m.append(h, y, C);
- let ee = e.querySelector(".reviewcontrols");
- ee ? ee.after(m) : n.before(m), e.append(A), n.classList.add("reviewgroups");
- let M = () => {
+ A.append(E, D, k, j, O), m.append(h, v, C);
+ let M = e.querySelector(".reviewcontrols");
+ M ? M.after(m) : n.before(m), e.append(A), n.classList.add("reviewgroups");
+ let ee = () => {
r.selected.clear(), r.anchor = null, P();
};
j.onclick = () => {
- r.busy || (M(), C.focus({ preventScroll: !0 }));
+ r.busy || (ee(), C.focus({ preventScroll: !0 }));
}, C.onclick = () => {
if (r.busy) return;
let e = l(), t = u().length === e.length;
@@ -4160,7 +4184,7 @@ function mi(e, t) {
d.className = "reviewlist", o.append(s, u), a.append(o, d), n.append(a), u.onclick = () => {
if (r.busy) return;
let e = t.map((e) => e.dataset.reviewKey);
- ai(r.selected, e, !e.every((e) => r.selected.has(e))), P();
+ oi(r.selected, e, !e.every((e) => r.selected.has(e))), P();
}, N.push(() => {
u.textContent = t.every((e) => r.selected.has(e.dataset.reviewKey)) ? "清空本组" : "全选本组";
});
@@ -4176,7 +4200,7 @@ function mi(e, t) {
e.className = "reviewpickname", e.append(...n.childNodes), n.classList.add("reviewpickheading"), n.append(i, e);
} else e.prepend(i);
let o = (e, n) => {
- di(r, l().map((e) => e.dataset.reviewKey), t, e, n), P();
+ fi(r, l().map((e) => e.dataset.reviewKey), t, e, n), P();
};
if (i.addEventListener("mousedown", (e) => {
e.shiftKey && e.preventDefault();
@@ -4190,7 +4214,7 @@ function mi(e, t) {
else if (n.key === "ArrowDown" || n.key === "ArrowUp") {
n.preventDefault();
let i = l(), a = i[i.indexOf(e) + (n.key === "ArrowDown" ? 1 : -1)];
- a && (r.anchor === null && (r.anchor = t), di(r, i.map((e) => e.dataset.reviewKey), a.dataset.reviewKey, !0, !0), P(), a.querySelector(".reviewpickitem input")?.focus());
+ a && (r.anchor === null && (r.anchor = t), fi(r, i.map((e) => e.dataset.reviewKey), a.dataset.reviewKey, !0, !0), P(), a.querySelector(".reviewpickitem input")?.focus());
}
}
}), N.push(() => {
@@ -4213,25 +4237,25 @@ function mi(e, t) {
}
}
e.addEventListener("keydown", (t) => {
- r.busy || !e.contains(n) || (t.key === "Escape" && r.selected.size && (t.preventDefault(), t.stopPropagation(), M()), (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a" && !t.target.matches("textarea,input:not([type=\"checkbox\"]):not([type=\"radio\"])") && (t.preventDefault(), t.stopPropagation(), l().forEach((e) => r.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(), l().forEach((e) => r.selected.add(e.dataset.reviewKey)), P()));
});
let te = "";
function P() {
let e = u();
- C.textContent = e.length === l().length ? "清空当前选择" : r.filter ? "全选当前分类" : "全选本页", A.hidden = !e.length, oi({
+ C.textContent = e.length === l().length ? "清空当前选择" : r.filter ? "全选当前分类" : "全选本页", A.hidden = !e.length, si({
count: E,
label: `已选 ${e.length} 项`,
- summary: ii(r.selected, l().map((e) => e.dataset.reviewKey)),
+ summary: ai(r.selected, l().map((e) => e.dataset.reviewKey)),
actions: [w, T]
}), w.disabled ||= e.some((e) => !f(e));
- let n = pi(d());
+ let n = mi(d());
D.hidden = !t.metadata || !d().some((e) => (e.candidates?.length || 0) > 1);
let i = e.length && !n.length ? "所选项目无共同来源" : "统一选择来源", a = JSON.stringify([i, n]);
if (a !== te) {
- te = a, D.innerHTML = g([["", i], ...n.map((e) => [e, e])], "", { label: "统一选择来源" });
- let e = b(D.firstElementChild);
+ te = a, D.innerHTML = _([["", i], ...n.map((e) => [e, e])], "", { label: "统一选择来源" });
+ let e = x(D.firstElementChild);
e.disabled = !n.length, e.addEventListener("change", () => {
- if (!(r.busy || !pi(d()).includes(e.value))) {
+ if (!(r.busy || !mi(d()).includes(e.value))) {
for (let n of u()) {
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) => {
@@ -4257,14 +4281,14 @@ function mi(e, t) {
O.textContent = "请先为所选的多来源候选选择来源。", u().find((e) => !e.querySelector("input[type=\"radio\"]:checked"))?.querySelector("input[type=\"radio\"]")?.focus();
return;
}
- r.busy = !0, O.textContent = `正在处理 0 / ${a.length}`, v(i, !0);
+ r.busy = !0, O.textContent = `正在处理 0 / ${a.length}`, y(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, d = await fi(a, async (e) => {
+ let l = 0, d = await pi(a, async (e) => {
try {
return await t.submit(e);
} finally {
@@ -4276,14 +4300,14 @@ function mi(e, t) {
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);
- }), v(i, !1), !t.active()) return;
+ }), y(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(), ci(e);
+ P(), li(e);
}
-function hi(e, t, n = 1) {
+function gi(e, t, n = 1) {
let r = (e, t) => Array.from({ length: t - e + 1 }, (t, n) => e + n);
if (n * 2 + 5 >= t) return r(1, t);
let i = Math.max(e - n, 1), a = Math.min(e + n, t), o = i > 2, s = a < t - 2;
@@ -4303,15 +4327,15 @@ function hi(e, t, n = 1) {
t
];
}
-function gi(e, t) {
+function _i(e, t) {
return Math.max(1, Math.ceil(e / t));
}
-function _i(e, t) {
+function vi(e, t) {
return Math.min(Math.max(1, Math.floor(e) || 1), t);
}
-function vi(e, t, n) {
+function yi(e, t, n) {
if (t <= 1) return "";
- let r = hi(e, t).map((t) => t === "…" ? "<li class=\"board-page-dots\" aria-hidden=\"true\">…</li>" : `<li><button type="button" class="board-page" data-page="${t}" aria-label="第 ${t} 页"${t === e ? " aria-current=\"page\"" : ""}>${t}</button></li>`).join("");
+ let r = gi(e, t).map((t) => t === "…" ? "<li class=\"board-page-dots\" aria-hidden=\"true\">…</li>" : `<li><button type="button" class="board-page" data-page="${t}" aria-label="第 ${t} 页"${t === e ? " aria-current=\"page\"" : ""}>${t}</button></li>`).join("");
return `<nav class="board-pagination" aria-label="${n}">
<button type="button" class="geist-button" data-page="${e - 1}"${e <= 1 ? " disabled" : ""}><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-chevron-left"></use></svg>上一页</button>
<ul>${r}</ul>
@@ -4320,10 +4344,10 @@ function vi(e, t, n) {
}
//#endregion
//#region src/native-image.ts
-function yi(e, t, n, r) {
+function bi(e, t, n, r) {
return e > 0 && t > 0 && e === n && t === r;
}
-function bi(e, t, n, r, i = 1) {
+function xi(e, t, n, r, i = 1) {
let a = Number.isFinite(i) && i > 0 ? i : 1;
e /= a, t /= a;
let o = [
@@ -4340,7 +4364,7 @@ function bi(e, t, n, r, i = 1) {
}
//#endregion
//#region src/entity-skeleton.ts
-function xi(e, t) {
+function Si(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>
@@ -4352,7 +4376,7 @@ function xi(e, t) {
}
//#endregion
//#region src/board-skeleton.ts
-function Si(e) {
+function Ci(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>`;
@@ -4362,7 +4386,7 @@ function Si(e) {
}
//#endregion
//#region src/catalog-onboarding.ts
-var Ci = [
+var wi = [
"loc",
"creator",
"performer",
@@ -4379,16 +4403,16 @@ var Ci = [
"jav",
"thumb"
];
-function wi() {
+function Ti() {
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\">&nbsp;</span></span>") + "</div><div class=\"tier catalog-placeholder\" aria-hidden=\"true\">" + e("<span class=\"brandpill\"><span class=\"mk\"></span><span class=\"placeholder-name\">&nbsp;</span></span>") + "</div>",
tags: "<span class=\"catalog-placeholder placeholder-tags\" aria-hidden=\"true\">" + e("<span class=\"pill\">&nbsp;</span>") + "</span>"
};
}
-async function Ti(e, t) {
+async function Ei(e, t) {
let n = new URLSearchParams();
- for (let t of Ci) e[t] && n.set(t, e[t]);
+ for (let t of wi) 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 || [],
@@ -4399,9 +4423,9 @@ async function Ti(e, t) {
return r.set("q", e), r.set("limit", "1"), (await t("/api/items?" + r)).total > 0 ? e : "";
}))).filter(Boolean);
}
-function Ei({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable: r = !1, online: i = !1 } = {}) {
+function Di({ 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", "还没有" + ({
+ return t || n ? d("search", n ? "还没有符合条件的 JAV 作品" : "没有符合条件的内容", n ? "已扫描但尚未补充发行资料的视频可在全部内容中查看。" : "清除筛选或搜索条件后查看全部内容。", { actions: "<a class=\"geist-button primary\" href=\"/?loc=&thumb=0\">查看全部内容</a>" }) : e === "catalog" ? d("play", "还没有视频", "添加媒体文件夹或关注来源,开始建立你的馆藏。", { actions: a + o }) : d(e === "tags" ? "tags" : "user-round", "还没有" + ({
tags: "标签",
performers: "艺人",
creators: "创作者",
@@ -4412,7 +4436,7 @@ function Ei({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable:
}
//#endregion
//#region src/sidebar.ts
-function Di(e) {
+function Oi(e) {
return [
"/",
"/unseen",
@@ -4422,92 +4446,92 @@ function Di(e) {
"/junk-files"
].includes(e) || /^\/(item|mix|parts|editions)\//.test(e) || /^\/playlists\/\d+\/\d+$/.test(e) || /^\/(performers|studios|creators|series|agencies)\/.+/.test(e);
}
-function Oi(e, t) {
+function ki(e, t) {
return e.dataset.surface === t && e.querySelector(".dnav") ? !1 : (e.dataset.surface = t, e.replaceChildren(), !0);
}
-function ki(e) {
+function Ai(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/resource-sync.ts
-var $ = (e = 0) => Number(e).toLocaleString(), Ai = {
+var $ = (e = 0) => Number(e).toLocaleString(), ji = {
local: "本地磁盘",
115: "115",
pikpak: "PikPak"
};
-function ji(e, t) {
+function Mi(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>${Ai[e.location] || "媒体来源"}</b><span class="${e.online ? "online" : "offline"}">${e.online ? "可访问" : "离线,已跳过"}</span></div>
+ <div class="resourcesourcetitle"><b>${ji[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 ? p(`将把找不到文件的 ${$(e.missing)} 项馆藏记录移入回收站,并清理 ${$(n.files)} 个闲置缓存。`, { label: "清理内容" }) : ""}
+ ${r ? m(`将把找不到文件的 ${$(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 Mi(e) {
+function Ni(e) {
return [
"small",
"sleeve",
"preview"
].includes(String(e)) ? "small" : "big";
}
-function Ni(e) {
+function Pi(e) {
return {
- javLayout: Mi(e.javLayout),
- javImage: Pi(e.javLayout === "preview" ? "thumbnail" : e.javImage)
+ javLayout: Ni(e.javLayout),
+ javImage: Fi(e.javLayout === "preview" ? "thumbnail" : e.javImage)
};
}
-function Pi(e) {
+function Fi(e) {
return e === "thumbnail" ? "thumbnail" : "cover";
}
-function Fi(e, t) {
- return e.is_jav && e.code && e.has_cover && (Pi(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";
-}
function Ii(e, t) {
+ return e.is_jav && e.code && e.has_cover && (Fi(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";
+}
+function Li(e, t) {
e.querySelectorAll("img[data-jav-image]").forEach((e) => {
- let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (Pi(t) === "cover" || !r)), a = i ? n : r;
+ let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (Fi(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 Li = {
+var Ri = {
"library-processing": {
- load: ft,
- component: ht
+ load: pt,
+ component: gt
},
scraping: {
- load: Kr,
- component: Yr
+ load: qr,
+ component: Xr
},
"quality-goals": {
- load: Ur,
- component: Gr
+ load: Wr,
+ component: Kr
},
configuration: {
- load: qn,
- component: er
+ load: Jn,
+ component: tr
}
-}, Ri = () => Object.keys(Li), zi = /* @__PURE__ */ new Map();
-async function Bi(e, t, n, r = {}) {
- let i = Li[e];
+}, zi = () => Object.keys(Ri), Bi = /* @__PURE__ */ new Map();
+async function Vi(e, t, n, r = {}) {
+ let i = Ri[e];
if (!i) throw Error(`未注册的 island:${String(e)}`);
- Hi(t);
+ Ui(t);
let a = {
controller: new AbortController(),
painted: !1
};
- zi.set(t, a);
+ Bi.set(t, a);
let o;
try {
o = {
@@ -4521,9 +4545,9 @@ async function Bi(e, t, n, r = {}) {
error: G(e)
};
}
- if (zi.get(t) !== a) return;
+ if (Bi.get(t) !== a) return;
if (r.isCurrent && !r.isCurrent()) {
- zi.delete(t);
+ Bi.delete(t);
return;
}
t.textContent = "", a.painted = !0;
@@ -4531,12 +4555,12 @@ async function Bi(e, t, n, r = {}) {
...n,
...o
};
- Oe(ae(i.component, s), t);
+ ke(oe(i.component, s), t);
}
-var Vi = (e) => !!e && zi.has(e);
-function Hi(e) {
- let t = zi.get(e);
- t && (t.controller.abort(), zi.delete(e), t.painted && Oe(null, e));
+var Hi = (e) => !!e && Bi.has(e);
+function Ui(e) {
+ let t = Bi.get(e);
+ t && (t.controller.abort(), Bi.delete(e), t.painted && ke(null, e));
}
//#endregion
-export { bt as TASTE_GUIDE_KEY, vn as activityChartsHtml, Si as boardPageSkeleton, je as boundedPreference, Ei as catalogEmptyHtml, Ti as catalogSuggestions, _i as clampPage, vt as cleanupSkeletonHtml, gt as cloudLocations, _t as cloudPreferenceLocations, si as createReviewSelection, fn as creatorSankeyHtml, Ie as distributionChart, wi as emptyCatalogLayout, xi as entitySkeletonHtml, ut as followJobProgress, ui as groupReviewRows, ti as identityEvidenceHtml, Et as initBoardControls, Vi as islandMounted, Ri as islandNames, Fi as javImageKind, ct as jobActivityHtml, Fe as jobProgressHtml, yi as matchesFaceSource, wt as mountBoardStatePreview, Bi as mountIsland, Ne as mountNumberSetting, bi as nativeImageFit, Pi as normalizeJavImage, Mi as normalizeJavLayout, Ni as normalizeJavPreferences, gi as pageCount, vi as paginationHtml, ke as preferredDirection, Re as radarChart, hn as radialCardHtml, Le as rankedChart, Qr as refreshStore, ji as resourceScanHtml, ei as reviewImageHtml, ai as selectGroup, ri as selectRange, ii as selectionSummary, Di as sidebarHasCatalogContent, xn as sidebarSectionHtml, ki as sidebarTagCounts, Pe as statCardBody, Zr as storeNames, Tt as syncBoardRange, Ii as syncJavImages, Me as syncNumberSetting, oi as syncSelectionToolbar, Oi as syncSidebarSurface, yt as tasteHistoryGuideHtml, wn as transitionTheme, Hi as unmountIsland, ci as updateReviewSticky, lt as watchJob, yn as wireActivityCharts, pn as wireCreatorSankey, jt as wireExpandableRanks, At as wireGrowingCharts, gn as wireRadialCards, ni as wireReviewPictures, mi as wireReviewSelection, Sn as wireSidebarGroups, xt as wireTasteHistoryGuide };
+export { xt as TASTE_GUIDE_KEY, yn as activityChartsHtml, Ci as boardPageSkeleton, Me as boundedPreference, Di as catalogEmptyHtml, Ei as catalogSuggestions, vi as clampPage, yt as cleanupSkeletonHtml, _t as cloudLocations, vt as cloudPreferenceLocations, ci as createReviewSelection, pn as creatorSankeyHtml, Le as distributionChart, Ti as emptyCatalogLayout, Si as entitySkeletonHtml, dt as followJobProgress, di as groupReviewRows, ni as identityEvidenceHtml, Dt as initBoardControls, Hi as islandMounted, zi as islandNames, Ii as javImageKind, lt as jobActivityHtml, Ie as jobProgressHtml, bi as matchesFaceSource, Tt as mountBoardStatePreview, Vi as mountIsland, Pe as mountNumberSetting, xi as nativeImageFit, Fi as normalizeJavImage, Ni as normalizeJavLayout, Pi as normalizeJavPreferences, _i as pageCount, yi as paginationHtml, Ae as preferredDirection, ze as radarChart, gn as radialCardHtml, Re as rankedChart, $r as refreshStore, Mi as resourceScanHtml, ti as reviewImageHtml, oi as selectGroup, ii as selectRange, ai as selectionSummary, Oi as sidebarHasCatalogContent, Sn as sidebarSectionHtml, Ai as sidebarTagCounts, Fe as statCardBody, Qr as storeNames, Et as syncBoardRange, Li as syncJavImages, Ne as syncNumberSetting, si as syncSelectionToolbar, ki as syncSidebarSurface, bt as tasteHistoryGuideHtml, Tn as transitionTheme, Ui as unmountIsland, li as updateReviewSticky, ut as watchJob, bn as wireActivityCharts, mn as wireCreatorSankey, Mt as wireExpandableRanks, jt as wireGrowingCharts, _n as wireRadialCards, ri as wireReviewPictures, hi as wireReviewSelection, Cn as wireSidebarGroups, St as wireTasteHistoryGuide };
diff --git a/web/js/ui-components.js b/web/js/ui-components.js
index 3d4ca3a80..cd76bb19c 100644
--- a/web/js/ui-components.js
+++ b/web/js/ui-components.js
@@ -113,6 +113,11 @@ function noteDetailsHtml({label='',items=[],footnote=''}={}){
<ul>${items.map(line).join('')}</ul>${footnote?`<p>${esc(footnote)}</p>`:''}</details>`;
}
+/** 数据管理子页的结果标题,只接收当前查询得到的读数。 */
+export function collectionSummaryHtml(label,value,detail=''){
+ return `<header class="collection-summary"><div><span>${esc(label)}</span><strong>${esc(value)}</strong></div>${detail?`<p>${esc(detail)}</p>`:''}</header>`;
+}
+
/** Inline, persistent context beside the field/card/section it describes. */
export function noteHtml(message,{variant='secondary',label='',className='',size='medium',filled=false,actionLabel='',details=null}={}){
const kind=NOTE_VARIANTS.has(variant)?variant:'secondary';