@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.
- package/README.md +1 -1
- package/lib/FilePreviewContent.d.ts +12 -1
- package/lib/FilePreviewContent.d.ts.map +1 -1
- package/lib/FilePreviewEmbed.d.ts +9 -1
- package/lib/FilePreviewEmbed.d.ts.map +1 -1
- package/lib/FilePreviewModal.d.ts +9 -1
- package/lib/FilePreviewModal.d.ts.map +1 -1
- package/lib/RequestContext.d.ts +24 -0
- package/lib/RequestContext.d.ts.map +1 -0
- package/lib/chunks/{index-BIg3vHQf.mjs → index-B-H9HQiI.mjs} +35 -35
- package/lib/chunks/index-B-H9HQiI.mjs.map +1 -0
- package/lib/chunks/{index-DOMMMe9f.mjs → index-BGeyzo6u.mjs} +2 -2
- package/lib/chunks/{index-DOMMMe9f.mjs.map → index-BGeyzo6u.mjs.map} +1 -1
- package/lib/chunks/{index-zDEwNk3h.mjs → index-BNUiNUWa.mjs} +35 -35
- package/lib/chunks/index-BNUiNUWa.mjs.map +1 -0
- package/lib/chunks/{index-DTH1IvOG.mjs → index-BSD3w5eG.mjs} +72 -72
- package/lib/chunks/index-BSD3w5eG.mjs.map +1 -0
- package/lib/chunks/{index-D_8IHm6o.mjs → index-BcBe6KW7.mjs} +11 -10
- package/lib/chunks/index-BcBe6KW7.mjs.map +1 -0
- package/lib/chunks/index-BdYkTSTt.mjs +51 -0
- package/lib/chunks/index-BdYkTSTt.mjs.map +1 -0
- package/lib/chunks/{index-BWbuffRN.mjs → index-BqEuP_8r.mjs} +8 -8
- package/lib/chunks/index-BqEuP_8r.mjs.map +1 -0
- package/lib/chunks/{index-LNXbKjrI.mjs → index-Bv93wiEK.mjs} +812 -681
- package/lib/chunks/index-Bv93wiEK.mjs.map +1 -0
- package/lib/chunks/{index-xTq9b3vw.mjs → index-CKirCT35.mjs} +13 -13
- package/lib/chunks/index-CKirCT35.mjs.map +1 -0
- package/lib/chunks/{index-BOEtlHD3.mjs → index-CgV8T0G5.mjs} +53 -53
- package/lib/chunks/index-CgV8T0G5.mjs.map +1 -0
- package/lib/chunks/{index-DinKO2op.mjs → index-D8GtNeDn.mjs} +2 -2
- package/lib/chunks/{index-DinKO2op.mjs.map → index-D8GtNeDn.mjs.map} +1 -1
- package/lib/chunks/{index-CQABwGVP.mjs → index-DGuiWJr7.mjs} +18 -18
- package/lib/chunks/index-DGuiWJr7.mjs.map +1 -0
- package/lib/chunks/{index-Yp36heK8.mjs → index-DV5Jd7Qe.mjs} +31 -31
- package/lib/chunks/index-DV5Jd7Qe.mjs.map +1 -0
- package/lib/chunks/{index-qxvk-6P6.mjs → index-DdOEWhrk.mjs} +33 -33
- package/lib/chunks/index-DdOEWhrk.mjs.map +1 -0
- package/lib/chunks/{index-w0tt7Myw.mjs → index-DmepcY31.mjs} +2 -2
- package/lib/chunks/{index-w0tt7Myw.mjs.map → index-DmepcY31.mjs.map} +1 -1
- package/lib/chunks/index-U3w45GW8.mjs +299 -0
- package/lib/chunks/index-U3w45GW8.mjs.map +1 -0
- package/lib/chunks/{index-BsSx9pGx.mjs → index-r3q2xCCI.mjs} +37 -36
- package/lib/chunks/index-r3q2xCCI.mjs.map +1 -0
- package/lib/chunks/{index-BEolw_uv.mjs → index-zEVVgWCH.mjs} +2 -2
- package/lib/chunks/{index-BEolw_uv.mjs.map → index-zEVVgWCH.mjs.map} +1 -1
- package/lib/chunks/{useShikiHighlight-DtWg9b8y.mjs → useShikiHighlight-DzEAK0S7.mjs} +7 -7
- package/lib/chunks/{useShikiHighlight-DtWg9b8y.mjs.map → useShikiHighlight-DzEAK0S7.mjs.map} +1 -1
- package/lib/index.cjs +20 -33
- package/lib/index.cjs.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.mjs +7 -7
- package/lib/renderers/Csv/index.d.ts.map +1 -1
- package/lib/renderers/Docx/index.d.ts.map +1 -1
- package/lib/renderers/Epub/index.d.ts.map +1 -1
- package/lib/renderers/Json/index.d.ts.map +1 -1
- package/lib/renderers/Markdown/index.d.ts.map +1 -1
- package/lib/renderers/Mobi/index.d.ts.map +1 -1
- package/lib/renderers/Msg/index.d.ts.map +1 -1
- package/lib/renderers/Pptx/index.d.ts.map +1 -1
- package/lib/renderers/Subtitle/index.d.ts.map +1 -1
- package/lib/renderers/Text/index.d.ts.map +1 -1
- package/lib/renderers/Xlsx/index.d.ts.map +1 -1
- package/lib/renderers/Xml/index.d.ts.map +1 -1
- package/lib/renderers/Zip/index.d.ts.map +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/lib/chunks/index--zZy1XpK.mjs +0 -299
- package/lib/chunks/index--zZy1XpK.mjs.map +0 -1
- package/lib/chunks/index-B5tBeF0g.mjs +0 -51
- package/lib/chunks/index-B5tBeF0g.mjs.map +0 -1
- package/lib/chunks/index-BIg3vHQf.mjs.map +0 -1
- package/lib/chunks/index-BOEtlHD3.mjs.map +0 -1
- package/lib/chunks/index-BWbuffRN.mjs.map +0 -1
- package/lib/chunks/index-BsSx9pGx.mjs.map +0 -1
- package/lib/chunks/index-CQABwGVP.mjs.map +0 -1
- package/lib/chunks/index-DTH1IvOG.mjs.map +0 -1
- package/lib/chunks/index-D_8IHm6o.mjs.map +0 -1
- package/lib/chunks/index-LNXbKjrI.mjs.map +0 -1
- package/lib/chunks/index-Yp36heK8.mjs.map +0 -1
- package/lib/chunks/index-qxvk-6P6.mjs.map +0 -1
- package/lib/chunks/index-xTq9b3vw.mjs.map +0 -1
- package/lib/chunks/index-zDEwNk3h.mjs.map +0 -1
- package/lib/chunks/xspreadsheet-CyBXARuf.mjs +0 -5215
- package/lib/chunks/xspreadsheet-CyBXARuf.mjs.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { motion as
|
|
5
|
-
import { ZoomOut as
|
|
6
|
-
import
|
|
7
|
-
import { pdfjs as
|
|
8
|
-
const
|
|
9
|
-
version:
|
|
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
|
|
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
|
|
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
|
|
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 ||
|
|
103
|
+
type: t.type || at(t.name),
|
|
104
104
|
size: t.size
|
|
105
105
|
};
|
|
106
106
|
if (typeof t == "string") {
|
|
107
|
-
const r =
|
|
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:
|
|
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 ||
|
|
119
|
+
type: t.type || at(t.name),
|
|
120
120
|
size: t.size
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
return t.map((e, r) =>
|
|
123
|
+
function Ve(t) {
|
|
124
|
+
return t.map((e, r) => He(e, r));
|
|
125
125
|
}
|
|
126
|
-
function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
258
|
+
function uo(t, e = {}) {
|
|
259
259
|
const r = e.delimiter ?? ",", n = e.firstRowAsHeader ?? !0, a = [];
|
|
260
|
-
let o = [],
|
|
261
|
-
const
|
|
262
|
-
for (;
|
|
263
|
-
const u = t[
|
|
264
|
-
if (
|
|
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[
|
|
267
|
-
|
|
266
|
+
if (t[p + 1] === '"') {
|
|
267
|
+
i += '"', p += 2;
|
|
268
268
|
continue;
|
|
269
269
|
}
|
|
270
|
-
|
|
270
|
+
s = !1, p += 1;
|
|
271
271
|
continue;
|
|
272
272
|
}
|
|
273
|
-
|
|
273
|
+
i += u, p += 1;
|
|
274
274
|
continue;
|
|
275
275
|
}
|
|
276
276
|
if (u === '"') {
|
|
277
|
-
|
|
277
|
+
s = !0, p += 1;
|
|
278
278
|
continue;
|
|
279
279
|
}
|
|
280
280
|
if (u === r) {
|
|
281
|
-
o.push(
|
|
281
|
+
o.push(i), i = "", p += 1;
|
|
282
282
|
continue;
|
|
283
283
|
}
|
|
284
284
|
if (u === "\r") {
|
|
285
|
-
t[
|
|
286
|
-
` && (
|
|
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(
|
|
291
|
+
o.push(i), a.push(o), o = [], i = "", p += 1;
|
|
292
292
|
continue;
|
|
293
293
|
}
|
|
294
|
-
|
|
294
|
+
i += u, p += 1;
|
|
295
295
|
}
|
|
296
|
-
for ((
|
|
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
|
|
304
|
-
n && a.length > 0 && (
|
|
305
|
-
const
|
|
306
|
-
|
|
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 <
|
|
311
|
+
for (; u.length < h; ) u.push("");
|
|
312
312
|
return {
|
|
313
|
-
header:
|
|
313
|
+
header: f,
|
|
314
314
|
rows: d,
|
|
315
|
-
columnCount:
|
|
315
|
+
columnCount: h,
|
|
316
316
|
delimiter: r
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
|
-
function
|
|
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
|
|
338
|
-
const r = await
|
|
339
|
-
if (!
|
|
340
|
-
const
|
|
341
|
-
return
|
|
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
|
|
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
|
|
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),
|
|
358
|
-
return `${
|
|
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
|
|
361
|
-
function
|
|
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" :
|
|
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
|
|
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
|
|
412
|
+
const i = [];
|
|
372
413
|
for (; o < r.length && r[o].trim() !== ""; )
|
|
373
|
-
|
|
374
|
-
for (a =
|
|
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
|
|
381
|
-
if (
|
|
382
|
-
|
|
383
|
-
else if (
|
|
384
|
-
|
|
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
|
|
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:
|
|
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
|
|
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
|
|
403
|
-
o = Number(
|
|
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
|
|
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
|
|
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
|
|
422
|
-
const
|
|
423
|
-
if (!
|
|
424
|
-
const
|
|
425
|
-
let
|
|
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
|
|
428
|
-
for (; (
|
|
429
|
-
|
|
430
|
-
if (
|
|
431
|
-
const d =
|
|
432
|
-
for (const
|
|
433
|
-
a.push({ start:
|
|
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((
|
|
476
|
+
a.sort((i, s) => i.start - s.start);
|
|
436
477
|
const o = r.offsetMs / 1e3;
|
|
437
|
-
return { format: "lrc", cues: a.map((
|
|
438
|
-
const
|
|
439
|
-
return { start:
|
|
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
|
|
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
|
|
447
|
-
const
|
|
448
|
-
if (!
|
|
449
|
-
const
|
|
450
|
-
let
|
|
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(
|
|
454
|
-
|
|
455
|
-
if (
|
|
456
|
-
const
|
|
457
|
-
for (const u of
|
|
458
|
-
o.push({ start: u, raw:
|
|
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((
|
|
461
|
-
const
|
|
462
|
-
return { format: "elrc", cues: o.map((
|
|
463
|
-
const
|
|
464
|
-
let
|
|
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(
|
|
468
|
-
const
|
|
469
|
-
|
|
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
|
|
472
|
-
|
|
473
|
-
const
|
|
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:
|
|
476
|
-
end:
|
|
477
|
-
text:
|
|
478
|
-
words:
|
|
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
|
|
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
|
|
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 = [],
|
|
492
|
-
for (const
|
|
493
|
-
const
|
|
494
|
-
if (
|
|
495
|
-
n =
|
|
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
|
-
|
|
540
|
+
i.push(p);
|
|
500
541
|
continue;
|
|
501
542
|
}
|
|
502
|
-
const d = /^Format:\s*(.+)$/i.exec(
|
|
543
|
+
const d = /^Format:\s*(.+)$/i.exec(c);
|
|
503
544
|
if (d) {
|
|
504
|
-
a = d[1].split(",").map((
|
|
545
|
+
a = d[1].split(",").map((x) => x.trim());
|
|
505
546
|
continue;
|
|
506
547
|
}
|
|
507
|
-
const
|
|
508
|
-
if (!
|
|
509
|
-
const u = a.length,
|
|
510
|
-
a.forEach((
|
|
511
|
-
|
|
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
|
|
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:
|
|
557
|
+
o.push({ start: T, end: k, text: R, style: F.Style });
|
|
517
558
|
}
|
|
518
|
-
return o.sort((
|
|
559
|
+
return o.sort((s, p) => s.start - p.start), {
|
|
519
560
|
format: e,
|
|
520
561
|
cues: o,
|
|
521
|
-
header:
|
|
562
|
+
header: i.join(`
|
|
522
563
|
`).trim() || void 0
|
|
523
564
|
};
|
|
524
565
|
}
|
|
525
|
-
function
|
|
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
|
|
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],
|
|
545
|
-
let
|
|
546
|
-
|
|
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
|
|
553
|
-
|
|
554
|
-
` : d +=
|
|
593
|
+
const _ = u;
|
|
594
|
+
_.tagName.toLowerCase() === "br" ? d += `
|
|
595
|
+
` : d += _.textContent || "";
|
|
555
596
|
}
|
|
556
597
|
});
|
|
557
|
-
const
|
|
598
|
+
const h = d.replace(/[ \t]+/g, " ").replace(/\n /g, `
|
|
558
599
|
`).trim();
|
|
559
|
-
(
|
|
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
|
|
564
|
-
switch (e ??
|
|
604
|
+
function bo(t, e) {
|
|
605
|
+
switch (e ?? er(t)) {
|
|
565
606
|
case "lrc":
|
|
566
|
-
return
|
|
607
|
+
return rr(t);
|
|
567
608
|
case "elrc":
|
|
568
|
-
return
|
|
609
|
+
return or(t);
|
|
569
610
|
case "ass":
|
|
570
|
-
return
|
|
611
|
+
return Dt(t, "ass");
|
|
571
612
|
case "ssa":
|
|
572
|
-
return
|
|
613
|
+
return Dt(t, "ssa");
|
|
573
614
|
case "ttml":
|
|
574
|
-
return
|
|
615
|
+
return nr(t);
|
|
575
616
|
case "vtt":
|
|
576
|
-
return
|
|
617
|
+
return Wt(t, "vtt");
|
|
577
618
|
case "srt":
|
|
578
619
|
default:
|
|
579
|
-
return
|
|
620
|
+
return Wt(t, "srt");
|
|
580
621
|
}
|
|
581
622
|
}
|
|
582
|
-
async function
|
|
583
|
-
return
|
|
623
|
+
async function go(t) {
|
|
624
|
+
return Ze.loadAsync(t);
|
|
584
625
|
}
|
|
585
|
-
function
|
|
626
|
+
function wo(t) {
|
|
586
627
|
const e = [];
|
|
587
628
|
return t.forEach((r, n) => {
|
|
588
629
|
var a;
|
|
589
|
-
const o = n.dir,
|
|
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:
|
|
592
|
-
name:
|
|
593
|
-
dir:
|
|
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
|
|
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
|
|
606
|
-
let
|
|
607
|
-
for (const
|
|
608
|
-
|
|
609
|
-
let
|
|
610
|
-
|
|
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
|
|
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((
|
|
629
|
-
for (const
|
|
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
|
|
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
|
|
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
|
|
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
|
-
],
|
|
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
|
|
721
|
-
const r = parseInt(t.substring(0, 2), 16), n = parseInt(t.substring(2, 4), 16), a = parseInt(t.substring(4, 6), 16), o = (
|
|
722
|
-
return
|
|
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
|
|
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
|
|
769
|
+
return dt(e);
|
|
729
770
|
}
|
|
730
771
|
}
|
|
731
|
-
function
|
|
772
|
+
function dt(t) {
|
|
732
773
|
if (t) {
|
|
733
774
|
if ("argb" in t && typeof t.argb == "string" && t.argb)
|
|
734
|
-
return
|
|
775
|
+
return ar(t.argb);
|
|
735
776
|
if ("theme" in t && typeof t.theme == "number") {
|
|
736
|
-
const e =
|
|
737
|
-
return "#" + (r !== 0 ?
|
|
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 =
|
|
781
|
+
const e = sr[t.indexed];
|
|
741
782
|
if (e) return "#" + e;
|
|
742
783
|
}
|
|
743
784
|
}
|
|
744
785
|
}
|
|
745
|
-
function
|
|
786
|
+
function cr(t) {
|
|
746
787
|
if (!t || !t.style) return;
|
|
747
|
-
const e =
|
|
788
|
+
const e = dt(t.color) || "#000000";
|
|
748
789
|
return [t.style, e];
|
|
749
790
|
}
|
|
750
|
-
function
|
|
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 =
|
|
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 =
|
|
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
|
|
770
|
-
for (const
|
|
771
|
-
const
|
|
772
|
-
|
|
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
|
|
819
|
+
function dr(t) {
|
|
779
820
|
return JSON.stringify(t);
|
|
780
821
|
}
|
|
781
|
-
function
|
|
782
|
-
const n =
|
|
822
|
+
function ur(t, e, r) {
|
|
823
|
+
const n = fr(t);
|
|
783
824
|
if (!n) return -1;
|
|
784
|
-
const a =
|
|
825
|
+
const a = dr(n), o = r.get(a);
|
|
785
826
|
if (o !== void 0) return o;
|
|
786
|
-
const
|
|
787
|
-
return e.push(n), r.set(a,
|
|
827
|
+
const i = e.length;
|
|
828
|
+
return e.push(n), r.set(a, i), i;
|
|
788
829
|
}
|
|
789
|
-
function
|
|
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
|
|
804
|
-
const e = t.split(":"), 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
|
|
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
|
|
862
|
+
function yo(t) {
|
|
822
863
|
const e = [];
|
|
823
864
|
return t.eachSheet((r) => {
|
|
824
|
-
const n = [], a = /* @__PURE__ */ new Map(), o = [],
|
|
825
|
-
for (let
|
|
826
|
-
const u = r.getColumn(
|
|
827
|
-
u.width && (
|
|
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
|
-
|
|
830
|
-
const
|
|
831
|
-
for (const
|
|
832
|
-
o.push(
|
|
833
|
-
const { top: u, left:
|
|
834
|
-
|
|
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 }, (
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
const
|
|
840
|
-
if (
|
|
841
|
-
const
|
|
842
|
-
|
|
843
|
-
const
|
|
844
|
-
|
|
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
|
|
847
|
-
|
|
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:
|
|
853
|
-
cols:
|
|
893
|
+
rows: i,
|
|
894
|
+
cols: s
|
|
854
895
|
});
|
|
855
896
|
}), e;
|
|
856
897
|
}
|
|
857
|
-
function
|
|
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
|
|
861
|
-
t.forEach((
|
|
862
|
-
|
|
863
|
-
}), o[0] = { cells:
|
|
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
|
|
866
|
-
return e.forEach((
|
|
867
|
-
const
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
}), o[String(
|
|
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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
1072
|
-
"zh-CN":
|
|
1073
|
-
"en-US":
|
|
1074
|
-
},
|
|
1075
|
-
function
|
|
1076
|
-
return e ? t.replace(
|
|
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
|
|
1122
|
+
function ut(t) {
|
|
1082
1123
|
var e;
|
|
1083
|
-
const r = t.fallbackLocale ?? "zh-CN", n =
|
|
1084
|
-
return (
|
|
1085
|
-
const
|
|
1086
|
-
return
|
|
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
|
|
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 =
|
|
1095
|
-
const a =
|
|
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__ */
|
|
1139
|
+
return /* @__PURE__ */ l(mt.Provider, { value: n, children: r });
|
|
1099
1140
|
};
|
|
1100
|
-
let
|
|
1101
|
-
function
|
|
1102
|
-
return
|
|
1141
|
+
let st = null;
|
|
1142
|
+
function yr() {
|
|
1143
|
+
return st || (st = ut({ locale: "zh-CN" })), st;
|
|
1103
1144
|
}
|
|
1104
|
-
function
|
|
1105
|
-
const t =
|
|
1106
|
-
return (t == null ? void 0 : t.t) ??
|
|
1145
|
+
function Kt() {
|
|
1146
|
+
const t = J(mt);
|
|
1147
|
+
return (t == null ? void 0 : t.t) ?? yr();
|
|
1107
1148
|
}
|
|
1108
|
-
function
|
|
1109
|
-
const t =
|
|
1149
|
+
function _o() {
|
|
1150
|
+
const t = J(mt);
|
|
1110
1151
|
return (t == null ? void 0 : t.locale) ?? "zh-CN";
|
|
1111
1152
|
}
|
|
1112
|
-
const
|
|
1113
|
-
function
|
|
1114
|
-
return
|
|
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
|
|
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__ */
|
|
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
|
|
1171
|
+
function kr(t) {
|
|
1131
1172
|
return [
|
|
1132
1173
|
{
|
|
1133
1174
|
items: [
|
|
1134
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1142
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
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__ */
|
|
1148
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
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__ */
|
|
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
|
|
1199
|
+
function Cr(t) {
|
|
1159
1200
|
return [
|
|
1160
1201
|
{
|
|
1161
1202
|
items: [
|
|
1162
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
1215
|
+
function Nr(t) {
|
|
1175
1216
|
return [
|
|
1176
1217
|
{
|
|
1177
1218
|
items: [
|
|
1178
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
1253
|
+
function Rr(t) {
|
|
1213
1254
|
return [
|
|
1214
1255
|
{
|
|
1215
1256
|
items: [
|
|
1216
1257
|
{
|
|
1217
1258
|
type: "button",
|
|
1218
|
-
icon: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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 · ${
|
|
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
|
|
1323
|
+
function Tr(t) {
|
|
1283
1324
|
const e = [
|
|
1284
1325
|
{
|
|
1285
1326
|
items: [
|
|
1286
1327
|
{
|
|
1287
1328
|
type: "button",
|
|
1288
|
-
icon: /* @__PURE__ */
|
|
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__ */
|
|
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
|
|
1347
|
+
function Pr(t) {
|
|
1307
1348
|
return [
|
|
1308
1349
|
{
|
|
1309
1350
|
items: [
|
|
1310
1351
|
{
|
|
1311
1352
|
type: "button",
|
|
1312
|
-
icon: t.viewMode === "preview" ? /* @__PURE__ */
|
|
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
|
|
1321
|
-
|
|
1322
|
-
),
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
),
|
|
1333
|
-
|
|
1334
|
-
)
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
)
|
|
1341
|
-
()
|
|
1342
|
-
)
|
|
1343
|
-
|
|
1344
|
-
)
|
|
1345
|
-
|
|
1346
|
-
)
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
)
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
),
|
|
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 =
|
|
1360
|
-
return /* @__PURE__ */
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
-
},
|
|
1379
|
-
const t =
|
|
1380
|
-
return /* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */
|
|
1382
|
-
/* @__PURE__ */
|
|
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
|
-
},
|
|
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:
|
|
1392
|
-
locale:
|
|
1393
|
-
messages:
|
|
1394
|
-
headless:
|
|
1395
|
-
theme:
|
|
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
|
|
1399
|
-
() =>
|
|
1400
|
-
[
|
|
1401
|
-
), [
|
|
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
|
-
|
|
1405
|
-
if (
|
|
1406
|
-
const
|
|
1407
|
-
return
|
|
1408
|
-
}, [
|
|
1409
|
-
const
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
},
|
|
1413
|
-
}, []),
|
|
1414
|
-
|
|
1415
|
-
}, [
|
|
1416
|
-
(
|
|
1417
|
-
|
|
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
|
-
[
|
|
1420
|
-
),
|
|
1525
|
+
[b, d]
|
|
1526
|
+
), Rt = B(
|
|
1421
1527
|
() => ({
|
|
1422
|
-
emit:
|
|
1423
|
-
t:
|
|
1424
|
-
theme:
|
|
1425
|
-
locale:
|
|
1528
|
+
emit: Nt,
|
|
1529
|
+
t: v,
|
|
1530
|
+
theme: k,
|
|
1531
|
+
locale: s
|
|
1426
1532
|
}),
|
|
1427
|
-
[
|
|
1533
|
+
[Nt, v, k, s]
|
|
1428
1534
|
);
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
}, [e]),
|
|
1432
|
-
if (
|
|
1433
|
-
const
|
|
1434
|
-
|
|
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
|
-
}, [
|
|
1437
|
-
|
|
1438
|
-
}), [
|
|
1439
|
-
const
|
|
1440
|
-
|
|
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",
|
|
1549
|
+
return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
|
|
1444
1550
|
{
|
|
1445
|
-
const
|
|
1446
|
-
return
|
|
1551
|
+
const w = xt.current;
|
|
1552
|
+
return w ? (w.addEventListener("keydown", m), () => w.removeEventListener("keydown", m)) : void 0;
|
|
1447
1553
|
}
|
|
1448
|
-
}, [a, e,
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1451
|
-
}, []),
|
|
1452
|
-
|
|
1453
|
-
}, []),
|
|
1454
|
-
|
|
1455
|
-
}, []),
|
|
1456
|
-
|
|
1457
|
-
}, []),
|
|
1458
|
-
if (
|
|
1459
|
-
const
|
|
1460
|
-
|
|
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
|
-
|
|
1463
|
-
|
|
1464
|
-
}, [
|
|
1465
|
-
|
|
1466
|
-
}, []),
|
|
1467
|
-
|
|
1468
|
-
}, []),
|
|
1469
|
-
|
|
1470
|
-
}, []),
|
|
1471
|
-
if (
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
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 (!
|
|
1482
|
-
const
|
|
1483
|
-
var
|
|
1484
|
-
if (
|
|
1485
|
-
return ((
|
|
1486
|
-
if (
|
|
1487
|
-
return
|
|
1488
|
-
zoom:
|
|
1489
|
-
onZoomIn:
|
|
1490
|
-
onZoomOut:
|
|
1491
|
-
onFitToWidth:
|
|
1492
|
-
onOriginalSize:
|
|
1493
|
-
onRotateLeft:
|
|
1494
|
-
onRotateRight:
|
|
1495
|
-
onReset:
|
|
1496
|
-
t:
|
|
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 (
|
|
1499
|
-
return
|
|
1500
|
-
zoom:
|
|
1501
|
-
onZoomIn:
|
|
1502
|
-
onZoomOut:
|
|
1503
|
-
onReset:
|
|
1504
|
-
t:
|
|
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 (
|
|
1507
|
-
return
|
|
1508
|
-
epubRef:
|
|
1509
|
-
current:
|
|
1510
|
-
total:
|
|
1511
|
-
fullWidth:
|
|
1512
|
-
t:
|
|
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 (
|
|
1515
|
-
return
|
|
1516
|
-
mobiRef:
|
|
1517
|
-
current:
|
|
1518
|
-
total:
|
|
1519
|
-
fullWidth:
|
|
1520
|
-
t:
|
|
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 (
|
|
1523
|
-
return
|
|
1524
|
-
if (
|
|
1525
|
-
const
|
|
1526
|
-
return
|
|
1527
|
-
wordWrap:
|
|
1528
|
-
onToggleWrap: () =>
|
|
1529
|
-
isHtml:
|
|
1530
|
-
htmlPreview:
|
|
1531
|
-
onToggleHtmlPreview: () =>
|
|
1532
|
-
t:
|
|
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
|
|
1536
|
-
viewMode:
|
|
1537
|
-
onToggleViewMode: () =>
|
|
1538
|
-
t:
|
|
1649
|
+
return g === "markdown" ? Pr({
|
|
1650
|
+
viewMode: Ct,
|
|
1651
|
+
onToggleViewMode: () => ge((E) => E === "preview" ? "source" : "preview"),
|
|
1652
|
+
t: v
|
|
1539
1653
|
}) : [];
|
|
1540
|
-
})(),
|
|
1654
|
+
})(), Et = [
|
|
1541
1655
|
{
|
|
1542
1656
|
items: [
|
|
1543
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
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
|
-
...
|
|
1660
|
+
...Me ? [{
|
|
1547
1661
|
items: [
|
|
1548
|
-
{ type: "button", icon: /* @__PURE__ */
|
|
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
|
-
],
|
|
1552
|
-
|
|
1553
|
-
(
|
|
1554
|
-
|
|
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:
|
|
1557
|
-
label:
|
|
1558
|
-
onClick:
|
|
1559
|
-
disabled:
|
|
1670
|
+
icon: Z.icon,
|
|
1671
|
+
label: Z.tooltip,
|
|
1672
|
+
onClick: Z.action,
|
|
1673
|
+
disabled: Z.disabled
|
|
1560
1674
|
},
|
|
1561
|
-
`${
|
|
1562
|
-
) : /* @__PURE__ */
|
|
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:
|
|
1567
|
-
children:
|
|
1680
|
+
style: { minWidth: Z.minWidth || "auto" },
|
|
1681
|
+
children: Z.content
|
|
1568
1682
|
},
|
|
1569
|
-
`${
|
|
1683
|
+
`${j}-${jt}`
|
|
1570
1684
|
)
|
|
1571
1685
|
),
|
|
1572
|
-
|
|
1573
|
-
] },
|
|
1574
|
-
return /* @__PURE__ */
|
|
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:
|
|
1691
|
+
ref: xt,
|
|
1578
1692
|
tabIndex: a === "embed" ? 0 : -1,
|
|
1579
|
-
"data-theme":
|
|
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
|
-
!
|
|
1583
|
-
|
|
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__ */
|
|
1592
|
-
/* @__PURE__ */
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
1711
|
+
$.length
|
|
1598
1712
|
] })
|
|
1599
1713
|
] }),
|
|
1600
|
-
/* @__PURE__ */
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
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
|
-
|
|
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__ */
|
|
1725
|
+
/* @__PURE__ */ l(
|
|
1612
1726
|
"div",
|
|
1613
1727
|
{
|
|
1614
|
-
ref:
|
|
1728
|
+
ref: D,
|
|
1615
1729
|
className: "rfp-flex-1 rfp-flex rfp-items-center rfp-justify-center rfp-overflow-auto",
|
|
1616
|
-
onMouseMove:
|
|
1617
|
-
children:
|
|
1618
|
-
|
|
1619
|
-
|
|
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:
|
|
1622
|
-
zoom:
|
|
1623
|
-
rotation:
|
|
1624
|
-
resetKey:
|
|
1625
|
-
fileSize:
|
|
1626
|
-
onZoomChange:
|
|
1627
|
-
onNaturalWidthChange:
|
|
1628
|
-
onNaturalHeightChange:
|
|
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
|
-
|
|
1632
|
-
|
|
1745
|
+
g === "pdf" && /* @__PURE__ */ l(
|
|
1746
|
+
Wr,
|
|
1633
1747
|
{
|
|
1634
|
-
url:
|
|
1635
|
-
zoom:
|
|
1636
|
-
currentPage:
|
|
1637
|
-
onPageChange:
|
|
1638
|
-
onTotalPagesChange:
|
|
1639
|
-
onPageWidthChange:
|
|
1748
|
+
url: C,
|
|
1749
|
+
zoom: R,
|
|
1750
|
+
currentPage: Qt,
|
|
1751
|
+
onPageChange: gt,
|
|
1752
|
+
onTotalPagesChange: wt,
|
|
1753
|
+
onPageWidthChange: rt
|
|
1640
1754
|
}
|
|
1641
1755
|
),
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
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:
|
|
1650
|
-
url:
|
|
1651
|
-
onChapterChange:
|
|
1652
|
-
onFullWidthChange:
|
|
1763
|
+
ref: yt,
|
|
1764
|
+
url: C,
|
|
1765
|
+
onChapterChange: Ce,
|
|
1766
|
+
onFullWidthChange: ie
|
|
1653
1767
|
}
|
|
1654
1768
|
),
|
|
1655
|
-
|
|
1656
|
-
|
|
1769
|
+
g === "mobi" && /* @__PURE__ */ l(
|
|
1770
|
+
Ur,
|
|
1657
1771
|
{
|
|
1658
|
-
ref:
|
|
1659
|
-
url:
|
|
1660
|
-
onChapterChange:
|
|
1661
|
-
onFullWidthChange:
|
|
1772
|
+
ref: Ft,
|
|
1773
|
+
url: C,
|
|
1774
|
+
onChapterChange: Ne,
|
|
1775
|
+
onFullWidthChange: de
|
|
1662
1776
|
}
|
|
1663
1777
|
),
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
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:
|
|
1675
|
-
fileType:
|
|
1676
|
-
onDownload:
|
|
1788
|
+
fileName: b.name,
|
|
1789
|
+
fileType: b.type,
|
|
1790
|
+
onDownload: nt
|
|
1677
1791
|
}
|
|
1678
|
-
) : /* @__PURE__ */
|
|
1679
|
-
|
|
1680
|
-
|
|
1792
|
+
) : /* @__PURE__ */ l(Jr, { url: C, onStatsChange: Re, nestingDepth: i })),
|
|
1793
|
+
g === "text" && /* @__PURE__ */ l(
|
|
1794
|
+
Kr,
|
|
1681
1795
|
{
|
|
1682
|
-
url:
|
|
1683
|
-
fileName:
|
|
1684
|
-
wordWrap:
|
|
1685
|
-
htmlPreview:
|
|
1796
|
+
url: C,
|
|
1797
|
+
fileName: b.name,
|
|
1798
|
+
wordWrap: _t,
|
|
1799
|
+
htmlPreview: kt
|
|
1686
1800
|
}
|
|
1687
1801
|
),
|
|
1688
|
-
|
|
1689
|
-
|
|
1802
|
+
g === "unsupported" && /* @__PURE__ */ l(
|
|
1803
|
+
Zt,
|
|
1690
1804
|
{
|
|
1691
|
-
fileName:
|
|
1692
|
-
fileType:
|
|
1693
|
-
onDownload:
|
|
1805
|
+
fileName: b.name,
|
|
1806
|
+
fileType: b.type,
|
|
1807
|
+
onDownload: nt
|
|
1694
1808
|
}
|
|
1695
1809
|
)
|
|
1696
1810
|
] })
|
|
1697
1811
|
}
|
|
1698
1812
|
),
|
|
1699
|
-
!
|
|
1700
|
-
e > 0 && /* @__PURE__ */
|
|
1701
|
-
|
|
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:
|
|
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: () =>
|
|
1708
|
-
style: { pointerEvents:
|
|
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__ */
|
|
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 <
|
|
1714
|
-
|
|
1827
|
+
e < $.length - 1 && /* @__PURE__ */ l(
|
|
1828
|
+
et.button,
|
|
1715
1829
|
{
|
|
1716
1830
|
initial: { opacity: 0 },
|
|
1717
|
-
animate: { opacity:
|
|
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: () =>
|
|
1721
|
-
style: { pointerEvents:
|
|
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__ */
|
|
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
|
-
},
|
|
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__ */
|
|
1739
|
-
/* @__PURE__ */
|
|
1740
|
-
/* @__PURE__ */
|
|
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
|
-
),
|
|
1858
|
+
), Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1745
1859
|
__proto__: null,
|
|
1746
|
-
FilePreviewContent:
|
|
1747
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
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:
|
|
1755
|
-
messages:
|
|
1756
|
-
headless:
|
|
1757
|
-
theme:
|
|
1758
|
-
onCustomEvent:
|
|
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 [
|
|
1878
|
+
const [M, v] = y(
|
|
1761
1879
|
() => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
1762
1880
|
);
|
|
1763
|
-
|
|
1764
|
-
if (
|
|
1765
|
-
const
|
|
1766
|
-
return
|
|
1767
|
-
}, [
|
|
1768
|
-
const
|
|
1769
|
-
if (
|
|
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
|
|
1772
|
-
return document.body.style.overflow = "hidden",
|
|
1773
|
-
document.body.style.overflow =
|
|
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
|
|
1778
|
-
|
|
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: (
|
|
1786
|
-
children: /* @__PURE__ */
|
|
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: (
|
|
1791
|
-
children: /* @__PURE__ */
|
|
1792
|
-
|
|
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:
|
|
1801
|
-
messages:
|
|
1802
|
-
headless:
|
|
1803
|
-
theme:
|
|
1804
|
-
onCustomEvent:
|
|
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
|
|
1812
|
-
},
|
|
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:
|
|
1820
|
-
style:
|
|
1821
|
-
locale:
|
|
1822
|
-
messages:
|
|
1823
|
-
headless:
|
|
1941
|
+
className: i,
|
|
1942
|
+
style: s,
|
|
1943
|
+
locale: p,
|
|
1944
|
+
messages: c,
|
|
1945
|
+
headless: f,
|
|
1824
1946
|
theme: d = "dark",
|
|
1825
|
-
onCustomEvent:
|
|
1947
|
+
onCustomEvent: h,
|
|
1948
|
+
requestInit: u,
|
|
1949
|
+
requestHandler: _,
|
|
1950
|
+
shouldFetchAsBlob: M,
|
|
1951
|
+
onDownload: v
|
|
1826
1952
|
}) => {
|
|
1827
|
-
const [
|
|
1953
|
+
const [F, T] = y(
|
|
1828
1954
|
() => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
1829
1955
|
);
|
|
1830
|
-
|
|
1956
|
+
L(() => {
|
|
1831
1957
|
if (d !== "auto") return;
|
|
1832
|
-
const
|
|
1833
|
-
return
|
|
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
|
|
1836
|
-
return /* @__PURE__ */
|
|
1961
|
+
const k = d === "auto" ? F ? "dark" : "light" : d;
|
|
1962
|
+
return /* @__PURE__ */ l(
|
|
1837
1963
|
"div",
|
|
1838
1964
|
{
|
|
1839
|
-
className: `rfp-root ${
|
|
1840
|
-
style: { width: a, height: o, ...
|
|
1841
|
-
"data-theme":
|
|
1842
|
-
children: /* @__PURE__ */
|
|
1843
|
-
|
|
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:
|
|
1851
|
-
messages:
|
|
1852
|
-
headless:
|
|
1976
|
+
locale: p,
|
|
1977
|
+
messages: c,
|
|
1978
|
+
headless: f,
|
|
1853
1979
|
theme: d,
|
|
1854
|
-
onCustomEvent:
|
|
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
|
|
1990
|
+
function ro(t) {
|
|
1861
1991
|
if (typeof window > "u") return;
|
|
1862
1992
|
const {
|
|
1863
|
-
workerSrc: e = `https://unpkg.com/pdfjs-dist@${
|
|
1864
|
-
cMapUrl: r = `https://unpkg.com/pdfjs-dist@${
|
|
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
|
-
|
|
1997
|
+
X.GlobalWorkerOptions.workerSrc = e, X.GlobalWorkerOptions.cMapUrl = r, X.GlobalWorkerOptions.cMapPacked = n;
|
|
1868
1998
|
}
|
|
1869
|
-
|
|
1870
|
-
const
|
|
1999
|
+
ro();
|
|
2000
|
+
const Mo = Ue.version;
|
|
1871
2001
|
export {
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
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-
|
|
2031
|
+
//# sourceMappingURL=index-Bv93wiEK.mjs.map
|