@eternalheart/react-file-preview 1.3.11 → 1.3.13
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 +27 -0
- package/README.zh-CN.md +27 -0
- package/lib/chunks/{index-nVblatyi.mjs → index-8pqs-pW7.mjs} +3 -3
- package/lib/chunks/{index-nVblatyi.mjs.map → index-8pqs-pW7.mjs.map} +1 -1
- package/lib/chunks/{index-CCkHAeLh.mjs → index-B0QA380T.mjs} +2 -2
- package/lib/chunks/{index-CCkHAeLh.mjs.map → index-B0QA380T.mjs.map} +1 -1
- package/lib/chunks/{index-D660ENHx.mjs → index-B2IlXQPc.mjs} +2 -2
- package/lib/chunks/{index-D660ENHx.mjs.map → index-B2IlXQPc.mjs.map} +1 -1
- package/lib/chunks/{index-BiyghBxu.mjs → index-BgMhDDkd.mjs} +2 -2
- package/lib/chunks/{index-BiyghBxu.mjs.map → index-BgMhDDkd.mjs.map} +1 -1
- package/lib/chunks/{index-BYdqrqnR.mjs → index-BvjPzMFc.mjs} +2 -2
- package/lib/chunks/{index-BYdqrqnR.mjs.map → index-BvjPzMFc.mjs.map} +1 -1
- package/lib/chunks/{index-B57rEPin.mjs → index-C8r2-Evl.mjs} +3 -3
- package/lib/chunks/{index-B57rEPin.mjs.map → index-C8r2-Evl.mjs.map} +1 -1
- package/lib/chunks/{index-CdmkF0CO.mjs → index-CIqtwqgy.mjs} +2 -2
- package/lib/chunks/{index-CdmkF0CO.mjs.map → index-CIqtwqgy.mjs.map} +1 -1
- package/lib/chunks/{index-C8CyS_sj.mjs → index-CRn7LdHD.mjs} +3 -3
- package/lib/chunks/{index-C8CyS_sj.mjs.map → index-CRn7LdHD.mjs.map} +1 -1
- package/lib/chunks/{index-CuAALtwC.mjs → index-CWCNvV2X.mjs} +500 -476
- package/lib/chunks/index-CWCNvV2X.mjs.map +1 -0
- package/lib/chunks/{index-BJ6vTNxc.mjs → index-Ctf8mG_u.mjs} +2 -2
- package/lib/chunks/{index-BJ6vTNxc.mjs.map → index-Ctf8mG_u.mjs.map} +1 -1
- package/lib/chunks/{index-DBEG73K1.mjs → index-DN4Lc1dx.mjs} +2 -2
- package/lib/chunks/{index-DBEG73K1.mjs.map → index-DN4Lc1dx.mjs.map} +1 -1
- package/lib/chunks/{index-rUfsiVR8.mjs → index-DYNPnFww.mjs} +2 -2
- package/lib/chunks/{index-rUfsiVR8.mjs.map → index-DYNPnFww.mjs.map} +1 -1
- package/lib/chunks/{index-qOC5xQyK.mjs → index-DZxzCMp2.mjs} +2 -2
- package/lib/chunks/{index-qOC5xQyK.mjs.map → index-DZxzCMp2.mjs.map} +1 -1
- package/lib/chunks/index-DfkP0zX3.mjs +357 -0
- package/lib/chunks/index-DfkP0zX3.mjs.map +1 -0
- package/lib/chunks/{index-DaFlk9dd.mjs → index-DqXfw2eb.mjs} +2 -2
- package/lib/chunks/{index-DaFlk9dd.mjs.map → index-DqXfw2eb.mjs.map} +1 -1
- package/lib/chunks/index-DtZwBUd0.mjs +270 -0
- package/lib/chunks/index-DtZwBUd0.mjs.map +1 -0
- package/lib/chunks/{index-C8OrFLd5.mjs → index-_EpQHlUY.mjs} +2 -2
- package/lib/chunks/{index-C8OrFLd5.mjs.map → index-_EpQHlUY.mjs.map} +1 -1
- package/lib/chunks/{index-ow-nGpuu.mjs → index-p4mew8Hx.mjs} +2 -2
- package/lib/chunks/{index-ow-nGpuu.mjs.map → index-p4mew8Hx.mjs.map} +1 -1
- package/lib/chunks/{index-_mP0FkqE.mjs → index-sft0uUd7.mjs} +2 -2
- package/lib/chunks/{index-_mP0FkqE.mjs.map → index-sft0uUd7.mjs.map} +1 -1
- package/lib/chunks/{useShikiHighlight-ClbUXJ2p.mjs → useShikiHighlight-CDDi36pF.mjs} +2 -2
- package/lib/chunks/{useShikiHighlight-ClbUXJ2p.mjs.map → useShikiHighlight-CDDi36pF.mjs.map} +1 -1
- package/lib/components/ResizableSplit.d.ts +12 -2
- package/lib/components/ResizableSplit.d.ts.map +1 -1
- package/lib/index.cjs +29 -29
- package/lib/index.cjs.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.mjs +1 -1
- package/lib/renderers/Image/index.d.ts.map +1 -1
- package/lib/renderers/Zip/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-BCuRRLYt.mjs +0 -222
- package/lib/chunks/index-BCuRRLYt.mjs.map +0 -1
- package/lib/chunks/index-CuAALtwC.mjs.map +0 -1
- package/lib/chunks/index-nLTQXCV7.mjs +0 -301
- package/lib/chunks/index-nLTQXCV7.mjs.map +0 -1
- package/lib/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/78-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/78-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/lib/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/lib/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/CNS2-V.bcmap +0 -3
- package/lib/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/ETenms-B5-H.bcmap +0 -3
- package/lib/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/GB-H.bcmap +0 -4
- package/lib/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/H.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/lib/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/lib/pdfjs/cmaps/LICENSE +0 -36
- package/lib/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/Roman.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/lib/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/lib/pdfjs/cmaps/V.bcmap +0 -0
- package/lib/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/lib/pdfjs/pdf.worker.min.mjs +0 -21
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as p, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { motion as
|
|
5
|
-
import { ZoomOut as
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
8
|
-
const
|
|
9
|
-
version:
|
|
10
|
-
},
|
|
1
|
+
import { jsx as p, jsxs as z, Fragment as _e } from "react/jsx-runtime";
|
|
2
|
+
import ke, { useMemo as I, useContext as q, createContext as at, useState as F, useRef as V, useEffect as E, lazy as R, useCallback as j, Suspense as Ce } from "react";
|
|
3
|
+
import { createPortal as Ne } from "react-dom";
|
|
4
|
+
import { motion as Y, AnimatePresence as Re } from "framer-motion";
|
|
5
|
+
import { ZoomOut as qt, ZoomIn as Gt, Scan as Me, RotateCcw as Pe, RotateCw as je, RefreshCw as Xt, List as Kt, ChevronLeft as it, ChevronRight as st, Minimize2 as Jt, Maximize2 as Yt, WrapText as ze, Code as Qt, Eye as te, FileQuestion as Te, Download as ee, X as Se } from "lucide-react";
|
|
6
|
+
import Ee from "jszip";
|
|
7
|
+
import * as Le from "pdfjs-dist/build/pdf.mjs";
|
|
8
|
+
const We = "1.3.13", $e = {
|
|
9
|
+
version: We
|
|
10
|
+
}, hr = [
|
|
11
11
|
"image",
|
|
12
12
|
"pdf",
|
|
13
13
|
"docx",
|
|
@@ -27,7 +27,7 @@ const Ie = "1.3.11", Ve = {
|
|
|
27
27
|
"text",
|
|
28
28
|
"font"
|
|
29
29
|
];
|
|
30
|
-
function
|
|
30
|
+
function De(t) {
|
|
31
31
|
try {
|
|
32
32
|
const e = new URL(t).pathname.split("/").pop() || "file";
|
|
33
33
|
return decodeURIComponent(e);
|
|
@@ -36,7 +36,7 @@ function Ze(t) {
|
|
|
36
36
|
return decodeURIComponent(e);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function et(t) {
|
|
40
40
|
var e;
|
|
41
41
|
const o = ((e = t.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "";
|
|
42
42
|
return {
|
|
@@ -113,36 +113,36 @@ function at(t) {
|
|
|
113
113
|
zip: "application/zip"
|
|
114
114
|
}[o] || "application/octet-stream";
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Ae(t, e = 0) {
|
|
117
117
|
if (t instanceof File)
|
|
118
118
|
return {
|
|
119
119
|
id: `file-${Date.now()}-${e}`,
|
|
120
120
|
name: t.name,
|
|
121
121
|
url: URL.createObjectURL(t),
|
|
122
|
-
type: t.type ||
|
|
122
|
+
type: t.type || et(t.name),
|
|
123
123
|
size: t.size
|
|
124
124
|
};
|
|
125
125
|
if (typeof t == "string") {
|
|
126
|
-
const o =
|
|
126
|
+
const o = De(t);
|
|
127
127
|
return {
|
|
128
128
|
id: `url-${Date.now()}-${e}`,
|
|
129
129
|
name: o,
|
|
130
130
|
url: t,
|
|
131
|
-
type:
|
|
131
|
+
type: et(o)
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
return {
|
|
135
135
|
id: t.id || `link-${Date.now()}-${e}`,
|
|
136
136
|
name: t.name,
|
|
137
137
|
url: t.url,
|
|
138
|
-
type: t.type ||
|
|
138
|
+
type: t.type || et(t.name),
|
|
139
139
|
size: t.size
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
return t.map((e, o) =>
|
|
142
|
+
function Ue(t) {
|
|
143
|
+
return t.map((e, o) => Ae(e, o));
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Oe(t) {
|
|
146
146
|
var e;
|
|
147
147
|
const o = ((e = t.name.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "", r = t.type.toLowerCase();
|
|
148
148
|
if (r.startsWith("image/") || [
|
|
@@ -249,7 +249,7 @@ function qe(t) {
|
|
|
249
249
|
];
|
|
250
250
|
return r.startsWith("text/") || a.includes(o) ? "text" : "unsupported";
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function gr(t) {
|
|
253
253
|
var e;
|
|
254
254
|
const o = ((e = t.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "";
|
|
255
255
|
return {
|
|
@@ -297,14 +297,14 @@ function xr(t) {
|
|
|
297
297
|
txt: "text"
|
|
298
298
|
}[o] || "text";
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function Ze(t) {
|
|
301
301
|
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function br(t) {
|
|
304
304
|
var e;
|
|
305
305
|
return (((e = t.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "") === "tsv" ? " " : ",";
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function wr(t, e = {}) {
|
|
308
308
|
const o = e.delimiter ?? ",", r = e.firstRowAsHeader ?? !0, a = [];
|
|
309
309
|
let n = [], i = "", s = !1, l = 0;
|
|
310
310
|
const f = t.length;
|
|
@@ -365,7 +365,7 @@ function Fr(t, e = {}) {
|
|
|
365
365
|
delimiter: o
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Ie(t) {
|
|
369
369
|
const e = t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
370
370
|
if (e.length >= 3 && e[0] === 239 && e[1] === 187 && e[2] === 191)
|
|
371
371
|
return new TextDecoder("utf-8").decode(e);
|
|
@@ -383,17 +383,17 @@ function Xe(t) {
|
|
|
383
383
|
}
|
|
384
384
|
return new TextDecoder("utf-8", { fatal: !1 }).decode(e);
|
|
385
385
|
}
|
|
386
|
-
async function
|
|
386
|
+
async function vr(t, e) {
|
|
387
387
|
const o = !!e && ("fetcher" in e || "init" in e || "signal" in e), r = o ? e.fetcher ?? fetch : fetch, a = o ? e.signal : void 0, n = o ? e.init : e, i = a ? { ...n, signal: a } : n, s = await r(t, i);
|
|
388
388
|
if (!s.ok) throw new Error(`请求失败: ${s.status}`);
|
|
389
389
|
const l = await s.arrayBuffer();
|
|
390
|
-
return
|
|
390
|
+
return Ie(l);
|
|
391
391
|
}
|
|
392
|
-
async function
|
|
392
|
+
async function Ve(t, e) {
|
|
393
393
|
if (t)
|
|
394
394
|
return typeof t == "function" ? await t(e) : t;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function Be(t, e) {
|
|
397
397
|
if (!t && !e) return;
|
|
398
398
|
if (!t) return e;
|
|
399
399
|
if (!e) return t;
|
|
@@ -406,20 +406,20 @@ function Je(t, e) {
|
|
|
406
406
|
headers: o
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function He(t) {
|
|
410
410
|
const e = (t == null ? void 0 : t.requestHandler) ?? ((r, a) => fetch(r, a)), o = t == null ? void 0 : t.requestInit;
|
|
411
411
|
return async (r, a) => {
|
|
412
|
-
const n = await
|
|
412
|
+
const n = await Ve(o, r), i = Be(n, a);
|
|
413
413
|
return e(r, i);
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
|
-
async function
|
|
416
|
+
async function qe(t, e = fetch, o) {
|
|
417
417
|
const r = await e(t, o);
|
|
418
418
|
if (!r.ok) throw new Error(`请求失败: ${r.status}`);
|
|
419
419
|
const a = await r.blob();
|
|
420
420
|
return URL.createObjectURL(a);
|
|
421
421
|
}
|
|
422
|
-
async function
|
|
422
|
+
async function Ge(t, e, o = fetch, r) {
|
|
423
423
|
const a = await o(t, r);
|
|
424
424
|
if (!a.ok) throw new Error(`请求失败: ${a.status}`);
|
|
425
425
|
const n = await a.blob(), i = URL.createObjectURL(n);
|
|
@@ -430,7 +430,7 @@ async function to(t, e, o = fetch, r) {
|
|
|
430
430
|
setTimeout(() => URL.revokeObjectURL(i), 1e3);
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function Ut(t) {
|
|
434
434
|
const e = t.trim().replace(",", "."), o = e.split(":").map((r) => r.trim());
|
|
435
435
|
if (o.length === 3) {
|
|
436
436
|
const [r, a, n] = o;
|
|
@@ -442,17 +442,17 @@ function Zt(t) {
|
|
|
442
442
|
}
|
|
443
443
|
return Number(e) || 0;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function xr(t) {
|
|
446
446
|
if (!isFinite(t) || t < 0) return "00:00:00.000";
|
|
447
447
|
const e = Math.floor(t * 1e3), o = e % 1e3, r = Math.floor(e / 1e3) % 60, a = Math.floor(e / 6e4) % 60, n = Math.floor(e / 36e5), i = (s, l = 2) => s.toString().padStart(l, "0");
|
|
448
448
|
return `${i(n)}:${i(a)}:${i(r)}.${i(o, 3)}`;
|
|
449
449
|
}
|
|
450
|
-
const
|
|
451
|
-
function
|
|
450
|
+
const Ot = /(\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}/, Xe = /^\s*\[\d{1,2}:\d{1,2}(?:[.:]\d{1,3})?\]/;
|
|
451
|
+
function Ke(t) {
|
|
452
452
|
const e = t.replace(/^\uFEFF/, "").trimStart();
|
|
453
|
-
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" :
|
|
453
|
+
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" : Xe.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";
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Zt(t, e) {
|
|
456
456
|
const o = t.replace(/\r\n?/g, `
|
|
457
457
|
`).replace(/^\uFEFF/, "").split(`
|
|
458
458
|
`), r = [];
|
|
@@ -468,16 +468,16 @@ function Ht(t, e) {
|
|
|
468
468
|
for (; n < o.length && o[n].trim() === ""; ) n++;
|
|
469
469
|
if (n >= o.length) break;
|
|
470
470
|
let i, s = null;
|
|
471
|
-
if (
|
|
471
|
+
if (Ot.test(o[n]))
|
|
472
472
|
s = o[n], n++;
|
|
473
|
-
else if (i = o[n].trim() || void 0, n++, n < o.length &&
|
|
473
|
+
else if (i = o[n].trim() || void 0, n++, n < o.length && Ot.test(o[n]))
|
|
474
474
|
s = o[n], n++;
|
|
475
475
|
else
|
|
476
476
|
continue;
|
|
477
477
|
if (!s) continue;
|
|
478
478
|
const l = s.match(/([\d:.,]+)\s*-->\s*([\d:.,]+)/);
|
|
479
479
|
if (!l) continue;
|
|
480
|
-
const f =
|
|
480
|
+
const f = Ut(l[1]), c = Ut(l[2]), d = [];
|
|
481
481
|
for (; n < o.length && o[n].trim() !== ""; )
|
|
482
482
|
d.push(o[n]), n++;
|
|
483
483
|
r.push({ id: i, start: f, end: c, text: d.join(`
|
|
@@ -485,7 +485,7 @@ function Ht(t, e) {
|
|
|
485
485
|
}
|
|
486
486
|
return { format: e, cues: r, header: a };
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function nt(t, e, o) {
|
|
489
489
|
const r = Number(t), a = Number(e);
|
|
490
490
|
let n = 0;
|
|
491
491
|
if (o) {
|
|
@@ -494,7 +494,7 @@ function lt(t, e, o) {
|
|
|
494
494
|
}
|
|
495
495
|
return r * 60 + a + n / 1e3;
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function oe(t, e) {
|
|
498
498
|
const o = /^\[(ti|ar|al|au|by|length|offset|re|ve):(.*)\]$/i.exec(t.trim());
|
|
499
499
|
if (!o) return !1;
|
|
500
500
|
const r = o[1].toLowerCase(), a = o[2].trim();
|
|
@@ -504,19 +504,19 @@ function ie(t, e) {
|
|
|
504
504
|
}
|
|
505
505
|
return !0;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Je(t) {
|
|
508
508
|
const e = t.replace(/\r\n?/g, `
|
|
509
509
|
`).replace(/^\uFEFF/, "").split(`
|
|
510
510
|
`), o = { metadata: {}, offsetMs: 0 }, r = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, a = [];
|
|
511
511
|
for (const i of e) {
|
|
512
512
|
const s = i.trim();
|
|
513
|
-
if (!s ||
|
|
513
|
+
if (!s || oe(s, o)) continue;
|
|
514
514
|
const l = [];
|
|
515
515
|
let f = 0;
|
|
516
516
|
r.lastIndex = 0;
|
|
517
517
|
let c;
|
|
518
518
|
for (; (c = r.exec(s)) !== null && c.index === f; )
|
|
519
|
-
l.push(
|
|
519
|
+
l.push(nt(c[1], c[2], c[3])), f = c.index + c[0].length;
|
|
520
520
|
if (l.length === 0) continue;
|
|
521
521
|
const d = s.slice(f).trim();
|
|
522
522
|
for (const m of l)
|
|
@@ -529,19 +529,19 @@ function ro(t) {
|
|
|
529
529
|
return { start: l, end: c, text: i.text };
|
|
530
530
|
}), metadata: o.metadata };
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Ye(t) {
|
|
533
533
|
const e = t.replace(/\r\n?/g, `
|
|
534
534
|
`).replace(/^\uFEFF/, "").split(`
|
|
535
535
|
`), o = { metadata: {}, offsetMs: 0 }, r = /\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g, a = /<(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?>/g, n = [];
|
|
536
536
|
for (const s of e) {
|
|
537
537
|
const l = s.trim();
|
|
538
|
-
if (!l ||
|
|
538
|
+
if (!l || oe(l, o)) continue;
|
|
539
539
|
const f = [];
|
|
540
540
|
let c = 0;
|
|
541
541
|
r.lastIndex = 0;
|
|
542
542
|
let d;
|
|
543
543
|
for (; (d = r.exec(l)) !== null && d.index === c; )
|
|
544
|
-
f.push(
|
|
544
|
+
f.push(nt(d[1], d[2], d[3])), c = d.index + d[0].length;
|
|
545
545
|
if (f.length === 0) continue;
|
|
546
546
|
const m = l.slice(c);
|
|
547
547
|
for (const u of f)
|
|
@@ -555,8 +555,8 @@ function no(t) {
|
|
|
555
555
|
a.lastIndex = 0;
|
|
556
556
|
let u;
|
|
557
557
|
for (; (u = a.exec(s.raw)) !== null; ) {
|
|
558
|
-
const
|
|
559
|
-
m !== null &&
|
|
558
|
+
const P = s.raw.slice(d, u.index);
|
|
559
|
+
m !== null && P && f.push({ start: Math.max(0, m - i), text: P }), c += P, m = nt(u[1], u[2], u[3]), d = u.index + u[0].length;
|
|
560
560
|
}
|
|
561
561
|
const w = s.raw.slice(d);
|
|
562
562
|
m !== null && w && f.push({ start: Math.max(0, m - i), text: w }), c += w;
|
|
@@ -569,11 +569,11 @@ function no(t) {
|
|
|
569
569
|
};
|
|
570
570
|
}), metadata: o.metadata };
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function It(t) {
|
|
573
573
|
const e = t.trim().split(":");
|
|
574
574
|
return e.length !== 3 ? 0 : Number(e[0]) * 3600 + Number(e[1]) * 60 + Number(e[2].replace(",", "."));
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function Vt(t, e) {
|
|
577
577
|
const o = t.replace(/\r\n?/g, `
|
|
578
578
|
`).replace(/^\uFEFF/, "").split(`
|
|
579
579
|
`);
|
|
@@ -597,13 +597,13 @@ function Gt(t, e) {
|
|
|
597
597
|
const m = /^(Dialogue|Comment):\s*(.+)$/i.exec(f);
|
|
598
598
|
if (!m || m[1].toLowerCase() === "comment" || a.length === 0) continue;
|
|
599
599
|
const u = a.length, w = m[2].split(","), C = w.slice(0, u - 1), x = w.slice(u - 1).join(","), _ = {};
|
|
600
|
-
a.forEach((y,
|
|
601
|
-
_[y] =
|
|
600
|
+
a.forEach((y, L) => {
|
|
601
|
+
_[y] = L === u - 1 ? x : C[L] ?? "";
|
|
602
602
|
});
|
|
603
|
-
const
|
|
603
|
+
const P = It(_.Start || ""), k = It(_.End || ""), M = (_.Text || "").replace(/\\N/g, `
|
|
604
604
|
`).replace(/\\n/g, `
|
|
605
605
|
`).replace(/\\h/g, " ").replace(/\{[^}]*\}/g, "");
|
|
606
|
-
n.push({ start:
|
|
606
|
+
n.push({ start: P, end: k, text: M, style: _.Style });
|
|
607
607
|
}
|
|
608
608
|
return n.sort((s, l) => s.start - l.start), {
|
|
609
609
|
format: e,
|
|
@@ -612,7 +612,7 @@ function Gt(t, e) {
|
|
|
612
612
|
`).trim() || void 0
|
|
613
613
|
};
|
|
614
614
|
}
|
|
615
|
-
function
|
|
615
|
+
function B(t) {
|
|
616
616
|
const e = t.trim();
|
|
617
617
|
if (!e) return 0;
|
|
618
618
|
const o = /^(\d+(?:\.\d+)?)(h|m|s|ms|f|t)$/i.exec(e);
|
|
@@ -623,18 +623,18 @@ function q(t) {
|
|
|
623
623
|
const r = e.split(":");
|
|
624
624
|
return r.length === 3 ? Number(r[0]) * 3600 + Number(r[1]) * 60 + Number(r[2]) : r.length === 2 ? Number(r[0]) * 60 + Number(r[1]) : Number(e) || 0;
|
|
625
625
|
}
|
|
626
|
-
function
|
|
626
|
+
function Qe(t) {
|
|
627
627
|
return t.replace(/&#x([0-9a-fA-F]+);/g, (e, o) => String.fromCharCode(parseInt(o, 16))).replace(/&#(\d+);/g, (e, o) => String.fromCharCode(Number(o))).replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, " ").replace(/&/g, "&");
|
|
628
628
|
}
|
|
629
|
-
function
|
|
629
|
+
function to(t) {
|
|
630
630
|
var e, o, r;
|
|
631
631
|
const a = [], n = /<(?:[\w-]+:)?p\b([^>]*)>([\s\S]*?)<\/(?:[\w-]+:)?p\s*>/gi;
|
|
632
632
|
let i;
|
|
633
633
|
for (; (i = n.exec(t)) !== null; ) {
|
|
634
|
-
const s = i[1], l = i[2], f = ((e = /\bbegin\s*=\s*["']([^"']+)["']/i.exec(s)) == null ? void 0 : e[1]) || "", c = ((o = /\bend\s*=\s*["']([^"']+)["']/i.exec(s)) == null ? void 0 : o[1]) || "", d = ((r = /\bdur\s*=\s*["']([^"']+)["']/i.exec(s)) == null ? void 0 : r[1]) || "", m =
|
|
634
|
+
const s = i[1], l = i[2], f = ((e = /\bbegin\s*=\s*["']([^"']+)["']/i.exec(s)) == null ? void 0 : e[1]) || "", c = ((o = /\bend\s*=\s*["']([^"']+)["']/i.exec(s)) == null ? void 0 : o[1]) || "", d = ((r = /\bdur\s*=\s*["']([^"']+)["']/i.exec(s)) == null ? void 0 : r[1]) || "", m = B(f);
|
|
635
635
|
let u;
|
|
636
|
-
c ? u =
|
|
637
|
-
const w =
|
|
636
|
+
c ? u = B(c) : d ? u = m + B(d) : u = m + 5;
|
|
637
|
+
const w = Qe(
|
|
638
638
|
l.replace(/<(?:[\w-]+:)?br\s*\/?>/gi, `
|
|
639
639
|
`).replace(/<[^>]+>/g, "")
|
|
640
640
|
).replace(/[ \t]+/g, " ").replace(/\n /g, `
|
|
@@ -643,7 +643,7 @@ function io(t) {
|
|
|
643
643
|
}
|
|
644
644
|
return a.sort((s, l) => s.start - l.start), { format: "ttml", cues: a };
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function eo(t) {
|
|
647
647
|
const e = t.replace(/^\uFEFF/, "");
|
|
648
648
|
if (typeof DOMParser < "u") {
|
|
649
649
|
const o = new DOMParser().parseFromString(e, "application/xml");
|
|
@@ -652,9 +652,9 @@ function so(t) {
|
|
|
652
652
|
if (r.length > 0) {
|
|
653
653
|
const a = [];
|
|
654
654
|
for (let n = 0; n < r.length; n++) {
|
|
655
|
-
const i = r[n], s = i.getAttribute("begin") || "", l = i.getAttribute("end") || "", f = i.getAttribute("dur") || "", c =
|
|
655
|
+
const i = r[n], s = i.getAttribute("begin") || "", l = i.getAttribute("end") || "", f = i.getAttribute("dur") || "", c = B(s);
|
|
656
656
|
let d;
|
|
657
|
-
l ? d =
|
|
657
|
+
l ? d = B(l) : f ? d = c + B(f) : d = c + 5;
|
|
658
658
|
let m = "";
|
|
659
659
|
i.childNodes.forEach((w) => {
|
|
660
660
|
if (w.nodeType === 3)
|
|
@@ -673,31 +673,31 @@ function so(t) {
|
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
|
-
return
|
|
676
|
+
return to(e);
|
|
677
677
|
}
|
|
678
|
-
function
|
|
679
|
-
switch (e ??
|
|
678
|
+
function yr(t, e) {
|
|
679
|
+
switch (e ?? Ke(t)) {
|
|
680
680
|
case "lrc":
|
|
681
|
-
return
|
|
681
|
+
return Je(t);
|
|
682
682
|
case "elrc":
|
|
683
|
-
return
|
|
683
|
+
return Ye(t);
|
|
684
684
|
case "ass":
|
|
685
|
-
return
|
|
685
|
+
return Vt(t, "ass");
|
|
686
686
|
case "ssa":
|
|
687
|
-
return
|
|
687
|
+
return Vt(t, "ssa");
|
|
688
688
|
case "ttml":
|
|
689
|
-
return
|
|
689
|
+
return eo(t);
|
|
690
690
|
case "vtt":
|
|
691
|
-
return
|
|
691
|
+
return Zt(t, "vtt");
|
|
692
692
|
case "srt":
|
|
693
693
|
default:
|
|
694
|
-
return
|
|
694
|
+
return Zt(t, "srt");
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
async function
|
|
698
|
-
return
|
|
697
|
+
async function Fr(t) {
|
|
698
|
+
return Ee.loadAsync(t);
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function _r(t) {
|
|
701
701
|
const e = [];
|
|
702
702
|
return t.forEach((o, r) => {
|
|
703
703
|
var a;
|
|
@@ -712,7 +712,7 @@ function Rr(t) {
|
|
|
712
712
|
});
|
|
713
713
|
}), e;
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function kr(t) {
|
|
716
716
|
const e = { name: "", path: "", isDir: !0, children: [], size: 0 }, o = /* @__PURE__ */ new Map();
|
|
717
717
|
o.set("", e);
|
|
718
718
|
const r = (n) => {
|
|
@@ -746,16 +746,16 @@ function Mr(t) {
|
|
|
746
746
|
};
|
|
747
747
|
return a(e), e;
|
|
748
748
|
}
|
|
749
|
-
async function
|
|
749
|
+
async function Cr(t, e, o) {
|
|
750
750
|
const r = t.file(e);
|
|
751
751
|
if (!r) throw new Error(`ZIP entry not found: ${e}`);
|
|
752
752
|
const a = await r.async("arraybuffer");
|
|
753
753
|
return new Blob([a], o ? { type: o } : void 0);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function oo(t) {
|
|
756
756
|
return t ? t.startsWith("#") ? t : t.length === 8 ? "#" + t.substring(2) : t.length === 6 ? "#" + t : "#000000" : "#000000";
|
|
757
757
|
}
|
|
758
|
-
const
|
|
758
|
+
const ro = [
|
|
759
759
|
"FFFFFF",
|
|
760
760
|
"000000",
|
|
761
761
|
"E7E6E6",
|
|
@@ -766,7 +766,7 @@ const po = [
|
|
|
766
766
|
"FFC000",
|
|
767
767
|
"5B9BD5",
|
|
768
768
|
"70AD47"
|
|
769
|
-
],
|
|
769
|
+
], no = [
|
|
770
770
|
"000000",
|
|
771
771
|
"FFFFFF",
|
|
772
772
|
"FF0000",
|
|
@@ -832,48 +832,48 @@ const po = [
|
|
|
832
832
|
"333399",
|
|
833
833
|
"333333"
|
|
834
834
|
];
|
|
835
|
-
function
|
|
835
|
+
function ao(t, e) {
|
|
836
836
|
const o = parseInt(t.substring(0, 2), 16), r = parseInt(t.substring(2, 4), 16), a = parseInt(t.substring(4, 6), 16), n = (f) => e < 0 ? Math.round(f * (1 + e)) : Math.round(f + (255 - f) * e), i = Math.min(255, Math.max(0, n(o))), s = Math.min(255, Math.max(0, n(r))), l = Math.min(255, Math.max(0, n(a)));
|
|
837
837
|
return i.toString(16).padStart(2, "0") + s.toString(16).padStart(2, "0") + l.toString(16).padStart(2, "0");
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function io(t) {
|
|
840
840
|
if (t && t.type === "pattern" && t.pattern === "solid") {
|
|
841
841
|
const e = t.fgColor;
|
|
842
842
|
if (e)
|
|
843
|
-
return
|
|
843
|
+
return lt(e);
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function lt(t) {
|
|
847
847
|
if (t) {
|
|
848
848
|
if ("argb" in t && typeof t.argb == "string" && t.argb)
|
|
849
|
-
return
|
|
849
|
+
return oo(t.argb);
|
|
850
850
|
if ("theme" in t && typeof t.theme == "number") {
|
|
851
|
-
const e =
|
|
852
|
-
return "#" + (o !== 0 ?
|
|
851
|
+
const e = ro[t.theme] || "000000", o = "tint" in t && typeof t.tint == "number" ? t.tint : 0;
|
|
852
|
+
return "#" + (o !== 0 ? ao(e, o) : e);
|
|
853
853
|
}
|
|
854
854
|
if ("indexed" in t && typeof t.indexed == "number") {
|
|
855
|
-
const e =
|
|
855
|
+
const e = no[t.indexed];
|
|
856
856
|
if (e) return "#" + e;
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
function
|
|
860
|
+
function so(t) {
|
|
861
861
|
if (!t || !t.style) return;
|
|
862
|
-
const e =
|
|
862
|
+
const e = lt(t.color) || "#000000";
|
|
863
863
|
return [t.style, e];
|
|
864
864
|
}
|
|
865
|
-
function
|
|
865
|
+
function lo(t) {
|
|
866
866
|
const e = {};
|
|
867
867
|
let o = !1;
|
|
868
868
|
if (t.font) {
|
|
869
869
|
const a = t.font;
|
|
870
870
|
if ((a.name || a.size || a.bold || a.italic) && (o = !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) {
|
|
871
|
-
const n =
|
|
871
|
+
const n = lt(a.color);
|
|
872
872
|
n && (o = !0, e.color = n);
|
|
873
873
|
}
|
|
874
874
|
a.underline && (o = !0, e.underline = !0), a.strike && (o = !0, e.strike = !0);
|
|
875
875
|
}
|
|
876
|
-
const r =
|
|
876
|
+
const r = io(t.fill);
|
|
877
877
|
if (r && (o = !0, e.bgcolor = r), t.alignment) {
|
|
878
878
|
const a = t.alignment;
|
|
879
879
|
a.horizontal && (o = !0, e.align = a.horizontal), a.vertical && (o = !0, e.valign = a.vertical), a.wrapText && (o = !0, e.textwrap = !0);
|
|
@@ -883,25 +883,25 @@ function ho(t) {
|
|
|
883
883
|
let n = !1;
|
|
884
884
|
const i = ["top", "bottom", "left", "right"];
|
|
885
885
|
for (const s of i) {
|
|
886
|
-
const l =
|
|
886
|
+
const l = so(t.border[s]);
|
|
887
887
|
l && (a[s] = l, n = !0);
|
|
888
888
|
}
|
|
889
889
|
n && (o = !0, e.border = a);
|
|
890
890
|
}
|
|
891
891
|
return o ? e : null;
|
|
892
892
|
}
|
|
893
|
-
function
|
|
893
|
+
function po(t) {
|
|
894
894
|
return JSON.stringify(t);
|
|
895
895
|
}
|
|
896
|
-
function
|
|
897
|
-
const r =
|
|
896
|
+
function fo(t, e, o) {
|
|
897
|
+
const r = lo(t);
|
|
898
898
|
if (!r) return -1;
|
|
899
|
-
const a =
|
|
899
|
+
const a = po(r), n = o.get(a);
|
|
900
900
|
if (n !== void 0) return n;
|
|
901
901
|
const i = e.length;
|
|
902
902
|
return e.push(r), o.set(a, i), i;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function co(t) {
|
|
905
905
|
const e = t.value;
|
|
906
906
|
if (e == null) return "";
|
|
907
907
|
if (typeof e == "string") return e;
|
|
@@ -915,8 +915,8 @@ function wo(t) {
|
|
|
915
915
|
}
|
|
916
916
|
return typeof e == "object" && "richText" in e ? e.richText.map((o) => o.text).join("") : typeof e == "object" && "hyperlink" in e ? e.text || "" : typeof e == "object" && "error" in e ? String(e.error) : String(e);
|
|
917
917
|
}
|
|
918
|
-
function
|
|
919
|
-
const e = t.split(":"), o =
|
|
918
|
+
function uo(t) {
|
|
919
|
+
const e = t.split(":"), o = Bt(e[0]), r = e[1] ? Bt(e[1]) : o;
|
|
920
920
|
return {
|
|
921
921
|
top: o.row,
|
|
922
922
|
left: o.col,
|
|
@@ -924,7 +924,7 @@ function vo(t) {
|
|
|
924
924
|
right: r.col
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function Bt(t) {
|
|
928
928
|
const e = t.match(/^([A-Z]+)(\d+)$/);
|
|
929
929
|
if (!e) return { row: 1, col: 1 };
|
|
930
930
|
const o = e[1], r = parseInt(e[2], 10);
|
|
@@ -933,7 +933,7 @@ function Xt(t) {
|
|
|
933
933
|
a = a * 26 + (o.charCodeAt(n) - 64);
|
|
934
934
|
return { row: r, col: a };
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function Nr(t) {
|
|
937
937
|
const e = [];
|
|
938
938
|
return t.eachSheet((o) => {
|
|
939
939
|
const r = [], a = /* @__PURE__ */ new Map(), n = [], i = {}, s = {}, l = o.columnCount;
|
|
@@ -945,18 +945,18 @@ function Pr(t) {
|
|
|
945
945
|
const f = /* @__PURE__ */ new Map(), c = o.model, d = (c == null ? void 0 : c.merges) || [];
|
|
946
946
|
for (const m of d) {
|
|
947
947
|
n.push(m);
|
|
948
|
-
const { top: u, left: w, bottom: C, right: x } =
|
|
949
|
-
f.set(`${u - 1},${w - 1}`, [_,
|
|
948
|
+
const { top: u, left: w, bottom: C, right: x } = uo(m), _ = C - u, P = x - w;
|
|
949
|
+
f.set(`${u - 1},${w - 1}`, [_, P]);
|
|
950
950
|
}
|
|
951
951
|
o.eachRow({ includeEmpty: !0 }, (m, u) => {
|
|
952
952
|
const w = u - 1, C = {};
|
|
953
|
-
m.eachCell({ includeEmpty: !1 }, (_,
|
|
954
|
-
const k =
|
|
953
|
+
m.eachCell({ includeEmpty: !1 }, (_, P) => {
|
|
954
|
+
const k = P - 1;
|
|
955
955
|
if (_.isMerged && _.master !== _) return;
|
|
956
|
-
const M =
|
|
957
|
-
y !== -1 && (
|
|
956
|
+
const M = co(_), y = fo(_, r, a), L = { text: M };
|
|
957
|
+
y !== -1 && (L.style = y);
|
|
958
958
|
const W = `${w},${k}`;
|
|
959
|
-
f.has(W) && (
|
|
959
|
+
f.has(W) && (L.merge = f.get(W)), C[String(k)] = L;
|
|
960
960
|
});
|
|
961
961
|
const x = { cells: C };
|
|
962
962
|
m.height && (x.height = Math.round(m.height * 1.333)), i[String(w)] = x;
|
|
@@ -969,7 +969,7 @@ function Pr(t) {
|
|
|
969
969
|
});
|
|
970
970
|
}), e;
|
|
971
971
|
}
|
|
972
|
-
function
|
|
972
|
+
function Rr(t, e, o = "Sheet1") {
|
|
973
973
|
const r = t.length > 0, a = r ? [{ font: { bold: !0 } }] : [], n = {};
|
|
974
974
|
if (r) {
|
|
975
975
|
const s = {};
|
|
@@ -985,7 +985,7 @@ function Tr(t, e, o = "Sheet1") {
|
|
|
985
985
|
}), n[String(l + i)] = { cells: f };
|
|
986
986
|
}), [{ name: o, styles: a, rows: n }];
|
|
987
987
|
}
|
|
988
|
-
function
|
|
988
|
+
function mo(t, e) {
|
|
989
989
|
var o;
|
|
990
990
|
if (typeof window > "u") return;
|
|
991
991
|
const r = (t == null ? void 0 : t.version) || ((o = t == null ? void 0 : t.GlobalWorkerOptions) == null ? void 0 : o.version) || "", {
|
|
@@ -995,7 +995,7 @@ function xo(t, e) {
|
|
|
995
995
|
} = e || {};
|
|
996
996
|
t.GlobalWorkerOptions && (t.GlobalWorkerOptions.workerSrc = a, t.GlobalWorkerOptions.cMapUrl = n, t.GlobalWorkerOptions.cMapPacked = i);
|
|
997
997
|
}
|
|
998
|
-
const
|
|
998
|
+
const ho = {
|
|
999
999
|
// ─────── common ───────
|
|
1000
1000
|
"common.download": "下载",
|
|
1001
1001
|
"common.close": "关闭",
|
|
@@ -1112,7 +1112,7 @@ const yo = {
|
|
|
1112
1112
|
"font.meta.glyphs": "字形数量",
|
|
1113
1113
|
"font.meta.format": "格式",
|
|
1114
1114
|
"font.sample_text_placeholder": "输入自定义文本..."
|
|
1115
|
-
},
|
|
1115
|
+
}, go = {
|
|
1116
1116
|
// ─────── common ───────
|
|
1117
1117
|
"common.download": "Download",
|
|
1118
1118
|
"common.close": "Close",
|
|
@@ -1229,25 +1229,25 @@ const yo = {
|
|
|
1229
1229
|
"font.meta.glyphs": "Glyphs",
|
|
1230
1230
|
"font.meta.format": "Format",
|
|
1231
1231
|
"font.sample_text_placeholder": "Type custom text..."
|
|
1232
|
-
},
|
|
1233
|
-
"zh-CN":
|
|
1234
|
-
"en-US":
|
|
1235
|
-
},
|
|
1236
|
-
function
|
|
1237
|
-
return e ? t.replace(
|
|
1232
|
+
}, J = {
|
|
1233
|
+
"zh-CN": ho,
|
|
1234
|
+
"en-US": go
|
|
1235
|
+
}, bo = /\{(\w+)\}/g;
|
|
1236
|
+
function wo(t, e) {
|
|
1237
|
+
return e ? t.replace(bo, (o, r) => {
|
|
1238
1238
|
const a = e[r];
|
|
1239
1239
|
return a === void 0 ? `{${r}}` : String(a);
|
|
1240
1240
|
}) : t;
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function pt(t) {
|
|
1243
1243
|
var e;
|
|
1244
|
-
const o = t.fallbackLocale ?? "zh-CN", r =
|
|
1244
|
+
const o = t.fallbackLocale ?? "zh-CN", r = J[t.locale] ?? J[o] ?? J["zh-CN"], a = (e = t.messages) == null ? void 0 : e[t.locale], n = a ? { ...r, ...a } : r, i = J["zh-CN"];
|
|
1245
1245
|
return (s, l) => {
|
|
1246
1246
|
const f = n[s] ?? i[s] ?? s;
|
|
1247
|
-
return
|
|
1247
|
+
return wo(f, l);
|
|
1248
1248
|
};
|
|
1249
1249
|
}
|
|
1250
|
-
const
|
|
1250
|
+
const vo = {
|
|
1251
1251
|
// 标准图片格式
|
|
1252
1252
|
jpg: "image/jpeg",
|
|
1253
1253
|
jpeg: "image/jpeg",
|
|
@@ -1328,16 +1328,16 @@ const Co = {
|
|
|
1328
1328
|
ttml: "application/ttml+xml",
|
|
1329
1329
|
dfxp: "application/ttml+xml"
|
|
1330
1330
|
};
|
|
1331
|
-
function
|
|
1331
|
+
function xo(t) {
|
|
1332
1332
|
const e = t.toLowerCase();
|
|
1333
|
-
return
|
|
1333
|
+
return vo[e] || "application/octet-stream";
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1335
|
+
function yo(t) {
|
|
1336
1336
|
var e;
|
|
1337
1337
|
const o = ((e = t.split(".").pop()) == null ? void 0 : e.toLowerCase()) || "";
|
|
1338
|
-
return
|
|
1338
|
+
return xo(o);
|
|
1339
1339
|
}
|
|
1340
|
-
function
|
|
1340
|
+
function Fo(t) {
|
|
1341
1341
|
return [
|
|
1342
1342
|
"image/heic",
|
|
1343
1343
|
"image/heif",
|
|
@@ -1354,33 +1354,33 @@ function Mo(t) {
|
|
|
1354
1354
|
"image/jpx"
|
|
1355
1355
|
].includes(t);
|
|
1356
1356
|
}
|
|
1357
|
-
const
|
|
1358
|
-
async function
|
|
1359
|
-
if (
|
|
1360
|
-
return
|
|
1361
|
-
if (!
|
|
1357
|
+
const ot = /* @__PURE__ */ new Map();
|
|
1358
|
+
async function Mr(t) {
|
|
1359
|
+
if (ot.has(t))
|
|
1360
|
+
return ot.get(t);
|
|
1361
|
+
if (!Fo(t))
|
|
1362
1362
|
return null;
|
|
1363
1363
|
try {
|
|
1364
1364
|
let e = null;
|
|
1365
|
-
return t === "image/heic" || t === "image/heif" ? e = (await import("./heicLoader-CH_raQNn-1fBLaICM.mjs")).default : t === "image/avif" ? e = (await import("./avifLoader-BP3fgcMm-BnpxLhxp.mjs")).default : t === "image/tiff" ? e = (await import("./tiffLoader-CTFKVLqJ-B84NfwhR.mjs")).default : t === "image/x-canon-cr2" || t === "image/x-nikon-nef" || t === "image/x-sony-arw" || t === "image/x-adobe-dng" || t === "image/x-fuji-raf" || t === "image/x-olympus-orf" ? e = (await import("./rawLoader-0mLvxCNp-CJmERiK7.mjs")).default : t === "image/vnd.adobe.photoshop" ? e = (await import("./psdLoader-Doxw3mWm-DVOGFSlh.mjs")).default : (t === "image/jp2" || t === "image/jpx") && (e = (await import("./jp2Loader-Bn-qPMbD-Bn-qPMbD.mjs")).default), e &&
|
|
1365
|
+
return t === "image/heic" || t === "image/heif" ? e = (await import("./heicLoader-CH_raQNn-1fBLaICM.mjs")).default : t === "image/avif" ? e = (await import("./avifLoader-BP3fgcMm-BnpxLhxp.mjs")).default : t === "image/tiff" ? e = (await import("./tiffLoader-CTFKVLqJ-B84NfwhR.mjs")).default : t === "image/x-canon-cr2" || t === "image/x-nikon-nef" || t === "image/x-sony-arw" || t === "image/x-adobe-dng" || t === "image/x-fuji-raf" || t === "image/x-olympus-orf" ? e = (await import("./rawLoader-0mLvxCNp-CJmERiK7.mjs")).default : t === "image/vnd.adobe.photoshop" ? e = (await import("./psdLoader-Doxw3mWm-DVOGFSlh.mjs")).default : (t === "image/jp2" || t === "image/jpx") && (e = (await import("./jp2Loader-Bn-qPMbD-Bn-qPMbD.mjs")).default), e && ot.set(t, e), e;
|
|
1366
1366
|
} catch (e) {
|
|
1367
1367
|
return console.warn(`Failed to load image decoder for ${t}:`, e), null;
|
|
1368
1368
|
}
|
|
1369
1369
|
}
|
|
1370
|
-
async function
|
|
1370
|
+
async function Pr(t) {
|
|
1371
1371
|
if (t.type && t.type !== "application/octet-stream")
|
|
1372
1372
|
return t.type;
|
|
1373
|
-
const e =
|
|
1373
|
+
const e = yo(t.name);
|
|
1374
1374
|
if (e !== "application/octet-stream")
|
|
1375
1375
|
return e;
|
|
1376
1376
|
if (t instanceof Blob || t instanceof File) {
|
|
1377
|
-
const o = await
|
|
1377
|
+
const o = await _o(t);
|
|
1378
1378
|
if (o !== "application/octet-stream")
|
|
1379
1379
|
return o;
|
|
1380
1380
|
}
|
|
1381
1381
|
return "application/octet-stream";
|
|
1382
1382
|
}
|
|
1383
|
-
async function
|
|
1383
|
+
async function _o(t) {
|
|
1384
1384
|
try {
|
|
1385
1385
|
const e = new Uint8Array(await t.slice(0, 12).arrayBuffer());
|
|
1386
1386
|
if (e[4] === 102 && e[5] === 116 && e[6] === 121 && e[7] === 112) {
|
|
@@ -1401,34 +1401,34 @@ async function jo(t) {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
return "application/octet-stream";
|
|
1403
1403
|
}
|
|
1404
|
-
const
|
|
1404
|
+
const ft = at(null), ko = ({
|
|
1405
1405
|
locale: t = "zh-CN",
|
|
1406
1406
|
messages: e,
|
|
1407
1407
|
children: o
|
|
1408
1408
|
}) => {
|
|
1409
|
-
const r =
|
|
1410
|
-
const a =
|
|
1409
|
+
const r = I(() => {
|
|
1410
|
+
const a = pt({ locale: t, messages: e });
|
|
1411
1411
|
return { locale: t, t: a };
|
|
1412
1412
|
}, [t, e]);
|
|
1413
|
-
return /* @__PURE__ */ p(
|
|
1413
|
+
return /* @__PURE__ */ p(ft.Provider, { value: r, children: o });
|
|
1414
1414
|
};
|
|
1415
|
-
let
|
|
1416
|
-
function
|
|
1417
|
-
return
|
|
1415
|
+
let rt = null;
|
|
1416
|
+
function Co() {
|
|
1417
|
+
return rt || (rt = pt({ locale: "zh-CN" })), rt;
|
|
1418
1418
|
}
|
|
1419
|
-
function
|
|
1420
|
-
const t =
|
|
1421
|
-
return (t == null ? void 0 : t.t) ??
|
|
1419
|
+
function re() {
|
|
1420
|
+
const t = q(ft);
|
|
1421
|
+
return (t == null ? void 0 : t.t) ?? Co();
|
|
1422
1422
|
}
|
|
1423
|
-
function
|
|
1424
|
-
const t =
|
|
1423
|
+
function jr() {
|
|
1424
|
+
const t = q(ft);
|
|
1425
1425
|
return (t == null ? void 0 : t.locale) ?? "zh-CN";
|
|
1426
1426
|
}
|
|
1427
|
-
const
|
|
1428
|
-
function
|
|
1429
|
-
return
|
|
1427
|
+
const ne = at(null), No = ({ theme: t, children: e }) => /* @__PURE__ */ p(ne.Provider, { value: t, children: e });
|
|
1428
|
+
function zr() {
|
|
1429
|
+
return q(ne) ?? "dark";
|
|
1430
1430
|
}
|
|
1431
|
-
const
|
|
1431
|
+
const Ro = ({ className: t }) => /* @__PURE__ */ p(
|
|
1432
1432
|
"svg",
|
|
1433
1433
|
{
|
|
1434
1434
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1442,55 +1442,55 @@ const So = ({ className: t }) => /* @__PURE__ */ p(
|
|
|
1442
1442
|
children: /* @__PURE__ */ p("text", { x: "12", y: "17.5", textAnchor: "middle", fontSize: "20", fontWeight: "bold", fill: "currentColor", stroke: "none", children: "1:1" })
|
|
1443
1443
|
}
|
|
1444
1444
|
);
|
|
1445
|
-
function
|
|
1445
|
+
function Mo(t) {
|
|
1446
1446
|
return [
|
|
1447
1447
|
{
|
|
1448
1448
|
items: [
|
|
1449
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1449
|
+
{ type: "button", icon: /* @__PURE__ */ p(qt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
|
|
1450
1450
|
{ type: "text", content: `${Math.round(t.zoom * 100)}%`, minWidth: "3rem" },
|
|
1451
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1451
|
+
{ type: "button", icon: /* @__PURE__ */ p(Gt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
|
|
1452
1452
|
]
|
|
1453
1453
|
},
|
|
1454
1454
|
{
|
|
1455
1455
|
items: [
|
|
1456
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1457
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1456
|
+
{ type: "button", icon: /* @__PURE__ */ p(Me, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.fit_to_window"), action: t.onFitToWidth },
|
|
1457
|
+
{ type: "button", icon: /* @__PURE__ */ p(Ro, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.original_size"), action: t.onOriginalSize }
|
|
1458
1458
|
]
|
|
1459
1459
|
},
|
|
1460
1460
|
{
|
|
1461
1461
|
items: [
|
|
1462
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1463
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1462
|
+
{ type: "button", icon: /* @__PURE__ */ p(Pe, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_left"), action: t.onRotateLeft },
|
|
1463
|
+
{ type: "button", icon: /* @__PURE__ */ p(je, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.rotate_right"), action: t.onRotateRight }
|
|
1464
1464
|
]
|
|
1465
1465
|
},
|
|
1466
1466
|
{
|
|
1467
1467
|
items: [
|
|
1468
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1468
|
+
{ type: "button", icon: /* @__PURE__ */ p(Xt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
|
|
1469
1469
|
]
|
|
1470
1470
|
}
|
|
1471
1471
|
];
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1473
|
+
function Po(t) {
|
|
1474
1474
|
return [
|
|
1475
1475
|
{
|
|
1476
1476
|
items: [
|
|
1477
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1477
|
+
{ type: "button", icon: /* @__PURE__ */ p(qt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_out"), action: t.onZoomOut, disabled: t.zoom <= 0.01 },
|
|
1478
1478
|
{ type: "text", content: `${Math.round(t.zoom * 100)}%`, minWidth: "3rem" },
|
|
1479
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1479
|
+
{ type: "button", icon: /* @__PURE__ */ p(Gt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.zoom_in"), action: t.onZoomIn, disabled: t.zoom >= 10 }
|
|
1480
1480
|
]
|
|
1481
1481
|
},
|
|
1482
1482
|
{
|
|
1483
1483
|
items: [
|
|
1484
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1484
|
+
{ type: "button", icon: /* @__PURE__ */ p(Xt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.reset"), action: t.onReset }
|
|
1485
1485
|
]
|
|
1486
1486
|
}
|
|
1487
1487
|
];
|
|
1488
1488
|
}
|
|
1489
|
-
function
|
|
1489
|
+
function jo(t) {
|
|
1490
1490
|
return [
|
|
1491
1491
|
{
|
|
1492
1492
|
items: [
|
|
1493
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1493
|
+
{ type: "button", icon: /* @__PURE__ */ p(Kt, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.toc"), action: () => {
|
|
1494
1494
|
var e;
|
|
1495
1495
|
return (e = t.epubRef.current) == null ? void 0 : e.toggleToc();
|
|
1496
1496
|
} }
|
|
@@ -1498,12 +1498,12 @@ function Wo(t) {
|
|
|
1498
1498
|
},
|
|
1499
1499
|
{
|
|
1500
1500
|
items: [
|
|
1501
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1501
|
+
{ type: "button", icon: /* @__PURE__ */ p(it, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.prev_page"), action: () => {
|
|
1502
1502
|
var e;
|
|
1503
1503
|
return (e = t.epubRef.current) == null ? void 0 : e.prevPage();
|
|
1504
1504
|
} },
|
|
1505
1505
|
{ type: "text", content: `${t.current} / ${t.total}`, minWidth: "4rem" },
|
|
1506
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1506
|
+
{ type: "button", icon: /* @__PURE__ */ p(st, { className: "rfp-w-4 rfp-h-4" }), tooltip: t.t("toolbar.next_page"), action: () => {
|
|
1507
1507
|
var e;
|
|
1508
1508
|
return (e = t.epubRef.current) == null ? void 0 : e.nextPage();
|
|
1509
1509
|
} }
|
|
@@ -1513,7 +1513,7 @@ function Wo(t) {
|
|
|
1513
1513
|
items: [
|
|
1514
1514
|
{
|
|
1515
1515
|
type: "button",
|
|
1516
|
-
icon: t.fullWidth ? /* @__PURE__ */ p(
|
|
1516
|
+
icon: t.fullWidth ? /* @__PURE__ */ p(Jt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ p(Yt, { className: "rfp-w-4 rfp-h-4" }),
|
|
1517
1517
|
tooltip: t.fullWidth ? t.t("toolbar.normal_width") : t.t("toolbar.full_width"),
|
|
1518
1518
|
action: () => {
|
|
1519
1519
|
var e;
|
|
@@ -1524,13 +1524,13 @@ function Wo(t) {
|
|
|
1524
1524
|
}
|
|
1525
1525
|
];
|
|
1526
1526
|
}
|
|
1527
|
-
function
|
|
1527
|
+
function zo(t) {
|
|
1528
1528
|
return [
|
|
1529
1529
|
{
|
|
1530
1530
|
items: [
|
|
1531
1531
|
{
|
|
1532
1532
|
type: "button",
|
|
1533
|
-
icon: /* @__PURE__ */ p(
|
|
1533
|
+
icon: /* @__PURE__ */ p(Kt, { className: "rfp-w-4 rfp-h-4" }),
|
|
1534
1534
|
tooltip: t.t("toolbar.toc"),
|
|
1535
1535
|
action: () => {
|
|
1536
1536
|
var e;
|
|
@@ -1543,7 +1543,7 @@ function $o(t) {
|
|
|
1543
1543
|
items: [
|
|
1544
1544
|
{
|
|
1545
1545
|
type: "button",
|
|
1546
|
-
icon: /* @__PURE__ */ p(
|
|
1546
|
+
icon: /* @__PURE__ */ p(it, { className: "rfp-w-4 rfp-h-4" }),
|
|
1547
1547
|
tooltip: t.t("toolbar.prev_page"),
|
|
1548
1548
|
action: () => {
|
|
1549
1549
|
var e;
|
|
@@ -1557,7 +1557,7 @@ function $o(t) {
|
|
|
1557
1557
|
},
|
|
1558
1558
|
{
|
|
1559
1559
|
type: "button",
|
|
1560
|
-
icon: /* @__PURE__ */ p(
|
|
1560
|
+
icon: /* @__PURE__ */ p(st, { className: "rfp-w-4 rfp-h-4" }),
|
|
1561
1561
|
tooltip: t.t("toolbar.next_page"),
|
|
1562
1562
|
action: () => {
|
|
1563
1563
|
var e;
|
|
@@ -1570,7 +1570,7 @@ function $o(t) {
|
|
|
1570
1570
|
items: [
|
|
1571
1571
|
{
|
|
1572
1572
|
type: "button",
|
|
1573
|
-
icon: t.fullWidth ? /* @__PURE__ */ p(
|
|
1573
|
+
icon: t.fullWidth ? /* @__PURE__ */ p(Jt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ p(Yt, { className: "rfp-w-4 rfp-h-4" }),
|
|
1574
1574
|
tooltip: t.fullWidth ? t.t("toolbar.normal_width") : t.t("toolbar.full_width"),
|
|
1575
1575
|
action: () => {
|
|
1576
1576
|
var e;
|
|
@@ -1581,26 +1581,26 @@ function $o(t) {
|
|
|
1581
1581
|
}
|
|
1582
1582
|
];
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1584
|
+
function To({ stats: t }) {
|
|
1585
1585
|
return t ? [
|
|
1586
1586
|
{
|
|
1587
1587
|
items: [
|
|
1588
1588
|
{
|
|
1589
1589
|
type: "text",
|
|
1590
|
-
content: `${t.files} files · ${t.dirs} dirs · ${
|
|
1590
|
+
content: `${t.files} files · ${t.dirs} dirs · ${Ze(t.size)}`,
|
|
1591
1591
|
minWidth: "10rem"
|
|
1592
1592
|
}
|
|
1593
1593
|
]
|
|
1594
1594
|
}
|
|
1595
1595
|
] : [];
|
|
1596
1596
|
}
|
|
1597
|
-
function
|
|
1597
|
+
function So(t) {
|
|
1598
1598
|
const e = [
|
|
1599
1599
|
{
|
|
1600
1600
|
items: [
|
|
1601
1601
|
{
|
|
1602
1602
|
type: "button",
|
|
1603
|
-
icon: /* @__PURE__ */ p(
|
|
1603
|
+
icon: /* @__PURE__ */ p(ze, { className: "rfp-w-4 rfp-h-4" }),
|
|
1604
1604
|
tooltip: t.wordWrap ? t.t("toolbar.wrap_off") : t.t("toolbar.wrap_on"),
|
|
1605
1605
|
action: t.onToggleWrap
|
|
1606
1606
|
}
|
|
@@ -1611,20 +1611,20 @@ function Ao(t) {
|
|
|
1611
1611
|
items: [
|
|
1612
1612
|
{
|
|
1613
1613
|
type: "button",
|
|
1614
|
-
icon: t.htmlPreview ? /* @__PURE__ */ p(
|
|
1614
|
+
icon: t.htmlPreview ? /* @__PURE__ */ p(Qt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ p(te, { className: "rfp-w-4 rfp-h-4" }),
|
|
1615
1615
|
tooltip: t.htmlPreview ? t.t("toolbar.source") : t.t("toolbar.preview"),
|
|
1616
1616
|
action: t.onToggleHtmlPreview
|
|
1617
1617
|
}
|
|
1618
1618
|
]
|
|
1619
1619
|
}), e;
|
|
1620
1620
|
}
|
|
1621
|
-
function
|
|
1621
|
+
function Eo(t) {
|
|
1622
1622
|
return [
|
|
1623
1623
|
{
|
|
1624
1624
|
items: [
|
|
1625
1625
|
{
|
|
1626
1626
|
type: "button",
|
|
1627
|
-
icon: t.viewMode === "preview" ? /* @__PURE__ */ p(
|
|
1627
|
+
icon: t.viewMode === "preview" ? /* @__PURE__ */ p(Qt, { className: "rfp-w-4 rfp-h-4" }) : /* @__PURE__ */ p(te, { className: "rfp-w-4 rfp-h-4" }),
|
|
1628
1628
|
tooltip: t.viewMode === "preview" ? t.t("toolbar.source") : t.t("toolbar.preview"),
|
|
1629
1629
|
action: t.onToggleViewMode
|
|
1630
1630
|
}
|
|
@@ -1632,35 +1632,35 @@ function Uo(t) {
|
|
|
1632
1632
|
}
|
|
1633
1633
|
];
|
|
1634
1634
|
}
|
|
1635
|
-
const
|
|
1635
|
+
const Lo = {
|
|
1636
1636
|
fetcher: (t, e) => fetch(t, e)
|
|
1637
|
-
},
|
|
1637
|
+
}, ct = at(Lo), Wo = ({
|
|
1638
1638
|
requestInit: t,
|
|
1639
1639
|
requestHandler: e,
|
|
1640
1640
|
shouldFetchAsBlob: o,
|
|
1641
1641
|
children: r
|
|
1642
1642
|
}) => {
|
|
1643
|
-
const a =
|
|
1643
|
+
const a = I(
|
|
1644
1644
|
() => ({
|
|
1645
|
-
fetcher:
|
|
1645
|
+
fetcher: He({ requestInit: t, requestHandler: e }),
|
|
1646
1646
|
shouldFetchAsBlob: o
|
|
1647
1647
|
}),
|
|
1648
1648
|
[t, e, o]
|
|
1649
1649
|
);
|
|
1650
|
-
return /* @__PURE__ */ p(
|
|
1650
|
+
return /* @__PURE__ */ p(ct.Provider, { value: a, children: r });
|
|
1651
1651
|
};
|
|
1652
|
-
function
|
|
1653
|
-
return
|
|
1652
|
+
function $o() {
|
|
1653
|
+
return q(ct).fetcher;
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1656
|
-
const { fetcher: e, shouldFetchAsBlob: o } =
|
|
1657
|
-
return
|
|
1655
|
+
function Do(t) {
|
|
1656
|
+
const { fetcher: e, shouldFetchAsBlob: o } = q(ct), r = !!(t && (o != null && o(t))), [a, n] = F(""), i = V(null);
|
|
1657
|
+
return E(() => {
|
|
1658
1658
|
if (!t || !r) {
|
|
1659
1659
|
i.current && (URL.revokeObjectURL(i.current), i.current = null), n("");
|
|
1660
1660
|
return;
|
|
1661
1661
|
}
|
|
1662
1662
|
let s = !1;
|
|
1663
|
-
return n(""),
|
|
1663
|
+
return n(""), qe(t.url, e).then((l) => {
|
|
1664
1664
|
if (s) {
|
|
1665
1665
|
URL.revokeObjectURL(l);
|
|
1666
1666
|
return;
|
|
@@ -1671,88 +1671,88 @@ function Zo(t) {
|
|
|
1671
1671
|
}), () => {
|
|
1672
1672
|
s = !0;
|
|
1673
1673
|
};
|
|
1674
|
-
}, [t == null ? void 0 : t.id, t == null ? void 0 : t.url, r, e]),
|
|
1674
|
+
}, [t == null ? void 0 : t.id, t == null ? void 0 : t.url, r, e]), E(() => () => {
|
|
1675
1675
|
i.current && (URL.revokeObjectURL(i.current), i.current = null);
|
|
1676
1676
|
}, []), t ? r ? a : t.url : "";
|
|
1677
1677
|
}
|
|
1678
|
-
const
|
|
1679
|
-
() => import("./index-
|
|
1678
|
+
const Ao = R(
|
|
1679
|
+
() => import("./index-DtZwBUd0.mjs").then((t) => ({ default: t.ImageRenderer }))
|
|
1680
|
+
), Uo = R(
|
|
1681
|
+
() => import("./index-BvjPzMFc.mjs").then((t) => ({ default: t.PdfRenderer }))
|
|
1682
|
+
), Oo = R(
|
|
1683
|
+
() => import("./index-CIqtwqgy.mjs").then((t) => ({ default: t.DocxRenderer }))
|
|
1684
|
+
), Zo = R(
|
|
1685
|
+
() => import("./index-sft0uUd7.mjs").then((t) => ({ default: t.XlsxRenderer }))
|
|
1686
|
+
), Io = R(
|
|
1687
|
+
() => import("./index-BgMhDDkd.mjs").then((t) => ({ default: t.PptxRenderer }))
|
|
1688
|
+
), Vo = R(
|
|
1689
|
+
() => import("./index-DqXfw2eb.mjs").then((t) => ({ default: t.MsgRenderer }))
|
|
1690
|
+
), Bo = R(
|
|
1691
|
+
() => import("./index-Ctf8mG_u.mjs").then((t) => ({ default: t.EpubRenderer }))
|
|
1680
1692
|
), Ho = R(
|
|
1681
|
-
() => import("./index-
|
|
1693
|
+
() => import("./index-DN4Lc1dx.mjs").then((t) => ({ default: t.MobiRenderer }))
|
|
1682
1694
|
), qo = R(
|
|
1683
|
-
() => import("./index-
|
|
1695
|
+
() => import("./index-B2IlXQPc.mjs").then((t) => ({ default: t.VideoRenderer }))
|
|
1684
1696
|
), Go = R(
|
|
1685
|
-
() => import("./index-
|
|
1697
|
+
() => import("./index-p4mew8Hx.mjs").then((t) => ({ default: t.AudioRenderer }))
|
|
1686
1698
|
), Xo = R(
|
|
1687
|
-
() => import("./index-
|
|
1699
|
+
() => import("./index-CRn7LdHD.mjs").then((t) => ({ default: t.MarkdownRenderer }))
|
|
1688
1700
|
), Ko = R(
|
|
1689
|
-
() => import("./index-
|
|
1701
|
+
() => import("./index-_EpQHlUY.mjs").then((t) => ({ default: t.JsonRenderer }))
|
|
1690
1702
|
), Jo = R(
|
|
1691
|
-
() => import("./index-
|
|
1703
|
+
() => import("./index-DZxzCMp2.mjs").then((t) => ({ default: t.CsvRenderer }))
|
|
1692
1704
|
), Yo = R(
|
|
1693
|
-
() => import("./index-
|
|
1705
|
+
() => import("./index-C8r2-Evl.mjs").then((t) => ({ default: t.XmlRenderer }))
|
|
1694
1706
|
), Qo = R(
|
|
1695
|
-
() => import("./index-
|
|
1707
|
+
() => import("./index-B0QA380T.mjs").then((t) => ({ default: t.SubtitleRenderer }))
|
|
1696
1708
|
), tr = R(
|
|
1697
|
-
() => import("./index-
|
|
1709
|
+
() => import("./index-DfkP0zX3.mjs").then((t) => ({ default: t.ZipRenderer }))
|
|
1698
1710
|
), er = R(
|
|
1699
|
-
() => import("./index-
|
|
1711
|
+
() => import("./index-8pqs-pW7.mjs").then((t) => ({ default: t.TextRenderer }))
|
|
1700
1712
|
), or = R(
|
|
1701
|
-
() => import("./index-
|
|
1702
|
-
),
|
|
1703
|
-
() => import("./index-qOC5xQyK.mjs").then((t) => ({ default: t.CsvRenderer }))
|
|
1704
|
-
), nr = R(
|
|
1705
|
-
() => import("./index-B57rEPin.mjs").then((t) => ({ default: t.XmlRenderer }))
|
|
1706
|
-
), ar = R(
|
|
1707
|
-
() => import("./index-CCkHAeLh.mjs").then((t) => ({ default: t.SubtitleRenderer }))
|
|
1708
|
-
), ir = R(
|
|
1709
|
-
() => import("./index-nLTQXCV7.mjs").then((t) => ({ default: t.ZipRenderer }))
|
|
1710
|
-
), sr = R(
|
|
1711
|
-
() => import("./index-nVblatyi.mjs").then((t) => ({ default: t.TextRenderer }))
|
|
1712
|
-
), lr = R(
|
|
1713
|
-
() => import("./index-rUfsiVR8.mjs").then((t) => ({ default: t.FontRenderer }))
|
|
1714
|
-
), Kt = ({
|
|
1713
|
+
() => import("./index-DYNPnFww.mjs").then((t) => ({ default: t.FontRenderer }))
|
|
1714
|
+
), Ht = ({
|
|
1715
1715
|
fileName: t,
|
|
1716
1716
|
fileType: e,
|
|
1717
1717
|
onDownload: o
|
|
1718
1718
|
}) => {
|
|
1719
|
-
const r =
|
|
1720
|
-
return /* @__PURE__ */
|
|
1721
|
-
/* @__PURE__ */ p("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__ */ p(
|
|
1722
|
-
/* @__PURE__ */
|
|
1719
|
+
const r = re();
|
|
1720
|
+
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: [
|
|
1721
|
+
/* @__PURE__ */ p("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__ */ p(Te, { className: "rfp-w-16 rfp-h-16 rfp-text-fg-secondary" }) }),
|
|
1722
|
+
/* @__PURE__ */ z("div", { className: "rfp-text-fg-primary rfp-text-center", children: [
|
|
1723
1723
|
/* @__PURE__ */ p("p", { className: "rfp-text-xl rfp-font-medium rfp-mb-2", children: t }),
|
|
1724
1724
|
/* @__PURE__ */ p("p", { className: "rfp-text-fg-secondary", children: r("common.unsupported_preview", { type: e }) })
|
|
1725
1725
|
] }),
|
|
1726
|
-
/* @__PURE__ */
|
|
1726
|
+
/* @__PURE__ */ z(
|
|
1727
1727
|
"button",
|
|
1728
1728
|
{
|
|
1729
1729
|
onClick: o,
|
|
1730
1730
|
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",
|
|
1731
1731
|
children: [
|
|
1732
|
-
/* @__PURE__ */ p(
|
|
1732
|
+
/* @__PURE__ */ p(ee, { className: "rfp-w-5 rfp-h-5" }),
|
|
1733
1733
|
r("common.download")
|
|
1734
1734
|
]
|
|
1735
1735
|
}
|
|
1736
1736
|
)
|
|
1737
1737
|
] });
|
|
1738
|
-
},
|
|
1739
|
-
const t =
|
|
1740
|
-
return /* @__PURE__ */ p("div", { className: "rfp-flex rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-text-fg-muted", children: /* @__PURE__ */
|
|
1738
|
+
}, rr = () => {
|
|
1739
|
+
const t = re();
|
|
1740
|
+
return /* @__PURE__ */ p("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: [
|
|
1741
1741
|
/* @__PURE__ */ p("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" }),
|
|
1742
1742
|
/* @__PURE__ */ p("span", { className: "rfp-text-sm", children: t("common.loading") ?? "Loading..." })
|
|
1743
1743
|
] }) });
|
|
1744
|
-
},
|
|
1744
|
+
}, nr = 3, dt = (t) => {
|
|
1745
1745
|
const { requestInit: e, requestHandler: o, shouldFetchAsBlob: r } = t;
|
|
1746
1746
|
return /* @__PURE__ */ p(
|
|
1747
|
-
|
|
1747
|
+
Wo,
|
|
1748
1748
|
{
|
|
1749
1749
|
requestInit: e,
|
|
1750
1750
|
requestHandler: o,
|
|
1751
1751
|
shouldFetchAsBlob: r,
|
|
1752
|
-
children: /* @__PURE__ */ p(
|
|
1752
|
+
children: /* @__PURE__ */ p(ar, { ...t })
|
|
1753
1753
|
}
|
|
1754
1754
|
);
|
|
1755
|
-
},
|
|
1755
|
+
}, ar = ({
|
|
1756
1756
|
files: t,
|
|
1757
1757
|
currentIndex: e,
|
|
1758
1758
|
onNavigate: o,
|
|
@@ -1771,200 +1771,192 @@ const Bo = R(
|
|
|
1771
1771
|
requestHandler: w,
|
|
1772
1772
|
shouldFetchAsBlob: C
|
|
1773
1773
|
}) => {
|
|
1774
|
-
const x =
|
|
1775
|
-
() =>
|
|
1774
|
+
const x = I(
|
|
1775
|
+
() => pt({ locale: s, messages: l }),
|
|
1776
1776
|
[s, l]
|
|
1777
|
-
), [_,
|
|
1777
|
+
), [_, P] = F(
|
|
1778
1778
|
() => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
1779
1779
|
);
|
|
1780
|
-
|
|
1780
|
+
E(() => {
|
|
1781
1781
|
if (c !== "auto") return;
|
|
1782
|
-
const h = window.matchMedia("(prefers-color-scheme: dark)"), v = (
|
|
1782
|
+
const h = window.matchMedia("(prefers-color-scheme: dark)"), v = (T) => P(T.matches);
|
|
1783
1783
|
return h.addEventListener("change", v), () => h.removeEventListener("change", v);
|
|
1784
1784
|
}, [c]);
|
|
1785
|
-
const k = c === "auto" ? _ ? "dark" : "light" : c, [M, y] = F(1), [
|
|
1786
|
-
G(!0), A.current && clearTimeout(A.current), A.current = window.setTimeout(() => {
|
|
1787
|
-
G(!1);
|
|
1788
|
-
}, we);
|
|
1789
|
-
}, []), ve = P(() => {
|
|
1790
|
-
Y();
|
|
1791
|
-
}, [Y]), $ = H(() => He(t), [t]), g = $[e], N = Zo(g), Z = H(() => g ? r.find((h) => h.test(g)) : null, [g, r]), b = g ? qe(g) : "unsupported", Wt = P(
|
|
1785
|
+
const k = c === "auto" ? _ ? "dark" : "light" : c, [M, y] = F(1), [L, W] = F(0), [ae, ut] = F(1), [, mt] = F(1), [A, Q] = F(0), [U, ht] = F(0), [ie, G] = F(0), $ = V(null), gt = V(null), bt = V(null), [se, wt] = F(0), [le, vt] = F(0), [pe, xt] = F(!1), yt = V(null), [fe, Ft] = F(0), [ce, _t] = F(0), [de, kt] = F(!1), [ue, Ct] = F(null), [Nt, Rt] = F(!0), [Mt, Pt] = F(!1), [jt, zt] = F("preview"), O = I(() => Ue(t), [t]), g = O[e], N = Do(g), Z = I(() => g ? r.find((h) => h.test(g)) : null, [g, r]), b = g ? Oe(g) : "unsupported", Tt = j(
|
|
1792
1786
|
(h, v) => {
|
|
1793
1787
|
g && (d == null || d({ name: h, payload: v, file: g }));
|
|
1794
1788
|
},
|
|
1795
1789
|
[g, d]
|
|
1796
|
-
),
|
|
1790
|
+
), St = I(
|
|
1797
1791
|
() => ({
|
|
1798
|
-
emit:
|
|
1792
|
+
emit: Tt,
|
|
1799
1793
|
t: x,
|
|
1800
1794
|
theme: k,
|
|
1801
1795
|
locale: s
|
|
1802
1796
|
}),
|
|
1803
|
-
[
|
|
1797
|
+
[Tt, x, k, s]
|
|
1804
1798
|
);
|
|
1805
|
-
|
|
1806
|
-
y(1), W(0),
|
|
1807
|
-
}, [e]),
|
|
1808
|
-
if (b === "image" &&
|
|
1809
|
-
const h =
|
|
1810
|
-
y(Math.max(0.01, Math.min(10,
|
|
1799
|
+
E(() => {
|
|
1800
|
+
y(1), W(0), ut(1), mt(1), Q(0), ht(0), G(0), wt(0), vt(0), xt(!1), Ft(0), _t(0), kt(!1), Ct(null), Rt(!0), Pt(!1), zt("preview");
|
|
1801
|
+
}, [e]), E(() => {
|
|
1802
|
+
if (b === "image" && A > 0 && U > 0 && $.current) {
|
|
1803
|
+
const h = $.current.clientWidth, v = $.current.clientHeight, T = h / A, S = v / U, H = Math.min(T, S);
|
|
1804
|
+
y(Math.max(0.01, Math.min(10, H)));
|
|
1811
1805
|
}
|
|
1812
|
-
}, [b,
|
|
1813
|
-
A.current && clearTimeout(A.current);
|
|
1814
|
-
}), [$.length, Y]), L(() => {
|
|
1806
|
+
}, [b, A, U]), E(() => {
|
|
1815
1807
|
const h = (v) => {
|
|
1816
|
-
v.key === "Escape" && a === "modal" ? n == null || n() : v.key === "ArrowLeft" && e > 0 ? o == null || o(e - 1) : v.key === "ArrowRight" && e <
|
|
1808
|
+
v.key === "Escape" && a === "modal" ? n == null || n() : v.key === "ArrowLeft" && e > 0 ? o == null || o(e - 1) : v.key === "ArrowRight" && e < O.length - 1 && (o == null || o(e + 1));
|
|
1817
1809
|
};
|
|
1818
1810
|
if (a === "modal")
|
|
1819
1811
|
return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
|
|
1820
1812
|
{
|
|
1821
|
-
const v =
|
|
1813
|
+
const v = gt.current;
|
|
1822
1814
|
return v ? (v.addEventListener("keydown", h), () => v.removeEventListener("keydown", h)) : void 0;
|
|
1823
1815
|
}
|
|
1824
|
-
}, [a, e,
|
|
1825
|
-
const
|
|
1816
|
+
}, [a, e, O.length, n, o]);
|
|
1817
|
+
const Et = j(() => {
|
|
1826
1818
|
y((h) => Math.min(h + 0.1, 10));
|
|
1827
|
-
}, []),
|
|
1819
|
+
}, []), Lt = j(() => {
|
|
1828
1820
|
y((h) => Math.max(h - 0.1, 0.01));
|
|
1829
|
-
}, []),
|
|
1821
|
+
}, []), me = j(() => {
|
|
1830
1822
|
W((h) => h + 90);
|
|
1831
|
-
}, []),
|
|
1823
|
+
}, []), he = j(() => {
|
|
1832
1824
|
W((h) => h - 90);
|
|
1833
|
-
}, []),
|
|
1834
|
-
if (
|
|
1835
|
-
const h =
|
|
1836
|
-
y(Math.max(0.01, Math.min(10,
|
|
1825
|
+
}, []), ge = j(() => {
|
|
1826
|
+
if ($.current && A > 0 && U > 0) {
|
|
1827
|
+
const h = $.current.clientWidth, v = $.current.clientHeight, T = h / A, S = v / U, H = Math.min(T, S);
|
|
1828
|
+
y(Math.max(0.01, Math.min(10, H)));
|
|
1837
1829
|
} else
|
|
1838
1830
|
y(1);
|
|
1839
|
-
W(0),
|
|
1840
|
-
}, [
|
|
1841
|
-
y(1), W(0),
|
|
1842
|
-
}, []),
|
|
1831
|
+
W(0), G((h) => h + 1);
|
|
1832
|
+
}, [A, U]), be = j(() => {
|
|
1833
|
+
y(1), W(0), G((h) => h + 1);
|
|
1834
|
+
}, []), we = j((h) => {
|
|
1843
1835
|
y(h);
|
|
1844
|
-
}, []),
|
|
1845
|
-
y(1), W(0),
|
|
1846
|
-
}, []),
|
|
1836
|
+
}, []), Wt = j(() => {
|
|
1837
|
+
y(1), W(0), G((h) => h + 1);
|
|
1838
|
+
}, []), $t = $o(), tt = j(async () => {
|
|
1847
1839
|
if (g) {
|
|
1848
1840
|
if (m) {
|
|
1849
1841
|
await m(g);
|
|
1850
1842
|
return;
|
|
1851
1843
|
}
|
|
1852
1844
|
try {
|
|
1853
|
-
await
|
|
1845
|
+
await Ge(g.url, g.name, $t);
|
|
1854
1846
|
} catch (h) {
|
|
1855
1847
|
console.error("[file-preview] download failed:", h);
|
|
1856
1848
|
}
|
|
1857
1849
|
}
|
|
1858
|
-
}, [g, m,
|
|
1850
|
+
}, [g, m, $t]), ve = j((h, v) => {
|
|
1851
|
+
wt(h), vt(v);
|
|
1852
|
+
}, []), xe = j((h, v) => {
|
|
1859
1853
|
Ft(h), _t(v);
|
|
1860
|
-
}, []),
|
|
1861
|
-
|
|
1862
|
-
}, []), Re = P((h) => {
|
|
1863
|
-
jt(h);
|
|
1854
|
+
}, []), ye = j((h) => {
|
|
1855
|
+
Ct(h);
|
|
1864
1856
|
}, []);
|
|
1865
1857
|
if (!g) return null;
|
|
1866
|
-
const
|
|
1858
|
+
const Fe = a === "modal" && !!n, X = (() => {
|
|
1867
1859
|
var h, v;
|
|
1868
1860
|
if (Z)
|
|
1869
|
-
return ((h = Z.getToolbarGroups) == null ? void 0 : h.call(Z, g,
|
|
1861
|
+
return ((h = Z.getToolbarGroups) == null ? void 0 : h.call(Z, g, St)) ?? [];
|
|
1870
1862
|
if (b === "image")
|
|
1871
|
-
return
|
|
1863
|
+
return Mo({
|
|
1872
1864
|
zoom: M,
|
|
1873
|
-
onZoomIn:
|
|
1874
|
-
onZoomOut:
|
|
1875
|
-
onFitToWidth:
|
|
1876
|
-
onOriginalSize:
|
|
1877
|
-
onRotateLeft:
|
|
1878
|
-
onRotateRight:
|
|
1879
|
-
onReset:
|
|
1865
|
+
onZoomIn: Et,
|
|
1866
|
+
onZoomOut: Lt,
|
|
1867
|
+
onFitToWidth: ge,
|
|
1868
|
+
onOriginalSize: be,
|
|
1869
|
+
onRotateLeft: he,
|
|
1870
|
+
onRotateRight: me,
|
|
1871
|
+
onReset: Wt,
|
|
1880
1872
|
t: x
|
|
1881
1873
|
});
|
|
1882
1874
|
if (b === "pdf")
|
|
1883
|
-
return
|
|
1875
|
+
return Po({
|
|
1884
1876
|
zoom: M,
|
|
1885
|
-
onZoomIn:
|
|
1886
|
-
onZoomOut:
|
|
1887
|
-
onReset:
|
|
1877
|
+
onZoomIn: Et,
|
|
1878
|
+
onZoomOut: Lt,
|
|
1879
|
+
onReset: Wt,
|
|
1888
1880
|
t: x
|
|
1889
1881
|
});
|
|
1890
1882
|
if (b === "epub")
|
|
1891
|
-
return
|
|
1892
|
-
epubRef:
|
|
1893
|
-
current:
|
|
1894
|
-
total:
|
|
1895
|
-
fullWidth:
|
|
1883
|
+
return jo({
|
|
1884
|
+
epubRef: bt,
|
|
1885
|
+
current: se,
|
|
1886
|
+
total: le,
|
|
1887
|
+
fullWidth: pe,
|
|
1896
1888
|
t: x
|
|
1897
1889
|
});
|
|
1898
1890
|
if (b === "mobi")
|
|
1899
|
-
return
|
|
1900
|
-
mobiRef:
|
|
1901
|
-
current:
|
|
1902
|
-
total:
|
|
1903
|
-
fullWidth:
|
|
1891
|
+
return zo({
|
|
1892
|
+
mobiRef: yt,
|
|
1893
|
+
current: fe,
|
|
1894
|
+
total: ce,
|
|
1895
|
+
fullWidth: de,
|
|
1904
1896
|
t: x
|
|
1905
1897
|
});
|
|
1906
1898
|
if (b === "zip")
|
|
1907
|
-
return
|
|
1899
|
+
return To({ stats: ue });
|
|
1908
1900
|
if (b === "text") {
|
|
1909
|
-
const
|
|
1910
|
-
return
|
|
1911
|
-
wordWrap:
|
|
1912
|
-
onToggleWrap: () =>
|
|
1913
|
-
isHtml:
|
|
1914
|
-
htmlPreview:
|
|
1915
|
-
onToggleHtmlPreview: () =>
|
|
1901
|
+
const T = ((v = g.name.split(".").pop()) == null ? void 0 : v.toLowerCase()) || "";
|
|
1902
|
+
return So({
|
|
1903
|
+
wordWrap: Nt,
|
|
1904
|
+
onToggleWrap: () => Rt((S) => !S),
|
|
1905
|
+
isHtml: T === "html" || T === "htm",
|
|
1906
|
+
htmlPreview: Mt,
|
|
1907
|
+
onToggleHtmlPreview: () => Pt((S) => !S),
|
|
1916
1908
|
t: x
|
|
1917
1909
|
});
|
|
1918
1910
|
}
|
|
1919
|
-
return b === "markdown" ?
|
|
1920
|
-
viewMode:
|
|
1921
|
-
onToggleViewMode: () =>
|
|
1911
|
+
return b === "markdown" ? Eo({
|
|
1912
|
+
viewMode: jt,
|
|
1913
|
+
onToggleViewMode: () => zt((T) => T === "preview" ? "source" : "preview"),
|
|
1922
1914
|
t: x
|
|
1923
1915
|
}) : [];
|
|
1924
|
-
})(),
|
|
1916
|
+
})(), Dt = [
|
|
1925
1917
|
{
|
|
1926
1918
|
items: [
|
|
1927
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1919
|
+
{ type: "button", icon: /* @__PURE__ */ p(ee, { className: "rfp-w-4 rfp-h-4" }), tooltip: x("common.download"), action: tt }
|
|
1928
1920
|
]
|
|
1929
1921
|
},
|
|
1930
|
-
...
|
|
1922
|
+
...Fe ? [{
|
|
1931
1923
|
items: [
|
|
1932
|
-
{ type: "button", icon: /* @__PURE__ */ p(
|
|
1924
|
+
{ type: "button", icon: /* @__PURE__ */ p(Se, { className: "rfp-w-4 rfp-h-4" }), tooltip: x("common.close"), action: n }
|
|
1933
1925
|
]
|
|
1934
1926
|
}] : []
|
|
1935
|
-
],
|
|
1936
|
-
|
|
1937
|
-
(
|
|
1938
|
-
|
|
1927
|
+
], K = (h, v) => h.map((T, S, H) => /* @__PURE__ */ z(ke.Fragment, { children: [
|
|
1928
|
+
T.items.map(
|
|
1929
|
+
(D, At) => D.type === "button" ? /* @__PURE__ */ p(
|
|
1930
|
+
ir,
|
|
1939
1931
|
{
|
|
1940
|
-
icon:
|
|
1941
|
-
label:
|
|
1942
|
-
onClick:
|
|
1943
|
-
disabled:
|
|
1932
|
+
icon: D.icon,
|
|
1933
|
+
label: D.tooltip,
|
|
1934
|
+
onClick: D.action,
|
|
1935
|
+
disabled: D.disabled
|
|
1944
1936
|
},
|
|
1945
|
-
`${S}-${
|
|
1937
|
+
`${S}-${At}`
|
|
1946
1938
|
) : /* @__PURE__ */ p(
|
|
1947
1939
|
"span",
|
|
1948
1940
|
{
|
|
1949
1941
|
className: "rfp-text-xs rfp-text-center rfp-font-medium rfp-tabular-nums rfp-text-fg-tertiary",
|
|
1950
|
-
style: { minWidth:
|
|
1951
|
-
children:
|
|
1942
|
+
style: { minWidth: D.minWidth || "auto" },
|
|
1943
|
+
children: D.content
|
|
1952
1944
|
},
|
|
1953
|
-
`${S}-${
|
|
1945
|
+
`${S}-${At}`
|
|
1954
1946
|
)
|
|
1955
1947
|
),
|
|
1956
|
-
S <
|
|
1948
|
+
S < H.length - 1 && /* @__PURE__ */ p("div", { className: `rfp-w-px rfp-h-4 rfp-bg-divide ${v}` })
|
|
1957
1949
|
] }, S));
|
|
1958
|
-
return /* @__PURE__ */ p(
|
|
1950
|
+
return /* @__PURE__ */ p(ko, { locale: s, messages: l, children: /* @__PURE__ */ p(No, { theme: k, children: /* @__PURE__ */ z(
|
|
1959
1951
|
"div",
|
|
1960
1952
|
{
|
|
1961
|
-
ref:
|
|
1953
|
+
ref: gt,
|
|
1962
1954
|
tabIndex: a === "embed" ? 0 : -1,
|
|
1963
1955
|
"data-theme": k,
|
|
1964
1956
|
className: "rfp-relative rfp-w-full rfp-h-full rfp-flex rfp-flex-col rfp-overflow-hidden rfp-outline-none",
|
|
1965
1957
|
children: [
|
|
1966
|
-
!f && /* @__PURE__ */
|
|
1967
|
-
|
|
1958
|
+
!f && /* @__PURE__ */ z(
|
|
1959
|
+
Y.div,
|
|
1968
1960
|
{
|
|
1969
1961
|
initial: { opacity: 0 },
|
|
1970
1962
|
animate: { opacity: 1 },
|
|
@@ -1972,148 +1964,130 @@ const Bo = R(
|
|
|
1972
1964
|
className: "rfp-flex-shrink-0 rfp-z-10 rfp-backdrop-blur-md rfp-border-b rfp-bg-surface-toolbar rfp-border-line",
|
|
1973
1965
|
style: { paddingTop: "env(safe-area-inset-top, 0px)" },
|
|
1974
1966
|
children: [
|
|
1975
|
-
/* @__PURE__ */
|
|
1976
|
-
/* @__PURE__ */
|
|
1967
|
+
/* @__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: [
|
|
1968
|
+
/* @__PURE__ */ z("div", { className: "rfp-flex rfp-items-center rfp-flex-1 rfp-min-w-0 rfp-mr-2 md:rfp-mr-3", children: [
|
|
1977
1969
|
/* @__PURE__ */ p("h2", { className: "rfp-font-medium rfp-text-xs md:rfp-text-sm rfp-truncate rfp-text-fg-primary", children: g.name }),
|
|
1978
|
-
/* @__PURE__ */
|
|
1970
|
+
/* @__PURE__ */ z("span", { className: "rfp-text-xs rfp-ml-2 rfp-flex-shrink-0 rfp-text-fg-muted", children: [
|
|
1979
1971
|
e + 1,
|
|
1980
1972
|
"/",
|
|
1981
|
-
|
|
1973
|
+
O.length
|
|
1982
1974
|
] })
|
|
1983
1975
|
] }),
|
|
1984
|
-
/* @__PURE__ */ p("div", { className: "rfp-flex rfp-items-center rfp-gap-1 md:rfp-hidden rfp-flex-shrink-0", children:
|
|
1985
|
-
/* @__PURE__ */
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1976
|
+
/* @__PURE__ */ p("div", { className: "rfp-flex rfp-items-center rfp-gap-1 md:rfp-hidden rfp-flex-shrink-0", children: K(Dt, "rfp-mx-0.5") }),
|
|
1977
|
+
/* @__PURE__ */ z("div", { className: "rfp-hidden md:rfp-flex rfp-items-center rfp-gap-1 rfp-flex-shrink-0", children: [
|
|
1978
|
+
K(X, "rfp-mx-1"),
|
|
1979
|
+
X.length > 0 && /* @__PURE__ */ p("div", { className: "rfp-w-px rfp-h-4 rfp-mx-1 rfp-bg-divide" }),
|
|
1980
|
+
K(Dt, "rfp-mx-1")
|
|
1989
1981
|
] })
|
|
1990
1982
|
] }),
|
|
1991
|
-
|
|
1983
|
+
X.length > 0 && /* @__PURE__ */ p("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: K(X, "rfp-mx-0.5") })
|
|
1992
1984
|
]
|
|
1993
1985
|
}
|
|
1994
1986
|
),
|
|
1995
1987
|
/* @__PURE__ */ p(
|
|
1996
1988
|
"div",
|
|
1997
1989
|
{
|
|
1998
|
-
ref:
|
|
1990
|
+
ref: $,
|
|
1999
1991
|
className: "rfp-flex-1 rfp-flex rfp-items-center rfp-justify-center rfp-overflow-auto",
|
|
2000
|
-
|
|
2001
|
-
children: Z ? Z.render(g, $t) : /* @__PURE__ */ T(Te, { fallback: /* @__PURE__ */ p(pr, {}), children: [
|
|
1992
|
+
children: Z ? Z.render(g, St) : /* @__PURE__ */ z(Ce, { fallback: /* @__PURE__ */ p(rr, {}), children: [
|
|
2002
1993
|
b === "image" && /* @__PURE__ */ p(
|
|
2003
|
-
|
|
1994
|
+
Ao,
|
|
2004
1995
|
{
|
|
2005
1996
|
url: N,
|
|
2006
1997
|
zoom: M,
|
|
2007
|
-
rotation:
|
|
2008
|
-
resetKey:
|
|
1998
|
+
rotation: L,
|
|
1999
|
+
resetKey: ie,
|
|
2009
2000
|
fileSize: g.size,
|
|
2010
2001
|
file: g,
|
|
2011
|
-
onZoomChange:
|
|
2012
|
-
onNaturalWidthChange:
|
|
2013
|
-
onNaturalHeightChange:
|
|
2002
|
+
onZoomChange: we,
|
|
2003
|
+
onNaturalWidthChange: Q,
|
|
2004
|
+
onNaturalHeightChange: ht
|
|
2014
2005
|
}
|
|
2015
2006
|
),
|
|
2016
2007
|
b === "pdf" && /* @__PURE__ */ p(
|
|
2017
|
-
|
|
2008
|
+
Uo,
|
|
2018
2009
|
{
|
|
2019
2010
|
url: N,
|
|
2020
2011
|
zoom: M,
|
|
2021
|
-
currentPage:
|
|
2022
|
-
onPageChange:
|
|
2023
|
-
onTotalPagesChange:
|
|
2024
|
-
onPageWidthChange:
|
|
2012
|
+
currentPage: ae,
|
|
2013
|
+
onPageChange: ut,
|
|
2014
|
+
onTotalPagesChange: mt,
|
|
2015
|
+
onPageWidthChange: Q
|
|
2025
2016
|
}
|
|
2026
2017
|
),
|
|
2027
|
-
b === "docx" && /* @__PURE__ */ p(
|
|
2028
|
-
b === "xlsx" && /* @__PURE__ */ p(
|
|
2029
|
-
b === "pptx" && /* @__PURE__ */ p(
|
|
2030
|
-
b === "msg" && /* @__PURE__ */ p(
|
|
2018
|
+
b === "docx" && /* @__PURE__ */ p(Oo, { url: N }),
|
|
2019
|
+
b === "xlsx" && /* @__PURE__ */ p(Zo, { url: N }),
|
|
2020
|
+
b === "pptx" && /* @__PURE__ */ p(Io, { url: N }),
|
|
2021
|
+
b === "msg" && /* @__PURE__ */ p(Vo, { url: N }),
|
|
2031
2022
|
b === "epub" && /* @__PURE__ */ p(
|
|
2032
|
-
|
|
2023
|
+
Bo,
|
|
2033
2024
|
{
|
|
2034
|
-
ref:
|
|
2025
|
+
ref: bt,
|
|
2035
2026
|
url: N,
|
|
2036
|
-
onChapterChange:
|
|
2037
|
-
onFullWidthChange:
|
|
2027
|
+
onChapterChange: ve,
|
|
2028
|
+
onFullWidthChange: xt
|
|
2038
2029
|
}
|
|
2039
2030
|
),
|
|
2040
2031
|
b === "mobi" && /* @__PURE__ */ p(
|
|
2041
|
-
|
|
2032
|
+
Ho,
|
|
2042
2033
|
{
|
|
2043
|
-
ref:
|
|
2034
|
+
ref: yt,
|
|
2044
2035
|
url: N,
|
|
2045
|
-
onChapterChange:
|
|
2046
|
-
onFullWidthChange:
|
|
2036
|
+
onChapterChange: xe,
|
|
2037
|
+
onFullWidthChange: kt
|
|
2047
2038
|
}
|
|
2048
2039
|
),
|
|
2049
|
-
b === "video" && /* @__PURE__ */ p(
|
|
2050
|
-
b === "audio" && /* @__PURE__ */ p(
|
|
2051
|
-
b === "markdown" && /* @__PURE__ */ p(
|
|
2052
|
-
b === "json" && /* @__PURE__ */ p(
|
|
2053
|
-
b === "csv" && /* @__PURE__ */ p(
|
|
2054
|
-
b === "xml" && /* @__PURE__ */ p(
|
|
2055
|
-
b === "subtitle" && /* @__PURE__ */ p(
|
|
2056
|
-
b === "zip" && (i >=
|
|
2057
|
-
|
|
2040
|
+
b === "video" && /* @__PURE__ */ p(qo, { url: N, fileName: g.name }),
|
|
2041
|
+
b === "audio" && /* @__PURE__ */ p(Go, { url: N, fileName: g.name }),
|
|
2042
|
+
b === "markdown" && /* @__PURE__ */ p(Xo, { url: N, viewMode: jt }),
|
|
2043
|
+
b === "json" && /* @__PURE__ */ p(Ko, { url: N, fileName: g.name }),
|
|
2044
|
+
b === "csv" && /* @__PURE__ */ p(Jo, { url: N, fileName: g.name }),
|
|
2045
|
+
b === "xml" && /* @__PURE__ */ p(Yo, { url: N, fileName: g.name }),
|
|
2046
|
+
b === "subtitle" && /* @__PURE__ */ p(Qo, { url: N, fileName: g.name }),
|
|
2047
|
+
b === "zip" && (i >= nr ? /* @__PURE__ */ p(
|
|
2048
|
+
Ht,
|
|
2058
2049
|
{
|
|
2059
2050
|
fileName: g.name,
|
|
2060
2051
|
fileType: g.type,
|
|
2061
|
-
onDownload:
|
|
2052
|
+
onDownload: tt
|
|
2062
2053
|
}
|
|
2063
|
-
) : /* @__PURE__ */ p(
|
|
2054
|
+
) : /* @__PURE__ */ p(tr, { url: N, onStatsChange: ye, nestingDepth: i })),
|
|
2064
2055
|
b === "text" && /* @__PURE__ */ p(
|
|
2065
|
-
|
|
2056
|
+
er,
|
|
2066
2057
|
{
|
|
2067
2058
|
url: N,
|
|
2068
2059
|
fileName: g.name,
|
|
2069
|
-
wordWrap:
|
|
2070
|
-
htmlPreview:
|
|
2060
|
+
wordWrap: Nt,
|
|
2061
|
+
htmlPreview: Mt
|
|
2071
2062
|
}
|
|
2072
2063
|
),
|
|
2073
|
-
b === "font" && /* @__PURE__ */ p(
|
|
2064
|
+
b === "font" && /* @__PURE__ */ p(or, { url: N }),
|
|
2074
2065
|
b === "unsupported" && /* @__PURE__ */ p(
|
|
2075
|
-
|
|
2066
|
+
Ht,
|
|
2076
2067
|
{
|
|
2077
2068
|
fileName: g.name,
|
|
2078
2069
|
fileType: g.type,
|
|
2079
|
-
onDownload:
|
|
2070
|
+
onDownload: tt
|
|
2080
2071
|
}
|
|
2081
2072
|
)
|
|
2082
2073
|
] }, g.url)
|
|
2083
2074
|
}
|
|
2084
2075
|
),
|
|
2085
|
-
!f &&
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
children: /* @__PURE__ */ p(ft, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
|
|
2097
|
-
}
|
|
2098
|
-
),
|
|
2099
|
-
e < $.length - 1 && /* @__PURE__ */ p(
|
|
2100
|
-
ot.button,
|
|
2101
|
-
{
|
|
2102
|
-
initial: { opacity: 0 },
|
|
2103
|
-
animate: { opacity: V ? 1 : 0, x: V ? 0 : 20 },
|
|
2104
|
-
transition: { duration: 0.2 },
|
|
2105
|
-
onClick: () => o == null ? void 0 : o(e + 1),
|
|
2106
|
-
onMouseEnter: () => G(!0),
|
|
2107
|
-
style: { pointerEvents: V ? "auto" : "none" },
|
|
2108
|
-
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",
|
|
2109
|
-
children: /* @__PURE__ */ p(ct, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
|
|
2110
|
-
}
|
|
2111
|
-
)
|
|
2112
|
-
] })
|
|
2076
|
+
!f && O.length > 1 && /* @__PURE__ */ p(
|
|
2077
|
+
lr,
|
|
2078
|
+
{
|
|
2079
|
+
containerRef: $,
|
|
2080
|
+
hasPrev: e > 0,
|
|
2081
|
+
hasNext: e < O.length - 1,
|
|
2082
|
+
onPrev: () => o == null ? void 0 : o(e - 1),
|
|
2083
|
+
onNext: () => o == null ? void 0 : o(e + 1),
|
|
2084
|
+
resetKey: e
|
|
2085
|
+
}
|
|
2086
|
+
)
|
|
2113
2087
|
]
|
|
2114
2088
|
}
|
|
2115
2089
|
) }) });
|
|
2116
|
-
},
|
|
2090
|
+
}, ir = ({ icon: t, label: e, onClick: o, disabled: r }) => /* @__PURE__ */ z(
|
|
2117
2091
|
"button",
|
|
2118
2092
|
{
|
|
2119
2093
|
onClick: o,
|
|
@@ -2121,16 +2095,66 @@ const Bo = R(
|
|
|
2121
2095
|
className: `rfp-relative rfp-group rfp-p-2 md:rfp-p-1.5 rfp-rounded-md rfp-transition-all rfp-select-none ${r ? "rfp-text-fg-disabled rfp-cursor-not-allowed" : "rfp-text-fg-primary hover:rfp-bg-surface-2 active:rfp-bg-surface-3"}`,
|
|
2122
2096
|
children: [
|
|
2123
2097
|
t,
|
|
2124
|
-
/* @__PURE__ */
|
|
2098
|
+
/* @__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 max-[1023px]:!rfp-hidden", children: [
|
|
2125
2099
|
/* @__PURE__ */ p("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" }),
|
|
2126
2100
|
/* @__PURE__ */ p("span", { className: "rfp-relative", children: e })
|
|
2127
2101
|
] })
|
|
2128
2102
|
]
|
|
2129
2103
|
}
|
|
2130
|
-
),
|
|
2104
|
+
), sr = 2e3, lr = ({
|
|
2105
|
+
containerRef: t,
|
|
2106
|
+
hasPrev: e,
|
|
2107
|
+
hasNext: o,
|
|
2108
|
+
onPrev: r,
|
|
2109
|
+
onNext: a,
|
|
2110
|
+
resetKey: n
|
|
2111
|
+
}) => {
|
|
2112
|
+
const [i, s] = F(!0), l = V(null), f = j(() => {
|
|
2113
|
+
l.current && clearTimeout(l.current), l.current = window.setTimeout(() => s(!1), sr);
|
|
2114
|
+
}, []), c = j(() => {
|
|
2115
|
+
s((d) => d || !0), f();
|
|
2116
|
+
}, [f]);
|
|
2117
|
+
return E(() => {
|
|
2118
|
+
const d = t.current;
|
|
2119
|
+
if (!d) return;
|
|
2120
|
+
const m = () => c();
|
|
2121
|
+
return d.addEventListener("mousemove", m), () => {
|
|
2122
|
+
d.removeEventListener("mousemove", m);
|
|
2123
|
+
};
|
|
2124
|
+
}, [t, c]), E(() => (s(!0), f(), () => {
|
|
2125
|
+
l.current && clearTimeout(l.current);
|
|
2126
|
+
}), [n, f]), /* @__PURE__ */ z(_e, { children: [
|
|
2127
|
+
e && /* @__PURE__ */ p(
|
|
2128
|
+
Y.button,
|
|
2129
|
+
{
|
|
2130
|
+
initial: { opacity: 0 },
|
|
2131
|
+
animate: { opacity: i ? 1 : 0, x: i ? 0 : -20 },
|
|
2132
|
+
transition: { duration: 0.2 },
|
|
2133
|
+
onClick: r,
|
|
2134
|
+
onMouseEnter: c,
|
|
2135
|
+
style: { pointerEvents: i ? "auto" : "none" },
|
|
2136
|
+
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",
|
|
2137
|
+
children: /* @__PURE__ */ p(it, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
|
|
2138
|
+
}
|
|
2139
|
+
),
|
|
2140
|
+
o && /* @__PURE__ */ p(
|
|
2141
|
+
Y.button,
|
|
2142
|
+
{
|
|
2143
|
+
initial: { opacity: 0 },
|
|
2144
|
+
animate: { opacity: i ? 1 : 0, x: i ? 0 : 20 },
|
|
2145
|
+
transition: { duration: 0.2 },
|
|
2146
|
+
onClick: a,
|
|
2147
|
+
onMouseEnter: c,
|
|
2148
|
+
style: { pointerEvents: i ? "auto" : "none" },
|
|
2149
|
+
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",
|
|
2150
|
+
children: /* @__PURE__ */ p(st, { className: "rfp-w-5 rfp-h-5 md:rfp-w-6 md:rfp-h-6" })
|
|
2151
|
+
}
|
|
2152
|
+
)
|
|
2153
|
+
] });
|
|
2154
|
+
}, Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2131
2155
|
__proto__: null,
|
|
2132
|
-
FilePreviewContent:
|
|
2133
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2156
|
+
FilePreviewContent: dt
|
|
2157
|
+
}, Symbol.toStringTag, { value: "Module" })), Sr = ({
|
|
2134
2158
|
files: t,
|
|
2135
2159
|
currentIndex: e,
|
|
2136
2160
|
isOpen: o,
|
|
@@ -2150,13 +2174,13 @@ const Bo = R(
|
|
|
2150
2174
|
const [C, x] = F(
|
|
2151
2175
|
() => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
2152
2176
|
);
|
|
2153
|
-
|
|
2177
|
+
E(() => {
|
|
2154
2178
|
if (f !== "auto") return;
|
|
2155
2179
|
const k = window.matchMedia("(prefers-color-scheme: dark)"), M = (y) => x(y.matches);
|
|
2156
2180
|
return k.addEventListener("change", M), () => k.removeEventListener("change", M);
|
|
2157
2181
|
}, [f]);
|
|
2158
2182
|
const _ = f === "auto" ? C ? "dark" : "light" : f;
|
|
2159
|
-
if (
|
|
2183
|
+
if (E(() => {
|
|
2160
2184
|
if (o) {
|
|
2161
2185
|
const k = document.body.style.overflow, M = document.body.style.paddingRight, y = window.innerWidth - document.documentElement.clientWidth;
|
|
2162
2186
|
return document.body.style.overflow = "hidden", y > 0 && (document.body.style.paddingRight = `${y}px`), () => {
|
|
@@ -2164,8 +2188,8 @@ const Bo = R(
|
|
|
2164
2188
|
};
|
|
2165
2189
|
}
|
|
2166
2190
|
}, [o]), !o) return null;
|
|
2167
|
-
const
|
|
2168
|
-
|
|
2191
|
+
const P = /* @__PURE__ */ p("div", { className: "rfp-root", "data-theme": _, children: /* @__PURE__ */ p(Re, { children: o && /* @__PURE__ */ p(
|
|
2192
|
+
Y.div,
|
|
2169
2193
|
{
|
|
2170
2194
|
initial: { opacity: 0 },
|
|
2171
2195
|
animate: { opacity: 1 },
|
|
@@ -2179,7 +2203,7 @@ const Bo = R(
|
|
|
2179
2203
|
className: "rfp-relative rfp-w-full rfp-h-full",
|
|
2180
2204
|
onClick: (k) => k.stopPropagation(),
|
|
2181
2205
|
children: /* @__PURE__ */ p(
|
|
2182
|
-
|
|
2206
|
+
dt,
|
|
2183
2207
|
{
|
|
2184
2208
|
mode: "modal",
|
|
2185
2209
|
files: t,
|
|
@@ -2202,8 +2226,8 @@ const Bo = R(
|
|
|
2202
2226
|
)
|
|
2203
2227
|
}
|
|
2204
2228
|
) }) });
|
|
2205
|
-
return
|
|
2206
|
-
},
|
|
2229
|
+
return Ne(P, document.body);
|
|
2230
|
+
}, Er = ({
|
|
2207
2231
|
files: t,
|
|
2208
2232
|
currentIndex: e = 0,
|
|
2209
2233
|
onNavigate: o,
|
|
@@ -2222,12 +2246,12 @@ const Bo = R(
|
|
|
2222
2246
|
shouldFetchAsBlob: C,
|
|
2223
2247
|
onDownload: x
|
|
2224
2248
|
}) => {
|
|
2225
|
-
const [_,
|
|
2249
|
+
const [_, P] = F(
|
|
2226
2250
|
() => typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
2227
2251
|
);
|
|
2228
|
-
|
|
2252
|
+
E(() => {
|
|
2229
2253
|
if (d !== "auto") return;
|
|
2230
|
-
const M = window.matchMedia("(prefers-color-scheme: dark)"), y = (
|
|
2254
|
+
const M = window.matchMedia("(prefers-color-scheme: dark)"), y = (L) => P(L.matches);
|
|
2231
2255
|
return M.addEventListener("change", y), () => M.removeEventListener("change", y);
|
|
2232
2256
|
}, [d]);
|
|
2233
2257
|
const k = d === "auto" ? _ ? "dark" : "light" : d;
|
|
@@ -2238,7 +2262,7 @@ const Bo = R(
|
|
|
2238
2262
|
style: { width: a, height: n, ...s },
|
|
2239
2263
|
"data-theme": k,
|
|
2240
2264
|
children: /* @__PURE__ */ p("div", { className: "rfp-relative rfp-w-full rfp-h-full rfp-overflow-hidden rfp-bg-surface-overlay", children: /* @__PURE__ */ p(
|
|
2241
|
-
|
|
2265
|
+
dt,
|
|
2242
2266
|
{
|
|
2243
2267
|
mode: "embed",
|
|
2244
2268
|
files: t,
|
|
@@ -2259,41 +2283,41 @@ const Bo = R(
|
|
|
2259
2283
|
}
|
|
2260
2284
|
);
|
|
2261
2285
|
};
|
|
2262
|
-
function
|
|
2263
|
-
|
|
2286
|
+
function Lr(t) {
|
|
2287
|
+
mo(Le, t);
|
|
2264
2288
|
}
|
|
2265
|
-
const
|
|
2289
|
+
const Wr = $e.version;
|
|
2266
2290
|
export {
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2291
|
+
kr as A,
|
|
2292
|
+
Ae as B,
|
|
2293
|
+
Ze as C,
|
|
2294
|
+
_r as D,
|
|
2295
|
+
vr as E,
|
|
2296
|
+
Oe as F,
|
|
2297
|
+
Pr as G,
|
|
2298
|
+
Nr as I,
|
|
2299
|
+
ko as L,
|
|
2300
|
+
br as M,
|
|
2301
|
+
xr as N,
|
|
2302
|
+
yr as P,
|
|
2303
|
+
Cr as R,
|
|
2304
|
+
wr as S,
|
|
2305
|
+
Rr as U,
|
|
2306
|
+
Wr as V,
|
|
2307
|
+
$o as a,
|
|
2308
|
+
zr as b,
|
|
2309
|
+
et as c,
|
|
2310
|
+
dt as d,
|
|
2311
|
+
Er as e,
|
|
2312
|
+
Sr as f,
|
|
2313
|
+
Lr as g,
|
|
2314
|
+
jr as h,
|
|
2315
|
+
Tr as i,
|
|
2316
|
+
Fr as j,
|
|
2317
|
+
Mr as q,
|
|
2318
|
+
re as u,
|
|
2319
|
+
hr as v,
|
|
2320
|
+
Ue as w,
|
|
2321
|
+
gr as y
|
|
2298
2322
|
};
|
|
2299
|
-
//# sourceMappingURL=index-
|
|
2323
|
+
//# sourceMappingURL=index-CWCNvV2X.mjs.map
|