@eternalheart/react-file-preview 1.3.7 → 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 (85) hide show
  1. package/README.md +1 -1
  2. package/lib/FilePreviewContent.d.ts +12 -1
  3. package/lib/FilePreviewContent.d.ts.map +1 -1
  4. package/lib/FilePreviewEmbed.d.ts +9 -1
  5. package/lib/FilePreviewEmbed.d.ts.map +1 -1
  6. package/lib/FilePreviewModal.d.ts +9 -1
  7. package/lib/FilePreviewModal.d.ts.map +1 -1
  8. package/lib/RequestContext.d.ts +24 -0
  9. package/lib/RequestContext.d.ts.map +1 -0
  10. package/lib/chunks/{index-BIg3vHQf.mjs → index-B-H9HQiI.mjs} +35 -35
  11. package/lib/chunks/index-B-H9HQiI.mjs.map +1 -0
  12. package/lib/chunks/{index-DOMMMe9f.mjs → index-BGeyzo6u.mjs} +2 -2
  13. package/lib/chunks/{index-DOMMMe9f.mjs.map → index-BGeyzo6u.mjs.map} +1 -1
  14. package/lib/chunks/{index-zDEwNk3h.mjs → index-BNUiNUWa.mjs} +35 -35
  15. package/lib/chunks/index-BNUiNUWa.mjs.map +1 -0
  16. package/lib/chunks/{index-DTH1IvOG.mjs → index-BSD3w5eG.mjs} +72 -72
  17. package/lib/chunks/index-BSD3w5eG.mjs.map +1 -0
  18. package/lib/chunks/{index-D_8IHm6o.mjs → index-BcBe6KW7.mjs} +11 -10
  19. package/lib/chunks/index-BcBe6KW7.mjs.map +1 -0
  20. package/lib/chunks/index-BdYkTSTt.mjs +51 -0
  21. package/lib/chunks/index-BdYkTSTt.mjs.map +1 -0
  22. package/lib/chunks/{index-BWbuffRN.mjs → index-BqEuP_8r.mjs} +8 -8
  23. package/lib/chunks/index-BqEuP_8r.mjs.map +1 -0
  24. package/lib/chunks/{index-LNXbKjrI.mjs → index-Bv93wiEK.mjs} +812 -681
  25. package/lib/chunks/index-Bv93wiEK.mjs.map +1 -0
  26. package/lib/chunks/{index-xTq9b3vw.mjs → index-CKirCT35.mjs} +13 -13
  27. package/lib/chunks/index-CKirCT35.mjs.map +1 -0
  28. package/lib/chunks/{index-BOEtlHD3.mjs → index-CgV8T0G5.mjs} +53 -53
  29. package/lib/chunks/index-CgV8T0G5.mjs.map +1 -0
  30. package/lib/chunks/{index-DinKO2op.mjs → index-D8GtNeDn.mjs} +2 -2
  31. package/lib/chunks/{index-DinKO2op.mjs.map → index-D8GtNeDn.mjs.map} +1 -1
  32. package/lib/chunks/{index-CQABwGVP.mjs → index-DGuiWJr7.mjs} +18 -18
  33. package/lib/chunks/index-DGuiWJr7.mjs.map +1 -0
  34. package/lib/chunks/{index-Yp36heK8.mjs → index-DV5Jd7Qe.mjs} +31 -31
  35. package/lib/chunks/index-DV5Jd7Qe.mjs.map +1 -0
  36. package/lib/chunks/{index-qxvk-6P6.mjs → index-DdOEWhrk.mjs} +33 -33
  37. package/lib/chunks/index-DdOEWhrk.mjs.map +1 -0
  38. package/lib/chunks/{index-w0tt7Myw.mjs → index-DmepcY31.mjs} +2 -2
  39. package/lib/chunks/{index-w0tt7Myw.mjs.map → index-DmepcY31.mjs.map} +1 -1
  40. package/lib/chunks/index-U3w45GW8.mjs +299 -0
  41. package/lib/chunks/index-U3w45GW8.mjs.map +1 -0
  42. package/lib/chunks/{index-BsSx9pGx.mjs → index-r3q2xCCI.mjs} +37 -36
  43. package/lib/chunks/index-r3q2xCCI.mjs.map +1 -0
  44. package/lib/chunks/{index-BEolw_uv.mjs → index-zEVVgWCH.mjs} +2 -2
  45. package/lib/chunks/{index-BEolw_uv.mjs.map → index-zEVVgWCH.mjs.map} +1 -1
  46. package/lib/chunks/{useShikiHighlight-DtWg9b8y.mjs → useShikiHighlight-DzEAK0S7.mjs} +7 -7
  47. package/lib/chunks/{useShikiHighlight-DtWg9b8y.mjs.map → useShikiHighlight-DzEAK0S7.mjs.map} +1 -1
  48. package/lib/index.cjs +20 -33
  49. package/lib/index.cjs.map +1 -1
  50. package/lib/index.css +1 -1
  51. package/lib/index.mjs +7 -7
  52. package/lib/renderers/Csv/index.d.ts.map +1 -1
  53. package/lib/renderers/Docx/index.d.ts.map +1 -1
  54. package/lib/renderers/Epub/index.d.ts.map +1 -1
  55. package/lib/renderers/Json/index.d.ts.map +1 -1
  56. package/lib/renderers/Markdown/index.d.ts.map +1 -1
  57. package/lib/renderers/Mobi/index.d.ts.map +1 -1
  58. package/lib/renderers/Msg/index.d.ts.map +1 -1
  59. package/lib/renderers/Pptx/index.d.ts.map +1 -1
  60. package/lib/renderers/Subtitle/index.d.ts.map +1 -1
  61. package/lib/renderers/Text/index.d.ts.map +1 -1
  62. package/lib/renderers/Xlsx/index.d.ts.map +1 -1
  63. package/lib/renderers/Xml/index.d.ts.map +1 -1
  64. package/lib/renderers/Zip/index.d.ts.map +1 -1
  65. package/lib/types.d.ts +1 -1
  66. package/lib/types.d.ts.map +1 -1
  67. package/package.json +4 -4
  68. package/lib/chunks/index--zZy1XpK.mjs +0 -299
  69. package/lib/chunks/index--zZy1XpK.mjs.map +0 -1
  70. package/lib/chunks/index-B5tBeF0g.mjs +0 -51
  71. package/lib/chunks/index-B5tBeF0g.mjs.map +0 -1
  72. package/lib/chunks/index-BIg3vHQf.mjs.map +0 -1
  73. package/lib/chunks/index-BOEtlHD3.mjs.map +0 -1
  74. package/lib/chunks/index-BWbuffRN.mjs.map +0 -1
  75. package/lib/chunks/index-BsSx9pGx.mjs.map +0 -1
  76. package/lib/chunks/index-CQABwGVP.mjs.map +0 -1
  77. package/lib/chunks/index-DTH1IvOG.mjs.map +0 -1
  78. package/lib/chunks/index-D_8IHm6o.mjs.map +0 -1
  79. package/lib/chunks/index-LNXbKjrI.mjs.map +0 -1
  80. package/lib/chunks/index-Yp36heK8.mjs.map +0 -1
  81. package/lib/chunks/index-qxvk-6P6.mjs.map +0 -1
  82. package/lib/chunks/index-xTq9b3vw.mjs.map +0 -1
  83. package/lib/chunks/index-zDEwNk3h.mjs.map +0 -1
  84. package/lib/chunks/xspreadsheet-CyBXARuf.mjs +0 -5215
  85. package/lib/chunks/xspreadsheet-CyBXARuf.mjs.map +0 -1
