@eternalheart/vue-file-preview 1.3.8 → 1.3.9

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.
Files changed (81) hide show
  1. package/lib/FilePreviewContent.vue.d.ts +13 -1
  2. package/lib/FilePreviewContent.vue.d.ts.map +1 -1
  3. package/lib/FilePreviewEmbed.vue.d.ts +13 -1
  4. package/lib/FilePreviewEmbed.vue.d.ts.map +1 -1
  5. package/lib/FilePreviewModal.vue.d.ts +13 -1
  6. package/lib/FilePreviewModal.vue.d.ts.map +1 -1
  7. package/lib/chunks/{index-BYzQg-jL.mjs → index-1khRVlUa.mjs} +25 -25
  8. package/lib/chunks/index-1khRVlUa.mjs.map +1 -0
  9. package/lib/chunks/{index-DXlcF1Dk.mjs → index-B9Xz5bUB.mjs} +2 -2
  10. package/lib/chunks/{index-DXlcF1Dk.mjs.map → index-B9Xz5bUB.mjs.map} +1 -1
  11. package/lib/chunks/{index-C324a7kV.mjs → index-BA-bP8P6.mjs} +789 -649
  12. package/lib/chunks/index-BA-bP8P6.mjs.map +1 -0
  13. package/lib/chunks/{index-BoL1b2w-.mjs → index-BP_8GjEV.mjs} +28 -28
  14. package/lib/chunks/index-BP_8GjEV.mjs.map +1 -0
  15. package/lib/chunks/{index-CTsscgqY.mjs → index-BVdw1Cc8.mjs} +32 -32
  16. package/lib/chunks/index-BVdw1Cc8.mjs.map +1 -0
  17. package/lib/chunks/{index-BCkcZs4y.mjs → index-BqSPk90T.mjs} +30 -30
  18. package/lib/chunks/index-BqSPk90T.mjs.map +1 -0
  19. package/lib/chunks/index-BrCSk7CK.mjs +116 -0
  20. package/lib/chunks/index-BrCSk7CK.mjs.map +1 -0
  21. package/lib/chunks/{index-5Smm2vx0.mjs → index-Bu8GH1aq.mjs} +27 -27
  22. package/lib/chunks/index-Bu8GH1aq.mjs.map +1 -0
  23. package/lib/chunks/{index-D9wf6m37.mjs → index-CYvPRxHK.mjs} +53 -53
  24. package/lib/chunks/index-CYvPRxHK.mjs.map +1 -0
  25. package/lib/chunks/{index-lHlugUBI.mjs → index-Cfm88ItA.mjs} +2 -2
  26. package/lib/chunks/{index-lHlugUBI.mjs.map → index-Cfm88ItA.mjs.map} +1 -1
  27. package/lib/chunks/{index-C7uOM7XL.mjs → index-CxKVonec.mjs} +52 -52
  28. package/lib/chunks/index-CxKVonec.mjs.map +1 -0
  29. package/lib/chunks/index-D6RuC1es.mjs +111 -0
  30. package/lib/chunks/index-D6RuC1es.mjs.map +1 -0
  31. package/lib/chunks/{index-dzB4jd9b.mjs → index-DEyjEp-i.mjs} +106 -106
  32. package/lib/chunks/index-DEyjEp-i.mjs.map +1 -0
  33. package/lib/chunks/{index-DAo-7spn.mjs → index-DFEd3JaR.mjs} +35 -35
  34. package/lib/chunks/index-DFEd3JaR.mjs.map +1 -0
  35. package/lib/chunks/index-DjvWRo53.mjs +281 -0
  36. package/lib/chunks/index-DjvWRo53.mjs.map +1 -0
  37. package/lib/chunks/{index-BM9FaQUl.mjs → index-H-QlBdbJ.mjs} +2 -2
  38. package/lib/chunks/{index-BM9FaQUl.mjs.map → index-H-QlBdbJ.mjs.map} +1 -1
  39. package/lib/chunks/{index-Bri7VeRx.mjs → index-_llF_WTY.mjs} +46 -46
  40. package/lib/chunks/index-_llF_WTY.mjs.map +1 -0
  41. package/lib/chunks/{index-cZn4ih-x.mjs → index-oQRFKvtz.mjs} +13 -13
  42. package/lib/chunks/{index-cZn4ih-x.mjs.map → index-oQRFKvtz.mjs.map} +1 -1
  43. package/lib/composables/useRequest.d.ts +24 -0
  44. package/lib/composables/useRequest.d.ts.map +1 -0
  45. package/lib/index.cjs +23 -23
  46. package/lib/index.cjs.map +1 -1
  47. package/lib/index.css +1 -1
  48. package/lib/index.mjs +6 -6
  49. package/lib/renderers/Csv/index.vue.d.ts.map +1 -1
  50. package/lib/renderers/Docx/index.vue.d.ts.map +1 -1
  51. package/lib/renderers/Epub/index.vue.d.ts.map +1 -1
  52. package/lib/renderers/Json/index.vue.d.ts.map +1 -1
  53. package/lib/renderers/Markdown/index.vue.d.ts.map +1 -1
  54. package/lib/renderers/Mobi/index.vue.d.ts.map +1 -1
  55. package/lib/renderers/Msg/index.vue.d.ts.map +1 -1
  56. package/lib/renderers/Pptx/index.vue.d.ts.map +1 -1
  57. package/lib/renderers/Subtitle/index.vue.d.ts.map +1 -1
  58. package/lib/renderers/Text/index.vue.d.ts.map +1 -1
  59. package/lib/renderers/Xlsx/index.vue.d.ts.map +1 -1
  60. package/lib/renderers/Xml/index.vue.d.ts.map +1 -1
  61. package/lib/renderers/Zip/index.vue.d.ts.map +1 -1
  62. package/lib/types.d.ts +1 -1
  63. package/lib/types.d.ts.map +1 -1
  64. package/package.json +1 -1
  65. package/lib/chunks/index-5Smm2vx0.mjs.map +0 -1
  66. package/lib/chunks/index-BCkcZs4y.mjs.map +0 -1
  67. package/lib/chunks/index-BYzQg-jL.mjs.map +0 -1
  68. package/lib/chunks/index-BoL1b2w-.mjs.map +0 -1
  69. package/lib/chunks/index-Bri7VeRx.mjs.map +0 -1
  70. package/lib/chunks/index-C324a7kV.mjs.map +0 -1
  71. package/lib/chunks/index-C7uOM7XL.mjs.map +0 -1
  72. package/lib/chunks/index-CTsscgqY.mjs.map +0 -1
  73. package/lib/chunks/index-Ch7AEfnk.mjs +0 -116
  74. package/lib/chunks/index-Ch7AEfnk.mjs.map +0 -1
  75. package/lib/chunks/index-D9wf6m37.mjs.map +0 -1
  76. package/lib/chunks/index-DAEQe-RI.mjs +0 -111
  77. package/lib/chunks/index-DAEQe-RI.mjs.map +0 -1
  78. package/lib/chunks/index-DAo-7spn.mjs.map +0 -1
  79. package/lib/chunks/index-ELyTQZeF.mjs +0 -281
  80. package/lib/chunks/index-ELyTQZeF.mjs.map +0 -1
  81. package/lib/chunks/index-dzB4jd9b.mjs.map +0 -1
