@eternalheart/vue-file-preview 1.6.6 → 1.6.8
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 +26 -6
- package/README.zh-CN.md +26 -6
- package/lib/FilePreviewContent.vue.d.ts +6 -0
- package/lib/FilePreviewEmbed.vue.d.ts +6 -0
- package/lib/FilePreviewModal.vue.d.ts +6 -0
- package/lib/chunks/{index-DcNc3goP.mjs → index-B1OYfn_2.mjs} +1 -1
- package/lib/chunks/{index-D656tL42.mjs → index-BJpiAJuf.mjs} +2 -2
- package/lib/chunks/{index-BF0-zECZ.mjs → index-BgtFv2mf.mjs} +1 -1
- package/lib/chunks/{index-BHy2oKCa.mjs → index-C3isZ_ue.mjs} +1 -1
- package/lib/chunks/{index-C-hfrxhW.mjs → index-CG01fzip.mjs} +1 -1
- package/lib/chunks/{index-u7QUztr_.mjs → index-CJYCIk06.mjs} +1 -1
- package/lib/chunks/{index-DxBxbEDT.mjs → index-CRTvjRyt.mjs} +1 -1
- package/lib/chunks/{index-DXqRgna1.mjs → index-CVN9K0qA.mjs} +1 -1
- package/lib/chunks/{index-07rgqwSI.mjs → index-CodGY6nz.mjs} +1 -1
- package/lib/chunks/{index-BnDCjh8a.mjs → index-D18co0be.mjs} +1 -1
- package/lib/chunks/{index-CdsYIxSD.mjs → index-D4O2OC-3.mjs} +1 -1
- package/lib/chunks/index-D5JP7cnv.mjs +110 -0
- package/lib/chunks/{index-Dh91eAMV.mjs → index-D6tN6EZR.mjs} +1 -1
- package/lib/chunks/{index-tOax5IQg.mjs → index-DJAZU94G.mjs} +1 -1
- package/lib/chunks/{index-CUrAAk7J.mjs → index-DL3r7NGE.mjs} +1 -1
- package/lib/chunks/{index-hDUlDDey.mjs → index-DYI-zHxA.mjs} +15 -15
- package/lib/chunks/{index-lDd0gQfG.mjs → index-DbQYYr9C.mjs} +1 -1
- package/lib/chunks/{index-xY2bzsk7.mjs → index-Hj5oboUU.mjs} +355 -339
- package/lib/chunks/{index-CksNYAz_.mjs → index-TlmEk0Wz.mjs} +1 -1
- package/lib/chunks/{index-ChMheVNW.mjs → index-XEPcqTt4.mjs} +1 -1
- package/lib/chunks/index-Z3_lfqRQ.mjs +348 -0
- package/lib/chunks/{index-CybXawTx.mjs → index-bgq5MUC6.mjs} +1 -1
- package/lib/chunks/{useShikiHighlight-DwEsf_jW.mjs → useShikiHighlight-xcK26Bn3.mjs} +1 -1
- package/lib/index.cjs +36 -36
- package/lib/index.css +1 -1
- package/lib/index.mjs +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-BV8V9hEs.mjs +0 -110
- package/lib/chunks/index-DWWV1OKd.mjs +0 -320
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { computed as p, unref as n, provide as zM, inject as DI, ref as
|
|
1
|
+
import { computed as p, unref as n, provide as zM, inject as DI, ref as F, watch as e, onBeforeUnmount as lM, defineComponent as AM, openBlock as d, createElementBlock as Z, createElementVNode as H, toDisplayString as O, defineAsyncComponent as AP, h as YP, createVNode as XM, createTextVNode as GP, onMounted as AI, Fragment as o, normalizeStyle as mM, createCommentVNode as E, toRef as oI, renderList as v, normalizeClass as WM, createBlock as a, resolveDynamicComponent as sM, mergeProps as dP, onUnmounted as xP, Teleport as cP } from "vue";
|
|
2
2
|
import { FileQuestion as bP, Download as CK, ChevronLeft as ZP, ChevronRight as WP, X as iP } from "lucide-vue-next";
|
|
3
3
|
import pP from "jszip";
|
|
4
|
-
const JP = "1.6.
|
|
4
|
+
const JP = "1.6.8", hP = {
|
|
5
5
|
version: JP
|
|
6
6
|
};
|
|
7
7
|
var oP = Object.defineProperty, HP = (M, I, K) => I in M ? oP(M, I, { enumerable: !0, configurable: !0, writable: !0, value: K }) : M[I] = K, nM = (M, I, K) => HP(M, typeof I != "symbol" ? I + "" : I, K);
|
|
@@ -278,6 +278,7 @@ function EP(M) {
|
|
|
278
278
|
"ini",
|
|
279
279
|
"conf",
|
|
280
280
|
"env",
|
|
281
|
+
"properties",
|
|
281
282
|
"tf",
|
|
282
283
|
"tfvars",
|
|
283
284
|
"diff",
|
|
@@ -286,7 +287,11 @@ function EP(M) {
|
|
|
286
287
|
"bash",
|
|
287
288
|
"zsh",
|
|
288
289
|
"ps1",
|
|
289
|
-
"
|
|
290
|
+
"bat",
|
|
291
|
+
"cmd",
|
|
292
|
+
"sql",
|
|
293
|
+
"tex",
|
|
294
|
+
"map"
|
|
290
295
|
];
|
|
291
296
|
return P.startsWith("text/") || w.includes(I) || yK[K] || M.name.startsWith(".") && !M.name.includes("/") ? "text" : "unsupported";
|
|
292
297
|
}
|
|
@@ -1331,7 +1336,7 @@ function GI(M, I) {
|
|
|
1331
1336
|
}
|
|
1332
1337
|
return null;
|
|
1333
1338
|
}
|
|
1334
|
-
function
|
|
1339
|
+
function W(M) {
|
|
1335
1340
|
return new DataView(M.buffer, M.byteOffset, M.byteLength);
|
|
1336
1341
|
}
|
|
1337
1342
|
const YK = 42476, gM = "", Aw = [
|
|
@@ -1357,7 +1362,7 @@ function KI(M) {
|
|
|
1357
1362
|
return M >= 127744 && M <= 129791 || M >= 128512 && M <= 128591 || M >= 129280 && M <= 129535 || M >= 9728 && M <= 10175 || // Misc symbols + dingbats (includes ✅ U+2705)
|
|
1358
1363
|
M >= 8960 && M <= 9215 || M >= 11088 && M <= 11093 || M === 12336 || M === 12349 || M === 12951 || M === 12953;
|
|
1359
1364
|
}
|
|
1360
|
-
function
|
|
1365
|
+
function xM(M) {
|
|
1361
1366
|
var I;
|
|
1362
1367
|
if (!M) return null;
|
|
1363
1368
|
const K = [...M], P = (I = K[0]) == null ? void 0 : I.codePointAt(0);
|
|
@@ -1390,7 +1395,7 @@ function GK(M, I, K) {
|
|
|
1390
1395
|
return P;
|
|
1391
1396
|
}
|
|
1392
1397
|
function dK(M, I, K) {
|
|
1393
|
-
const P =
|
|
1398
|
+
const P = W(M);
|
|
1394
1399
|
let w = "", l = I;
|
|
1395
1400
|
I + 2 <= M.length && P.getUint16(I, !0) === 65279 && (l = I + 2);
|
|
1396
1401
|
const C = Math.min(K, M.length - (M.length % 2 === 0 ? 0 : 1));
|
|
@@ -1439,7 +1444,7 @@ function Yw(M) {
|
|
|
1439
1444
|
const C = [];
|
|
1440
1445
|
for (let g = 0; g < l.length; g++) {
|
|
1441
1446
|
const s = l[g], y = g + 1 < l.length ? l[g + 1] : w.length, T = w.slice(s, y).join("").trim();
|
|
1442
|
-
T &&
|
|
1447
|
+
T && xM(T) && C.push(T);
|
|
1443
1448
|
}
|
|
1444
1449
|
if (C.length > 1) {
|
|
1445
1450
|
I.push(...C);
|
|
@@ -1455,7 +1460,7 @@ function Gw(M) {
|
|
|
1455
1460
|
return Yw(I);
|
|
1456
1461
|
}
|
|
1457
1462
|
function dw(M) {
|
|
1458
|
-
const I =
|
|
1463
|
+
const I = W(M), K = [];
|
|
1459
1464
|
let P = "";
|
|
1460
1465
|
for (let w = 0; w + 1 < M.length; w += 2) {
|
|
1461
1466
|
const l = I.getUint16(w, !0);
|
|
@@ -1473,7 +1478,7 @@ function dw(M) {
|
|
|
1473
1478
|
`));
|
|
1474
1479
|
}
|
|
1475
1480
|
function cK(M) {
|
|
1476
|
-
const I =
|
|
1481
|
+
const I = W(M);
|
|
1477
1482
|
if (M.length < 512 || I.getUint16(0, !0) !== YK)
|
|
1478
1483
|
return null;
|
|
1479
1484
|
let K = 32;
|
|
@@ -1518,7 +1523,7 @@ function bw(M) {
|
|
|
1518
1523
|
}
|
|
1519
1524
|
function Zw(M) {
|
|
1520
1525
|
if (M.length < 6) return [];
|
|
1521
|
-
const I =
|
|
1526
|
+
const I = W(M);
|
|
1522
1527
|
let K = I.getUint16(0, !0), P = I.getUint16(2, !0), w = 4;
|
|
1523
1528
|
if (K === 65535 && (K = I.getUint16(2, !0), P = I.getUint16(4, !0), w = 6), K < 1 || K > 128 || P > 64) return [];
|
|
1524
1529
|
const l = [];
|
|
@@ -1539,7 +1544,7 @@ function Zw(M) {
|
|
|
1539
1544
|
function Ww(M, I, K) {
|
|
1540
1545
|
const P = /* @__PURE__ */ new Map();
|
|
1541
1546
|
if (!(I != null && I.lcb) || I.fc + I.lcb > M.length) return P;
|
|
1542
|
-
const w = M.subarray(I.fc, I.fc + I.lcb), l =
|
|
1547
|
+
const w = M.subarray(I.fc, I.fc + I.lcb), l = W(w);
|
|
1543
1548
|
if (w.length < 6) return P;
|
|
1544
1549
|
const C = l.getUint16(0, !0), g = l.getUint16(2, !0), s = l.getUint16(4, !0);
|
|
1545
1550
|
if (C < 4 || g > 256 || s > 32) return P;
|
|
@@ -1550,7 +1555,7 @@ function Ww(M, I, K) {
|
|
|
1550
1555
|
if (y + S > w.length) break;
|
|
1551
1556
|
const j = w.subarray(y, y + S);
|
|
1552
1557
|
y += S;
|
|
1553
|
-
const X =
|
|
1558
|
+
const X = W(j), B = Math.min(s, j.length);
|
|
1554
1559
|
let D = "";
|
|
1555
1560
|
if (B + 2 <= j.length) {
|
|
1556
1561
|
const Y = X.getUint16(B, !0);
|
|
@@ -1607,7 +1612,7 @@ function Jw(M, I) {
|
|
|
1607
1612
|
const K = xw(M, I.length);
|
|
1608
1613
|
if (!K || K.fcClx + K.lcbClx > I.length)
|
|
1609
1614
|
return null;
|
|
1610
|
-
const P = I.subarray(K.fcClx, K.fcClx + K.lcbClx), w =
|
|
1615
|
+
const P = I.subarray(K.fcClx, K.fcClx + K.lcbClx), w = W(P);
|
|
1611
1616
|
let l = 0;
|
|
1612
1617
|
for (; l < P.length; ) {
|
|
1613
1618
|
const S = P[l];
|
|
@@ -1646,7 +1651,7 @@ function Jw(M, I) {
|
|
|
1646
1651
|
return T.length ? T : null;
|
|
1647
1652
|
}
|
|
1648
1653
|
function hw(M) {
|
|
1649
|
-
const I =
|
|
1654
|
+
const I = W(M);
|
|
1650
1655
|
if (M.length < 32 || I.getUint16(0, !0) !== YK)
|
|
1651
1656
|
return null;
|
|
1652
1657
|
const K = I.getUint32(24, !0), P = I.getUint32(28, !0);
|
|
@@ -1658,41 +1663,41 @@ function hw(M) {
|
|
|
1658
1663
|
function ow(M) {
|
|
1659
1664
|
return M.split(gM).map((I) => I.replace(/\t+/g, " ").trim()).filter(Boolean);
|
|
1660
1665
|
}
|
|
1661
|
-
function
|
|
1662
|
-
const I =
|
|
1666
|
+
function _(M) {
|
|
1667
|
+
const I = xM(M);
|
|
1663
1668
|
let K = I ? M.slice(I.length) : M;
|
|
1664
1669
|
return K = K.replace(/^[\uFE0F\u200D\s]+/, "").trim(), K;
|
|
1665
1670
|
}
|
|
1666
1671
|
function dI(M) {
|
|
1667
|
-
return /^(table of contents|contents)\s*$/i.test(
|
|
1672
|
+
return /^(table of contents|contents)\s*$/i.test(_(M));
|
|
1668
1673
|
}
|
|
1669
|
-
function
|
|
1670
|
-
const I =
|
|
1674
|
+
function YM(M) {
|
|
1675
|
+
const I = _(M);
|
|
1671
1676
|
return /^\d{1,2}[.)]\s+\S.+/.test(I) && I.length < 120;
|
|
1672
1677
|
}
|
|
1673
1678
|
function PI(M) {
|
|
1674
|
-
const I =
|
|
1679
|
+
const I = xM(M);
|
|
1675
1680
|
if (!I) return !1;
|
|
1676
1681
|
const K = M.slice(I.length).replace(/^\s+/, "");
|
|
1677
1682
|
return /^\d{1,2}[.)]\s+\S.+/.test(K) && M.length < 120;
|
|
1678
1683
|
}
|
|
1679
1684
|
function bK(M) {
|
|
1680
|
-
const I =
|
|
1685
|
+
const I = _(M);
|
|
1681
1686
|
return /^[A-Z][.)]\s+\S/.test(I) && I.length < 80;
|
|
1682
1687
|
}
|
|
1683
1688
|
function ZK(M) {
|
|
1684
|
-
const I =
|
|
1685
|
-
if (I.length < 3 || I.length > 60 || /[.!?:]$/.test(I) || /^\d+[.)]/.test(I) || /^[A-Z][.)]/.test(I) ||
|
|
1689
|
+
const I = _(M);
|
|
1690
|
+
if (I.length < 3 || I.length > 60 || /[.!?:]$/.test(I) || /^\d+[.)]/.test(I) || /^[A-Z][.)]/.test(I) || GM(I) || QM(I) || EM(I)) return !1;
|
|
1686
1691
|
const K = I.split(/\s+/);
|
|
1687
1692
|
return K.length > 8 ? !1 : K.filter((P) => /^[A-Z0-9]/.test(P) || /^(and|or|of|for|to|in|a|an|the|&)$/i.test(P)).length >= Math.ceil(K.length * 0.7);
|
|
1688
1693
|
}
|
|
1689
1694
|
function QM(M) {
|
|
1690
1695
|
return /^([-*•·▪◦–—])\s+\S/.test(M);
|
|
1691
1696
|
}
|
|
1692
|
-
function
|
|
1693
|
-
if (
|
|
1697
|
+
function GM(M) {
|
|
1698
|
+
if (YM(M) || PI(M) || dI(M))
|
|
1694
1699
|
return !1;
|
|
1695
|
-
const I =
|
|
1700
|
+
const I = xM(M);
|
|
1696
1701
|
if (!I) return !1;
|
|
1697
1702
|
const K = M.slice(I.length);
|
|
1698
1703
|
return /^\s+\S/.test(K);
|
|
@@ -1704,12 +1709,12 @@ function wI(M) {
|
|
|
1704
1709
|
return /^[A-Z0-9][A-Z0-9,/+\s-]{0,40}\([^)]{2,40}\)\s*$/.test(M) && M.length < 80;
|
|
1705
1710
|
}
|
|
1706
1711
|
function uM(M) {
|
|
1707
|
-
if (M.length > 72 || /[.!?]$/.test(M) ||
|
|
1712
|
+
if (M.length > 72 || /[.!?]$/.test(M) || YM(M) || bK(M) || ZK(M) || GM(M) || QM(M) || EM(M) || wI(M) || M.includes(gM) || /HYPERLINK\s+"/i.test(M)) return !1;
|
|
1708
1713
|
const I = M.split(/\s+/);
|
|
1709
1714
|
return I.length >= 2 && I.length <= 10;
|
|
1710
1715
|
}
|
|
1711
1716
|
function Hw(M) {
|
|
1712
|
-
const I = M.trim(), K =
|
|
1717
|
+
const I = M.trim(), K = xM(I);
|
|
1713
1718
|
if (K)
|
|
1714
1719
|
return {
|
|
1715
1720
|
marker: K,
|
|
@@ -1722,7 +1727,7 @@ function Hw(M) {
|
|
|
1722
1727
|
} : { text: I.replace(/^([-*•·▪◦–—])\s+/, "") };
|
|
1723
1728
|
}
|
|
1724
1729
|
function mw(M) {
|
|
1725
|
-
if (
|
|
1730
|
+
if (YM(M) || dI(M) || GM(M) || M.length > 100 || /[.!]$/.test(M))
|
|
1726
1731
|
return !1;
|
|
1727
1732
|
if (/^[IVXLCDM\d]+[.)]\s+\S/.test(M) || /^[A-Z][.)]\s+\S/.test(M))
|
|
1728
1733
|
return !0;
|
|
@@ -1788,7 +1793,7 @@ function Fw(M) {
|
|
|
1788
1793
|
continue;
|
|
1789
1794
|
}
|
|
1790
1795
|
if (dI(w)) {
|
|
1791
|
-
I.push({ kind: "heading", text:
|
|
1796
|
+
I.push({ kind: "heading", text: _(w), level: 2 }), K += 1;
|
|
1792
1797
|
const C = [];
|
|
1793
1798
|
for (; K < M.length && mw(M[K]); ) {
|
|
1794
1799
|
const g = M[K].replace(/^[IVXLCDM\d]+[.)]\s+/, "").replace(/^[A-Z][.)]\s+/, "").trim();
|
|
@@ -1797,8 +1802,8 @@ function Fw(M) {
|
|
|
1797
1802
|
C.length && I.push({ kind: "list", style: "ordered", items: C });
|
|
1798
1803
|
continue;
|
|
1799
1804
|
}
|
|
1800
|
-
if (
|
|
1801
|
-
P = !0, I.push({ kind: "heading", text:
|
|
1805
|
+
if (YM(w) && !PI(w)) {
|
|
1806
|
+
P = !0, I.push({ kind: "heading", text: _(w), level: 2 }), K += 1;
|
|
1802
1807
|
continue;
|
|
1803
1808
|
}
|
|
1804
1809
|
if (PI(w)) {
|
|
@@ -1806,16 +1811,16 @@ function Fw(M) {
|
|
|
1806
1811
|
continue;
|
|
1807
1812
|
}
|
|
1808
1813
|
if (bK(w)) {
|
|
1809
|
-
I.push({ kind: "heading", text:
|
|
1814
|
+
I.push({ kind: "heading", text: _(w), level: 3 }), K += 1;
|
|
1810
1815
|
continue;
|
|
1811
1816
|
}
|
|
1812
1817
|
if (P && ZK(w)) {
|
|
1813
|
-
I.push({ kind: "heading", text:
|
|
1818
|
+
I.push({ kind: "heading", text: _(w), level: 2 }), K += 1;
|
|
1814
1819
|
continue;
|
|
1815
1820
|
}
|
|
1816
|
-
if (
|
|
1821
|
+
if (GM(w)) {
|
|
1817
1822
|
const C = [];
|
|
1818
|
-
for (; K < M.length &&
|
|
1823
|
+
for (; K < M.length && GM(M[K]) && !YM(M[K]); )
|
|
1819
1824
|
C.push(Hw(M[K])), K += 1;
|
|
1820
1825
|
I.push({ kind: "list", style: "emoji", items: C });
|
|
1821
1826
|
continue;
|
|
@@ -1932,8 +1937,8 @@ function Ew(M) {
|
|
|
1932
1937
|
function R(M) {
|
|
1933
1938
|
return M.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1934
1939
|
}
|
|
1935
|
-
const Uw = 4080,
|
|
1936
|
-
function
|
|
1940
|
+
const Uw = 4080, IM = 4e3, zw = 4001, fM = 4008, xI = 3999, Nw = 1011, WK = 2032, fw = 4023, aw = 4003, iK = 61451, pK = 385, Vw = 1001, nw = 1006, Rw = 1016, JK = 61450, rw = 384, uw = 387, Ow = 395, ew = 396, vw = 0, qw = 4, UI = 61443, hK = 61444, oK = 61455, HK = 61456, _w = 75, $w = 1, mK = 61469, kK = 61482, FK = 61470, M0 = 61471, I0 = 61481, $ = 0, UM = 1, cI = 2, K0 = 4, CM = 5, jM = 6, P0 = 7, w0 = 8;
|
|
1941
|
+
function t(M, I) {
|
|
1937
1942
|
if (I + 8 > M.byteLength) return null;
|
|
1938
1943
|
const K = M.getUint16(I, !0), P = M.getUint16(I + 2, !0), w = M.getUint32(I + 4, !0), l = Math.max(0, M.byteLength - I - 8);
|
|
1939
1944
|
return {
|
|
@@ -1945,7 +1950,7 @@ function Q(M, I) {
|
|
|
1945
1950
|
};
|
|
1946
1951
|
}
|
|
1947
1952
|
function bI(M) {
|
|
1948
|
-
const I =
|
|
1953
|
+
const I = W(M);
|
|
1949
1954
|
let K = "", P = 0;
|
|
1950
1955
|
for (M.length >= 2 && I.getUint16(0, !0) === 65279 && (P = 2); P + 1 < M.length; P += 2) {
|
|
1951
1956
|
const w = I.getUint16(P, !0);
|
|
@@ -1972,7 +1977,7 @@ function WI(M) {
|
|
|
1972
1977
|
`).trim();
|
|
1973
1978
|
}
|
|
1974
1979
|
function l0(M) {
|
|
1975
|
-
const I =
|
|
1980
|
+
const I = W(M);
|
|
1976
1981
|
let K = "", P = 0;
|
|
1977
1982
|
for (M.length >= 2 && I.getUint16(0, !0) === 65279 && (P = 2); P + 1 < M.length; P += 2) {
|
|
1978
1983
|
const w = I.getUint16(P, !0);
|
|
@@ -1995,7 +2000,7 @@ function C0(M) {
|
|
|
1995
2000
|
return M & 15 && (I += 2), M & 16 && (I += 2), M & 32 && (I += 4), M & 64 && (I += 2), M & 128 && (I += 2), M & 256 && (I += 2), M & 512 && (I += 2), M & 1024 && (I += 2), M & 2048 && (I += 2), M & 4096 && (I += 2), M & 8192 && (I += 2), M & 16384 && (I += 2), M & 65536 && (I += 2), M & 917504 && (I += 2), M & 1048576 && (I += 2), I;
|
|
1996
2001
|
}
|
|
1997
2002
|
function LK(M, I) {
|
|
1998
|
-
const K =
|
|
2003
|
+
const K = W(M), P = [];
|
|
1999
2004
|
let w = 0, l = 0;
|
|
2000
2005
|
for (; w + 10 <= M.length && l < I; ) {
|
|
2001
2006
|
const C = K.getUint32(w, !0), g = K.getUint16(w + 4, !0), s = K.getUint32(w + 6, !0);
|
|
@@ -2029,7 +2034,7 @@ function s0(M, I, K, P) {
|
|
|
2029
2034
|
return w;
|
|
2030
2035
|
}
|
|
2031
2036
|
function T0(M, I, K, P, w = 0) {
|
|
2032
|
-
const l =
|
|
2037
|
+
const l = W(M);
|
|
2033
2038
|
let C = K, g = 0, s, y = !1, T, S;
|
|
2034
2039
|
for (; C + 8 <= M.length && g < I; ) {
|
|
2035
2040
|
const X = l.getUint32(C, !0), B = l.getUint32(C + 4, !0);
|
|
@@ -2083,15 +2088,15 @@ function S0(M, I) {
|
|
|
2083
2088
|
return l += s.length + 1, { text: s.replace(/[ \t]+$/g, "").replace(/^[ \t]+/, ""), indent: T };
|
|
2084
2089
|
});
|
|
2085
2090
|
}
|
|
2086
|
-
function
|
|
2091
|
+
function q(M) {
|
|
2087
2092
|
const I = M.trim();
|
|
2088
2093
|
return /^(by|from|with|featuring|presented by)\s+/i.test(I) || /^[\w\s]+,\s*(phd|md|esq|jr|sr|ii|iii|iv)$/i.test(I);
|
|
2089
2094
|
}
|
|
2090
|
-
function
|
|
2095
|
+
function dM(M) {
|
|
2091
2096
|
const I = M.trim();
|
|
2092
2097
|
return /^(click to (edit|add)|double[- ]click|placeholder|^title$|^subtitle$|^text$|^slide title$|^body text$)/i.test(I) || /^\[.*\]$/.test(I) || I.length === 0;
|
|
2093
2098
|
}
|
|
2094
|
-
function
|
|
2099
|
+
function BM(M) {
|
|
2095
2100
|
const I = M.trim();
|
|
2096
2101
|
return !!(!I || /^[\s*•·▪◦\-–—]+$/u.test(I) || I.length <= 2 && !/[a-zA-Z0-9\u00C0-\u024F]/u.test(I));
|
|
2097
2102
|
}
|
|
@@ -2099,7 +2104,7 @@ function lI(M) {
|
|
|
2099
2104
|
const I = M.trim();
|
|
2100
2105
|
return /^(ingredients|preparation|directions|instructions|method|steps)\s*$/i.test(I) ? "kicker" : /^\d+\s*(minutes|mins|hr|hours)\b/i.test(I) || /^serves\b/i.test(I) || /^\d+\s*(minutes|mins)\s*[•·]\s*serves\b/i.test(I) || /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(I) || /^www\.[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/i.test(I) || /^https?:\/\//i.test(I) ? "meta" : null;
|
|
2101
2106
|
}
|
|
2102
|
-
function
|
|
2107
|
+
function U(M) {
|
|
2103
2108
|
return `#${[M.r, M.g, M.b].map((I) => I.toString(16).padStart(2, "0")).join("")}`;
|
|
2104
2109
|
}
|
|
2105
2110
|
function gI(M) {
|
|
@@ -2109,11 +2114,11 @@ function gI(M) {
|
|
|
2109
2114
|
const K = /times|roman|georgia|garamond|antiqua|mincho|serif/i.test(I) ? "serif" : /wingdings|symbol/i.test(I) ? "fantasy" : "sans-serif";
|
|
2110
2115
|
return `'${I}',${K}`;
|
|
2111
2116
|
}
|
|
2112
|
-
function
|
|
2117
|
+
function DM(M) {
|
|
2113
2118
|
return !!M && /gothic|mincho|droid|simsun|nsimsun|mingliu|pming|gulim|batang|malgun|meiryo|hiragino|微软|宋体|黑体|ゴシック/i.test(M);
|
|
2114
2119
|
}
|
|
2115
2120
|
function QK(M, I) {
|
|
2116
|
-
const K =
|
|
2121
|
+
const K = W(M);
|
|
2117
2122
|
let P, w;
|
|
2118
2123
|
for (let l = 0; l + 8 <= M.length; l += 2) {
|
|
2119
2124
|
const C = K.getUint32(l, !0), g = K.getUint32(l + 4, !0);
|
|
@@ -2141,7 +2146,7 @@ function j0(M, I) {
|
|
|
2141
2146
|
}
|
|
2142
2147
|
function X0(M, I, K, P) {
|
|
2143
2148
|
const w = (l) => {
|
|
2144
|
-
if (!(l == null || !K[l]) && !(
|
|
2149
|
+
if (!(l == null || !K[l]) && !(DM(K[l]) && K.some((C) => C && !DM(C))))
|
|
2145
2150
|
return l;
|
|
2146
2151
|
};
|
|
2147
2152
|
return w(M) ?? w(I) ?? CI(K, P);
|
|
@@ -2149,8 +2154,8 @@ function X0(M, I, K, P) {
|
|
|
2149
2154
|
function CI(M, I) {
|
|
2150
2155
|
const K = I ? [1, 0, 2, 5] : [0, 1, 2, 5];
|
|
2151
2156
|
for (const w of K)
|
|
2152
|
-
if (M[w] && !
|
|
2153
|
-
const P = M.findIndex((w) => w && !
|
|
2157
|
+
if (M[w] && !DM(M[w])) return w;
|
|
2158
|
+
const P = M.findIndex((w) => w && !DM(w));
|
|
2154
2159
|
return P >= 0 ? P : 0;
|
|
2155
2160
|
}
|
|
2156
2161
|
function yI(M, I) {
|
|
@@ -2212,7 +2217,7 @@ function Y0(M) {
|
|
|
2212
2217
|
return { r: M & 255, g: M >> 8 & 255, b: M >> 16 & 255 };
|
|
2213
2218
|
}
|
|
2214
2219
|
function G0(M) {
|
|
2215
|
-
const I = [], K = Math.floor(M.length / 6), P =
|
|
2220
|
+
const I = [], K = Math.floor(M.length / 6), P = W(M);
|
|
2216
2221
|
for (let w = 0; w < K; w++) {
|
|
2217
2222
|
const l = P.getUint16(w * 6, !0), C = l & 16383, g = (l & 32768) !== 0, s = (l & 16384) !== 0;
|
|
2218
2223
|
if (!(g || s) && C === pK) {
|
|
@@ -2226,20 +2231,20 @@ const d0 = { r: 255, g: 255, b: 255 };
|
|
|
2226
2231
|
function sI(M, I) {
|
|
2227
2232
|
const K = (I == null ? void 0 : I.surface) ?? d0, P = M[3] ?? M[1] ?? { r: 0, g: 0, b: 0 }, w = M[1] ?? { r: 0, g: 0, b: 0 }, l = M[4] ?? P, C = M[5] ?? l;
|
|
2228
2233
|
return {
|
|
2229
|
-
brand:
|
|
2230
|
-
onBrand:
|
|
2231
|
-
surface:
|
|
2232
|
-
title:
|
|
2233
|
-
body:
|
|
2234
|
-
accent:
|
|
2235
|
-
background: (I == null ? void 0 : I.css) ??
|
|
2234
|
+
brand: U(l),
|
|
2235
|
+
onBrand: U(M[1] ?? B0(l)),
|
|
2236
|
+
surface: U(K),
|
|
2237
|
+
title: U(P),
|
|
2238
|
+
body: U(w),
|
|
2239
|
+
accent: U(C),
|
|
2240
|
+
background: (I == null ? void 0 : I.css) ?? U(K)
|
|
2236
2241
|
};
|
|
2237
2242
|
}
|
|
2238
2243
|
function x0(M, I = []) {
|
|
2239
2244
|
var K;
|
|
2240
2245
|
const P = (K = M[0]) == null ? void 0 : K.colors;
|
|
2241
2246
|
if (!P) {
|
|
2242
|
-
const w = I[0] ? { css:
|
|
2247
|
+
const w = I[0] ? { css: U(I[0]), surface: I[0] } : null;
|
|
2243
2248
|
return sI([], w);
|
|
2244
2249
|
}
|
|
2245
2250
|
return sI(P);
|
|
@@ -2250,19 +2255,19 @@ function fK(M, I = !1, K = !1) {
|
|
|
2250
2255
|
return I && g === 0 && !w ? "image" : P && w && g < 100 || P && g < 40 && y.length >= 2 || P && g === 0 && !w && s.length >= 2 && s.length <= 4 && C.length <= 36 ? "hero" : P && g === 0 && !w && s.length <= 3 && C.length <= 28 ? "section" : "content";
|
|
2251
2256
|
}
|
|
2252
2257
|
function c0(M) {
|
|
2253
|
-
const I = M.filter((y) => !
|
|
2258
|
+
const I = M.filter((y) => !BM(y.text) && !dM(y.text)).map((y) => ({ ...y }));
|
|
2254
2259
|
if (!I.length) return I;
|
|
2255
2260
|
for (const y of I)
|
|
2256
|
-
|
|
2261
|
+
q(y.text) ? y.role = "subtitle" : y.textType === $ || y.textType === jM ? y.role = "title" : y.textType === CM ? y.role = "subtitle" : y.role = "body";
|
|
2257
2262
|
{
|
|
2258
|
-
const y = I.filter((S) => S.role === "title").find((S) =>
|
|
2259
|
-
(S) => S.role !== "subtitle" && !
|
|
2260
|
-
`) && (S.textType === CM || S.textType ===
|
|
2263
|
+
const y = I.filter((S) => S.role === "title").find((S) => q(S.text)), T = I.find(
|
|
2264
|
+
(S) => S.role !== "subtitle" && !q(S.text) && S.text.length <= 40 && !S.text.includes(`
|
|
2265
|
+
`) && (S.textType === CM || S.textType === $ || S.textType === UM)
|
|
2261
2266
|
);
|
|
2262
2267
|
y && T && y !== T && (y.role = "subtitle", T.role = "title");
|
|
2263
2268
|
}
|
|
2264
2269
|
const K = I.filter(
|
|
2265
|
-
(y) => y.textType ===
|
|
2270
|
+
(y) => y.textType === $ || y.textType === jM || y.role === "title"
|
|
2266
2271
|
);
|
|
2267
2272
|
for (const y of I) {
|
|
2268
2273
|
const T = lI(y.text);
|
|
@@ -2271,14 +2276,14 @@ function c0(M) {
|
|
|
2271
2276
|
y.role = "title";
|
|
2272
2277
|
continue;
|
|
2273
2278
|
}
|
|
2274
|
-
if (T === "kicker" && (y.textType ===
|
|
2279
|
+
if (T === "kicker" && (y.textType === $ || y.textType === jM) && I.indexOf(y) === 0) {
|
|
2275
2280
|
y.role = "title";
|
|
2276
2281
|
continue;
|
|
2277
2282
|
}
|
|
2278
2283
|
y.role = T;
|
|
2279
2284
|
}
|
|
2280
2285
|
}
|
|
2281
|
-
let P = I.find((y) => y.role === "title" && !
|
|
2286
|
+
let P = I.find((y) => y.role === "title" && !q(y.text));
|
|
2282
2287
|
if (!P) {
|
|
2283
2288
|
const y = I.find((T) => T.role === "body");
|
|
2284
2289
|
if (y && y.text.includes(`
|
|
@@ -2301,7 +2306,7 @@ function c0(M) {
|
|
|
2301
2306
|
}
|
|
2302
2307
|
if (!P) {
|
|
2303
2308
|
const T = I.find((S) => S.role === "body" && S.text.length <= 60 && !S.text.includes(`
|
|
2304
|
-
`)) ?? I.find((S) => !
|
|
2309
|
+
`)) ?? I.find((S) => !q(S.text) && S.role !== "meta");
|
|
2305
2310
|
T && (T.role = "title", P = T);
|
|
2306
2311
|
}
|
|
2307
2312
|
}
|
|
@@ -2312,14 +2317,14 @@ function c0(M) {
|
|
|
2312
2317
|
const l = I.filter((y) => y !== P && y.role !== "kicker" && y.role !== "meta");
|
|
2313
2318
|
if (P && l.length >= 1) {
|
|
2314
2319
|
const y = l[0];
|
|
2315
|
-
(y.role === "subtitle" ||
|
|
2320
|
+
(y.role === "subtitle" || q(y.text) || y.role === "body" && y.text.length <= 60 && !y.text.includes(`
|
|
2316
2321
|
`) && l.length === 1) && (y.role = "subtitle");
|
|
2317
2322
|
}
|
|
2318
2323
|
let C = !1;
|
|
2319
2324
|
for (const y of I)
|
|
2320
2325
|
y.role === "subtitle" && (C ? y.role = "body" : C = !0);
|
|
2321
2326
|
const g = I.find((y) => y.role === "title"), s = I.find((y) => y.role === "subtitle");
|
|
2322
|
-
return g && s &&
|
|
2327
|
+
return g && s && q(g.text) && !q(s.text) && (g.role = "subtitle", s.role = "title"), I.filter((y) => !BM(y.text));
|
|
2323
2328
|
}
|
|
2324
2329
|
function aK(M, I, K = [], P, w, l) {
|
|
2325
2330
|
const C = c0(M);
|
|
@@ -2372,7 +2377,7 @@ function i0(M, I) {
|
|
|
2372
2377
|
function p0(M) {
|
|
2373
2378
|
const I = NM(M, "Pictures");
|
|
2374
2379
|
if (!(I != null && I.length)) return [];
|
|
2375
|
-
const K =
|
|
2380
|
+
const K = W(I), P = [];
|
|
2376
2381
|
let w = 0;
|
|
2377
2382
|
for (; w + 8 <= I.length; ) {
|
|
2378
2383
|
const l = K.getUint16(w, !0), C = K.getUint16(w + 2, !0), g = K.getUint32(w + 4, !0), s = l >> 4, y = w + 8, T = Math.min(y + g, I.length);
|
|
@@ -2395,17 +2400,17 @@ function J0(M) {
|
|
|
2395
2400
|
const I = [];
|
|
2396
2401
|
let K = null;
|
|
2397
2402
|
const P = (w, l) => {
|
|
2398
|
-
const C =
|
|
2403
|
+
const C = W(M);
|
|
2399
2404
|
let g = w;
|
|
2400
2405
|
for (; g + 8 <= l; ) {
|
|
2401
|
-
const s =
|
|
2406
|
+
const s = t(C, g);
|
|
2402
2407
|
if (!s) break;
|
|
2403
2408
|
const y = g + s.headerSize, T = Math.min(y + s.len, l), S = M.subarray(y, T);
|
|
2404
2409
|
if (s.type === xI)
|
|
2405
2410
|
S.length >= 4 ? K = new DataView(S.buffer, S.byteOffset, 4).getUint32(0, !0) : S.length >= 2 && (K = new DataView(S.buffer, S.byteOffset, 2).getUint16(0, !0));
|
|
2406
|
-
else if (s.type ===
|
|
2407
|
-
const j = s.type ===
|
|
2408
|
-
j && K !== cI && !
|
|
2411
|
+
else if (s.type === IM || s.type === fM) {
|
|
2412
|
+
const j = s.type === IM ? bI(S) : ZI(S);
|
|
2413
|
+
j && K !== cI && !BM(j) && !dM(j) && I.push({
|
|
2409
2414
|
role: "body",
|
|
2410
2415
|
text: j,
|
|
2411
2416
|
textType: K ?? void 0
|
|
@@ -2442,34 +2447,34 @@ function h0(M) {
|
|
|
2442
2447
|
return { cols: I.length, rows: K.length, cells: P };
|
|
2443
2448
|
}
|
|
2444
2449
|
function o0(M) {
|
|
2445
|
-
const I =
|
|
2450
|
+
const I = W(M);
|
|
2446
2451
|
let K = -1, P = 0, w = 0, l = 0, C = 0, g = !1, s = "";
|
|
2447
2452
|
const y = (T, S) => {
|
|
2448
2453
|
let j = T;
|
|
2449
2454
|
for (; j + 8 <= S; ) {
|
|
2450
|
-
const X =
|
|
2455
|
+
const X = t(I, j);
|
|
2451
2456
|
if (!X) break;
|
|
2452
2457
|
const B = j + X.headerSize, D = Math.min(B + X.len, S), A = M.subarray(B, D);
|
|
2453
2458
|
if (X.type === JK)
|
|
2454
2459
|
K = X.instance;
|
|
2455
2460
|
else if (X.type === oK && A.length >= 16) {
|
|
2456
|
-
const Y =
|
|
2461
|
+
const Y = W(A), G = Y.getInt32(0, !0), x = Y.getInt32(4, !0), J = Y.getInt32(8, !0), i = Y.getInt32(12, !0);
|
|
2457
2462
|
P = G, w = x, l = J - G, C = i - x, g = !0;
|
|
2458
2463
|
} else if (X.type === HK && A.length >= 8) {
|
|
2459
|
-
const Y =
|
|
2464
|
+
const Y = W(A), G = Y.getInt16(0, !0), x = Y.getInt16(2, !0), J = Y.getInt16(4, !0), i = Y.getInt16(6, !0);
|
|
2460
2465
|
P = x, w = G, l = J - x, C = i - G, g = !0;
|
|
2461
|
-
} else X.type ===
|
|
2466
|
+
} else X.type === IM || X.type === fM ? s = X.type === IM ? bI(A) : ZI(A) : X.ver === 15 && X.len > 0 && y(B, D);
|
|
2462
2467
|
if (j = D, X.len === 0) break;
|
|
2463
2468
|
}
|
|
2464
2469
|
};
|
|
2465
2470
|
return y(0, M.length), !g || K !== $w || l < 48 || C < 24 ? null : { x: P, y: w, w: l, h: C, text: s };
|
|
2466
2471
|
}
|
|
2467
2472
|
function H0(M) {
|
|
2468
|
-
const I =
|
|
2473
|
+
const I = W(M), K = [], P = (C, g) => {
|
|
2469
2474
|
const s = [];
|
|
2470
2475
|
let y = C;
|
|
2471
2476
|
for (; y + 8 <= g; ) {
|
|
2472
|
-
const T =
|
|
2477
|
+
const T = t(I, y);
|
|
2473
2478
|
if (!T) break;
|
|
2474
2479
|
const S = y + T.headerSize, j = Math.min(S + T.len, g), X = M.subarray(S, j);
|
|
2475
2480
|
if (T.type === hK) {
|
|
@@ -2485,7 +2490,7 @@ function H0(M) {
|
|
|
2485
2490
|
}, w = (C, g) => {
|
|
2486
2491
|
let s = C;
|
|
2487
2492
|
for (; s + 8 <= g; ) {
|
|
2488
|
-
const y =
|
|
2493
|
+
const y = t(I, s);
|
|
2489
2494
|
if (!y) break;
|
|
2490
2495
|
const T = s + y.headerSize, S = Math.min(T + y.len, g);
|
|
2491
2496
|
if (y.type === UI) {
|
|
@@ -2534,9 +2539,9 @@ function k0(M, I) {
|
|
|
2534
2539
|
if (M.fillColor == null && M.fillType == null) return null;
|
|
2535
2540
|
const K = M.fillColor != null ? aI(M.fillColor, I) : void 0, P = M.fillBackColor != null ? aI(M.fillBackColor, I) : void 0, w = M.fillType ?? vw;
|
|
2536
2541
|
return w >= qw && w <= 8 && K && P ? {
|
|
2537
|
-
css: `linear-gradient(180deg, ${
|
|
2542
|
+
css: `linear-gradient(180deg, ${U(K)} 0%, ${U(P)} 100%)`,
|
|
2538
2543
|
surface: K
|
|
2539
|
-
} : K ? { css:
|
|
2544
|
+
} : K ? { css: U(K), surface: K } : null;
|
|
2540
2545
|
}
|
|
2541
2546
|
function VI(M, I) {
|
|
2542
2547
|
for (const K of M) {
|
|
@@ -2550,7 +2555,7 @@ function F0(M, I) {
|
|
|
2550
2555
|
return !(M != null && M.length) || !(I != null && I.length) || M.length < 8 || I.length < 8 ? !1 : M.every((K, P) => K.r === I[P].r && K.g === I[P].g && K.b === I[P].b);
|
|
2551
2556
|
}
|
|
2552
2557
|
function L0(M) {
|
|
2553
|
-
const I =
|
|
2558
|
+
const I = W(M), K = {
|
|
2554
2559
|
shapeType: -1,
|
|
2555
2560
|
box: null,
|
|
2556
2561
|
text: "",
|
|
@@ -2566,13 +2571,13 @@ function L0(M) {
|
|
|
2566
2571
|
}, P = (w, l) => {
|
|
2567
2572
|
let C = w;
|
|
2568
2573
|
for (; C + 8 <= l; ) {
|
|
2569
|
-
const g =
|
|
2574
|
+
const g = t(I, C);
|
|
2570
2575
|
if (!g) break;
|
|
2571
2576
|
const s = C + g.headerSize, y = Math.min(s + g.len, l), T = M.subarray(s, y);
|
|
2572
2577
|
if (g.type === JK)
|
|
2573
2578
|
K.shapeType = g.instance;
|
|
2574
2579
|
else if (g.type === oK && T.length >= 16) {
|
|
2575
|
-
const S =
|
|
2580
|
+
const S = W(T);
|
|
2576
2581
|
K.box = {
|
|
2577
2582
|
l: S.getInt32(0, !0),
|
|
2578
2583
|
t: S.getInt32(4, !0),
|
|
@@ -2580,7 +2585,7 @@ function L0(M) {
|
|
|
2580
2585
|
b: S.getInt32(12, !0)
|
|
2581
2586
|
};
|
|
2582
2587
|
} else if (g.type === HK && T.length >= 8) {
|
|
2583
|
-
const S =
|
|
2588
|
+
const S = W(T);
|
|
2584
2589
|
K.box = {
|
|
2585
2590
|
t: S.getInt16(0, !0),
|
|
2586
2591
|
l: S.getInt16(2, !0),
|
|
@@ -2588,22 +2593,22 @@ function L0(M) {
|
|
|
2588
2593
|
b: S.getInt16(6, !0)
|
|
2589
2594
|
};
|
|
2590
2595
|
} else if (g.type === iK) {
|
|
2591
|
-
const S =
|
|
2596
|
+
const S = W(T), j = Math.floor(T.length / 6);
|
|
2592
2597
|
for (let X = 0; X < j; X++) {
|
|
2593
2598
|
const B = S.getUint16(X * 6, !0) & 16383, D = S.getUint32(X * 6 + 2, !0);
|
|
2594
2599
|
B === 260 ? K.pib = D & 65535 : B === rw ? K.fillType = D : B === pK ? K.fillColor = D : B === uw ? K.fillBackColor = D : B === Ow ? K.fillAngle = D : B === ew && (K.fillFocus = D);
|
|
2595
2600
|
}
|
|
2596
|
-
} else g.type === xI && T.length >= 4 ? K.textType = new DataView(T.buffer, T.byteOffset, 4).getUint32(0, !0) : g.type ===
|
|
2601
|
+
} else g.type === xI && T.length >= 4 ? K.textType = new DataView(T.buffer, T.byteOffset, 4).getUint32(0, !0) : g.type === IM || g.type === fM ? (K.rawText = g.type === IM ? l0(T) : g0(T), K.text = WI(K.rawText)) : g.type === zw ? K.style = T : g.ver === 15 && g.len > 0 && P(s, y);
|
|
2597
2602
|
if (C = y, g.len === 0) break;
|
|
2598
2603
|
}
|
|
2599
2604
|
};
|
|
2600
2605
|
return P(0, M.length), K;
|
|
2601
2606
|
}
|
|
2602
2607
|
function TI(M) {
|
|
2603
|
-
const I =
|
|
2608
|
+
const I = W(M), K = [], P = (w, l) => {
|
|
2604
2609
|
let C = w;
|
|
2605
2610
|
for (; C + 8 <= l; ) {
|
|
2606
|
-
const g =
|
|
2611
|
+
const g = t(I, C);
|
|
2607
2612
|
if (!g) break;
|
|
2608
2613
|
const s = C + g.headerSize, y = Math.min(s + g.len, l);
|
|
2609
2614
|
if (g.type === hK ? K.push(L0(M.subarray(s, y))) : g.ver === 15 && g.len > 0 && P(s, y), C = y, g.len === 0) break;
|
|
@@ -2612,10 +2617,10 @@ function TI(M) {
|
|
|
2612
2617
|
return P(0, M.length), K;
|
|
2613
2618
|
}
|
|
2614
2619
|
function t0(M) {
|
|
2615
|
-
const I =
|
|
2620
|
+
const I = W(M), K = [], P = (w, l) => {
|
|
2616
2621
|
let C = w;
|
|
2617
2622
|
for (; C + 8 <= l; ) {
|
|
2618
|
-
const g =
|
|
2623
|
+
const g = t(I, C);
|
|
2619
2624
|
if (!g) break;
|
|
2620
2625
|
const s = C + g.headerSize, y = Math.min(s + g.len, l);
|
|
2621
2626
|
if (g.type === fw) {
|
|
@@ -2634,16 +2639,16 @@ function t0(M) {
|
|
|
2634
2639
|
return P(0, M.length), K;
|
|
2635
2640
|
}
|
|
2636
2641
|
function Q0(M, I) {
|
|
2637
|
-
const K =
|
|
2642
|
+
const K = W(M), P = [], w = (l, C) => {
|
|
2638
2643
|
let g = l;
|
|
2639
2644
|
for (; g + 8 <= C; ) {
|
|
2640
|
-
const s =
|
|
2645
|
+
const s = t(K, g);
|
|
2641
2646
|
if (!s) break;
|
|
2642
2647
|
const y = g + s.headerSize, T = Math.min(y + s.len, C);
|
|
2643
2648
|
if (s.type === aw) {
|
|
2644
2649
|
const S = M.subarray(y, T), j = QK(S, I);
|
|
2645
2650
|
let X;
|
|
2646
|
-
const B =
|
|
2651
|
+
const B = W(S);
|
|
2647
2652
|
for (let A = 0; A + 2 <= S.length; A += 2) {
|
|
2648
2653
|
const Y = B.getUint16(A, !0);
|
|
2649
2654
|
Y >= 20 && Y <= 72 && (X = Y);
|
|
@@ -2660,7 +2665,7 @@ function Q0(M, I) {
|
|
|
2660
2665
|
return w(0, M.length), P;
|
|
2661
2666
|
}
|
|
2662
2667
|
function VK(M, I, K) {
|
|
2663
|
-
const P = K[
|
|
2668
|
+
const P = K[$] ?? K[jM], w = K[UM] ?? K[CM], l = (P == null ? void 0 : P.font) != null && !DM(I[P.font]) ? P.font : CI(I, !0), C = (w == null ? void 0 : w.font) != null && !DM(I[w.font]) ? w.font : CI(I, !1), g = gI(I[l] ?? I[0]), s = gI(I[C] ?? I[0]);
|
|
2664
2669
|
return {
|
|
2665
2670
|
...M,
|
|
2666
2671
|
font: s ?? g,
|
|
@@ -2671,12 +2676,12 @@ function VK(M, I, K) {
|
|
|
2671
2676
|
};
|
|
2672
2677
|
}
|
|
2673
2678
|
function nI(M) {
|
|
2674
|
-
const I =
|
|
2679
|
+
const I = W(M);
|
|
2675
2680
|
let K = null;
|
|
2676
2681
|
const P = (w, l) => {
|
|
2677
2682
|
let C = w;
|
|
2678
2683
|
for (; C + 8 <= l; ) {
|
|
2679
|
-
const g =
|
|
2684
|
+
const g = t(I, C);
|
|
2680
2685
|
if (!g) break;
|
|
2681
2686
|
const s = C + g.headerSize, y = Math.min(s + g.len, l);
|
|
2682
2687
|
if (g.type === WK) {
|
|
@@ -2703,7 +2708,7 @@ function z0(M, I, K) {
|
|
|
2703
2708
|
return K.add(P), I[P] ?? void 0;
|
|
2704
2709
|
}
|
|
2705
2710
|
function N0(M, I, K) {
|
|
2706
|
-
if (M ===
|
|
2711
|
+
if (M === $ || M === jM) return "title";
|
|
2707
2712
|
if (M === CM || M === P0 || M === w0) {
|
|
2708
2713
|
if (M === CM) {
|
|
2709
2714
|
const P = I.split(/\n/).map((w) => w.trim()).filter(Boolean);
|
|
@@ -2729,20 +2734,20 @@ function f0(M, I, K, P, w, l = [], C = []) {
|
|
|
2729
2734
|
const Y = fI(A.box, K);
|
|
2730
2735
|
if (!Y) continue;
|
|
2731
2736
|
if (A.shapeType === _w || A.pib) {
|
|
2732
|
-
const
|
|
2733
|
-
if (
|
|
2737
|
+
const KM = z0(A.pib, I, P);
|
|
2738
|
+
if (KM && (B.push(KM), X.push({ kind: "image", box: Y, image: KM })), !A.text || BM(A.text) || dM(A.text)) continue;
|
|
2734
2739
|
}
|
|
2735
|
-
if (!A.text ||
|
|
2736
|
-
const G = N0(A.textType, A.text, Y), x = S0(A.rawText || A.text, A.style), J = (g = A.style) != null && g.length ? LK(A.style, (A.rawText || A.text).length).end : 0, i = (s = A.style) != null && s.length ? T0(A.style, (A.rawText || A.text).length, J, w, l.length) : { color: void 0, shadow: !1, size: void 0, font: void 0 }, k = G === "title" ? w == null ? void 0 : w[3] : w == null ? void 0 : w[1], r = i.color ?? k ?? { r: 0, g: 0, b: 0 },
|
|
2740
|
+
if (!A.text || BM(A.text) || dM(A.text)) continue;
|
|
2741
|
+
const G = N0(A.textType, A.text, Y), x = S0(A.rawText || A.text, A.style), J = (g = A.style) != null && g.length ? LK(A.style, (A.rawText || A.text).length).end : 0, i = (s = A.style) != null && s.length ? T0(A.style, (A.rawText || A.text).length, J, w, l.length) : { color: void 0, shadow: !1, size: void 0, font: void 0 }, k = G === "title" ? w == null ? void 0 : w[3] : w == null ? void 0 : w[1], r = i.color ?? k ?? { r: 0, g: 0, b: 0 }, cM = A.textType ?? (G === "title" ? $ : G === "subtitle" ? CM : UM), u = C[cM] ?? (G === "title" ? C[$] : C[UM]), yM = X0(i.font, u == null ? void 0 : u.font, l, G === "title"), aM = G === "title" && i.size != null && i.size < 20 ? (u == null ? void 0 : u.size) ?? i.size : i.size ?? (u == null ? void 0 : u.size);
|
|
2737
2742
|
X.push({
|
|
2738
2743
|
kind: G,
|
|
2739
2744
|
box: Y,
|
|
2740
2745
|
center: A.textType === jM || A.textType === CM && G === "subtitle" || G === "title" && !i.shadow,
|
|
2741
2746
|
narrow: Y.w < 42,
|
|
2742
2747
|
shadow: i.shadow || void 0,
|
|
2743
|
-
color:
|
|
2748
|
+
color: U(r),
|
|
2744
2749
|
fontSize: aM,
|
|
2745
|
-
fontFamily: gI(l[
|
|
2750
|
+
fontFamily: gI(l[yM] ?? l[0]),
|
|
2746
2751
|
text: A.text,
|
|
2747
2752
|
paragraphs: x.length ? x : void 0
|
|
2748
2753
|
});
|
|
@@ -2750,14 +2755,14 @@ function f0(M, I, K, P, w, l = [], C = []) {
|
|
|
2750
2755
|
return { shapes: X, images: B, table: T };
|
|
2751
2756
|
}
|
|
2752
2757
|
function a0(M) {
|
|
2753
|
-
const I =
|
|
2758
|
+
const I = W(M), K = (P, w) => {
|
|
2754
2759
|
let l = P;
|
|
2755
2760
|
for (; l + 8 <= w; ) {
|
|
2756
|
-
const C =
|
|
2761
|
+
const C = t(I, l);
|
|
2757
2762
|
if (!C) break;
|
|
2758
2763
|
const g = l + C.headerSize, s = Math.min(g + C.len, w);
|
|
2759
2764
|
if (C.type === Vw && C.len >= 8) {
|
|
2760
|
-
const y =
|
|
2765
|
+
const y = W(M.subarray(g, s)), T = Math.abs(y.getInt32(0, !0)) || 4, S = Math.abs(y.getInt32(4, !0)) || 3;
|
|
2761
2766
|
return { width: T, height: S };
|
|
2762
2767
|
}
|
|
2763
2768
|
if (C.ver === 15 && C.len > 0) {
|
|
@@ -2771,10 +2776,10 @@ function a0(M) {
|
|
|
2771
2776
|
return K(0, M.length) ?? { width: 4, height: 3 };
|
|
2772
2777
|
}
|
|
2773
2778
|
function V0(M, I, K, P, w = [], l = []) {
|
|
2774
|
-
const C =
|
|
2779
|
+
const C = W(M), g = [], s = [], y = [], T = /* @__PURE__ */ new Set(), S = (j, X) => {
|
|
2775
2780
|
let B = j;
|
|
2776
2781
|
for (; B + 8 <= X; ) {
|
|
2777
|
-
const D =
|
|
2782
|
+
const D = t(C, B);
|
|
2778
2783
|
if (!D) break;
|
|
2779
2784
|
const A = B + D.headerSize, Y = Math.min(A + D.len, X), G = M.subarray(A, Y);
|
|
2780
2785
|
if (D.type === Rw) {
|
|
@@ -2790,7 +2795,7 @@ function V0(M, I, K, P, w = [], l = []) {
|
|
|
2790
2795
|
let D = VI(B, X ?? void 0);
|
|
2791
2796
|
if (!D && X) {
|
|
2792
2797
|
const i = s.find((k) => F0(k.scheme, X));
|
|
2793
|
-
i && (D = i.fill ?? (X[0] ? { css:
|
|
2798
|
+
i && (D = i.fill ?? (X[0] ? { css: U(X[0]), surface: X[0] } : null));
|
|
2794
2799
|
}
|
|
2795
2800
|
const A = VK(E0(X ?? void 0, P, D), w, l), Y = f0(
|
|
2796
2801
|
j,
|
|
@@ -2822,20 +2827,20 @@ function RI(M) {
|
|
|
2822
2827
|
}
|
|
2823
2828
|
K = [], P = null, w = !1;
|
|
2824
2829
|
}, C = (g, s, y) => {
|
|
2825
|
-
const T =
|
|
2830
|
+
const T = W(g);
|
|
2826
2831
|
let S = s;
|
|
2827
2832
|
for (; S + 8 <= y; ) {
|
|
2828
|
-
const j =
|
|
2833
|
+
const j = t(T, S);
|
|
2829
2834
|
if (!j) break;
|
|
2830
2835
|
const X = S + j.headerSize, B = Math.min(X + j.len, y), D = g.subarray(X, B);
|
|
2831
2836
|
if (j.type === Nw)
|
|
2832
2837
|
l(), w = !0;
|
|
2833
2838
|
else if (j.type === xI)
|
|
2834
2839
|
D.length >= 4 ? P = new DataView(D.buffer, D.byteOffset, 4).getUint32(0, !0) : D.length >= 2 && (P = new DataView(D.buffer, D.byteOffset, 2).getUint16(0, !0));
|
|
2835
|
-
else if (j.type ===
|
|
2840
|
+
else if (j.type === IM || j.type === fM) {
|
|
2836
2841
|
!w && I.length === 0 && (w = !0);
|
|
2837
|
-
const A = j.type ===
|
|
2838
|
-
A && P !== cI && !
|
|
2842
|
+
const A = j.type === IM ? bI(D) : ZI(D);
|
|
2843
|
+
A && P !== cI && !BM(A) && !dM(A) && K.push({
|
|
2839
2844
|
role: "body",
|
|
2840
2845
|
text: A,
|
|
2841
2846
|
textType: P ?? void 0
|
|
@@ -2847,10 +2852,10 @@ function RI(M) {
|
|
|
2847
2852
|
return C(M, 0, M.length), l(), I;
|
|
2848
2853
|
}
|
|
2849
2854
|
function nK(M, I, K, P, w) {
|
|
2850
|
-
const l =
|
|
2855
|
+
const l = W(M);
|
|
2851
2856
|
let C = I;
|
|
2852
2857
|
for (; C + 8 <= K; ) {
|
|
2853
|
-
const g =
|
|
2858
|
+
const g = t(l, C);
|
|
2854
2859
|
if (!g) break;
|
|
2855
2860
|
const s = C + g.headerSize, y = Math.min(s + g.len, K), T = M.subarray(s, y);
|
|
2856
2861
|
if (g.type === WK) {
|
|
@@ -2871,10 +2876,10 @@ function n0(M) {
|
|
|
2871
2876
|
let S = V0(P, C, T, y, g, s);
|
|
2872
2877
|
if (!S.length) {
|
|
2873
2878
|
const j = [], X = (B, D) => {
|
|
2874
|
-
const A =
|
|
2879
|
+
const A = W(P);
|
|
2875
2880
|
let Y = B;
|
|
2876
2881
|
for (; Y + 8 <= D; ) {
|
|
2877
|
-
const G =
|
|
2882
|
+
const G = t(A, Y);
|
|
2878
2883
|
if (!G) break;
|
|
2879
2884
|
const x = Y + G.headerSize, J = Math.min(x + G.len, D), i = P.subarray(x, J);
|
|
2880
2885
|
if (G.type === Uw) {
|
|
@@ -3052,13 +3057,13 @@ const eM = 2057, OK = 10, $0 = 60, Ml = 252, Il = 253, Kl = 516, Pl = 214, wl =
|
|
|
3052
3057
|
57,
|
|
3053
3058
|
58
|
|
3054
3059
|
]), eK = ["#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A"];
|
|
3055
|
-
function
|
|
3060
|
+
function MM(M) {
|
|
3056
3061
|
return new DataView(M.buffer, M.byteOffset, M.byteLength);
|
|
3057
3062
|
}
|
|
3058
3063
|
function vK(M) {
|
|
3059
3064
|
if (M.length < 4)
|
|
3060
3065
|
return !1;
|
|
3061
|
-
const I =
|
|
3066
|
+
const I = MM(M).getUint16(0, !0);
|
|
3062
3067
|
return I === 9 || I === 521 || I === 1033 || I === 2057;
|
|
3063
3068
|
}
|
|
3064
3069
|
function bC(M) {
|
|
@@ -3066,7 +3071,7 @@ function bC(M) {
|
|
|
3066
3071
|
return AK(I) ? !!GI(I, ["Workbook", "Book"]) : vK(I);
|
|
3067
3072
|
}
|
|
3068
3073
|
function Yl(M) {
|
|
3069
|
-
const I =
|
|
3074
|
+
const I = MM(M), K = [];
|
|
3070
3075
|
let P = 0;
|
|
3071
3076
|
for (; P + 4 <= M.length; ) {
|
|
3072
3077
|
const w = I.getUint16(P, !0), l = I.getUint16(P + 2, !0);
|
|
@@ -3179,7 +3184,7 @@ function xl(M, I, K) {
|
|
|
3179
3184
|
for (let g = 0; g < P && l < M.length; g++)
|
|
3180
3185
|
C += String.fromCharCode(M[l++]);
|
|
3181
3186
|
else {
|
|
3182
|
-
const g =
|
|
3187
|
+
const g = MM(M);
|
|
3183
3188
|
for (let s = 0; s < P && l + 1 < M.length; s++)
|
|
3184
3189
|
C += String.fromCharCode(g.getUint16(l, !0)), l += 2;
|
|
3185
3190
|
}
|
|
@@ -3216,7 +3221,7 @@ function Zl(M, I) {
|
|
|
3216
3221
|
const P = M[6];
|
|
3217
3222
|
return P === 0 ? { pendingString: !0 } : P === 1 ? M[8] ? "TRUE" : "FALSE" : P === 2 ? eK[M[8]] ?? `#ERR${M[8]}` : "";
|
|
3218
3223
|
}
|
|
3219
|
-
const K =
|
|
3224
|
+
const K = MM(M).getFloat64(6, !0);
|
|
3220
3225
|
return oM(K, I);
|
|
3221
3226
|
}
|
|
3222
3227
|
function eI(M) {
|
|
@@ -3248,7 +3253,7 @@ function pl(M, I, K, P, w, l) {
|
|
|
3248
3253
|
};
|
|
3249
3254
|
let g = null, s = I;
|
|
3250
3255
|
for (; s < M.length; s++) {
|
|
3251
|
-
const { type: y, data: T } = M[s], S =
|
|
3256
|
+
const { type: y, data: T } = M[s], S = MM(T);
|
|
3252
3257
|
if (y === OK)
|
|
3253
3258
|
return { sheet: C, next: s + 1 };
|
|
3254
3259
|
if (y === Il && T.length >= 10) {
|
|
@@ -3357,7 +3362,7 @@ function Jl(M) {
|
|
|
3357
3362
|
let g = 0;
|
|
3358
3363
|
if (((I = K[0]) == null ? void 0 : I.type) === eM) {
|
|
3359
3364
|
const T = K[0].data;
|
|
3360
|
-
T.length >= 2 && (P =
|
|
3365
|
+
T.length >= 2 && (P = MM(T).getUint16(0, !0) >= 1536), g = 1;
|
|
3361
3366
|
}
|
|
3362
3367
|
for (; g < K.length; ) {
|
|
3363
3368
|
const T = K[g];
|
|
@@ -3371,7 +3376,7 @@ function Jl(M) {
|
|
|
3371
3376
|
w.push(...dl(T.data, S)), g = j;
|
|
3372
3377
|
continue;
|
|
3373
3378
|
}
|
|
3374
|
-
T.type === Sl ? l.push(il(T.data, P)) : T.type === jl && T.data.length >= 4 && C.push(
|
|
3379
|
+
T.type === Sl ? l.push(il(T.data, P)) : T.type === jl && T.data.length >= 4 && C.push(MM(T.data).getUint16(2, !0)), g += 1;
|
|
3375
3380
|
}
|
|
3376
3381
|
const s = [];
|
|
3377
3382
|
let y = 0;
|
|
@@ -3381,7 +3386,7 @@ function Jl(M) {
|
|
|
3381
3386
|
g += 1;
|
|
3382
3387
|
continue;
|
|
3383
3388
|
}
|
|
3384
|
-
const S = T.data.length >= 4 ?
|
|
3389
|
+
const S = T.data.length >= 4 ? MM(T.data).getUint16(2, !0) : uI, j = l[y];
|
|
3385
3390
|
if (y += 1, S !== uI) {
|
|
3386
3391
|
for (; g < K.length && K[g].type !== OK; )
|
|
3387
3392
|
g += 1;
|
|
@@ -3487,7 +3492,7 @@ function $K(M) {
|
|
|
3487
3492
|
}
|
|
3488
3493
|
return K.children[0] ?? K;
|
|
3489
3494
|
}
|
|
3490
|
-
function
|
|
3495
|
+
function z(M, I) {
|
|
3491
3496
|
return M.children.find((K) => K.name === I);
|
|
3492
3497
|
}
|
|
3493
3498
|
function SI(M, I) {
|
|
@@ -3497,7 +3502,7 @@ function SI(M, I) {
|
|
|
3497
3502
|
};
|
|
3498
3503
|
return P(M), K;
|
|
3499
3504
|
}
|
|
3500
|
-
function
|
|
3505
|
+
function L(M, I) {
|
|
3501
3506
|
return M.attrs[I];
|
|
3502
3507
|
}
|
|
3503
3508
|
function MP(M, I) {
|
|
@@ -3554,13 +3559,13 @@ function vI(M, I, K) {
|
|
|
3554
3559
|
}
|
|
3555
3560
|
function qI(M) {
|
|
3556
3561
|
if (!M) return;
|
|
3557
|
-
const I = (
|
|
3562
|
+
const I = (L(M, "val") ?? "").toLowerCase();
|
|
3558
3563
|
return !(I === "0" || I === "false" || I === "off");
|
|
3559
3564
|
}
|
|
3560
3565
|
function _I(M, I, K) {
|
|
3561
3566
|
if (!M) return;
|
|
3562
|
-
const P =
|
|
3563
|
-
return P ?
|
|
3567
|
+
const P = z(M, I);
|
|
3568
|
+
return P ? L(P, K) : void 0;
|
|
3564
3569
|
}
|
|
3565
3570
|
function XI(...M) {
|
|
3566
3571
|
const I = {};
|
|
@@ -3574,7 +3579,7 @@ function ml(M) {
|
|
|
3574
3579
|
const K = SI($K(M), "clrScheme")[0];
|
|
3575
3580
|
if (!K) return I;
|
|
3576
3581
|
for (const P of K.children) {
|
|
3577
|
-
const w =
|
|
3582
|
+
const w = z(P, "srgbClr"), l = z(P, "sysClr"), C = IP(w ? L(w, "val") : l ? L(l, "lastClr") : void 0);
|
|
3578
3583
|
C && (I[P.name] = C);
|
|
3579
3584
|
}
|
|
3580
3585
|
return I;
|
|
@@ -3588,22 +3593,22 @@ function kl(M, I, K, P) {
|
|
|
3588
3593
|
}
|
|
3589
3594
|
function $I(M, I) {
|
|
3590
3595
|
if (!M) return {};
|
|
3591
|
-
const K =
|
|
3596
|
+
const K = z(M, "rFonts"), P = z(M, "color"), w = z(M, "sz") ?? z(M, "szCs"), l = z(M, "u"), C = {
|
|
3592
3597
|
font: Hl(
|
|
3593
|
-
K ?
|
|
3598
|
+
K ? L(K, "ascii") ?? L(K, "hAnsi") ?? L(K, "cs") ?? L(K, "eastAsia") : void 0
|
|
3594
3599
|
),
|
|
3595
|
-
size: w ? Number(
|
|
3596
|
-
color: IP(P ?
|
|
3600
|
+
size: w ? Number(L(w, "val")) / 2 : void 0,
|
|
3601
|
+
color: IP(P ? L(P, "val") : void 0) ?? kl(
|
|
3597
3602
|
I,
|
|
3598
|
-
P ?
|
|
3599
|
-
P ?
|
|
3600
|
-
P ?
|
|
3603
|
+
P ? L(P, "themeColor") : void 0,
|
|
3604
|
+
P ? L(P, "themeTint") : void 0,
|
|
3605
|
+
P ? L(P, "themeShade") : void 0
|
|
3601
3606
|
),
|
|
3602
|
-
bold: qI(
|
|
3603
|
-
italic: qI(
|
|
3607
|
+
bold: qI(z(M, "b")),
|
|
3608
|
+
italic: qI(z(M, "i"))
|
|
3604
3609
|
};
|
|
3605
3610
|
if (l) {
|
|
3606
|
-
const g = (
|
|
3611
|
+
const g = (L(l, "val") ?? "single").toLowerCase();
|
|
3607
3612
|
C.underline = g !== "none" && g !== "false" && g !== "0";
|
|
3608
3613
|
}
|
|
3609
3614
|
return (!C.size || Number.isNaN(C.size)) && delete C.size, C;
|
|
@@ -3613,14 +3618,14 @@ function Fl(M, I) {
|
|
|
3613
3618
|
let P = {};
|
|
3614
3619
|
if (!M) return { styles: K, defaults: P };
|
|
3615
3620
|
const w = $K(M), l = SI(w, "rPrDefault")[0];
|
|
3616
|
-
P = $I(l ?
|
|
3621
|
+
P = $I(l ? z(l, "rPr") ?? l : void 0, I);
|
|
3617
3622
|
for (const C of SI(w, "style")) {
|
|
3618
|
-
const g =
|
|
3623
|
+
const g = L(C, "styleId");
|
|
3619
3624
|
g && K.set(g, {
|
|
3620
3625
|
id: g,
|
|
3621
3626
|
name: _I(C, "name", "val") ?? g,
|
|
3622
3627
|
basedOn: _I(C, "basedOn", "val"),
|
|
3623
|
-
rPr: $I(
|
|
3628
|
+
rPr: $I(z(C, "rPr"), I)
|
|
3624
3629
|
});
|
|
3625
3630
|
}
|
|
3626
3631
|
return { styles: K, defaults: P };
|
|
@@ -4362,7 +4367,7 @@ function Pg() {
|
|
|
4362
4367
|
return p(() => M.value.fetcher);
|
|
4363
4368
|
}
|
|
4364
4369
|
function wg(M) {
|
|
4365
|
-
const I = CP(), K =
|
|
4370
|
+
const I = CP(), K = F("");
|
|
4366
4371
|
let P = null;
|
|
4367
4372
|
const w = () => {
|
|
4368
4373
|
P && (URL.revokeObjectURL(P), P = null);
|
|
@@ -4394,28 +4399,28 @@ function wg(M) {
|
|
|
4394
4399
|
}
|
|
4395
4400
|
},
|
|
4396
4401
|
{ immediate: !0 }
|
|
4397
|
-
),
|
|
4402
|
+
), lM(w), p(() => {
|
|
4398
4403
|
var g, s;
|
|
4399
4404
|
const l = M.value;
|
|
4400
4405
|
return l ? !((s = (g = I.value).shouldFetchAsBlob) != null && s.call(g, l)) ? l.url : K.value : "";
|
|
4401
4406
|
});
|
|
4402
4407
|
}
|
|
4403
|
-
const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-text-fg-muted" }, gg = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-gap-3" }, Cg = { class: "vfp-text-sm" }, yg = /* @__PURE__ */
|
|
4408
|
+
const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-text-fg-muted" }, gg = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-gap-3" }, Cg = { class: "vfp-text-sm" }, yg = /* @__PURE__ */ AM({
|
|
4404
4409
|
__name: "RendererLoading",
|
|
4405
4410
|
setup(M) {
|
|
4406
4411
|
const { t: I } = JI();
|
|
4407
|
-
return (K, P) => (d(),
|
|
4412
|
+
return (K, P) => (d(), Z("div", lg, [
|
|
4408
4413
|
H("div", gg, [
|
|
4409
4414
|
P[0] || (P[0] = H("div", { class: "vfp-w-8 vfp-h-8 vfp-rounded-full vfp-border-2 vfp-border-fg-muted vfp-border-t-transparent vfp-animate-spin" }, null, -1)),
|
|
4410
4415
|
H("span", Cg, O(n(I)("common.loading") || "Loading..."), 1)
|
|
4411
4416
|
])
|
|
4412
4417
|
]));
|
|
4413
4418
|
}
|
|
4414
|
-
}), h = (M) =>
|
|
4419
|
+
}), h = (M) => AP({
|
|
4415
4420
|
loader: M,
|
|
4416
|
-
loadingComponent: { render: () =>
|
|
4421
|
+
loadingComponent: { render: () => YP(yg) },
|
|
4417
4422
|
delay: 0
|
|
4418
|
-
}), sg = h(() => import("./index-
|
|
4423
|
+
}), sg = h(() => import("./index-B1OYfn_2.mjs")), Tg = h(() => import("./index-DL3r7NGE.mjs")), Sg = h(() => import("./index-CVN9K0qA.mjs")), wK = h(() => import("./index-BgtFv2mf.mjs")), jg = h(() => import("./index-CG01fzip.mjs")), Xg = h(() => import("./index-CodGY6nz.mjs")), Bg = h(() => import("./index-C3isZ_ue.mjs")), Dg = h(() => import("./index-D18co0be.mjs")), Ag = h(() => import("./index-DbQYYr9C.mjs")), Yg = h(() => import("./index-D6tN6EZR.mjs")), Gg = h(() => import("./index-DYI-zHxA.mjs")), dg = h(() => import("./index-bgq5MUC6.mjs")), xg = h(() => import("./index-DJAZU94G.mjs")), cg = h(() => import("./index-BJpiAJuf.mjs")), bg = h(() => import("./index-XEPcqTt4.mjs")), Zg = h(() => import("./index-Z3_lfqRQ.mjs")), Wg = h(() => import("./index-D5JP7cnv.mjs")), ig = h(() => import("./index-CRTvjRyt.mjs")), pg = h(() => import("./index-D4O2OC-3.mjs")), Jg = h(() => import("./index-CJYCIk06.mjs")), hg = h(() => import("./index-TlmEk0Wz.mjs")), lK = [
|
|
4419
4424
|
{
|
|
4420
4425
|
fileType: "image",
|
|
4421
4426
|
component: sg,
|
|
@@ -4584,7 +4589,7 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4584
4589
|
// 传递原始文件名用于识别扩展名
|
|
4585
4590
|
})
|
|
4586
4591
|
}
|
|
4587
|
-
], og = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-p-6 vfp-gap-4" }, Hg = { class: "vfp-w-20 vfp-h-20 vfp-rounded-full vfp-bg-surface-2 vfp-flex vfp-items-center vfp-justify-center" }, mg = { class: "vfp-text-fg-primary vfp-text-center" }, kg = { class: "vfp-text-lg vfp-font-medium vfp-mb-2" }, Fg = { class: "vfp-text-fg-secondary" }, gK = /* @__PURE__ */
|
|
4592
|
+
], og = { class: "vfp-flex vfp-flex-col vfp-items-center vfp-justify-center vfp-w-full vfp-h-full vfp-p-6 vfp-gap-4" }, Hg = { class: "vfp-w-20 vfp-h-20 vfp-rounded-full vfp-bg-surface-2 vfp-flex vfp-items-center vfp-justify-center" }, mg = { class: "vfp-text-fg-primary vfp-text-center" }, kg = { class: "vfp-text-lg vfp-font-medium vfp-mb-2" }, Fg = { class: "vfp-text-fg-secondary" }, gK = /* @__PURE__ */ AM({
|
|
4588
4593
|
__name: "index",
|
|
4589
4594
|
props: {
|
|
4590
4595
|
fileName: {},
|
|
@@ -4595,9 +4600,9 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4595
4600
|
const { t: P } = JI(), w = K;
|
|
4596
4601
|
return I({
|
|
4597
4602
|
getToolbarGroups: () => []
|
|
4598
|
-
}), (C, g) => (d(),
|
|
4603
|
+
}), (C, g) => (d(), Z("div", og, [
|
|
4599
4604
|
H("div", Hg, [
|
|
4600
|
-
|
|
4605
|
+
XM(n(bP), { class: "vfp-w-10 vfp-h-10 vfp-text-fg-secondary" })
|
|
4601
4606
|
]),
|
|
4602
4607
|
H("div", mg, [
|
|
4603
4608
|
H("p", kg, O(M.fileName), 1),
|
|
@@ -4607,12 +4612,12 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4607
4612
|
class: "vfp-flex vfp-items-center vfp-gap-2 vfp-px-4 vfp-py-2 vfp-bg-surface-2 hover:vfp-bg-surface-3 vfp-backdrop-blur-sm vfp-rounded-lg vfp-text-fg-primary vfp-font-medium vfp-transition-all",
|
|
4608
4613
|
onClick: g[0] || (g[0] = (s) => w("download"))
|
|
4609
4614
|
}, [
|
|
4610
|
-
|
|
4611
|
-
|
|
4615
|
+
XM(n(CK), { class: "vfp-w-5 vfp-h-5" }),
|
|
4616
|
+
GP(" " + O(n(P)("common.download")), 1)
|
|
4612
4617
|
])
|
|
4613
4618
|
]));
|
|
4614
4619
|
}
|
|
4615
|
-
}), Lg = 2e3, tg = /* @__PURE__ */
|
|
4620
|
+
}), Lg = 2e3, tg = /* @__PURE__ */ AM({
|
|
4616
4621
|
__name: "NavArrows",
|
|
4617
4622
|
props: {
|
|
4618
4623
|
containerRef: {},
|
|
@@ -4622,7 +4627,7 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4622
4627
|
},
|
|
4623
4628
|
emits: ["prev", "next"],
|
|
4624
4629
|
setup(M, { emit: I }) {
|
|
4625
|
-
const K = M, P = I, w =
|
|
4630
|
+
const K = M, P = I, w = F(!0);
|
|
4626
4631
|
let l = null;
|
|
4627
4632
|
const C = () => {
|
|
4628
4633
|
l !== null && clearTimeout(l), l = window.setTimeout(() => {
|
|
@@ -4641,10 +4646,10 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4641
4646
|
w.value = !0, C();
|
|
4642
4647
|
}), AI(() => {
|
|
4643
4648
|
C();
|
|
4644
|
-
}),
|
|
4649
|
+
}), lM(() => {
|
|
4645
4650
|
l !== null && clearTimeout(l), y();
|
|
4646
|
-
}), (S, j) => (d(),
|
|
4647
|
-
M.hasPrev ? (d(),
|
|
4651
|
+
}), (S, j) => (d(), Z(o, null, [
|
|
4652
|
+
M.hasPrev ? (d(), Z("button", {
|
|
4648
4653
|
key: 0,
|
|
4649
4654
|
style: mM({
|
|
4650
4655
|
opacity: w.value ? 1 : 0,
|
|
@@ -4656,9 +4661,9 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4656
4661
|
onClick: j[0] || (j[0] = (X) => P("prev")),
|
|
4657
4662
|
onMouseenter: g
|
|
4658
4663
|
}, [
|
|
4659
|
-
|
|
4660
|
-
], 36)) :
|
|
4661
|
-
M.hasNext ? (d(),
|
|
4664
|
+
XM(n(ZP), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
|
|
4665
|
+
], 36)) : E("", !0),
|
|
4666
|
+
M.hasNext ? (d(), Z("button", {
|
|
4662
4667
|
key: 1,
|
|
4663
4668
|
style: mM({
|
|
4664
4669
|
opacity: w.value ? 1 : 0,
|
|
@@ -4670,8 +4675,8 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4670
4675
|
onClick: j[1] || (j[1] = (X) => P("next")),
|
|
4671
4676
|
onMouseenter: g
|
|
4672
4677
|
}, [
|
|
4673
|
-
|
|
4674
|
-
], 36)) :
|
|
4678
|
+
XM(n(WP), { class: "vfp-w-5 vfp-h-5 md:vfp-w-6 md:vfp-h-6" })
|
|
4679
|
+
], 36)) : E("", !0)
|
|
4675
4680
|
], 64));
|
|
4676
4681
|
}
|
|
4677
4682
|
}), Qg = ["tabindex", "data-theme"], Eg = {
|
|
@@ -4687,7 +4692,7 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4687
4692
|
}, eg = {
|
|
4688
4693
|
key: 0,
|
|
4689
4694
|
class: "vfp-w-px vfp-h-4 vfp-mx-0.5 vfp-bg-divide"
|
|
4690
|
-
}, vg = ["data-tooltip", "disabled", "aria-pressed", "onClick"], qg = 3, _g = /* @__PURE__ */
|
|
4695
|
+
}, vg = ["data-tooltip", "disabled", "aria-pressed", "onClick"], qg = 3, _g = /* @__PURE__ */ AM({
|
|
4691
4696
|
__name: "FilePreviewContent",
|
|
4692
4697
|
props: {
|
|
4693
4698
|
files: {},
|
|
@@ -4705,7 +4710,9 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4705
4710
|
onDownload: { type: Function, default: void 0 },
|
|
4706
4711
|
onClose: { type: Function, default: void 0 },
|
|
4707
4712
|
showClose: { type: Boolean, default: void 0 },
|
|
4708
|
-
showDownload: { type: Boolean, default: !0 }
|
|
4713
|
+
showDownload: { type: Boolean, default: !0 },
|
|
4714
|
+
showNavigation: { type: Boolean, default: !0 },
|
|
4715
|
+
loopNavigation: { type: Boolean, default: !1 }
|
|
4709
4716
|
},
|
|
4710
4717
|
emits: ["navigate", "close", "custom-event"],
|
|
4711
4718
|
setup(M, { emit: I }) {
|
|
@@ -4717,51 +4724,51 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4717
4724
|
}));
|
|
4718
4725
|
const P = I;
|
|
4719
4726
|
_l(oI(K, "locale"), oI(K, "messages"));
|
|
4720
|
-
const { t: w } = JI(), l =
|
|
4727
|
+
const { t: w } = JI(), l = F(
|
|
4721
4728
|
typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
4722
4729
|
);
|
|
4723
4730
|
let C = null;
|
|
4724
4731
|
e(
|
|
4725
4732
|
() => K.theme,
|
|
4726
|
-
(
|
|
4727
|
-
if (C && (C(), C = null),
|
|
4728
|
-
const
|
|
4733
|
+
(c) => {
|
|
4734
|
+
if (C && (C(), C = null), c === "auto") {
|
|
4735
|
+
const N = window.matchMedia("(prefers-color-scheme: dark)"), f = (ZM) => {
|
|
4729
4736
|
l.value = ZM.matches;
|
|
4730
4737
|
};
|
|
4731
|
-
|
|
4738
|
+
N.addEventListener("change", f), C = () => N.removeEventListener("change", f);
|
|
4732
4739
|
}
|
|
4733
4740
|
},
|
|
4734
4741
|
{ immediate: !0 }
|
|
4735
|
-
),
|
|
4742
|
+
), lM(() => {
|
|
4736
4743
|
C && C();
|
|
4737
4744
|
});
|
|
4738
4745
|
const g = p(
|
|
4739
4746
|
() => K.theme === "auto" ? l.value ? "dark" : "light" : K.theme
|
|
4740
4747
|
);
|
|
4741
4748
|
Mg(g);
|
|
4742
|
-
const s =
|
|
4749
|
+
const s = F(null), y = F(null), T = F(null), S = F([]);
|
|
4743
4750
|
let j = null;
|
|
4744
4751
|
const X = () => {
|
|
4745
4752
|
j && (j(), j = null);
|
|
4746
4753
|
};
|
|
4747
|
-
e(T, (
|
|
4748
|
-
var
|
|
4749
|
-
X(), S.value = [],
|
|
4754
|
+
e(T, (c) => {
|
|
4755
|
+
var N;
|
|
4756
|
+
X(), S.value = [], c && (c.onToolbarChange && (j = c.onToolbarChange(() => {
|
|
4750
4757
|
var f;
|
|
4751
|
-
S.value = ((f =
|
|
4752
|
-
})), S.value = ((
|
|
4753
|
-
}),
|
|
4758
|
+
S.value = ((f = c.getToolbarGroups) == null ? void 0 : f.call(c)) ?? [];
|
|
4759
|
+
})), S.value = ((N = c.getToolbarGroups) == null ? void 0 : N.call(c)) ?? []);
|
|
4760
|
+
}), lM(() => {
|
|
4754
4761
|
X();
|
|
4755
4762
|
});
|
|
4756
|
-
const B = p(() => FP(K.files)), D = p(() => B.value[K.currentIndex]), A = wg(D), Y = p(() => D.value && K.customRenderers.find((
|
|
4757
|
-
() => lK.find((
|
|
4763
|
+
const B = p(() => FP(K.files)), D = p(() => B.value[K.currentIndex]), A = wg(D), Y = p(() => D.value && K.customRenderers.find((c) => c.test(D.value)) || null), G = p(() => !Y.value || !D.value ? null : Y.value.render(D.value, r.value)), x = p(() => D.value ? EP(D.value) : "unsupported"), J = p(
|
|
4764
|
+
() => lK.find((c) => c.fileType === x.value) ?? (x.value === "xls" ? lK.find((c) => c.fileType === "xlsx") : null) ?? null
|
|
4758
4765
|
), i = p(() => !J.value || !D.value ? {} : J.value.getProps({
|
|
4759
4766
|
resolvedUrl: A.value,
|
|
4760
4767
|
zipNestingDepth: K.zipNestingDepth,
|
|
4761
4768
|
currentFile: D.value
|
|
4762
|
-
})), k = (
|
|
4769
|
+
})), k = (c, N) => {
|
|
4763
4770
|
if (!D.value) return;
|
|
4764
|
-
const f = { name:
|
|
4771
|
+
const f = { name: c, payload: N, file: D.value };
|
|
4765
4772
|
P("custom-event", f);
|
|
4766
4773
|
}, r = p(() => ({
|
|
4767
4774
|
emit: k,
|
|
@@ -4772,169 +4779,175 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4772
4779
|
zM("file-preview:custom-ctx", r), e(
|
|
4773
4780
|
() => K.currentIndex,
|
|
4774
4781
|
() => {
|
|
4775
|
-
|
|
4782
|
+
sP.value = 0, TP.value = 0, SP.value = !1, jP.value = 0, XP.value = 0, BP.value = !1;
|
|
4776
4783
|
}
|
|
4777
4784
|
);
|
|
4778
|
-
const
|
|
4779
|
-
|
|
4785
|
+
const cM = () => {
|
|
4786
|
+
const c = B.value.length;
|
|
4787
|
+
c <= 1 || (K.currentIndex > 0 ? P("navigate", K.currentIndex - 1) : K.loopNavigation && P("navigate", c - 1));
|
|
4788
|
+
}, u = () => {
|
|
4789
|
+
const c = B.value.length;
|
|
4790
|
+
c <= 1 || (K.currentIndex < c - 1 ? P("navigate", K.currentIndex + 1) : K.loopNavigation && P("navigate", 0));
|
|
4791
|
+
}, yM = (c) => {
|
|
4792
|
+
c.key === "Escape" && K.mode === "modal" ? P("close") : c.key === "ArrowLeft" ? cM() : c.key === "ArrowRight" ? u() : c.key === "Home" && B.value.length > 0 && K.currentIndex !== 0 ? P("navigate", 0) : c.key === "End" && B.value.length > 0 && K.currentIndex !== B.value.length - 1 && P("navigate", B.value.length - 1);
|
|
4780
4793
|
};
|
|
4781
4794
|
AI(() => {
|
|
4782
4795
|
K.mode === "modal" ? window.addEventListener("keydown", yM) : y.value && y.value.addEventListener("keydown", yM);
|
|
4783
|
-
}),
|
|
4796
|
+
}), lM(() => {
|
|
4784
4797
|
K.mode === "modal" ? window.removeEventListener("keydown", yM) : y.value && y.value.removeEventListener("keydown", yM);
|
|
4785
4798
|
});
|
|
4786
|
-
const
|
|
4799
|
+
const aM = Pg(), KM = async () => {
|
|
4787
4800
|
if (D.value) {
|
|
4788
4801
|
if (K.onDownload) {
|
|
4789
4802
|
await K.onDownload(D.value);
|
|
4790
4803
|
return;
|
|
4791
4804
|
}
|
|
4792
4805
|
try {
|
|
4793
|
-
await VP(D.value.url, D.value.name,
|
|
4794
|
-
} catch (
|
|
4795
|
-
console.error("[file-preview] download failed:",
|
|
4806
|
+
await VP(D.value.url, D.value.name, aM.value);
|
|
4807
|
+
} catch (c) {
|
|
4808
|
+
console.error("[file-preview] download failed:", c);
|
|
4796
4809
|
}
|
|
4797
4810
|
}
|
|
4798
|
-
},
|
|
4811
|
+
}, yP = p(
|
|
4799
4812
|
() => LP(K.mode, K.showClose)
|
|
4800
|
-
),
|
|
4801
|
-
var
|
|
4802
|
-
return Y.value ? ((
|
|
4813
|
+
), sP = F(0), TP = F(0), SP = F(!1), jP = F(0), XP = F(0), BP = F(!1), bM = p(() => {
|
|
4814
|
+
var c, N;
|
|
4815
|
+
return Y.value ? ((N = (c = Y.value).getToolbarGroups) == null ? void 0 : N.call(c, D.value, r.value)) ?? [] : S.value;
|
|
4803
4816
|
}), VM = p(() => {
|
|
4804
|
-
const
|
|
4805
|
-
return K.showDownload &&
|
|
4817
|
+
const c = [];
|
|
4818
|
+
return K.showDownload && c.push({
|
|
4806
4819
|
items: [
|
|
4807
|
-
{ type: "button", icon: CK, tooltip: w.value("common.download"), action:
|
|
4820
|
+
{ type: "button", icon: CK, tooltip: w.value("common.download"), action: KM }
|
|
4808
4821
|
]
|
|
4809
|
-
}),
|
|
4822
|
+
}), yP.value && c.push({
|
|
4810
4823
|
items: [
|
|
4811
4824
|
{ type: "button", icon: iP, tooltip: w.value("common.close"), action: () => P("close") }
|
|
4812
4825
|
]
|
|
4813
|
-
}),
|
|
4814
|
-
}),
|
|
4815
|
-
return (
|
|
4826
|
+
}), c;
|
|
4827
|
+
}), DP = p(() => bM.value.length > 0);
|
|
4828
|
+
return (c, N) => {
|
|
4816
4829
|
var f, ZM;
|
|
4817
|
-
return d(),
|
|
4830
|
+
return d(), Z("div", {
|
|
4818
4831
|
ref_key: "rootRef",
|
|
4819
4832
|
ref: y,
|
|
4820
4833
|
tabindex: M.mode === "embed" ? 0 : -1,
|
|
4821
4834
|
"data-theme": g.value,
|
|
4822
4835
|
class: "vfp-relative vfp-w-full vfp-h-full vfp-flex vfp-flex-col vfp-overflow-hidden vfp-outline-none"
|
|
4823
4836
|
}, [
|
|
4824
|
-
M.headless ?
|
|
4837
|
+
M.headless ? E("", !0) : (d(), Z("div", Eg, [
|
|
4825
4838
|
H("div", Ug, [
|
|
4826
4839
|
H("div", zg, [
|
|
4827
4840
|
H("h2", Ng, O((f = D.value) == null ? void 0 : f.name), 1),
|
|
4828
4841
|
H("span", fg, O(M.currentIndex + 1) + "/" + O(B.value.length), 1)
|
|
4829
4842
|
]),
|
|
4830
4843
|
H("div", ag, [
|
|
4831
|
-
(d(!0),
|
|
4832
|
-
key: "m-action-" +
|
|
4844
|
+
(d(!0), Z(o, null, v(VM.value, (PM, Q) => (d(), Z(o, {
|
|
4845
|
+
key: "m-action-" + Q
|
|
4833
4846
|
}, [
|
|
4834
|
-
(d(!0),
|
|
4835
|
-
key: "m-action-" +
|
|
4847
|
+
(d(!0), Z(o, null, v(PM.items, (b, wM) => (d(), Z(o, {
|
|
4848
|
+
key: "m-action-" + Q + "-" + wM
|
|
4836
4849
|
}, [
|
|
4837
|
-
|
|
4850
|
+
b.type === "button" ? (d(), Z("button", {
|
|
4838
4851
|
key: 0,
|
|
4839
|
-
class: WM(["toolbar-btn", { active:
|
|
4840
|
-
"data-tooltip":
|
|
4841
|
-
disabled:
|
|
4842
|
-
"aria-pressed":
|
|
4843
|
-
onClick:
|
|
4852
|
+
class: WM(["toolbar-btn", { active: b.active }]),
|
|
4853
|
+
"data-tooltip": b.tooltip,
|
|
4854
|
+
disabled: b.disabled,
|
|
4855
|
+
"aria-pressed": b.active,
|
|
4856
|
+
onClick: b.action
|
|
4844
4857
|
}, [
|
|
4845
|
-
(d(), a(sM(
|
|
4846
|
-
], 10, Vg)) :
|
|
4858
|
+
(d(), a(sM(b.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
4859
|
+
], 10, Vg)) : E("", !0)
|
|
4847
4860
|
], 64))), 128))
|
|
4848
4861
|
], 64))), 128))
|
|
4849
4862
|
]),
|
|
4850
4863
|
H("div", ng, [
|
|
4851
|
-
(d(!0),
|
|
4852
|
-
key: "d-tool-" +
|
|
4864
|
+
(d(!0), Z(o, null, v(bM.value, (PM, Q) => (d(), Z(o, {
|
|
4865
|
+
key: "d-tool-" + Q
|
|
4853
4866
|
}, [
|
|
4854
|
-
(d(!0),
|
|
4855
|
-
key: "d-tool-" +
|
|
4867
|
+
(d(!0), Z(o, null, v(PM.items, (b, wM) => (d(), Z(o, {
|
|
4868
|
+
key: "d-tool-" + Q + "-" + wM
|
|
4856
4869
|
}, [
|
|
4857
|
-
|
|
4870
|
+
b.type === "button" ? (d(), Z("button", {
|
|
4858
4871
|
key: 0,
|
|
4859
|
-
class: WM(["toolbar-btn", { active:
|
|
4860
|
-
"data-tooltip":
|
|
4861
|
-
disabled:
|
|
4862
|
-
"aria-pressed":
|
|
4863
|
-
onClick:
|
|
4872
|
+
class: WM(["toolbar-btn", { active: b.active }]),
|
|
4873
|
+
"data-tooltip": b.tooltip,
|
|
4874
|
+
disabled: b.disabled,
|
|
4875
|
+
"aria-pressed": b.active,
|
|
4876
|
+
onClick: b.action
|
|
4864
4877
|
}, [
|
|
4865
|
-
(d(), a(sM(
|
|
4866
|
-
], 10, Rg)) :
|
|
4878
|
+
(d(), a(sM(b.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
4879
|
+
], 10, Rg)) : b.type === "text" ? (d(), Z("span", {
|
|
4867
4880
|
key: 1,
|
|
4868
4881
|
class: "vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums vfp-text-fg-tertiary",
|
|
4869
|
-
style: mM({ minWidth:
|
|
4870
|
-
}, O(
|
|
4882
|
+
style: mM({ minWidth: b.minWidth || "auto" })
|
|
4883
|
+
}, O(b.content), 5)) : E("", !0)
|
|
4871
4884
|
], 64))), 128)),
|
|
4872
|
-
|
|
4885
|
+
Q < bM.value.length - 1 || VM.value.length > 0 ? (d(), Z("div", rg)) : E("", !0)
|
|
4873
4886
|
], 64))), 128)),
|
|
4874
|
-
(d(!0),
|
|
4875
|
-
key: "d-action-" +
|
|
4887
|
+
(d(!0), Z(o, null, v(VM.value, (PM, Q) => (d(), Z(o, {
|
|
4888
|
+
key: "d-action-" + Q
|
|
4876
4889
|
}, [
|
|
4877
|
-
(d(!0),
|
|
4878
|
-
key: "d-action-" +
|
|
4890
|
+
(d(!0), Z(o, null, v(PM.items, (b, wM) => (d(), Z(o, {
|
|
4891
|
+
key: "d-action-" + Q + "-" + wM
|
|
4879
4892
|
}, [
|
|
4880
|
-
|
|
4893
|
+
b.type === "button" ? (d(), Z("button", {
|
|
4881
4894
|
key: 0,
|
|
4882
|
-
class: WM(["toolbar-btn", { active:
|
|
4883
|
-
"data-tooltip":
|
|
4884
|
-
disabled:
|
|
4885
|
-
"aria-pressed":
|
|
4886
|
-
onClick:
|
|
4895
|
+
class: WM(["toolbar-btn", { active: b.active }]),
|
|
4896
|
+
"data-tooltip": b.tooltip,
|
|
4897
|
+
disabled: b.disabled,
|
|
4898
|
+
"aria-pressed": b.active,
|
|
4899
|
+
onClick: b.action
|
|
4887
4900
|
}, [
|
|
4888
|
-
(d(), a(sM(
|
|
4889
|
-
], 10, ug)) :
|
|
4901
|
+
(d(), a(sM(b.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
4902
|
+
], 10, ug)) : E("", !0)
|
|
4890
4903
|
], 64))), 128))
|
|
4891
4904
|
], 64))), 128))
|
|
4892
4905
|
])
|
|
4893
4906
|
]),
|
|
4894
|
-
|
|
4895
|
-
(d(!0),
|
|
4896
|
-
key: "m-tool-" +
|
|
4907
|
+
DP.value ? (d(), Z("div", Og, [
|
|
4908
|
+
(d(!0), Z(o, null, v(bM.value, (PM, Q) => (d(), Z(o, {
|
|
4909
|
+
key: "m-tool-" + Q
|
|
4897
4910
|
}, [
|
|
4898
|
-
|
|
4899
|
-
(d(!0),
|
|
4900
|
-
key: "m-tool-" +
|
|
4911
|
+
Q > 0 ? (d(), Z("div", eg)) : E("", !0),
|
|
4912
|
+
(d(!0), Z(o, null, v(PM.items, (b, wM) => (d(), Z(o, {
|
|
4913
|
+
key: "m-tool-" + Q + "-" + wM
|
|
4901
4914
|
}, [
|
|
4902
|
-
|
|
4915
|
+
b.type === "button" ? (d(), Z("button", {
|
|
4903
4916
|
key: 0,
|
|
4904
|
-
class: WM(["toolbar-btn", { active:
|
|
4905
|
-
"data-tooltip":
|
|
4906
|
-
disabled:
|
|
4907
|
-
"aria-pressed":
|
|
4908
|
-
onClick:
|
|
4917
|
+
class: WM(["toolbar-btn", { active: b.active }]),
|
|
4918
|
+
"data-tooltip": b.tooltip,
|
|
4919
|
+
disabled: b.disabled,
|
|
4920
|
+
"aria-pressed": b.active,
|
|
4921
|
+
onClick: b.action
|
|
4909
4922
|
}, [
|
|
4910
|
-
(d(), a(sM(
|
|
4911
|
-
], 10, vg)) :
|
|
4923
|
+
(d(), a(sM(b.icon), { class: "vfp-w-4 vfp-h-4" }))
|
|
4924
|
+
], 10, vg)) : b.type === "text" ? (d(), Z("span", {
|
|
4912
4925
|
key: 1,
|
|
4913
4926
|
class: "vfp-text-xs vfp-text-center vfp-font-medium vfp-tabular-nums vfp-text-fg-tertiary",
|
|
4914
|
-
style: mM({ minWidth:
|
|
4915
|
-
}, O(
|
|
4927
|
+
style: mM({ minWidth: b.minWidth || "auto" })
|
|
4928
|
+
}, O(b.content), 5)) : E("", !0)
|
|
4916
4929
|
], 64))), 128))
|
|
4917
4930
|
], 64))), 128))
|
|
4918
|
-
])) :
|
|
4931
|
+
])) : E("", !0)
|
|
4919
4932
|
])),
|
|
4920
|
-
(d(),
|
|
4933
|
+
(d(), Z("div", {
|
|
4921
4934
|
ref_key: "contentRef",
|
|
4922
4935
|
ref: s,
|
|
4923
4936
|
class: "vfp-flex-1 vfp-flex vfp-items-center vfp-justify-center vfp-overflow-auto",
|
|
4924
4937
|
key: (ZM = D.value) == null ? void 0 : ZM.url
|
|
4925
4938
|
}, [
|
|
4926
|
-
D.value ? (d(),
|
|
4939
|
+
D.value ? (d(), Z(o, { key: 0 }, [
|
|
4927
4940
|
G.value ? (d(), a(sM(G.value), {
|
|
4928
4941
|
key: 0,
|
|
4929
4942
|
file: D.value,
|
|
4930
4943
|
ctx: r.value
|
|
4931
|
-
}, null, 8, ["file", "ctx"])) : (d(),
|
|
4944
|
+
}, null, 8, ["file", "ctx"])) : (d(), Z(o, { key: 1 }, [
|
|
4932
4945
|
x.value === "zip" && K.zipNestingDepth >= qg ? (d(), a(gK, {
|
|
4933
4946
|
key: 0,
|
|
4934
4947
|
"file-name": D.value.name,
|
|
4935
4948
|
"file-type": D.value.type,
|
|
4936
|
-
onDownload:
|
|
4937
|
-
}, null, 8, ["file-name", "file-type"])) : J.value ? (d(), a(sM(J.value.component),
|
|
4949
|
+
onDownload: KM
|
|
4950
|
+
}, null, 8, ["file-name", "file-type"])) : J.value ? (d(), a(sM(J.value.component), dP({
|
|
4938
4951
|
key: 1,
|
|
4939
4952
|
ref_key: "rendererRef",
|
|
4940
4953
|
ref: T
|
|
@@ -4942,20 +4955,20 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4942
4955
|
key: 2,
|
|
4943
4956
|
"file-name": D.value.name,
|
|
4944
4957
|
"file-type": D.value.type,
|
|
4945
|
-
onDownload:
|
|
4958
|
+
onDownload: KM
|
|
4946
4959
|
}, null, 8, ["file-name", "file-type"]))
|
|
4947
4960
|
], 64))
|
|
4948
|
-
], 64)) :
|
|
4961
|
+
], 64)) : E("", !0)
|
|
4949
4962
|
])),
|
|
4950
|
-
!M.headless && B.value.length > 1 ? (d(), a(tg, {
|
|
4963
|
+
!M.headless && M.showNavigation && B.value.length > 1 ? (d(), a(tg, {
|
|
4951
4964
|
key: 1,
|
|
4952
4965
|
"container-ref": s.value,
|
|
4953
|
-
"has-prev": M.currentIndex > 0,
|
|
4954
|
-
"has-next": M.currentIndex < B.value.length - 1,
|
|
4966
|
+
"has-prev": M.loopNavigation || M.currentIndex > 0,
|
|
4967
|
+
"has-next": M.loopNavigation || M.currentIndex < B.value.length - 1,
|
|
4955
4968
|
"reset-key": M.currentIndex,
|
|
4956
|
-
onPrev:
|
|
4957
|
-
onNext:
|
|
4958
|
-
}, null, 8, ["container-ref", "has-prev", "has-next", "reset-key"])) :
|
|
4969
|
+
onPrev: cM,
|
|
4970
|
+
onNext: u
|
|
4971
|
+
}, null, 8, ["container-ref", "has-prev", "has-next", "reset-key"])) : E("", !0)
|
|
4959
4972
|
], 8, Qg);
|
|
4960
4973
|
};
|
|
4961
4974
|
}
|
|
@@ -4964,7 +4977,7 @@ const lg = { class: "vfp-flex vfp-items-center vfp-justify-center vfp-w-full vfp
|
|
|
4964
4977
|
for (const [P, w] of I)
|
|
4965
4978
|
K[P] = w;
|
|
4966
4979
|
return K;
|
|
4967
|
-
}, hI = /* @__PURE__ */ $g(_g, [["__scopeId", "data-v-
|
|
4980
|
+
}, hI = /* @__PURE__ */ $g(_g, [["__scopeId", "data-v-bdc3fb32"]]), UC = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4968
4981
|
__proto__: null,
|
|
4969
4982
|
default: hI
|
|
4970
4983
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -4980,11 +4993,11 @@ function MC(M) {
|
|
|
4980
4993
|
};
|
|
4981
4994
|
return AI(() => {
|
|
4982
4995
|
M() && w();
|
|
4983
|
-
}),
|
|
4996
|
+
}), xP(() => {
|
|
4984
4997
|
l();
|
|
4985
4998
|
}), { lock: w, unlock: l };
|
|
4986
4999
|
}
|
|
4987
|
-
const IC = ["data-theme"], zC = /* @__PURE__ */
|
|
5000
|
+
const IC = ["data-theme"], zC = /* @__PURE__ */ AM({
|
|
4988
5001
|
__name: "FilePreviewModal",
|
|
4989
5002
|
props: {
|
|
4990
5003
|
files: {},
|
|
@@ -5000,7 +5013,9 @@ const IC = ["data-theme"], zC = /* @__PURE__ */ DM({
|
|
|
5000
5013
|
shouldFetchAsBlob: { type: Function, default: void 0 },
|
|
5001
5014
|
onDownload: { type: Function, default: void 0 },
|
|
5002
5015
|
showClose: { type: Boolean, default: void 0 },
|
|
5003
|
-
showDownload: { type: Boolean, default: !0 }
|
|
5016
|
+
showDownload: { type: Boolean, default: !0 },
|
|
5017
|
+
showNavigation: { type: Boolean, default: !0 },
|
|
5018
|
+
loopNavigation: { type: Boolean, default: !1 }
|
|
5004
5019
|
},
|
|
5005
5020
|
emits: ["close", "navigate", "custom-event"],
|
|
5006
5021
|
setup(M, { emit: I }) {
|
|
@@ -5011,7 +5026,7 @@ const IC = ["data-theme"], zC = /* @__PURE__ */ DM({
|
|
|
5011
5026
|
j ? w() : l();
|
|
5012
5027
|
}
|
|
5013
5028
|
);
|
|
5014
|
-
const C =
|
|
5029
|
+
const C = F(
|
|
5015
5030
|
typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
5016
5031
|
);
|
|
5017
5032
|
let g = null;
|
|
@@ -5026,58 +5041,55 @@ const IC = ["data-theme"], zC = /* @__PURE__ */ DM({
|
|
|
5026
5041
|
}
|
|
5027
5042
|
},
|
|
5028
5043
|
{ immediate: !0 }
|
|
5029
|
-
),
|
|
5044
|
+
), lM(() => {
|
|
5030
5045
|
g && g();
|
|
5031
5046
|
});
|
|
5032
5047
|
const s = p(
|
|
5033
5048
|
() => K.theme === "auto" ? C.value ? "dark" : "light" : K.theme
|
|
5034
5049
|
), y = () => P("close"), T = (j) => j.stopPropagation(), S = (j) => j.stopPropagation();
|
|
5035
|
-
return (j, X) => (d(), a(
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5050
|
+
return (j, X) => (d(), a(cP, { to: "body" }, [
|
|
5051
|
+
M.isOpen ? (d(), Z("div", {
|
|
5052
|
+
key: 0,
|
|
5053
|
+
class: "vfp-root",
|
|
5054
|
+
"data-theme": s.value
|
|
5055
|
+
}, [
|
|
5056
|
+
H("div", {
|
|
5057
|
+
class: "vfp-fixed vfp-inset-0 vfp-z-[9999] vfp-flex vfp-items-center vfp-justify-center vfp-backdrop-blur-md vfp-overflow-hidden vfp-bg-surface-overlay",
|
|
5058
|
+
onClick: y,
|
|
5059
|
+
onWheel: S
|
|
5060
|
+
}, [
|
|
5061
|
+
H("div", {
|
|
5062
|
+
class: "vfp-relative vfp-w-full vfp-h-full",
|
|
5063
|
+
onClick: T
|
|
5042
5064
|
}, [
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
onClose: X[0] || (X[0] = (B) => P("close")),
|
|
5069
|
-
onNavigate: X[1] || (X[1] = (B) => P("navigate", B)),
|
|
5070
|
-
onCustomEvent: X[2] || (X[2] = (B) => P("custom-event", B))
|
|
5071
|
-
}, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download", "on-close", "show-close", "show-download"])
|
|
5072
|
-
])
|
|
5073
|
-
], 32)
|
|
5074
|
-
], 8, IC)) : U("", !0)
|
|
5075
|
-
]),
|
|
5076
|
-
_: 1
|
|
5077
|
-
})
|
|
5065
|
+
XM(hI, {
|
|
5066
|
+
mode: "modal",
|
|
5067
|
+
files: M.files,
|
|
5068
|
+
"current-index": M.currentIndex,
|
|
5069
|
+
"custom-renderers": M.customRenderers,
|
|
5070
|
+
locale: M.locale,
|
|
5071
|
+
messages: M.messages,
|
|
5072
|
+
headless: M.headless,
|
|
5073
|
+
theme: M.theme,
|
|
5074
|
+
"request-init": M.requestInit,
|
|
5075
|
+
"request-handler": M.requestHandler,
|
|
5076
|
+
"should-fetch-as-blob": M.shouldFetchAsBlob,
|
|
5077
|
+
"on-download": M.onDownload,
|
|
5078
|
+
"on-close": () => P("close"),
|
|
5079
|
+
"show-close": M.showClose,
|
|
5080
|
+
"show-download": M.showDownload,
|
|
5081
|
+
"show-navigation": M.showNavigation,
|
|
5082
|
+
"loop-navigation": M.loopNavigation,
|
|
5083
|
+
onClose: X[0] || (X[0] = (B) => P("close")),
|
|
5084
|
+
onNavigate: X[1] || (X[1] = (B) => P("navigate", B)),
|
|
5085
|
+
onCustomEvent: X[2] || (X[2] = (B) => P("custom-event", B))
|
|
5086
|
+
}, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download", "on-close", "show-close", "show-download", "show-navigation", "loop-navigation"])
|
|
5087
|
+
])
|
|
5088
|
+
], 32)
|
|
5089
|
+
], 8, IC)) : E("", !0)
|
|
5078
5090
|
]));
|
|
5079
5091
|
}
|
|
5080
|
-
}), KC = ["data-theme"], PC = { class: "vfp-relative vfp-w-full vfp-h-full vfp-overflow-hidden vfp-bg-surface-overlay" }, NC = /* @__PURE__ */
|
|
5092
|
+
}), KC = ["data-theme"], PC = { class: "vfp-relative vfp-w-full vfp-h-full vfp-overflow-hidden vfp-bg-surface-overlay" }, NC = /* @__PURE__ */ AM({
|
|
5081
5093
|
__name: "FilePreviewEmbed",
|
|
5082
5094
|
props: {
|
|
5083
5095
|
files: {},
|
|
@@ -5095,11 +5107,13 @@ const IC = ["data-theme"], zC = /* @__PURE__ */ DM({
|
|
|
5095
5107
|
onDownload: { type: Function, default: void 0 },
|
|
5096
5108
|
onClose: { type: Function, default: void 0 },
|
|
5097
5109
|
showClose: { type: Boolean, default: void 0 },
|
|
5098
|
-
showDownload: { type: Boolean, default: !0 }
|
|
5110
|
+
showDownload: { type: Boolean, default: !0 },
|
|
5111
|
+
showNavigation: { type: Boolean, default: !0 },
|
|
5112
|
+
loopNavigation: { type: Boolean, default: !1 }
|
|
5099
5113
|
},
|
|
5100
5114
|
emits: ["navigate", "custom-event", "close"],
|
|
5101
5115
|
setup(M, { emit: I }) {
|
|
5102
|
-
const K = M, P = I, w =
|
|
5116
|
+
const K = M, P = I, w = F(
|
|
5103
5117
|
typeof window < "u" ? window.matchMedia("(prefers-color-scheme: dark)").matches : !0
|
|
5104
5118
|
);
|
|
5105
5119
|
let l = null;
|
|
@@ -5114,7 +5128,7 @@ const IC = ["data-theme"], zC = /* @__PURE__ */ DM({
|
|
|
5114
5128
|
}
|
|
5115
5129
|
},
|
|
5116
5130
|
{ immediate: !0 }
|
|
5117
|
-
),
|
|
5131
|
+
), lM(() => {
|
|
5118
5132
|
l && l();
|
|
5119
5133
|
});
|
|
5120
5134
|
const C = p(
|
|
@@ -5123,13 +5137,13 @@ const IC = ["data-theme"], zC = /* @__PURE__ */ DM({
|
|
|
5123
5137
|
width: typeof K.width == "number" ? `${K.width}px` : K.width,
|
|
5124
5138
|
height: typeof K.height == "number" ? `${K.height}px` : K.height
|
|
5125
5139
|
};
|
|
5126
|
-
return (s, y) => (d(),
|
|
5140
|
+
return (s, y) => (d(), Z("div", {
|
|
5127
5141
|
class: "vfp-root",
|
|
5128
5142
|
style: g,
|
|
5129
5143
|
"data-theme": C.value
|
|
5130
5144
|
}, [
|
|
5131
5145
|
H("div", PC, [
|
|
5132
|
-
|
|
5146
|
+
XM(hI, {
|
|
5133
5147
|
mode: "embed",
|
|
5134
5148
|
files: M.files,
|
|
5135
5149
|
"current-index": M.currentIndex,
|
|
@@ -5145,10 +5159,12 @@ const IC = ["data-theme"], zC = /* @__PURE__ */ DM({
|
|
|
5145
5159
|
"on-close": M.onClose,
|
|
5146
5160
|
"show-close": M.showClose,
|
|
5147
5161
|
"show-download": M.showDownload,
|
|
5162
|
+
"show-navigation": M.showNavigation,
|
|
5163
|
+
"loop-navigation": M.loopNavigation,
|
|
5148
5164
|
onNavigate: y[0] || (y[0] = (T) => P("navigate", T)),
|
|
5149
5165
|
onCustomEvent: y[1] || (y[1] = (T) => P("custom-event", T)),
|
|
5150
5166
|
onClose: y[2] || (y[2] = () => P("close"))
|
|
5151
|
-
}, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download", "on-close", "show-close", "show-download"])
|
|
5167
|
+
}, null, 8, ["files", "current-index", "custom-renderers", "locale", "messages", "headless", "theme", "request-init", "request-handler", "should-fetch-as-blob", "on-download", "on-close", "show-close", "show-download", "show-navigation", "loop-navigation"])
|
|
5152
5168
|
])
|
|
5153
5169
|
], 8, KC));
|
|
5154
5170
|
}
|