@@ -1,14 +1,14 @@
1
- import { jsx as i, jsxs as N, Fragment as Fe } from "react/jsx-runtime";
2
- import _e, { createContext as jt, useContext as it, useMemo as G, lazy as k, useState as _, useEffect as W, useRef as H, useCallback as C, Suspense as ke } from "react";
3
- import { createPortal as Ce } from "react-dom";
4
- import { motion as Y, AnimatePresence as Ne } from "framer-motion";
5
- import { ZoomOut as Wt, ZoomIn as Lt, Scan as Me, RotateCcw as Te, RotateCw as Re, RefreshCw as $t, List as Dt, ChevronLeft as st, ChevronRight as lt, Minimize2 as Zt, Maximize2 as At, WrapText as Pe, Code as Ot, Eye as It, FileQuestion as ze, Download as Vt, X as Ee } from "lucide-react";
6
- import Se from "jszip";
7
- import { pdfjs as U } from "react-pdf";
8
- const je = "1.3.7", We = {
9
- version: je
1
+ import { jsx as l, jsxs as z, Fragment as Te } from "react/jsx-runtime";
2
+ import Pe, { createContext as pt, useContext as J, useMemo as B, useState as y, useRef as V, useEffect as L, lazy as N, useCallback as P, Suspense as ze } from "react";
3
+ import { createPortal as Ee } from "react-dom";
4
+ import { motion as et, AnimatePresence as je } from "framer-motion";
5
+ import { ZoomOut as At, ZoomIn as Ut, Scan as Se, RotateCcw as Le, RotateCw as We, RefreshCw as It, List as Ht, ChevronLeft as ct, ChevronRight as ft, Minimize2 as Vt, Maximize2 as Bt, WrapText as $e, Code as qt, Eye as Gt, FileQuestion as De, Download as Xt, X as Oe } from "lucide-react";
6
+ import Ze from "jszip";
7
+ import { pdfjs as X } from "react-pdf";
8
+ const Ae = "1.3.9", Ue = {
9
+ version: Ae
10
10
  };
11
- function Le(t) {
11
+ function Ie(t) {
12
12
  try {
13
13
  const e = new URL(t).pathname.split("/").pop() || "file";
14
14
  return decodeURIComponent(e);
@@ -17,7 +17,7 @@ function Le(t) {
17
17
  return decodeURIComponent(e);
18
18
  }
19
19
  }
20
- function rt(t) {
20
+ function at(t) {
21
21
  var e;
22
22
  const r = ((e = t.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "";
23
23
  return {
@@ -94,36 +94,36 @@ function rt(t) {
94
94
  zip: "application/zip"
95
95
  }[r] || "application/octet-stream";
96
96
  }
97
- function $e(t, e = 0) {
97
+ function He(t, e = 0) {
98
98
  if (t instanceof File)
99
99
  return {
100
100
  id: `file-${Date.now()}-${e}`,
101
101
  name: t.name,
102
102
  url: URL.createObjectURL(t),
103
- type: t.type || rt(t.name),
103
+ type: t.type || at(t.name),
104
104
  size: t.size
105
105
  };
106
106
  if (typeof t == "string") {
107
- const r = Le(t);
107
+ const r = Ie(t);
108
108
  return {
109
109
  id: `url-${Date.now()}-${e}`,
110
110
  name: r,
111
111
  url: t,
112
- type: rt(r)
112
+ type: at(r)
113
113
  };
114
114
  }
115
115
  return {
116
116
  id: t.id || `link-${Date.now()}-${e}`,
117
117
  name: t.name,
118
118
  url: t.url,
119
- type: t.type || rt(t.name),
119
+ type: t.type || at(t.name),
120
120
  size: t.size
121
121
  };
122
122
  }
123
- function De(t) {
124
- return t.map((e, r) => $e(e, r));
123
+ function Ve(t) {
124
+ return t.map((e, r) => He(e, r));
125
125
  }
126
- function Ze(t) {
126
+ function Be(t) {
127
127
  var e;
128
128
  const r = ((e = t.name.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "", n = t.type.toLowerCase();
129
129
  if (n.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(r))
@@ -201,7 +201,7 @@ function Ze(t) {
201
201
  ];
202
202
  return n.startsWith("text/") || a.includes(r) ? "text" : "unsupported";
203
203
  }
204
- function Gr(t) {
204
+ function co(t) {
205
205
  var e;
206
206
  const r = ((e = t.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "";
207
207
  return {
@@ -248,75 +248,75 @@ function Gr(t) {
248
248
  txt: "text"
249
249
  }[r] || "text";
250
250
  }
251
- function Ae(t) {
251
+ function qe(t) {
252
252
  return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
253
253
  }
254
- function Xr(t) {
254
+ function fo(t) {
255
255
  var e;
256
256
  return (((e = t.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "") === "tsv" ? " " : ",";
257
257
  }
258
- function qr(t, e = {}) {
258
+ function uo(t, e = {}) {
259
259
  const r = e.delimiter ?? ",", n = e.firstRowAsHeader ?? !0, a = [];
260
- let o = [], l = "", p = !1, s = 0;
261
- const f = t.length;
262
- for (; s < f; ) {
263
- const u = t[s];
264
- if (p) {
260
+ let o = [], i = "", s = !1, p = 0;
261
+ const c = t.length;
262
+ for (; p < c; ) {
263
+ const u = t[p];
264
+ if (s) {
265
265
  if (u === '"') {
266
- if (t[s + 1] === '"') {
267
- l += '"', s += 2;
266
+ if (t[p + 1] === '"') {
267
+ i += '"', p += 2;
268
268
  continue;
269
269
  }
270
- p = !1, s += 1;
270
+ s = !1, p += 1;
271
271
  continue;
272
272
  }
273
- l += u, s += 1;
273
+ i += u, p += 1;
274
274
  continue;
275
275
  }
276
276
  if (u === '"') {
277
- p = !0, s += 1;
277
+ s = !0, p += 1;
278
278
  continue;
279
279
  }
280
280
  if (u === r) {
281
- o.push(l), l = "", s += 1;
281
+ o.push(i), i = "", p += 1;
282
282
  continue;
283
283
  }
284
284
  if (u === "\r") {
285
- t[s + 1] === `
286
- ` && (s += 1), o.push(l), a.push(o), o = [], l = "", s += 1;
285
+ t[p + 1] === `
286
+ ` && (p += 1), o.push(i), a.push(o), o = [], i = "", p += 1;
287
287
  continue;
288
288
  }
289
289
  if (u === `
290
290
  `) {
291
- o.push(l), a.push(o), o = [], l = "", s += 1;
291
+ o.push(i), a.push(o), o = [], i = "", p += 1;
292
292
  continue;
293
293
  }
294
- l += u, s += 1;
294
+ i += u, p += 1;
295
295
  }
296
- for ((l.length > 0 || o.length > 0) && (o.push(l), a.push(o)); a.length > 0; ) {
296
+ for ((i.length > 0 || o.length > 0) && (o.push(i), a.push(o)); a.length > 0; ) {
297
297
  const u = a[a.length - 1];
298
298
  if (u.length === 1 && u[0] === "")
299
299
  a.pop();
300
300
  else
301
301
  break;
302
302
  }
303
- let c = [], d = a;
304
- n && a.length > 0 && (c = a[0], d = a.slice(1));
305
- const m = Math.max(
306
- c.length,
303
+ let f = [], d = a;
304
+ n && a.length > 0 && (f = a[0], d = a.slice(1));
305
+ const h = Math.max(
306
+ f.length,
307
307
  ...d.map((u) => u.length),
308
308
  0
309
309
  );
310
310
  for (const u of d)
311
- for (; u.length < m; ) u.push("");
311
+ for (; u.length < h; ) u.push("");
312
312
  return {
313
- header: c,
313
+ header: f,
314
314
  rows: d,
315
- columnCount: m,
315
+ columnCount: h,
316
316
  delimiter: r
317
317
  };
318
318
  }
319
- function Oe(t) {
319
+ function Ge(t) {
320
320
  const e = t instanceof Uint8Array ? t : new Uint8Array(t);
321
321
  if (e.length >= 3 && e[0] === 239 && e[1] === 187 && e[2] === 191)
322
322
  return new TextDecoder("utf-8").decode(e);
@@ -334,13 +334,54 @@ function Oe(t) {
334
334
  }
335
335
  return new TextDecoder("utf-8", { fatal: !1 }).decode(e);
336
336
  }
337
- async function Jr(t, e) {
338
- const r = await fetch(t, e);
339
- if (!r.ok) throw new Error(`请求失败: ${r.status}`);
340
- const n = await r.arrayBuffer();
341
- return Oe(n);
337
+ async function mo(t, e) {
338
+ const r = !!e && ("fetcher" in e || "init" in e), n = r ? e.fetcher ?? fetch : fetch, a = r ? e.init : e, o = await n(t, a);
339
+ if (!o.ok) throw new Error(`请求失败: ${o.status}`);
340
+ const i = await o.arrayBuffer();
341
+ return Ge(i);
342
+ }
343
+ async function Xe(t, e) {
344
+ if (t)
345
+ return typeof t == "function" ? await t(e) : t;
346
+ }
347
+ function Je(t, e) {
348
+ if (!t && !e) return;
349
+ if (!t) return e;
350
+ if (!e) return t;
351
+ const r = new Headers(t.headers || {});
352
+ return e.headers && new Headers(e.headers).forEach((n, a) => {
353
+ r.set(a, n);
354
+ }), {
355
+ ...t,
356
+ ...e,
357
+ headers: r
358
+ };
359
+ }
360
+ function Ke(t) {
361
+ const e = (t == null ? void 0 : t.requestHandler) ?? ((n, a) => fetch(n, a)), r = t == null ? void 0 : t.requestInit;
362
+ return async (n, a) => {
363
+ const o = await Xe(r, n), i = Je(o, a);
364
+ return e(n, i);
365
+ };
366
+ }
367
+ async function Ye(t, e = fetch, r) {
368
+ const n = await e(t, r);
369
+ if (!n.ok) throw new Error(`请求失败: ${n.status}`);
370
+ const a = await n.blob();
371
+ return URL.createObjectURL(a);
372
+ }
373
+ async function Qe(t, e, r = fetch, n) {
374
+ const a = await r(t, n);
375
+ if (!a.ok) throw new Error(`请求失败: ${a.status}`);
376
+ const o = await a.blob(), i = URL.createObjectURL(o);
377
+ try {
378
+ const s = document.createElement("a");
379
+ s.href = i, s.download = e, s.style.display = "none", document.body.appendChild(s), s.click(), document.body.removeChild(s);
380
+ } finally {
381
+ setTimeout(() => URL.revokeObjectURL(i), 1e3);
382
+ }
342
383
  }
343
- function Mt(t) {
384
+ function St(t) {
344
385
  const e = t.trim().replace(",", "."), r = e.split(":").map((n) => n.trim());
345
386
  if (r.length === 3) {
346
387
  const [n, a, o] = r;
@@ -352,59 +393,59 @@ function Mt(t) {
352
393
  }
353
394
  return Number(e) || 0;
354
395
  }
355
- function Kr(t) {
396
+ function ho(t) {
356
397
  if (!isFinite(t) || t < 0) return "00:00:00.000";
357
- const e = Math.floor(t * 1e3), r = e % 1e3, n = Math.floor(e / 1e3) % 60, a = Math.floor(e / 6e4) % 60, o = Math.floor(e / 36e5), l = (p, s = 2) => p.toString().padStart(s, "0");
358
- return `${l(o)}:${l(a)}:${l(n)}.${l(r, 3)}`;
398
+ const e = Math.floor(t * 1e3), r = e % 1e3, n = Math.floor(e / 1e3) % 60, a = Math.floor(e / 6e4) % 60, o = Math.floor(e / 36e5), i = (s, p = 2) => s.toString().padStart(p, "0");
399
+ return `${i(o)}:${i(a)}:${i(n)}.${i(r, 3)}`;
359
400
  }
360
- const Tt = /(\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}/, Ie = /^\s*\[\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?\]/;
361
- function Ve(t) {
401
+ const Lt = /(\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}/, tr = /^\s*\[\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?\]/;
402
+ function er(t) {
362
403
  const e = t.replace(/^\uFEFF/, "").trimStart();
363
- return /^WEBVTT/.test(e) ? "vtt" : /^<\?xml/i.test(e) || /<tt\b[^>]*>/i.test(e) ? "ttml" : /^\[Script Info\]/im.test(e) || /^Dialogue:/m.test(e) ? /ScriptType:\s*v4\.00\s*$/im.test(e) ? "ssa" : "ass" : Ie.test(e) || /^\[(ti|ar|al|au|by|length|offset|re|ve):/im.test(e) ? /<\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?>/.test(e) ? "elrc" : "lrc" : "srt";
404
+ return /^WEBVTT/.test(e) ? "vtt" : /^<\?xml/i.test(e) || /<tt\b[^>]*>/i.test(e) ? "ttml" : /^\[Script Info\]/im.test(e) || /^Dialogue:/m.test(e) ? /ScriptType:\s*v4\.00\s*$/im.test(e) ? "ssa" : "ass" : tr.test(e) || /^\[(ti|ar|al|au|by|length|offset|re|ve):/im.test(e) ? /<\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?>/.test(e) ? "elrc" : "lrc" : "srt";
364
405
  }
365
- function Rt(t, e) {
406
+ function Wt(t, e) {
366
407
  const r = t.replace(/\r\n?/g, `
367
408
  `).replace(/^\uFEFF/, "").split(`
368
409
  `), n = [];
369
410
  let a, o = 0;
370
411
  if (e === "vtt") {
371
- const l = [];
412
+ const i = [];
372
413
  for (; o < r.length && r[o].trim() !== ""; )
373
- l.push(r[o]), o++;
374
- for (a = l.join(`
414
+ i.push(r[o]), o++;
415
+ for (a = i.join(`
375
416
  `); o < r.length && r[o].trim() === ""; ) o++;
376
417
  }
377
418
  for (; o < r.length; ) {
378
419
  for (; o < r.length && r[o].trim() === ""; ) o++;
379
420
  if (o >= r.length) break;
380
- let l, p = null;
381
- if (Tt.test(r[o]))
382
- p = r[o], o++;
383
- else if (l = r[o].trim() || void 0, o++, o < r.length && Tt.test(r[o]))
384
- p = r[o], o++;
421
+ let i, s = null;
422
+ if (Lt.test(r[o]))
423
+ s = r[o], o++;
424
+ else if (i = r[o].trim() || void 0, o++, o < r.length && Lt.test(r[o]))
425
+ s = r[o], o++;
385
426
  else
386
427
  continue;
387
- if (!p) continue;
388
- const s = p.match(/([\d:.,]+)\s*-->\s*([\d:.,]+)/);
389
428
  if (!s) continue;
390
- const f = Mt(s[1]), c = Mt(s[2]), d = [];
429
+ const p = s.match(/([\d:.,]+)\s*-->\s*([\d:.,]+)/);
430
+ if (!p) continue;
431
+ const c = St(p[1]), f = St(p[2]), d = [];
391
432
  for (; o < r.length && r[o].trim() !== ""; )
392
433
  d.push(r[o]), o++;
393
- n.push({ id: l, start: f, end: c, text: d.join(`
434
+ n.push({ id: i, start: c, end: f, text: d.join(`
394
435
  `) });
395
436
  }
396
437
  return { format: e, cues: n, header: a };
397
438
  }
398
- function at(t, e, r) {
439
+ function lt(t, e, r) {
399
440
  const n = Number(t), a = Number(e);
400
441
  let o = 0;
401
442
  if (r) {
402
- const l = (r + "000").slice(0, 3);
403
- o = Number(l);
443
+ const i = (r + "000").slice(0, 3);
444
+ o = Number(i);
404
445
  }
405
446
  return n * 60 + a + o / 1e3;
406
447
  }
407
- function Bt(t, e) {
448
+ function Jt(t, e) {
408
449
  const r = /^\[(ti|ar|al|au|by|length|offset|re|ve):(.*)\]$/i.exec(t.trim());
409
450
  if (!r) return !1;
410
451
  const n = r[1].toLowerCase(), a = r[2].trim();
@@ -414,115 +455,115 @@ function Bt(t, e) {
414
455
  }
415
456
  return !0;
416
457
  }
417
- function Be(t) {
458
+ function rr(t) {
418
459
  const e = t.replace(/\r\n?/g, `
419
460
  `).replace(/^\uFEFF/, "").split(`
420
461
  `), r = { metadata: {}, offsetMs: 0 }, n = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, a = [];
421
- for (const l of e) {
422
- const p = l.trim();
423
- if (!p || Bt(p, r)) continue;
424
- const s = [];
425
- let f = 0;
462
+ for (const i of e) {
463
+ const s = i.trim();
464
+ if (!s || Jt(s, r)) continue;
465
+ const p = [];
466
+ let c = 0;
426
467
  n.lastIndex = 0;
427
- let c;
428
- for (; (c = n.exec(p)) !== null && c.index === f; )
429
- s.push(at(c[1], c[2], c[3])), f = c.index + c[0].length;
430
- if (s.length === 0) continue;
431
- const d = p.slice(f).trim();
432
- for (const m of s)
433
- a.push({ start: m, text: d });
468
+ let f;
469
+ for (; (f = n.exec(s)) !== null && f.index === c; )
470
+ p.push(lt(f[1], f[2], f[3])), c = f.index + f[0].length;
471
+ if (p.length === 0) continue;
472
+ const d = s.slice(c).trim();
473
+ for (const h of p)
474
+ a.push({ start: h, text: d });
434
475
  }
435
- a.sort((l, p) => l.start - p.start);
476
+ a.sort((i, s) => i.start - s.start);
436
477
  const o = r.offsetMs / 1e3;
437
- return { format: "lrc", cues: a.map((l, p) => {
438
- const s = Math.max(0, l.start - o), f = a[p + 1], c = f ? Math.max(s, f.start - o) : s + 5;
439
- return { start: s, end: c, text: l.text };
478
+ return { format: "lrc", cues: a.map((i, s) => {
479
+ const p = Math.max(0, i.start - o), c = a[s + 1], f = c ? Math.max(p, c.start - o) : p + 5;
480
+ return { start: p, end: f, text: i.text };
440
481
  }), metadata: r.metadata };
441
482
  }
442
- function He(t) {
483
+ function or(t) {
443
484
  const e = t.replace(/\r\n?/g, `
444
485
  `).replace(/^\uFEFF/, "").split(`
445
486
  `), r = { metadata: {}, offsetMs: 0 }, n = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, a = /<(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?>/g, o = [];
446
- for (const p of e) {
447
- const s = p.trim();
448
- if (!s || Bt(s, r)) continue;
449
- const f = [];
450
- let c = 0;
487
+ for (const s of e) {
488
+ const p = s.trim();
489
+ if (!p || Jt(p, r)) continue;
490
+ const c = [];
491
+ let f = 0;
451
492
  n.lastIndex = 0;
452
493
  let d;
453
- for (; (d = n.exec(s)) !== null && d.index === c; )
454
- f.push(at(d[1], d[2], d[3])), c = d.index + d[0].length;
455
- if (f.length === 0) continue;
456
- const m = s.slice(c);
457
- for (const u of f)
458
- o.push({ start: u, raw: m });
494
+ for (; (d = n.exec(p)) !== null && d.index === f; )
495
+ c.push(lt(d[1], d[2], d[3])), f = d.index + d[0].length;
496
+ if (c.length === 0) continue;
497
+ const h = p.slice(f);
498
+ for (const u of c)
499
+ o.push({ start: u, raw: h });
459
500
  }
460
- o.sort((p, s) => p.start - s.start);
461
- const l = r.offsetMs / 1e3;
462
- return { format: "elrc", cues: o.map((p, s) => {
463
- const f = [];
464
- let c = "", d = 0, m = null;
501
+ o.sort((s, p) => s.start - p.start);
502
+ const i = r.offsetMs / 1e3;
503
+ return { format: "elrc", cues: o.map((s, p) => {
504
+ const c = [];
505
+ let f = "", d = 0, h = null;
465
506
  a.lastIndex = 0;
466
507
  let u;
467
- for (; (u = a.exec(p.raw)) !== null; ) {
468
- const M = p.raw.slice(d, u.index);
469
- m !== null && M && f.push({ start: Math.max(0, m - l), text: M }), c += M, m = at(u[1], u[2], u[3]), d = u.index + u[0].length;
508
+ for (; (u = a.exec(s.raw)) !== null; ) {
509
+ const T = s.raw.slice(d, u.index);
510
+ h !== null && T && c.push({ start: Math.max(0, h - i), text: T }), f += T, h = lt(u[1], u[2], u[3]), d = u.index + u[0].length;
470
511
  }
471
- const F = p.raw.slice(d);
472
- m !== null && F && f.push({ start: Math.max(0, m - l), text: F }), c += F;
473
- const x = Math.max(0, p.start - l), y = o[s + 1], b = y ? Math.max(x, y.start - l) : x + 5;
512
+ const _ = s.raw.slice(d);
513
+ h !== null && _ && c.push({ start: Math.max(0, h - i), text: _ }), f += _;
514
+ const M = Math.max(0, s.start - i), v = o[p + 1], F = v ? Math.max(M, v.start - i) : M + 5;
474
515
  return {
475
- start: x,
476
- end: b,
477
- text: c.trim(),
478
- words: f.length ? f : void 0
516
+ start: M,
517
+ end: F,
518
+ text: f.trim(),
519
+ words: c.length ? c : void 0
479
520
  };
480
521
  }), metadata: r.metadata };
481
522
  }
482
- function Pt(t) {
523
+ function $t(t) {
483
524
  const e = t.trim().split(":");
484
525
  return e.length !== 3 ? 0 : Number(e[0]) * 3600 + Number(e[1]) * 60 + Number(e[2].replace(",", "."));
485
526
  }
486
- function zt(t, e) {
527
+ function Dt(t, e) {
487
528
  const r = t.replace(/\r\n?/g, `
488
529
  `).replace(/^\uFEFF/, "").split(`
489
530
  `);
490
531
  let n = "", a = [];
491
- const o = [], l = [];
492
- for (const p of r) {
493
- const s = p.replace(/\s+$/, ""), f = s.trim(), c = /^\[([^\]]+)\]\s*$/.exec(f);
494
- if (c) {
495
- n = c[1].toLowerCase(), l.push(s);
532
+ const o = [], i = [];
533
+ for (const s of r) {
534
+ const p = s.replace(/\s+$/, ""), c = p.trim(), f = /^\[([^\]]+)\]\s*$/.exec(c);
535
+ if (f) {
536
+ n = f[1].toLowerCase(), i.push(p);
496
537
  continue;
497
538
  }
498
539
  if (n !== "events") {
499
- l.push(s);
540
+ i.push(p);
500
541
  continue;
501
542
  }
502
- const d = /^Format:\s*(.+)$/i.exec(f);
543
+ const d = /^Format:\s*(.+)$/i.exec(c);
503
544
  if (d) {
504
- a = d[1].split(",").map((z) => z.trim());
545
+ a = d[1].split(",").map((x) => x.trim());
505
546
  continue;
506
547
  }
507
- const m = /^(Dialogue|Comment):\s*(.+)$/i.exec(f);
508
- if (!m || m[1].toLowerCase() === "comment" || a.length === 0) continue;
509
- const u = a.length, F = m[2].split(","), x = F.slice(0, u - 1), y = F.slice(u - 1).join(","), b = {};
510
- a.forEach((z, E) => {
511
- b[z] = E === u - 1 ? y : x[E] ?? "";
548
+ const h = /^(Dialogue|Comment):\s*(.+)$/i.exec(c);
549
+ if (!h || h[1].toLowerCase() === "comment" || a.length === 0) continue;
550
+ const u = a.length, _ = h[2].split(","), M = _.slice(0, u - 1), v = _.slice(u - 1).join(","), F = {};
551
+ a.forEach((x, S) => {
552
+ F[x] = S === u - 1 ? v : M[S] ?? "";
512
553
  });
513
- const M = Pt(b.Start || ""), P = Pt(b.End || ""), I = (b.Text || "").replace(/\\N/g, `
554
+ const T = $t(F.Start || ""), k = $t(F.End || ""), R = (F.Text || "").replace(/\\N/g, `
514
555
  `).replace(/\\n/g, `
515
556
  `).replace(/\\h/g, " ").replace(/\{[^}]*\}/g, "");
516
- o.push({ start: M, end: P, text: I, style: b.Style });
557
+ o.push({ start: T, end: k, text: R, style: F.Style });
517
558
  }
518
- return o.sort((p, s) => p.start - s.start), {
559
+ return o.sort((s, p) => s.start - p.start), {
519
560
  format: e,
520
561
  cues: o,
521
- header: l.join(`
562
+ header: i.join(`
522
563
  `).trim() || void 0
523
564
  };
524
565
  }
525
- function ot(t) {
566
+ function it(t) {
526
567
  const e = t.trim();
527
568
  if (!e) return 0;
528
569
  const r = /^(\d+(?:\.\d+)?)(h|m|s|ms|f|t)$/i.exec(e);
@@ -533,7 +574,7 @@ function ot(t) {
533
574
  const n = e.split(":");
534
575
  return n.length === 3 ? Number(n[0]) * 3600 + Number(n[1]) * 60 + Number(n[2]) : n.length === 2 ? Number(n[0]) * 60 + Number(n[1]) : Number(e) || 0;
535
576
  }
536
- function Ue(t) {
577
+ function nr(t) {
537
578
  if (typeof DOMParser > "u")
538
579
  throw new Error("TTML parsing requires a DOMParser environment");
539
580
  const e = new DOMParser().parseFromString(t, "application/xml");
@@ -541,75 +582,75 @@ function Ue(t) {
541
582
  throw new Error("TTML XML parse error");
542
583
  const r = e.getElementsByTagName("p"), n = [];
543
584
  for (let a = 0; a < r.length; a++) {
544
- const o = r[a], l = o.getAttribute("begin") || "", p = o.getAttribute("end") || "", s = o.getAttribute("dur") || "", f = ot(l);
545
- let c;
546
- p ? c = ot(p) : s ? c = f + ot(s) : c = f + 5;
585
+ const o = r[a], i = o.getAttribute("begin") || "", s = o.getAttribute("end") || "", p = o.getAttribute("dur") || "", c = it(i);
586
+ let f;
587
+ s ? f = it(s) : p ? f = c + it(p) : f = c + 5;
547
588
  let d = "";
548
589
  o.childNodes.forEach((u) => {
549
590
  if (u.nodeType === 3)
550
591
  d += u.nodeValue || "";
551
592
  else if (u.nodeType === 1) {
552
- const F = u;
553
- F.tagName.toLowerCase() === "br" ? d += `
554
- ` : d += F.textContent || "";
593
+ const _ = u;
594
+ _.tagName.toLowerCase() === "br" ? d += `
595
+ ` : d += _.textContent || "";
555
596
  }
556
597
  });
557
- const m = d.replace(/[ \t]+/g, " ").replace(/\n /g, `
598
+ const h = d.replace(/[ \t]+/g, " ").replace(/\n /g, `
558
599
  `).trim();
559
- (m || f || c) && n.push({ start: f, end: c, text: m });
600
+ (h || c || f) && n.push({ start: c, end: f, text: h });
560
601
  }
561
602
  return n.sort((a, o) => a.start - o.start), { format: "ttml", cues: n };
562
603
  }
563
- function Yr(t, e) {
564
- switch (e ?? Ve(t)) {
604
+ function bo(t, e) {
605
+ switch (e ?? er(t)) {
565
606
  case "lrc":
566
- return Be(t);
607
+ return rr(t);
567
608
  case "elrc":
568
- return He(t);
609
+ return or(t);
569
610
  case "ass":
570
- return zt(t, "ass");
611
+ return Dt(t, "ass");
571
612
  case "ssa":
572
- return zt(t, "ssa");
613
+ return Dt(t, "ssa");
573
614
  case "ttml":
574
- return Ue(t);
615
+ return nr(t);
575
616
  case "vtt":
576
- return Rt(t, "vtt");
617
+ return Wt(t, "vtt");
577
618
  case "srt":
578
619
  default:
579
- return Rt(t, "srt");
620
+ return Wt(t, "srt");
580
621
  }
581
622
  }
582
- async function Qr(t) {
583
- return Se.loadAsync(t);
623
+ async function go(t) {
624
+ return Ze.loadAsync(t);
584
625
  }
585
- function to(t) {
626
+ function wo(t) {
586
627
  const e = [];
587
628
  return t.forEach((r, n) => {
588
629
  var a;
589
- const o = n.dir, l = o && !r.endsWith("/") ? r + "/" : r, p = o ? l.replace(/\/$/, "") : l, s = p.lastIndexOf("/"), f = s >= 0 ? p.slice(s + 1) : p, c = s >= 0 ? p.slice(0, s) : "", d = o ? 0 : ((a = n._data) == null ? void 0 : a.uncompressedSize) ?? 0;
630
+ const o = n.dir, i = o && !r.endsWith("/") ? r + "/" : r, s = o ? i.replace(/\/$/, "") : i, p = s.lastIndexOf("/"), c = p >= 0 ? s.slice(p + 1) : s, f = p >= 0 ? s.slice(0, p) : "", d = o ? 0 : ((a = n._data) == null ? void 0 : a.uncompressedSize) ?? 0;
590
631
  e.push({
591
- path: l,
592
- name: f,
593
- dir: c,
632
+ path: i,
633
+ name: c,
634
+ dir: f,
594
635
  isDir: o,
595
636
  size: d,
596
637
  date: n.date
597
638
  });
598
639
  }), e;
599
640
  }
600
- function eo(t) {
641
+ function vo(t) {
601
642
  const e = { name: "", path: "", isDir: !0, children: [], size: 0 }, r = /* @__PURE__ */ new Map();
602
643
  r.set("", e);
603
644
  const n = (o) => {
604
645
  if (r.has(o)) return r.get(o);
605
- const l = o.split("/").filter(Boolean);
606
- let p = e, s = "";
607
- for (const f of l) {
608
- s = s ? `${s}/${f}` : f;
609
- let c = r.get(s);
610
- c || (c = { name: f, path: s + "/", isDir: !0, children: [], size: 0 }, p.children.push(c), r.set(s, c)), p = c;
646
+ const i = o.split("/").filter(Boolean);
647
+ let s = e, p = "";
648
+ for (const c of i) {
649
+ p = p ? `${p}/${c}` : c;
650
+ let f = r.get(p);
651
+ f || (f = { name: c, path: p + "/", isDir: !0, children: [], size: 0 }, s.children.push(f), r.set(p, f)), s = f;
611
652
  }
612
- return p;
653
+ return s;
613
654
  };
614
655
  for (const o of t) {
615
656
  if (o.isDir) {
@@ -625,22 +666,22 @@ function eo(t) {
625
666
  }
626
667
  const a = (o) => {
627
668
  if (o.children) {
628
- o.children.sort((l, p) => l.isDir !== p.isDir ? l.isDir ? -1 : 1 : l.name.localeCompare(p.name));
629
- for (const l of o.children) a(l);
669
+ o.children.sort((i, s) => i.isDir !== s.isDir ? i.isDir ? -1 : 1 : i.name.localeCompare(s.name));
670
+ for (const i of o.children) a(i);
630
671
  }
631
672
  };
632
673
  return a(e), e;
633
674
  }
634
- async function ro(t, e, r) {
675
+ async function xo(t, e, r) {
635
676
  const n = t.file(e);
636
677
  if (!n) throw new Error(`ZIP entry not found: ${e}`);
637
678
  const a = await n.async("arraybuffer");
638
679
  return new Blob([a], r ? { type: r } : void 0);
639
680
  }
640
- function Ge(t) {
681
+ function ar(t) {
641
682
  return t ? t.startsWith("#") ? t : t.length === 8 ? "#" + t.substring(2) : t.length === 6 ? "#" + t : "#000000" : "#000000";
642
683
  }
643
- const Xe = [
684
+ const ir = [
644
685
  "FFFFFF",
645
686
  "000000",
646
687
  "E7E6E6",
@@ -651,7 +692,7 @@ const Xe = [
651
692
  "FFC000",
652
693
  "5B9BD5",
653
694
  "70AD47"
654
- ], qe = [
695
+ ], sr = [
655
696
  "000000",
656
697
  "FFFFFF",
657
698
  "FF0000",
@@ -717,48 +758,48 @@ const Xe = [
717
758
  "333399",
718
759
  "333333"
719
760
  ];
720
- function Je(t, e) {
721
- const r = parseInt(t.substring(0, 2), 16), n = parseInt(t.substring(2, 4), 16), a = parseInt(t.substring(4, 6), 16), o = (f) => e < 0 ? Math.round(f * (1 + e)) : Math.round(f + (255 - f) * e), l = Math.min(255, Math.max(0, o(r))), p = Math.min(255, Math.max(0, o(n))), s = Math.min(255, Math.max(0, o(a)));
722
- return l.toString(16).padStart(2, "0") + p.toString(16).padStart(2, "0") + s.toString(16).padStart(2, "0");
761
+ function lr(t, e) {
762
+ const r = parseInt(t.substring(0, 2), 16), n = parseInt(t.substring(2, 4), 16), a = parseInt(t.substring(4, 6), 16), o = (c) => e < 0 ? Math.round(c * (1 + e)) : Math.round(c + (255 - c) * e), i = Math.min(255, Math.max(0, o(r))), s = Math.min(255, Math.max(0, o(n))), p = Math.min(255, Math.max(0, o(a)));
763
+ return i.toString(16).padStart(2, "0") + s.toString(16).padStart(2, "0") + p.toString(16).padStart(2, "0");
723
764
  }
724
- function Ke(t) {
765
+ function pr(t) {
725
766
  if (t && t.type === "pattern" && t.pattern === "solid") {
726
767
  const e = t.fgColor;
727
768
  if (e)
728
- return pt(e);
769
+ return dt(e);
729
770
  }
730
771
  }
731
- function pt(t) {
772
+ function dt(t) {
732
773
  if (t) {
733
774
  if ("argb" in t && typeof t.argb == "string" && t.argb)
734
- return Ge(t.argb);
775
+ return ar(t.argb);
735
776
  if ("theme" in t && typeof t.theme == "number") {
736
- const e = Xe[t.theme] || "000000", r = "tint" in t && typeof t.tint == "number" ? t.tint : 0;
737
- return "#" + (r !== 0 ? Je(e, r) : e);
777
+ const e = ir[t.theme] || "000000", r = "tint" in t && typeof t.tint == "number" ? t.tint : 0;
778
+ return "#" + (r !== 0 ? lr(e, r) : e);
738
779
  }
739
780
  if ("indexed" in t && typeof t.indexed == "number") {
740
- const e = qe[t.indexed];
781
+ const e = sr[t.indexed];
741
782
  if (e) return "#" + e;
742
783
  }
743
784
  }
744
785
  }
745
- function Ye(t) {
786
+ function cr(t) {
746
787
  if (!t || !t.style) return;
747
- const e = pt(t.color) || "#000000";
788
+ const e = dt(t.color) || "#000000";
748
789
  return [t.style, e];
749
790
  }
750
- function Qe(t) {
791
+ function fr(t) {
751
792
  const e = {};
752
793
  let r = !1;
753
794
  if (t.font) {
754
795
  const a = t.font;
755
796
  if ((a.name || a.size || a.bold || a.italic) && (r = !0, e.font = {}, a.name && (e.font.name = a.name), a.size && (e.font.size = a.size), a.bold && (e.font.bold = !0), a.italic && (e.font.italic = !0)), a.color) {
756
- const o = pt(a.color);
797
+ const o = dt(a.color);
757
798
  o && (r = !0, e.color = o);
758
799
  }
759
800
  a.underline && (r = !0, e.underline = !0), a.strike && (r = !0, e.strike = !0);
760
801
  }
761
- const n = Ke(t.fill);
802
+ const n = pr(t.fill);
762
803
  if (n && (r = !0, e.bgcolor = n), t.alignment) {
763
804
  const a = t.alignment;
764
805
  a.horizontal && (r = !0, e.align = a.horizontal), a.vertical && (r = !0, e.valign = a.vertical), a.wrapText && (r = !0, e.textwrap = !0);
@@ -766,27 +807,27 @@ function Qe(t) {
766
807
  if (t.border) {
767
808
  const a = {};
768
809
  let o = !1;
769
- const l = ["top", "bottom", "left", "right"];
770
- for (const p of l) {
771
- const s = Ye(t.border[p]);
772
- s && (a[p] = s, o = !0);
810
+ const i = ["top", "bottom", "left", "right"];
811
+ for (const s of i) {
812
+ const p = cr(t.border[s]);
813
+ p && (a[s] = p, o = !0);
773
814
  }
774
815
  o && (r = !0, e.border = a);
775
816
  }
776
817
  return r ? e : null;
777
818
  }
778
- function tr(t) {
819
+ function dr(t) {
779
820
  return JSON.stringify(t);
780
821
  }
781
- function er(t, e, r) {
782
- const n = Qe(t);
822
+ function ur(t, e, r) {
823
+ const n = fr(t);
783
824
  if (!n) return -1;
784
- const a = tr(n), o = r.get(a);
825
+ const a = dr(n), o = r.get(a);
785
826
  if (o !== void 0) return o;
786
- const l = e.length;
787
- return e.push(n), r.set(a, l), l;
827
+ const i = e.length;
828
+ return e.push(n), r.set(a, i), i;
788
829
  }
789
- function rr(t) {
830
+ function mr(t) {
790
831
  const e = t.value;
791
832
  if (e == null) return "";
792
833
  if (typeof e == "string") return e;
@@ -800,8 +841,8 @@ function rr(t) {
800
841
  }
801
842
  return typeof e == "object" && "richText" in e ? e.richText.map((r) => r.text).join("") : typeof e == "object" && "hyperlink" in e ? e.text || "" : typeof e == "object" && "error" in e ? String(e.error) : String(e);
802
843
  }
803
- function or(t) {
804
- const e = t.split(":"), r = Et(e[0]), n = e[1] ? Et(e[1]) : r;
844
+ function hr(t) {
845
+ const e = t.split(":"), r = Ot(e[0]), n = e[1] ? Ot(e[1]) : r;
805
846
  return {
806
847
  top: r.row,
807
848
  left: r.col,
@@ -809,7 +850,7 @@ function or(t) {
809
850
  right: n.col
810
851
  };
811
852
  }
812
- function Et(t) {
853
+ function Ot(t) {
813
854
  const e = t.match(/^([A-Z]+)(\d+)$/);
814
855
  if (!e) return { row: 1, col: 1 };
815
856
  const r = e[1], n = parseInt(e[2], 10);
@@ -818,59 +859,59 @@ function Et(t) {
818
859
  a = a * 26 + (r.charCodeAt(o) - 64);
819
860
  return { row: n, col: a };
820
861
  }
821
- function oo(t) {
862
+ function yo(t) {
822
863
  const e = [];
823
864
  return t.eachSheet((r) => {
824
- const n = [], a = /* @__PURE__ */ new Map(), o = [], l = {}, p = {}, s = r.columnCount;
825
- for (let m = 1; m <= s; m++) {
826
- const u = r.getColumn(m);
827
- u.width && (p[String(m - 1)] = { width: Math.round(u.width * 7.5) });
865
+ const n = [], a = /* @__PURE__ */ new Map(), o = [], i = {}, s = {}, p = r.columnCount;
866
+ for (let h = 1; h <= p; h++) {
867
+ const u = r.getColumn(h);
868
+ u.width && (s[String(h - 1)] = { width: Math.round(u.width * 7.5) });
828
869
  }
829
- p.len = Math.max(s, 26);
830
- const f = /* @__PURE__ */ new Map(), c = r.model, d = (c == null ? void 0 : c.merges) || [];
831
- for (const m of d) {
832
- o.push(m);
833
- const { top: u, left: F, bottom: x, right: y } = or(m), b = x - u, M = y - F;
834
- f.set(`${u - 1},${F - 1}`, [b, M]);
870
+ s.len = Math.max(p, 26);
871
+ const c = /* @__PURE__ */ new Map(), f = r.model, d = (f == null ? void 0 : f.merges) || [];
872
+ for (const h of d) {
873
+ o.push(h);
874
+ const { top: u, left: _, bottom: M, right: v } = hr(h), F = M - u, T = v - _;
875
+ c.set(`${u - 1},${_ - 1}`, [F, T]);
835
876
  }
836
- r.eachRow({ includeEmpty: !0 }, (m, u) => {
837
- const F = u - 1, x = {};
838
- m.eachCell({ includeEmpty: !1 }, (b, M) => {
839
- const P = M - 1;
840
- if (b.isMerged && b.master !== b) return;
841
- const I = rr(b), z = er(b, n, a), E = { text: I };
842
- z !== -1 && (E.style = z);
843
- const S = `${F},${P}`;
844
- f.has(S) && (E.merge = f.get(S)), x[String(P)] = E;
877
+ r.eachRow({ includeEmpty: !0 }, (h, u) => {
878
+ const _ = u - 1, M = {};
879
+ h.eachCell({ includeEmpty: !1 }, (F, T) => {
880
+ const k = T - 1;
881
+ if (F.isMerged && F.master !== F) return;
882
+ const R = mr(F), x = ur(F, n, a), S = { text: R };
883
+ x !== -1 && (S.style = x);
884
+ const W = `${_},${k}`;
885
+ c.has(W) && (S.merge = c.get(W)), M[String(k)] = S;
845
886
  });
846
- const y = { cells: x };
847
- m.height && (y.height = Math.round(m.height * 1.333)), l[String(F)] = y;
887
+ const v = { cells: M };
888
+ h.height && (v.height = Math.round(h.height * 1.333)), i[String(_)] = v;
848
889
  }), e.push({
849
890
  name: r.name,
850
891
  styles: n,
851
892
  merges: o,
852
- rows: l,
853
- cols: p
893
+ rows: i,
894
+ cols: s
854
895
  });
855
896
  }), e;
856
897
  }
857
- function no(t, e, r = "Sheet1") {
898
+ function Fo(t, e, r = "Sheet1") {
858
899
  const n = t.length > 0, a = n ? [{ font: { bold: !0 } }] : [], o = {};
859
900
  if (n) {
860
- const p = {};
861
- t.forEach((s, f) => {
862
- p[String(f)] = { text: s, style: 0 };
863
- }), o[0] = { cells: p };
901
+ const s = {};
902
+ t.forEach((p, c) => {
903
+ s[String(c)] = { text: p, style: 0 };
904
+ }), o[0] = { cells: s };
864
905
  }
865
- const l = n ? 1 : 0;
866
- return e.forEach((p, s) => {
867
- const f = {};
868
- p.forEach((c, d) => {
869
- c !== void 0 && c !== "" && (f[String(d)] = { text: c });
870
- }), o[String(s + l)] = { cells: f };
906
+ const i = n ? 1 : 0;
907
+ return e.forEach((s, p) => {
908
+ const c = {};
909
+ s.forEach((f, d) => {
910
+ f !== void 0 && f !== "" && (c[String(d)] = { text: f });
911
+ }), o[String(p + i)] = { cells: c };
871
912
  }), [{ name: r, styles: a, rows: o }];
872
913
  }
873
- const nr = {
914
+ const br = {
874
915
  // ─────── common ───────
875
916
  "common.download": "下载",
876
917
  "common.close": "关闭",
@@ -969,7 +1010,7 @@ const nr = {
969
1010
  "zip.parse_failed": "ZIP 解析失败",
970
1011
  // ─────── text ───────
971
1012
  "text.load_failed": "文本文件加载失败"
972
- }, ar = {
1013
+ }, gr = {
973
1014
  // ─────── common ───────
974
1015
  "common.download": "Download",
975
1016
  "common.close": "Close",
@@ -1068,52 +1109,52 @@ const nr = {
1068
1109
  "zip.parse_failed": "Failed to parse ZIP",
1069
1110
  // ─────── text ───────
1070
1111
  "text.load_failed": "Failed to load text file"
1071
- }, K = {
1072
- "zh-CN": nr,
1073
- "en-US": ar
1074
- }, ir = /\{(\w+)\}/g;
1075
- function sr(t, e) {
1076
- return e ? t.replace(ir, (r, n) => {
1112
+ }, tt = {
1113
+ "zh-CN": br,
1114
+ "en-US": gr
1115
+ }, wr = /\{(\w+)\}/g;
1116
+ function vr(t, e) {
1117
+ return e ? t.replace(wr, (r, n) => {
1077
1118
  const a = e[n];
1078
1119
  return a === void 0 ? `{${n}}` : String(a);
1079
1120
  }) : t;
1080
1121
  }
1081
- function ft(t) {
1122
+ function ut(t) {
1082
1123
  var e;
1083
- const r = t.fallbackLocale ?? "zh-CN", n = K[t.locale] ?? K[r] ?? K["zh-CN"], a = (e = t.messages) == null ? void 0 : e[t.locale], o = a ? { ...n, ...a } : n, l = K["zh-CN"];
1084
- return (p, s) => {
1085
- const f = o[p] ?? l[p] ?? p;
1086
- return sr(f, s);
1124
+ const r = t.fallbackLocale ?? "zh-CN", n = tt[t.locale] ?? tt[r] ?? tt["zh-CN"], a = (e = t.messages) == null ? void 0 : e[t.locale], o = a ? { ...n, ...a } : n, i = tt["zh-CN"];
1125
+ return (s, p) => {
1126
+ const c = o[s] ?? i[s] ?? s;
1127
+ return vr(c, p);
1087
1128
  };
1088
1129
  }
1089
- const ct = jt(null), lr = ({
1130
+ const mt = pt(null), xr = ({
1090
1131
  locale: t = "zh-CN",
1091
1132
  messages: e,
1092
1133
  children: r
1093
1134
  }) => {
1094
- const n = G(() => {
1095
- const a = ft({ locale: t, messages: e });
1135
+ const n = B(() => {
1136
+ const a = ut({ locale: t, messages: e });
1096
1137
  return { locale: t, t: a };
1097
1138
  }, [t, e]);
1098
- return /* @__PURE__ */ i(ct.Provider, { value: n, children: r });
1139
+ return /* @__PURE__ */ l(mt.Provider, { value: n, children: r });
1099
1140
  };
1100
- let nt = null;
1101
- function pr() {
1102
- return nt || (nt = ft({ locale: "zh-CN" })), nt;
1141
+ let st = null;
1142
+ function yr() {
1143
+ return st || (st = ut({ locale: "zh-CN" })), st;
1103
1144
  }
1104
- function Ht() {
1105
- const t = it(ct);
1106
- return (t == null ? void 0 : t.t) ?? pr();
1145
+ function Kt() {
1146
+ const t = J(mt);
1147
+ return (t == null ? void 0 : t.t) ?? yr();
1107
1148
  }
1108
- function ao() {
1109
- const t = it(ct);
1149
+ function _o() {
1150
+ const t = J(mt);
1110
1151
  return (t == null ? void 0 : t.locale) ?? "zh-CN";
1111
1152
  }
1112
- const Ut = jt(null), fr = ({ theme: t, children: e }) => /* @__PURE__ */ i(Ut.Provider, { value: t, children: e });
1113
- function io() {
1114
- return it(Ut) ?? "dark";
1153
+ const Yt = pt(null), Fr = ({ theme: t, children: e }) => /* @__PURE__ */ l(Yt.Provider, { value: t, children: e });
1154
+ function ko() {
1155
+ return J(Yt) ?? "dark";
1115
1156
  }
1116
- const cr = ({ className: t }) => /* @__PURE__ */ i(
1157
+ const _r = ({ className: t }) => /* @__PURE__ */ l(
1117
1158
  "svg",
1118
1159
  {
1119
1160
  xmlns: "http://www.w3.org/2000/svg",
@@ -1124,58 +1165,58 @@ const cr = ({ className: t }) => /* @__PURE__ */ i(
1124
1165
  strokeLinecap: "round",
1125
1166
  strokeLinejoin: "round",
1126
1167
  className: t,
1127
- children: /* @__PURE__ */ i("text", { x: "12", y: "17.5", textAnchor: "middle", fontSize: "20", fontWeight: "bold", fill: "currentColor", stroke: "none", children: "1:1" })
1168
+ children: /* @__PURE__ */ l("text", { x: "12", y: "17.5", textAnchor: "middle", fontSize: "20", fontWeight: "bold", fill: "currentColor", stroke: "none", children: "1:1" })
1128
1169
  }
1129
1170
  );
1130
- function dr(t) {
1171
+ function kr(t) {
1131
1172
  return [
1132
1173
  {
1133
1174
  items: [
1134
- { type: "button", icon: /* @__PURE__ */ i(Wt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
1175
+ { type: "button", icon: /* @__PURE__ */ l(At, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
1135
1176
  { type: "text", content: `${Math.round(t.zoom * 100)}%`, minWidth: "3rem" },
1136
- { type: "button", icon: /* @__PURE__ */ i(Lt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
1177
+ { type: "button", icon: /* @__PURE__ */ l(Ut, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
1137
1178
  ]
1138
1179
  },
1139
1180
  {
1140
1181
  items: [
1141
- { type: "button", icon: /* @__PURE__ */ i(Me, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.fit_to_window"), action: t.onFitToWidth },
1142
- { type: "button", icon: /* @__PURE__ */ i(cr, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.original_size"), action: t.onOriginalSize }
1182
+ { type: "button", icon: /* @__PURE__ */ l(Se, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.fit_to_window"), action: t.onFitToWidth },
1183
+ { type: "button", icon: /* @__PURE__ */ l(_r, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.original_size"), action: t.onOriginalSize }
1143
1184
  ]
1144
1185
  },
1145
1186
  {
1146
1187
  items: [
1147
- { type: "button", icon: /* @__PURE__ */ i(Te, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_left"), action: t.onRotateLeft },
1148
- { type: "button", icon: /* @__PURE__ */ i(Re, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_right"), action: t.onRotateRight }
1188
+ { type: "button", icon: /* @__PURE__ */ l(Le, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_left"), action: t.onRotateLeft },
1189
+ { type: "button", icon: /* @__PURE__ */ l(We, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_right"), action: t.onRotateRight }
1149
1190
  ]
1150
1191
  },
1151
1192
  {
1152
1193
  items: [
1153
- { type: "button", icon: /* @__PURE__ */ i($t, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
1194
+ { type: "button", icon: /* @__PURE__ */ l(It, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
1154
1195
  ]
1155
1196
  }
1156
1197
  ];
1157
1198
  }
1158
- function ur(t) {
1199
+ function Cr(t) {
1159
1200
  return [
1160
1201
  {
1161
1202
  items: [
1162
- { type: "button", icon: /* @__PURE__ */ i(Wt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
1203
+ { type: "button", icon: /* @__PURE__ */ l(At, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
1163
1204
  { type: "text", content: `${Math.round(t.zoom * 100)}%`, minWidth: "3rem" },
1164
- { type: "button", icon: /* @__PURE__ */ i(Lt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
1205
+ { type: "button", icon: /* @__PURE__ */ l(Ut, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
1165
1206
  ]
1166
1207
  },
1167
1208
  {
1168
1209
  items: [
1169
- { type: "button", icon: /* @__PURE__ */ i($t, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
1210
+ { type: "button", icon: /* @__PURE__ */ l(It, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
1170
1211
  ]
1171
1212
  }
1172
1213
  ];
1173
1214
  }
1174
- function mr(t) {
1215
+ function Nr(t) {
1175
1216
  return [
1176
1217
  {
1177
1218
  items: [
1178
- { type: "button", icon: /* @__PURE__ */ i(Dt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.toc"), action: () => {
1219
+ { type: "button", icon: /* @__PURE__ */ l(Ht, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.toc"), action: () => {
1179
1220
  var e;
1180
1221
  return (e = t.epubRef.current) == null ? void 0 : e.toggleToc();
1181
1222
  } }
@@ -1183,12 +1224,12 @@ function mr(t) {
1183
1224
  },
1184
1225
  {
1185
1226
  items: [
1186
- { type: "button", icon: /* @__PURE__ */ i(st, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.prev_page"), action: () => {
1227
+ { type: "button", icon: /* @__PURE__ */ l(ct, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.prev_page"), action: () => {
1187
1228
  var e;
1188
1229
  return (e = t.epubRef.current) == null ? void 0 : e.prevPage();
1189
1230
  } },
1190
1231
  { type: "text", content: `${t.current} / ${t.total}`, minWidth: "4rem" },
1191
- { type: "button", icon: /* @__PURE__ */ i(lt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.next_page"), action: () => {
1232
+ { type: "button", icon: /* @__PURE__ */ l(ft, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.next_page"), action: () => {
1192
1233
  var e;
1193
1234
  return (e = t.epubRef.current) == null ? void 0 : e.nextPage();
1194
1235
  } }
@@ -1198,7 +1239,7 @@ function mr(t) {
1198
1239
  items: [
1199
1240
  {
1200
1241
  type: "button",
1201
- icon: t.fullWidth ? /* @__PURE__ */ i(Zt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ i(At, { className: "rfp-w-4 rfp-h-4" }),
1242
+ icon: t.fullWidth ? /* @__PURE__ */ l(Vt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ l(Bt, { className: "rfp-w-4 rfp-h-4" }),
1202
1243
  tooltip: t.fullWidth ? t.t("toolbar.normal_width") : t.t("toolbar.full_width"),
1203
1244
  action: () => {
1204
1245
  var e;
@@ -1209,13 +1250,13 @@ function mr(t) {
1209
1250
  }
1210
1251
  ];
1211
1252
  }
1212
- function hr(t) {
1253
+ function Rr(t) {
1213
1254
  return [
1214
1255
  {
1215
1256
  items: [
1216
1257
  {
1217
1258
  type: "button",
1218
- icon: /* @__PURE__ */ i(Dt, { className: "rfp-w-4 rfp-h-4" }),
1259
+ icon: /* @__PURE__ */ l(Ht, { className: "rfp-w-4 rfp-h-4" }),
1219
1260
  tooltip: t.t("toolbar.toc"),
1220
1261
  action: () => {
1221
1262
  var e;
@@ -1228,7 +1269,7 @@ function hr(t) {
1228
1269
  items: [
1229
1270
  {
1230
1271
  type: "button",
1231
- icon: /* @__PURE__ */ i(st, { className: "rfp-w-4 rfp-h-4" }),
1272
+ icon: /* @__PURE__ */ l(ct, { className: "rfp-w-4 rfp-h-4" }),
1232
1273
  tooltip: t.t("toolbar.prev_page"),
1233
1274
  action: () => {
1234
1275
  var e;
@@ -1242,7 +1283,7 @@ function hr(t) {
1242
1283
  },
1243
1284
  {
1244
1285
  type: "button",
1245
- icon: /* @__PURE__ */ i(lt, { className: "rfp-w-4 rfp-h-4" }),
1286
+ icon: /* @__PURE__ */ l(ft, { className: "rfp-w-4 rfp-h-4" }),
1246
1287
  tooltip: t.t("toolbar.next_page"),
1247
1288
  action: () => {
1248
1289
  var e;
@@ -1255,7 +1296,7 @@ function hr(t) {
1255
1296
  items: [
1256
1297
  {
1257
1298
  type: "button",
1258
- icon: t.fullWidth ? /* @__PURE__ */ i(Zt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ i(At, { className: "rfp-w-4 rfp-h-4" }),
1299
+ icon: t.fullWidth ? /* @__PURE__ */ l(Vt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ l(Bt, { className: "rfp-w-4 rfp-h-4" }),
1259
1300
  tooltip: t.fullWidth ? t.t("toolbar.normal_width") : t.t("toolbar.full_width"),
1260
1301
  action: () => {
1261
1302
  var e;
@@ -1266,26 +1307,26 @@ function hr(t) {
1266
1307
  }
1267
1308
  ];
1268
1309
  }
1269
- function gr({ stats: t }) {
1310
+ function Mr({ stats: t }) {
1270
1311
  return t ? [
1271
1312
  {
1272
1313
  items: [
1273
1314
  {
1274
1315
  type: "text",
1275
- content: `${t.files} files · ${t.dirs} dirs · ${Ae(t.size)}`,
1316
+ content: `${t.files} files · ${t.dirs} dirs · ${qe(t.size)}`,
1276
1317
  minWidth: "10rem"
1277
1318
  }
1278
1319
  ]
1279
1320
  }
1280
1321
  ] : [];
1281
1322
  }
1282
- function br(t) {
1323
+ function Tr(t) {
1283
1324
  const e = [
1284
1325
  {
1285
1326
  items: [
1286
1327
  {
1287
1328
  type: "button",
1288
- icon: /* @__PURE__ */ i(Pe, { className: "rfp-w-4 rfp-h-4" }),
1329
+ icon: /* @__PURE__ */ l($e, { className: "rfp-w-4 rfp-h-4" }),
1289
1330
  tooltip: t.wordWrap ? t.t("toolbar.wrap_off") : t.t("toolbar.wrap_on"),
1290
1331
  action: t.onToggleWrap
1291
1332
  }
@@ -1296,20 +1337,20 @@ function br(t) {
1296
1337
  items: [
1297
1338
  {
1298
1339
  type: "button",
1299
- icon: t.htmlPreview ? /* @__PURE__ */ i(Ot, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ i(It, { className: "rfp-w-4 rfp-h-4" }),
1340
+ icon: t.htmlPreview ? /* @__PURE__ */ l(qt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ l(Gt, { className: "rfp-w-4 rfp-h-4" }),
1300
1341
  tooltip: t.htmlPreview ? t.t("toolbar.source") : t.t("toolbar.preview"),
1301
1342
  action: t.onToggleHtmlPreview
1302
1343
  }
1303
1344
  ]
1304
1345
  }), e;
1305
1346
  }
1306
- function wr(t) {
1347
+ function Pr(t) {
1307
1348
  return [
1308
1349
  {
1309
1350
  items: [
1310
1351
  {
1311
1352
  type: "button",
1312
- icon: t.viewMode === "preview" ? /* @__PURE__ */ i(Ot, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ i(It, { className: "rfp-w-4 rfp-h-4" }),
1353
+ icon: t.viewMode === "preview" ? /* @__PURE__ */ l(qt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ l(Gt, { className: "rfp-w-4 rfp-h-4" }),
1313
1354
  tooltip: t.viewMode === "preview" ? t.t("toolbar.source") : t.t("toolbar.preview"),
1314
1355
  action: t.onToggleViewMode
1315
1356
  }
@@ -1317,270 +1358,343 @@ function wr(t) {
1317
1358
  }
1318
1359
  ];
1319
1360
  }
1320
- const xr = k(
1321
- () => import("./index-DinKO2op.mjs").then((t) => ({ default: t.ImageRenderer }))
1322
- ), vr = k(
1323
- () => import("./index-w0tt7Myw.mjs").then((t) => ({ default: t.PdfRenderer }))
1324
- ), yr = k(
1325
- () => import("./index-zDEwNk3h.mjs").then((t) => ({ default: t.DocxRenderer }))
1326
- ), Fr = k(
1327
- () => import("./index-BsSx9pGx.mjs").then((t) => ({ default: t.XlsxRenderer }))
1328
- ), _r = k(
1329
- () => import("./index-BWbuffRN.mjs").then((t) => ({ default: t.PptxRenderer }))
1330
- ), kr = k(
1331
- () => import("./index-BOEtlHD3.mjs").then((t) => ({ default: t.MsgRenderer }))
1332
- ), Cr = k(
1333
- () => import("./index-DTH1IvOG.mjs").then((t) => ({ default: t.EpubRenderer }))
1334
- ), Nr = k(
1335
- () => import("./index-Yp36heK8.mjs").then((t) => ({ default: t.MobiRenderer }))
1336
- ), Mr = k(
1337
- () => import("./index-DOMMMe9f.mjs").then((t) => ({ default: t.VideoRenderer }))
1338
- ), Tr = k(
1339
- () => import("./index-BEolw_uv.mjs").then((t) => ({ default: t.AudioRenderer }))
1340
- ), Rr = k(
1341
- () => import("./index-qxvk-6P6.mjs").then((t) => ({ default: t.MarkdownRenderer }))
1342
- ), Pr = k(
1343
- () => import("./index-BIg3vHQf.mjs").then((t) => ({ default: t.JsonRenderer }))
1344
- ), zr = k(
1345
- () => import("./index-D_8IHm6o.mjs").then((t) => ({ default: t.CsvRenderer }))
1346
- ), Er = k(
1347
- () => import("./index-B5tBeF0g.mjs").then((t) => ({ default: t.XmlRenderer }))
1348
- ), Sr = k(
1349
- () => import("./index-CQABwGVP.mjs").then((t) => ({ default: t.SubtitleRenderer }))
1350
- ), jr = k(
1351
- () => import("./index--zZy1XpK.mjs").then((t) => ({ default: t.ZipRenderer }))
1352
- ), Wr = k(
1353
- () => import("./index-xTq9b3vw.mjs").then((t) => ({ default: t.TextRenderer }))
1354
- ), St = ({
1361
+ const zr = {
1362
+ fetcher: (t, e) => fetch(t, e)
1363
+ }, ht = pt(zr), Er = ({
1364
+ requestInit: t,
1365
+ requestHandler: e,
1366
+ shouldFetchAsBlob: r,
1367
+ children: n
1368
+ }) => {
1369
+ const a = B(
1370
+ () => ({
1371
+ fetcher: Ke({ requestInit: t, requestHandler: e }),
1372
+ shouldFetchAsBlob: r
1373
+ }),
1374
+ [t, e, r]
1375
+ );
1376
+ return /* @__PURE__ */ l(ht.Provider, { value: a, children: n });
1377
+ };
1378
+ function jr() {
1379
+ return J(ht).fetcher;
1380
+ }
1381
+ function Sr(t) {
1382
+ const { fetcher: e, shouldFetchAsBlob: r } = J(ht), n = !!(t && (r != null && r(t))), [a, o] = y(
1383
+ () => t ? n ? "" : t.url : ""
1384
+ ), i = V(null);
1385
+ return L(() => {
1386
+ if (!t) {
1387
+ o("");
1388
+ return;
1389
+ }
1390
+ if (!n) {
1391
+ o(t.url);
1392
+ return;
1393
+ }
1394
+ let s = !1;
1395
+ return o(""), Ye(t.url, e).then((p) => {
1396
+ if (s) {
1397
+ URL.revokeObjectURL(p);
1398
+ return;
1399
+ }
1400
+ i.current && URL.revokeObjectURL(i.current), i.current = p, o(p);
1401
+ }).catch((p) => {
1402
+ s || (console.error("[file-preview] resolve blob url failed:", p), o(t.url));
1403
+ }), () => {
1404
+ s = !0;
1405
+ };
1406
+ }, [t == null ? void 0 : t.id, t == null ? void 0 : t.url, n, e]), L(() => () => {
1407
+ i.current && (URL.revokeObjectURL(i.current), i.current = null);
1408
+ }, []), a;
1409
+ }
1410
+ const Lr = N(
1411
+ () => import("./index-D8GtNeDn.mjs").then((t) => ({ default: t.ImageRenderer }))
1412
+ ), Wr = N(
1413
+ () => import("./index-DmepcY31.mjs").then((t) => ({ default: t.PdfRenderer }))
1414
+ ), $r = N(
1415
+ () => import("./index-BNUiNUWa.mjs").then((t) => ({ default: t.DocxRenderer }))
1416
+ ), Dr = N(
1417
+ () => import("./index-r3q2xCCI.mjs").then((t) => ({ default: t.XlsxRenderer }))
1418
+ ), Or = N(
1419
+ () => import("./index-BqEuP_8r.mjs").then((t) => ({ default: t.PptxRenderer }))
1420
+ ), Zr = N(
1421
+ () => import("./index-CgV8T0G5.mjs").then((t) => ({ default: t.MsgRenderer }))
1422
+ ), Ar = N(
1423
+ () => import("./index-BSD3w5eG.mjs").then((t) => ({ default: t.EpubRenderer }))
1424
+ ), Ur = N(
1425
+ () => import("./index-DV5Jd7Qe.mjs").then((t) => ({ default: t.MobiRenderer }))
1426
+ ), Ir = N(
1427
+ () => import("./index-BGeyzo6u.mjs").then((t) => ({ default: t.VideoRenderer }))
1428
+ ), Hr = N(
1429
+ () => import("./index-zEVVgWCH.mjs").then((t) => ({ default: t.AudioRenderer }))
1430
+ ), Vr = N(
1431
+ () => import("./index-DdOEWhrk.mjs").then((t) => ({ default: t.MarkdownRenderer }))
1432
+ ), Br = N(
1433
+ () => import("./index-B-H9HQiI.mjs").then((t) => ({ default: t.JsonRenderer }))
1434
+ ), qr = N(
1435
+ () => import("./index-BcBe6KW7.mjs").then((t) => ({ default: t.CsvRenderer }))
1436
+ ), Gr = N(
1437
+ () => import("./index-BdYkTSTt.mjs").then((t) => ({ default: t.XmlRenderer }))
1438
+ ), Xr = N(
1439
+ () => import("./index-DGuiWJr7.mjs").then((t) => ({ default: t.SubtitleRenderer }))
1440
+ ), Jr = N(
1441
+ () => import("./index-U3w45GW8.mjs").then((t) => ({ default: t.ZipRenderer }))
1442
+ ), Kr = N(
1443
+ () => import("./index-CKirCT35.mjs").then((t) => ({ default: t.TextRenderer }))
1444
+ ), Zt = ({
1355
1445
  fileName: t,
1356
1446
  fileType: e,
1357
1447
  onDownload: r
1358
1448
  }) => {
1359
- const n = Ht();
1360
- return /* @__PURE__ */ N("div", { className: "rfp-flex rfp-flex-col rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-p-8 rfp-gap-6", children: [
1361
- /* @__PURE__ */ i("div", { className: "rfp-w-32 rfp-h-32 rfp-rounded-full rfp-bg-surface-2 rfp-flex rfp-items-center rfp-justify-center", children: /* @__PURE__ */ i(ze, { className: "rfp-w-16 rfp-h-16 rfp-text-fg-secondary" }) }),
1362
- /* @__PURE__ */ N("div", { className: "rfp-text-fg-primary rfp-text-center", children: [
1363
- /* @__PURE__ */ i("p", { className: "rfp-text-xl rfp-font-medium rfp-mb-2", children: t }),
1364
- /* @__PURE__ */ i("p", { className: "rfp-text-fg-secondary", children: n("common.unsupported_preview", { type: e }) })
1449
+ const n = Kt();
1450
+ return /* @__PURE__ */ z("div", { className: "rfp-flex rfp-flex-col rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-p-8 rfp-gap-6", children: [
1451
+ /* @__PURE__ */ l("div", { className: "rfp-w-32 rfp-h-32 rfp-rounded-full rfp-bg-surface-2 rfp-flex rfp-items-center rfp-justify-center", children: /* @__PURE__ */ l(De, { className: "rfp-w-16 rfp-h-16 rfp-text-fg-secondary" }) }),
1452
+ /* @__PURE__ */ z("div", { className: "rfp-text-fg-primary rfp-text-center", children: [
1453
+ /* @__PURE__ */ l("p", { className: "rfp-text-xl rfp-font-medium rfp-mb-2", children: t }),
1454
+ /* @__PURE__ */ l("p", { className: "rfp-text-fg-secondary", children: n("common.unsupported_preview", { type: e }) })
1365
1455
  ] }),
1366
- /* @__PURE__ */ N(
1456
+ /* @__PURE__ */ z(
1367
1457
  "button",
1368
1458
  {
1369
1459
  onClick: r,
1370
1460
  className: "rfp-flex rfp-items-center rfp-gap-2 rfp-px-6 rfp-py-3 rfp-bg-surface-2 hover:rfp-bg-surface-3 rfp-backdrop-blur-sm rfp-rounded-lg rfp-text-fg-primary rfp-font-medium rfp-transition-all",
1371
1461
  children: [
1372
- /* @__PURE__ */ i(Vt, { className: "rfp-w-5 rfp-h-5" }),
1462
+ /* @__PURE__ */ l(Xt, { className: "rfp-w-5 rfp-h-5" }),
1373
1463
  n("common.download")
1374
1464
  ]
1375
1465
  }
1376
1466
  )
1377
1467
  ] });
1378
- }, Lr = () => {
1379
- const t = Ht();
1380
- return /* @__PURE__ */ i("div", { className: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-text-fg-muted", children: /* @__PURE__ */ N("div", { className: "rfp-flex rfp-flex-col rfp-items-center rfp-gap-3", children: [
1381
- /* @__PURE__ */ i("div", { className: "rfp-w-8 rfp-h-8 rfp-rounded-full rfp-border-2 rfp-border-fg-muted rfp-border-t-transparent rfp-animate-spin" }),
1382
- /* @__PURE__ */ i("span", { className: "rfp-text-sm", children: t("common.loading") ?? "Loading..." })
1468
+ }, Yr = () => {
1469
+ const t = Kt();
1470
+ return /* @__PURE__ */ l("div", { className: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-text-fg-muted", children: /* @__PURE__ */ z("div", { className: "rfp-flex rfp-flex-col rfp-items-center rfp-gap-3", children: [
1471
+ /* @__PURE__ */ l("div", { className: "rfp-w-8 rfp-h-8 rfp-rounded-full rfp-border-2 rfp-border-fg-muted rfp-border-t-transparent rfp-animate-spin" }),
1472
+ /* @__PURE__ */ l("span", { className: "rfp-text-sm", children: t("common.loading") ?? "Loading..." })
1383
1473
  ] }) });
1384
- }, $r = 3, dt = ({
1474
+ }, Qr = 3, bt = (t) => {
1475
+ const { requestInit: e, requestHandler: r, shouldFetchAsBlob: n } = t;
1476
+ return /* @__PURE__ */ l(
1477
+ Er,
1478
+ {
1479
+ requestInit: e,
1480
+ requestHandler: r,
1481
+ shouldFetchAsBlob: n,
1482
+ children: /* @__PURE__ */ l(to, { ...t })
1483
+ }
1484
+ );
1485
+ }, to = ({
1385
1486
  files: t,
1386
1487
  currentIndex: e,
1387
1488
  onNavigate: r,
1388
1489
  customRenderers: n = [],
1389
1490
  mode: a = "modal",
1390
1491
  onClose: o,
1391
- zipNestingDepth: l = 0,
1392
- locale: p = "zh-CN",
1393
- messages: s,
1394
- headless: f = !1,
1395
- theme: c = "dark",
1396
- onCustomEvent: d
1492
+ zipNestingDepth: i = 0,
1493
+ locale: s = "zh-CN",
1494
+ messages: p,
1495
+ headless: c = !1,
1496
+ theme: f = "dark",
1497
+ onCustomEvent: d,
1498
+ onDownload: h,
1499
+ // 以下三项已由外层 RequestProvider 消费,Inner 内不再直接使用
1500
+ requestInit: u,
1501
+ requestHandler: _,
1502
+ shouldFetchAsBlob: M
1397
1503
  }) => {
1398
- const m = G(
1399
- () => ft({ locale: p, messages: s }),
1400
- [p, s]
1401
- ), [u, F] = _(
1504
+ const v = B(
1505
+ () => ut({ locale: s, messages: p }),
1506
+ [s, p]
1507
+ ), [F, T] = y(
1402
1508
  () => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
1403
1509
  );
1404
- W(() => {
1405
- if (c !== "auto") return;
1406
- const h = window.matchMedia("(prefers-color-scheme: dark)"), v = (T) => F(T.matches);
1407
- return h.addEventListener("change", v), () => h.removeEventListener("change", v);
1408
- }, [c]);
1409
- const x = c === "auto" ? u ? "dark" : "light" : c, [y, b] = _(1), [M, P] = _(0), [I, z] = _(1), [, E] = _(1), [S, Q] = _(0), [Z, ut] = _(0), [Gt, tt] = _(0), L = H(null), mt = H(null), ht = H(null), [Xt, qt] = _(0), [Jt, Kt] = _(0), [Yt, Qt] = _(!1), gt = H(null), [te, ee] = _(0), [re, oe] = _(0), [ne, ae] = _(!1), [ie, se] = _(null), [bt, le] = _(!0), [wt, pe] = _(!1), [xt, fe] = _("preview"), [A, V] = _(!0), $ = H(null), ce = 2e3, X = C(() => {
1410
- V(!0), $.current && clearTimeout($.current), $.current = window.setTimeout(() => {
1411
- V(!1);
1412
- }, ce);
1413
- }, []), de = C(() => {
1414
- X();
1415
- }, [X]), j = G(() => De(t), [t]), g = j[e], O = G(() => g ? n.find((h) => h.test(g)) : null, [g, n]), w = g ? Ze(g) : "unsupported", vt = C(
1416
- (h, v) => {
1417
- g && (d == null || d({ name: h, payload: v, file: g }));
1510
+ L(() => {
1511
+ if (f !== "auto") return;
1512
+ const m = window.matchMedia("(prefers-color-scheme: dark)"), w = (E) => T(E.matches);
1513
+ return m.addEventListener("change", w), () => m.removeEventListener("change", w);
1514
+ }, [f]);
1515
+ const k = f === "auto" ? F ? "dark" : "light" : f, [R, x] = y(1), [S, W] = y(0), [Qt, gt] = y(1), [, wt] = y(1), [A, rt] = y(0), [U, vt] = y(0), [te, ot] = y(0), D = V(null), xt = V(null), yt = V(null), [ee, re] = y(0), [oe, ne] = y(0), [ae, ie] = y(!1), Ft = V(null), [se, le] = y(0), [pe, ce] = y(0), [fe, de] = y(!1), [ue, me] = y(null), [_t, he] = y(!0), [kt, be] = y(!1), [Ct, ge] = y("preview"), [I, q] = y(!0), O = V(null), we = 2e3, K = P(() => {
1516
+ q(!0), O.current && clearTimeout(O.current), O.current = window.setTimeout(() => {
1517
+ q(!1);
1518
+ }, we);
1519
+ }, []), ve = P(() => {
1520
+ K();
1521
+ }, [K]), $ = B(() => Ve(t), [t]), b = $[e], C = Sr(b), H = B(() => b ? n.find((m) => m.test(b)) : null, [b, n]), g = b ? Be(b) : "unsupported", Nt = P(
1522
+ (m, w) => {
1523
+ b && (d == null || d({ name: m, payload: w, file: b }));
1418
1524
  },
1419
- [g, d]
1420
- ), yt = G(
1525
+ [b, d]
1526
+ ), Rt = B(
1421
1527
  () => ({
1422
- emit: vt,
1423
- t: m,
1424
- theme: x,
1425
- locale: p
1528
+ emit: Nt,
1529
+ t: v,
1530
+ theme: k,
1531
+ locale: s
1426
1532
  }),
1427
- [vt, m, x, p]
1533
+ [Nt, v, k, s]
1428
1534
  );
1429
- W(() => {
1430
- b(1), P(0), z(1), E(1), Q(0), ut(0), V(!0), $.current && clearTimeout($.current);
1431
- }, [e]), W(() => {
1432
- if (w === "image" && S > 0 && Z > 0 && L.current) {
1433
- const h = L.current.clientWidth, v = L.current.clientHeight, T = h / S, R = v / Z, B = Math.min(T, R);
1434
- b(Math.max(0.01, Math.min(10, B)));
1535
+ L(() => {
1536
+ x(1), W(0), gt(1), wt(1), rt(0), vt(0), q(!0), O.current && clearTimeout(O.current);
1537
+ }, [e]), L(() => {
1538
+ if (g === "image" && A > 0 && U > 0 && D.current) {
1539
+ const m = D.current.clientWidth, w = D.current.clientHeight, E = m / A, j = w / U, G = Math.min(E, j);
1540
+ x(Math.max(0.01, Math.min(10, G)));
1435
1541
  }
1436
- }, [w, S, Z]), W(() => (j.length > 1 && X(), () => {
1437
- $.current && clearTimeout($.current);
1438
- }), [j.length, X]), W(() => {
1439
- const h = (v) => {
1440
- v.key === "Escape" && a === "modal" ? o == null || o() : v.key === "ArrowLeft" && e > 0 ? r == null || r(e - 1) : v.key === "ArrowRight" && e < j.length - 1 && (r == null || r(e + 1));
1542
+ }, [g, A, U]), L(() => ($.length > 1 && K(), () => {
1543
+ O.current && clearTimeout(O.current);
1544
+ }), [$.length, K]), L(() => {
1545
+ const m = (w) => {
1546
+ w.key === "Escape" && a === "modal" ? o == null || o() : w.key === "ArrowLeft" && e > 0 ? r == null || r(e - 1) : w.key === "ArrowRight" && e < $.length - 1 && (r == null || r(e + 1));
1441
1547
  };
1442
1548
  if (a === "modal")
1443
- return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
1549
+ return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
1444
1550
  {
1445
- const v = mt.current;
1446
- return v ? (v.addEventListener("keydown", h), () => v.removeEventListener("keydown", h)) : void 0;
1551
+ const w = xt.current;
1552
+ return w ? (w.addEventListener("keydown", m), () => w.removeEventListener("keydown", m)) : void 0;
1447
1553
  }
1448
- }, [a, e, j.length, o, r]);
1449
- const Ft = C(() => {
1450
- b((h) => Math.min(h + 0.1, 10));
1451
- }, []), _t = C(() => {
1452
- b((h) => Math.max(h - 0.1, 0.01));
1453
- }, []), ue = C(() => {
1454
- P((h) => h + 90);
1455
- }, []), me = C(() => {
1456
- P((h) => h - 90);
1457
- }, []), he = C(() => {
1458
- if (L.current && S > 0 && Z > 0) {
1459
- const h = L.current.clientWidth, v = L.current.clientHeight, T = h / S, R = v / Z, B = Math.min(T, R);
1460
- b(Math.max(0.01, Math.min(10, B)));
1554
+ }, [a, e, $.length, o, r]);
1555
+ const Mt = P(() => {
1556
+ x((m) => Math.min(m + 0.1, 10));
1557
+ }, []), Tt = P(() => {
1558
+ x((m) => Math.max(m - 0.1, 0.01));
1559
+ }, []), xe = P(() => {
1560
+ W((m) => m + 90);
1561
+ }, []), ye = P(() => {
1562
+ W((m) => m - 90);
1563
+ }, []), Fe = P(() => {
1564
+ if (D.current && A > 0 && U > 0) {
1565
+ const m = D.current.clientWidth, w = D.current.clientHeight, E = m / A, j = w / U, G = Math.min(E, j);
1566
+ x(Math.max(0.01, Math.min(10, G)));
1461
1567
  } else
1462
- b(1);
1463
- P(0), tt((h) => h + 1);
1464
- }, [S, Z]), ge = C(() => {
1465
- b(1), P(0), tt((h) => h + 1);
1466
- }, []), be = C((h) => {
1467
- b(h);
1468
- }, []), kt = C(() => {
1469
- b(1), P(0), tt((h) => h + 1);
1470
- }, []), et = C(() => {
1471
- if (!g) return;
1472
- const h = document.createElement("a");
1473
- h.href = g.url, h.download = g.name, h.click();
1474
- }, [g]), we = C((h, v) => {
1475
- qt(h), Kt(v);
1476
- }, []), xe = C((h, v) => {
1477
- ee(h), oe(v);
1478
- }, []), ve = C((h) => {
1479
- se(h);
1568
+ x(1);
1569
+ W(0), ot((m) => m + 1);
1570
+ }, [A, U]), _e = P(() => {
1571
+ x(1), W(0), ot((m) => m + 1);
1572
+ }, []), ke = P((m) => {
1573
+ x(m);
1574
+ }, []), Pt = P(() => {
1575
+ x(1), W(0), ot((m) => m + 1);
1576
+ }, []), zt = jr(), nt = P(async () => {
1577
+ if (b) {
1578
+ if (h) {
1579
+ await h(b);
1580
+ return;
1581
+ }
1582
+ try {
1583
+ await Qe(b.url, b.name, zt);
1584
+ } catch (m) {
1585
+ console.error("[file-preview] download failed:", m);
1586
+ }
1587
+ }
1588
+ }, [b, h, zt]), Ce = P((m, w) => {
1589
+ re(m), ne(w);
1590
+ }, []), Ne = P((m, w) => {
1591
+ le(m), ce(w);
1592
+ }, []), Re = P((m) => {
1593
+ me(m);
1480
1594
  }, []);
1481
- if (!g) return null;
1482
- const ye = a === "modal" && !!o, q = (() => {
1483
- var h, v;
1484
- if (O)
1485
- return ((h = O.getToolbarGroups) == null ? void 0 : h.call(O, g, yt)) ?? [];
1486
- if (w === "image")
1487
- return dr({
1488
- zoom: y,
1489
- onZoomIn: Ft,
1490
- onZoomOut: _t,
1491
- onFitToWidth: he,
1492
- onOriginalSize: ge,
1493
- onRotateLeft: me,
1494
- onRotateRight: ue,
1495
- onReset: kt,
1496
- t: m
1595
+ if (!b) return null;
1596
+ const Me = a === "modal" && !!o, Y = (() => {
1597
+ var m, w;
1598
+ if (H)
1599
+ return ((m = H.getToolbarGroups) == null ? void 0 : m.call(H, b, Rt)) ?? [];
1600
+ if (g === "image")
1601
+ return kr({
1602
+ zoom: R,
1603
+ onZoomIn: Mt,
1604
+ onZoomOut: Tt,
1605
+ onFitToWidth: Fe,
1606
+ onOriginalSize: _e,
1607
+ onRotateLeft: ye,
1608
+ onRotateRight: xe,
1609
+ onReset: Pt,
1610
+ t: v
1497
1611
  });
1498
- if (w === "pdf")
1499
- return ur({
1500
- zoom: y,
1501
- onZoomIn: Ft,
1502
- onZoomOut: _t,
1503
- onReset: kt,
1504
- t: m
1612
+ if (g === "pdf")
1613
+ return Cr({
1614
+ zoom: R,
1615
+ onZoomIn: Mt,
1616
+ onZoomOut: Tt,
1617
+ onReset: Pt,
1618
+ t: v
1505
1619
  });
1506
- if (w === "epub")
1507
- return mr({
1508
- epubRef: ht,
1509
- current: Xt,
1510
- total: Jt,
1511
- fullWidth: Yt,
1512
- t: m
1620
+ if (g === "epub")
1621
+ return Nr({
1622
+ epubRef: yt,
1623
+ current: ee,
1624
+ total: oe,
1625
+ fullWidth: ae,
1626
+ t: v
1513
1627
  });
1514
- if (w === "mobi")
1515
- return hr({
1516
- mobiRef: gt,
1517
- current: te,
1518
- total: re,
1519
- fullWidth: ne,
1520
- t: m
1628
+ if (g === "mobi")
1629
+ return Rr({
1630
+ mobiRef: Ft,
1631
+ current: se,
1632
+ total: pe,
1633
+ fullWidth: fe,
1634
+ t: v
1521
1635
  });
1522
- if (w === "zip")
1523
- return gr({ stats: ie });
1524
- if (w === "text") {
1525
- const T = ((v = g.name.split(".").pop()) == null ? void 0 : v.toLowerCase()) || "";
1526
- return br({
1527
- wordWrap: bt,
1528
- onToggleWrap: () => le((R) => !R),
1529
- isHtml: T === "html" || T === "htm",
1530
- htmlPreview: wt,
1531
- onToggleHtmlPreview: () => pe((R) => !R),
1532
- t: m
1636
+ if (g === "zip")
1637
+ return Mr({ stats: ue });
1638
+ if (g === "text") {
1639
+ const E = ((w = b.name.split(".").pop()) == null ? void 0 : w.toLowerCase()) || "";
1640
+ return Tr({
1641
+ wordWrap: _t,
1642
+ onToggleWrap: () => he((j) => !j),
1643
+ isHtml: E === "html" || E === "htm",
1644
+ htmlPreview: kt,
1645
+ onToggleHtmlPreview: () => be((j) => !j),
1646
+ t: v
1533
1647
  });
1534
1648
  }
1535
- return w === "markdown" ? wr({
1536
- viewMode: xt,
1537
- onToggleViewMode: () => fe((T) => T === "preview" ? "source" : "preview"),
1538
- t: m
1649
+ return g === "markdown" ? Pr({
1650
+ viewMode: Ct,
1651
+ onToggleViewMode: () => ge((E) => E === "preview" ? "source" : "preview"),
1652
+ t: v
1539
1653
  }) : [];
1540
- })(), Ct = [
1654
+ })(), Et = [
1541
1655
  {
1542
1656
  items: [
1543
- { type: "button", icon: /* @__PURE__ */ i(Vt, { className: "rfp-w-4 rfp-h-4" }), tooltip: m("common.download"), action: et }
1657
+ { type: "button", icon: /* @__PURE__ */ l(Xt, { className: "rfp-w-4 rfp-h-4" }), tooltip: v("common.download"), action: nt }
1544
1658
  ]
1545
1659
  },
1546
- ...ye ? [{
1660
+ ...Me ? [{
1547
1661
  items: [
1548
- { type: "button", icon: /* @__PURE__ */ i(Ee, { className: "rfp-w-4 rfp-h-4" }), tooltip: m("common.close"), action: o }
1662
+ { type: "button", icon: /* @__PURE__ */ l(Oe, { className: "rfp-w-4 rfp-h-4" }), tooltip: v("common.close"), action: o }
1549
1663
  ]
1550
1664
  }] : []
1551
- ], J = (h, v) => h.map((T, R, B) => /* @__PURE__ */ N(_e.Fragment, { children: [
1552
- T.items.map(
1553
- (D, Nt) => D.type === "button" ? /* @__PURE__ */ i(
1554
- Dr,
1665
+ ], Q = (m, w) => m.map((E, j, G) => /* @__PURE__ */ z(Pe.Fragment, { children: [
1666
+ E.items.map(
1667
+ (Z, jt) => Z.type === "button" ? /* @__PURE__ */ l(
1668
+ eo,
1555
1669
  {
1556
- icon: D.icon,
1557
- label: D.tooltip,
1558
- onClick: D.action,
1559
- disabled: D.disabled
1670
+ icon: Z.icon,
1671
+ label: Z.tooltip,
1672
+ onClick: Z.action,
1673
+ disabled: Z.disabled
1560
1674
  },
1561
- `${R}-${Nt}`
1562
- ) : /* @__PURE__ */ i(
1675
+ `${j}-${jt}`
1676
+ ) : /* @__PURE__ */ l(
1563
1677
  "span",
1564
1678
  {
1565
1679
  className: "rfp-text-xs rfp-text-center rfp-font-medium rfp-tabular-nums rfp-text-fg-tertiary",
1566
- style: { minWidth: D.minWidth || "auto" },
1567
- children: D.content
1680
+ style: { minWidth: Z.minWidth || "auto" },
1681
+ children: Z.content
1568
1682
  },
1569
- `${R}-${Nt}`
1683
+ `${j}-${jt}`
1570
1684
  )
1571
1685
  ),
1572
- R < B.length - 1 && /* @__PURE__ */ i("div", { className: `rfp-w-px rfp-h-4 rfp-bg-divide ${v}` })
1573
- ] }, R));
1574
- return /* @__PURE__ */ i(lr, { locale: p, messages: s, children: /* @__PURE__ */ i(fr, { theme: x, children: /* @__PURE__ */ N(
1686
+ j < G.length - 1 && /* @__PURE__ */ l("div", { className: `rfp-w-px rfp-h-4 rfp-bg-divide ${w}` })
1687
+ ] }, j));
1688
+ return /* @__PURE__ */ l(xr, { locale: s, messages: p, children: /* @__PURE__ */ l(Fr, { theme: k, children: /* @__PURE__ */ z(
1575
1689
  "div",
1576
1690
  {
1577
- ref: mt,
1691
+ ref: xt,
1578
1692
  tabIndex: a === "embed" ? 0 : -1,
1579
- "data-theme": x,
1693
+ "data-theme": k,
1580
1694
  className: "rfp-relative rfp-w-full rfp-h-full rfp-flex rfp-flex-col rfp-overflow-hidden rfp-outline-none",
1581
1695
  children: [
1582
- !f && /* @__PURE__ */ N(
1583
- Y.div,
1696
+ !c && /* @__PURE__ */ z(
1697
+ et.div,
1584
1698
  {
1585
1699
  initial: { opacity: 0 },
1586
1700
  animate: { opacity: 1 },
@@ -1588,146 +1702,146 @@ const xr = k(
1588
1702
  className: "rfp-flex-shrink-0 rfp-z-10 rfp-backdrop-blur-md rfp-border-b rfp-bg-surface-toolbar rfp-border-line",
1589
1703
  style: { paddingTop: "env(safe-area-inset-top, 0px)" },
1590
1704
  children: [
1591
- /* @__PURE__ */ N("div", { className: "rfp-flex rfp-items-center rfp-justify-between rfp-px-3 md:rfp-px-5 rfp-py-1.5 md:rfp-py-2.5", children: [
1592
- /* @__PURE__ */ N("div", { className: "rfp-flex rfp-items-center rfp-flex-1 rfp-min-w-0 rfp-mr-2 md:rfp-mr-3", children: [
1593
- /* @__PURE__ */ i("h2", { className: "rfp-font-medium rfp-text-xs md:rfp-text-sm rfp-truncate rfp-text-fg-primary", children: g.name }),
1594
- /* @__PURE__ */ N("span", { className: "rfp-text-xs rfp-ml-2 rfp-flex-shrink-0 rfp-text-fg-muted", children: [
1705
+ /* @__PURE__ */ z("div", { className: "rfp-flex rfp-items-center rfp-justify-between rfp-px-3 md:rfp-px-5 rfp-py-1.5 md:rfp-py-2.5", children: [
1706
+ /* @__PURE__ */ z("div", { className: "rfp-flex rfp-items-center rfp-flex-1 rfp-min-w-0 rfp-mr-2 md:rfp-mr-3", children: [
1707
+ /* @__PURE__ */ l("h2", { className: "rfp-font-medium rfp-text-xs md:rfp-text-sm rfp-truncate rfp-text-fg-primary", children: b.name }),
1708
+ /* @__PURE__ */ z("span", { className: "rfp-text-xs rfp-ml-2 rfp-flex-shrink-0 rfp-text-fg-muted", children: [
1595
1709
  e + 1,
1596
1710
  "/",
1597
- j.length
1711
+ $.length
1598
1712
  ] })
1599
1713
  ] }),
1600
- /* @__PURE__ */ i("div", { className: "rfp-flex rfp-items-center rfp-gap-1 md:rfp-hidden rfp-flex-shrink-0", children: J(Ct, "rfp-mx-0.5") }),
1601
- /* @__PURE__ */ N("div", { className: "rfp-hidden md:rfp-flex rfp-items-center rfp-gap-1 rfp-flex-shrink-0", children: [
1602
- J(q, "rfp-mx-1"),
1603
- q.length > 0 && /* @__PURE__ */ i("div", { className: "rfp-w-px rfp-h-4 rfp-mx-1 rfp-bg-divide" }),
1604
- J(Ct, "rfp-mx-1")
1714
+ /* @__PURE__ */ l("div", { className: "rfp-flex rfp-items-center rfp-gap-1 md:rfp-hidden rfp-flex-shrink-0", children: Q(Et, "rfp-mx-0.5") }),
1715
+ /* @__PURE__ */ z("div", { className: "rfp-hidden md:rfp-flex rfp-items-center rfp-gap-1 rfp-flex-shrink-0", children: [
1716
+ Q(Y, "rfp-mx-1"),
1717
+ Y.length > 0 && /* @__PURE__ */ l("div", { className: "rfp-w-px rfp-h-4 rfp-mx-1 rfp-bg-divide" }),
1718
+ Q(Et, "rfp-mx-1")
1605
1719
  ] })
1606
1720
  ] }),
1607
- q.length > 0 && /* @__PURE__ */ i("div", { className: "rfp-flex rfp-items-center rfp-gap-1 rfp-px-3 rfp-pb-1.5 rfp-overflow-x-auto scrollbar-hide md:rfp-hidden", children: J(q, "rfp-mx-0.5") })
1721
+ Y.length > 0 && /* @__PURE__ */ l("div", { className: "rfp-flex rfp-items-center rfp-gap-1 rfp-px-3 rfp-pb-1.5 rfp-overflow-x-auto scrollbar-hide md:rfp-hidden", children: Q(Y, "rfp-mx-0.5") })
1608
1722
  ]
1609
1723
  }
1610
1724
  ),
1611
- /* @__PURE__ */ i(
1725
+ /* @__PURE__ */ l(
1612
1726
  "div",
1613
1727
  {
1614
- ref: L,
1728
+ ref: D,
1615
1729
  className: "rfp-flex-1 rfp-flex rfp-items-center rfp-justify-center rfp-overflow-auto",
1616
- onMouseMove: de,
1617
- children: O ? O.render(g, yt) : /* @__PURE__ */ N(ke, { fallback: /* @__PURE__ */ i(Lr, {}), children: [
1618
- w === "image" && /* @__PURE__ */ i(
1619
- xr,
1730
+ onMouseMove: ve,
1731
+ children: H ? H.render(b, Rt) : /* @__PURE__ */ z(ze, { fallback: /* @__PURE__ */ l(Yr, {}), children: [
1732
+ g === "image" && /* @__PURE__ */ l(
1733
+ Lr,
1620
1734
  {
1621
- url: g.url,
1622
- zoom: y,
1623
- rotation: M,
1624
- resetKey: Gt,
1625
- fileSize: g.size,
1626
- onZoomChange: be,
1627
- onNaturalWidthChange: Q,
1628
- onNaturalHeightChange: ut
1735
+ url: C,
1736
+ zoom: R,
1737
+ rotation: S,
1738
+ resetKey: te,
1739
+ fileSize: b.size,
1740
+ onZoomChange: ke,
1741
+ onNaturalWidthChange: rt,
1742
+ onNaturalHeightChange: vt
1629
1743
  }
1630
1744
  ),
1631
- w === "pdf" && /* @__PURE__ */ i(
1632
- vr,
1745
+ g === "pdf" && /* @__PURE__ */ l(
1746
+ Wr,
1633
1747
  {
1634
- url: g.url,
1635
- zoom: y,
1636
- currentPage: I,
1637
- onPageChange: z,
1638
- onTotalPagesChange: E,
1639
- onPageWidthChange: Q
1748
+ url: C,
1749
+ zoom: R,
1750
+ currentPage: Qt,
1751
+ onPageChange: gt,
1752
+ onTotalPagesChange: wt,
1753
+ onPageWidthChange: rt
1640
1754
  }
1641
1755
  ),
1642
- w === "docx" && /* @__PURE__ */ i(yr, { url: g.url }),
1643
- w === "xlsx" && /* @__PURE__ */ i(Fr, { url: g.url }),
1644
- w === "pptx" && /* @__PURE__ */ i(_r, { url: g.url }),
1645
- w === "msg" && /* @__PURE__ */ i(kr, { url: g.url }),
1646
- w === "epub" && /* @__PURE__ */ i(
1647
- Cr,
1756
+ g === "docx" && /* @__PURE__ */ l($r, { url: C }),
1757
+ g === "xlsx" && /* @__PURE__ */ l(Dr, { url: C }),
1758
+ g === "pptx" && /* @__PURE__ */ l(Or, { url: C }),
1759
+ g === "msg" && /* @__PURE__ */ l(Zr, { url: C }),
1760
+ g === "epub" && /* @__PURE__ */ l(
1761
+ Ar,
1648
1762
  {
1649
- ref: ht,
1650
- url: g.url,
1651
- onChapterChange: we,
1652
- onFullWidthChange: Qt
1763
+ ref: yt,
1764
+ url: C,
1765
+ onChapterChange: Ce,
1766
+ onFullWidthChange: ie
1653
1767
  }
1654
1768
  ),
1655
- w === "mobi" && /* @__PURE__ */ i(
1656
- Nr,
1769
+ g === "mobi" && /* @__PURE__ */ l(
1770
+ Ur,
1657
1771
  {
1658
- ref: gt,
1659
- url: g.url,
1660
- onChapterChange: xe,
1661
- onFullWidthChange: ae
1772
+ ref: Ft,
1773
+ url: C,
1774
+ onChapterChange: Ne,
1775
+ onFullWidthChange: de
1662
1776
  }
1663
1777
  ),
1664
- w === "video" && /* @__PURE__ */ i(Mr, { url: g.url }),
1665
- w === "audio" && /* @__PURE__ */ i(Tr, { url: g.url, fileName: g.name }),
1666
- w === "markdown" && /* @__PURE__ */ i(Rr, { url: g.url, viewMode: xt }),
1667
- w === "json" && /* @__PURE__ */ i(Pr, { url: g.url, fileName: g.name }),
1668
- w === "csv" && /* @__PURE__ */ i(zr, { url: g.url, fileName: g.name }),
1669
- w === "xml" && /* @__PURE__ */ i(Er, { url: g.url, fileName: g.name }),
1670
- w === "subtitle" && /* @__PURE__ */ i(Sr, { url: g.url, fileName: g.name }),
1671
- w === "zip" && (l >= $r ? /* @__PURE__ */ i(
1672
- St,
1778
+ g === "video" && /* @__PURE__ */ l(Ir, { url: C }),
1779
+ g === "audio" && /* @__PURE__ */ l(Hr, { url: C, fileName: b.name }),
1780
+ g === "markdown" && /* @__PURE__ */ l(Vr, { url: C, viewMode: Ct }),
1781
+ g === "json" && /* @__PURE__ */ l(Br, { url: C, fileName: b.name }),
1782
+ g === "csv" && /* @__PURE__ */ l(qr, { url: C, fileName: b.name }),
1783
+ g === "xml" && /* @__PURE__ */ l(Gr, { url: C, fileName: b.name }),
1784
+ g === "subtitle" && /* @__PURE__ */ l(Xr, { url: C, fileName: b.name }),
1785
+ g === "zip" && (i >= Qr ? /* @__PURE__ */ l(
1786
+ Zt,
1673
1787
  {
1674
- fileName: g.name,
1675
- fileType: g.type,
1676
- onDownload: et
1788
+ fileName: b.name,
1789
+ fileType: b.type,
1790
+ onDownload: nt
1677
1791
  }
1678
- ) : /* @__PURE__ */ i(jr, { url: g.url, onStatsChange: ve, nestingDepth: l })),
1679
- w === "text" && /* @__PURE__ */ i(
1680
- Wr,
1792
+ ) : /* @__PURE__ */ l(Jr, { url: C, onStatsChange: Re, nestingDepth: i })),
1793
+ g === "text" && /* @__PURE__ */ l(
1794
+ Kr,
1681
1795
  {
1682
- url: g.url,
1683
- fileName: g.name,
1684
- wordWrap: bt,
1685
- htmlPreview: wt
1796
+ url: C,
1797
+ fileName: b.name,
1798
+ wordWrap: _t,
1799
+ htmlPreview: kt
1686
1800
  }
1687
1801
  ),
1688
- w === "unsupported" && /* @__PURE__ */ i(
1689
- St,
1802
+ g === "unsupported" && /* @__PURE__ */ l(
1803
+ Zt,
1690
1804
  {
1691
- fileName: g.name,
1692
- fileType: g.type,
1693
- onDownload: et
1805
+ fileName: b.name,
1806
+ fileType: b.type,
1807
+ onDownload: nt
1694
1808
  }
1695
1809
  )
1696
1810
  ] })
1697
1811
  }
1698
1812
  ),
1699
- !f && j.length > 1 && /* @__PURE__ */ N(Fe, { children: [
1700
- e > 0 && /* @__PURE__ */ i(
1701
- Y.button,
1813
+ !c && $.length > 1 && /* @__PURE__ */ z(Te, { children: [
1814
+ e > 0 && /* @__PURE__ */ l(
1815
+ et.button,
1702
1816
  {
1703
1817
  initial: { opacity: 0 },
1704
- animate: { opacity: A ? 1 : 0, x: A ? 0 : -20 },
1818
+ animate: { opacity: I ? 1 : 0, x: I ? 0 : -20 },
1705
1819
  transition: { duration: 0.2 },
1706
1820
  onClick: () => r == null ? void 0 : r(e - 1),
1707
- onMouseEnter: () => V(!0),
1708
- style: { pointerEvents: A ? "auto" : "none" },
1821
+ onMouseEnter: () => q(!0),
1822
+ style: { pointerEvents: I ? "auto" : "none" },
1709
1823
  className: "rfp-absolute rfp-z-20 rfp-left-2 md:rfp-left-4 rfp-top-1/2 -rfp-translate-y-1/2 rfp-w-10 rfp-h-10 md:rfp-w-12 md:rfp-h-12 rfp-rounded-full rfp-backdrop-blur-xl rfp-border rfp-flex rfp-items-center rfp-justify-center rfp-transition-colors rfp-shadow-2xl rfp-bg-surface-nav rfp-border-line hover:rfp-bg-surface-nav-hover rfp-text-fg-primary",
1710
- children: /* @__PURE__ */ i(st, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
1824
+ children: /* @__PURE__ */ l(ct, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
1711
1825
  }
1712
1826
  ),
1713
- e < j.length - 1 && /* @__PURE__ */ i(
1714
- Y.button,
1827
+ e < $.length - 1 && /* @__PURE__ */ l(
1828
+ et.button,
1715
1829
  {
1716
1830
  initial: { opacity: 0 },
1717
- animate: { opacity: A ? 1 : 0, x: A ? 0 : 20 },
1831
+ animate: { opacity: I ? 1 : 0, x: I ? 0 : 20 },
1718
1832
  transition: { duration: 0.2 },
1719
1833
  onClick: () => r == null ? void 0 : r(e + 1),
1720
- onMouseEnter: () => V(!0),
1721
- style: { pointerEvents: A ? "auto" : "none" },
1834
+ onMouseEnter: () => q(!0),
1835
+ style: { pointerEvents: I ? "auto" : "none" },
1722
1836
  className: "rfp-absolute rfp-z-20 rfp-right-2 md:rfp-right-4 rfp-top-1/2 -rfp-translate-y-1/2 rfp-w-10 rfp-h-10 md:rfp-w-12 md:rfp-h-12 rfp-rounded-full rfp-backdrop-blur-xl rfp-border rfp-flex rfp-items-center rfp-justify-center rfp-transition-colors rfp-shadow-2xl rfp-bg-surface-nav rfp-border-line hover:rfp-bg-surface-nav-hover rfp-text-fg-primary",
1723
- children: /* @__PURE__ */ i(lt, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
1837
+ children: /* @__PURE__ */ l(ft, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
1724
1838
  }
1725
1839
  )
1726
1840
  ] })
1727
1841
  ]
1728
1842
  }
1729
1843
  ) }) });
1730
- }, Dr = ({ icon: t, label: e, onClick: r, disabled: n }) => /* @__PURE__ */ N(
1844
+ }, eo = ({ icon: t, label: e, onClick: r, disabled: n }) => /* @__PURE__ */ z(
1731
1845
  "button",
1732
1846
  {
1733
1847
  onClick: r,
@@ -1735,61 +1849,65 @@ const xr = k(
1735
1849
  className: `rfp-relative rfp-group rfp-p-2 md:rfp-p-1.5 rfp-rounded-md rfp-transition-all rfp-select-none ${n ? "rfp-text-fg-disabled rfp-cursor-not-allowed" : "rfp-text-fg-primary hover:rfp-bg-surface-2 active:rfp-bg-surface-3"}`,
1736
1850
  children: [
1737
1851
  t,
1738
- /* @__PURE__ */ N("span", { className: "rfp-absolute rfp-left-1/2 -rfp-translate-x-1/2 rfp-top-full rfp-mt-1.5 rfp-px-2 rfp-py-1 rfp-text-xs rfp-rounded rfp-whitespace-nowrap rfp-pointer-events-none rfp-opacity-0 rfp-invisible group-hover:rfp-opacity-100 group-hover:rfp-visible rfp-transition-opacity rfp-duration-200 rfp-z-50 rfp-bg-fg-primary rfp-text-fg-inverse", children: [
1739
- /* @__PURE__ */ i("span", { className: "rfp-absolute rfp-left-1/2 -rfp-translate-x-1/2 -rfp-top-1 rfp-w-2 rfp-h-2 rfp-rotate-45 rfp-bg-fg-primary" }),
1740
- /* @__PURE__ */ i("span", { className: "rfp-relative", children: e })
1852
+ /* @__PURE__ */ z("span", { className: "rfp-absolute rfp-left-1/2 -rfp-translate-x-1/2 rfp-top-full rfp-mt-1.5 rfp-px-2 rfp-py-1 rfp-text-xs rfp-rounded rfp-whitespace-nowrap rfp-pointer-events-none rfp-opacity-0 rfp-invisible group-hover:rfp-opacity-100 group-hover:rfp-visible rfp-transition-opacity rfp-duration-200 rfp-z-50 rfp-bg-fg-primary rfp-text-fg-inverse", children: [
1853
+ /* @__PURE__ */ l("span", { className: "rfp-absolute rfp-left-1/2 -rfp-translate-x-1/2 -rfp-top-1 rfp-w-2 rfp-h-2 rfp-rotate-45 rfp-bg-fg-primary" }),
1854
+ /* @__PURE__ */ l("span", { className: "rfp-relative", children: e })
1741
1855
  ] })
1742
1856
  ]
1743
1857
  }
1744
- ), so = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1858
+ ), Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1745
1859
  __proto__: null,
1746
- FilePreviewContent: dt
1747
- }, Symbol.toStringTag, { value: "Module" })), lo = ({
1860
+ FilePreviewContent: bt
1861
+ }, Symbol.toStringTag, { value: "Module" })), No = ({
1748
1862
  files: t,
1749
1863
  currentIndex: e,
1750
1864
  isOpen: r,
1751
1865
  onClose: n,
1752
1866
  onNavigate: a,
1753
1867
  customRenderers: o = [],
1754
- locale: l,
1755
- messages: p,
1756
- headless: s,
1757
- theme: f = "dark",
1758
- onCustomEvent: c
1868
+ locale: i,
1869
+ messages: s,
1870
+ headless: p,
1871
+ theme: c = "dark",
1872
+ onCustomEvent: f,
1873
+ requestInit: d,
1874
+ requestHandler: h,
1875
+ shouldFetchAsBlob: u,
1876
+ onDownload: _
1759
1877
  }) => {
1760
- const [d, m] = _(
1878
+ const [M, v] = y(
1761
1879
  () => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
1762
1880
  );
1763
- W(() => {
1764
- if (f !== "auto") return;
1765
- const x = window.matchMedia("(prefers-color-scheme: dark)"), y = (b) => m(b.matches);
1766
- return x.addEventListener("change", y), () => x.removeEventListener("change", y);
1767
- }, [f]);
1768
- const u = f === "auto" ? d ? "dark" : "light" : f;
1769
- if (W(() => {
1881
+ L(() => {
1882
+ if (c !== "auto") return;
1883
+ const k = window.matchMedia("(prefers-color-scheme: dark)"), R = (x) => v(x.matches);
1884
+ return k.addEventListener("change", R), () => k.removeEventListener("change", R);
1885
+ }, [c]);
1886
+ const F = c === "auto" ? M ? "dark" : "light" : c;
1887
+ if (L(() => {
1770
1888
  if (r) {
1771
- const x = document.body.style.overflow, y = document.body.style.paddingRight, b = window.innerWidth - document.documentElement.clientWidth;
1772
- return document.body.style.overflow = "hidden", b > 0 && (document.body.style.paddingRight = `${b}px`), () => {
1773
- document.body.style.overflow = x, document.body.style.paddingRight = y;
1889
+ const k = document.body.style.overflow, R = document.body.style.paddingRight, x = window.innerWidth - document.documentElement.clientWidth;
1890
+ return document.body.style.overflow = "hidden", x > 0 && (document.body.style.paddingRight = `${x}px`), () => {
1891
+ document.body.style.overflow = k, document.body.style.paddingRight = R;
1774
1892
  };
1775
1893
  }
1776
1894
  }, [r]), !r) return null;
1777
- const F = /* @__PURE__ */ i("div", { className: "rfp-root", "data-theme": u, children: /* @__PURE__ */ i(Ne, { children: r && /* @__PURE__ */ i(
1778
- Y.div,
1895
+ const T = /* @__PURE__ */ l("div", { className: "rfp-root", "data-theme": F, children: /* @__PURE__ */ l(je, { children: r && /* @__PURE__ */ l(
1896
+ et.div,
1779
1897
  {
1780
1898
  initial: { opacity: 0 },
1781
1899
  animate: { opacity: 1 },
1782
1900
  exit: { opacity: 0 },
1783
1901
  className: "rfp-fixed rfp-inset-0 rfp-z-[9999] rfp-flex rfp-items-center rfp-justify-center rfp-backdrop-blur-md rfp-overflow-hidden rfp-bg-surface-overlay",
1784
1902
  onClick: n,
1785
- onWheel: (x) => x.stopPropagation(),
1786
- children: /* @__PURE__ */ i(
1903
+ onWheel: (k) => k.stopPropagation(),
1904
+ children: /* @__PURE__ */ l(
1787
1905
  "div",
1788
1906
  {
1789
1907
  className: "rfp-relative rfp-w-full rfp-h-full",
1790
- onClick: (x) => x.stopPropagation(),
1791
- children: /* @__PURE__ */ i(
1792
- dt,
1908
+ onClick: (k) => k.stopPropagation(),
1909
+ children: /* @__PURE__ */ l(
1910
+ bt,
1793
1911
  {
1794
1912
  mode: "modal",
1795
1913
  files: t,
@@ -1797,104 +1915,117 @@ const xr = k(
1797
1915
  onClose: n,
1798
1916
  onNavigate: a,
1799
1917
  customRenderers: o,
1800
- locale: l,
1801
- messages: p,
1802
- headless: s,
1803
- theme: f,
1804
- onCustomEvent: c
1918
+ locale: i,
1919
+ messages: s,
1920
+ headless: p,
1921
+ theme: c,
1922
+ onCustomEvent: f,
1923
+ requestInit: d,
1924
+ requestHandler: h,
1925
+ shouldFetchAsBlob: u,
1926
+ onDownload: _
1805
1927
  }
1806
1928
  )
1807
1929
  }
1808
1930
  )
1809
1931
  }
1810
1932
  ) }) });
1811
- return Ce(F, document.body);
1812
- }, po = ({
1933
+ return Ee(T, document.body);
1934
+ }, Ro = ({
1813
1935
  files: t,
1814
1936
  currentIndex: e = 0,
1815
1937
  onNavigate: r,
1816
1938
  customRenderers: n = [],
1817
1939
  width: a = "100%",
1818
1940
  height: o = "100%",
1819
- className: l,
1820
- style: p,
1821
- locale: s,
1822
- messages: f,
1823
- headless: c,
1941
+ className: i,
1942
+ style: s,
1943
+ locale: p,
1944
+ messages: c,
1945
+ headless: f,
1824
1946
  theme: d = "dark",
1825
- onCustomEvent: m
1947
+ onCustomEvent: h,
1948
+ requestInit: u,
1949
+ requestHandler: _,
1950
+ shouldFetchAsBlob: M,
1951
+ onDownload: v
1826
1952
  }) => {
1827
- const [u, F] = _(
1953
+ const [F, T] = y(
1828
1954
  () => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
1829
1955
  );
1830
- W(() => {
1956
+ L(() => {
1831
1957
  if (d !== "auto") return;
1832
- const y = window.matchMedia("(prefers-color-scheme: dark)"), b = (M) => F(M.matches);
1833
- return y.addEventListener("change", b), () => y.removeEventListener("change", b);
1958
+ const R = window.matchMedia("(prefers-color-scheme: dark)"), x = (S) => T(S.matches);
1959
+ return R.addEventListener("change", x), () => R.removeEventListener("change", x);
1834
1960
  }, [d]);
1835
- const x = d === "auto" ? u ? "dark" : "light" : d;
1836
- return /* @__PURE__ */ i(
1961
+ const k = d === "auto" ? F ? "dark" : "light" : d;
1962
+ return /* @__PURE__ */ l(
1837
1963
  "div",
1838
1964
  {
1839
- className: `rfp-root ${l ?? ""}`,
1840
- style: { width: a, height: o, ...p },
1841
- "data-theme": x,
1842
- children: /* @__PURE__ */ i("div", { className: "rfp-relative rfp-w-full rfp-h-full rfp-overflow-hidden rfp-bg-surface-overlay", children: /* @__PURE__ */ i(
1843
- dt,
1965
+ className: `rfp-root ${i ?? ""}`,
1966
+ style: { width: a, height: o, ...s },
1967
+ "data-theme": k,
1968
+ children: /* @__PURE__ */ l("div", { className: "rfp-relative rfp-w-full rfp-h-full rfp-overflow-hidden rfp-bg-surface-overlay", children: /* @__PURE__ */ l(
1969
+ bt,
1844
1970
  {
1845
1971
  mode: "embed",
1846
1972
  files: t,
1847
1973
  currentIndex: e,
1848
1974
  onNavigate: r,
1849
1975
  customRenderers: n,
1850
- locale: s,
1851
- messages: f,
1852
- headless: c,
1976
+ locale: p,
1977
+ messages: c,
1978
+ headless: f,
1853
1979
  theme: d,
1854
- onCustomEvent: m
1980
+ onCustomEvent: h,
1981
+ requestInit: u,
1982
+ requestHandler: _,
1983
+ shouldFetchAsBlob: M,
1984
+ onDownload: v
1855
1985
  }
1856
1986
  ) })
1857
1987
  }
1858
1988
  );
1859
1989
  };
1860
- function Zr(t) {
1990
+ function ro(t) {
1861
1991
  if (typeof window > "u") return;
1862
1992
  const {
1863
- workerSrc: e = `https://unpkg.com/pdfjs-dist@${U.version}/build/pdf.worker.min.mjs`,
1864
- cMapUrl: r = `https://unpkg.com/pdfjs-dist@${U.version}/cmaps/`,
1993
+ workerSrc: e = `https://unpkg.com/pdfjs-dist@${X.version}/build/pdf.worker.min.mjs`,
1994
+ cMapUrl: r = `https://unpkg.com/pdfjs-dist@${X.version}/cmaps/`,
1865
1995
  cMapPacked: n = !0
1866
1996
  } = t || {};
1867
- U.GlobalWorkerOptions.workerSrc = e, U.GlobalWorkerOptions.cMapUrl = r, U.GlobalWorkerOptions.cMapPacked = n;
1997
+ X.GlobalWorkerOptions.workerSrc = e, X.GlobalWorkerOptions.cMapUrl = r, X.GlobalWorkerOptions.cMapPacked = n;
1868
1998
  }
1869
- Zr();
1870
- const fo = We.version;
1999
+ ro();
2000
+ const Mo = Ue.version;
1871
2001
  export {
1872
- oo as C,
1873
- Qr as F,
1874
- $e as I,
1875
- lr as L,
1876
- fo as V,
1877
- ro as _,
1878
- io as a,
1879
- Yr as b,
1880
- rt as c,
1881
- Ze as d,
1882
- Gr as e,
1883
- dt as f,
1884
- qr as g,
1885
- Jr as h,
1886
- po as i,
1887
- lo as j,
1888
- no as k,
1889
- Zr as l,
1890
- Xr as m,
1891
- De as n,
1892
- ao as o,
1893
- Ae as p,
1894
- so as q,
1895
- Ht as u,
1896
- to as v,
1897
- eo as w,
1898
- Kr as x
2002
+ go as C,
2003
+ Fo as E,
2004
+ bt as F,
2005
+ xr as L,
2006
+ xo as M,
2007
+ vo as S,
2008
+ He as U,
2009
+ Mo as V,
2010
+ bo as _,
2011
+ jr as a,
2012
+ mo as b,
2013
+ ko as c,
2014
+ wo as d,
2015
+ Be as e,
2016
+ co as f,
2017
+ fo as g,
2018
+ Ro as h,
2019
+ No as i,
2020
+ ro as j,
2021
+ at as k,
2022
+ Ve as l,
2023
+ qe as m,
2024
+ _o as n,
2025
+ Co as o,
2026
+ Kt as u,
2027
+ uo as x,
2028
+ ho as y,
2029
+ yo as z
1899
2030
  };
1900
- //# sourceMappingURL=index-LNXbKjrI.mjs.map
2031
+ //# sourceMappingURL=index-Bv93wiEK.mjs.map