Skip to content

armgit / peach

Public Imported from GitHub
0

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

Merge branch 'master' into agent/claude/vercel-button-fills

longmeidao13ed2461a73c
diff --cc frontend/src/islands/scraping.tsx
index 7bbf54e57,cf13377e2..d2b4c1d76
--- a/frontend/src/islands/scraping.tsx
+++ b/frontend/src/islands/scraping.tsx
@@@ -76,20 -74,9 +75,18 @@@ function SourceForm({ source, toast }:
<form ref={form} class="cleanupfieldset" data-geist-fieldset onSubmit={event => { event.preventDefault(); void action('save'); }}>
<div class="geist-fieldset-content scraping-fields">
<div dangerouslySetInnerHTML={{ __html: fieldsetTitle(`scraping-${source.source}`, source.label) }} />
- <a class="scraping-url" href={source.login} target="_blank" rel="noopener noreferrer">{source.login}</a>
+ {/* 前面是站点自己的图标(指对象),后面是外链箭头(指形态)——两枚都在
+ `vercel-geist-button-icons.md` 的「加图标」那一侧,中间的地址不重复说这两件事。
+ 图标直接取对方站点的 `/favicon.ico`:这一页配置的就是与这些站的连接,
+ 浏览器本来就要连它们,不必绕服务端。取不到时把 `<img>` 摘掉,不留破图。 */}
+ <a class="scraping-url" href={source.login} target="_blank" rel="noopener noreferrer">
+ <img src={faviconUrl(source.login)} alt="" width="16" height="16" loading="lazy"
+ onError={event => event.currentTarget.remove()} />
+ <span>{source.login}</span>
+ <svg aria-hidden="true"><use href="#i-external-link" /></svg>
+ </a>
<div class="scraping-label">连接方式<NetworkSelect value={network} onChange={setNetwork} /></div>
- {network === 'proxy' && <label>代理地址<input class="geist-input" type="password" autoComplete="off" value={proxy}
- placeholder={saved.proxy_saved ? '已保存,留空保留' : 'http://127.0.0.1:7890'} disabled={busy}
- onInput={event => setProxy(event.currentTarget.value)} /></label>}
+ {network === 'peach' && <a href="/configuration#peachProxy">配置 Peach 代理</a>}
{source.accepts_cookie && <>
<p>{saved.cookie_saved ? 'Cookie 已保存,登录是否有效请在抓取时确认。' : '需要登录时,任选一种方式提供 Cookie。'}</p>
<div class="insightswitch scraping-cookie-method" role="radiogroup" aria-label="提供 Cookie 的方式(二选一)">
diff --cc web/css/04-manage.css
index 60aa82022,639727d37..fee65a417
--- a/web/css/04-manage.css
+++ b/web/css/04-manage.css
@@@ -13,18 -13,15 +13,26 @@@
/* 判定状态用左侧色条表达:整卡描边在一列里扫过去时反而认不出来 */
.reviewitem{position:relative;display:flex;flex-direction:column;box-sizing:border-box;height:var(--review-fieldset-height);margin:0;padding:0;min-width:0;overflow:hidden;background:var(--ground);border:1px solid var(--field-ring);border-radius:var(--floating-radius)}.reviewitem::before{content:'';position:absolute;z-index:3;left:0;top:0;bottom:0;width:3px;background:transparent}.reviewitem[data-decision="approved"]::before{background:var(--keep)}.reviewitem[data-decision="rejected"]::before{background:var(--drop)}.reviewitem[data-decision="skipped"]::before{background:var(--muted)}.reviewitem[data-decision="rejected"],.reviewitem[data-decision="skipped"]{opacity:.6}.reviewitem h4{margin:0 0 6px;font-size:var(--fs-lg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reviewitem p{margin:4px 0;color:var(--muted);font-size:var(--fs-xs);line-height:1.55;overflow-wrap:anywhere}
.reviewitem>.geist-fieldset-content{flex:1;min-height:0;padding:20px}.reviewcontent{height:100%}
- .reviewitem .reviewactions{flex:0 0 auto;box-sizing:border-box;min-height:56px;margin:0;padding:12px 12px 12px 20px;background:var(--overlay-5);border-top:1px solid var(--line-soft);border-radius:0 0 var(--floating-radius) var(--floating-radius);display:flex;gap:8px;justify-content:flex-end}
+ .reviewcontent .geist-scroller-container{padding-right:12px}
+ .reviewlist.reviewgroups{display:block}.reviewgroup{margin-bottom:24px}
+ .reviewbulkbar{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:16px}
+ .reviewbulkbar h3{margin:0 auto 0 0;font-size:var(--fs-lg)}
+ .reviewpickitem{display:flex;align-items:center;gap:8px;margin:16px 20px 0;font-size:var(--fs-md)}
+ .reviewpickitem[hidden],.reviewbulkbar [hidden]{display:none}
+ .reviewgroup>.reviewstate:empty{display:none}
+ .library-processing-result{margin-top:16px}
+ .reviewitem .reviewactions{flex:0 0 auto;box-sizing:border-box;min-height:56px;margin:0;padding:12px 12px 12px 20px;background:var(--overlay-5);border-top:1px solid var(--line-soft);border-radius:0 0 var(--floating-radius) var(--floating-radius);display:flex;gap:8px}
+/* 没抽帧、没取到图的那两种卡,中间用空状态铺满而不是留一行小字:一行字挂在
+ 半屏留白上方,读起来像界面坏了,而这两种情况都是有原因、说得清的。 */
+.reviewcontent .geist-scroller-container:has(>.reviewempty){display:flex;flex-direction:column;min-height:100%}
+/* 两个类一起写:.emptystate 的 320px 下限排在这条之后,单类选择器压不过它,
+ 空状态会撑到 320px 把卡里其余内容顶出可视区。 */
+.emptystate.reviewempty{flex:1 1 auto;min-height:120px;margin:10px 0 0;padding:16px 14px;border:0;
+ border-radius:var(--control-radius);background:var(--inset)}
+.emptystate.reviewempty .es-icon{width:40px;height:40px;margin-bottom:2px}
+.emptystate.reviewempty .es-icon svg{width:22px;height:22px}
+.emptystate.reviewempty h3{font-size:var(--fs-sm)}
+.emptystate.reviewempty p{max-width:30ch;font-size:var(--fs-xs)}
.reviewtags{display:flex;flex-wrap:wrap;gap:5px;margin:9px 0}.reviewtags span{padding:3px 9px;border:1px solid var(--border-15);border-radius:var(--pill-radius);font-size:var(--fs-xs);color:var(--ink-2)}
/* 唯一候选:纯展示,几何对齐 .revieworigin,不画单选圈。radio 仍在 DOM 里,
提交路径读的就是它;只是没什么可选的时候不该让人以为还有别的选项。 */
diff --cc web/dist/peach-ui.js
index 6c11c2fce,b1b3ed6ee..a2594a60e
--- a/web/dist/peach-ui.js
+++ b/web/dist/peach-ui.js
@@@ -1,21 -1,21 +1,21 @@@
- import { MEDIA_SOURCE_ICONS as e, emptyStateHtml as t, fieldsetTitle as n, loadingDotsHtml as r, noteHtml as i, progressHtml as a, selectFieldHtml as o, selectOptionIconHtml as s, setActionBusy as c, wireSelectField as l } from "/js/ui-components.js";
- import { LOC as u, faviconUrl as d, fmtDur as f, fmtSize as p } from "/js/core.js";
+ import { MEDIA_SOURCE_ICONS as e, checkboxHtml as t, confirmModal as n, emptyStateHtml as r, fieldsetTitle as i, loadingDotsHtml as a, noteHtml as o, progressHtml as s, selectFieldHtml as c, selectOptionIconHtml as l, setActionBusy as u, wireCollapse as d, wireSelectField as f } from "/js/ui-components.js";
-import { LOC as p, fmtDur as m, fmtSize as h, icon as g } from "/js/core.js";
++import { LOC as p, faviconUrl as m, fmtDur as h, fmtSize as g, icon as _ } from "/js/core.js";
//#region node_modules/preact/dist/preact.module.js
- var m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k = {}, A = [], ee = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, j = Array.isArray;
-var _, v, y, b, x, S, C, w, T, E, D, ee, O, k, te, A = {}, j = [], ne = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, re = Array.isArray;
++var v, y, b, x, S, C, w, T, E, D, O, k, A, ee, te, j = {}, ne = [], re = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ie = Array.isArray;
function M(e, t) {
for (var n in t) e[n] = t[n];
return e;
}
- function te(e) {
-function ie(e) {
++function ae(e) {
e && e.parentNode && e.parentNode.removeChild(e);
}
- function ne(e, t, n) {
-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 ? m.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 re(e, o, r, i, null);
- if (arguments.length > 2 && (o.children = arguments.length > 3 ? _.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 ? v.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 re(e, t, n, r, i) {
-function oe(e, t, n, r, i) {
++function se(e, t, n, r, i) {
var a = {
type: e,
props: t,
@@@ -27,62 -27,62 +27,62 @@@
__e: null,
__c: null,
constructor: void 0,
- __v: i ?? ++g,
- __v: i ?? ++y,
++ __v: i ?? ++b,
__i: -1,
__u: 0
};
- return i == null && h.vnode != null && h.vnode(a), a;
- return i == null && v.vnode != null && v.vnode(a), a;
++ return i == null && y.vnode != null && y.vnode(a), a;
}
function N(e) {
return e.children;
}
- function ie(e, t) {
-function se(e, t) {
++function P(e, t) {
this.props = e, this.context = t;
}
--function P(e, t) {
-- if (t == null) return e.__ ? P(e.__, e.__i + 1) : null;
++function F(e, t) {
++ if (t == null) return e.__ ? F(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" ? P(e) : null;
++ return typeof e.type == "function" ? F(e) : null;
}
- function ae(e) {
+ function ce(e) {
if (e.__P && e.__d) {
var t = e.__v, n = t.__e, r = [], i = [], a = M({}, t);
- a.__v = t.__v + 1, h.vnode && h.vnode(a), ge(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? P(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, ve(r, a, i), t.__e = t.__ = null, a.__e != n && oe(a);
- a.__v = t.__v + 1, v.vnode && v.vnode(a), ye(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? P(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, xe(r, a, i), t.__e = t.__ = null, a.__e != n && le(a);
++ a.__v = t.__v + 1, y.vnode && y.vnode(a), ye(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? F(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, xe(r, a, i), t.__e = t.__ = null, a.__e != n && le(a);
}
}
- function oe(e) {
+ function le(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;
- }), oe(e);
+ }), le(e);
}
- function se(e) {
- (!e.__d && (e.__d = !0) && v.push(e) && !ce.__r++ || y != h.debounceRendering) && ((y = h.debounceRendering) || b)(ce);
+ function ue(e) {
- (!e.__d && (e.__d = !0) && x.push(e) && !de.__r++ || S != v.debounceRendering) && ((S = v.debounceRendering) || C)(de);
++ (!e.__d && (e.__d = !0) && S.push(e) && !de.__r++ || C != y.debounceRendering) && ((C = y.debounceRendering) || w)(de);
}
- function ce() {
+ function de() {
try {
- for (var e, t = 1; v.length;) v.length > t && v.sort(x), e = v.shift(), t = v.length, ae(e);
- for (var e, t = 1; x.length;) x.length > t && x.sort(w), e = x.shift(), t = x.length, ce(e);
++ for (var e, t = 1; S.length;) S.length > t && S.sort(T), e = S.shift(), t = S.length, ce(e);
} finally {
- v.length = ce.__r = 0;
- x.length = de.__r = 0;
++ S.length = de.__r = 0;
}
}
- function le(e, t, n, r, i, a, o, s, c, l, u) {
- var d, f, p, m, h, g, _ = r && r.__k || A, v = t.length;
- for (c = ue(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || k, p.__i = d, g = ge(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && xe(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = de(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 fe(e, t, n, r, i, a, o, s, c, l, u) {
- var d, f, p, m, h, g, _ = r && r.__k || j, v = t.length;
- for (c = pe(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || A, p.__i = d, g = ye(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && we(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = me(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);
++ var d, f, p, m, h, g, _ = r && r.__k || ne, v = t.length;
++ for (c = pe(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || j, p.__i = d, g = ye(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && we(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = me(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);
return n.__e = h, c;
}
- function ue(e, t, n, r, i) {
+ function pe(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] = re(null, o, null, null, null) : j(o) ? o = e.__k[a] = re(N, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = re(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 = fe(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 = P(s)), Se(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] = oe(null, o, null, null, null) : re(o) ? o = e.__k[a] = oe(N, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = oe(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = he(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
- if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = P(s)), Te(s, s));
++ for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = se(null, o, null, null, null) : ie(o) ? o = e.__k[a] = se(N, { 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 = he(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
++ if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = F(s)), Te(s, s));
return r;
}
- function de(e, t, n) {
+ function me(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 = de(r[i], t, n));
+ for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = me(r[i], t, n));
return t;
}
-- e.__e != t && (t && e.type && !t.parentNode && (t = P(e)), t = n.insertBefore(e.__e, t || null));
++ e.__e != t && (t && e.type && !t.parentNode && (t = F(e)), t = n.insertBefore(e.__e, t || null));
do
t &&= t.nextSibling;
while (t != null && t.nodeType == 8);
@@@ -96,18 -96,18 +96,18 @@@ function he(e, t, n, r)
}
return -1;
}
- function pe(e, t, n) {
- t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || ee.test(t) ? n : n + "px";
+ function ge(e, t, n) {
- t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || ne.test(t) ? n : n + "px";
++ t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || re.test(t) ? n : n + "px";
}
- function me(e, t, n, r, i) {
+ function _e(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 || pe(e.style, t, "");
- if (n) for (t in n) r && n[t] == r[t] || pe(e.style, t, n[t]);
+ if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || ge(e.style, t, "");
+ if (n) for (t in n) r && n[t] == r[t] || ge(e.style, t, n[t]);
}
- } else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(T, "$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[w] = r[w] : (n[w] = E, e.addEventListener(t, a ? O : D, a)) : e.removeEventListener(t, a ? O : D, 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[D] = r[D] : (n[D] = O, e.addEventListener(t, a ? te : k, a)) : e.removeEventListener(t, a ? te : k, a);
++ } else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(k, "$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[O] = r[O] : (n[O] = A, e.addEventListener(t, a ? te : ee, a)) : e.removeEventListener(t, a ? te : ee, 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 {
@@@ -121,68 -121,68 +121,68 @@@ function ve(e)
return function(t) {
if (this.l) {
var n = this.l[t.type + e];
- if (t[C] == null) t[C] = E++;
- else if (t[C] < n[w]) return;
- return n(h.event ? h.event(t) : t);
- if (t[E] == null) t[E] = O++;
- else if (t[E] < n[D]) return;
- return n(v.event ? v.event(t) : t);
++ if (t[D] == null) t[D] = A++;
++ else if (t[D] < n[O]) return;
++ return n(y.event ? y.event(t) : t);
}
};
}
- function ge(e, t, n, r, i, a, o, s, c, l) {
- var u, d, f, p, m, g, _, v, y, b, x, S, C, w, T, E, D = t.type;
+ function ye(e, t, n, r, i, a, o, s, c, l) {
- var u, d, f, p, m, h, g, _, y, b, x, S, C, w, T, E, D = t.type;
++ var u, d, f, p, m, h, g, _, v, b, x, S, C, w, T, E, D = t.type;
if (t.constructor !== void 0) return null;
- 128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = h.__b) && u(t);
- 128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = v.__b) && u(t);
++ 128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = y.__b) && u(t);
n: if (typeof D == "function") {
d = o.length;
try {
- if (y = t.props, b = D.prototype && D.prototype.render, x = (u = D.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? v = (f = t.__c = n.__c).__ = f.__E : (b ? t.__c = f = new D(y, S) : (t.__c = f = new ie(y, S), f.constructor = D, f.render = Ce), x && x.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), b && f.__s == null && (f.__s = f.state), b && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = M({}, f.__s)), M(f.__s, D.getDerivedStateFromProps(y, f.__s))), m = f.props, g = f.state, f.__v = t, p) b && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), b && f.componentDidMount != null && f.__h.push(f.componentDidMount);
- if (y = t.props, b = D.prototype && D.prototype.render, x = (u = D.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? _ = (f = t.__c = n.__c).__ = f.__E : (b ? t.__c = f = new D(y, S) : (t.__c = f = new se(y, S), f.constructor = D, f.render = Ee), x && x.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), b && f.__s == null && (f.__s = f.state), b && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = M({}, f.__s)), M(f.__s, D.getDerivedStateFromProps(y, f.__s))), m = f.props, h = f.state, f.__v = t, p) b && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), b && f.componentDidMount != null && f.__h.push(f.componentDidMount);
++ if (v = t.props, b = D.prototype && D.prototype.render, x = (u = D.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? _ = (f = t.__c = n.__c).__ = f.__E : (b ? t.__c = f = new D(v, S) : (t.__c = f = new P(v, S), f.constructor = D, f.render = Ee), x && x.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), b && f.__s == null && (f.__s = f.state), b && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = M({}, f.__s)), M(f.__s, D.getDerivedStateFromProps(v, f.__s))), m = f.props, h = f.state, f.__v = t, p) b && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), b && f.componentDidMount != null && f.__h.push(f.componentDidMount);
else {
-- if (b && D.getDerivedStateFromProps == null && y !== m && f.componentWillReceiveProps != null && f.componentWillReceiveProps(y, S), t.__v == n.__v || !f.__e && f.shouldComponentUpdate != null && !1 === f.shouldComponentUpdate(y, f.__s, S)) {
-- t.__v != n.__v && (f.props = y, f.state = f.__s, f.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {
++ if (b && D.getDerivedStateFromProps == null && v !== m && f.componentWillReceiveProps != null && f.componentWillReceiveProps(v, S), t.__v == n.__v || !f.__e && f.shouldComponentUpdate != null && !1 === f.shouldComponentUpdate(v, f.__s, S)) {
++ 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);
- }), A.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = P(n);
- }), j.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = P(n);
++ }), ne.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = F(n);
break n;
}
-- f.componentWillUpdate != null && f.componentWillUpdate(y, f.__s, S), b && f.componentDidUpdate != null && f.__h.push(function() {
- f.componentDidUpdate(m, g, _);
++ f.componentWillUpdate != null && f.componentWillUpdate(v, f.__s, S), b && f.componentDidUpdate != null && f.__h.push(function() {
+ f.componentDidUpdate(m, h, g);
});
}
- if (f.context = S, f.props = y, f.__P = e, f.__e = !1, C = h.__r, w = 0, b) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), A.push.apply(f.__h, f._sb), f._sb = [];
- if (f.context = S, f.props = y, f.__P = e, f.__e = !1, C = v.__r, w = 0, b) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), j.push.apply(f.__h, f._sb), f._sb = [];
++ if (f.context = S, f.props = v, f.__P = e, f.__e = !1, C = y.__r, w = 0, b) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), ne.push.apply(f.__h, f._sb), f._sb = [];
else do
f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), f.state = f.__s;
while (f.__d && ++w < 25);
- f.state = f.__s, f.getChildContext != null && (r = M(M({}, r), f.getChildContext())), b && !p && f.getSnapshotBeforeUpdate != null && (_ = f.getSnapshotBeforeUpdate(m, g)), T = u != null && u.type === N && u.key == null ? ye(u.props.children) : u, s = le(e, j(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), v && (f.__E = f.__ = null);
- f.state = f.__s, f.getChildContext != null && (r = M(M({}, r), f.getChildContext())), b && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === N && u.key == null ? Se(u.props.children) : u, s = fe(e, re(T) ? T : [T], t, n, r, i, a, o, s, c, l), f.base = t.__e, t.__u &= -161, f.__h.length && o.push(f), _ && (f.__E = f.__ = null);
++ f.state = f.__s, f.getChildContext != null && (r = M(M({}, r), f.getChildContext())), b && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === N && u.key == null ? Se(u.props.children) : u, s = fe(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--;) te(a[E]);
- } 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 || _e(t), h.__e(e, t, n);
- t.__k ??= n.__k || [], e.then || be(t), v.__e(e, t, n);
++ t.__k ??= n.__k || [], e.then || be(t), y.__e(e, t, n);
}
- } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = be(n.__e, t, n, r, i, a, o, c, l);
- return (u = h.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 = Ce(n.__e, t, n, r, i, a, o, c, l);
- return (u = v.diffed) && u(t), 128 & t.__u ? void 0 : s;
++ return (u = y.diffed) && u(t), 128 & t.__u ? void 0 : s;
}
- function _e(e) {
- e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(_e));
+ function be(e) {
+ e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(be));
}
- function ve(e, t, n) {
- for (var r = 0; r < n.length; r++) xe(n[r], n[++r], n[++r]);
- h.__c && h.__c(t, e), e.some(function(t) {
+ function xe(e, t, n) {
+ for (var r = 0; r < n.length; r++) we(n[r], n[++r], n[++r]);
- v.__c && v.__c(t, e), e.some(function(t) {
++ y.__c && y.__c(t, e), e.some(function(t) {
try {
e = t.__h, t.__h = [], e.some(function(e) {
e.call(t);
});
} catch (e) {
- h.__e(e, t.__v);
- v.__e(e, t.__v);
++ y.__e(e, t.__v);
}
});
}
- function ye(e) {
- return typeof e != "object" || !e || e.__b > 0 ? e : j(e) ? e.map(ye) : e.constructor === void 0 ? M({}, e) : null;
+ function Se(e) {
- return typeof e != "object" || !e || e.__b > 0 ? e : re(e) ? e.map(Se) : e.constructor === void 0 ? M({}, e) : null;
++ return typeof e != "object" || !e || e.__b > 0 ? e : ie(e) ? e.map(Se) : e.constructor === void 0 ? M({}, e) : null;
}
- function be(e, t, n, r, i, a, o, s, c) {
- var l, u, d, f, p, g, _, v = n.props || k, y = t.props, b = t.type;
+ function Ce(e, t, n, r, i, a, o, s, c) {
- var l, u, d, f, p, m, h, g = n.props || A, y = t.props, b = t.type;
++ var l, u, d, f, p, m, h, g = n.props || j, _ = t.props, b = t.type;
if (b == "svg" ? i = "http://www.w3.org/2000/svg" : b == "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 == !!b && (b ? p.localName == b : p.nodeType == 3)) {
e = p, a[l] = null;
@@@ -190,17 -190,17 +190,17 @@@
}
}
if (e == null) {
-- if (b == null) return document.createTextNode(y);
- e = document.createElementNS(i, b, y.is && y), s &&= (h.__m && h.__m(t, a), !1), a = null;
- e = document.createElementNS(i, b, y.is && y), s &&= (v.__m && v.__m(t, a), !1), a = null;
++ if (b == null) return document.createTextNode(_);
++ e = document.createElementNS(i, b, _.is && _), s &&= (y.__m && y.__m(t, a), !1), a = null;
}
- if (b == null) v === y || s && e.data == y || (e.data = y);
- if (b == null) g === y || s && e.data == y || (e.data = y);
++ if (b == null) g === _ || s && e.data == _ || (e.data = _);
else {
- if (a = b == "textarea" && y.defaultValue != null ? null : a && m.call(e.childNodes), !s && a != null) for (v = {}, l = 0; l < e.attributes.length; l++) v[(p = e.attributes[l]).name] = p.value;
- for (l in v) p = v[l], l == "dangerouslySetInnerHTML" ? d = p : l == "children" || l in y || l == "value" && "defaultValue" in y || l == "checked" && "defaultChecked" in y || me(e, l, null, p, i);
- for (l in y) p = y[l], l == "children" ? f = p : l == "dangerouslySetInnerHTML" ? u = p : l == "value" ? g = p : l == "checked" ? _ = p : s && typeof p != "function" || v[l] === p || me(e, l, p, v[l], i);
- if (a = b == "textarea" && y.defaultValue != null ? null : a && _.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 y || l == "value" && "defaultValue" in y || l == "checked" && "defaultChecked" in y || _e(e, l, null, p, i);
- for (l in y) p = y[l], l == "children" ? f = p : l == "dangerouslySetInnerHTML" ? u = p : l == "value" ? m = p : l == "checked" ? h = p : s && typeof p != "function" || g[l] === p || _e(e, l, p, g[l], i);
++ if (a = b == "textarea" && _.defaultValue != null ? null : a && v.call(e.childNodes), !s && a != null) for (g = {}, l = 0; l < e.attributes.length; l++) g[(p = e.attributes[l]).name] = p.value;
++ for (l in g) p = g[l], l == "dangerouslySetInnerHTML" ? d = p : l == "children" || l in _ || l == "value" && "defaultValue" in _ || l == "checked" && "defaultChecked" in _ || _e(e, l, null, p, i);
++ for (l in _) p = _[l], l == "children" ? f = p : l == "dangerouslySetInnerHTML" ? u = p : l == "value" ? m = p : l == "checked" ? h = p : s && typeof p != "function" || g[l] === p || _e(e, l, p, g[l], i);
if (u) s || d && (u.__html == d.__html || u.__html == e.innerHTML) || (e.innerHTML = u.__html), t.__k = [];
- else if (d && (e.innerHTML = ""), le(t.type == "template" ? e.content : e, j(f) ? f : [f], t, n, r, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && P(n, 0), s, c), a != null) for (l = a.length; l--;) te(a[l]);
- s && b != "textarea" || (l = "value", b == "progress" && g == null ? e.removeAttribute("value") : g != null && (g !== e[l] || b == "progress" && !g || b == "option" && g != v[l]) && me(e, l, g, v[l], i), l = "checked", _ != null && _ != e[l] && me(e, l, _, v[l], i));
- else if (d && (e.innerHTML = ""), fe(t.type == "template" ? e.content : e, re(f) ? f : [f], t, n, r, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && P(n, 0), s, c), a != null) for (l = a.length; l--;) ie(a[l]);
++ else if (d && (e.innerHTML = ""), fe(t.type == "template" ? e.content : e, ie(f) ? f : [f], t, n, r, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && F(n, 0), s, c), a != null) for (l = a.length; l--;) ae(a[l]);
+ s && b != "textarea" || (l = "value", b == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[l] || b == "progress" && !m || b == "option" && m != g[l]) && _e(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && _e(e, l, h, g[l], i));
}
return e;
}
@@@ -211,49 -211,54 +211,54 @@@ function we(e, t, n)
r && e.__u(), r && t == null || (e.__u = e(t));
} else e.current = t;
} catch (e) {
- h.__e(e, n);
- v.__e(e, n);
++ y.__e(e, n);
}
}
- function Se(e, t, n) {
+ function Te(e, t, n) {
var r, i;
- if (h.unmount && h.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || xe(r, null, t)), (r = e.__c) != null) {
- if (v.unmount && v.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || we(r, null, t)), (r = e.__c) != null) {
++ if (y.unmount && y.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || we(r, null, t)), (r = e.__c) != null) {
if (r.componentWillUnmount) try {
r.componentWillUnmount();
} catch (e) {
- h.__e(e, t);
- v.__e(e, t);
++ y.__e(e, t);
}
r.base = r.__P = r.__n = null;
}
- if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Se(r[i], t, n || typeof e.type != "function");
- n || te(e.__e), e.__c = e.__ = e.__e = void 0;
+ if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Te(r[i], t, n || typeof e.type != "function");
- n || ie(e.__e), e.__c = e.__ = e.__e = void 0;
++ n || ae(e.__e), e.__c = e.__ = e.__e = void 0;
}
- function Ce(e, t, n) {
+ function Ee(e, t, n) {
return this.constructor(e, n);
}
- function we(e, t, n) {
+ function De(e, t, n) {
var r, i, a, o;
- t == document && (t = document.documentElement), h.__ && h.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], ge(t, e = (!r && n || t).__k = ne(N, null, [e]), i || k, k, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? m.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), ve(a, e, o), e.props.children = null;
- t == document && (t = document.documentElement), v.__ && v.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], ye(t, e = (!r && n || t).__k = ae(N, null, [e]), i || A, A, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? _.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), xe(a, e, o), e.props.children = null;
++ t == document && (t = document.documentElement), y.__ && y.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], ye(t, e = (!r && n || t).__k = oe(N, null, [e]), i || j, j, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? v.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), xe(a, e, o), e.props.children = null;
}
- m = A.slice, h = { __e: function(e, t, n, r) {
-_ = j.slice, v = { __e: function(e, t, n, r) {
++v = ne.slice, y = { __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;
- } }, g = 0, _ = function(e) {
-} }, y = 0, b = function(e) {
++} }, b = 0, x = function(e) {
return e != null && e.constructor === void 0;
- }, ie.prototype.setState = function(e, t) {
-}, se.prototype.setState = function(e, t) {
++}, P.prototype.setState = function(e, t) {
var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = M({}, this.state);
- typeof e == "function" && (e = e(M({}, n), this.props)), e && M(n, e), e != null && this.__v && (t && this._sb.push(t), se(this));
- }, ie.prototype.forceUpdate = function(e) {
- this.__v && (this.__e = !0, e && this.__h.push(e), se(this));
- }, ie.prototype.render = N, v = [], b = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, x = function(e, t) {
+ typeof e == "function" && (e = e(M({}, n), this.props)), e && M(n, e), e != null && this.__v && (t && this._sb.push(t), ue(this));
-}, se.prototype.forceUpdate = function(e) {
++}, P.prototype.forceUpdate = function(e) {
+ this.__v && (this.__e = !0, e && this.__h.push(e), ue(this));
-}, se.prototype.render = N, x = [], C = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, w = function(e, t) {
++}, P.prototype.render = N, S = [], w = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, T = function(e, t) {
return e.__v.__b - t.__v.__b;
- }, ce.__r = 0, S = Math.random().toString(8), C = "__d" + S, w = "__a" + S, T = /(PointerCapture)$|Capture$/i, E = 0, D = he(!1), O = he(!0);
-}, de.__r = 0, T = Math.random().toString(8), E = "__d" + T, D = "__a" + T, ee = /(PointerCapture)$|Capture$/i, O = 0, k = ve(!1), te = ve(!0);
++}, de.__r = 0, E = Math.random().toString(8), D = "__d" + E, O = "__a" + E, k = /(PointerCapture)$|Capture$/i, A = 0, ee = ve(!1), te = ve(!0);
+ //#endregion
+ //#region src/sort-preferences.ts
+ function Oe(e, t, n) {
+ return e === "seed" ? "" : e === t && n === "asc" ? "asc" : "desc";
+ }
//#endregion
//#region src/api.ts
- var Te = class extends Error {
+ var ke = class extends Error {
status;
body;
constructor(e, t, n = null) {
@@@ -271,8 -276,8 +276,8 @@@
if (typeof n == "string" && n) return n;
}
return "";
--}, F = (e) => e instanceof Error ? e.message : String(e);
--async function I(e, t) {
++}, I = (e) => e instanceof Error ? e.message : String(e);
++async function L(e, t) {
let n = await fetch(e, {
headers: { Accept: "application/json" },
credentials: "same-origin",
@@@ -281,10 -286,10 +286,10 @@@
try {
r = await n.json();
} catch {}
- if (!n.ok) throw new Te(Ee(r) || `请求失败(${n.status})`, n.status);
+ if (!n.ok) throw new ke(Ae(r) || `请求失败(${n.status})`, n.status);
return r;
}
--async function L(e, t, n = "POST", r) {
++async function R(e, t, n = "POST", r) {
let i = await fetch(e, {
method: n,
...r ? { signal: r } : {},
@@@ -303,24 -308,24 +308,24 @@@
}
//#endregion
//#region node_modules/preact/hooks/dist/hooks.module.js
- var R, z, De, Oe, ke = 0, Ae = [], B = h, je = B.__b, Me = B.__r, Ne = B.diffed, Pe = B.__c, Fe = B.unmount, Ie = B.__;
- function Le(e, t) {
- B.__h && B.__h(z, e, ke || t), ke = 0;
- var n = z.__H || (z.__H = {
-var R, z, je, Me, Ne = 0, Pe = [], B = v, Fe = B.__b, Ie = B.__r, Le = B.diffed, Re = B.__c, ze = B.unmount, Be = B.__;
++var z, B, je, Me, Ne = 0, Pe = [], V = y, Fe = V.__b, Ie = V.__r, Le = V.diffed, Re = V.__c, ze = V.unmount, Be = V.__;
+ function Ve(e, t) {
- B.__h && B.__h(z, e, Ne || t), Ne = 0;
- var n = z.__H || (z.__H = {
++ V.__h && V.__h(B, e, Ne || t), Ne = 0;
++ var n = B.__H || (B.__H = {
__: [],
__h: []
});
return e >= n.__.length && n.__.push({}), n.__[e];
}
--function V(e) {
- return ke = 1, Re(Ke, e);
++function H(e) {
+ return Ne = 1, He(Xe, e);
}
- function Re(e, t, n) {
- var r = Le(R++, 2);
- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Ke(void 0, t), function(e) {
+ function He(e, t, n) {
- var r = Ve(R++, 2);
++ var r = Ve(z++, 2);
+ if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Xe(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)) {
++ }], r.__c = B, !B.__f)) {
var i = function(e, t, n) {
if (!r.__c.__H) return !0;
var i = !1, o = r.__c.props !== e;
@@@ -336,75 -341,75 +341,75 @@@
}
return !i || o;
};
-- z.__f = !0;
-- var a = z.shouldComponentUpdate, o = z.componentWillUpdate;
-- z.componentWillUpdate = function(e, t, n) {
++ B.__f = !0;
++ var a = B.shouldComponentUpdate, o = B.componentWillUpdate;
++ B.componentWillUpdate = function(e, t, n) {
if (this.__e) {
var r = a;
a = void 0, i(e, t, n), a = r;
}
o && o.call(this, e, t, n);
-- }, z.shouldComponentUpdate = i;
++ }, B.shouldComponentUpdate = i;
}
return r.__N || r.__;
}
--function H(e, t) {
- var n = Le(R++, 3);
- !B.__s && Ge(n.__H, t) && (n.__ = e, n.u = t, z.__H.__h.push(n));
- var n = Ve(R++, 3);
- !B.__s && Ye(n.__H, t) && (n.__ = e, n.u = t, z.__H.__h.push(n));
--}
function U(e, t) {
- var n = Le(R++, 4);
- !B.__s && Ge(n.__H, t) && (n.__ = e, n.u = t, z.__h.push(n));
- var n = Ve(R++, 4);
- !B.__s && Ye(n.__H, t) && (n.__ = e, n.u = t, z.__h.push(n));
++ var n = Ve(z++, 3);
++ !V.__s && Ye(n.__H, t) && (n.__ = e, n.u = t, B.__H.__h.push(n));
+ }
-function W(e) {
++function W(e, t) {
++ var n = Ve(z++, 4);
++ !V.__s && Ye(n.__H, t) && (n.__ = e, n.u = t, B.__h.push(n));
+}
- function W(e) {
- return ke = 5, ze(function() {
++function G(e) {
+ return Ne = 5, Ue(function() {
return { current: e };
}, []);
}
- function ze(e, t) {
- var n = Le(R++, 7);
- return Ge(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
+ function Ue(e, t) {
- var n = Ve(R++, 7);
++ var n = Ve(z++, 7);
+ return Ye(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
}
- function Be() {
- for (var e; e = Ae.shift();) {
+ function We() {
+ for (var e; e = Pe.shift();) {
var t = e.__H;
if (e.__P && t) try {
- t.__h.some(Ue), t.__h.some(We), t.__h = [];
+ t.__h.some(qe), t.__h.some(Je), t.__h = [];
} catch (n) {
-- t.__h = [], B.__e(n, e.__v);
++ t.__h = [], V.__e(n, e.__v);
}
}
}
--B.__b = function(e) {
- z = null, je && je(e);
- z = null, Fe && Fe(e);
--}, B.__ = function(e, t) {
- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Ie && Ie(e, t);
- }, B.__r = function(e) {
- Me && Me(e), R = 0;
- var t = (z = e.__c).__H;
- t && (De === z ? (t.__h = [], z.__h = [], t.__.some(function(e) {
++V.__b = function(e) {
++ B = null, Fe && Fe(e);
++}, V.__ = function(e, t) {
+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Be && Be(e, t);
-}, B.__r = function(e) {
- Ie && Ie(e), R = 0;
- var t = (z = e.__c).__H;
- t && (je === z ? (t.__h = [], z.__h = [], t.__.some(function(e) {
++}, V.__r = function(e) {
++ Ie && Ie(e), z = 0;
++ var t = (B = e.__c).__H;
++ t && (je === B ? (t.__h = [], B.__h = [], t.__.some(function(e) {
e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
- })) : (t.__h.some(Ue), t.__h.some(We), t.__h = [], R = 0)), De = z;
- })) : (t.__h.some(qe), t.__h.some(Je), t.__h = [], R = 0)), je = z;
--}, B.diffed = function(e) {
- Ne && Ne(e);
++ })) : (t.__h.some(qe), t.__h.some(Je), t.__h = [], z = 0)), je = B;
++}, V.diffed = function(e) {
+ Le && Le(e);
var t = e.__c;
- t && t.__H && (t.__H.__h.length && (Ae.push(t) !== 1 && Oe === B.requestAnimationFrame || ((Oe = B.requestAnimationFrame) || He)(Be)), t.__H.__.some(function(e) {
- t && t.__H && (t.__H.__h.length && (Pe.push(t) !== 1 && Me === B.requestAnimationFrame || ((Me = B.requestAnimationFrame) || Ke)(We)), t.__H.__.some(function(e) {
++ t && t.__H && (t.__H.__h.length && (Pe.push(t) !== 1 && Me === V.requestAnimationFrame || ((Me = V.requestAnimationFrame) || Ke)(We)), t.__H.__.some(function(e) {
e.u &&= (e.__H = e.u, void 0);
- })), De = z = null;
- })), je = z = null;
--}, B.__c = function(e, t) {
++ })), je = B = null;
++}, V.__c = function(e, t) {
t.some(function(e) {
try {
- e.__h.some(Ue), e.__h = e.__h.filter(function(e) {
- return !e.__ || We(e);
+ e.__h.some(qe), e.__h = e.__h.filter(function(e) {
+ return !e.__ || Je(e);
});
} catch (n) {
t.some(function(e) {
e.__h &&= [];
-- }), t = [], B.__e(n, e.__v);
++ }), t = [], V.__e(n, e.__v);
}
- }), Pe && Pe(e, t);
- }, B.unmount = function(e) {
- Fe && Fe(e);
+ }), Re && Re(e, t);
-}, B.unmount = function(e) {
++}, V.unmount = function(e) {
+ ze && ze(e);
var t, n = e.__c;
n && n.__H && (n.__H.__.some(function(e) {
try {
@@@ -412,24 -417,24 +417,24 @@@
} catch (e) {
t = e;
}
-- }), n.__H = void 0, t && B.__e(t, n.__v));
++ }), n.__H = void 0, t && V.__e(t, n.__v));
};
- var Ve = typeof requestAnimationFrame == "function";
- function He(e) {
+ var Ge = typeof requestAnimationFrame == "function";
+ function Ke(e) {
var t, n = function() {
- clearTimeout(r), Ve && cancelAnimationFrame(t), setTimeout(e);
+ clearTimeout(r), Ge && cancelAnimationFrame(t), setTimeout(e);
}, r = setTimeout(n, 35);
- Ve && (t = requestAnimationFrame(n));
+ Ge && (t = requestAnimationFrame(n));
}
- function Ue(e) {
- var t = z, n = e.__c;
- typeof n == "function" && (e.__c = void 0, n()), z = t;
+ function qe(e) {
- var t = z, n = e.__c;
- typeof n == "function" && (e.__c = void 0, n()), z = t;
++ var t = B, n = e.__c;
++ typeof n == "function" && (e.__c = void 0, n()), B = t;
}
- function We(e) {
- var t = z;
- e.__c = e.__(), z = t;
+ function Je(e) {
- var t = z;
- e.__c = e.__(), z = t;
++ var t = B;
++ e.__c = e.__(), B = t;
}
- function Ge(e, t) {
+ function Ye(e, t) {
return !e || e.length !== t.length || t.some(function(t, n) {
return t !== e[n];
});
@@@ -439,9 -444,9 +444,9 @@@ function Xe(e, t)
}
//#endregion
//#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
- var qe = 0;
+ var Ze = 0;
Array.isArray;
--function G(e, t, n, r, i, a) {
++function K(e, t, n, r, i, a) {
t ||= {};
var o, s, c = t;
if ("ref" in c) for (s in c = {}, t) s == "ref" ? o = t[s] : c[s] = t[s];
@@@ -463,19 -468,19 +468,19 @@@
__self: a
};
if (typeof e == "function" && (o = e.defaultProps)) for (s in o) c[s] === void 0 && (c[s] = o[s]);
- return h.vnode && h.vnode(l), l;
- return v.vnode && v.vnode(l), l;
++ return y.vnode && y.vnode(l), l;
}
//#endregion
//#region src/islands/access-settings.tsx
- function Je({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1 }) {
- return /* @__PURE__ */ G("div", {
+ function Qe({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1 }) {
- return /* @__PURE__ */ G("div", {
++ return /* @__PURE__ */ K("div", {
class: "configfield",
children: [
-- /* @__PURE__ */ G("label", {
++ /* @__PURE__ */ K("label", {
for: e,
children: t
}),
-- /* @__PURE__ */ G("input", {
++ /* @__PURE__ */ K("input", {
id: e,
class: "geist-input",
type: "password",
@@@ -487,7 -492,7 +492,7 @@@
"aria-invalid": !!i,
"aria-describedby": i || a ? `${e}-hint` : void 0
}),
-- i || a ? /* @__PURE__ */ G("p", {
++ i || a ? /* @__PURE__ */ K("p", {
id: `${e}-hint`,
class: i ? "configbad" : "confighelp",
role: i ? "alert" : void 0,
@@@ -496,9 -501,9 +501,9 @@@
]
});
}
- function Ye({ initial: e, receipt: t }) {
- let [r, i] = V(e), [a, o] = V(""), [s, l] = V(""), [u, d] = V(""), [f, p] = V(!1), [m, h] = V(""), [g, _] = V({}), v = W(null), y = W(!1), b = W(null);
- return /* @__PURE__ */ G("form", {
+ function $e({ initial: e, receipt: t }) {
- let [n, r] = V(e), [a, o] = V(""), [s, c] = V(""), [l, d] = V(""), [f, p] = V(!1), [m, h] = V(""), [g, _] = V({}), v = W(null), y = W(!1), b = W(null);
- return /* @__PURE__ */ G("form", {
++ let [n, r] = H(e), [a, o] = H(""), [s, c] = H(""), [l, d] = H(""), [f, p] = H(!1), [m, h] = H(""), [g, _] = H({}), v = G(null), y = G(!1), b = G(null);
++ return /* @__PURE__ */ K("form", {
class: "configfieldset",
onSubmit: async (e) => {
if (e.preventDefault(), y.current) return;
@@@ -508,38 -513,38 +513,38 @@@
requestAnimationFrame(() => v.current?.querySelector("[aria-invalid=\"true\"]")?.focus());
return;
}
- y.current = !0, c(b.current, !0);
+ y.current = !0, u(b.current, !0);
try {
-- let e = await L("/api/configuration/access", {
- revision: r.revision,
++ let e = await R("/api/configuration/access", {
+ revision: n.revision,
action: f ? "disable" : "set",
confirm_disable: f,
current_password: a,
password: f ? "" : s,
- confirmation: f ? "" : u
+ confirmation: f ? "" : l
});
- i(e), o(""), l(""), d(""), p(!1), _({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存访问密码");
+ r(e), o(""), c(""), d(""), p(!1), _({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存访问密码");
} catch (e) {
- let t = e instanceof Te ? e.body : null, n = t?.errors || t?.detail?.errors;
- n ? _(n) : h(F(e));
+ let t = e instanceof ke ? e.body : null, n = t?.errors || t?.detail?.errors;
- n ? _(n) : h(F(e));
++ n ? _(n) : h(I(e));
} finally {
- y.current = !1, c(b.current, !1);
+ y.current = !1, u(b.current, !1);
}
},
"aria-labelledby": "accessTitle",
noValidate: !0,
ref: v,
-- children: [/* @__PURE__ */ G("div", {
++ children: [/* @__PURE__ */ K("div", {
class: "geist-fieldset-content",
children: [
-- /* @__PURE__ */ G("div", {
++ /* @__PURE__ */ K("div", {
class: "configfieldset-heading",
- children: [/* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: n("accessTitle", "访问密码") } }), /* @__PURE__ */ G("p", {
- children: [/* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: i("accessTitle", "访问密码") } }), /* @__PURE__ */ G("p", {
++ children: [/* @__PURE__ */ K("div", { dangerouslySetInnerHTML: { __html: i("accessTitle", "访问密码") } }), /* @__PURE__ */ K("p", {
class: "confighelp",
- children: r.mode === "open" ? "未设置密码,能连接到 Peach 的设备可直接访问。" : r.mode === "legacy" ? "当前使用系统生成的访问口令。你可以设置自己的密码,或关闭登录要求。" : r.mode === "locked" ? "访问设置无法读取,请在本机检查配置文件。" : "已设置密码。新设备需要登录,保持登录时间在登录页选择。"
+ children: n.mode === "open" ? "未设置密码,能连接到 Peach 的设备可直接访问。" : n.mode === "legacy" ? "当前使用系统生成的访问口令。你可以设置自己的密码,或关闭登录要求。" : n.mode === "locked" ? "访问设置无法读取,请在本机检查配置文件。" : "已设置密码。新设备需要登录,保持登录时间在登录页选择。"
})]
}),
- r.mode === "password" ? /* @__PURE__ */ G(Je, {
- n.mode === "password" ? /* @__PURE__ */ G(Qe, {
++ n.mode === "password" ? /* @__PURE__ */ K(Qe, {
id: "access-current",
label: "当前访问密码",
value: a,
@@@ -547,46 -552,46 +552,46 @@@
error: g.current_password,
current: !0
}) : null,
- !f && r.mode !== "locked" ? /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G(Je, {
- !f && n.mode !== "locked" ? /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G(Qe, {
++ !f && n.mode !== "locked" ? /* @__PURE__ */ K(N, { children: [/* @__PURE__ */ K(Qe, {
id: "access-password",
- label: r.mode === "password" ? "新访问密码" : "设置访问密码",
+ label: n.mode === "password" ? "新访问密码" : "设置访问密码",
value: s,
- onInput: l,
+ onInput: c,
error: g.password,
help: "至少 8 个字符。保存后其他设备需要重新登录。"
- }), /* @__PURE__ */ G(Je, {
- }), /* @__PURE__ */ G(Qe, {
++ }), /* @__PURE__ */ K(Qe, {
id: "access-confirm",
label: "确认访问密码",
- value: u,
+ value: l,
onInput: d,
error: g.confirmation
})] }) : null,
- r.mode === "password" || r.mode === "legacy" ? /* @__PURE__ */ G("label", {
- n.mode === "password" || n.mode === "legacy" ? /* @__PURE__ */ G("label", {
++ n.mode === "password" || n.mode === "legacy" ? /* @__PURE__ */ K("label", {
class: "configcheck",
-- children: [/* @__PURE__ */ G("span", {
++ children: [/* @__PURE__ */ K("span", {
class: "pcheck",
-- children: [/* @__PURE__ */ G("input", {
++ children: [/* @__PURE__ */ K("input", {
type: "checkbox",
checked: f,
onChange: (e) => p(e.currentTarget.checked)
-- }), /* @__PURE__ */ G("span", {
++ }), /* @__PURE__ */ K("span", {
"aria-hidden": "true",
-- children: /* @__PURE__ */ G("svg", {
++ children: /* @__PURE__ */ K("svg", {
viewBox: "0 0 24 24",
-- children: /* @__PURE__ */ G("use", { href: "#i-check" })
++ children: /* @__PURE__ */ K("use", { href: "#i-check" })
})
})]
-- }), /* @__PURE__ */ G("span", { children: "关闭访问密码,允许能连接到 Peach 的设备直接访问" })]
++ }), /* @__PURE__ */ K("span", { children: "关闭访问密码,允许能连接到 Peach 的设备直接访问" })]
}) : null,
-- m ? /* @__PURE__ */ G("p", {
++ m ? /* @__PURE__ */ K("p", {
class: "configbad",
role: "alert",
children: m
}) : null
]
- }), r.mode === "locked" ? null : /* @__PURE__ */ G("div", {
- }), n.mode === "locked" ? null : /* @__PURE__ */ G("div", {
++ }), n.mode === "locked" ? null : /* @__PURE__ */ K("div", {
class: "geist-fieldset-footer",
-- children: [/* @__PURE__ */ G("p", { children: "保存后立即生效。" }), /* @__PURE__ */ G("button", {
++ children: [/* @__PURE__ */ K("p", { children: "保存后立即生效。" }), /* @__PURE__ */ K("button", {
class: "geist-button primary",
type: "submit",
ref: b,
@@@ -596,177 -601,441 +601,441 @@@
});
}
//#endregion
- //#region src/jobs.ts
- async function Xe(e) {
- let t = e.pause || ((e) => new Promise((t) => setTimeout(t, e))), n = 0;
- for (; e.active();) {
- let r;
+ //#region src/islands/release-updates.tsx
+ var et = /* @__PURE__ */ new Set([
+ "downloading",
+ "verifying",
+ "extracting",
+ "preparing",
+ "restarting",
+ "installing"
+ ]);
+ function tt({ initial: e, initialJob: t }) {
- let [r, a] = V(e), [o, c] = V(t || {
++ let [r, a] = H(e), [o, c] = H(t || {
+ state: "idle",
+ progress: 0
- }), [l, d] = V(""), f = W(null), p = W(!0), m = W(!1), h = W(null);
- H(() => {
++ }), [l, d] = H(""), f = G(null), p = G(!0), m = G(!1), h = G(null);
++ U(() => {
+ u(h.current, et.has(o.state));
- }, [o.state]), H(() => () => {
++ }, [o.state]), U(() => () => {
+ p.current = !1, f.current?.abort();
+ }, []);
+ let g = async () => {
- let e = await L("/api/configuration/update-restart", {});
++ let e = await R("/api/configuration/update-restart", {});
+ p.current && c(e);
+ };
- H(() => {
++ U(() => {
+ o.state !== "ready" || m.current || (m.current = !0, n({
+ title: "更新已准备好",
+ body: `Peach ${o.version || ""} 将在重启后安装。`,
+ confirmLabel: "立即重启",
+ cancelLabel: "稍后",
+ onConfirm: g
+ }));
- }, [o.state]), H(() => {
++ }, [o.state]), U(() => {
+ if (!et.has(o.state)) return;
+ let e = new AbortController(), t, n = 0, r = async () => {
+ try {
- let t = await I("/api/configuration/update-status", e.signal);
++ let t = await L("/api/configuration/update-status", e.signal);
+ e.signal.aborted || (c(t), n = 0, t.state === "complete" && a((e) => ({
+ ...e,
+ current_version: t.version || e.current_version,
+ state: "current",
+ message: "已是最新测试版。"
+ })));
+ } catch {
+ ++n >= 120 && !e.signal.aborted && d("尚未连接到 Peach,请检查托盘后刷新页面。");
+ }
+ !e.signal.aborted && n < 120 && (t = setTimeout(r, 1e3));
+ };
+ return t = setTimeout(r, 1e3), () => {
+ e.abort(), clearTimeout(t);
+ };
+ }, [o.state]);
+ let _ = async (e) => {
+ if (f.current || et.has(o.state)) return;
+ let t = new AbortController();
+ f.current = t, m.current = !1, d(""), u(e, !0);
try {
- r = await e.read(AbortSignal.timeout(15e3));
- } catch (r) {
- if (!e.active()) return;
- n++, e.disconnected(r), await t(Math.min(2e3 * 2 ** Math.min(n, 4), 3e4));
- continue;
- let e = await L("/api/configuration/update", {}, "POST", t.signal);
++ let e = await R("/api/configuration/update", {}, "POST", t.signal);
+ t.signal.aborted || c(e);
+ } catch (e) {
- t.signal.aborted || d(F(e));
++ t.signal.aborted || d(I(e));
+ } finally {
+ f.current = null, u(e, !1);
}
- if (!e.active() || (n = 0, e.render(r), e.once) || !e.keepWatching && r.status !== "running") return;
- await t(2e3);
- }
- }
- function Ze(e) {
- let t = document.createElement("div");
- e.host.hidden = !0, t.dataset.followJob = "", t.setAttribute("aria-live", "polite"), e.host.prepend(t);
- let n = e.storageKey || "peach-follow-job", r = sessionStorage.getItem(n) || void 0, i = !1;
- Xe({
- read: e.read,
- active: () => !i && e.active() && t.isConnected,
- keepWatching: e.watchIdle !== !1,
- render: (a) => {
- let o = a.status === "running";
- if (e.host.hidden = !o, e.busy(o), o) {
- r = a.job_id, r && sessionStorage.setItem(n, r);
- let i = a.current, o = (i?.attempt || 1) > 1 ? ` · 第 ${i?.attempt}/${i?.max_attempts} 次尝试${i?.retry_in ? `,${i.retry_in} 秒后重试` : ""}` : "", s = (e.title || (a.total ? `${a.older ? "抓取历史" : "检查更新"}:已完成 ${a.checked || 0}/${a.total} 个来源` : "正在准备检查任务…")) + (i ? ` · ${i.label || i.provider || ""}${o}` : ""), c = e.loading(s) + ((a.total || 0) > 0 ? e.progress(a.checked || 0, a.total) : "");
- t.innerHTML = e.container ? e.container(c) : c;
- } else if (r && r === a.job_id) r = void 0, i = !0, e.host.hidden = a.status !== "failed", sessionStorage.removeItem(n), t.innerHTML = a.status === "failed" ? e.note(a.error || "检查失败") : "", e.complete(a);
- else {
- if (r && a.status === "idle") {
- e.host.hidden = !1, t.innerHTML = e.note("任务状态已失效,请重新发起任务"), sessionStorage.removeItem(n), i = !0;
- return;
- }
- t.innerHTML = "";
- }
- },
- disconnected: () => {
- e.host.hidden = !1, t.innerHTML = e.note("暂时无法读取进度,正在重新连接…");
+ }, v = async (t) => {
+ if (f.current) return;
+ let n = new AbortController();
+ f.current = n, u(t, !0), d("");
+ try {
- let e = await I("/api/configuration/updates", n.signal);
++ let e = await L("/api/configuration/updates", n.signal);
+ n.signal.aborted || a(e);
+ } catch (t) {
+ n.signal.aborted || (a({
+ ...e,
+ state: "error"
- }), d(F(t)));
++ }), d(I(t)));
+ } finally {
+ f.current = null, u(t, !1);
}
+ };
- return /* @__PURE__ */ G("section", {
++ return /* @__PURE__ */ K("section", {
+ class: "configfieldset",
+ "data-geist-fieldset": !0,
+ "aria-labelledby": "configUpdatesTitle",
- children: [/* @__PURE__ */ G("div", {
++ children: [/* @__PURE__ */ K("div", {
+ class: "geist-fieldset-content",
+ children: [
- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: i("configUpdatesTitle", "检查更新") } }),
- /* @__PURE__ */ G("dl", {
++ /* @__PURE__ */ K("div", { dangerouslySetInnerHTML: { __html: i("configUpdatesTitle", "检查更新") } }),
++ /* @__PURE__ */ K("dl", {
+ class: "configfacts",
+ children: [
- /* @__PURE__ */ G("dt", { children: "当前版本" }),
- /* @__PURE__ */ G("dd", { children: r.current_version }),
- /* @__PURE__ */ G("dt", { children: "安装方式" }),
- /* @__PURE__ */ G("dd", { children: r.installation }),
- /* @__PURE__ */ G("dt", { children: "更新通道" }),
- /* @__PURE__ */ G("dd", { children: r.channel }),
- /* @__PURE__ */ G("dt", { children: "最新版本" }),
- /* @__PURE__ */ G("dd", { children: r.latest_version || (r.state === "unchecked" ? "尚未检查" : "未取得") })
++ /* @__PURE__ */ K("dt", { children: "当前版本" }),
++ /* @__PURE__ */ K("dd", { children: r.current_version }),
++ /* @__PURE__ */ K("dt", { children: "安装方式" }),
++ /* @__PURE__ */ K("dd", { children: r.installation }),
++ /* @__PURE__ */ K("dt", { children: "更新通道" }),
++ /* @__PURE__ */ K("dd", { children: r.channel }),
++ /* @__PURE__ */ K("dt", { children: "最新版本" }),
++ /* @__PURE__ */ K("dd", { children: r.latest_version || (r.state === "unchecked" ? "尚未检查" : "未取得") })
+ ]
+ }),
- /* @__PURE__ */ G("p", {
++ /* @__PURE__ */ K("p", {
+ class: l || r.state === "error" ? "configbad" : "confighelp",
+ role: l || r.state === "error" ? "alert" : "status",
+ children: l || r.message
+ }),
- o.state === "idle" ? null : /* @__PURE__ */ G("div", {
++ o.state === "idle" ? null : /* @__PURE__ */ K("div", {
+ "aria-live": "polite",
- children: [/* @__PURE__ */ G("p", {
++ children: [/* @__PURE__ */ K("p", {
+ class: o.state === "error" ? "configbad" : "confighelp",
+ children: o.message
- }), o.state === "error" ? null : /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: s(o.state === "downloading" ? "下载进度" : "安装进度", o.state === "downloading" ? o.downloaded || 0 : o.progress, o.state === "downloading" ? o.total || 1 : 100) } }), /* @__PURE__ */ G("p", {
++ }), o.state === "error" ? null : /* @__PURE__ */ K(N, { children: [/* @__PURE__ */ K("div", { dangerouslySetInnerHTML: { __html: s(o.state === "downloading" ? "下载进度" : "安装进度", o.state === "downloading" ? o.downloaded || 0 : o.progress, o.state === "downloading" ? o.total || 1 : 100) } }), /* @__PURE__ */ K("p", {
+ class: "confighelp",
+ children: o.state === "downloading" && o.total ? `${((o.downloaded || 0) / 1048576).toFixed(1)} / ${(o.total / 1048576).toFixed(1)} MB` : `${o.progress}%`
+ })] })]
+ })
+ ]
- }), /* @__PURE__ */ G("div", {
++ }), /* @__PURE__ */ K("div", {
+ class: "geist-fieldset-footer",
+ "data-geist-fieldset-footer": !0,
+ children: [
- /* @__PURE__ */ G("a", {
++ /* @__PURE__ */ K("a", {
+ class: "geist-button",
+ href: r.release_url,
+ target: "_blank",
+ rel: "noreferrer",
+ children: "查看发布页"
+ }),
- o.state === "ready" ? /* @__PURE__ */ G("button", {
++ o.state === "ready" ? /* @__PURE__ */ K("button", {
+ type: "button",
+ class: "geist-button primary",
+ onClick: () => {
+ n({
+ title: "更新已准备好",
+ body: `Peach ${o.version || ""} 将在重启后安装。`,
+ confirmLabel: "立即重启",
+ cancelLabel: "稍后",
+ onConfirm: g
+ });
+ },
+ children: "重启安装"
+ }) : null,
- r.state === "available" && r.installation === "独立测试包" && o.state !== "ready" ? /* @__PURE__ */ G("button", {
++ r.state === "available" && r.installation === "独立测试包" && o.state !== "ready" ? /* @__PURE__ */ K("button", {
+ ref: h,
+ type: "button",
+ class: "geist-button primary",
+ onClick: (e) => _(e.currentTarget),
+ children: "下载并安装"
+ }) : null,
- /* @__PURE__ */ G("button", {
++ /* @__PURE__ */ K("button", {
+ type: "button",
+ class: "geist-button",
+ disabled: et.has(o.state),
+ onClick: (e) => v(e.currentTarget),
+ children: "检查更新"
+ })
+ ]
+ })]
});
}
//#endregion
- //#region src/islands/library-processing.tsx
- var Qe = (e, t) => I("/api/library-processing", t);
- function $e({ data: e, error: t, toast: o, onComplete: s, mode: l, monitor: u }) {
- let [d, f] = V(e || { status: "idle" }), [p, m] = V(t), [h, g] = V(!1), [_, v] = V(!1), y = W(new AbortController()), b = W(0), x = W(d.status), S = W(null), C = h || d.status === "running";
- U(() => c(S.current, C), [C]);
- async function w() {
- let e = ++b.current;
- await Xe({
- read: (e) => I("/api/library-processing", e),
- active: () => !y.current.signal.aborted && b.current === e,
- keepWatching: l === "notice" || !!u,
- render: (e) => {
- f(e), m(""), e.status === "complete" && x.current === "running" && l !== "notice" && (v(!0), o("已完成扫描与资料采集")), x.current === "running" && (e.status === "complete" || e.status === "failed") && s?.(), x.current = e.status;
- },
- disconnected: () => m("连接中断,正在重新读取处理进度")
+ //#region src/islands/peach-proxy.tsx
+ function nt({ initial: e, receipt: t }) {
- let [n, r] = V(e), [a, o] = V(e.mode), [s, l] = V(""), [d, p] = V(""), m = W(!1), h = W(null), g = W(null), _ = W(new AbortController());
- H(() => () => _.current.abort(), []), U(() => {
++ let [n, r] = H(e), [a, o] = H(e.mode), [s, l] = H(""), [d, p] = H(""), m = G(!1), h = G(null), g = G(null), _ = G(new AbortController());
++ U(() => () => _.current.abort(), []), W(() => {
+ let t = h.current;
+ t.innerHTML = c([
+ ["environment", "系统代理"],
+ ["direct", "直连"],
+ ["proxy", "自定义"]
+ ], e.mode, {
+ label: "Peach 代理",
+ className: "configselect",
+ attr: "data-fixed-width"
});
- }
- H(() => ((d.status === "running" || l === "notice" || u) && w(), () => y.current.abort()), []);
- async function T() {
- if (!C) {
- g(!0), m(""), v(!1);
+ let n = f(t.firstElementChild), r = () => o(n.value);
+ return n.addEventListener("change", r), () => {
+ n.removeEventListener("change", r), t.replaceChildren();
+ };
+ }, []);
+ async function v() {
+ if (!m.current) {
+ m.current = !0, u(g.current, !0), p("");
try {
- let e = await L("/api/library-processing", {}, "POST", y.current.signal);
- if (y.current.signal.aborted) return;
- x.current = e.status, f(e), g(!1), await w();
- let e = await L("/api/configuration/peach-proxy", {
++ let e = await R("/api/configuration/peach-proxy", {
+ mode: a,
+ proxy: s
+ }, "POST", _.current.signal);
+ _.current.signal.aborted || (r(e), l(""), t("已保存 Peach 代理"));
} catch (e) {
- y.current.signal.aborted || (m(F(e)), g(!1));
- _.current.signal.aborted || p(F(e));
++ _.current.signal.aborted || p(I(e));
+ } finally {
+ m.current = !1, u(g.current, !1);
}
}
}
- return l === "notice" ? !p && d.status !== "running" && d.status !== "failed" ? null : /* @__PURE__ */ G("div", {
- class: "library-processing-banner",
- role: "status",
- children: [/* @__PURE__ */ G("span", { children: p || (d.status === "failed" ? "扫描与资料采集未完成" : `${d.stage || "正在整理馆藏"}${d.total ? ` · ${d.checked || 0} / ${d.total}` : ""}`) }), /* @__PURE__ */ G("a", {
- class: "geist-button",
- href: "/configuration#libraryProcessing",
- children: p || d.status === "failed" ? "查看并处理" : "查看进度"
- return /* @__PURE__ */ G("form", {
++ return /* @__PURE__ */ K("form", {
+ id: "peachProxy",
+ class: "configfieldset",
+ "data-geist-fieldset": !0,
+ onSubmit: (e) => {
+ e.preventDefault(), v();
+ },
- children: [/* @__PURE__ */ G("div", {
++ children: [/* @__PURE__ */ K("div", {
+ class: "geist-fieldset-content",
+ children: [
- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: i("peachProxyTitle", "Peach 代理") } }),
- /* @__PURE__ */ G("p", {
++ /* @__PURE__ */ K("div", { dangerouslySetInnerHTML: { __html: i("peachProxyTitle", "Peach 代理") } }),
++ /* @__PURE__ */ K("p", {
+ class: "confighelp",
+ children: "采集来源选择“Peach 代理”时共用此设置。"
+ }),
- /* @__PURE__ */ G("div", { ref: h }),
- a === "proxy" && /* @__PURE__ */ G("div", {
++ /* @__PURE__ */ K("div", { ref: h }),
++ a === "proxy" && /* @__PURE__ */ K("div", {
+ class: "configfield",
- children: [/* @__PURE__ */ G("label", {
++ children: [/* @__PURE__ */ K("label", {
+ htmlFor: "peachProxyAddress",
+ children: "代理地址"
- }), /* @__PURE__ */ G("input", {
++ }), /* @__PURE__ */ K("input", {
+ id: "peachProxyAddress",
+ class: "geist-input",
+ type: "password",
+ autoComplete: "off",
+ value: s,
+ placeholder: n.proxy_saved ? "已保存,留空保留" : "http://127.0.0.1:7890",
+ onInput: (e) => l(e.currentTarget.value)
+ })]
+ }),
- n.needs_selection && /* @__PURE__ */ G("p", {
++ n.needs_selection && /* @__PURE__ */ K("p", {
+ class: "configbad",
+ children: "已有来源的代理地址不同,请选择公共连接方式。"
+ }),
- d && /* @__PURE__ */ G("p", {
++ d && /* @__PURE__ */ K("p", {
+ class: "configbad",
+ role: "alert",
+ children: d
+ })
+ ]
- }), /* @__PURE__ */ G("footer", {
++ }), /* @__PURE__ */ K("footer", {
+ class: "geist-fieldset-footer",
+ "data-geist-fieldset-footer": !0,
- children: /* @__PURE__ */ G("button", {
++ children: /* @__PURE__ */ K("button", {
+ ref: g,
+ class: "geist-button primary",
+ type: "submit",
+ children: "保存代理"
+ })
})]
- }) : /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("div", {
- class: "geist-fieldset-content library-processing",
- children: [
- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: n("cleanupScrapingTitle", "扫描与采集") } }),
- /* @__PURE__ */ G("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),
- /* @__PURE__ */ G("div", {
- "aria-live": "polite",
- children: [
- d.status === "running" && /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: r(`${d.stage || "正在处理"}${d.total ? ` · ${d.checked || 0} / ${d.total}` : ""}`) } }), !!d.total && /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: a(`已处理 ${d.checked || 0} / ${d.total} 个视频`, d.checked || 0, d.total) } })] }),
- (p || d.status === "failed") && /* @__PURE__ */ G("div", {
- role: "alert",
- dangerouslySetInnerHTML: { __html: i(p || d.error || "处理未完成,请重试", { variant: "error" }) }
- }),
- d.status === "failed" && !!d.issues?.length && /* @__PURE__ */ G("ul", { children: d.issues.slice(0, 20).map((e) => /* @__PURE__ */ G("li", { children: [
- e.asset_id ? /* @__PURE__ */ G("a", {
- href: `/item/${e.asset_id}`,
- children: "查看视频"
- }) : null,
- e.asset_id ? ":" : "",
- e.message
- ] })) }),
- _ && /* @__PURE__ */ G("p", { children: [
- "已扫描 ",
- d.scanned || 0,
- " 个文件,识别 ",
- d.identified || 0,
- " 个番号,整理 ",
- d.candidates || 0,
- " 组资料候选。"
- ] })
- ]
+ });
+ }
+ //#endregion
+ //#region src/islands/desktop-settings.tsx
+ function rt({ label: e, checked: t, disabled: n, change: r }) {
- return /* @__PURE__ */ G("label", {
++ return /* @__PURE__ */ K("label", {
+ class: "configcheck",
- children: [/* @__PURE__ */ G("span", {
++ children: [/* @__PURE__ */ K("span", {
+ class: "pcheck",
- children: [/* @__PURE__ */ G("input", {
++ children: [/* @__PURE__ */ K("input", {
+ type: "checkbox",
+ checked: t,
+ disabled: n,
+ onChange: (e) => r(e.currentTarget.checked)
- }), /* @__PURE__ */ G("span", {
++ }), /* @__PURE__ */ K("span", {
+ "aria-hidden": "true",
- children: /* @__PURE__ */ G("svg", {
++ children: /* @__PURE__ */ K("svg", {
+ viewBox: "0 0 24 24",
- children: /* @__PURE__ */ G("use", { href: "#i-check" })
++ children: /* @__PURE__ */ K("use", { href: "#i-check" })
+ })
+ })]
- }), /* @__PURE__ */ G("span", { children: e })]
++ }), /* @__PURE__ */ K("span", { children: e })]
+ });
+ }
+ function it({ startup: e, receipt: t }) {
- let [n, r] = V(e.enabled), [a, o] = V(e.silent), [s, c] = V(""), l = W(!1), d = W(null);
++ let [n, r] = H(e.enabled), [a, o] = H(e.silent), [s, c] = H(""), l = G(!1), d = G(null);
+ async function f() {
+ if (!l.current) {
+ l.current = !0, u(d.current, !0), c("");
+ try {
- await L("/api/configuration/startup", {
++ await R("/api/configuration/startup", {
+ enabled: n,
+ silent: a
+ }), t("已保存开机自启");
+ } catch (e) {
- c(F(e));
++ c(I(e));
+ } finally {
+ l.current = !1, u(d.current, !1);
+ }
+ }
+ }
- return /* @__PURE__ */ G("form", {
++ return /* @__PURE__ */ K("form", {
+ class: "configfieldset",
+ "data-geist-fieldset": !0,
+ onSubmit: (e) => {
+ e.preventDefault(), f();
+ },
- children: [/* @__PURE__ */ G("div", {
++ children: [/* @__PURE__ */ K("div", {
+ class: "geist-fieldset-content",
+ children: [
- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: i("startupTitle", "开机自启") } }),
- /* @__PURE__ */ G(rt, {
++ /* @__PURE__ */ K("div", { dangerouslySetInnerHTML: { __html: i("startupTitle", "开机自启") } }),
++ /* @__PURE__ */ K(rt, {
+ label: "开机后启动 Peach",
+ checked: n,
+ disabled: !e.available,
+ change: r
+ }),
- /* @__PURE__ */ G(rt, {
++ /* @__PURE__ */ K(rt, {
+ label: "静默启动",
+ checked: a,
+ disabled: !e.available,
+ change: o
+ }),
- /* @__PURE__ */ G("p", {
++ /* @__PURE__ */ K("p", {
+ class: "confighelp",
+ children: "静默启动仅显示托盘;关闭后自动打开浏览器。"
+ }),
- e.message && /* @__PURE__ */ G("p", {
++ e.message && /* @__PURE__ */ K("p", {
+ class: "confighelp",
+ children: e.message
+ }),
- s && /* @__PURE__ */ G("p", {
++ s && /* @__PURE__ */ K("p", {
+ class: "configbad",
+ role: "alert",
+ children: s
+ })
+ ]
- }), /* @__PURE__ */ G("footer", {
++ }), /* @__PURE__ */ K("footer", {
+ class: "geist-fieldset-footer",
+ "data-geist-fieldset-footer": !0,
- children: /* @__PURE__ */ G("button", {
++ children: /* @__PURE__ */ K("button", {
+ ref: d,
+ type: "submit",
+ class: "geist-button primary",
+ disabled: !e.available,
+ children: "保存自启"
})
- ]
- }), /* @__PURE__ */ G("footer", {
- class: "geist-fieldset-footer",
- "data-geist-fieldset-footer": !0,
- children: [
- /* @__PURE__ */ G("a", {
- class: "geist-button",
- href: "/scraping",
- children: "采集来源"
- }),
- !!d.candidates && /* @__PURE__ */ G("a", {
- class: "geist-button",
- href: "/review",
- children: "复核资料"
- }),
- /* @__PURE__ */ G("button", {
- ref: S,
+ })]
+ });
+ }
+ function at({ data: e }) {
- let t = W(null);
- return U(() => {
++ let t = G(null);
++ return W(() => {
+ let n = t.current, r = document.createElement("details");
+ r.className = "configdirectories";
+ let i = document.createElement("summary");
- i.innerHTML = g("chevron-right") + "<span>数据目录</span>", r.append(i);
++ i.innerHTML = _("chevron-right") + "<span>数据目录</span>", r.append(i);
+ for (let t of [.../* @__PURE__ */ new Set([e.data_root, ...e.directories])]) {
+ let e = document.createElement("p");
+ e.className = "confighelp", e.textContent = t, r.append(e);
+ }
+ return n.replaceChildren(r), d(n, "details", "uninstall-data"), () => n.replaceChildren();
- }, [e]), /* @__PURE__ */ G("div", { ref: t });
++ }, [e]), /* @__PURE__ */ K("div", { ref: t });
+ }
+ function ot({ uninstall: e }) {
- let [t, r] = V(!1), [a, o] = V("");
++ let [t, r] = H(!1), [a, o] = H("");
+ async function s() {
+ await n({
+ title: "卸载 Peach",
+ danger: !0,
+ body: t ? "将退出 Peach,移除程序、开机自启、设置、本地数据库、观看记录、凭据和缓存。原始媒体文件保留。" : "将退出 Peach 并移除程序和开机自启。设置、本地数据库、观看记录与缓存保留。",
+ confirmLabel: "卸载 Peach",
+ onConfirm: async () => {
- let e = await L("/api/configuration/uninstall", {
++ let e = await R("/api/configuration/uninstall", {
+ delete_data: t,
+ confirmation: "卸载 Peach"
+ });
+ o(e.message);
+ }
+ });
+ }
- return /* @__PURE__ */ G("section", {
++ return /* @__PURE__ */ K("section", {
+ id: "uninstallPeach",
+ class: "configfieldset configdanger",
+ "data-geist-fieldset": !0,
+ "data-fieldset-type": "error",
- children: [/* @__PURE__ */ G("div", {
++ children: [/* @__PURE__ */ K("div", {
+ class: "geist-fieldset-content",
+ children: [
- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: i("uninstallTitle", "卸载 Peach") } }),
- e.available && /* @__PURE__ */ G("p", {
++ /* @__PURE__ */ K("div", { dangerouslySetInnerHTML: { __html: i("uninstallTitle", "卸载 Peach") } }),
++ e.available && /* @__PURE__ */ K("p", {
+ class: "confighelp",
+ children: "卸载会退出 Peach、移除程序和开机自启。原始媒体文件保留。"
+ }),
- /* @__PURE__ */ G(rt, {
++ /* @__PURE__ */ K(rt, {
+ label: "完全卸载:同时删除设置、本地数据库、观看记录、凭据和缓存",
+ checked: t,
+ disabled: !e.full_available || !!a,
+ change: r
+ }),
- /* @__PURE__ */ G(at, { data: e }),
- e.message && /* @__PURE__ */ G("p", {
++ /* @__PURE__ */ K(at, { data: e }),
++ e.message && /* @__PURE__ */ K("p", {
+ class: "confighelp",
+ children: e.message
+ }),
- a && /* @__PURE__ */ G("p", {
++ a && /* @__PURE__ */ K("p", {
+ class: "confighelp",
+ role: "status",
+ children: a
+ })
+ ]
- }), /* @__PURE__ */ G("footer", {
++ }), /* @__PURE__ */ K("footer", {
+ class: "geist-fieldset-footer",
+ "data-geist-fieldset-footer": !0,
- children: /* @__PURE__ */ G("button", {
++ children: /* @__PURE__ */ K("button", {
type: "button",
- class: "geist-button primary",
- onClick: () => void T(),
- children: d.status === "failed" ? "重试未完成项" : "扫描并补全资料"
+ class: "geist-button danger",
+ disabled: !e.available || !!a,
+ onClick: () => void s(),
+ children: "卸载 Peach"
})
- ]
- })] });
+ })]
+ });
}
//#endregion
//#region src/islands/configuration.tsx
- var et = "/api/configuration", tt = "/api/pick-folder", nt = 8e3, rt = (e, t) => Promise.all([I(et, t), I("/api/library-processing", t).catch((e) => ({
- status: "failed",
- error: F(e)
- }))]).then(([e, t]) => ({
- ...e,
- processing: t
- })), K = ({ html: e, class: t }) => /* @__PURE__ */ G("div", {
-var st = "/api/configuration", ct = "/api/pick-folder", lt = 8e3, ut = (e, t) => I(st, t), K = ({ html: e, class: t }) => /* @__PURE__ */ G("div", {
++var st = "/api/configuration", ct = "/api/pick-folder", lt = 8e3, ut = (e, t) => L(st, t), q = ({ html: e, class: t }) => /* @__PURE__ */ K("div", {
class: t,
dangerouslySetInnerHTML: { __html: e }
- }), it = (e) => !(e instanceof Te) || e.status !== 400 ? null : e.body?.errors ?? null;
- function at({ facts: e }) {
- return /* @__PURE__ */ G("section", {
+ }), dt = (e) => !(e instanceof ke) || e.status !== 400 ? null : e.body?.errors ?? null;
+ function ft({ facts: e }) {
- return /* @__PURE__ */ G("section", {
++ return /* @__PURE__ */ K("section", {
class: "configfieldset",
"data-geist-fieldset": !0,
"aria-labelledby": "configFactsTitle",
-- children: /* @__PURE__ */ G("div", {
++ children: /* @__PURE__ */ K("div", {
class: "geist-fieldset-content",
- children: [/* @__PURE__ */ G(K, { html: n("configFactsTitle", "运行信息") }), /* @__PURE__ */ G("dl", {
- children: [/* @__PURE__ */ G(K, { html: i("configFactsTitle", "运行信息") }), /* @__PURE__ */ G("dl", {
++ children: [/* @__PURE__ */ K(q, { html: i("configFactsTitle", "运行信息") }), /* @__PURE__ */ K("dl", {
class: "configfacts",
-- children: e.map((e) => /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("dt", { children: e.term }), /* @__PURE__ */ G("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ G("span", {
++ children: e.map((e) => /* @__PURE__ */ K(N, { children: [/* @__PURE__ */ K("dt", { children: e.term }), /* @__PURE__ */ K("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ K("span", {
class: "confighelp",
-- children: [" ", /* @__PURE__ */ G("a", {
++ children: [" ", /* @__PURE__ */ K("a", {
href: e.download_url,
target: "_blank",
rel: "noreferrer",
-- children: [e.download_label, /* @__PURE__ */ G("svg", {
++ children: [e.download_label, /* @__PURE__ */ K("svg", {
"aria-hidden": "true",
viewBox: "0 0 24 24",
-- children: /* @__PURE__ */ G("use", { href: "#i-external-link" })
++ children: /* @__PURE__ */ K("use", { href: "#i-external-link" })
})]
})]
}) : null] })] }))
@@@ -774,70 -1043,70 +1043,70 @@@
})
});
}
- function ot({ data: t }) {
- let [r, i] = V(t.media_sources), [a, o] = V(""), l = W(null);
- H(() => () => l.current?.abort(), []);
- let u = async (e) => {
- if (l.current) return;
+ function pt({ data: t }) {
- let [n, r] = V(t.media_sources), [a, o] = V(""), s = W(null);
- H(() => () => s.current?.abort(), []);
++ let [n, r] = H(t.media_sources), [a, o] = H(""), s = G(null);
++ U(() => () => s.current?.abort(), []);
+ let c = async (e) => {
+ if (s.current) return;
let t = new AbortController();
- l.current = t, c(e, !0), o("");
+ s.current = t, u(e, !0), o("");
try {
- let e = await I(et, t.signal);
- t.signal.aborted || i(e.media_sources);
- let e = await I(st, t.signal);
++ let e = await L(st, t.signal);
+ t.signal.aborted || r(e.media_sources);
} catch (e) {
-- t.signal.aborted || o(F(e));
++ t.signal.aborted || o(I(e));
} finally {
- l.current = null, c(e, !1);
+ s.current = null, u(e, !1);
}
};
- return r ? /* @__PURE__ */ G("section", {
- return n ? /* @__PURE__ */ G("section", {
++ return n ? /* @__PURE__ */ K("section", {
class: "configfieldset",
"aria-labelledby": "configMountsTitle",
-- children: [/* @__PURE__ */ G("div", {
++ children: [/* @__PURE__ */ K("div", {
class: "geist-fieldset-content",
children: [
- /* @__PURE__ */ G(K, { html: n("configMountsTitle", "挂载状态") }),
- /* @__PURE__ */ G(K, { html: i("configMountsTitle", "挂载状态") }),
-- /* @__PURE__ */ G("dl", {
++ /* @__PURE__ */ K(q, { html: i("configMountsTitle", "挂载状态") }),
++ /* @__PURE__ */ K("dl", {
class: "configfacts",
- children: r.map((t) => /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("dt", { children: [/* @__PURE__ */ G("span", {
- children: n.map((t) => /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("dt", { children: [/* @__PURE__ */ G("span", {
++ children: n.map((t) => /* @__PURE__ */ K(N, { children: [/* @__PURE__ */ K("dt", { children: [/* @__PURE__ */ K("span", {
"aria-hidden": "true",
- dangerouslySetInnerHTML: { __html: s(e[t.location]) }
+ dangerouslySetInnerHTML: { __html: l(e[t.location]) }
}), {
local: "本地磁盘",
115: "CloudDrive · 115",
pikpak: "CloudDrive · PikPak"
-- }[t.location] || t.location] }), /* @__PURE__ */ G("dd", { children: [
++ }[t.location] || t.location] }), /* @__PURE__ */ K("dd", { children: [
t.path || "未配置挂载点",
" ",
-- /* @__PURE__ */ G("span", {
++ /* @__PURE__ */ K("span", {
class: `configstatus ${t.online === !0 ? "online" : t.online === !1 ? "offline" : "unknown"}`,
children: t.online === !0 ? "在线" : t.online === !1 ? "离线" : "未检测"
})
] })] }))
}),
-- a ? /* @__PURE__ */ G("p", {
++ a ? /* @__PURE__ */ K("p", {
class: "configbad",
role: "alert",
children: a
}) : null
]
-- }), /* @__PURE__ */ G("div", {
++ }), /* @__PURE__ */ K("div", {
class: "geist-fieldset-footer",
"data-geist-fieldset-footer": !0,
-- children: /* @__PURE__ */ G("button", {
++ children: /* @__PURE__ */ K("button", {
type: "button",
class: "geist-button",
- onClick: (e) => u(e.currentTarget),
+ onClick: (e) => c(e.currentTarget),
children: "刷新挂载状态"
})
})]
}) : null;
}
- function st({ value: t, label: n, onChange: r }) {
- let i = W(null), a = W(null), s = W(r);
- return s.current = r, U(() => {
+ function mt({ value: t, label: n, onChange: r }) {
- let i = W(null), a = W(null), o = W(r);
- return o.current = r, U(() => {
++ let i = G(null), a = G(null), o = G(r);
++ return o.current = r, W(() => {
let r = i.current;
- r.innerHTML = o([
+ r.innerHTML = c([
["local", "本地磁盘"],
["115", "CloudDrive · 115"],
["pikpak", "CloudDrive · PikPak"]
@@@ -846,15 -1115,15 +1115,15 @@@
n,
e[t]
]), t, { label: n });
- let c = l(r.firstElementChild);
- a.current = c;
- let u = () => s.current(c.value);
- return c.addEventListener("change", u), () => {
- a.current = null, c.disabled = !0, c.removeEventListener("change", u), r.replaceChildren();
+ let s = f(r.firstElementChild);
+ a.current = s;
+ let l = () => o.current(s.value);
+ return s.addEventListener("change", l), () => {
+ a.current = null, s.disabled = !0, s.removeEventListener("change", l), r.replaceChildren();
};
-- }, [n]), U(() => {
++ }, [n]), W(() => {
a.current && (a.current.value = t);
-- }, [t]), /* @__PURE__ */ G("div", {
++ }, [t]), /* @__PURE__ */ K("div", {
ref: i,
class: "configsourcecontrol"
});
@@@ -864,167 -1133,167 +1133,167 @@@ function ht({ data: e, receipt: t })
"local",
"115",
"pikpak"
- ].includes(e.location)), [a, o] = V(r?.length ? r.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [s, l] = V(r?.map((e) => e.location) ?? []), [u, d] = V(r?.map((e) => e.root) ?? []), [f, p] = V(String(e.port)), [m, h] = V(!1), [g, _] = V([]), [v, y] = V(""), [b, x] = V(""), [S, C] = V(null), [w, T] = V(null), E = W(!1), D = W(e.revision), O = W([]), k = W(null);
- ].includes(e.location)), [r, a] = V(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [s, c] = V(n?.map((e) => e.location) ?? []), [l, d] = V(n?.map((e) => e.root) ?? []), [f, p] = V(String(e.port)), [m, h] = V(!1), [g, _] = V([]), [v, y] = V(""), [b, x] = V(""), [S, C] = V(null), [w, T] = V(null), E = W(!1), D = W(e.revision), ee = W([]), O = W(null);
-- U(() => {
- w !== null && (ee.current[w]?.focus(), T(null));
- }, [w]), H(() => {
++ ].includes(e.location)), [r, a] = H(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [s, c] = H(n?.map((e) => e.location) ?? []), [l, d] = H(n?.map((e) => e.root) ?? []), [f, p] = H(String(e.port)), [m, h] = H(!1), [g, _] = H([]), [v, y] = H(""), [b, x] = H(""), [S, C] = H(null), [w, T] = H(null), E = G(!1), D = G(e.revision), O = G([]), k = G(null);
++ W(() => {
+ w !== null && (O.current[w]?.focus(), T(null));
- }, [w]), H(() => {
++ }, [w]), U(() => {
if (!S) return;
- let e = setTimeout(() => location.assign(S.url), nt);
+ let e = setTimeout(() => location.assign(S.url), lt);
return () => clearTimeout(e);
}, [S]);
- let k = (e, t) => {
+ let A = (e, t) => {
- o((n) => n.map((n, r) => r === e ? t : n));
+ a((n) => n.map((n, r) => r === e ? t : n));
- }, te = () => {
+ }, ee = () => {
- T(a.length), o((e) => [...e, ""]);
- }, j = (e) => {
- l((t) => t.filter((t, n) => n !== e)), d((t) => t.filter((t, n) => n !== e)), o((t) => t.filter((t, n) => n !== e)), _((t) => t.filter((t, n) => n !== e));
- }, M = (e, t) => {
+ T(r.length), a((e) => [...e, ""]);
- }, A = (e) => {
++ }, te = (e) => {
+ c((t) => t.filter((t, n) => n !== e)), d((t) => t.filter((t, n) => n !== e)), a((t) => t.filter((t, n) => n !== e)), _((t) => t.filter((t, n) => n !== e));
+ }, j = (e, t) => {
_((n) => {
let r = [...n];
for (; r.length <= e;) r.push("");
return r[e] = t, r;
});
- }, te = async (e, t) => {
+ }, ne = async (e, t) => {
if (t.getAttribute("aria-busy") !== "true") {
- c(t, !0);
+ u(t, !0);
try {
- let { path: t } = await L(tt, { initial: a[e] ?? "" });
- t && (A(e, t), M(e, ""));
- let { path: t } = await L(ct, { initial: r[e] ?? "" });
- t && (k(e, t), j(e, ""));
++ let { path: t } = await R(ct, { initial: r[e] ?? "" });
++ t && (A(e, t), j(e, ""));
} catch (t) {
- M(e, F(t));
- j(e, F(t));
++ j(e, I(t));
} finally {
- c(t, !1);
+ u(t, !1);
}
}
};
-- return S ? /* @__PURE__ */ G("div", {
++ return S ? /* @__PURE__ */ K("div", {
class: "configsaved",
role: "status",
-- children: /* @__PURE__ */ G("div", {
++ children: /* @__PURE__ */ K("div", {
class: "geist-note geist-note-success",
role: "note",
-- children: [/* @__PURE__ */ G("svg", {
++ children: [/* @__PURE__ */ K("svg", {
"aria-hidden": "true",
viewBox: "0 0 24 24",
-- children: /* @__PURE__ */ G("use", { href: "#i-check" })
-- }), /* @__PURE__ */ G("p", { children: /* @__PURE__ */ G("span", { children: [
++ children: /* @__PURE__ */ K("use", { href: "#i-check" })
++ }), /* @__PURE__ */ K("p", { children: /* @__PURE__ */ K("span", { children: [
"配置已保存,Peach 正在重新启动。稍后自动跳转,或点击",
-- /* @__PURE__ */ G("a", {
++ /* @__PURE__ */ K("a", {
href: S.url,
children: "进入馆藏"
}),
"。"
] }) })]
})
-- }) : /* @__PURE__ */ G("form", {
++ }) : /* @__PURE__ */ K("form", {
class: "configfieldset",
"data-geist-fieldset": !0,
"aria-labelledby": "configTitle",
onSubmit: async (n) => {
if (n.preventDefault(), !E.current) {
- E.current = !0, c(k.current, !0), x("");
- E.current = !0, u(O.current, !0), x("");
++ E.current = !0, u(k.current, !0), x("");
try {
- let n = await L(et, {
- let n = await L(st, {
++ let n = await R(st, {
revision: D.current,
- media_dirs: a,
- ...e.media_sources ? { media_sources: a.map((e, t) => ({
+ media_dirs: r,
+ ...e.media_sources ? { media_sources: r.map((e, t) => ({
path: e,
location: s[t] || "local",
- root: u[t] || ""
+ root: l[t] || ""
})) } : {},
port: f,
scan_now: m
});
D.current = n.revision, _([]), y(""), t("已保存配置"), C(n);
} catch (e) {
- let t = it(e);
- t ? (_(t.media_dirs ?? []), y(t.port ?? "")) : (_([]), y(""), x(F(e)));
+ let t = dt(e);
- t ? (_(t.media_dirs ?? []), y(t.port ?? "")) : (_([]), y(""), x(F(e)));
++ t ? (_(t.media_dirs ?? []), y(t.port ?? "")) : (_([]), y(""), x(I(e)));
} finally {
- E.current = !1, c(k.current, !1);
- E.current = !1, u(O.current, !1);
++ E.current = !1, u(k.current, !1);
}
}
},
noValidate: !0,
-- children: [/* @__PURE__ */ G("div", {
++ children: [/* @__PURE__ */ K("div", {
class: "geist-fieldset-content",
children: [
- /* @__PURE__ */ G(K, { html: n("configTitle", "这台电脑") }),
- /* @__PURE__ */ G(K, { html: i("configTitle", "这台电脑") }),
-- /* @__PURE__ */ G("div", {
++ /* @__PURE__ */ K(q, { html: i("configTitle", "这台电脑") }),
++ /* @__PURE__ */ K("div", {
class: "configfield",
children: [
-- /* @__PURE__ */ G("span", {
++ /* @__PURE__ */ K("span", {
class: "configlabel",
id: "configDirsLabel",
children: "媒体文件夹"
}),
-- /* @__PURE__ */ G("div", {
++ /* @__PURE__ */ K("div", {
class: "configdirs",
role: "group",
"aria-labelledby": "configDirsLabel",
- children: a.map((t, n) => /* @__PURE__ */ G("div", {
- children: r.map((t, n) => /* @__PURE__ */ G("div", {
++ children: r.map((t, n) => /* @__PURE__ */ K("div", {
class: "configdir",
children: [
-- /* @__PURE__ */ G("span", {
++ /* @__PURE__ */ K("span", {
class: "configpathlabel",
children: ["本机文件夹 ", n + 1]
}),
-- /* @__PURE__ */ G("input", {
++ /* @__PURE__ */ K("input", {
class: "geist-input",
type: "text",
value: t,
"aria-label": `媒体文件夹 ${n + 1}`,
"aria-invalid": g[n] ? "true" : void 0,
- onInput: (e) => k(n, e.currentTarget.value),
+ onInput: (e) => A(n, e.currentTarget.value),
ref: (e) => {
- ee.current[n] = e;
+ O.current[n] = e;
}
}),
-- /* @__PURE__ */ G("button", {
++ /* @__PURE__ */ K("button", {
type: "button",
class: "geist-button configpick",
"aria-label": "选择文件夹",
- onClick: (e) => te(n, e.currentTarget),
- children: /* @__PURE__ */ G("svg", {
+ onClick: (e) => ne(n, e.currentTarget),
- children: /* @__PURE__ */ G("svg", {
++ children: /* @__PURE__ */ K("svg", {
viewBox: "0 0 24 24",
"aria-hidden": "true",
-- children: /* @__PURE__ */ G("use", { href: "#i-folder-search" })
++ children: /* @__PURE__ */ K("use", { href: "#i-folder-search" })
})
}),
- a.length > 1 ? /* @__PURE__ */ G("button", {
- r.length > 1 ? /* @__PURE__ */ G("button", {
++ r.length > 1 ? /* @__PURE__ */ K("button", {
type: "button",
class: "geist-button configrm",
"aria-label": "移除这个文件夹",
- onClick: () => j(n),
- onClick: () => A(n),
-- children: /* @__PURE__ */ G("svg", {
++ onClick: () => te(n),
++ children: /* @__PURE__ */ K("svg", {
viewBox: "0 0 24 24",
"aria-hidden": "true",
-- children: /* @__PURE__ */ G("use", { href: "#i-x" })
++ children: /* @__PURE__ */ K("use", { href: "#i-x" })
})
}) : null,
-- /* @__PURE__ */ G("div", {
++ /* @__PURE__ */ K("div", {
class: "configsource",
-- children: [/* @__PURE__ */ G("div", {
++ children: [/* @__PURE__ */ K("div", {
class: "configsourcelabel",
- children: ["媒体来源", /* @__PURE__ */ G(st, {
- children: ["媒体来源", /* @__PURE__ */ G(mt, {
++ children: ["媒体来源", /* @__PURE__ */ K(mt, {
label: `媒体来源 ${n + 1}`,
value: s[n] || "local",
onChange: (e) => {
let t = [...s];
- t[n] = e, l(t);
+ t[n] = e, c(t);
}
})]
-- }), e.windows === !1 ? /* @__PURE__ */ G("label", { children: ["Windows 中的对应路径", /* @__PURE__ */ G("input", {
++ }), e.windows === !1 ? /* @__PURE__ */ K("label", { children: ["Windows 中的对应路径", /* @__PURE__ */ K("input", {
class: "geist-input",
"aria-label": `Windows 中的对应路径 ${n + 1}`,
- value: u[n] || "",
+ value: l[n] || "",
placeholder: "例如 B:\\\\",
onInput: (e) => {
- let t = [...u];
+ let t = [...l];
t[n] = e.currentTarget.value, d(t);
}
})] }) : null]
}),
-- g[n] ? /* @__PURE__ */ G("p", {
++ g[n] ? /* @__PURE__ */ K("p", {
class: "configbad",
role: "alert",
children: g[n]
@@@ -1032,61 -1301,61 +1301,61 @@@
]
}, n))
}),
-- /* @__PURE__ */ G("button", {
++ /* @__PURE__ */ K("button", {
type: "button",
class: "geist-button configadd",
- onClick: te,
+ onClick: ee,
children: "添加文件夹"
}),
-- s.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ G("p", {
++ s.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ K("p", {
class: "confighelp",
-- children: ["先在 CloudDrive 登录网盘并完成挂载。", /* @__PURE__ */ G("a", {
++ children: ["先在 CloudDrive 登录网盘并完成挂载。", /* @__PURE__ */ K("a", {
href: "https://www.clouddrive2.com/help.html",
target: "_blank",
rel: "noreferrer",
-- children: ["挂载帮助", /* @__PURE__ */ G("svg", {
++ children: ["挂载帮助", /* @__PURE__ */ K("svg", {
"aria-hidden": "true",
viewBox: "0 0 24 24",
-- children: /* @__PURE__ */ G("use", { href: "#i-external-link" })
++ children: /* @__PURE__ */ K("use", { href: "#i-external-link" })
})]
})]
}) : null,
-- s.some((e) => e === "115" || e === "pikpak") ? e.mount_dependencies?.filter((e) => !e.available).map((e) => /* @__PURE__ */ G("p", {
++ s.some((e) => e === "115" || e === "pikpak") ? e.mount_dependencies?.filter((e) => !e.available).map((e) => /* @__PURE__ */ K("p", {
class: "confighelp",
children: [
"未检测到 ",
e.name,
"。",
-- /* @__PURE__ */ G("a", {
++ /* @__PURE__ */ K("a", {
href: e.download_url,
target: "_blank",
rel: "noreferrer",
children: [
"下载 ",
e.name,
-- /* @__PURE__ */ G("svg", {
++ /* @__PURE__ */ K("svg", {
"aria-hidden": "true",
viewBox: "0 0 24 24",
-- children: /* @__PURE__ */ G("use", { href: "#i-external-link" })
++ children: /* @__PURE__ */ K("use", { href: "#i-external-link" })
})
]
})
]
})) : null,
-- e.windows === !1 ? /* @__PURE__ */ G("p", {
++ e.windows === !1 ? /* @__PURE__ */ K("p", {
class: "confighelp",
children: "本机文件夹是这台电脑读取媒体的位置。Windows 中的对应路径用于匹配馆藏中已有的路径,例如 B:\\ 对应本机挂载文件夹。"
}) : null
]
}),
-- e.port_editable === !1 ? null : /* @__PURE__ */ G("div", {
++ e.port_editable === !1 ? null : /* @__PURE__ */ K("div", {
class: "configfield",
children: [
-- /* @__PURE__ */ G("label", {
++ /* @__PURE__ */ K("label", {
for: "configPort",
children: "本机访问端口"
}),
-- /* @__PURE__ */ G("input", {
++ /* @__PURE__ */ K("input", {
id: "configPort",
class: "geist-input",
type: "text",
@@@ -1095,86 -1364,87 +1364,87 @@@
"aria-invalid": v ? "true" : void 0,
onInput: (e) => p(e.currentTarget.value)
}),
-- v ? /* @__PURE__ */ G("p", {
++ v ? /* @__PURE__ */ K("p", {
class: "configbad",
role: "alert",
children: v
}) : null,
-- /* @__PURE__ */ G("p", {
++ /* @__PURE__ */ K("p", {
class: "confighelp",
children: "浏览器地址里冒号后面的数字,一般不用改。"
})
]
}),
-- /* @__PURE__ */ G("label", {
++ /* @__PURE__ */ K("label", {
class: "configcheck",
-- children: [/* @__PURE__ */ G("span", {
++ children: [/* @__PURE__ */ K("span", {
class: "pcheck",
-- children: [/* @__PURE__ */ G("input", {
++ children: [/* @__PURE__ */ K("input", {
type: "checkbox",
checked: m,
onChange: (e) => h(e.currentTarget.checked)
-- }), /* @__PURE__ */ G("span", {
++ }), /* @__PURE__ */ K("span", {
"aria-hidden": "true",
-- children: /* @__PURE__ */ G("svg", {
++ children: /* @__PURE__ */ K("svg", {
viewBox: "0 0 24 24",
-- children: /* @__PURE__ */ G("use", { href: "#i-check" })
++ children: /* @__PURE__ */ K("use", { href: "#i-check" })
})
})]
-- }), /* @__PURE__ */ G("span", { children: "保存后扫描并补全资料" })]
++ }), /* @__PURE__ */ K("span", { children: "保存后扫描并补全资料" })]
}),
- b ? /* @__PURE__ */ G(K, { html: i(b, {
- b ? /* @__PURE__ */ G(K, { html: o(b, {
++ b ? /* @__PURE__ */ K(q, { html: o(b, {
variant: "error",
label: "没有保存"
}) }) : null
]
-- }), /* @__PURE__ */ G("div", {
++ }), /* @__PURE__ */ K("div", {
class: "geist-fieldset-footer",
"data-geist-fieldset-footer": !0,
-- children: [/* @__PURE__ */ G("p", { children: e.port_editable === !1 ? "保存后 Peach 会重新载入配置。" : "保存后 Peach 会重新启动,端口改了就用新地址打开。" }), /* @__PURE__ */ G("button", {
++ children: [/* @__PURE__ */ K("p", { children: e.port_editable === !1 ? "保存后 Peach 会重新载入配置。" : "保存后 Peach 会重新启动,端口改了就用新地址打开。" }), /* @__PURE__ */ K("button", {
type: "submit",
class: "geist-button primary",
- ref: O,
+ ref: k,
children: "保存配置"
})]
})]
});
}
- function lt({ receipt: e, data: t, error: n }) {
- return n || !t ? /* @__PURE__ */ G(K, {
+ function gt({ receipt: e, data: t, error: n }) {
- return n || !t ? /* @__PURE__ */ G(K, {
++ return n || !t ? /* @__PURE__ */ K(q, {
class: "configpage",
- html: i(n || "没有读到配置", {
+ html: o(n || "没有读到配置", {
variant: "error",
label: "打不开配置"
})
-- }) : /* @__PURE__ */ G("div", {
++ }) : /* @__PURE__ */ K("div", {
class: "configpage",
children: [
- t.editable ? /* @__PURE__ */ G(ct, {
- t.startup ? /* @__PURE__ */ G(it, {
++ t.startup ? /* @__PURE__ */ K(it, {
+ startup: t.startup,
+ receipt: e
+ }) : null,
- t.editable ? /* @__PURE__ */ G(ht, {
++ t.editable ? /* @__PURE__ */ K(ht, {
data: t,
receipt: e
- }) : /* @__PURE__ */ G(K, { html: i(t.notice, {
- }) : /* @__PURE__ */ G(K, { html: o(t.notice, {
++ }) : /* @__PURE__ */ K(q, { html: o(t.notice, {
variant: "secondary",
label: "只读"
}) }),
- t.access ? /* @__PURE__ */ G(Ye, {
- /* @__PURE__ */ G(pt, { data: t }),
- t.peach_proxy ? /* @__PURE__ */ G(nt, {
++ /* @__PURE__ */ K(pt, { data: t }),
++ t.peach_proxy ? /* @__PURE__ */ K(nt, {
+ initial: t.peach_proxy,
+ receipt: e
+ }) : null,
- t.access ? /* @__PURE__ */ G($e, {
++ t.access ? /* @__PURE__ */ K($e, {
initial: t.access,
receipt: e
}) : null,
- /* @__PURE__ */ G("section", {
- id: "libraryProcessing",
- class: "configfieldset",
- "data-geist-fieldset": !0,
- "aria-labelledby": "cleanupScrapingTitle",
- children: /* @__PURE__ */ G($e, {
- data: t.processing || { status: "idle" },
- error: "",
- toast: e,
- monitor: !0
- })
- }),
- /* @__PURE__ */ G(at, { facts: t.facts }),
- /* @__PURE__ */ G(ot, { data: t })
- t.updates ? /* @__PURE__ */ G(tt, {
++ t.updates ? /* @__PURE__ */ K(tt, {
+ initial: t.updates,
+ initialJob: t.update_job
+ }) : null,
- /* @__PURE__ */ G(ft, { facts: t.facts }),
- t.uninstall ? /* @__PURE__ */ G(ot, { uninstall: t.uninstall }) : null
++ /* @__PURE__ */ K(ft, { facts: t.facts }),
++ t.uninstall ? /* @__PURE__ */ K(ot, { uninstall: t.uninstall }) : null
]
});
}
@@@ -1186,17 -1456,17 +1456,17 @@@ function vt()
else {
var e, t = !1;
for ((function() {
- var e = vt;
- for (vt = void 0; e !== void 0;) {
- var e = Tt;
- for (Tt = void 0; e !== void 0;) {
++ var e = Et;
++ for (Et = 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;
}
- })(); mt !== void 0;) {
- var n = mt;
- for (mt = void 0, ht++; n !== void 0;) {
- })(); xt !== void 0;) {
- var n = xt;
- for (xt = void 0, St++; n !== void 0;) {
++ })(); St !== void 0;) {
++ var n = St;
++ for (St = void 0, Ct++; n !== void 0;) {
var r = n.u;
- if (n.u = void 0, n.f &= -3, !(8 & n.f) && St(n)) try {
- if (n.u = void 0, n.f &= -3, !(8 & n.f) && kt(n)) try {
++ if (n.u = void 0, n.f &= -3, !(8 & n.f) && At(n)) try {
n.c();
} catch (n) {
t ||= (e = n, !0);
@@@ -1204,30 -1474,30 +1474,30 @@@
n = r;
}
}
- if (ht = 0, Y--, t) throw e;
- if (St = 0, Y--, t) throw e;
++ if (Ct = 0, Y--, t) throw e;
}
}
- function ft(e) {
+ function yt(e) {
if (Y > 0) return e();
- _t = ++gt, Y++;
- wt = ++Ct, Y++;
++ Tt = ++wt, Y++;
try {
return e();
} finally {
- dt();
+ vt();
}
}
--var q, J = void 0;
- function pt(e) {
-function bt(e) {
-- var t = J, n = q;
-- J = void 0, q = void 0;
++var bt, J = void 0;
++function xt(e) {
++ var t = J, n = bt;
++ J = void 0, bt = void 0;
try {
return e();
} finally {
-- J = t, q = n;
++ J = t, bt = n;
}
}
- var mt = void 0, Y = 0, ht = 0, gt = 0, _t = 0, vt = void 0, yt = 0;
- function bt(e) {
-var xt = void 0, Y = 0, St = 0, Ct = 0, wt = 0, Tt = void 0, Et = 0;
-function Dt(e) {
++var St = void 0, Y = 0, Ct = 0, wt = 0, Tt = 0, Et = void 0, Dt = 0;
++function Ot(e) {
if (J !== void 0) {
var t = e.n;
if (t === void 0 || t.t !== J) return t = {
@@@ -1250,7 -1520,7 +1520,7 @@@ X.prototype.brand = _t, X.prototype.h
return !0;
}, X.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 ? pt(function() {
- n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? bt(function() {
++ n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? xt(function() {
var e;
(e = t.W) == null || e.call(t);
}) : n.e = e);
@@@ -1258,16 -1528,16 +1528,16 @@@
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 && pt(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 && bt(function() {
++ n !== void 0 && (n.x = r, e.e = void 0), r !== void 0 && (r.e = n, e.x = void 0), e === this.t && (this.t = r, r === void 0 && xt(function() {
var e;
(e = t.Z) == null || e.call(t);
}));
}
}, X.prototype.subscribe = function(e) {
var t = this;
- return kt(function() {
- return It(function() {
++ return Lt(function() {
var n = t.value;
- pt(function() {
- bt(function() {
++ xt(function() {
return e(n);
});
}, { name: "sub" });
@@@ -1279,25 -1549,25 +1549,25 @@@
return this.value;
}, X.prototype.peek = function() {
var e = this;
- return pt(function() {
- return bt(function() {
++ return xt(function() {
return e.value;
});
}, Object.defineProperty(X.prototype, "value", {
get: function() {
- var e = bt(this);
- var e = Dt(this);
++ var e = Ot(this);
return e !== void 0 && (e.i = this.i), this.v;
},
set: function(e) {
if (e !== this.v) {
- if (ht > 100) throw Error("Cycle detected");
- if (St > 100) throw Error("Cycle detected");
++ if (Ct > 100) throw Error("Cycle detected");
(function(e) {
- Y !== 0 && ht === 0 && e.l !== _t && (e.l = _t, vt = {
- Y !== 0 && St === 0 && e.l !== wt && (e.l = wt, Tt = {
++ Y !== 0 && Ct === 0 && e.l !== Tt && (e.l = Tt, Et = {
S: e,
v: e.v,
i: e.i,
- o: vt
- o: Tt
++ o: Et
});
- })(this), this.v = e, this.i++, yt++, Y++;
- })(this), this.v = e, this.i++, Et++, Y++;
++ })(this), this.v = e, this.i++, Dt++, Y++;
try {
for (var t = this.t; t !== void 0; t = t.x) t.t.N();
} finally {
@@@ -1306,14 -1576,14 +1576,14 @@@
}
}
});
- function xt(e, t) {
-function Ot(e, t) {
++function kt(e, t) {
return new X(e, t);
}
- function St(e) {
-function kt(e) {
++function At(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 Ct(e) {
-function At(e) {
++function jt(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) {
@@@ -1322,7 -1592,7 +1592,7 @@@
}
}
}
- function wt(e) {
-function jt(e) {
++function Mt(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;
@@@ -1330,21 -1600,21 +1600,21 @@@
e.s = n;
}
function Z(e, t) {
- X.call(this, void 0, t), this.x = e, this.s = void 0, this.g = yt - 1, this.f = 4;
- X.call(this, void 0, t), this.x = e, this.s = void 0, this.g = Et - 1, this.f = 4;
++ X.call(this, void 0, t), this.x = e, this.s = void 0, this.g = Dt - 1, this.f = 4;
}
Z.prototype = new X(), Z.prototype.h = function() {
if (this.f &= -3, 1 & this.f) return !1;
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === yt)) return !0;
- if (this.g = yt, this.f |= 1, this.i > 0 && !St(this)) return this.f &= -2, !0;
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === Et)) return !0;
- if (this.g = Et, this.f |= 1, this.i > 0 && !kt(this)) return this.f &= -2, !0;
++ if ((36 & this.f) == 32 || (this.f &= -5, this.g === Dt)) return !0;
++ if (this.g = Dt, this.f |= 1, this.i > 0 && !At(this)) return this.f &= -2, !0;
var e = J;
try {
- Ct(this), J = this;
- At(this), J = this;
++ jt(this), J = 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 J = e, wt(this), this.f &= -2, !0;
- return J = e, jt(this), this.f &= -2, !0;
++ return J = e, Mt(this), this.f &= -2, !0;
}, Z.prototype.S = function(e) {
if (this.t === void 0) {
this.f |= 36;
@@@ -1363,14 -1633,14 +1633,14 @@@
}
}, Object.defineProperty(Z.prototype, "value", { get: function() {
if (1 & this.f) throw Error("Cycle detected");
- var e = bt(this);
- var e = Dt(this);
++ var e = Ot(this);
if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;
return this.v;
} });
- function Tt(e, t) {
-function Mt(e, t) {
++function Nt(e, t) {
return new Z(e, t);
}
- function Et(e) {
-function Nt(e) {
++function Pt(e) {
var t = e.m;
if (e.m = void 0, typeof t == "function") {
Y++;
@@@ -1379,22 -1649,22 +1649,22 @@@
try {
t();
} catch (t) {
- throw e.f &= -2, e.f |= 8, Dt(e), t;
- throw e.f &= -2, e.f |= 8, Pt(e), t;
++ throw e.f &= -2, e.f |= 8, Ft(e), t;
} finally {
- J = n, dt();
+ J = n, vt();
}
}
}
- function Dt(e) {
-function Pt(e) {
++function Ft(e) {
for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
- e.x = void 0, e.s = void 0, Et(e);
- e.x = void 0, e.s = void 0, Nt(e);
++ e.x = void 0, e.s = void 0, Pt(e);
}
- function Ot(e) {
-function Ft(e) {
++function It(e) {
if (J !== this) throw Error("Out-of-order effect");
- wt(this), J = e, this.f &= -2, 8 & this.f && Dt(this), dt();
- jt(this), J = e, this.f &= -2, 8 & this.f && Pt(this), vt();
++ Mt(this), J = e, this.f &= -2, 8 & this.f && Ft(this), vt();
}
function Q(e, t) {
-- this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, q && q.push(this);
++ this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, bt && bt.push(this);
}
Q.prototype.c = function() {
var e = this.S();
@@@ -1407,17 -1677,17 +1677,17 @@@
}
}, Q.prototype.S = function() {
if (1 & this.f) throw Error("Cycle detected");
- this.f |= 1, this.f &= -9, Et(this), Ct(this), Y++;
- this.f |= 1, this.f &= -9, Nt(this), At(this), Y++;
++ this.f |= 1, this.f &= -9, Pt(this), jt(this), Y++;
var e = J;
- return J = this, Ot.bind(this, e);
- return J = this, Ft.bind(this, e);
++ return J = this, It.bind(this, e);
}, Q.prototype.N = function() {
- 2 & this.f || (this.f |= 2, this.u = mt, mt = this);
- 2 & this.f || (this.f |= 2, this.u = xt, xt = this);
++ 2 & this.f || (this.f |= 2, this.u = St, St = this);
}, Q.prototype.d = function() {
- this.f |= 8, 1 & this.f || Dt(this);
- this.f |= 8, 1 & this.f || Pt(this);
++ this.f |= 8, 1 & this.f || Ft(this);
}, Q.prototype.dispose = function() {
this.d();
};
- function kt(e, t) {
-function It(e, t) {
++function Lt(e, t) {
var n = new Q(e, t);
try {
n.c();
@@@ -1429,35 -1699,35 +1699,35 @@@
}
//#endregion
//#region node_modules/@preact/signals/dist/signals.module.js
- var At, jt, Mt = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Nt = [];
- kt(function() {
- At = this.N;
-var Lt, Rt, zt = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Bt = [];
-It(function() {
- Lt = this.N;
++var Rt, zt, Bt = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Vt = [];
++Lt(function() {
++ Rt = this.N;
})();
function $(e, t) {
- h[e] = t.bind(null, h[e] || function() {});
- v[e] = t.bind(null, v[e] || function() {});
++ y[e] = t.bind(null, y[e] || function() {});
}
- function Pt(e) {
- if (jt) {
- var t = jt;
- jt = void 0, t();
-function Vt(e) {
- if (Rt) {
- var t = Rt;
- Rt = void 0, t();
++function Ht(e) {
++ if (zt) {
++ var t = zt;
++ zt = void 0, t();
}
- jt = e && e.S();
- Rt = e && e.S();
++ zt = e && e.S();
}
- function Ft(e) {
- var t = this, n = e.data, r = Lt(n);
-function Ht(e) {
- var t = this, n = e.data, r = Wt(n);
++function Ut(e) {
++ var t = this, n = e.data, r = Gt(n);
r.name = "ReactiveDom", r.value = n;
- var i = ze(function() {
+ var i = Ue(function() {
for (var e = t, n = t.__v; n = n.__;) if (n.__c) {
n.__c.__$f |= 4;
break;
}
- var i = Tt(function() {
- var i = Mt(function() {
++ var i = Nt(function() {
var e = r.value.value;
return e === 0 ? 0 : !0 === e ? "" : e || "";
- }), a = Tt(function() {
- return !Array.isArray(i.value) && !_(i.value);
- }), o = kt(function() {
- if (this.N = Bt, a.value) {
- }), a = Mt(function() {
- return !Array.isArray(i.value) && !b(i.value);
- }), o = It(function() {
- if (this.N = qt, a.value) {
++ }), a = Nt(function() {
++ return !Array.isArray(i.value) && !x(i.value);
++ }), o = Lt(function() {
++ if (this.N = Jt, a.value) {
var t = i.value;
e.__v && e.__v.__e && e.__v.__e.nodeType === 3 && (e.__v.__e.data = t);
}
@@@ -1468,14 -1738,14 +1738,14 @@@
}, []), a = i[0], o = i[1];
return a.value ? o.peek() : o.value;
}
- Ft.displayName = "ReactiveTextNode", Object.defineProperties(X.prototype, {
-Ht.displayName = "ReactiveTextNode", Object.defineProperties(X.prototype, {
++Ut.displayName = "ReactiveTextNode", Object.defineProperties(X.prototype, {
constructor: {
configurable: !0,
value: void 0
},
type: {
configurable: !0,
- value: Ft
- value: Ht
++ value: Ut
},
props: {
configurable: !0,
@@@ -1501,24 -1771,24 +1771,24 @@@
e(t);
}), $("__r", function(e, t) {
if (e(t), t.type !== N) {
- Pt();
- Vt();
++ Ht();
var n, r = t.__c;
r && (r.__$f &= -2, (n = r.__$u) === void 0 && (r.__$u = n = function(e, t) {
var n;
- return kt(function() {
- return It(function() {
++ return Lt(function() {
n = this;
}, { name: t }), n.c = e, n;
}(function(e) {
return function() {
var t;
- Mt && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});
- zt && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});
++ Bt && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});
};
- }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), Pt(n);
- }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), Vt(n);
++ }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), Ht(n);
}
}), $("__e", function(e, t, n, r) {
- Pt(), e(t, n, r);
- Vt(), e(t, n, r);
++ Ht(), e(t, n, r);
}), $("diffed", function(e, t) {
- Pt();
- Vt();
++ Ht();
var n;
if (typeof t.type == "string" && (n = t.__e)) {
var r = t.__np, i = t.props, a = n.U;
@@@ -1528,19 -1798,19 +1798,19 @@@
}
if (r) for (var c in a || (a = {}, n.U = a), r) {
var l = a[c], u = r[c];
- l === void 0 ? (l = It(n, c, u, i), a[c] = l) : l.o(u, i);
- l === void 0 ? (l = Ut(n, c, u, i), a[c] = l) : l.o(u, i);
++ l === void 0 ? (l = Wt(n, c, u, i), a[c] = l) : l.o(u, i);
}
}
e(t);
});
- function It(e, t, n, r) {
- var i = t in e && e.ownerSVGElement === void 0, a = xt(n);
-function Ut(e, t, n, r) {
- var i = t in e && e.ownerSVGElement === void 0, a = Ot(n);
++function Wt(e, t, n, r) {
++ var i = t in e && e.ownerSVGElement === void 0, a = kt(n);
return {
o: function(e, t) {
a.value = e, r = t;
},
- d: kt(function() {
- this.N = Bt;
- d: It(function() {
- this.N = qt;
++ d: Lt(function() {
++ this.N = Jt;
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));
})
@@@ -1572,7 -1842,7 +1842,7 @@@ $("unmount", function(e, t)
e(t);
}), $("__h", function(e, t, n, r) {
r < 3 && (t.__$f |= 2), e(t, n, r);
- }), ie.prototype.shouldComponentUpdate = function(e, t) {
-}), se.prototype.shouldComponentUpdate = function(e, t) {
++}), P.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;
@@@ -1584,266 -1854,287 +1854,301 @@@
for (var s in this.props) if (!(s in e)) return !0;
return !1;
};
- function Lt(e, t) {
- return ze(function() {
- return xt(e, t);
-function Wt(e, t) {
++function Gt(e, t) {
+ return Ue(function() {
- return Ot(e, t);
++ return kt(e, t);
}, []);
}
- var Rt = function(e) {
-var Gt = function(e) {
++var Kt = function(e) {
queueMicrotask(function() {
queueMicrotask(e);
});
};
- function zt() {
- ft(function() {
- for (var e; e = Nt.shift();) At.call(e);
-function Kt() {
++function qt() {
+ yt(function() {
- for (var e; e = Bt.shift();) Lt.call(e);
++ for (var e; e = Vt.shift();) Rt.call(e);
});
}
- function Bt() {
- Nt.push(this) === 1 && (h.requestAnimationFrame || Rt)(zt);
-function qt() {
- Bt.push(this) === 1 && (v.requestAnimationFrame || Gt)(Kt);
++function Jt() {
++ Vt.push(this) === 1 && (y.requestAnimationFrame || Kt)(qt);
}
//#endregion
//#region src/state/quality-goals.ts
- var Vt = "/api/quality-goals?limit=200", Ht = {
-var Jt = "/api/quality-goals?limit=200", Yt = {
++var Yt = "/api/quality-goals?limit=200", Xt = {
data: null,
error: ""
- }, Ut = xt(Ht), Wt = 0, Gt = Tt(() => Ut.value);
- Tt(() => Ut.value.data?.total ?? null);
- function Kt() {
- Wt += 1, Ut.value = Ht;
-}, Xt = Ot(Yt), Zt = 0, Qt = Mt(() => Xt.value);
-Mt(() => Xt.value.data?.total ?? null);
-function $t() {
- Zt += 1, Xt.value = Yt;
++}, Zt = kt(Xt), Qt = 0, $t = Nt(() => Zt.value);
++Nt(() => Zt.value.data?.total ?? null);
++function en() {
++ Qt += 1, Zt.value = Xt;
}
- async function qt(e) {
- let t = Wt += 1;
-async function en(e) {
- let t = Zt += 1;
++async function tn(e) {
++ let t = Qt += 1;
try {
- let n = await I(Vt, e);
- return t === Wt && (Ut.value = {
- let n = await I(Jt, e);
- return t === Zt && (Xt.value = {
++ let n = await L(Yt, e);
++ return t === Qt && (Zt.value = {
data: n,
error: ""
}), n;
} catch (n) {
- throw !e?.aborted && t === Wt && (Ut.value = {
- throw !e?.aborted && t === Zt && (Xt.value = {
++ throw !e?.aborted && t === Qt && (Zt.value = {
data: null,
-- error: F(n)
++ error: I(n)
}), n;
}
}
//#endregion
//#region src/islands/quality-goals.tsx
- var Jt = (e, t) => qt(t), Yt = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;
- function Xt({ openItem: e, javTitleHtml: n, javDisplayName: r, srcBadge: a }) {
- let { data: o, error: s } = Gt.value;
-var tn = (e, t) => en(t), nn = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;
-function rn({ openItem: e, javTitleHtml: t, javDisplayName: n, srcBadge: i }) {
- let { data: a, error: s } = Qt.value;
-- if (s) return /* @__PURE__ */ G("div", {
++var nn = (e, t) => tn(t), rn = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;
++function an({ openItem: e, javTitleHtml: t, javDisplayName: n, srcBadge: i }) {
++ let { data: a, error: s } = $t.value;
++ if (s) return /* @__PURE__ */ K("div", {
class: "qualitylist",
- dangerouslySetInnerHTML: { __html: i(s, {
+ dangerouslySetInnerHTML: { __html: o(s, {
variant: "error",
label: "读取失败"
}) }
});
- let c = o?.items ?? [];
- return c.length ? /* @__PURE__ */ G("div", {
+ let c = a?.items ?? [];
- return c.length ? /* @__PURE__ */ G("div", {
++ return c.length ? /* @__PURE__ */ K("div", {
class: "qualitylist",
- children: c.map((t) => /* @__PURE__ */ G("article", {
- children: c.map((r) => /* @__PURE__ */ G("article", {
++ children: c.map((r) => /* @__PURE__ */ K("article", {
class: "qualityitem",
-- children: [/* @__PURE__ */ G("button", {
++ children: [/* @__PURE__ */ K("button", {
class: "qualitycover",
type: "button",
- "aria-label": `打开 ${r(t)}`,
- onClick: () => e(t.id),
- children: /* @__PURE__ */ G("img", {
- src: Yt(t),
+ "aria-label": `打开 ${n(r)}`,
+ onClick: () => e(r.id),
- children: /* @__PURE__ */ G("img", {
- src: nn(r),
++ children: /* @__PURE__ */ K("img", {
++ src: rn(r),
alt: "",
loading: "lazy",
onError: (e) => e.currentTarget.remove()
})
-- }), /* @__PURE__ */ G("div", { children: [
-- /* @__PURE__ */ G("h3", { children: /* @__PURE__ */ G("button", {
++ }), /* @__PURE__ */ K("div", { children: [
++ /* @__PURE__ */ K("h3", { children: /* @__PURE__ */ K("button", {
type: "button",
"data-middle-truncate": !0,
- onClick: () => e(t.id),
- dangerouslySetInnerHTML: { __html: n(t) }
+ onClick: () => e(r.id),
+ dangerouslySetInnerHTML: { __html: t(r) }
}) }),
-- /* @__PURE__ */ G("p", {
++ /* @__PURE__ */ K("p", {
class: "mono",
children: [
-- /* @__PURE__ */ G("span", {
++ /* @__PURE__ */ K("span", {
style: "display:contents",
- dangerouslySetInnerHTML: { __html: a(t.location, t.cost) }
+ dangerouslySetInnerHTML: { __html: i(r.location, r.cost) }
}),
- /* @__PURE__ */ G("span", { children: u[t.location] ?? t.location }),
- /* @__PURE__ */ G("span", { children: f(t.duration) }),
- /* @__PURE__ */ G("span", { children: p(t.size ?? 0) })
- /* @__PURE__ */ G("span", { children: p[r.location] ?? r.location }),
- /* @__PURE__ */ G("span", { children: m(r.duration) }),
- /* @__PURE__ */ G("span", { children: h(r.size ?? 0) })
++ /* @__PURE__ */ K("span", { children: p[r.location] ?? r.location }),
++ /* @__PURE__ */ K("span", { children: h(r.duration) }),
++ /* @__PURE__ */ K("span", { children: g(r.size ?? 0) })
]
}),
- t.reason ? /* @__PURE__ */ G("p", { children: t.reason }) : null
- r.reason ? /* @__PURE__ */ G("p", { children: r.reason }) : null
++ r.reason ? /* @__PURE__ */ K("p", { children: r.reason }) : null
] })]
- }, t.id))
- }) : /* @__PURE__ */ G("div", {
+ }, r.id))
- }) : /* @__PURE__ */ G("div", {
++ }) : /* @__PURE__ */ K("div", {
class: "qualitylist",
- dangerouslySetInnerHTML: { __html: t("sparkles", "没有标记中的高清版目标", "现有版本都已满足条件,或还没有加入追踪。") }
+ dangerouslySetInnerHTML: { __html: r("sparkles", "没有标记中的高清版目标", "现有版本都已满足条件,或还没有加入追踪。") }
+ });
+ }
+ //#endregion
+ //#region src/jobs.ts
-async function an(e) {
++async function on(e) {
+ let t = e.pause || ((e) => new Promise((t) => setTimeout(t, e))), n = 0;
+ for (; e.active();) {
+ let r;
+ try {
+ r = await e.read(AbortSignal.timeout(15e3));
+ } catch (r) {
+ if (!e.active()) return;
+ n++, e.disconnected(r), await t(Math.min(2e3 * 2 ** Math.min(n, 4), 3e4));
+ continue;
+ }
+ if (!e.active() || (n = 0, e.render(r), e.once) || !e.keepWatching && r.status !== "running") return;
+ await t(2e3);
+ }
+ }
-function on(e) {
++function sn(e) {
+ let t = document.createElement("div");
+ e.host.hidden = !0, t.dataset.followJob = "", t.setAttribute("aria-live", "polite"), e.host.prepend(t);
+ let n = e.storageKey || "peach-follow-job", r = sessionStorage.getItem(n) || void 0, i = !1;
- an({
++ on({
+ read: e.read,
+ active: () => !i && e.active() && t.isConnected,
+ keepWatching: e.watchIdle !== !1,
+ render: (a) => {
+ let o = a.status === "running";
+ if (e.host.hidden = !o, e.busy(o), o) {
+ r = a.job_id, r && sessionStorage.setItem(n, r);
+ let i = a.current, o = (i?.attempt || 1) > 1 ? ` · 第 ${i?.attempt}/${i?.max_attempts} 次尝试${i?.retry_in ? `,${i.retry_in} 秒后重试` : ""}` : "", s = (e.title || (a.total ? `${a.older ? "抓取历史" : "检查更新"}:已完成 ${a.checked || 0}/${a.total} 个来源` : "正在准备检查任务…")) + (i ? ` · ${i.label || i.provider || ""}${o}` : ""), c = e.loading(s) + ((a.total || 0) > 0 ? e.progress(a.checked || 0, a.total) : "");
+ t.innerHTML = e.container ? e.container(c) : c;
+ } else if (r && r === a.job_id) r = void 0, i = !0, e.host.hidden = a.status !== "failed", sessionStorage.removeItem(n), t.innerHTML = a.status === "failed" ? e.note(a.error || "检查失败") : "", e.complete(a);
+ else {
+ if (r && a.status === "idle") {
+ e.host.hidden = !1, t.innerHTML = e.note("任务状态已失效,请重新发起任务"), sessionStorage.removeItem(n), i = !0;
+ return;
+ }
+ t.innerHTML = "";
+ }
+ },
+ disconnected: () => {
+ e.host.hidden = !1, t.innerHTML = e.note("暂时无法读取进度,正在重新连接…");
+ }
});
}
//#endregion
//#region src/islands/scraping.tsx
- var Zt = (e, t) => I("/api/scraping", t);
- function Qt({ value: e, onChange: t }) {
-var sn = (e, t) => I("/api/scraping", t);
-function cn({ value: e, onChange: t }) {
-- let n = W(null), r = W(t);
-- return r.current = t, U(() => {
++var cn = (e, t) => L("/api/scraping", t);
++function ln({ value: e, onChange: t }) {
++ let n = G(null), r = G(t);
++ return r.current = t, W(() => {
let t = n.current;
- t.innerHTML = o([
- ["environment", "系统代理"],
- ["direct", "应用直连"],
- ["proxy", "自定义代理"]
- ], e, { label: "连接方式" });
- let i = l(t.firstElementChild), a = () => r.current(i.value);
+ t.innerHTML = c([["peach", "Peach 代理"], ["direct", "直接连接"]], e, { label: "连接方式" });
+ let i = f(t.firstElementChild), a = () => r.current(i.value);
return i.addEventListener("change", a), () => {
i.disabled = !0, i.removeEventListener("change", a), t.replaceChildren();
};
-- }, []), /* @__PURE__ */ G("div", {
++ }, []), /* @__PURE__ */ K("div", {
ref: n,
class: "scraping-network"
});
}
- function $t({ source: e, toast: t }) {
- let [r, a] = V(e), [o, s] = V(e.network), [l, u] = V(""), [f, p] = V(""), [m, h] = V(""), [g, _] = V("paste"), [v, y] = V(""), [b, x] = V(!1), [S, C] = V(""), [w, T] = V([]), E = W(null), D = W(null);
-function ln({ source: e, toast: t }) {
- let [n, r] = V(e), [a, s] = V(e.network), [c, l] = V(""), [d, f] = V(""), [p, m] = V("paste"), [h, g] = V(""), [_, v] = V(!1), [y, b] = V(""), [x, S] = V([]), C = W(null), w = W(null);
-- U(() => {
- D.current?.querySelectorAll("footer button").forEach((e) => c(e, b));
- }, [b]);
- let O = W(new AbortController());
- H(() => () => O.current.abort(), []);
- async function k(n) {
- if (!b) {
- x(!0), C(""), T([]);
- w.current?.querySelectorAll("footer button").forEach((e) => u(e, _));
- }, [_]);
- let T = W(new AbortController());
- H(() => () => T.current.abort(), []);
- async function E(n) {
- if (!_) {
- v(!0), b(""), S([]);
++function un({ source: e, toast: t }) {
++ let [n, r] = H(e), [a, s] = H(e.network), [c, l] = H(""), [d, f] = H(""), [p, h] = H("paste"), [g, _] = H(""), [v, y] = H(!1), [b, x] = H(""), [S, C] = H([]), w = G(null), T = G(null);
++ W(() => {
++ T.current?.querySelectorAll("footer button").forEach((e) => u(e, v));
++ }, [v]);
++ let E = G(new AbortController());
++ U(() => () => E.current.abort(), []);
++ async function D(n) {
++ if (!v) {
++ y(!0), x(""), C([]);
try {
if (n === "check") {
- let t = await L("/api/scraping/check", { source: e.source }, "POST", O.current.signal);
- O.current.signal.aborted || T(t.results);
- let t = await L("/api/scraping/check", { source: e.source }, "POST", T.current.signal);
- T.current.signal.aborted || S(t.results);
++ let t = await R("/api/scraping/check", { source: e.source }, "POST", E.current.signal);
++ E.current.signal.aborted || C(t.results);
} else {
- let r = await L("/api/scraping/settings", {
- let i = await L("/api/scraping/settings", {
++ let i = await R("/api/scraping/settings", {
source: e.source,
- network: o,
- proxy: l,
- cookie: f,
- cookies_text: m,
+ network: a,
+ cookie: c,
+ cookies_text: d,
revoke: n === "revoke"
- }, "POST", O.current.signal);
- O.current.signal.aborted || (a(r.saved), u(""), p(""), h(""), y(""), E.current && (E.current.value = ""), t(n === "revoke" ? "Cookie 已撤销" : "来源设置已保存"));
- }, "POST", T.current.signal);
- T.current.signal.aborted || (r(i.saved), l(""), f(""), g(""), C.current && (C.current.value = ""), t(n === "revoke" ? "Cookie 已撤销" : "来源设置已保存"));
++ }, "POST", E.current.signal);
++ E.current.signal.aborted || (r(i.saved), l(""), f(""), _(""), w.current && (w.current.value = ""), t(n === "revoke" ? "Cookie 已撤销" : "来源设置已保存"));
}
} catch (e) {
- O.current.signal.aborted || C(F(e));
- T.current.signal.aborted || b(F(e));
++ E.current.signal.aborted || x(I(e));
} finally {
- O.current.signal.aborted || x(!1);
- T.current.signal.aborted || v(!1);
++ E.current.signal.aborted || y(!1);
}
}
}
-- return /* @__PURE__ */ G("section", {
++ return /* @__PURE__ */ K("section", {
class: "scraping-source",
-- children: /* @__PURE__ */ G("form", {
- ref: D,
- ref: w,
++ children: /* @__PURE__ */ K("form", {
++ ref: T,
class: "cleanupfieldset",
"data-geist-fieldset": !0,
onSubmit: (e) => {
- e.preventDefault(), k("save");
- e.preventDefault(), E("save");
++ e.preventDefault(), D("save");
},
-- children: [/* @__PURE__ */ G("div", {
++ children: [/* @__PURE__ */ K("div", {
class: "geist-fieldset-content scraping-fields",
children: [
- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: n(`scraping-${e.source}`, e.label) } }),
- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: i(`scraping-${e.source}`, e.label) } }),
-- /* @__PURE__ */ G("a", {
++ /* @__PURE__ */ K("div", { dangerouslySetInnerHTML: { __html: i(`scraping-${e.source}`, e.label) } }),
++ /* @__PURE__ */ K("a", {
class: "scraping-url",
href: e.login,
target: "_blank",
rel: "noopener noreferrer",
- children: e.login
+ children: [
- /* @__PURE__ */ G("img", {
- src: d(e.login),
++ /* @__PURE__ */ K("img", {
++ src: m(e.login),
+ alt: "",
+ width: "16",
+ height: "16",
+ loading: "lazy",
+ onError: (e) => e.currentTarget.remove()
+ }),
- /* @__PURE__ */ G("span", { children: e.login }),
- /* @__PURE__ */ G("svg", {
++ /* @__PURE__ */ K("span", { children: e.login }),
++ /* @__PURE__ */ K("svg", {
+ "aria-hidden": "true",
- children: /* @__PURE__ */ G("use", { href: "#i-external-link" })
++ children: /* @__PURE__ */ K("use", { href: "#i-external-link" })
+ })
+ ]
}),
-- /* @__PURE__ */ G("div", {
++ /* @__PURE__ */ K("div", {
class: "scraping-label",
- children: ["连接方式", /* @__PURE__ */ G(Qt, {
- value: o,
- children: ["连接方式", /* @__PURE__ */ G(cn, {
++ children: ["连接方式", /* @__PURE__ */ K(ln, {
+ value: a,
onChange: s
})]
}),
- o === "proxy" && /* @__PURE__ */ G("label", { children: ["代理地址", /* @__PURE__ */ G("input", {
- class: "geist-input",
- type: "password",
- autoComplete: "off",
- value: l,
- placeholder: r.proxy_saved ? "已保存,留空保留" : "http://127.0.0.1:7890",
- disabled: b,
- onInput: (e) => u(e.currentTarget.value)
- })] }),
- e.accepts_cookie && /* @__PURE__ */ G(N, { children: [
- /* @__PURE__ */ G("p", { children: r.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),
- /* @__PURE__ */ G("div", {
- a === "peach" && /* @__PURE__ */ G("a", {
++ a === "peach" && /* @__PURE__ */ K("a", {
+ href: "/configuration#peachProxy",
+ children: "配置 Peach 代理"
+ }),
- e.accepts_cookie && /* @__PURE__ */ G(N, { children: [
- /* @__PURE__ */ G("p", { children: n.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),
- /* @__PURE__ */ G("div", {
++ e.accepts_cookie && /* @__PURE__ */ K(N, { children: [
++ /* @__PURE__ */ K("p", { children: n.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),
++ /* @__PURE__ */ K("div", {
class: "insightswitch scraping-cookie-method",
role: "radiogroup",
"aria-label": "提供 Cookie 的方式(二选一)",
-- children: [["paste", "粘贴 Cookie"], ["file", "导入文件"]].map(([t, n]) => /* @__PURE__ */ G("label", { children: [/* @__PURE__ */ G("input", {
++ children: [["paste", "粘贴 Cookie"], ["file", "导入文件"]].map(([t, n]) => /* @__PURE__ */ K("label", { children: [/* @__PURE__ */ K("input", {
type: "radio",
name: `cookie-method-${e.source}`,
value: t,
- checked: g === t,
+ checked: p === t,
onChange: () => {
- _(t), p(""), h(""), y("");
- m(t), l(""), f(""), g("");
++ h(t), l(""), f(""), _("");
}
-- }), /* @__PURE__ */ G("span", { children: n })] }, t))
++ }), /* @__PURE__ */ K("span", { children: n })] }, t))
}),
- g === "paste" ? /* @__PURE__ */ G("label", { children: ["Cookie", /* @__PURE__ */ G("input", {
- p === "paste" ? /* @__PURE__ */ G("label", { children: ["Cookie", /* @__PURE__ */ G("input", {
++ p === "paste" ? /* @__PURE__ */ K("label", { children: ["Cookie", /* @__PURE__ */ K("input", {
class: "geist-input",
type: "password",
autoComplete: "off",
- value: f,
- disabled: b,
- onInput: (e) => p(e.currentTarget.value)
- })] }) : /* @__PURE__ */ G("label", {
+ value: c,
- disabled: _,
++ disabled: v,
+ onInput: (e) => l(e.currentTarget.value)
- })] }) : /* @__PURE__ */ G("label", {
++ })] }) : /* @__PURE__ */ K("label", {
class: "scraping-file",
-- children: ["Netscape Cookie 文件(.txt)", /* @__PURE__ */ G("span", {
++ children: ["Netscape Cookie 文件(.txt)", /* @__PURE__ */ K("span", {
class: "scraping-file-control",
children: [
-- /* @__PURE__ */ G("span", {
++ /* @__PURE__ */ K("span", {
class: "geist-button",
children: "选择文件"
}),
-- /* @__PURE__ */ G("span", {
++ /* @__PURE__ */ K("span", {
class: "scraping-file-name",
- children: v || "未选择文件"
- children: h || "未选择文件"
++ children: g || "未选择文件"
}),
-- /* @__PURE__ */ G("input", {
- ref: E,
- ref: C,
++ /* @__PURE__ */ K("input", {
++ ref: w,
type: "file",
accept: ".txt",
- disabled: b,
- disabled: _,
++ disabled: v,
onChange: async (e) => {
let t = e.currentTarget.files?.[0];
if (!t) {
- h(""), y("");
- f(""), g("");
++ f(""), _("");
return;
}
- if (h(""), t.size > 262144) {
- C("Cookie 文本超过 256 KiB"), e.currentTarget.value = "";
+ if (f(""), t.size > 262144) {
- b("Cookie 文本超过 256 KiB"), e.currentTarget.value = "";
++ x("Cookie 文本超过 256 KiB"), e.currentTarget.value = "";
return;
}
- x(!0);
- v(!0);
++ y(!0);
try {
let e = await t.text();
- O.current.signal.aborted || (h(e), y(t.name));
- T.current.signal.aborted || (f(e), g(t.name));
++ E.current.signal.aborted || (f(e), _(t.name));
} catch {
- O.current.signal.aborted || C("Cookie 文件未读取,请重新选择");
- T.current.signal.aborted || b("Cookie 文件未读取,请重新选择");
++ E.current.signal.aborted || x("Cookie 文件未读取,请重新选择");
} finally {
- O.current.signal.aborted || x(!1);
- T.current.signal.aborted || v(!1);
++ E.current.signal.aborted || y(!1);
}
}
})
@@@ -1851,123 -2142,217 +2156,217 @@@
})]
})
] }),
- S && /* @__PURE__ */ G("div", {
- y && /* @__PURE__ */ G("div", {
++ b && /* @__PURE__ */ K("div", {
role: "alert",
- dangerouslySetInnerHTML: { __html: i(S, { variant: "error" }) }
- dangerouslySetInnerHTML: { __html: o(y, { variant: "error" }) }
++ dangerouslySetInnerHTML: { __html: o(b, { variant: "error" }) }
}),
- w.map((t) => /* @__PURE__ */ G("div", {
- x.map((t) => /* @__PURE__ */ G("div", {
++ S.map((t) => /* @__PURE__ */ K("div", {
role: "status",
- dangerouslySetInnerHTML: { __html: i(`${e.label}${t.label === "来源页面" ? "" : " 高清图片"}:${t.ok ? "可连接" : "不能连接"}` + (t.width ? ` · ${t.width} × ${t.height}` : "") + (t.message ? `。${t.message}` : ""), { variant: t.ok ? "success" : "error" }) }
+ dangerouslySetInnerHTML: { __html: o(`${e.label}${t.label === "来源页面" ? "" : " 高清图片"}:${t.ok ? "可连接" : "不能连接"}` + (t.width ? ` · ${t.width} × ${t.height}` : "") + (t.message ? `。${t.message}` : ""), { variant: t.ok ? "success" : "error" }) }
}, t.label))
]
-- }), /* @__PURE__ */ G("footer", {
++ }), /* @__PURE__ */ K("footer", {
class: "geist-fieldset-footer",
"data-geist-fieldset-footer": !0,
children: [
- e.accepts_cookie && r.cookie_saved && /* @__PURE__ */ G("button", {
- /* @__PURE__ */ G("button", {
- class: "geist-button primary",
- type: "submit",
- children: "保存"
- }),
- /* @__PURE__ */ G("button", {
++ e.accepts_cookie && n.cookie_saved && /* @__PURE__ */ K("button", {
class: "geist-button",
type: "button",
- onClick: () => void k("revoke"),
- onClick: () => void E("check"),
- children: "检查连接"
++ onClick: () => void D("revoke"),
+ children: "撤销 Cookie"
}),
- /* @__PURE__ */ G("button", {
- e.accepts_cookie && n.cookie_saved && /* @__PURE__ */ G("button", {
++ /* @__PURE__ */ K("button", {
class: "geist-button",
type: "button",
- onClick: () => void k("check"),
- onClick: () => void E("revoke"),
- children: "撤销 Cookie"
++ onClick: () => void D("check"),
+ children: "检查连接"
+ }),
- /* @__PURE__ */ G("button", {
++ /* @__PURE__ */ K("button", {
+ class: "geist-button primary",
+ type: "submit",
+ children: "保存"
})
]
})]
})
});
}
- function en({ data: e, error: t, toast: r }) {
- let [a, o] = V(""), [s, l] = V(!1), [u, d] = V(""), f = W(null);
- U(() => c(f.current, s), [s]);
-function un({ data: e, error: t, toast: n }) {
- let [r, a] = V(""), [s, c] = V(!1), [l, d] = V(""), f = W(null);
- U(() => u(f.current, s), [s]);
-- let p = W(new AbortController()), m = W(0);
++function dn({ data: e, error: t, toast: n }) {
++ let [r, a] = H(""), [s, c] = H(!1), [l, d] = H(""), f = G(null);
++ W(() => u(f.current, s), [s]);
++ let p = G(new AbortController()), m = G(0);
async function h(e = !1) {
let t = ++m.current;
- await Xe({
- await an({
-- read: (e) => I("/api/scraping/cover", e),
++ await on({
++ read: (e) => L("/api/scraping/cover", e),
active: () => !p.current.signal.aborted && t === m.current,
render: (t) => {
- l(t.status === "running"), t.status === "running" && (e = !1), t.status === "failed" && !e && d(t.error || "采集未取得"), t.status === "complete" && !e && r(t.result || "封面采集完成");
+ c(t.status === "running"), t.status === "running" && (e = !1), t.status === "failed" && !e && d(t.error || "采集未取得"), t.status === "complete" && !e && n(t.result || "封面采集完成");
},
disconnected: () => d("连接中断,正在重新读取后台进度")
});
}
-- H(() => (h(!0), () => p.current.abort()), []);
++ U(() => (h(!0), () => p.current.abort()), []);
async function g() {
if (!s) {
- m.current++, l(!0), d("");
+ m.current++, c(!0), d("");
try {
- await L("/api/scraping/cover", { code: a }, "POST", p.current.signal), await h();
- await L("/api/scraping/cover", { code: r }, "POST", p.current.signal), await h();
++ await R("/api/scraping/cover", { code: r }, "POST", p.current.signal), await h();
} catch (e) {
- p.current.signal.aborted || (l(!1), d(F(e)));
- p.current.signal.aborted || (c(!1), d(F(e)));
++ p.current.signal.aborted || (c(!1), d(I(e)));
}
}
}
-- return t ? /* @__PURE__ */ G("div", {
++ return t ? /* @__PURE__ */ K("div", {
role: "alert",
- dangerouslySetInnerHTML: { __html: i(t, { variant: "error" }) }
- }) : /* @__PURE__ */ G("div", {
+ dangerouslySetInnerHTML: { __html: o(t, { variant: "error" }) }
- }) : /* @__PURE__ */ G("div", {
++ }) : /* @__PURE__ */ K("div", {
class: "scraping-page",
children: [
-- /* @__PURE__ */ G("p", { children: "高清图片可能需要代理才能下载,请先检查连接。" }),
-- /* @__PURE__ */ G("section", {
++ /* @__PURE__ */ K("p", { children: "高清图片可能需要代理才能下载,请先检查连接。" }),
++ /* @__PURE__ */ K("section", {
class: "cleanupfieldset scraping-source",
"data-geist-fieldset": !0,
-- children: /* @__PURE__ */ G("div", {
++ children: /* @__PURE__ */ K("div", {
class: "geist-fieldset-content scraping-fields",
children: [
- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: n("scraping-cover", "高清封面") } }),
- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: i("scraping-cover", "高清封面") } }),
-- /* @__PURE__ */ G("form", {
++ /* @__PURE__ */ K("div", { dangerouslySetInnerHTML: { __html: i("scraping-cover", "高清封面") } }),
++ /* @__PURE__ */ K("form", {
class: "scraping-cover-form",
onSubmit: (e) => {
e.preventDefault(), g();
},
-- children: [/* @__PURE__ */ G("input", {
++ children: [/* @__PURE__ */ K("input", {
class: "geist-input",
"aria-label": "馆藏番号",
required: !0,
- value: a,
+ value: r,
disabled: s,
placeholder: "输入馆藏番号,如 ABW-232",
- onInput: (e) => o(e.currentTarget.value)
- }), /* @__PURE__ */ G("button", {
+ onInput: (e) => a(e.currentTarget.value)
- }), /* @__PURE__ */ G("button", {
++ }), /* @__PURE__ */ K("button", {
ref: f,
class: "geist-button primary",
type: "submit",
children: "抓取封面"
})]
}),
- u && /* @__PURE__ */ G("div", {
- l && /* @__PURE__ */ G("div", {
++ l && /* @__PURE__ */ K("div", {
role: "alert",
- dangerouslySetInnerHTML: { __html: i(u, { variant: "error" }) }
+ dangerouslySetInnerHTML: { __html: o(l, { variant: "error" }) }
})
]
})
}),
- e?.sources.map((e) => /* @__PURE__ */ G($t, {
- e?.sources.map((e) => /* @__PURE__ */ G(ln, {
++ e?.sources.map((e) => /* @__PURE__ */ K(un, {
source: e,
- toast: r
+ toast: n
}, e.source))
]
});
}
//#endregion
+ //#region src/islands/library-processing.tsx
-var dn = (e, t) => I("/api/library-processing", t);
-function fn({ data: e, error: t, toast: n, onComplete: r, mode: c, monitor: l }) {
- let [d, f] = V(e || { status: "idle" }), [p, m] = V(t), [h, g] = V(!1), [_, v] = V(!1), y = W(new AbortController()), b = W(0), x = W(d.status), S = W(null), C = h || d.status === "running";
- U(() => u(S.current, C), [C]);
++var fn = (e, t) => L("/api/library-processing", t);
++function pn({ data: e, error: t, toast: n, onComplete: r, mode: c, monitor: l }) {
++ let [d, f] = H(e || { status: "idle" }), [p, m] = H(t), [h, g] = H(!1), [_, v] = H(!1), y = G(new AbortController()), b = G(0), x = G(d.status), S = G(null), C = h || d.status === "running";
++ W(() => u(S.current, C), [C]);
+ async function w() {
+ let e = ++b.current;
- await an({
- read: (e) => I("/api/library-processing", e),
++ await on({
++ read: (e) => L("/api/library-processing", e),
+ active: () => !y.current.signal.aborted && b.current === e,
+ keepWatching: c === "notice" || !!l,
+ render: (e) => {
+ f(e), m(""), e.status === "complete" && x.current === "running" && c !== "notice" && (v(!0), n("已完成扫描与资料采集")), x.current === "running" && (e.status === "complete" || e.status === "failed") && r?.(), x.current = e.status;
+ },
+ disconnected: () => m("连接中断,正在重新读取处理进度")
+ });
+ }
- H(() => ((d.status === "running" || c === "notice" || l) && w(), () => y.current.abort()), []);
++ U(() => ((d.status === "running" || c === "notice" || l) && w(), () => y.current.abort()), []);
+ async function T() {
+ if (!C) {
+ g(!0), m(""), v(!1);
+ try {
- let e = await L("/api/library-processing", {}, "POST", y.current.signal);
++ let e = await R("/api/library-processing", {}, "POST", y.current.signal);
+ if (y.current.signal.aborted) return;
+ x.current = e.status, f(e), g(!1), await w();
+ } catch (e) {
- y.current.signal.aborted || (m(F(e)), g(!1));
++ y.current.signal.aborted || (m(I(e)), g(!1));
+ }
+ }
+ }
- return c === "notice" ? !p && d.status !== "running" && d.status !== "failed" ? null : /* @__PURE__ */ G("div", {
++ return c === "notice" ? !p && d.status !== "running" && d.status !== "failed" ? null : /* @__PURE__ */ K("div", {
+ class: "library-processing-banner",
+ role: "status",
- children: [/* @__PURE__ */ G("span", { children: p || (d.status === "failed" ? "扫描与资料采集未完成" : `${d.stage || "正在整理馆藏"}${d.total ? ` · ${d.checked || 0} / ${d.total}` : ""}`) }), /* @__PURE__ */ G("a", {
++ children: [/* @__PURE__ */ K("span", { children: p || (d.status === "failed" ? "扫描与资料采集未完成" : `${d.stage || "正在整理馆藏"}${d.total ? ` · ${d.checked || 0} / ${d.total}` : ""}`) }), /* @__PURE__ */ K("a", {
+ class: "geist-button",
+ href: "/data-cleanup#libraryProcessing",
+ children: p || d.status === "failed" ? "查看并处理" : "查看进度"
+ })]
- }) : /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("div", {
++ }) : /* @__PURE__ */ K(N, { children: [/* @__PURE__ */ K("div", {
+ class: "geist-fieldset-content library-processing",
+ children: [
- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: i("cleanupScrapingTitle", "扫描与采集") } }),
- /* @__PURE__ */ G("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),
- /* @__PURE__ */ G("div", {
++ /* @__PURE__ */ K("div", { dangerouslySetInnerHTML: { __html: i("cleanupScrapingTitle", "扫描与采集") } }),
++ /* @__PURE__ */ K("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),
++ /* @__PURE__ */ K("div", {
+ "aria-live": "polite",
+ children: [
- d.status === "running" && /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: a(`${d.stage || "正在处理"}${d.total ? ` · ${d.checked || 0} / ${d.total}` : ""}`) } }), !!d.total && /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: s(`已处理 ${d.checked || 0} / ${d.total} 个视频`, d.checked || 0, d.total) } })] }),
- (p || d.status === "failed") && /* @__PURE__ */ G("div", {
++ d.status === "running" && /* @__PURE__ */ K(N, { children: [/* @__PURE__ */ K("div", { dangerouslySetInnerHTML: { __html: a(`${d.stage || "正在处理"}${d.total ? ` · ${d.checked || 0} / ${d.total}` : ""}`) } }), !!d.total && /* @__PURE__ */ K("div", { dangerouslySetInnerHTML: { __html: s(`已处理 ${d.checked || 0} / ${d.total} 个视频`, d.checked || 0, d.total) } })] }),
++ (p || d.status === "failed") && /* @__PURE__ */ K("div", {
+ role: "alert",
+ dangerouslySetInnerHTML: { __html: o(p || d.error || "处理未完成,请重试", { variant: "error" }) }
+ }),
- d.status === "failed" && !!d.issues?.length && /* @__PURE__ */ G("ul", { children: d.issues.slice(0, 20).map((e) => /* @__PURE__ */ G("li", { children: [
- e.asset_id ? /* @__PURE__ */ G("a", {
++ d.status === "failed" && !!d.issues?.length && /* @__PURE__ */ K("ul", { children: d.issues.slice(0, 20).map((e) => /* @__PURE__ */ K("li", { children: [
++ e.asset_id ? /* @__PURE__ */ K("a", {
+ href: `/item/${e.asset_id}`,
+ children: "查看视频"
+ }) : null,
+ e.asset_id ? ":" : "",
+ e.message
+ ] })) }),
- _ && /* @__PURE__ */ G("div", {
++ _ && /* @__PURE__ */ K("div", {
+ class: "library-processing-result",
+ dangerouslySetInnerHTML: { __html: o(`已扫描 ${d.scanned || 0} 个文件,识别 ${d.identified || 0} 个番号,整理 ${d.candidates || 0} 组资料候选。`, {
+ variant: "success",
+ label: "处理完成"
+ }) }
+ })
+ ]
+ })
+ ]
- }), /* @__PURE__ */ G("footer", {
++ }), /* @__PURE__ */ K("footer", {
+ class: "geist-fieldset-footer",
+ "data-geist-fieldset-footer": !0,
+ children: [
- /* @__PURE__ */ G("a", {
++ /* @__PURE__ */ K("a", {
+ class: "geist-button",
+ href: "/scraping",
+ children: "采集来源"
+ }),
- !!d.candidates && /* @__PURE__ */ G("a", {
++ !!d.candidates && /* @__PURE__ */ K("a", {
+ class: "geist-button",
+ href: "/review",
+ children: "复核资料"
+ }),
- /* @__PURE__ */ G("button", {
++ /* @__PURE__ */ K("button", {
+ ref: S,
+ type: "button",
+ class: "geist-button primary",
+ onClick: () => void T(),
+ children: d.status === "failed" ? "重试未完成项" : "扫描并补全资料"
+ })
+ ]
+ })] });
+ }
+ //#endregion
//#region src/state/index.ts
- var tn = { "quality-goals": {
- refresh: qt,
- reset: Kt
- } }, nn = () => Object.keys(tn);
- async function rn(e) {
- let t = tn[e];
-var pn = { "quality-goals": {
- refresh: en,
- reset: $t
-} }, mn = () => Object.keys(pn);
-async function hn(e) {
- let t = pn[e];
++var mn = { "quality-goals": {
++ refresh: tn,
++ reset: en
++} }, hn = () => Object.keys(mn);
++async function gn(e) {
++ let t = mn[e];
if (!t) throw Error(`未登记的共享 store:${String(e)}`);
try {
return await t.refresh(), !0;
@@@ -1976,11 -2361,154 +2375,154 @@@
}
}
//#endregion
+ //#region src/review-bulk.ts
-var gn = () => ({
++var _n = () => ({
+ active: !1,
+ busy: !1,
+ selected: /* @__PURE__ */ new Set(),
+ choices: /* @__PURE__ */ new Map(),
+ assets: /* @__PURE__ */ new Map(),
+ errors: /* @__PURE__ */ new Map()
+ });
-async function _n(e, t, n, r) {
++async function vn(e, t, n, r) {
+ let i = [], a = 0;
+ for (let o of e) {
+ if (!r()) break;
+ try {
+ let e = await t(o.payload);
+ if (!e.ok) throw Error(e.error || "服务端未采用该项");
+ a++, n(o.key);
+ } catch (e) {
+ i.push({
+ key: o.key,
- message: F(e)
++ message: I(e)
+ });
+ }
+ }
+ return {
+ completed: a,
+ failures: i
+ };
+ }
-function vn(e, n) {
++function yn(e, n) {
+ let r = e.querySelector(".reviewlist");
+ if (!r || !n.rows.length || n.locked) return;
+ let i = n.state, a = [...r.querySelectorAll("[data-review-key]")], o = document.createElement("div");
+ o.className = "reviewbulkbar";
+ let s = document.createElement("button");
+ s.className = "geist-button", s.type = "button", o.append(s), r.before(o);
+ let c = n.metadata ? [{
+ title: "单一候选",
+ cards: a.filter((e) => (n.rows.find((t) => t.item_key === e.dataset.reviewKey)?.candidates?.length || 0) === 1)
+ }, {
+ title: "需选择来源",
+ cards: a.filter((e) => (n.rows.find((t) => t.item_key === e.dataset.reviewKey)?.candidates?.length || 0) !== 1)
+ }] : [{
+ title: "待复核",
+ cards: a
+ }];
+ r.classList.add("reviewgroups");
+ let l = (e) => !e.querySelector("[data-review-status=\"approved\"]")?.disabled, d = [];
+ for (let a of c.filter((e) => e.cards.length)) {
+ let o = document.createElement("section");
+ o.className = "reviewgroup";
+ let s = document.createElement("div");
+ s.className = "reviewbulkbar";
+ let c = document.createElement("h3");
+ c.textContent = `${a.title} · ${a.cards.length}`;
+ let p = document.createElement("button");
+ p.className = "geist-button", p.type = "button";
+ let m = document.createElement("button");
+ m.className = "geist-button", m.type = "button";
+ let h = document.createElement("p");
+ h.className = "reviewstate", h.setAttribute("role", "status");
+ let g = document.createElement("div");
+ g.className = "reviewlist", s.append(c, p, m), o.append(s, h, g), r.append(o);
+ for (let e of a.cards) {
+ g.append(e);
+ let n = e.dataset.reviewKey, r = l(e);
+ i.errors.has(n) && (e.querySelector(".reviewstate").textContent = i.errors.get(n));
+ let a = document.createElement("label");
+ a.className = "reviewpickitem", a.innerHTML = t("aria-label=\"选择此复核项\"") + "<span>选择此项</span>";
+ let o = a.querySelector("input");
+ if (e.prepend(a), i.assets.has(n)) {
+ let t = i.assets.get(n), r = [...e.querySelectorAll("[data-review-asset]")];
+ r.forEach((e) => {
+ let n = t.includes(Number(e.dataset.reviewAsset));
+ e.setAttribute("aria-pressed", String(n)), e.classList.toggle("picked", n);
+ });
+ let a = e.querySelector("[data-picked-count]");
+ a && (a.textContent = `已选 ${t.length} / ${r.length}`);
+ }
+ e.addEventListener("click", (t) => {
+ t.target.closest("[data-review-asset],[data-pick-all],[data-pick-none]") && i.assets.set(n, [...e.querySelectorAll("[data-review-asset][aria-pressed=\"true\"]")].map((e) => Number(e.dataset.reviewAsset)));
+ });
+ for (let t of e.querySelectorAll("input[type=\"radio\"]")) i.choices.has(n) && (t.checked = i.choices.get(n) === t.value), t.addEventListener("change", () => {
+ t.checked && i.choices.set(n, t.value);
+ });
+ o.onchange = () => {
+ o.checked ? i.selected.add(n) : i.selected.delete(n), f();
+ }, d.push(() => {
+ a.hidden = !i.active, o.checked = i.selected.has(n), o.disabled = !r;
+ });
+ }
+ let _ = () => a.cards.filter((e) => i.selected.has(e.dataset.reviewKey) && l(e));
+ d.push(() => {
+ p.hidden = m.hidden = !i.active, p.textContent = _().length && _().length === a.cards.filter(l).length ? "清空本组" : "全选本组", m.textContent = `采用所选${_().length ? `(${_().length})` : ""}`, m.disabled = !_().length, p.disabled = !a.cards.some(l);
+ }), p.onclick = () => {
+ if (i.busy) return;
+ let e = a.cards.filter(l), t = _().length === e.length;
+ e.forEach((e) => t ? i.selected.delete(e.dataset.reviewKey) : i.selected.add(e.dataset.reviewKey)), f();
+ }, m.onclick = async () => {
+ if (i.busy || !_().length) return;
+ let t = _().map((e) => ({
+ key: e.dataset.reviewKey,
+ payload: n.payload(e)
+ }));
+ if (n.metadata && t.some((e) => !e.payload.candidate_key)) {
+ h.textContent = "请先为所选的多来源候选选择来源。", _().find((e) => !e.querySelector("input[type=\"radio\"]:checked"))?.querySelector("input[type=\"radio\"]")?.focus();
+ return;
+ }
+ i.busy = !0, h.textContent = `正在采用 0 / ${t.length}`, f(), u(m, !0);
+ let r = [...e.querySelectorAll("button,input")], a = r.map((e) => e.getAttribute("aria-disabled"));
+ r.forEach((e) => {
+ e.setAttribute("aria-disabled", "true");
+ });
+ let o = (e) => {
+ e instanceof KeyboardEvent && e.key === "Tab" || (e.preventDefault(), e.stopImmediatePropagation());
+ };
+ e.addEventListener("click", o, !0), e.addEventListener("keydown", o, !0);
- let s = 0, c = await _n(t, async (e) => {
++ let s = 0, c = await vn(t, async (e) => {
+ try {
+ return await n.submit(e);
+ } finally {
+ s++, n.active() && (h.textContent = `正在采用 ${s} / ${t.length}`);
+ }
+ }, (e) => {
+ i.selected.delete(e), i.errors.delete(e), n.applied(e);
+ }, n.active);
+ if (i.busy = !1, e.removeEventListener("click", o, !0), e.removeEventListener("keydown", o, !0), r.forEach((e, t) => {
+ let n = a[t];
+ n === null ? e.removeAttribute("aria-disabled") : e.setAttribute("aria-disabled", n);
+ }), u(m, !1), !n.active()) return;
+ n.notify(`已采用 ${c.completed} 项${c.failures.length ? `,${c.failures.length} 项未完成` : ""}`), c.failures.forEach((e) => i.errors.set(e.key, e.message));
+ let l = e.parentElement;
+ n.refresh(), l?.querySelector(".reviewbulkbar button")?.focus({ preventScroll: !0 });
+ };
+ }
+ function f() {
+ s.textContent = i.active ? "退出多选" : "多选", s.setAttribute("aria-pressed", String(i.active)), d.forEach((e) => e());
+ }
+ s.onclick = () => {
+ i.busy || (i.active = !i.active, i.active || i.selected.clear(), f());
+ }, f();
+ }
+ //#endregion
//#region src/native-image.ts
- function an(e, t, n, r) {
-function yn(e, t, n, r) {
++function bn(e, t, n, r) {
return e > 0 && t > 0 && e === n && t === r;
}
- function on(e, t, n, r, i = 1) {
-function bn(e, t, n, r, i = 1) {
++function xn(e, t, n, r, i = 1) {
let a = Number.isFinite(i) && i > 0 ? i : 1;
e /= a, t /= a;
let o = [
@@@ -1997,7 -2525,7 +2539,7 @@@
}
//#endregion
//#region src/entity-skeleton.ts
- function sn(e, t) {
-function xn(e, t) {
++function Sn(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>
@@@ -2009,7 -2537,7 +2551,7 @@@
}
//#endregion
//#region src/catalog-onboarding.ts
- var cn = [
-var Sn = [
++var Cn = [
"loc",
"creator",
"performer",
@@@ -2026,7 -2554,7 +2568,7 @@@
"jav",
"thumb"
];
- function ln() {
-function Cn() {
++function wn() {
let e = (e) => [
,
,
@@@ -2037,9 -2565,9 +2579,9 @@@
tags: "<span class=\"catalog-placeholder placeholder-tags\" aria-hidden=\"true\">" + e("<span class=\"pill\">&nbsp;</span>") + "</span>"
};
}
- async function un(e, t) {
-async function wn(e, t) {
++async function Tn(e, t) {
let n = new URLSearchParams();
- for (let t of cn) e[t] && n.set(t, e[t]);
- for (let t of Sn) e[t] && n.set(t, e[t]);
++ for (let t of Cn) 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 || [],
@@@ -2050,9 -2578,9 +2592,9 @@@
return r.set("q", e), r.set("limit", "1"), (await t("/api/items?" + r)).total > 0 ? e : "";
}))).filter(Boolean);
}
- function dn({ kind: e = "catalog", filtered: n = !1, jav: r = !1, configurable: i = !1, online: a = !1 } = {}) {
-function Tn({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable: i = !1, online: a = !1 } = {}) {
++function En({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable: i = !1, online: a = !1 } = {}) {
let o = i ? "<a class=\"geist-button primary\" href=\"/configuration\">添加内容</a>" : "", s = "<a class=\"geist-button\" href=\"/follow-manage\">添加来源</a>";
- return n || r ? t("search", r ? "还没有符合条件的 JAV 作品" : "没有符合条件的内容", r ? "已扫描但尚未补充发行资料的视频可在全部内容中查看。" : "清除筛选或搜索条件后查看全部内容。", { actions: "<a class=\"geist-button primary\" href=\"/?loc=&thumb=0\">查看全部内容</a>" }) : e === "catalog" ? t("play", "还没有视频", "添加媒体文件夹或关注来源,开始建立你的馆藏。", { actions: o + s }) : t(e === "tags" ? "tags" : "user-round", "还没有" + ({
+ return t || n ? r("search", n ? "还没有符合条件的 JAV 作品" : "没有符合条件的内容", n ? "已扫描但尚未补充发行资料的视频可在全部内容中查看。" : "清除筛选或搜索条件后查看全部内容。", { actions: "<a class=\"geist-button primary\" href=\"/?loc=&thumb=0\">查看全部内容</a>" }) : e === "catalog" ? r("play", "还没有视频", "添加媒体文件夹或关注来源,开始建立你的馆藏。", { actions: o + s }) : r(e === "tags" ? "tags" : "user-round", "还没有" + ({
tags: "标签",
performers: "艺人",
creators: "创作者",
@@@ -2063,7 -2591,7 +2605,7 @@@
}
//#endregion
//#region src/sidebar.ts
- function fn(e) {
-function En(e) {
++function Dn(e) {
return [
"/",
"/unseen",
@@@ -2073,23 -2601,23 +2615,23 @@@
"/junk-files"
].includes(e) || /^\/(item|mix|parts|editions)\//.test(e) || /^\/playlists\/\d+\/\d+$/.test(e) || /^\/(performers|studios|creators|series|agencies)\/.+/.test(e);
}
- function pn(e, t) {
-function Dn(e, t) {
++function On(e, t) {
return e.dataset.surface === t && e.querySelector(".dnav") ? !1 : (e.dataset.surface = t, e.replaceChildren(), !0);
}
- function mn(e) {
-function On(e) {
++function kn(e) {
let t = /* @__PURE__ */ new Map();
for (let n of e) for (let e of new Set(n.tags || [])) t.set(e, (t.get(e) || 0) + 1);
return [...t].sort((e, t) => t[1] - e[1]).slice(0, 30);
}
//#endregion
//#region src/management.ts
- function hn(e) {
-function kn(e) {
++function An(e) {
return e.filter((e) => ["115", "pikpak"].includes(e.location) && (e.roots === void 0 || e.roots.length > 0)).map((e) => e.location);
}
- function gn(e, t) {
-function An(e, t) {
++function jn(e, t) {
return t.filter((t) => e.some((e) => e.location === t));
}
- function _n() {
-function jn() {
++function Mn() {
return `<div class="cleanuppage" data-skeleton="cleanup" aria-busy="true" aria-label="正在读取数据管理状态">
<div class="cleanupgrid">${[
[
@@@ -2135,7 -2663,7 +2677,7 @@@
<footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button"${r === 3 ? " class=\"danger\"" : ""} disabled>${r === 3 ? "<svg aria-hidden=\"true\"><use href=\"#i-trash\"></use></svg><span>" + t + "</span>" : t}</button></footer>
</section>`).join("")}</div></div>`;
}
- function vn(e, t = !1, n = !1) {
-function Mn(e, t = !1, n = !1) {
++function Nn(e, t = !1, n = !1) {
if (t || n) return "";
let r = "<svg aria-hidden=\"true\"><use href=\"#i-external-link\"></use></svg>";
return `<details class="taste-history-guide"${e ? " open" : ""}>
@@@ -2149,69 -2677,69 +2691,69 @@@
<button type="button" class="geist-button taste-guide-skip">跳过</button>
</div></details>`;
}
- var yn = "peach-taste-guide-dismissed";
- function bn(e, t) {
-var Nn = "peach-taste-guide-dismissed";
-function Pn(e, t) {
++var Pn = "peach-taste-guide-dismissed";
++function Fn(e, t) {
let n = e.querySelector(".taste-history-guide");
n?.querySelector(".taste-guide-skip")?.addEventListener("click", () => {
- t.setItem(yn, "1"), n.remove();
- t.setItem(Nn, "1"), n.remove();
++ t.setItem(Pn, "1"), n.remove();
});
}
//#endregion
//#region src/jav-artwork.ts
- function xn(e) {
-function Fn(e) {
++function In(e) {
return [
"small",
"sleeve",
"preview"
].includes(String(e)) ? "small" : "big";
}
- function Sn(e) {
-function In(e) {
++function Ln(e) {
return {
- javLayout: xn(e.javLayout),
- javImage: Cn(e.javLayout === "preview" ? "thumbnail" : e.javImage)
- javLayout: Fn(e.javLayout),
- javImage: Ln(e.javLayout === "preview" ? "thumbnail" : e.javImage)
++ javLayout: In(e.javLayout),
++ javImage: Rn(e.javLayout === "preview" ? "thumbnail" : e.javImage)
};
}
- function Cn(e) {
-function Ln(e) {
++function Rn(e) {
return e === "thumbnail" ? "thumbnail" : "cover";
}
- function wn(e, t) {
- return e.is_jav && e.code && e.has_cover && (Cn(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";
-function Rn(e, t) {
- return e.is_jav && e.code && e.has_cover && (Ln(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";
-}
+ function zn(e, t) {
++ return e.is_jav && e.code && e.has_cover && (Rn(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";
+}
- function Tn(e, t) {
++function Bn(e, t) {
e.querySelectorAll("img[data-jav-image]").forEach((e) => {
- let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (Cn(t) === "cover" || !r)), a = i ? n : r;
- let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (Ln(t) === "cover" || !r)), a = i ? n : r;
++ let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (Rn(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 En = {
-var Bn = {
++var Vn = {
"library-processing": {
- load: Qe,
- component: $e
- load: dn,
- component: fn
++ load: fn,
++ component: pn
},
scraping: {
- load: Zt,
- component: en
- load: sn,
- component: un
++ load: cn,
++ component: dn
},
"quality-goals": {
- load: Jt,
- component: Xt
- load: tn,
- component: rn
++ load: nn,
++ component: an
},
configuration: {
- load: rt,
- component: lt
+ load: ut,
+ component: gt
}
- }, Dn = () => Object.keys(En), On = /* @__PURE__ */ new Map();
- async function kn(e, t, n, r = {}) {
- let i = En[e];
-}, Vn = () => Object.keys(Bn), Hn = /* @__PURE__ */ new Map();
-async function Un(e, t, n, r = {}) {
- let i = Bn[e];
++}, Hn = () => Object.keys(Vn), Un = /* @__PURE__ */ new Map();
++async function Wn(e, t, n, r = {}) {
++ let i = Vn[e];
if (!i) throw Error(`未注册的 island:${String(e)}`);
- An(t);
- Wn(t);
++ Gn(t);
let a = {
controller: new AbortController(),
painted: !1
};
- On.set(t, a);
- Hn.set(t, a);
++ Un.set(t, a);
let o;
try {
o = {
@@@ -2222,12 -2750,12 +2764,12 @@@
if (a.controller.signal.aborted) return;
o = {
data: null,
-- error: F(e)
++ error: I(e)
};
}
- if (On.get(t) !== a) return;
- if (Hn.get(t) !== a) return;
++ if (Un.get(t) !== a) return;
if (r.isCurrent && !r.isCurrent()) {
- On.delete(t);
- Hn.delete(t);
++ Un.delete(t);
return;
}
t.textContent = "", a.painted = !0;
@@@ -2235,11 -2763,11 +2777,11 @@@
...n,
...o
};
- we(ne(i.component, s), t);
- De(ae(i.component, s), t);
++ De(oe(i.component, s), t);
}
- function An(e) {
- let t = On.get(e);
- t && (t.controller.abort(), On.delete(e), t.painted && we(null, e));
-function Wn(e) {
- let t = Hn.get(e);
- t && (t.controller.abort(), Hn.delete(e), t.painted && De(null, e));
++function Gn(e) {
++ let t = Un.get(e);
++ t && (t.controller.abort(), Un.delete(e), t.painted && De(null, e));
}
//#endregion
- export { yn as TASTE_GUIDE_KEY, dn as catalogEmptyHtml, un as catalogSuggestions, _n as cleanupSkeletonHtml, hn as cloudLocations, gn as cloudPreferenceLocations, ln as emptyCatalogLayout, sn as entitySkeletonHtml, Ze as followJobProgress, Dn as islandNames, wn as javImageKind, an as matchesFaceSource, kn as mountIsland, on as nativeImageFit, Cn as normalizeJavImage, xn as normalizeJavLayout, Sn as normalizeJavPreferences, rn as refreshStore, fn as sidebarHasCatalogContent, mn as sidebarTagCounts, nn as storeNames, Tn as syncJavImages, pn as syncSidebarSurface, vn as tasteHistoryGuideHtml, An as unmountIsland, Xe as watchJob, bn as wireTasteHistoryGuide };
-export { Nn as TASTE_GUIDE_KEY, Tn as catalogEmptyHtml, wn as catalogSuggestions, jn as cleanupSkeletonHtml, kn as cloudLocations, An as cloudPreferenceLocations, gn as createReviewSelection, Cn as emptyCatalogLayout, xn as entitySkeletonHtml, on as followJobProgress, Vn as islandNames, Rn as javImageKind, yn as matchesFaceSource, Un as mountIsland, bn as nativeImageFit, Ln as normalizeJavImage, Fn as normalizeJavLayout, In as normalizeJavPreferences, Oe as preferredDirection, hn as refreshStore, En as sidebarHasCatalogContent, On as sidebarTagCounts, mn as storeNames, zn as syncJavImages, Dn as syncSidebarSurface, Mn as tasteHistoryGuideHtml, Wn as unmountIsland, an as watchJob, vn as wireReviewSelection, Pn as wireTasteHistoryGuide };
++export { Pn as TASTE_GUIDE_KEY, En as catalogEmptyHtml, Tn as catalogSuggestions, Mn as cleanupSkeletonHtml, An as cloudLocations, jn as cloudPreferenceLocations, _n as createReviewSelection, wn as emptyCatalogLayout, Sn as entitySkeletonHtml, sn as followJobProgress, Hn as islandNames, zn as javImageKind, bn as matchesFaceSource, Wn as mountIsland, xn as nativeImageFit, Rn as normalizeJavImage, In as normalizeJavLayout, Ln as normalizeJavPreferences, Oe as preferredDirection, gn as refreshStore, Dn as sidebarHasCatalogContent, kn as sidebarTagCounts, hn as storeNames, Bn as syncJavImages, On as syncSidebarSurface, Nn as tasteHistoryGuideHtml, Gn as unmountIsland, on as watchJob, yn as wireReviewSelection, Fn as wireTasteHistoryGuide };