@@ -1,10 +1,10 @@
1
- import { inject as Le, computed as T, unref as C, provide as ue, h as O, defineComponent as X, openBlock as c, createElementBlock as g, createElementVNode as E, toDisplayString as D, defineAsyncComponent as ut, createVNode as G, createTextVNode as dt, toRef as Te, ref as z, watch as V, onBeforeUnmount as oe, onMounted as De, Fragment as R, renderList as I, createBlock as _, resolveDynamicComponent as U, createCommentVNode as L, normalizeStyle as ee, onUnmounted as pt, Teleport as ct, Transition as ft, withCtx as mt } from "vue";
2
- import { ZoomOut as Ie, ZoomIn as Oe, Scan as vt, RotateCcw as ht, RotateCw as gt, RefreshCw as Ze, List as Ae, ChevronLeft as de, ChevronRight as pe, Minimize2 as Be, Maximize2 as Ve, WrapText as bt, Code as Ge, Eye as He, FileQuestion as wt, Download as Ue, X as xt } from "lucide-vue-next";
3
- import yt from "jszip";
4
- const kt = "1.3.8", Ft = {
5
- version: kt
1
+ import { inject as ce, computed as z, unref as v, provide as ae, ref as _, watch as q, onBeforeUnmount as G, h as B, defineComponent as X, openBlock as f, createElementBlock as b, createElementVNode as P, toDisplayString as I, defineAsyncComponent as pt, createVNode as H, createTextVNode as mt, toRef as Pe, onMounted as Ie, Fragment as E, renderList as O, createBlock as R, resolveDynamicComponent as V, createCommentVNode as W, normalizeStyle as oe, onUnmounted as vt, Teleport as ht, Transition as gt, withCtx as bt } from "vue";
2
+ import { ZoomOut as Oe, ZoomIn as qe, Scan as wt, RotateCcw as yt, RotateCw as xt, RefreshCw as Be, List as Ae, ChevronLeft as fe, ChevronRight as pe, Minimize2 as Ue, Maximize2 as He, WrapText as Ft, Code as Ze, Eye as Ve, FileQuestion as kt, Download as Ge, X as Ct } from "lucide-vue-next";
3
+ import _t from "jszip";
4
+ const Rt = "1.3.9", zt = {
5
+ version: Rt
6
6
  };
7
- function Ct(e) {
7
+ function Mt(e) {
8
8
  try {
9
9
  const t = new URL(e).pathname.split("/").pop() || "file";
10
10
  return decodeURIComponent(t);
@@ -13,7 +13,7 @@ function Ct(e) {
13
13
  return decodeURIComponent(t);
14
14
  }
15
15
  }
16
- function le(e) {
16
+ function ie(e) {
17
17
  var t;
18
18
  const o = ((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "";
19
19
  return {
@@ -90,36 +90,36 @@ function le(e) {
90
90
  zip: "application/zip"
91
91
  }[o] || "application/octet-stream";
92
92
  }
93
- function _t(e, t = 0) {
93
+ function Tt(e, t = 0) {
94
94
  if (e instanceof File)
95
95
  return {
96
96
  id: `file-${Date.now()}-${t}`,
97
97
  name: e.name,
98
98
  url: URL.createObjectURL(e),
99
- type: e.type || le(e.name),
99
+ type: e.type || ie(e.name),
100
100
  size: e.size
101
101
  };
102
102
  if (typeof e == "string") {
103
- const o = Ct(e);
103
+ const o = Mt(e);
104
104
  return {
105
105
  id: `url-${Date.now()}-${t}`,
106
106
  name: o,
107
107
  url: e,
108
- type: le(o)
108
+ type: ie(o)
109
109
  };
110
110
  }
111
111
  return {
112
112
  id: e.id || `link-${Date.now()}-${t}`,
113
113
  name: e.name,
114
114
  url: e.url,
115
- type: e.type || le(e.name),
115
+ type: e.type || ie(e.name),
116
116
  size: e.size
117
117
  };
118
118
  }
119
- function zt(e) {
120
- return e.map((t, o) => _t(t, o));
119
+ function Et(e) {
120
+ return e.map((t, o) => Tt(t, o));
121
121
  }
122
- function Mt(e) {
122
+ function Pt(e) {
123
123
  var t;
124
124
  const o = ((t = e.name.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "", a = e.type.toLowerCase();
125
125
  if (a.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(o))
@@ -197,7 +197,7 @@ function Mt(e) {
197
197
  ];
198
198
  return a.startsWith("text/") || l.includes(o) ? "text" : "unsupported";
199
199
  }
200
- function ln(e) {
200
+ function wn(e) {
201
201
  var t;
202
202
  const o = ((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "";
203
203
  return {
@@ -244,7 +244,7 @@ function ln(e) {
244
244
  txt: "text"
245
245
  }[o] || "text";
246
246
  }
247
- function rn(e) {
247
+ function yn(e) {
248
248
  var t;
249
249
  const o = ((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase().split("?")[0]) || "";
250
250
  return {
@@ -260,80 +260,80 @@ function rn(e) {
260
260
  flv: "video/x-flv"
261
261
  }[o] || "video/mp4";
262
262
  }
263
- function Rt(e) {
263
+ function $t(e) {
264
264
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
265
265
  }
266
- function sn(e) {
266
+ function xn(e) {
267
267
  if (!isFinite(e) || isNaN(e) || e < 0) return "0:00";
268
268
  const t = Math.floor(e / 60), o = Math.floor(e % 60);
269
269
  return `${t}:${o.toString().padStart(2, "0")}`;
270
270
  }
271
- function un(e) {
271
+ function Fn(e) {
272
272
  var t;
273
273
  return (((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "") === "tsv" ? " " : ",";
274
274
  }
275
- function dn(e, t = {}) {
275
+ function kn(e, t = {}) {
276
276
  const o = t.delimiter ?? ",", a = t.firstRowAsHeader ?? !0, l = [];
277
- let n = [], i = "", s = !1, r = 0;
277
+ let n = [], r = "", s = !1, i = 0;
278
278
  const u = e.length;
279
- for (; r < u; ) {
280
- const p = e[r];
279
+ for (; i < u; ) {
280
+ const c = e[i];
281
281
  if (s) {
282
- if (p === '"') {
283
- if (e[r + 1] === '"') {
284
- i += '"', r += 2;
282
+ if (c === '"') {
283
+ if (e[i + 1] === '"') {
284
+ r += '"', i += 2;
285
285
  continue;
286
286
  }
287
- s = !1, r += 1;
287
+ s = !1, i += 1;
288
288
  continue;
289
289
  }
290
- i += p, r += 1;
290
+ r += c, i += 1;
291
291
  continue;
292
292
  }
293
- if (p === '"') {
294
- s = !0, r += 1;
293
+ if (c === '"') {
294
+ s = !0, i += 1;
295
295
  continue;
296
296
  }
297
- if (p === o) {
298
- n.push(i), i = "", r += 1;
297
+ if (c === o) {
298
+ n.push(r), r = "", i += 1;
299
299
  continue;
300
300
  }
301
- if (p === "\r") {
302
- e[r + 1] === `
303
- ` && (r += 1), n.push(i), l.push(n), n = [], i = "", r += 1;
301
+ if (c === "\r") {
302
+ e[i + 1] === `
303
+ ` && (i += 1), n.push(r), l.push(n), n = [], r = "", i += 1;
304
304
  continue;
305
305
  }
306
- if (p === `
306
+ if (c === `
307
307
  `) {
308
- n.push(i), l.push(n), n = [], i = "", r += 1;
308
+ n.push(r), l.push(n), n = [], r = "", i += 1;
309
309
  continue;
310
310
  }
311
- i += p, r += 1;
311
+ r += c, i += 1;
312
312
  }
313
- for ((i.length > 0 || n.length > 0) && (n.push(i), l.push(n)); l.length > 0; ) {
314
- const p = l[l.length - 1];
315
- if (p.length === 1 && p[0] === "")
313
+ for ((r.length > 0 || n.length > 0) && (n.push(r), l.push(n)); l.length > 0; ) {
314
+ const c = l[l.length - 1];
315
+ if (c.length === 1 && c[0] === "")
316
316
  l.pop();
317
317
  else
318
318
  break;
319
319
  }
320
- let d = [], v = l;
321
- a && l.length > 0 && (d = l[0], v = l.slice(1));
322
- const m = Math.max(
320
+ let d = [], m = l;
321
+ a && l.length > 0 && (d = l[0], m = l.slice(1));
322
+ const p = Math.max(
323
323
  d.length,
324
- ...v.map((p) => p.length),
324
+ ...m.map((c) => c.length),
325
325
  0
326
326
  );
327
- for (const p of v)
328
- for (; p.length < m; ) p.push("");
327
+ for (const c of m)
328
+ for (; c.length < p; ) c.push("");
329
329
  return {
330
330
  header: d,
331
- rows: v,
332
- columnCount: m,
331
+ rows: m,
332
+ columnCount: p,
333
333
  delimiter: o
334
334
  };
335
335
  }
336
- function Tt(e) {
336
+ function jt(e) {
337
337
  const t = e instanceof Uint8Array ? e : new Uint8Array(e);
338
338
  if (t.length >= 3 && t[0] === 239 && t[1] === 187 && t[2] === 191)
339
339
  return new TextDecoder("utf-8").decode(t);
@@ -351,13 +351,54 @@ function Tt(e) {
351
351
  }
352
352
  return new TextDecoder("utf-8", { fatal: !1 }).decode(t);
353
353
  }
354
- async function pn(e, t) {
355
- const o = await fetch(e, t);
356
- if (!o.ok) throw new Error(`请求失败: ${o.status}`);
357
- const a = await o.arrayBuffer();
358
- return Tt(a);
354
+ async function Cn(e, t) {
355
+ const o = !!t && ("fetcher" in t || "init" in t), a = o ? t.fetcher ?? fetch : fetch, l = o ? t.init : t, n = await a(e, l);
356
+ if (!n.ok) throw new Error(`请求失败: ${n.status}`);
357
+ const r = await n.arrayBuffer();
358
+ return jt(r);
359
+ }
360
+ async function St(e, t) {
361
+ if (e)
362
+ return typeof e == "function" ? await e(t) : e;
363
+ }
364
+ function Lt(e, t) {
365
+ if (!e && !t) return;
366
+ if (!e) return t;
367
+ if (!t) return e;
368
+ const o = new Headers(e.headers || {});
369
+ return t.headers && new Headers(t.headers).forEach((a, l) => {
370
+ o.set(l, a);
371
+ }), {
372
+ ...e,
373
+ ...t,
374
+ headers: o
375
+ };
376
+ }
377
+ function Nt(e) {
378
+ const t = (e == null ? void 0 : e.requestHandler) ?? ((a, l) => fetch(a, l)), o = e == null ? void 0 : e.requestInit;
379
+ return async (a, l) => {
380
+ const n = await St(o, a), r = Lt(n, l);
381
+ return t(a, r);
382
+ };
383
+ }
384
+ async function Dt(e, t = fetch, o) {
385
+ const a = await t(e, o);
386
+ if (!a.ok) throw new Error(`请求失败: ${a.status}`);
387
+ const l = await a.blob();
388
+ return URL.createObjectURL(l);
389
+ }
390
+ async function Wt(e, t, o = fetch, a) {
391
+ const l = await o(e, a);
392
+ if (!l.ok) throw new Error(`请求失败: ${l.status}`);
393
+ const n = await l.blob(), r = URL.createObjectURL(n);
394
+ try {
395
+ const s = document.createElement("a");
396
+ s.href = r, s.download = t, s.style.display = "none", document.body.appendChild(s), s.click(), document.body.removeChild(s);
397
+ } finally {
398
+ setTimeout(() => URL.revokeObjectURL(r), 1e3);
399
+ }
359
400
  }
360
- function Ee(e) {
401
+ function $e(e) {
361
402
  const t = e.trim().replace(",", "."), o = t.split(":").map((a) => a.trim());
362
403
  if (o.length === 3) {
363
404
  const [a, l, n] = o;
@@ -369,55 +410,55 @@ function Ee(e) {
369
410
  }
370
411
  return Number(t) || 0;
371
412
  }
372
- function cn(e) {
413
+ function _n(e) {
373
414
  if (!isFinite(e) || e < 0) return "00:00:00.000";
374
- const t = Math.floor(e * 1e3), o = t % 1e3, a = Math.floor(t / 1e3) % 60, l = Math.floor(t / 6e4) % 60, n = Math.floor(t / 36e5), i = (s, r = 2) => s.toString().padStart(r, "0");
375
- return `${i(n)}:${i(l)}:${i(a)}.${i(o, 3)}`;
415
+ const t = Math.floor(e * 1e3), o = t % 1e3, a = Math.floor(t / 1e3) % 60, l = Math.floor(t / 6e4) % 60, n = Math.floor(t / 36e5), r = (s, i = 2) => s.toString().padStart(i, "0");
416
+ return `${r(n)}:${r(l)}:${r(a)}.${r(o, 3)}`;
376
417
  }
377
- const Pe = /(\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}/, Et = /^\s*\[\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?\]/;
378
- function Pt(e) {
418
+ const je = /(\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}/, It = /^\s*\[\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?\]/;
419
+ function Ot(e) {
379
420
  const t = e.replace(/^\uFEFF/, "").trimStart();
380
- 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" : Et.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";
421
+ 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" : It.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";
381
422
  }
382
- function $e(e, t) {
423
+ function Se(e, t) {
383
424
  const o = e.replace(/\r\n?/g, `
384
425
  `).replace(/^\uFEFF/, "").split(`
385
426
  `), a = [];
386
427
  let l, n = 0;
387
428
  if (t === "vtt") {
388
- const i = [];
429
+ const r = [];
389
430
  for (; n < o.length && o[n].trim() !== ""; )
390
- i.push(o[n]), n++;
391
- for (l = i.join(`
431
+ r.push(o[n]), n++;
432
+ for (l = r.join(`
392
433
  `); n < o.length && o[n].trim() === ""; ) n++;
393
434
  }
394
435
  for (; n < o.length; ) {
395
436
  for (; n < o.length && o[n].trim() === ""; ) n++;
396
437
  if (n >= o.length) break;
397
- let i, s = null;
398
- if (Pe.test(o[n]))
438
+ let r, s = null;
439
+ if (je.test(o[n]))
399
440
  s = o[n], n++;
400
- else if (i = o[n].trim() || void 0, n++, n < o.length && Pe.test(o[n]))
441
+ else if (r = o[n].trim() || void 0, n++, n < o.length && je.test(o[n]))
401
442
  s = o[n], n++;
402
443
  else
403
444
  continue;
404
445
  if (!s) continue;
405
- const r = s.match(/([\d:.,]+)\s*-->\s*([\d:.,]+)/);
406
- if (!r) continue;
407
- const u = Ee(r[1]), d = Ee(r[2]), v = [];
446
+ const i = s.match(/([\d:.,]+)\s*-->\s*([\d:.,]+)/);
447
+ if (!i) continue;
448
+ const u = $e(i[1]), d = $e(i[2]), m = [];
408
449
  for (; n < o.length && o[n].trim() !== ""; )
409
- v.push(o[n]), n++;
410
- a.push({ id: i, start: u, end: d, text: v.join(`
450
+ m.push(o[n]), n++;
451
+ a.push({ id: r, start: u, end: d, text: m.join(`
411
452
  `) });
412
453
  }
413
454
  return { format: t, cues: a, header: l };
414
455
  }
415
- function se(e, t, o) {
456
+ function de(e, t, o) {
416
457
  const a = Number(e), l = Number(t);
417
458
  let n = 0;
418
459
  if (o) {
419
- const i = (o + "000").slice(0, 3);
420
- n = Number(i);
460
+ const r = (o + "000").slice(0, 3);
461
+ n = Number(r);
421
462
  }
422
463
  return a * 60 + l + n / 1e3;
423
464
  }
@@ -431,63 +472,63 @@ function Xe(e, t) {
431
472
  }
432
473
  return !0;
433
474
  }
434
- function $t(e) {
475
+ function qt(e) {
435
476
  const t = e.replace(/\r\n?/g, `
436
477
  `).replace(/^\uFEFF/, "").split(`
437
478
  `), o = { metadata: {}, offsetMs: 0 }, a = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, l = [];
438
- for (const i of t) {
439
- const s = i.trim();
479
+ for (const r of t) {
480
+ const s = r.trim();
440
481
  if (!s || Xe(s, o)) continue;
441
- const r = [];
482
+ const i = [];
442
483
  let u = 0;
443
484
  a.lastIndex = 0;
444
485
  let d;
445
486
  for (; (d = a.exec(s)) !== null && d.index === u; )
446
- r.push(se(d[1], d[2], d[3])), u = d.index + d[0].length;
447
- if (r.length === 0) continue;
448
- const v = s.slice(u).trim();
449
- for (const m of r)
450
- l.push({ start: m, text: v });
487
+ i.push(de(d[1], d[2], d[3])), u = d.index + d[0].length;
488
+ if (i.length === 0) continue;
489
+ const m = s.slice(u).trim();
490
+ for (const p of i)
491
+ l.push({ start: p, text: m });
451
492
  }
452
- l.sort((i, s) => i.start - s.start);
493
+ l.sort((r, s) => r.start - s.start);
453
494
  const n = o.offsetMs / 1e3;
454
- return { format: "lrc", cues: l.map((i, s) => {
455
- const r = Math.max(0, i.start - n), u = l[s + 1], d = u ? Math.max(r, u.start - n) : r + 5;
456
- return { start: r, end: d, text: i.text };
495
+ return { format: "lrc", cues: l.map((r, s) => {
496
+ const i = Math.max(0, r.start - n), u = l[s + 1], d = u ? Math.max(i, u.start - n) : i + 5;
497
+ return { start: i, end: d, text: r.text };
457
498
  }), metadata: o.metadata };
458
499
  }
459
- function St(e) {
500
+ function Bt(e) {
460
501
  const t = e.replace(/\r\n?/g, `
461
502
  `).replace(/^\uFEFF/, "").split(`
462
503
  `), o = { metadata: {}, offsetMs: 0 }, a = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, l = /<(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?>/g, n = [];
463
504
  for (const s of t) {
464
- const r = s.trim();
465
- if (!r || Xe(r, o)) continue;
505
+ const i = s.trim();
506
+ if (!i || Xe(i, o)) continue;
466
507
  const u = [];
467
508
  let d = 0;
468
509
  a.lastIndex = 0;
469
- let v;
470
- for (; (v = a.exec(r)) !== null && v.index === d; )
471
- u.push(se(v[1], v[2], v[3])), d = v.index + v[0].length;
510
+ let m;
511
+ for (; (m = a.exec(i)) !== null && m.index === d; )
512
+ u.push(de(m[1], m[2], m[3])), d = m.index + m[0].length;
472
513
  if (u.length === 0) continue;
473
- const m = r.slice(d);
474
- for (const p of u)
475
- n.push({ start: p, raw: m });
514
+ const p = i.slice(d);
515
+ for (const c of u)
516
+ n.push({ start: c, raw: p });
476
517
  }
477
- n.sort((s, r) => s.start - r.start);
478
- const i = o.offsetMs / 1e3;
479
- return { format: "elrc", cues: n.map((s, r) => {
518
+ n.sort((s, i) => s.start - i.start);
519
+ const r = o.offsetMs / 1e3;
520
+ return { format: "elrc", cues: n.map((s, i) => {
480
521
  const u = [];
481
- let d = "", v = 0, m = null;
522
+ let d = "", m = 0, p = null;
482
523
  l.lastIndex = 0;
483
- let p;
484
- for (; (p = l.exec(s.raw)) !== null; ) {
485
- const P = s.raw.slice(v, p.index);
486
- m !== null && P && u.push({ start: Math.max(0, m - i), text: P }), d += P, m = se(p[1], p[2], p[3]), v = p.index + p[0].length;
524
+ let c;
525
+ for (; (c = l.exec(s.raw)) !== null; ) {
526
+ const $ = s.raw.slice(m, c.index);
527
+ p !== null && $ && u.push({ start: Math.max(0, p - r), text: $ }), d += $, p = de(c[1], c[2], c[3]), m = c.index + c[0].length;
487
528
  }
488
- const y = s.raw.slice(v);
489
- m !== null && y && u.push({ start: Math.max(0, m - i), text: y }), d += y;
490
- const M = Math.max(0, s.start - i), N = n[r + 1], k = N ? Math.max(M, N.start - i) : M + 5;
529
+ const F = s.raw.slice(m);
530
+ p !== null && F && u.push({ start: Math.max(0, p - r), text: F }), d += F;
531
+ const M = Math.max(0, s.start - r), L = n[i + 1], k = L ? Math.max(M, L.start - r) : M + 5;
491
532
  return {
492
533
  start: M,
493
534
  end: k,
@@ -496,7 +537,7 @@ function St(e) {
496
537
  };
497
538
  }), metadata: o.metadata };
498
539
  }
499
- function Se(e) {
540
+ function Le(e) {
500
541
  const t = e.trim().split(":");
501
542
  return t.length !== 3 ? 0 : Number(t[0]) * 3600 + Number(t[1]) * 60 + Number(t[2].replace(",", "."));
502
543
  }
@@ -505,41 +546,41 @@ function Ne(e, t) {
505
546
  `).replace(/^\uFEFF/, "").split(`
506
547
  `);
507
548
  let a = "", l = [];
508
- const n = [], i = [];
549
+ const n = [], r = [];
509
550
  for (const s of o) {
510
- const r = s.replace(/\s+$/, ""), u = r.trim(), d = /^\[([^\]]+)\]\s*$/.exec(u);
551
+ const i = s.replace(/\s+$/, ""), u = i.trim(), d = /^\[([^\]]+)\]\s*$/.exec(u);
511
552
  if (d) {
512
- a = d[1].toLowerCase(), i.push(r);
553
+ a = d[1].toLowerCase(), r.push(i);
513
554
  continue;
514
555
  }
515
556
  if (a !== "events") {
516
- i.push(r);
557
+ r.push(i);
517
558
  continue;
518
559
  }
519
- const v = /^Format:\s*(.+)$/i.exec(u);
520
- if (v) {
521
- l = v[1].split(",").map((W) => W.trim());
560
+ const m = /^Format:\s*(.+)$/i.exec(u);
561
+ if (m) {
562
+ l = m[1].split(",").map((D) => D.trim());
522
563
  continue;
523
564
  }
524
- const m = /^(Dialogue|Comment):\s*(.+)$/i.exec(u);
525
- if (!m || m[1].toLowerCase() === "comment" || l.length === 0) continue;
526
- const p = l.length, y = m[2].split(","), M = y.slice(0, p - 1), N = y.slice(p - 1).join(","), k = {};
527
- l.forEach((W, f) => {
528
- k[W] = f === p - 1 ? N : M[f] ?? "";
565
+ const p = /^(Dialogue|Comment):\s*(.+)$/i.exec(u);
566
+ if (!p || p[1].toLowerCase() === "comment" || l.length === 0) continue;
567
+ const c = l.length, F = p[2].split(","), M = F.slice(0, c - 1), L = F.slice(c - 1).join(","), k = {};
568
+ l.forEach((D, g) => {
569
+ k[D] = g === c - 1 ? L : M[g] ?? "";
529
570
  });
530
- const P = Se(k.Start || ""), Z = Se(k.End || ""), H = (k.Text || "").replace(/\\N/g, `
571
+ const $ = Le(k.Start || ""), A = Le(k.End || ""), Z = (k.Text || "").replace(/\\N/g, `
531
572
  `).replace(/\\n/g, `
532
573
  `).replace(/\\h/g, " ").replace(/\{[^}]*\}/g, "");
533
- n.push({ start: P, end: Z, text: H, style: k.Style });
574
+ n.push({ start: $, end: A, text: Z, style: k.Style });
534
575
  }
535
- return n.sort((s, r) => s.start - r.start), {
576
+ return n.sort((s, i) => s.start - i.start), {
536
577
  format: t,
537
578
  cues: n,
538
- header: i.join(`
579
+ header: r.join(`
539
580
  `).trim() || void 0
540
581
  };
541
582
  }
542
- function re(e) {
583
+ function se(e) {
543
584
  const t = e.trim();
544
585
  if (!t) return 0;
545
586
  const o = /^(\d+(?:\.\d+)?)(h|m|s|ms|f|t)$/i.exec(t);
@@ -550,7 +591,7 @@ function re(e) {
550
591
  const a = t.split(":");
551
592
  return a.length === 3 ? Number(a[0]) * 3600 + Number(a[1]) * 60 + Number(a[2]) : a.length === 2 ? Number(a[0]) * 60 + Number(a[1]) : Number(t) || 0;
552
593
  }
553
- function Nt(e) {
594
+ function At(e) {
554
595
  if (typeof DOMParser > "u")
555
596
  throw new Error("TTML parsing requires a DOMParser environment");
556
597
  const t = new DOMParser().parseFromString(e, "application/xml");
@@ -558,73 +599,73 @@ function Nt(e) {
558
599
  throw new Error("TTML XML parse error");
559
600
  const o = t.getElementsByTagName("p"), a = [];
560
601
  for (let l = 0; l < o.length; l++) {
561
- const n = o[l], i = n.getAttribute("begin") || "", s = n.getAttribute("end") || "", r = n.getAttribute("dur") || "", u = re(i);
602
+ const n = o[l], r = n.getAttribute("begin") || "", s = n.getAttribute("end") || "", i = n.getAttribute("dur") || "", u = se(r);
562
603
  let d;
563
- s ? d = re(s) : r ? d = u + re(r) : d = u + 5;
564
- let v = "";
565
- n.childNodes.forEach((p) => {
566
- if (p.nodeType === 3)
567
- v += p.nodeValue || "";
568
- else if (p.nodeType === 1) {
569
- const y = p;
570
- y.tagName.toLowerCase() === "br" ? v += `
571
- ` : v += y.textContent || "";
604
+ s ? d = se(s) : i ? d = u + se(i) : d = u + 5;
605
+ let m = "";
606
+ n.childNodes.forEach((c) => {
607
+ if (c.nodeType === 3)
608
+ m += c.nodeValue || "";
609
+ else if (c.nodeType === 1) {
610
+ const F = c;
611
+ F.tagName.toLowerCase() === "br" ? m += `
612
+ ` : m += F.textContent || "";
572
613
  }
573
614
  });
574
- const m = v.replace(/[ \t]+/g, " ").replace(/\n /g, `
615
+ const p = m.replace(/[ \t]+/g, " ").replace(/\n /g, `
575
616
  `).trim();
576
- (m || u || d) && a.push({ start: u, end: d, text: m });
617
+ (p || u || d) && a.push({ start: u, end: d, text: p });
577
618
  }
578
619
  return a.sort((l, n) => l.start - n.start), { format: "ttml", cues: a };
579
620
  }
580
- function fn(e, t) {
581
- switch (t ?? Pt(e)) {
621
+ function Rn(e, t) {
622
+ switch (t ?? Ot(e)) {
582
623
  case "lrc":
583
- return $t(e);
624
+ return qt(e);
584
625
  case "elrc":
585
- return St(e);
626
+ return Bt(e);
586
627
  case "ass":
587
628
  return Ne(e, "ass");
588
629
  case "ssa":
589
630
  return Ne(e, "ssa");
590
631
  case "ttml":
591
- return Nt(e);
632
+ return At(e);
592
633
  case "vtt":
593
- return $e(e, "vtt");
634
+ return Se(e, "vtt");
594
635
  case "srt":
595
636
  default:
596
- return $e(e, "srt");
637
+ return Se(e, "srt");
597
638
  }
598
639
  }
599
- async function mn(e) {
600
- return yt.loadAsync(e);
640
+ async function zn(e) {
641
+ return _t.loadAsync(e);
601
642
  }
602
- function vn(e) {
643
+ function Mn(e) {
603
644
  const t = [];
604
645
  return e.forEach((o, a) => {
605
646
  var l;
606
- const n = a.dir, i = n && !o.endsWith("/") ? o + "/" : o, s = n ? i.replace(/\/$/, "") : i, r = s.lastIndexOf("/"), u = r >= 0 ? s.slice(r + 1) : s, d = r >= 0 ? s.slice(0, r) : "", v = n ? 0 : ((l = a._data) == null ? void 0 : l.uncompressedSize) ?? 0;
647
+ const n = a.dir, r = n && !o.endsWith("/") ? o + "/" : o, s = n ? r.replace(/\/$/, "") : r, i = s.lastIndexOf("/"), u = i >= 0 ? s.slice(i + 1) : s, d = i >= 0 ? s.slice(0, i) : "", m = n ? 0 : ((l = a._data) == null ? void 0 : l.uncompressedSize) ?? 0;
607
648
  t.push({
608
- path: i,
649
+ path: r,
609
650
  name: u,
610
651
  dir: d,
611
652
  isDir: n,
612
- size: v,
653
+ size: m,
613
654
  date: a.date
614
655
  });
615
656
  }), t;
616
657
  }
617
- function hn(e) {
658
+ function Tn(e) {
618
659
  const t = { name: "", path: "", isDir: !0, children: [], size: 0 }, o = /* @__PURE__ */ new Map();
619
660
  o.set("", t);
620
661
  const a = (n) => {
621
662
  if (o.has(n)) return o.get(n);
622
- const i = n.split("/").filter(Boolean);
623
- let s = t, r = "";
624
- for (const u of i) {
625
- r = r ? `${r}/${u}` : u;
626
- let d = o.get(r);
627
- d || (d = { name: u, path: r + "/", isDir: !0, children: [], size: 0 }, s.children.push(d), o.set(r, d)), s = d;
663
+ const r = n.split("/").filter(Boolean);
664
+ let s = t, i = "";
665
+ for (const u of r) {
666
+ i = i ? `${i}/${u}` : u;
667
+ let d = o.get(i);
668
+ d || (d = { name: u, path: i + "/", isDir: !0, children: [], size: 0 }, s.children.push(d), o.set(i, d)), s = d;
628
669
  }
629
670
  return s;
630
671
  };
@@ -642,22 +683,22 @@ function hn(e) {
642
683
  }
643
684
  const l = (n) => {
644
685
  if (n.children) {
645
- n.children.sort((i, s) => i.isDir !== s.isDir ? i.isDir ? -1 : 1 : i.name.localeCompare(s.name));
646
- for (const i of n.children) l(i);
686
+ n.children.sort((r, s) => r.isDir !== s.isDir ? r.isDir ? -1 : 1 : r.name.localeCompare(s.name));
687
+ for (const r of n.children) l(r);
647
688
  }
648
689
  };
649
690
  return l(t), t;
650
691
  }
651
- async function gn(e, t, o) {
692
+ async function En(e, t, o) {
652
693
  const a = e.file(t);
653
694
  if (!a) throw new Error(`ZIP entry not found: ${t}`);
654
695
  const l = await a.async("arraybuffer");
655
696
  return new Blob([l], o ? { type: o } : void 0);
656
697
  }
657
- function jt(e) {
698
+ function Ut(e) {
658
699
  return e ? e.startsWith("#") ? e : e.length === 8 ? "#" + e.substring(2) : e.length === 6 ? "#" + e : "#000000" : "#000000";
659
700
  }
660
- const Wt = [
701
+ const Ht = [
661
702
  "FFFFFF",
662
703
  "000000",
663
704
  "E7E6E6",
@@ -668,7 +709,7 @@ const Wt = [
668
709
  "FFC000",
669
710
  "5B9BD5",
670
711
  "70AD47"
671
- ], Lt = [
712
+ ], Zt = [
672
713
  "000000",
673
714
  "FFFFFF",
674
715
  "FF0000",
@@ -734,48 +775,48 @@ const Wt = [
734
775
  "333399",
735
776
  "333333"
736
777
  ];
737
- function Dt(e, t) {
738
- const o = parseInt(e.substring(0, 2), 16), a = parseInt(e.substring(2, 4), 16), l = parseInt(e.substring(4, 6), 16), n = (u) => t < 0 ? Math.round(u * (1 + t)) : Math.round(u + (255 - u) * t), i = Math.min(255, Math.max(0, n(o))), s = Math.min(255, Math.max(0, n(a))), r = Math.min(255, Math.max(0, n(l)));
739
- return i.toString(16).padStart(2, "0") + s.toString(16).padStart(2, "0") + r.toString(16).padStart(2, "0");
778
+ function Vt(e, t) {
779
+ const o = parseInt(e.substring(0, 2), 16), a = parseInt(e.substring(2, 4), 16), l = parseInt(e.substring(4, 6), 16), n = (u) => t < 0 ? Math.round(u * (1 + t)) : Math.round(u + (255 - u) * t), r = Math.min(255, Math.max(0, n(o))), s = Math.min(255, Math.max(0, n(a))), i = Math.min(255, Math.max(0, n(l)));
780
+ return r.toString(16).padStart(2, "0") + s.toString(16).padStart(2, "0") + i.toString(16).padStart(2, "0");
740
781
  }
741
- function It(e) {
782
+ function Gt(e) {
742
783
  if (e && e.type === "pattern" && e.pattern === "solid") {
743
784
  const t = e.fgColor;
744
785
  if (t)
745
- return ce(t);
786
+ return me(t);
746
787
  }
747
788
  }
748
- function ce(e) {
789
+ function me(e) {
749
790
  if (e) {
750
791
  if ("argb" in e && typeof e.argb == "string" && e.argb)
751
- return jt(e.argb);
792
+ return Ut(e.argb);
752
793
  if ("theme" in e && typeof e.theme == "number") {
753
- const t = Wt[e.theme] || "000000", o = "tint" in e && typeof e.tint == "number" ? e.tint : 0;
754
- return "#" + (o !== 0 ? Dt(t, o) : t);
794
+ const t = Ht[e.theme] || "000000", o = "tint" in e && typeof e.tint == "number" ? e.tint : 0;
795
+ return "#" + (o !== 0 ? Vt(t, o) : t);
755
796
  }
756
797
  if ("indexed" in e && typeof e.indexed == "number") {
757
- const t = Lt[e.indexed];
798
+ const t = Zt[e.indexed];
758
799
  if (t) return "#" + t;
759
800
  }
760
801
  }
761
802
  }
762
- function Ot(e) {
803
+ function Xt(e) {
763
804
  if (!e || !e.style) return;
764
- const t = ce(e.color) || "#000000";
805
+ const t = me(e.color) || "#000000";
765
806
  return [e.style, t];
766
807
  }
767
- function Zt(e) {
808
+ function Yt(e) {
768
809
  const t = {};
769
810
  let o = !1;
770
811
  if (e.font) {
771
812
  const l = e.font;
772
813
  if ((l.name || l.size || l.bold || l.italic) && (o = !0, t.font = {}, l.name && (t.font.name = l.name), l.size && (t.font.size = l.size), l.bold && (t.font.bold = !0), l.italic && (t.font.italic = !0)), l.color) {
773
- const n = ce(l.color);
814
+ const n = me(l.color);
774
815
  n && (o = !0, t.color = n);
775
816
  }
776
817
  l.underline && (o = !0, t.underline = !0), l.strike && (o = !0, t.strike = !0);
777
818
  }
778
- const a = It(e.fill);
819
+ const a = Gt(e.fill);
779
820
  if (a && (o = !0, t.bgcolor = a), e.alignment) {
780
821
  const l = e.alignment;
781
822
  l.horizontal && (o = !0, t.align = l.horizontal), l.vertical && (o = !0, t.valign = l.vertical), l.wrapText && (o = !0, t.textwrap = !0);
@@ -783,27 +824,27 @@ function Zt(e) {
783
824
  if (e.border) {
784
825
  const l = {};
785
826
  let n = !1;
786
- const i = ["top", "bottom", "left", "right"];
787
- for (const s of i) {
788
- const r = Ot(e.border[s]);
789
- r && (l[s] = r, n = !0);
827
+ const r = ["top", "bottom", "left", "right"];
828
+ for (const s of r) {
829
+ const i = Xt(e.border[s]);
830
+ i && (l[s] = i, n = !0);
790
831
  }
791
832
  n && (o = !0, t.border = l);
792
833
  }
793
834
  return o ? t : null;
794
835
  }
795
- function At(e) {
836
+ function Kt(e) {
796
837
  return JSON.stringify(e);
797
838
  }
798
- function Bt(e, t, o) {
799
- const a = Zt(e);
839
+ function Jt(e, t, o) {
840
+ const a = Yt(e);
800
841
  if (!a) return -1;
801
- const l = At(a), n = o.get(l);
842
+ const l = Kt(a), n = o.get(l);
802
843
  if (n !== void 0) return n;
803
- const i = t.length;
804
- return t.push(a), o.set(l, i), i;
844
+ const r = t.length;
845
+ return t.push(a), o.set(l, r), r;
805
846
  }
806
- function Vt(e) {
847
+ function Qt(e) {
807
848
  const t = e.value;
808
849
  if (t == null) return "";
809
850
  if (typeof t == "string") return t;
@@ -817,8 +858,8 @@ function Vt(e) {
817
858
  }
818
859
  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);
819
860
  }
820
- function Gt(e) {
821
- const t = e.split(":"), o = je(t[0]), a = t[1] ? je(t[1]) : o;
861
+ function eo(e) {
862
+ const t = e.split(":"), o = De(t[0]), a = t[1] ? De(t[1]) : o;
822
863
  return {
823
864
  top: o.row,
824
865
  left: o.col,
@@ -826,7 +867,7 @@ function Gt(e) {
826
867
  right: a.col
827
868
  };
828
869
  }
829
- function je(e) {
870
+ function De(e) {
830
871
  const t = e.match(/^([A-Z]+)(\d+)$/);
831
872
  if (!t) return { row: 1, col: 1 };
832
873
  const o = t[1], a = parseInt(t[2], 10);
@@ -835,69 +876,69 @@ function je(e) {
835
876
  l = l * 26 + (o.charCodeAt(n) - 64);
836
877
  return { row: a, col: l };
837
878
  }
838
- function bn(e) {
879
+ function Pn(e) {
839
880
  const t = [];
840
881
  return e.eachSheet((o) => {
841
- const a = [], l = /* @__PURE__ */ new Map(), n = [], i = {}, s = {}, r = o.columnCount;
842
- for (let m = 1; m <= r; m++) {
843
- const p = o.getColumn(m);
844
- p.width && (s[String(m - 1)] = { width: Math.round(p.width * 7.5) });
882
+ const a = [], l = /* @__PURE__ */ new Map(), n = [], r = {}, s = {}, i = o.columnCount;
883
+ for (let p = 1; p <= i; p++) {
884
+ const c = o.getColumn(p);
885
+ c.width && (s[String(p - 1)] = { width: Math.round(c.width * 7.5) });
845
886
  }
846
- s.len = Math.max(r, 26);
847
- const u = /* @__PURE__ */ new Map(), d = o.model, v = (d == null ? void 0 : d.merges) || [];
848
- for (const m of v) {
849
- n.push(m);
850
- const { top: p, left: y, bottom: M, right: N } = Gt(m), k = M - p, P = N - y;
851
- u.set(`${p - 1},${y - 1}`, [k, P]);
887
+ s.len = Math.max(i, 26);
888
+ const u = /* @__PURE__ */ new Map(), d = o.model, m = (d == null ? void 0 : d.merges) || [];
889
+ for (const p of m) {
890
+ n.push(p);
891
+ const { top: c, left: F, bottom: M, right: L } = eo(p), k = M - c, $ = L - F;
892
+ u.set(`${c - 1},${F - 1}`, [k, $]);
852
893
  }
853
- o.eachRow({ includeEmpty: !0 }, (m, p) => {
854
- const y = p - 1, M = {};
855
- m.eachCell({ includeEmpty: !1 }, (k, P) => {
856
- const Z = P - 1;
894
+ o.eachRow({ includeEmpty: !0 }, (p, c) => {
895
+ const F = c - 1, M = {};
896
+ p.eachCell({ includeEmpty: !1 }, (k, $) => {
897
+ const A = $ - 1;
857
898
  if (k.isMerged && k.master !== k) return;
858
- const H = Vt(k), W = Bt(k, a, l), f = { text: H };
859
- W !== -1 && (f.style = W);
860
- const A = `${y},${Z}`;
861
- u.has(A) && (f.merge = u.get(A)), M[String(Z)] = f;
899
+ const Z = Qt(k), D = Jt(k, a, l), g = { text: Z };
900
+ D !== -1 && (g.style = D);
901
+ const T = `${F},${A}`;
902
+ u.has(T) && (g.merge = u.get(T)), M[String(A)] = g;
862
903
  });
863
- const N = { cells: M };
864
- m.height && (N.height = Math.round(m.height * 1.333)), i[String(y)] = N;
904
+ const L = { cells: M };
905
+ p.height && (L.height = Math.round(p.height * 1.333)), r[String(F)] = L;
865
906
  }), t.push({
866
907
  name: o.name,
867
908
  styles: a,
868
909
  merges: n,
869
- rows: i,
910
+ rows: r,
870
911
  cols: s
871
912
  });
872
913
  }), t;
873
914
  }
874
- function wn(e, t, o = "Sheet1") {
915
+ function $n(e, t, o = "Sheet1") {
875
916
  const a = e.length > 0, l = a ? [{ font: { bold: !0 } }] : [], n = {};
876
917
  if (a) {
877
918
  const s = {};
878
- e.forEach((r, u) => {
879
- s[String(u)] = { text: r, style: 0 };
919
+ e.forEach((i, u) => {
920
+ s[String(u)] = { text: i, style: 0 };
880
921
  }), n[0] = { cells: s };
881
922
  }
882
- const i = a ? 1 : 0;
883
- return t.forEach((s, r) => {
923
+ const r = a ? 1 : 0;
924
+ return t.forEach((s, i) => {
884
925
  const u = {};
885
- s.forEach((d, v) => {
886
- d !== void 0 && d !== "" && (u[String(v)] = { text: d });
887
- }), n[String(r + i)] = { cells: u };
926
+ s.forEach((d, m) => {
927
+ d !== void 0 && d !== "" && (u[String(m)] = { text: d });
928
+ }), n[String(i + r)] = { cells: u };
888
929
  }), [{ name: o, styles: l, rows: n }];
889
930
  }
890
- function xn(e, t) {
931
+ function jn(e, t) {
891
932
  var o;
892
933
  if (typeof window > "u") return;
893
934
  const a = (e == null ? void 0 : e.version) || ((o = e == null ? void 0 : e.GlobalWorkerOptions) == null ? void 0 : o.version) || "", {
894
935
  workerSrc: l = `https://unpkg.com/pdfjs-dist@${a}/build/pdf.worker.min.mjs`,
895
936
  cMapUrl: n = `https://unpkg.com/pdfjs-dist@${a}/cmaps/`,
896
- cMapPacked: i = !0
937
+ cMapPacked: r = !0
897
938
  } = t || {};
898
- e.GlobalWorkerOptions && (e.GlobalWorkerOptions.workerSrc = l, e.GlobalWorkerOptions.cMapUrl = n, e.GlobalWorkerOptions.cMapPacked = i);
939
+ e.GlobalWorkerOptions && (e.GlobalWorkerOptions.workerSrc = l, e.GlobalWorkerOptions.cMapUrl = n, e.GlobalWorkerOptions.cMapPacked = r);
899
940
  }
900
- const Ht = {
941
+ const to = {
901
942
  // ─────── common ───────
902
943
  "common.download": "下载",
903
944
  "common.close": "关闭",
@@ -996,7 +1037,7 @@ const Ht = {
996
1037
  "zip.parse_failed": "ZIP 解析失败",
997
1038
  // ─────── text ───────
998
1039
  "text.load_failed": "文本文件加载失败"
999
- }, Ut = {
1040
+ }, oo = {
1000
1041
  // ─────── common ───────
1001
1042
  "common.download": "Download",
1002
1043
  "common.close": "Close",
@@ -1095,51 +1136,115 @@ const Ht = {
1095
1136
  "zip.parse_failed": "Failed to parse ZIP",
1096
1137
  // ─────── text ───────
1097
1138
  "text.load_failed": "Failed to load text file"
1098
- }, te = {
1099
- "zh-CN": Ht,
1100
- "en-US": Ut
1101
- }, Xt = /\{(\w+)\}/g;
1102
- function qt(e, t) {
1103
- return t ? e.replace(Xt, (o, a) => {
1139
+ }, ne = {
1140
+ "zh-CN": to,
1141
+ "en-US": oo
1142
+ }, no = /\{(\w+)\}/g;
1143
+ function ao(e, t) {
1144
+ return t ? e.replace(no, (o, a) => {
1104
1145
  const l = t[a];
1105
1146
  return l === void 0 ? `{${a}}` : String(l);
1106
1147
  }) : e;
1107
1148
  }
1108
- function qe(e) {
1149
+ function Ye(e) {
1109
1150
  var t;
1110
- const o = e.fallbackLocale ?? "zh-CN", a = te[e.locale] ?? te[o] ?? te["zh-CN"], l = (t = e.messages) == null ? void 0 : t[e.locale], n = l ? { ...a, ...l } : a, i = te["zh-CN"];
1111
- return (s, r) => {
1112
- const u = n[s] ?? i[s] ?? s;
1113
- return qt(u, r);
1151
+ const o = e.fallbackLocale ?? "zh-CN", a = ne[e.locale] ?? ne[o] ?? ne["zh-CN"], l = (t = e.messages) == null ? void 0 : t[e.locale], n = l ? { ...a, ...l } : a, r = ne["zh-CN"];
1152
+ return (s, i) => {
1153
+ const u = n[s] ?? r[s] ?? s;
1154
+ return ao(u, i);
1114
1155
  };
1115
1156
  }
1116
- const Ye = Symbol("file-preview-locale");
1117
- function Yt(e, t) {
1118
- const o = T(() => C(e) ?? "zh-CN"), a = T(
1119
- () => qe({ locale: o.value, messages: C(t) })
1157
+ const Ke = Symbol("file-preview-locale");
1158
+ function lo(e, t) {
1159
+ const o = z(() => v(e) ?? "zh-CN"), a = z(
1160
+ () => Ye({ locale: o.value, messages: v(t) })
1120
1161
  );
1121
- ue(Ye, { locale: o, t: a });
1162
+ ae(Ke, { locale: o, t: a });
1122
1163
  }
1123
- let ie = null;
1124
- function Jt() {
1125
- return ie || (ie = qe({ locale: "zh-CN" })), ie;
1164
+ let ue = null;
1165
+ function ro() {
1166
+ return ue || (ue = Ye({ locale: "zh-CN" })), ue;
1126
1167
  }
1127
- function fe() {
1128
- const e = Le(Ye, null);
1168
+ function ve() {
1169
+ const e = ce(Ke, null);
1129
1170
  if (e) return e;
1130
- const t = T(() => "zh-CN"), o = T(() => Jt());
1171
+ const t = z(() => "zh-CN"), o = z(() => ro());
1131
1172
  return { locale: t, t: o };
1132
1173
  }
1133
1174
  const Je = Symbol("vfp-resolved-theme");
1134
- function Kt(e) {
1135
- const t = T(() => C(e));
1136
- ue(Je, t);
1175
+ function io(e) {
1176
+ const t = z(() => v(e));
1177
+ ae(Je, t);
1178
+ }
1179
+ function Sn() {
1180
+ const e = ce(Je, null);
1181
+ return e || z(() => "dark");
1182
+ }
1183
+ const Qe = Symbol("file-preview:request");
1184
+ function so(e) {
1185
+ const t = z(() => {
1186
+ const o = typeof e == "function" ? e() : e;
1187
+ return {
1188
+ fetcher: Nt({
1189
+ requestInit: o.requestInit,
1190
+ requestHandler: o.requestHandler
1191
+ }),
1192
+ shouldFetchAsBlob: o.shouldFetchAsBlob
1193
+ };
1194
+ });
1195
+ return ae(Qe, t), t;
1196
+ }
1197
+ function uo() {
1198
+ return { fetcher: (e, t) => fetch(e, t) };
1199
+ }
1200
+ function et() {
1201
+ const e = ce(Qe, void 0);
1202
+ return e || z(() => uo());
1203
+ }
1204
+ function co() {
1205
+ const e = et();
1206
+ return z(() => e.value.fetcher);
1137
1207
  }
1138
- function yn() {
1139
- const e = Le(Je, null);
1140
- return e || T(() => "dark");
1208
+ function fo(e) {
1209
+ const t = et(), o = _("");
1210
+ let a = null;
1211
+ const l = () => {
1212
+ a && (URL.revokeObjectURL(a), a = null);
1213
+ };
1214
+ return q(
1215
+ () => {
1216
+ var s, i;
1217
+ const n = e.value, r = !!(n && ((i = (s = t.value).shouldFetchAsBlob) != null && i.call(s, n)));
1218
+ return { f: n, need: r, fetcher: t.value.fetcher };
1219
+ },
1220
+ async ({ f: n, need: r, fetcher: s }, i, u) => {
1221
+ if (!n) {
1222
+ l(), o.value = "";
1223
+ return;
1224
+ }
1225
+ if (!r) {
1226
+ l(), o.value = n.url;
1227
+ return;
1228
+ }
1229
+ let d = !1;
1230
+ u(() => {
1231
+ d = !0;
1232
+ }), o.value = "";
1233
+ try {
1234
+ const m = await Dt(n.url, s);
1235
+ if (d) {
1236
+ URL.revokeObjectURL(m);
1237
+ return;
1238
+ }
1239
+ l(), a = m, o.value = m;
1240
+ } catch (m) {
1241
+ d || (console.error("[file-preview] resolve blob url failed:", m), o.value = n.url);
1242
+ }
1243
+ },
1244
+ { immediate: !0 }
1245
+ ), G(l), o;
1141
1246
  }
1142
- const Qt = (e, { attrs: t }) => O("svg", {
1247
+ const po = (e, { attrs: t }) => B("svg", {
1143
1248
  xmlns: "http://www.w3.org/2000/svg",
1144
1249
  viewBox: "0 0 24 24",
1145
1250
  fill: "none",
@@ -1149,7 +1254,7 @@ const Qt = (e, { attrs: t }) => O("svg", {
1149
1254
  "stroke-linejoin": "round",
1150
1255
  ...t
1151
1256
  }, [
1152
- O("text", {
1257
+ B("text", {
1153
1258
  x: "12",
1154
1259
  y: "17.5",
1155
1260
  "text-anchor": "middle",
@@ -1159,51 +1264,51 @@ const Qt = (e, { attrs: t }) => O("svg", {
1159
1264
  stroke: "none"
1160
1265
  }, "1:1")
1161
1266
  ]);
1162
- function eo(e) {
1267
+ function mo(e) {
1163
1268
  return [
1164
1269
  {
1165
1270
  items: [
1166
- { type: "button", icon: Ie, tooltip: e.t("toolbar.zoom_out"), action: e.onZoomOut, disabled: e.zoom <= 0.01 },
1271
+ { type: "button", icon: Oe, tooltip: e.t("toolbar.zoom_out"), action: e.onZoomOut, disabled: e.zoom <= 0.01 },
1167
1272
  { type: "text", content: `${Math.round(e.zoom * 100)}%`, minWidth: "3rem" },
1168
- { type: "button", icon: Oe, tooltip: e.t("toolbar.zoom_in"), action: e.onZoomIn, disabled: e.zoom >= 10 }
1273
+ { type: "button", icon: qe, tooltip: e.t("toolbar.zoom_in"), action: e.onZoomIn, disabled: e.zoom >= 10 }
1169
1274
  ]
1170
1275
  },
1171
1276
  {
1172
1277
  items: [
1173
- { type: "button", icon: vt, tooltip: e.t("toolbar.fit_to_window"), action: e.onFitToWidth },
1174
- { type: "button", icon: Qt, tooltip: e.t("toolbar.original_size"), action: e.onOriginalSize }
1278
+ { type: "button", icon: wt, tooltip: e.t("toolbar.fit_to_window"), action: e.onFitToWidth },
1279
+ { type: "button", icon: po, tooltip: e.t("toolbar.original_size"), action: e.onOriginalSize }
1175
1280
  ]
1176
1281
  },
1177
1282
  {
1178
1283
  items: [
1179
- { type: "button", icon: ht, tooltip: e.t("toolbar.rotate_left"), action: e.onRotateLeft },
1180
- { type: "button", icon: gt, tooltip: e.t("toolbar.rotate_right"), action: e.onRotateRight }
1284
+ { type: "button", icon: yt, tooltip: e.t("toolbar.rotate_left"), action: e.onRotateLeft },
1285
+ { type: "button", icon: xt, tooltip: e.t("toolbar.rotate_right"), action: e.onRotateRight }
1181
1286
  ]
1182
1287
  },
1183
1288
  {
1184
1289
  items: [
1185
- { type: "button", icon: Ze, tooltip: e.t("toolbar.reset"), action: e.onReset }
1290
+ { type: "button", icon: Be, tooltip: e.t("toolbar.reset"), action: e.onReset }
1186
1291
  ]
1187
1292
  }
1188
1293
  ];
1189
1294
  }
1190
- function to(e) {
1295
+ function vo(e) {
1191
1296
  return [
1192
1297
  {
1193
1298
  items: [
1194
- { type: "button", icon: Ie, tooltip: e.t("toolbar.zoom_out"), action: e.onZoomOut, disabled: e.zoom <= 0.01 },
1299
+ { type: "button", icon: Oe, tooltip: e.t("toolbar.zoom_out"), action: e.onZoomOut, disabled: e.zoom <= 0.01 },
1195
1300
  { type: "text", content: `${Math.round(e.zoom * 100)}%`, minWidth: "3rem" },
1196
- { type: "button", icon: Oe, tooltip: e.t("toolbar.zoom_in"), action: e.onZoomIn, disabled: e.zoom >= 10 }
1301
+ { type: "button", icon: qe, tooltip: e.t("toolbar.zoom_in"), action: e.onZoomIn, disabled: e.zoom >= 10 }
1197
1302
  ]
1198
1303
  },
1199
1304
  {
1200
1305
  items: [
1201
- { type: "button", icon: Ze, tooltip: e.t("toolbar.reset"), action: e.onReset }
1306
+ { type: "button", icon: Be, tooltip: e.t("toolbar.reset"), action: e.onReset }
1202
1307
  ]
1203
1308
  }
1204
1309
  ];
1205
1310
  }
1206
- function oo(e) {
1311
+ function ho(e) {
1207
1312
  return [
1208
1313
  {
1209
1314
  items: [
@@ -1215,7 +1320,7 @@ function oo(e) {
1215
1320
  },
1216
1321
  {
1217
1322
  items: [
1218
- { type: "button", icon: de, tooltip: e.t("toolbar.prev_page"), action: () => {
1323
+ { type: "button", icon: fe, tooltip: e.t("toolbar.prev_page"), action: () => {
1219
1324
  var t;
1220
1325
  return (t = e.epubRef) == null ? void 0 : t.prevPage();
1221
1326
  } },
@@ -1230,7 +1335,7 @@ function oo(e) {
1230
1335
  items: [
1231
1336
  {
1232
1337
  type: "button",
1233
- icon: e.fullWidth ? Be : Ve,
1338
+ icon: e.fullWidth ? Ue : He,
1234
1339
  tooltip: e.fullWidth ? e.t("toolbar.normal_width") : e.t("toolbar.full_width"),
1235
1340
  action: () => {
1236
1341
  var t;
@@ -1241,7 +1346,7 @@ function oo(e) {
1241
1346
  }
1242
1347
  ];
1243
1348
  }
1244
- function no(e) {
1349
+ function go(e) {
1245
1350
  return [
1246
1351
  {
1247
1352
  items: [
@@ -1253,7 +1358,7 @@ function no(e) {
1253
1358
  },
1254
1359
  {
1255
1360
  items: [
1256
- { type: "button", icon: de, tooltip: e.t("toolbar.prev_page"), action: () => {
1361
+ { type: "button", icon: fe, tooltip: e.t("toolbar.prev_page"), action: () => {
1257
1362
  var t;
1258
1363
  return (t = e.mobiRef) == null ? void 0 : t.prevPage();
1259
1364
  } },
@@ -1268,7 +1373,7 @@ function no(e) {
1268
1373
  items: [
1269
1374
  {
1270
1375
  type: "button",
1271
- icon: e.fullWidth ? Be : Ve,
1376
+ icon: e.fullWidth ? Ue : He,
1272
1377
  tooltip: e.fullWidth ? e.t("toolbar.normal_width") : e.t("toolbar.full_width"),
1273
1378
  action: () => {
1274
1379
  var t;
@@ -1279,26 +1384,26 @@ function no(e) {
1279
1384
  }
1280
1385
  ];
1281
1386
  }
1282
- function ao({ stats: e }) {
1387
+ function bo({ stats: e }) {
1283
1388
  return e ? [
1284
1389
  {
1285
1390
  items: [
1286
1391
  {
1287
1392
  type: "text",
1288
- content: `${e.files} files · ${e.dirs} dirs · ${Rt(e.size)}`,
1393
+ content: `${e.files} files · ${e.dirs} dirs · ${$t(e.size)}`,
1289
1394
  minWidth: "10rem"
1290
1395
  }
1291
1396
  ]
1292
1397
  }
1293
1398
  ] : [];
1294
1399
  }
1295
- function lo(e) {
1400
+ function wo(e) {
1296
1401
  const t = [
1297
1402
  {
1298
1403
  items: [
1299
1404
  {
1300
1405
  type: "button",
1301
- icon: O(bt, { class: "vfp-w-4 vfp-h-4" }),
1406
+ icon: B(Ft, { class: "vfp-w-4 vfp-h-4" }),
1302
1407
  tooltip: e.wordWrap ? e.t("toolbar.wrap_off") : e.t("toolbar.wrap_on"),
1303
1408
  action: e.onToggleWrap
1304
1409
  }
@@ -1309,20 +1414,20 @@ function lo(e) {
1309
1414
  items: [
1310
1415
  {
1311
1416
  type: "button",
1312
- icon: e.htmlPreview ? O(Ge, { class: "vfp-w-4 vfp-h-4" }) : O(He, { class: "vfp-w-4 vfp-h-4" }),
1417
+ icon: e.htmlPreview ? B(Ze, { class: "vfp-w-4 vfp-h-4" }) : B(Ve, { class: "vfp-w-4 vfp-h-4" }),
1313
1418
  tooltip: e.htmlPreview ? e.t("toolbar.source") : e.t("toolbar.preview"),
1314
1419
  action: e.onToggleHtmlPreview
1315
1420
  }
1316
1421
  ]
1317
1422
  }), t;
1318
1423
  }
1319
- function ro(e) {
1424
+ function yo(e) {
1320
1425
  return [
1321
1426
  {
1322
1427
  items: [
1323
1428
  {
1324
1429
  type: "button",
1325
- icon: e.viewMode === "preview" ? O(Ge, { class: "vfp-w-4 vfp-h-4" }) : O(He, { class: "vfp-w-4 vfp-h-4" }),
1430
+ icon: e.viewMode === "preview" ? B(Ze, { class: "vfp-w-4 vfp-h-4" }) : B(Ve, { class: "vfp-w-4 vfp-h-4" }),
1326
1431
  tooltip: e.viewMode === "preview" ? e.t("toolbar.source") : e.t("toolbar.preview"),
1327
1432
  action: e.onToggleViewMode
1328
1433
  }
@@ -1330,22 +1435,22 @@ function ro(e) {
1330
1435
  }
1331
1436
  ];
1332
1437
  }
1333
- const io = { class: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-text-fg-muted" }, so = { class: "rfp-flex rfp-flex-col rfp-items-center rfp-gap-3" }, uo = { class: "rfp-text-sm" }, po = /* @__PURE__ */ X({
1438
+ const xo = { class: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-text-fg-muted" }, Fo = { class: "rfp-flex rfp-flex-col rfp-items-center rfp-gap-3" }, ko = { class: "rfp-text-sm" }, Co = /* @__PURE__ */ X({
1334
1439
  __name: "RendererLoading",
1335
1440
  setup(e) {
1336
- const { t } = fe();
1337
- return (o, a) => (c(), g("div", io, [
1338
- E("div", so, [
1339
- a[0] || (a[0] = E("div", { class: "rfp-w-8 rfp-h-8 rfp-rounded-full rfp-border-2 rfp-border-fg-muted rfp-border-t-transparent rfp-animate-spin" }, null, -1)),
1340
- E("span", uo, D(C(t)("common.loading") || "Loading..."), 1)
1441
+ const { t } = ve();
1442
+ return (o, a) => (f(), b("div", xo, [
1443
+ P("div", Fo, [
1444
+ a[0] || (a[0] = P("div", { class: "rfp-w-8 rfp-h-8 rfp-rounded-full rfp-border-2 rfp-border-fg-muted rfp-border-t-transparent rfp-animate-spin" }, null, -1)),
1445
+ P("span", ko, I(v(t)("common.loading") || "Loading..."), 1)
1341
1446
  ])
1342
1447
  ]));
1343
1448
  }
1344
- }), $ = (e) => ut({
1449
+ }), j = (e) => pt({
1345
1450
  loader: e,
1346
- loadingComponent: { render: () => O(po) },
1451
+ loadingComponent: { render: () => B(Co) },
1347
1452
  delay: 0
1348
- }), co = $(() => import("./index-BM9FaQUl.mjs")), fo = $(() => import("./index-cZn4ih-x.mjs")), mo = $(() => import("./index-DAo-7spn.mjs")), vo = $(() => import("./index-BoL1b2w-.mjs")), ho = $(() => import("./index-BYzQg-jL.mjs")), go = $(() => import("./index-dzB4jd9b.mjs")), bo = $(() => import("./index-D9wf6m37.mjs")), wo = $(() => import("./index-Bri7VeRx.mjs")), xo = $(() => import("./index-DXlcF1Dk.mjs")), yo = $(() => import("./index-lHlugUBI.mjs")), ko = $(() => import("./index-CTsscgqY.mjs")), Fo = $(() => import("./index-C7uOM7XL.mjs")), Co = $(() => import("./index-DAEQe-RI.mjs")), _o = $(() => import("./index-BCkcZs4y.mjs")), zo = $(() => import("./index-Ch7AEfnk.mjs")), Mo = $(() => import("./index-ELyTQZeF.mjs")), Ro = $(() => import("./index-5Smm2vx0.mjs")), To = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-p-8 vfp-gap-6" }, Eo = { class: "vfp-w-32 vfp-h-32 vfp-rounded-full vfp-bg-surface-2 vfp-flex vfp-items-center vfp-justify-center" }, Po = { class: "vfp-text-fg-primary vfp-text-center" }, $o = { class: "vfp-text-xl vfp-font-medium vfp-mb-2" }, So = { class: "vfp-text-fg-secondary" }, We = /* @__PURE__ */ X({
1453
+ }), _o = j(() => import("./index-H-QlBdbJ.mjs")), Ro = j(() => import("./index-oQRFKvtz.mjs")), zo = j(() => import("./index-DFEd3JaR.mjs")), Mo = j(() => import("./index-BP_8GjEV.mjs")), To = j(() => import("./index-1khRVlUa.mjs")), Eo = j(() => import("./index-DEyjEp-i.mjs")), Po = j(() => import("./index-CYvPRxHK.mjs")), $o = j(() => import("./index-_llF_WTY.mjs")), jo = j(() => import("./index-B9Xz5bUB.mjs")), So = j(() => import("./index-Cfm88ItA.mjs")), Lo = j(() => import("./index-BVdw1Cc8.mjs")), No = j(() => import("./index-CxKVonec.mjs")), Do = j(() => import("./index-D6RuC1es.mjs")), Wo = j(() => import("./index-BqSPk90T.mjs")), Io = j(() => import("./index-BrCSk7CK.mjs")), Oo = j(() => import("./index-DjvWRo53.mjs")), qo = j(() => import("./index-Bu8GH1aq.mjs")), Bo = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-p-8 vfp-gap-6" }, Ao = { class: "vfp-w-32 vfp-h-32 vfp-rounded-full vfp-bg-surface-2 vfp-flex vfp-items-center vfp-justify-center" }, Uo = { class: "vfp-text-fg-primary vfp-text-center" }, Ho = { class: "vfp-text-xl vfp-font-medium vfp-mb-2" }, Zo = { class: "vfp-text-fg-secondary" }, We = /* @__PURE__ */ X({
1349
1454
  __name: "index",
1350
1455
  props: {
1351
1456
  fileName: {},
@@ -1353,35 +1458,35 @@ const io = { class: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp
1353
1458
  },
1354
1459
  emits: ["download"],
1355
1460
  setup(e, { emit: t }) {
1356
- const { t: o } = fe(), a = t;
1357
- return (l, n) => (c(), g("div", To, [
1358
- E("div", Eo, [
1359
- G(C(wt), { class: "vfp-w-16 vfp-h-16 vfp-text-fg-secondary" })
1461
+ const { t: o } = ve(), a = t;
1462
+ return (l, n) => (f(), b("div", Bo, [
1463
+ P("div", Ao, [
1464
+ H(v(kt), { class: "vfp-w-16 vfp-h-16 vfp-text-fg-secondary" })
1360
1465
  ]),
1361
- E("div", Po, [
1362
- E("p", $o, D(e.fileName), 1),
1363
- E("p", So, D(C(o)("common.unsupported_preview", { type: e.fileType })), 1)
1466
+ P("div", Uo, [
1467
+ P("p", Ho, I(e.fileName), 1),
1468
+ P("p", Zo, I(v(o)("common.unsupported_preview", { type: e.fileType })), 1)
1364
1469
  ]),
1365
- E("button", {
1470
+ P("button", {
1366
1471
  class: "vfp-flex vfp-items-center vfp-gap-2 vfp-px-6 vfp-py-3 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",
1367
- onClick: n[0] || (n[0] = (i) => a("download"))
1472
+ onClick: n[0] || (n[0] = (r) => a("download"))
1368
1473
  }, [
1369
- G(C(Ue), { class: "vfp-w-5 vfp-h-5" }),
1370
- dt(" " + D(C(o)("common.download")), 1)
1474
+ H(v(Ge), { class: "vfp-w-5 vfp-h-5" }),
1475
+ mt(" " + I(v(o)("common.download")), 1)
1371
1476
  ])
1372
1477
  ]));
1373
1478
  }
1374
- }), No = ["tabindex", "data-theme"], jo = {
1479
+ }), Vo = ["tabindex", "data-theme"], Go = {
1375
1480
  key: 0,
1376
1481
  class: "vfp-flex-shrink-0 vfp-z-10 vfp-backdrop-blur-md vfp-border-b vfp-bg-surface-toolbar vfp-border-line",
1377
1482
  style: { "padding-top": "env(safe-area-inset-top, 0px)" }
1378
- }, Wo = { 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" }, Lo = { class: "vfp-flex vfp-items-center vfp-flex-1 vfp-min-w-0 vfp-mr-2 md:vfp-mr-3" }, Do = { class: "vfp-font-medium vfp-text-xs md:vfp-text-sm vfp-truncate vfp-text-fg-primary" }, Io = { class: "vfp-text-xs vfp-ml-2 vfp-flex-shrink-0 vfp-text-fg-muted" }, Oo = { class: "vfp-flex vfp-items-center vfp-gap-1 md:vfp-hidden vfp-flex-shrink-0" }, Zo = ["data-tooltip", "disabled", "onClick"], Ao = { class: "vfp-hidden md:vfp-flex vfp-items-center vfp-gap-1 vfp-flex-shrink-0" }, Bo = ["data-tooltip", "disabled", "onClick"], Vo = ["data-tooltip", "disabled", "onClick"], Go = {
1483
+ }, Xo = { 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" }, Yo = { class: "vfp-flex vfp-items-center vfp-flex-1 vfp-min-w-0 vfp-mr-2 md:vfp-mr-3" }, Ko = { class: "vfp-font-medium vfp-text-xs md:vfp-text-sm vfp-truncate vfp-text-fg-primary" }, Jo = { class: "vfp-text-xs vfp-ml-2 vfp-flex-shrink-0 vfp-text-fg-muted" }, Qo = { class: "vfp-flex vfp-items-center vfp-gap-1 md:vfp-hidden vfp-flex-shrink-0" }, en = ["data-tooltip", "disabled", "onClick"], tn = { class: "vfp-hidden md:vfp-flex vfp-items-center vfp-gap-1 vfp-flex-shrink-0" }, on = ["data-tooltip", "disabled", "onClick"], nn = ["data-tooltip", "disabled", "onClick"], an = {
1379
1484
  key: 0,
1380
1485
  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"
1381
- }, Ho = {
1486
+ }, ln = {
1382
1487
  key: 0,
1383
1488
  class: "vfp-w-px vfp-h-4 vfp-mx-0.5 vfp-bg-divide"
1384
- }, Uo = ["data-tooltip", "disabled", "onClick"], Xo = 3, qo = 2e3, Yo = /* @__PURE__ */ X({
1489
+ }, rn = ["data-tooltip", "disabled", "onClick"], sn = 3, un = 2e3, dn = /* @__PURE__ */ X({
1385
1490
  __name: "FilePreviewContent",
1386
1491
  props: {
1387
1492
  files: {},
@@ -1392,400 +1497,418 @@ const io = { class: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp
1392
1497
  locale: { default: void 0 },
1393
1498
  messages: { default: void 0 },
1394
1499
  headless: { type: Boolean, default: !1 },
1395
- theme: { default: "dark" }
1500
+ theme: { default: "dark" },
1501
+ requestInit: { type: Function, default: void 0 },
1502
+ requestHandler: { type: Function, default: void 0 },
1503
+ shouldFetchAsBlob: { type: Function, default: void 0 },
1504
+ onDownload: { type: Function, default: void 0 }
1396
1505
  },
1397
1506
  emits: ["navigate", "close", "custom-event"],
1398
1507
  setup(e, { emit: t }) {
1399
- const o = e, a = t;
1400
- Yt(Te(o, "locale"), Te(o, "messages"));
1401
- const { t: l } = fe(), n = z(
1508
+ const o = e;
1509
+ so(() => ({
1510
+ requestInit: o.requestInit,
1511
+ requestHandler: o.requestHandler,
1512
+ shouldFetchAsBlob: o.shouldFetchAsBlob
1513
+ }));
1514
+ const a = t;
1515
+ lo(Pe(o, "locale"), Pe(o, "messages"));
1516
+ const { t: l } = ve(), n = _(
1402
1517
  typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
1403
1518
  );
1404
- let i = null;
1405
- V(
1519
+ let r = null;
1520
+ q(
1406
1521
  () => o.theme,
1407
- (b) => {
1408
- if (i && (i(), i = null), b === "auto") {
1409
- const h = window.matchMedia("(prefers-color-scheme: dark)"), j = (w) => {
1522
+ (y) => {
1523
+ if (r && (r(), r = null), y === "auto") {
1524
+ const h = window.matchMedia("(prefers-color-scheme: dark)"), N = (w) => {
1410
1525
  n.value = w.matches;
1411
1526
  };
1412
- h.addEventListener("change", j), i = () => h.removeEventListener("change", j);
1527
+ h.addEventListener("change", N), r = () => h.removeEventListener("change", N);
1413
1528
  }
1414
1529
  },
1415
1530
  { immediate: !0 }
1416
- ), oe(() => {
1417
- i && i();
1531
+ ), G(() => {
1532
+ r && r();
1418
1533
  });
1419
- const s = T(
1534
+ const s = z(
1420
1535
  () => o.theme === "auto" ? n.value ? "dark" : "light" : o.theme
1421
1536
  );
1422
- Kt(s);
1423
- const r = z(1), u = z(0), d = z(1), v = z(1), m = z(0), p = z(0), y = z(0), M = z(null), N = z(null), k = z(!0);
1424
- let P = null;
1425
- const Z = () => {
1426
- k.value = !0, P !== null && clearTimeout(P), P = window.setTimeout(() => {
1537
+ io(s);
1538
+ const i = _(1), u = _(0), d = _(1), m = _(1), p = _(0), c = _(0), F = _(0), M = _(null), L = _(null), k = _(!0);
1539
+ let $ = null;
1540
+ const A = () => {
1541
+ k.value = !0, $ !== null && clearTimeout($), $ = window.setTimeout(() => {
1427
1542
  k.value = !1;
1428
- }, qo);
1429
- }, H = () => Z(), W = T(() => zt(o.files)), f = T(() => W.value[o.currentIndex]), A = T(() => f.value && o.customRenderers.find((b) => b.test(f.value)) || null), ve = T(() => !A.value || !f.value ? null : A.value.render(f.value, q.value)), F = T(() => f.value ? Mt(f.value) : "unsupported"), Ke = (b, h) => {
1430
- if (!f.value) return;
1431
- const j = { name: b, payload: h, file: f.value };
1432
- a("custom-event", j);
1433
- }, q = T(() => ({
1434
- emit: Ke,
1543
+ }, un);
1544
+ }, Z = () => A(), D = z(() => Et(o.files)), g = z(() => D.value[o.currentIndex]), T = fo(g), Y = z(() => g.value && o.customRenderers.find((y) => y.test(g.value)) || null), ge = z(() => !Y.value || !g.value ? null : Y.value.render(g.value, K.value)), C = z(() => g.value ? Pt(g.value) : "unsupported"), tt = (y, h) => {
1545
+ if (!g.value) return;
1546
+ const N = { name: y, payload: h, file: g.value };
1547
+ a("custom-event", N);
1548
+ }, K = z(() => ({
1549
+ emit: tt,
1435
1550
  t: l.value,
1436
1551
  theme: s.value,
1437
1552
  locale: o.locale ?? "zh-CN"
1438
1553
  }));
1439
- ue("file-preview:custom-ctx", q), V(
1554
+ ae("file-preview:custom-ctx", K), q(
1440
1555
  () => o.currentIndex,
1441
1556
  () => {
1442
- r.value = 1, u.value = 0, d.value = 1, v.value = 1, m.value = 0, p.value = 0, k.value = !0, P !== null && clearTimeout(P);
1557
+ i.value = 1, u.value = 0, d.value = 1, m.value = 1, p.value = 0, c.value = 0, k.value = !0, $ !== null && clearTimeout($);
1443
1558
  }
1444
- ), V(
1445
- [F, m, p],
1559
+ ), q(
1560
+ [C, p, c],
1446
1561
  () => {
1447
- if (F.value === "image" && m.value > 0 && p.value > 0 && M.value) {
1448
- const b = M.value.clientWidth, h = M.value.clientHeight, j = b / m.value, w = h / p.value, S = Math.min(j, w);
1449
- r.value = Math.max(0.01, Math.min(10, S));
1562
+ if (C.value === "image" && p.value > 0 && c.value > 0 && M.value) {
1563
+ const y = M.value.clientWidth, h = M.value.clientHeight, N = y / p.value, w = h / c.value, S = Math.min(N, w);
1564
+ i.value = Math.max(0.01, Math.min(10, S));
1450
1565
  }
1451
1566
  }
1452
- ), V(
1453
- () => W.value.length,
1454
- (b) => {
1455
- b > 1 && Z();
1567
+ ), q(
1568
+ () => D.value.length,
1569
+ (y) => {
1570
+ y > 1 && A();
1456
1571
  },
1457
1572
  { immediate: !0 }
1458
1573
  );
1459
- const Y = (b) => {
1460
- b.key === "Escape" && o.mode === "modal" ? a("close") : b.key === "ArrowLeft" && o.currentIndex > 0 ? a("navigate", o.currentIndex - 1) : b.key === "ArrowRight" && o.currentIndex < W.value.length - 1 && a("navigate", o.currentIndex + 1);
1574
+ const J = (y) => {
1575
+ y.key === "Escape" && o.mode === "modal" ? a("close") : y.key === "ArrowLeft" && o.currentIndex > 0 ? a("navigate", o.currentIndex - 1) : y.key === "ArrowRight" && o.currentIndex < D.value.length - 1 && a("navigate", o.currentIndex + 1);
1461
1576
  };
1462
- De(() => {
1463
- o.mode === "modal" ? window.addEventListener("keydown", Y) : N.value && N.value.addEventListener("keydown", Y);
1464
- }), oe(() => {
1465
- P !== null && clearTimeout(P), o.mode === "modal" ? window.removeEventListener("keydown", Y) : N.value && N.value.removeEventListener("keydown", Y);
1577
+ Ie(() => {
1578
+ o.mode === "modal" ? window.addEventListener("keydown", J) : L.value && L.value.addEventListener("keydown", J);
1579
+ }), G(() => {
1580
+ $ !== null && clearTimeout($), o.mode === "modal" ? window.removeEventListener("keydown", J) : L.value && L.value.removeEventListener("keydown", J);
1466
1581
  });
1467
- const he = () => {
1468
- r.value = Math.min(r.value + 0.1, 10);
1469
- }, ge = () => {
1470
- r.value = Math.max(r.value - 0.1, 0.01);
1471
- }, Qe = () => {
1582
+ const be = () => {
1583
+ i.value = Math.min(i.value + 0.1, 10);
1584
+ }, we = () => {
1585
+ i.value = Math.max(i.value - 0.1, 0.01);
1586
+ }, ot = () => {
1472
1587
  u.value = u.value + 90;
1473
- }, et = () => {
1588
+ }, nt = () => {
1474
1589
  u.value = u.value - 90;
1475
- }, tt = () => {
1476
- if (M.value && m.value > 0 && p.value > 0) {
1477
- const b = M.value.clientWidth, h = M.value.clientHeight, j = b / m.value, w = h / p.value, S = Math.min(j, w);
1478
- r.value = Math.max(0.01, Math.min(10, S));
1590
+ }, at = () => {
1591
+ if (M.value && p.value > 0 && c.value > 0) {
1592
+ const y = M.value.clientWidth, h = M.value.clientHeight, N = y / p.value, w = h / c.value, S = Math.min(N, w);
1593
+ i.value = Math.max(0.01, Math.min(10, S));
1479
1594
  } else
1480
- r.value = 1;
1481
- u.value = 0, y.value++;
1482
- }, ot = () => {
1483
- r.value = 1, u.value = 0, y.value++;
1484
- }, nt = (b) => {
1485
- r.value = b;
1486
- }, be = () => {
1487
- r.value = 1, u.value = 0, y.value++;
1488
- }, ne = () => {
1489
- if (!f.value) return;
1490
- const b = document.createElement("a");
1491
- b.href = f.value.url, b.download = f.value.name, b.click();
1492
- }, at = T(() => o.mode === "modal"), we = z(null), xe = z(0), ye = z(0), ke = z(!1), Fe = z(null), Ce = z(0), _e = z(0), ze = z(!1), lt = (b, h) => {
1493
- xe.value = b, ye.value = h;
1494
- }, rt = (b, h) => {
1495
- Ce.value = b, _e.value = h;
1496
- }, Me = z(null), it = (b) => {
1497
- Me.value = b;
1498
- }, J = z(!0), K = z(!1), Q = z("preview"), ae = T(() => {
1499
- var b, h, j;
1500
- if (A.value)
1501
- return ((h = (b = A.value).getToolbarGroups) == null ? void 0 : h.call(b, f.value, q.value)) ?? [];
1502
- if (F.value === "image")
1503
- return eo({
1504
- zoom: r.value,
1505
- onZoomIn: he,
1506
- onZoomOut: ge,
1507
- onFitToWidth: tt,
1508
- onOriginalSize: ot,
1509
- onRotateLeft: et,
1510
- onRotateRight: Qe,
1511
- onReset: be,
1595
+ i.value = 1;
1596
+ u.value = 0, F.value++;
1597
+ }, lt = () => {
1598
+ i.value = 1, u.value = 0, F.value++;
1599
+ }, rt = (y) => {
1600
+ i.value = y;
1601
+ }, ye = () => {
1602
+ i.value = 1, u.value = 0, F.value++;
1603
+ }, it = co(), le = async () => {
1604
+ if (g.value) {
1605
+ if (o.onDownload) {
1606
+ await o.onDownload(g.value);
1607
+ return;
1608
+ }
1609
+ try {
1610
+ await Wt(g.value.url, g.value.name, it.value);
1611
+ } catch (y) {
1612
+ console.error("[file-preview] download failed:", y);
1613
+ }
1614
+ }
1615
+ }, st = z(() => o.mode === "modal"), xe = _(null), Fe = _(0), ke = _(0), Ce = _(!1), _e = _(null), Re = _(0), ze = _(0), Me = _(!1), ut = (y, h) => {
1616
+ Fe.value = y, ke.value = h;
1617
+ }, dt = (y, h) => {
1618
+ Re.value = y, ze.value = h;
1619
+ }, Te = _(null), ct = (y) => {
1620
+ Te.value = y;
1621
+ }, Q = _(!0), ee = _(!1), te = _("preview"), re = z(() => {
1622
+ var y, h, N;
1623
+ if (Y.value)
1624
+ return ((h = (y = Y.value).getToolbarGroups) == null ? void 0 : h.call(y, g.value, K.value)) ?? [];
1625
+ if (C.value === "image")
1626
+ return mo({
1627
+ zoom: i.value,
1628
+ onZoomIn: be,
1629
+ onZoomOut: we,
1630
+ onFitToWidth: at,
1631
+ onOriginalSize: lt,
1632
+ onRotateLeft: nt,
1633
+ onRotateRight: ot,
1634
+ onReset: ye,
1512
1635
  t: l.value
1513
1636
  });
1514
- if (F.value === "pdf")
1515
- return to({
1516
- zoom: r.value,
1517
- onZoomIn: he,
1518
- onZoomOut: ge,
1519
- onReset: be,
1637
+ if (C.value === "pdf")
1638
+ return vo({
1639
+ zoom: i.value,
1640
+ onZoomIn: be,
1641
+ onZoomOut: we,
1642
+ onReset: ye,
1520
1643
  t: l.value
1521
1644
  });
1522
- if (F.value === "epub")
1523
- return oo({
1524
- epubRef: we.value,
1525
- current: xe.value,
1526
- total: ye.value,
1527
- fullWidth: ke.value,
1645
+ if (C.value === "epub")
1646
+ return ho({
1647
+ epubRef: xe.value,
1648
+ current: Fe.value,
1649
+ total: ke.value,
1650
+ fullWidth: Ce.value,
1528
1651
  t: l.value
1529
1652
  });
1530
- if (F.value === "mobi")
1531
- return no({
1532
- mobiRef: Fe.value,
1533
- current: Ce.value,
1534
- total: _e.value,
1535
- fullWidth: ze.value,
1653
+ if (C.value === "mobi")
1654
+ return go({
1655
+ mobiRef: _e.value,
1656
+ current: Re.value,
1657
+ total: ze.value,
1658
+ fullWidth: Me.value,
1536
1659
  t: l.value
1537
1660
  });
1538
- if (F.value === "zip")
1539
- return ao({ stats: Me.value, t: l.value });
1540
- if (F.value === "text") {
1541
- const w = ((j = f.value.name.split(".").pop()) == null ? void 0 : j.toLowerCase()) || "";
1542
- return lo({
1543
- wordWrap: J.value,
1661
+ if (C.value === "zip")
1662
+ return bo({ stats: Te.value, t: l.value });
1663
+ if (C.value === "text") {
1664
+ const w = ((N = g.value.name.split(".").pop()) == null ? void 0 : N.toLowerCase()) || "";
1665
+ return wo({
1666
+ wordWrap: Q.value,
1544
1667
  onToggleWrap: () => {
1545
- J.value = !J.value;
1668
+ Q.value = !Q.value;
1546
1669
  },
1547
1670
  isHtml: w === "html" || w === "htm",
1548
- htmlPreview: K.value,
1671
+ htmlPreview: ee.value,
1549
1672
  onToggleHtmlPreview: () => {
1550
- K.value = !K.value;
1673
+ ee.value = !ee.value;
1551
1674
  },
1552
1675
  t: l.value
1553
1676
  });
1554
1677
  }
1555
- return F.value === "markdown" ? ro({
1556
- viewMode: Q.value,
1678
+ return C.value === "markdown" ? yo({
1679
+ viewMode: te.value,
1557
1680
  onToggleViewMode: () => {
1558
- Q.value = Q.value === "preview" ? "source" : "preview";
1681
+ te.value = te.value === "preview" ? "source" : "preview";
1559
1682
  },
1560
1683
  t: l.value
1561
1684
  }) : [];
1562
- }), Re = T(() => {
1563
- const b = [
1685
+ }), Ee = z(() => {
1686
+ const y = [
1564
1687
  {
1565
1688
  items: [
1566
- { type: "button", icon: Ue, tooltip: l.value("common.download"), action: ne }
1689
+ { type: "button", icon: Ge, tooltip: l.value("common.download"), action: le }
1567
1690
  ]
1568
1691
  }
1569
1692
  ];
1570
- return at.value && b.push({
1693
+ return st.value && y.push({
1571
1694
  items: [
1572
- { type: "button", icon: xt, tooltip: l.value("common.close"), action: () => a("close") }
1695
+ { type: "button", icon: Ct, tooltip: l.value("common.close"), action: () => a("close") }
1573
1696
  ]
1574
- }), b;
1575
- }), st = T(() => ae.value.length > 0);
1576
- return (b, h) => {
1577
- var j;
1578
- return c(), g("div", {
1697
+ }), y;
1698
+ }), ft = z(() => re.value.length > 0);
1699
+ return (y, h) => {
1700
+ var N;
1701
+ return f(), b("div", {
1579
1702
  ref_key: "rootRef",
1580
- ref: N,
1703
+ ref: L,
1581
1704
  tabindex: e.mode === "embed" ? 0 : -1,
1582
1705
  "data-theme": s.value,
1583
1706
  class: "vfp-relative vfp-w-full vfp-h-full vfp-flex vfp-flex-col vfp-overflow-hidden vfp-outline-none"
1584
1707
  }, [
1585
- e.headless ? L("", !0) : (c(), g("div", jo, [
1586
- E("div", Wo, [
1587
- E("div", Lo, [
1588
- E("h2", Do, D((j = f.value) == null ? void 0 : j.name), 1),
1589
- E("span", Io, D(e.currentIndex + 1) + "/" + D(W.value.length), 1)
1708
+ e.headless ? W("", !0) : (f(), b("div", Go, [
1709
+ P("div", Xo, [
1710
+ P("div", Yo, [
1711
+ P("h2", Ko, I((N = g.value) == null ? void 0 : N.name), 1),
1712
+ P("span", Jo, I(e.currentIndex + 1) + "/" + I(D.value.length), 1)
1590
1713
  ]),
1591
- E("div", Oo, [
1592
- (c(!0), g(R, null, I(Re.value, (w, S) => (c(), g(R, {
1714
+ P("div", Qo, [
1715
+ (f(!0), b(E, null, O(Ee.value, (w, S) => (f(), b(E, {
1593
1716
  key: "m-action-" + S
1594
1717
  }, [
1595
- (c(!0), g(R, null, I(w.items, (x, B) => (c(), g(R, {
1596
- key: "m-action-" + S + "-" + B
1718
+ (f(!0), b(E, null, O(w.items, (x, U) => (f(), b(E, {
1719
+ key: "m-action-" + S + "-" + U
1597
1720
  }, [
1598
- x.type === "button" ? (c(), g("button", {
1721
+ x.type === "button" ? (f(), b("button", {
1599
1722
  key: 0,
1600
1723
  class: "toolbar-btn",
1601
1724
  "data-tooltip": x.tooltip,
1602
1725
  disabled: x.disabled,
1603
1726
  onClick: x.action
1604
1727
  }, [
1605
- (c(), _(U(x.icon), { class: "vfp-w-4 vfp-h-4" }))
1606
- ], 8, Zo)) : L("", !0)
1728
+ (f(), R(V(x.icon), { class: "vfp-w-4 vfp-h-4" }))
1729
+ ], 8, en)) : W("", !0)
1607
1730
  ], 64))), 128))
1608
1731
  ], 64))), 128))
1609
1732
  ]),
1610
- E("div", Ao, [
1611
- (c(!0), g(R, null, I(ae.value, (w, S) => (c(), g(R, {
1733
+ P("div", tn, [
1734
+ (f(!0), b(E, null, O(re.value, (w, S) => (f(), b(E, {
1612
1735
  key: "d-tool-" + S
1613
1736
  }, [
1614
- (c(!0), g(R, null, I(w.items, (x, B) => (c(), g(R, {
1615
- key: "d-tool-" + S + "-" + B
1737
+ (f(!0), b(E, null, O(w.items, (x, U) => (f(), b(E, {
1738
+ key: "d-tool-" + S + "-" + U
1616
1739
  }, [
1617
- x.type === "button" ? (c(), g("button", {
1740
+ x.type === "button" ? (f(), b("button", {
1618
1741
  key: 0,
1619
1742
  class: "toolbar-btn",
1620
1743
  "data-tooltip": x.tooltip,
1621
1744
  disabled: x.disabled,
1622
1745
  onClick: x.action
1623
1746
  }, [
1624
- (c(), _(U(x.icon), { class: "vfp-w-4 vfp-h-4" }))
1625
- ], 8, Bo)) : x.type === "text" ? (c(), g("span", {
1747
+ (f(), R(V(x.icon), { class: "vfp-w-4 vfp-h-4" }))
1748
+ ], 8, on)) : x.type === "text" ? (f(), b("span", {
1626
1749
  key: 1,
1627
1750
  class: "vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums vfp-text-fg-tertiary",
1628
- style: ee({ minWidth: x.minWidth || "auto" })
1629
- }, D(x.content), 5)) : L("", !0)
1751
+ style: oe({ minWidth: x.minWidth || "auto" })
1752
+ }, I(x.content), 5)) : W("", !0)
1630
1753
  ], 64))), 128)),
1631
- h[11] || (h[11] = E("div", { class: "vfp-w-px vfp-h-4 vfp-mx-1 vfp-bg-divide" }, null, -1))
1754
+ h[11] || (h[11] = P("div", { class: "vfp-w-px vfp-h-4 vfp-mx-1 vfp-bg-divide" }, null, -1))
1632
1755
  ], 64))), 128)),
1633
- (c(!0), g(R, null, I(Re.value, (w, S) => (c(), g(R, {
1756
+ (f(!0), b(E, null, O(Ee.value, (w, S) => (f(), b(E, {
1634
1757
  key: "d-action-" + S
1635
1758
  }, [
1636
- (c(!0), g(R, null, I(w.items, (x, B) => (c(), g(R, {
1637
- key: "d-action-" + S + "-" + B
1759
+ (f(!0), b(E, null, O(w.items, (x, U) => (f(), b(E, {
1760
+ key: "d-action-" + S + "-" + U
1638
1761
  }, [
1639
- x.type === "button" ? (c(), g("button", {
1762
+ x.type === "button" ? (f(), b("button", {
1640
1763
  key: 0,
1641
1764
  class: "toolbar-btn",
1642
1765
  "data-tooltip": x.tooltip,
1643
1766
  disabled: x.disabled,
1644
1767
  onClick: x.action
1645
1768
  }, [
1646
- (c(), _(U(x.icon), { class: "vfp-w-4 vfp-h-4" }))
1647
- ], 8, Vo)) : L("", !0)
1769
+ (f(), R(V(x.icon), { class: "vfp-w-4 vfp-h-4" }))
1770
+ ], 8, nn)) : W("", !0)
1648
1771
  ], 64))), 128))
1649
1772
  ], 64))), 128))
1650
1773
  ])
1651
1774
  ]),
1652
- st.value ? (c(), g("div", Go, [
1653
- (c(!0), g(R, null, I(ae.value, (w, S) => (c(), g(R, {
1775
+ ft.value ? (f(), b("div", an, [
1776
+ (f(!0), b(E, null, O(re.value, (w, S) => (f(), b(E, {
1654
1777
  key: "m-tool-" + S
1655
1778
  }, [
1656
- S > 0 ? (c(), g("div", Ho)) : L("", !0),
1657
- (c(!0), g(R, null, I(w.items, (x, B) => (c(), g(R, {
1658
- key: "m-tool-" + S + "-" + B
1779
+ S > 0 ? (f(), b("div", ln)) : W("", !0),
1780
+ (f(!0), b(E, null, O(w.items, (x, U) => (f(), b(E, {
1781
+ key: "m-tool-" + S + "-" + U
1659
1782
  }, [
1660
- x.type === "button" ? (c(), g("button", {
1783
+ x.type === "button" ? (f(), b("button", {
1661
1784
  key: 0,
1662
1785
  class: "toolbar-btn",
1663
1786
  "data-tooltip": x.tooltip,
1664
1787
  disabled: x.disabled,
1665
1788
  onClick: x.action
1666
1789
  }, [
1667
- (c(), _(U(x.icon), { class: "vfp-w-4 vfp-h-4" }))
1668
- ], 8, Uo)) : x.type === "text" ? (c(), g("span", {
1790
+ (f(), R(V(x.icon), { class: "vfp-w-4 vfp-h-4" }))
1791
+ ], 8, rn)) : x.type === "text" ? (f(), b("span", {
1669
1792
  key: 1,
1670
1793
  class: "vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums vfp-text-fg-tertiary",
1671
- style: ee({ minWidth: x.minWidth || "auto" })
1672
- }, D(x.content), 5)) : L("", !0)
1794
+ style: oe({ minWidth: x.minWidth || "auto" })
1795
+ }, I(x.content), 5)) : W("", !0)
1673
1796
  ], 64))), 128))
1674
1797
  ], 64))), 128))
1675
- ])) : L("", !0)
1798
+ ])) : W("", !0)
1676
1799
  ])),
1677
- E("div", {
1800
+ P("div", {
1678
1801
  ref_key: "contentRef",
1679
1802
  ref: M,
1680
1803
  class: "vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-overflow-auto",
1681
- onMousemove: H
1804
+ onMousemove: Z
1682
1805
  }, [
1683
- f.value ? (c(), g(R, { key: 0 }, [
1684
- ve.value ? (c(), _(U(ve.value), {
1806
+ g.value ? (f(), b(E, { key: 0 }, [
1807
+ ge.value ? (f(), R(V(ge.value), {
1685
1808
  key: 0,
1686
- file: f.value,
1687
- ctx: q.value
1688
- }, null, 8, ["file", "ctx"])) : (c(), g(R, { key: 1 }, [
1689
- F.value === "image" ? (c(), _(C(co), {
1809
+ file: g.value,
1810
+ ctx: K.value
1811
+ }, null, 8, ["file", "ctx"])) : (f(), b(E, { key: 1 }, [
1812
+ C.value === "image" ? (f(), R(v(_o), {
1690
1813
  key: 0,
1691
- url: f.value.url,
1692
- zoom: r.value,
1814
+ url: v(T),
1815
+ zoom: i.value,
1693
1816
  rotation: u.value,
1694
- "reset-key": y.value,
1695
- "file-size": f.value.size,
1696
- onZoomChange: nt,
1697
- onNaturalWidthChange: h[0] || (h[0] = (w) => m.value = w),
1698
- onNaturalHeightChange: h[1] || (h[1] = (w) => p.value = w)
1699
- }, null, 8, ["url", "zoom", "rotation", "reset-key", "file-size"])) : F.value === "pdf" ? (c(), _(C(fo), {
1817
+ "reset-key": F.value,
1818
+ "file-size": g.value.size,
1819
+ onZoomChange: rt,
1820
+ onNaturalWidthChange: h[0] || (h[0] = (w) => p.value = w),
1821
+ onNaturalHeightChange: h[1] || (h[1] = (w) => c.value = w)
1822
+ }, null, 8, ["url", "zoom", "rotation", "reset-key", "file-size"])) : C.value === "pdf" ? (f(), R(v(Ro), {
1700
1823
  key: 1,
1701
- url: f.value.url,
1702
- zoom: r.value,
1824
+ url: v(T),
1825
+ zoom: i.value,
1703
1826
  "current-page": d.value,
1704
1827
  onPageChange: h[2] || (h[2] = (w) => d.value = w),
1705
- onTotalPagesChange: h[3] || (h[3] = (w) => v.value = w),
1706
- onPageWidthChange: h[4] || (h[4] = (w) => m.value = w)
1707
- }, null, 8, ["url", "zoom", "current-page"])) : F.value === "docx" ? (c(), _(C(mo), {
1828
+ onTotalPagesChange: h[3] || (h[3] = (w) => m.value = w),
1829
+ onPageWidthChange: h[4] || (h[4] = (w) => p.value = w)
1830
+ }, null, 8, ["url", "zoom", "current-page"])) : C.value === "docx" ? (f(), R(v(zo), {
1708
1831
  key: 2,
1709
- url: f.value.url
1710
- }, null, 8, ["url"])) : F.value === "xlsx" ? (c(), _(C(vo), {
1832
+ url: v(T)
1833
+ }, null, 8, ["url"])) : C.value === "xlsx" ? (f(), R(v(Mo), {
1711
1834
  key: 3,
1712
- url: f.value.url
1713
- }, null, 8, ["url"])) : F.value === "pptx" ? (c(), _(C(ho), {
1835
+ url: v(T)
1836
+ }, null, 8, ["url"])) : C.value === "pptx" ? (f(), R(v(To), {
1714
1837
  key: 4,
1715
- url: f.value.url
1716
- }, null, 8, ["url"])) : F.value === "msg" ? (c(), _(C(go), {
1838
+ url: v(T)
1839
+ }, null, 8, ["url"])) : C.value === "msg" ? (f(), R(v(Eo), {
1717
1840
  key: 5,
1718
- url: f.value.url
1719
- }, null, 8, ["url"])) : F.value === "epub" ? (c(), _(C(bo), {
1841
+ url: v(T)
1842
+ }, null, 8, ["url"])) : C.value === "epub" ? (f(), R(v(Po), {
1720
1843
  key: 6,
1721
1844
  ref_key: "epubRef",
1722
- ref: we,
1723
- url: f.value.url,
1724
- onChapterChange: lt,
1725
- onFullWidthChange: h[5] || (h[5] = (w) => ke.value = w)
1726
- }, null, 8, ["url"])) : F.value === "mobi" ? (c(), _(C(wo), {
1845
+ ref: xe,
1846
+ url: v(T),
1847
+ onChapterChange: ut,
1848
+ onFullWidthChange: h[5] || (h[5] = (w) => Ce.value = w)
1849
+ }, null, 8, ["url"])) : C.value === "mobi" ? (f(), R(v($o), {
1727
1850
  key: 7,
1728
1851
  ref_key: "mobiRef",
1729
- ref: Fe,
1730
- url: f.value.url,
1731
- onChapterChange: rt,
1732
- onFullWidthChange: h[6] || (h[6] = (w) => ze.value = w)
1733
- }, null, 8, ["url"])) : F.value === "video" ? (c(), _(C(xo), {
1852
+ ref: _e,
1853
+ url: v(T),
1854
+ onChapterChange: dt,
1855
+ onFullWidthChange: h[6] || (h[6] = (w) => Me.value = w)
1856
+ }, null, 8, ["url"])) : C.value === "video" ? (f(), R(v(jo), {
1734
1857
  key: 8,
1735
- url: f.value.url
1736
- }, null, 8, ["url"])) : F.value === "audio" ? (c(), _(C(yo), {
1858
+ url: v(T)
1859
+ }, null, 8, ["url"])) : C.value === "audio" ? (f(), R(v(So), {
1737
1860
  key: 9,
1738
- url: f.value.url,
1739
- "file-name": f.value.name
1740
- }, null, 8, ["url", "file-name"])) : F.value === "markdown" ? (c(), _(C(ko), {
1861
+ url: v(T),
1862
+ "file-name": g.value.name
1863
+ }, null, 8, ["url", "file-name"])) : C.value === "markdown" ? (f(), R(v(Lo), {
1741
1864
  key: 10,
1742
- url: f.value.url,
1743
- "view-mode": Q.value
1744
- }, null, 8, ["url", "view-mode"])) : F.value === "json" ? (c(), _(C(Fo), {
1865
+ url: v(T),
1866
+ "view-mode": te.value
1867
+ }, null, 8, ["url", "view-mode"])) : C.value === "json" ? (f(), R(v(No), {
1745
1868
  key: 11,
1746
- url: f.value.url,
1747
- "file-name": f.value.name
1748
- }, null, 8, ["url", "file-name"])) : F.value === "csv" ? (c(), _(C(Co), {
1869
+ url: v(T),
1870
+ "file-name": g.value.name
1871
+ }, null, 8, ["url", "file-name"])) : C.value === "csv" ? (f(), R(v(Do), {
1749
1872
  key: 12,
1750
- url: f.value.url,
1751
- "file-name": f.value.name
1752
- }, null, 8, ["url", "file-name"])) : F.value === "xml" ? (c(), _(C(_o), {
1873
+ url: v(T),
1874
+ "file-name": g.value.name
1875
+ }, null, 8, ["url", "file-name"])) : C.value === "xml" ? (f(), R(v(Wo), {
1753
1876
  key: 13,
1754
- url: f.value.url,
1755
- "file-name": f.value.name
1756
- }, null, 8, ["url", "file-name"])) : F.value === "subtitle" ? (c(), _(C(zo), {
1877
+ url: v(T),
1878
+ "file-name": g.value.name
1879
+ }, null, 8, ["url", "file-name"])) : C.value === "subtitle" ? (f(), R(v(Io), {
1757
1880
  key: 14,
1758
- url: f.value.url,
1759
- "file-name": f.value.name
1760
- }, null, 8, ["url", "file-name"])) : F.value === "zip" && o.zipNestingDepth >= Xo ? (c(), _(We, {
1881
+ url: v(T),
1882
+ "file-name": g.value.name
1883
+ }, null, 8, ["url", "file-name"])) : C.value === "zip" && o.zipNestingDepth >= sn ? (f(), R(We, {
1761
1884
  key: 15,
1762
- "file-name": f.value.name,
1763
- "file-type": f.value.type,
1764
- onDownload: ne
1765
- }, null, 8, ["file-name", "file-type"])) : F.value === "zip" ? (c(), _(C(Mo), {
1885
+ "file-name": g.value.name,
1886
+ "file-type": g.value.type,
1887
+ onDownload: le
1888
+ }, null, 8, ["file-name", "file-type"])) : C.value === "zip" ? (f(), R(v(Oo), {
1766
1889
  key: 16,
1767
- url: f.value.url,
1890
+ url: v(T),
1768
1891
  "nesting-depth": o.zipNestingDepth,
1769
- onStatsChange: it
1770
- }, null, 8, ["url", "nesting-depth"])) : F.value === "text" ? (c(), _(C(Ro), {
1892
+ onStatsChange: ct
1893
+ }, null, 8, ["url", "nesting-depth"])) : C.value === "text" ? (f(), R(v(qo), {
1771
1894
  key: 17,
1772
- url: f.value.url,
1773
- "file-name": f.value.name,
1774
- "word-wrap": J.value,
1775
- "html-preview": K.value
1776
- }, null, 8, ["url", "file-name", "word-wrap", "html-preview"])) : (c(), _(We, {
1895
+ url: v(T),
1896
+ "file-name": g.value.name,
1897
+ "word-wrap": Q.value,
1898
+ "html-preview": ee.value
1899
+ }, null, 8, ["url", "file-name", "word-wrap", "html-preview"])) : (f(), R(We, {
1777
1900
  key: 18,
1778
- "file-name": f.value.name,
1779
- "file-type": f.value.type,
1780
- onDownload: ne
1901
+ "file-name": g.value.name,
1902
+ "file-type": g.value.type,
1903
+ onDownload: le
1781
1904
  }, null, 8, ["file-name", "file-type"]))
1782
1905
  ], 64))
1783
- ], 64)) : L("", !0)
1906
+ ], 64)) : W("", !0)
1784
1907
  ], 544),
1785
- !e.headless && W.value.length > 1 ? (c(), g(R, { key: 1 }, [
1786
- e.currentIndex > 0 ? (c(), g("button", {
1908
+ !e.headless && D.value.length > 1 ? (f(), b(E, { key: 1 }, [
1909
+ e.currentIndex > 0 ? (f(), b("button", {
1787
1910
  key: 0,
1788
- style: ee({
1911
+ style: oe({
1789
1912
  opacity: k.value ? 1 : 0,
1790
1913
  transform: k.value ? "translateY(-50%)" : "translateY(-50%) translateX(-20px)",
1791
1914
  pointerEvents: k.value ? "auto" : "none",
@@ -1795,11 +1918,11 @@ const io = { class: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp
1795
1918
  onClick: h[7] || (h[7] = (w) => a("navigate", e.currentIndex - 1)),
1796
1919
  onMouseenter: h[8] || (h[8] = (w) => k.value = !0)
1797
1920
  }, [
1798
- G(C(de), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
1799
- ], 36)) : L("", !0),
1800
- e.currentIndex < W.value.length - 1 ? (c(), g("button", {
1921
+ H(v(fe), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
1922
+ ], 36)) : W("", !0),
1923
+ e.currentIndex < D.value.length - 1 ? (f(), b("button", {
1801
1924
  key: 1,
1802
- style: ee({
1925
+ style: oe({
1803
1926
  opacity: k.value ? 1 : 0,
1804
1927
  transform: k.value ? "translateY(-50%)" : "translateY(-50%) translateX(20px)",
1805
1928
  pointerEvents: k.value ? "auto" : "none",
@@ -1809,38 +1932,38 @@ const io = { class: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp
1809
1932
  onClick: h[9] || (h[9] = (w) => a("navigate", e.currentIndex + 1)),
1810
1933
  onMouseenter: h[10] || (h[10] = (w) => k.value = !0)
1811
1934
  }, [
1812
- G(C(pe), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
1813
- ], 36)) : L("", !0)
1814
- ], 64)) : L("", !0)
1815
- ], 8, No);
1935
+ H(v(pe), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
1936
+ ], 36)) : W("", !0)
1937
+ ], 64)) : W("", !0)
1938
+ ], 8, Vo);
1816
1939
  };
1817
1940
  }
1818
- }), Jo = (e, t) => {
1941
+ }), cn = (e, t) => {
1819
1942
  const o = e.__vccOpts || e;
1820
1943
  for (const [a, l] of t)
1821
1944
  o[a] = l;
1822
1945
  return o;
1823
- }, me = /* @__PURE__ */ Jo(Yo, [["__scopeId", "data-v-45f93f85"]]), kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1946
+ }, he = /* @__PURE__ */ cn(dn, [["__scopeId", "data-v-14963572"]]), Ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1824
1947
  __proto__: null,
1825
- default: me
1948
+ default: he
1826
1949
  }, Symbol.toStringTag, { value: "Module" }));
1827
- function Ko(e) {
1950
+ function fn(e) {
1828
1951
  let t = "", o = "", a = !1;
1829
1952
  const l = () => {
1830
1953
  if (a || typeof document > "u") return;
1831
1954
  t = document.body.style.overflow, o = document.body.style.paddingRight;
1832
- const i = window.innerWidth - document.documentElement.clientWidth;
1833
- document.body.style.overflow = "hidden", i > 0 && (document.body.style.paddingRight = `${i}px`), a = !0;
1955
+ const r = window.innerWidth - document.documentElement.clientWidth;
1956
+ document.body.style.overflow = "hidden", r > 0 && (document.body.style.paddingRight = `${r}px`), a = !0;
1834
1957
  }, n = () => {
1835
1958
  !a || typeof document > "u" || (document.body.style.overflow = t, document.body.style.paddingRight = o, a = !1);
1836
1959
  };
1837
- return De(() => {
1960
+ return Ie(() => {
1838
1961
  e() && l();
1839
- }), pt(() => {
1962
+ }), vt(() => {
1840
1963
  n();
1841
1964
  }), { lock: l, unlock: n };
1842
1965
  }
1843
- const Qo = ["data-theme"], Fn = /* @__PURE__ */ X({
1966
+ const pn = ["data-theme"], Nn = /* @__PURE__ */ X({
1844
1967
  __name: "FilePreviewModal",
1845
1968
  props: {
1846
1969
  files: {},
@@ -1850,56 +1973,60 @@ const Qo = ["data-theme"], Fn = /* @__PURE__ */ X({
1850
1973
  locale: { default: void 0 },
1851
1974
  messages: { default: void 0 },
1852
1975
  headless: { type: Boolean, default: !1 },
1853
- theme: { default: "dark" }
1976
+ theme: { default: "dark" },
1977
+ requestInit: { type: Function, default: void 0 },
1978
+ requestHandler: { type: Function, default: void 0 },
1979
+ shouldFetchAsBlob: { type: Function, default: void 0 },
1980
+ onDownload: { type: Function, default: void 0 }
1854
1981
  },
1855
1982
  emits: ["close", "navigate", "custom-event"],
1856
1983
  setup(e, { emit: t }) {
1857
- const o = e, a = t, { lock: l, unlock: n } = Ko(() => o.isOpen);
1858
- V(
1984
+ const o = e, a = t, { lock: l, unlock: n } = fn(() => o.isOpen);
1985
+ q(
1859
1986
  () => o.isOpen,
1860
- (m) => {
1861
- m ? l() : n();
1987
+ (p) => {
1988
+ p ? l() : n();
1862
1989
  }
1863
1990
  );
1864
- const i = z(
1991
+ const r = _(
1865
1992
  typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
1866
1993
  );
1867
1994
  let s = null;
1868
- V(
1995
+ q(
1869
1996
  () => o.theme,
1870
- (m) => {
1871
- if (s && (s(), s = null), m === "auto") {
1872
- const p = window.matchMedia("(prefers-color-scheme: dark)"), y = (M) => {
1873
- i.value = M.matches;
1997
+ (p) => {
1998
+ if (s && (s(), s = null), p === "auto") {
1999
+ const c = window.matchMedia("(prefers-color-scheme: dark)"), F = (M) => {
2000
+ r.value = M.matches;
1874
2001
  };
1875
- p.addEventListener("change", y), s = () => p.removeEventListener("change", y);
2002
+ c.addEventListener("change", F), s = () => c.removeEventListener("change", F);
1876
2003
  }
1877
2004
  },
1878
2005
  { immediate: !0 }
1879
- ), oe(() => {
2006
+ ), G(() => {
1880
2007
  s && s();
1881
2008
  });
1882
- const r = T(
1883
- () => o.theme === "auto" ? i.value ? "dark" : "light" : o.theme
1884
- ), u = () => a("close"), d = (m) => m.stopPropagation(), v = (m) => m.stopPropagation();
1885
- return (m, p) => (c(), _(ct, { to: "body" }, [
1886
- G(ft, { name: "vfp-fade" }, {
1887
- default: mt(() => [
1888
- e.isOpen ? (c(), g("div", {
2009
+ const i = z(
2010
+ () => o.theme === "auto" ? r.value ? "dark" : "light" : o.theme
2011
+ ), u = () => a("close"), d = (p) => p.stopPropagation(), m = (p) => p.stopPropagation();
2012
+ return (p, c) => (f(), R(ht, { to: "body" }, [
2013
+ H(gt, { name: "vfp-fade" }, {
2014
+ default: bt(() => [
2015
+ e.isOpen ? (f(), b("div", {
1889
2016
  key: 0,
1890
2017
  class: "vfp-root",
1891
- "data-theme": r.value
2018
+ "data-theme": i.value
1892
2019
  }, [
1893
- E("div", {
2020
+ P("div", {
1894
2021
  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",
1895
2022
  onClick: u,
1896
- onWheel: v
2023
+ onWheel: m
1897
2024
  }, [
1898
- E("div", {
2025
+ P("div", {
1899
2026
  class: "vfp-relative vfp-w-full vfp-h-full",
1900
2027
  onClick: d
1901
2028
  }, [
1902
- G(me, {
2029
+ H(he, {
1903
2030
  mode: "modal",
1904
2031
  files: e.files,
1905
2032
  "current-index": e.currentIndex,
@@ -1908,19 +2035,23 @@ const Qo = ["data-theme"], Fn = /* @__PURE__ */ X({
1908
2035
  messages: e.messages,
1909
2036
  headless: e.headless,
1910
2037
  theme: e.theme,
1911
- onClose: p[0] || (p[0] = (y) => a("close")),
1912
- onNavigate: p[1] || (p[1] = (y) => a("navigate", y)),
1913
- onCustomEvent: p[2] || (p[2] = (y) => a("custom-event", y))
1914
- }, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme"])
2038
+ "request-init": e.requestInit,
2039
+ "request-handler": e.requestHandler,
2040
+ "should-fetch-as-blob": e.shouldFetchAsBlob,
2041
+ "on-download": e.onDownload,
2042
+ onClose: c[0] || (c[0] = (F) => a("close")),
2043
+ onNavigate: c[1] || (c[1] = (F) => a("navigate", F)),
2044
+ onCustomEvent: c[2] || (c[2] = (F) => a("custom-event", F))
2045
+ }, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download"])
1915
2046
  ])
1916
2047
  ], 32)
1917
- ], 8, Qo)) : L("", !0)
2048
+ ], 8, pn)) : W("", !0)
1918
2049
  ]),
1919
2050
  _: 1
1920
2051
  })
1921
2052
  ]));
1922
2053
  }
1923
- }), en = ["data-theme"], tn = { class: "vfp-relative vfp-w-full vfp-h-full vfp-overflow-hidden vfp-bg-surface-overlay" }, Cn = /* @__PURE__ */ X({
2054
+ }), mn = ["data-theme"], vn = { class: "vfp-relative vfp-w-full vfp-h-full vfp-overflow-hidden vfp-bg-surface-overlay" }, Dn = /* @__PURE__ */ X({
1924
2055
  __name: "FilePreviewEmbed",
1925
2056
  props: {
1926
2057
  files: {},
@@ -1931,41 +2062,45 @@ const Qo = ["data-theme"], Fn = /* @__PURE__ */ X({
1931
2062
  locale: { default: void 0 },
1932
2063
  messages: { default: void 0 },
1933
2064
  headless: { type: Boolean, default: !1 },
1934
- theme: { default: "dark" }
2065
+ theme: { default: "dark" },
2066
+ requestInit: { type: Function, default: void 0 },
2067
+ requestHandler: { type: Function, default: void 0 },
2068
+ shouldFetchAsBlob: { type: Function, default: void 0 },
2069
+ onDownload: { type: Function, default: void 0 }
1935
2070
  },
1936
2071
  emits: ["navigate", "custom-event"],
1937
2072
  setup(e, { emit: t }) {
1938
- const o = e, a = t, l = z(
2073
+ const o = e, a = t, l = _(
1939
2074
  typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
1940
2075
  );
1941
2076
  let n = null;
1942
- V(
2077
+ q(
1943
2078
  () => o.theme,
1944
- (r) => {
1945
- if (n && (n(), n = null), r === "auto") {
1946
- const u = window.matchMedia("(prefers-color-scheme: dark)"), d = (v) => {
1947
- l.value = v.matches;
2079
+ (i) => {
2080
+ if (n && (n(), n = null), i === "auto") {
2081
+ const u = window.matchMedia("(prefers-color-scheme: dark)"), d = (m) => {
2082
+ l.value = m.matches;
1948
2083
  };
1949
2084
  u.addEventListener("change", d), n = () => u.removeEventListener("change", d);
1950
2085
  }
1951
2086
  },
1952
2087
  { immediate: !0 }
1953
- ), oe(() => {
2088
+ ), G(() => {
1954
2089
  n && n();
1955
2090
  });
1956
- const i = T(
2091
+ const r = z(
1957
2092
  () => o.theme === "auto" ? l.value ? "dark" : "light" : o.theme
1958
2093
  ), s = {
1959
2094
  width: typeof o.width == "number" ? `${o.width}px` : o.width,
1960
2095
  height: typeof o.height == "number" ? `${o.height}px` : o.height
1961
2096
  };
1962
- return (r, u) => (c(), g("div", {
2097
+ return (i, u) => (f(), b("div", {
1963
2098
  class: "vfp-root",
1964
2099
  style: s,
1965
- "data-theme": i.value
2100
+ "data-theme": r.value
1966
2101
  }, [
1967
- E("div", tn, [
1968
- G(me, {
2102
+ P("div", vn, [
2103
+ H(he, {
1969
2104
  mode: "embed",
1970
2105
  files: e.files,
1971
2106
  "current-index": e.currentIndex,
@@ -1974,44 +2109,49 @@ const Qo = ["data-theme"], Fn = /* @__PURE__ */ X({
1974
2109
  messages: e.messages,
1975
2110
  headless: e.headless,
1976
2111
  theme: e.theme,
2112
+ "request-init": e.requestInit,
2113
+ "request-handler": e.requestHandler,
2114
+ "should-fetch-as-blob": e.shouldFetchAsBlob,
2115
+ "on-download": e.onDownload,
1977
2116
  onNavigate: u[0] || (u[0] = (d) => a("navigate", d)),
1978
2117
  onCustomEvent: u[1] || (u[1] = (d) => a("custom-event", d))
1979
- }, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme"])
2118
+ }, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download"])
1980
2119
  ])
1981
- ], 8, en));
2120
+ ], 8, mn));
1982
2121
  }
1983
- }), _n = Ft.version;
2122
+ }), Wn = zt.version;
1984
2123
  export {
1985
- bn as C,
1986
- mn as F,
1987
- _t as I,
1988
- Ye as L,
1989
- qe as M,
1990
- xn as S,
1991
- _n as V,
1992
- Jo as _,
1993
- rn as a,
1994
- yn as b,
1995
- fn as c,
1996
- Mt as d,
1997
- le as e,
1998
- sn as f,
1999
- dn as g,
2000
- pn as h,
2001
- gn as i,
2002
- ln as j,
2003
- wn as k,
2004
- me as l,
2005
- un as m,
2006
- Cn as n,
2007
- Fn as o,
2008
- Rt as p,
2009
- zt as q,
2010
- Yt as r,
2011
- kn as s,
2012
- fe as u,
2013
- vn as v,
2014
- hn as w,
2015
- cn as x
2124
+ zn as C,
2125
+ $n as E,
2126
+ he as F,
2127
+ jn as L,
2128
+ En as M,
2129
+ Ye as N,
2130
+ Tn as S,
2131
+ Tt as U,
2132
+ Wn as V,
2133
+ cn as _,
2134
+ co as a,
2135
+ Sn as b,
2136
+ Cn as c,
2137
+ Ke as d,
2138
+ Rn as e,
2139
+ Pt as f,
2140
+ Fn as g,
2141
+ xn as h,
2142
+ Mn as i,
2143
+ wn as j,
2144
+ ie as k,
2145
+ Dn as l,
2146
+ $t as m,
2147
+ Nn as n,
2148
+ Et as o,
2149
+ yn as p,
2150
+ lo as q,
2151
+ Ln as r,
2152
+ ve as u,
2153
+ kn as x,
2154
+ _n as y,
2155
+ Pn as z
2016
2156
  };
2017
- //# sourceMappingURL=index-C324a7kV.mjs.map
2157
+ //# sourceMappingURL=index-BA-bP8P6.mjs.map