react-book-reader 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1509 +0,0 @@
1
- const Z = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535], $t = [96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 192, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 160, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 224, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 144, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 208, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 176, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 240, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 200, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 168, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 232, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 152, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 216, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 184, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 248, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 196, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 164, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 228, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 148, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 212, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 180, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 244, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 204, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 172, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 236, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 156, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 220, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 188, 0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 252, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 194, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 162, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 226, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 146, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 210, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 178, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 242, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 202, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 170, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 234, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 154, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 218, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 186, 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 250, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 198, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 166, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 230, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 150, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 214, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 182, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 246, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 206, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 174, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 238, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 158, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 222, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 190, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 254, 96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 193, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 161, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 225, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 145, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 209, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 177, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 241, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 201, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 169, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 233, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 153, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 217, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 185, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 249, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 197, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 165, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 229, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 149, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 213, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 181, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 245, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 205, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 173, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 237, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 157, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 221, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 189, 0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 253, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 195, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 163, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 227, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 147, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 211, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 179, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 243, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 203, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 171, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 235, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 155, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 219, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 187, 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 251, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 199, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 167, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 231, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 151, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 215, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 183, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 247, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 207, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 175, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 239, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 159, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 223, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 191, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 255], en = [80, 5, 1, 87, 5, 257, 83, 5, 17, 91, 5, 4097, 81, 5, 5, 89, 5, 1025, 85, 5, 65, 93, 5, 16385, 80, 5, 3, 88, 5, 513, 84, 5, 33, 92, 5, 8193, 82, 5, 9, 90, 5, 2049, 86, 5, 129, 192, 5, 24577, 80, 5, 2, 87, 5, 385, 83, 5, 25, 91, 5, 6145, 81, 5, 7, 89, 5, 1537, 85, 5, 97, 93, 5, 24577, 80, 5, 4, 88, 5, 769, 84, 5, 49, 92, 5, 12289, 82, 5, 13, 90, 5, 3073, 86, 5, 193, 192, 5, 24577], tn = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], nn = [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, 112, 112], rn = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577], an = [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], be = 15;
2
- function We() {
3
- let n, t, e, r, a, l;
4
- function s(f, w, _, g, x, z, c, p, i, o, u) {
5
- let b, y, k, m, h, A, D, U, v, S, E, O, W, F, C;
6
- S = 0, h = _;
7
- do
8
- e[f[w + S]]++, S++, h--;
9
- while (h !== 0);
10
- if (e[0] == _) return c[0] = -1, p[0] = 0, 0;
11
- for (U = p[0], A = 1; A <= be && e[A] === 0; A++) ;
12
- for (D = A, U < A && (U = A), h = be; h !== 0 && e[h] === 0; h--) ;
13
- for (k = h, U > h && (U = h), p[0] = U, F = 1 << A; A < h; A++, F <<= 1) if ((F -= e[A]) < 0) return -3;
14
- if ((F -= e[h]) < 0) return -3;
15
- for (e[h] += F, l[1] = A = 0, S = 1, W = 2; --h != 0; ) l[W] = A += e[S], W++, S++;
16
- h = 0, S = 0;
17
- do
18
- (A = f[w + S]) !== 0 && (u[l[A]++] = h), S++;
19
- while (++h < _);
20
- for (_ = l[k], l[0] = h = 0, S = 0, m = -1, O = -U, a[0] = 0, E = 0, C = 0; D <= k; D++) for (b = e[D]; b-- != 0; ) {
21
- for (; D > O + U; ) {
22
- if (m++, O += U, C = k - O, C = C > U ? U : C, (y = 1 << (A = D - O)) > b + 1 && (y -= b + 1, W = D, A < C)) for (; ++A < C && !((y <<= 1) <= e[++W]); ) y -= e[W];
23
- if (C = 1 << A, o[0] + C > 1440) return -3;
24
- a[m] = E = o[0], o[0] += C, m !== 0 ? (l[m] = h, r[0] = A, r[1] = U, A = h >>> O - U, r[2] = E - a[m - 1] - A, i.set(r, 3 * (a[m - 1] + A))) : c[0] = E;
25
- }
26
- for (r[1] = D - O, S >= _ ? r[0] = 192 : u[S] < g ? (r[0] = u[S] < 256 ? 0 : 96, r[2] = u[S++]) : (r[0] = z[u[S] - g] + 16 + 64, r[2] = x[u[S++] - g]), y = 1 << D - O, A = h >>> O; A < C; A += y) i.set(r, 3 * (E + A));
27
- for (A = 1 << D - 1; h & A; A >>>= 1) h ^= A;
28
- for (h ^= A, v = (1 << O) - 1; (h & v) != l[m]; ) m--, O -= U, v = (1 << O) - 1;
29
- }
30
- return F !== 0 && k != 1 ? -5 : 0;
31
- }
32
- function d(f) {
33
- let w;
34
- for (n || (n = [], t = [], e = new Int32Array(16), r = [], a = new Int32Array(be), l = new Int32Array(16)), t.length < f && (t = []), w = 0; w < f; w++) t[w] = 0;
35
- for (w = 0; w < 16; w++) e[w] = 0;
36
- for (w = 0; w < 3; w++) r[w] = 0;
37
- a.set(e.subarray(0, be), 0), l.set(e.subarray(0, 16), 0);
38
- }
39
- this.inflate_trees_bits = function(f, w, _, g, x) {
40
- let z;
41
- return d(19), n[0] = 0, z = s(f, 0, 19, 19, null, null, _, w, g, n, t), z == -3 ? x.msg = "oversubscribed dynamic bit lengths tree" : z != -5 && w[0] !== 0 || (x.msg = "incomplete dynamic bit lengths tree", z = -3), z;
42
- }, this.inflate_trees_dynamic = function(f, w, _, g, x, z, c, p, i) {
43
- let o;
44
- return d(288), n[0] = 0, o = s(_, 0, f, 257, tn, nn, z, g, p, n, t), o != 0 || g[0] === 0 ? (o == -3 ? i.msg = "oversubscribed literal/length tree" : o != -4 && (i.msg = "incomplete literal/length tree", o = -3), o) : (d(288), o = s(_, f, w, 0, rn, an, c, x, p, n, t), o != 0 || x[0] === 0 && f > 257 ? (o == -3 ? i.msg = "oversubscribed distance tree" : o == -5 ? (i.msg = "incomplete distance tree", o = -3) : o != -4 && (i.msg = "empty distance tree with lengths", o = -3), o) : 0);
45
- };
46
- }
47
- We.inflate_trees_fixed = function(n, t, e, r) {
48
- return n[0] = 9, t[0] = 5, e[0] = $t, r[0] = en, 0;
49
- };
50
- function sn() {
51
- const n = this;
52
- let t, e, r, a, l = 0, s = 0, d = 0, f = 0, w = 0, _ = 0, g = 0, x = 0, z = 0, c = 0;
53
- function p(i, o, u, b, y, k, m, h) {
54
- let A, D, U, v, S, E, O, W, F, C, j, K, T, R, M, L;
55
- O = h.next_in_index, W = h.avail_in, S = m.bitb, E = m.bitk, F = m.write, C = F < m.read ? m.read - F - 1 : m.end - F, j = Z[i], K = Z[o];
56
- do {
57
- for (; E < 20; ) W--, S |= (255 & h.read_byte(O++)) << E, E += 8;
58
- if (A = S & j, D = u, U = b, L = 3 * (U + A), (v = D[L]) !== 0) for (; ; ) {
59
- if (S >>= D[L + 1], E -= D[L + 1], 16 & v) {
60
- for (v &= 15, T = D[L + 2] + (S & Z[v]), S >>= v, E -= v; E < 15; ) W--, S |= (255 & h.read_byte(O++)) << E, E += 8;
61
- for (A = S & K, D = y, U = k, L = 3 * (U + A), v = D[L]; ; ) {
62
- if (S >>= D[L + 1], E -= D[L + 1], 16 & v) {
63
- for (v &= 15; E < v; ) W--, S |= (255 & h.read_byte(O++)) << E, E += 8;
64
- if (R = D[L + 2] + (S & Z[v]), S >>= v, E -= v, C -= T, F >= R) M = F - R, F - M > 0 && 2 > F - M ? (m.win[F++] = m.win[M++], m.win[F++] = m.win[M++], T -= 2) : (m.win.set(m.win.subarray(M, M + 2), F), F += 2, M += 2, T -= 2);
65
- else {
66
- M = F - R;
67
- do
68
- M += m.end;
69
- while (M < 0);
70
- if (v = m.end - M, T > v) {
71
- if (T -= v, F - M > 0 && v > F - M) do
72
- m.win[F++] = m.win[M++];
73
- while (--v != 0);
74
- else m.win.set(m.win.subarray(M, M + v), F), F += v, M += v, v = 0;
75
- M = 0;
76
- }
77
- }
78
- if (F - M > 0 && T > F - M) do
79
- m.win[F++] = m.win[M++];
80
- while (--T != 0);
81
- else m.win.set(m.win.subarray(M, M + T), F), F += T, M += T, T = 0;
82
- break;
83
- }
84
- if (64 & v) return h.msg = "invalid distance code", T = h.avail_in - W, T = E >> 3 < T ? E >> 3 : T, W += T, O -= T, E -= T << 3, m.bitb = S, m.bitk = E, h.avail_in = W, h.total_in += O - h.next_in_index, h.next_in_index = O, m.write = F, -3;
85
- A += D[L + 2], A += S & Z[v], L = 3 * (U + A), v = D[L];
86
- }
87
- break;
88
- }
89
- if (64 & v) return 32 & v ? (T = h.avail_in - W, T = E >> 3 < T ? E >> 3 : T, W += T, O -= T, E -= T << 3, m.bitb = S, m.bitk = E, h.avail_in = W, h.total_in += O - h.next_in_index, h.next_in_index = O, m.write = F, 1) : (h.msg = "invalid literal/length code", T = h.avail_in - W, T = E >> 3 < T ? E >> 3 : T, W += T, O -= T, E -= T << 3, m.bitb = S, m.bitk = E, h.avail_in = W, h.total_in += O - h.next_in_index, h.next_in_index = O, m.write = F, -3);
90
- if (A += D[L + 2], A += S & Z[v], L = 3 * (U + A), (v = D[L]) === 0) {
91
- S >>= D[L + 1], E -= D[L + 1], m.win[F++] = D[L + 2], C--;
92
- break;
93
- }
94
- }
95
- else S >>= D[L + 1], E -= D[L + 1], m.win[F++] = D[L + 2], C--;
96
- } while (C >= 258 && W >= 10);
97
- return T = h.avail_in - W, T = E >> 3 < T ? E >> 3 : T, W += T, O -= T, E -= T << 3, m.bitb = S, m.bitk = E, h.avail_in = W, h.total_in += O - h.next_in_index, h.next_in_index = O, m.write = F, 0;
98
- }
99
- n.init = function(i, o, u, b, y, k) {
100
- t = 0, g = i, x = o, r = u, z = b, a = y, c = k, e = null;
101
- }, n.proc = function(i, o, u) {
102
- let b, y, k, m, h, A, D, U = 0, v = 0, S = 0;
103
- for (S = o.next_in_index, m = o.avail_in, U = i.bitb, v = i.bitk, h = i.write, A = h < i.read ? i.read - h - 1 : i.end - h; ; ) switch (t) {
104
- case 0:
105
- if (A >= 258 && m >= 10 && (i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, u = p(g, x, r, z, a, c, i, o), S = o.next_in_index, m = o.avail_in, U = i.bitb, v = i.bitk, h = i.write, A = h < i.read ? i.read - h - 1 : i.end - h, u != 0)) {
106
- t = u == 1 ? 7 : 9;
107
- break;
108
- }
109
- d = g, e = r, s = z, t = 1;
110
- case 1:
111
- for (b = d; v < b; ) {
112
- if (m === 0) return i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
113
- u = 0, m--, U |= (255 & o.read_byte(S++)) << v, v += 8;
114
- }
115
- if (y = 3 * (s + (U & Z[b])), U >>>= e[y + 1], v -= e[y + 1], k = e[y], k === 0) {
116
- f = e[y + 2], t = 6;
117
- break;
118
- }
119
- if (16 & k) {
120
- w = 15 & k, l = e[y + 2], t = 2;
121
- break;
122
- }
123
- if (!(64 & k)) {
124
- d = k, s = y / 3 + e[y + 2];
125
- break;
126
- }
127
- if (32 & k) {
128
- t = 7;
129
- break;
130
- }
131
- return t = 9, o.msg = "invalid literal/length code", u = -3, i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
132
- case 2:
133
- for (b = w; v < b; ) {
134
- if (m === 0) return i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
135
- u = 0, m--, U |= (255 & o.read_byte(S++)) << v, v += 8;
136
- }
137
- l += U & Z[b], U >>= b, v -= b, d = x, e = a, s = c, t = 3;
138
- case 3:
139
- for (b = d; v < b; ) {
140
- if (m === 0) return i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
141
- u = 0, m--, U |= (255 & o.read_byte(S++)) << v, v += 8;
142
- }
143
- if (y = 3 * (s + (U & Z[b])), U >>= e[y + 1], v -= e[y + 1], k = e[y], 16 & k) {
144
- w = 15 & k, _ = e[y + 2], t = 4;
145
- break;
146
- }
147
- if (!(64 & k)) {
148
- d = k, s = y / 3 + e[y + 2];
149
- break;
150
- }
151
- return t = 9, o.msg = "invalid distance code", u = -3, i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
152
- case 4:
153
- for (b = w; v < b; ) {
154
- if (m === 0) return i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
155
- u = 0, m--, U |= (255 & o.read_byte(S++)) << v, v += 8;
156
- }
157
- _ += U & Z[b], U >>= b, v -= b, t = 5;
158
- case 5:
159
- for (D = h - _; D < 0; ) D += i.end;
160
- for (; l !== 0; ) {
161
- if (A === 0 && (h == i.end && i.read !== 0 && (h = 0, A = h < i.read ? i.read - h - 1 : i.end - h), A === 0 && (i.write = h, u = i.inflate_flush(o, u), h = i.write, A = h < i.read ? i.read - h - 1 : i.end - h, h == i.end && i.read !== 0 && (h = 0, A = h < i.read ? i.read - h - 1 : i.end - h), A === 0))) return i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
162
- i.win[h++] = i.win[D++], A--, D == i.end && (D = 0), l--;
163
- }
164
- t = 0;
165
- break;
166
- case 6:
167
- if (A === 0 && (h == i.end && i.read !== 0 && (h = 0, A = h < i.read ? i.read - h - 1 : i.end - h), A === 0 && (i.write = h, u = i.inflate_flush(o, u), h = i.write, A = h < i.read ? i.read - h - 1 : i.end - h, h == i.end && i.read !== 0 && (h = 0, A = h < i.read ? i.read - h - 1 : i.end - h), A === 0))) return i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
168
- u = 0, i.win[h++] = f, A--, t = 0;
169
- break;
170
- case 7:
171
- if (v > 7 && (v -= 8, m++, S--), i.write = h, u = i.inflate_flush(o, u), h = i.write, A = h < i.read ? i.read - h - 1 : i.end - h, i.read != i.write) return i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
172
- t = 8;
173
- case 8:
174
- return u = 1, i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
175
- case 9:
176
- return u = -3, i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
177
- default:
178
- return u = -2, i.bitb = U, i.bitk = v, o.avail_in = m, o.total_in += S - o.next_in_index, o.next_in_index = S, i.write = h, i.inflate_flush(o, u);
179
- }
180
- }, n.free = function() {
181
- };
182
- }
183
- const Ge = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
184
- function on(n, t) {
185
- const e = this;
186
- let r, a = 0, l = 0, s = 0, d = 0;
187
- const f = [0], w = [0], _ = new sn();
188
- let g = 0, x = new Int32Array(4320);
189
- const z = new We();
190
- e.bitk = 0, e.bitb = 0, e.win = new Uint8Array(t), e.end = t, e.read = 0, e.write = 0, e.reset = function(c, p) {
191
- p && (p[0] = 0), a == 6 && _.free(c), a = 0, e.bitk = 0, e.bitb = 0, e.read = e.write = 0;
192
- }, e.reset(n, null), e.inflate_flush = function(c, p) {
193
- let i, o, u;
194
- return o = c.next_out_index, u = e.read, i = (u <= e.write ? e.write : e.end) - u, i > c.avail_out && (i = c.avail_out), i !== 0 && p == -5 && (p = 0), c.avail_out -= i, c.total_out += i, c.next_out.set(e.win.subarray(u, u + i), o), o += i, u += i, u == e.end && (u = 0, e.write == e.end && (e.write = 0), i = e.write - u, i > c.avail_out && (i = c.avail_out), i !== 0 && p == -5 && (p = 0), c.avail_out -= i, c.total_out += i, c.next_out.set(e.win.subarray(u, u + i), o), o += i, u += i), c.next_out_index = o, e.read = u, p;
195
- }, e.proc = function(c, p) {
196
- let i, o, u, b, y, k, m, h;
197
- for (b = c.next_in_index, y = c.avail_in, o = e.bitb, u = e.bitk, k = e.write, m = k < e.read ? e.read - k - 1 : e.end - k; ; ) {
198
- let A, D, U, v, S, E, O, W;
199
- switch (a) {
200
- case 0:
201
- for (; u < 3; ) {
202
- if (y === 0) return e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
203
- p = 0, y--, o |= (255 & c.read_byte(b++)) << u, u += 8;
204
- }
205
- switch (i = 7 & o, g = 1 & i, i >>> 1) {
206
- case 0:
207
- o >>>= 3, u -= 3, i = 7 & u, o >>>= i, u -= i, a = 1;
208
- break;
209
- case 1:
210
- A = [], D = [], U = [[]], v = [[]], We.inflate_trees_fixed(A, D, U, v), _.init(A[0], D[0], U[0], 0, v[0], 0), o >>>= 3, u -= 3, a = 6;
211
- break;
212
- case 2:
213
- o >>>= 3, u -= 3, a = 3;
214
- break;
215
- case 3:
216
- return o >>>= 3, u -= 3, a = 9, c.msg = "invalid block type", p = -3, e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
217
- }
218
- break;
219
- case 1:
220
- for (; u < 32; ) {
221
- if (y === 0) return e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
222
- p = 0, y--, o |= (255 & c.read_byte(b++)) << u, u += 8;
223
- }
224
- if ((~o >>> 16 & 65535) != (65535 & o)) return a = 9, c.msg = "invalid stored block lengths", p = -3, e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
225
- l = 65535 & o, o = u = 0, a = l !== 0 ? 2 : g !== 0 ? 7 : 0;
226
- break;
227
- case 2:
228
- if (y === 0 || m === 0 && (k == e.end && e.read !== 0 && (k = 0, m = k < e.read ? e.read - k - 1 : e.end - k), m === 0 && (e.write = k, p = e.inflate_flush(c, p), k = e.write, m = k < e.read ? e.read - k - 1 : e.end - k, k == e.end && e.read !== 0 && (k = 0, m = k < e.read ? e.read - k - 1 : e.end - k), m === 0))) return e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
229
- if (p = 0, i = l, i > y && (i = y), i > m && (i = m), e.win.set(c.read_buf(b, i), k), b += i, y -= i, k += i, m -= i, (l -= i) != 0) break;
230
- a = g !== 0 ? 7 : 0;
231
- break;
232
- case 3:
233
- for (; u < 14; ) {
234
- if (y === 0) return e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
235
- p = 0, y--, o |= (255 & c.read_byte(b++)) << u, u += 8;
236
- }
237
- if (s = i = 16383 & o, (31 & i) > 29 || (i >> 5 & 31) > 29) return a = 9, c.msg = "too many length or distance symbols", p = -3, e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
238
- if (i = 258 + (31 & i) + (i >> 5 & 31), !r || r.length < i) r = [];
239
- else for (h = 0; h < i; h++) r[h] = 0;
240
- o >>>= 14, u -= 14, d = 0, a = 4;
241
- case 4:
242
- for (; d < 4 + (s >>> 10); ) {
243
- for (; u < 3; ) {
244
- if (y === 0) return e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
245
- p = 0, y--, o |= (255 & c.read_byte(b++)) << u, u += 8;
246
- }
247
- r[Ge[d++]] = 7 & o, o >>>= 3, u -= 3;
248
- }
249
- for (; d < 19; ) r[Ge[d++]] = 0;
250
- if (f[0] = 7, i = z.inflate_trees_bits(r, f, w, x, c), i != 0) return (p = i) == -3 && (r = null, a = 9), e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
251
- d = 0, a = 5;
252
- case 5:
253
- for (; i = s, !(d >= 258 + (31 & i) + (i >> 5 & 31)); ) {
254
- let F, C;
255
- for (i = f[0]; u < i; ) {
256
- if (y === 0) return e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
257
- p = 0, y--, o |= (255 & c.read_byte(b++)) << u, u += 8;
258
- }
259
- if (i = x[3 * (w[0] + (o & Z[i])) + 1], C = x[3 * (w[0] + (o & Z[i])) + 2], C < 16) o >>>= i, u -= i, r[d++] = C;
260
- else {
261
- for (h = C == 18 ? 7 : C - 14, F = C == 18 ? 11 : 3; u < i + h; ) {
262
- if (y === 0) return e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
263
- p = 0, y--, o |= (255 & c.read_byte(b++)) << u, u += 8;
264
- }
265
- if (o >>>= i, u -= i, F += o & Z[h], o >>>= h, u -= h, h = d, i = s, h + F > 258 + (31 & i) + (i >> 5 & 31) || C == 16 && h < 1) return r = null, a = 9, c.msg = "invalid bit length repeat", p = -3, e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
266
- C = C == 16 ? r[h - 1] : 0;
267
- do
268
- r[h++] = C;
269
- while (--F != 0);
270
- d = h;
271
- }
272
- }
273
- if (w[0] = -1, S = [], E = [], O = [], W = [], S[0] = 9, E[0] = 6, i = s, i = z.inflate_trees_dynamic(257 + (31 & i), 1 + (i >> 5 & 31), r, S, E, O, W, x, c), i != 0) return i == -3 && (r = null, a = 9), p = i, e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
274
- _.init(S[0], E[0], x, O[0], x, W[0]), a = 6;
275
- case 6:
276
- if (e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, (p = _.proc(e, c, p)) != 1) return e.inflate_flush(c, p);
277
- if (p = 0, _.free(c), b = c.next_in_index, y = c.avail_in, o = e.bitb, u = e.bitk, k = e.write, m = k < e.read ? e.read - k - 1 : e.end - k, g === 0) {
278
- a = 0;
279
- break;
280
- }
281
- a = 7;
282
- case 7:
283
- if (e.write = k, p = e.inflate_flush(c, p), k = e.write, m = k < e.read ? e.read - k - 1 : e.end - k, e.read != e.write) return e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
284
- a = 8;
285
- case 8:
286
- return p = 1, e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
287
- case 9:
288
- return p = -3, e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
289
- default:
290
- return p = -2, e.bitb = o, e.bitk = u, c.avail_in = y, c.total_in += b - c.next_in_index, c.next_in_index = b, e.write = k, e.inflate_flush(c, p);
291
- }
292
- }
293
- }, e.free = function(c) {
294
- e.reset(c, null), e.win = null, x = null;
295
- }, e.set_dictionary = function(c, p, i) {
296
- e.win.set(c.subarray(p, p + i), 0), e.read = e.write = i;
297
- }, e.sync_point = function() {
298
- return a == 1 ? 1 : 0;
299
- };
300
- }
301
- const X = 13, ln = [0, 0, 255, 255];
302
- function cn() {
303
- const n = this;
304
- function t(e) {
305
- return e && e.istate ? (e.total_in = e.total_out = 0, e.msg = null, e.istate.mode = 7, e.istate.blocks.reset(e, null), 0) : -2;
306
- }
307
- n.mode = 0, n.method = 0, n.was = [0], n.need = 0, n.marker = 0, n.wbits = 0, n.inflateEnd = function(e) {
308
- return n.blocks && n.blocks.free(e), n.blocks = null, 0;
309
- }, n.inflateInit = function(e, r) {
310
- return e.msg = null, n.blocks = null, r < 8 || r > 15 ? (n.inflateEnd(e), -2) : (n.wbits = r, e.istate.blocks = new on(e, 1 << r), t(e), 0);
311
- }, n.inflate = function(e, r) {
312
- let a, l;
313
- if (!e || !e.istate || !e.next_in) return -2;
314
- const s = e.istate;
315
- for (r = r == 4 ? -5 : 0, a = -5; ; ) switch (s.mode) {
316
- case 0:
317
- if (e.avail_in === 0) return a;
318
- if (a = r, e.avail_in--, e.total_in++, (15 & (s.method = e.read_byte(e.next_in_index++))) != 8) {
319
- s.mode = X, e.msg = "unknown compression method", s.marker = 5;
320
- break;
321
- }
322
- if (8 + (s.method >> 4) > s.wbits) {
323
- s.mode = X, e.msg = "invalid win size", s.marker = 5;
324
- break;
325
- }
326
- s.mode = 1;
327
- case 1:
328
- if (e.avail_in === 0) return a;
329
- if (a = r, e.avail_in--, e.total_in++, l = 255 & e.read_byte(e.next_in_index++), ((s.method << 8) + l) % 31 != 0) {
330
- s.mode = X, e.msg = "incorrect header check", s.marker = 5;
331
- break;
332
- }
333
- if (!(32 & l)) {
334
- s.mode = 7;
335
- break;
336
- }
337
- s.mode = 2;
338
- case 2:
339
- if (e.avail_in === 0) return a;
340
- a = r, e.avail_in--, e.total_in++, s.need = (255 & e.read_byte(e.next_in_index++)) << 24 & 4278190080, s.mode = 3;
341
- case 3:
342
- if (e.avail_in === 0) return a;
343
- a = r, e.avail_in--, e.total_in++, s.need += (255 & e.read_byte(e.next_in_index++)) << 16 & 16711680, s.mode = 4;
344
- case 4:
345
- if (e.avail_in === 0) return a;
346
- a = r, e.avail_in--, e.total_in++, s.need += (255 & e.read_byte(e.next_in_index++)) << 8 & 65280, s.mode = 5;
347
- case 5:
348
- return e.avail_in === 0 ? a : (a = r, e.avail_in--, e.total_in++, s.need += 255 & e.read_byte(e.next_in_index++), s.mode = 6, 2);
349
- case 6:
350
- return s.mode = X, e.msg = "need dictionary", s.marker = 0, -2;
351
- case 7:
352
- if (a = s.blocks.proc(e, a), a == -3) {
353
- s.mode = X, s.marker = 0;
354
- break;
355
- }
356
- if (a == 0 && (a = r), a != 1) return a;
357
- a = r, s.blocks.reset(e, s.was), s.mode = 12;
358
- case 12:
359
- return e.avail_in = 0, 1;
360
- case X:
361
- return -3;
362
- default:
363
- return -2;
364
- }
365
- }, n.inflateSetDictionary = function(e, r, a) {
366
- let l = 0, s = a;
367
- if (!e || !e.istate || e.istate.mode != 6) return -2;
368
- const d = e.istate;
369
- return s >= 1 << d.wbits && (s = (1 << d.wbits) - 1, l = a - s), d.blocks.set_dictionary(r, l, s), d.mode = 7, 0;
370
- }, n.inflateSync = function(e) {
371
- let r, a, l, s, d;
372
- if (!e || !e.istate) return -2;
373
- const f = e.istate;
374
- if (f.mode != X && (f.mode = X, f.marker = 0), (r = e.avail_in) === 0) return -5;
375
- for (a = e.next_in_index, l = f.marker; r !== 0 && l < 4; ) e.read_byte(a) == ln[l] ? l++ : l = e.read_byte(a) !== 0 ? 0 : 4 - l, a++, r--;
376
- return e.total_in += a - e.next_in_index, e.next_in_index = a, e.avail_in = r, f.marker = l, l != 4 ? -3 : (s = e.total_in, d = e.total_out, t(e), e.total_in = s, e.total_out = d, f.mode = 7, 0);
377
- }, n.inflateSyncPoint = function(e) {
378
- return e && e.istate && e.istate.blocks ? e.istate.blocks.sync_point() : -2;
379
- };
380
- }
381
- function pt() {
382
- }
383
- pt.prototype = { inflateInit(n) {
384
- const t = this;
385
- return t.istate = new cn(), n || (n = 15), t.istate.inflateInit(t, n);
386
- }, inflate(n) {
387
- const t = this;
388
- return t.istate ? t.istate.inflate(t, n) : -2;
389
- }, inflateEnd() {
390
- const n = this;
391
- if (!n.istate) return -2;
392
- const t = n.istate.inflateEnd(n);
393
- return n.istate = null, t;
394
- }, inflateSync() {
395
- const n = this;
396
- return n.istate ? n.istate.inflateSync(n) : -2;
397
- }, inflateSetDictionary(n, t) {
398
- const e = this;
399
- return e.istate ? e.istate.inflateSetDictionary(e, n, t) : -2;
400
- }, read_byte(n) {
401
- return this.next_in[n];
402
- }, read_buf(n, t) {
403
- return this.next_in.subarray(n, n + t);
404
- } };
405
- const ie = 4294967295, re = 65535, Je = 33639248, Qe = 101075792, ae = 22, H = void 0, te = "undefined", we = "function";
406
- class Xe {
407
- constructor(t) {
408
- return class extends TransformStream {
409
- constructor(e, r) {
410
- const a = new t(r);
411
- super({ transform(l, s) {
412
- s.enqueue(a.append(l));
413
- }, flush(l) {
414
- const s = a.flush();
415
- s && l.enqueue(s);
416
- } });
417
- }
418
- };
419
- }
420
- }
421
- let mt = 2;
422
- try {
423
- typeof navigator != te && navigator.hardwareConcurrency && (mt = navigator.hardwareConcurrency);
424
- } catch {
425
- }
426
- const un = { chunkSize: 524288, maxWorkers: mt, terminateWorkerTimeout: 5e3, useWebWorkers: !0, useCompressionStream: !0, workerScripts: H, CompressionStreamNative: typeof CompressionStream != te && CompressionStream, DecompressionStreamNative: typeof DecompressionStream != te && DecompressionStream }, ee = Object.assign({}, un);
427
- function fn(n) {
428
- const { baseURL: t, chunkSize: e, maxWorkers: r, terminateWorkerTimeout: a, useCompressionStream: l, useWebWorkers: s, Deflate: d, Inflate: f, CompressionStream: w, DecompressionStream: _, workerScripts: g } = n;
429
- if (Y("baseURL", t), Y("chunkSize", e), Y("maxWorkers", r), Y("terminateWorkerTimeout", a), Y("useCompressionStream", l), Y("useWebWorkers", s), d && (ee.CompressionStream = new Xe(d)), f && (ee.DecompressionStream = new Xe(f)), Y("CompressionStream", w), Y("DecompressionStream", _), g !== H) {
430
- const { deflate: x, inflate: z } = g;
431
- if ((x || z) && (ee.workerScripts || (ee.workerScripts = {})), x) {
432
- if (!Array.isArray(x)) throw new Error("workerScripts.deflate must be an array");
433
- ee.workerScripts.deflate = x;
434
- }
435
- if (z) {
436
- if (!Array.isArray(z)) throw new Error("workerScripts.inflate must be an array");
437
- ee.workerScripts.inflate = z;
438
- }
439
- }
440
- }
441
- function Y(n, t) {
442
- t !== H && (ee[n] = t);
443
- }
444
- const yt = [];
445
- for (let n = 0; n < 256; n++) {
446
- let t = n;
447
- for (let e = 0; e < 8; e++) 1 & t ? t = t >>> 1 ^ 3988292384 : t >>>= 1;
448
- yt[n] = t;
449
- }
450
- class xe {
451
- constructor(t) {
452
- this.crc = t || -1;
453
- }
454
- append(t) {
455
- let e = 0 | this.crc;
456
- for (let r = 0, a = 0 | t.length; r < a; r++) e = e >>> 8 ^ yt[255 & (e ^ t[r])];
457
- this.crc = e;
458
- }
459
- get() {
460
- return ~this.crc;
461
- }
462
- }
463
- class xt extends TransformStream {
464
- constructor() {
465
- let t;
466
- const e = new xe();
467
- super({ transform(r, a) {
468
- e.append(r), a.enqueue(r);
469
- }, flush() {
470
- const r = new Uint8Array(4);
471
- new DataView(r.buffer).setUint32(0, e.get()), t.value = r;
472
- } }), t = this;
473
- }
474
- }
475
- const q = { concat(n, t) {
476
- if (n.length === 0 || t.length === 0) return n.concat(t);
477
- const e = n[n.length - 1], r = q.getPartial(e);
478
- return r === 32 ? n.concat(t) : q._shiftRight(t, r, 0 | e, n.slice(0, n.length - 1));
479
- }, bitLength(n) {
480
- const t = n.length;
481
- if (t === 0) return 0;
482
- const e = n[t - 1];
483
- return 32 * (t - 1) + q.getPartial(e);
484
- }, clamp(n, t) {
485
- if (32 * n.length < t) return n;
486
- const e = (n = n.slice(0, Math.ceil(t / 32))).length;
487
- return t &= 31, e > 0 && t && (n[e - 1] = q.partial(t, n[e - 1] & 2147483648 >> t - 1, 1)), n;
488
- }, partial: (n, t, e) => n === 32 ? t : (e ? 0 | t : t << 32 - n) + 1099511627776 * n, getPartial: (n) => Math.round(n / 1099511627776) || 32, _shiftRight(n, t, e, r) {
489
- for (r === void 0 && (r = []); t >= 32; t -= 32) r.push(e), e = 0;
490
- if (t === 0) return r.concat(n);
491
- for (let s = 0; s < n.length; s++) r.push(e | n[s] >>> t), e = n[s] << 32 - t;
492
- const a = n.length ? n[n.length - 1] : 0, l = q.getPartial(a);
493
- return r.push(q.partial(t + l & 31, t + l > 32 ? e : r.pop(), 1)), r;
494
- } }, ge = { bytes: { fromBits(n) {
495
- const t = q.bitLength(n) / 8, e = new Uint8Array(t);
496
- let r;
497
- for (let a = 0; a < t; a++) 3 & a || (r = n[a / 4]), e[a] = r >>> 24, r <<= 8;
498
- return e;
499
- }, toBits(n) {
500
- const t = [];
501
- let e, r = 0;
502
- for (e = 0; e < n.length; e++) r = r << 8 | n[e], 3 & ~e || (t.push(r), r = 0);
503
- return 3 & e && t.push(q.partial(8 * (3 & e), r)), t;
504
- } } }, dn = { sha1: class {
505
- constructor(n) {
506
- const t = this;
507
- t.blockSize = 512, t._init = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], t._key = [1518500249, 1859775393, 2400959708, 3395469782], n ? (t._h = n._h.slice(0), t._buffer = n._buffer.slice(0), t._length = n._length) : t.reset();
508
- }
509
- reset() {
510
- const n = this;
511
- return n._h = n._init.slice(0), n._buffer = [], n._length = 0, n;
512
- }
513
- update(n) {
514
- const t = this;
515
- typeof n == "string" && (n = ge.utf8String.toBits(n));
516
- const e = t._buffer = q.concat(t._buffer, n), r = t._length, a = t._length = r + q.bitLength(n);
517
- if (a > 9007199254740991) throw new Error("Cannot hash more than 2^53 - 1 bits");
518
- const l = new Uint32Array(e);
519
- let s = 0;
520
- for (let d = t.blockSize + r - (t.blockSize + r & t.blockSize - 1); d <= a; d += t.blockSize) t._block(l.subarray(16 * s, 16 * (s + 1))), s += 1;
521
- return e.splice(0, 16 * s), t;
522
- }
523
- finalize() {
524
- const n = this;
525
- let t = n._buffer;
526
- const e = n._h;
527
- t = q.concat(t, [q.partial(1, 1)]);
528
- for (let r = t.length + 2; 15 & r; r++) t.push(0);
529
- for (t.push(Math.floor(n._length / 4294967296)), t.push(0 | n._length); t.length; ) n._block(t.splice(0, 16));
530
- return n.reset(), e;
531
- }
532
- _f(n, t, e, r) {
533
- return n <= 19 ? t & e | ~t & r : n <= 39 ? t ^ e ^ r : n <= 59 ? t & e | t & r | e & r : n <= 79 ? t ^ e ^ r : void 0;
534
- }
535
- _S(n, t) {
536
- return t << n | t >>> 32 - n;
537
- }
538
- _block(n) {
539
- const t = this, e = t._h, r = Array(80);
540
- for (let w = 0; w < 16; w++) r[w] = n[w];
541
- let a = e[0], l = e[1], s = e[2], d = e[3], f = e[4];
542
- for (let w = 0; w <= 79; w++) {
543
- w >= 16 && (r[w] = t._S(1, r[w - 3] ^ r[w - 8] ^ r[w - 14] ^ r[w - 16]));
544
- const _ = t._S(5, a) + t._f(w, l, s, d) + f + r[w] + t._key[Math.floor(w / 20)] | 0;
545
- f = d, d = s, s = t._S(30, l), l = a, a = _;
546
- }
547
- e[0] = e[0] + a | 0, e[1] = e[1] + l | 0, e[2] = e[2] + s | 0, e[3] = e[3] + d | 0, e[4] = e[4] + f | 0;
548
- }
549
- } }, hn = { aes: class {
550
- constructor(n) {
551
- const t = this;
552
- t._tables = [[[], [], [], [], []], [[], [], [], [], []]], t._tables[0][0][0] || t._precompute();
553
- const e = t._tables[0][4], r = t._tables[1], a = n.length;
554
- let l, s, d, f = 1;
555
- if (a !== 4 && a !== 6 && a !== 8) throw new Error("invalid aes key size");
556
- for (t._key = [s = n.slice(0), d = []], l = a; l < 4 * a + 28; l++) {
557
- let w = s[l - 1];
558
- (l % a == 0 || a === 8 && l % a == 4) && (w = e[w >>> 24] << 24 ^ e[w >> 16 & 255] << 16 ^ e[w >> 8 & 255] << 8 ^ e[255 & w], l % a == 0 && (w = w << 8 ^ w >>> 24 ^ f << 24, f = f << 1 ^ 283 * (f >> 7))), s[l] = s[l - a] ^ w;
559
- }
560
- for (let w = 0; l; w++, l--) {
561
- const _ = s[3 & w ? l : l - 4];
562
- d[w] = l <= 4 || w < 4 ? _ : r[0][e[_ >>> 24]] ^ r[1][e[_ >> 16 & 255]] ^ r[2][e[_ >> 8 & 255]] ^ r[3][e[255 & _]];
563
- }
564
- }
565
- encrypt(n) {
566
- return this._crypt(n, 0);
567
- }
568
- decrypt(n) {
569
- return this._crypt(n, 1);
570
- }
571
- _precompute() {
572
- const n = this._tables[0], t = this._tables[1], e = n[4], r = t[4], a = [], l = [];
573
- let s, d, f, w;
574
- for (let _ = 0; _ < 256; _++) l[(a[_] = _ << 1 ^ 283 * (_ >> 7)) ^ _] = _;
575
- for (let _ = s = 0; !e[_]; _ ^= d || 1, s = l[s] || 1) {
576
- let g = s ^ s << 1 ^ s << 2 ^ s << 3 ^ s << 4;
577
- g = g >> 8 ^ 255 & g ^ 99, e[_] = g, r[g] = _, w = a[f = a[d = a[_]]];
578
- let x = 16843009 * w ^ 65537 * f ^ 257 * d ^ 16843008 * _, z = 257 * a[g] ^ 16843008 * g;
579
- for (let c = 0; c < 4; c++) n[c][_] = z = z << 24 ^ z >>> 8, t[c][g] = x = x << 24 ^ x >>> 8;
580
- }
581
- for (let _ = 0; _ < 5; _++) n[_] = n[_].slice(0), t[_] = t[_].slice(0);
582
- }
583
- _crypt(n, t) {
584
- if (n.length !== 4) throw new Error("invalid aes block size");
585
- const e = this._key[t], r = e.length / 4 - 2, a = [0, 0, 0, 0], l = this._tables[t], s = l[0], d = l[1], f = l[2], w = l[3], _ = l[4];
586
- let g, x, z, c = n[0] ^ e[0], p = n[t ? 3 : 1] ^ e[1], i = n[2] ^ e[2], o = n[t ? 1 : 3] ^ e[3], u = 4;
587
- for (let b = 0; b < r; b++) g = s[c >>> 24] ^ d[p >> 16 & 255] ^ f[i >> 8 & 255] ^ w[255 & o] ^ e[u], x = s[p >>> 24] ^ d[i >> 16 & 255] ^ f[o >> 8 & 255] ^ w[255 & c] ^ e[u + 1], z = s[i >>> 24] ^ d[o >> 16 & 255] ^ f[c >> 8 & 255] ^ w[255 & p] ^ e[u + 2], o = s[o >>> 24] ^ d[c >> 16 & 255] ^ f[p >> 8 & 255] ^ w[255 & i] ^ e[u + 3], u += 4, c = g, p = x, i = z;
588
- for (let b = 0; b < 4; b++) a[t ? 3 & -b : b] = _[c >>> 24] << 24 ^ _[p >> 16 & 255] << 16 ^ _[i >> 8 & 255] << 8 ^ _[255 & o] ^ e[u++], g = c, c = p, p = i, i = o, o = g;
589
- return a;
590
- }
591
- } }, wn = { getRandomValues(n) {
592
- const t = new Uint32Array(n.buffer), e = (r) => {
593
- let a = 987654321;
594
- const l = 4294967295;
595
- return function() {
596
- return a = 36969 * (65535 & a) + (a >> 16) & l, (((a << 16) + (r = 18e3 * (65535 & r) + (r >> 16) & l) & l) / 4294967296 + 0.5) * (Math.random() > 0.5 ? 1 : -1);
597
- };
598
- };
599
- for (let r, a = 0; a < n.length; a += 4) {
600
- const l = e(4294967296 * (r || Math.random()));
601
- r = 987654071 * l(), t[a / 4] = 4294967296 * l() | 0;
602
- }
603
- return n;
604
- } }, _n = { ctrGladman: class {
605
- constructor(n, t) {
606
- this._prf = n, this._initIv = t, this._iv = t;
607
- }
608
- reset() {
609
- this._iv = this._initIv;
610
- }
611
- update(n) {
612
- return this.calculate(this._prf, n, this._iv);
613
- }
614
- incWord(n) {
615
- if (255 & ~(n >> 24)) n += 1 << 24;
616
- else {
617
- let t = n >> 16 & 255, e = n >> 8 & 255, r = 255 & n;
618
- t === 255 ? (t = 0, e === 255 ? (e = 0, r === 255 ? r = 0 : ++r) : ++e) : ++t, n = 0, n += t << 16, n += e << 8, n += r;
619
- }
620
- return n;
621
- }
622
- incCounter(n) {
623
- (n[0] = this.incWord(n[0])) === 0 && (n[1] = this.incWord(n[1]));
624
- }
625
- calculate(n, t, e) {
626
- let r;
627
- if (!(r = t.length)) return [];
628
- const a = q.bitLength(t);
629
- for (let l = 0; l < r; l += 4) {
630
- this.incCounter(e);
631
- const s = n.encrypt(e);
632
- t[l] ^= s[0], t[l + 1] ^= s[1], t[l + 2] ^= s[2], t[l + 3] ^= s[3];
633
- }
634
- return q.clamp(t, a);
635
- }
636
- } }, se = { importKey: (n) => new se.hmacSha1(ge.bytes.toBits(n)), pbkdf2(n, t, e, r) {
637
- if (e = e || 1e4, r < 0 || e < 0) throw new Error("invalid params to pbkdf2");
638
- const a = 1 + (r >> 5) << 2;
639
- let l, s, d, f, w;
640
- const _ = new ArrayBuffer(a), g = new DataView(_);
641
- let x = 0;
642
- const z = q;
643
- for (t = ge.bytes.toBits(t), w = 1; x < (a || 1); w++) {
644
- for (l = s = n.encrypt(z.concat(t, [w])), d = 1; d < e; d++) for (s = n.encrypt(s), f = 0; f < s.length; f++) l[f] ^= s[f];
645
- for (d = 0; x < (a || 1) && d < l.length; d++) g.setInt32(x, l[d]), x += 4;
646
- }
647
- return _.slice(0, r / 8);
648
- }, hmacSha1: class {
649
- constructor(n) {
650
- const t = this, e = t._hash = dn.sha1, r = [[], []];
651
- t._baseHash = [new e(), new e()];
652
- const a = t._baseHash[0].blockSize / 32;
653
- n.length > a && (n = new e().update(n).finalize());
654
- for (let l = 0; l < a; l++) r[0][l] = 909522486 ^ n[l], r[1][l] = 1549556828 ^ n[l];
655
- t._baseHash[0].update(r[0]), t._baseHash[1].update(r[1]), t._resultHash = new e(t._baseHash[0]);
656
- }
657
- reset() {
658
- const n = this;
659
- n._resultHash = new n._hash(n._baseHash[0]), n._updated = !1;
660
- }
661
- update(n) {
662
- this._updated = !0, this._resultHash.update(n);
663
- }
664
- digest() {
665
- const n = this, t = n._resultHash.finalize(), e = new n._hash(n._baseHash[1]).update(t).finalize();
666
- return n.reset(), e;
667
- }
668
- encrypt(n) {
669
- if (this._updated) throw new Error("encrypt on already updated hmac called!");
670
- return this.update(n), this.digest(n);
671
- }
672
- } }, bn = typeof crypto != te && typeof crypto.getRandomValues == we, gt = "Invalid password", kt = "Invalid signature", Pe = "zipjs-abort-check-password";
673
- function vt(n) {
674
- return bn ? crypto.getRandomValues(n) : wn.getRandomValues(n);
675
- }
676
- const oe = 16, St = { name: "PBKDF2" }, pn = Object.assign({ hash: { name: "HMAC" } }, St), Ue = Object.assign({ iterations: 1e3, hash: { name: "SHA-1" } }, St), mn = ["deriveBits"], ue = [8, 12, 16], ce = [16, 24, 32], $ = 10, yn = [0, 0, 0, 0], Se = typeof crypto != te, fe = Se && crypto.subtle, zt = Se && typeof fe != te, J = ge.bytes, xn = hn.aes, gn = _n.ctrGladman, kn = se.hmacSha1;
677
- let Ye = Se && zt && typeof fe.importKey == we, $e = Se && zt && typeof fe.deriveBits == we;
678
- class vn extends TransformStream {
679
- constructor({ password: t, rawPassword: e, signed: r, encryptionStrength: a, checkPasswordOnly: l }) {
680
- super({ start() {
681
- Object.assign(this, { ready: new Promise(((s) => this.resolveReady = s)), password: Dt(t, e), signed: r, strength: a - 1, pending: new Uint8Array() });
682
- }, async transform(s, d) {
683
- const f = this, { password: w, strength: _, resolveReady: g, ready: x } = f;
684
- w ? (await (async function(c, p, i, o) {
685
- const u = await Ut(c, p, i, G(o, 0, ue[p])), b = G(o, ue[p]);
686
- if (u[0] != b[0] || u[1] != b[1]) throw new Error(gt);
687
- })(f, _, w, G(s, 0, ue[_] + 2)), s = G(s, ue[_] + 2), l ? d.error(new Error(Pe)) : g()) : await x;
688
- const z = new Uint8Array(s.length - $ - (s.length - $) % oe);
689
- d.enqueue(At(f, s, z, 0, $, !0));
690
- }, async flush(s) {
691
- const { signed: d, ctr: f, hmac: w, pending: _, ready: g } = this;
692
- if (w && f) {
693
- await g;
694
- const x = G(_, 0, _.length - $), z = G(_, _.length - $);
695
- let c = new Uint8Array();
696
- if (x.length) {
697
- const p = he(J, x);
698
- w.update(p);
699
- const i = f.update(p);
700
- c = de(J, i);
701
- }
702
- if (d) {
703
- const p = G(de(J, w.digest()), 0, $);
704
- for (let i = 0; i < $; i++) if (p[i] != z[i]) throw new Error(kt);
705
- }
706
- s.enqueue(c);
707
- }
708
- } });
709
- }
710
- }
711
- class Sn extends TransformStream {
712
- constructor({ password: t, rawPassword: e, encryptionStrength: r }) {
713
- let a;
714
- super({ start() {
715
- Object.assign(this, { ready: new Promise(((l) => this.resolveReady = l)), password: Dt(t, e), strength: r - 1, pending: new Uint8Array() });
716
- }, async transform(l, s) {
717
- const d = this, { password: f, strength: w, resolveReady: _, ready: g } = d;
718
- let x = new Uint8Array();
719
- f ? (x = await (async function(c, p, i) {
720
- const o = vt(new Uint8Array(ue[p])), u = await Ut(c, p, i, o);
721
- return Ce(o, u);
722
- })(d, w, f), _()) : await g;
723
- const z = new Uint8Array(x.length + l.length - l.length % oe);
724
- z.set(x, 0), s.enqueue(At(d, l, z, x.length, 0));
725
- }, async flush(l) {
726
- const { ctr: s, hmac: d, pending: f, ready: w } = this;
727
- if (d && s) {
728
- await w;
729
- let _ = new Uint8Array();
730
- if (f.length) {
731
- const g = s.update(he(J, f));
732
- d.update(g), _ = de(J, g);
733
- }
734
- a.signature = de(J, d.digest()).slice(0, $), l.enqueue(Ce(_, a.signature));
735
- }
736
- } }), a = this;
737
- }
738
- }
739
- function At(n, t, e, r, a, l) {
740
- const { ctr: s, hmac: d, pending: f } = n, w = t.length - a;
741
- let _;
742
- for (f.length && (t = Ce(f, t), e = (function(g, x) {
743
- if (x && x > g.length) {
744
- const z = g;
745
- (g = new Uint8Array(x)).set(z, 0);
746
- }
747
- return g;
748
- })(e, w - w % oe)), _ = 0; _ <= w - oe; _ += oe) {
749
- const g = he(J, G(t, _, _ + oe));
750
- l && d.update(g);
751
- const x = s.update(g);
752
- l || d.update(x), e.set(de(J, x), _ + r);
753
- }
754
- return n.pending = G(t, _), e;
755
- }
756
- async function Ut(n, t, e, r) {
757
- n.password = null;
758
- const a = await (async function(_, g, x, z, c) {
759
- if (!Ye) return se.importKey(g);
760
- try {
761
- return await fe.importKey(_, g, x, z, c);
762
- } catch {
763
- return Ye = !1, se.importKey(g);
764
- }
765
- })("raw", e, pn, !1, mn), l = await (async function(_, g, x) {
766
- if (!$e) return se.pbkdf2(g, _.salt, Ue.iterations, x);
767
- try {
768
- return await fe.deriveBits(_, g, x);
769
- } catch {
770
- return $e = !1, se.pbkdf2(g, _.salt, Ue.iterations, x);
771
- }
772
- })(Object.assign({ salt: r }, Ue), a, 8 * (2 * ce[t] + 2)), s = new Uint8Array(l), d = he(J, G(s, 0, ce[t])), f = he(J, G(s, ce[t], 2 * ce[t])), w = G(s, 2 * ce[t]);
773
- return Object.assign(n, { keys: { key: d, authentication: f, passwordVerification: w }, ctr: new gn(new xn(d), Array.from(yn)), hmac: new kn(f) }), w;
774
- }
775
- function Dt(n, t) {
776
- return t === H ? (function(e) {
777
- if (typeof TextEncoder == te) {
778
- e = unescape(encodeURIComponent(e));
779
- const r = new Uint8Array(e.length);
780
- for (let a = 0; a < r.length; a++) r[a] = e.charCodeAt(a);
781
- return r;
782
- }
783
- return new TextEncoder().encode(e);
784
- })(n) : t;
785
- }
786
- function Ce(n, t) {
787
- let e = n;
788
- return n.length + t.length && (e = new Uint8Array(n.length + t.length), e.set(n, 0), e.set(t, n.length)), e;
789
- }
790
- function G(n, t, e) {
791
- return n.subarray(t, e);
792
- }
793
- function de(n, t) {
794
- return n.fromBits(t);
795
- }
796
- function he(n, t) {
797
- return n.toBits(t);
798
- }
799
- const ke = 12;
800
- class zn extends TransformStream {
801
- constructor({ password: t, passwordVerification: e, checkPasswordOnly: r }) {
802
- super({ start() {
803
- Object.assign(this, { password: t, passwordVerification: e }), Et(this, t);
804
- }, transform(a, l) {
805
- const s = this;
806
- if (s.password) {
807
- const d = et(s, a.subarray(0, ke));
808
- if (s.password = null, d[11] != s.passwordVerification) throw new Error(gt);
809
- a = a.subarray(ke);
810
- }
811
- r ? l.error(new Error(Pe)) : l.enqueue(et(s, a));
812
- } });
813
- }
814
- }
815
- class An extends TransformStream {
816
- constructor({ password: t, passwordVerification: e }) {
817
- super({ start() {
818
- Object.assign(this, { password: t, passwordVerification: e }), Et(this, t);
819
- }, transform(r, a) {
820
- const l = this;
821
- let s, d;
822
- if (l.password) {
823
- l.password = null;
824
- const f = vt(new Uint8Array(ke));
825
- f[11] = l.passwordVerification, s = new Uint8Array(r.length + f.length), s.set(tt(l, f), 0), d = ke;
826
- } else s = new Uint8Array(r.length), d = 0;
827
- s.set(tt(l, r), d), a.enqueue(s);
828
- } });
829
- }
830
- }
831
- function et(n, t) {
832
- const e = new Uint8Array(t.length);
833
- for (let r = 0; r < t.length; r++) e[r] = Tt(n) ^ t[r], Re(n, e[r]);
834
- return e;
835
- }
836
- function tt(n, t) {
837
- const e = new Uint8Array(t.length);
838
- for (let r = 0; r < t.length; r++) e[r] = Tt(n) ^ t[r], Re(n, t[r]);
839
- return e;
840
- }
841
- function Et(n, t) {
842
- const e = [305419896, 591751049, 878082192];
843
- Object.assign(n, { keys: e, crcKey0: new xe(e[0]), crcKey2: new xe(e[2]) });
844
- for (let r = 0; r < t.length; r++) Re(n, t.charCodeAt(r));
845
- }
846
- function Re(n, t) {
847
- let [e, r, a] = n.keys;
848
- n.crcKey0.append([t]), e = ~n.crcKey0.get(), r = nt(Math.imul(nt(r + Ft(e)), 134775813) + 1), n.crcKey2.append([r >>> 24]), a = ~n.crcKey2.get(), n.keys = [e, r, a];
849
- }
850
- function Tt(n) {
851
- const t = 2 | n.keys[2];
852
- return Ft(Math.imul(t, 1 ^ t) >>> 8);
853
- }
854
- function Ft(n) {
855
- return 255 & n;
856
- }
857
- function nt(n) {
858
- return 4294967295 & n;
859
- }
860
- const rt = "deflate-raw";
861
- class Un extends TransformStream {
862
- constructor(t, { chunkSize: e, CompressionStream: r, CompressionStreamNative: a }) {
863
- super({});
864
- const { compressed: l, encrypted: s, useCompressionStream: d, zipCrypto: f, signed: w, level: _ } = t, g = this;
865
- let x, z, c = Ot(super.readable);
866
- s && !f || !w || (x = new xt(), c = Q(c, x)), l && (c = Ct(c, d, { level: _, chunkSize: e }, a, r)), s && (f ? c = Q(c, new An(t)) : (z = new Sn(t), c = Q(c, z))), Wt(g, c, (() => {
867
- let p;
868
- s && !f && (p = z.signature), s && !f || !w || (p = new DataView(x.value.buffer).getUint32(0)), g.signature = p;
869
- }));
870
- }
871
- }
872
- class Dn extends TransformStream {
873
- constructor(t, { chunkSize: e, DecompressionStream: r, DecompressionStreamNative: a }) {
874
- super({});
875
- const { zipCrypto: l, encrypted: s, signed: d, signature: f, compressed: w, useCompressionStream: _ } = t;
876
- let g, x, z = Ot(super.readable);
877
- s && (l ? z = Q(z, new zn(t)) : (x = new vn(t), z = Q(z, x))), w && (z = Ct(z, _, { chunkSize: e }, a, r)), s && !l || !d || (g = new xt(), z = Q(z, g)), Wt(this, z, (() => {
878
- if ((!s || l) && d) {
879
- const c = new DataView(g.value.buffer);
880
- if (f != c.getUint32(0, !1)) throw new Error(kt);
881
- }
882
- }));
883
- }
884
- }
885
- function Ot(n) {
886
- return Q(n, new TransformStream({ transform(t, e) {
887
- t && t.length && e.enqueue(t);
888
- } }));
889
- }
890
- function Wt(n, t, e) {
891
- t = Q(t, new TransformStream({ flush: e })), Object.defineProperty(n, "readable", { get: () => t });
892
- }
893
- function Ct(n, t, e, r, a) {
894
- try {
895
- n = Q(n, new (t && r ? r : a)(rt, e));
896
- } catch {
897
- if (!t) return n;
898
- try {
899
- n = Q(n, new a(rt, e));
900
- } catch {
901
- return n;
902
- }
903
- }
904
- return n;
905
- }
906
- function Q(n, t) {
907
- return n.pipeThrough(t);
908
- }
909
- const En = "message", Tn = "start", Fn = "pull", it = "data", at = "close", jt = "inflate";
910
- class On extends TransformStream {
911
- constructor(t, e) {
912
- super({});
913
- const r = this, { codecType: a } = t;
914
- let l;
915
- a.startsWith("deflate") ? l = Un : a.startsWith(jt) && (l = Dn);
916
- let s = 0, d = 0;
917
- const f = new l(t, e), w = super.readable, _ = new TransformStream({ transform(x, z) {
918
- x && x.length && (d += x.length, z.enqueue(x));
919
- }, flush() {
920
- Object.assign(r, { inputSize: d });
921
- } }), g = new TransformStream({ transform(x, z) {
922
- x && x.length && (s += x.length, z.enqueue(x));
923
- }, flush() {
924
- const { signature: x } = f;
925
- Object.assign(r, { signature: x, outputSize: s, inputSize: d });
926
- } });
927
- Object.defineProperty(r, "readable", { get: () => w.pipeThrough(_).pipeThrough(f).pipeThrough(g) });
928
- }
929
- }
930
- class Wn extends TransformStream {
931
- constructor(t) {
932
- let e;
933
- super({ transform: function r(a, l) {
934
- if (e) {
935
- const s = new Uint8Array(e.length + a.length);
936
- s.set(e), s.set(a, e.length), a = s, e = null;
937
- }
938
- a.length > t ? (l.enqueue(a.slice(0, t)), r(a.slice(t), l)) : e = a;
939
- }, flush(r) {
940
- e && e.length && r.enqueue(e);
941
- } });
942
- }
943
- }
944
- let Mt = typeof Worker != te;
945
- class De {
946
- constructor(t, { readable: e, writable: r }, { options: a, config: l, streamOptions: s, useWebWorkers: d, transferStreams: f, scripts: w }, _) {
947
- const { signal: g } = s;
948
- return Object.assign(t, { busy: !0, readable: e.pipeThrough(new Wn(l.chunkSize)).pipeThrough(new Cn(e, s), { signal: g }), writable: r, options: Object.assign({}, a), scripts: w, transferStreams: f, terminate: () => new Promise(((x) => {
949
- const { worker: z, busy: c } = t;
950
- z ? (c ? t.resolveTerminated = x : (z.terminate(), x()), t.interface = null) : x();
951
- })), onTaskFinished() {
952
- const { resolveTerminated: x } = t;
953
- x && (t.resolveTerminated = null, t.terminated = !0, t.worker.terminate(), x()), t.busy = !1, _(t);
954
- } }), (d && Mt ? jn : Lt)(t, l);
955
- }
956
- }
957
- class Cn extends TransformStream {
958
- constructor(t, { onstart: e, onprogress: r, size: a, onend: l }) {
959
- let s = 0;
960
- super({ async start() {
961
- e && await Ee(e, a);
962
- }, async transform(d, f) {
963
- s += d.length, r && await Ee(r, s, a), f.enqueue(d);
964
- }, async flush() {
965
- t.size = s, l && await Ee(l, s);
966
- } });
967
- }
968
- }
969
- async function Ee(n, ...t) {
970
- try {
971
- await n(...t);
972
- } catch {
973
- }
974
- }
975
- function Lt(n, t) {
976
- return { run: () => (async function({ options: e, readable: r, writable: a, onTaskFinished: l }, s) {
977
- try {
978
- const d = new On(e, s);
979
- await r.pipeThrough(d).pipeTo(a, { preventClose: !0, preventAbort: !0 });
980
- const { signature: f, inputSize: w, outputSize: _ } = d;
981
- return { signature: f, inputSize: w, outputSize: _ };
982
- } finally {
983
- l();
984
- }
985
- })(n, t) };
986
- }
987
- function jn(n, t) {
988
- const { baseURL: e, chunkSize: r } = t;
989
- if (!n.interface) {
990
- let a;
991
- try {
992
- a = (function(l, s, d) {
993
- const f = { type: "module" };
994
- let w, _;
995
- typeof l == we && (l = l());
996
- try {
997
- w = new URL(l, s);
998
- } catch {
999
- w = l;
1000
- }
1001
- if (st) try {
1002
- _ = new Worker(w);
1003
- } catch {
1004
- st = !1, _ = new Worker(w, f);
1005
- }
1006
- else _ = new Worker(w, f);
1007
- return _.addEventListener(En, ((g) => (async function({ data: x }, z) {
1008
- const { type: c, value: p, messageId: i, result: o, error: u } = x, { reader: b, writer: y, resolveResult: k, rejectResult: m, onTaskFinished: h } = z;
1009
- try {
1010
- if (u) {
1011
- const { message: D, stack: U, code: v, name: S } = u, E = new Error(D);
1012
- Object.assign(E, { stack: U, code: v, name: S }), A(E);
1013
- } else {
1014
- if (c == Fn) {
1015
- const { value: D, done: U } = await b.read();
1016
- pe({ type: it, value: D, done: U, messageId: i }, z);
1017
- }
1018
- c == it && (await y.ready, await y.write(new Uint8Array(p)), pe({ type: "ack", messageId: i }, z)), c == at && A(null, o);
1019
- }
1020
- } catch (D) {
1021
- pe({ type: at, messageId: i }, z), A(D);
1022
- }
1023
- function A(D, U) {
1024
- D ? m(D) : k(U), y && y.releaseLock(), h();
1025
- }
1026
- })(g, d))), _;
1027
- })(n.scripts[0], e, n);
1028
- } catch {
1029
- return Mt = !1, Lt(n, t);
1030
- }
1031
- Object.assign(n, { worker: a, interface: { run: () => (async function(l, s) {
1032
- let d, f;
1033
- const w = new Promise(((o, u) => {
1034
- d = o, f = u;
1035
- }));
1036
- Object.assign(l, { reader: null, writer: null, resolveResult: d, rejectResult: f, result: w });
1037
- const { readable: _, options: g, scripts: x } = l, { writable: z, closed: c } = (function(o) {
1038
- let u;
1039
- const b = new Promise(((k) => u = k));
1040
- return { writable: new WritableStream({ async write(k) {
1041
- const m = o.getWriter();
1042
- await m.ready, await m.write(k), m.releaseLock();
1043
- }, close() {
1044
- u();
1045
- }, abort: (k) => o.getWriter().abort(k) }), closed: b };
1046
- })(l.writable), p = pe({ type: Tn, scripts: x.slice(1), options: g, config: s, readable: _, writable: z }, l);
1047
- p || Object.assign(l, { reader: _.getReader(), writer: z.getWriter() });
1048
- const i = await w;
1049
- return p || await z.getWriter().close(), await c, i;
1050
- })(n, { chunkSize: r }) } });
1051
- }
1052
- return n.interface;
1053
- }
1054
- let st = !0, ot = !0;
1055
- function pe(n, { worker: t, writer: e, onTaskFinished: r, transferStreams: a }) {
1056
- try {
1057
- let { value: l, readable: s, writable: d } = n;
1058
- const f = [];
1059
- if (l && (l.byteLength < l.buffer.byteLength ? n.value = l.buffer.slice(0, l.byteLength) : n.value = l.buffer, f.push(n.value)), a && ot ? (s && f.push(s), d && f.push(d)) : n.readable = n.writable = null, f.length) try {
1060
- return t.postMessage(n, f), !0;
1061
- } catch {
1062
- ot = !1, n.readable = n.writable = null, t.postMessage(n);
1063
- }
1064
- else t.postMessage(n);
1065
- } catch (l) {
1066
- throw e && e.releaseLock(), r(), l;
1067
- }
1068
- }
1069
- let ne = [];
1070
- const Te = [];
1071
- let lt = 0;
1072
- async function Mn(n, t) {
1073
- const { options: e, config: r } = t, { transferStreams: a, useWebWorkers: l, useCompressionStream: s, codecType: d, compressed: f, signed: w, encrypted: _ } = e, { workerScripts: g, maxWorkers: x } = r;
1074
- t.transferStreams = a || a === H;
1075
- const z = !(f || w || _ || t.transferStreams);
1076
- return t.useWebWorkers = !z && (l || l === H && r.useWebWorkers), t.scripts = t.useWebWorkers && g ? g[d] : [], e.useCompressionStream = s || s === H && r.useCompressionStream, (await (async function() {
1077
- const p = ne.find(((i) => !i.busy));
1078
- if (p) return ct(p), new De(p, n, t, c);
1079
- if (ne.length < x) {
1080
- const i = { indexWorker: lt };
1081
- return lt++, ne.push(i), new De(i, n, t, c);
1082
- }
1083
- return new Promise(((i) => Te.push({ resolve: i, stream: n, workerOptions: t })));
1084
- })()).run();
1085
- function c(p) {
1086
- if (Te.length) {
1087
- const [{ resolve: i, stream: o, workerOptions: u }] = Te.splice(0, 1);
1088
- i(new De(p, o, u, c));
1089
- } else p.worker ? (ct(p), (function(i, o) {
1090
- const { config: u } = o, { terminateWorkerTimeout: b } = u;
1091
- Number.isFinite(b) && b >= 0 && (i.terminated ? i.terminated = !1 : i.terminateTimeout = setTimeout((async () => {
1092
- ne = ne.filter(((y) => y != i));
1093
- try {
1094
- await i.terminate();
1095
- } catch {
1096
- }
1097
- }), b));
1098
- })(p, t)) : ne = ne.filter(((i) => i != p));
1099
- }
1100
- }
1101
- function ct(n) {
1102
- const { terminateTimeout: t } = n;
1103
- t && (clearTimeout(t), n.terminateTimeout = null);
1104
- }
1105
- const Ln = 65536, Pt = "writable";
1106
- class Be {
1107
- constructor() {
1108
- this.size = 0;
1109
- }
1110
- init() {
1111
- this.initialized = !0;
1112
- }
1113
- }
1114
- class Rt extends Be {
1115
- get readable() {
1116
- const t = this, { chunkSize: e = Ln } = t, r = new ReadableStream({ start() {
1117
- this.chunkOffset = 0;
1118
- }, async pull(a) {
1119
- const { offset: l = 0, size: s, diskNumberStart: d } = r, { chunkOffset: f } = this;
1120
- a.enqueue(await N(t, l + f, Math.min(e, s - f), d)), f + e > s ? a.close() : this.chunkOffset += e;
1121
- } });
1122
- return r;
1123
- }
1124
- }
1125
- class Pn extends Rt {
1126
- constructor(t) {
1127
- super(), Object.assign(this, { blob: t, size: t.size });
1128
- }
1129
- async readUint8Array(t, e) {
1130
- const r = this, a = t + e;
1131
- let s = await (t || a < r.size ? r.blob.slice(t, a) : r.blob).arrayBuffer();
1132
- return s.byteLength > e && (s = s.slice(t, a)), new Uint8Array(s);
1133
- }
1134
- }
1135
- class Rn extends Be {
1136
- constructor(t) {
1137
- super();
1138
- const e = new TransformStream(), r = [];
1139
- t && r.push(["Content-Type", t]), Object.defineProperty(this, Pt, { get: () => e.writable }), this.blob = new Response(e.readable, { headers: r }).blob();
1140
- }
1141
- getData() {
1142
- return this.blob;
1143
- }
1144
- }
1145
- class Xn extends Rn {
1146
- constructor(t) {
1147
- super(t), Object.assign(this, { encoding: t, utf8: !t || t.toLowerCase() == "utf-8" });
1148
- }
1149
- async getData() {
1150
- const { encoding: t, utf8: e } = this, r = await super.getData();
1151
- if (r.text && e) return r.text();
1152
- {
1153
- const a = new FileReader();
1154
- return new Promise(((l, s) => {
1155
- Object.assign(a, { onload: ({ target: d }) => l(d.result), onerror: () => s(a.error) }), a.readAsText(r, t);
1156
- }));
1157
- }
1158
- }
1159
- }
1160
- class Bn extends Rt {
1161
- constructor(t) {
1162
- super(), this.readers = t;
1163
- }
1164
- async init() {
1165
- const t = this, { readers: e } = t;
1166
- t.lastDiskNumber = 0, t.lastDiskOffset = 0, await Promise.all(e.map((async (r, a) => {
1167
- await r.init(), a != e.length - 1 && (t.lastDiskOffset += r.size), t.size += r.size;
1168
- }))), super.init();
1169
- }
1170
- async readUint8Array(t, e, r = 0) {
1171
- const a = this, { readers: l } = this;
1172
- let s, d = r;
1173
- d == -1 && (d = l.length - 1);
1174
- let f = t;
1175
- for (; f >= l[d].size; ) f -= l[d].size, d++;
1176
- const w = l[d], _ = w.size;
1177
- if (f + e <= _) s = await N(w, f, e);
1178
- else {
1179
- const g = _ - f;
1180
- s = new Uint8Array(e), s.set(await N(w, f, g)), s.set(await a.readUint8Array(t + g, e - g, r), g);
1181
- }
1182
- return a.lastDiskNumber = Math.max(d, a.lastDiskNumber), s;
1183
- }
1184
- }
1185
- class ut extends Be {
1186
- constructor(t, e = 4294967295) {
1187
- super();
1188
- const r = this;
1189
- let a, l, s;
1190
- Object.assign(r, { diskNumber: 0, diskOffset: 0, size: 0, maxSize: e, availableSize: e });
1191
- const d = new WritableStream({ async write(_) {
1192
- const { availableSize: g } = r;
1193
- if (s) _.length >= g ? (await f(_.slice(0, g)), await w(), r.diskOffset += a.size, r.diskNumber++, s = null, await this.write(_.slice(g))) : await f(_);
1194
- else {
1195
- const { value: x, done: z } = await t.next();
1196
- if (z && !x) throw new Error("Writer iterator completed too soon");
1197
- a = x, a.size = 0, a.maxSize && (r.maxSize = a.maxSize), r.availableSize = r.maxSize, await ve(a), l = x.writable, s = l.getWriter(), await this.write(_);
1198
- }
1199
- }, async close() {
1200
- await s.ready, await w();
1201
- } });
1202
- async function f(_) {
1203
- const g = _.length;
1204
- g && (await s.ready, await s.write(_), a.size += g, r.size += g, r.availableSize -= g);
1205
- }
1206
- async function w() {
1207
- l.size = a.size, await s.close();
1208
- }
1209
- Object.defineProperty(r, Pt, { get: () => d });
1210
- }
1211
- }
1212
- async function ve(n, t) {
1213
- if (!n.init || n.initialized) return Promise.resolve();
1214
- await n.init(t);
1215
- }
1216
- function In(n) {
1217
- return Array.isArray(n) && (n = new Bn(n)), n instanceof ReadableStream && (n = { readable: n }), n;
1218
- }
1219
- function N(n, t, e, r) {
1220
- return n.readUint8Array(t, e, r);
1221
- }
1222
- const Bt = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""), Nn = Bt.length == 256;
1223
- function me(n, t) {
1224
- return t && t.trim().toLowerCase() == "cp437" ? (function(e) {
1225
- if (Nn) {
1226
- let r = "";
1227
- for (let a = 0; a < e.length; a++) r += Bt[e[a]];
1228
- return r;
1229
- }
1230
- return new TextDecoder().decode(e);
1231
- })(n) : new TextDecoder(t).decode(n);
1232
- }
1233
- const It = "filename", Nt = "rawFilename", Vt = "comment", qt = "rawComment", Ht = "uncompressedSize", Kt = "compressedSize", Zt = "offset", je = "diskNumberStart", Me = "lastModDate", Le = "rawLastModDate", Gt = "lastAccessDate", Vn = "rawLastAccessDate", Jt = "creationDate", qn = "rawCreationDate", Hn = [It, Nt, Kt, Ht, Me, Le, Vt, qt, Gt, Jt, Zt, je, je, "internalFileAttribute", "externalFileAttribute", "msDosCompatible", "zip64", "encrypted", "version", "versionMadeBy", "zipCrypto", "directory", "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];
1234
- class ft {
1235
- constructor(t) {
1236
- Hn.forEach(((e) => this[e] = t[e]));
1237
- }
1238
- }
1239
- const Fe = "File format is not recognized", Kn = "Zip64 extra field not found", dt = "Compression method not supported", ht = "Split zip file", wt = "utf-8", _t = "cp437", Zn = [[Ht, ie], [Kt, ie], [Zt, ie], [je, re]], Gn = { [re]: { getValue: P, bytes: 4 }, [ie]: { getValue: ye, bytes: 8 } };
1240
- class Yn {
1241
- constructor(t, e = {}) {
1242
- Object.assign(this, { reader: In(t), options: e, config: ee });
1243
- }
1244
- async *getEntriesGenerator(t = {}) {
1245
- const e = this;
1246
- let { reader: r } = e;
1247
- const { config: a } = e;
1248
- if (await ve(r), r.size !== H && r.readUint8Array || (r = new Pn(await new Response(r.readable).blob()), await ve(r)), r.size < ae) throw new Error(Fe);
1249
- r.chunkSize = (function(U) {
1250
- return Math.max(U.chunkSize, 64);
1251
- })(a);
1252
- const l = await (async function(U, v, S, E, O) {
1253
- const W = new Uint8Array(4);
1254
- (function(j, K, T) {
1255
- j.setUint32(K, T, !0);
1256
- })(B(W), 0, v);
1257
- const F = E + O;
1258
- return await C(E) || await C(Math.min(F, S));
1259
- async function C(j) {
1260
- const K = S - j, T = await N(U, K, j);
1261
- for (let R = T.length - E; R >= 0; R--) if (T[R] == W[0] && T[R + 1] == W[1] && T[R + 2] == W[2] && T[R + 3] == W[3]) return { offset: K + R, buffer: T.slice(R, R + E).buffer };
1262
- }
1263
- })(r, 101010256, r.size, ae, 1048560);
1264
- if (!l)
1265
- throw P(B(await N(r, 0, 4))) == 134695760 ? new Error(ht) : new Error("End of central directory not found");
1266
- const s = B(l);
1267
- let d = P(s, 12), f = P(s, 16);
1268
- const w = l.offset, _ = I(s, 20), g = w + ae + _;
1269
- let x = I(s, 4);
1270
- const z = r.lastDiskNumber || 0;
1271
- let c = I(s, 6), p = I(s, 8), i = 0, o = 0;
1272
- if (f == ie || d == ie || p == re || c == re) {
1273
- const U = B(await N(r, l.offset - 20, 20));
1274
- if (P(U, 0) == 117853008) {
1275
- f = ye(U, 8);
1276
- let v = await N(r, f, 56, -1), S = B(v);
1277
- const E = l.offset - 20 - 56;
1278
- if (P(S, 0) != Qe && f != E) {
1279
- const O = f;
1280
- f = E, i = f - O, v = await N(r, f, 56, -1), S = B(v);
1281
- }
1282
- if (P(S, 0) != Qe) throw new Error("End of Zip64 central directory locator not found");
1283
- x == re && (x = P(S, 16)), c == re && (c = P(S, 20)), p == re && (p = ye(S, 32)), d == ie && (d = ye(S, 40)), f -= d;
1284
- }
1285
- }
1286
- if (f >= r.size && (i = r.size - f - d - ae, f = r.size - d - ae), z != x) throw new Error(ht);
1287
- if (f < 0) throw new Error(Fe);
1288
- let u = 0, b = await N(r, f, d, c), y = B(b);
1289
- if (d) {
1290
- const U = l.offset - d;
1291
- if (P(y, u) != Je && f != U) {
1292
- const v = f;
1293
- f = U, i += f - v, b = await N(r, f, d, c), y = B(b);
1294
- }
1295
- }
1296
- const k = l.offset - f - (r.lastDiskOffset || 0);
1297
- if (d != k && k >= 0 && (d = k, b = await N(r, f, d, c), y = B(b)), f < 0 || f >= r.size) throw new Error(Fe);
1298
- const m = V(e, t, "filenameEncoding"), h = V(e, t, "commentEncoding");
1299
- for (let U = 0; U < p; U++) {
1300
- const v = new Jn(r, a, e.options);
1301
- if (P(y, u) != Je) throw new Error("Central directory header not found");
1302
- Qt(v, y, u + 6);
1303
- const S = !!v.bitFlag.languageEncodingFlag, E = u + 46, O = E + v.filenameLength, W = O + v.extraFieldLength, F = I(y, u + 4), C = !0, j = b.subarray(E, O), K = I(y, u + 32), T = W + K, R = b.subarray(W, T), M = S, L = S, Ie = !(16 & ~le(y, u + 38)), Ne = P(y, u + 42) + i;
1304
- Object.assign(v, { versionMadeBy: F, msDosCompatible: C, compressedSize: 0, uncompressedSize: 0, commentLength: K, directory: Ie, offset: Ne, diskNumberStart: I(y, u + 34), internalFileAttribute: I(y, u + 36), externalFileAttribute: P(y, u + 38), rawFilename: j, filenameUTF8: M, commentUTF8: L, rawExtraField: b.subarray(O, W) });
1305
- const Ve = V(e, t, "decodeText") || me, qe = M ? wt : m || _t, He = L ? wt : h || _t;
1306
- let _e = Ve(j, qe);
1307
- _e === H && (_e = me(j, qe));
1308
- let ze = Ve(R, He);
1309
- ze === H && (ze = me(R, He)), Object.assign(v, { rawComment: R, filename: _e, comment: ze, directory: Ie || _e.endsWith("/") }), o = Math.max(Ne, o), await Xt(v, v, y, u + 6), v.zipCrypto = v.encrypted && !v.extraFieldAES;
1310
- const Ae = new ft(v);
1311
- Ae.getData = (Ze, Yt) => v.getData(Ze, Ae, Yt), u = T;
1312
- const { onprogress: Ke } = t;
1313
- if (Ke) try {
1314
- await Ke(U + 1, p, new ft(v));
1315
- } catch {
1316
- }
1317
- yield Ae;
1318
- }
1319
- const A = V(e, t, "extractPrependedData"), D = V(e, t, "extractAppendedData");
1320
- return A && (e.prependedData = o > 0 ? await N(r, 0, o) : new Uint8Array()), e.comment = _ ? await N(r, w + ae, _) : new Uint8Array(), D && (e.appendedData = g < r.size ? await N(r, g, r.size - g) : new Uint8Array()), !0;
1321
- }
1322
- async getEntries(t = {}) {
1323
- const e = [];
1324
- for await (const r of this.getEntriesGenerator(t)) e.push(r);
1325
- return e;
1326
- }
1327
- async close() {
1328
- }
1329
- }
1330
- class Jn {
1331
- constructor(t, e, r) {
1332
- Object.assign(this, { reader: t, config: e, options: r });
1333
- }
1334
- async getData(t, e, r = {}) {
1335
- const a = this, { reader: l, offset: s, diskNumberStart: d, extraFieldAES: f, compressionMethod: w, config: _, bitFlag: g, signature: x, rawLastModDate: z, uncompressedSize: c, compressedSize: p } = a, i = e.localDirectory = {}, o = B(await N(l, s, 30, d));
1336
- let u = V(a, r, "password"), b = V(a, r, "rawPassword");
1337
- const y = V(a, r, "passThrough");
1338
- if (u = u && u.length && u, b = b && b.length && b, f && f.originalCompressionMethod != 99) throw new Error(dt);
1339
- if (w != 0 && w != 8 && !y) throw new Error(dt);
1340
- if (P(o, 0) != 67324752) throw new Error("Local file header not found");
1341
- Qt(i, o, 4), i.rawExtraField = i.extraFieldLength ? await N(l, s + 30 + i.filenameLength, i.extraFieldLength, d) : new Uint8Array(), await Xt(a, i, o, 4, !0), Object.assign(e, { lastAccessDate: i.lastAccessDate, creationDate: i.creationDate });
1342
- const k = a.encrypted && i.encrypted && !y, m = k && !f;
1343
- if (y || (e.zipCrypto = m), k) {
1344
- if (!m && f.strength === H) throw new Error("Encryption method not supported");
1345
- if (!u && !b) throw new Error("File contains encrypted entry");
1346
- }
1347
- const h = s + 30 + i.filenameLength + i.extraFieldLength, A = p, D = l.readable;
1348
- Object.assign(D, { diskNumberStart: d, offset: h, size: A });
1349
- const U = V(a, r, "signal"), v = V(a, r, "checkPasswordOnly");
1350
- v && (t = new WritableStream()), t = (function(j) {
1351
- j.writable === H && typeof j.next == we && (j = new ut(j)), j instanceof WritableStream && (j = { writable: j });
1352
- const { writable: K } = j;
1353
- return K.size === H && (K.size = 0), j instanceof ut || Object.assign(j, { diskNumber: 0, diskOffset: 0, availableSize: 1 / 0, maxSize: 1 / 0 }), j;
1354
- })(t), await ve(t, y ? p : c);
1355
- const { writable: S } = t, { onstart: E, onprogress: O, onend: W } = r, F = { options: { codecType: jt, password: u, rawPassword: b, zipCrypto: m, encryptionStrength: f && f.strength, signed: V(a, r, "checkSignature") && !y, passwordVerification: m && (g.dataDescriptor ? z >>> 8 & 255 : x >>> 24 & 255), signature: x, compressed: w != 0 && !y, encrypted: a.encrypted && !y, useWebWorkers: V(a, r, "useWebWorkers"), useCompressionStream: V(a, r, "useCompressionStream"), transferStreams: V(a, r, "transferStreams"), checkPasswordOnly: v }, config: _, streamOptions: { signal: U, size: A, onstart: E, onprogress: O, onend: W } };
1356
- let C = 0;
1357
- try {
1358
- ({ outputSize: C } = await Mn({ readable: D, writable: S }, F));
1359
- } catch (j) {
1360
- if (!v || j.message != Pe) throw j;
1361
- } finally {
1362
- const j = V(a, r, "preventClose");
1363
- S.size += C, j || S.locked || await S.getWriter().close();
1364
- }
1365
- return v ? H : t.getData ? t.getData() : S;
1366
- }
1367
- }
1368
- function Qt(n, t, e) {
1369
- const r = n.rawBitFlag = I(t, e + 2), a = !(1 & ~r), l = P(t, e + 6);
1370
- Object.assign(n, { encrypted: a, version: I(t, e), bitFlag: { level: (6 & r) >> 1, dataDescriptor: !(8 & ~r), languageEncodingFlag: !(2048 & ~r) }, rawLastModDate: l, lastModDate: Qn(l), filenameLength: I(t, e + 22), extraFieldLength: I(t, e + 24) });
1371
- }
1372
- async function Xt(n, t, e, r, a) {
1373
- const { rawExtraField: l } = t, s = t.extraField = /* @__PURE__ */ new Map(), d = B(new Uint8Array(l));
1374
- let f = 0;
1375
- try {
1376
- for (; f < l.length; ) {
1377
- const o = I(d, f), u = I(d, f + 2);
1378
- s.set(o, { type: o, data: l.slice(f + 4, f + 4 + u) }), f += 4 + u;
1379
- }
1380
- } catch {
1381
- }
1382
- const w = I(e, r + 4);
1383
- Object.assign(t, { signature: P(e, r + 10), uncompressedSize: P(e, r + 18), compressedSize: P(e, r + 14) });
1384
- const _ = s.get(1);
1385
- _ && ((function(o, u) {
1386
- u.zip64 = !0;
1387
- const b = B(o.data), y = Zn.filter((([k, m]) => u[k] == m));
1388
- for (let k = 0, m = 0; k < y.length; k++) {
1389
- const [h, A] = y[k];
1390
- if (u[h] == A) {
1391
- const D = Gn[A];
1392
- u[h] = o[h] = D.getValue(b, m), m += D.bytes;
1393
- } else if (o[h]) throw new Error(Kn);
1394
- }
1395
- })(_, t), t.extraFieldZip64 = _);
1396
- const g = s.get(28789);
1397
- g && (await bt(g, It, Nt, t, n), t.extraFieldUnicodePath = g);
1398
- const x = s.get(25461);
1399
- x && (await bt(x, Vt, qt, t, n), t.extraFieldUnicodeComment = x);
1400
- const z = s.get(39169);
1401
- z ? ((function(o, u, b) {
1402
- const y = B(o.data), k = le(y, 4);
1403
- Object.assign(o, { vendorVersion: le(y, 0), vendorId: le(y, 2), strength: k, originalCompressionMethod: b, compressionMethod: I(y, 5) }), u.compressionMethod = o.compressionMethod;
1404
- })(z, t, w), t.extraFieldAES = z) : t.compressionMethod = w;
1405
- const c = s.get(10);
1406
- c && ((function(o, u) {
1407
- const b = B(o.data);
1408
- let y, k = 4;
1409
- try {
1410
- for (; k < o.data.length && !y; ) {
1411
- const m = I(b, k), h = I(b, k + 2);
1412
- m == 1 && (y = o.data.slice(k + 4, k + 4 + h)), k += 4 + h;
1413
- }
1414
- } catch {
1415
- }
1416
- try {
1417
- if (y && y.length == 24) {
1418
- const m = B(y), h = m.getBigUint64(0, !0), A = m.getBigUint64(8, !0), D = m.getBigUint64(16, !0);
1419
- Object.assign(o, { rawLastModDate: h, rawLastAccessDate: A, rawCreationDate: D });
1420
- const U = Oe(h), v = Oe(A), S = { lastModDate: U, lastAccessDate: v, creationDate: Oe(D) };
1421
- Object.assign(o, S), Object.assign(u, S);
1422
- }
1423
- } catch {
1424
- }
1425
- })(c, t), t.extraFieldNTFS = c);
1426
- const p = s.get(21589);
1427
- p && ((function(o, u, b) {
1428
- const y = B(o.data), k = le(y, 0), m = [], h = [];
1429
- b ? (1 & ~k || (m.push(Me), h.push(Le)), 2 & ~k || (m.push(Gt), h.push(Vn)), 4 & ~k || (m.push(Jt), h.push(qn))) : o.data.length >= 5 && (m.push(Me), h.push(Le));
1430
- let A = 1;
1431
- m.forEach(((D, U) => {
1432
- if (o.data.length >= A + 4) {
1433
- const v = P(y, A);
1434
- u[D] = o[D] = new Date(1e3 * v);
1435
- const S = h[U];
1436
- o[S] = v;
1437
- }
1438
- A += 4;
1439
- }));
1440
- })(p, t, a), t.extraFieldExtendedTimestamp = p);
1441
- const i = s.get(6534);
1442
- i && (t.extraFieldUSDZ = i);
1443
- }
1444
- async function bt(n, t, e, r, a) {
1445
- const l = B(n.data), s = new xe();
1446
- s.append(a[e]);
1447
- const d = B(new Uint8Array(4));
1448
- d.setUint32(0, s.get(), !0);
1449
- const f = P(l, 1);
1450
- Object.assign(n, { version: le(l, 0), [t]: me(n.data.subarray(5)), valid: !a.bitFlag.languageEncodingFlag && f == P(d, 0) }), n.valid && (r[t] = n[t], r[t + "UTF8"] = !0);
1451
- }
1452
- function V(n, t, e) {
1453
- return t[e] === H ? n.options[e] : t[e];
1454
- }
1455
- function Qn(n) {
1456
- const t = (4294901760 & n) >> 16, e = 65535 & n;
1457
- try {
1458
- return new Date(1980 + ((65024 & t) >> 9), ((480 & t) >> 5) - 1, 31 & t, (63488 & e) >> 11, (2016 & e) >> 5, 2 * (31 & e), 0);
1459
- } catch {
1460
- }
1461
- }
1462
- function Oe(n) {
1463
- return new Date(Number(n / BigInt(1e4) - BigInt(116444736e5)));
1464
- }
1465
- function le(n, t) {
1466
- return n.getUint8(t);
1467
- }
1468
- function I(n, t) {
1469
- return n.getUint16(t, !0);
1470
- }
1471
- function P(n, t) {
1472
- return n.getUint32(t, !0);
1473
- }
1474
- function ye(n, t) {
1475
- return Number(n.getBigUint64(t, !0));
1476
- }
1477
- function B(n) {
1478
- return new DataView(n.buffer);
1479
- }
1480
- fn({ Inflate: function(n) {
1481
- const t = new pt(), e = n && n.chunkSize ? Math.floor(2 * n.chunkSize) : 131072, r = new Uint8Array(e);
1482
- let a = !1;
1483
- t.inflateInit(), t.next_out = r, this.append = function(l, s) {
1484
- const d = [];
1485
- let f, w, _ = 0, g = 0, x = 0;
1486
- if (l.length !== 0) {
1487
- t.next_in_index = 0, t.next_in = l, t.avail_in = l.length;
1488
- do {
1489
- if (t.next_out_index = 0, t.avail_out = e, t.avail_in !== 0 || a || (t.next_in_index = 0, a = !0), f = t.inflate(0), a && f === -5) {
1490
- if (t.avail_in !== 0) throw new Error("inflating: bad input");
1491
- } else if (f !== 0 && f !== 1) throw new Error("inflating: " + t.msg);
1492
- if ((a || f === 1) && t.avail_in === l.length) throw new Error("inflating: bad input");
1493
- t.next_out_index && (t.next_out_index === e ? d.push(new Uint8Array(r)) : d.push(r.subarray(0, t.next_out_index))), x += t.next_out_index, s && t.next_in_index > 0 && t.next_in_index != _ && (s(t.next_in_index), _ = t.next_in_index);
1494
- } while (t.avail_in > 0 || t.avail_out === 0);
1495
- return d.length > 1 ? (w = new Uint8Array(x), d.forEach((function(z) {
1496
- w.set(z, g), g += z.length;
1497
- }))) : w = d[0] ? new Uint8Array(d[0]) : new Uint8Array(), w;
1498
- }
1499
- }, this.flush = function() {
1500
- t.inflateEnd();
1501
- };
1502
- } });
1503
- export {
1504
- Pn as BlobReader,
1505
- Rn as BlobWriter,
1506
- Xn as TextWriter,
1507
- Yn as ZipReader,
1508
- fn as configure
1509
- };