vue-book-reader 1.2.5 → 1.2.6
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 +29 -35
- package/dist/index.css +3 -3
- package/dist/vue-book-reader.es.js +1386 -1305
- package/dist/vue-book-reader.umd.js +1347 -1265
- package/package.json +1 -4
|
@@ -1613,6 +1613,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1613
1613
|
location: {
|
|
1614
1614
|
type: [String, Number]
|
|
1615
1615
|
},
|
|
1616
|
+
initOption: {
|
|
1617
|
+
type: Object
|
|
1618
|
+
},
|
|
1616
1619
|
tocChanged: Function,
|
|
1617
1620
|
getRendition: Function
|
|
1618
1621
|
},
|
|
@@ -1630,7 +1633,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1630
1633
|
};
|
|
1631
1634
|
}
|
|
1632
1635
|
const props = __props;
|
|
1633
|
-
const { tocChanged, getRendition } = props;
|
|
1636
|
+
const { tocChanged, getRendition, initOption } = props;
|
|
1634
1637
|
const { url, location } = toRefs(props);
|
|
1635
1638
|
const emit = __emit;
|
|
1636
1639
|
let view$1 = null;
|
|
@@ -1648,20 +1651,20 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1648
1651
|
}
|
|
1649
1652
|
await view$1.open(url.value);
|
|
1650
1653
|
getRendition && getRendition(view$1);
|
|
1651
|
-
initReader();
|
|
1654
|
+
await initReader();
|
|
1652
1655
|
}
|
|
1653
1656
|
} catch (error) {
|
|
1654
1657
|
console.error("Error opening book:", error);
|
|
1655
1658
|
isError.value = true;
|
|
1656
1659
|
}
|
|
1657
1660
|
};
|
|
1658
|
-
const initReader = () => {
|
|
1661
|
+
const initReader = async () => {
|
|
1659
1662
|
isLoaded.value = true;
|
|
1660
1663
|
const { book } = view$1;
|
|
1661
1664
|
registerEvents();
|
|
1662
1665
|
tocChanged && tocChanged(book.toc);
|
|
1663
|
-
if (
|
|
1664
|
-
|
|
1666
|
+
if (initOption) {
|
|
1667
|
+
await view$1.init(initOption);
|
|
1665
1668
|
} else {
|
|
1666
1669
|
view$1.renderer.next();
|
|
1667
1670
|
}
|
|
@@ -1728,7 +1731,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
1728
1731
|
}
|
|
1729
1732
|
return target;
|
|
1730
1733
|
};
|
|
1731
|
-
const BookView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
1734
|
+
const BookView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-0c743b16"]]);
|
|
1732
1735
|
const _hoisted_1$1 = ["onClick"];
|
|
1733
1736
|
const _hoisted_2$1 = { key: 0 };
|
|
1734
1737
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -1933,8 +1936,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1933
1936
|
});
|
|
1934
1937
|
const VueReader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ce33d15c"]]);
|
|
1935
1938
|
const findIndices = (arr, f2) => arr.map((x2, i2, a2) => f2(x2, i2, a2) ? i2 : null).filter((x2) => x2 != null);
|
|
1936
|
-
const splitAt = (arr, is) => [-1, ...is, arr.length].reduce(({ xs, a: a2 },
|
|
1937
|
-
const concatArrays = (a2,
|
|
1939
|
+
const splitAt = (arr, is) => [-1, ...is, arr.length].reduce(({ xs, a: a2 }, b3) => ({ xs: (xs == null ? void 0 : xs.concat([arr.slice(a2 + 1, b3)])) ?? [], a: b3 }), {}).xs;
|
|
1940
|
+
const concatArrays = (a2, b3) => a2.slice(0, -1).concat([a2[a2.length - 1].concat(b3[0])]).concat(b3.slice(1));
|
|
1938
1941
|
const isNumber = /\d/;
|
|
1939
1942
|
const isCFI = /^epubcfi\((.*)\)$/;
|
|
1940
1943
|
const escapeCFI = (str) => str.replace(/[\^[\](),;=]/g, "^$&");
|
|
@@ -2055,12 +2058,12 @@ const buildRange = (from, to) => {
|
|
|
2055
2058
|
let pushToParent = true;
|
|
2056
2059
|
const len = Math.max(localFrom.length, localTo.length);
|
|
2057
2060
|
for (let i2 = 0; i2 < len; i2++) {
|
|
2058
|
-
const a2 = localFrom[i2],
|
|
2059
|
-
pushToParent &&= (a2 == null ? void 0 : a2.index) === (
|
|
2061
|
+
const a2 = localFrom[i2], b3 = localTo[i2];
|
|
2062
|
+
pushToParent &&= (a2 == null ? void 0 : a2.index) === (b3 == null ? void 0 : b3.index) && !(a2 == null ? void 0 : a2.offset) && !(b3 == null ? void 0 : b3.offset);
|
|
2060
2063
|
if (pushToParent) localParent.push(a2);
|
|
2061
2064
|
else {
|
|
2062
2065
|
if (a2) localStart.push(a2);
|
|
2063
|
-
if (
|
|
2066
|
+
if (b3) localEnd.push(b3);
|
|
2064
2067
|
}
|
|
2065
2068
|
}
|
|
2066
2069
|
const parent = from.slice(0, -1).concat([localParent]);
|
|
@@ -2121,7 +2124,9 @@ const partsToNode = (node, parts, filter2) => {
|
|
|
2121
2124
|
}
|
|
2122
2125
|
};
|
|
2123
2126
|
const nodeToParts = (node, offset, filter2) => {
|
|
2124
|
-
|
|
2127
|
+
let { id, parentNode } = node;
|
|
2128
|
+
while (filter2)
|
|
2129
|
+
parentNode = parentNode.parentNode;
|
|
2125
2130
|
const indexed = indexChildNodes(parentNode, filter2);
|
|
2126
2131
|
const index = indexed.findIndex((x2) => Array.isArray(x2) ? x2.some((x3) => x3 === node) : x2 === node);
|
|
2127
2132
|
const chunk = indexed[index];
|
|
@@ -2233,7 +2238,7 @@ class SectionProgress {
|
|
|
2233
2238
|
this.sizes = sections.map((s2) => s2.linear != "no" && s2.size > 0 ? s2.size : 0);
|
|
2234
2239
|
this.sizePerLoc = sizePerLoc;
|
|
2235
2240
|
this.sizePerTimeUnit = sizePerTimeUnit;
|
|
2236
|
-
this.sizeTotal = this.sizes.reduce((a2,
|
|
2241
|
+
this.sizeTotal = this.sizes.reduce((a2, b3) => a2 + b3, 0);
|
|
2237
2242
|
this.sectionFractions = this.#getSectionFractions();
|
|
2238
2243
|
}
|
|
2239
2244
|
#getSectionFractions() {
|
|
@@ -2247,7 +2252,7 @@ class SectionProgress {
|
|
|
2247
2252
|
getProgress(index, fractionInSection, pageFraction = 0) {
|
|
2248
2253
|
const { sizes, sizePerLoc, sizePerTimeUnit, sizeTotal } = this;
|
|
2249
2254
|
const sizeInSection = sizes[index] ?? 0;
|
|
2250
|
-
const sizeBefore = sizes.slice(0, index).reduce((a2,
|
|
2255
|
+
const sizeBefore = sizes.slice(0, index).reduce((a2, b3) => a2 + b3, 0);
|
|
2251
2256
|
const size = sizeBefore + fractionInSection * sizeInSection;
|
|
2252
2257
|
const nextSize = size + pageFraction * sizeInSection;
|
|
2253
2258
|
const remainingTotal = sizeTotal - size;
|
|
@@ -2324,12 +2329,12 @@ class Overlayer {
|
|
|
2324
2329
|
obj.rects = rects;
|
|
2325
2330
|
}
|
|
2326
2331
|
}
|
|
2327
|
-
hitTest({ x: x2, y:
|
|
2332
|
+
hitTest({ x: x2, y: y3 }) {
|
|
2328
2333
|
const arr = Array.from(this.#map.entries());
|
|
2329
2334
|
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
2330
2335
|
const [key, obj] = arr[i2];
|
|
2331
2336
|
for (const { left, top, right, bottom } of obj.rects)
|
|
2332
|
-
if (top <=
|
|
2337
|
+
if (top <= y3 && left <= x2 && bottom > y3 && right > x2)
|
|
2333
2338
|
return [key, obj.range];
|
|
2334
2339
|
}
|
|
2335
2340
|
return [];
|
|
@@ -2490,7 +2495,7 @@ const textWalker = function* (x2, func, filterFunc) {
|
|
|
2490
2495
|
const walker = document.createTreeWalker(root, filter$1, { acceptNode: filterFunc || acceptNode });
|
|
2491
2496
|
const walk = x2.commonAncestorContainer ? walkRange : walkDocument;
|
|
2492
2497
|
const nodes = walk(x2, walker);
|
|
2493
|
-
const strs = nodes.map((node) => node.nodeValue);
|
|
2498
|
+
const strs = nodes.map((node) => node.nodeValue ?? "");
|
|
2494
2499
|
const makeRange2 = (startIndex, startOffset, endIndex, endOffset) => {
|
|
2495
2500
|
const range = document.createRange();
|
|
2496
2501
|
range.setStart(nodes[startIndex], startOffset);
|
|
@@ -2697,6 +2702,8 @@ let View$1 = class View extends HTMLElement {
|
|
|
2697
2702
|
#tocProgress;
|
|
2698
2703
|
#pageProgress;
|
|
2699
2704
|
#searchResults = /* @__PURE__ */ new Map();
|
|
2705
|
+
#searchDraw;
|
|
2706
|
+
#searchDrawOptions;
|
|
2700
2707
|
#cursorAutohider = new CursorAutohider(this, () => this.hasAttribute("autohide-cursor"));
|
|
2701
2708
|
isFixedLayout = false;
|
|
2702
2709
|
lastLocation;
|
|
@@ -2850,7 +2857,7 @@ let View$1 = class View extends HTMLElement {
|
|
|
2850
2857
|
return;
|
|
2851
2858
|
}
|
|
2852
2859
|
const range = doc ? anchor2(doc) : anchor2;
|
|
2853
|
-
overlayer.add(value, range,
|
|
2860
|
+
overlayer.add(value, range, this.#searchDraw, this.#searchDrawOptions);
|
|
2854
2861
|
}
|
|
2855
2862
|
return;
|
|
2856
2863
|
}
|
|
@@ -3011,6 +3018,8 @@ let View$1 = class View extends HTMLElement {
|
|
|
3011
3018
|
async *search(opts) {
|
|
3012
3019
|
var _a;
|
|
3013
3020
|
this.clearSearch();
|
|
3021
|
+
this.#searchDraw = opts.draw ?? Overlayer.outline;
|
|
3022
|
+
this.#searchDrawOptions = opts.drawOptions;
|
|
3014
3023
|
const { searchMatcher: searchMatcher2 } = await Promise.resolve().then(() => search$1);
|
|
3015
3024
|
const { query, index } = opts;
|
|
3016
3025
|
const matcher = searchMatcher2(
|
|
@@ -3065,511 +3074,81 @@ const view = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
3065
3074
|
View: View$1,
|
|
3066
3075
|
makeBook
|
|
3067
3076
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3068
|
-
const e$1 =
|
|
3069
|
-
|
|
3070
|
-
let e2, i2, r2, a2, d, f2;
|
|
3071
|
-
function h2(e3, i3, s2, o2, l2, c, h3, w2, _2, b2, p2) {
|
|
3072
|
-
let m2, g2, y2, x2, k2, v2, S2, z2, A2, U3, D2, E2, T2, F2, O2;
|
|
3073
|
-
U3 = 0, k2 = s2;
|
|
3074
|
-
do {
|
|
3075
|
-
r2[e3[i3 + U3]]++, U3++, k2--;
|
|
3076
|
-
} while (0 !== k2);
|
|
3077
|
-
if (r2[0] == s2) return h3[0] = -1, w2[0] = 0, 0;
|
|
3078
|
-
for (z2 = w2[0], v2 = 1; v2 <= u$1 && 0 === r2[v2]; v2++) ;
|
|
3079
|
-
for (S2 = v2, z2 < v2 && (z2 = v2), k2 = u$1; 0 !== k2 && 0 === r2[k2]; k2--) ;
|
|
3080
|
-
for (y2 = k2, z2 > k2 && (z2 = k2), w2[0] = z2, F2 = 1 << v2; v2 < k2; v2++, F2 <<= 1) if ((F2 -= r2[v2]) < 0) return t$1;
|
|
3081
|
-
if ((F2 -= r2[k2]) < 0) return t$1;
|
|
3082
|
-
for (r2[k2] += F2, f2[1] = v2 = 0, U3 = 1, T2 = 2; 0 != --k2; ) f2[T2] = v2 += r2[U3], T2++, U3++;
|
|
3083
|
-
k2 = 0, U3 = 0;
|
|
3084
|
-
do {
|
|
3085
|
-
0 !== (v2 = e3[i3 + U3]) && (p2[f2[v2]++] = k2), U3++;
|
|
3086
|
-
} while (++k2 < s2);
|
|
3087
|
-
for (s2 = f2[y2], f2[0] = k2 = 0, U3 = 0, x2 = -1, E2 = -z2, d[0] = 0, D2 = 0, O2 = 0; S2 <= y2; S2++) for (m2 = r2[S2]; 0 != m2--; ) {
|
|
3088
|
-
for (; S2 > E2 + z2; ) {
|
|
3089
|
-
if (x2++, E2 += z2, O2 = y2 - E2, O2 = O2 > z2 ? z2 : O2, (g2 = 1 << (v2 = S2 - E2)) > m2 + 1 && (g2 -= m2 + 1, T2 = S2, v2 < O2)) for (; ++v2 < O2 && !((g2 <<= 1) <= r2[++T2]); ) g2 -= r2[T2];
|
|
3090
|
-
if (O2 = 1 << v2, b2[0] + O2 > 1440) return t$1;
|
|
3091
|
-
d[x2] = D2 = b2[0], b2[0] += O2, 0 !== x2 ? (f2[x2] = k2, a2[0] = v2, a2[1] = z2, v2 = k2 >>> E2 - z2, a2[2] = D2 - d[x2 - 1] - v2, _2.set(a2, 3 * (d[x2 - 1] + v2))) : h3[0] = D2;
|
|
3092
|
-
}
|
|
3093
|
-
for (a2[1] = S2 - E2, U3 >= s2 ? a2[0] = 192 : p2[U3] < o2 ? (a2[0] = p2[U3] < 256 ? 0 : 96, a2[2] = p2[U3++]) : (a2[0] = c[p2[U3] - o2] + 16 + 64, a2[2] = l2[p2[U3++] - o2]), g2 = 1 << S2 - E2, v2 = k2 >>> E2; v2 < O2; v2 += g2) _2.set(a2, 3 * (D2 + v2));
|
|
3094
|
-
for (v2 = 1 << S2 - 1; k2 & v2; v2 >>>= 1) k2 ^= v2;
|
|
3095
|
-
for (k2 ^= v2, A2 = (1 << E2) - 1; (k2 & A2) != f2[x2]; ) x2--, E2 -= z2, A2 = (1 << E2) - 1;
|
|
3096
|
-
}
|
|
3097
|
-
return 0 !== F2 && 1 != y2 ? n$1 : 0;
|
|
3098
|
-
}
|
|
3099
|
-
function w(t2) {
|
|
3100
|
-
let n2;
|
|
3101
|
-
for (e2 || (e2 = [], i2 = [], r2 = new Int32Array(16), a2 = [], d = new Int32Array(u$1), f2 = new Int32Array(16)), i2.length < t2 && (i2 = []), n2 = 0; n2 < t2; n2++) i2[n2] = 0;
|
|
3102
|
-
for (n2 = 0; n2 < 16; n2++) r2[n2] = 0;
|
|
3103
|
-
for (n2 = 0; n2 < 3; n2++) a2[n2] = 0;
|
|
3104
|
-
d.set(r2.subarray(0, u$1), 0), f2.set(r2.subarray(0, 16), 0);
|
|
3105
|
-
}
|
|
3106
|
-
this.inflate_trees_bits = function(r3, a3, s2, o2, l2) {
|
|
3107
|
-
let c;
|
|
3108
|
-
return w(19), e2[0] = 0, c = h2(r3, 0, 19, 19, null, null, s2, a3, o2, e2, i2), c == t$1 ? l2.msg = "oversubscribed dynamic bit lengths tree" : c != n$1 && 0 !== a3[0] || (l2.msg = "incomplete dynamic bit lengths tree", c = t$1), c;
|
|
3109
|
-
}, this.inflate_trees_dynamic = function(r3, a3, u, d2, f3, _2, b2, p2, m2) {
|
|
3110
|
-
let g2;
|
|
3111
|
-
return w(288), e2[0] = 0, g2 = h2(u, 0, r3, 257, s$1, o$1, _2, d2, p2, e2, i2), 0 != g2 || 0 === d2[0] ? (g2 == t$1 ? m2.msg = "oversubscribed literal/length tree" : -4 != g2 && (m2.msg = "incomplete literal/length tree", g2 = t$1), g2) : (w(288), g2 = h2(u, r3, a3, 0, l$1, c$1, b2, f3, p2, e2, i2), 0 != g2 || 0 === f3[0] && r3 > 257 ? (g2 == t$1 ? m2.msg = "oversubscribed distance tree" : g2 == n$1 ? (m2.msg = "incomplete distance tree", g2 = t$1) : -4 != g2 && (m2.msg = "empty distance tree with lengths", g2 = t$1), g2) : 0);
|
|
3112
|
-
};
|
|
3113
|
-
}
|
|
3114
|
-
d$1.inflate_trees_fixed = function(e2, t2, n2, i2) {
|
|
3115
|
-
return e2[0] = 9, t2[0] = 5, n2[0] = r$1, i2[0] = a$1, 0;
|
|
3116
|
-
};
|
|
3117
|
-
function f$1() {
|
|
3118
|
-
const n2 = this;
|
|
3119
|
-
let r2, a2, s2, o2, l2 = 0, c = 0, u = 0, d = 0, f2 = 0, h2 = 0, w = 0, _2 = 0, b2 = 0, p2 = 0;
|
|
3120
|
-
function m2(e2, n3, r3, a3, s3, o3, l3, c2) {
|
|
3121
|
-
let u2, d2, f3, h3, w2, _3, b3, p3, m3, g2, y2, x2, k2, v2, S2, z2;
|
|
3122
|
-
b3 = c2.next_in_index, p3 = c2.avail_in, w2 = l3.bitb, _3 = l3.bitk, m3 = l3.write, g2 = m3 < l3.read ? l3.read - m3 - 1 : l3.end - m3, y2 = i$1[e2], x2 = i$1[n3];
|
|
3123
|
-
do {
|
|
3124
|
-
for (; _3 < 20; ) p3--, w2 |= (255 & c2.read_byte(b3++)) << _3, _3 += 8;
|
|
3125
|
-
if (u2 = w2 & y2, d2 = r3, f3 = a3, z2 = 3 * (f3 + u2), 0 !== (h3 = d2[z2])) for (; ; ) {
|
|
3126
|
-
if (w2 >>= d2[z2 + 1], _3 -= d2[z2 + 1], 16 & h3) {
|
|
3127
|
-
for (h3 &= 15, k2 = d2[z2 + 2] + (w2 & i$1[h3]), w2 >>= h3, _3 -= h3; _3 < 15; ) p3--, w2 |= (255 & c2.read_byte(b3++)) << _3, _3 += 8;
|
|
3128
|
-
for (u2 = w2 & x2, d2 = s3, f3 = o3, z2 = 3 * (f3 + u2), h3 = d2[z2]; ; ) {
|
|
3129
|
-
if (w2 >>= d2[z2 + 1], _3 -= d2[z2 + 1], 16 & h3) {
|
|
3130
|
-
for (h3 &= 15; _3 < h3; ) p3--, w2 |= (255 & c2.read_byte(b3++)) << _3, _3 += 8;
|
|
3131
|
-
if (v2 = d2[z2 + 2] + (w2 & i$1[h3]), w2 >>= h3, _3 -= h3, g2 -= k2, m3 >= v2) S2 = m3 - v2, m3 - S2 > 0 && 2 > m3 - S2 ? (l3.win[m3++] = l3.win[S2++], l3.win[m3++] = l3.win[S2++], k2 -= 2) : (l3.win.set(l3.win.subarray(S2, S2 + 2), m3), m3 += 2, S2 += 2, k2 -= 2);
|
|
3132
|
-
else {
|
|
3133
|
-
S2 = m3 - v2;
|
|
3134
|
-
do {
|
|
3135
|
-
S2 += l3.end;
|
|
3136
|
-
} while (S2 < 0);
|
|
3137
|
-
if (h3 = l3.end - S2, k2 > h3) {
|
|
3138
|
-
if (k2 -= h3, m3 - S2 > 0 && h3 > m3 - S2) do {
|
|
3139
|
-
l3.win[m3++] = l3.win[S2++];
|
|
3140
|
-
} while (0 != --h3);
|
|
3141
|
-
else l3.win.set(l3.win.subarray(S2, S2 + h3), m3), m3 += h3, S2 += h3, h3 = 0;
|
|
3142
|
-
S2 = 0;
|
|
3143
|
-
}
|
|
3144
|
-
}
|
|
3145
|
-
if (m3 - S2 > 0 && k2 > m3 - S2) do {
|
|
3146
|
-
l3.win[m3++] = l3.win[S2++];
|
|
3147
|
-
} while (0 != --k2);
|
|
3148
|
-
else l3.win.set(l3.win.subarray(S2, S2 + k2), m3), m3 += k2, S2 += k2, k2 = 0;
|
|
3149
|
-
break;
|
|
3150
|
-
}
|
|
3151
|
-
if (64 & h3) return c2.msg = "invalid distance code", k2 = c2.avail_in - p3, k2 = _3 >> 3 < k2 ? _3 >> 3 : k2, p3 += k2, b3 -= k2, _3 -= k2 << 3, l3.bitb = w2, l3.bitk = _3, c2.avail_in = p3, c2.total_in += b3 - c2.next_in_index, c2.next_in_index = b3, l3.write = m3, t$1;
|
|
3152
|
-
u2 += d2[z2 + 2], u2 += w2 & i$1[h3], z2 = 3 * (f3 + u2), h3 = d2[z2];
|
|
3153
|
-
}
|
|
3154
|
-
break;
|
|
3155
|
-
}
|
|
3156
|
-
if (64 & h3) return 32 & h3 ? (k2 = c2.avail_in - p3, k2 = _3 >> 3 < k2 ? _3 >> 3 : k2, p3 += k2, b3 -= k2, _3 -= k2 << 3, l3.bitb = w2, l3.bitk = _3, c2.avail_in = p3, c2.total_in += b3 - c2.next_in_index, c2.next_in_index = b3, l3.write = m3, 1) : (c2.msg = "invalid literal/length code", k2 = c2.avail_in - p3, k2 = _3 >> 3 < k2 ? _3 >> 3 : k2, p3 += k2, b3 -= k2, _3 -= k2 << 3, l3.bitb = w2, l3.bitk = _3, c2.avail_in = p3, c2.total_in += b3 - c2.next_in_index, c2.next_in_index = b3, l3.write = m3, t$1);
|
|
3157
|
-
if (u2 += d2[z2 + 2], u2 += w2 & i$1[h3], z2 = 3 * (f3 + u2), 0 === (h3 = d2[z2])) {
|
|
3158
|
-
w2 >>= d2[z2 + 1], _3 -= d2[z2 + 1], l3.win[m3++] = d2[z2 + 2], g2--;
|
|
3159
|
-
break;
|
|
3160
|
-
}
|
|
3161
|
-
}
|
|
3162
|
-
else w2 >>= d2[z2 + 1], _3 -= d2[z2 + 1], l3.win[m3++] = d2[z2 + 2], g2--;
|
|
3163
|
-
} while (g2 >= 258 && p3 >= 10);
|
|
3164
|
-
return k2 = c2.avail_in - p3, k2 = _3 >> 3 < k2 ? _3 >> 3 : k2, p3 += k2, b3 -= k2, _3 -= k2 << 3, l3.bitb = w2, l3.bitk = _3, c2.avail_in = p3, c2.total_in += b3 - c2.next_in_index, c2.next_in_index = b3, l3.write = m3, 0;
|
|
3165
|
-
}
|
|
3166
|
-
n2.init = function(e2, t2, n3, i2, l3, c2) {
|
|
3167
|
-
r2 = 0, w = e2, _2 = t2, s2 = n3, b2 = i2, o2 = l3, p2 = c2, a2 = null;
|
|
3168
|
-
}, n2.proc = function(n3, g2, y2) {
|
|
3169
|
-
let x2, k2, v2, S2, z2, A2, U3, D2 = 0, E2 = 0, T2 = 0;
|
|
3170
|
-
for (T2 = g2.next_in_index, S2 = g2.avail_in, D2 = n3.bitb, E2 = n3.bitk, z2 = n3.write, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2; ; ) switch (r2) {
|
|
3171
|
-
case 0:
|
|
3172
|
-
if (A2 >= 258 && S2 >= 10 && (n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, y2 = m2(w, _2, s2, b2, o2, p2, n3, g2), T2 = g2.next_in_index, S2 = g2.avail_in, D2 = n3.bitb, E2 = n3.bitk, z2 = n3.write, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2, 0 != y2)) {
|
|
3173
|
-
r2 = 1 == y2 ? 7 : 9;
|
|
3174
|
-
break;
|
|
3175
|
-
}
|
|
3176
|
-
u = w, a2 = s2, c = b2, r2 = 1;
|
|
3177
|
-
case 1:
|
|
3178
|
-
for (x2 = u; E2 < x2; ) {
|
|
3179
|
-
if (0 === S2) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3180
|
-
y2 = 0, S2--, D2 |= (255 & g2.read_byte(T2++)) << E2, E2 += 8;
|
|
3181
|
-
}
|
|
3182
|
-
if (k2 = 3 * (c + (D2 & i$1[x2])), D2 >>>= a2[k2 + 1], E2 -= a2[k2 + 1], v2 = a2[k2], 0 === v2) {
|
|
3183
|
-
d = a2[k2 + 2], r2 = 6;
|
|
3184
|
-
break;
|
|
3185
|
-
}
|
|
3186
|
-
if (16 & v2) {
|
|
3187
|
-
f2 = 15 & v2, l2 = a2[k2 + 2], r2 = 2;
|
|
3188
|
-
break;
|
|
3189
|
-
}
|
|
3190
|
-
if (!(64 & v2)) {
|
|
3191
|
-
u = v2, c = k2 / 3 + a2[k2 + 2];
|
|
3192
|
-
break;
|
|
3193
|
-
}
|
|
3194
|
-
if (32 & v2) {
|
|
3195
|
-
r2 = 7;
|
|
3196
|
-
break;
|
|
3197
|
-
}
|
|
3198
|
-
return r2 = 9, g2.msg = "invalid literal/length code", y2 = t$1, n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3199
|
-
case 2:
|
|
3200
|
-
for (x2 = f2; E2 < x2; ) {
|
|
3201
|
-
if (0 === S2) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3202
|
-
y2 = 0, S2--, D2 |= (255 & g2.read_byte(T2++)) << E2, E2 += 8;
|
|
3203
|
-
}
|
|
3204
|
-
l2 += D2 & i$1[x2], D2 >>= x2, E2 -= x2, u = _2, a2 = o2, c = p2, r2 = 3;
|
|
3205
|
-
case 3:
|
|
3206
|
-
for (x2 = u; E2 < x2; ) {
|
|
3207
|
-
if (0 === S2) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3208
|
-
y2 = 0, S2--, D2 |= (255 & g2.read_byte(T2++)) << E2, E2 += 8;
|
|
3209
|
-
}
|
|
3210
|
-
if (k2 = 3 * (c + (D2 & i$1[x2])), D2 >>= a2[k2 + 1], E2 -= a2[k2 + 1], v2 = a2[k2], 16 & v2) {
|
|
3211
|
-
f2 = 15 & v2, h2 = a2[k2 + 2], r2 = 4;
|
|
3212
|
-
break;
|
|
3213
|
-
}
|
|
3214
|
-
if (!(64 & v2)) {
|
|
3215
|
-
u = v2, c = k2 / 3 + a2[k2 + 2];
|
|
3216
|
-
break;
|
|
3217
|
-
}
|
|
3218
|
-
return r2 = 9, g2.msg = "invalid distance code", y2 = t$1, n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3219
|
-
case 4:
|
|
3220
|
-
for (x2 = f2; E2 < x2; ) {
|
|
3221
|
-
if (0 === S2) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3222
|
-
y2 = 0, S2--, D2 |= (255 & g2.read_byte(T2++)) << E2, E2 += 8;
|
|
3223
|
-
}
|
|
3224
|
-
h2 += D2 & i$1[x2], D2 >>= x2, E2 -= x2, r2 = 5;
|
|
3225
|
-
case 5:
|
|
3226
|
-
for (U3 = z2 - h2; U3 < 0; ) U3 += n3.end;
|
|
3227
|
-
for (; 0 !== l2; ) {
|
|
3228
|
-
if (0 === A2 && (z2 == n3.end && 0 !== n3.read && (z2 = 0, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2), 0 === A2 && (n3.write = z2, y2 = n3.inflate_flush(g2, y2), z2 = n3.write, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2, z2 == n3.end && 0 !== n3.read && (z2 = 0, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2), 0 === A2))) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3229
|
-
n3.win[z2++] = n3.win[U3++], A2--, U3 == n3.end && (U3 = 0), l2--;
|
|
3230
|
-
}
|
|
3231
|
-
r2 = 0;
|
|
3232
|
-
break;
|
|
3233
|
-
case 6:
|
|
3234
|
-
if (0 === A2 && (z2 == n3.end && 0 !== n3.read && (z2 = 0, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2), 0 === A2 && (n3.write = z2, y2 = n3.inflate_flush(g2, y2), z2 = n3.write, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2, z2 == n3.end && 0 !== n3.read && (z2 = 0, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2), 0 === A2))) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3235
|
-
y2 = 0, n3.win[z2++] = d, A2--, r2 = 0;
|
|
3236
|
-
break;
|
|
3237
|
-
case 7:
|
|
3238
|
-
if (E2 > 7 && (E2 -= 8, S2++, T2--), n3.write = z2, y2 = n3.inflate_flush(g2, y2), z2 = n3.write, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2, n3.read != n3.write) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3239
|
-
r2 = 8;
|
|
3240
|
-
case 8:
|
|
3241
|
-
return y2 = 1, n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3242
|
-
case 9:
|
|
3243
|
-
return y2 = t$1, n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3244
|
-
default:
|
|
3245
|
-
return y2 = e$1, n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3246
|
-
}
|
|
3247
|
-
}, n2.free = function() {
|
|
3248
|
-
};
|
|
3249
|
-
}
|
|
3250
|
-
const h$1 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
|
|
3251
|
-
function w$1(r2, a2) {
|
|
3252
|
-
const s2 = this;
|
|
3253
|
-
let o2, l2 = 0, c = 0, u = 0, w = 0;
|
|
3254
|
-
const _2 = [0], b2 = [0], p2 = new f$1();
|
|
3255
|
-
let m2 = 0, g2 = new Int32Array(4320);
|
|
3256
|
-
const y2 = new d$1();
|
|
3257
|
-
s2.bitk = 0, s2.bitb = 0, s2.win = new Uint8Array(a2), s2.end = a2, s2.read = 0, s2.write = 0, s2.reset = function(e2, t2) {
|
|
3258
|
-
t2 && (t2[0] = 0), 6 == l2 && p2.free(e2), l2 = 0, s2.bitk = 0, s2.bitb = 0, s2.read = s2.write = 0;
|
|
3259
|
-
}, s2.reset(r2, null), s2.inflate_flush = function(e2, t2) {
|
|
3260
|
-
let i2, r3, a3;
|
|
3261
|
-
return r3 = e2.next_out_index, a3 = s2.read, i2 = (a3 <= s2.write ? s2.write : s2.end) - a3, i2 > e2.avail_out && (i2 = e2.avail_out), 0 !== i2 && t2 == n$1 && (t2 = 0), e2.avail_out -= i2, e2.total_out += i2, e2.next_out.set(s2.win.subarray(a3, a3 + i2), r3), r3 += i2, a3 += i2, a3 == s2.end && (a3 = 0, s2.write == s2.end && (s2.write = 0), i2 = s2.write - a3, i2 > e2.avail_out && (i2 = e2.avail_out), 0 !== i2 && t2 == n$1 && (t2 = 0), e2.avail_out -= i2, e2.total_out += i2, e2.next_out.set(s2.win.subarray(a3, a3 + i2), r3), r3 += i2, a3 += i2), e2.next_out_index = r3, s2.read = a3, t2;
|
|
3262
|
-
}, s2.proc = function(n2, r3) {
|
|
3263
|
-
let a3, f2, x2, k2, v2, S2, z2, A2;
|
|
3264
|
-
for (k2 = n2.next_in_index, v2 = n2.avail_in, f2 = s2.bitb, x2 = s2.bitk, S2 = s2.write, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2; ; ) {
|
|
3265
|
-
let U3, D2, E2, T2, F2, O2, C2, W2;
|
|
3266
|
-
switch (l2) {
|
|
3267
|
-
case 0:
|
|
3268
|
-
for (; x2 < 3; ) {
|
|
3269
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3270
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3271
|
-
}
|
|
3272
|
-
switch (a3 = 7 & f2, m2 = 1 & a3, a3 >>> 1) {
|
|
3273
|
-
case 0:
|
|
3274
|
-
f2 >>>= 3, x2 -= 3, a3 = 7 & x2, f2 >>>= a3, x2 -= a3, l2 = 1;
|
|
3275
|
-
break;
|
|
3276
|
-
case 1:
|
|
3277
|
-
U3 = [], D2 = [], E2 = [[]], T2 = [[]], d$1.inflate_trees_fixed(U3, D2, E2, T2), p2.init(U3[0], D2[0], E2[0], 0, T2[0], 0), f2 >>>= 3, x2 -= 3, l2 = 6;
|
|
3278
|
-
break;
|
|
3279
|
-
case 2:
|
|
3280
|
-
f2 >>>= 3, x2 -= 3, l2 = 3;
|
|
3281
|
-
break;
|
|
3282
|
-
case 3:
|
|
3283
|
-
return f2 >>>= 3, x2 -= 3, l2 = 9, n2.msg = "invalid block type", r3 = t$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3284
|
-
}
|
|
3285
|
-
break;
|
|
3286
|
-
case 1:
|
|
3287
|
-
for (; x2 < 32; ) {
|
|
3288
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3289
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3290
|
-
}
|
|
3291
|
-
if ((~f2 >>> 16 & 65535) != (65535 & f2)) return l2 = 9, n2.msg = "invalid stored block lengths", r3 = t$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3292
|
-
c = 65535 & f2, f2 = x2 = 0, l2 = 0 !== c ? 2 : 0 !== m2 ? 7 : 0;
|
|
3293
|
-
break;
|
|
3294
|
-
case 2:
|
|
3295
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3296
|
-
if (0 === z2 && (S2 == s2.end && 0 !== s2.read && (S2 = 0, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2), 0 === z2 && (s2.write = S2, r3 = s2.inflate_flush(n2, r3), S2 = s2.write, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2, S2 == s2.end && 0 !== s2.read && (S2 = 0, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2), 0 === z2))) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3297
|
-
if (r3 = 0, a3 = c, a3 > v2 && (a3 = v2), a3 > z2 && (a3 = z2), s2.win.set(n2.read_buf(k2, a3), S2), k2 += a3, v2 -= a3, S2 += a3, z2 -= a3, 0 != (c -= a3)) break;
|
|
3298
|
-
l2 = 0 !== m2 ? 7 : 0;
|
|
3299
|
-
break;
|
|
3300
|
-
case 3:
|
|
3301
|
-
for (; x2 < 14; ) {
|
|
3302
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3303
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3304
|
-
}
|
|
3305
|
-
if (u = a3 = 16383 & f2, (31 & a3) > 29 || (a3 >> 5 & 31) > 29) return l2 = 9, n2.msg = "too many length or distance symbols", r3 = t$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3306
|
-
if (a3 = 258 + (31 & a3) + (a3 >> 5 & 31), !o2 || o2.length < a3) o2 = [];
|
|
3307
|
-
else for (A2 = 0; A2 < a3; A2++) o2[A2] = 0;
|
|
3308
|
-
f2 >>>= 14, x2 -= 14, w = 0, l2 = 4;
|
|
3309
|
-
case 4:
|
|
3310
|
-
for (; w < 4 + (u >>> 10); ) {
|
|
3311
|
-
for (; x2 < 3; ) {
|
|
3312
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3313
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3314
|
-
}
|
|
3315
|
-
o2[h$1[w++]] = 7 & f2, f2 >>>= 3, x2 -= 3;
|
|
3316
|
-
}
|
|
3317
|
-
for (; w < 19; ) o2[h$1[w++]] = 0;
|
|
3318
|
-
if (_2[0] = 7, a3 = y2.inflate_trees_bits(o2, _2, b2, g2, n2), 0 != a3) return (r3 = a3) == t$1 && (o2 = null, l2 = 9), s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3319
|
-
w = 0, l2 = 5;
|
|
3320
|
-
case 5:
|
|
3321
|
-
for (; a3 = u, !(w >= 258 + (31 & a3) + (a3 >> 5 & 31)); ) {
|
|
3322
|
-
let e2, c2;
|
|
3323
|
-
for (a3 = _2[0]; x2 < a3; ) {
|
|
3324
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3325
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3326
|
-
}
|
|
3327
|
-
if (a3 = g2[3 * (b2[0] + (f2 & i$1[a3])) + 1], c2 = g2[3 * (b2[0] + (f2 & i$1[a3])) + 2], c2 < 16) f2 >>>= a3, x2 -= a3, o2[w++] = c2;
|
|
3328
|
-
else {
|
|
3329
|
-
for (A2 = 18 == c2 ? 7 : c2 - 14, e2 = 18 == c2 ? 11 : 3; x2 < a3 + A2; ) {
|
|
3330
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3331
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3332
|
-
}
|
|
3333
|
-
if (f2 >>>= a3, x2 -= a3, e2 += f2 & i$1[A2], f2 >>>= A2, x2 -= A2, A2 = w, a3 = u, A2 + e2 > 258 + (31 & a3) + (a3 >> 5 & 31) || 16 == c2 && A2 < 1) return o2 = null, l2 = 9, n2.msg = "invalid bit length repeat", r3 = t$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3334
|
-
c2 = 16 == c2 ? o2[A2 - 1] : 0;
|
|
3335
|
-
do {
|
|
3336
|
-
o2[A2++] = c2;
|
|
3337
|
-
} while (0 != --e2);
|
|
3338
|
-
w = A2;
|
|
3339
|
-
}
|
|
3340
|
-
}
|
|
3341
|
-
if (b2[0] = -1, F2 = [], O2 = [], C2 = [], W2 = [], F2[0] = 9, O2[0] = 6, a3 = u, a3 = y2.inflate_trees_dynamic(257 + (31 & a3), 1 + (a3 >> 5 & 31), o2, F2, O2, C2, W2, g2, n2), 0 != a3) return a3 == t$1 && (o2 = null, l2 = 9), r3 = a3, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3342
|
-
p2.init(F2[0], O2[0], g2, C2[0], g2, W2[0]), l2 = 6;
|
|
3343
|
-
case 6:
|
|
3344
|
-
if (s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, 1 != (r3 = p2.proc(s2, n2, r3))) return s2.inflate_flush(n2, r3);
|
|
3345
|
-
if (r3 = 0, p2.free(n2), k2 = n2.next_in_index, v2 = n2.avail_in, f2 = s2.bitb, x2 = s2.bitk, S2 = s2.write, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2, 0 === m2) {
|
|
3346
|
-
l2 = 0;
|
|
3347
|
-
break;
|
|
3348
|
-
}
|
|
3349
|
-
l2 = 7;
|
|
3350
|
-
case 7:
|
|
3351
|
-
if (s2.write = S2, r3 = s2.inflate_flush(n2, r3), S2 = s2.write, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2, s2.read != s2.write) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3352
|
-
l2 = 8;
|
|
3353
|
-
case 8:
|
|
3354
|
-
return r3 = 1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3355
|
-
case 9:
|
|
3356
|
-
return r3 = t$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3357
|
-
default:
|
|
3358
|
-
return r3 = e$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3359
|
-
}
|
|
3360
|
-
}
|
|
3361
|
-
}, s2.free = function(e2) {
|
|
3362
|
-
s2.reset(e2, null), s2.win = null, g2 = null;
|
|
3363
|
-
}, s2.set_dictionary = function(e2, t2, n2) {
|
|
3364
|
-
s2.win.set(e2.subarray(t2, t2 + n2), 0), s2.read = s2.write = n2;
|
|
3365
|
-
}, s2.sync_point = function() {
|
|
3366
|
-
return 1 == l2 ? 1 : 0;
|
|
3367
|
-
};
|
|
3368
|
-
}
|
|
3369
|
-
const _ = 13, b$1 = [0, 0, 255, 255];
|
|
3370
|
-
function p$1() {
|
|
3371
|
-
const i2 = this;
|
|
3372
|
-
function r2(t2) {
|
|
3373
|
-
return t2 && t2.istate ? (t2.total_in = t2.total_out = 0, t2.msg = null, t2.istate.mode = 7, t2.istate.blocks.reset(t2, null), 0) : e$1;
|
|
3374
|
-
}
|
|
3375
|
-
i2.mode = 0, i2.method = 0, i2.was = [0], i2.need = 0, i2.marker = 0, i2.wbits = 0, i2.inflateEnd = function(e2) {
|
|
3376
|
-
return i2.blocks && i2.blocks.free(e2), i2.blocks = null, 0;
|
|
3377
|
-
}, i2.inflateInit = function(t2, n2) {
|
|
3378
|
-
return t2.msg = null, i2.blocks = null, n2 < 8 || n2 > 15 ? (i2.inflateEnd(t2), e$1) : (i2.wbits = n2, t2.istate.blocks = new w$1(t2, 1 << n2), r2(t2), 0);
|
|
3379
|
-
}, i2.inflate = function(i3, r3) {
|
|
3380
|
-
let a2, s2;
|
|
3381
|
-
if (!i3 || !i3.istate || !i3.next_in) return e$1;
|
|
3382
|
-
const o2 = i3.istate;
|
|
3383
|
-
for (r3 = 4 == r3 ? n$1 : 0, a2 = n$1; ; ) switch (o2.mode) {
|
|
3384
|
-
case 0:
|
|
3385
|
-
if (0 === i3.avail_in) return a2;
|
|
3386
|
-
if (a2 = r3, i3.avail_in--, i3.total_in++, 8 != (15 & (o2.method = i3.read_byte(i3.next_in_index++)))) {
|
|
3387
|
-
o2.mode = _, i3.msg = "unknown compression method", o2.marker = 5;
|
|
3388
|
-
break;
|
|
3389
|
-
}
|
|
3390
|
-
if (8 + (o2.method >> 4) > o2.wbits) {
|
|
3391
|
-
o2.mode = _, i3.msg = "invalid win size", o2.marker = 5;
|
|
3392
|
-
break;
|
|
3393
|
-
}
|
|
3394
|
-
o2.mode = 1;
|
|
3395
|
-
case 1:
|
|
3396
|
-
if (0 === i3.avail_in) return a2;
|
|
3397
|
-
if (a2 = r3, i3.avail_in--, i3.total_in++, s2 = 255 & i3.read_byte(i3.next_in_index++), ((o2.method << 8) + s2) % 31 != 0) {
|
|
3398
|
-
o2.mode = _, i3.msg = "incorrect header check", o2.marker = 5;
|
|
3399
|
-
break;
|
|
3400
|
-
}
|
|
3401
|
-
if (!(32 & s2)) {
|
|
3402
|
-
o2.mode = 7;
|
|
3403
|
-
break;
|
|
3404
|
-
}
|
|
3405
|
-
o2.mode = 2;
|
|
3406
|
-
case 2:
|
|
3407
|
-
if (0 === i3.avail_in) return a2;
|
|
3408
|
-
a2 = r3, i3.avail_in--, i3.total_in++, o2.need = (255 & i3.read_byte(i3.next_in_index++)) << 24 & 4278190080, o2.mode = 3;
|
|
3409
|
-
case 3:
|
|
3410
|
-
if (0 === i3.avail_in) return a2;
|
|
3411
|
-
a2 = r3, i3.avail_in--, i3.total_in++, o2.need += (255 & i3.read_byte(i3.next_in_index++)) << 16 & 16711680, o2.mode = 4;
|
|
3412
|
-
case 4:
|
|
3413
|
-
if (0 === i3.avail_in) return a2;
|
|
3414
|
-
a2 = r3, i3.avail_in--, i3.total_in++, o2.need += (255 & i3.read_byte(i3.next_in_index++)) << 8 & 65280, o2.mode = 5;
|
|
3415
|
-
case 5:
|
|
3416
|
-
return 0 === i3.avail_in ? a2 : (a2 = r3, i3.avail_in--, i3.total_in++, o2.need += 255 & i3.read_byte(i3.next_in_index++), o2.mode = 6, 2);
|
|
3417
|
-
case 6:
|
|
3418
|
-
return o2.mode = _, i3.msg = "need dictionary", o2.marker = 0, e$1;
|
|
3419
|
-
case 7:
|
|
3420
|
-
if (a2 = o2.blocks.proc(i3, a2), a2 == t$1) {
|
|
3421
|
-
o2.mode = _, o2.marker = 0;
|
|
3422
|
-
break;
|
|
3423
|
-
}
|
|
3424
|
-
if (0 == a2 && (a2 = r3), 1 != a2) return a2;
|
|
3425
|
-
a2 = r3, o2.blocks.reset(i3, o2.was), o2.mode = 12;
|
|
3426
|
-
case 12:
|
|
3427
|
-
return i3.avail_in = 0, 1;
|
|
3428
|
-
case _:
|
|
3429
|
-
return t$1;
|
|
3430
|
-
default:
|
|
3431
|
-
return e$1;
|
|
3432
|
-
}
|
|
3433
|
-
}, i2.inflateSetDictionary = function(t2, n2, i3) {
|
|
3434
|
-
let r3 = 0, a2 = i3;
|
|
3435
|
-
if (!t2 || !t2.istate || 6 != t2.istate.mode) return e$1;
|
|
3436
|
-
const s2 = t2.istate;
|
|
3437
|
-
return a2 >= 1 << s2.wbits && (a2 = (1 << s2.wbits) - 1, r3 = i3 - a2), s2.blocks.set_dictionary(n2, r3, a2), s2.mode = 7, 0;
|
|
3438
|
-
}, i2.inflateSync = function(i3) {
|
|
3439
|
-
let a2, s2, o2, l2, c;
|
|
3440
|
-
if (!i3 || !i3.istate) return e$1;
|
|
3441
|
-
const u = i3.istate;
|
|
3442
|
-
if (u.mode != _ && (u.mode = _, u.marker = 0), 0 === (a2 = i3.avail_in)) return n$1;
|
|
3443
|
-
for (s2 = i3.next_in_index, o2 = u.marker; 0 !== a2 && o2 < 4; ) i3.read_byte(s2) == b$1[o2] ? o2++ : o2 = 0 !== i3.read_byte(s2) ? 0 : 4 - o2, s2++, a2--;
|
|
3444
|
-
return i3.total_in += s2 - i3.next_in_index, i3.next_in_index = s2, i3.avail_in = a2, u.marker = o2, 4 != o2 ? t$1 : (l2 = i3.total_in, c = i3.total_out, r2(i3), i3.total_in = l2, i3.total_out = c, u.mode = 7, 0);
|
|
3445
|
-
}, i2.inflateSyncPoint = function(t2) {
|
|
3446
|
-
return t2 && t2.istate && t2.istate.blocks ? t2.istate.blocks.sync_point() : e$1;
|
|
3447
|
-
};
|
|
3448
|
-
}
|
|
3449
|
-
function m$1() {
|
|
3450
|
-
}
|
|
3451
|
-
m$1.prototype = { inflateInit(e2) {
|
|
3452
|
-
const t2 = this;
|
|
3453
|
-
return t2.istate = new p$1(), e2 || (e2 = 15), t2.istate.inflateInit(t2, e2);
|
|
3454
|
-
}, inflate(t2) {
|
|
3455
|
-
const n2 = this;
|
|
3456
|
-
return n2.istate ? n2.istate.inflate(n2, t2) : e$1;
|
|
3457
|
-
}, inflateEnd() {
|
|
3458
|
-
const t2 = this;
|
|
3459
|
-
if (!t2.istate) return e$1;
|
|
3460
|
-
const n2 = t2.istate.inflateEnd(t2);
|
|
3461
|
-
return t2.istate = null, n2;
|
|
3462
|
-
}, inflateSync() {
|
|
3463
|
-
const t2 = this;
|
|
3464
|
-
return t2.istate ? t2.istate.inflateSync(t2) : e$1;
|
|
3465
|
-
}, inflateSetDictionary(t2, n2) {
|
|
3466
|
-
const i2 = this;
|
|
3467
|
-
return i2.istate ? i2.istate.inflateSetDictionary(i2, t2, n2) : e$1;
|
|
3468
|
-
}, read_byte(e2) {
|
|
3469
|
-
return this.next_in[e2];
|
|
3470
|
-
}, read_buf(e2, t2) {
|
|
3471
|
-
return this.next_in.subarray(e2, e2 + t2);
|
|
3472
|
-
} };
|
|
3473
|
-
const g$1 = 4294967295, y$1 = 65535, x$1 = 33639248, k$1 = 101075792, v$1 = 22, S = void 0, z$1 = "undefined", A$1 = "function";
|
|
3474
|
-
let U$1 = class U {
|
|
3475
|
-
constructor(e2) {
|
|
3476
|
-
return class extends TransformStream {
|
|
3477
|
-
constructor(t2, n2) {
|
|
3478
|
-
const i2 = new e2(n2);
|
|
3479
|
-
super({ transform(e3, t3) {
|
|
3480
|
-
t3.enqueue(i2.append(e3));
|
|
3481
|
-
}, flush(e3) {
|
|
3482
|
-
const t3 = i2.flush();
|
|
3483
|
-
t3 && e3.enqueue(t3);
|
|
3484
|
-
} });
|
|
3485
|
-
}
|
|
3486
|
-
};
|
|
3487
|
-
}
|
|
3488
|
-
};
|
|
3489
|
-
let D = 2;
|
|
3077
|
+
const e$1 = 4294967295, t$1 = 65535, r$1 = 134695760, n$1 = r$1, s$1 = 33639248, a$1 = 101075792, i$1 = 22, o$1 = 16384, c$1 = void 0, l$1 = 1 / 0, u$1 = "undefined", d$1 = "function";
|
|
3078
|
+
let f$1 = 2;
|
|
3490
3079
|
try {
|
|
3491
|
-
typeof navigator !=
|
|
3492
|
-
} catch
|
|
3080
|
+
typeof navigator != u$1 && navigator.hardwareConcurrency && (f$1 = navigator.hardwareConcurrency);
|
|
3081
|
+
} catch {
|
|
3493
3082
|
}
|
|
3494
|
-
const
|
|
3495
|
-
function
|
|
3496
|
-
const {
|
|
3497
|
-
|
|
3498
|
-
const { deflate: e3, inflate: t3 } = d;
|
|
3499
|
-
if ((e3 || t3) && (T$1.workerScripts || (T$1.workerScripts = {})), e3) {
|
|
3500
|
-
if (!Array.isArray(e3)) throw new Error("workerScripts.deflate must be an array");
|
|
3501
|
-
T$1.workerScripts.deflate = e3;
|
|
3502
|
-
}
|
|
3503
|
-
if (t3) {
|
|
3504
|
-
if (!Array.isArray(t3)) throw new Error("workerScripts.inflate must be an array");
|
|
3505
|
-
T$1.workerScripts.inflate = t3;
|
|
3506
|
-
}
|
|
3507
|
-
}
|
|
3083
|
+
const h$1 = { workerURI: "./core/web-worker-wasm.js", wasmURI: "./core/streams/zlib-wasm/zlib-streams.wasm", chunkSize: 65536, maxWorkers: f$1, terminateWorkerTimeout: 5e3, useWebWorkers: true, useCompressionStream: true, CompressionStream: typeof CompressionStream != u$1 && CompressionStream, DecompressionStream: typeof DecompressionStream != u$1 && DecompressionStream }, p$1 = Object.assign({}, h$1);
|
|
3084
|
+
function w$1(e2) {
|
|
3085
|
+
const { baseURI: t2, chunkSize: r2, maxWorkers: n2, terminateWorkerTimeout: s2, useCompressionStream: a2, useWebWorkers: i2, CompressionStream: o2, DecompressionStream: c, CompressionStreamZlib: l2, DecompressionStreamZlib: u, workerURI: d, wasmURI: f2 } = e2;
|
|
3086
|
+
g$1("baseURI", t2), g$1("wasmURI", f2), g$1("workerURI", d), g$1("chunkSize", r2), g$1("maxWorkers", n2), g$1("terminateWorkerTimeout", s2), g$1("useCompressionStream", a2), g$1("useWebWorkers", i2), g$1("CompressionStream", o2), g$1("DecompressionStream", c), g$1("CompressionStreamZlib", l2), g$1("DecompressionStreamZlib", u);
|
|
3508
3087
|
}
|
|
3509
|
-
function
|
|
3510
|
-
t2 !==
|
|
3088
|
+
function g$1(e2, t2) {
|
|
3089
|
+
t2 !== c$1 && (p$1[e2] = t2);
|
|
3511
3090
|
}
|
|
3512
|
-
const
|
|
3091
|
+
const m$1 = [];
|
|
3513
3092
|
for (let e2 = 0; e2 < 256; e2++) {
|
|
3514
3093
|
let t2 = e2;
|
|
3515
3094
|
for (let e3 = 0; e3 < 8; e3++) 1 & t2 ? t2 = t2 >>> 1 ^ 3988292384 : t2 >>>= 1;
|
|
3516
|
-
|
|
3095
|
+
m$1[e2] = t2;
|
|
3517
3096
|
}
|
|
3518
|
-
class
|
|
3097
|
+
let y$1 = class y {
|
|
3519
3098
|
constructor(e2) {
|
|
3520
3099
|
this.crc = e2 || -1;
|
|
3521
3100
|
}
|
|
3522
3101
|
append(e2) {
|
|
3523
3102
|
let t2 = 0 | this.crc;
|
|
3524
|
-
for (let
|
|
3103
|
+
for (let r2 = 0, n2 = 0 | e2.length; r2 < n2; r2++) t2 = t2 >>> 8 ^ m$1[255 & (t2 ^ e2[r2])];
|
|
3525
3104
|
this.crc = t2;
|
|
3526
3105
|
}
|
|
3527
3106
|
get() {
|
|
3528
3107
|
return ~this.crc;
|
|
3529
3108
|
}
|
|
3530
|
-
}
|
|
3531
|
-
class
|
|
3109
|
+
};
|
|
3110
|
+
let b$1 = class b extends TransformStream {
|
|
3532
3111
|
constructor() {
|
|
3533
3112
|
let e2;
|
|
3534
|
-
const t2 = new
|
|
3535
|
-
super({ transform(e3,
|
|
3536
|
-
t2.append(e3),
|
|
3113
|
+
const t2 = new y$1();
|
|
3114
|
+
super({ transform(e3, r2) {
|
|
3115
|
+
t2.append(e3), r2.enqueue(e3);
|
|
3537
3116
|
}, flush() {
|
|
3538
|
-
const
|
|
3539
|
-
new DataView(
|
|
3117
|
+
const r2 = new Uint8Array(4);
|
|
3118
|
+
new DataView(r2.buffer).setUint32(0, t2.get()), e2.value = r2;
|
|
3540
3119
|
} }), e2 = this;
|
|
3541
3120
|
}
|
|
3542
|
-
}
|
|
3543
|
-
const
|
|
3121
|
+
};
|
|
3122
|
+
const S = { concat(e2, t2) {
|
|
3544
3123
|
if (0 === e2.length || 0 === t2.length) return e2.concat(t2);
|
|
3545
|
-
const
|
|
3546
|
-
return 32 ===
|
|
3124
|
+
const r2 = e2[e2.length - 1], n2 = S.getPartial(r2);
|
|
3125
|
+
return 32 === n2 ? e2.concat(t2) : S._shiftRight(t2, n2, 0 | r2, e2.slice(0, e2.length - 1));
|
|
3547
3126
|
}, bitLength(e2) {
|
|
3548
3127
|
const t2 = e2.length;
|
|
3549
3128
|
if (0 === t2) return 0;
|
|
3550
|
-
const
|
|
3551
|
-
return 32 * (t2 - 1) +
|
|
3129
|
+
const r2 = e2[t2 - 1];
|
|
3130
|
+
return 32 * (t2 - 1) + S.getPartial(r2);
|
|
3552
3131
|
}, clamp(e2, t2) {
|
|
3553
3132
|
if (32 * e2.length < t2) return e2;
|
|
3554
|
-
const
|
|
3555
|
-
return t2 &= 31,
|
|
3556
|
-
}, partial: (e2, t2,
|
|
3557
|
-
for (void 0 ===
|
|
3558
|
-
if (0 === t2) return
|
|
3559
|
-
for (let
|
|
3560
|
-
const
|
|
3561
|
-
return
|
|
3562
|
-
} },
|
|
3563
|
-
const t2 =
|
|
3564
|
-
let
|
|
3565
|
-
for (let
|
|
3566
|
-
return
|
|
3133
|
+
const r2 = (e2 = e2.slice(0, Math.ceil(t2 / 32))).length;
|
|
3134
|
+
return t2 &= 31, r2 > 0 && t2 && (e2[r2 - 1] = S.partial(t2, e2[r2 - 1] & 2147483648 >> t2 - 1, 1)), e2;
|
|
3135
|
+
}, partial: (e2, t2, r2) => 32 === e2 ? t2 : (r2 ? 0 | t2 : t2 << 32 - e2) + 1099511627776 * e2, getPartial: (e2) => Math.round(e2 / 1099511627776) || 32, _shiftRight(e2, t2, r2, n2) {
|
|
3136
|
+
for (void 0 === n2 && (n2 = []); t2 >= 32; t2 -= 32) n2.push(r2), r2 = 0;
|
|
3137
|
+
if (0 === t2) return n2.concat(e2);
|
|
3138
|
+
for (let s3 = 0; s3 < e2.length; s3++) n2.push(r2 | e2[s3] >>> t2), r2 = e2[s3] << 32 - t2;
|
|
3139
|
+
const s2 = e2.length ? e2[e2.length - 1] : 0, a2 = S.getPartial(s2);
|
|
3140
|
+
return n2.push(S.partial(t2 + a2 & 31, t2 + a2 > 32 ? r2 : n2.pop(), 1)), n2;
|
|
3141
|
+
} }, k$1 = { bytes: { fromBits(e2) {
|
|
3142
|
+
const t2 = S.bitLength(e2) / 8, r2 = new Uint8Array(t2);
|
|
3143
|
+
let n2;
|
|
3144
|
+
for (let s2 = 0; s2 < t2; s2++) 3 & s2 || (n2 = e2[s2 / 4]), r2[s2] = n2 >>> 24, n2 <<= 8;
|
|
3145
|
+
return r2;
|
|
3567
3146
|
}, toBits(e2) {
|
|
3568
3147
|
const t2 = [];
|
|
3569
|
-
let
|
|
3570
|
-
for (
|
|
3571
|
-
return 3 &
|
|
3572
|
-
} } },
|
|
3148
|
+
let r2, n2 = 0;
|
|
3149
|
+
for (r2 = 0; r2 < e2.length; r2++) n2 = n2 << 8 | e2[r2], 3 & ~r2 || (t2.push(n2), n2 = 0);
|
|
3150
|
+
return 3 & r2 && t2.push(S.partial(8 * (3 & r2), n2)), t2;
|
|
3151
|
+
} } }, z$1 = { sha1: class {
|
|
3573
3152
|
constructor(e2) {
|
|
3574
3153
|
const t2 = this;
|
|
3575
3154
|
t2.blockSize = 512, t2._init = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], t2._key = [1518500249, 1859775393, 2400959708, 3395469782], e2 ? (t2._h = e2._h.slice(0), t2._buffer = e2._buffer.slice(0), t2._length = e2._length) : t2.reset();
|
|
@@ -3580,54 +3159,54 @@ const M = { concat(e2, t2) {
|
|
|
3580
3159
|
}
|
|
3581
3160
|
update(e2) {
|
|
3582
3161
|
const t2 = this;
|
|
3583
|
-
"string" == typeof e2 && (e2 =
|
|
3584
|
-
const
|
|
3585
|
-
if (
|
|
3586
|
-
const a2 = new Uint32Array(
|
|
3587
|
-
let
|
|
3588
|
-
for (let e3 = t2.blockSize +
|
|
3589
|
-
return
|
|
3162
|
+
"string" == typeof e2 && (e2 = k$1.utf8String.toBits(e2));
|
|
3163
|
+
const r2 = t2._buffer = S.concat(t2._buffer, e2), n2 = t2._length, s2 = t2._length = n2 + S.bitLength(e2);
|
|
3164
|
+
if (s2 > 9007199254740991) throw new Error("Cannot hash more than 2^53 - 1 bits");
|
|
3165
|
+
const a2 = new Uint32Array(r2);
|
|
3166
|
+
let i2 = 0;
|
|
3167
|
+
for (let e3 = t2.blockSize + n2 - (t2.blockSize + n2 & t2.blockSize - 1); e3 <= s2; e3 += t2.blockSize) t2._block(a2.subarray(16 * i2, 16 * (i2 + 1))), i2 += 1;
|
|
3168
|
+
return r2.splice(0, 16 * i2), t2;
|
|
3590
3169
|
}
|
|
3591
3170
|
finalize() {
|
|
3592
3171
|
const e2 = this;
|
|
3593
3172
|
let t2 = e2._buffer;
|
|
3594
|
-
const
|
|
3595
|
-
t2 =
|
|
3173
|
+
const r2 = e2._h;
|
|
3174
|
+
t2 = S.concat(t2, [S.partial(1, 1)]);
|
|
3596
3175
|
for (let e3 = t2.length + 2; 15 & e3; e3++) t2.push(0);
|
|
3597
3176
|
for (t2.push(Math.floor(e2._length / 4294967296)), t2.push(0 | e2._length); t2.length; ) e2._block(t2.splice(0, 16));
|
|
3598
|
-
return e2.reset(),
|
|
3177
|
+
return e2.reset(), r2;
|
|
3599
3178
|
}
|
|
3600
|
-
_f(e2, t2,
|
|
3601
|
-
return e2 <= 19 ? t2 &
|
|
3179
|
+
_f(e2, t2, r2, n2) {
|
|
3180
|
+
return e2 <= 19 ? t2 & r2 | ~t2 & n2 : e2 <= 39 ? t2 ^ r2 ^ n2 : e2 <= 59 ? t2 & r2 | t2 & n2 | r2 & n2 : e2 <= 79 ? t2 ^ r2 ^ n2 : void 0;
|
|
3602
3181
|
}
|
|
3603
3182
|
_S(e2, t2) {
|
|
3604
3183
|
return t2 << e2 | t2 >>> 32 - e2;
|
|
3605
3184
|
}
|
|
3606
3185
|
_block(e2) {
|
|
3607
|
-
const t2 = this,
|
|
3608
|
-
for (let t3 = 0; t3 < 16; t3++)
|
|
3609
|
-
let
|
|
3186
|
+
const t2 = this, r2 = t2._h, n2 = Array(80);
|
|
3187
|
+
for (let t3 = 0; t3 < 16; t3++) n2[t3] = e2[t3];
|
|
3188
|
+
let s2 = r2[0], a2 = r2[1], i2 = r2[2], o2 = r2[3], c = r2[4];
|
|
3610
3189
|
for (let e3 = 0; e3 <= 79; e3++) {
|
|
3611
|
-
e3 >= 16 && (
|
|
3612
|
-
const
|
|
3613
|
-
|
|
3190
|
+
e3 >= 16 && (n2[e3] = t2._S(1, n2[e3 - 3] ^ n2[e3 - 8] ^ n2[e3 - 14] ^ n2[e3 - 16]));
|
|
3191
|
+
const r3 = t2._S(5, s2) + t2._f(e3, a2, i2, o2) + c + n2[e3] + t2._key[Math.floor(e3 / 20)] | 0;
|
|
3192
|
+
c = o2, o2 = i2, i2 = t2._S(30, a2), a2 = s2, s2 = r3;
|
|
3614
3193
|
}
|
|
3615
|
-
|
|
3194
|
+
r2[0] = r2[0] + s2 | 0, r2[1] = r2[1] + a2 | 0, r2[2] = r2[2] + i2 | 0, r2[3] = r2[3] + o2 | 0, r2[4] = r2[4] + c | 0;
|
|
3616
3195
|
}
|
|
3617
|
-
} },
|
|
3196
|
+
} }, x$1 = { aes: class {
|
|
3618
3197
|
constructor(e2) {
|
|
3619
3198
|
const t2 = this;
|
|
3620
3199
|
t2._tables = [[[], [], [], [], []], [[], [], [], [], []]], t2._tables[0][0][0] || t2._precompute();
|
|
3621
|
-
const
|
|
3622
|
-
let a2,
|
|
3623
|
-
if (4 !==
|
|
3624
|
-
for (t2._key = [
|
|
3625
|
-
let e3 =
|
|
3626
|
-
(a2 %
|
|
3200
|
+
const r2 = t2._tables[0][4], n2 = t2._tables[1], s2 = e2.length;
|
|
3201
|
+
let a2, i2, o2, c = 1;
|
|
3202
|
+
if (4 !== s2 && 6 !== s2 && 8 !== s2) throw new Error("invalid aes key size");
|
|
3203
|
+
for (t2._key = [i2 = e2.slice(0), o2 = []], a2 = s2; a2 < 4 * s2 + 28; a2++) {
|
|
3204
|
+
let e3 = i2[a2 - 1];
|
|
3205
|
+
(a2 % s2 === 0 || 8 === s2 && a2 % s2 === 4) && (e3 = r2[e3 >>> 24] << 24 ^ r2[e3 >> 16 & 255] << 16 ^ r2[e3 >> 8 & 255] << 8 ^ r2[255 & e3], a2 % s2 === 0 && (e3 = e3 << 8 ^ e3 >>> 24 ^ c << 24, c = c << 1 ^ 283 * (c >> 7))), i2[a2] = i2[a2 - s2] ^ e3;
|
|
3627
3206
|
}
|
|
3628
3207
|
for (let e3 = 0; a2; e3++, a2--) {
|
|
3629
|
-
const t3 =
|
|
3630
|
-
o2[e3] = a2 <= 4 || e3 < 4 ? t3 :
|
|
3208
|
+
const t3 = i2[3 & e3 ? a2 : a2 - 4];
|
|
3209
|
+
o2[e3] = a2 <= 4 || e3 < 4 ? t3 : n2[0][r2[t3 >>> 24]] ^ n2[1][r2[t3 >> 16 & 255]] ^ n2[2][r2[t3 >> 8 & 255]] ^ n2[3][r2[255 & t3]];
|
|
3631
3210
|
}
|
|
3632
3211
|
}
|
|
3633
3212
|
encrypt(e2) {
|
|
@@ -3637,40 +3216,40 @@ const M = { concat(e2, t2) {
|
|
|
3637
3216
|
return this._crypt(e2, 1);
|
|
3638
3217
|
}
|
|
3639
3218
|
_precompute() {
|
|
3640
|
-
const e2 = this._tables[0], t2 = this._tables[1],
|
|
3641
|
-
let
|
|
3642
|
-
for (let e3 = 0; e3 < 256; e3++) a2[(
|
|
3643
|
-
for (let u =
|
|
3644
|
-
let a3 =
|
|
3645
|
-
a3 = a3 >> 8 ^ 255 & a3 ^ 99,
|
|
3646
|
-
let d = 16843009 *
|
|
3647
|
-
for (let
|
|
3219
|
+
const e2 = this._tables[0], t2 = this._tables[1], r2 = e2[4], n2 = t2[4], s2 = [], a2 = [];
|
|
3220
|
+
let i2, o2, c, l2;
|
|
3221
|
+
for (let e3 = 0; e3 < 256; e3++) a2[(s2[e3] = e3 << 1 ^ 283 * (e3 >> 7)) ^ e3] = e3;
|
|
3222
|
+
for (let u = i2 = 0; !r2[u]; u ^= o2 || 1, i2 = a2[i2] || 1) {
|
|
3223
|
+
let a3 = i2 ^ i2 << 1 ^ i2 << 2 ^ i2 << 3 ^ i2 << 4;
|
|
3224
|
+
a3 = a3 >> 8 ^ 255 & a3 ^ 99, r2[u] = a3, n2[a3] = u, l2 = s2[c = s2[o2 = s2[u]]];
|
|
3225
|
+
let d = 16843009 * l2 ^ 65537 * c ^ 257 * o2 ^ 16843008 * u, f2 = 257 * s2[a3] ^ 16843008 * a3;
|
|
3226
|
+
for (let r3 = 0; r3 < 4; r3++) e2[r3][u] = f2 = f2 << 24 ^ f2 >>> 8, t2[r3][a3] = d = d << 24 ^ d >>> 8;
|
|
3648
3227
|
}
|
|
3649
|
-
for (let
|
|
3228
|
+
for (let r3 = 0; r3 < 5; r3++) e2[r3] = e2[r3].slice(0), t2[r3] = t2[r3].slice(0);
|
|
3650
3229
|
}
|
|
3651
3230
|
_crypt(e2, t2) {
|
|
3652
3231
|
if (4 !== e2.length) throw new Error("invalid aes block size");
|
|
3653
|
-
const
|
|
3654
|
-
let d, f2, h2,
|
|
3655
|
-
for (let e3 = 0; e3 <
|
|
3656
|
-
for (let e3 = 0; e3 < 4; e3++)
|
|
3657
|
-
return
|
|
3658
|
-
}
|
|
3659
|
-
} },
|
|
3660
|
-
const t2 = new Uint32Array(e2.buffer),
|
|
3232
|
+
const r2 = this._key[t2], n2 = r2.length / 4 - 2, s2 = [0, 0, 0, 0], a2 = this._tables[t2], i2 = a2[0], o2 = a2[1], c = a2[2], l2 = a2[3], u = a2[4];
|
|
3233
|
+
let d, f2, h2, p2 = e2[0] ^ r2[0], w = e2[t2 ? 3 : 1] ^ r2[1], g2 = e2[2] ^ r2[2], m2 = e2[t2 ? 1 : 3] ^ r2[3], y3 = 4;
|
|
3234
|
+
for (let e3 = 0; e3 < n2; e3++) d = i2[p2 >>> 24] ^ o2[w >> 16 & 255] ^ c[g2 >> 8 & 255] ^ l2[255 & m2] ^ r2[y3], f2 = i2[w >>> 24] ^ o2[g2 >> 16 & 255] ^ c[m2 >> 8 & 255] ^ l2[255 & p2] ^ r2[y3 + 1], h2 = i2[g2 >>> 24] ^ o2[m2 >> 16 & 255] ^ c[p2 >> 8 & 255] ^ l2[255 & w] ^ r2[y3 + 2], m2 = i2[m2 >>> 24] ^ o2[p2 >> 16 & 255] ^ c[w >> 8 & 255] ^ l2[255 & g2] ^ r2[y3 + 3], y3 += 4, p2 = d, w = f2, g2 = h2;
|
|
3235
|
+
for (let e3 = 0; e3 < 4; e3++) s2[t2 ? 3 & -e3 : e3] = u[p2 >>> 24] << 24 ^ u[w >> 16 & 255] << 16 ^ u[g2 >> 8 & 255] << 8 ^ u[255 & m2] ^ r2[y3++], d = p2, p2 = w, w = g2, g2 = m2, m2 = d;
|
|
3236
|
+
return s2;
|
|
3237
|
+
}
|
|
3238
|
+
} }, U$1 = { getRandomValues(e2) {
|
|
3239
|
+
const t2 = new Uint32Array(e2.buffer), r2 = (e3) => {
|
|
3661
3240
|
let t3 = 987654321;
|
|
3662
|
-
const
|
|
3241
|
+
const r3 = 4294967295;
|
|
3663
3242
|
return function() {
|
|
3664
|
-
t3 = 36969 * (65535 & t3) + (t3 >> 16) &
|
|
3665
|
-
return (((t3 << 16) + (e3 = 18e3 * (65535 & e3) + (e3 >> 16) &
|
|
3243
|
+
t3 = 36969 * (65535 & t3) + (t3 >> 16) & r3;
|
|
3244
|
+
return (((t3 << 16) + (e3 = 18e3 * (65535 & e3) + (e3 >> 16) & r3) & r3) / 4294967296 + 0.5) * (Math.random() > 0.5 ? 1 : -1);
|
|
3666
3245
|
};
|
|
3667
3246
|
};
|
|
3668
|
-
for (let
|
|
3669
|
-
const e3 =
|
|
3670
|
-
|
|
3247
|
+
for (let n2, s2 = 0; s2 < e2.length; s2 += 4) {
|
|
3248
|
+
const e3 = r2(4294967296 * (n2 || Math.random()));
|
|
3249
|
+
n2 = 987654071 * e3(), t2[s2 / 4] = 4294967296 * e3() | 0;
|
|
3671
3250
|
}
|
|
3672
3251
|
return e2;
|
|
3673
|
-
} },
|
|
3252
|
+
} }, A$1 = { ctrGladman: class {
|
|
3674
3253
|
constructor(e2, t2) {
|
|
3675
3254
|
this._prf = e2, this._initIv = t2, this._iv = t2;
|
|
3676
3255
|
}
|
|
@@ -3683,45 +3262,45 @@ const M = { concat(e2, t2) {
|
|
|
3683
3262
|
incWord(e2) {
|
|
3684
3263
|
if (255 & ~(e2 >> 24)) e2 += 1 << 24;
|
|
3685
3264
|
else {
|
|
3686
|
-
let t2 = e2 >> 16 & 255,
|
|
3687
|
-
255 === t2 ? (t2 = 0, 255 ===
|
|
3265
|
+
let t2 = e2 >> 16 & 255, r2 = e2 >> 8 & 255, n2 = 255 & e2;
|
|
3266
|
+
255 === t2 ? (t2 = 0, 255 === r2 ? (r2 = 0, 255 === n2 ? n2 = 0 : ++n2) : ++r2) : ++t2, e2 = 0, e2 += t2 << 16, e2 += r2 << 8, e2 += n2;
|
|
3688
3267
|
}
|
|
3689
3268
|
return e2;
|
|
3690
3269
|
}
|
|
3691
3270
|
incCounter(e2) {
|
|
3692
3271
|
0 === (e2[0] = this.incWord(e2[0])) && (e2[1] = this.incWord(e2[1]));
|
|
3693
3272
|
}
|
|
3694
|
-
calculate(e2, t2,
|
|
3695
|
-
let
|
|
3696
|
-
if (!(
|
|
3697
|
-
const
|
|
3698
|
-
for (let
|
|
3699
|
-
this.incCounter(
|
|
3700
|
-
const
|
|
3701
|
-
t2[
|
|
3702
|
-
}
|
|
3703
|
-
return
|
|
3704
|
-
}
|
|
3705
|
-
} },
|
|
3706
|
-
if (
|
|
3707
|
-
const
|
|
3708
|
-
let a2,
|
|
3709
|
-
const u = new ArrayBuffer(
|
|
3273
|
+
calculate(e2, t2, r2) {
|
|
3274
|
+
let n2;
|
|
3275
|
+
if (!(n2 = t2.length)) return [];
|
|
3276
|
+
const s2 = S.bitLength(t2);
|
|
3277
|
+
for (let s3 = 0; s3 < n2; s3 += 4) {
|
|
3278
|
+
this.incCounter(r2);
|
|
3279
|
+
const n3 = e2.encrypt(r2);
|
|
3280
|
+
t2[s3] ^= n3[0], t2[s3 + 1] ^= n3[1], t2[s3 + 2] ^= n3[2], t2[s3 + 3] ^= n3[3];
|
|
3281
|
+
}
|
|
3282
|
+
return S.clamp(t2, s2);
|
|
3283
|
+
}
|
|
3284
|
+
} }, v$1 = { importKey: (e2) => new v$1.hmacSha1(k$1.bytes.toBits(e2)), pbkdf2(e2, t2, r2, n2) {
|
|
3285
|
+
if (r2 = r2 || 1e4, n2 < 0 || r2 < 0) throw new Error("invalid params to pbkdf2");
|
|
3286
|
+
const s2 = 1 + (n2 >> 5) << 2;
|
|
3287
|
+
let a2, i2, o2, c, l2;
|
|
3288
|
+
const u = new ArrayBuffer(s2), d = new DataView(u);
|
|
3710
3289
|
let f2 = 0;
|
|
3711
|
-
const h2 =
|
|
3712
|
-
for (t2 =
|
|
3713
|
-
for (a2 =
|
|
3714
|
-
for (o2 = 0; f2 < (
|
|
3290
|
+
const h2 = S;
|
|
3291
|
+
for (t2 = k$1.bytes.toBits(t2), l2 = 1; f2 < (s2 || 1); l2++) {
|
|
3292
|
+
for (a2 = i2 = e2.encrypt(h2.concat(t2, [l2])), o2 = 1; o2 < r2; o2++) for (i2 = e2.encrypt(i2), c = 0; c < i2.length; c++) a2[c] ^= i2[c];
|
|
3293
|
+
for (o2 = 0; f2 < (s2 || 1) && o2 < a2.length; o2++) d.setInt32(f2, a2[o2]), f2 += 4;
|
|
3715
3294
|
}
|
|
3716
|
-
return u.slice(0,
|
|
3295
|
+
return u.slice(0, n2 / 8);
|
|
3717
3296
|
}, hmacSha1: class {
|
|
3718
3297
|
constructor(e2) {
|
|
3719
|
-
const t2 = this,
|
|
3720
|
-
t2._baseHash = [new
|
|
3721
|
-
const
|
|
3722
|
-
e2.length >
|
|
3723
|
-
for (let t3 = 0; t3 <
|
|
3724
|
-
t2._baseHash[0].update(
|
|
3298
|
+
const t2 = this, r2 = t2._hash = z$1.sha1, n2 = [[], []];
|
|
3299
|
+
t2._baseHash = [new r2(), new r2()];
|
|
3300
|
+
const s2 = t2._baseHash[0].blockSize / 32;
|
|
3301
|
+
e2.length > s2 && (e2 = new r2().update(e2).finalize());
|
|
3302
|
+
for (let t3 = 0; t3 < s2; t3++) n2[0][t3] = 909522486 ^ e2[t3], n2[1][t3] = 1549556828 ^ e2[t3];
|
|
3303
|
+
t2._baseHash[0].update(n2[0]), t2._baseHash[1].update(n2[1]), t2._resultHash = new r2(t2._baseHash[0]);
|
|
3725
3304
|
}
|
|
3726
3305
|
reset() {
|
|
3727
3306
|
const e2 = this;
|
|
@@ -3731,449 +3310,470 @@ const M = { concat(e2, t2) {
|
|
|
3731
3310
|
this._updated = true, this._resultHash.update(e2);
|
|
3732
3311
|
}
|
|
3733
3312
|
digest() {
|
|
3734
|
-
const e2 = this, t2 = e2._resultHash.finalize(),
|
|
3735
|
-
return e2.reset(),
|
|
3313
|
+
const e2 = this, t2 = e2._resultHash.finalize(), r2 = new e2._hash(e2._baseHash[1]).update(t2).finalize();
|
|
3314
|
+
return e2.reset(), r2;
|
|
3736
3315
|
}
|
|
3737
3316
|
encrypt(e2) {
|
|
3738
3317
|
if (this._updated) throw new Error("encrypt on already updated hmac called!");
|
|
3739
3318
|
return this.update(e2), this.digest(e2);
|
|
3740
3319
|
}
|
|
3741
|
-
} },
|
|
3742
|
-
function
|
|
3743
|
-
return
|
|
3320
|
+
} }, D$1 = typeof crypto != u$1 && typeof crypto.getRandomValues == d$1, _ = "Invalid password", F = "Invalid signature", O = "zipjs-abort-check-password";
|
|
3321
|
+
function E$1(e2) {
|
|
3322
|
+
return D$1 ? crypto.getRandomValues(e2) : U$1.getRandomValues(e2);
|
|
3744
3323
|
}
|
|
3745
|
-
const
|
|
3746
|
-
let
|
|
3747
|
-
class
|
|
3748
|
-
constructor({ password: e2, rawPassword: t2, signed:
|
|
3324
|
+
const T$1 = 16, C = { name: "PBKDF2" }, R = Object.assign({ hash: { name: "HMAC" } }, C), W = Object.assign({ iterations: 1e3, hash: { name: "SHA-1" } }, C), M = ["deriveBits"], j = [8, 12, 16], I = [16, 24, 32], B = 10, P = [0, 0, 0, 0], L = typeof crypto != u$1, V = L && crypto.subtle, N = L && typeof V != u$1, Z = k$1.bytes, q = x$1.aes, H = A$1.ctrGladman, K = v$1.hmacSha1;
|
|
3325
|
+
let G = L && N && typeof V.importKey == d$1, J = L && N && typeof V.deriveBits == d$1;
|
|
3326
|
+
class Q extends TransformStream {
|
|
3327
|
+
constructor({ password: e2, rawPassword: t2, signed: r2, encryptionStrength: n2, checkPasswordOnly: s2 }) {
|
|
3749
3328
|
super({ start() {
|
|
3750
|
-
Object.assign(this, { ready: new Promise((
|
|
3329
|
+
Object.assign(this, { ready: new Promise((e3) => this.resolveReady = e3), password: ee(e2, t2), signed: r2, strength: n2 - 1, pending: new Uint8Array() });
|
|
3751
3330
|
}, async transform(e3, t3) {
|
|
3752
|
-
const
|
|
3753
|
-
|
|
3754
|
-
const
|
|
3755
|
-
if (
|
|
3756
|
-
})(
|
|
3757
|
-
const
|
|
3758
|
-
t3.enqueue(
|
|
3331
|
+
const r3 = this, { password: n3, strength: a2, resolveReady: i2, ready: o2 } = r3;
|
|
3332
|
+
n3 ? (await (async function(e4, t4, r4, n4) {
|
|
3333
|
+
const s3 = await $(e4, t4, r4, re(n4, 0, j[t4])), a3 = re(n4, j[t4]);
|
|
3334
|
+
if (s3[0] != a3[0] || s3[1] != a3[1]) throw new Error(_);
|
|
3335
|
+
})(r3, a2, n3, re(e3, 0, j[a2] + 2)), e3 = re(e3, j[a2] + 2), s2 ? t3.error(new Error(O)) : i2()) : await o2;
|
|
3336
|
+
const c = new Uint8Array(e3.length - B - (e3.length - B) % T$1);
|
|
3337
|
+
t3.enqueue(Y(r3, e3, c, 0, B, true));
|
|
3759
3338
|
}, async flush(e3) {
|
|
3760
|
-
const { signed: t3, ctr:
|
|
3761
|
-
if (
|
|
3339
|
+
const { signed: t3, ctr: r3, hmac: n3, pending: s3, ready: a2 } = this;
|
|
3340
|
+
if (n3 && r3) {
|
|
3762
3341
|
await a2;
|
|
3763
|
-
const
|
|
3764
|
-
let
|
|
3765
|
-
if (
|
|
3766
|
-
const e4 =
|
|
3767
|
-
|
|
3768
|
-
const t4 =
|
|
3769
|
-
|
|
3342
|
+
const i2 = re(s3, 0, s3.length - B), o2 = re(s3, s3.length - B);
|
|
3343
|
+
let c = new Uint8Array();
|
|
3344
|
+
if (i2.length) {
|
|
3345
|
+
const e4 = se(Z, i2);
|
|
3346
|
+
n3.update(e4);
|
|
3347
|
+
const t4 = r3.update(e4);
|
|
3348
|
+
c = ne(Z, t4);
|
|
3770
3349
|
}
|
|
3771
3350
|
if (t3) {
|
|
3772
|
-
const e4 =
|
|
3773
|
-
for (let t4 = 0; t4 <
|
|
3351
|
+
const e4 = re(ne(Z, n3.digest()), 0, B);
|
|
3352
|
+
for (let t4 = 0; t4 < B; t4++) if (e4[t4] != o2[t4]) throw new Error(F);
|
|
3774
3353
|
}
|
|
3775
|
-
e3.enqueue(
|
|
3354
|
+
e3.enqueue(c);
|
|
3776
3355
|
}
|
|
3777
3356
|
} });
|
|
3778
3357
|
}
|
|
3779
3358
|
}
|
|
3780
|
-
class
|
|
3781
|
-
constructor({ password: e2, rawPassword: t2, encryptionStrength:
|
|
3782
|
-
let
|
|
3359
|
+
class X extends TransformStream {
|
|
3360
|
+
constructor({ password: e2, rawPassword: t2, encryptionStrength: r2 }) {
|
|
3361
|
+
let n2;
|
|
3783
3362
|
super({ start() {
|
|
3784
|
-
Object.assign(this, { ready: new Promise((
|
|
3363
|
+
Object.assign(this, { ready: new Promise((e3) => this.resolveReady = e3), password: ee(e2, t2), strength: r2 - 1, pending: new Uint8Array() });
|
|
3785
3364
|
}, async transform(e3, t3) {
|
|
3786
|
-
const
|
|
3365
|
+
const r3 = this, { password: n3, strength: s2, resolveReady: a2, ready: i2 } = r3;
|
|
3787
3366
|
let o2 = new Uint8Array();
|
|
3788
|
-
|
|
3789
|
-
const
|
|
3790
|
-
return
|
|
3791
|
-
})(
|
|
3792
|
-
const
|
|
3793
|
-
|
|
3367
|
+
n3 ? (o2 = await (async function(e4, t4, r4) {
|
|
3368
|
+
const n4 = E$1(new Uint8Array(j[t4])), s3 = await $(e4, t4, r4, n4);
|
|
3369
|
+
return te(n4, s3);
|
|
3370
|
+
})(r3, s2, n3), a2()) : await i2;
|
|
3371
|
+
const c = new Uint8Array(o2.length + e3.length - e3.length % T$1);
|
|
3372
|
+
c.set(o2, 0), t3.enqueue(Y(r3, e3, c, o2.length, 0));
|
|
3794
3373
|
}, async flush(e3) {
|
|
3795
|
-
const { ctr: t3, hmac:
|
|
3796
|
-
if (
|
|
3374
|
+
const { ctr: t3, hmac: r3, pending: s2, ready: a2 } = this;
|
|
3375
|
+
if (r3 && t3) {
|
|
3797
3376
|
await a2;
|
|
3798
|
-
let
|
|
3799
|
-
if (
|
|
3800
|
-
const e4 = t3.update(
|
|
3801
|
-
|
|
3377
|
+
let i2 = new Uint8Array();
|
|
3378
|
+
if (s2.length) {
|
|
3379
|
+
const e4 = t3.update(se(Z, s2));
|
|
3380
|
+
r3.update(e4), i2 = ne(Z, e4);
|
|
3802
3381
|
}
|
|
3803
|
-
|
|
3382
|
+
n2.signature = ne(Z, r3.digest()).slice(0, B), e3.enqueue(te(i2, n2.signature));
|
|
3804
3383
|
}
|
|
3805
|
-
} }),
|
|
3384
|
+
} }), n2 = this;
|
|
3806
3385
|
}
|
|
3807
3386
|
}
|
|
3808
|
-
function
|
|
3809
|
-
const { ctr:
|
|
3387
|
+
function Y(e2, t2, r2, n2, s2, a2) {
|
|
3388
|
+
const { ctr: i2, hmac: o2, pending: c } = e2, l2 = t2.length - s2;
|
|
3810
3389
|
let u;
|
|
3811
|
-
for (
|
|
3390
|
+
for (c.length && (t2 = te(c, t2), r2 = (function(e3, t3) {
|
|
3812
3391
|
if (t3 && t3 > e3.length) {
|
|
3813
|
-
const
|
|
3814
|
-
(e3 = new Uint8Array(t3)).set(
|
|
3392
|
+
const r3 = e3;
|
|
3393
|
+
(e3 = new Uint8Array(t3)).set(r3, 0);
|
|
3815
3394
|
}
|
|
3816
3395
|
return e3;
|
|
3817
|
-
})(
|
|
3818
|
-
const e3 =
|
|
3396
|
+
})(r2, l2 - l2 % T$1)), u = 0; u <= l2 - T$1; u += T$1) {
|
|
3397
|
+
const e3 = se(Z, re(t2, u, u + T$1));
|
|
3819
3398
|
a2 && o2.update(e3);
|
|
3820
|
-
const
|
|
3821
|
-
a2 || o2.update(
|
|
3399
|
+
const s3 = i2.update(e3);
|
|
3400
|
+
a2 || o2.update(s3), r2.set(ne(Z, s3), u + n2);
|
|
3822
3401
|
}
|
|
3823
|
-
return e2.pending =
|
|
3402
|
+
return e2.pending = re(t2, u), r2;
|
|
3824
3403
|
}
|
|
3825
|
-
async function
|
|
3404
|
+
async function $(e2, t2, r2, n2) {
|
|
3826
3405
|
e2.password = null;
|
|
3827
|
-
const
|
|
3828
|
-
if (!
|
|
3406
|
+
const s2 = await (async function(e3, t3, r3, n3, s3) {
|
|
3407
|
+
if (!G) return v$1.importKey(t3);
|
|
3829
3408
|
try {
|
|
3830
|
-
return await
|
|
3831
|
-
} catch
|
|
3832
|
-
return
|
|
3409
|
+
return await V.importKey(e3, t3, r3, n3, s3);
|
|
3410
|
+
} catch {
|
|
3411
|
+
return G = false, v$1.importKey(t3);
|
|
3833
3412
|
}
|
|
3834
|
-
})("raw",
|
|
3835
|
-
if (!
|
|
3413
|
+
})("raw", r2, R, false, M), a2 = await (async function(e3, t3, r3) {
|
|
3414
|
+
if (!J) return v$1.pbkdf2(t3, e3.salt, W.iterations, r3);
|
|
3836
3415
|
try {
|
|
3837
|
-
return await
|
|
3838
|
-
} catch
|
|
3839
|
-
return
|
|
3416
|
+
return await V.deriveBits(e3, t3, r3);
|
|
3417
|
+
} catch {
|
|
3418
|
+
return J = false, v$1.pbkdf2(t3, e3.salt, W.iterations, r3);
|
|
3840
3419
|
}
|
|
3841
|
-
})(Object.assign({ salt:
|
|
3842
|
-
return Object.assign(e2, { keys: { key: o2, authentication:
|
|
3420
|
+
})(Object.assign({ salt: n2 }, W), s2, 8 * (2 * I[t2] + 2)), i2 = new Uint8Array(a2), o2 = se(Z, re(i2, 0, I[t2])), c = se(Z, re(i2, I[t2], 2 * I[t2])), l2 = re(i2, 2 * I[t2]);
|
|
3421
|
+
return Object.assign(e2, { keys: { key: o2, authentication: c, passwordVerification: l2 }, ctr: new H(new q(o2), Array.from(P)), hmac: new K(c) }), l2;
|
|
3843
3422
|
}
|
|
3844
|
-
function
|
|
3845
|
-
return t2 ===
|
|
3846
|
-
if (typeof TextEncoder ==
|
|
3423
|
+
function ee(e2, t2) {
|
|
3424
|
+
return t2 === c$1 ? (function(e3) {
|
|
3425
|
+
if (typeof TextEncoder == u$1) {
|
|
3847
3426
|
e3 = unescape(encodeURIComponent(e3));
|
|
3848
3427
|
const t3 = new Uint8Array(e3.length);
|
|
3849
|
-
for (let
|
|
3428
|
+
for (let r2 = 0; r2 < t3.length; r2++) t3[r2] = e3.charCodeAt(r2);
|
|
3850
3429
|
return t3;
|
|
3851
3430
|
}
|
|
3852
3431
|
return new TextEncoder().encode(e3);
|
|
3853
3432
|
})(e2) : t2;
|
|
3854
3433
|
}
|
|
3855
|
-
function
|
|
3856
|
-
let
|
|
3857
|
-
return e2.length + t2.length && (
|
|
3434
|
+
function te(e2, t2) {
|
|
3435
|
+
let r2 = e2;
|
|
3436
|
+
return e2.length + t2.length && (r2 = new Uint8Array(e2.length + t2.length), r2.set(e2, 0), r2.set(t2, e2.length)), r2;
|
|
3858
3437
|
}
|
|
3859
|
-
function
|
|
3860
|
-
return e2.subarray(t2,
|
|
3438
|
+
function re(e2, t2, r2) {
|
|
3439
|
+
return e2.subarray(t2, r2);
|
|
3861
3440
|
}
|
|
3862
|
-
function
|
|
3441
|
+
function ne(e2, t2) {
|
|
3863
3442
|
return e2.fromBits(t2);
|
|
3864
3443
|
}
|
|
3865
|
-
function
|
|
3444
|
+
function se(e2, t2) {
|
|
3866
3445
|
return e2.toBits(t2);
|
|
3867
3446
|
}
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
constructor({ password: e2, passwordVerification: t2, checkPasswordOnly: n2 }) {
|
|
3447
|
+
class ae extends TransformStream {
|
|
3448
|
+
constructor({ password: e2, passwordVerification: t2, checkPasswordOnly: r2 }) {
|
|
3871
3449
|
super({ start() {
|
|
3872
|
-
Object.assign(this, { password: e2, passwordVerification: t2 }),
|
|
3450
|
+
Object.assign(this, { password: e2, passwordVerification: t2 }), le(this, e2);
|
|
3873
3451
|
}, transform(e3, t3) {
|
|
3874
|
-
const
|
|
3875
|
-
if (
|
|
3876
|
-
const t4 =
|
|
3877
|
-
if (
|
|
3878
|
-
e3 = e3.subarray(
|
|
3452
|
+
const n2 = this;
|
|
3453
|
+
if (n2.password) {
|
|
3454
|
+
const t4 = oe(n2, e3.subarray(0, 12));
|
|
3455
|
+
if (n2.password = null, t4.at(-1) != n2.passwordVerification) throw new Error(_);
|
|
3456
|
+
e3 = e3.subarray(12);
|
|
3879
3457
|
}
|
|
3880
|
-
|
|
3458
|
+
r2 ? t3.error(new Error(O)) : t3.enqueue(oe(n2, e3));
|
|
3881
3459
|
} });
|
|
3882
3460
|
}
|
|
3883
3461
|
}
|
|
3884
|
-
class
|
|
3462
|
+
class ie extends TransformStream {
|
|
3885
3463
|
constructor({ password: e2, passwordVerification: t2 }) {
|
|
3886
3464
|
super({ start() {
|
|
3887
|
-
Object.assign(this, { password: e2, passwordVerification: t2 }),
|
|
3465
|
+
Object.assign(this, { password: e2, passwordVerification: t2 }), le(this, e2);
|
|
3888
3466
|
}, transform(e3, t3) {
|
|
3889
|
-
const
|
|
3890
|
-
let
|
|
3891
|
-
if (
|
|
3892
|
-
|
|
3893
|
-
const t4 =
|
|
3894
|
-
t4[11] =
|
|
3895
|
-
} else
|
|
3896
|
-
|
|
3467
|
+
const r2 = this;
|
|
3468
|
+
let n2, s2;
|
|
3469
|
+
if (r2.password) {
|
|
3470
|
+
r2.password = null;
|
|
3471
|
+
const t4 = E$1(new Uint8Array(12));
|
|
3472
|
+
t4[11] = r2.passwordVerification, n2 = new Uint8Array(e3.length + t4.length), n2.set(ce(r2, t4), 0), s2 = 12;
|
|
3473
|
+
} else n2 = new Uint8Array(e3.length), s2 = 0;
|
|
3474
|
+
n2.set(ce(r2, e3), s2), t3.enqueue(n2);
|
|
3897
3475
|
} });
|
|
3898
3476
|
}
|
|
3899
3477
|
}
|
|
3900
|
-
function
|
|
3901
|
-
const
|
|
3902
|
-
for (let
|
|
3903
|
-
return
|
|
3478
|
+
function oe(e2, t2) {
|
|
3479
|
+
const r2 = new Uint8Array(t2.length);
|
|
3480
|
+
for (let n2 = 0; n2 < t2.length; n2++) r2[n2] = de(e2) ^ t2[n2], ue(e2, r2[n2]);
|
|
3481
|
+
return r2;
|
|
3904
3482
|
}
|
|
3905
|
-
function
|
|
3906
|
-
const
|
|
3907
|
-
for (let
|
|
3908
|
-
return
|
|
3483
|
+
function ce(e2, t2) {
|
|
3484
|
+
const r2 = new Uint8Array(t2.length);
|
|
3485
|
+
for (let n2 = 0; n2 < t2.length; n2++) r2[n2] = de(e2) ^ t2[n2], ue(e2, t2[n2]);
|
|
3486
|
+
return r2;
|
|
3909
3487
|
}
|
|
3910
|
-
function
|
|
3911
|
-
const
|
|
3912
|
-
Object.assign(e2, { keys:
|
|
3913
|
-
for (let
|
|
3488
|
+
function le(e2, t2) {
|
|
3489
|
+
const r2 = [305419896, 591751049, 878082192];
|
|
3490
|
+
Object.assign(e2, { keys: r2, crcKey0: new y$1(r2[0]), crcKey2: new y$1(r2[2]) });
|
|
3491
|
+
for (let r3 = 0; r3 < t2.length; r3++) ue(e2, t2.charCodeAt(r3));
|
|
3914
3492
|
}
|
|
3915
|
-
function
|
|
3916
|
-
let [
|
|
3917
|
-
e2.crcKey0.append([t2]),
|
|
3493
|
+
function ue(e2, t2) {
|
|
3494
|
+
let [r2, n2, s2] = e2.keys;
|
|
3495
|
+
e2.crcKey0.append([t2]), r2 = ~e2.crcKey0.get(), n2 = he(Math.imul(he(n2 + fe(r2)), 134775813) + 1), e2.crcKey2.append([n2 >>> 24]), s2 = ~e2.crcKey2.get(), e2.keys = [r2, n2, s2];
|
|
3918
3496
|
}
|
|
3919
|
-
function
|
|
3497
|
+
function de(e2) {
|
|
3920
3498
|
const t2 = 2 | e2.keys[2];
|
|
3921
|
-
return
|
|
3499
|
+
return fe(Math.imul(t2, 1 ^ t2) >>> 8);
|
|
3922
3500
|
}
|
|
3923
|
-
function
|
|
3501
|
+
function fe(e2) {
|
|
3924
3502
|
return 255 & e2;
|
|
3925
3503
|
}
|
|
3926
|
-
function
|
|
3504
|
+
function he(e2) {
|
|
3927
3505
|
return 4294967295 & e2;
|
|
3928
3506
|
}
|
|
3929
|
-
const
|
|
3930
|
-
class
|
|
3931
|
-
constructor(e2, { chunkSize: t2,
|
|
3507
|
+
const pe = "Invalid uncompressed size";
|
|
3508
|
+
class we extends TransformStream {
|
|
3509
|
+
constructor(e2, { chunkSize: t2, CompressionStreamZlib: r2, CompressionStream: n2 }) {
|
|
3932
3510
|
super({});
|
|
3933
|
-
const { compressed:
|
|
3934
|
-
let d, f2, h2 =
|
|
3935
|
-
a2 && !o2 || !
|
|
3511
|
+
const { compressed: s2, encrypted: a2, useCompressionStream: i2, zipCrypto: o2, signed: c, level: l2 } = e2, u = this;
|
|
3512
|
+
let d, f2, h2 = super.readable;
|
|
3513
|
+
a2 && !o2 || !c || (d = new b$1(), h2 = be(h2, d)), s2 && (h2 = ye(h2, i2, { level: l2, chunkSize: t2 }, n2, r2, n2)), a2 && (o2 ? h2 = be(h2, new ie(e2)) : (f2 = new X(e2), h2 = be(h2, f2))), me(u, h2, () => {
|
|
3936
3514
|
let e3;
|
|
3937
|
-
a2 && !o2 && (e3 = f2.signature), a2 && !o2 || !
|
|
3938
|
-
})
|
|
3515
|
+
a2 && !o2 && (e3 = f2.signature), a2 && !o2 || !c || (e3 = new DataView(d.value.buffer).getUint32(0)), u.signature = e3;
|
|
3516
|
+
});
|
|
3939
3517
|
}
|
|
3940
3518
|
}
|
|
3941
|
-
class
|
|
3942
|
-
constructor(e2, { chunkSize: t2,
|
|
3519
|
+
class ge extends TransformStream {
|
|
3520
|
+
constructor(e2, { chunkSize: t2, DecompressionStreamZlib: r2, DecompressionStream: n2 }) {
|
|
3943
3521
|
super({});
|
|
3944
|
-
const { zipCrypto:
|
|
3945
|
-
let
|
|
3946
|
-
a2 && (
|
|
3947
|
-
if ((!a2 ||
|
|
3948
|
-
const e3 = new DataView(
|
|
3949
|
-
if (o2 != e3.getUint32(0, false)) throw new Error(
|
|
3522
|
+
const { zipCrypto: s2, encrypted: a2, signed: i2, signature: o2, compressed: c, useCompressionStream: l2, deflate64: u } = e2;
|
|
3523
|
+
let d, f2, h2 = super.readable;
|
|
3524
|
+
a2 && (s2 ? h2 = be(h2, new ae(e2)) : (f2 = new Q(e2), h2 = be(h2, f2))), c && (h2 = ye(h2, l2, { chunkSize: t2, deflate64: u }, n2, r2, n2)), a2 && !s2 || !i2 || (d = new b$1(), h2 = be(h2, d)), me(this, h2, () => {
|
|
3525
|
+
if ((!a2 || s2) && i2) {
|
|
3526
|
+
const e3 = new DataView(d.value.buffer);
|
|
3527
|
+
if (o2 != e3.getUint32(0, false)) throw new Error(F);
|
|
3950
3528
|
}
|
|
3951
|
-
})
|
|
3529
|
+
});
|
|
3952
3530
|
}
|
|
3953
3531
|
}
|
|
3954
|
-
function
|
|
3955
|
-
|
|
3956
|
-
e3 && e3.length && t2.enqueue(e3);
|
|
3957
|
-
} }));
|
|
3532
|
+
function me(e2, t2, r2) {
|
|
3533
|
+
t2 = be(t2, new TransformStream({ flush: r2 })), Object.defineProperty(e2, "readable", { get: () => t2 });
|
|
3958
3534
|
}
|
|
3959
|
-
function
|
|
3960
|
-
|
|
3961
|
-
}
|
|
3962
|
-
function Me(e2, t2, n2, i2, r2) {
|
|
3535
|
+
function ye(e2, t2, r2, n2, s2, a2) {
|
|
3536
|
+
const i2 = t2 && n2 ? n2 : s2 || a2, o2 = r2.deflate64 ? "deflate64-raw" : "deflate-raw";
|
|
3963
3537
|
try {
|
|
3964
|
-
e2 =
|
|
3965
|
-
} catch (
|
|
3966
|
-
if (!t2)
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3538
|
+
e2 = be(e2, new i2(o2, r2));
|
|
3539
|
+
} catch (n3) {
|
|
3540
|
+
if (!t2) throw n3;
|
|
3541
|
+
if (s2) e2 = be(e2, new s2(o2, r2));
|
|
3542
|
+
else {
|
|
3543
|
+
if (!a2) throw n3;
|
|
3544
|
+
e2 = be(e2, new a2(o2, r2));
|
|
3971
3545
|
}
|
|
3972
3546
|
}
|
|
3973
3547
|
return e2;
|
|
3974
3548
|
}
|
|
3975
|
-
function
|
|
3549
|
+
function be(e2, t2) {
|
|
3976
3550
|
return e2.pipeThrough(t2);
|
|
3977
3551
|
}
|
|
3978
|
-
const
|
|
3979
|
-
class
|
|
3552
|
+
const Se = "start", ke = "pull", ze = "data", xe = "close", Ue = "inflate";
|
|
3553
|
+
class Ae extends TransformStream {
|
|
3980
3554
|
constructor(e2, t2) {
|
|
3981
3555
|
super({});
|
|
3982
|
-
const
|
|
3983
|
-
let
|
|
3984
|
-
|
|
3985
|
-
let a2 = 0
|
|
3986
|
-
const
|
|
3987
|
-
e3 && e3.length && (s2 += e3.length, t3.enqueue(e3));
|
|
3988
|
-
}, flush() {
|
|
3989
|
-
Object.assign(n2, { inputSize: s2 });
|
|
3990
|
-
} }), u = new TransformStream({ transform(e3, t3) {
|
|
3556
|
+
const r2 = this, { codecType: n2 } = e2;
|
|
3557
|
+
let s2;
|
|
3558
|
+
n2.startsWith("deflate") ? s2 = we : n2.startsWith(Ue) && (s2 = ge), r2.outputSize = 0;
|
|
3559
|
+
let a2 = 0;
|
|
3560
|
+
const i2 = new s2(e2, t2), o2 = super.readable, l2 = new TransformStream({ transform(e3, t3) {
|
|
3991
3561
|
e3 && e3.length && (a2 += e3.length, t3.enqueue(e3));
|
|
3992
3562
|
}, flush() {
|
|
3993
|
-
|
|
3994
|
-
|
|
3563
|
+
Object.assign(r2, { inputSize: a2 });
|
|
3564
|
+
} }), u = new TransformStream({ transform(t3, n3) {
|
|
3565
|
+
if (t3 && t3.length && (n3.enqueue(t3), r2.outputSize += t3.length, e2.outputSize !== c$1 && r2.outputSize > e2.outputSize)) throw new Error(pe);
|
|
3566
|
+
}, flush() {
|
|
3567
|
+
const { signature: e3 } = i2;
|
|
3568
|
+
Object.assign(r2, { signature: e3, inputSize: a2 });
|
|
3995
3569
|
} });
|
|
3996
|
-
Object.defineProperty(
|
|
3570
|
+
Object.defineProperty(r2, "readable", { get: () => o2.pipeThrough(l2).pipeThrough(i2).pipeThrough(u) });
|
|
3997
3571
|
}
|
|
3998
3572
|
}
|
|
3999
|
-
class
|
|
3573
|
+
class ve extends TransformStream {
|
|
4000
3574
|
constructor(e2) {
|
|
4001
3575
|
let t2;
|
|
4002
|
-
super({ transform: function n2
|
|
3576
|
+
super({ transform: function r2(n2, s2) {
|
|
4003
3577
|
if (t2) {
|
|
4004
|
-
const e3 = new Uint8Array(t2.length +
|
|
4005
|
-
e3.set(t2), e3.set(
|
|
3578
|
+
const e3 = new Uint8Array(t2.length + n2.length);
|
|
3579
|
+
e3.set(t2), e3.set(n2, t2.length), n2 = e3, t2 = null;
|
|
4006
3580
|
}
|
|
4007
|
-
|
|
3581
|
+
n2.length > e2 ? (s2.enqueue(n2.slice(0, e2)), r2(n2.slice(e2), s2)) : t2 = n2;
|
|
4008
3582
|
}, flush(e3) {
|
|
4009
3583
|
t2 && t2.length && e3.enqueue(t2);
|
|
4010
3584
|
} });
|
|
4011
3585
|
}
|
|
4012
3586
|
}
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
3587
|
+
const De = { type: "module" };
|
|
3588
|
+
let _e, Fe, Oe, Ee = true;
|
|
3589
|
+
try {
|
|
3590
|
+
Ee = typeof structuredClone == d$1 && structuredClone(new DOMException("", "AbortError")).code !== c$1;
|
|
3591
|
+
} catch {
|
|
3592
|
+
}
|
|
3593
|
+
class Te {
|
|
3594
|
+
constructor(e2, { readable: t2, writable: r2 }, { options: n2, config: s2, streamOptions: a2, useWebWorkers: i2, transferStreams: o2, workerURI: l2 }, d) {
|
|
3595
|
+
const { signal: f2 } = a2;
|
|
3596
|
+
return Object.assign(e2, { busy: true, readable: t2.pipeThrough(new ve(s2.chunkSize)).pipeThrough(new Ce(a2), { signal: f2 }), writable: r2, options: Object.assign({}, n2), workerURI: l2, transferStreams: o2, terminate: () => new Promise((t3) => {
|
|
3597
|
+
const { worker: r3, busy: n3 } = e2;
|
|
3598
|
+
r3 ? (n3 ? e2.resolveTerminated = t3 : (r3.terminate(), t3()), e2.interface = null) : t3();
|
|
3599
|
+
}), onTaskFinished() {
|
|
4021
3600
|
const { resolveTerminated: t3 } = e2;
|
|
4022
|
-
t3 && (e2.resolveTerminated = null, e2.terminated = true, e2.worker.terminate(), t3()), e2.busy = false,
|
|
4023
|
-
} }), (
|
|
3601
|
+
t3 && (e2.resolveTerminated = null, e2.terminated = true, e2.worker.terminate(), t3()), e2.busy = false, d(e2);
|
|
3602
|
+
} }), _e === c$1 && (_e = typeof Worker != u$1), (i2 && _e ? Me : We)(e2, s2);
|
|
4024
3603
|
}
|
|
4025
3604
|
}
|
|
4026
|
-
class
|
|
4027
|
-
constructor(
|
|
4028
|
-
let
|
|
3605
|
+
class Ce extends TransformStream {
|
|
3606
|
+
constructor({ onstart: e2, onprogress: t2, size: r2, onend: n2 }) {
|
|
3607
|
+
let s2 = 0;
|
|
4029
3608
|
super({ async start() {
|
|
4030
|
-
|
|
4031
|
-
}, async transform(e3,
|
|
4032
|
-
|
|
3609
|
+
e2 && await Re(e2, r2);
|
|
3610
|
+
}, async transform(e3, n3) {
|
|
3611
|
+
s2 += e3.length, t2 && await Re(t2, s2, r2), n3.enqueue(e3);
|
|
4033
3612
|
}, async flush() {
|
|
4034
|
-
|
|
3613
|
+
n2 && await Re(n2, s2);
|
|
4035
3614
|
} });
|
|
4036
3615
|
}
|
|
4037
3616
|
}
|
|
4038
|
-
async function
|
|
3617
|
+
async function Re(e2, ...t2) {
|
|
4039
3618
|
try {
|
|
4040
3619
|
await e2(...t2);
|
|
4041
|
-
} catch
|
|
3620
|
+
} catch {
|
|
4042
3621
|
}
|
|
4043
3622
|
}
|
|
4044
|
-
function
|
|
4045
|
-
return { run: () => (async function({ options: e3, readable: t3, writable:
|
|
3623
|
+
function We(e2, t2) {
|
|
3624
|
+
return { run: () => (async function({ options: e3, readable: t3, writable: r2, onTaskFinished: n2 }, s2) {
|
|
3625
|
+
let a2;
|
|
4046
3626
|
try {
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
3627
|
+
if (!e3.useCompressionStream) try {
|
|
3628
|
+
await void 0;
|
|
3629
|
+
} catch {
|
|
3630
|
+
e3.useCompressionStream = true;
|
|
3631
|
+
}
|
|
3632
|
+
a2 = new Ae(e3, s2), await t3.pipeThrough(a2).pipeTo(r2, { preventClose: true, preventAbort: true });
|
|
3633
|
+
const { signature: n3, inputSize: i2, outputSize: o2 } = a2;
|
|
3634
|
+
return { signature: n3, inputSize: i2, outputSize: o2 };
|
|
3635
|
+
} catch (e4) {
|
|
3636
|
+
throw a2 && (e4.outputSize = a2.outputSize), e4;
|
|
4051
3637
|
} finally {
|
|
4052
|
-
|
|
3638
|
+
n2();
|
|
4053
3639
|
}
|
|
4054
3640
|
})(e2, t2) };
|
|
4055
3641
|
}
|
|
4056
|
-
function
|
|
4057
|
-
const {
|
|
3642
|
+
function Me(e2, t2) {
|
|
3643
|
+
const { baseURI: r2, chunkSize: n2 } = t2;
|
|
3644
|
+
let { wasmURI: s2 } = t2;
|
|
4058
3645
|
if (!e2.interface) {
|
|
4059
|
-
let
|
|
3646
|
+
let a2;
|
|
3647
|
+
typeof s2 == d$1 && (s2 = s2());
|
|
4060
3648
|
try {
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
}
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
const { message: e6, stack: t5, code: n5, name: i5 } = s2, r5 = new Error(e6);
|
|
4081
|
-
Object.assign(r5, { stack: t5, code: n5, name: i5 }), f2(r5);
|
|
4082
|
-
} else {
|
|
4083
|
-
if (n4 == Be) {
|
|
4084
|
-
const { value: e6, done: n5 } = await o2.read();
|
|
4085
|
-
et({ type: Ie, value: e6, done: n5, messageId: r4 }, t4);
|
|
4086
|
-
}
|
|
4087
|
-
n4 == Ie && (await l2.ready, await l2.write(new Uint8Array(i4)), et({ type: "ack", messageId: r4 }, t4)), n4 == Ne && f2(null, a3);
|
|
4088
|
-
}
|
|
4089
|
-
} catch (s3) {
|
|
4090
|
-
et({ type: Ne, messageId: r4 }, t4), f2(s3);
|
|
4091
|
-
}
|
|
4092
|
-
function f2(e6, t5) {
|
|
4093
|
-
e6 ? u(e6) : c(t5), l2 && l2.releaseLock(), d();
|
|
4094
|
-
}
|
|
4095
|
-
})(e4, n3))), a2;
|
|
4096
|
-
})(e2.scripts[0], n2, e2);
|
|
4097
|
-
} catch (n3) {
|
|
4098
|
-
return Ke = false, Qe(e2, t2);
|
|
4099
|
-
}
|
|
4100
|
-
Object.assign(e2, { worker: r2, interface: { run: () => (async function(e3, t3) {
|
|
4101
|
-
let n3, i3;
|
|
4102
|
-
const r3 = new Promise(((e4, t4) => {
|
|
4103
|
-
n3 = e4, i3 = t4;
|
|
4104
|
-
}));
|
|
4105
|
-
Object.assign(e3, { reader: null, writer: null, resolveResult: n3, rejectResult: i3, result: r3 });
|
|
4106
|
-
const { readable: a2, options: s2, scripts: o2 } = e3, { writable: l2, closed: c } = (function(e4) {
|
|
4107
|
-
let t4;
|
|
4108
|
-
const n4 = new Promise(((e5) => t4 = e5)), i4 = new WritableStream({ async write(t5) {
|
|
4109
|
-
const n5 = e4.getWriter();
|
|
4110
|
-
await n5.ready, await n5.write(t5), n5.releaseLock();
|
|
4111
|
-
}, close() {
|
|
4112
|
-
t4();
|
|
4113
|
-
}, abort: (t5) => e4.getWriter().abort(t5) });
|
|
4114
|
-
return { writable: i4, closed: n4 };
|
|
4115
|
-
})(e3.writable), u = et({ type: Re, scripts: o2.slice(1), options: s2, config: t3, readable: a2, writable: l2 }, e3);
|
|
4116
|
-
u || Object.assign(e3, { reader: a2.getReader(), writer: l2.getWriter() });
|
|
4117
|
-
const d = await r3;
|
|
4118
|
-
u || await l2.getWriter().close();
|
|
4119
|
-
return await c, d;
|
|
4120
|
-
})(e2, { chunkSize: i2 }) } });
|
|
3649
|
+
a2 = je(e2.workerURI, r2, e2);
|
|
3650
|
+
} catch {
|
|
3651
|
+
return _e = false, We(e2, t2);
|
|
3652
|
+
}
|
|
3653
|
+
Object.assign(e2, { worker: a2, interface: { run: () => (async function(e3, t3) {
|
|
3654
|
+
let r3, n3;
|
|
3655
|
+
const s3 = new Promise((e4, t4) => {
|
|
3656
|
+
r3 = e4, n3 = t4;
|
|
3657
|
+
});
|
|
3658
|
+
Object.assign(e3, { reader: null, writer: null, resolveResult: r3, rejectResult: n3, result: s3 });
|
|
3659
|
+
const { readable: a3, options: i2 } = e3, { writable: o2, closed: c } = (function(e4) {
|
|
3660
|
+
const { writable: t4, readable: r4 } = new TransformStream(), n4 = r4.pipeTo(e4, { preventClose: true });
|
|
3661
|
+
return { writable: t4, closed: n4 };
|
|
3662
|
+
})(e3.writable), l2 = Ie({ type: Se, options: i2, config: t3, readable: a3, writable: o2 }, e3);
|
|
3663
|
+
l2 || Object.assign(e3, { reader: a3.getReader(), writer: o2.getWriter() });
|
|
3664
|
+
const u = await s3;
|
|
3665
|
+
l2 || await o2.getWriter().close();
|
|
3666
|
+
return await c, u;
|
|
3667
|
+
})(e2, { chunkSize: n2, wasmURI: s2, baseURI: r2 }) } });
|
|
4121
3668
|
}
|
|
4122
3669
|
return e2.interface;
|
|
4123
3670
|
}
|
|
4124
|
-
|
|
4125
|
-
|
|
3671
|
+
function je(e2, t2, r2, n2, s2 = true) {
|
|
3672
|
+
let a2, i2, o2;
|
|
3673
|
+
if (Fe === c$1) {
|
|
3674
|
+
const l2 = typeof e2 == d$1;
|
|
3675
|
+
i2 = l2 ? e2(s2) : e2;
|
|
3676
|
+
const u = i2.startsWith("data:"), f2 = i2.startsWith("blob:");
|
|
3677
|
+
if (u || f2) {
|
|
3678
|
+
n2 === c$1 && (n2 = false), n2 && (o2 = De);
|
|
3679
|
+
try {
|
|
3680
|
+
a2 = new Worker(i2, o2);
|
|
3681
|
+
} catch (s3) {
|
|
3682
|
+
if (f2) try {
|
|
3683
|
+
URL.revokeObjectURL(i2);
|
|
3684
|
+
} catch {
|
|
3685
|
+
}
|
|
3686
|
+
if (l2 && f2) return je(e2, t2, r2, n2, false);
|
|
3687
|
+
if (n2) throw s3;
|
|
3688
|
+
return je(e2, t2, r2, true, false);
|
|
3689
|
+
}
|
|
3690
|
+
} else {
|
|
3691
|
+
n2 === c$1 && (n2 = true), n2 && (o2 = De);
|
|
3692
|
+
try {
|
|
3693
|
+
i2 = new URL(i2, t2);
|
|
3694
|
+
} catch {
|
|
3695
|
+
}
|
|
3696
|
+
try {
|
|
3697
|
+
a2 = new Worker(i2, o2);
|
|
3698
|
+
} catch (a3) {
|
|
3699
|
+
if (n2) throw a3;
|
|
3700
|
+
return je(e2, t2, r2, false, s2);
|
|
3701
|
+
}
|
|
3702
|
+
}
|
|
3703
|
+
Fe = i2, Oe = o2;
|
|
3704
|
+
} else a2 = new Worker(Fe, Oe);
|
|
3705
|
+
return a2.addEventListener("message", (e3) => (async function({ data: e4 }, t3) {
|
|
3706
|
+
const { type: r3, value: n3, messageId: s3, result: a3, error: i3 } = e4, { reader: o3, writer: c, resolveResult: l2, rejectResult: u, onTaskFinished: d } = t3;
|
|
3707
|
+
try {
|
|
3708
|
+
if (i3) {
|
|
3709
|
+
const { message: e5, stack: t4, code: r4, name: n4, outputSize: s4 } = i3, a4 = new Error(e5);
|
|
3710
|
+
Object.assign(a4, { stack: t4, code: r4, name: n4, outputSize: s4 }), f2(a4);
|
|
3711
|
+
} else {
|
|
3712
|
+
if (r3 == ke) {
|
|
3713
|
+
const { value: e5, done: r4 } = await o3.read();
|
|
3714
|
+
Ie({ type: ze, value: e5, done: r4, messageId: s3 }, t3);
|
|
3715
|
+
}
|
|
3716
|
+
r3 == ze && (await c.ready, await c.write(new Uint8Array(n3)), Ie({ type: "ack", messageId: s3 }, t3)), r3 == xe && f2(null, a3);
|
|
3717
|
+
}
|
|
3718
|
+
} catch (i4) {
|
|
3719
|
+
Ie({ type: xe, messageId: s3 }, t3), f2(i4);
|
|
3720
|
+
}
|
|
3721
|
+
function f2(e5, t4) {
|
|
3722
|
+
e5 ? u(e5) : l2(t4), c && c.releaseLock(), d();
|
|
3723
|
+
}
|
|
3724
|
+
})(e3, r2)), a2;
|
|
3725
|
+
}
|
|
3726
|
+
function Ie(e2, { worker: t2, writer: r2, onTaskFinished: n2, transferStreams: s2 }) {
|
|
4126
3727
|
try {
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
$e = false, e2.readable = e2.writable = null, t2.postMessage(e2);
|
|
3728
|
+
const { value: r3, readable: n3, writable: a2 } = e2, i2 = [];
|
|
3729
|
+
if (r3 && (e2.value = r3, i2.push(e2.value.buffer)), s2 && Ee ? (n3 && i2.push(n3), a2 && i2.push(a2)) : e2.readable = e2.writable = null, i2.length) try {
|
|
3730
|
+
return t2.postMessage(e2, i2), true;
|
|
3731
|
+
} catch {
|
|
3732
|
+
Ee = false, e2.readable = e2.writable = null, t2.postMessage(e2);
|
|
4133
3733
|
}
|
|
4134
3734
|
else t2.postMessage(e2);
|
|
4135
3735
|
} catch (e3) {
|
|
4136
|
-
throw
|
|
4137
|
-
}
|
|
4138
|
-
}
|
|
4139
|
-
let
|
|
4140
|
-
const
|
|
4141
|
-
let
|
|
4142
|
-
async function
|
|
4143
|
-
const { options:
|
|
4144
|
-
t2.transferStreams =
|
|
4145
|
-
const h2 = !(
|
|
4146
|
-
return t2.useWebWorkers = !h2 && (a2 || a2 ===
|
|
4147
|
-
const
|
|
4148
|
-
if (
|
|
4149
|
-
if (
|
|
4150
|
-
const
|
|
4151
|
-
return
|
|
4152
|
-
}
|
|
4153
|
-
return new Promise((
|
|
3736
|
+
throw r2 && r2.releaseLock(), n2(), e3;
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
let Be = [];
|
|
3740
|
+
const Pe = [];
|
|
3741
|
+
let Le = 0;
|
|
3742
|
+
async function Ve(e2, t2) {
|
|
3743
|
+
const { options: r2, config: n2 } = t2, { transferStreams: s2, useWebWorkers: a2, useCompressionStream: i2, compressed: o2, signed: l2, encrypted: u } = r2, { workerURI: d, maxWorkers: f2 } = n2;
|
|
3744
|
+
t2.transferStreams = s2 || s2 === c$1;
|
|
3745
|
+
const h2 = !(o2 || l2 || u || t2.transferStreams);
|
|
3746
|
+
return t2.useWebWorkers = !h2 && (a2 || a2 === c$1 && n2.useWebWorkers), t2.workerURI = t2.useWebWorkers && d ? d : c$1, r2.useCompressionStream = i2 || i2 === c$1 && n2.useCompressionStream, (await (async function() {
|
|
3747
|
+
const r3 = Be.find((e3) => !e3.busy);
|
|
3748
|
+
if (r3) return Ne(r3), new Te(r3, e2, t2, p2);
|
|
3749
|
+
if (Be.length < f2) {
|
|
3750
|
+
const r4 = { indexWorker: Le };
|
|
3751
|
+
return Le++, Be.push(r4), new Te(r4, e2, t2, p2);
|
|
3752
|
+
}
|
|
3753
|
+
return new Promise((r4) => Pe.push({ resolve: r4, stream: e2, workerOptions: t2 }));
|
|
4154
3754
|
})()).run();
|
|
4155
|
-
function
|
|
4156
|
-
if (
|
|
4157
|
-
const [{ resolve: t3, stream:
|
|
4158
|
-
t3(new
|
|
4159
|
-
} else e3.worker ? (
|
|
4160
|
-
const { config:
|
|
4161
|
-
Number.isFinite(
|
|
4162
|
-
|
|
3755
|
+
function p2(e3) {
|
|
3756
|
+
if (Pe.length) {
|
|
3757
|
+
const [{ resolve: t3, stream: r3, workerOptions: n3 }] = Pe.splice(0, 1);
|
|
3758
|
+
t3(new Te(e3, r3, n3, p2));
|
|
3759
|
+
} else e3.worker ? (Ne(e3), (function(e4, t3) {
|
|
3760
|
+
const { config: r3 } = t3, { terminateWorkerTimeout: n3 } = r3;
|
|
3761
|
+
Number.isFinite(n3) && n3 >= 0 && (e4.terminated ? e4.terminated = false : e4.terminateTimeout = setTimeout(async () => {
|
|
3762
|
+
Be = Be.filter((t4) => t4 != e4);
|
|
4163
3763
|
try {
|
|
4164
3764
|
await e4.terminate();
|
|
4165
|
-
} catch
|
|
3765
|
+
} catch {
|
|
4166
3766
|
}
|
|
4167
|
-
}
|
|
4168
|
-
})(e3, t2)) :
|
|
3767
|
+
}, n3));
|
|
3768
|
+
})(e3, t2)) : Be = Be.filter((t3) => t3 != e3);
|
|
4169
3769
|
}
|
|
4170
3770
|
}
|
|
4171
|
-
function
|
|
3771
|
+
function Ne(e2) {
|
|
4172
3772
|
const { terminateTimeout: t2 } = e2;
|
|
4173
3773
|
t2 && (clearTimeout(t2), e2.terminateTimeout = null);
|
|
4174
3774
|
}
|
|
4175
|
-
const
|
|
4176
|
-
class
|
|
3775
|
+
const Ze = 65536, qe = "writable";
|
|
3776
|
+
class He {
|
|
4177
3777
|
constructor() {
|
|
4178
3778
|
this.size = 0;
|
|
4179
3779
|
}
|
|
@@ -4181,403 +3781,461 @@ class lt {
|
|
|
4181
3781
|
this.initialized = true;
|
|
4182
3782
|
}
|
|
4183
3783
|
}
|
|
4184
|
-
class
|
|
3784
|
+
class Ke extends He {
|
|
4185
3785
|
get readable() {
|
|
4186
|
-
const e2 = this, { chunkSize: t2 =
|
|
3786
|
+
const e2 = this, { chunkSize: t2 = Ze } = e2, r2 = new ReadableStream({ start() {
|
|
4187
3787
|
this.chunkOffset = 0;
|
|
4188
|
-
}, async pull(
|
|
4189
|
-
const { offset:
|
|
4190
|
-
|
|
3788
|
+
}, async pull(n2) {
|
|
3789
|
+
const { offset: s2 = 0, size: a2, diskNumberStart: i2 } = r2, { chunkOffset: o2 } = this, l2 = a2 === c$1 ? t2 : Math.min(t2, a2 - o2), u = await rt(e2, s2 + o2, l2, i2);
|
|
3790
|
+
n2.enqueue(u), o2 + t2 > a2 || a2 === c$1 && !u.length && l2 ? n2.close() : this.chunkOffset += t2;
|
|
4191
3791
|
} });
|
|
4192
|
-
return
|
|
3792
|
+
return r2;
|
|
4193
3793
|
}
|
|
4194
3794
|
}
|
|
4195
|
-
class
|
|
3795
|
+
class Ge extends Ke {
|
|
4196
3796
|
constructor(e2) {
|
|
4197
3797
|
super(), Object.assign(this, { blob: e2, size: e2.size });
|
|
4198
3798
|
}
|
|
4199
3799
|
async readUint8Array(e2, t2) {
|
|
4200
|
-
const
|
|
4201
|
-
let a2 = await
|
|
4202
|
-
return a2.byteLength > t2 && (a2 = a2.slice(e2,
|
|
3800
|
+
const r2 = this, n2 = e2 + t2, s2 = e2 || n2 < r2.size ? r2.blob.slice(e2, n2) : r2.blob;
|
|
3801
|
+
let a2 = await s2.arrayBuffer();
|
|
3802
|
+
return a2.byteLength > t2 && (a2 = a2.slice(e2, n2)), new Uint8Array(a2);
|
|
4203
3803
|
}
|
|
4204
3804
|
}
|
|
4205
|
-
class
|
|
3805
|
+
class Je extends He {
|
|
4206
3806
|
constructor(e2) {
|
|
4207
3807
|
super();
|
|
4208
|
-
const t2 = new TransformStream(),
|
|
4209
|
-
e2 &&
|
|
3808
|
+
const t2 = new TransformStream(), r2 = [];
|
|
3809
|
+
e2 && r2.push(["Content-Type", e2]), Object.defineProperty(this, qe, { get: () => t2.writable }), this.blob = new Response(t2.readable, { headers: r2 }).blob();
|
|
4210
3810
|
}
|
|
4211
3811
|
getData() {
|
|
4212
3812
|
return this.blob;
|
|
4213
3813
|
}
|
|
4214
3814
|
}
|
|
4215
|
-
class
|
|
3815
|
+
class Qe extends Je {
|
|
4216
3816
|
constructor(e2) {
|
|
4217
3817
|
super(e2), Object.assign(this, { encoding: e2, utf8: !e2 || "utf-8" == e2.toLowerCase() });
|
|
4218
3818
|
}
|
|
4219
3819
|
async getData() {
|
|
4220
|
-
const { encoding: e2, utf8: t2 } = this,
|
|
4221
|
-
if (
|
|
3820
|
+
const { encoding: e2, utf8: t2 } = this, r2 = await super.getData();
|
|
3821
|
+
if (r2.text && t2) return r2.text();
|
|
4222
3822
|
{
|
|
4223
3823
|
const t3 = new FileReader();
|
|
4224
|
-
return new Promise((
|
|
4225
|
-
Object.assign(t3, { onload: ({ target: e3 }) =>
|
|
4226
|
-
})
|
|
3824
|
+
return new Promise((n2, s2) => {
|
|
3825
|
+
Object.assign(t3, { onload: ({ target: e3 }) => n2(e3.result), onerror: () => s2(t3.error) }), t3.readAsText(r2, e2);
|
|
3826
|
+
});
|
|
4227
3827
|
}
|
|
4228
3828
|
}
|
|
4229
3829
|
}
|
|
4230
|
-
class
|
|
3830
|
+
class Xe extends Ke {
|
|
4231
3831
|
constructor(e2) {
|
|
4232
3832
|
super(), this.readers = e2;
|
|
4233
3833
|
}
|
|
4234
3834
|
async init() {
|
|
4235
3835
|
const e2 = this, { readers: t2 } = e2;
|
|
4236
|
-
e2.lastDiskNumber = 0, e2.lastDiskOffset = 0, await Promise.all(t2.map(
|
|
4237
|
-
await
|
|
4238
|
-
}))
|
|
4239
|
-
}
|
|
4240
|
-
async readUint8Array(e2, t2,
|
|
4241
|
-
const
|
|
4242
|
-
let a2,
|
|
4243
|
-
-1 ==
|
|
3836
|
+
e2.lastDiskNumber = 0, e2.lastDiskOffset = 0, await Promise.all(t2.map(async (r2, n2) => {
|
|
3837
|
+
await r2.init(), n2 != t2.length - 1 && (e2.lastDiskOffset += r2.size), e2.size += r2.size;
|
|
3838
|
+
})), super.init();
|
|
3839
|
+
}
|
|
3840
|
+
async readUint8Array(e2, t2, r2 = 0) {
|
|
3841
|
+
const n2 = this, { readers: s2 } = this;
|
|
3842
|
+
let a2, i2 = r2;
|
|
3843
|
+
-1 == i2 && (i2 = s2.length - 1);
|
|
4244
3844
|
let o2 = e2;
|
|
4245
|
-
for (; o2 >=
|
|
4246
|
-
const
|
|
4247
|
-
if (
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
3845
|
+
for (; s2[i2] && o2 >= s2[i2].size; ) o2 -= s2[i2].size, i2++;
|
|
3846
|
+
const c = s2[i2];
|
|
3847
|
+
if (c) {
|
|
3848
|
+
const s3 = c.size;
|
|
3849
|
+
if (o2 + t2 <= s3) a2 = await rt(c, o2, t2);
|
|
3850
|
+
else {
|
|
3851
|
+
const i3 = s3 - o2;
|
|
3852
|
+
a2 = new Uint8Array(t2);
|
|
3853
|
+
const l2 = await rt(c, o2, i3);
|
|
3854
|
+
a2.set(l2, 0);
|
|
3855
|
+
const u = await n2.readUint8Array(e2 + i3, t2 - i3, r2);
|
|
3856
|
+
a2.set(u, i3), l2.length + u.length < t2 && (a2 = a2.subarray(0, l2.length + u.length));
|
|
3857
|
+
}
|
|
3858
|
+
} else a2 = new Uint8Array();
|
|
3859
|
+
return n2.lastDiskNumber = Math.max(i2, n2.lastDiskNumber), a2;
|
|
4253
3860
|
}
|
|
4254
3861
|
}
|
|
4255
|
-
class
|
|
3862
|
+
class Ye extends He {
|
|
4256
3863
|
constructor(e2, t2 = 4294967295) {
|
|
4257
3864
|
super();
|
|
4258
|
-
const
|
|
4259
|
-
let
|
|
4260
|
-
Object.assign(
|
|
4261
|
-
const
|
|
4262
|
-
const { availableSize:
|
|
4263
|
-
if (a2) t3.length >=
|
|
3865
|
+
const r2 = this;
|
|
3866
|
+
let n2, s2, a2;
|
|
3867
|
+
Object.assign(r2, { diskNumber: 0, diskOffset: 0, size: 0, maxSize: t2, availableSize: t2 });
|
|
3868
|
+
const i2 = new WritableStream({ async write(t3) {
|
|
3869
|
+
const { availableSize: i3 } = r2;
|
|
3870
|
+
if (a2) t3.length >= i3 ? (await o2(t3.subarray(0, i3)), await c(), r2.diskOffset += n2.size, r2.diskNumber++, a2 = null, await this.write(t3.subarray(i3))) : await o2(t3);
|
|
4264
3871
|
else {
|
|
4265
|
-
const { value:
|
|
4266
|
-
if (o3 && !
|
|
4267
|
-
|
|
3872
|
+
const { value: i4, done: o3 } = await e2.next();
|
|
3873
|
+
if (o3 && !i4) throw new Error("Writer iterator completed too soon");
|
|
3874
|
+
n2 = i4, n2.size = 0, n2.maxSize && (r2.maxSize = n2.maxSize), r2.availableSize = r2.maxSize, await tt(n2), s2 = i4.writable, a2 = s2.getWriter(), await this.write(t3);
|
|
4268
3875
|
}
|
|
4269
3876
|
}, async close() {
|
|
4270
|
-
await a2.ready, await
|
|
3877
|
+
await a2.ready, await c();
|
|
4271
3878
|
} });
|
|
4272
3879
|
async function o2(e3) {
|
|
4273
3880
|
const t3 = e3.length;
|
|
4274
|
-
t3 && (await a2.ready, await a2.write(e3),
|
|
3881
|
+
t3 && (await a2.ready, await a2.write(e3), n2.size += t3, r2.size += t3, r2.availableSize -= t3);
|
|
4275
3882
|
}
|
|
4276
|
-
async function
|
|
4277
|
-
|
|
3883
|
+
async function c() {
|
|
3884
|
+
await a2.close();
|
|
4278
3885
|
}
|
|
4279
|
-
Object.defineProperty(
|
|
3886
|
+
Object.defineProperty(r2, qe, { get: () => i2 });
|
|
3887
|
+
}
|
|
3888
|
+
}
|
|
3889
|
+
class $e {
|
|
3890
|
+
constructor(e2) {
|
|
3891
|
+
return Array.isArray(e2) && (e2 = new Xe(e2)), e2 instanceof ReadableStream && (e2 = { readable: e2 }), e2;
|
|
3892
|
+
}
|
|
3893
|
+
}
|
|
3894
|
+
class et {
|
|
3895
|
+
constructor(e2) {
|
|
3896
|
+
return e2.writable === c$1 && typeof e2.next == d$1 && (e2 = new Ye(e2)), e2 instanceof WritableStream && (e2 = { writable: e2 }), e2.size === c$1 && (e2.size = 0), e2 instanceof Ye || Object.assign(e2, { diskNumber: 0, diskOffset: 0, availableSize: l$1, maxSize: l$1 }), e2;
|
|
4280
3897
|
}
|
|
4281
3898
|
}
|
|
4282
|
-
async function
|
|
3899
|
+
async function tt(e2, t2) {
|
|
4283
3900
|
if (!e2.init || e2.initialized) return Promise.resolve();
|
|
4284
3901
|
await e2.init(t2);
|
|
4285
3902
|
}
|
|
4286
|
-
function
|
|
4287
|
-
return
|
|
3903
|
+
function rt(e2, t2, r2, n2) {
|
|
3904
|
+
return e2.readUint8Array(t2, r2, n2);
|
|
4288
3905
|
}
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
}
|
|
4292
|
-
const mt = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""), gt = 256 == mt.length;
|
|
4293
|
-
function yt(e2, t2) {
|
|
3906
|
+
const nt = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""), st = 256 == nt.length;
|
|
3907
|
+
function at(e2, t2) {
|
|
4294
3908
|
return t2 && "cp437" == t2.trim().toLowerCase() ? (function(e3) {
|
|
4295
|
-
if (
|
|
3909
|
+
if (st) {
|
|
4296
3910
|
let t3 = "";
|
|
4297
|
-
for (let
|
|
3911
|
+
for (let r2 = 0; r2 < e3.length; r2++) t3 += nt[e3[r2]];
|
|
4298
3912
|
return t3;
|
|
4299
3913
|
}
|
|
4300
3914
|
return new TextDecoder().decode(e3);
|
|
4301
3915
|
})(e2) : new TextDecoder(t2).decode(e2);
|
|
4302
3916
|
}
|
|
4303
|
-
const
|
|
4304
|
-
class
|
|
3917
|
+
const it = "filename", ot = "rawFilename", ct = "comment", lt = "rawComment", ut = "uncompressedSize", dt = "compressedSize", ft = "offset", ht = "diskNumberStart", pt = "lastModDate", wt = "rawLastModDate", gt = "lastAccessDate", mt = "rawLastAccessDate", yt = "creationDate", bt = "rawCreationDate", St = [it, ot, ut, dt, pt, wt, ct, lt, gt, yt, bt, ft, ht, "internalFileAttributes", "externalFileAttributes", "msdosAttributesRaw", "msdosAttributes", "msDosCompatible", "zip64", "encrypted", "version", "versionMadeBy", "zipCrypto", "directory", "executable", "compressionMethod", "signature", "extraField", "extraFieldUnix", "extraFieldInfoZip", "uid", "gid", "unixMode", "setuid", "setgid", "sticky", "bitFlag", "filenameUTF8", "commentUTF8", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];
|
|
3918
|
+
class kt {
|
|
4305
3919
|
constructor(e2) {
|
|
4306
|
-
|
|
3920
|
+
St.forEach((t2) => this[t2] = e2[t2]);
|
|
4307
3921
|
}
|
|
4308
3922
|
}
|
|
4309
|
-
const
|
|
4310
|
-
class
|
|
3923
|
+
const zt = "File format is not recognized", xt = "Zip64 extra field not found", Ut = "Compression method not supported", At = "Split zip file", vt = "Overlapping entry found", Dt = "utf-8", _t = "cp437", Ft = [[ut, e$1], [dt, e$1], [ft, e$1], [ht, t$1]], Ot = { [t$1]: { getValue: Nt, bytes: 4 }, [e$1]: { getValue: Zt, bytes: 8 } };
|
|
3924
|
+
class Et {
|
|
4311
3925
|
constructor(e2, t2 = {}) {
|
|
4312
|
-
Object.assign(this, { reader:
|
|
4313
|
-
}
|
|
4314
|
-
async *getEntriesGenerator(
|
|
4315
|
-
const
|
|
4316
|
-
let { reader:
|
|
4317
|
-
const { config:
|
|
4318
|
-
if (await
|
|
4319
|
-
|
|
4320
|
-
return Math.max(
|
|
4321
|
-
})(
|
|
4322
|
-
const
|
|
4323
|
-
const
|
|
4324
|
-
!(function(
|
|
4325
|
-
|
|
4326
|
-
})(
|
|
4327
|
-
const
|
|
4328
|
-
return await
|
|
4329
|
-
async function
|
|
4330
|
-
const
|
|
4331
|
-
for (let
|
|
3926
|
+
Object.assign(this, { reader: new $e(e2), options: t2, config: p$1, readRanges: [] });
|
|
3927
|
+
}
|
|
3928
|
+
async *getEntriesGenerator(n2 = {}) {
|
|
3929
|
+
const l2 = this;
|
|
3930
|
+
let { reader: u } = l2;
|
|
3931
|
+
const { config: d } = l2;
|
|
3932
|
+
if (await tt(u), u.size !== c$1 && u.readUint8Array || (u = new Ge(await new Response(u.readable).blob()), await tt(u)), u.size < i$1) throw new Error(zt);
|
|
3933
|
+
u.chunkSize = (function(e2) {
|
|
3934
|
+
return Math.max(e2.chunkSize, 64);
|
|
3935
|
+
})(d);
|
|
3936
|
+
const f2 = await (async function(e2, t2, r2, n3, s2) {
|
|
3937
|
+
const a2 = new Uint8Array(4);
|
|
3938
|
+
!(function(e3, t3, r3) {
|
|
3939
|
+
e3.setUint32(t3, r3, true);
|
|
3940
|
+
})(qt(a2), 0, t2);
|
|
3941
|
+
const i2 = n3 + s2;
|
|
3942
|
+
return await o2(n3) || await o2(Math.min(i2, r2));
|
|
3943
|
+
async function o2(t3) {
|
|
3944
|
+
const s3 = r2 - t3, i3 = await rt(e2, s3, t3);
|
|
3945
|
+
for (let e3 = i3.length - n3; e3 >= 0; e3--) if (i3[e3] == a2[0] && i3[e3 + 1] == a2[1] && i3[e3 + 2] == a2[2] && i3[e3 + 3] == a2[3]) return { offset: s3 + e3, buffer: i3.slice(e3, e3 + n3).buffer };
|
|
4332
3946
|
}
|
|
4333
|
-
})(
|
|
4334
|
-
if (!
|
|
4335
|
-
throw
|
|
4336
|
-
}
|
|
4337
|
-
const
|
|
4338
|
-
let
|
|
4339
|
-
const
|
|
4340
|
-
let
|
|
4341
|
-
const
|
|
4342
|
-
let
|
|
4343
|
-
if (
|
|
4344
|
-
const
|
|
4345
|
-
if (117853008 ==
|
|
4346
|
-
|
|
4347
|
-
let
|
|
4348
|
-
const
|
|
4349
|
-
if (
|
|
4350
|
-
const
|
|
4351
|
-
|
|
3947
|
+
})(u, 101010256, u.size, i$1, 1048560);
|
|
3948
|
+
if (!f2) {
|
|
3949
|
+
throw Nt(qt(await rt(u, 0, 4))) == r$1 ? new Error(At) : new Error("End of central directory not found");
|
|
3950
|
+
}
|
|
3951
|
+
const h2 = qt(f2);
|
|
3952
|
+
let p2 = Nt(h2, 12), w = Nt(h2, 16);
|
|
3953
|
+
const g2 = f2.offset, m2 = Vt(h2, 20), y3 = g2 + i$1 + m2;
|
|
3954
|
+
let b3 = Vt(h2, 4);
|
|
3955
|
+
const S2 = u.lastDiskNumber || 0;
|
|
3956
|
+
let k2 = Vt(h2, 6), z2 = Vt(h2, 8), x2 = 0, U2 = 0;
|
|
3957
|
+
if (w == e$1 || p2 == e$1 || z2 == t$1 || k2 == t$1) {
|
|
3958
|
+
const r2 = qt(await rt(u, f2.offset - 20, 20));
|
|
3959
|
+
if (117853008 == Nt(r2, 0)) {
|
|
3960
|
+
w = Zt(r2, 8);
|
|
3961
|
+
let n3 = await rt(u, w, 56, -1), s2 = qt(n3);
|
|
3962
|
+
const i2 = f2.offset - 20 - 56;
|
|
3963
|
+
if (Nt(s2, 0) != a$1 && w != i2) {
|
|
3964
|
+
const e2 = w;
|
|
3965
|
+
w = i2, w > e2 && (x2 = w - e2), n3 = await rt(u, w, 56, -1), s2 = qt(n3);
|
|
4352
3966
|
}
|
|
4353
|
-
if (
|
|
4354
|
-
|
|
3967
|
+
if (Nt(s2, 0) != a$1) throw new Error("End of Zip64 central directory locator not found");
|
|
3968
|
+
b3 == t$1 && (b3 = Nt(s2, 16)), k2 == t$1 && (k2 = Nt(s2, 20)), z2 == t$1 && (z2 = Zt(s2, 32)), p2 == e$1 && (p2 = Zt(s2, 40)), w -= p2;
|
|
4355
3969
|
}
|
|
4356
3970
|
}
|
|
4357
|
-
if (
|
|
4358
|
-
if (
|
|
4359
|
-
let
|
|
4360
|
-
if (
|
|
4361
|
-
const
|
|
4362
|
-
if (
|
|
4363
|
-
const
|
|
4364
|
-
|
|
3971
|
+
if (w >= u.size && (x2 = u.size - w - p2 - i$1, w = u.size - p2 - i$1), S2 != b3) throw new Error(At);
|
|
3972
|
+
if (w < 0) throw new Error(zt);
|
|
3973
|
+
let A2 = 0, v2 = await rt(u, w, p2, k2), D2 = qt(v2);
|
|
3974
|
+
if (p2) {
|
|
3975
|
+
const e2 = f2.offset - p2;
|
|
3976
|
+
if (Nt(D2, A2) != s$1 && w != e2) {
|
|
3977
|
+
const t2 = w;
|
|
3978
|
+
w = e2, w > t2 && (x2 += w - t2), v2 = await rt(u, w, p2, k2), D2 = qt(v2);
|
|
4365
3979
|
}
|
|
4366
3980
|
}
|
|
4367
|
-
const
|
|
4368
|
-
if (
|
|
4369
|
-
const
|
|
4370
|
-
for (let
|
|
4371
|
-
const
|
|
4372
|
-
if (
|
|
4373
|
-
|
|
4374
|
-
const
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
let
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
const
|
|
4382
|
-
|
|
4383
|
-
const
|
|
4384
|
-
|
|
4385
|
-
await
|
|
4386
|
-
|
|
3981
|
+
const _2 = f2.offset - w - (u.lastDiskOffset || 0);
|
|
3982
|
+
if (p2 != _2 && _2 >= 0 && (p2 = _2, v2 = await rt(u, w, p2, k2), D2 = qt(v2)), w < 0 || w >= u.size) throw new Error(zt);
|
|
3983
|
+
const F2 = It(l2, n2, "filenameEncoding"), O2 = It(l2, n2, "commentEncoding");
|
|
3984
|
+
for (let e2 = 0; e2 < z2; e2++) {
|
|
3985
|
+
const r2 = new Tt(u, d, l2.options);
|
|
3986
|
+
if (Nt(D2, A2) != s$1) throw new Error("Central directory header not found");
|
|
3987
|
+
Ct(r2, D2, A2 + 6);
|
|
3988
|
+
const a2 = Boolean(r2.bitFlag.languageEncodingFlag), i2 = A2 + 46, f3 = i2 + r2.filenameLength, h3 = f3 + r2.extraFieldLength, p3 = Vt(D2, A2 + 4), w2 = !(p3 >> 8), g3 = p3 >> 8 == 3, m3 = v2.subarray(i2, f3), y4 = Vt(D2, A2 + 32), b4 = h3 + y4, S3 = v2.subarray(h3, b4), k3 = a2, _3 = a2, E3 = Nt(D2, A2 + 38), T3 = 255 & E3, C2 = { readOnly: Boolean(1 & T3), hidden: Boolean(2 & T3), system: Boolean(4 & T3), directory: Boolean(16 & T3), archive: Boolean(32 & T3) }, R2 = Nt(D2, A2 + 42) + x2, W2 = It(l2, n2, "decodeText") || at, M2 = k3 ? Dt : F2 || _t, j2 = _3 ? Dt : O2 || _t;
|
|
3989
|
+
let I2 = W2(m3, M2);
|
|
3990
|
+
I2 === c$1 && (I2 = at(m3, M2));
|
|
3991
|
+
let B2 = W2(S3, j2);
|
|
3992
|
+
B2 === c$1 && (B2 = at(S3, j2)), Object.assign(r2, { versionMadeBy: p3, msDosCompatible: w2, compressedSize: 0, uncompressedSize: 0, commentLength: y4, offset: R2, diskNumberStart: Vt(D2, A2 + 34), internalFileAttributes: Vt(D2, A2 + 36), externalFileAttributes: E3, msdosAttributesRaw: T3, msdosAttributes: C2, rawFilename: m3, filenameUTF8: k3, commentUTF8: _3, rawExtraField: v2.subarray(f3, h3), rawComment: S3, filename: I2, comment: B2 }), U2 = Math.max(R2, U2), Rt(r2, r2, D2, A2 + 6);
|
|
3993
|
+
const P2 = r2.externalFileAttributes >> 16 & t$1;
|
|
3994
|
+
r2.unixMode === c$1 && 16877 & P2 && (r2.unixMode = P2);
|
|
3995
|
+
const L2 = Boolean(2048 & r2.unixMode), V2 = Boolean(1024 & r2.unixMode), N2 = Boolean(512 & r2.unixMode), Z2 = r2.unixMode !== c$1 ? !!(73 & r2.unixMode) : g3 && !!(73 & P2), q2 = r2.unixMode !== c$1 && (61440 & r2.unixMode) == o$1, H2 = (61440 & P2) == o$1;
|
|
3996
|
+
Object.assign(r2, { setuid: L2, setgid: V2, sticky: N2, unixExternalUpper: P2, internalFileAttribute: r2.internalFileAttributes, externalFileAttribute: r2.externalFileAttributes, executable: Z2, directory: q2 || H2 || w2 && C2.directory || I2.endsWith("/") && !r2.uncompressedSize, zipCrypto: r2.encrypted && !r2.extraFieldAES });
|
|
3997
|
+
const K2 = new kt(r2);
|
|
3998
|
+
K2.getData = (e3, t2) => r2.getData(e3, K2, l2.readRanges, t2), K2.arrayBuffer = async (e3) => {
|
|
3999
|
+
const t2 = new TransformStream(), [n3] = await Promise.all([new Response(t2.readable).arrayBuffer(), r2.getData(t2, K2, l2.readRanges, e3)]);
|
|
4000
|
+
return n3;
|
|
4001
|
+
}, A2 = b4;
|
|
4002
|
+
const { onprogress: G2 } = n2;
|
|
4003
|
+
if (G2) try {
|
|
4004
|
+
await G2(e2 + 1, z2, new kt(r2));
|
|
4005
|
+
} catch {
|
|
4387
4006
|
}
|
|
4388
|
-
yield
|
|
4007
|
+
yield K2;
|
|
4389
4008
|
}
|
|
4390
|
-
const E2 =
|
|
4391
|
-
return E2 && (
|
|
4009
|
+
const E2 = It(l2, n2, "extractPrependedData"), T2 = It(l2, n2, "extractAppendedData");
|
|
4010
|
+
return E2 && (l2.prependedData = U2 > 0 ? await rt(u, 0, U2) : new Uint8Array()), l2.comment = m2 ? await rt(u, g2 + i$1, m2) : new Uint8Array(), T2 && (l2.appendedData = y3 < u.size ? await rt(u, y3, u.size - y3) : new Uint8Array()), true;
|
|
4392
4011
|
}
|
|
4393
4012
|
async getEntries(e2 = {}) {
|
|
4394
4013
|
const t2 = [];
|
|
4395
|
-
for await (const
|
|
4014
|
+
for await (const r2 of this.getEntriesGenerator(e2)) t2.push(r2);
|
|
4396
4015
|
return t2;
|
|
4397
4016
|
}
|
|
4398
4017
|
async close() {
|
|
4399
4018
|
}
|
|
4400
4019
|
}
|
|
4401
|
-
class
|
|
4402
|
-
constructor(e2, t2,
|
|
4403
|
-
Object.assign(this, { reader: e2, config: t2, options:
|
|
4404
|
-
}
|
|
4405
|
-
async getData(e2, t2,
|
|
4406
|
-
const
|
|
4407
|
-
let
|
|
4408
|
-
const
|
|
4409
|
-
if (
|
|
4410
|
-
if (0 !=
|
|
4411
|
-
if (67324752 !=
|
|
4412
|
-
|
|
4413
|
-
const
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
const
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
const {
|
|
4427
|
-
let
|
|
4020
|
+
class Tt {
|
|
4021
|
+
constructor(e2, t2, r2) {
|
|
4022
|
+
Object.assign(this, { reader: e2, config: t2, options: r2 });
|
|
4023
|
+
}
|
|
4024
|
+
async getData(e2, t2, r2, s2 = {}) {
|
|
4025
|
+
const a2 = this, { reader: i2, offset: o2, diskNumberStart: l2, extraFieldAES: u, extraFieldZip64: d, compressionMethod: f2, config: h2, bitFlag: p2, signature: w, rawLastModDate: g2, uncompressedSize: m2, compressedSize: y3 } = a2, { dataDescriptor: b3 } = p2, S2 = t2.localDirectory = {}, k2 = qt(await rt(i2, o2, 30, l2));
|
|
4026
|
+
let z2 = It(a2, s2, "password"), x2 = It(a2, s2, "rawPassword");
|
|
4027
|
+
const U2 = It(a2, s2, "passThrough");
|
|
4028
|
+
if (z2 = z2 && z2.length && z2, x2 = x2 && x2.length && x2, u && 99 != u.originalCompressionMethod) throw new Error(Ut);
|
|
4029
|
+
if (0 != f2 && 8 != f2 && 9 != f2 && !U2) throw new Error(Ut);
|
|
4030
|
+
if (67324752 != Nt(k2, 0)) throw new Error("Local file header not found");
|
|
4031
|
+
Ct(S2, k2, 4);
|
|
4032
|
+
const { extraFieldLength: A2, filenameLength: v2, lastAccessDate: D2, creationDate: _2 } = S2;
|
|
4033
|
+
S2.rawExtraField = A2 ? await rt(i2, o2 + 30 + v2, A2, l2) : new Uint8Array(), Rt(a2, S2, k2, 4, true), Object.assign(t2, { lastAccessDate: D2, creationDate: _2 });
|
|
4034
|
+
const F2 = a2.encrypted && S2.encrypted && !U2, E2 = F2 && !u;
|
|
4035
|
+
if (U2 || (t2.zipCrypto = E2), F2) {
|
|
4036
|
+
if (!E2 && u.strength === c$1) throw new Error("Encryption method not supported");
|
|
4037
|
+
if (!z2 && !x2) throw new Error("File contains encrypted entry");
|
|
4038
|
+
}
|
|
4039
|
+
const T2 = o2 + 30 + v2 + A2, C2 = y3, R2 = i2.readable;
|
|
4040
|
+
Object.assign(R2, { diskNumberStart: l2, offset: T2, size: C2 });
|
|
4041
|
+
const W2 = It(a2, s2, "signal"), M2 = It(a2, s2, "checkPasswordOnly");
|
|
4042
|
+
let j2 = It(a2, s2, "checkOverlappingEntry");
|
|
4043
|
+
const I2 = It(a2, s2, "checkOverlappingEntryOnly");
|
|
4044
|
+
I2 && (j2 = true);
|
|
4045
|
+
const { onstart: B2, onprogress: P2, onend: L2 } = s2, V2 = 9 == f2;
|
|
4046
|
+
let N2 = It(a2, s2, "useCompressionStream");
|
|
4047
|
+
V2 && (N2 = false);
|
|
4048
|
+
const Z2 = { options: { codecType: Ue, password: z2, rawPassword: x2, zipCrypto: E2, encryptionStrength: u && u.strength, signed: It(a2, s2, "checkSignature") && !U2, passwordVerification: E2 && (b3 ? g2 >>> 8 & 255 : w >>> 24 & 255), outputSize: U2 ? y3 : m2, signature: w, compressed: 0 != f2 && !U2, encrypted: a2.encrypted && !U2, useWebWorkers: It(a2, s2, "useWebWorkers"), useCompressionStream: N2, transferStreams: It(a2, s2, "transferStreams"), deflate64: V2, checkPasswordOnly: M2 }, config: h2, streamOptions: { signal: W2, size: C2, onstart: B2, onprogress: P2, onend: L2 } };
|
|
4049
|
+
let q2;
|
|
4050
|
+
j2 && await (async function({ reader: e3, fileEntry: t3, offset: r3, diskNumberStart: s3, signature: a3, compressedSize: i3, uncompressedSize: o3, dataOffset: c, dataDescriptor: l3, extraFieldZip64: u2, readRanges: d2 }) {
|
|
4051
|
+
let f3 = 0;
|
|
4052
|
+
if (s3) for (let t4 = 0; t4 < s3; t4++) {
|
|
4053
|
+
f3 += e3.readers[t4].size;
|
|
4054
|
+
}
|
|
4055
|
+
let h3 = 0;
|
|
4056
|
+
l3 && (h3 = u2 ? 20 : 12);
|
|
4057
|
+
if (h3) {
|
|
4058
|
+
const r4 = await rt(e3, c + i3, h3 + 4, s3);
|
|
4059
|
+
if (Nt(qt(r4), 0) == n$1) {
|
|
4060
|
+
const e4 = Nt(qt(r4), 4);
|
|
4061
|
+
let n2, s4;
|
|
4062
|
+
u2 ? (n2 = Zt(qt(r4), 8), s4 = Zt(qt(r4), 16)) : (n2 = Nt(qt(r4), 8), s4 = Nt(qt(r4), 12));
|
|
4063
|
+
(t3.encrypted && !t3.zipCrypto || e4 == a3) && n2 == i3 && s4 == o3 && (h3 += 4);
|
|
4064
|
+
}
|
|
4065
|
+
}
|
|
4066
|
+
const p3 = { start: f3 + r3, end: f3 + c + i3 + h3, fileEntry: t3 };
|
|
4067
|
+
for (const e4 of d2) if (e4.fileEntry != t3 && p3.start >= e4.start && p3.start < e4.end) {
|
|
4068
|
+
const t4 = new Error(vt);
|
|
4069
|
+
throw t4.overlappingEntry = e4.fileEntry, t4;
|
|
4070
|
+
}
|
|
4071
|
+
d2.push(p3);
|
|
4072
|
+
})({ reader: i2, fileEntry: t2, offset: o2, diskNumberStart: l2, signature: w, compressedSize: y3, uncompressedSize: m2, dataOffset: T2, dataDescriptor: b3 || S2.bitFlag.dataDescriptor, extraFieldZip64: d || S2.extraFieldZip64, readRanges: r2 });
|
|
4428
4073
|
try {
|
|
4429
|
-
(
|
|
4430
|
-
|
|
4431
|
-
|
|
4074
|
+
if (!I2) {
|
|
4075
|
+
M2 && (e2 = new WritableStream()), e2 = new et(e2), await tt(e2, U2 ? y3 : m2), { writable: q2 } = e2;
|
|
4076
|
+
const { outputSize: t3 } = await Ve({ readable: R2, writable: q2 }, Z2);
|
|
4077
|
+
if (e2.size += t3, t3 != (U2 ? y3 : m2)) throw new Error(pe);
|
|
4078
|
+
}
|
|
4079
|
+
} catch (t3) {
|
|
4080
|
+
if (t3.outputSize !== c$1 && (e2.size += t3.outputSize), !M2 || t3.message != O) throw t3;
|
|
4432
4081
|
} finally {
|
|
4433
|
-
|
|
4434
|
-
E2.size += W2, e3 || E2.locked || await E2.getWriter().close();
|
|
4082
|
+
It(a2, s2, "preventClose") || !q2 || q2.locked || await q2.getWriter().close();
|
|
4435
4083
|
}
|
|
4436
|
-
return
|
|
4084
|
+
return M2 || I2 ? c$1 : e2.getData ? e2.getData() : q2;
|
|
4437
4085
|
}
|
|
4438
4086
|
}
|
|
4439
|
-
function
|
|
4440
|
-
const
|
|
4441
|
-
Object.assign(e2, { encrypted:
|
|
4087
|
+
function Ct(e2, t2, r2) {
|
|
4088
|
+
const n2 = e2.rawBitFlag = Vt(t2, r2 + 2), s2 = !(1 & ~n2), a2 = Nt(t2, r2 + 6);
|
|
4089
|
+
Object.assign(e2, { encrypted: s2, version: Vt(t2, r2), bitFlag: { level: (6 & n2) >> 1, dataDescriptor: !(8 & ~n2), languageEncodingFlag: !(2048 & ~n2) }, rawLastModDate: a2, lastModDate: Bt(a2), filenameLength: Vt(t2, r2 + 22), extraFieldLength: Vt(t2, r2 + 24) });
|
|
4442
4090
|
}
|
|
4443
|
-
|
|
4444
|
-
const { rawExtraField: a2 } = t2,
|
|
4445
|
-
let
|
|
4091
|
+
function Rt(e2, t2, r2, n2, s2) {
|
|
4092
|
+
const { rawExtraField: a2 } = t2, i2 = t2.extraField = /* @__PURE__ */ new Map(), o2 = qt(new Uint8Array(a2));
|
|
4093
|
+
let c = 0;
|
|
4446
4094
|
try {
|
|
4447
|
-
for (;
|
|
4448
|
-
const e3 =
|
|
4449
|
-
|
|
4095
|
+
for (; c < a2.length; ) {
|
|
4096
|
+
const e3 = Vt(o2, c), t3 = Vt(o2, c + 2);
|
|
4097
|
+
i2.set(e3, { type: e3, data: a2.slice(c + 4, c + 4 + t3) }), c += 4 + t3;
|
|
4450
4098
|
}
|
|
4451
|
-
} catch
|
|
4099
|
+
} catch {
|
|
4452
4100
|
}
|
|
4453
|
-
const
|
|
4454
|
-
Object.assign(t2, { signature:
|
|
4455
|
-
const u =
|
|
4101
|
+
const l2 = Vt(r2, n2 + 4);
|
|
4102
|
+
Object.assign(t2, { signature: Nt(r2, n2 + 10), compressedSize: Nt(r2, n2 + 14), uncompressedSize: Nt(r2, n2 + 18) });
|
|
4103
|
+
const u = i2.get(1);
|
|
4456
4104
|
u && (!(function(e3, t3) {
|
|
4457
4105
|
t3.zip64 = true;
|
|
4458
|
-
const
|
|
4459
|
-
for (let
|
|
4460
|
-
const [
|
|
4461
|
-
if (t3[
|
|
4462
|
-
const
|
|
4463
|
-
t3[
|
|
4464
|
-
} else if (e3[
|
|
4106
|
+
const r3 = qt(e3.data), n3 = Ft.filter(([e4, r4]) => t3[e4] == r4);
|
|
4107
|
+
for (let s3 = 0, a3 = 0; s3 < n3.length; s3++) {
|
|
4108
|
+
const [i3, o3] = n3[s3];
|
|
4109
|
+
if (t3[i3] == o3) {
|
|
4110
|
+
const n4 = Ot[o3];
|
|
4111
|
+
t3[i3] = e3[i3] = n4.getValue(r3, a3), a3 += n4.bytes;
|
|
4112
|
+
} else if (e3[i3]) throw new Error(xt);
|
|
4465
4113
|
}
|
|
4466
4114
|
})(u, t2), t2.extraFieldZip64 = u);
|
|
4467
|
-
const d =
|
|
4468
|
-
d && (
|
|
4469
|
-
const f2 =
|
|
4470
|
-
f2 && (
|
|
4471
|
-
const h2 =
|
|
4472
|
-
h2 ? (!(function(e3, t3,
|
|
4473
|
-
const
|
|
4474
|
-
Object.assign(e3, { vendorVersion:
|
|
4475
|
-
})(h2, t2,
|
|
4476
|
-
const
|
|
4477
|
-
|
|
4478
|
-
const
|
|
4479
|
-
let
|
|
4115
|
+
const d = i2.get(28789);
|
|
4116
|
+
d && (Wt(d, it, ot, t2, e2), t2.extraFieldUnicodePath = d);
|
|
4117
|
+
const f2 = i2.get(25461);
|
|
4118
|
+
f2 && (Wt(f2, ct, lt, t2, e2), t2.extraFieldUnicodeComment = f2);
|
|
4119
|
+
const h2 = i2.get(39169);
|
|
4120
|
+
h2 ? (!(function(e3, t3, r3) {
|
|
4121
|
+
const n3 = qt(e3.data), s3 = Lt(n3, 4);
|
|
4122
|
+
Object.assign(e3, { vendorVersion: Lt(n3, 0), vendorId: Lt(n3, 2), strength: s3, originalCompressionMethod: r3, compressionMethod: Vt(n3, 5) }), t3.compressionMethod = e3.compressionMethod;
|
|
4123
|
+
})(h2, t2, l2), t2.extraFieldAES = h2) : t2.compressionMethod = l2;
|
|
4124
|
+
const p2 = i2.get(10);
|
|
4125
|
+
p2 && (!(function(e3, t3) {
|
|
4126
|
+
const r3 = qt(e3.data);
|
|
4127
|
+
let n3, s3 = 4;
|
|
4480
4128
|
try {
|
|
4481
|
-
for (;
|
|
4482
|
-
const t4 =
|
|
4483
|
-
1 == t4 && (
|
|
4129
|
+
for (; s3 < e3.data.length && !n3; ) {
|
|
4130
|
+
const t4 = Vt(r3, s3), a3 = Vt(r3, s3 + 2);
|
|
4131
|
+
1 == t4 && (n3 = e3.data.slice(s3 + 4, s3 + 4 + a3)), s3 += 4 + a3;
|
|
4484
4132
|
}
|
|
4485
|
-
} catch
|
|
4133
|
+
} catch {
|
|
4486
4134
|
}
|
|
4487
4135
|
try {
|
|
4488
|
-
if (
|
|
4489
|
-
const
|
|
4490
|
-
Object.assign(e3, { rawLastModDate:
|
|
4491
|
-
const o3 =
|
|
4492
|
-
Object.assign(e3,
|
|
4136
|
+
if (n3 && 24 == n3.length) {
|
|
4137
|
+
const r4 = qt(n3), s4 = r4.getBigUint64(0, true), a3 = r4.getBigUint64(8, true), i3 = r4.getBigUint64(16, true);
|
|
4138
|
+
Object.assign(e3, { rawLastModDate: s4, rawLastAccessDate: a3, rawCreationDate: i3 });
|
|
4139
|
+
const o3 = Pt(s4), c2 = Pt(a3), l3 = { lastModDate: o3, lastAccessDate: c2, creationDate: Pt(i3) };
|
|
4140
|
+
Object.assign(e3, l3), Object.assign(t3, l3);
|
|
4493
4141
|
}
|
|
4494
|
-
} catch
|
|
4142
|
+
} catch {
|
|
4495
4143
|
}
|
|
4496
|
-
})(
|
|
4497
|
-
const
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4144
|
+
})(p2, t2), t2.extraFieldNTFS = p2);
|
|
4145
|
+
const w = i2.get(30805);
|
|
4146
|
+
if (w) Mt(w, t2, false), t2.extraFieldUnix = w;
|
|
4147
|
+
else {
|
|
4148
|
+
const e3 = i2.get(30837);
|
|
4149
|
+
e3 && (Mt(e3, t2, true), t2.extraFieldInfoZip = e3);
|
|
4150
|
+
}
|
|
4151
|
+
const g2 = i2.get(21589);
|
|
4152
|
+
g2 && (!(function(e3, t3, r3) {
|
|
4153
|
+
const n3 = qt(e3.data), s3 = Lt(n3, 0), a3 = [], i3 = [];
|
|
4154
|
+
r3 ? (1 & ~s3 || (a3.push(pt), i3.push(wt)), 2 & ~s3 || (a3.push(gt), i3.push(mt)), 4 & ~s3 || (a3.push(yt), i3.push(bt))) : e3.data.length >= 5 && (a3.push(pt), i3.push(wt));
|
|
4501
4155
|
let o3 = 1;
|
|
4502
|
-
a3.forEach((
|
|
4156
|
+
a3.forEach((r4, s4) => {
|
|
4503
4157
|
if (e3.data.length >= o3 + 4) {
|
|
4504
|
-
const a4 =
|
|
4505
|
-
t3[
|
|
4506
|
-
const
|
|
4507
|
-
e3[
|
|
4158
|
+
const a4 = Nt(n3, o3);
|
|
4159
|
+
t3[r4] = e3[r4] = new Date(1e3 * a4);
|
|
4160
|
+
const c2 = i3[s4];
|
|
4161
|
+
e3[c2] = a4;
|
|
4508
4162
|
}
|
|
4509
4163
|
o3 += 4;
|
|
4510
|
-
})
|
|
4511
|
-
})(
|
|
4512
|
-
const
|
|
4513
|
-
|
|
4514
|
-
}
|
|
4515
|
-
|
|
4516
|
-
const a2 =
|
|
4517
|
-
|
|
4518
|
-
const o2 =
|
|
4519
|
-
o2.setUint32(0,
|
|
4520
|
-
const
|
|
4521
|
-
Object.assign(e2, { version:
|
|
4522
|
-
}
|
|
4523
|
-
function
|
|
4524
|
-
return t2[n2] === S ? e2.options[n2] : t2[n2];
|
|
4525
|
-
}
|
|
4526
|
-
function Xt(e2) {
|
|
4527
|
-
const t2 = (4294901760 & e2) >> 16, n2 = 65535 & e2;
|
|
4164
|
+
});
|
|
4165
|
+
})(g2, t2, s2), t2.extraFieldExtendedTimestamp = g2);
|
|
4166
|
+
const m2 = i2.get(6534);
|
|
4167
|
+
m2 && (t2.extraFieldUSDZ = m2);
|
|
4168
|
+
}
|
|
4169
|
+
function Wt(e2, t2, r2, n2, s2) {
|
|
4170
|
+
const a2 = qt(e2.data), i2 = new y$1();
|
|
4171
|
+
i2.append(s2[r2]);
|
|
4172
|
+
const o2 = qt(new Uint8Array(4));
|
|
4173
|
+
o2.setUint32(0, i2.get(), true);
|
|
4174
|
+
const c = Nt(a2, 1);
|
|
4175
|
+
Object.assign(e2, { version: Lt(a2, 0), [t2]: at(e2.data.subarray(5)), valid: !s2.bitFlag.languageEncodingFlag && c == Nt(o2, 0) }), e2.valid && (n2[t2] = e2[t2], n2[t2 + "UTF8"] = true);
|
|
4176
|
+
}
|
|
4177
|
+
function Mt(e2, t2, r2) {
|
|
4528
4178
|
try {
|
|
4529
|
-
|
|
4530
|
-
|
|
4179
|
+
const n2 = qt(new Uint8Array(e2.data));
|
|
4180
|
+
let s2 = 0;
|
|
4181
|
+
const a2 = Lt(n2, s2++), i2 = Lt(n2, s2++), o2 = e2.data.subarray(s2, s2 + i2);
|
|
4182
|
+
s2 += i2;
|
|
4183
|
+
const l2 = jt(o2), u = Lt(n2, s2++), d = e2.data.subarray(s2, s2 + u);
|
|
4184
|
+
s2 += u;
|
|
4185
|
+
const f2 = jt(d);
|
|
4186
|
+
let h2 = c$1;
|
|
4187
|
+
if (!r2 && s2 + 2 <= e2.data.length) {
|
|
4188
|
+
const t3 = e2.data;
|
|
4189
|
+
h2 = new DataView(t3.buffer, t3.byteOffset + s2, 2).getUint16(0, true);
|
|
4190
|
+
}
|
|
4191
|
+
Object.assign(e2, { version: a2, uid: l2, gid: f2, unixMode: h2 }), l2 !== c$1 && (t2.uid = l2), f2 !== c$1 && (t2.gid = f2), h2 !== c$1 && (t2.unixMode = h2);
|
|
4192
|
+
} catch {
|
|
4193
|
+
}
|
|
4194
|
+
}
|
|
4195
|
+
function jt(e2) {
|
|
4196
|
+
const t2 = new Uint8Array(4);
|
|
4197
|
+
t2.set(e2, 0);
|
|
4198
|
+
return new DataView(t2.buffer, t2.byteOffset, 4).getUint32(0, true);
|
|
4199
|
+
}
|
|
4200
|
+
function It(e2, t2, r2) {
|
|
4201
|
+
return t2[r2] === c$1 ? e2.options[r2] : t2[r2];
|
|
4202
|
+
}
|
|
4203
|
+
function Bt(e2) {
|
|
4204
|
+
const r2 = (4294901760 & e2) >> 16, n2 = e2 & t$1;
|
|
4205
|
+
try {
|
|
4206
|
+
return new Date(1980 + ((65024 & r2) >> 9), ((480 & r2) >> 5) - 1, 31 & r2, (63488 & n2) >> 11, (2016 & n2) >> 5, 2 * (31 & n2), 0);
|
|
4207
|
+
} catch {
|
|
4531
4208
|
}
|
|
4532
4209
|
}
|
|
4533
|
-
function
|
|
4210
|
+
function Pt(e2) {
|
|
4534
4211
|
return new Date(Number(e2 / BigInt(1e4) - BigInt(116444736e5)));
|
|
4535
4212
|
}
|
|
4536
|
-
function
|
|
4213
|
+
function Lt(e2, t2) {
|
|
4537
4214
|
return e2.getUint8(t2);
|
|
4538
4215
|
}
|
|
4539
|
-
function
|
|
4216
|
+
function Vt(e2, t2) {
|
|
4540
4217
|
return e2.getUint16(t2, true);
|
|
4541
4218
|
}
|
|
4542
|
-
function
|
|
4219
|
+
function Nt(e2, t2) {
|
|
4543
4220
|
return e2.getUint32(t2, true);
|
|
4544
4221
|
}
|
|
4545
|
-
function
|
|
4222
|
+
function Zt(e2, t2) {
|
|
4546
4223
|
return Number(e2.getBigUint64(t2, true));
|
|
4547
4224
|
}
|
|
4548
|
-
function
|
|
4225
|
+
function qt(e2) {
|
|
4549
4226
|
return new DataView(e2.buffer);
|
|
4550
4227
|
}
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
const o2 = [];
|
|
4556
|
-
let l2, c, u = 0, d = 0, f2 = 0;
|
|
4557
|
-
if (0 !== e3.length) {
|
|
4558
|
-
t2.next_in_index = 0, t2.next_in = e3, t2.avail_in = e3.length;
|
|
4559
|
-
do {
|
|
4560
|
-
if (t2.next_out_index = 0, t2.avail_out = i2, 0 !== t2.avail_in || a2 || (t2.next_in_index = 0, a2 = true), l2 = t2.inflate(0), a2 && l2 === n$1) {
|
|
4561
|
-
if (0 !== t2.avail_in) throw new Error("inflating: bad input");
|
|
4562
|
-
} else if (0 !== l2 && 1 !== l2) throw new Error("inflating: " + t2.msg);
|
|
4563
|
-
if ((a2 || 1 === l2) && t2.avail_in === e3.length) throw new Error("inflating: bad input");
|
|
4564
|
-
t2.next_out_index && (t2.next_out_index === i2 ? o2.push(new Uint8Array(r2)) : o2.push(r2.subarray(0, t2.next_out_index))), f2 += t2.next_out_index, s2 && t2.next_in_index > 0 && t2.next_in_index != u && (s2(t2.next_in_index), u = t2.next_in_index);
|
|
4565
|
-
} while (t2.avail_in > 0 || 0 === t2.avail_out);
|
|
4566
|
-
return o2.length > 1 ? (c = new Uint8Array(f2), o2.forEach((function(e4) {
|
|
4567
|
-
c.set(e4, d), d += e4.length;
|
|
4568
|
-
}))) : c = o2[0] ? new Uint8Array(o2[0]) : new Uint8Array(), c;
|
|
4569
|
-
}
|
|
4570
|
-
}, this.flush = function() {
|
|
4571
|
-
t2.inflateEnd();
|
|
4572
|
-
};
|
|
4573
|
-
} });
|
|
4228
|
+
try {
|
|
4229
|
+
w$1({ baseURI: import.meta.url });
|
|
4230
|
+
} catch {
|
|
4231
|
+
}
|
|
4574
4232
|
const zip = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4575
4233
|
__proto__: null,
|
|
4576
|
-
BlobReader:
|
|
4577
|
-
BlobWriter:
|
|
4578
|
-
TextWriter:
|
|
4579
|
-
ZipReader:
|
|
4580
|
-
configure:
|
|
4234
|
+
BlobReader: Ge,
|
|
4235
|
+
BlobWriter: Je,
|
|
4236
|
+
TextWriter: Qe,
|
|
4237
|
+
ZipReader: Et,
|
|
4238
|
+
configure: w$1
|
|
4581
4239
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4582
4240
|
const NS$2 = {
|
|
4583
4241
|
CONTAINER: "urn:oasis:names:tc:opendocument:xmlns:container",
|
|
@@ -4697,9 +4355,9 @@ const getPrefixes = (doc) => {
|
|
|
4697
4355
|
};
|
|
4698
4356
|
const getPropertyURL = (value, prefixes) => {
|
|
4699
4357
|
if (!value) return null;
|
|
4700
|
-
const [a2,
|
|
4701
|
-
const prefix =
|
|
4702
|
-
const reference =
|
|
4358
|
+
const [a2, b3] = value.split(":");
|
|
4359
|
+
const prefix = b3 ? a2 : null;
|
|
4360
|
+
const reference = b3 ? b3 : a2;
|
|
4703
4361
|
const baseURL = prefixes.get(prefix);
|
|
4704
4362
|
return baseURL ? baseURL + reference : null;
|
|
4705
4363
|
};
|
|
@@ -4748,7 +4406,7 @@ const getMetadata = (opf) => {
|
|
|
4748
4406
|
if (!alts.length && (!x2.lang || x2.lang === baseLang) && !altRep) return x2.value;
|
|
4749
4407
|
const map = { [x2.lang ?? baseLang]: x2.value };
|
|
4750
4408
|
if (altRep) map[x2.attrs["alt-rep-lang"]] = altRep;
|
|
4751
|
-
for (const
|
|
4409
|
+
for (const y3 of alts) map[y3.lang] ??= y3.value;
|
|
4752
4410
|
return map;
|
|
4753
4411
|
};
|
|
4754
4412
|
const makeContributor = (x2) => {
|
|
@@ -4799,7 +4457,7 @@ const getMetadata = (opf) => {
|
|
|
4799
4457
|
subtitle: (_h = (_g = dc.title) == null ? void 0 : _g.find((x2) => prop(x2, "title-type") === "subtitle")) == null ? void 0 : _h.value,
|
|
4800
4458
|
language: (_i = dc.language) == null ? void 0 : _i.map((x2) => x2.value),
|
|
4801
4459
|
description: one(dc.description),
|
|
4802
|
-
publisher:
|
|
4460
|
+
publisher: (_j = dc.publisher) == null ? void 0 : _j.map(makeContributor),
|
|
4803
4461
|
published: ((_l = (_k = dc.date) == null ? void 0 : _k.find((x2) => x2.attrs.event === "publication")) == null ? void 0 : _l.value) ?? one(dc.date),
|
|
4804
4462
|
modified: one(properties[PREFIX.dcterms + "modified"]) ?? ((_n = (_m = dc.date) == null ? void 0 : _m.find((x2) => x2.attrs.event === "modification")) == null ? void 0 : _n.value),
|
|
4805
4463
|
subject: (_o = dc.subject) == null ? void 0 : _o.map(makeContributor),
|
|
@@ -4813,7 +4471,9 @@ const getMetadata = (opf) => {
|
|
|
4813
4471
|
altIdentifier: (_r = dc.identifier) == null ? void 0 : _r.map(makeAltIdentifier),
|
|
4814
4472
|
source: (_s = dc.source) == null ? void 0 : _s.map(makeAltIdentifier),
|
|
4815
4473
|
// NOTE: not in webpub schema
|
|
4816
|
-
rights: one(dc.rights)
|
|
4474
|
+
rights: one(dc.rights),
|
|
4475
|
+
// NOTE: not in webpub schema
|
|
4476
|
+
pageBreakSource: one(properties["pageBreakSource"])
|
|
4817
4477
|
// NOTE: not in webpub schema
|
|
4818
4478
|
};
|
|
4819
4479
|
const remapContributor = (defaultKey) => (x2) => {
|
|
@@ -5568,7 +5228,7 @@ const makeComicBook = ({ entries, loadBlob, getSize }, file) => {
|
|
|
5568
5228
|
cache.delete(name);
|
|
5569
5229
|
};
|
|
5570
5230
|
const exts = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".jxl", ".avif"];
|
|
5571
|
-
const files = entries.map((entry) => entry.filename).filter((name) => exts.some((ext) => name.endsWith(ext))).sort();
|
|
5231
|
+
const files = entries.map((entry) => entry.filename).filter((name) => exts.some((ext) => name.endsWith(ext))).sort(new Intl.Collator([], { numeric: true }).compare);
|
|
5572
5232
|
if (!files.length) throw new Error("No supported image files in archive");
|
|
5573
5233
|
const book = {};
|
|
5574
5234
|
book.getCover = () => loadBlob(files[0]);
|
|
@@ -5879,7 +5539,7 @@ const makeFB2 = async (blob) => {
|
|
|
5879
5539
|
var _a2;
|
|
5880
5540
|
return ((_a2 = el2.getAttribute("src")) == null ? void 0 : _a2.length) ?? 0;
|
|
5881
5541
|
}
|
|
5882
|
-
).reduce((a2,
|
|
5542
|
+
).reduce((a2, b3) => a2 + b3, 0),
|
|
5883
5543
|
linear
|
|
5884
5544
|
};
|
|
5885
5545
|
});
|
|
@@ -5901,8 +5561,8 @@ const makeFB2 = async (blob) => {
|
|
|
5901
5561
|
};
|
|
5902
5562
|
}).filter((item) => item);
|
|
5903
5563
|
book.resolveHref = (href) => {
|
|
5904
|
-
const [a2,
|
|
5905
|
-
return a2 ? { index: Number(a2), anchor: (doc2) => doc2.querySelector(`[${dataID}="${
|
|
5564
|
+
const [a2, b3] = href.split("#");
|
|
5565
|
+
return a2 ? { index: Number(a2), anchor: (doc2) => doc2.querySelector(`[${dataID}="${b3}"]`) } : { index: idMap.get(b3), anchor: (doc2) => doc2.getElementById(b3) };
|
|
5906
5566
|
};
|
|
5907
5567
|
book.splitTOCHref = (href) => {
|
|
5908
5568
|
var _a;
|
|
@@ -5918,6 +5578,415 @@ const fb2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
5918
5578
|
__proto__: null,
|
|
5919
5579
|
makeFB2
|
|
5920
5580
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5581
|
+
const textLayerBuilderCSS = '/* Copyright 2014 Mozilla Foundation\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the "License");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an "AS IS" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n.textLayer {\r\n color-scheme: only light;\r\n\r\n position: absolute;\r\n text-align: initial;\r\n inset: 0;\r\n overflow: clip;\r\n opacity: 1;\r\n line-height: 1;\r\n text-size-adjust: none;\r\n forced-color-adjust: none;\r\n transform-origin: 0 0;\r\n caret-color: CanvasText;\r\n z-index: 0;\r\n\r\n &.highlighting {\r\n touch-action: none;\r\n }\r\n\r\n :is(span, br) {\r\n color: transparent;\r\n position: absolute;\r\n white-space: pre;\r\n cursor: text;\r\n transform-origin: 0% 0%;\r\n }\r\n\r\n /* We multiply the font size by --min-font-size, and then scale the text\r\n * elements by 1/--min-font-size. This allows us to effectively ignore the\r\n * minimum font size enforced by the browser, so that the text layer <span>s\r\n * can always match the size of the text in the canvas. */\r\n --min-font-size: 1;\r\n --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));\r\n --min-font-size-inv: calc(1 / var(--min-font-size));\r\n\r\n > :not(.markedContent),\r\n .markedContent span:not(.markedContent) {\r\n z-index: 1;\r\n\r\n --font-height: 0; /* set by text_layer.js */\r\n font-size: calc(var(--text-scale-factor) * var(--font-height));\r\n\r\n --scale-x: 1;\r\n --rotate: 0deg;\r\n transform: rotate(var(--rotate)) scaleX(var(--scale-x))\r\n scale(var(--min-font-size-inv));\r\n }\r\n\r\n .markedContent {\r\n display: contents;\r\n }\r\n\r\n span[role="img"] {\r\n user-select: none;\r\n cursor: default;\r\n }\r\n\r\n .highlight {\r\n --highlight-bg-color: rgb(180 0 170 / 0.25);\r\n --highlight-selected-bg-color: rgb(0 100 0 / 0.25);\r\n --highlight-backdrop-filter: none;\r\n --highlight-selected-backdrop-filter: none;\r\n\r\n @media screen and (forced-colors: active) {\r\n --highlight-bg-color: transparent;\r\n --highlight-selected-bg-color: transparent;\r\n --highlight-backdrop-filter: var(--hcm-highlight-filter);\r\n --highlight-selected-backdrop-filter: var(\r\n --hcm-highlight-selected-filter\r\n );\r\n }\r\n\r\n margin: -1px;\r\n padding: 1px;\r\n background-color: var(--highlight-bg-color);\r\n backdrop-filter: var(--highlight-backdrop-filter);\r\n border-radius: 4px;\r\n\r\n &.appended {\r\n position: initial;\r\n }\r\n\r\n &.begin {\r\n border-radius: 4px 0 0 4px;\r\n }\r\n\r\n &.end {\r\n border-radius: 0 4px 4px 0;\r\n }\r\n\r\n &.middle {\r\n border-radius: 0;\r\n }\r\n\r\n &.selected {\r\n background-color: var(--highlight-selected-bg-color);\r\n backdrop-filter: var(--highlight-selected-backdrop-filter);\r\n }\r\n }\r\n\r\n ::selection {\r\n /* stylelint-disable declaration-block-no-duplicate-properties */\r\n /*#if !MOZCENTRAL*/\r\n background: rgba(0 0 255 / 0.25);\r\n /*#endif*/\r\n /* stylelint-enable declaration-block-no-duplicate-properties */\r\n background: color-mix(in srgb, AccentColor, transparent 75%);\r\n }\r\n\r\n /* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */\r\n /*#if !MOZCENTRAL*/\r\n br::selection {\r\n background: transparent;\r\n }\r\n /*#endif*/\r\n\r\n .endOfContent {\r\n display: block;\r\n position: absolute;\r\n inset: 100% 0 0;\r\n z-index: 0;\r\n cursor: default;\r\n user-select: none;\r\n }\r\n\r\n &.selecting .endOfContent {\r\n top: 0;\r\n }\r\n}\r\n';
|
|
5582
|
+
const annotationLayerBuilderCSS = `/* Copyright 2014 Mozilla Foundation\r
|
|
5583
|
+
*\r
|
|
5584
|
+
* Licensed under the Apache License, Version 2.0 (the "License");\r
|
|
5585
|
+
* you may not use this file except in compliance with the License.\r
|
|
5586
|
+
* You may obtain a copy of the License at\r
|
|
5587
|
+
*\r
|
|
5588
|
+
* http://www.apache.org/licenses/LICENSE-2.0\r
|
|
5589
|
+
*\r
|
|
5590
|
+
* Unless required by applicable law or agreed to in writing, software\r
|
|
5591
|
+
* distributed under the License is distributed on an "AS IS" BASIS,\r
|
|
5592
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
|
|
5593
|
+
* See the License for the specific language governing permissions and\r
|
|
5594
|
+
* limitations under the License.\r
|
|
5595
|
+
*/\r
|
|
5596
|
+
\r
|
|
5597
|
+
.annotationLayer {\r
|
|
5598
|
+
color-scheme: only light;\r
|
|
5599
|
+
\r
|
|
5600
|
+
--annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");\r
|
|
5601
|
+
--input-focus-border-color: Highlight;\r
|
|
5602
|
+
--input-focus-outline: 1px solid Canvas;\r
|
|
5603
|
+
--input-unfocused-border-color: transparent;\r
|
|
5604
|
+
--input-disabled-border-color: transparent;\r
|
|
5605
|
+
--input-hover-border-color: black;\r
|
|
5606
|
+
--link-outline: none;\r
|
|
5607
|
+
\r
|
|
5608
|
+
@media screen and (forced-colors: active) {\r
|
|
5609
|
+
--input-focus-border-color: CanvasText;\r
|
|
5610
|
+
--input-unfocused-border-color: ActiveText;\r
|
|
5611
|
+
--input-disabled-border-color: GrayText;\r
|
|
5612
|
+
--input-hover-border-color: Highlight;\r
|
|
5613
|
+
--link-outline: 1.5px solid LinkText;\r
|
|
5614
|
+
\r
|
|
5615
|
+
.textWidgetAnnotation :is(input, textarea):required,\r
|
|
5616
|
+
.choiceWidgetAnnotation select:required,\r
|
|
5617
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required {\r
|
|
5618
|
+
outline: 1.5px solid selectedItem;\r
|
|
5619
|
+
}\r
|
|
5620
|
+
\r
|
|
5621
|
+
.linkAnnotation {\r
|
|
5622
|
+
outline: var(--link-outline);\r
|
|
5623
|
+
\r
|
|
5624
|
+
&:hover {\r
|
|
5625
|
+
backdrop-filter: var(--hcm-highlight-filter);\r
|
|
5626
|
+
}\r
|
|
5627
|
+
\r
|
|
5628
|
+
& > a:hover {\r
|
|
5629
|
+
opacity: 0 !important;\r
|
|
5630
|
+
background: none !important;\r
|
|
5631
|
+
box-shadow: none;\r
|
|
5632
|
+
}\r
|
|
5633
|
+
}\r
|
|
5634
|
+
\r
|
|
5635
|
+
.popupAnnotation .popup {\r
|
|
5636
|
+
outline: calc(1.5px * var(--total-scale-factor)) solid CanvasText !important;\r
|
|
5637
|
+
background-color: ButtonFace !important;\r
|
|
5638
|
+
color: ButtonText !important;\r
|
|
5639
|
+
}\r
|
|
5640
|
+
\r
|
|
5641
|
+
.highlightArea:hover::after {\r
|
|
5642
|
+
position: absolute;\r
|
|
5643
|
+
top: 0;\r
|
|
5644
|
+
left: 0;\r
|
|
5645
|
+
width: 100%;\r
|
|
5646
|
+
height: 100%;\r
|
|
5647
|
+
backdrop-filter: var(--hcm-highlight-filter);\r
|
|
5648
|
+
content: "";\r
|
|
5649
|
+
pointer-events: none;\r
|
|
5650
|
+
}\r
|
|
5651
|
+
\r
|
|
5652
|
+
.popupAnnotation.focused .popup {\r
|
|
5653
|
+
outline: calc(3px * var(--total-scale-factor)) solid Highlight !important;\r
|
|
5654
|
+
}\r
|
|
5655
|
+
}\r
|
|
5656
|
+
\r
|
|
5657
|
+
position: absolute;\r
|
|
5658
|
+
top: 0;\r
|
|
5659
|
+
left: 0;\r
|
|
5660
|
+
pointer-events: none;\r
|
|
5661
|
+
transform-origin: 0 0;\r
|
|
5662
|
+
\r
|
|
5663
|
+
&[data-main-rotation="90"] .norotate {\r
|
|
5664
|
+
transform: rotate(270deg) translateX(-100%);\r
|
|
5665
|
+
}\r
|
|
5666
|
+
&[data-main-rotation="180"] .norotate {\r
|
|
5667
|
+
transform: rotate(180deg) translate(-100%, -100%);\r
|
|
5668
|
+
}\r
|
|
5669
|
+
&[data-main-rotation="270"] .norotate {\r
|
|
5670
|
+
transform: rotate(90deg) translateY(-100%);\r
|
|
5671
|
+
}\r
|
|
5672
|
+
\r
|
|
5673
|
+
&.disabled {\r
|
|
5674
|
+
section,\r
|
|
5675
|
+
.popup {\r
|
|
5676
|
+
pointer-events: none;\r
|
|
5677
|
+
}\r
|
|
5678
|
+
}\r
|
|
5679
|
+
\r
|
|
5680
|
+
.annotationContent {\r
|
|
5681
|
+
position: absolute;\r
|
|
5682
|
+
width: 100%;\r
|
|
5683
|
+
height: 100%;\r
|
|
5684
|
+
pointer-events: none;\r
|
|
5685
|
+
\r
|
|
5686
|
+
&.freetext {\r
|
|
5687
|
+
background: transparent;\r
|
|
5688
|
+
border: none;\r
|
|
5689
|
+
inset: 0;\r
|
|
5690
|
+
overflow: visible;\r
|
|
5691
|
+
white-space: nowrap;\r
|
|
5692
|
+
font: 10px sans-serif;\r
|
|
5693
|
+
line-height: 1.35;\r
|
|
5694
|
+
}\r
|
|
5695
|
+
}\r
|
|
5696
|
+
\r
|
|
5697
|
+
section {\r
|
|
5698
|
+
position: absolute;\r
|
|
5699
|
+
text-align: initial;\r
|
|
5700
|
+
pointer-events: auto;\r
|
|
5701
|
+
box-sizing: border-box;\r
|
|
5702
|
+
transform-origin: 0 0;\r
|
|
5703
|
+
user-select: none;\r
|
|
5704
|
+
\r
|
|
5705
|
+
&:has(div.annotationContent) {\r
|
|
5706
|
+
canvas.annotationContent {\r
|
|
5707
|
+
display: none;\r
|
|
5708
|
+
}\r
|
|
5709
|
+
}\r
|
|
5710
|
+
\r
|
|
5711
|
+
.overlaidText {\r
|
|
5712
|
+
position: absolute;\r
|
|
5713
|
+
top: 0;\r
|
|
5714
|
+
left: 0;\r
|
|
5715
|
+
width: 0;\r
|
|
5716
|
+
height: 0;\r
|
|
5717
|
+
display: inline-block;\r
|
|
5718
|
+
overflow: hidden;\r
|
|
5719
|
+
}\r
|
|
5720
|
+
}\r
|
|
5721
|
+
\r
|
|
5722
|
+
.textLayer.selecting ~ & section {\r
|
|
5723
|
+
pointer-events: none;\r
|
|
5724
|
+
}\r
|
|
5725
|
+
\r
|
|
5726
|
+
:is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a {\r
|
|
5727
|
+
position: absolute;\r
|
|
5728
|
+
font-size: 1em;\r
|
|
5729
|
+
top: 0;\r
|
|
5730
|
+
left: 0;\r
|
|
5731
|
+
width: 100%;\r
|
|
5732
|
+
height: 100%;\r
|
|
5733
|
+
}\r
|
|
5734
|
+
\r
|
|
5735
|
+
:is(.linkAnnotation, .buttonWidgetAnnotation.pushButton):not(.hasBorder)\r
|
|
5736
|
+
> a:hover {\r
|
|
5737
|
+
opacity: 0.2;\r
|
|
5738
|
+
background-color: rgb(255 255 0);\r
|
|
5739
|
+
}\r
|
|
5740
|
+
\r
|
|
5741
|
+
.linkAnnotation.hasBorder:hover {\r
|
|
5742
|
+
background-color: rgb(255 255 0 / 0.2);\r
|
|
5743
|
+
}\r
|
|
5744
|
+
\r
|
|
5745
|
+
.hasBorder {\r
|
|
5746
|
+
background-size: 100% 100%;\r
|
|
5747
|
+
}\r
|
|
5748
|
+
\r
|
|
5749
|
+
.textAnnotation img {\r
|
|
5750
|
+
position: absolute;\r
|
|
5751
|
+
cursor: pointer;\r
|
|
5752
|
+
width: 100%;\r
|
|
5753
|
+
height: 100%;\r
|
|
5754
|
+
top: 0;\r
|
|
5755
|
+
left: 0;\r
|
|
5756
|
+
}\r
|
|
5757
|
+
\r
|
|
5758
|
+
.textWidgetAnnotation :is(input, textarea),\r
|
|
5759
|
+
.choiceWidgetAnnotation select,\r
|
|
5760
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input {\r
|
|
5761
|
+
background-image: var(--annotation-unfocused-field-background);\r
|
|
5762
|
+
border: 2px solid var(--input-unfocused-border-color);\r
|
|
5763
|
+
box-sizing: border-box;\r
|
|
5764
|
+
font: calc(9px * var(--total-scale-factor)) sans-serif;\r
|
|
5765
|
+
height: 100%;\r
|
|
5766
|
+
margin: 0;\r
|
|
5767
|
+
vertical-align: top;\r
|
|
5768
|
+
width: 100%;\r
|
|
5769
|
+
}\r
|
|
5770
|
+
\r
|
|
5771
|
+
.textWidgetAnnotation :is(input, textarea):required,\r
|
|
5772
|
+
.choiceWidgetAnnotation select:required,\r
|
|
5773
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required {\r
|
|
5774
|
+
outline: 1.5px solid red;\r
|
|
5775
|
+
}\r
|
|
5776
|
+
\r
|
|
5777
|
+
.choiceWidgetAnnotation select option {\r
|
|
5778
|
+
padding: 0;\r
|
|
5779
|
+
}\r
|
|
5780
|
+
\r
|
|
5781
|
+
.buttonWidgetAnnotation.radioButton input {\r
|
|
5782
|
+
border-radius: 50%;\r
|
|
5783
|
+
}\r
|
|
5784
|
+
\r
|
|
5785
|
+
.textWidgetAnnotation textarea {\r
|
|
5786
|
+
resize: none;\r
|
|
5787
|
+
}\r
|
|
5788
|
+
\r
|
|
5789
|
+
.textWidgetAnnotation :is(input, textarea)[disabled],\r
|
|
5790
|
+
.choiceWidgetAnnotation select[disabled],\r
|
|
5791
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input[disabled] {\r
|
|
5792
|
+
background: none;\r
|
|
5793
|
+
border: 2px solid var(--input-disabled-border-color);\r
|
|
5794
|
+
cursor: not-allowed;\r
|
|
5795
|
+
}\r
|
|
5796
|
+
\r
|
|
5797
|
+
.textWidgetAnnotation :is(input, textarea):hover,\r
|
|
5798
|
+
.choiceWidgetAnnotation select:hover,\r
|
|
5799
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input:hover {\r
|
|
5800
|
+
border: 2px solid var(--input-hover-border-color);\r
|
|
5801
|
+
}\r
|
|
5802
|
+
.textWidgetAnnotation :is(input, textarea):hover,\r
|
|
5803
|
+
.choiceWidgetAnnotation select:hover,\r
|
|
5804
|
+
.buttonWidgetAnnotation.checkBox input:hover {\r
|
|
5805
|
+
border-radius: 2px;\r
|
|
5806
|
+
}\r
|
|
5807
|
+
\r
|
|
5808
|
+
.textWidgetAnnotation :is(input, textarea):focus,\r
|
|
5809
|
+
.choiceWidgetAnnotation select:focus {\r
|
|
5810
|
+
background: none;\r
|
|
5811
|
+
border: 2px solid var(--input-focus-border-color);\r
|
|
5812
|
+
border-radius: 2px;\r
|
|
5813
|
+
outline: var(--input-focus-outline);\r
|
|
5814
|
+
}\r
|
|
5815
|
+
\r
|
|
5816
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus {\r
|
|
5817
|
+
background-image: none;\r
|
|
5818
|
+
background-color: transparent;\r
|
|
5819
|
+
}\r
|
|
5820
|
+
\r
|
|
5821
|
+
.buttonWidgetAnnotation.checkBox :focus {\r
|
|
5822
|
+
border: 2px solid var(--input-focus-border-color);\r
|
|
5823
|
+
border-radius: 2px;\r
|
|
5824
|
+
outline: var(--input-focus-outline);\r
|
|
5825
|
+
}\r
|
|
5826
|
+
\r
|
|
5827
|
+
.buttonWidgetAnnotation.radioButton :focus {\r
|
|
5828
|
+
border: 2px solid var(--input-focus-border-color);\r
|
|
5829
|
+
outline: var(--input-focus-outline);\r
|
|
5830
|
+
}\r
|
|
5831
|
+
\r
|
|
5832
|
+
.buttonWidgetAnnotation.checkBox input:checked::before,\r
|
|
5833
|
+
.buttonWidgetAnnotation.checkBox input:checked::after,\r
|
|
5834
|
+
.buttonWidgetAnnotation.radioButton input:checked::before {\r
|
|
5835
|
+
background-color: CanvasText;\r
|
|
5836
|
+
content: "";\r
|
|
5837
|
+
display: block;\r
|
|
5838
|
+
position: absolute;\r
|
|
5839
|
+
}\r
|
|
5840
|
+
\r
|
|
5841
|
+
.buttonWidgetAnnotation.checkBox input:checked::before,\r
|
|
5842
|
+
.buttonWidgetAnnotation.checkBox input:checked::after {\r
|
|
5843
|
+
height: 80%;\r
|
|
5844
|
+
left: 45%;\r
|
|
5845
|
+
width: 1px;\r
|
|
5846
|
+
}\r
|
|
5847
|
+
\r
|
|
5848
|
+
.buttonWidgetAnnotation.checkBox input:checked::before {\r
|
|
5849
|
+
transform: rotate(45deg);\r
|
|
5850
|
+
}\r
|
|
5851
|
+
\r
|
|
5852
|
+
.buttonWidgetAnnotation.checkBox input:checked::after {\r
|
|
5853
|
+
transform: rotate(-45deg);\r
|
|
5854
|
+
}\r
|
|
5855
|
+
\r
|
|
5856
|
+
.buttonWidgetAnnotation.radioButton input:checked::before {\r
|
|
5857
|
+
border-radius: 50%;\r
|
|
5858
|
+
height: 50%;\r
|
|
5859
|
+
left: 25%;\r
|
|
5860
|
+
top: 25%;\r
|
|
5861
|
+
width: 50%;\r
|
|
5862
|
+
}\r
|
|
5863
|
+
\r
|
|
5864
|
+
.textWidgetAnnotation input.comb {\r
|
|
5865
|
+
font-family: monospace;\r
|
|
5866
|
+
padding-left: 2px;\r
|
|
5867
|
+
padding-right: 0;\r
|
|
5868
|
+
}\r
|
|
5869
|
+
\r
|
|
5870
|
+
.textWidgetAnnotation input.comb:focus {\r
|
|
5871
|
+
/*\r
|
|
5872
|
+
* Letter spacing is placed on the right side of each character. Hence, the\r
|
|
5873
|
+
* letter spacing of the last character may be placed outside the visible\r
|
|
5874
|
+
* area, causing horizontal scrolling. We avoid this by extending the width\r
|
|
5875
|
+
* when the element has focus and revert this when it loses focus.\r
|
|
5876
|
+
*/\r
|
|
5877
|
+
width: 103%;\r
|
|
5878
|
+
}\r
|
|
5879
|
+
\r
|
|
5880
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input {\r
|
|
5881
|
+
appearance: none;\r
|
|
5882
|
+
}\r
|
|
5883
|
+
\r
|
|
5884
|
+
.fileAttachmentAnnotation .popupTriggerArea {\r
|
|
5885
|
+
height: 100%;\r
|
|
5886
|
+
width: 100%;\r
|
|
5887
|
+
}\r
|
|
5888
|
+
\r
|
|
5889
|
+
.popupAnnotation {\r
|
|
5890
|
+
position: absolute;\r
|
|
5891
|
+
font-size: calc(9px * var(--total-scale-factor));\r
|
|
5892
|
+
pointer-events: none;\r
|
|
5893
|
+
width: max-content;\r
|
|
5894
|
+
max-width: 45%;\r
|
|
5895
|
+
height: auto;\r
|
|
5896
|
+
}\r
|
|
5897
|
+
\r
|
|
5898
|
+
.popup {\r
|
|
5899
|
+
background-color: rgb(255 255 153);\r
|
|
5900
|
+
color: black;\r
|
|
5901
|
+
box-shadow: 0 calc(2px * var(--total-scale-factor))\r
|
|
5902
|
+
calc(5px * var(--total-scale-factor)) rgb(136 136 136);\r
|
|
5903
|
+
border-radius: calc(2px * var(--total-scale-factor));\r
|
|
5904
|
+
outline: 1.5px solid rgb(255 255 74);\r
|
|
5905
|
+
padding: calc(6px * var(--total-scale-factor));\r
|
|
5906
|
+
cursor: pointer;\r
|
|
5907
|
+
font: message-box;\r
|
|
5908
|
+
white-space: normal;\r
|
|
5909
|
+
word-wrap: break-word;\r
|
|
5910
|
+
pointer-events: auto;\r
|
|
5911
|
+
user-select: text;\r
|
|
5912
|
+
}\r
|
|
5913
|
+
\r
|
|
5914
|
+
.popupAnnotation.focused .popup {\r
|
|
5915
|
+
outline-width: 3px;\r
|
|
5916
|
+
}\r
|
|
5917
|
+
\r
|
|
5918
|
+
.popup * {\r
|
|
5919
|
+
font-size: calc(9px * var(--total-scale-factor));\r
|
|
5920
|
+
}\r
|
|
5921
|
+
\r
|
|
5922
|
+
.popup > .header {\r
|
|
5923
|
+
display: inline-block;\r
|
|
5924
|
+
}\r
|
|
5925
|
+
\r
|
|
5926
|
+
.popup > .header > .title {\r
|
|
5927
|
+
display: inline;\r
|
|
5928
|
+
font-weight: bold;\r
|
|
5929
|
+
}\r
|
|
5930
|
+
\r
|
|
5931
|
+
.popup > .header .popupDate {\r
|
|
5932
|
+
display: inline-block;\r
|
|
5933
|
+
margin-left: calc(5px * var(--total-scale-factor));\r
|
|
5934
|
+
width: fit-content;\r
|
|
5935
|
+
}\r
|
|
5936
|
+
\r
|
|
5937
|
+
.popupContent {\r
|
|
5938
|
+
border-top: 1px solid rgb(51 51 51);\r
|
|
5939
|
+
margin-top: calc(2px * var(--total-scale-factor));\r
|
|
5940
|
+
padding-top: calc(2px * var(--total-scale-factor));\r
|
|
5941
|
+
}\r
|
|
5942
|
+
\r
|
|
5943
|
+
.richText > * {\r
|
|
5944
|
+
white-space: pre-wrap;\r
|
|
5945
|
+
font-size: calc(9px * var(--total-scale-factor));\r
|
|
5946
|
+
}\r
|
|
5947
|
+
\r
|
|
5948
|
+
.popupTriggerArea {\r
|
|
5949
|
+
cursor: pointer;\r
|
|
5950
|
+
\r
|
|
5951
|
+
&:hover {\r
|
|
5952
|
+
backdrop-filter: var(--hcm-highlight-filter);\r
|
|
5953
|
+
}\r
|
|
5954
|
+
}\r
|
|
5955
|
+
\r
|
|
5956
|
+
section svg {\r
|
|
5957
|
+
position: absolute;\r
|
|
5958
|
+
width: 100%;\r
|
|
5959
|
+
height: 100%;\r
|
|
5960
|
+
top: 0;\r
|
|
5961
|
+
left: 0;\r
|
|
5962
|
+
}\r
|
|
5963
|
+
\r
|
|
5964
|
+
.annotationTextContent {\r
|
|
5965
|
+
position: absolute;\r
|
|
5966
|
+
width: 100%;\r
|
|
5967
|
+
height: 100%;\r
|
|
5968
|
+
opacity: 0;\r
|
|
5969
|
+
color: transparent;\r
|
|
5970
|
+
user-select: none;\r
|
|
5971
|
+
pointer-events: none;\r
|
|
5972
|
+
\r
|
|
5973
|
+
span {\r
|
|
5974
|
+
width: 100%;\r
|
|
5975
|
+
display: inline-block;\r
|
|
5976
|
+
}\r
|
|
5977
|
+
}\r
|
|
5978
|
+
\r
|
|
5979
|
+
svg.quadrilateralsContainer {\r
|
|
5980
|
+
contain: strict;\r
|
|
5981
|
+
width: 0;\r
|
|
5982
|
+
height: 0;\r
|
|
5983
|
+
position: absolute;\r
|
|
5984
|
+
top: 0;\r
|
|
5985
|
+
left: 0;\r
|
|
5986
|
+
z-index: -1;\r
|
|
5987
|
+
}\r
|
|
5988
|
+
}\r
|
|
5989
|
+
`;
|
|
5921
5990
|
const render = async (page, doc, zoom) => {
|
|
5922
5991
|
const scale = zoom * devicePixelRatio;
|
|
5923
5992
|
doc.documentElement.style.transform = `scale(${1 / devicePixelRatio})`;
|
|
@@ -5952,15 +6021,13 @@ const render = async (page, doc, zoom) => {
|
|
|
5952
6021
|
container.onpointerdown = () => container.classList.add("selecting");
|
|
5953
6022
|
container.onpointerup = () => container.classList.remove("selecting");
|
|
5954
6023
|
const div = doc.querySelector(".annotationLayer");
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
}
|
|
5963
|
-
});
|
|
6024
|
+
const linkService = {
|
|
6025
|
+
goToDestination: () => {
|
|
6026
|
+
},
|
|
6027
|
+
getDestinationHash: (dest) => JSON.stringify(dest),
|
|
6028
|
+
addLinkAttributes: (link, url) => link.href = url
|
|
6029
|
+
};
|
|
6030
|
+
await new pdfjsLib.AnnotationLayer({ page, viewport, div, linkService }).render({ annotations: await page.getAnnotations() });
|
|
5964
6031
|
};
|
|
5965
6032
|
const renderPage = async (page, getImageBlob) => {
|
|
5966
6033
|
const viewport = page.getViewport({ scale: 1 });
|
|
@@ -5982,6 +6049,17 @@ const renderPage = async (page, getImageBlob) => {
|
|
|
5982
6049
|
margin: 0;
|
|
5983
6050
|
padding: 0;
|
|
5984
6051
|
}
|
|
6052
|
+
/*
|
|
6053
|
+
https://github.com/mozilla/pdf.js/commit/bd05b255fabfc313b194bfe9a17ccded4d90fb5a
|
|
6054
|
+
*/
|
|
6055
|
+
:root {
|
|
6056
|
+
--user-unit: 1;
|
|
6057
|
+
--total-scale-factor: calc(var(--scale-factor) * var(--user-unit));
|
|
6058
|
+
--scale-round-x: 1px;
|
|
6059
|
+
--scale-round-y: 1px;
|
|
6060
|
+
}
|
|
6061
|
+
${textLayerBuilderCSS}
|
|
6062
|
+
${annotationLayerBuilderCSS}
|
|
5985
6063
|
</style>
|
|
5986
6064
|
<div id="canvas"></div>
|
|
5987
6065
|
<div class="textLayer"></div>
|
|
@@ -6004,8 +6082,8 @@ const makePDF = async (file) => {
|
|
|
6004
6082
|
};
|
|
6005
6083
|
const pdf2 = await pdfjsLib.getDocument({
|
|
6006
6084
|
range: transport,
|
|
6007
|
-
|
|
6008
|
-
|
|
6085
|
+
cMapUrl: pdfjsPath("cmaps/"),
|
|
6086
|
+
standardFontDataUrl: pdfjsPath("standard_fonts/"),
|
|
6009
6087
|
isEvalSupported: false
|
|
6010
6088
|
}).promise;
|
|
6011
6089
|
const book = { rendition: { layout: "pre-paginated" } };
|
|
@@ -6319,17 +6397,17 @@ const MOBI_LANG = {
|
|
|
6319
6397
|
97: ["ne"],
|
|
6320
6398
|
98: ["fy"]
|
|
6321
6399
|
};
|
|
6322
|
-
const concatTypedArray = (a2,
|
|
6323
|
-
const result = new a2.constructor(a2.length +
|
|
6400
|
+
const concatTypedArray = (a2, b3) => {
|
|
6401
|
+
const result = new a2.constructor(a2.length + b3.length);
|
|
6324
6402
|
result.set(a2);
|
|
6325
|
-
result.set(
|
|
6403
|
+
result.set(b3, a2.length);
|
|
6326
6404
|
return result;
|
|
6327
6405
|
};
|
|
6328
|
-
const concatTypedArray3 = (a2,
|
|
6329
|
-
const result = new a2.constructor(a2.length +
|
|
6406
|
+
const concatTypedArray3 = (a2, b3, c) => {
|
|
6407
|
+
const result = new a2.constructor(a2.length + b3.length + c.length);
|
|
6330
6408
|
result.set(a2);
|
|
6331
|
-
result.set(
|
|
6332
|
-
result.set(c, a2.length +
|
|
6409
|
+
result.set(b3, a2.length);
|
|
6410
|
+
result.set(c, a2.length + b3.length);
|
|
6333
6411
|
return result;
|
|
6334
6412
|
};
|
|
6335
6413
|
const decoder = new TextDecoder();
|
|
@@ -6801,6 +6879,9 @@ class MOBI6 {
|
|
|
6801
6879
|
createDocument: () => this.createDocument(section),
|
|
6802
6880
|
size: section.end - section.start
|
|
6803
6881
|
}));
|
|
6882
|
+
this.#fileposList = [...new Set(
|
|
6883
|
+
Array.from(str.matchAll(fileposRegex), (m2) => m2[1])
|
|
6884
|
+
)].map((filepos) => ({ filepos, number: Number(filepos) })).sort((a2, b3) => a2.number - b3.number);
|
|
6804
6885
|
try {
|
|
6805
6886
|
this.landmarks = await this.getGuide();
|
|
6806
6887
|
const tocHref = (_a = this.landmarks.find(({ type }) => type == null ? void 0 : type.includes("toc"))) == null ? void 0 : _a.href;
|
|
@@ -6841,9 +6922,6 @@ class MOBI6 {
|
|
|
6841
6922
|
} catch (e2) {
|
|
6842
6923
|
console.warn(e2);
|
|
6843
6924
|
}
|
|
6844
|
-
this.#fileposList = [...new Set(
|
|
6845
|
-
Array.from(str.matchAll(fileposRegex), (m2) => m2[1])
|
|
6846
|
-
)].map((filepos) => ({ filepos, number: Number(filepos) })).sort((a2, b2) => a2.number - b2.number);
|
|
6847
6925
|
this.metadata = this.mobi.getMetadata();
|
|
6848
6926
|
this.getCover = this.mobi.getCover.bind(this.mobi);
|
|
6849
6927
|
return this;
|
|
@@ -7047,7 +7125,7 @@ class KF8 {
|
|
|
7047
7125
|
const last = arr[arr.length - 1];
|
|
7048
7126
|
const fragStart = (last == null ? void 0 : last.fragEnd) ?? 0, fragEnd = fragStart + skel.numFrag;
|
|
7049
7127
|
const frags = fragTable.slice(fragStart, fragEnd);
|
|
7050
|
-
const length = skel.length + frags.map((f2) => f2.length).reduce((a2,
|
|
7128
|
+
const length = skel.length + frags.map((f2) => f2.length).reduce((a2, b3) => a2 + b3, 0);
|
|
7051
7129
|
const totalLength = ((last == null ? void 0 : last.totalLength) ?? 0) + length;
|
|
7052
7130
|
return arr.concat({ skel, frags, fragEnd, length, totalLength });
|
|
7053
7131
|
}, []);
|
|
@@ -7281,25 +7359,25 @@ const mobi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
7281
7359
|
MOBI,
|
|
7282
7360
|
isMOBI
|
|
7283
7361
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7284
|
-
var r = Uint8Array,
|
|
7285
|
-
for (var i2 = new
|
|
7286
|
-
var f2 = new
|
|
7362
|
+
var r = Uint8Array, n = Uint16Array, a = Int32Array, e = new r([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]), i = new r([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]), t = new r([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), f = function(r2, e2) {
|
|
7363
|
+
for (var i2 = new n(31), t2 = 0; t2 < 31; ++t2) i2[t2] = e2 += 1 << r2[t2 - 1];
|
|
7364
|
+
var f2 = new a(i2[30]);
|
|
7287
7365
|
for (t2 = 1; t2 < 30; ++t2) for (var o2 = i2[t2]; o2 < i2[t2 + 1]; ++o2) f2[o2] = o2 - i2[t2] << 5 | t2;
|
|
7288
7366
|
return { b: i2, r: f2 };
|
|
7289
|
-
}, o = f(
|
|
7367
|
+
}, o = f(e, 2), v = o.b, l = o.r;
|
|
7290
7368
|
v[28] = 258, l[258] = 28;
|
|
7291
|
-
for (var u = f(i, 0).b, c = new
|
|
7369
|
+
for (var u = f(i, 0).b, c = new n(32768), d = 0; d < 32768; ++d) {
|
|
7292
7370
|
var w = (43690 & d) >> 1 | (21845 & d) << 1;
|
|
7293
7371
|
w = (61680 & (w = (52428 & w) >> 2 | (13107 & w) << 2)) >> 4 | (3855 & w) << 4, c[d] = ((65280 & w) >> 8 | (255 & w) << 8) >> 1;
|
|
7294
7372
|
}
|
|
7295
|
-
var
|
|
7296
|
-
for (var i2 = r2.length, t2 = 0, f2 = new
|
|
7297
|
-
var o2, v2 = new
|
|
7298
|
-
for (t2 = 1; t2 <
|
|
7373
|
+
var b2 = function(r2, a2, e2) {
|
|
7374
|
+
for (var i2 = r2.length, t2 = 0, f2 = new n(a2); t2 < i2; ++t2) r2[t2] && ++f2[r2[t2] - 1];
|
|
7375
|
+
var o2, v2 = new n(a2);
|
|
7376
|
+
for (t2 = 1; t2 < a2; ++t2) v2[t2] = v2[t2 - 1] + f2[t2 - 1] << 1;
|
|
7299
7377
|
{
|
|
7300
|
-
o2 = new
|
|
7301
|
-
var l2 = 15 -
|
|
7302
|
-
for (t2 = 0; t2 < i2; ++t2) if (r2[t2]) for (var u = t2 << 4 | r2[t2], d =
|
|
7378
|
+
o2 = new n(1 << a2);
|
|
7379
|
+
var l2 = 15 - a2;
|
|
7380
|
+
for (t2 = 0; t2 < i2; ++t2) if (r2[t2]) for (var u = t2 << 4 | r2[t2], d = a2 - r2[t2], w = v2[r2[t2] - 1]++ << d, b3 = w | (1 << d) - 1; w <= b3; ++w) o2[c[w] >> l2] = u;
|
|
7303
7381
|
}
|
|
7304
7382
|
return o2;
|
|
7305
7383
|
}, s = new r(288);
|
|
@@ -7309,123 +7387,125 @@ for (d = 256; d < 280; ++d) s[d] = 7;
|
|
|
7309
7387
|
for (d = 280; d < 288; ++d) s[d] = 8;
|
|
7310
7388
|
var h = new r(32);
|
|
7311
7389
|
for (d = 0; d < 32; ++d) h[d] = 5;
|
|
7312
|
-
var
|
|
7313
|
-
for (var
|
|
7314
|
-
return a2;
|
|
7315
|
-
}, k = function(r2, a2, e2) {
|
|
7316
|
-
var n2 = a2 / 8 | 0;
|
|
7317
|
-
return (r2[n2] | r2[n2 + 1] << 8) >> (7 & a2) & e2;
|
|
7318
|
-
}, m = function(r2, a2) {
|
|
7319
|
-
var e2 = a2 / 8 | 0;
|
|
7320
|
-
return (r2[e2] | r2[e2 + 1] << 8 | r2[e2 + 2] << 16) >> (7 & a2);
|
|
7321
|
-
}, x = ["unexpected EOF", "invalid block type", "invalid length/literal", "invalid distance", "stream finished", "no stream handler", , "no callback", "invalid UTF-8 data", "extra field too long", "date not in range 1980-2099", "filename too long", "stream finishing", "invalid zip data"], T = function(r2, a2, e2) {
|
|
7322
|
-
var n2 = new Error(a2 || x[r2]);
|
|
7323
|
-
if (n2.code = r2, Error.captureStackTrace && Error.captureStackTrace(n2, T), !e2) throw n2;
|
|
7390
|
+
var y2 = b2(s, 9), g = b2(h, 5), p = function(r2) {
|
|
7391
|
+
for (var n2 = r2[0], a2 = 1; a2 < r2.length; ++a2) r2[a2] > n2 && (n2 = r2[a2]);
|
|
7324
7392
|
return n2;
|
|
7325
|
-
},
|
|
7326
|
-
var
|
|
7327
|
-
|
|
7328
|
-
|
|
7393
|
+
}, k = function(r2, n2, a2) {
|
|
7394
|
+
var e2 = n2 / 8 | 0;
|
|
7395
|
+
return (r2[e2] | r2[e2 + 1] << 8) >> (7 & n2) & a2;
|
|
7396
|
+
}, m = function(r2, n2) {
|
|
7397
|
+
var a2 = n2 / 8 | 0;
|
|
7398
|
+
return (r2[a2] | r2[a2 + 1] << 8 | r2[a2 + 2] << 16) >> (7 & n2);
|
|
7399
|
+
}, x = function(r2) {
|
|
7400
|
+
return (r2 + 7) / 8 | 0;
|
|
7401
|
+
}, T = ["unexpected EOF", "invalid block type", "invalid length/literal", "invalid distance", "stream finished", "no stream handler", , "no callback", "invalid UTF-8 data", "extra field too long", "date not in range 1980-2099", "filename too long", "stream finishing", "invalid zip data"], E = function(r2, n2, a2) {
|
|
7402
|
+
var e2 = new Error(n2 || T[r2]);
|
|
7403
|
+
if (e2.code = r2, Error.captureStackTrace && Error.captureStackTrace(e2, E), !a2) throw e2;
|
|
7404
|
+
return e2;
|
|
7405
|
+
}, z = function(n2, a2, f2, o2) {
|
|
7406
|
+
var l2 = n2.length, c = o2 ? o2.length : 0;
|
|
7407
|
+
if (!l2 || a2.f && !a2.l) return f2 || new r(0);
|
|
7408
|
+
var d = !f2, w = d || 2 != a2.i, s2 = a2.i;
|
|
7329
7409
|
d && (f2 = new r(3 * l2));
|
|
7330
|
-
var h2 = function(
|
|
7331
|
-
var
|
|
7332
|
-
if (
|
|
7333
|
-
var
|
|
7334
|
-
|
|
7410
|
+
var h2 = function(n3) {
|
|
7411
|
+
var a3 = f2.length;
|
|
7412
|
+
if (n3 > a3) {
|
|
7413
|
+
var e2 = new r(Math.max(2 * a3, n3));
|
|
7414
|
+
e2.set(f2), f2 = e2;
|
|
7335
7415
|
}
|
|
7336
|
-
},
|
|
7416
|
+
}, T2 = a2.f || 0, z2 = a2.p || 0, A2 = a2.b || 0, U2 = a2.l, D2 = a2.d, F2 = a2.m, M2 = a2.n, S2 = 8 * l2;
|
|
7337
7417
|
do {
|
|
7338
|
-
if (!
|
|
7339
|
-
|
|
7340
|
-
var
|
|
7341
|
-
if (
|
|
7342
|
-
var
|
|
7343
|
-
if (
|
|
7344
|
-
s2 &&
|
|
7418
|
+
if (!U2) {
|
|
7419
|
+
T2 = k(n2, z2, 1);
|
|
7420
|
+
var I2 = k(n2, z2 + 1, 3);
|
|
7421
|
+
if (z2 += 3, !I2) {
|
|
7422
|
+
var O2 = n2[(P2 = x(z2) + 4) - 4] | n2[P2 - 3] << 8, j2 = P2 + O2;
|
|
7423
|
+
if (j2 > l2) {
|
|
7424
|
+
s2 && E(0);
|
|
7345
7425
|
break;
|
|
7346
7426
|
}
|
|
7347
|
-
w && h2(
|
|
7427
|
+
w && h2(A2 + O2), f2.set(n2.subarray(P2, j2), A2), a2.b = A2 += O2, a2.p = z2 = 8 * j2, a2.f = T2;
|
|
7348
7428
|
continue;
|
|
7349
7429
|
}
|
|
7350
|
-
if (1 ==
|
|
7351
|
-
else if (2 ==
|
|
7352
|
-
var
|
|
7353
|
-
|
|
7354
|
-
for (var
|
|
7355
|
-
|
|
7356
|
-
var
|
|
7357
|
-
for (
|
|
7358
|
-
var
|
|
7359
|
-
if (
|
|
7430
|
+
if (1 == I2) U2 = y2, D2 = g, F2 = 9, M2 = 5;
|
|
7431
|
+
else if (2 == I2) {
|
|
7432
|
+
var q2 = k(n2, z2, 31) + 257, B2 = k(n2, z2 + 10, 15) + 4, C2 = q2 + k(n2, z2 + 5, 31) + 1;
|
|
7433
|
+
z2 += 14;
|
|
7434
|
+
for (var G2 = new r(C2), H2 = new r(19), J2 = 0; J2 < B2; ++J2) H2[t[J2]] = k(n2, z2 + 3 * J2, 7);
|
|
7435
|
+
z2 += 3 * B2;
|
|
7436
|
+
var K2 = p(H2), L2 = (1 << K2) - 1, N2 = b2(H2, K2);
|
|
7437
|
+
for (J2 = 0; J2 < C2; ) {
|
|
7438
|
+
var P2, Q2 = N2[k(n2, z2, L2)];
|
|
7439
|
+
if (z2 += 15 & Q2, (P2 = Q2 >> 4) < 16) G2[J2++] = P2;
|
|
7360
7440
|
else {
|
|
7361
|
-
var
|
|
7362
|
-
for (16 ==
|
|
7441
|
+
var R2 = 0, V2 = 0;
|
|
7442
|
+
for (16 == P2 ? (V2 = 3 + k(n2, z2, 3), z2 += 2, R2 = G2[J2 - 1]) : 17 == P2 ? (V2 = 3 + k(n2, z2, 7), z2 += 3) : 18 == P2 && (V2 = 11 + k(n2, z2, 127), z2 += 7); V2--; ) G2[J2++] = R2;
|
|
7363
7443
|
}
|
|
7364
7444
|
}
|
|
7365
|
-
var
|
|
7366
|
-
|
|
7367
|
-
} else
|
|
7368
|
-
if (
|
|
7369
|
-
s2 &&
|
|
7445
|
+
var W2 = G2.subarray(0, q2), X2 = G2.subarray(q2);
|
|
7446
|
+
F2 = p(W2), M2 = p(X2), U2 = b2(W2, F2), D2 = b2(X2, M2);
|
|
7447
|
+
} else E(1);
|
|
7448
|
+
if (z2 > S2) {
|
|
7449
|
+
s2 && E(0);
|
|
7370
7450
|
break;
|
|
7371
7451
|
}
|
|
7372
7452
|
}
|
|
7373
|
-
w && h2(
|
|
7374
|
-
for (var
|
|
7375
|
-
var
|
|
7376
|
-
if ((
|
|
7377
|
-
s2 &&
|
|
7453
|
+
w && h2(A2 + 131072);
|
|
7454
|
+
for (var Y2 = (1 << F2) - 1, Z2 = (1 << M2) - 1, $2 = z2; ; $2 = z2) {
|
|
7455
|
+
var _2 = (R2 = U2[m(n2, z2) & Y2]) >> 4;
|
|
7456
|
+
if ((z2 += 15 & R2) > S2) {
|
|
7457
|
+
s2 && E(0);
|
|
7378
7458
|
break;
|
|
7379
7459
|
}
|
|
7380
|
-
if (
|
|
7460
|
+
if (R2 || E(2), _2 < 256) f2[A2++] = _2;
|
|
7381
7461
|
else {
|
|
7382
|
-
if (256 ==
|
|
7383
|
-
|
|
7462
|
+
if (256 == _2) {
|
|
7463
|
+
$2 = z2, U2 = null;
|
|
7384
7464
|
break;
|
|
7385
7465
|
}
|
|
7386
|
-
var
|
|
7387
|
-
if (
|
|
7388
|
-
var
|
|
7389
|
-
|
|
7466
|
+
var rr = _2 - 254;
|
|
7467
|
+
if (_2 > 264) {
|
|
7468
|
+
var nr = e[J2 = _2 - 257];
|
|
7469
|
+
rr = k(n2, z2, (1 << nr) - 1) + v[J2], z2 += nr;
|
|
7390
7470
|
}
|
|
7391
|
-
var ar =
|
|
7392
|
-
ar ||
|
|
7393
|
-
|
|
7471
|
+
var ar = D2[m(n2, z2) & Z2], er = ar >> 4;
|
|
7472
|
+
ar || E(3), z2 += 15 & ar;
|
|
7473
|
+
X2 = u[er];
|
|
7394
7474
|
if (er > 3) {
|
|
7395
|
-
|
|
7396
|
-
|
|
7475
|
+
nr = i[er];
|
|
7476
|
+
X2 += m(n2, z2) & (1 << nr) - 1, z2 += nr;
|
|
7397
7477
|
}
|
|
7398
|
-
if (
|
|
7399
|
-
s2 &&
|
|
7478
|
+
if (z2 > S2) {
|
|
7479
|
+
s2 && E(0);
|
|
7400
7480
|
break;
|
|
7401
7481
|
}
|
|
7402
|
-
w && h2(
|
|
7403
|
-
var
|
|
7404
|
-
if (
|
|
7405
|
-
var
|
|
7406
|
-
for (
|
|
7482
|
+
w && h2(A2 + 131072);
|
|
7483
|
+
var ir = A2 + rr;
|
|
7484
|
+
if (A2 < X2) {
|
|
7485
|
+
var tr = c - X2, fr = Math.min(X2, ir);
|
|
7486
|
+
for (tr + A2 < 0 && E(3); A2 < fr; ++A2) f2[A2] = o2[tr + A2];
|
|
7407
7487
|
}
|
|
7408
|
-
for (;
|
|
7488
|
+
for (; A2 < ir; ++A2) f2[A2] = f2[A2 - X2];
|
|
7409
7489
|
}
|
|
7410
7490
|
}
|
|
7411
|
-
|
|
7412
|
-
} while (!
|
|
7413
|
-
return
|
|
7414
|
-
return (null ==
|
|
7415
|
-
})(f2, 0,
|
|
7416
|
-
},
|
|
7417
|
-
function
|
|
7418
|
-
return
|
|
7419
|
-
var
|
|
7420
|
-
}
|
|
7421
|
-
var
|
|
7491
|
+
a2.l = U2, a2.p = $2, a2.b = A2, a2.f = T2, U2 && (T2 = 1, a2.m = F2, a2.d = D2, a2.n = M2);
|
|
7492
|
+
} while (!T2);
|
|
7493
|
+
return A2 != f2.length && d ? (function(n3, a3, e2) {
|
|
7494
|
+
return (null == e2 || e2 > n3.length) && (e2 = n3.length), new r(n3.subarray(a3, e2));
|
|
7495
|
+
})(f2, 0, A2) : f2.subarray(0, A2);
|
|
7496
|
+
}, A = new r(0);
|
|
7497
|
+
function U(r2, n2) {
|
|
7498
|
+
return z(r2.subarray((a2 = r2, e2 = n2 && n2.dictionary, (8 != (15 & a2[0]) || a2[0] >> 4 > 7 || (a2[0] << 8 | a2[1]) % 31) && E(6, "invalid zlib data"), (a2[1] >> 5 & 1) == +!e2 && E(6, "invalid zlib data: " + (32 & a2[1] ? "need" : "unexpected") + " dictionary"), 2 + (a2[1] >> 3 & 4)), -4), { i: 2 }, n2 && n2.out, n2 && n2.dictionary);
|
|
7499
|
+
var a2, e2;
|
|
7500
|
+
}
|
|
7501
|
+
var D = "undefined" != typeof TextDecoder && new TextDecoder();
|
|
7422
7502
|
try {
|
|
7423
|
-
|
|
7503
|
+
D.decode(A, { stream: true });
|
|
7424
7504
|
} catch (r2) {
|
|
7425
7505
|
}
|
|
7426
7506
|
const fflate = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7427
7507
|
__proto__: null,
|
|
7428
|
-
unzlibSync:
|
|
7508
|
+
unzlibSync: U
|
|
7429
7509
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7430
7510
|
const parseViewport = (str) => {
|
|
7431
7511
|
var _a, _b;
|
|
@@ -7731,21 +7811,21 @@ const debounce = (f2, wait2, immediate) => {
|
|
|
7731
7811
|
};
|
|
7732
7812
|
const lerp = (min, max, x2) => x2 * (max - min) + min;
|
|
7733
7813
|
const easeOutQuad = (x2) => 1 - (1 - x2) * (1 - x2);
|
|
7734
|
-
const animate = (a2,
|
|
7814
|
+
const animate = (a2, b3, duration, ease, render2) => new Promise((resolve) => {
|
|
7735
7815
|
let start;
|
|
7736
7816
|
const step = (now) => {
|
|
7737
7817
|
if (document.hidden) {
|
|
7738
|
-
render2(lerp(a2,
|
|
7818
|
+
render2(lerp(a2, b3, 1));
|
|
7739
7819
|
return resolve();
|
|
7740
7820
|
}
|
|
7741
7821
|
start ??= now;
|
|
7742
7822
|
const fraction = Math.min(1, (now - start) / duration);
|
|
7743
|
-
render2(lerp(a2,
|
|
7823
|
+
render2(lerp(a2, b3, ease(fraction)));
|
|
7744
7824
|
if (fraction < 1) requestAnimationFrame(step);
|
|
7745
7825
|
else resolve();
|
|
7746
7826
|
};
|
|
7747
7827
|
if (document.hidden) {
|
|
7748
|
-
render2(lerp(a2,
|
|
7828
|
+
render2(lerp(a2, b3, 1));
|
|
7749
7829
|
return resolve();
|
|
7750
7830
|
}
|
|
7751
7831
|
requestAnimationFrame(step);
|
|
@@ -7821,15 +7901,15 @@ const getVisibleRange = (doc, start, end, mapRect) => {
|
|
|
7821
7901
|
nodes.push(node);
|
|
7822
7902
|
const from = nodes[0] ?? doc.body;
|
|
7823
7903
|
const to = nodes[nodes.length - 1] ?? from;
|
|
7824
|
-
const startOffset = from.nodeType === 1 ? 0 : bisectNode(doc, from, (a2,
|
|
7904
|
+
const startOffset = from.nodeType === 1 ? 0 : bisectNode(doc, from, (a2, b3) => {
|
|
7825
7905
|
const p2 = mapRect(getBoundingClientRect(a2));
|
|
7826
|
-
const q2 = mapRect(getBoundingClientRect(
|
|
7906
|
+
const q2 = mapRect(getBoundingClientRect(b3));
|
|
7827
7907
|
if (p2.right < start && q2.left > start) return 0;
|
|
7828
7908
|
return q2.left > start ? -1 : 1;
|
|
7829
7909
|
});
|
|
7830
|
-
const endOffset = to.nodeType === 1 ? 0 : bisectNode(doc, to, (a2,
|
|
7910
|
+
const endOffset = to.nodeType === 1 ? 0 : bisectNode(doc, to, (a2, b3) => {
|
|
7831
7911
|
const p2 = mapRect(getBoundingClientRect(a2));
|
|
7832
|
-
const q2 = mapRect(getBoundingClientRect(
|
|
7912
|
+
const q2 = mapRect(getBoundingClientRect(b3));
|
|
7833
7913
|
if (p2.right < end && q2.left > end) return 0;
|
|
7834
7914
|
return q2.left > end ? -1 : 1;
|
|
7835
7915
|
});
|
|
@@ -8310,7 +8390,7 @@ class Paginator extends HTMLElement {
|
|
|
8310
8390
|
if (detail.type !== "text/css") return;
|
|
8311
8391
|
const w = innerWidth;
|
|
8312
8392
|
const h2 = innerHeight;
|
|
8313
|
-
detail.data = Promise.resolve(detail.data).then((data) => data.replace(new RegExp("(?<=[{\\s;])-epub-", "gi"), "").replace(/(\d*\.?\d+)vw/gi, (_2, d) => parseFloat(d) * w / 100 + "px").replace(/(\d*\.?\d+)vh/gi, (_2, d) => parseFloat(d) * h2 / 100 + "px").replace(/page-break-(after|before|inside)\s*:/gi, (_2, x2) => `-webkit-column-break-${x2}:`).replace(/break-(after|before|inside)\s*:\s*(avoid-)?page/gi, (_2, x2,
|
|
8393
|
+
detail.data = Promise.resolve(detail.data).then((data) => data.replace(new RegExp("(?<=[{\\s;])-epub-", "gi"), "").replace(/(\d*\.?\d+)vw/gi, (_2, d) => parseFloat(d) * w / 100 + "px").replace(/(\d*\.?\d+)vh/gi, (_2, d) => parseFloat(d) * h2 / 100 + "px").replace(/page-break-(after|before|inside)\s*:/gi, (_2, x2) => `-webkit-column-break-${x2}:`).replace(/break-(after|before|inside)\s*:\s*(avoid-)?page/gi, (_2, x2, y3) => `break-${x2}: ${y3 ?? ""}column`));
|
|
8314
8394
|
});
|
|
8315
8395
|
}
|
|
8316
8396
|
#createView() {
|
|
@@ -8410,10 +8490,10 @@ class Paginator extends HTMLElement {
|
|
|
8410
8490
|
const delta = this.#vertical ? dy : dx;
|
|
8411
8491
|
const element = this.#container;
|
|
8412
8492
|
const { scrollProp } = this;
|
|
8413
|
-
const [offset, a2,
|
|
8493
|
+
const [offset, a2, b3] = this.#scrollBounds;
|
|
8414
8494
|
const rtl = this.#rtl;
|
|
8415
|
-
const min = rtl ? offset -
|
|
8416
|
-
const max = rtl ? offset + a2 : offset +
|
|
8495
|
+
const min = rtl ? offset - b3 : offset - a2;
|
|
8496
|
+
const max = rtl ? offset + a2 : offset + b3;
|
|
8417
8497
|
element[scrollProp] = Math.max(min, Math.min(
|
|
8418
8498
|
max,
|
|
8419
8499
|
element[scrollProp] + delta
|
|
@@ -8421,10 +8501,10 @@ class Paginator extends HTMLElement {
|
|
|
8421
8501
|
}
|
|
8422
8502
|
snap(vx, vy) {
|
|
8423
8503
|
const velocity = this.#vertical ? vy : vx;
|
|
8424
|
-
const [offset, a2,
|
|
8504
|
+
const [offset, a2, b3] = this.#scrollBounds;
|
|
8425
8505
|
const { start, end, pages, size } = this;
|
|
8426
8506
|
const min = Math.abs(offset) - a2;
|
|
8427
|
-
const max = Math.abs(offset) +
|
|
8507
|
+
const max = Math.abs(offset) + b3;
|
|
8428
8508
|
const d = velocity * (this.#rtl ? -size : size);
|
|
8429
8509
|
const page = Math.floor(
|
|
8430
8510
|
Math.max(min, Math.min(max, (start + end) / 2 + (isNaN(d) ? 0 : d))) / size
|
|
@@ -8458,11 +8538,11 @@ class Paginator extends HTMLElement {
|
|
|
8458
8538
|
}
|
|
8459
8539
|
e2.preventDefault();
|
|
8460
8540
|
const touch = e2.changedTouches[0];
|
|
8461
|
-
const x2 = touch.screenX,
|
|
8462
|
-
const dx = state.x - x2, dy = state.y -
|
|
8541
|
+
const x2 = touch.screenX, y3 = touch.screenY;
|
|
8542
|
+
const dx = state.x - x2, dy = state.y - y3;
|
|
8463
8543
|
const dt2 = e2.timeStamp - state.t;
|
|
8464
8544
|
state.x = x2;
|
|
8465
|
-
state.y =
|
|
8545
|
+
state.y = y3;
|
|
8466
8546
|
state.t = e2.timeStamp;
|
|
8467
8547
|
state.vx = dx / dt2;
|
|
8468
8548
|
state.vy = dy / dt2;
|
|
@@ -8940,10 +9020,11 @@ const fragmentToSSML = (fragment, inherited) => {
|
|
|
8940
9020
|
const { lang } = inherited;
|
|
8941
9021
|
if (lang) ssml.documentElement.setAttributeNS(NS.XML, "lang", lang);
|
|
8942
9022
|
const convert = (node, parent, inheritedAlphabet) => {
|
|
9023
|
+
var _a, _b, _c;
|
|
8943
9024
|
if (!node) return;
|
|
8944
9025
|
if (node.nodeType === 3) return ssml.createTextNode(node.textContent);
|
|
8945
9026
|
if (node.nodeType === 4) return ssml.createCDATASection(node.textContent);
|
|
8946
|
-
if (node.nodeType !== 1) return;
|
|
9027
|
+
if (node.nodeType !== 1 && node.nodeType !== 11) return;
|
|
8947
9028
|
let el;
|
|
8948
9029
|
const nodeName = node.nodeName.toLowerCase();
|
|
8949
9030
|
if (nodeName === "foliate-mark") {
|
|
@@ -8953,14 +9034,14 @@ const fragmentToSSML = (fragment, inherited) => {
|
|
|
8953
9034
|
el = ssml.createElementNS(NS.SSML, "break");
|
|
8954
9035
|
else if (nodeName === "em" || nodeName === "strong")
|
|
8955
9036
|
el = ssml.createElementNS(NS.SSML, "emphasis");
|
|
8956
|
-
const lang2 = node.lang || node.getAttributeNS(NS.XML, "lang");
|
|
9037
|
+
const lang2 = node.lang || ((_a = node.getAttributeNS) == null ? void 0 : _a.call(node, NS.XML, "lang"));
|
|
8957
9038
|
if (lang2) {
|
|
8958
9039
|
if (!el) el = ssml.createElementNS(NS.SSML, "lang");
|
|
8959
9040
|
el.setAttributeNS(NS.XML, "lang", lang2);
|
|
8960
9041
|
}
|
|
8961
|
-
const alphabet = node.getAttributeNS(NS.SSML, "alphabet") || inheritedAlphabet;
|
|
9042
|
+
const alphabet = ((_b = node.getAttributeNS) == null ? void 0 : _b.call(node, NS.SSML, "alphabet")) || inheritedAlphabet;
|
|
8962
9043
|
if (!el) {
|
|
8963
|
-
const ph = node.getAttributeNS(NS.SSML, "ph");
|
|
9044
|
+
const ph = (_c = node.getAttributeNS) == null ? void 0 : _c.call(node, NS.SSML, "ph");
|
|
8964
9045
|
if (ph) {
|
|
8965
9046
|
el = ssml.createElementNS(NS.SSML, "phoneme");
|
|
8966
9047
|
if (alphabet) el.setAttribute("alphabet", alphabet);
|
|
@@ -8976,7 +9057,7 @@ const fragmentToSSML = (fragment, inherited) => {
|
|
|
8976
9057
|
}
|
|
8977
9058
|
return el;
|
|
8978
9059
|
};
|
|
8979
|
-
convert(fragment
|
|
9060
|
+
convert(fragment, ssml.documentElement, inherited.alphabet);
|
|
8980
9061
|
return ssml;
|
|
8981
9062
|
};
|
|
8982
9063
|
const getFragmentWithMarks = (range, textWalker2, granularity) => {
|