@eternalheart/vue-file-preview 1.3.13 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/FilePreviewContent.vue.d.ts +3 -0
- package/lib/FilePreviewContent.vue.d.ts.map +1 -1
- package/lib/FilePreviewEmbed.vue.d.ts +5 -0
- package/lib/FilePreviewEmbed.vue.d.ts.map +1 -1
- package/lib/FilePreviewModal.vue.d.ts.map +1 -1
- package/lib/chunks/{RendererError.vue_vue_type_script_setup_true_lang-CbgZBSDr.mjs → RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs} +9 -9
- package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs.map +1 -0
- package/lib/chunks/index-8ETACZ6T.mjs +267 -0
- package/lib/chunks/index-8ETACZ6T.mjs.map +1 -0
- package/lib/chunks/{index-DyipSoKh.mjs → index-B-LW-GJO.mjs} +24 -21
- package/lib/chunks/index-B-LW-GJO.mjs.map +1 -0
- package/lib/chunks/{index-Cjnw238n.mjs → index-BT9hXA6r.mjs} +3 -3
- package/lib/chunks/{index-Cjnw238n.mjs.map → index-BT9hXA6r.mjs.map} +1 -1
- package/lib/chunks/{index-CyrFxdIJ.mjs → index-BcKI75RW.mjs} +4 -4
- package/lib/chunks/{index-CyrFxdIJ.mjs.map → index-BcKI75RW.mjs.map} +1 -1
- package/lib/chunks/{index-Ctd0JQ6K.mjs → index-By6vGdnK.mjs} +3 -3
- package/lib/chunks/{index-Ctd0JQ6K.mjs.map → index-By6vGdnK.mjs.map} +1 -1
- package/lib/chunks/{index-BHi1WRQZ.mjs → index-C-Mu0fvH.mjs} +3 -3
- package/lib/chunks/{index-BHi1WRQZ.mjs.map → index-C-Mu0fvH.mjs.map} +1 -1
- package/lib/chunks/{index-DT9dPz8I.mjs → index-CGSq7-Q-.mjs} +3 -3
- package/lib/chunks/{index-DT9dPz8I.mjs.map → index-CGSq7-Q-.mjs.map} +1 -1
- package/lib/chunks/{index-DTtHrdBl.mjs → index-CWpU8prZ.mjs} +11 -11
- package/lib/chunks/index-CWpU8prZ.mjs.map +1 -0
- package/lib/chunks/index-CYa_XneH.mjs +303 -0
- package/lib/chunks/index-CYa_XneH.mjs.map +1 -0
- package/lib/chunks/{index-CYt6tpQC.mjs → index-CbJkkdEB.mjs} +9 -9
- package/lib/chunks/index-CbJkkdEB.mjs.map +1 -0
- package/lib/chunks/{index-DEoR7aDN.mjs → index-CoITLoYL.mjs} +3 -3
- package/lib/chunks/{index-DEoR7aDN.mjs.map → index-CoITLoYL.mjs.map} +1 -1
- package/lib/chunks/{index-Oxwizt6-.mjs → index-D9QQL7U6.mjs} +605 -557
- package/lib/chunks/index-D9QQL7U6.mjs.map +1 -0
- package/lib/chunks/{index-BvegaxQF.mjs → index-DAdO2lkI.mjs} +32 -32
- package/lib/chunks/index-DAdO2lkI.mjs.map +1 -0
- package/lib/chunks/{index-GGGDPwxX.mjs → index-DGqDJMot.mjs} +3 -3
- package/lib/chunks/{index-GGGDPwxX.mjs.map → index-DGqDJMot.mjs.map} +1 -1
- package/lib/chunks/{index-DIe0vHlt.mjs → index-DTyG1Wzp.mjs} +8 -8
- package/lib/chunks/index-DTyG1Wzp.mjs.map +1 -0
- package/lib/chunks/{index-Dw1U4YqT.mjs → index-DglMeKJM.mjs} +36 -38
- package/lib/chunks/{index-Dw1U4YqT.mjs.map → index-DglMeKJM.mjs.map} +1 -1
- package/lib/chunks/{index-B2lqsdp7.mjs → index-OOoaYpkl.mjs} +3 -3
- package/lib/chunks/{index-B2lqsdp7.mjs.map → index-OOoaYpkl.mjs.map} +1 -1
- package/lib/chunks/{index-DBw8tvyb.mjs → index-jcgLzyDR.mjs} +4 -4
- package/lib/chunks/{index-DBw8tvyb.mjs.map → index-jcgLzyDR.mjs.map} +1 -1
- package/lib/chunks/{index-BTW1xwB9.mjs → index-nFIiu1lA.mjs} +3 -3
- package/lib/chunks/{index-BTW1xwB9.mjs.map → index-nFIiu1lA.mjs.map} +1 -1
- package/lib/index.cjs +40 -32
- package/lib/index.cjs.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.mjs +1 -1
- package/lib/renderers/Audio/index.vue.d.ts.map +1 -1
- package/lib/renderers/Docx/index.vue.d.ts.map +1 -1
- package/lib/renderers/Epub/index.vue.d.ts.map +1 -1
- package/lib/renderers/Markdown/index.vue.d.ts.map +1 -1
- package/lib/renderers/Pdf/index.vue.d.ts +3 -0
- package/lib/renderers/Pdf/index.vue.d.ts.map +1 -1
- package/lib/renderers/Pdf/toolbar.d.ts +5 -0
- package/lib/renderers/Pdf/toolbar.d.ts.map +1 -1
- package/lib/renderers/RendererError.vue.d.ts.map +1 -1
- package/lib/renderers/Subtitle/index.vue.d.ts.map +1 -1
- package/lib/renderers/Text/index.vue.d.ts.map +1 -1
- package/lib/renderers/Xml/index.vue.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-CbgZBSDr.mjs.map +0 -1
- package/lib/chunks/index-BvegaxQF.mjs.map +0 -1
- package/lib/chunks/index-CYt6tpQC.mjs.map +0 -1
- package/lib/chunks/index-DIe0vHlt.mjs.map +0 -1
- package/lib/chunks/index-DTtHrdBl.mjs.map +0 -1
- package/lib/chunks/index-DX_NBPzS.mjs +0 -248
- package/lib/chunks/index-DX_NBPzS.mjs.map +0 -1
- package/lib/chunks/index-DyipSoKh.mjs.map +0 -1
- package/lib/chunks/index-Oxwizt6-.mjs.map +0 -1
- package/lib/chunks/index-Zwl5J-Uw.mjs +0 -166
- package/lib/chunks/index-Zwl5J-Uw.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { ZoomOut as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
version:
|
|
1
|
+
import { computed as R, unref as v, provide as ie, inject as ye, ref as _, watch as O, onBeforeUnmount as X, h as H, defineComponent as K, openBlock as f, createElementBlock as b, createElementVNode as S, toDisplayString as B, defineAsyncComponent as pt, createVNode as Z, createTextVNode as mt, onMounted as Fe, Fragment as T, normalizeStyle as ae, createCommentVNode as I, toRef as Se, renderList as U, createBlock as C, resolveDynamicComponent as ee, onUnmounted as vt, Teleport as ht, Transition as gt, withCtx as bt } from "vue";
|
|
2
|
+
import { ZoomOut as qe, ZoomIn as Be, Scan as wt, RotateCcw as xt, RotateCw as yt, RefreshCw as Oe, List as ke, ChevronLeft as le, ChevronRight as re, Minimize2 as Ue, Maximize2 as He, WrapText as Ft, Code as Ve, Eye as Ze, FileQuestion as kt, Download as Ge, X as Ct } from "lucide-vue-next";
|
|
3
|
+
import _t from "jszip";
|
|
4
|
+
const Rt = "1.4.0", Pt = {
|
|
5
|
+
version: Rt
|
|
6
6
|
}, zn = [
|
|
7
7
|
"image",
|
|
8
8
|
"pdf",
|
|
@@ -32,7 +32,7 @@ function zt(e) {
|
|
|
32
32
|
return decodeURIComponent(t);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function ge(e) {
|
|
36
36
|
var t;
|
|
37
37
|
const o = ((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "";
|
|
38
38
|
return {
|
|
@@ -115,7 +115,7 @@ function Mt(e, t = 0) {
|
|
|
115
115
|
id: `file-${Date.now()}-${t}`,
|
|
116
116
|
name: e.name,
|
|
117
117
|
url: URL.createObjectURL(e),
|
|
118
|
-
type: e.type ||
|
|
118
|
+
type: e.type || ge(e.name),
|
|
119
119
|
size: e.size
|
|
120
120
|
};
|
|
121
121
|
if (typeof e == "string") {
|
|
@@ -124,21 +124,21 @@ function Mt(e, t = 0) {
|
|
|
124
124
|
id: `url-${Date.now()}-${t}`,
|
|
125
125
|
name: o,
|
|
126
126
|
url: e,
|
|
127
|
-
type:
|
|
127
|
+
type: ge(o)
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
return {
|
|
131
131
|
id: e.id || `link-${Date.now()}-${t}`,
|
|
132
132
|
name: e.name,
|
|
133
133
|
url: e.url,
|
|
134
|
-
type: e.type ||
|
|
134
|
+
type: e.type || ge(e.name),
|
|
135
135
|
size: e.size
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
function jt(e) {
|
|
139
139
|
return e.map((t, o) => Mt(t, o));
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function Tt(e) {
|
|
142
142
|
var t;
|
|
143
143
|
const o = ((t = e.name.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "", n = e.type.toLowerCase();
|
|
144
144
|
if (n.startsWith("image/") || [
|
|
@@ -309,19 +309,19 @@ function jn(e) {
|
|
|
309
309
|
flv: "video/x-flv"
|
|
310
310
|
}[o] || "video/mp4";
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Et(e) {
|
|
313
313
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function Tn(e) {
|
|
316
316
|
if (!isFinite(e) || isNaN(e) || e < 0) return "0:00";
|
|
317
317
|
const t = Math.floor(e / 60), o = Math.floor(e % 60);
|
|
318
318
|
return `${t}:${o.toString().padStart(2, "0")}`;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function En(e) {
|
|
321
321
|
var t;
|
|
322
322
|
return (((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "") === "tsv" ? " " : ",";
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Sn(e, t = {}) {
|
|
325
325
|
const o = t.delimiter ?? ",", n = t.firstRowAsHeader ?? !0, i = [];
|
|
326
326
|
let a = [], l = "", s = !1, r = 0;
|
|
327
327
|
const u = e.length;
|
|
@@ -366,23 +366,23 @@ function En(e, t = {}) {
|
|
|
366
366
|
else
|
|
367
367
|
break;
|
|
368
368
|
}
|
|
369
|
-
let d = [],
|
|
370
|
-
n && i.length > 0 && (d = i[0],
|
|
371
|
-
const
|
|
369
|
+
let d = [], p = i;
|
|
370
|
+
n && i.length > 0 && (d = i[0], p = i.slice(1));
|
|
371
|
+
const m = Math.max(
|
|
372
372
|
d.length,
|
|
373
|
-
...
|
|
373
|
+
...p.map((c) => c.length),
|
|
374
374
|
0
|
|
375
375
|
);
|
|
376
|
-
for (const c of
|
|
377
|
-
for (; c.length <
|
|
376
|
+
for (const c of p)
|
|
377
|
+
for (; c.length < m; ) c.push("");
|
|
378
378
|
return {
|
|
379
379
|
header: d,
|
|
380
|
-
rows:
|
|
381
|
-
columnCount:
|
|
380
|
+
rows: p,
|
|
381
|
+
columnCount: m,
|
|
382
382
|
delimiter: o
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function St(e) {
|
|
386
386
|
const t = e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
387
387
|
if (t.length >= 3 && t[0] === 239 && t[1] === 187 && t[2] === 191)
|
|
388
388
|
return new TextDecoder("utf-8").decode(t);
|
|
@@ -400,17 +400,17 @@ function Et(e) {
|
|
|
400
400
|
}
|
|
401
401
|
return new TextDecoder("utf-8", { fatal: !1 }).decode(t);
|
|
402
402
|
}
|
|
403
|
-
async function
|
|
403
|
+
async function Nn(e, t) {
|
|
404
404
|
const o = !!t && ("fetcher" in t || "init" in t || "signal" in t), n = o ? t.fetcher ?? fetch : fetch, i = o ? t.signal : void 0, a = o ? t.init : t, l = i ? { ...a, signal: i } : a, s = await n(e, l);
|
|
405
405
|
if (!s.ok) throw new Error(`请求失败: ${s.status}`);
|
|
406
406
|
const r = await s.arrayBuffer();
|
|
407
|
-
return
|
|
407
|
+
return St(r);
|
|
408
408
|
}
|
|
409
|
-
async function
|
|
409
|
+
async function Nt(e, t) {
|
|
410
410
|
if (e)
|
|
411
411
|
return typeof e == "function" ? await e(t) : e;
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function $t(e, t) {
|
|
414
414
|
if (!e && !t) return;
|
|
415
415
|
if (!e) return t;
|
|
416
416
|
if (!t) return e;
|
|
@@ -423,20 +423,20 @@ function Nt(e, t) {
|
|
|
423
423
|
headers: o
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Lt(e) {
|
|
427
427
|
const t = (e == null ? void 0 : e.requestHandler) ?? ((n, i) => fetch(n, i)), o = e == null ? void 0 : e.requestInit;
|
|
428
428
|
return async (n, i) => {
|
|
429
|
-
const a = await
|
|
429
|
+
const a = await Nt(o, n), l = $t(a, i);
|
|
430
430
|
return t(n, l);
|
|
431
431
|
};
|
|
432
432
|
}
|
|
433
|
-
async function
|
|
433
|
+
async function Wt(e, t = fetch, o) {
|
|
434
434
|
const n = await t(e, o);
|
|
435
435
|
if (!n.ok) throw new Error(`请求失败: ${n.status}`);
|
|
436
436
|
const i = await n.blob();
|
|
437
437
|
return URL.createObjectURL(i);
|
|
438
438
|
}
|
|
439
|
-
async function
|
|
439
|
+
async function It(e, t, o = fetch, n) {
|
|
440
440
|
const i = await o(e, n);
|
|
441
441
|
if (!i.ok) throw new Error(`请求失败: ${i.status}`);
|
|
442
442
|
const a = await i.blob(), l = URL.createObjectURL(a);
|
|
@@ -447,7 +447,7 @@ async function Wt(e, t, o = fetch, n) {
|
|
|
447
447
|
setTimeout(() => URL.revokeObjectURL(l), 1e3);
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function Ne(e) {
|
|
451
451
|
const t = e.trim().replace(",", "."), o = t.split(":").map((n) => n.trim());
|
|
452
452
|
if (o.length === 3) {
|
|
453
453
|
const [n, i, a] = o;
|
|
@@ -459,17 +459,17 @@ function Se(e) {
|
|
|
459
459
|
}
|
|
460
460
|
return Number(t) || 0;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function $n(e) {
|
|
463
463
|
if (!isFinite(e) || e < 0) return "00:00:00.000";
|
|
464
464
|
const t = Math.floor(e * 1e3), o = t % 1e3, n = Math.floor(t / 1e3) % 60, i = Math.floor(t / 6e4) % 60, a = Math.floor(t / 36e5), l = (s, r = 2) => s.toString().padStart(r, "0");
|
|
465
465
|
return `${l(a)}:${l(i)}:${l(n)}.${l(o, 3)}`;
|
|
466
466
|
}
|
|
467
|
-
const
|
|
468
|
-
function
|
|
467
|
+
const $e = /(\d{1,2}:)?\d{1,2}:\d{1,2}[.,]\d{1,3}\s*-->\s*(\d{1,2}:)?\d{1,2}:\d{1,2}[.,]\d{1,3}/, Dt = /^\s*\[\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?\]/;
|
|
468
|
+
function At(e) {
|
|
469
469
|
const t = e.replace(/^\uFEFF/, "").trimStart();
|
|
470
|
-
return /^WEBVTT/.test(t) ? "vtt" : /^<\?xml/i.test(t) || /<tt\b[^>]*>/i.test(t) ? "ttml" : /^\[Script Info\]/im.test(t) || /^Dialogue:/m.test(t) ? /ScriptType:\s*v4\.00\s*$/im.test(t) ? "ssa" : "ass" :
|
|
470
|
+
return /^WEBVTT/.test(t) ? "vtt" : /^<\?xml/i.test(t) || /<tt\b[^>]*>/i.test(t) ? "ttml" : /^\[Script Info\]/im.test(t) || /^Dialogue:/m.test(t) ? /ScriptType:\s*v4\.00\s*$/im.test(t) ? "ssa" : "ass" : Dt.test(t) || /^\[(ti|ar|al|au|by|length|offset|re|ve):/im.test(t) ? /<\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?>/.test(t) ? "elrc" : "lrc" : "srt";
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function Le(e, t) {
|
|
473
473
|
const o = e.replace(/\r\n?/g, `
|
|
474
474
|
`).replace(/^\uFEFF/, "").split(`
|
|
475
475
|
`), n = [];
|
|
@@ -485,24 +485,24 @@ function $e(e, t) {
|
|
|
485
485
|
for (; a < o.length && o[a].trim() === ""; ) a++;
|
|
486
486
|
if (a >= o.length) break;
|
|
487
487
|
let l, s = null;
|
|
488
|
-
if (
|
|
488
|
+
if ($e.test(o[a]))
|
|
489
489
|
s = o[a], a++;
|
|
490
|
-
else if (l = o[a].trim() || void 0, a++, a < o.length &&
|
|
490
|
+
else if (l = o[a].trim() || void 0, a++, a < o.length && $e.test(o[a]))
|
|
491
491
|
s = o[a], a++;
|
|
492
492
|
else
|
|
493
493
|
continue;
|
|
494
494
|
if (!s) continue;
|
|
495
495
|
const r = s.match(/([\d:.,]+)\s*-->\s*([\d:.,]+)/);
|
|
496
496
|
if (!r) continue;
|
|
497
|
-
const u =
|
|
497
|
+
const u = Ne(r[1]), d = Ne(r[2]), p = [];
|
|
498
498
|
for (; a < o.length && o[a].trim() !== ""; )
|
|
499
|
-
|
|
500
|
-
n.push({ id: l, start: u, end: d, text:
|
|
499
|
+
p.push(o[a]), a++;
|
|
500
|
+
n.push({ id: l, start: u, end: d, text: p.join(`
|
|
501
501
|
`) });
|
|
502
502
|
}
|
|
503
503
|
return { format: t, cues: n, header: i };
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function xe(e, t, o) {
|
|
506
506
|
const n = Number(e), i = Number(t);
|
|
507
507
|
let a = 0;
|
|
508
508
|
if (o) {
|
|
@@ -521,7 +521,7 @@ function Xe(e, t) {
|
|
|
521
521
|
}
|
|
522
522
|
return !0;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function qt(e) {
|
|
525
525
|
const t = e.replace(/\r\n?/g, `
|
|
526
526
|
`).replace(/^\uFEFF/, "").split(`
|
|
527
527
|
`), o = { metadata: {}, offsetMs: 0 }, n = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, i = [];
|
|
@@ -533,11 +533,11 @@ function At(e) {
|
|
|
533
533
|
n.lastIndex = 0;
|
|
534
534
|
let d;
|
|
535
535
|
for (; (d = n.exec(s)) !== null && d.index === u; )
|
|
536
|
-
r.push(
|
|
536
|
+
r.push(xe(d[1], d[2], d[3])), u = d.index + d[0].length;
|
|
537
537
|
if (r.length === 0) continue;
|
|
538
|
-
const
|
|
539
|
-
for (const
|
|
540
|
-
i.push({ start:
|
|
538
|
+
const p = s.slice(u).trim();
|
|
539
|
+
for (const m of r)
|
|
540
|
+
i.push({ start: m, text: p });
|
|
541
541
|
}
|
|
542
542
|
i.sort((l, s) => l.start - s.start);
|
|
543
543
|
const a = o.offsetMs / 1e3;
|
|
@@ -556,41 +556,41 @@ function Bt(e) {
|
|
|
556
556
|
const u = [];
|
|
557
557
|
let d = 0;
|
|
558
558
|
n.lastIndex = 0;
|
|
559
|
-
let
|
|
560
|
-
for (; (
|
|
561
|
-
u.push(
|
|
559
|
+
let p;
|
|
560
|
+
for (; (p = n.exec(r)) !== null && p.index === d; )
|
|
561
|
+
u.push(xe(p[1], p[2], p[3])), d = p.index + p[0].length;
|
|
562
562
|
if (u.length === 0) continue;
|
|
563
|
-
const
|
|
563
|
+
const m = r.slice(d);
|
|
564
564
|
for (const c of u)
|
|
565
|
-
a.push({ start: c, raw:
|
|
565
|
+
a.push({ start: c, raw: m });
|
|
566
566
|
}
|
|
567
567
|
a.sort((s, r) => s.start - r.start);
|
|
568
568
|
const l = o.offsetMs / 1e3;
|
|
569
569
|
return { format: "elrc", cues: a.map((s, r) => {
|
|
570
570
|
const u = [];
|
|
571
|
-
let d = "",
|
|
571
|
+
let d = "", p = 0, m = null;
|
|
572
572
|
i.lastIndex = 0;
|
|
573
573
|
let c;
|
|
574
574
|
for (; (c = i.exec(s.raw)) !== null; ) {
|
|
575
|
-
const
|
|
576
|
-
|
|
575
|
+
const L = s.raw.slice(p, c.index);
|
|
576
|
+
m !== null && L && u.push({ start: Math.max(0, m - l), text: L }), d += L, m = xe(c[1], c[2], c[3]), p = c.index + c[0].length;
|
|
577
577
|
}
|
|
578
|
-
const w = s.raw.slice(
|
|
579
|
-
|
|
580
|
-
const
|
|
578
|
+
const w = s.raw.slice(p);
|
|
579
|
+
m !== null && w && u.push({ start: Math.max(0, m - l), text: w }), d += w;
|
|
580
|
+
const P = Math.max(0, s.start - l), j = a[r + 1], M = j ? Math.max(P, j.start - l) : P + 5;
|
|
581
581
|
return {
|
|
582
|
-
start:
|
|
583
|
-
end:
|
|
582
|
+
start: P,
|
|
583
|
+
end: M,
|
|
584
584
|
text: d.trim(),
|
|
585
585
|
words: u.length ? u : void 0
|
|
586
586
|
};
|
|
587
587
|
}), metadata: o.metadata };
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function We(e) {
|
|
590
590
|
const t = e.trim().split(":");
|
|
591
591
|
return t.length !== 3 ? 0 : Number(t[0]) * 3600 + Number(t[1]) * 60 + Number(t[2].replace(",", "."));
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function Ie(e, t) {
|
|
594
594
|
const o = e.replace(/\r\n?/g, `
|
|
595
595
|
`).replace(/^\uFEFF/, "").split(`
|
|
596
596
|
`);
|
|
@@ -606,21 +606,21 @@ function We(e, t) {
|
|
|
606
606
|
l.push(r);
|
|
607
607
|
continue;
|
|
608
608
|
}
|
|
609
|
-
const
|
|
610
|
-
if (
|
|
611
|
-
i =
|
|
609
|
+
const p = /^Format:\s*(.+)$/i.exec(u);
|
|
610
|
+
if (p) {
|
|
611
|
+
i = p[1].split(",").map((D) => D.trim());
|
|
612
612
|
continue;
|
|
613
613
|
}
|
|
614
|
-
const
|
|
615
|
-
if (!
|
|
616
|
-
const c = i.length, w =
|
|
617
|
-
i.forEach((
|
|
618
|
-
|
|
614
|
+
const m = /^(Dialogue|Comment):\s*(.+)$/i.exec(u);
|
|
615
|
+
if (!m || m[1].toLowerCase() === "comment" || i.length === 0) continue;
|
|
616
|
+
const c = i.length, w = m[2].split(","), P = w.slice(0, c - 1), j = w.slice(c - 1).join(","), M = {};
|
|
617
|
+
i.forEach((D, q) => {
|
|
618
|
+
M[D] = q === c - 1 ? j : P[q] ?? "";
|
|
619
619
|
});
|
|
620
|
-
const
|
|
620
|
+
const L = We(M.Start || ""), g = We(M.End || ""), z = (M.Text || "").replace(/\\N/g, `
|
|
621
621
|
`).replace(/\\n/g, `
|
|
622
622
|
`).replace(/\\h/g, " ").replace(/\{[^}]*\}/g, "");
|
|
623
|
-
a.push({ start:
|
|
623
|
+
a.push({ start: L, end: g, text: z, style: M.Style });
|
|
624
624
|
}
|
|
625
625
|
return a.sort((s, r) => s.start - r.start), {
|
|
626
626
|
format: t,
|
|
@@ -629,7 +629,7 @@ function We(e, t) {
|
|
|
629
629
|
`).trim() || void 0
|
|
630
630
|
};
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function G(e) {
|
|
633
633
|
const t = e.trim();
|
|
634
634
|
if (!t) return 0;
|
|
635
635
|
const o = /^(\d+(?:\.\d+)?)(h|m|s|ms|f|t)$/i.exec(t);
|
|
@@ -640,27 +640,27 @@ function Z(e) {
|
|
|
640
640
|
const n = t.split(":");
|
|
641
641
|
return n.length === 3 ? Number(n[0]) * 3600 + Number(n[1]) * 60 + Number(n[2]) : n.length === 2 ? Number(n[0]) * 60 + Number(n[1]) : Number(t) || 0;
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function Ot(e) {
|
|
644
644
|
return e.replace(/&#x([0-9a-fA-F]+);/g, (t, o) => String.fromCharCode(parseInt(o, 16))).replace(/&#(\d+);/g, (t, o) => String.fromCharCode(Number(o))).replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, " ").replace(/&/g, "&");
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function Ut(e) {
|
|
647
647
|
var t, o, n;
|
|
648
648
|
const i = [], a = /<(?:[\w-]+:)?p\b([^>]*)>([\s\S]*?)<\/(?:[\w-]+:)?p\s*>/gi;
|
|
649
649
|
let l;
|
|
650
650
|
for (; (l = a.exec(e)) !== null; ) {
|
|
651
|
-
const s = l[1], r = l[2], u = ((t = /\bbegin\s*=\s*["']([^"']+)["']/i.exec(s)) == null ? void 0 : t[1]) || "", d = ((o = /\bend\s*=\s*["']([^"']+)["']/i.exec(s)) == null ? void 0 : o[1]) || "",
|
|
651
|
+
const s = l[1], r = l[2], u = ((t = /\bbegin\s*=\s*["']([^"']+)["']/i.exec(s)) == null ? void 0 : t[1]) || "", d = ((o = /\bend\s*=\s*["']([^"']+)["']/i.exec(s)) == null ? void 0 : o[1]) || "", p = ((n = /\bdur\s*=\s*["']([^"']+)["']/i.exec(s)) == null ? void 0 : n[1]) || "", m = G(u);
|
|
652
652
|
let c;
|
|
653
|
-
d ? c =
|
|
654
|
-
const w =
|
|
653
|
+
d ? c = G(d) : p ? c = m + G(p) : c = m + 5;
|
|
654
|
+
const w = Ot(
|
|
655
655
|
r.replace(/<(?:[\w-]+:)?br\s*\/?>/gi, `
|
|
656
656
|
`).replace(/<[^>]+>/g, "")
|
|
657
657
|
).replace(/[ \t]+/g, " ").replace(/\n /g, `
|
|
658
658
|
`).trim();
|
|
659
|
-
(w ||
|
|
659
|
+
(w || m || c) && i.push({ start: m, end: c, text: w });
|
|
660
660
|
}
|
|
661
661
|
return i.sort((s, r) => s.start - r.start), { format: "ttml", cues: i };
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function Ht(e) {
|
|
664
664
|
const t = e.replace(/^\uFEFF/, "");
|
|
665
665
|
if (typeof DOMParser < "u") {
|
|
666
666
|
const o = new DOMParser().parseFromString(t, "application/xml");
|
|
@@ -669,67 +669,67 @@ function Ut(e) {
|
|
|
669
669
|
if (n.length > 0) {
|
|
670
670
|
const i = [];
|
|
671
671
|
for (let a = 0; a < n.length; a++) {
|
|
672
|
-
const l = n[a], s = l.getAttribute("begin") || "", r = l.getAttribute("end") || "", u = l.getAttribute("dur") || "", d =
|
|
673
|
-
let
|
|
674
|
-
r ?
|
|
675
|
-
let
|
|
672
|
+
const l = n[a], s = l.getAttribute("begin") || "", r = l.getAttribute("end") || "", u = l.getAttribute("dur") || "", d = G(s);
|
|
673
|
+
let p;
|
|
674
|
+
r ? p = G(r) : u ? p = d + G(u) : p = d + 5;
|
|
675
|
+
let m = "";
|
|
676
676
|
l.childNodes.forEach((w) => {
|
|
677
677
|
if (w.nodeType === 3)
|
|
678
|
-
|
|
678
|
+
m += w.nodeValue || "";
|
|
679
679
|
else if (w.nodeType === 1) {
|
|
680
|
-
const
|
|
681
|
-
(
|
|
682
|
-
` :
|
|
680
|
+
const P = w;
|
|
681
|
+
(P.localName || P.tagName).toLowerCase() === "br" ? m += `
|
|
682
|
+
` : m += P.textContent || "";
|
|
683
683
|
}
|
|
684
684
|
});
|
|
685
|
-
const c =
|
|
685
|
+
const c = m.replace(/[ \t]+/g, " ").replace(/\n /g, `
|
|
686
686
|
`).trim();
|
|
687
|
-
(c || d ||
|
|
687
|
+
(c || d || p) && i.push({ start: d, end: p, text: c });
|
|
688
688
|
}
|
|
689
689
|
return i.sort((a, l) => a.start - l.start), { format: "ttml", cues: i };
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
|
-
return
|
|
693
|
+
return Ut(t);
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
switch (t ??
|
|
695
|
+
function Ln(e, t) {
|
|
696
|
+
switch (t ?? At(e)) {
|
|
697
697
|
case "lrc":
|
|
698
|
-
return
|
|
698
|
+
return qt(e);
|
|
699
699
|
case "elrc":
|
|
700
700
|
return Bt(e);
|
|
701
701
|
case "ass":
|
|
702
|
-
return
|
|
702
|
+
return Ie(e, "ass");
|
|
703
703
|
case "ssa":
|
|
704
|
-
return
|
|
704
|
+
return Ie(e, "ssa");
|
|
705
705
|
case "ttml":
|
|
706
|
-
return
|
|
706
|
+
return Ht(e);
|
|
707
707
|
case "vtt":
|
|
708
|
-
return
|
|
708
|
+
return Le(e, "vtt");
|
|
709
709
|
case "srt":
|
|
710
710
|
default:
|
|
711
|
-
return
|
|
711
|
+
return Le(e, "srt");
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
|
-
async function
|
|
715
|
-
return
|
|
714
|
+
async function Wn(e) {
|
|
715
|
+
return _t.loadAsync(e);
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function In(e) {
|
|
718
718
|
const t = [];
|
|
719
719
|
return e.forEach((o, n) => {
|
|
720
720
|
var i;
|
|
721
|
-
const a = n.dir, l = a && !o.endsWith("/") ? o + "/" : o, s = a ? l.replace(/\/$/, "") : l, r = s.lastIndexOf("/"), u = r >= 0 ? s.slice(r + 1) : s, d = r >= 0 ? s.slice(0, r) : "",
|
|
721
|
+
const a = n.dir, l = a && !o.endsWith("/") ? o + "/" : o, s = a ? l.replace(/\/$/, "") : l, r = s.lastIndexOf("/"), u = r >= 0 ? s.slice(r + 1) : s, d = r >= 0 ? s.slice(0, r) : "", p = a ? 0 : ((i = n._data) == null ? void 0 : i.uncompressedSize) ?? 0;
|
|
722
722
|
t.push({
|
|
723
723
|
path: l,
|
|
724
724
|
name: u,
|
|
725
725
|
dir: d,
|
|
726
726
|
isDir: a,
|
|
727
|
-
size:
|
|
727
|
+
size: p,
|
|
728
728
|
date: n.date
|
|
729
729
|
});
|
|
730
730
|
}), t;
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function Dn(e) {
|
|
733
733
|
const t = { name: "", path: "", isDir: !0, children: [], size: 0 }, o = /* @__PURE__ */ new Map();
|
|
734
734
|
o.set("", t);
|
|
735
735
|
const n = (a) => {
|
|
@@ -763,16 +763,16 @@ function In(e) {
|
|
|
763
763
|
};
|
|
764
764
|
return i(t), t;
|
|
765
765
|
}
|
|
766
|
-
async function
|
|
766
|
+
async function An(e, t, o) {
|
|
767
767
|
const n = e.file(t);
|
|
768
768
|
if (!n) throw new Error(`ZIP entry not found: ${t}`);
|
|
769
769
|
const i = await n.async("arraybuffer");
|
|
770
770
|
return new Blob([i], o ? { type: o } : void 0);
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function Vt(e) {
|
|
773
773
|
return e ? e.startsWith("#") ? e : e.length === 8 ? "#" + e.substring(2) : e.length === 6 ? "#" + e : "#000000" : "#000000";
|
|
774
774
|
}
|
|
775
|
-
const
|
|
775
|
+
const Zt = [
|
|
776
776
|
"FFFFFF",
|
|
777
777
|
"000000",
|
|
778
778
|
"E7E6E6",
|
|
@@ -783,7 +783,7 @@ const Vt = [
|
|
|
783
783
|
"FFC000",
|
|
784
784
|
"5B9BD5",
|
|
785
785
|
"70AD47"
|
|
786
|
-
],
|
|
786
|
+
], Gt = [
|
|
787
787
|
"000000",
|
|
788
788
|
"FFFFFF",
|
|
789
789
|
"FF0000",
|
|
@@ -849,48 +849,48 @@ const Vt = [
|
|
|
849
849
|
"333399",
|
|
850
850
|
"333333"
|
|
851
851
|
];
|
|
852
|
-
function
|
|
852
|
+
function Xt(e, t) {
|
|
853
853
|
const o = parseInt(e.substring(0, 2), 16), n = parseInt(e.substring(2, 4), 16), i = parseInt(e.substring(4, 6), 16), a = (u) => t < 0 ? Math.round(u * (1 + t)) : Math.round(u + (255 - u) * t), l = Math.min(255, Math.max(0, a(o))), s = Math.min(255, Math.max(0, a(n))), r = Math.min(255, Math.max(0, a(i)));
|
|
854
854
|
return l.toString(16).padStart(2, "0") + s.toString(16).padStart(2, "0") + r.toString(16).padStart(2, "0");
|
|
855
855
|
}
|
|
856
|
-
function
|
|
856
|
+
function Kt(e) {
|
|
857
857
|
if (e && e.type === "pattern" && e.pattern === "solid") {
|
|
858
858
|
const t = e.fgColor;
|
|
859
859
|
if (t)
|
|
860
|
-
return
|
|
860
|
+
return Ce(t);
|
|
861
861
|
}
|
|
862
862
|
}
|
|
863
|
-
function
|
|
863
|
+
function Ce(e) {
|
|
864
864
|
if (e) {
|
|
865
865
|
if ("argb" in e && typeof e.argb == "string" && e.argb)
|
|
866
|
-
return
|
|
866
|
+
return Vt(e.argb);
|
|
867
867
|
if ("theme" in e && typeof e.theme == "number") {
|
|
868
|
-
const t =
|
|
869
|
-
return "#" + (o !== 0 ?
|
|
868
|
+
const t = Zt[e.theme] || "000000", o = "tint" in e && typeof e.tint == "number" ? e.tint : 0;
|
|
869
|
+
return "#" + (o !== 0 ? Xt(t, o) : t);
|
|
870
870
|
}
|
|
871
871
|
if ("indexed" in e && typeof e.indexed == "number") {
|
|
872
|
-
const t =
|
|
872
|
+
const t = Gt[e.indexed];
|
|
873
873
|
if (t) return "#" + t;
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function Yt(e) {
|
|
878
878
|
if (!e || !e.style) return;
|
|
879
|
-
const t =
|
|
879
|
+
const t = Ce(e.color) || "#000000";
|
|
880
880
|
return [e.style, t];
|
|
881
881
|
}
|
|
882
|
-
function
|
|
882
|
+
function Jt(e) {
|
|
883
883
|
const t = {};
|
|
884
884
|
let o = !1;
|
|
885
885
|
if (e.font) {
|
|
886
886
|
const i = e.font;
|
|
887
887
|
if ((i.name || i.size || i.bold || i.italic) && (o = !0, t.font = {}, i.name && (t.font.name = i.name), i.size && (t.font.size = i.size), i.bold && (t.font.bold = !0), i.italic && (t.font.italic = !0)), i.color) {
|
|
888
|
-
const a =
|
|
888
|
+
const a = Ce(i.color);
|
|
889
889
|
a && (o = !0, t.color = a);
|
|
890
890
|
}
|
|
891
891
|
i.underline && (o = !0, t.underline = !0), i.strike && (o = !0, t.strike = !0);
|
|
892
892
|
}
|
|
893
|
-
const n =
|
|
893
|
+
const n = Kt(e.fill);
|
|
894
894
|
if (n && (o = !0, t.bgcolor = n), e.alignment) {
|
|
895
895
|
const i = e.alignment;
|
|
896
896
|
i.horizontal && (o = !0, t.align = i.horizontal), i.vertical && (o = !0, t.valign = i.vertical), i.wrapText && (o = !0, t.textwrap = !0);
|
|
@@ -900,25 +900,25 @@ function Yt(e) {
|
|
|
900
900
|
let a = !1;
|
|
901
901
|
const l = ["top", "bottom", "left", "right"];
|
|
902
902
|
for (const s of l) {
|
|
903
|
-
const r =
|
|
903
|
+
const r = Yt(e.border[s]);
|
|
904
904
|
r && (i[s] = r, a = !0);
|
|
905
905
|
}
|
|
906
906
|
a && (o = !0, t.border = i);
|
|
907
907
|
}
|
|
908
908
|
return o ? t : null;
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function Qt(e) {
|
|
911
911
|
return JSON.stringify(e);
|
|
912
912
|
}
|
|
913
|
-
function
|
|
914
|
-
const n =
|
|
913
|
+
function eo(e, t, o) {
|
|
914
|
+
const n = Jt(e);
|
|
915
915
|
if (!n) return -1;
|
|
916
|
-
const i =
|
|
916
|
+
const i = Qt(n), a = o.get(i);
|
|
917
917
|
if (a !== void 0) return a;
|
|
918
918
|
const l = t.length;
|
|
919
919
|
return t.push(n), o.set(i, l), l;
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function to(e) {
|
|
922
922
|
const t = e.value;
|
|
923
923
|
if (t == null) return "";
|
|
924
924
|
if (typeof t == "string") return t;
|
|
@@ -932,8 +932,8 @@ function eo(e) {
|
|
|
932
932
|
}
|
|
933
933
|
return typeof t == "object" && "richText" in t ? t.richText.map((o) => o.text).join("") : typeof t == "object" && "hyperlink" in t ? t.text || "" : typeof t == "object" && "error" in t ? String(t.error) : String(t);
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
const t = e.split(":"), o =
|
|
935
|
+
function oo(e) {
|
|
936
|
+
const t = e.split(":"), o = De(t[0]), n = t[1] ? De(t[1]) : o;
|
|
937
937
|
return {
|
|
938
938
|
top: o.row,
|
|
939
939
|
left: o.col,
|
|
@@ -941,7 +941,7 @@ function to(e) {
|
|
|
941
941
|
right: n.col
|
|
942
942
|
};
|
|
943
943
|
}
|
|
944
|
-
function
|
|
944
|
+
function De(e) {
|
|
945
945
|
const t = e.match(/^([A-Z]+)(\d+)$/);
|
|
946
946
|
if (!t) return { row: 1, col: 1 };
|
|
947
947
|
const o = t[1], n = parseInt(t[2], 10);
|
|
@@ -950,33 +950,33 @@ function Ie(e) {
|
|
|
950
950
|
i = i * 26 + (o.charCodeAt(a) - 64);
|
|
951
951
|
return { row: n, col: i };
|
|
952
952
|
}
|
|
953
|
-
function
|
|
953
|
+
function qn(e) {
|
|
954
954
|
const t = [];
|
|
955
955
|
return e.eachSheet((o) => {
|
|
956
956
|
const n = [], i = /* @__PURE__ */ new Map(), a = [], l = {}, s = {}, r = o.columnCount;
|
|
957
|
-
for (let
|
|
958
|
-
const c = o.getColumn(
|
|
959
|
-
c.width && (s[String(
|
|
957
|
+
for (let m = 1; m <= r; m++) {
|
|
958
|
+
const c = o.getColumn(m);
|
|
959
|
+
c.width && (s[String(m - 1)] = { width: Math.round(c.width * 7.5) });
|
|
960
960
|
}
|
|
961
961
|
s.len = Math.max(r, 26);
|
|
962
|
-
const u = /* @__PURE__ */ new Map(), d = o.model,
|
|
963
|
-
for (const
|
|
964
|
-
a.push(
|
|
965
|
-
const { top: c, left: w, bottom:
|
|
966
|
-
u.set(`${c - 1},${w - 1}`, [
|
|
962
|
+
const u = /* @__PURE__ */ new Map(), d = o.model, p = (d == null ? void 0 : d.merges) || [];
|
|
963
|
+
for (const m of p) {
|
|
964
|
+
a.push(m);
|
|
965
|
+
const { top: c, left: w, bottom: P, right: j } = oo(m), M = P - c, L = j - w;
|
|
966
|
+
u.set(`${c - 1},${w - 1}`, [M, L]);
|
|
967
967
|
}
|
|
968
|
-
o.eachRow({ includeEmpty: !0 }, (
|
|
969
|
-
const w = c - 1,
|
|
970
|
-
|
|
971
|
-
const
|
|
972
|
-
if (
|
|
973
|
-
const
|
|
974
|
-
|
|
975
|
-
const
|
|
976
|
-
u.has(
|
|
968
|
+
o.eachRow({ includeEmpty: !0 }, (m, c) => {
|
|
969
|
+
const w = c - 1, P = {};
|
|
970
|
+
m.eachCell({ includeEmpty: !1 }, (M, L) => {
|
|
971
|
+
const g = L - 1;
|
|
972
|
+
if (M.isMerged && M.master !== M) return;
|
|
973
|
+
const z = to(M), D = eo(M, n, i), q = { text: z };
|
|
974
|
+
D !== -1 && (q.style = D);
|
|
975
|
+
const x = `${w},${g}`;
|
|
976
|
+
u.has(x) && (q.merge = u.get(x)), P[String(g)] = q;
|
|
977
977
|
});
|
|
978
|
-
const
|
|
979
|
-
|
|
978
|
+
const j = { cells: P };
|
|
979
|
+
m.height && (j.height = Math.round(m.height * 1.333)), l[String(w)] = j;
|
|
980
980
|
}), t.push({
|
|
981
981
|
name: o.name,
|
|
982
982
|
styles: n,
|
|
@@ -997,12 +997,12 @@ function Bn(e, t, o = "Sheet1") {
|
|
|
997
997
|
const l = n ? 1 : 0;
|
|
998
998
|
return t.forEach((s, r) => {
|
|
999
999
|
const u = {};
|
|
1000
|
-
s.forEach((d,
|
|
1001
|
-
d !== void 0 && d !== "" && (u[String(
|
|
1000
|
+
s.forEach((d, p) => {
|
|
1001
|
+
d !== void 0 && d !== "" && (u[String(p)] = { text: d });
|
|
1002
1002
|
}), a[String(r + l)] = { cells: u };
|
|
1003
1003
|
}), [{ name: o, styles: i, rows: a }];
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1005
|
+
function On(e, t) {
|
|
1006
1006
|
var o;
|
|
1007
1007
|
if (typeof window > "u") return;
|
|
1008
1008
|
const n = (e == null ? void 0 : e.version) || ((o = e == null ? void 0 : e.GlobalWorkerOptions) == null ? void 0 : o.version) || "", {
|
|
@@ -1012,13 +1012,19 @@ function qn(e, t) {
|
|
|
1012
1012
|
} = t || {};
|
|
1013
1013
|
e.GlobalWorkerOptions && (e.GlobalWorkerOptions.workerSrc = i, e.GlobalWorkerOptions.cMapUrl = a, e.GlobalWorkerOptions.cMapPacked = l);
|
|
1014
1014
|
}
|
|
1015
|
-
const
|
|
1015
|
+
const no = {
|
|
1016
1016
|
// ─────── common ───────
|
|
1017
1017
|
"common.download": "下载",
|
|
1018
1018
|
"common.close": "关闭",
|
|
1019
1019
|
"common.loading": "加载中",
|
|
1020
1020
|
"common.unknown_error": "未知错误",
|
|
1021
1021
|
"common.unsupported_preview": "不支持预览此文件类型 ({type})",
|
|
1022
|
+
"common.retry": "重试",
|
|
1023
|
+
// ─────── accessibility ───────
|
|
1024
|
+
"accessibility.previousFile": "上一个文件",
|
|
1025
|
+
"accessibility.nextFile": "下一个文件",
|
|
1026
|
+
"accessibility.closePreview": "关闭预览",
|
|
1027
|
+
"accessibility.downloadFile": "下载文件",
|
|
1022
1028
|
// ─────── toolbar ───────
|
|
1023
1029
|
"toolbar.zoom_in": "放大",
|
|
1024
1030
|
"toolbar.zoom_out": "缩小",
|
|
@@ -1028,6 +1034,7 @@ const oo = {
|
|
|
1028
1034
|
"toolbar.fit_to_window": "适应窗口",
|
|
1029
1035
|
"toolbar.original_size": "原始尺寸",
|
|
1030
1036
|
"toolbar.toc": "目录",
|
|
1037
|
+
"toolbar.outline": "大纲",
|
|
1031
1038
|
"toolbar.prev_page": "上一页",
|
|
1032
1039
|
"toolbar.next_page": "下一页",
|
|
1033
1040
|
"toolbar.full_width": "全屏宽度",
|
|
@@ -1129,13 +1136,19 @@ const oo = {
|
|
|
1129
1136
|
"font.meta.glyphs": "字形数量",
|
|
1130
1137
|
"font.meta.format": "格式",
|
|
1131
1138
|
"font.sample_text_placeholder": "输入自定义文本..."
|
|
1132
|
-
},
|
|
1139
|
+
}, ao = {
|
|
1133
1140
|
// ─────── common ───────
|
|
1134
1141
|
"common.download": "Download",
|
|
1135
1142
|
"common.close": "Close",
|
|
1136
1143
|
"common.loading": "Loading",
|
|
1137
1144
|
"common.unknown_error": "Unknown error",
|
|
1138
1145
|
"common.unsupported_preview": "Preview not supported for this file type ({type})",
|
|
1146
|
+
"common.retry": "Retry",
|
|
1147
|
+
// ─────── accessibility ───────
|
|
1148
|
+
"accessibility.previousFile": "Previous file",
|
|
1149
|
+
"accessibility.nextFile": "Next file",
|
|
1150
|
+
"accessibility.closePreview": "Close preview",
|
|
1151
|
+
"accessibility.downloadFile": "Download file",
|
|
1139
1152
|
// ─────── toolbar ───────
|
|
1140
1153
|
"toolbar.zoom_in": "Zoom in",
|
|
1141
1154
|
"toolbar.zoom_out": "Zoom out",
|
|
@@ -1145,6 +1158,7 @@ const oo = {
|
|
|
1145
1158
|
"toolbar.fit_to_window": "Fit to window",
|
|
1146
1159
|
"toolbar.original_size": "Original size",
|
|
1147
1160
|
"toolbar.toc": "Table of contents",
|
|
1161
|
+
"toolbar.outline": "Outline",
|
|
1148
1162
|
"toolbar.prev_page": "Previous page",
|
|
1149
1163
|
"toolbar.next_page": "Next page",
|
|
1150
1164
|
"toolbar.full_width": "Full width",
|
|
@@ -1247,11 +1261,11 @@ const oo = {
|
|
|
1247
1261
|
"font.meta.format": "Format",
|
|
1248
1262
|
"font.sample_text_placeholder": "Type custom text..."
|
|
1249
1263
|
}, ne = {
|
|
1250
|
-
"zh-CN":
|
|
1251
|
-
"en-US":
|
|
1252
|
-
},
|
|
1253
|
-
function
|
|
1254
|
-
return t ? e.replace(
|
|
1264
|
+
"zh-CN": no,
|
|
1265
|
+
"en-US": ao
|
|
1266
|
+
}, io = /\{(\w+)\}/g;
|
|
1267
|
+
function lo(e, t) {
|
|
1268
|
+
return t ? e.replace(io, (o, n) => {
|
|
1255
1269
|
const i = t[n];
|
|
1256
1270
|
return i === void 0 ? `{${n}}` : String(i);
|
|
1257
1271
|
}) : e;
|
|
@@ -1261,10 +1275,10 @@ function Ke(e) {
|
|
|
1261
1275
|
const o = e.fallbackLocale ?? "zh-CN", n = ne[e.locale] ?? ne[o] ?? ne["zh-CN"], i = (t = e.messages) == null ? void 0 : t[e.locale], a = i ? { ...n, ...i } : n, l = ne["zh-CN"];
|
|
1262
1276
|
return (s, r) => {
|
|
1263
1277
|
const u = a[s] ?? l[s] ?? s;
|
|
1264
|
-
return
|
|
1278
|
+
return lo(u, r);
|
|
1265
1279
|
};
|
|
1266
1280
|
}
|
|
1267
|
-
const
|
|
1281
|
+
const ro = {
|
|
1268
1282
|
// 标准图片格式
|
|
1269
1283
|
jpg: "image/jpeg",
|
|
1270
1284
|
jpeg: "image/jpeg",
|
|
@@ -1345,16 +1359,16 @@ const lo = {
|
|
|
1345
1359
|
ttml: "application/ttml+xml",
|
|
1346
1360
|
dfxp: "application/ttml+xml"
|
|
1347
1361
|
};
|
|
1348
|
-
function
|
|
1362
|
+
function so(e) {
|
|
1349
1363
|
const t = e.toLowerCase();
|
|
1350
|
-
return
|
|
1364
|
+
return ro[t] || "application/octet-stream";
|
|
1351
1365
|
}
|
|
1352
|
-
function
|
|
1366
|
+
function uo(e) {
|
|
1353
1367
|
var t;
|
|
1354
1368
|
const o = ((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "";
|
|
1355
|
-
return
|
|
1369
|
+
return so(o);
|
|
1356
1370
|
}
|
|
1357
|
-
function
|
|
1371
|
+
function co(e) {
|
|
1358
1372
|
return [
|
|
1359
1373
|
"image/heic",
|
|
1360
1374
|
"image/heif",
|
|
@@ -1371,33 +1385,33 @@ function uo(e) {
|
|
|
1371
1385
|
"image/jpx"
|
|
1372
1386
|
].includes(e);
|
|
1373
1387
|
}
|
|
1374
|
-
const
|
|
1375
|
-
async function
|
|
1376
|
-
if (
|
|
1377
|
-
return
|
|
1378
|
-
if (!
|
|
1388
|
+
const be = /* @__PURE__ */ new Map();
|
|
1389
|
+
async function Un(e) {
|
|
1390
|
+
if (be.has(e))
|
|
1391
|
+
return be.get(e);
|
|
1392
|
+
if (!co(e))
|
|
1379
1393
|
return null;
|
|
1380
1394
|
try {
|
|
1381
1395
|
let t = null;
|
|
1382
|
-
return e === "image/heic" || e === "image/heif" ? t = (await import("./heicLoader-CH_raQNn-1fBLaICM.mjs")).default : e === "image/avif" ? t = (await import("./avifLoader-BP3fgcMm-BnpxLhxp.mjs")).default : e === "image/tiff" ? t = (await import("./tiffLoader-CTFKVLqJ-B84NfwhR.mjs")).default : e === "image/x-canon-cr2" || e === "image/x-nikon-nef" || e === "image/x-sony-arw" || e === "image/x-adobe-dng" || e === "image/x-fuji-raf" || e === "image/x-olympus-orf" ? t = (await import("./rawLoader-0mLvxCNp-CJmERiK7.mjs")).default : e === "image/vnd.adobe.photoshop" ? t = (await import("./psdLoader-Doxw3mWm-DVOGFSlh.mjs")).default : (e === "image/jp2" || e === "image/jpx") && (t = (await import("./jp2Loader-Bn-qPMbD-Bn-qPMbD.mjs")).default), t &&
|
|
1396
|
+
return e === "image/heic" || e === "image/heif" ? t = (await import("./heicLoader-CH_raQNn-1fBLaICM.mjs")).default : e === "image/avif" ? t = (await import("./avifLoader-BP3fgcMm-BnpxLhxp.mjs")).default : e === "image/tiff" ? t = (await import("./tiffLoader-CTFKVLqJ-B84NfwhR.mjs")).default : e === "image/x-canon-cr2" || e === "image/x-nikon-nef" || e === "image/x-sony-arw" || e === "image/x-adobe-dng" || e === "image/x-fuji-raf" || e === "image/x-olympus-orf" ? t = (await import("./rawLoader-0mLvxCNp-CJmERiK7.mjs")).default : e === "image/vnd.adobe.photoshop" ? t = (await import("./psdLoader-Doxw3mWm-DVOGFSlh.mjs")).default : (e === "image/jp2" || e === "image/jpx") && (t = (await import("./jp2Loader-Bn-qPMbD-Bn-qPMbD.mjs")).default), t && be.set(e, t), t;
|
|
1383
1397
|
} catch (t) {
|
|
1384
1398
|
return console.warn(`Failed to load image decoder for ${e}:`, t), null;
|
|
1385
1399
|
}
|
|
1386
1400
|
}
|
|
1387
|
-
async function
|
|
1401
|
+
async function Hn(e) {
|
|
1388
1402
|
if (e.type && e.type !== "application/octet-stream")
|
|
1389
1403
|
return e.type;
|
|
1390
|
-
const t =
|
|
1404
|
+
const t = uo(e.name);
|
|
1391
1405
|
if (t !== "application/octet-stream")
|
|
1392
1406
|
return t;
|
|
1393
1407
|
if (e instanceof Blob || e instanceof File) {
|
|
1394
|
-
const o = await
|
|
1408
|
+
const o = await fo(e);
|
|
1395
1409
|
if (o !== "application/octet-stream")
|
|
1396
1410
|
return o;
|
|
1397
1411
|
}
|
|
1398
1412
|
return "application/octet-stream";
|
|
1399
1413
|
}
|
|
1400
|
-
async function
|
|
1414
|
+
async function fo(e) {
|
|
1401
1415
|
try {
|
|
1402
1416
|
const t = new Uint8Array(await e.slice(0, 12).arrayBuffer());
|
|
1403
1417
|
if (t[4] === 102 && t[5] === 116 && t[6] === 121 && t[7] === 112) {
|
|
@@ -1419,37 +1433,37 @@ async function co(e) {
|
|
|
1419
1433
|
return "application/octet-stream";
|
|
1420
1434
|
}
|
|
1421
1435
|
const Ye = Symbol("file-preview-locale");
|
|
1422
|
-
function
|
|
1423
|
-
const o =
|
|
1436
|
+
function po(e, t) {
|
|
1437
|
+
const o = R(() => v(e) ?? "zh-CN"), n = R(
|
|
1424
1438
|
() => Ke({ locale: o.value, messages: v(t) })
|
|
1425
1439
|
);
|
|
1426
1440
|
ie(Ye, { locale: o, t: n });
|
|
1427
1441
|
}
|
|
1428
|
-
let
|
|
1429
|
-
function
|
|
1430
|
-
return
|
|
1442
|
+
let we = null;
|
|
1443
|
+
function mo() {
|
|
1444
|
+
return we || (we = Ke({ locale: "zh-CN" })), we;
|
|
1431
1445
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const e =
|
|
1446
|
+
function _e() {
|
|
1447
|
+
const e = ye(Ye, null);
|
|
1434
1448
|
if (e) return e;
|
|
1435
|
-
const t =
|
|
1449
|
+
const t = R(() => "zh-CN"), o = R(() => mo());
|
|
1436
1450
|
return { locale: t, t: o };
|
|
1437
1451
|
}
|
|
1438
1452
|
const Je = Symbol("vfp-resolved-theme");
|
|
1439
|
-
function
|
|
1440
|
-
const t =
|
|
1453
|
+
function vo(e) {
|
|
1454
|
+
const t = R(() => v(e));
|
|
1441
1455
|
ie(Je, t);
|
|
1442
1456
|
}
|
|
1443
|
-
function
|
|
1444
|
-
const e =
|
|
1445
|
-
return e ||
|
|
1457
|
+
function Vn() {
|
|
1458
|
+
const e = ye(Je, null);
|
|
1459
|
+
return e || R(() => "dark");
|
|
1446
1460
|
}
|
|
1447
1461
|
const Qe = Symbol("file-preview:request");
|
|
1448
|
-
function
|
|
1449
|
-
const t =
|
|
1462
|
+
function ho(e) {
|
|
1463
|
+
const t = R(() => {
|
|
1450
1464
|
const o = typeof e == "function" ? e() : e;
|
|
1451
1465
|
return {
|
|
1452
|
-
fetcher:
|
|
1466
|
+
fetcher: Lt({
|
|
1453
1467
|
requestInit: o.requestInit,
|
|
1454
1468
|
requestHandler: o.requestHandler
|
|
1455
1469
|
}),
|
|
@@ -1458,24 +1472,24 @@ function vo(e) {
|
|
|
1458
1472
|
});
|
|
1459
1473
|
return ie(Qe, t), t;
|
|
1460
1474
|
}
|
|
1461
|
-
function
|
|
1475
|
+
function go() {
|
|
1462
1476
|
return { fetcher: (e, t) => fetch(e, t) };
|
|
1463
1477
|
}
|
|
1464
1478
|
function et() {
|
|
1465
|
-
const e =
|
|
1466
|
-
return e ||
|
|
1479
|
+
const e = ye(Qe, void 0);
|
|
1480
|
+
return e || R(() => go());
|
|
1467
1481
|
}
|
|
1468
|
-
function
|
|
1482
|
+
function bo() {
|
|
1469
1483
|
const e = et();
|
|
1470
|
-
return
|
|
1484
|
+
return R(() => e.value.fetcher);
|
|
1471
1485
|
}
|
|
1472
|
-
function
|
|
1473
|
-
const t = et(), o =
|
|
1486
|
+
function wo(e) {
|
|
1487
|
+
const t = et(), o = _("");
|
|
1474
1488
|
let n = null;
|
|
1475
1489
|
const i = () => {
|
|
1476
1490
|
n && (URL.revokeObjectURL(n), n = null);
|
|
1477
1491
|
};
|
|
1478
|
-
return
|
|
1492
|
+
return O(
|
|
1479
1493
|
() => {
|
|
1480
1494
|
var s, r;
|
|
1481
1495
|
const a = e.value, l = !!(a && ((r = (s = t.value).shouldFetchAsBlob) != null && r.call(s, a)));
|
|
@@ -1491,24 +1505,24 @@ function bo(e) {
|
|
|
1491
1505
|
d = !0;
|
|
1492
1506
|
}), o.value = "";
|
|
1493
1507
|
try {
|
|
1494
|
-
const
|
|
1508
|
+
const p = await Wt(a.url, s);
|
|
1495
1509
|
if (d) {
|
|
1496
|
-
URL.revokeObjectURL(
|
|
1510
|
+
URL.revokeObjectURL(p);
|
|
1497
1511
|
return;
|
|
1498
1512
|
}
|
|
1499
|
-
i(), n =
|
|
1500
|
-
} catch (
|
|
1501
|
-
d || (console.error("[file-preview] resolve blob url failed:",
|
|
1513
|
+
i(), n = p, o.value = p;
|
|
1514
|
+
} catch (p) {
|
|
1515
|
+
d || (console.error("[file-preview] resolve blob url failed:", p), o.value = a.url);
|
|
1502
1516
|
}
|
|
1503
1517
|
},
|
|
1504
1518
|
{ immediate: !0 }
|
|
1505
|
-
),
|
|
1519
|
+
), X(i), R(() => {
|
|
1506
1520
|
var s, r;
|
|
1507
1521
|
const a = e.value;
|
|
1508
1522
|
return a ? !((r = (s = t.value).shouldFetchAsBlob) != null && r.call(s, a)) ? a.url : o.value : "";
|
|
1509
1523
|
});
|
|
1510
1524
|
}
|
|
1511
|
-
const xo = (e, { attrs: t }) =>
|
|
1525
|
+
const xo = (e, { attrs: t }) => H("svg", {
|
|
1512
1526
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1513
1527
|
viewBox: "0 0 24 24",
|
|
1514
1528
|
fill: "none",
|
|
@@ -1518,7 +1532,7 @@ const xo = (e, { attrs: t }) => O("svg", {
|
|
|
1518
1532
|
"stroke-linejoin": "round",
|
|
1519
1533
|
...t
|
|
1520
1534
|
}, [
|
|
1521
|
-
|
|
1535
|
+
H("text", {
|
|
1522
1536
|
x: "12",
|
|
1523
1537
|
y: "17.5",
|
|
1524
1538
|
"text-anchor": "middle",
|
|
@@ -1528,55 +1542,63 @@ const xo = (e, { attrs: t }) => O("svg", {
|
|
|
1528
1542
|
stroke: "none"
|
|
1529
1543
|
}, "1:1")
|
|
1530
1544
|
]);
|
|
1531
|
-
function
|
|
1545
|
+
function yo(e) {
|
|
1532
1546
|
return [
|
|
1533
1547
|
{
|
|
1534
1548
|
items: [
|
|
1535
|
-
{ type: "button", icon:
|
|
1549
|
+
{ type: "button", icon: qe, tooltip: e.t("toolbar.zoom_out"), action: e.onZoomOut, disabled: e.zoom <= 0.01 },
|
|
1536
1550
|
{ type: "text", content: `${Math.round(e.zoom * 100)}%`, minWidth: "3rem" },
|
|
1537
1551
|
{ type: "button", icon: Be, tooltip: e.t("toolbar.zoom_in"), action: e.onZoomIn, disabled: e.zoom >= 10 }
|
|
1538
1552
|
]
|
|
1539
1553
|
},
|
|
1540
1554
|
{
|
|
1541
1555
|
items: [
|
|
1542
|
-
{ type: "button", icon:
|
|
1556
|
+
{ type: "button", icon: wt, tooltip: e.t("toolbar.fit_to_window"), action: e.onFitToWidth },
|
|
1543
1557
|
{ type: "button", icon: xo, tooltip: e.t("toolbar.original_size"), action: e.onOriginalSize }
|
|
1544
1558
|
]
|
|
1545
1559
|
},
|
|
1546
1560
|
{
|
|
1547
1561
|
items: [
|
|
1548
1562
|
{ type: "button", icon: xt, tooltip: e.t("toolbar.rotate_left"), action: e.onRotateLeft },
|
|
1549
|
-
{ type: "button", icon:
|
|
1563
|
+
{ type: "button", icon: yt, tooltip: e.t("toolbar.rotate_right"), action: e.onRotateRight }
|
|
1550
1564
|
]
|
|
1551
1565
|
},
|
|
1552
1566
|
{
|
|
1553
1567
|
items: [
|
|
1554
|
-
{ type: "button", icon:
|
|
1568
|
+
{ type: "button", icon: Oe, tooltip: e.t("toolbar.reset"), action: e.onReset }
|
|
1555
1569
|
]
|
|
1556
1570
|
}
|
|
1557
1571
|
];
|
|
1558
1572
|
}
|
|
1559
|
-
function
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1573
|
+
function Fo(e) {
|
|
1574
|
+
const t = [];
|
|
1575
|
+
return e.onToggleOutline && t.push({
|
|
1576
|
+
items: [
|
|
1577
|
+
{ type: "button", icon: ke, tooltip: e.t("toolbar.outline"), action: e.onToggleOutline }
|
|
1578
|
+
]
|
|
1579
|
+
}), t.push({
|
|
1580
|
+
items: [
|
|
1581
|
+
{ type: "button", icon: le, tooltip: e.t("toolbar.prev_page"), action: e.onPrevPage, disabled: e.currentPage <= 1 },
|
|
1582
|
+
{ type: "text", content: `${e.currentPage} / ${e.totalPages}`, minWidth: "4rem" },
|
|
1583
|
+
{ type: "button", icon: re, tooltip: e.t("toolbar.next_page"), action: e.onNextPage, disabled: e.currentPage >= e.totalPages }
|
|
1584
|
+
]
|
|
1585
|
+
}), t.push({
|
|
1586
|
+
items: [
|
|
1587
|
+
{ type: "button", icon: qe, tooltip: e.t("toolbar.zoom_out"), action: e.onZoomOut, disabled: e.zoom <= 0.01 },
|
|
1588
|
+
{ type: "text", content: `${Math.round(e.zoom * 100)}%`, minWidth: "3rem" },
|
|
1589
|
+
{ type: "button", icon: Be, tooltip: e.t("toolbar.zoom_in"), action: e.onZoomIn, disabled: e.zoom >= 10 }
|
|
1590
|
+
]
|
|
1591
|
+
}), t.push({
|
|
1592
|
+
items: [
|
|
1593
|
+
{ type: "button", icon: Oe, tooltip: e.t("toolbar.reset"), action: e.onReset }
|
|
1594
|
+
]
|
|
1595
|
+
}), t;
|
|
1574
1596
|
}
|
|
1575
1597
|
function ko(e) {
|
|
1576
1598
|
return [
|
|
1577
1599
|
{
|
|
1578
1600
|
items: [
|
|
1579
|
-
{ type: "button", icon:
|
|
1601
|
+
{ type: "button", icon: ke, tooltip: e.t("toolbar.toc"), action: () => {
|
|
1580
1602
|
var t;
|
|
1581
1603
|
return (t = e.epubRef) == null ? void 0 : t.toggleToc();
|
|
1582
1604
|
} }
|
|
@@ -1584,12 +1606,12 @@ function ko(e) {
|
|
|
1584
1606
|
},
|
|
1585
1607
|
{
|
|
1586
1608
|
items: [
|
|
1587
|
-
{ type: "button", icon:
|
|
1609
|
+
{ type: "button", icon: le, tooltip: e.t("toolbar.prev_page"), action: () => {
|
|
1588
1610
|
var t;
|
|
1589
1611
|
return (t = e.epubRef) == null ? void 0 : t.prevPage();
|
|
1590
1612
|
} },
|
|
1591
1613
|
{ type: "text", content: `${e.current} / ${e.total}`, minWidth: "4rem" },
|
|
1592
|
-
{ type: "button", icon:
|
|
1614
|
+
{ type: "button", icon: re, tooltip: e.t("toolbar.next_page"), action: () => {
|
|
1593
1615
|
var t;
|
|
1594
1616
|
return (t = e.epubRef) == null ? void 0 : t.nextPage();
|
|
1595
1617
|
} }
|
|
@@ -1610,11 +1632,11 @@ function ko(e) {
|
|
|
1610
1632
|
}
|
|
1611
1633
|
];
|
|
1612
1634
|
}
|
|
1613
|
-
function
|
|
1635
|
+
function Co(e) {
|
|
1614
1636
|
return [
|
|
1615
1637
|
{
|
|
1616
1638
|
items: [
|
|
1617
|
-
{ type: "button", icon:
|
|
1639
|
+
{ type: "button", icon: ke, tooltip: e.t("toolbar.toc"), action: () => {
|
|
1618
1640
|
var t;
|
|
1619
1641
|
return (t = e.mobiRef) == null ? void 0 : t.toggleToc();
|
|
1620
1642
|
} }
|
|
@@ -1622,12 +1644,12 @@ function Fo(e) {
|
|
|
1622
1644
|
},
|
|
1623
1645
|
{
|
|
1624
1646
|
items: [
|
|
1625
|
-
{ type: "button", icon:
|
|
1647
|
+
{ type: "button", icon: le, tooltip: e.t("toolbar.prev_page"), action: () => {
|
|
1626
1648
|
var t;
|
|
1627
1649
|
return (t = e.mobiRef) == null ? void 0 : t.prevPage();
|
|
1628
1650
|
} },
|
|
1629
1651
|
{ type: "text", content: `${e.current} / ${e.total}`, minWidth: "4rem" },
|
|
1630
|
-
{ type: "button", icon:
|
|
1652
|
+
{ type: "button", icon: re, tooltip: e.t("toolbar.next_page"), action: () => {
|
|
1631
1653
|
var t;
|
|
1632
1654
|
return (t = e.mobiRef) == null ? void 0 : t.nextPage();
|
|
1633
1655
|
} }
|
|
@@ -1648,26 +1670,26 @@ function Fo(e) {
|
|
|
1648
1670
|
}
|
|
1649
1671
|
];
|
|
1650
1672
|
}
|
|
1651
|
-
function
|
|
1673
|
+
function _o({ stats: e }) {
|
|
1652
1674
|
return e ? [
|
|
1653
1675
|
{
|
|
1654
1676
|
items: [
|
|
1655
1677
|
{
|
|
1656
1678
|
type: "text",
|
|
1657
|
-
content: `${e.files} files · ${e.dirs} dirs · ${
|
|
1679
|
+
content: `${e.files} files · ${e.dirs} dirs · ${Et(e.size)}`,
|
|
1658
1680
|
minWidth: "10rem"
|
|
1659
1681
|
}
|
|
1660
1682
|
]
|
|
1661
1683
|
}
|
|
1662
1684
|
] : [];
|
|
1663
1685
|
}
|
|
1664
|
-
function
|
|
1686
|
+
function Ro(e) {
|
|
1665
1687
|
const t = [
|
|
1666
1688
|
{
|
|
1667
1689
|
items: [
|
|
1668
1690
|
{
|
|
1669
1691
|
type: "button",
|
|
1670
|
-
icon:
|
|
1692
|
+
icon: H(Ft, { class: "vfp-w-4 vfp-h-4" }),
|
|
1671
1693
|
tooltip: e.wordWrap ? e.t("toolbar.wrap_off") : e.t("toolbar.wrap_on"),
|
|
1672
1694
|
action: e.onToggleWrap
|
|
1673
1695
|
}
|
|
@@ -1678,20 +1700,20 @@ function _o(e) {
|
|
|
1678
1700
|
items: [
|
|
1679
1701
|
{
|
|
1680
1702
|
type: "button",
|
|
1681
|
-
icon: e.htmlPreview ?
|
|
1703
|
+
icon: e.htmlPreview ? H(Ve, { class: "vfp-w-4 vfp-h-4" }) : H(Ze, { class: "vfp-w-4 vfp-h-4" }),
|
|
1682
1704
|
tooltip: e.htmlPreview ? e.t("toolbar.source") : e.t("toolbar.preview"),
|
|
1683
1705
|
action: e.onToggleHtmlPreview
|
|
1684
1706
|
}
|
|
1685
1707
|
]
|
|
1686
1708
|
}), t;
|
|
1687
1709
|
}
|
|
1688
|
-
function
|
|
1710
|
+
function Po(e) {
|
|
1689
1711
|
return [
|
|
1690
1712
|
{
|
|
1691
1713
|
items: [
|
|
1692
1714
|
{
|
|
1693
1715
|
type: "button",
|
|
1694
|
-
icon: e.viewMode === "preview" ?
|
|
1716
|
+
icon: e.viewMode === "preview" ? H(Ve, { class: "vfp-w-4 vfp-h-4" }) : H(Ze, { class: "vfp-w-4 vfp-h-4" }),
|
|
1695
1717
|
tooltip: e.viewMode === "preview" ? e.t("toolbar.source") : e.t("toolbar.preview"),
|
|
1696
1718
|
action: e.onToggleViewMode
|
|
1697
1719
|
}
|
|
@@ -1699,22 +1721,22 @@ function Ro(e) {
|
|
|
1699
1721
|
}
|
|
1700
1722
|
];
|
|
1701
1723
|
}
|
|
1702
|
-
const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-text-fg-muted" }, Mo = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-gap-3" }, jo = { class: "vfp-text-sm" },
|
|
1724
|
+
const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-text-fg-muted" }, Mo = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-gap-3" }, jo = { class: "vfp-text-sm" }, To = /* @__PURE__ */ K({
|
|
1703
1725
|
__name: "RendererLoading",
|
|
1704
1726
|
setup(e) {
|
|
1705
|
-
const { t } =
|
|
1727
|
+
const { t } = _e();
|
|
1706
1728
|
return (o, n) => (f(), b("div", zo, [
|
|
1707
|
-
|
|
1708
|
-
n[0] || (n[0] =
|
|
1709
|
-
|
|
1729
|
+
S("div", Mo, [
|
|
1730
|
+
n[0] || (n[0] = S("div", { class: "vfp-w-8 vfp-h-8 vfp-rounded-full vfp-border-2 vfp-border-fg-muted vfp-border-t-transparent vfp-animate-spin" }, null, -1)),
|
|
1731
|
+
S("span", jo, B(v(t)("common.loading") || "Loading..."), 1)
|
|
1710
1732
|
])
|
|
1711
1733
|
]));
|
|
1712
1734
|
}
|
|
1713
|
-
}),
|
|
1735
|
+
}), N = (e) => pt({
|
|
1714
1736
|
loader: e,
|
|
1715
|
-
loadingComponent: { render: () =>
|
|
1737
|
+
loadingComponent: { render: () => H(To) },
|
|
1716
1738
|
delay: 0
|
|
1717
|
-
}),
|
|
1739
|
+
}), Eo = N(() => import("./index-CGSq7-Q-.mjs")), So = N(() => import("./index-CYa_XneH.mjs")), No = N(() => import("./index-B-LW-GJO.mjs")), $o = N(() => import("./index-CoITLoYL.mjs")), Lo = N(() => import("./index-BT9hXA6r.mjs")), Wo = N(() => import("./index-OOoaYpkl.mjs")), Io = N(() => import("./index-8ETACZ6T.mjs")), Do = N(() => import("./index-C-Mu0fvH.mjs")), Ao = N(() => import("./index-By6vGdnK.mjs")), qo = N(() => import("./index-DAdO2lkI.mjs")), Bo = N(() => import("./index-DglMeKJM.mjs")), Oo = N(() => import("./index-jcgLzyDR.mjs")), Uo = N(() => import("./index-DGqDJMot.mjs")), Ho = N(() => import("./index-DTyG1Wzp.mjs")), Vo = N(() => import("./index-CbJkkdEB.mjs")), Zo = N(() => import("./index-BcKI75RW.mjs")), Go = N(() => import("./index-CWpU8prZ.mjs")), Xo = N(() => import("./index-nFIiu1lA.mjs")), Ko = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-p-6 vfp-gap-4" }, Yo = { class: "vfp-w-20 vfp-h-20 vfp-rounded-full vfp-bg-surface-2 vfp-flex vfp-items-center vfp-justify-center" }, Jo = { class: "vfp-text-fg-primary vfp-text-center" }, Qo = { class: "vfp-text-lg vfp-font-medium vfp-mb-2" }, en = { class: "vfp-text-fg-secondary" }, Ae = /* @__PURE__ */ K({
|
|
1718
1740
|
__name: "index",
|
|
1719
1741
|
props: {
|
|
1720
1742
|
fileName: {},
|
|
@@ -1722,25 +1744,25 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
1722
1744
|
},
|
|
1723
1745
|
emits: ["download"],
|
|
1724
1746
|
setup(e, { emit: t }) {
|
|
1725
|
-
const { t: o } =
|
|
1726
|
-
return (i, a) => (f(), b("div",
|
|
1727
|
-
|
|
1728
|
-
|
|
1747
|
+
const { t: o } = _e(), n = t;
|
|
1748
|
+
return (i, a) => (f(), b("div", Ko, [
|
|
1749
|
+
S("div", Yo, [
|
|
1750
|
+
Z(v(kt), { class: "vfp-w-10 vfp-h-10 vfp-text-fg-secondary" })
|
|
1729
1751
|
]),
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1752
|
+
S("div", Jo, [
|
|
1753
|
+
S("p", Qo, B(e.fileName), 1),
|
|
1754
|
+
S("p", en, B(v(o)("common.unsupported_preview", { type: e.fileType })), 1)
|
|
1733
1755
|
]),
|
|
1734
|
-
|
|
1735
|
-
class: "vfp-flex vfp-items-center vfp-gap-2 vfp-px-
|
|
1756
|
+
S("button", {
|
|
1757
|
+
class: "vfp-flex vfp-items-center vfp-gap-2 vfp-px-4 vfp-py-2 vfp-bg-surface-2 hover:vfp-bg-surface-3 vfp-backdrop-blur-sm vfp-rounded-lg vfp-text-fg-primary vfp-font-medium vfp-transition-all",
|
|
1736
1758
|
onClick: a[0] || (a[0] = (l) => n("download"))
|
|
1737
1759
|
}, [
|
|
1738
|
-
|
|
1739
|
-
|
|
1760
|
+
Z(v(Ge), { class: "vfp-w-5 vfp-h-5" }),
|
|
1761
|
+
mt(" " + B(v(o)("common.download")), 1)
|
|
1740
1762
|
])
|
|
1741
1763
|
]));
|
|
1742
1764
|
}
|
|
1743
|
-
}),
|
|
1765
|
+
}), tn = 2e3, on = /* @__PURE__ */ K({
|
|
1744
1766
|
__name: "NavArrows",
|
|
1745
1767
|
props: {
|
|
1746
1768
|
containerRef: {},
|
|
@@ -1750,28 +1772,28 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
1750
1772
|
},
|
|
1751
1773
|
emits: ["prev", "next"],
|
|
1752
1774
|
setup(e, { emit: t }) {
|
|
1753
|
-
const o = e, n = t, i =
|
|
1775
|
+
const o = e, n = t, i = _(!0);
|
|
1754
1776
|
let a = null;
|
|
1755
1777
|
const l = () => {
|
|
1756
1778
|
a !== null && clearTimeout(a), a = window.setTimeout(() => {
|
|
1757
1779
|
i.value = !1;
|
|
1758
|
-
},
|
|
1780
|
+
}, tn);
|
|
1759
1781
|
}, s = () => {
|
|
1760
1782
|
i.value || (i.value = !0), l();
|
|
1761
1783
|
};
|
|
1762
1784
|
let r = null;
|
|
1763
1785
|
const u = () => {
|
|
1764
1786
|
r && (r.removeEventListener("mousemove", s), r = null);
|
|
1765
|
-
}, d = (
|
|
1766
|
-
r !==
|
|
1787
|
+
}, d = (p) => {
|
|
1788
|
+
r !== p && (u(), p && (p.addEventListener("mousemove", s), r = p));
|
|
1767
1789
|
};
|
|
1768
|
-
return
|
|
1790
|
+
return O(() => o.containerRef, (p) => d(p), { immediate: !0 }), O(() => o.resetKey, () => {
|
|
1769
1791
|
i.value = !0, l();
|
|
1770
|
-
}),
|
|
1792
|
+
}), Fe(() => {
|
|
1771
1793
|
l();
|
|
1772
|
-
}),
|
|
1794
|
+
}), X(() => {
|
|
1773
1795
|
a !== null && clearTimeout(a), u();
|
|
1774
|
-
}), (
|
|
1796
|
+
}), (p, m) => (f(), b(T, null, [
|
|
1775
1797
|
e.hasPrev ? (f(), b("button", {
|
|
1776
1798
|
key: 0,
|
|
1777
1799
|
style: ae({
|
|
@@ -1781,11 +1803,11 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
1781
1803
|
transition: "opacity 0.2s, transform 0.2s"
|
|
1782
1804
|
}),
|
|
1783
1805
|
class: "vfp-absolute vfp-z-20 vfp-left-2 md:vfp-left-4 vfp-top-1/2 vfp-w-10 vfp-h-10 md:vfp-w-12 md:vfp-h-12 vfp-rounded-full vfp-backdrop-blur-xl vfp-border vfp-flex vfp-items-center vfp-justify-center vfp-transition-colors vfp-shadow-2xl vfp-bg-surface-nav vfp-border-line hover:vfp-bg-surface-nav-hover vfp-text-fg-primary",
|
|
1784
|
-
onClick:
|
|
1806
|
+
onClick: m[0] || (m[0] = (c) => n("prev")),
|
|
1785
1807
|
onMouseenter: s
|
|
1786
1808
|
}, [
|
|
1787
|
-
|
|
1788
|
-
], 36)) :
|
|
1809
|
+
Z(v(le), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
|
|
1810
|
+
], 36)) : I("", !0),
|
|
1789
1811
|
e.hasNext ? (f(), b("button", {
|
|
1790
1812
|
key: 1,
|
|
1791
1813
|
style: ae({
|
|
@@ -1795,24 +1817,24 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
1795
1817
|
transition: "opacity 0.2s, transform 0.2s"
|
|
1796
1818
|
}),
|
|
1797
1819
|
class: "vfp-absolute vfp-z-20 vfp-right-2 md:vfp-right-4 vfp-top-1/2 vfp-w-10 vfp-h-10 md:vfp-w-12 md:vfp-h-12 vfp-rounded-full vfp-backdrop-blur-xl vfp-border vfp-flex vfp-items-center vfp-justify-center vfp-transition-colors vfp-shadow-2xl vfp-bg-surface-nav vfp-border-line hover:vfp-bg-surface-nav-hover vfp-text-fg-primary",
|
|
1798
|
-
onClick:
|
|
1820
|
+
onClick: m[1] || (m[1] = (c) => n("next")),
|
|
1799
1821
|
onMouseenter: s
|
|
1800
1822
|
}, [
|
|
1801
|
-
|
|
1802
|
-
], 36)) :
|
|
1823
|
+
Z(v(re), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
|
|
1824
|
+
], 36)) : I("", !0)
|
|
1803
1825
|
], 64));
|
|
1804
1826
|
}
|
|
1805
|
-
}),
|
|
1827
|
+
}), nn = ["tabindex", "data-theme"], an = {
|
|
1806
1828
|
key: 0,
|
|
1807
1829
|
class: "vfp-flex-shrink-0 vfp-z-10 vfp-backdrop-blur-md vfp-border-b vfp-bg-surface-toolbar vfp-border-line",
|
|
1808
1830
|
style: { "padding-top": "env(safe-area-inset-top, 0px)" }
|
|
1809
|
-
},
|
|
1831
|
+
}, ln = { class: "vfp-flex vfp-items-center vfp-justify-between vfp-px-3 md:vfp-px-5 vfp-py-1.5 md:vfp-py-2.5" }, rn = { class: "vfp-flex vfp-items-center vfp-flex-1 vfp-min-w-0 vfp-mr-2 md:vfp-mr-3" }, sn = { class: "vfp-font-medium vfp-text-xs md:vfp-text-sm vfp-truncate vfp-text-fg-primary" }, un = { class: "vfp-text-xs vfp-ml-2 vfp-flex-shrink-0 vfp-text-fg-muted" }, dn = { class: "vfp-flex vfp-items-center vfp-gap-1 md:vfp-hidden vfp-flex-shrink-0" }, cn = ["data-tooltip", "disabled", "onClick"], fn = { class: "vfp-hidden md:vfp-flex vfp-items-center vfp-gap-1 vfp-flex-shrink-0" }, pn = ["data-tooltip", "disabled", "onClick"], mn = ["data-tooltip", "disabled", "onClick"], vn = {
|
|
1810
1832
|
key: 0,
|
|
1811
1833
|
class: "vfp-flex vfp-items-center vfp-gap-1 vfp-px-3 vfp-pb-1.5 vfp-overflow-x-auto scrollbar-hide md:vfp-hidden"
|
|
1812
|
-
},
|
|
1834
|
+
}, hn = {
|
|
1813
1835
|
key: 0,
|
|
1814
1836
|
class: "vfp-w-px vfp-h-4 vfp-mx-0.5 vfp-bg-divide"
|
|
1815
|
-
},
|
|
1837
|
+
}, gn = ["data-tooltip", "disabled", "onClick"], bn = 3, wn = /* @__PURE__ */ K({
|
|
1816
1838
|
__name: "FilePreviewContent",
|
|
1817
1839
|
props: {
|
|
1818
1840
|
files: {},
|
|
@@ -1827,210 +1849,230 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
1827
1849
|
requestInit: { type: Function, default: void 0 },
|
|
1828
1850
|
requestHandler: { type: Function, default: void 0 },
|
|
1829
1851
|
shouldFetchAsBlob: { type: Function, default: void 0 },
|
|
1830
|
-
onDownload: { type: Function, default: void 0 }
|
|
1852
|
+
onDownload: { type: Function, default: void 0 },
|
|
1853
|
+
onClose: { type: Function, default: void 0 }
|
|
1831
1854
|
},
|
|
1832
1855
|
emits: ["navigate", "close", "custom-event"],
|
|
1833
1856
|
setup(e, { emit: t }) {
|
|
1834
1857
|
const o = e;
|
|
1835
|
-
|
|
1858
|
+
ho(() => ({
|
|
1836
1859
|
requestInit: o.requestInit,
|
|
1837
1860
|
requestHandler: o.requestHandler,
|
|
1838
1861
|
shouldFetchAsBlob: o.shouldFetchAsBlob
|
|
1839
1862
|
}));
|
|
1840
1863
|
const n = t;
|
|
1841
|
-
|
|
1842
|
-
const { t: i } =
|
|
1864
|
+
po(Se(o, "locale"), Se(o, "messages"));
|
|
1865
|
+
const { t: i } = _e(), a = _(
|
|
1843
1866
|
typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
1844
1867
|
);
|
|
1845
1868
|
let l = null;
|
|
1846
|
-
|
|
1869
|
+
O(
|
|
1847
1870
|
() => o.theme,
|
|
1848
1871
|
(y) => {
|
|
1849
1872
|
if (l && (l(), l = null), y === "auto") {
|
|
1850
|
-
const
|
|
1851
|
-
a.value =
|
|
1873
|
+
const h = window.matchMedia("(prefers-color-scheme: dark)"), W = ($) => {
|
|
1874
|
+
a.value = $.matches;
|
|
1852
1875
|
};
|
|
1853
|
-
|
|
1876
|
+
h.addEventListener("change", W), l = () => h.removeEventListener("change", W);
|
|
1854
1877
|
}
|
|
1855
1878
|
},
|
|
1856
1879
|
{ immediate: !0 }
|
|
1857
|
-
),
|
|
1880
|
+
), X(() => {
|
|
1858
1881
|
l && l();
|
|
1859
1882
|
});
|
|
1860
|
-
const s =
|
|
1883
|
+
const s = R(
|
|
1861
1884
|
() => o.theme === "auto" ? a.value ? "dark" : "light" : o.theme
|
|
1862
1885
|
);
|
|
1863
|
-
|
|
1864
|
-
const r =
|
|
1865
|
-
if (!
|
|
1866
|
-
const
|
|
1867
|
-
n("custom-event",
|
|
1868
|
-
}, te =
|
|
1869
|
-
emit:
|
|
1886
|
+
vo(s);
|
|
1887
|
+
const r = _(1), u = _(0), d = _(1), p = _(1), m = _(0), c = _(0), w = _(0), P = _(!1), j = _(null), M = _(null), L = R(() => jt(o.files)), g = R(() => L.value[o.currentIndex]), z = wo(g), D = R(() => g.value && o.customRenderers.find((y) => y.test(g.value)) || null), q = R(() => !D.value || !g.value ? null : D.value.render(g.value, te.value)), x = R(() => g.value ? Tt(g.value) : "unsupported"), tt = (y, h) => {
|
|
1888
|
+
if (!g.value) return;
|
|
1889
|
+
const W = { name: y, payload: h, file: g.value };
|
|
1890
|
+
n("custom-event", W);
|
|
1891
|
+
}, te = R(() => ({
|
|
1892
|
+
emit: tt,
|
|
1870
1893
|
t: i.value,
|
|
1871
1894
|
theme: s.value,
|
|
1872
1895
|
locale: o.locale ?? "zh-CN"
|
|
1873
1896
|
}));
|
|
1874
|
-
ie("file-preview:custom-ctx", te),
|
|
1897
|
+
ie("file-preview:custom-ctx", te), O(
|
|
1875
1898
|
() => o.currentIndex,
|
|
1876
1899
|
() => {
|
|
1877
|
-
r.value = 1, u.value = 0, d.value = 1,
|
|
1900
|
+
r.value = 1, u.value = 0, d.value = 1, p.value = 1, m.value = 0, c.value = 0, w.value = 0, ue.value = 0, de.value = 0, ce.value = !1, fe.value = 0, pe.value = 0, me.value = !1, ve.value = null, Y.value = !0, J.value = !1, Q.value = "preview";
|
|
1878
1901
|
}
|
|
1879
|
-
),
|
|
1880
|
-
[x,
|
|
1902
|
+
), O(
|
|
1903
|
+
[x, m, c],
|
|
1881
1904
|
() => {
|
|
1882
|
-
if (x.value === "image" &&
|
|
1883
|
-
const y =
|
|
1884
|
-
r.value = Math.max(0.01, Math.min(10,
|
|
1905
|
+
if (x.value === "image" && m.value > 0 && c.value > 0 && j.value) {
|
|
1906
|
+
const y = j.value.clientWidth, h = j.value.clientHeight, W = y / m.value, $ = h / c.value, A = Math.min(W, $);
|
|
1907
|
+
r.value = Math.max(0.01, Math.min(10, A));
|
|
1885
1908
|
}
|
|
1886
1909
|
}
|
|
1887
1910
|
);
|
|
1888
1911
|
const oe = (y) => {
|
|
1889
|
-
y.key === "Escape" && o.mode === "modal" ? n("close") : y.key === "ArrowLeft" && o.currentIndex > 0 ? n("navigate", o.currentIndex - 1) : y.key === "ArrowRight" && o.currentIndex <
|
|
1912
|
+
y.key === "Escape" && o.mode === "modal" ? n("close") : y.key === "ArrowLeft" && o.currentIndex > 0 ? n("navigate", o.currentIndex - 1) : y.key === "ArrowRight" && o.currentIndex < L.value.length - 1 && n("navigate", o.currentIndex + 1);
|
|
1890
1913
|
};
|
|
1891
|
-
|
|
1892
|
-
o.mode === "modal" ? window.addEventListener("keydown", oe) :
|
|
1893
|
-
}),
|
|
1894
|
-
o.mode === "modal" ? window.removeEventListener("keydown", oe) :
|
|
1914
|
+
Fe(() => {
|
|
1915
|
+
o.mode === "modal" ? window.addEventListener("keydown", oe) : M.value && M.value.addEventListener("keydown", oe);
|
|
1916
|
+
}), X(() => {
|
|
1917
|
+
o.mode === "modal" ? window.removeEventListener("keydown", oe) : M.value && M.value.removeEventListener("keydown", oe);
|
|
1895
1918
|
});
|
|
1896
|
-
const
|
|
1919
|
+
const Pe = () => {
|
|
1897
1920
|
r.value = Math.min(r.value + 0.1, 10);
|
|
1898
1921
|
}, ze = () => {
|
|
1899
1922
|
r.value = Math.max(r.value - 0.1, 0.01);
|
|
1900
|
-
}, tt = () => {
|
|
1901
|
-
u.value = u.value + 90;
|
|
1902
1923
|
}, ot = () => {
|
|
1903
|
-
u.value = u.value
|
|
1924
|
+
u.value = u.value + 90;
|
|
1904
1925
|
}, nt = () => {
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1926
|
+
u.value = u.value - 90;
|
|
1927
|
+
}, at = () => {
|
|
1928
|
+
if (j.value && m.value > 0 && c.value > 0) {
|
|
1929
|
+
const y = j.value.clientWidth, h = j.value.clientHeight, W = y / m.value, $ = h / c.value, A = Math.min(W, $);
|
|
1930
|
+
r.value = Math.max(0.01, Math.min(10, A));
|
|
1908
1931
|
} else
|
|
1909
1932
|
r.value = 1;
|
|
1910
1933
|
u.value = 0, w.value++;
|
|
1911
|
-
},
|
|
1934
|
+
}, it = () => {
|
|
1912
1935
|
r.value = 1, u.value = 0, w.value++;
|
|
1913
|
-
},
|
|
1936
|
+
}, lt = (y) => {
|
|
1914
1937
|
r.value = y;
|
|
1915
1938
|
}, Me = () => {
|
|
1916
1939
|
r.value = 1, u.value = 0, w.value++;
|
|
1917
|
-
},
|
|
1918
|
-
if (
|
|
1940
|
+
}, rt = bo(), se = async () => {
|
|
1941
|
+
if (g.value) {
|
|
1919
1942
|
if (o.onDownload) {
|
|
1920
|
-
await o.onDownload(
|
|
1943
|
+
await o.onDownload(g.value);
|
|
1921
1944
|
return;
|
|
1922
1945
|
}
|
|
1923
1946
|
try {
|
|
1924
|
-
await
|
|
1947
|
+
await It(g.value.url, g.value.name, rt.value);
|
|
1925
1948
|
} catch (y) {
|
|
1926
1949
|
console.error("[file-preview] download failed:", y);
|
|
1927
1950
|
}
|
|
1928
1951
|
}
|
|
1929
|
-
},
|
|
1930
|
-
|
|
1931
|
-
},
|
|
1932
|
-
|
|
1933
|
-
},
|
|
1934
|
-
|
|
1935
|
-
},
|
|
1936
|
-
var y,
|
|
1937
|
-
if (
|
|
1938
|
-
return ((
|
|
1952
|
+
}, st = R(() => !!o.onClose), je = _(null), ue = _(0), de = _(0), ce = _(!1), Te = _(null), fe = _(0), pe = _(0), me = _(!1), ut = (y, h) => {
|
|
1953
|
+
ue.value = y, de.value = h;
|
|
1954
|
+
}, dt = (y, h) => {
|
|
1955
|
+
fe.value = y, pe.value = h;
|
|
1956
|
+
}, ve = _(null), ct = (y) => {
|
|
1957
|
+
ve.value = y;
|
|
1958
|
+
}, Y = _(!0), J = _(!1), Q = _("preview"), he = R(() => {
|
|
1959
|
+
var y, h, W;
|
|
1960
|
+
if (D.value)
|
|
1961
|
+
return ((h = (y = D.value).getToolbarGroups) == null ? void 0 : h.call(y, g.value, te.value)) ?? [];
|
|
1939
1962
|
if (x.value === "image")
|
|
1940
|
-
return
|
|
1963
|
+
return yo({
|
|
1941
1964
|
zoom: r.value,
|
|
1942
|
-
onZoomIn:
|
|
1965
|
+
onZoomIn: Pe,
|
|
1943
1966
|
onZoomOut: ze,
|
|
1944
|
-
onFitToWidth:
|
|
1945
|
-
onOriginalSize:
|
|
1946
|
-
onRotateLeft:
|
|
1947
|
-
onRotateRight:
|
|
1967
|
+
onFitToWidth: at,
|
|
1968
|
+
onOriginalSize: it,
|
|
1969
|
+
onRotateLeft: nt,
|
|
1970
|
+
onRotateRight: ot,
|
|
1948
1971
|
onReset: Me,
|
|
1949
1972
|
t: i.value
|
|
1950
1973
|
});
|
|
1951
1974
|
if (x.value === "pdf")
|
|
1952
|
-
return
|
|
1975
|
+
return Fo({
|
|
1953
1976
|
zoom: r.value,
|
|
1954
|
-
|
|
1977
|
+
currentPage: d.value,
|
|
1978
|
+
totalPages: p.value || 0,
|
|
1979
|
+
onZoomIn: Pe,
|
|
1955
1980
|
onZoomOut: ze,
|
|
1956
1981
|
onReset: Me,
|
|
1982
|
+
onPrevPage: () => {
|
|
1983
|
+
var E;
|
|
1984
|
+
const $ = (E = j.value) == null ? void 0 : E.querySelector(".vfp-overflow-auto");
|
|
1985
|
+
if (!$) return;
|
|
1986
|
+
const F = $.querySelectorAll("[data-page-number]")[Math.max(0, d.value - 2)];
|
|
1987
|
+
F && F.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
1988
|
+
},
|
|
1989
|
+
onNextPage: () => {
|
|
1990
|
+
var E;
|
|
1991
|
+
const $ = (E = j.value) == null ? void 0 : E.querySelector(".vfp-overflow-auto");
|
|
1992
|
+
if (!$) return;
|
|
1993
|
+
const A = $.querySelectorAll("[data-page-number]"), F = A[Math.min(A.length - 1, d.value)];
|
|
1994
|
+
F && F.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
1995
|
+
},
|
|
1996
|
+
onToggleOutline: () => {
|
|
1997
|
+
P.value = !P.value;
|
|
1998
|
+
},
|
|
1957
1999
|
t: i.value
|
|
1958
2000
|
});
|
|
1959
2001
|
if (x.value === "epub")
|
|
1960
2002
|
return ko({
|
|
1961
2003
|
epubRef: je.value,
|
|
1962
|
-
current:
|
|
1963
|
-
total:
|
|
1964
|
-
fullWidth:
|
|
2004
|
+
current: ue.value,
|
|
2005
|
+
total: de.value,
|
|
2006
|
+
fullWidth: ce.value,
|
|
1965
2007
|
t: i.value
|
|
1966
2008
|
});
|
|
1967
2009
|
if (x.value === "mobi")
|
|
1968
|
-
return
|
|
1969
|
-
mobiRef:
|
|
1970
|
-
current:
|
|
1971
|
-
total:
|
|
1972
|
-
fullWidth:
|
|
2010
|
+
return Co({
|
|
2011
|
+
mobiRef: Te.value,
|
|
2012
|
+
current: fe.value,
|
|
2013
|
+
total: pe.value,
|
|
2014
|
+
fullWidth: me.value,
|
|
1973
2015
|
t: i.value
|
|
1974
2016
|
});
|
|
1975
2017
|
if (x.value === "zip")
|
|
1976
|
-
return
|
|
2018
|
+
return _o({ stats: ve.value, t: i.value });
|
|
1977
2019
|
if (x.value === "text") {
|
|
1978
|
-
const
|
|
1979
|
-
return
|
|
1980
|
-
wordWrap:
|
|
2020
|
+
const $ = ((W = g.value.name.split(".").pop()) == null ? void 0 : W.toLowerCase()) || "";
|
|
2021
|
+
return Ro({
|
|
2022
|
+
wordWrap: Y.value,
|
|
1981
2023
|
onToggleWrap: () => {
|
|
1982
|
-
|
|
2024
|
+
Y.value = !Y.value;
|
|
1983
2025
|
},
|
|
1984
|
-
isHtml:
|
|
1985
|
-
htmlPreview:
|
|
2026
|
+
isHtml: $ === "html" || $ === "htm",
|
|
2027
|
+
htmlPreview: J.value,
|
|
1986
2028
|
onToggleHtmlPreview: () => {
|
|
1987
|
-
|
|
2029
|
+
J.value = !J.value;
|
|
1988
2030
|
},
|
|
1989
2031
|
t: i.value
|
|
1990
2032
|
});
|
|
1991
2033
|
}
|
|
1992
|
-
return x.value === "markdown" ?
|
|
1993
|
-
viewMode:
|
|
2034
|
+
return x.value === "markdown" ? Po({
|
|
2035
|
+
viewMode: Q.value,
|
|
1994
2036
|
onToggleViewMode: () => {
|
|
1995
|
-
|
|
2037
|
+
Q.value = Q.value === "preview" ? "source" : "preview";
|
|
1996
2038
|
},
|
|
1997
2039
|
t: i.value
|
|
1998
2040
|
}) : [];
|
|
1999
|
-
}),
|
|
2041
|
+
}), Ee = R(() => {
|
|
2000
2042
|
const y = [
|
|
2001
2043
|
{
|
|
2002
2044
|
items: [
|
|
2003
|
-
{ type: "button", icon: Ge, tooltip: i.value("common.download"), action:
|
|
2045
|
+
{ type: "button", icon: Ge, tooltip: i.value("common.download"), action: se }
|
|
2004
2046
|
]
|
|
2005
2047
|
}
|
|
2006
2048
|
];
|
|
2007
|
-
return
|
|
2049
|
+
return st.value && y.push({
|
|
2008
2050
|
items: [
|
|
2009
|
-
{ type: "button", icon:
|
|
2051
|
+
{ type: "button", icon: Ct, tooltip: i.value("common.close"), action: () => n("close") }
|
|
2010
2052
|
]
|
|
2011
2053
|
}), y;
|
|
2012
|
-
}),
|
|
2013
|
-
return (y,
|
|
2014
|
-
var
|
|
2054
|
+
}), ft = R(() => he.value.length > 0);
|
|
2055
|
+
return (y, h) => {
|
|
2056
|
+
var W, $, A;
|
|
2015
2057
|
return f(), b("div", {
|
|
2016
2058
|
ref_key: "rootRef",
|
|
2017
|
-
ref:
|
|
2059
|
+
ref: M,
|
|
2018
2060
|
tabindex: e.mode === "embed" ? 0 : -1,
|
|
2019
2061
|
"data-theme": s.value,
|
|
2020
2062
|
class: "vfp-relative vfp-w-full vfp-h-full vfp-flex vfp-flex-col vfp-overflow-hidden vfp-outline-none"
|
|
2021
2063
|
}, [
|
|
2022
|
-
e.headless ?
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2064
|
+
e.headless ? I("", !0) : (f(), b("div", an, [
|
|
2065
|
+
S("div", ln, [
|
|
2066
|
+
S("div", rn, [
|
|
2067
|
+
S("h2", sn, B((W = g.value) == null ? void 0 : W.name), 1),
|
|
2068
|
+
S("span", un, B(e.currentIndex + 1) + "/" + B(L.value.length), 1)
|
|
2027
2069
|
]),
|
|
2028
|
-
|
|
2029
|
-
(f(!0), b(
|
|
2030
|
-
key: "m-action-" +
|
|
2070
|
+
S("div", dn, [
|
|
2071
|
+
(f(!0), b(T, null, U(Ee.value, (F, E) => (f(), b(T, {
|
|
2072
|
+
key: "m-action-" + E
|
|
2031
2073
|
}, [
|
|
2032
|
-
(f(!0), b(
|
|
2033
|
-
key: "m-action-" +
|
|
2074
|
+
(f(!0), b(T, null, U(F.items, (k, V) => (f(), b(T, {
|
|
2075
|
+
key: "m-action-" + E + "-" + V
|
|
2034
2076
|
}, [
|
|
2035
2077
|
k.type === "button" ? (f(), b("button", {
|
|
2036
2078
|
key: 0,
|
|
@@ -2039,17 +2081,17 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
2039
2081
|
disabled: k.disabled,
|
|
2040
2082
|
onClick: k.action
|
|
2041
2083
|
}, [
|
|
2042
|
-
(f(),
|
|
2043
|
-
], 8,
|
|
2084
|
+
(f(), C(ee(k.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
2085
|
+
], 8, cn)) : I("", !0)
|
|
2044
2086
|
], 64))), 128))
|
|
2045
2087
|
], 64))), 128))
|
|
2046
2088
|
]),
|
|
2047
|
-
|
|
2048
|
-
(f(!0), b(
|
|
2049
|
-
key: "d-tool-" +
|
|
2089
|
+
S("div", fn, [
|
|
2090
|
+
(f(!0), b(T, null, U(he.value, (F, E) => (f(), b(T, {
|
|
2091
|
+
key: "d-tool-" + E
|
|
2050
2092
|
}, [
|
|
2051
|
-
(f(!0), b(
|
|
2052
|
-
key: "d-tool-" +
|
|
2093
|
+
(f(!0), b(T, null, U(F.items, (k, V) => (f(), b(T, {
|
|
2094
|
+
key: "d-tool-" + E + "-" + V
|
|
2053
2095
|
}, [
|
|
2054
2096
|
k.type === "button" ? (f(), b("button", {
|
|
2055
2097
|
key: 0,
|
|
@@ -2058,20 +2100,20 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
2058
2100
|
disabled: k.disabled,
|
|
2059
2101
|
onClick: k.action
|
|
2060
2102
|
}, [
|
|
2061
|
-
(f(),
|
|
2062
|
-
], 8,
|
|
2103
|
+
(f(), C(ee(k.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
2104
|
+
], 8, pn)) : k.type === "text" ? (f(), b("span", {
|
|
2063
2105
|
key: 1,
|
|
2064
2106
|
class: "vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums vfp-text-fg-tertiary",
|
|
2065
2107
|
style: ae({ minWidth: k.minWidth || "auto" })
|
|
2066
|
-
},
|
|
2108
|
+
}, B(k.content), 5)) : I("", !0)
|
|
2067
2109
|
], 64))), 128)),
|
|
2068
|
-
|
|
2110
|
+
h[10] || (h[10] = S("div", { class: "vfp-w-px vfp-h-4 vfp-mx-1 vfp-bg-divide" }, null, -1))
|
|
2069
2111
|
], 64))), 128)),
|
|
2070
|
-
(f(!0), b(
|
|
2071
|
-
key: "d-action-" +
|
|
2112
|
+
(f(!0), b(T, null, U(Ee.value, (F, E) => (f(), b(T, {
|
|
2113
|
+
key: "d-action-" + E
|
|
2072
2114
|
}, [
|
|
2073
|
-
(f(!0), b(
|
|
2074
|
-
key: "d-action-" +
|
|
2115
|
+
(f(!0), b(T, null, U(F.items, (k, V) => (f(), b(T, {
|
|
2116
|
+
key: "d-action-" + E + "-" + V
|
|
2075
2117
|
}, [
|
|
2076
2118
|
k.type === "button" ? (f(), b("button", {
|
|
2077
2119
|
key: 0,
|
|
@@ -2080,19 +2122,19 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
2080
2122
|
disabled: k.disabled,
|
|
2081
2123
|
onClick: k.action
|
|
2082
2124
|
}, [
|
|
2083
|
-
(f(),
|
|
2084
|
-
], 8,
|
|
2125
|
+
(f(), C(ee(k.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
2126
|
+
], 8, mn)) : I("", !0)
|
|
2085
2127
|
], 64))), 128))
|
|
2086
2128
|
], 64))), 128))
|
|
2087
2129
|
])
|
|
2088
2130
|
]),
|
|
2089
|
-
|
|
2090
|
-
(f(!0), b(
|
|
2091
|
-
key: "m-tool-" +
|
|
2131
|
+
ft.value ? (f(), b("div", vn, [
|
|
2132
|
+
(f(!0), b(T, null, U(he.value, (F, E) => (f(), b(T, {
|
|
2133
|
+
key: "m-tool-" + E
|
|
2092
2134
|
}, [
|
|
2093
|
-
|
|
2094
|
-
(f(!0), b(
|
|
2095
|
-
key: "m-tool-" +
|
|
2135
|
+
E > 0 ? (f(), b("div", hn)) : I("", !0),
|
|
2136
|
+
(f(!0), b(T, null, U(F.items, (k, V) => (f(), b(T, {
|
|
2137
|
+
key: "m-tool-" + E + "-" + V
|
|
2096
2138
|
}, [
|
|
2097
2139
|
k.type === "button" ? (f(), b("button", {
|
|
2098
2140
|
key: 0,
|
|
@@ -2101,139 +2143,141 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
2101
2143
|
disabled: k.disabled,
|
|
2102
2144
|
onClick: k.action
|
|
2103
2145
|
}, [
|
|
2104
|
-
(f(),
|
|
2105
|
-
], 8,
|
|
2146
|
+
(f(), C(ee(k.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
2147
|
+
], 8, gn)) : k.type === "text" ? (f(), b("span", {
|
|
2106
2148
|
key: 1,
|
|
2107
2149
|
class: "vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums vfp-text-fg-tertiary",
|
|
2108
2150
|
style: ae({ minWidth: k.minWidth || "auto" })
|
|
2109
|
-
},
|
|
2151
|
+
}, B(k.content), 5)) : I("", !0)
|
|
2110
2152
|
], 64))), 128))
|
|
2111
2153
|
], 64))), 128))
|
|
2112
|
-
])) :
|
|
2154
|
+
])) : I("", !0)
|
|
2113
2155
|
])),
|
|
2114
2156
|
(f(), b("div", {
|
|
2115
2157
|
ref_key: "contentRef",
|
|
2116
|
-
ref:
|
|
2158
|
+
ref: j,
|
|
2117
2159
|
class: "vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-overflow-auto",
|
|
2118
|
-
key: (
|
|
2160
|
+
key: ($ = g.value) == null ? void 0 : $.url
|
|
2119
2161
|
}, [
|
|
2120
|
-
|
|
2121
|
-
|
|
2162
|
+
g.value ? (f(), b(T, { key: 0 }, [
|
|
2163
|
+
q.value ? (f(), C(ee(q.value), {
|
|
2122
2164
|
key: 0,
|
|
2123
|
-
file:
|
|
2165
|
+
file: g.value,
|
|
2124
2166
|
ctx: te.value
|
|
2125
|
-
}, null, 8, ["file", "ctx"])) : (f(), b(
|
|
2126
|
-
x.value === "image" ? (f(),
|
|
2167
|
+
}, null, 8, ["file", "ctx"])) : (f(), b(T, { key: 1 }, [
|
|
2168
|
+
x.value === "image" ? (f(), C(v(Eo), {
|
|
2127
2169
|
key: 0,
|
|
2128
|
-
url: v(
|
|
2170
|
+
url: v(z),
|
|
2129
2171
|
zoom: r.value,
|
|
2130
2172
|
rotation: u.value,
|
|
2131
2173
|
"reset-key": w.value,
|
|
2132
|
-
"file-size":
|
|
2133
|
-
file:
|
|
2134
|
-
onZoomChange:
|
|
2135
|
-
onNaturalWidthChange:
|
|
2136
|
-
onNaturalHeightChange:
|
|
2137
|
-
}, null, 8, ["url", "zoom", "rotation", "reset-key", "file-size", "file"])) : x.value === "pdf" ? (f(),
|
|
2174
|
+
"file-size": g.value.size,
|
|
2175
|
+
file: g.value,
|
|
2176
|
+
onZoomChange: lt,
|
|
2177
|
+
onNaturalWidthChange: h[0] || (h[0] = (F) => m.value = F),
|
|
2178
|
+
onNaturalHeightChange: h[1] || (h[1] = (F) => c.value = F)
|
|
2179
|
+
}, null, 8, ["url", "zoom", "rotation", "reset-key", "file-size", "file"])) : x.value === "pdf" ? (f(), C(v(So), {
|
|
2138
2180
|
key: 1,
|
|
2139
|
-
url: v(
|
|
2181
|
+
url: v(z),
|
|
2140
2182
|
zoom: r.value,
|
|
2141
2183
|
"current-page": d.value,
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2184
|
+
"show-outline": P.value,
|
|
2185
|
+
onPageChange: h[2] || (h[2] = (F) => d.value = F),
|
|
2186
|
+
onTotalPagesChange: h[3] || (h[3] = (F) => p.value = F),
|
|
2187
|
+
onPageWidthChange: h[4] || (h[4] = (F) => m.value = F),
|
|
2188
|
+
onToggleOutline: h[5] || (h[5] = () => P.value = !P.value)
|
|
2189
|
+
}, null, 8, ["url", "zoom", "current-page", "show-outline"])) : x.value === "docx" ? (f(), C(v(No), {
|
|
2146
2190
|
key: 2,
|
|
2147
|
-
url: v(
|
|
2148
|
-
}, null, 8, ["url"])) : x.value === "xlsx" ? (f(),
|
|
2191
|
+
url: v(z)
|
|
2192
|
+
}, null, 8, ["url"])) : x.value === "xlsx" ? (f(), C(v($o), {
|
|
2149
2193
|
key: 3,
|
|
2150
|
-
url: v(
|
|
2151
|
-
}, null, 8, ["url"])) : x.value === "pptx" ? (f(),
|
|
2194
|
+
url: v(z)
|
|
2195
|
+
}, null, 8, ["url"])) : x.value === "pptx" ? (f(), C(v(Lo), {
|
|
2152
2196
|
key: 4,
|
|
2153
|
-
url: v(
|
|
2154
|
-
}, null, 8, ["url"])) : x.value === "msg" ? (f(),
|
|
2197
|
+
url: v(z)
|
|
2198
|
+
}, null, 8, ["url"])) : x.value === "msg" ? (f(), C(v(Wo), {
|
|
2155
2199
|
key: 5,
|
|
2156
|
-
url: v(
|
|
2157
|
-
}, null, 8, ["url"])) : x.value === "epub" ? (f(),
|
|
2200
|
+
url: v(z)
|
|
2201
|
+
}, null, 8, ["url"])) : x.value === "epub" ? (f(), C(v(Io), {
|
|
2158
2202
|
key: 6,
|
|
2159
2203
|
ref_key: "epubRef",
|
|
2160
2204
|
ref: je,
|
|
2161
|
-
url: v(
|
|
2162
|
-
onChapterChange:
|
|
2163
|
-
onFullWidthChange:
|
|
2164
|
-
}, null, 8, ["url"])) : x.value === "mobi" ? (f(),
|
|
2205
|
+
url: v(z),
|
|
2206
|
+
onChapterChange: ut,
|
|
2207
|
+
onFullWidthChange: h[6] || (h[6] = (F) => ce.value = F)
|
|
2208
|
+
}, null, 8, ["url"])) : x.value === "mobi" ? (f(), C(v(Do), {
|
|
2165
2209
|
key: 7,
|
|
2166
2210
|
ref_key: "mobiRef",
|
|
2167
|
-
ref:
|
|
2168
|
-
url: v(
|
|
2169
|
-
onChapterChange:
|
|
2170
|
-
onFullWidthChange:
|
|
2171
|
-
}, null, 8, ["url"])) : x.value === "video" ? (f(),
|
|
2211
|
+
ref: Te,
|
|
2212
|
+
url: v(z),
|
|
2213
|
+
onChapterChange: dt,
|
|
2214
|
+
onFullWidthChange: h[7] || (h[7] = (F) => me.value = F)
|
|
2215
|
+
}, null, 8, ["url"])) : x.value === "video" ? (f(), C(v(Ao), {
|
|
2172
2216
|
key: 8,
|
|
2173
|
-
url: v(
|
|
2174
|
-
"file-name": (
|
|
2175
|
-
}, null, 8, ["url", "file-name"])) : x.value === "audio" ? (f(),
|
|
2217
|
+
url: v(z),
|
|
2218
|
+
"file-name": (A = g.value) == null ? void 0 : A.name
|
|
2219
|
+
}, null, 8, ["url", "file-name"])) : x.value === "audio" ? (f(), C(v(qo), {
|
|
2176
2220
|
key: 9,
|
|
2177
|
-
url: v(
|
|
2178
|
-
"file-name":
|
|
2179
|
-
}, null, 8, ["url", "file-name"])) : x.value === "markdown" ? (f(),
|
|
2221
|
+
url: v(z),
|
|
2222
|
+
"file-name": g.value.name
|
|
2223
|
+
}, null, 8, ["url", "file-name"])) : x.value === "markdown" ? (f(), C(v(Bo), {
|
|
2180
2224
|
key: 10,
|
|
2181
|
-
url: v(
|
|
2182
|
-
"view-mode":
|
|
2183
|
-
}, null, 8, ["url", "view-mode"])) : x.value === "json" ? (f(),
|
|
2225
|
+
url: v(z),
|
|
2226
|
+
"view-mode": Q.value
|
|
2227
|
+
}, null, 8, ["url", "view-mode"])) : x.value === "json" ? (f(), C(v(Oo), {
|
|
2184
2228
|
key: 11,
|
|
2185
|
-
url: v(
|
|
2186
|
-
"file-name":
|
|
2187
|
-
}, null, 8, ["url", "file-name"])) : x.value === "csv" ? (f(),
|
|
2229
|
+
url: v(z),
|
|
2230
|
+
"file-name": g.value.name
|
|
2231
|
+
}, null, 8, ["url", "file-name"])) : x.value === "csv" ? (f(), C(v(Uo), {
|
|
2188
2232
|
key: 12,
|
|
2189
|
-
url: v(
|
|
2190
|
-
"file-name":
|
|
2191
|
-
}, null, 8, ["url", "file-name"])) : x.value === "xml" ? (f(),
|
|
2233
|
+
url: v(z),
|
|
2234
|
+
"file-name": g.value.name
|
|
2235
|
+
}, null, 8, ["url", "file-name"])) : x.value === "xml" ? (f(), C(v(Ho), {
|
|
2192
2236
|
key: 13,
|
|
2193
|
-
url: v(
|
|
2194
|
-
"file-name":
|
|
2195
|
-
}, null, 8, ["url", "file-name"])) : x.value === "subtitle" ? (f(),
|
|
2237
|
+
url: v(z),
|
|
2238
|
+
"file-name": g.value.name
|
|
2239
|
+
}, null, 8, ["url", "file-name"])) : x.value === "subtitle" ? (f(), C(v(Vo), {
|
|
2196
2240
|
key: 14,
|
|
2197
|
-
url: v(
|
|
2198
|
-
"file-name":
|
|
2199
|
-
}, null, 8, ["url", "file-name"])) : x.value === "zip" && o.zipNestingDepth >=
|
|
2241
|
+
url: v(z),
|
|
2242
|
+
"file-name": g.value.name
|
|
2243
|
+
}, null, 8, ["url", "file-name"])) : x.value === "zip" && o.zipNestingDepth >= bn ? (f(), C(Ae, {
|
|
2200
2244
|
key: 15,
|
|
2201
|
-
"file-name":
|
|
2202
|
-
"file-type":
|
|
2203
|
-
onDownload:
|
|
2204
|
-
}, null, 8, ["file-name", "file-type"])) : x.value === "zip" ? (f(),
|
|
2245
|
+
"file-name": g.value.name,
|
|
2246
|
+
"file-type": g.value.type,
|
|
2247
|
+
onDownload: se
|
|
2248
|
+
}, null, 8, ["file-name", "file-type"])) : x.value === "zip" ? (f(), C(v(Zo), {
|
|
2205
2249
|
key: 16,
|
|
2206
|
-
url: v(
|
|
2250
|
+
url: v(z),
|
|
2207
2251
|
"nesting-depth": o.zipNestingDepth,
|
|
2208
|
-
onStatsChange:
|
|
2209
|
-
}, null, 8, ["url", "nesting-depth"])) : x.value === "text" ? (f(),
|
|
2252
|
+
onStatsChange: ct
|
|
2253
|
+
}, null, 8, ["url", "nesting-depth"])) : x.value === "text" ? (f(), C(v(Go), {
|
|
2210
2254
|
key: 17,
|
|
2211
|
-
url: v(
|
|
2212
|
-
"file-name":
|
|
2213
|
-
"word-wrap":
|
|
2214
|
-
"html-preview":
|
|
2215
|
-
}, null, 8, ["url", "file-name", "word-wrap", "html-preview"])) : x.value === "font" ? (f(),
|
|
2255
|
+
url: v(z),
|
|
2256
|
+
"file-name": g.value.name,
|
|
2257
|
+
"word-wrap": Y.value,
|
|
2258
|
+
"html-preview": J.value
|
|
2259
|
+
}, null, 8, ["url", "file-name", "word-wrap", "html-preview"])) : x.value === "font" ? (f(), C(v(Xo), {
|
|
2216
2260
|
key: 18,
|
|
2217
|
-
url: v(
|
|
2218
|
-
}, null, 8, ["url"])) : (f(),
|
|
2261
|
+
url: v(z)
|
|
2262
|
+
}, null, 8, ["url"])) : (f(), C(Ae, {
|
|
2219
2263
|
key: 19,
|
|
2220
|
-
"file-name":
|
|
2221
|
-
"file-type":
|
|
2222
|
-
onDownload:
|
|
2264
|
+
"file-name": g.value.name,
|
|
2265
|
+
"file-type": g.value.type,
|
|
2266
|
+
onDownload: se
|
|
2223
2267
|
}, null, 8, ["file-name", "file-type"]))
|
|
2224
2268
|
], 64))
|
|
2225
|
-
], 64)) :
|
|
2269
|
+
], 64)) : I("", !0)
|
|
2226
2270
|
])),
|
|
2227
|
-
!e.headless &&
|
|
2271
|
+
!e.headless && L.value.length > 1 ? (f(), C(on, {
|
|
2228
2272
|
key: 1,
|
|
2229
|
-
"container-ref":
|
|
2273
|
+
"container-ref": j.value,
|
|
2230
2274
|
"has-prev": e.currentIndex > 0,
|
|
2231
|
-
"has-next": e.currentIndex <
|
|
2275
|
+
"has-next": e.currentIndex < L.value.length - 1,
|
|
2232
2276
|
"reset-key": e.currentIndex,
|
|
2233
|
-
onPrev:
|
|
2234
|
-
onNext:
|
|
2235
|
-
}, null, 8, ["container-ref", "has-prev", "has-next", "reset-key"])) :
|
|
2236
|
-
], 8,
|
|
2277
|
+
onPrev: h[8] || (h[8] = (F) => n("navigate", e.currentIndex - 1)),
|
|
2278
|
+
onNext: h[9] || (h[9] = (F) => n("navigate", e.currentIndex + 1))
|
|
2279
|
+
}, null, 8, ["container-ref", "has-prev", "has-next", "reset-key"])) : I("", !0)
|
|
2280
|
+
], 8, nn);
|
|
2237
2281
|
};
|
|
2238
2282
|
}
|
|
2239
2283
|
}), xn = (e, t) => {
|
|
@@ -2241,11 +2285,11 @@ const zo = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
2241
2285
|
for (const [n, i] of t)
|
|
2242
2286
|
o[n] = i;
|
|
2243
2287
|
return o;
|
|
2244
|
-
},
|
|
2288
|
+
}, Re = /* @__PURE__ */ xn(wn, [["__scopeId", "data-v-57fe6bde"]]), Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2245
2289
|
__proto__: null,
|
|
2246
|
-
default:
|
|
2290
|
+
default: Re
|
|
2247
2291
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2248
|
-
function
|
|
2292
|
+
function yn(e) {
|
|
2249
2293
|
let t = "", o = "", n = !1;
|
|
2250
2294
|
const i = () => {
|
|
2251
2295
|
if (n || typeof document > "u") return;
|
|
@@ -2255,13 +2299,13 @@ function wn(e) {
|
|
|
2255
2299
|
}, a = () => {
|
|
2256
2300
|
!n || typeof document > "u" || (document.body.style.overflow = t, document.body.style.paddingRight = o, n = !1);
|
|
2257
2301
|
};
|
|
2258
|
-
return
|
|
2302
|
+
return Fe(() => {
|
|
2259
2303
|
e() && i();
|
|
2260
|
-
}),
|
|
2304
|
+
}), vt(() => {
|
|
2261
2305
|
a();
|
|
2262
2306
|
}), { lock: i, unlock: a };
|
|
2263
2307
|
}
|
|
2264
|
-
const
|
|
2308
|
+
const Fn = ["data-theme"], Gn = /* @__PURE__ */ K({
|
|
2265
2309
|
__name: "FilePreviewModal",
|
|
2266
2310
|
props: {
|
|
2267
2311
|
files: {},
|
|
@@ -2279,52 +2323,52 @@ const yn = ["data-theme"], Zn = /* @__PURE__ */ X({
|
|
|
2279
2323
|
},
|
|
2280
2324
|
emits: ["close", "navigate", "custom-event"],
|
|
2281
2325
|
setup(e, { emit: t }) {
|
|
2282
|
-
const o = e, n = t, { lock: i, unlock: a } =
|
|
2283
|
-
|
|
2326
|
+
const o = e, n = t, { lock: i, unlock: a } = yn(() => o.isOpen);
|
|
2327
|
+
O(
|
|
2284
2328
|
() => o.isOpen,
|
|
2285
|
-
(
|
|
2286
|
-
|
|
2329
|
+
(m) => {
|
|
2330
|
+
m ? i() : a();
|
|
2287
2331
|
}
|
|
2288
2332
|
);
|
|
2289
|
-
const l =
|
|
2333
|
+
const l = _(
|
|
2290
2334
|
typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
2291
2335
|
);
|
|
2292
2336
|
let s = null;
|
|
2293
|
-
|
|
2337
|
+
O(
|
|
2294
2338
|
() => o.theme,
|
|
2295
|
-
(
|
|
2296
|
-
if (s && (s(), s = null),
|
|
2297
|
-
const c = window.matchMedia("(prefers-color-scheme: dark)"), w = (
|
|
2298
|
-
l.value =
|
|
2339
|
+
(m) => {
|
|
2340
|
+
if (s && (s(), s = null), m === "auto") {
|
|
2341
|
+
const c = window.matchMedia("(prefers-color-scheme: dark)"), w = (P) => {
|
|
2342
|
+
l.value = P.matches;
|
|
2299
2343
|
};
|
|
2300
2344
|
c.addEventListener("change", w), s = () => c.removeEventListener("change", w);
|
|
2301
2345
|
}
|
|
2302
2346
|
},
|
|
2303
2347
|
{ immediate: !0 }
|
|
2304
|
-
),
|
|
2348
|
+
), X(() => {
|
|
2305
2349
|
s && s();
|
|
2306
2350
|
});
|
|
2307
|
-
const r =
|
|
2351
|
+
const r = R(
|
|
2308
2352
|
() => o.theme === "auto" ? l.value ? "dark" : "light" : o.theme
|
|
2309
|
-
), u = () => n("close"), d = (
|
|
2310
|
-
return (
|
|
2311
|
-
|
|
2312
|
-
default:
|
|
2353
|
+
), u = () => n("close"), d = (m) => m.stopPropagation(), p = (m) => m.stopPropagation();
|
|
2354
|
+
return (m, c) => (f(), C(ht, { to: "body" }, [
|
|
2355
|
+
Z(gt, { name: "vfp-fade" }, {
|
|
2356
|
+
default: bt(() => [
|
|
2313
2357
|
e.isOpen ? (f(), b("div", {
|
|
2314
2358
|
key: 0,
|
|
2315
2359
|
class: "vfp-root",
|
|
2316
2360
|
"data-theme": r.value
|
|
2317
2361
|
}, [
|
|
2318
|
-
|
|
2362
|
+
S("div", {
|
|
2319
2363
|
class: "vfp-fixed vfp-inset-0 vfp-z-[9999] vfp-flex vfp-items-center vfp-justify-center vfp-backdrop-blur-md vfp-overflow-hidden vfp-bg-surface-overlay",
|
|
2320
2364
|
onClick: u,
|
|
2321
|
-
onWheel:
|
|
2365
|
+
onWheel: p
|
|
2322
2366
|
}, [
|
|
2323
|
-
|
|
2367
|
+
S("div", {
|
|
2324
2368
|
class: "vfp-relative vfp-w-full vfp-h-full",
|
|
2325
2369
|
onClick: d
|
|
2326
2370
|
}, [
|
|
2327
|
-
|
|
2371
|
+
Z(Re, {
|
|
2328
2372
|
mode: "modal",
|
|
2329
2373
|
files: e.files,
|
|
2330
2374
|
"current-index": e.currentIndex,
|
|
@@ -2337,19 +2381,20 @@ const yn = ["data-theme"], Zn = /* @__PURE__ */ X({
|
|
|
2337
2381
|
"request-handler": e.requestHandler,
|
|
2338
2382
|
"should-fetch-as-blob": e.shouldFetchAsBlob,
|
|
2339
2383
|
"on-download": e.onDownload,
|
|
2384
|
+
"on-close": () => n("close"),
|
|
2340
2385
|
onClose: c[0] || (c[0] = (w) => n("close")),
|
|
2341
2386
|
onNavigate: c[1] || (c[1] = (w) => n("navigate", w)),
|
|
2342
2387
|
onCustomEvent: c[2] || (c[2] = (w) => n("custom-event", w))
|
|
2343
|
-
}, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download"])
|
|
2388
|
+
}, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download", "on-close"])
|
|
2344
2389
|
])
|
|
2345
2390
|
], 32)
|
|
2346
|
-
], 8,
|
|
2391
|
+
], 8, Fn)) : I("", !0)
|
|
2347
2392
|
]),
|
|
2348
2393
|
_: 1
|
|
2349
2394
|
})
|
|
2350
2395
|
]));
|
|
2351
2396
|
}
|
|
2352
|
-
}), kn = ["data-theme"],
|
|
2397
|
+
}), kn = ["data-theme"], Cn = { class: "vfp-relative vfp-w-full vfp-h-full vfp-overflow-hidden vfp-bg-surface-overlay" }, Xn = /* @__PURE__ */ K({
|
|
2353
2398
|
__name: "FilePreviewEmbed",
|
|
2354
2399
|
props: {
|
|
2355
2400
|
files: {},
|
|
@@ -2364,29 +2409,30 @@ const yn = ["data-theme"], Zn = /* @__PURE__ */ X({
|
|
|
2364
2409
|
requestInit: { type: Function, default: void 0 },
|
|
2365
2410
|
requestHandler: { type: Function, default: void 0 },
|
|
2366
2411
|
shouldFetchAsBlob: { type: Function, default: void 0 },
|
|
2367
|
-
onDownload: { type: Function, default: void 0 }
|
|
2412
|
+
onDownload: { type: Function, default: void 0 },
|
|
2413
|
+
onClose: { type: Function, default: void 0 }
|
|
2368
2414
|
},
|
|
2369
|
-
emits: ["navigate", "custom-event"],
|
|
2415
|
+
emits: ["navigate", "custom-event", "close"],
|
|
2370
2416
|
setup(e, { emit: t }) {
|
|
2371
|
-
const o = e, n = t, i =
|
|
2417
|
+
const o = e, n = t, i = _(
|
|
2372
2418
|
typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
2373
2419
|
);
|
|
2374
2420
|
let a = null;
|
|
2375
|
-
|
|
2421
|
+
O(
|
|
2376
2422
|
() => o.theme,
|
|
2377
2423
|
(r) => {
|
|
2378
2424
|
if (a && (a(), a = null), r === "auto") {
|
|
2379
|
-
const u = window.matchMedia("(prefers-color-scheme: dark)"), d = (
|
|
2380
|
-
i.value =
|
|
2425
|
+
const u = window.matchMedia("(prefers-color-scheme: dark)"), d = (p) => {
|
|
2426
|
+
i.value = p.matches;
|
|
2381
2427
|
};
|
|
2382
2428
|
u.addEventListener("change", d), a = () => u.removeEventListener("change", d);
|
|
2383
2429
|
}
|
|
2384
2430
|
},
|
|
2385
2431
|
{ immediate: !0 }
|
|
2386
|
-
),
|
|
2432
|
+
), X(() => {
|
|
2387
2433
|
a && a();
|
|
2388
2434
|
});
|
|
2389
|
-
const l =
|
|
2435
|
+
const l = R(
|
|
2390
2436
|
() => o.theme === "auto" ? i.value ? "dark" : "light" : o.theme
|
|
2391
2437
|
), s = {
|
|
2392
2438
|
width: typeof o.width == "number" ? `${o.width}px` : o.width,
|
|
@@ -2397,8 +2443,8 @@ const yn = ["data-theme"], Zn = /* @__PURE__ */ X({
|
|
|
2397
2443
|
style: s,
|
|
2398
2444
|
"data-theme": l.value
|
|
2399
2445
|
}, [
|
|
2400
|
-
|
|
2401
|
-
|
|
2446
|
+
S("div", Cn, [
|
|
2447
|
+
Z(Re, {
|
|
2402
2448
|
mode: "embed",
|
|
2403
2449
|
files: e.files,
|
|
2404
2450
|
"current-index": e.currentIndex,
|
|
@@ -2411,48 +2457,50 @@ const yn = ["data-theme"], Zn = /* @__PURE__ */ X({
|
|
|
2411
2457
|
"request-handler": e.requestHandler,
|
|
2412
2458
|
"should-fetch-as-blob": e.shouldFetchAsBlob,
|
|
2413
2459
|
"on-download": e.onDownload,
|
|
2460
|
+
"on-close": e.onClose,
|
|
2414
2461
|
onNavigate: u[0] || (u[0] = (d) => n("navigate", d)),
|
|
2415
|
-
onCustomEvent: u[1] || (u[1] = (d) => n("custom-event", d))
|
|
2416
|
-
|
|
2462
|
+
onCustomEvent: u[1] || (u[1] = (d) => n("custom-event", d)),
|
|
2463
|
+
onClose: u[2] || (u[2] = () => n("close"))
|
|
2464
|
+
}, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download", "on-close"])
|
|
2417
2465
|
])
|
|
2418
2466
|
], 8, kn));
|
|
2419
2467
|
}
|
|
2420
|
-
}),
|
|
2468
|
+
}), Kn = Pt.version;
|
|
2421
2469
|
export {
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2470
|
+
Dn as A,
|
|
2471
|
+
On as B,
|
|
2472
|
+
Et as C,
|
|
2473
|
+
In as D,
|
|
2474
|
+
Nn as E,
|
|
2475
|
+
Tt as F,
|
|
2476
|
+
Hn as G,
|
|
2477
|
+
qn as I,
|
|
2430
2478
|
Ye as L,
|
|
2431
|
-
|
|
2432
|
-
Nn as N,
|
|
2479
|
+
En as M,
|
|
2433
2480
|
$n as P,
|
|
2434
|
-
|
|
2435
|
-
|
|
2481
|
+
An as R,
|
|
2482
|
+
Sn as S,
|
|
2483
|
+
Ln as T,
|
|
2436
2484
|
Bn as U,
|
|
2437
|
-
|
|
2485
|
+
Kn as V,
|
|
2438
2486
|
Ke as W,
|
|
2439
2487
|
xn as _,
|
|
2440
|
-
|
|
2488
|
+
bo as a,
|
|
2441
2489
|
jn as b,
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2490
|
+
Vn as c,
|
|
2491
|
+
ge as d,
|
|
2492
|
+
Re as e,
|
|
2493
|
+
Xn as f,
|
|
2494
|
+
Gn as g,
|
|
2447
2495
|
Mt as h,
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2496
|
+
Zn as i,
|
|
2497
|
+
Wn as j,
|
|
2498
|
+
Tn as k,
|
|
2499
|
+
po as p,
|
|
2500
|
+
Un as q,
|
|
2501
|
+
_e as u,
|
|
2454
2502
|
zn as v,
|
|
2455
2503
|
jt as w,
|
|
2456
2504
|
Mn as y
|
|
2457
2505
|
};
|
|
2458
|
-
//# sourceMappingURL=index-
|
|
2506
|
+
//# sourceMappingURL=index-D9QQL7U6.mjs.map
|