@courtifyai/docx-render 1.0.9 → 1.0.10
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/dist/index.es.js +740 -634
- package/dist/index.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -25,53 +25,53 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
25
25
|
x.exports = t();
|
|
26
26
|
})(function() {
|
|
27
27
|
return function t(r, n, a) {
|
|
28
|
-
function o(
|
|
29
|
-
if (!n[
|
|
30
|
-
if (!r[
|
|
28
|
+
function o(m, u) {
|
|
29
|
+
if (!n[m]) {
|
|
30
|
+
if (!r[m]) {
|
|
31
31
|
var y = typeof Tt == "function" && Tt;
|
|
32
|
-
if (!
|
|
33
|
-
if (s) return s(
|
|
34
|
-
var
|
|
35
|
-
throw
|
|
32
|
+
if (!u && y) return y(m, !0);
|
|
33
|
+
if (s) return s(m, !0);
|
|
34
|
+
var p = new Error("Cannot find module '" + m + "'");
|
|
35
|
+
throw p.code = "MODULE_NOT_FOUND", p;
|
|
36
36
|
}
|
|
37
|
-
var h = n[
|
|
38
|
-
r[
|
|
39
|
-
var d = r[
|
|
37
|
+
var h = n[m] = { exports: {} };
|
|
38
|
+
r[m][0].call(h.exports, function(b) {
|
|
39
|
+
var d = r[m][1][b];
|
|
40
40
|
return o(d || b);
|
|
41
41
|
}, h, h.exports, t, r, n, a);
|
|
42
42
|
}
|
|
43
|
-
return n[
|
|
43
|
+
return n[m].exports;
|
|
44
44
|
}
|
|
45
45
|
for (var s = typeof Tt == "function" && Tt, c = 0; c < a.length; c++) o(a[c]);
|
|
46
46
|
return o;
|
|
47
47
|
}({ 1: [function(t, r, n) {
|
|
48
48
|
var a = t("./utils"), o = t("./support"), s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
49
49
|
n.encode = function(c) {
|
|
50
|
-
for (var
|
|
50
|
+
for (var m, u, y, p, h, b, d, _ = [], f = 0, v = c.length, E = v, A = a.getTypeOf(c) !== "string"; f < c.length; ) E = v - f, y = A ? (m = c[f++], u = f < v ? c[f++] : 0, f < v ? c[f++] : 0) : (m = c.charCodeAt(f++), u = f < v ? c.charCodeAt(f++) : 0, f < v ? c.charCodeAt(f++) : 0), p = m >> 2, h = (3 & m) << 4 | u >> 4, b = 1 < E ? (15 & u) << 2 | y >> 6 : 64, d = 2 < E ? 63 & y : 64, _.push(s.charAt(p) + s.charAt(h) + s.charAt(b) + s.charAt(d));
|
|
51
51
|
return _.join("");
|
|
52
52
|
}, n.decode = function(c) {
|
|
53
|
-
var
|
|
54
|
-
if (c.substr(0,
|
|
53
|
+
var m, u, y, p, h, b, d = 0, _ = 0, f = "data:";
|
|
54
|
+
if (c.substr(0, f.length) === f) throw new Error("Invalid base64 input, it looks like a data url.");
|
|
55
55
|
var v, E = 3 * (c = c.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4;
|
|
56
56
|
if (c.charAt(c.length - 1) === s.charAt(64) && E--, c.charAt(c.length - 2) === s.charAt(64) && E--, E % 1 != 0) throw new Error("Invalid base64 input, bad content length.");
|
|
57
|
-
for (v = o.uint8array ? new Uint8Array(0 | E) : new Array(0 | E); d < c.length; )
|
|
57
|
+
for (v = o.uint8array ? new Uint8Array(0 | E) : new Array(0 | E); d < c.length; ) m = s.indexOf(c.charAt(d++)) << 2 | (p = s.indexOf(c.charAt(d++))) >> 4, u = (15 & p) << 4 | (h = s.indexOf(c.charAt(d++))) >> 2, y = (3 & h) << 6 | (b = s.indexOf(c.charAt(d++))), v[_++] = m, h !== 64 && (v[_++] = u), b !== 64 && (v[_++] = y);
|
|
58
58
|
return v;
|
|
59
59
|
};
|
|
60
60
|
}, { "./support": 30, "./utils": 32 }], 2: [function(t, r, n) {
|
|
61
61
|
var a = t("./external"), o = t("./stream/DataWorker"), s = t("./stream/Crc32Probe"), c = t("./stream/DataLengthProbe");
|
|
62
|
-
function
|
|
63
|
-
this.compressedSize =
|
|
62
|
+
function m(u, y, p, h, b) {
|
|
63
|
+
this.compressedSize = u, this.uncompressedSize = y, this.crc32 = p, this.compression = h, this.compressedContent = b;
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
var
|
|
67
|
-
return
|
|
65
|
+
m.prototype = { getContentWorker: function() {
|
|
66
|
+
var u = new o(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")), y = this;
|
|
67
|
+
return u.on("end", function() {
|
|
68
68
|
if (this.streamInfo.data_length !== y.uncompressedSize) throw new Error("Bug : uncompressed data size mismatch");
|
|
69
|
-
}),
|
|
69
|
+
}), u;
|
|
70
70
|
}, getCompressedWorker: function() {
|
|
71
71
|
return new o(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression);
|
|
72
|
-
} },
|
|
73
|
-
return
|
|
74
|
-
}, r.exports =
|
|
72
|
+
} }, m.createWorkerFrom = function(u, y, p) {
|
|
73
|
+
return u.pipe(new s()).pipe(new c("uncompressedSize")).pipe(y.compressWorker(p)).pipe(new c("compressedSize")).withStreamInfo("compression", y);
|
|
74
|
+
}, r.exports = m;
|
|
75
75
|
}, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(t, r, n) {
|
|
76
76
|
var a = t("./stream/GenericWorker");
|
|
77
77
|
n.STORE = { magic: "\0\0", compressWorker: function() {
|
|
@@ -81,24 +81,24 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
81
81
|
} }, n.DEFLATE = t("./flate");
|
|
82
82
|
}, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(t, r, n) {
|
|
83
83
|
var a = t("./utils"), o = function() {
|
|
84
|
-
for (var s, c = [],
|
|
85
|
-
s =
|
|
86
|
-
for (var
|
|
87
|
-
c[
|
|
84
|
+
for (var s, c = [], m = 0; m < 256; m++) {
|
|
85
|
+
s = m;
|
|
86
|
+
for (var u = 0; u < 8; u++) s = 1 & s ? 3988292384 ^ s >>> 1 : s >>> 1;
|
|
87
|
+
c[m] = s;
|
|
88
88
|
}
|
|
89
89
|
return c;
|
|
90
90
|
}();
|
|
91
91
|
r.exports = function(s, c) {
|
|
92
|
-
return s !== void 0 && s.length ? a.getTypeOf(s) !== "string" ? function(
|
|
93
|
-
var h = o, b =
|
|
94
|
-
|
|
95
|
-
for (var d =
|
|
96
|
-
return -1 ^
|
|
97
|
-
}(0 | c, s, s.length, 0) : function(
|
|
98
|
-
var h = o, b =
|
|
99
|
-
|
|
100
|
-
for (var d =
|
|
101
|
-
return -1 ^
|
|
92
|
+
return s !== void 0 && s.length ? a.getTypeOf(s) !== "string" ? function(m, u, y, p) {
|
|
93
|
+
var h = o, b = p + y;
|
|
94
|
+
m ^= -1;
|
|
95
|
+
for (var d = p; d < b; d++) m = m >>> 8 ^ h[255 & (m ^ u[d])];
|
|
96
|
+
return -1 ^ m;
|
|
97
|
+
}(0 | c, s, s.length, 0) : function(m, u, y, p) {
|
|
98
|
+
var h = o, b = p + y;
|
|
99
|
+
m ^= -1;
|
|
100
|
+
for (var d = p; d < b; d++) m = m >>> 8 ^ h[255 & (m ^ u.charCodeAt(d))];
|
|
101
|
+
return -1 ^ m;
|
|
102
102
|
}(0 | c, s, s.length, 0) : 0;
|
|
103
103
|
};
|
|
104
104
|
}, { "./utils": 32 }], 5: [function(t, r, n) {
|
|
@@ -107,26 +107,26 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
107
107
|
var a = null;
|
|
108
108
|
a = typeof Promise < "u" ? Promise : t("lie"), r.exports = { Promise: a };
|
|
109
109
|
}, { lie: 37 }], 7: [function(t, r, n) {
|
|
110
|
-
var a = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Uint32Array < "u", o = t("pako"), s = t("./utils"), c = t("./stream/GenericWorker"),
|
|
111
|
-
function
|
|
112
|
-
c.call(this, "FlateWorker/" + y), this._pako = null, this._pakoAction = y, this._pakoOptions =
|
|
110
|
+
var a = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Uint32Array < "u", o = t("pako"), s = t("./utils"), c = t("./stream/GenericWorker"), m = a ? "uint8array" : "array";
|
|
111
|
+
function u(y, p) {
|
|
112
|
+
c.call(this, "FlateWorker/" + y), this._pako = null, this._pakoAction = y, this._pakoOptions = p, this.meta = {};
|
|
113
113
|
}
|
|
114
|
-
n.magic = "\b\0", s.inherits(
|
|
115
|
-
this.meta = y.meta, this._pako === null && this._createPako(), this._pako.push(s.transformTo(
|
|
116
|
-
},
|
|
114
|
+
n.magic = "\b\0", s.inherits(u, c), u.prototype.processChunk = function(y) {
|
|
115
|
+
this.meta = y.meta, this._pako === null && this._createPako(), this._pako.push(s.transformTo(m, y.data), !1);
|
|
116
|
+
}, u.prototype.flush = function() {
|
|
117
117
|
c.prototype.flush.call(this), this._pako === null && this._createPako(), this._pako.push([], !0);
|
|
118
|
-
},
|
|
118
|
+
}, u.prototype.cleanUp = function() {
|
|
119
119
|
c.prototype.cleanUp.call(this), this._pako = null;
|
|
120
|
-
},
|
|
120
|
+
}, u.prototype._createPako = function() {
|
|
121
121
|
this._pako = new o[this._pakoAction]({ raw: !0, level: this._pakoOptions.level || -1 });
|
|
122
122
|
var y = this;
|
|
123
|
-
this._pako.onData = function(
|
|
124
|
-
y.push({ data:
|
|
123
|
+
this._pako.onData = function(p) {
|
|
124
|
+
y.push({ data: p, meta: y.meta });
|
|
125
125
|
};
|
|
126
126
|
}, n.compressWorker = function(y) {
|
|
127
|
-
return new
|
|
127
|
+
return new u("Deflate", y);
|
|
128
128
|
}, n.uncompressWorker = function() {
|
|
129
|
-
return new
|
|
129
|
+
return new u("Inflate", {});
|
|
130
130
|
};
|
|
131
131
|
}, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(t, r, n) {
|
|
132
132
|
function a(h, b) {
|
|
@@ -134,37 +134,37 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
134
134
|
for (d = 0; d < b; d++) _ += String.fromCharCode(255 & h), h >>>= 8;
|
|
135
135
|
return _;
|
|
136
136
|
}
|
|
137
|
-
function o(h, b, d, _,
|
|
138
|
-
var E, A, T = h.file, L = h.compression, B = v !==
|
|
137
|
+
function o(h, b, d, _, f, v) {
|
|
138
|
+
var E, A, T = h.file, L = h.compression, B = v !== m.utf8encode, j = s.transformTo("string", v(T.name)), z = s.transformTo("string", m.utf8encode(T.name)), Z = T.comment, Q = s.transformTo("string", v(Z)), k = s.transformTo("string", m.utf8encode(Z)), N = z.length !== T.name.length, l = k.length !== Z.length, D = "", et = "", U = "", rt = T.dir, W = T.date, tt = { crc32: 0, compressedSize: 0, uncompressedSize: 0 };
|
|
139
139
|
b && !d || (tt.crc32 = h.crc32, tt.compressedSize = h.compressedSize, tt.uncompressedSize = h.uncompressedSize);
|
|
140
140
|
var F = 0;
|
|
141
141
|
b && (F |= 8), B || !N && !l || (F |= 2048);
|
|
142
142
|
var I = 0, J = 0;
|
|
143
|
-
rt && (I |= 16),
|
|
143
|
+
rt && (I |= 16), f === "UNIX" ? (J = 798, I |= function(V, lt) {
|
|
144
144
|
var ut = V;
|
|
145
145
|
return V || (ut = lt ? 16893 : 33204), (65535 & ut) << 16;
|
|
146
146
|
}(T.unixPermissions, rt)) : (J = 20, I |= function(V) {
|
|
147
147
|
return 63 & (V || 0);
|
|
148
|
-
}(T.dosPermissions)), E = W.getUTCHours(), E <<= 6, E |= W.getUTCMinutes(), E <<= 5, E |= W.getUTCSeconds() / 2, A = W.getUTCFullYear() - 1980, A <<= 4, A |= W.getUTCMonth() + 1, A <<= 5, A |= W.getUTCDate(), N && (et = a(1, 1) + a(
|
|
148
|
+
}(T.dosPermissions)), E = W.getUTCHours(), E <<= 6, E |= W.getUTCMinutes(), E <<= 5, E |= W.getUTCSeconds() / 2, A = W.getUTCFullYear() - 1980, A <<= 4, A |= W.getUTCMonth() + 1, A <<= 5, A |= W.getUTCDate(), N && (et = a(1, 1) + a(u(j), 4) + z, D += "up" + a(et.length, 2) + et), l && (U = a(1, 1) + a(u(Q), 4) + k, D += "uc" + a(U.length, 2) + U);
|
|
149
149
|
var Y = "";
|
|
150
150
|
return Y += `
|
|
151
151
|
\0`, Y += a(F, 2), Y += L.magic, Y += a(E, 2), Y += a(A, 2), Y += a(tt.crc32, 4), Y += a(tt.compressedSize, 4), Y += a(tt.uncompressedSize, 4), Y += a(j.length, 2), Y += a(D.length, 2), { fileRecord: y.LOCAL_FILE_HEADER + Y + j + D, dirRecord: y.CENTRAL_FILE_HEADER + a(J, 2) + Y + a(Q.length, 2) + "\0\0\0\0" + a(I, 4) + a(_, 4) + j + D + Q };
|
|
152
152
|
}
|
|
153
|
-
var s = t("../utils"), c = t("../stream/GenericWorker"),
|
|
154
|
-
function
|
|
153
|
+
var s = t("../utils"), c = t("../stream/GenericWorker"), m = t("../utf8"), u = t("../crc32"), y = t("../signature");
|
|
154
|
+
function p(h, b, d, _) {
|
|
155
155
|
c.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = b, this.zipPlatform = d, this.encodeFileName = _, this.streamFiles = h, this.accumulate = !1, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = [];
|
|
156
156
|
}
|
|
157
|
-
s.inherits(
|
|
157
|
+
s.inherits(p, c), p.prototype.push = function(h) {
|
|
158
158
|
var b = h.meta.percent || 0, d = this.entriesCount, _ = this._sources.length;
|
|
159
159
|
this.accumulate ? this.contentBuffer.push(h) : (this.bytesWritten += h.data.length, c.prototype.push.call(this, { data: h.data, meta: { currentFile: this.currentFile, percent: d ? (b + 100 * (d - _ - 1)) / d : 100 } }));
|
|
160
|
-
},
|
|
160
|
+
}, p.prototype.openedSource = function(h) {
|
|
161
161
|
this.currentSourceOffset = this.bytesWritten, this.currentFile = h.file.name;
|
|
162
162
|
var b = this.streamFiles && !h.file.dir;
|
|
163
163
|
if (b) {
|
|
164
164
|
var d = o(h, b, !1, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
|
|
165
165
|
this.push({ data: d.fileRecord, meta: { percent: 0 } });
|
|
166
166
|
} else this.accumulate = !0;
|
|
167
|
-
},
|
|
167
|
+
}, p.prototype.closedSource = function(h) {
|
|
168
168
|
this.accumulate = !1;
|
|
169
169
|
var b = this.streamFiles && !h.file.dir, d = o(h, b, !0, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
|
|
170
170
|
if (this.dirRecords.push(d.dirRecord), b) this.push({ data: function(_) {
|
|
@@ -172,16 +172,16 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
172
172
|
}(h), meta: { percent: 100 } });
|
|
173
173
|
else for (this.push({ data: d.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift());
|
|
174
174
|
this.currentFile = null;
|
|
175
|
-
},
|
|
175
|
+
}, p.prototype.flush = function() {
|
|
176
176
|
for (var h = this.bytesWritten, b = 0; b < this.dirRecords.length; b++) this.push({ data: this.dirRecords[b], meta: { percent: 100 } });
|
|
177
|
-
var d = this.bytesWritten - h, _ = function(
|
|
177
|
+
var d = this.bytesWritten - h, _ = function(f, v, E, A, T) {
|
|
178
178
|
var L = s.transformTo("string", T(A));
|
|
179
|
-
return y.CENTRAL_DIRECTORY_END + "\0\0\0\0" + a(
|
|
179
|
+
return y.CENTRAL_DIRECTORY_END + "\0\0\0\0" + a(f, 2) + a(f, 2) + a(v, 4) + a(E, 4) + a(L.length, 2) + L;
|
|
180
180
|
}(this.dirRecords.length, d, h, this.zipComment, this.encodeFileName);
|
|
181
181
|
this.push({ data: _, meta: { percent: 100 } });
|
|
182
|
-
},
|
|
182
|
+
}, p.prototype.prepareNextSource = function() {
|
|
183
183
|
this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume();
|
|
184
|
-
},
|
|
184
|
+
}, p.prototype.registerPrevious = function(h) {
|
|
185
185
|
this._sources.push(h);
|
|
186
186
|
var b = this;
|
|
187
187
|
return h.on("data", function(d) {
|
|
@@ -191,9 +191,9 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
191
191
|
}), h.on("error", function(d) {
|
|
192
192
|
b.error(d);
|
|
193
193
|
}), this;
|
|
194
|
-
},
|
|
194
|
+
}, p.prototype.resume = function() {
|
|
195
195
|
return !!c.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), !0) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), !0));
|
|
196
|
-
},
|
|
196
|
+
}, p.prototype.error = function(h) {
|
|
197
197
|
var b = this._sources;
|
|
198
198
|
if (!c.prototype.error.call(this, h)) return !1;
|
|
199
199
|
for (var d = 0; d < b.length; d++) try {
|
|
@@ -201,28 +201,28 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
201
201
|
} catch {
|
|
202
202
|
}
|
|
203
203
|
return !0;
|
|
204
|
-
},
|
|
204
|
+
}, p.prototype.lock = function() {
|
|
205
205
|
c.prototype.lock.call(this);
|
|
206
206
|
for (var h = this._sources, b = 0; b < h.length; b++) h[b].lock();
|
|
207
|
-
}, r.exports =
|
|
207
|
+
}, r.exports = p;
|
|
208
208
|
}, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(t, r, n) {
|
|
209
209
|
var a = t("../compressions"), o = t("./ZipFileWorker");
|
|
210
|
-
n.generateWorker = function(s, c,
|
|
211
|
-
var
|
|
210
|
+
n.generateWorker = function(s, c, m) {
|
|
211
|
+
var u = new o(c.streamFiles, m, c.platform, c.encodeFileName), y = 0;
|
|
212
212
|
try {
|
|
213
|
-
s.forEach(function(
|
|
213
|
+
s.forEach(function(p, h) {
|
|
214
214
|
y++;
|
|
215
215
|
var b = function(v, E) {
|
|
216
216
|
var A = v || E, T = a[A];
|
|
217
217
|
if (!T) throw new Error(A + " is not a valid compression method !");
|
|
218
218
|
return T;
|
|
219
|
-
}(h.options.compression, c.compression), d = h.options.compressionOptions || c.compressionOptions || {}, _ = h.dir,
|
|
220
|
-
h._compressWorker(b, d).withStreamInfo("file", { name:
|
|
221
|
-
}),
|
|
222
|
-
} catch (
|
|
223
|
-
|
|
219
|
+
}(h.options.compression, c.compression), d = h.options.compressionOptions || c.compressionOptions || {}, _ = h.dir, f = h.date;
|
|
220
|
+
h._compressWorker(b, d).withStreamInfo("file", { name: p, dir: _, date: f, comment: h.comment || "", unixPermissions: h.unixPermissions, dosPermissions: h.dosPermissions }).pipe(u);
|
|
221
|
+
}), u.entriesCount = y;
|
|
222
|
+
} catch (p) {
|
|
223
|
+
u.error(p);
|
|
224
224
|
}
|
|
225
|
-
return
|
|
225
|
+
return u;
|
|
226
226
|
};
|
|
227
227
|
}, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(t, r, n) {
|
|
228
228
|
function a() {
|
|
@@ -238,29 +238,29 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
238
238
|
return new a().loadAsync(o, s);
|
|
239
239
|
}, a.external = t("./external"), r.exports = a;
|
|
240
240
|
}, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(t, r, n) {
|
|
241
|
-
var a = t("./utils"), o = t("./external"), s = t("./utf8"), c = t("./zipEntries"),
|
|
242
|
-
function y(
|
|
241
|
+
var a = t("./utils"), o = t("./external"), s = t("./utf8"), c = t("./zipEntries"), m = t("./stream/Crc32Probe"), u = t("./nodejsUtils");
|
|
242
|
+
function y(p) {
|
|
243
243
|
return new o.Promise(function(h, b) {
|
|
244
|
-
var d =
|
|
244
|
+
var d = p.decompressed.getContentWorker().pipe(new m());
|
|
245
245
|
d.on("error", function(_) {
|
|
246
246
|
b(_);
|
|
247
247
|
}).on("end", function() {
|
|
248
|
-
d.streamInfo.crc32 !==
|
|
248
|
+
d.streamInfo.crc32 !== p.decompressed.crc32 ? b(new Error("Corrupted zip : CRC32 mismatch")) : h();
|
|
249
249
|
}).resume();
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
r.exports = function(
|
|
252
|
+
r.exports = function(p, h) {
|
|
253
253
|
var b = this;
|
|
254
|
-
return h = a.extend(h || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: s.utf8decode }),
|
|
254
|
+
return h = a.extend(h || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: s.utf8decode }), u.isNode && u.isStream(p) ? o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : a.prepareContent("the loaded zip file", p, !0, h.optimizedBinaryString, h.base64).then(function(d) {
|
|
255
255
|
var _ = new c(h);
|
|
256
256
|
return _.load(d), _;
|
|
257
257
|
}).then(function(d) {
|
|
258
|
-
var _ = [o.Promise.resolve(d)],
|
|
259
|
-
if (h.checkCRC32) for (var v = 0; v <
|
|
258
|
+
var _ = [o.Promise.resolve(d)], f = d.files;
|
|
259
|
+
if (h.checkCRC32) for (var v = 0; v < f.length; v++) _.push(y(f[v]));
|
|
260
260
|
return o.Promise.all(_);
|
|
261
261
|
}).then(function(d) {
|
|
262
|
-
for (var _ = d.shift(),
|
|
263
|
-
var E =
|
|
262
|
+
for (var _ = d.shift(), f = _.files, v = 0; v < f.length; v++) {
|
|
263
|
+
var E = f[v], A = E.fileNameStr, T = a.resolve(E.fileNameStr);
|
|
264
264
|
b.file(T, E.decompressed, { binary: !0, optimizedBinaryString: !0, date: E.date, dir: E.dir, comment: E.fileCommentStr.length ? E.fileCommentStr : null, unixPermissions: E.unixPermissions, dosPermissions: E.dosPermissions, createFolders: h.createFolders }), E.dir || (b.file(T).unsafeOriginalName = A);
|
|
265
265
|
}
|
|
266
266
|
return _.zipComment.length && (b.comment = _.zipComment), b;
|
|
@@ -268,17 +268,17 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
268
268
|
};
|
|
269
269
|
}, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(t, r, n) {
|
|
270
270
|
var a = t("../utils"), o = t("../stream/GenericWorker");
|
|
271
|
-
function s(c,
|
|
272
|
-
o.call(this, "Nodejs stream input adapter for " + c), this._upstreamEnded = !1, this._bindStream(
|
|
271
|
+
function s(c, m) {
|
|
272
|
+
o.call(this, "Nodejs stream input adapter for " + c), this._upstreamEnded = !1, this._bindStream(m);
|
|
273
273
|
}
|
|
274
274
|
a.inherits(s, o), s.prototype._bindStream = function(c) {
|
|
275
|
-
var
|
|
276
|
-
(this._stream = c).pause(), c.on("data", function(
|
|
277
|
-
|
|
278
|
-
}).on("error", function(
|
|
279
|
-
|
|
275
|
+
var m = this;
|
|
276
|
+
(this._stream = c).pause(), c.on("data", function(u) {
|
|
277
|
+
m.push({ data: u, meta: { percent: 0 } });
|
|
278
|
+
}).on("error", function(u) {
|
|
279
|
+
m.isPaused ? this.generatedError = u : m.error(u);
|
|
280
280
|
}).on("end", function() {
|
|
281
|
-
|
|
281
|
+
m.isPaused ? m._upstreamEnded = !0 : m.end();
|
|
282
282
|
});
|
|
283
283
|
}, s.prototype.pause = function() {
|
|
284
284
|
return !!o.prototype.pause.call(this) && (this._stream.pause(), !0);
|
|
@@ -287,15 +287,15 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
287
287
|
}, r.exports = s;
|
|
288
288
|
}, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(t, r, n) {
|
|
289
289
|
var a = t("readable-stream").Readable;
|
|
290
|
-
function o(s, c,
|
|
290
|
+
function o(s, c, m) {
|
|
291
291
|
a.call(this, c), this._helper = s;
|
|
292
|
-
var
|
|
293
|
-
s.on("data", function(y,
|
|
294
|
-
|
|
292
|
+
var u = this;
|
|
293
|
+
s.on("data", function(y, p) {
|
|
294
|
+
u.push(y) || u._helper.pause(), m && m(p);
|
|
295
295
|
}).on("error", function(y) {
|
|
296
|
-
|
|
296
|
+
u.emit("error", y);
|
|
297
297
|
}).on("end", function() {
|
|
298
|
-
|
|
298
|
+
u.push(null);
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
t("../utils").inherits(o, a), o.prototype._read = function() {
|
|
@@ -317,23 +317,23 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
317
317
|
} };
|
|
318
318
|
}, {}], 15: [function(t, r, n) {
|
|
319
319
|
function a(T, L, B) {
|
|
320
|
-
var j, z = s.getTypeOf(L), Z = s.extend(B || {},
|
|
321
|
-
Z.date = Z.date || /* @__PURE__ */ new Date(), Z.compression !== null && (Z.compression = Z.compression.toUpperCase()), typeof Z.unixPermissions == "string" && (Z.unixPermissions = parseInt(Z.unixPermissions, 8)), Z.unixPermissions && 16384 & Z.unixPermissions && (Z.dir = !0), Z.dosPermissions && 16 & Z.dosPermissions && (Z.dir = !0), Z.dir && (T =
|
|
320
|
+
var j, z = s.getTypeOf(L), Z = s.extend(B || {}, u);
|
|
321
|
+
Z.date = Z.date || /* @__PURE__ */ new Date(), Z.compression !== null && (Z.compression = Z.compression.toUpperCase()), typeof Z.unixPermissions == "string" && (Z.unixPermissions = parseInt(Z.unixPermissions, 8)), Z.unixPermissions && 16384 & Z.unixPermissions && (Z.dir = !0), Z.dosPermissions && 16 & Z.dosPermissions && (Z.dir = !0), Z.dir && (T = f(T)), Z.createFolders && (j = _(T)) && v.call(this, j, !0);
|
|
322
322
|
var Q = z === "string" && Z.binary === !1 && Z.base64 === !1;
|
|
323
323
|
B && B.binary !== void 0 || (Z.binary = !Q), (L instanceof y && L.uncompressedSize === 0 || Z.dir || !L || L.length === 0) && (Z.base64 = !1, Z.binary = !0, L = "", Z.compression = "STORE", z = "string");
|
|
324
324
|
var k = null;
|
|
325
325
|
k = L instanceof y || L instanceof c ? L : b.isNode && b.isStream(L) ? new d(T, L) : s.prepareContent(T, L, Z.binary, Z.optimizedBinaryString, Z.base64);
|
|
326
|
-
var N = new
|
|
326
|
+
var N = new p(T, k, Z);
|
|
327
327
|
this.files[T] = N;
|
|
328
328
|
}
|
|
329
|
-
var o = t("./utf8"), s = t("./utils"), c = t("./stream/GenericWorker"),
|
|
329
|
+
var o = t("./utf8"), s = t("./utils"), c = t("./stream/GenericWorker"), m = t("./stream/StreamHelper"), u = t("./defaults"), y = t("./compressedObject"), p = t("./zipObject"), h = t("./generate"), b = t("./nodejsUtils"), d = t("./nodejs/NodejsStreamInputAdapter"), _ = function(T) {
|
|
330
330
|
T.slice(-1) === "/" && (T = T.substring(0, T.length - 1));
|
|
331
331
|
var L = T.lastIndexOf("/");
|
|
332
332
|
return 0 < L ? T.substring(0, L) : "";
|
|
333
|
-
},
|
|
333
|
+
}, f = function(T) {
|
|
334
334
|
return T.slice(-1) !== "/" && (T += "/"), T;
|
|
335
335
|
}, v = function(T, L) {
|
|
336
|
-
return L = L !== void 0 ? L :
|
|
336
|
+
return L = L !== void 0 ? L : u.createFolders, T = f(T), this.files[T] || a.call(this, T, null, { dir: !0, createFolders: L }), this.files[T];
|
|
337
337
|
};
|
|
338
338
|
function E(T) {
|
|
339
339
|
return Object.prototype.toString.call(T) === "[object RegExp]";
|
|
@@ -385,7 +385,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
385
385
|
} catch (z) {
|
|
386
386
|
(L = new c("error")).error(z);
|
|
387
387
|
}
|
|
388
|
-
return new
|
|
388
|
+
return new m(L, B.type || "string", B.mimeType);
|
|
389
389
|
}, generateAsync: function(T, L) {
|
|
390
390
|
return this.generateInternalStream(T).accumulate(L);
|
|
391
391
|
}, generateNodeStream: function(T, L) {
|
|
@@ -403,11 +403,11 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
403
403
|
t("../utils").inherits(o, a), o.prototype.byteAt = function(s) {
|
|
404
404
|
return this.data[this.zero + s];
|
|
405
405
|
}, o.prototype.lastIndexOfSignature = function(s) {
|
|
406
|
-
for (var c = s.charCodeAt(0),
|
|
406
|
+
for (var c = s.charCodeAt(0), m = s.charCodeAt(1), u = s.charCodeAt(2), y = s.charCodeAt(3), p = this.length - 4; 0 <= p; --p) if (this.data[p] === c && this.data[p + 1] === m && this.data[p + 2] === u && this.data[p + 3] === y) return p - this.zero;
|
|
407
407
|
return -1;
|
|
408
408
|
}, o.prototype.readAndCheckSignature = function(s) {
|
|
409
|
-
var c = s.charCodeAt(0),
|
|
410
|
-
return c ===
|
|
409
|
+
var c = s.charCodeAt(0), m = s.charCodeAt(1), u = s.charCodeAt(2), y = s.charCodeAt(3), p = this.readData(4);
|
|
410
|
+
return c === p[0] && m === p[1] && u === p[2] && y === p[3];
|
|
411
411
|
}, o.prototype.readData = function(s) {
|
|
412
412
|
if (this.checkOffset(s), s === 0) return [];
|
|
413
413
|
var c = this.data.slice(this.zero + this.index, this.zero + this.index + s);
|
|
@@ -428,9 +428,9 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
428
428
|
this.setIndex(this.index + s);
|
|
429
429
|
}, byteAt: function() {
|
|
430
430
|
}, readInt: function(s) {
|
|
431
|
-
var c,
|
|
432
|
-
for (this.checkOffset(s), c = this.index + s - 1; c >= this.index; c--)
|
|
433
|
-
return this.index += s,
|
|
431
|
+
var c, m = 0;
|
|
432
|
+
for (this.checkOffset(s), c = this.index + s - 1; c >= this.index; c--) m = (m << 8) + this.byteAt(c);
|
|
433
|
+
return this.index += s, m;
|
|
434
434
|
}, readString: function(s) {
|
|
435
435
|
return a.transformTo("string", this.readData(s));
|
|
436
436
|
}, readData: function() {
|
|
@@ -477,10 +477,10 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
477
477
|
return this.index += s, c;
|
|
478
478
|
}, r.exports = o;
|
|
479
479
|
}, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(t, r, n) {
|
|
480
|
-
var a = t("../utils"), o = t("../support"), s = t("./ArrayReader"), c = t("./StringReader"),
|
|
480
|
+
var a = t("../utils"), o = t("../support"), s = t("./ArrayReader"), c = t("./StringReader"), m = t("./NodeBufferReader"), u = t("./Uint8ArrayReader");
|
|
481
481
|
r.exports = function(y) {
|
|
482
|
-
var
|
|
483
|
-
return a.checkSupport(
|
|
482
|
+
var p = a.getTypeOf(y);
|
|
483
|
+
return a.checkSupport(p), p !== "string" || o.uint8array ? p === "nodebuffer" ? new m(y) : o.uint8array ? new u(a.transformTo("uint8array", y)) : new s(a.transformTo("array", y)) : new c(y);
|
|
484
484
|
};
|
|
485
485
|
}, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(t, r, n) {
|
|
486
486
|
n.LOCAL_FILE_HEADER = "PK", n.CENTRAL_FILE_HEADER = "PK", n.CENTRAL_DIRECTORY_END = "PK", n.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", n.ZIP64_CENTRAL_DIRECTORY_END = "PK", n.DATA_DESCRIPTOR = "PK\x07\b";
|
|
@@ -507,8 +507,8 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
507
507
|
}
|
|
508
508
|
a.inherits(s, o), s.prototype.processChunk = function(c) {
|
|
509
509
|
if (c) {
|
|
510
|
-
var
|
|
511
|
-
this.streamInfo[this.propName] =
|
|
510
|
+
var m = this.streamInfo[this.propName] || 0;
|
|
511
|
+
this.streamInfo[this.propName] = m + c.data.length;
|
|
512
512
|
}
|
|
513
513
|
o.prototype.processChunk.call(this, c);
|
|
514
514
|
}, r.exports = s;
|
|
@@ -516,11 +516,11 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
516
516
|
var a = t("../utils"), o = t("./GenericWorker");
|
|
517
517
|
function s(c) {
|
|
518
518
|
o.call(this, "DataWorker");
|
|
519
|
-
var
|
|
520
|
-
this.dataIsReady = !1, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = !1, c.then(function(
|
|
521
|
-
|
|
522
|
-
}, function(
|
|
523
|
-
|
|
519
|
+
var m = this;
|
|
520
|
+
this.dataIsReady = !1, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = !1, c.then(function(u) {
|
|
521
|
+
m.dataIsReady = !0, m.data = u, m.max = u && u.length || 0, m.type = a.getTypeOf(u), m.isPaused || m._tickAndRepeat();
|
|
522
|
+
}, function(u) {
|
|
523
|
+
m.error(u);
|
|
524
524
|
});
|
|
525
525
|
}
|
|
526
526
|
a.inherits(s, o), s.prototype.cleanUp = function() {
|
|
@@ -531,20 +531,20 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
531
531
|
this._tickScheduled = !1, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (a.delay(this._tickAndRepeat, [], this), this._tickScheduled = !0));
|
|
532
532
|
}, s.prototype._tick = function() {
|
|
533
533
|
if (this.isPaused || this.isFinished) return !1;
|
|
534
|
-
var c = null,
|
|
534
|
+
var c = null, m = Math.min(this.max, this.index + 16384);
|
|
535
535
|
if (this.index >= this.max) return this.end();
|
|
536
536
|
switch (this.type) {
|
|
537
537
|
case "string":
|
|
538
|
-
c = this.data.substring(this.index,
|
|
538
|
+
c = this.data.substring(this.index, m);
|
|
539
539
|
break;
|
|
540
540
|
case "uint8array":
|
|
541
|
-
c = this.data.subarray(this.index,
|
|
541
|
+
c = this.data.subarray(this.index, m);
|
|
542
542
|
break;
|
|
543
543
|
case "array":
|
|
544
544
|
case "nodebuffer":
|
|
545
|
-
c = this.data.slice(this.index,
|
|
545
|
+
c = this.data.slice(this.index, m);
|
|
546
546
|
}
|
|
547
|
-
return this.index =
|
|
547
|
+
return this.index = m, this.push({ data: c, meta: { percent: this.max ? this.index / this.max * 100 : 0 } });
|
|
548
548
|
}, r.exports = s;
|
|
549
549
|
}, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(t, r, n) {
|
|
550
550
|
function a(o) {
|
|
@@ -603,18 +603,18 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
603
603
|
return this.previous ? this.previous + " -> " + o : o;
|
|
604
604
|
} }, r.exports = a;
|
|
605
605
|
}, {}], 29: [function(t, r, n) {
|
|
606
|
-
var a = t("../utils"), o = t("./ConvertWorker"), s = t("./GenericWorker"), c = t("../base64"),
|
|
607
|
-
if (
|
|
606
|
+
var a = t("../utils"), o = t("./ConvertWorker"), s = t("./GenericWorker"), c = t("../base64"), m = t("../support"), u = t("../external"), y = null;
|
|
607
|
+
if (m.nodestream) try {
|
|
608
608
|
y = t("../nodejs/NodejsStreamOutputAdapter");
|
|
609
609
|
} catch {
|
|
610
610
|
}
|
|
611
|
-
function
|
|
612
|
-
return new
|
|
611
|
+
function p(b, d) {
|
|
612
|
+
return new u.Promise(function(_, f) {
|
|
613
613
|
var v = [], E = b._internalType, A = b._outputType, T = b._mimeType;
|
|
614
614
|
b.on("data", function(L, B) {
|
|
615
615
|
v.push(L), d && d(B);
|
|
616
616
|
}).on("error", function(L) {
|
|
617
|
-
v = [],
|
|
617
|
+
v = [], f(L);
|
|
618
618
|
}).on("end", function() {
|
|
619
619
|
try {
|
|
620
620
|
var L = function(B, j, z) {
|
|
@@ -645,34 +645,34 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
645
645
|
}(E, v), T);
|
|
646
646
|
_(L);
|
|
647
647
|
} catch (B) {
|
|
648
|
-
|
|
648
|
+
f(B);
|
|
649
649
|
}
|
|
650
650
|
v = [];
|
|
651
651
|
}).resume();
|
|
652
652
|
});
|
|
653
653
|
}
|
|
654
654
|
function h(b, d, _) {
|
|
655
|
-
var
|
|
655
|
+
var f = d;
|
|
656
656
|
switch (d) {
|
|
657
657
|
case "blob":
|
|
658
658
|
case "arraybuffer":
|
|
659
|
-
|
|
659
|
+
f = "uint8array";
|
|
660
660
|
break;
|
|
661
661
|
case "base64":
|
|
662
|
-
|
|
662
|
+
f = "string";
|
|
663
663
|
}
|
|
664
664
|
try {
|
|
665
|
-
this._internalType =
|
|
665
|
+
this._internalType = f, this._outputType = d, this._mimeType = _, a.checkSupport(f), this._worker = b.pipe(new o(f)), b.lock();
|
|
666
666
|
} catch (v) {
|
|
667
667
|
this._worker = new s("error"), this._worker.error(v);
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
670
|
h.prototype = { accumulate: function(b) {
|
|
671
|
-
return
|
|
671
|
+
return p(this, b);
|
|
672
672
|
}, on: function(b, d) {
|
|
673
673
|
var _ = this;
|
|
674
|
-
return b === "data" ? this._worker.on(b, function(
|
|
675
|
-
d.call(_,
|
|
674
|
+
return b === "data" ? this._worker.on(b, function(f) {
|
|
675
|
+
d.call(_, f.data, f.meta);
|
|
676
676
|
}) : this._worker.on(b, function() {
|
|
677
677
|
a.delay(d, arguments, _);
|
|
678
678
|
}), this;
|
|
@@ -705,29 +705,29 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
705
705
|
n.nodestream = !1;
|
|
706
706
|
}
|
|
707
707
|
}, { "readable-stream": 16 }], 31: [function(t, r, n) {
|
|
708
|
-
for (var a = t("./utils"), o = t("./support"), s = t("./nodejsUtils"), c = t("./stream/GenericWorker"),
|
|
709
|
-
|
|
708
|
+
for (var a = t("./utils"), o = t("./support"), s = t("./nodejsUtils"), c = t("./stream/GenericWorker"), m = new Array(256), u = 0; u < 256; u++) m[u] = 252 <= u ? 6 : 248 <= u ? 5 : 240 <= u ? 4 : 224 <= u ? 3 : 192 <= u ? 2 : 1;
|
|
709
|
+
m[254] = m[254] = 1;
|
|
710
710
|
function y() {
|
|
711
711
|
c.call(this, "utf-8 decode"), this.leftOver = null;
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function p() {
|
|
714
714
|
c.call(this, "utf-8 encode");
|
|
715
715
|
}
|
|
716
716
|
n.utf8encode = function(h) {
|
|
717
717
|
return o.nodebuffer ? s.newBufferFrom(h, "utf-8") : function(b) {
|
|
718
|
-
var d, _,
|
|
719
|
-
for (v = 0; v < A; v++) (64512 & (_ = b.charCodeAt(v))) == 55296 && v + 1 < A && (64512 & (
|
|
720
|
-
for (d = o.uint8array ? new Uint8Array(T) : new Array(T), v = E = 0; E < T; v++) (64512 & (_ = b.charCodeAt(v))) == 55296 && v + 1 < A && (64512 & (
|
|
718
|
+
var d, _, f, v, E, A = b.length, T = 0;
|
|
719
|
+
for (v = 0; v < A; v++) (64512 & (_ = b.charCodeAt(v))) == 55296 && v + 1 < A && (64512 & (f = b.charCodeAt(v + 1))) == 56320 && (_ = 65536 + (_ - 55296 << 10) + (f - 56320), v++), T += _ < 128 ? 1 : _ < 2048 ? 2 : _ < 65536 ? 3 : 4;
|
|
720
|
+
for (d = o.uint8array ? new Uint8Array(T) : new Array(T), v = E = 0; E < T; v++) (64512 & (_ = b.charCodeAt(v))) == 55296 && v + 1 < A && (64512 & (f = b.charCodeAt(v + 1))) == 56320 && (_ = 65536 + (_ - 55296 << 10) + (f - 56320), v++), _ < 128 ? d[E++] = _ : (_ < 2048 ? d[E++] = 192 | _ >>> 6 : (_ < 65536 ? d[E++] = 224 | _ >>> 12 : (d[E++] = 240 | _ >>> 18, d[E++] = 128 | _ >>> 12 & 63), d[E++] = 128 | _ >>> 6 & 63), d[E++] = 128 | 63 & _);
|
|
721
721
|
return d;
|
|
722
722
|
}(h);
|
|
723
723
|
}, n.utf8decode = function(h) {
|
|
724
724
|
return o.nodebuffer ? a.transformTo("nodebuffer", h).toString("utf-8") : function(b) {
|
|
725
|
-
var d, _,
|
|
726
|
-
for (d = _ = 0; d < E; ) if ((
|
|
727
|
-
else if (4 < (v =
|
|
725
|
+
var d, _, f, v, E = b.length, A = new Array(2 * E);
|
|
726
|
+
for (d = _ = 0; d < E; ) if ((f = b[d++]) < 128) A[_++] = f;
|
|
727
|
+
else if (4 < (v = m[f])) A[_++] = 65533, d += v - 1;
|
|
728
728
|
else {
|
|
729
|
-
for (
|
|
730
|
-
1 < v ? A[_++] = 65533 :
|
|
729
|
+
for (f &= v === 2 ? 31 : v === 3 ? 15 : 7; 1 < v && d < E; ) f = f << 6 | 63 & b[d++], v--;
|
|
730
|
+
1 < v ? A[_++] = 65533 : f < 65536 ? A[_++] = f : (f -= 65536, A[_++] = 55296 | f >> 10 & 1023, A[_++] = 56320 | 1023 & f);
|
|
731
731
|
}
|
|
732
732
|
return A.length !== _ && (A.subarray ? A = A.subarray(0, _) : A.length = _), a.applyFromCharCode(A);
|
|
733
733
|
}(h = a.transformTo(o.uint8array ? "uint8array" : "array", h));
|
|
@@ -743,21 +743,21 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
743
743
|
var _ = function(v, E) {
|
|
744
744
|
var A;
|
|
745
745
|
for ((E = E || v.length) > v.length && (E = v.length), A = E - 1; 0 <= A && (192 & v[A]) == 128; ) A--;
|
|
746
|
-
return A < 0 || A === 0 ? E : A +
|
|
747
|
-
}(b),
|
|
748
|
-
_ !== b.length && (o.uint8array ? (
|
|
746
|
+
return A < 0 || A === 0 ? E : A + m[v[A]] > E ? A : E;
|
|
747
|
+
}(b), f = b;
|
|
748
|
+
_ !== b.length && (o.uint8array ? (f = b.subarray(0, _), this.leftOver = b.subarray(_, b.length)) : (f = b.slice(0, _), this.leftOver = b.slice(_, b.length))), this.push({ data: n.utf8decode(f), meta: h.meta });
|
|
749
749
|
}, y.prototype.flush = function() {
|
|
750
750
|
this.leftOver && this.leftOver.length && (this.push({ data: n.utf8decode(this.leftOver), meta: {} }), this.leftOver = null);
|
|
751
|
-
}, n.Utf8DecodeWorker = y, a.inherits(
|
|
751
|
+
}, n.Utf8DecodeWorker = y, a.inherits(p, c), p.prototype.processChunk = function(h) {
|
|
752
752
|
this.push({ data: n.utf8encode(h.data), meta: h.meta });
|
|
753
|
-
}, n.Utf8EncodeWorker =
|
|
753
|
+
}, n.Utf8EncodeWorker = p;
|
|
754
754
|
}, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(t, r, n) {
|
|
755
755
|
var a = t("./support"), o = t("./base64"), s = t("./nodejsUtils"), c = t("./external");
|
|
756
|
-
function
|
|
756
|
+
function m(d) {
|
|
757
757
|
return d;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
for (var
|
|
759
|
+
function u(d, _) {
|
|
760
|
+
for (var f = 0; f < d.length; ++f) _[f] = 255 & d.charCodeAt(f);
|
|
761
761
|
return _;
|
|
762
762
|
}
|
|
763
763
|
t("setimmediate"), n.newBlob = function(d, _) {
|
|
@@ -766,20 +766,20 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
766
766
|
return new Blob([d], { type: _ });
|
|
767
767
|
} catch {
|
|
768
768
|
try {
|
|
769
|
-
var
|
|
770
|
-
return
|
|
769
|
+
var f = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
|
|
770
|
+
return f.append(d), f.getBlob(_);
|
|
771
771
|
} catch {
|
|
772
772
|
throw new Error("Bug : can't construct the Blob.");
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
775
|
};
|
|
776
|
-
var y = { stringifyByChunk: function(d, _,
|
|
776
|
+
var y = { stringifyByChunk: function(d, _, f) {
|
|
777
777
|
var v = [], E = 0, A = d.length;
|
|
778
|
-
if (A <=
|
|
779
|
-
for (; E < A; ) _ === "array" || _ === "nodebuffer" ? v.push(String.fromCharCode.apply(null, d.slice(E, Math.min(E +
|
|
778
|
+
if (A <= f) return String.fromCharCode.apply(null, d);
|
|
779
|
+
for (; E < A; ) _ === "array" || _ === "nodebuffer" ? v.push(String.fromCharCode.apply(null, d.slice(E, Math.min(E + f, A)))) : v.push(String.fromCharCode.apply(null, d.subarray(E, Math.min(E + f, A)))), E += f;
|
|
780
780
|
return v.join("");
|
|
781
781
|
}, stringifyByChar: function(d) {
|
|
782
|
-
for (var _ = "",
|
|
782
|
+
for (var _ = "", f = 0; f < d.length; f++) _ += String.fromCharCode(d[f]);
|
|
783
783
|
return _;
|
|
784
784
|
}, applyCanBeUsed: { uint8array: function() {
|
|
785
785
|
try {
|
|
@@ -794,87 +794,87 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
794
794
|
return !1;
|
|
795
795
|
}
|
|
796
796
|
}() } };
|
|
797
|
-
function
|
|
798
|
-
var _ = 65536,
|
|
799
|
-
if (
|
|
800
|
-
return y.stringifyByChunk(d,
|
|
797
|
+
function p(d) {
|
|
798
|
+
var _ = 65536, f = n.getTypeOf(d), v = !0;
|
|
799
|
+
if (f === "uint8array" ? v = y.applyCanBeUsed.uint8array : f === "nodebuffer" && (v = y.applyCanBeUsed.nodebuffer), v) for (; 1 < _; ) try {
|
|
800
|
+
return y.stringifyByChunk(d, f, _);
|
|
801
801
|
} catch {
|
|
802
802
|
_ = Math.floor(_ / 2);
|
|
803
803
|
}
|
|
804
804
|
return y.stringifyByChar(d);
|
|
805
805
|
}
|
|
806
806
|
function h(d, _) {
|
|
807
|
-
for (var
|
|
807
|
+
for (var f = 0; f < d.length; f++) _[f] = d[f];
|
|
808
808
|
return _;
|
|
809
809
|
}
|
|
810
|
-
n.applyFromCharCode =
|
|
810
|
+
n.applyFromCharCode = p;
|
|
811
811
|
var b = {};
|
|
812
|
-
b.string = { string:
|
|
813
|
-
return
|
|
812
|
+
b.string = { string: m, array: function(d) {
|
|
813
|
+
return u(d, new Array(d.length));
|
|
814
814
|
}, arraybuffer: function(d) {
|
|
815
815
|
return b.string.uint8array(d).buffer;
|
|
816
816
|
}, uint8array: function(d) {
|
|
817
|
-
return
|
|
817
|
+
return u(d, new Uint8Array(d.length));
|
|
818
818
|
}, nodebuffer: function(d) {
|
|
819
|
-
return
|
|
820
|
-
} }, b.array = { string:
|
|
819
|
+
return u(d, s.allocBuffer(d.length));
|
|
820
|
+
} }, b.array = { string: p, array: m, arraybuffer: function(d) {
|
|
821
821
|
return new Uint8Array(d).buffer;
|
|
822
822
|
}, uint8array: function(d) {
|
|
823
823
|
return new Uint8Array(d);
|
|
824
824
|
}, nodebuffer: function(d) {
|
|
825
825
|
return s.newBufferFrom(d);
|
|
826
826
|
} }, b.arraybuffer = { string: function(d) {
|
|
827
|
-
return
|
|
827
|
+
return p(new Uint8Array(d));
|
|
828
828
|
}, array: function(d) {
|
|
829
829
|
return h(new Uint8Array(d), new Array(d.byteLength));
|
|
830
|
-
}, arraybuffer:
|
|
830
|
+
}, arraybuffer: m, uint8array: function(d) {
|
|
831
831
|
return new Uint8Array(d);
|
|
832
832
|
}, nodebuffer: function(d) {
|
|
833
833
|
return s.newBufferFrom(new Uint8Array(d));
|
|
834
|
-
} }, b.uint8array = { string:
|
|
834
|
+
} }, b.uint8array = { string: p, array: function(d) {
|
|
835
835
|
return h(d, new Array(d.length));
|
|
836
836
|
}, arraybuffer: function(d) {
|
|
837
837
|
return d.buffer;
|
|
838
|
-
}, uint8array:
|
|
838
|
+
}, uint8array: m, nodebuffer: function(d) {
|
|
839
839
|
return s.newBufferFrom(d);
|
|
840
|
-
} }, b.nodebuffer = { string:
|
|
840
|
+
} }, b.nodebuffer = { string: p, array: function(d) {
|
|
841
841
|
return h(d, new Array(d.length));
|
|
842
842
|
}, arraybuffer: function(d) {
|
|
843
843
|
return b.nodebuffer.uint8array(d).buffer;
|
|
844
844
|
}, uint8array: function(d) {
|
|
845
845
|
return h(d, new Uint8Array(d.length));
|
|
846
|
-
}, nodebuffer:
|
|
846
|
+
}, nodebuffer: m }, n.transformTo = function(d, _) {
|
|
847
847
|
if (_ = _ || "", !d) return _;
|
|
848
848
|
n.checkSupport(d);
|
|
849
|
-
var
|
|
850
|
-
return b[
|
|
849
|
+
var f = n.getTypeOf(_);
|
|
850
|
+
return b[f][d](_);
|
|
851
851
|
}, n.resolve = function(d) {
|
|
852
|
-
for (var _ = d.split("/"),
|
|
852
|
+
for (var _ = d.split("/"), f = [], v = 0; v < _.length; v++) {
|
|
853
853
|
var E = _[v];
|
|
854
|
-
E === "." || E === "" && v !== 0 && v !== _.length - 1 || (E === ".." ?
|
|
854
|
+
E === "." || E === "" && v !== 0 && v !== _.length - 1 || (E === ".." ? f.pop() : f.push(E));
|
|
855
855
|
}
|
|
856
|
-
return
|
|
856
|
+
return f.join("/");
|
|
857
857
|
}, n.getTypeOf = function(d) {
|
|
858
858
|
return typeof d == "string" ? "string" : Object.prototype.toString.call(d) === "[object Array]" ? "array" : a.nodebuffer && s.isBuffer(d) ? "nodebuffer" : a.uint8array && d instanceof Uint8Array ? "uint8array" : a.arraybuffer && d instanceof ArrayBuffer ? "arraybuffer" : void 0;
|
|
859
859
|
}, n.checkSupport = function(d) {
|
|
860
860
|
if (!a[d.toLowerCase()]) throw new Error(d + " is not supported by this platform");
|
|
861
861
|
}, n.MAX_VALUE_16BITS = 65535, n.MAX_VALUE_32BITS = -1, n.pretty = function(d) {
|
|
862
|
-
var _,
|
|
863
|
-
for (
|
|
862
|
+
var _, f, v = "";
|
|
863
|
+
for (f = 0; f < (d || "").length; f++) v += "\\x" + ((_ = d.charCodeAt(f)) < 16 ? "0" : "") + _.toString(16).toUpperCase();
|
|
864
864
|
return v;
|
|
865
|
-
}, n.delay = function(d, _,
|
|
865
|
+
}, n.delay = function(d, _, f) {
|
|
866
866
|
setImmediate(function() {
|
|
867
|
-
d.apply(
|
|
867
|
+
d.apply(f || null, _ || []);
|
|
868
868
|
});
|
|
869
869
|
}, n.inherits = function(d, _) {
|
|
870
|
-
function
|
|
870
|
+
function f() {
|
|
871
871
|
}
|
|
872
|
-
|
|
872
|
+
f.prototype = _.prototype, d.prototype = new f();
|
|
873
873
|
}, n.extend = function() {
|
|
874
|
-
var d, _,
|
|
875
|
-
for (d = 0; d < arguments.length; d++) for (_ in arguments[d]) Object.prototype.hasOwnProperty.call(arguments[d], _) &&
|
|
876
|
-
return
|
|
877
|
-
}, n.prepareContent = function(d, _,
|
|
874
|
+
var d, _, f = {};
|
|
875
|
+
for (d = 0; d < arguments.length; d++) for (_ in arguments[d]) Object.prototype.hasOwnProperty.call(arguments[d], _) && f[_] === void 0 && (f[_] = arguments[d][_]);
|
|
876
|
+
return f;
|
|
877
|
+
}, n.prepareContent = function(d, _, f, v, E) {
|
|
878
878
|
return c.Promise.resolve(_).then(function(A) {
|
|
879
879
|
return a.blob && (A instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(A)) !== -1) && typeof FileReader < "u" ? new c.Promise(function(T, L) {
|
|
880
880
|
var B = new FileReader();
|
|
@@ -886,39 +886,39 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
886
886
|
}) : A;
|
|
887
887
|
}).then(function(A) {
|
|
888
888
|
var T = n.getTypeOf(A);
|
|
889
|
-
return T ? (T === "arraybuffer" ? A = n.transformTo("uint8array", A) : T === "string" && (E ? A = o.decode(A) :
|
|
890
|
-
return
|
|
889
|
+
return T ? (T === "arraybuffer" ? A = n.transformTo("uint8array", A) : T === "string" && (E ? A = o.decode(A) : f && v !== !0 && (A = function(L) {
|
|
890
|
+
return u(L, a.uint8array ? new Uint8Array(L.length) : new Array(L.length));
|
|
891
891
|
}(A))), A) : c.Promise.reject(new Error("Can't read the data of '" + d + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
|
|
892
892
|
});
|
|
893
893
|
};
|
|
894
894
|
}, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function(t, r, n) {
|
|
895
|
-
var a = t("./reader/readerFor"), o = t("./utils"), s = t("./signature"), c = t("./zipEntry"),
|
|
896
|
-
function
|
|
895
|
+
var a = t("./reader/readerFor"), o = t("./utils"), s = t("./signature"), c = t("./zipEntry"), m = t("./support");
|
|
896
|
+
function u(y) {
|
|
897
897
|
this.files = [], this.loadOptions = y;
|
|
898
898
|
}
|
|
899
|
-
|
|
899
|
+
u.prototype = { checkSignature: function(y) {
|
|
900
900
|
if (!this.reader.readAndCheckSignature(y)) {
|
|
901
901
|
this.reader.index -= 4;
|
|
902
|
-
var
|
|
903
|
-
throw new Error("Corrupted zip or bug: unexpected signature (" + o.pretty(
|
|
902
|
+
var p = this.reader.readString(4);
|
|
903
|
+
throw new Error("Corrupted zip or bug: unexpected signature (" + o.pretty(p) + ", expected " + o.pretty(y) + ")");
|
|
904
904
|
}
|
|
905
|
-
}, isSignature: function(y,
|
|
905
|
+
}, isSignature: function(y, p) {
|
|
906
906
|
var h = this.reader.index;
|
|
907
907
|
this.reader.setIndex(y);
|
|
908
|
-
var b = this.reader.readString(4) ===
|
|
908
|
+
var b = this.reader.readString(4) === p;
|
|
909
909
|
return this.reader.setIndex(h), b;
|
|
910
910
|
}, readBlockEndOfCentral: function() {
|
|
911
911
|
this.diskNumber = this.reader.readInt(2), this.diskWithCentralDirStart = this.reader.readInt(2), this.centralDirRecordsOnThisDisk = this.reader.readInt(2), this.centralDirRecords = this.reader.readInt(2), this.centralDirSize = this.reader.readInt(4), this.centralDirOffset = this.reader.readInt(4), this.zipCommentLength = this.reader.readInt(2);
|
|
912
|
-
var y = this.reader.readData(this.zipCommentLength),
|
|
912
|
+
var y = this.reader.readData(this.zipCommentLength), p = m.uint8array ? "uint8array" : "array", h = o.transformTo(p, y);
|
|
913
913
|
this.zipComment = this.loadOptions.decodeFileName(h);
|
|
914
914
|
}, readBlockZip64EndOfCentral: function() {
|
|
915
915
|
this.zip64EndOfCentralSize = this.reader.readInt(8), this.reader.skip(4), this.diskNumber = this.reader.readInt(4), this.diskWithCentralDirStart = this.reader.readInt(4), this.centralDirRecordsOnThisDisk = this.reader.readInt(8), this.centralDirRecords = this.reader.readInt(8), this.centralDirSize = this.reader.readInt(8), this.centralDirOffset = this.reader.readInt(8), this.zip64ExtensibleData = {};
|
|
916
|
-
for (var y,
|
|
916
|
+
for (var y, p, h, b = this.zip64EndOfCentralSize - 44; 0 < b; ) y = this.reader.readInt(2), p = this.reader.readInt(4), h = this.reader.readData(p), this.zip64ExtensibleData[y] = { id: y, length: p, value: h };
|
|
917
917
|
}, readBlockZip64EndOfCentralLocator: function() {
|
|
918
918
|
if (this.diskWithZip64CentralDirStart = this.reader.readInt(4), this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8), this.disksCount = this.reader.readInt(4), 1 < this.disksCount) throw new Error("Multi-volumes zip are not supported");
|
|
919
919
|
}, readLocalFiles: function() {
|
|
920
|
-
var y,
|
|
921
|
-
for (y = 0; y < this.files.length; y++)
|
|
920
|
+
var y, p;
|
|
921
|
+
for (y = 0; y < this.files.length; y++) p = this.files[y], this.reader.setIndex(p.localHeaderOffset), this.checkSignature(s.LOCAL_FILE_HEADER), p.readLocalPart(this.reader), p.handleUTF8(), p.processAttributes();
|
|
922
922
|
}, readCentralDir: function() {
|
|
923
923
|
var y;
|
|
924
924
|
for (this.reader.setIndex(this.centralDirOffset); this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER); ) (y = new c({ zip64: this.zip64 }, this.loadOptions)).readCentralPart(this.reader), this.files.push(y);
|
|
@@ -927,7 +927,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
927
927
|
var y = this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);
|
|
928
928
|
if (y < 0) throw this.isSignature(0, s.LOCAL_FILE_HEADER) ? new Error("Corrupted zip: can't find end of central directory") : new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");
|
|
929
929
|
this.reader.setIndex(y);
|
|
930
|
-
var
|
|
930
|
+
var p = y;
|
|
931
931
|
if (this.checkSignature(s.CENTRAL_DIRECTORY_END), this.readBlockEndOfCentral(), this.diskNumber === o.MAX_VALUE_16BITS || this.diskWithCentralDirStart === o.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === o.MAX_VALUE_16BITS || this.centralDirRecords === o.MAX_VALUE_16BITS || this.centralDirSize === o.MAX_VALUE_32BITS || this.centralDirOffset === o.MAX_VALUE_32BITS) {
|
|
932
932
|
if (this.zip64 = !0, (y = this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR)) < 0) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");
|
|
933
933
|
if (this.reader.setIndex(y), this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), !this.isSignature(this.relativeOffsetEndOfZip64CentralDir, s.ZIP64_CENTRAL_DIRECTORY_END) && (this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END), this.relativeOffsetEndOfZip64CentralDir < 0)) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");
|
|
@@ -935,20 +935,20 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
935
935
|
}
|
|
936
936
|
var h = this.centralDirOffset + this.centralDirSize;
|
|
937
937
|
this.zip64 && (h += 20, h += 12 + this.zip64EndOfCentralSize);
|
|
938
|
-
var b =
|
|
939
|
-
if (0 < b) this.isSignature(
|
|
938
|
+
var b = p - h;
|
|
939
|
+
if (0 < b) this.isSignature(p, s.CENTRAL_FILE_HEADER) || (this.reader.zero = b);
|
|
940
940
|
else if (b < 0) throw new Error("Corrupted zip: missing " + Math.abs(b) + " bytes.");
|
|
941
941
|
}, prepareReader: function(y) {
|
|
942
942
|
this.reader = a(y);
|
|
943
943
|
}, load: function(y) {
|
|
944
944
|
this.prepareReader(y), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles();
|
|
945
|
-
} }, r.exports =
|
|
945
|
+
} }, r.exports = u;
|
|
946
946
|
}, { "./reader/readerFor": 22, "./signature": 23, "./support": 30, "./utils": 32, "./zipEntry": 34 }], 34: [function(t, r, n) {
|
|
947
|
-
var a = t("./reader/readerFor"), o = t("./utils"), s = t("./compressedObject"), c = t("./crc32"),
|
|
948
|
-
function
|
|
947
|
+
var a = t("./reader/readerFor"), o = t("./utils"), s = t("./compressedObject"), c = t("./crc32"), m = t("./utf8"), u = t("./compressions"), y = t("./support");
|
|
948
|
+
function p(h, b) {
|
|
949
949
|
this.options = h, this.loadOptions = b;
|
|
950
950
|
}
|
|
951
|
-
|
|
951
|
+
p.prototype = { isEncrypted: function() {
|
|
952
952
|
return (1 & this.bitFlag) == 1;
|
|
953
953
|
}, useUTF8: function() {
|
|
954
954
|
return (2048 & this.bitFlag) == 2048;
|
|
@@ -956,7 +956,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
956
956
|
var b, d;
|
|
957
957
|
if (h.skip(22), this.fileNameLength = h.readInt(2), d = h.readInt(2), this.fileName = h.readData(this.fileNameLength), h.skip(d), this.compressedSize === -1 || this.uncompressedSize === -1) throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");
|
|
958
958
|
if ((b = function(_) {
|
|
959
|
-
for (var
|
|
959
|
+
for (var f in u) if (Object.prototype.hasOwnProperty.call(u, f) && u[f].magic === _) return u[f];
|
|
960
960
|
return null;
|
|
961
961
|
}(this.compressionMethod)) === null) throw new Error("Corrupted zip : compression " + o.pretty(this.compressionMethod) + " unknown (inner file : " + o.transformTo("string", this.fileName) + ")");
|
|
962
962
|
this.decompressed = new s(this.compressedSize, this.uncompressedSize, this.crc32, b, h.readData(this.compressedSize));
|
|
@@ -975,12 +975,12 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
975
975
|
this.uncompressedSize === o.MAX_VALUE_32BITS && (this.uncompressedSize = h.readInt(8)), this.compressedSize === o.MAX_VALUE_32BITS && (this.compressedSize = h.readInt(8)), this.localHeaderOffset === o.MAX_VALUE_32BITS && (this.localHeaderOffset = h.readInt(8)), this.diskNumberStart === o.MAX_VALUE_32BITS && (this.diskNumberStart = h.readInt(4));
|
|
976
976
|
}
|
|
977
977
|
}, readExtraFields: function(h) {
|
|
978
|
-
var b, d, _,
|
|
979
|
-
for (this.extraFields || (this.extraFields = {}); h.index + 4 <
|
|
980
|
-
h.setIndex(
|
|
978
|
+
var b, d, _, f = h.index + this.extraFieldsLength;
|
|
979
|
+
for (this.extraFields || (this.extraFields = {}); h.index + 4 < f; ) b = h.readInt(2), d = h.readInt(2), _ = h.readData(d), this.extraFields[b] = { id: b, length: d, value: _ };
|
|
980
|
+
h.setIndex(f);
|
|
981
981
|
}, handleUTF8: function() {
|
|
982
982
|
var h = y.uint8array ? "uint8array" : "array";
|
|
983
|
-
if (this.useUTF8()) this.fileNameStr =
|
|
983
|
+
if (this.useUTF8()) this.fileNameStr = m.utf8decode(this.fileName), this.fileCommentStr = m.utf8decode(this.fileComment);
|
|
984
984
|
else {
|
|
985
985
|
var b = this.findExtraFieldUnicodePath();
|
|
986
986
|
if (b !== null) this.fileNameStr = b;
|
|
@@ -991,40 +991,40 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
991
991
|
var _ = this.findExtraFieldUnicodeComment();
|
|
992
992
|
if (_ !== null) this.fileCommentStr = _;
|
|
993
993
|
else {
|
|
994
|
-
var
|
|
995
|
-
this.fileCommentStr = this.loadOptions.decodeFileName(
|
|
994
|
+
var f = o.transformTo(h, this.fileComment);
|
|
995
|
+
this.fileCommentStr = this.loadOptions.decodeFileName(f);
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
998
|
}, findExtraFieldUnicodePath: function() {
|
|
999
999
|
var h = this.extraFields[28789];
|
|
1000
1000
|
if (h) {
|
|
1001
1001
|
var b = a(h.value);
|
|
1002
|
-
return b.readInt(1) !== 1 || c(this.fileName) !== b.readInt(4) ? null :
|
|
1002
|
+
return b.readInt(1) !== 1 || c(this.fileName) !== b.readInt(4) ? null : m.utf8decode(b.readData(h.length - 5));
|
|
1003
1003
|
}
|
|
1004
1004
|
return null;
|
|
1005
1005
|
}, findExtraFieldUnicodeComment: function() {
|
|
1006
1006
|
var h = this.extraFields[25461];
|
|
1007
1007
|
if (h) {
|
|
1008
1008
|
var b = a(h.value);
|
|
1009
|
-
return b.readInt(1) !== 1 || c(this.fileComment) !== b.readInt(4) ? null :
|
|
1009
|
+
return b.readInt(1) !== 1 || c(this.fileComment) !== b.readInt(4) ? null : m.utf8decode(b.readData(h.length - 5));
|
|
1010
1010
|
}
|
|
1011
1011
|
return null;
|
|
1012
|
-
} }, r.exports =
|
|
1012
|
+
} }, r.exports = p;
|
|
1013
1013
|
}, { "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./reader/readerFor": 22, "./support": 30, "./utf8": 31, "./utils": 32 }], 35: [function(t, r, n) {
|
|
1014
1014
|
function a(b, d, _) {
|
|
1015
1015
|
this.name = b, this.dir = _.dir, this.date = _.date, this.comment = _.comment, this.unixPermissions = _.unixPermissions, this.dosPermissions = _.dosPermissions, this._data = d, this._dataBinary = _.binary, this.options = { compression: _.compression, compressionOptions: _.compressionOptions };
|
|
1016
1016
|
}
|
|
1017
|
-
var o = t("./stream/StreamHelper"), s = t("./stream/DataWorker"), c = t("./utf8"),
|
|
1017
|
+
var o = t("./stream/StreamHelper"), s = t("./stream/DataWorker"), c = t("./utf8"), m = t("./compressedObject"), u = t("./stream/GenericWorker");
|
|
1018
1018
|
a.prototype = { internalStream: function(b) {
|
|
1019
1019
|
var d = null, _ = "string";
|
|
1020
1020
|
try {
|
|
1021
1021
|
if (!b) throw new Error("No output type specified.");
|
|
1022
|
-
var
|
|
1022
|
+
var f = (_ = b.toLowerCase()) === "string" || _ === "text";
|
|
1023
1023
|
_ !== "binarystring" && _ !== "text" || (_ = "string"), d = this._decompressWorker();
|
|
1024
1024
|
var v = !this._dataBinary;
|
|
1025
|
-
v && !
|
|
1025
|
+
v && !f && (d = d.pipe(new c.Utf8EncodeWorker())), !v && f && (d = d.pipe(new c.Utf8DecodeWorker()));
|
|
1026
1026
|
} catch (E) {
|
|
1027
|
-
(d = new
|
|
1027
|
+
(d = new u("error")).error(E);
|
|
1028
1028
|
}
|
|
1029
1029
|
return new o(d, _, "");
|
|
1030
1030
|
}, async: function(b, d) {
|
|
@@ -1032,23 +1032,23 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1032
1032
|
}, nodeStream: function(b, d) {
|
|
1033
1033
|
return this.internalStream(b || "nodebuffer").toNodejsStream(d);
|
|
1034
1034
|
}, _compressWorker: function(b, d) {
|
|
1035
|
-
if (this._data instanceof
|
|
1035
|
+
if (this._data instanceof m && this._data.compression.magic === b.magic) return this._data.getCompressedWorker();
|
|
1036
1036
|
var _ = this._decompressWorker();
|
|
1037
|
-
return this._dataBinary || (_ = _.pipe(new c.Utf8EncodeWorker())),
|
|
1037
|
+
return this._dataBinary || (_ = _.pipe(new c.Utf8EncodeWorker())), m.createWorkerFrom(_, b, d);
|
|
1038
1038
|
}, _decompressWorker: function() {
|
|
1039
|
-
return this._data instanceof
|
|
1039
|
+
return this._data instanceof m ? this._data.getContentWorker() : this._data instanceof u ? this._data : new s(this._data);
|
|
1040
1040
|
} };
|
|
1041
|
-
for (var y = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"],
|
|
1041
|
+
for (var y = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"], p = function() {
|
|
1042
1042
|
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
1043
|
-
}, h = 0; h < y.length; h++) a.prototype[y[h]] =
|
|
1043
|
+
}, h = 0; h < y.length; h++) a.prototype[y[h]] = p;
|
|
1044
1044
|
r.exports = a;
|
|
1045
1045
|
}, { "./compressedObject": 2, "./stream/DataWorker": 27, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31 }], 36: [function(t, r, n) {
|
|
1046
1046
|
(function(a) {
|
|
1047
1047
|
var o, s, c = a.MutationObserver || a.WebKitMutationObserver;
|
|
1048
1048
|
if (c) {
|
|
1049
|
-
var
|
|
1050
|
-
|
|
1051
|
-
y.data =
|
|
1049
|
+
var m = 0, u = new c(b), y = a.document.createTextNode("");
|
|
1050
|
+
u.observe(y, { characterData: !0 }), o = function() {
|
|
1051
|
+
y.data = m = ++m % 2;
|
|
1052
1052
|
};
|
|
1053
1053
|
} else if (a.setImmediate || a.MessageChannel === void 0) o = "document" in a && "onreadystatechange" in a.document.createElement("script") ? function() {
|
|
1054
1054
|
var d = a.document.createElement("script");
|
|
@@ -1059,18 +1059,18 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1059
1059
|
setTimeout(b, 0);
|
|
1060
1060
|
};
|
|
1061
1061
|
else {
|
|
1062
|
-
var
|
|
1063
|
-
|
|
1064
|
-
|
|
1062
|
+
var p = new a.MessageChannel();
|
|
1063
|
+
p.port1.onmessage = b, o = function() {
|
|
1064
|
+
p.port2.postMessage(0);
|
|
1065
1065
|
};
|
|
1066
1066
|
}
|
|
1067
1067
|
var h = [];
|
|
1068
1068
|
function b() {
|
|
1069
1069
|
var d, _;
|
|
1070
1070
|
s = !0;
|
|
1071
|
-
for (var
|
|
1072
|
-
for (_ = h, h = [], d = -1; ++d <
|
|
1073
|
-
|
|
1071
|
+
for (var f = h.length; f; ) {
|
|
1072
|
+
for (_ = h, h = [], d = -1; ++d < f; ) _[d]();
|
|
1073
|
+
f = h.length;
|
|
1074
1074
|
}
|
|
1075
1075
|
s = !1;
|
|
1076
1076
|
}
|
|
@@ -1082,104 +1082,104 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1082
1082
|
var a = t("immediate");
|
|
1083
1083
|
function o() {
|
|
1084
1084
|
}
|
|
1085
|
-
var s = {}, c = ["REJECTED"],
|
|
1086
|
-
function y(
|
|
1087
|
-
if (typeof
|
|
1088
|
-
this.state =
|
|
1085
|
+
var s = {}, c = ["REJECTED"], m = ["FULFILLED"], u = ["PENDING"];
|
|
1086
|
+
function y(f) {
|
|
1087
|
+
if (typeof f != "function") throw new TypeError("resolver must be a function");
|
|
1088
|
+
this.state = u, this.queue = [], this.outcome = void 0, f !== o && d(this, f);
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
this.promise =
|
|
1090
|
+
function p(f, v, E) {
|
|
1091
|
+
this.promise = f, typeof v == "function" && (this.onFulfilled = v, this.callFulfilled = this.otherCallFulfilled), typeof E == "function" && (this.onRejected = E, this.callRejected = this.otherCallRejected);
|
|
1092
1092
|
}
|
|
1093
|
-
function h(
|
|
1093
|
+
function h(f, v, E) {
|
|
1094
1094
|
a(function() {
|
|
1095
1095
|
var A;
|
|
1096
1096
|
try {
|
|
1097
1097
|
A = v(E);
|
|
1098
1098
|
} catch (T) {
|
|
1099
|
-
return s.reject(
|
|
1099
|
+
return s.reject(f, T);
|
|
1100
1100
|
}
|
|
1101
|
-
A ===
|
|
1101
|
+
A === f ? s.reject(f, new TypeError("Cannot resolve promise with itself")) : s.resolve(f, A);
|
|
1102
1102
|
});
|
|
1103
1103
|
}
|
|
1104
|
-
function b(
|
|
1105
|
-
var v =
|
|
1106
|
-
if (
|
|
1107
|
-
v.apply(
|
|
1104
|
+
function b(f) {
|
|
1105
|
+
var v = f && f.then;
|
|
1106
|
+
if (f && (typeof f == "object" || typeof f == "function") && typeof v == "function") return function() {
|
|
1107
|
+
v.apply(f, arguments);
|
|
1108
1108
|
};
|
|
1109
1109
|
}
|
|
1110
|
-
function d(
|
|
1110
|
+
function d(f, v) {
|
|
1111
1111
|
var E = !1;
|
|
1112
1112
|
function A(B) {
|
|
1113
|
-
E || (E = !0, s.reject(
|
|
1113
|
+
E || (E = !0, s.reject(f, B));
|
|
1114
1114
|
}
|
|
1115
1115
|
function T(B) {
|
|
1116
|
-
E || (E = !0, s.resolve(
|
|
1116
|
+
E || (E = !0, s.resolve(f, B));
|
|
1117
1117
|
}
|
|
1118
1118
|
var L = _(function() {
|
|
1119
1119
|
v(T, A);
|
|
1120
1120
|
});
|
|
1121
1121
|
L.status === "error" && A(L.value);
|
|
1122
1122
|
}
|
|
1123
|
-
function _(
|
|
1123
|
+
function _(f, v) {
|
|
1124
1124
|
var E = {};
|
|
1125
1125
|
try {
|
|
1126
|
-
E.value =
|
|
1126
|
+
E.value = f(v), E.status = "success";
|
|
1127
1127
|
} catch (A) {
|
|
1128
1128
|
E.status = "error", E.value = A;
|
|
1129
1129
|
}
|
|
1130
1130
|
return E;
|
|
1131
1131
|
}
|
|
1132
|
-
(r.exports = y).prototype.finally = function(
|
|
1133
|
-
if (typeof
|
|
1132
|
+
(r.exports = y).prototype.finally = function(f) {
|
|
1133
|
+
if (typeof f != "function") return this;
|
|
1134
1134
|
var v = this.constructor;
|
|
1135
1135
|
return this.then(function(E) {
|
|
1136
|
-
return v.resolve(
|
|
1136
|
+
return v.resolve(f()).then(function() {
|
|
1137
1137
|
return E;
|
|
1138
1138
|
});
|
|
1139
1139
|
}, function(E) {
|
|
1140
|
-
return v.resolve(
|
|
1140
|
+
return v.resolve(f()).then(function() {
|
|
1141
1141
|
throw E;
|
|
1142
1142
|
});
|
|
1143
1143
|
});
|
|
1144
|
-
}, y.prototype.catch = function(
|
|
1145
|
-
return this.then(null,
|
|
1146
|
-
}, y.prototype.then = function(
|
|
1147
|
-
if (typeof
|
|
1144
|
+
}, y.prototype.catch = function(f) {
|
|
1145
|
+
return this.then(null, f);
|
|
1146
|
+
}, y.prototype.then = function(f, v) {
|
|
1147
|
+
if (typeof f != "function" && this.state === m || typeof v != "function" && this.state === c) return this;
|
|
1148
1148
|
var E = new this.constructor(o);
|
|
1149
|
-
return this.state !==
|
|
1150
|
-
},
|
|
1151
|
-
s.resolve(this.promise,
|
|
1152
|
-
},
|
|
1153
|
-
h(this.promise, this.onFulfilled,
|
|
1154
|
-
},
|
|
1155
|
-
s.reject(this.promise,
|
|
1156
|
-
},
|
|
1157
|
-
h(this.promise, this.onRejected,
|
|
1158
|
-
}, s.resolve = function(
|
|
1149
|
+
return this.state !== u ? h(E, this.state === m ? f : v, this.outcome) : this.queue.push(new p(E, f, v)), E;
|
|
1150
|
+
}, p.prototype.callFulfilled = function(f) {
|
|
1151
|
+
s.resolve(this.promise, f);
|
|
1152
|
+
}, p.prototype.otherCallFulfilled = function(f) {
|
|
1153
|
+
h(this.promise, this.onFulfilled, f);
|
|
1154
|
+
}, p.prototype.callRejected = function(f) {
|
|
1155
|
+
s.reject(this.promise, f);
|
|
1156
|
+
}, p.prototype.otherCallRejected = function(f) {
|
|
1157
|
+
h(this.promise, this.onRejected, f);
|
|
1158
|
+
}, s.resolve = function(f, v) {
|
|
1159
1159
|
var E = _(b, v);
|
|
1160
|
-
if (E.status === "error") return s.reject(
|
|
1160
|
+
if (E.status === "error") return s.reject(f, E.value);
|
|
1161
1161
|
var A = E.value;
|
|
1162
|
-
if (A) d(
|
|
1162
|
+
if (A) d(f, A);
|
|
1163
1163
|
else {
|
|
1164
|
-
|
|
1165
|
-
for (var T = -1, L =
|
|
1164
|
+
f.state = m, f.outcome = v;
|
|
1165
|
+
for (var T = -1, L = f.queue.length; ++T < L; ) f.queue[T].callFulfilled(v);
|
|
1166
1166
|
}
|
|
1167
|
-
return
|
|
1168
|
-
}, s.reject = function(
|
|
1169
|
-
|
|
1170
|
-
for (var E = -1, A =
|
|
1171
|
-
return
|
|
1172
|
-
}, y.resolve = function(
|
|
1173
|
-
return
|
|
1174
|
-
}, y.reject = function(
|
|
1167
|
+
return f;
|
|
1168
|
+
}, s.reject = function(f, v) {
|
|
1169
|
+
f.state = c, f.outcome = v;
|
|
1170
|
+
for (var E = -1, A = f.queue.length; ++E < A; ) f.queue[E].callRejected(v);
|
|
1171
|
+
return f;
|
|
1172
|
+
}, y.resolve = function(f) {
|
|
1173
|
+
return f instanceof this ? f : s.resolve(new this(o), f);
|
|
1174
|
+
}, y.reject = function(f) {
|
|
1175
1175
|
var v = new this(o);
|
|
1176
|
-
return s.reject(v,
|
|
1177
|
-
}, y.all = function(
|
|
1176
|
+
return s.reject(v, f);
|
|
1177
|
+
}, y.all = function(f) {
|
|
1178
1178
|
var v = this;
|
|
1179
|
-
if (Object.prototype.toString.call(
|
|
1180
|
-
var E =
|
|
1179
|
+
if (Object.prototype.toString.call(f) !== "[object Array]") return this.reject(new TypeError("must be an array"));
|
|
1180
|
+
var E = f.length, A = !1;
|
|
1181
1181
|
if (!E) return this.resolve([]);
|
|
1182
|
-
for (var T = new Array(E), L = 0, B = -1, j = new this(o); ++B < E; ) z(
|
|
1182
|
+
for (var T = new Array(E), L = 0, B = -1, j = new this(o); ++B < E; ) z(f[B], B);
|
|
1183
1183
|
return j;
|
|
1184
1184
|
function z(Z, Q) {
|
|
1185
1185
|
v.resolve(Z).then(function(k) {
|
|
@@ -1188,12 +1188,12 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1188
1188
|
A || (A = !0, s.reject(j, k));
|
|
1189
1189
|
});
|
|
1190
1190
|
}
|
|
1191
|
-
}, y.race = function(
|
|
1191
|
+
}, y.race = function(f) {
|
|
1192
1192
|
var v = this;
|
|
1193
|
-
if (Object.prototype.toString.call(
|
|
1194
|
-
var E =
|
|
1193
|
+
if (Object.prototype.toString.call(f) !== "[object Array]") return this.reject(new TypeError("must be an array"));
|
|
1194
|
+
var E = f.length, A = !1;
|
|
1195
1195
|
if (!E) return this.resolve([]);
|
|
1196
|
-
for (var T = -1, L = new this(o); ++T < E; ) B =
|
|
1196
|
+
for (var T = -1, L = new this(o); ++T < E; ) B = f[T], v.resolve(B).then(function(j) {
|
|
1197
1197
|
A || (A = !0, s.resolve(L, j));
|
|
1198
1198
|
}, function(j) {
|
|
1199
1199
|
A || (A = !0, s.reject(L, j));
|
|
@@ -1205,68 +1205,68 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1205
1205
|
var a = {};
|
|
1206
1206
|
(0, t("./lib/utils/common").assign)(a, t("./lib/deflate"), t("./lib/inflate"), t("./lib/zlib/constants")), r.exports = a;
|
|
1207
1207
|
}, { "./lib/deflate": 39, "./lib/inflate": 40, "./lib/utils/common": 41, "./lib/zlib/constants": 44 }], 39: [function(t, r, n) {
|
|
1208
|
-
var a = t("./zlib/deflate"), o = t("./utils/common"), s = t("./utils/strings"), c = t("./zlib/messages"),
|
|
1209
|
-
function d(
|
|
1210
|
-
if (!(this instanceof d)) return new d(
|
|
1211
|
-
this.options = o.assign({ level:
|
|
1208
|
+
var a = t("./zlib/deflate"), o = t("./utils/common"), s = t("./utils/strings"), c = t("./zlib/messages"), m = t("./zlib/zstream"), u = Object.prototype.toString, y = 0, p = -1, h = 0, b = 8;
|
|
1209
|
+
function d(f) {
|
|
1210
|
+
if (!(this instanceof d)) return new d(f);
|
|
1211
|
+
this.options = o.assign({ level: p, method: b, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: h, to: "" }, f || {});
|
|
1212
1212
|
var v = this.options;
|
|
1213
|
-
v.raw && 0 < v.windowBits ? v.windowBits = -v.windowBits : v.gzip && 0 < v.windowBits && v.windowBits < 16 && (v.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new
|
|
1213
|
+
v.raw && 0 < v.windowBits ? v.windowBits = -v.windowBits : v.gzip && 0 < v.windowBits && v.windowBits < 16 && (v.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new m(), this.strm.avail_out = 0;
|
|
1214
1214
|
var E = a.deflateInit2(this.strm, v.level, v.method, v.windowBits, v.memLevel, v.strategy);
|
|
1215
1215
|
if (E !== y) throw new Error(c[E]);
|
|
1216
1216
|
if (v.header && a.deflateSetHeader(this.strm, v.header), v.dictionary) {
|
|
1217
1217
|
var A;
|
|
1218
|
-
if (A = typeof v.dictionary == "string" ? s.string2buf(v.dictionary) :
|
|
1218
|
+
if (A = typeof v.dictionary == "string" ? s.string2buf(v.dictionary) : u.call(v.dictionary) === "[object ArrayBuffer]" ? new Uint8Array(v.dictionary) : v.dictionary, (E = a.deflateSetDictionary(this.strm, A)) !== y) throw new Error(c[E]);
|
|
1219
1219
|
this._dict_set = !0;
|
|
1220
1220
|
}
|
|
1221
1221
|
}
|
|
1222
|
-
function _(
|
|
1222
|
+
function _(f, v) {
|
|
1223
1223
|
var E = new d(v);
|
|
1224
|
-
if (E.push(
|
|
1224
|
+
if (E.push(f, !0), E.err) throw E.msg || c[E.err];
|
|
1225
1225
|
return E.result;
|
|
1226
1226
|
}
|
|
1227
|
-
d.prototype.push = function(
|
|
1227
|
+
d.prototype.push = function(f, v) {
|
|
1228
1228
|
var E, A, T = this.strm, L = this.options.chunkSize;
|
|
1229
1229
|
if (this.ended) return !1;
|
|
1230
|
-
A = v === ~~v ? v : v === !0 ? 4 : 0, typeof
|
|
1230
|
+
A = v === ~~v ? v : v === !0 ? 4 : 0, typeof f == "string" ? T.input = s.string2buf(f) : u.call(f) === "[object ArrayBuffer]" ? T.input = new Uint8Array(f) : T.input = f, T.next_in = 0, T.avail_in = T.input.length;
|
|
1231
1231
|
do {
|
|
1232
1232
|
if (T.avail_out === 0 && (T.output = new o.Buf8(L), T.next_out = 0, T.avail_out = L), (E = a.deflate(T, A)) !== 1 && E !== y) return this.onEnd(E), !(this.ended = !0);
|
|
1233
1233
|
T.avail_out !== 0 && (T.avail_in !== 0 || A !== 4 && A !== 2) || (this.options.to === "string" ? this.onData(s.buf2binstring(o.shrinkBuf(T.output, T.next_out))) : this.onData(o.shrinkBuf(T.output, T.next_out)));
|
|
1234
1234
|
} while ((0 < T.avail_in || T.avail_out === 0) && E !== 1);
|
|
1235
1235
|
return A === 4 ? (E = a.deflateEnd(this.strm), this.onEnd(E), this.ended = !0, E === y) : A !== 2 || (this.onEnd(y), !(T.avail_out = 0));
|
|
1236
|
-
}, d.prototype.onData = function(
|
|
1237
|
-
this.chunks.push(
|
|
1238
|
-
}, d.prototype.onEnd = function(
|
|
1239
|
-
|
|
1240
|
-
}, n.Deflate = d, n.deflate = _, n.deflateRaw = function(
|
|
1241
|
-
return (v = v || {}).raw = !0, _(
|
|
1242
|
-
}, n.gzip = function(
|
|
1243
|
-
return (v = v || {}).gzip = !0, _(
|
|
1236
|
+
}, d.prototype.onData = function(f) {
|
|
1237
|
+
this.chunks.push(f);
|
|
1238
|
+
}, d.prototype.onEnd = function(f) {
|
|
1239
|
+
f === y && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = f, this.msg = this.strm.msg;
|
|
1240
|
+
}, n.Deflate = d, n.deflate = _, n.deflateRaw = function(f, v) {
|
|
1241
|
+
return (v = v || {}).raw = !0, _(f, v);
|
|
1242
|
+
}, n.gzip = function(f, v) {
|
|
1243
|
+
return (v = v || {}).gzip = !0, _(f, v);
|
|
1244
1244
|
};
|
|
1245
1245
|
}, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function(t, r, n) {
|
|
1246
|
-
var a = t("./zlib/inflate"), o = t("./utils/common"), s = t("./utils/strings"), c = t("./zlib/constants"),
|
|
1246
|
+
var a = t("./zlib/inflate"), o = t("./utils/common"), s = t("./utils/strings"), c = t("./zlib/constants"), m = t("./zlib/messages"), u = t("./zlib/zstream"), y = t("./zlib/gzheader"), p = Object.prototype.toString;
|
|
1247
1247
|
function h(d) {
|
|
1248
1248
|
if (!(this instanceof h)) return new h(d);
|
|
1249
1249
|
this.options = o.assign({ chunkSize: 16384, windowBits: 0, to: "" }, d || {});
|
|
1250
1250
|
var _ = this.options;
|
|
1251
|
-
_.raw && 0 <= _.windowBits && _.windowBits < 16 && (_.windowBits = -_.windowBits, _.windowBits === 0 && (_.windowBits = -15)), !(0 <= _.windowBits && _.windowBits < 16) || d && d.windowBits || (_.windowBits += 32), 15 < _.windowBits && _.windowBits < 48 && !(15 & _.windowBits) && (_.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new
|
|
1252
|
-
var
|
|
1253
|
-
if (
|
|
1251
|
+
_.raw && 0 <= _.windowBits && _.windowBits < 16 && (_.windowBits = -_.windowBits, _.windowBits === 0 && (_.windowBits = -15)), !(0 <= _.windowBits && _.windowBits < 16) || d && d.windowBits || (_.windowBits += 32), 15 < _.windowBits && _.windowBits < 48 && !(15 & _.windowBits) && (_.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new u(), this.strm.avail_out = 0;
|
|
1252
|
+
var f = a.inflateInit2(this.strm, _.windowBits);
|
|
1253
|
+
if (f !== c.Z_OK) throw new Error(m[f]);
|
|
1254
1254
|
this.header = new y(), a.inflateGetHeader(this.strm, this.header);
|
|
1255
1255
|
}
|
|
1256
1256
|
function b(d, _) {
|
|
1257
|
-
var
|
|
1258
|
-
if (
|
|
1259
|
-
return
|
|
1257
|
+
var f = new h(_);
|
|
1258
|
+
if (f.push(d, !0), f.err) throw f.msg || m[f.err];
|
|
1259
|
+
return f.result;
|
|
1260
1260
|
}
|
|
1261
1261
|
h.prototype.push = function(d, _) {
|
|
1262
|
-
var
|
|
1262
|
+
var f, v, E, A, T, L, B = this.strm, j = this.options.chunkSize, z = this.options.dictionary, Z = !1;
|
|
1263
1263
|
if (this.ended) return !1;
|
|
1264
|
-
v = _ === ~~_ ? _ : _ === !0 ? c.Z_FINISH : c.Z_NO_FLUSH, typeof d == "string" ? B.input = s.binstring2buf(d) :
|
|
1264
|
+
v = _ === ~~_ ? _ : _ === !0 ? c.Z_FINISH : c.Z_NO_FLUSH, typeof d == "string" ? B.input = s.binstring2buf(d) : p.call(d) === "[object ArrayBuffer]" ? B.input = new Uint8Array(d) : B.input = d, B.next_in = 0, B.avail_in = B.input.length;
|
|
1265
1265
|
do {
|
|
1266
|
-
if (B.avail_out === 0 && (B.output = new o.Buf8(j), B.next_out = 0, B.avail_out = j), (
|
|
1267
|
-
B.next_out && (B.avail_out !== 0 &&
|
|
1268
|
-
} while ((0 < B.avail_in || B.avail_out === 0) &&
|
|
1269
|
-
return
|
|
1266
|
+
if (B.avail_out === 0 && (B.output = new o.Buf8(j), B.next_out = 0, B.avail_out = j), (f = a.inflate(B, c.Z_NO_FLUSH)) === c.Z_NEED_DICT && z && (L = typeof z == "string" ? s.string2buf(z) : p.call(z) === "[object ArrayBuffer]" ? new Uint8Array(z) : z, f = a.inflateSetDictionary(this.strm, L)), f === c.Z_BUF_ERROR && Z === !0 && (f = c.Z_OK, Z = !1), f !== c.Z_STREAM_END && f !== c.Z_OK) return this.onEnd(f), !(this.ended = !0);
|
|
1267
|
+
B.next_out && (B.avail_out !== 0 && f !== c.Z_STREAM_END && (B.avail_in !== 0 || v !== c.Z_FINISH && v !== c.Z_SYNC_FLUSH) || (this.options.to === "string" ? (E = s.utf8border(B.output, B.next_out), A = B.next_out - E, T = s.buf2string(B.output, E), B.next_out = A, B.avail_out = j - A, A && o.arraySet(B.output, B.output, E, A, 0), this.onData(T)) : this.onData(o.shrinkBuf(B.output, B.next_out)))), B.avail_in === 0 && B.avail_out === 0 && (Z = !0);
|
|
1268
|
+
} while ((0 < B.avail_in || B.avail_out === 0) && f !== c.Z_STREAM_END);
|
|
1269
|
+
return f === c.Z_STREAM_END && (v = c.Z_FINISH), v === c.Z_FINISH ? (f = a.inflateEnd(this.strm), this.onEnd(f), this.ended = !0, f === c.Z_OK) : v !== c.Z_SYNC_FLUSH || (this.onEnd(c.Z_OK), !(B.avail_out = 0));
|
|
1270
1270
|
}, h.prototype.onData = function(d) {
|
|
1271
1271
|
this.chunks.push(d);
|
|
1272
1272
|
}, h.prototype.onEnd = function(d) {
|
|
@@ -1277,27 +1277,27 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1277
1277
|
}, { "./utils/common": 41, "./utils/strings": 42, "./zlib/constants": 44, "./zlib/gzheader": 47, "./zlib/inflate": 49, "./zlib/messages": 51, "./zlib/zstream": 53 }], 41: [function(t, r, n) {
|
|
1278
1278
|
var a = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u";
|
|
1279
1279
|
n.assign = function(c) {
|
|
1280
|
-
for (var
|
|
1281
|
-
var
|
|
1282
|
-
if (
|
|
1283
|
-
if (typeof
|
|
1284
|
-
for (var y in
|
|
1280
|
+
for (var m = Array.prototype.slice.call(arguments, 1); m.length; ) {
|
|
1281
|
+
var u = m.shift();
|
|
1282
|
+
if (u) {
|
|
1283
|
+
if (typeof u != "object") throw new TypeError(u + "must be non-object");
|
|
1284
|
+
for (var y in u) u.hasOwnProperty(y) && (c[y] = u[y]);
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
1287
|
return c;
|
|
1288
|
-
}, n.shrinkBuf = function(c,
|
|
1289
|
-
return c.length ===
|
|
1288
|
+
}, n.shrinkBuf = function(c, m) {
|
|
1289
|
+
return c.length === m ? c : c.subarray ? c.subarray(0, m) : (c.length = m, c);
|
|
1290
1290
|
};
|
|
1291
|
-
var o = { arraySet: function(c,
|
|
1292
|
-
if (
|
|
1293
|
-
else for (var h = 0; h < y; h++) c[
|
|
1291
|
+
var o = { arraySet: function(c, m, u, y, p) {
|
|
1292
|
+
if (m.subarray && c.subarray) c.set(m.subarray(u, u + y), p);
|
|
1293
|
+
else for (var h = 0; h < y; h++) c[p + h] = m[u + h];
|
|
1294
1294
|
}, flattenChunks: function(c) {
|
|
1295
|
-
var
|
|
1296
|
-
for (
|
|
1297
|
-
for (b = new Uint8Array(y),
|
|
1295
|
+
var m, u, y, p, h, b;
|
|
1296
|
+
for (m = y = 0, u = c.length; m < u; m++) y += c[m].length;
|
|
1297
|
+
for (b = new Uint8Array(y), m = p = 0, u = c.length; m < u; m++) h = c[m], b.set(h, p), p += h.length;
|
|
1298
1298
|
return b;
|
|
1299
|
-
} }, s = { arraySet: function(c,
|
|
1300
|
-
for (var h = 0; h < y; h++) c[
|
|
1299
|
+
} }, s = { arraySet: function(c, m, u, y, p) {
|
|
1300
|
+
for (var h = 0; h < y; h++) c[p + h] = m[u + h];
|
|
1301
1301
|
}, flattenChunks: function(c) {
|
|
1302
1302
|
return [].concat.apply([], c);
|
|
1303
1303
|
} };
|
|
@@ -1316,43 +1316,43 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1316
1316
|
} catch {
|
|
1317
1317
|
s = !1;
|
|
1318
1318
|
}
|
|
1319
|
-
for (var c = new a.Buf8(256),
|
|
1320
|
-
function
|
|
1321
|
-
if (
|
|
1322
|
-
for (var h = "", b = 0; b <
|
|
1319
|
+
for (var c = new a.Buf8(256), m = 0; m < 256; m++) c[m] = 252 <= m ? 6 : 248 <= m ? 5 : 240 <= m ? 4 : 224 <= m ? 3 : 192 <= m ? 2 : 1;
|
|
1320
|
+
function u(y, p) {
|
|
1321
|
+
if (p < 65537 && (y.subarray && s || !y.subarray && o)) return String.fromCharCode.apply(null, a.shrinkBuf(y, p));
|
|
1322
|
+
for (var h = "", b = 0; b < p; b++) h += String.fromCharCode(y[b]);
|
|
1323
1323
|
return h;
|
|
1324
1324
|
}
|
|
1325
1325
|
c[254] = c[254] = 1, n.string2buf = function(y) {
|
|
1326
|
-
var
|
|
1327
|
-
for (d = 0; d <
|
|
1328
|
-
for (
|
|
1329
|
-
return
|
|
1326
|
+
var p, h, b, d, _, f = y.length, v = 0;
|
|
1327
|
+
for (d = 0; d < f; d++) (64512 & (h = y.charCodeAt(d))) == 55296 && d + 1 < f && (64512 & (b = y.charCodeAt(d + 1))) == 56320 && (h = 65536 + (h - 55296 << 10) + (b - 56320), d++), v += h < 128 ? 1 : h < 2048 ? 2 : h < 65536 ? 3 : 4;
|
|
1328
|
+
for (p = new a.Buf8(v), d = _ = 0; _ < v; d++) (64512 & (h = y.charCodeAt(d))) == 55296 && d + 1 < f && (64512 & (b = y.charCodeAt(d + 1))) == 56320 && (h = 65536 + (h - 55296 << 10) + (b - 56320), d++), h < 128 ? p[_++] = h : (h < 2048 ? p[_++] = 192 | h >>> 6 : (h < 65536 ? p[_++] = 224 | h >>> 12 : (p[_++] = 240 | h >>> 18, p[_++] = 128 | h >>> 12 & 63), p[_++] = 128 | h >>> 6 & 63), p[_++] = 128 | 63 & h);
|
|
1329
|
+
return p;
|
|
1330
1330
|
}, n.buf2binstring = function(y) {
|
|
1331
|
-
return
|
|
1331
|
+
return u(y, y.length);
|
|
1332
1332
|
}, n.binstring2buf = function(y) {
|
|
1333
|
-
for (var
|
|
1334
|
-
return
|
|
1335
|
-
}, n.buf2string = function(y,
|
|
1336
|
-
var h, b, d, _,
|
|
1337
|
-
for (h = b = 0; h <
|
|
1333
|
+
for (var p = new a.Buf8(y.length), h = 0, b = p.length; h < b; h++) p[h] = y.charCodeAt(h);
|
|
1334
|
+
return p;
|
|
1335
|
+
}, n.buf2string = function(y, p) {
|
|
1336
|
+
var h, b, d, _, f = p || y.length, v = new Array(2 * f);
|
|
1337
|
+
for (h = b = 0; h < f; ) if ((d = y[h++]) < 128) v[b++] = d;
|
|
1338
1338
|
else if (4 < (_ = c[d])) v[b++] = 65533, h += _ - 1;
|
|
1339
1339
|
else {
|
|
1340
|
-
for (d &= _ === 2 ? 31 : _ === 3 ? 15 : 7; 1 < _ && h <
|
|
1340
|
+
for (d &= _ === 2 ? 31 : _ === 3 ? 15 : 7; 1 < _ && h < f; ) d = d << 6 | 63 & y[h++], _--;
|
|
1341
1341
|
1 < _ ? v[b++] = 65533 : d < 65536 ? v[b++] = d : (d -= 65536, v[b++] = 55296 | d >> 10 & 1023, v[b++] = 56320 | 1023 & d);
|
|
1342
1342
|
}
|
|
1343
|
-
return
|
|
1344
|
-
}, n.utf8border = function(y,
|
|
1343
|
+
return u(v, b);
|
|
1344
|
+
}, n.utf8border = function(y, p) {
|
|
1345
1345
|
var h;
|
|
1346
|
-
for ((
|
|
1347
|
-
return h < 0 || h === 0 ?
|
|
1346
|
+
for ((p = p || y.length) > y.length && (p = y.length), h = p - 1; 0 <= h && (192 & y[h]) == 128; ) h--;
|
|
1347
|
+
return h < 0 || h === 0 ? p : h + c[y[h]] > p ? h : p;
|
|
1348
1348
|
};
|
|
1349
1349
|
}, { "./common": 41 }], 43: [function(t, r, n) {
|
|
1350
1350
|
r.exports = function(a, o, s, c) {
|
|
1351
|
-
for (var
|
|
1352
|
-
for (s -= y = 2e3 < s ? 2e3 : s;
|
|
1353
|
-
|
|
1351
|
+
for (var m = 65535 & a | 0, u = a >>> 16 & 65535 | 0, y = 0; s !== 0; ) {
|
|
1352
|
+
for (s -= y = 2e3 < s ? 2e3 : s; u = u + (m = m + o[c++] | 0) | 0, --y; ) ;
|
|
1353
|
+
m %= 65521, u %= 65521;
|
|
1354
1354
|
}
|
|
1355
|
-
return
|
|
1355
|
+
return m | u << 16 | 0;
|
|
1356
1356
|
};
|
|
1357
1357
|
}, {}], 44: [function(t, r, n) {
|
|
1358
1358
|
r.exports = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 };
|
|
@@ -1360,21 +1360,21 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1360
1360
|
var a = function() {
|
|
1361
1361
|
for (var o, s = [], c = 0; c < 256; c++) {
|
|
1362
1362
|
o = c;
|
|
1363
|
-
for (var
|
|
1363
|
+
for (var m = 0; m < 8; m++) o = 1 & o ? 3988292384 ^ o >>> 1 : o >>> 1;
|
|
1364
1364
|
s[c] = o;
|
|
1365
1365
|
}
|
|
1366
1366
|
return s;
|
|
1367
1367
|
}();
|
|
1368
|
-
r.exports = function(o, s, c,
|
|
1369
|
-
var
|
|
1368
|
+
r.exports = function(o, s, c, m) {
|
|
1369
|
+
var u = a, y = m + c;
|
|
1370
1370
|
o ^= -1;
|
|
1371
|
-
for (var
|
|
1371
|
+
for (var p = m; p < y; p++) o = o >>> 8 ^ u[255 & (o ^ s[p])];
|
|
1372
1372
|
return -1 ^ o;
|
|
1373
1373
|
};
|
|
1374
1374
|
}, {}], 46: [function(t, r, n) {
|
|
1375
|
-
var a, o = t("../utils/common"), s = t("./trees"), c = t("./adler32"),
|
|
1375
|
+
var a, o = t("../utils/common"), s = t("./trees"), c = t("./adler32"), m = t("./crc32"), u = t("./messages"), y = 0, p = 4, h = 0, b = -2, d = -1, _ = 4, f = 2, v = 8, E = 9, A = 286, T = 30, L = 19, B = 2 * A + 1, j = 15, z = 3, Z = 258, Q = Z + z + 1, k = 42, N = 113, l = 1, D = 2, et = 3, U = 4;
|
|
1376
1376
|
function rt(i, O) {
|
|
1377
|
-
return i.msg =
|
|
1377
|
+
return i.msg = u[O], O;
|
|
1378
1378
|
}
|
|
1379
1379
|
function W(i) {
|
|
1380
1380
|
return (i << 1) - (4 < i ? 9 : 0);
|
|
@@ -1421,7 +1421,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1421
1421
|
g += G;
|
|
1422
1422
|
}
|
|
1423
1423
|
if (i.strm.avail_in === 0) break;
|
|
1424
|
-
if (M = i.strm, $ = i.window, R = i.strstart + i.lookahead, H = g, q = void 0, q = M.avail_in, H < q && (q = H), P = q === 0 ? 0 : (M.avail_in -= q, o.arraySet($, M.input, M.next_in, q, R), M.state.wrap === 1 ? M.adler = c(M.adler, $, q, R) : M.state.wrap === 2 && (M.adler =
|
|
1424
|
+
if (M = i.strm, $ = i.window, R = i.strstart + i.lookahead, H = g, q = void 0, q = M.avail_in, H < q && (q = H), P = q === 0 ? 0 : (M.avail_in -= q, o.arraySet($, M.input, M.next_in, q, R), M.state.wrap === 1 ? M.adler = c(M.adler, $, q, R) : M.state.wrap === 2 && (M.adler = m(M.adler, $, q, R)), M.next_in += q, M.total_in += q, q), i.lookahead += P, i.lookahead + i.insert >= z) for (S = i.strstart - i.insert, i.ins_h = i.window[S], i.ins_h = (i.ins_h << i.hash_shift ^ i.window[S + 1]) & i.hash_mask; i.insert && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[S + z - 1]) & i.hash_mask, i.prev[S & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = S, S++, i.insert--, !(i.lookahead + i.insert < z)); ) ;
|
|
1425
1425
|
} while (i.lookahead < Q && i.strm.avail_in !== 0);
|
|
1426
1426
|
}
|
|
1427
1427
|
function ut(i, O) {
|
|
@@ -1437,7 +1437,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1437
1437
|
else w = s._tr_tally(i, 0, i.window[i.strstart]), i.lookahead--, i.strstart++;
|
|
1438
1438
|
if (w && (I(i, !1), i.strm.avail_out === 0)) return l;
|
|
1439
1439
|
}
|
|
1440
|
-
return i.insert = i.strstart < z - 1 ? i.strstart : z - 1, O ===
|
|
1440
|
+
return i.insert = i.strstart < z - 1 ? i.strstart : z - 1, O === p ? (I(i, !0), i.strm.avail_out === 0 ? et : U) : i.last_lit && (I(i, !1), i.strm.avail_out === 0) ? l : D;
|
|
1441
1441
|
}
|
|
1442
1442
|
function it(i, O) {
|
|
1443
1443
|
for (var P, w, g; ; ) {
|
|
@@ -1452,7 +1452,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1452
1452
|
if ((w = s._tr_tally(i, 0, i.window[i.strstart - 1])) && I(i, !1), i.strstart++, i.lookahead--, i.strm.avail_out === 0) return l;
|
|
1453
1453
|
} else i.match_available = 1, i.strstart++, i.lookahead--;
|
|
1454
1454
|
}
|
|
1455
|
-
return i.match_available && (w = s._tr_tally(i, 0, i.window[i.strstart - 1]), i.match_available = 0), i.insert = i.strstart < z - 1 ? i.strstart : z - 1, O ===
|
|
1455
|
+
return i.match_available && (w = s._tr_tally(i, 0, i.window[i.strstart - 1]), i.match_available = 0), i.insert = i.strstart < z - 1 ? i.strstart : z - 1, O === p ? (I(i, !0), i.strm.avail_out === 0 ? et : U) : i.last_lit && (I(i, !1), i.strm.avail_out === 0) ? l : D;
|
|
1456
1456
|
}
|
|
1457
1457
|
function at(i, O, P, w, g) {
|
|
1458
1458
|
this.good_length = i, this.max_lazy = O, this.nice_length = P, this.max_chain = w, this.func = g;
|
|
@@ -1462,7 +1462,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1462
1462
|
}
|
|
1463
1463
|
function ct(i) {
|
|
1464
1464
|
var O;
|
|
1465
|
-
return i && i.state ? (i.total_in = i.total_out = 0, i.data_type =
|
|
1465
|
+
return i && i.state ? (i.total_in = i.total_out = 0, i.data_type = f, (O = i.state).pending = 0, O.pending_out = 0, O.wrap < 0 && (O.wrap = -O.wrap), O.status = O.wrap ? k : N, i.adler = O.wrap === 2 ? 0 : 1, O.last_flush = y, s._tr_init(O), h) : rt(i, b);
|
|
1466
1466
|
}
|
|
1467
1467
|
function bt(i) {
|
|
1468
1468
|
var O = ct(i);
|
|
@@ -1489,7 +1489,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1489
1489
|
var w = i.block_start + P;
|
|
1490
1490
|
if ((i.strstart === 0 || i.strstart >= w) && (i.lookahead = i.strstart - w, i.strstart = w, I(i, !1), i.strm.avail_out === 0) || i.strstart - i.block_start >= i.w_size - Q && (I(i, !1), i.strm.avail_out === 0)) return l;
|
|
1491
1491
|
}
|
|
1492
|
-
return i.insert = 0, O ===
|
|
1492
|
+
return i.insert = 0, O === p ? (I(i, !0), i.strm.avail_out === 0 ? et : U) : (i.strstart > i.block_start && (I(i, !1), i.strm.avail_out), l);
|
|
1493
1493
|
}), new at(4, 4, 8, 4, ut), new at(4, 5, 16, 8, ut), new at(4, 6, 32, 32, ut), new at(4, 4, 16, 16, it), new at(8, 16, 32, 32, it), new at(8, 16, 128, 128, it), new at(8, 32, 128, 256, it), new at(32, 128, 258, 1024, it), new at(32, 258, 258, 4096, it)], n.deflateInit = function(i, O) {
|
|
1494
1494
|
return pt(i, O, v, 15, 8, 0);
|
|
1495
1495
|
}, n.deflateInit2 = pt, n.deflateReset = bt, n.deflateResetKeep = ct, n.deflateSetHeader = function(i, O) {
|
|
@@ -1497,41 +1497,41 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1497
1497
|
}, n.deflate = function(i, O) {
|
|
1498
1498
|
var P, w, g, S;
|
|
1499
1499
|
if (!i || !i.state || 5 < O || O < 0) return i ? rt(i, b) : b;
|
|
1500
|
-
if (w = i.state, !i.output || !i.input && i.avail_in !== 0 || w.status === 666 && O !==
|
|
1501
|
-
if (w.strm = i, P = w.last_flush, w.last_flush = O, w.status === k) if (w.wrap === 2) i.adler = 0, J(w, 31), J(w, 139), J(w, 8), w.gzhead ? (J(w, (w.gzhead.text ? 1 : 0) + (w.gzhead.hcrc ? 2 : 0) + (w.gzhead.extra ? 4 : 0) + (w.gzhead.name ? 8 : 0) + (w.gzhead.comment ? 16 : 0)), J(w, 255 & w.gzhead.time), J(w, w.gzhead.time >> 8 & 255), J(w, w.gzhead.time >> 16 & 255), J(w, w.gzhead.time >> 24 & 255), J(w, w.level === 9 ? 2 : 2 <= w.strategy || w.level < 2 ? 4 : 0), J(w, 255 & w.gzhead.os), w.gzhead.extra && w.gzhead.extra.length && (J(w, 255 & w.gzhead.extra.length), J(w, w.gzhead.extra.length >> 8 & 255)), w.gzhead.hcrc && (i.adler =
|
|
1500
|
+
if (w = i.state, !i.output || !i.input && i.avail_in !== 0 || w.status === 666 && O !== p) return rt(i, i.avail_out === 0 ? -5 : b);
|
|
1501
|
+
if (w.strm = i, P = w.last_flush, w.last_flush = O, w.status === k) if (w.wrap === 2) i.adler = 0, J(w, 31), J(w, 139), J(w, 8), w.gzhead ? (J(w, (w.gzhead.text ? 1 : 0) + (w.gzhead.hcrc ? 2 : 0) + (w.gzhead.extra ? 4 : 0) + (w.gzhead.name ? 8 : 0) + (w.gzhead.comment ? 16 : 0)), J(w, 255 & w.gzhead.time), J(w, w.gzhead.time >> 8 & 255), J(w, w.gzhead.time >> 16 & 255), J(w, w.gzhead.time >> 24 & 255), J(w, w.level === 9 ? 2 : 2 <= w.strategy || w.level < 2 ? 4 : 0), J(w, 255 & w.gzhead.os), w.gzhead.extra && w.gzhead.extra.length && (J(w, 255 & w.gzhead.extra.length), J(w, w.gzhead.extra.length >> 8 & 255)), w.gzhead.hcrc && (i.adler = m(i.adler, w.pending_buf, w.pending, 0)), w.gzindex = 0, w.status = 69) : (J(w, 0), J(w, 0), J(w, 0), J(w, 0), J(w, 0), J(w, w.level === 9 ? 2 : 2 <= w.strategy || w.level < 2 ? 4 : 0), J(w, 3), w.status = N);
|
|
1502
1502
|
else {
|
|
1503
1503
|
var M = v + (w.w_bits - 8 << 4) << 8;
|
|
1504
1504
|
M |= (2 <= w.strategy || w.level < 2 ? 0 : w.level < 6 ? 1 : w.level === 6 ? 2 : 3) << 6, w.strstart !== 0 && (M |= 32), M += 31 - M % 31, w.status = N, Y(w, M), w.strstart !== 0 && (Y(w, i.adler >>> 16), Y(w, 65535 & i.adler)), i.adler = 1;
|
|
1505
1505
|
}
|
|
1506
1506
|
if (w.status === 69) if (w.gzhead.extra) {
|
|
1507
|
-
for (g = w.pending; w.gzindex < (65535 & w.gzhead.extra.length) && (w.pending !== w.pending_buf_size || (w.gzhead.hcrc && w.pending > g && (i.adler =
|
|
1508
|
-
w.gzhead.hcrc && w.pending > g && (i.adler =
|
|
1507
|
+
for (g = w.pending; w.gzindex < (65535 & w.gzhead.extra.length) && (w.pending !== w.pending_buf_size || (w.gzhead.hcrc && w.pending > g && (i.adler = m(i.adler, w.pending_buf, w.pending - g, g)), F(i), g = w.pending, w.pending !== w.pending_buf_size)); ) J(w, 255 & w.gzhead.extra[w.gzindex]), w.gzindex++;
|
|
1508
|
+
w.gzhead.hcrc && w.pending > g && (i.adler = m(i.adler, w.pending_buf, w.pending - g, g)), w.gzindex === w.gzhead.extra.length && (w.gzindex = 0, w.status = 73);
|
|
1509
1509
|
} else w.status = 73;
|
|
1510
1510
|
if (w.status === 73) if (w.gzhead.name) {
|
|
1511
1511
|
g = w.pending;
|
|
1512
1512
|
do {
|
|
1513
|
-
if (w.pending === w.pending_buf_size && (w.gzhead.hcrc && w.pending > g && (i.adler =
|
|
1513
|
+
if (w.pending === w.pending_buf_size && (w.gzhead.hcrc && w.pending > g && (i.adler = m(i.adler, w.pending_buf, w.pending - g, g)), F(i), g = w.pending, w.pending === w.pending_buf_size)) {
|
|
1514
1514
|
S = 1;
|
|
1515
1515
|
break;
|
|
1516
1516
|
}
|
|
1517
1517
|
S = w.gzindex < w.gzhead.name.length ? 255 & w.gzhead.name.charCodeAt(w.gzindex++) : 0, J(w, S);
|
|
1518
1518
|
} while (S !== 0);
|
|
1519
|
-
w.gzhead.hcrc && w.pending > g && (i.adler =
|
|
1519
|
+
w.gzhead.hcrc && w.pending > g && (i.adler = m(i.adler, w.pending_buf, w.pending - g, g)), S === 0 && (w.gzindex = 0, w.status = 91);
|
|
1520
1520
|
} else w.status = 91;
|
|
1521
1521
|
if (w.status === 91) if (w.gzhead.comment) {
|
|
1522
1522
|
g = w.pending;
|
|
1523
1523
|
do {
|
|
1524
|
-
if (w.pending === w.pending_buf_size && (w.gzhead.hcrc && w.pending > g && (i.adler =
|
|
1524
|
+
if (w.pending === w.pending_buf_size && (w.gzhead.hcrc && w.pending > g && (i.adler = m(i.adler, w.pending_buf, w.pending - g, g)), F(i), g = w.pending, w.pending === w.pending_buf_size)) {
|
|
1525
1525
|
S = 1;
|
|
1526
1526
|
break;
|
|
1527
1527
|
}
|
|
1528
1528
|
S = w.gzindex < w.gzhead.comment.length ? 255 & w.gzhead.comment.charCodeAt(w.gzindex++) : 0, J(w, S);
|
|
1529
1529
|
} while (S !== 0);
|
|
1530
|
-
w.gzhead.hcrc && w.pending > g && (i.adler =
|
|
1530
|
+
w.gzhead.hcrc && w.pending > g && (i.adler = m(i.adler, w.pending_buf, w.pending - g, g)), S === 0 && (w.status = 103);
|
|
1531
1531
|
} else w.status = 103;
|
|
1532
1532
|
if (w.status === 103 && (w.gzhead.hcrc ? (w.pending + 2 > w.pending_buf_size && F(i), w.pending + 2 <= w.pending_buf_size && (J(w, 255 & i.adler), J(w, i.adler >> 8 & 255), i.adler = 0, w.status = N)) : w.status = N), w.pending !== 0) {
|
|
1533
1533
|
if (F(i), i.avail_out === 0) return w.last_flush = -1, h;
|
|
1534
|
-
} else if (i.avail_in === 0 && W(O) <= W(P) && O !==
|
|
1534
|
+
} else if (i.avail_in === 0 && W(O) <= W(P) && O !== p) return rt(i, -5);
|
|
1535
1535
|
if (w.status === 666 && i.avail_in !== 0) return rt(i, -5);
|
|
1536
1536
|
if (i.avail_in !== 0 || w.lookahead !== 0 || O !== y && w.status !== 666) {
|
|
1537
1537
|
var $ = w.strategy === 2 ? function(R, H) {
|
|
@@ -1542,7 +1542,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1542
1542
|
}
|
|
1543
1543
|
if (R.match_length = 0, q = s._tr_tally(R, 0, R.window[R.strstart]), R.lookahead--, R.strstart++, q && (I(R, !1), R.strm.avail_out === 0)) return l;
|
|
1544
1544
|
}
|
|
1545
|
-
return R.insert = 0, H ===
|
|
1545
|
+
return R.insert = 0, H === p ? (I(R, !0), R.strm.avail_out === 0 ? et : U) : R.last_lit && (I(R, !1), R.strm.avail_out === 0) ? l : D;
|
|
1546
1546
|
}(w, O) : w.strategy === 3 ? function(R, H) {
|
|
1547
1547
|
for (var q, G, K, ot, st = R.window; ; ) {
|
|
1548
1548
|
if (R.lookahead <= Z) {
|
|
@@ -1558,12 +1558,12 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1558
1558
|
}
|
|
1559
1559
|
if (R.match_length >= z ? (q = s._tr_tally(R, 1, R.match_length - z), R.lookahead -= R.match_length, R.strstart += R.match_length, R.match_length = 0) : (q = s._tr_tally(R, 0, R.window[R.strstart]), R.lookahead--, R.strstart++), q && (I(R, !1), R.strm.avail_out === 0)) return l;
|
|
1560
1560
|
}
|
|
1561
|
-
return R.insert = 0, H ===
|
|
1561
|
+
return R.insert = 0, H === p ? (I(R, !0), R.strm.avail_out === 0 ? et : U) : R.last_lit && (I(R, !1), R.strm.avail_out === 0) ? l : D;
|
|
1562
1562
|
}(w, O) : a[w.level].func(w, O);
|
|
1563
1563
|
if ($ !== et && $ !== U || (w.status = 666), $ === l || $ === et) return i.avail_out === 0 && (w.last_flush = -1), h;
|
|
1564
1564
|
if ($ === D && (O === 1 ? s._tr_align(w) : O !== 5 && (s._tr_stored_block(w, 0, 0, !1), O === 3 && (tt(w.head), w.lookahead === 0 && (w.strstart = 0, w.block_start = 0, w.insert = 0))), F(i), i.avail_out === 0)) return w.last_flush = -1, h;
|
|
1565
1565
|
}
|
|
1566
|
-
return O !==
|
|
1566
|
+
return O !== p ? h : w.wrap <= 0 ? 1 : (w.wrap === 2 ? (J(w, 255 & i.adler), J(w, i.adler >> 8 & 255), J(w, i.adler >> 16 & 255), J(w, i.adler >> 24 & 255), J(w, 255 & i.total_in), J(w, i.total_in >> 8 & 255), J(w, i.total_in >> 16 & 255), J(w, i.total_in >> 24 & 255)) : (Y(w, i.adler >>> 16), Y(w, 65535 & i.adler)), F(i), 0 < w.wrap && (w.wrap = -w.wrap), w.pending !== 0 ? h : 1);
|
|
1567
1567
|
}, n.deflateEnd = function(i) {
|
|
1568
1568
|
var O;
|
|
1569
1569
|
return i && i.state ? (O = i.state.status) !== k && O !== 69 && O !== 73 && O !== 91 && O !== 103 && O !== N && O !== 666 ? rt(i, b) : (i.state = null, O === N ? rt(i, -3) : h) : b;
|
|
@@ -1582,12 +1582,12 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1582
1582
|
};
|
|
1583
1583
|
}, {}], 48: [function(t, r, n) {
|
|
1584
1584
|
r.exports = function(a, o) {
|
|
1585
|
-
var s, c,
|
|
1586
|
-
s = a.state, c = a.next_in, l = a.input,
|
|
1585
|
+
var s, c, m, u, y, p, h, b, d, _, f, v, E, A, T, L, B, j, z, Z, Q, k, N, l, D;
|
|
1586
|
+
s = a.state, c = a.next_in, l = a.input, m = c + (a.avail_in - 5), u = a.next_out, D = a.output, y = u - (o - a.avail_out), p = u + (a.avail_out - 257), h = s.dmax, b = s.wsize, d = s.whave, _ = s.wnext, f = s.window, v = s.hold, E = s.bits, A = s.lencode, T = s.distcode, L = (1 << s.lenbits) - 1, B = (1 << s.distbits) - 1;
|
|
1587
1587
|
t: do {
|
|
1588
1588
|
E < 15 && (v += l[c++] << E, E += 8, v += l[c++] << E, E += 8), j = A[v & L];
|
|
1589
1589
|
e: for (; ; ) {
|
|
1590
|
-
if (v >>>= z = j >>> 24, E -= z, (z = j >>> 16 & 255) === 0) D[
|
|
1590
|
+
if (v >>>= z = j >>> 24, E -= z, (z = j >>> 16 & 255) === 0) D[u++] = 65535 & j;
|
|
1591
1591
|
else {
|
|
1592
1592
|
if (!(16 & z)) {
|
|
1593
1593
|
if (!(64 & z)) {
|
|
@@ -1615,45 +1615,45 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1615
1615
|
a.msg = "invalid distance too far back", s.mode = 30;
|
|
1616
1616
|
break t;
|
|
1617
1617
|
}
|
|
1618
|
-
if (v >>>= z, E -= z, (z =
|
|
1618
|
+
if (v >>>= z, E -= z, (z = u - y) < Q) {
|
|
1619
1619
|
if (d < (z = Q - z) && s.sane) {
|
|
1620
1620
|
a.msg = "invalid distance too far back", s.mode = 30;
|
|
1621
1621
|
break t;
|
|
1622
1622
|
}
|
|
1623
|
-
if (N =
|
|
1623
|
+
if (N = f, (k = 0) === _) {
|
|
1624
1624
|
if (k += b - z, z < Z) {
|
|
1625
|
-
for (Z -= z; D[
|
|
1626
|
-
k =
|
|
1625
|
+
for (Z -= z; D[u++] = f[k++], --z; ) ;
|
|
1626
|
+
k = u - Q, N = D;
|
|
1627
1627
|
}
|
|
1628
1628
|
} else if (_ < z) {
|
|
1629
1629
|
if (k += b + _ - z, (z -= _) < Z) {
|
|
1630
|
-
for (Z -= z; D[
|
|
1630
|
+
for (Z -= z; D[u++] = f[k++], --z; ) ;
|
|
1631
1631
|
if (k = 0, _ < Z) {
|
|
1632
|
-
for (Z -= z = _; D[
|
|
1633
|
-
k =
|
|
1632
|
+
for (Z -= z = _; D[u++] = f[k++], --z; ) ;
|
|
1633
|
+
k = u - Q, N = D;
|
|
1634
1634
|
}
|
|
1635
1635
|
}
|
|
1636
1636
|
} else if (k += _ - z, z < Z) {
|
|
1637
|
-
for (Z -= z; D[
|
|
1638
|
-
k =
|
|
1637
|
+
for (Z -= z; D[u++] = f[k++], --z; ) ;
|
|
1638
|
+
k = u - Q, N = D;
|
|
1639
1639
|
}
|
|
1640
|
-
for (; 2 < Z; ) D[
|
|
1641
|
-
Z && (D[
|
|
1640
|
+
for (; 2 < Z; ) D[u++] = N[k++], D[u++] = N[k++], D[u++] = N[k++], Z -= 3;
|
|
1641
|
+
Z && (D[u++] = N[k++], 1 < Z && (D[u++] = N[k++]));
|
|
1642
1642
|
} else {
|
|
1643
|
-
for (k =
|
|
1644
|
-
Z && (D[
|
|
1643
|
+
for (k = u - Q; D[u++] = D[k++], D[u++] = D[k++], D[u++] = D[k++], 2 < (Z -= 3); ) ;
|
|
1644
|
+
Z && (D[u++] = D[k++], 1 < Z && (D[u++] = D[k++]));
|
|
1645
1645
|
}
|
|
1646
1646
|
break;
|
|
1647
1647
|
}
|
|
1648
1648
|
}
|
|
1649
1649
|
break;
|
|
1650
1650
|
}
|
|
1651
|
-
} while (c <
|
|
1652
|
-
c -= Z = E >> 3, v &= (1 << (E -= Z << 3)) - 1, a.next_in = c, a.next_out =
|
|
1651
|
+
} while (c < m && u < p);
|
|
1652
|
+
c -= Z = E >> 3, v &= (1 << (E -= Z << 3)) - 1, a.next_in = c, a.next_out = u, a.avail_in = c < m ? m - c + 5 : 5 - (c - m), a.avail_out = u < p ? p - u + 257 : 257 - (u - p), s.hold = v, s.bits = E;
|
|
1653
1653
|
};
|
|
1654
1654
|
}, {}], 49: [function(t, r, n) {
|
|
1655
|
-
var a = t("../utils/common"), o = t("./adler32"), s = t("./crc32"), c = t("./inffast"),
|
|
1656
|
-
function
|
|
1655
|
+
var a = t("../utils/common"), o = t("./adler32"), s = t("./crc32"), c = t("./inffast"), m = t("./inftrees"), u = 1, y = 2, p = 0, h = -2, b = 1, d = 852, _ = 592;
|
|
1656
|
+
function f(k) {
|
|
1657
1657
|
return (k >>> 24 & 255) + (k >>> 8 & 65280) + ((65280 & k) << 8) + ((255 & k) << 24);
|
|
1658
1658
|
}
|
|
1659
1659
|
function v() {
|
|
@@ -1661,7 +1661,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1661
1661
|
}
|
|
1662
1662
|
function E(k) {
|
|
1663
1663
|
var N;
|
|
1664
|
-
return k && k.state ? (N = k.state, k.total_in = k.total_out = N.total = 0, k.msg = "", N.wrap && (k.adler = 1 & N.wrap), N.mode = b, N.last = 0, N.havedict = 0, N.dmax = 32768, N.head = null, N.hold = 0, N.bits = 0, N.lencode = N.lendyn = new a.Buf32(d), N.distcode = N.distdyn = new a.Buf32(_), N.sane = 1, N.back = -1,
|
|
1664
|
+
return k && k.state ? (N = k.state, k.total_in = k.total_out = N.total = 0, k.msg = "", N.wrap && (k.adler = 1 & N.wrap), N.mode = b, N.last = 0, N.havedict = 0, N.dmax = 32768, N.head = null, N.hold = 0, N.bits = 0, N.lencode = N.lendyn = new a.Buf32(d), N.distcode = N.distdyn = new a.Buf32(_), N.sane = 1, N.back = -1, p) : h;
|
|
1665
1665
|
}
|
|
1666
1666
|
function A(k) {
|
|
1667
1667
|
var N;
|
|
@@ -1673,7 +1673,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1673
1673
|
}
|
|
1674
1674
|
function L(k, N) {
|
|
1675
1675
|
var l, D;
|
|
1676
|
-
return k ? (D = new v(), (k.state = D).window = null, (l = T(k, N)) !==
|
|
1676
|
+
return k ? (D = new v(), (k.state = D).window = null, (l = T(k, N)) !== p && (k.state = null), l) : h;
|
|
1677
1677
|
}
|
|
1678
1678
|
var B, j, z = !0;
|
|
1679
1679
|
function Z(k) {
|
|
@@ -1683,8 +1683,8 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1683
1683
|
for (; N < 256; ) k.lens[N++] = 9;
|
|
1684
1684
|
for (; N < 280; ) k.lens[N++] = 7;
|
|
1685
1685
|
for (; N < 288; ) k.lens[N++] = 8;
|
|
1686
|
-
for (
|
|
1687
|
-
|
|
1686
|
+
for (m(u, k.lens, 0, 288, B, 0, k.work, { bits: 9 }), N = 0; N < 32; ) k.lens[N++] = 5;
|
|
1687
|
+
m(y, k.lens, 0, 32, j, 0, k.work, { bits: 5 }), z = !1;
|
|
1688
1688
|
}
|
|
1689
1689
|
k.lencode = B, k.lenbits = 9, k.distcode = j, k.distbits = 5;
|
|
1690
1690
|
}
|
|
@@ -1697,7 +1697,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1697
1697
|
}, n.inflateInit2 = L, n.inflate = function(k, N) {
|
|
1698
1698
|
var l, D, et, U, rt, W, tt, F, I, J, Y, V, lt, ut, it, at, dt, ct, bt, pt, i, O, P, w, g = 0, S = new a.Buf8(4), M = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
|
|
1699
1699
|
if (!k || !k.state || !k.output || !k.input && k.avail_in !== 0) return h;
|
|
1700
|
-
(l = k.state).mode === 12 && (l.mode = 13), rt = k.next_out, et = k.output, tt = k.avail_out, U = k.next_in, D = k.input, W = k.avail_in, F = l.hold, I = l.bits, J = W, Y = tt, O =
|
|
1700
|
+
(l = k.state).mode === 12 && (l.mode = 13), rt = k.next_out, et = k.output, tt = k.avail_out, U = k.next_in, D = k.input, W = k.avail_in, F = l.hold, I = l.bits, J = W, Y = tt, O = p;
|
|
1701
1701
|
t: for (; ; ) switch (l.mode) {
|
|
1702
1702
|
case b:
|
|
1703
1703
|
if (l.wrap === 0) {
|
|
@@ -1798,7 +1798,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1798
1798
|
if (W === 0) break t;
|
|
1799
1799
|
W--, F += D[U++] << I, I += 8;
|
|
1800
1800
|
}
|
|
1801
|
-
k.adler = l.check =
|
|
1801
|
+
k.adler = l.check = f(F), I = F = 0, l.mode = 11;
|
|
1802
1802
|
case 11:
|
|
1803
1803
|
if (l.havedict === 0) return k.next_out = rt, k.avail_out = tt, k.next_in = U, k.avail_in = W, l.hold = F, l.bits = I, 2;
|
|
1804
1804
|
k.adler = l.check = 1, l.mode = 12;
|
|
@@ -1868,7 +1868,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1868
1868
|
l.lens[M[l.have++]] = 7 & F, F >>>= 3, I -= 3;
|
|
1869
1869
|
}
|
|
1870
1870
|
for (; l.have < 19; ) l.lens[M[l.have++]] = 0;
|
|
1871
|
-
if (l.lencode = l.lendyn, l.lenbits = 7, P = { bits: l.lenbits }, O =
|
|
1871
|
+
if (l.lencode = l.lendyn, l.lenbits = 7, P = { bits: l.lenbits }, O = m(0, l.lens, 0, 19, l.lencode, 0, l.work, P), l.lenbits = P.bits, O) {
|
|
1872
1872
|
k.msg = "invalid code lengths set", l.mode = 30;
|
|
1873
1873
|
break;
|
|
1874
1874
|
}
|
|
@@ -1916,11 +1916,11 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
1916
1916
|
k.msg = "invalid code -- missing end-of-block", l.mode = 30;
|
|
1917
1917
|
break;
|
|
1918
1918
|
}
|
|
1919
|
-
if (l.lenbits = 9, P = { bits: l.lenbits }, O =
|
|
1919
|
+
if (l.lenbits = 9, P = { bits: l.lenbits }, O = m(u, l.lens, 0, l.nlen, l.lencode, 0, l.work, P), l.lenbits = P.bits, O) {
|
|
1920
1920
|
k.msg = "invalid literal/lengths set", l.mode = 30;
|
|
1921
1921
|
break;
|
|
1922
1922
|
}
|
|
1923
|
-
if (l.distbits = 6, l.distcode = l.distdyn, P = { bits: l.distbits }, O =
|
|
1923
|
+
if (l.distbits = 6, l.distcode = l.distdyn, P = { bits: l.distbits }, O = m(y, l.lens, l.nlen, l.ndist, l.distcode, 0, l.work, P), l.distbits = P.bits, O) {
|
|
1924
1924
|
k.msg = "invalid distances set", l.mode = 30;
|
|
1925
1925
|
break;
|
|
1926
1926
|
}
|
|
@@ -2017,7 +2017,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
2017
2017
|
if (W === 0) break t;
|
|
2018
2018
|
W--, F |= D[U++] << I, I += 8;
|
|
2019
2019
|
}
|
|
2020
|
-
if (Y -= tt, k.total_out += Y, l.total += Y, Y && (k.adler = l.check = l.flags ? s(l.check, et, Y, rt - Y) : o(l.check, et, Y, rt - Y)), Y = tt, (l.flags ? F :
|
|
2020
|
+
if (Y -= tt, k.total_out += Y, l.total += Y, Y && (k.adler = l.check = l.flags ? s(l.check, et, Y, rt - Y) : o(l.check, et, Y, rt - Y)), Y = tt, (l.flags ? F : f(F)) !== l.check) {
|
|
2021
2021
|
k.msg = "incorrect data check", l.mode = 30;
|
|
2022
2022
|
break;
|
|
2023
2023
|
}
|
|
@@ -2049,46 +2049,46 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
2049
2049
|
default:
|
|
2050
2050
|
return h;
|
|
2051
2051
|
}
|
|
2052
|
-
return k.next_out = rt, k.avail_out = tt, k.next_in = U, k.avail_in = W, l.hold = F, l.bits = I, (l.wsize || Y !== k.avail_out && l.mode < 30 && (l.mode < 27 || N !== 4)) && Q(k, k.output, k.next_out, Y - k.avail_out) ? (l.mode = 31, -4) : (J -= k.avail_in, Y -= k.avail_out, k.total_in += J, k.total_out += Y, l.total += Y, l.wrap && Y && (k.adler = l.check = l.flags ? s(l.check, et, Y, k.next_out - Y) : o(l.check, et, Y, k.next_out - Y)), k.data_type = l.bits + (l.last ? 64 : 0) + (l.mode === 12 ? 128 : 0) + (l.mode === 20 || l.mode === 15 ? 256 : 0), (J == 0 && Y === 0 || N === 4) && O ===
|
|
2052
|
+
return k.next_out = rt, k.avail_out = tt, k.next_in = U, k.avail_in = W, l.hold = F, l.bits = I, (l.wsize || Y !== k.avail_out && l.mode < 30 && (l.mode < 27 || N !== 4)) && Q(k, k.output, k.next_out, Y - k.avail_out) ? (l.mode = 31, -4) : (J -= k.avail_in, Y -= k.avail_out, k.total_in += J, k.total_out += Y, l.total += Y, l.wrap && Y && (k.adler = l.check = l.flags ? s(l.check, et, Y, k.next_out - Y) : o(l.check, et, Y, k.next_out - Y)), k.data_type = l.bits + (l.last ? 64 : 0) + (l.mode === 12 ? 128 : 0) + (l.mode === 20 || l.mode === 15 ? 256 : 0), (J == 0 && Y === 0 || N === 4) && O === p && (O = -5), O);
|
|
2053
2053
|
}, n.inflateEnd = function(k) {
|
|
2054
2054
|
if (!k || !k.state) return h;
|
|
2055
2055
|
var N = k.state;
|
|
2056
|
-
return N.window && (N.window = null), k.state = null,
|
|
2056
|
+
return N.window && (N.window = null), k.state = null, p;
|
|
2057
2057
|
}, n.inflateGetHeader = function(k, N) {
|
|
2058
2058
|
var l;
|
|
2059
|
-
return k && k.state && 2 & (l = k.state).wrap ? ((l.head = N).done = !1,
|
|
2059
|
+
return k && k.state && 2 & (l = k.state).wrap ? ((l.head = N).done = !1, p) : h;
|
|
2060
2060
|
}, n.inflateSetDictionary = function(k, N) {
|
|
2061
2061
|
var l, D = N.length;
|
|
2062
|
-
return k && k.state ? (l = k.state).wrap !== 0 && l.mode !== 11 ? h : l.mode === 11 && o(1, N, D, 0) !== l.check ? -3 : Q(k, N, D, D) ? (l.mode = 31, -4) : (l.havedict = 1,
|
|
2062
|
+
return k && k.state ? (l = k.state).wrap !== 0 && l.mode !== 11 ? h : l.mode === 11 && o(1, N, D, 0) !== l.check ? -3 : Q(k, N, D, D) ? (l.mode = 31, -4) : (l.havedict = 1, p) : h;
|
|
2063
2063
|
}, n.inflateInfo = "pako inflate (from Nodeca project)";
|
|
2064
2064
|
}, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function(t, r, n) {
|
|
2065
|
-
var a = t("../utils/common"), o = [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], s = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], c = [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, 0, 0],
|
|
2066
|
-
r.exports = function(
|
|
2067
|
-
var v, E, A, T, L, B, j, z, Z, Q =
|
|
2065
|
+
var a = t("../utils/common"), o = [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], s = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], c = [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, 0, 0], m = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];
|
|
2066
|
+
r.exports = function(u, y, p, h, b, d, _, f) {
|
|
2067
|
+
var v, E, A, T, L, B, j, z, Z, Q = f.bits, k = 0, N = 0, l = 0, D = 0, et = 0, U = 0, rt = 0, W = 0, tt = 0, F = 0, I = null, J = 0, Y = new a.Buf16(16), V = new a.Buf16(16), lt = null, ut = 0;
|
|
2068
2068
|
for (k = 0; k <= 15; k++) Y[k] = 0;
|
|
2069
|
-
for (N = 0; N < h; N++) Y[y[
|
|
2069
|
+
for (N = 0; N < h; N++) Y[y[p + N]]++;
|
|
2070
2070
|
for (et = Q, D = 15; 1 <= D && Y[D] === 0; D--) ;
|
|
2071
|
-
if (D < et && (et = D), D === 0) return b[d++] = 20971520, b[d++] = 20971520,
|
|
2071
|
+
if (D < et && (et = D), D === 0) return b[d++] = 20971520, b[d++] = 20971520, f.bits = 1, 0;
|
|
2072
2072
|
for (l = 1; l < D && Y[l] === 0; l++) ;
|
|
2073
2073
|
for (et < l && (et = l), k = W = 1; k <= 15; k++) if (W <<= 1, (W -= Y[k]) < 0) return -1;
|
|
2074
|
-
if (0 < W && (
|
|
2074
|
+
if (0 < W && (u === 0 || D !== 1)) return -1;
|
|
2075
2075
|
for (V[1] = 0, k = 1; k < 15; k++) V[k + 1] = V[k] + Y[k];
|
|
2076
|
-
for (N = 0; N < h; N++) y[
|
|
2077
|
-
if (B =
|
|
2076
|
+
for (N = 0; N < h; N++) y[p + N] !== 0 && (_[V[y[p + N]]++] = N);
|
|
2077
|
+
if (B = u === 0 ? (I = lt = _, 19) : u === 1 ? (I = o, J -= 257, lt = s, ut -= 257, 256) : (I = c, lt = m, -1), k = l, L = d, rt = N = F = 0, A = -1, T = (tt = 1 << (U = et)) - 1, u === 1 && 852 < tt || u === 2 && 592 < tt) return 1;
|
|
2078
2078
|
for (; ; ) {
|
|
2079
2079
|
for (j = k - rt, Z = _[N] < B ? (z = 0, _[N]) : _[N] > B ? (z = lt[ut + _[N]], I[J + _[N]]) : (z = 96, 0), v = 1 << k - rt, l = E = 1 << U; b[L + (F >> rt) + (E -= v)] = j << 24 | z << 16 | Z | 0, E !== 0; ) ;
|
|
2080
2080
|
for (v = 1 << k - 1; F & v; ) v >>= 1;
|
|
2081
2081
|
if (v !== 0 ? (F &= v - 1, F += v) : F = 0, N++, --Y[k] == 0) {
|
|
2082
2082
|
if (k === D) break;
|
|
2083
|
-
k = y[
|
|
2083
|
+
k = y[p + _[N]];
|
|
2084
2084
|
}
|
|
2085
2085
|
if (et < k && (F & T) !== A) {
|
|
2086
2086
|
for (rt === 0 && (rt = et), L += l, W = 1 << (U = k - rt); U + rt < D && !((W -= Y[U + rt]) <= 0); ) U++, W <<= 1;
|
|
2087
|
-
if (tt += 1 << U,
|
|
2087
|
+
if (tt += 1 << U, u === 1 && 852 < tt || u === 2 && 592 < tt) return 1;
|
|
2088
2088
|
b[A = F & T] = et << 24 | U << 16 | L - d | 0;
|
|
2089
2089
|
}
|
|
2090
2090
|
}
|
|
2091
|
-
return F !== 0 && (b[L + F] = k - rt << 24 | 64 << 16 | 0),
|
|
2091
|
+
return F !== 0 && (b[L + F] = k - rt << 24 | 64 << 16 | 0), f.bits = et, 0;
|
|
2092
2092
|
};
|
|
2093
2093
|
}, { "../utils/common": 41 }], 51: [function(t, r, n) {
|
|
2094
2094
|
r.exports = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" };
|
|
@@ -2097,7 +2097,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
2097
2097
|
function c(g) {
|
|
2098
2098
|
for (var S = g.length; 0 <= --S; ) g[S] = 0;
|
|
2099
2099
|
}
|
|
2100
|
-
var
|
|
2100
|
+
var m = 0, u = 29, y = 256, p = y + 1 + u, h = 30, b = 19, d = 2 * p + 1, _ = 15, f = 16, v = 7, E = 256, A = 16, T = 17, L = 18, B = [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], j = [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], z = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], Z = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], Q = new Array(2 * (p + 2));
|
|
2101
2101
|
c(Q);
|
|
2102
2102
|
var k = new Array(2 * h);
|
|
2103
2103
|
c(k);
|
|
@@ -2105,7 +2105,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
2105
2105
|
c(N);
|
|
2106
2106
|
var l = new Array(256);
|
|
2107
2107
|
c(l);
|
|
2108
|
-
var D = new Array(
|
|
2108
|
+
var D = new Array(u);
|
|
2109
2109
|
c(D);
|
|
2110
2110
|
var et, U, rt, W = new Array(h);
|
|
2111
2111
|
function tt(g, S, M, $, R) {
|
|
@@ -2121,7 +2121,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
2121
2121
|
g.pending_buf[g.pending++] = 255 & S, g.pending_buf[g.pending++] = S >>> 8 & 255;
|
|
2122
2122
|
}
|
|
2123
2123
|
function Y(g, S, M) {
|
|
2124
|
-
g.bi_valid >
|
|
2124
|
+
g.bi_valid > f - M ? (g.bi_buf |= S << g.bi_valid & 65535, J(g, g.bi_buf), g.bi_buf = S >> f - g.bi_valid, g.bi_valid += M - f) : (g.bi_buf |= S << g.bi_valid & 65535, g.bi_valid += M);
|
|
2125
2125
|
}
|
|
2126
2126
|
function V(g, S, M) {
|
|
2127
2127
|
Y(g, M[2 * S], M[2 * S + 1]);
|
|
@@ -2140,7 +2140,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
2140
2140
|
}
|
|
2141
2141
|
function it(g) {
|
|
2142
2142
|
var S;
|
|
2143
|
-
for (S = 0; S <
|
|
2143
|
+
for (S = 0; S < p; S++) g.dyn_ltree[2 * S] = 0;
|
|
2144
2144
|
for (S = 0; S < h; S++) g.dyn_dtree[2 * S] = 0;
|
|
2145
2145
|
for (S = 0; S < b; S++) g.bl_tree[2 * S] = 0;
|
|
2146
2146
|
g.dyn_ltree[2 * E] = 1, g.opt_len = g.static_len = 0, g.last_lit = g.matches = 0;
|
|
@@ -2195,14 +2195,14 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
2195
2195
|
c(W);
|
|
2196
2196
|
var P = !1;
|
|
2197
2197
|
function w(g, S, M, $) {
|
|
2198
|
-
Y(g, (
|
|
2198
|
+
Y(g, (m << 1) + ($ ? 1 : 0), 3), function(R, H, q, G) {
|
|
2199
2199
|
at(R), J(R, q), J(R, ~q), a.arraySet(R.pending_buf, R.window, H, q, R.pending), R.pending += q;
|
|
2200
2200
|
}(g, S, M);
|
|
2201
2201
|
}
|
|
2202
2202
|
n._tr_init = function(g) {
|
|
2203
2203
|
P || (function() {
|
|
2204
2204
|
var S, M, $, R, H, q = new Array(_ + 1);
|
|
2205
|
-
for (R = $ = 0; R <
|
|
2205
|
+
for (R = $ = 0; R < u - 1; R++) for (D[R] = $, S = 0; S < 1 << B[R]; S++) l[$++] = R;
|
|
2206
2206
|
for (l[$ - 1] = R, R = H = 0; R < 16; R++) for (W[R] = H, S = 0; S < 1 << j[R]; S++) N[H++] = R;
|
|
2207
2207
|
for (H >>= 7; R < h; R++) for (W[R] = H << 7, S = 0; S < 1 << j[R] - 7; S++) N[256 + H++] = R;
|
|
2208
2208
|
for (M = 0; M <= _; M++) q[M] = 0;
|
|
@@ -2210,8 +2210,8 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
2210
2210
|
for (; S <= 255; ) Q[2 * S + 1] = 9, S++, q[9]++;
|
|
2211
2211
|
for (; S <= 279; ) Q[2 * S + 1] = 7, S++, q[7]++;
|
|
2212
2212
|
for (; S <= 287; ) Q[2 * S + 1] = 8, S++, q[8]++;
|
|
2213
|
-
for (ut(Q,
|
|
2214
|
-
et = new tt(Q, B, y + 1,
|
|
2213
|
+
for (ut(Q, p + 1, q), S = 0; S < h; S++) k[2 * S + 1] = 5, k[2 * S] = lt(S, 5);
|
|
2214
|
+
et = new tt(Q, B, y + 1, p, _), U = new tt(k, j, 0, h, _), rt = new tt(new Array(0), z, 0, b, v);
|
|
2215
2215
|
}(), P = !0), g.l_desc = new F(g.dyn_ltree, et), g.d_desc = new F(g.dyn_dtree, U), g.bl_desc = new F(g.bl_tree, rt), g.bi_buf = 0, g.bi_valid = 0, it(g);
|
|
2216
2216
|
}, n._tr_stored_block = w, n._tr_flush_block = function(g, S, M, $) {
|
|
2217
2217
|
var R, H, q = 0;
|
|
@@ -2245,7 +2245,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
2245
2245
|
(function(a) {
|
|
2246
2246
|
(function(o, s) {
|
|
2247
2247
|
if (!o.setImmediate) {
|
|
2248
|
-
var c,
|
|
2248
|
+
var c, m, u, y, p = 1, h = {}, b = !1, d = o.document, _ = Object.getPrototypeOf && Object.getPrototypeOf(o);
|
|
2249
2249
|
_ = _ && _.setTimeout ? _ : o, c = {}.toString.call(o.process) === "[object process]" ? function(A) {
|
|
2250
2250
|
process.nextTick(function() {
|
|
2251
2251
|
v(A);
|
|
@@ -2259,25 +2259,25 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
2259
2259
|
}
|
|
2260
2260
|
}() ? (y = "setImmediate$" + Math.random() + "$", o.addEventListener ? o.addEventListener("message", E, !1) : o.attachEvent("onmessage", E), function(A) {
|
|
2261
2261
|
o.postMessage(y + A, "*");
|
|
2262
|
-
}) : o.MessageChannel ? ((
|
|
2262
|
+
}) : o.MessageChannel ? ((u = new MessageChannel()).port1.onmessage = function(A) {
|
|
2263
2263
|
v(A.data);
|
|
2264
2264
|
}, function(A) {
|
|
2265
|
-
|
|
2266
|
-
}) : d && "onreadystatechange" in d.createElement("script") ? (
|
|
2265
|
+
u.port2.postMessage(A);
|
|
2266
|
+
}) : d && "onreadystatechange" in d.createElement("script") ? (m = d.documentElement, function(A) {
|
|
2267
2267
|
var T = d.createElement("script");
|
|
2268
2268
|
T.onreadystatechange = function() {
|
|
2269
|
-
v(A), T.onreadystatechange = null,
|
|
2270
|
-
},
|
|
2269
|
+
v(A), T.onreadystatechange = null, m.removeChild(T), T = null;
|
|
2270
|
+
}, m.appendChild(T);
|
|
2271
2271
|
}) : function(A) {
|
|
2272
2272
|
setTimeout(v, 0, A);
|
|
2273
2273
|
}, _.setImmediate = function(A) {
|
|
2274
2274
|
typeof A != "function" && (A = new Function("" + A));
|
|
2275
2275
|
for (var T = new Array(arguments.length - 1), L = 0; L < T.length; L++) T[L] = arguments[L + 1];
|
|
2276
2276
|
var B = { callback: A, args: T };
|
|
2277
|
-
return h[
|
|
2278
|
-
}, _.clearImmediate =
|
|
2277
|
+
return h[p] = B, c(p), p++;
|
|
2278
|
+
}, _.clearImmediate = f;
|
|
2279
2279
|
}
|
|
2280
|
-
function
|
|
2280
|
+
function f(A) {
|
|
2281
2281
|
delete h[A];
|
|
2282
2282
|
}
|
|
2283
2283
|
function v(A) {
|
|
@@ -2307,7 +2307,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
2307
2307
|
}
|
|
2308
2308
|
})(T);
|
|
2309
2309
|
} finally {
|
|
2310
|
-
|
|
2310
|
+
f(A), b = !1;
|
|
2311
2311
|
}
|
|
2312
2312
|
}
|
|
2313
2313
|
}
|
|
@@ -2554,16 +2554,16 @@ function ne(x, e) {
|
|
|
2554
2554
|
}
|
|
2555
2555
|
function ie(x, e, t) {
|
|
2556
2556
|
const r = x.replace("#", ""), n = parseInt(r.substr(0, 2), 16), a = parseInt(r.substr(2, 2), 16), o = parseInt(r.substr(4, 2), 16);
|
|
2557
|
-
let s = n, c = a,
|
|
2557
|
+
let s = n, c = a, m = o;
|
|
2558
2558
|
if (e !== void 0 && e > 0) {
|
|
2559
|
-
const
|
|
2560
|
-
s = Math.round(n + (255 - n) *
|
|
2559
|
+
const u = e / 255;
|
|
2560
|
+
s = Math.round(n + (255 - n) * u), c = Math.round(a + (255 - a) * u), m = Math.round(o + (255 - o) * u);
|
|
2561
2561
|
}
|
|
2562
2562
|
if (t !== void 0 && t > 0) {
|
|
2563
|
-
const
|
|
2564
|
-
s = Math.round(s *
|
|
2563
|
+
const u = 1 - t / 255;
|
|
2564
|
+
s = Math.round(s * u), c = Math.round(c * u), m = Math.round(m * u);
|
|
2565
2565
|
}
|
|
2566
|
-
return s = Math.max(0, Math.min(255, s)), c = Math.max(0, Math.min(255, c)),
|
|
2566
|
+
return s = Math.max(0, Math.min(255, s)), c = Math.max(0, Math.min(255, c)), m = Math.max(0, Math.min(255, m)), `#${Ft(s)}${Ft(c)}${Ft(m)}`;
|
|
2567
2567
|
}
|
|
2568
2568
|
function Ft(x) {
|
|
2569
2569
|
const e = x.toString(16);
|
|
@@ -2725,14 +2725,14 @@ async function pe(x, e, t, r, n) {
|
|
|
2725
2725
|
(b, d) => setTimeout(() => d(new Error("字体加载超时")), n)
|
|
2726
2726
|
)
|
|
2727
2727
|
]);
|
|
2728
|
-
let
|
|
2729
|
-
t.key && (
|
|
2730
|
-
const
|
|
2728
|
+
let m = c;
|
|
2729
|
+
t.key && (m = me(c, t.key));
|
|
2730
|
+
const u = ge(new Uint8Array(m)), y = be(u), p = new Blob([m], { type: y }), h = await ye(p);
|
|
2731
2731
|
return {
|
|
2732
2732
|
fontName: e.name,
|
|
2733
2733
|
type: t.type,
|
|
2734
2734
|
dataUrl: h,
|
|
2735
|
-
format:
|
|
2735
|
+
format: u
|
|
2736
2736
|
};
|
|
2737
2737
|
}
|
|
2738
2738
|
function me(x, e) {
|
|
@@ -2923,9 +2923,9 @@ class Re {
|
|
|
2923
2923
|
async parse(e) {
|
|
2924
2924
|
const t = e instanceof ArrayBuffer ? e : await e.arrayBuffer();
|
|
2925
2925
|
this.zip = await Yt.loadAsync(t), this.bookmarks = /* @__PURE__ */ new Map(), await this.parseRelationships(), await this.loadImages();
|
|
2926
|
-
const r = await this.parseStyles(), n = new Map(r.map((
|
|
2926
|
+
const r = await this.parseStyles(), n = new Map(r.map((f) => [f.id, f])), a = await this.parseComments(), o = new Map(a.map((f) => [f.id, f])), s = await this.parseCommentsExtended(), c = Te(a, s), { numberings: m, abstractNumberings: u, numberingMap: y } = await this.parseNumberings();
|
|
2927
2927
|
this.theme = await this.parseTheme();
|
|
2928
|
-
const
|
|
2928
|
+
const p = await this.parseHeadersFooters("header"), h = await this.parseHeadersFooters("footer"), b = await this.parseFootnotes(), d = await this.parseEndnotes();
|
|
2929
2929
|
return this.fontTable = await this.parseFontTable(), this.embeddedFonts = await this.loadEmbeddedFonts(), {
|
|
2930
2930
|
body: await this.parseDocument(),
|
|
2931
2931
|
comments: a,
|
|
@@ -2934,12 +2934,12 @@ class Re {
|
|
|
2934
2934
|
commentsExtendedMap: s,
|
|
2935
2935
|
styles: r,
|
|
2936
2936
|
styleMap: n,
|
|
2937
|
-
numberings:
|
|
2937
|
+
numberings: m,
|
|
2938
2938
|
numberingMap: y,
|
|
2939
|
-
abstractNumberings:
|
|
2939
|
+
abstractNumberings: u,
|
|
2940
2940
|
images: this.images,
|
|
2941
2941
|
relationships: this.relationships,
|
|
2942
|
-
headers:
|
|
2942
|
+
headers: p,
|
|
2943
2943
|
footers: h,
|
|
2944
2944
|
theme: this.theme,
|
|
2945
2945
|
footnotes: b,
|
|
@@ -3005,13 +3005,13 @@ class Re {
|
|
|
3005
3005
|
"style"
|
|
3006
3006
|
);
|
|
3007
3007
|
for (let s = 0; s < n.length; s++) {
|
|
3008
|
-
const c = n[s],
|
|
3008
|
+
const c = n[s], m = C.element(c, "name"), u = C.element(c, "basedOn"), y = {
|
|
3009
3009
|
id: C.attr(c, "styleId") || "",
|
|
3010
|
-
name:
|
|
3010
|
+
name: m ? C.attr(m, "val") : void 0,
|
|
3011
3011
|
type: C.attr(c, "type") || "paragraph",
|
|
3012
|
-
basedOn:
|
|
3013
|
-
},
|
|
3014
|
-
|
|
3012
|
+
basedOn: u ? C.attr(u, "val") : void 0
|
|
3013
|
+
}, p = C.element(c, "pPr");
|
|
3014
|
+
p && (y.paragraphProps = this.parseParagraphProperties(p));
|
|
3015
3015
|
const h = C.element(c, "rPr");
|
|
3016
3016
|
h && (y.runProps = this.parseRunProperties(h)), r.push(y);
|
|
3017
3017
|
}
|
|
@@ -3102,16 +3102,16 @@ class Re {
|
|
|
3102
3102
|
t
|
|
3103
3103
|
);
|
|
3104
3104
|
for (let o = 0; o < a.length; o++) {
|
|
3105
|
-
const s = a[o], c = C.attr(s, "id") || "",
|
|
3106
|
-
if (
|
|
3105
|
+
const s = a[o], c = C.attr(s, "id") || "", m = C.attr(s, "type");
|
|
3106
|
+
if (m === "separator" || m === "continuationSeparator")
|
|
3107
3107
|
continue;
|
|
3108
|
-
const
|
|
3108
|
+
const u = {
|
|
3109
3109
|
type: r,
|
|
3110
3110
|
id: c,
|
|
3111
|
-
noteType:
|
|
3111
|
+
noteType: m,
|
|
3112
3112
|
children: this.parseChildren(s)
|
|
3113
3113
|
};
|
|
3114
|
-
n.set(c,
|
|
3114
|
+
n.set(c, u);
|
|
3115
3115
|
}
|
|
3116
3116
|
return n;
|
|
3117
3117
|
}
|
|
@@ -3119,8 +3119,8 @@ class Re {
|
|
|
3119
3119
|
* 解析编号(word/numbering.xml)
|
|
3120
3120
|
*/
|
|
3121
3121
|
async parseNumberings() {
|
|
3122
|
-
var c,
|
|
3123
|
-
const e = await ((
|
|
3122
|
+
var c, m;
|
|
3123
|
+
const e = await ((m = (c = this.zip) == null ? void 0 : c.file(mt.NUMBERING)) == null ? void 0 : m.async("string"));
|
|
3124
3124
|
if (!e)
|
|
3125
3125
|
return {
|
|
3126
3126
|
numberings: [],
|
|
@@ -3128,29 +3128,29 @@ class Re {
|
|
|
3128
3128
|
numberingMap: /* @__PURE__ */ new Map()
|
|
3129
3129
|
};
|
|
3130
3130
|
const r = gt(e).documentElement, n = [], a = /* @__PURE__ */ new Map();
|
|
3131
|
-
for (const
|
|
3132
|
-
switch (
|
|
3131
|
+
for (const u of C.elements(r))
|
|
3132
|
+
switch (u.localName) {
|
|
3133
3133
|
case "abstractNum":
|
|
3134
|
-
n.push(this.parseAbstractNumbering(
|
|
3134
|
+
n.push(this.parseAbstractNumbering(u));
|
|
3135
3135
|
break;
|
|
3136
3136
|
case "num":
|
|
3137
|
-
const y = C.attr(
|
|
3138
|
-
if (
|
|
3139
|
-
const h = C.attr(
|
|
3137
|
+
const y = C.attr(u, "numId") || "", p = C.element(u, "abstractNumId");
|
|
3138
|
+
if (p) {
|
|
3139
|
+
const h = C.attr(p, "val") || "";
|
|
3140
3140
|
a.set(y, h);
|
|
3141
3141
|
}
|
|
3142
3142
|
break;
|
|
3143
3143
|
}
|
|
3144
3144
|
const o = [], s = /* @__PURE__ */ new Map();
|
|
3145
|
-
for (const [
|
|
3146
|
-
const
|
|
3147
|
-
if (
|
|
3145
|
+
for (const [u, y] of a) {
|
|
3146
|
+
const p = n.find((h) => h.id === y);
|
|
3147
|
+
if (p) {
|
|
3148
3148
|
const h = {
|
|
3149
|
-
id:
|
|
3149
|
+
id: u,
|
|
3150
3150
|
abstractNumId: y,
|
|
3151
|
-
levels:
|
|
3151
|
+
levels: p.levels.map((b) => ({ ...b }))
|
|
3152
3152
|
};
|
|
3153
|
-
o.push(h), s.set(
|
|
3153
|
+
o.push(h), s.set(u, h);
|
|
3154
3154
|
}
|
|
3155
3155
|
}
|
|
3156
3156
|
return { numberings: o, abstractNumberings: n, numberingMap: s };
|
|
@@ -3231,19 +3231,19 @@ class Re {
|
|
|
3231
3231
|
"http://schemas.openxmlformats.org/wordprocessingml/2006/main",
|
|
3232
3232
|
"comment"
|
|
3233
3233
|
), a = "http://schemas.microsoft.com/office/word/2010/wordml";
|
|
3234
|
-
for (let
|
|
3235
|
-
const
|
|
3236
|
-
let
|
|
3237
|
-
|
|
3234
|
+
for (let m = 0; m < n.length; m++) {
|
|
3235
|
+
const u = n[m], y = ((c = u.textContent) == null ? void 0 : c.trim()) || "";
|
|
3236
|
+
let p = u.getAttributeNS(a, "paraId");
|
|
3237
|
+
p || (p = u.getAttribute("w14:paraId") || null);
|
|
3238
3238
|
const h = {
|
|
3239
3239
|
type: X.Comment,
|
|
3240
|
-
id: C.attr(
|
|
3241
|
-
author: C.attr(
|
|
3242
|
-
date: C.attr(
|
|
3243
|
-
initials: C.attr(
|
|
3244
|
-
children: this.parseChildren(
|
|
3240
|
+
id: C.attr(u, "id") || "",
|
|
3241
|
+
author: C.attr(u, "author") || "未知",
|
|
3242
|
+
date: C.attr(u, "date") || (/* @__PURE__ */ new Date()).toISOString(),
|
|
3243
|
+
initials: C.attr(u, "initials"),
|
|
3244
|
+
children: this.parseChildren(u),
|
|
3245
3245
|
rawText: y,
|
|
3246
|
-
paraId:
|
|
3246
|
+
paraId: p || void 0
|
|
3247
3247
|
};
|
|
3248
3248
|
r.push(h);
|
|
3249
3249
|
}
|
|
@@ -3262,8 +3262,8 @@ class Re {
|
|
|
3262
3262
|
* 解析文档主体
|
|
3263
3263
|
*/
|
|
3264
3264
|
async parseDocument() {
|
|
3265
|
-
var
|
|
3266
|
-
const e = await ((
|
|
3265
|
+
var m, u;
|
|
3266
|
+
const e = await ((u = (m = this.zip) == null ? void 0 : m.file(mt.DOCUMENT)) == null ? void 0 : u.async("string"));
|
|
3267
3267
|
if (!e)
|
|
3268
3268
|
return { type: X.Document, children: [] };
|
|
3269
3269
|
const t = gt(e), r = t.getElementsByTagNameNS(
|
|
@@ -3293,14 +3293,14 @@ class Re {
|
|
|
3293
3293
|
if (o.type === r) {
|
|
3294
3294
|
const s = `word/${o.target}`, c = await ((a = (n = this.zip) == null ? void 0 : n.file(s)) == null ? void 0 : a.async("string"));
|
|
3295
3295
|
if (c) {
|
|
3296
|
-
const
|
|
3296
|
+
const u = gt(c).getElementsByTagNameNS(
|
|
3297
3297
|
"http://schemas.openxmlformats.org/wordprocessingml/2006/main",
|
|
3298
3298
|
e === "header" ? "hdr" : "ftr"
|
|
3299
3299
|
)[0];
|
|
3300
|
-
if (
|
|
3300
|
+
if (u) {
|
|
3301
3301
|
const y = {
|
|
3302
3302
|
type: e === "header" ? X.Header : X.Footer,
|
|
3303
|
-
children: this.parseChildren(
|
|
3303
|
+
children: this.parseChildren(u)
|
|
3304
3304
|
};
|
|
3305
3305
|
t.set(o.id, y);
|
|
3306
3306
|
}
|
|
@@ -3567,10 +3567,10 @@ class Re {
|
|
|
3567
3567
|
s && (t.pageBreakBefore = C.boolAttr(s, "val") !== !1);
|
|
3568
3568
|
const c = C.element(e, "pBdr");
|
|
3569
3569
|
c && (t.borders = this.parseBorders(c));
|
|
3570
|
-
const
|
|
3571
|
-
|
|
3572
|
-
const
|
|
3573
|
-
return
|
|
3570
|
+
const m = C.element(e, "sectPr");
|
|
3571
|
+
m && (t.sectionProps = this.parseSectionProperties(m));
|
|
3572
|
+
const u = C.element(e, "numPr");
|
|
3573
|
+
return u && (t.numbering = this.parseParagraphNumbering(u)), t;
|
|
3574
3574
|
}
|
|
3575
3575
|
/**
|
|
3576
3576
|
* 解析段落编号引用
|
|
@@ -3607,7 +3607,7 @@ class Re {
|
|
|
3607
3607
|
* 解析 Run 属性
|
|
3608
3608
|
*/
|
|
3609
3609
|
parseRunProperties(e) {
|
|
3610
|
-
var b, d, _,
|
|
3610
|
+
var b, d, _, f;
|
|
3611
3611
|
const t = {}, r = C.element(e, "rStyle");
|
|
3612
3612
|
r && (t.styleId = C.attr(r, "val"));
|
|
3613
3613
|
const n = C.element(e, "b");
|
|
@@ -3620,16 +3620,16 @@ class Re {
|
|
|
3620
3620
|
s && (t.strike = C.attr(s, "val") !== "0");
|
|
3621
3621
|
const c = C.element(e, "dstrike");
|
|
3622
3622
|
c && (t.dstrike = C.attr(c, "val") !== "0");
|
|
3623
|
-
const
|
|
3624
|
-
if (
|
|
3625
|
-
const v = C.attr(
|
|
3623
|
+
const m = C.element(e, "vertAlign");
|
|
3624
|
+
if (m) {
|
|
3625
|
+
const v = C.attr(m, "val");
|
|
3626
3626
|
(v === "superscript" || v === "subscript") && (t.vertAlign = v);
|
|
3627
3627
|
}
|
|
3628
|
-
const
|
|
3629
|
-
if (
|
|
3630
|
-
const v = C.attr(
|
|
3628
|
+
const u = C.element(e, "color");
|
|
3629
|
+
if (u) {
|
|
3630
|
+
const v = C.attr(u, "val"), E = C.attr(u, "themeColor");
|
|
3631
3631
|
if (E) {
|
|
3632
|
-
const A = C.attr(
|
|
3632
|
+
const A = C.attr(u, "themeTint"), T = C.attr(u, "themeShade");
|
|
3633
3633
|
if (t.themeColor = {
|
|
3634
3634
|
themeColor: E,
|
|
3635
3635
|
themeTint: A ? parseInt(A, 16) : void 0,
|
|
@@ -3642,9 +3642,9 @@ class Re {
|
|
|
3642
3642
|
}
|
|
3643
3643
|
const y = C.element(e, "sz");
|
|
3644
3644
|
y && (t.fontSize = C.lengthAttr(y, "val", wt.FontSize));
|
|
3645
|
-
const
|
|
3646
|
-
if (
|
|
3647
|
-
const v = C.attr(
|
|
3645
|
+
const p = C.element(e, "rFonts");
|
|
3646
|
+
if (p) {
|
|
3647
|
+
const v = C.attr(p, "asciiTheme"), E = C.attr(p, "eastAsiaTheme");
|
|
3648
3648
|
if (v || E) {
|
|
3649
3649
|
const A = v || E || "";
|
|
3650
3650
|
if (A.startsWith("major")) {
|
|
@@ -3652,12 +3652,12 @@ class Re {
|
|
|
3652
3652
|
const T = A.includes("EastAsia") ? this.theme.fontScheme.majorFont.ea : this.theme.fontScheme.majorFont.latin;
|
|
3653
3653
|
T && (t.fontFamily = T);
|
|
3654
3654
|
}
|
|
3655
|
-
} else if (A.startsWith("minor") && (t.themeFontFamily = "minor", (
|
|
3655
|
+
} else if (A.startsWith("minor") && (t.themeFontFamily = "minor", (f = (_ = this.theme) == null ? void 0 : _.fontScheme) != null && f.minorFont)) {
|
|
3656
3656
|
const T = A.includes("EastAsia") ? this.theme.fontScheme.minorFont.ea : this.theme.fontScheme.minorFont.latin;
|
|
3657
3657
|
T && (t.fontFamily = T);
|
|
3658
3658
|
}
|
|
3659
3659
|
}
|
|
3660
|
-
t.fontFamily || (t.fontFamily = C.attr(
|
|
3660
|
+
t.fontFamily || (t.fontFamily = C.attr(p, "ascii") || C.attr(p, "eastAsia") || C.attr(p, "hAnsi"));
|
|
3661
3661
|
}
|
|
3662
3662
|
const h = C.element(e, "highlight");
|
|
3663
3663
|
return h && (t.highlight = C.attr(h, "val")), t;
|
|
@@ -3922,16 +3922,16 @@ class Re {
|
|
|
3922
3922
|
"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",
|
|
3923
3923
|
"extent"
|
|
3924
3924
|
)[0];
|
|
3925
|
-
let c,
|
|
3925
|
+
let c, m;
|
|
3926
3926
|
if (s) {
|
|
3927
|
-
const
|
|
3928
|
-
|
|
3927
|
+
const u = s.getAttribute("cx"), y = s.getAttribute("cy");
|
|
3928
|
+
u && (c = C.convertLength(u, wt.Emu)), y && (m = C.convertLength(y, wt.Emu));
|
|
3929
3929
|
}
|
|
3930
3930
|
t.push({
|
|
3931
3931
|
type: X.Image,
|
|
3932
3932
|
src: this.images.get(o),
|
|
3933
3933
|
width: c,
|
|
3934
|
-
height:
|
|
3934
|
+
height: m
|
|
3935
3935
|
});
|
|
3936
3936
|
}
|
|
3937
3937
|
}
|
|
@@ -4095,9 +4095,13 @@ class Ie {
|
|
|
4095
4095
|
this.positionCommentBubbles(), this.updateLines(), r = !1;
|
|
4096
4096
|
}), r = !0);
|
|
4097
4097
|
};
|
|
4098
|
-
t.addEventListener(
|
|
4099
|
-
|
|
4100
|
-
|
|
4098
|
+
t.addEventListener(
|
|
4099
|
+
"scroll",
|
|
4100
|
+
() => {
|
|
4101
|
+
this.positionCommentBubbles(), this.updateLines();
|
|
4102
|
+
},
|
|
4103
|
+
{ passive: !0 }
|
|
4104
|
+
), window.addEventListener("resize", n), requestAnimationFrame(() => {
|
|
4101
4105
|
this.positionCommentBubbles(), this.updateLines();
|
|
4102
4106
|
});
|
|
4103
4107
|
}
|
|
@@ -4105,47 +4109,55 @@ class Ie {
|
|
|
4105
4109
|
* 单页渲染模式
|
|
4106
4110
|
*/
|
|
4107
4111
|
renderSinglePage(e, t) {
|
|
4108
|
-
const r = this.createElement(
|
|
4112
|
+
const r = this.createElement(
|
|
4113
|
+
"div",
|
|
4114
|
+
`${this.classPrefix}-document`
|
|
4115
|
+
), n = this.createElement("div", `${this.classPrefix}-page`), a = this.renderElement(t.body);
|
|
4109
4116
|
a && n.appendChild(a), this.renderPageFootnotes(this.currentFootnoteIds, n), r.appendChild(n), e.appendChild(r), this.renderDocumentEndnotes(e);
|
|
4110
4117
|
}
|
|
4111
4118
|
/**
|
|
4112
4119
|
* 分页渲染模式
|
|
4113
4120
|
*/
|
|
4114
4121
|
renderWithPages(e, t) {
|
|
4115
|
-
const r = t.body, n = r.sectionProps, a = this.splitBySection(
|
|
4122
|
+
const r = t.body, n = r.sectionProps, a = this.splitBySection(
|
|
4123
|
+
r.children || [],
|
|
4124
|
+
n
|
|
4125
|
+
), o = this.groupByPageBreaks(a);
|
|
4116
4126
|
this.totalPages = o.length;
|
|
4117
4127
|
let s;
|
|
4118
4128
|
for (let c = 0; c < o.length; c++) {
|
|
4119
4129
|
this.currentPageNumber = c + 1;
|
|
4120
|
-
const
|
|
4121
|
-
if (
|
|
4122
|
-
let
|
|
4123
|
-
const h = this.createPageElement(
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4130
|
+
const m = this.currentFootnoteIds.length, u = o[c];
|
|
4131
|
+
if (u.length === 0) continue;
|
|
4132
|
+
let p = u[0].sectProps || n;
|
|
4133
|
+
const h = this.createPageElement(p);
|
|
4134
|
+
p != null && p.headerRefs && this.renderHeaderFooter(
|
|
4135
|
+
p.headerRefs,
|
|
4136
|
+
p,
|
|
4127
4137
|
c,
|
|
4128
|
-
s !==
|
|
4138
|
+
s !== p,
|
|
4129
4139
|
h,
|
|
4130
4140
|
"header"
|
|
4131
4141
|
);
|
|
4132
|
-
for (const d of
|
|
4142
|
+
for (const d of u) {
|
|
4133
4143
|
const _ = this.createSectionContent(d.sectProps);
|
|
4134
|
-
for (const
|
|
4135
|
-
const v = this.renderElement(
|
|
4144
|
+
for (const f of d.elements) {
|
|
4145
|
+
const v = this.renderElement(f);
|
|
4136
4146
|
v && _.appendChild(v);
|
|
4137
4147
|
}
|
|
4138
|
-
h.appendChild(_),
|
|
4148
|
+
h.appendChild(_), p = d.sectProps || p;
|
|
4139
4149
|
}
|
|
4140
|
-
const b = this.currentFootnoteIds.slice(
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4150
|
+
const b = this.currentFootnoteIds.slice(
|
|
4151
|
+
m
|
|
4152
|
+
);
|
|
4153
|
+
this.renderPageFootnotes(b, h), p != null && p.footerRefs && this.renderHeaderFooter(
|
|
4154
|
+
p.footerRefs,
|
|
4155
|
+
p,
|
|
4144
4156
|
c,
|
|
4145
|
-
s !==
|
|
4157
|
+
s !== p,
|
|
4146
4158
|
h,
|
|
4147
4159
|
"footer"
|
|
4148
|
-
), e.appendChild(h), s =
|
|
4160
|
+
), e.appendChild(h), s = p;
|
|
4149
4161
|
}
|
|
4150
4162
|
this.renderDocumentEndnotes(e);
|
|
4151
4163
|
}
|
|
@@ -4159,9 +4171,9 @@ class Ie {
|
|
|
4159
4171
|
r.push(n);
|
|
4160
4172
|
for (const c of e)
|
|
4161
4173
|
if (c.type === X.Paragraph && (o = c.props) != null && o.pageBreakBefore && (n.pageBreak = !0, n = { sectProps: null, elements: [], pageBreak: !1 }, r.push(n)), n.elements.push(c), c.type === X.Paragraph) {
|
|
4162
|
-
const
|
|
4174
|
+
const m = c, u = (s = m.props) == null ? void 0 : s.sectionProps;
|
|
4163
4175
|
let y = !1;
|
|
4164
|
-
const
|
|
4176
|
+
const p = (h) => {
|
|
4165
4177
|
for (const b of h) {
|
|
4166
4178
|
if (b.type === X.Break) {
|
|
4167
4179
|
const d = b;
|
|
@@ -4170,10 +4182,10 @@ class Ie {
|
|
|
4170
4182
|
return;
|
|
4171
4183
|
}
|
|
4172
4184
|
}
|
|
4173
|
-
b.type === X.Run && b.children &&
|
|
4185
|
+
b.type === X.Run && b.children && p(b.children);
|
|
4174
4186
|
}
|
|
4175
4187
|
};
|
|
4176
|
-
this.options.breakPages &&
|
|
4188
|
+
this.options.breakPages && m.children && p(m.children), (u || y) && (n.sectProps = u || null, n.pageBreak = y, n = { sectProps: null, elements: [], pageBreak: !1 }, r.push(n));
|
|
4177
4189
|
}
|
|
4178
4190
|
let a = null;
|
|
4179
4191
|
for (let c = r.length - 1; c >= 0; c--)
|
|
@@ -4215,7 +4227,10 @@ class Ie {
|
|
|
4215
4227
|
* 创建 Section 内容区域
|
|
4216
4228
|
*/
|
|
4217
4229
|
createSectionContent(e) {
|
|
4218
|
-
const t = this.createElement(
|
|
4230
|
+
const t = this.createElement(
|
|
4231
|
+
"article",
|
|
4232
|
+
`${this.classPrefix}-section-content`
|
|
4233
|
+
);
|
|
4219
4234
|
if (e != null && e.columns) {
|
|
4220
4235
|
const r = e.columns;
|
|
4221
4236
|
r.numberOfColumns && r.numberOfColumns > 1 && (t.style.columnCount = String(r.numberOfColumns), r.space && (t.style.columnGap = r.space), r.separator && (t.style.columnRule = "1px solid #ccc"));
|
|
@@ -4226,32 +4241,41 @@ class Ie {
|
|
|
4226
4241
|
* 渲染页眉或页脚
|
|
4227
4242
|
*/
|
|
4228
4243
|
renderHeaderFooter(e, t, r, n, a, o) {
|
|
4229
|
-
var y,
|
|
4244
|
+
var y, p;
|
|
4230
4245
|
if (!e || e.length === 0) return;
|
|
4231
4246
|
let s = null;
|
|
4232
4247
|
if (t.titlePage && n && (s = e.find((h) => h.type === "first")), s || r % 2 === 1 && (s = e.find((h) => h.type === "even")), s || (s = e.find((h) => h.type === "default")), !s) return;
|
|
4233
|
-
const c = o === "header" ? (y = this.document) == null ? void 0 : y.headers : (
|
|
4234
|
-
if (!
|
|
4235
|
-
const
|
|
4236
|
-
|
|
4248
|
+
const c = o === "header" ? (y = this.document) == null ? void 0 : y.headers : (p = this.document) == null ? void 0 : p.footers, m = c == null ? void 0 : c.get(s.id);
|
|
4249
|
+
if (!m) return;
|
|
4250
|
+
const u = this.createElement(
|
|
4251
|
+
"div",
|
|
4252
|
+
`${this.classPrefix}-${o}`
|
|
4253
|
+
);
|
|
4254
|
+
for (const h of m.children || []) {
|
|
4237
4255
|
const b = this.renderElement(h);
|
|
4238
|
-
b &&
|
|
4256
|
+
b && u.appendChild(b);
|
|
4239
4257
|
}
|
|
4240
4258
|
if (t.pageMargins) {
|
|
4241
4259
|
const h = t.pageMargins;
|
|
4242
|
-
o === "header" && h.header && h.top ? (
|
|
4260
|
+
o === "header" && h.header && h.top ? (u.style.marginTop = `calc(${h.header} - ${h.top})`, u.style.minHeight = `calc(${h.top} - ${h.header})`) : o === "footer" && h.footer && h.bottom && (u.style.marginBottom = `calc(${h.footer} - ${h.bottom})`, u.style.minHeight = `calc(${h.bottom} - ${h.footer})`);
|
|
4243
4261
|
}
|
|
4244
|
-
o === "header" ? a.insertBefore(
|
|
4262
|
+
o === "header" ? a.insertBefore(u, a.firstChild) : a.appendChild(u);
|
|
4245
4263
|
}
|
|
4246
4264
|
/**
|
|
4247
4265
|
* 渲染所有评论气泡(右侧固定面板)
|
|
4248
4266
|
*/
|
|
4249
4267
|
renderAllCommentBubbles() {
|
|
4250
4268
|
var r;
|
|
4251
|
-
const e = this.createElement(
|
|
4269
|
+
const e = this.createElement(
|
|
4270
|
+
"div",
|
|
4271
|
+
`${this.classPrefix}-comments-layer`
|
|
4272
|
+
);
|
|
4252
4273
|
this.container.appendChild(e);
|
|
4253
4274
|
const t = ((r = this.document) == null ? void 0 : r.comments) || [];
|
|
4254
|
-
console.log(
|
|
4275
|
+
console.log(
|
|
4276
|
+
"[DEBUG] renderAllCommentBubbles - Total comments:",
|
|
4277
|
+
t.length
|
|
4278
|
+
), t.forEach((n) => {
|
|
4255
4279
|
var a;
|
|
4256
4280
|
console.log("[DEBUG] Comment:", {
|
|
4257
4281
|
id: n.id,
|
|
@@ -4274,13 +4298,20 @@ class Ie {
|
|
|
4274
4298
|
* 原文不可见时隐藏评论
|
|
4275
4299
|
*/
|
|
4276
4300
|
positionCommentBubbles() {
|
|
4277
|
-
const e = this.container.querySelector(
|
|
4301
|
+
const e = this.container.querySelector(
|
|
4302
|
+
`.${this.classPrefix}-page`
|
|
4303
|
+
);
|
|
4278
4304
|
if (!e) return;
|
|
4279
|
-
const
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4305
|
+
const t = e.getBoundingClientRect(), r = 1198, n = t.width, s = Math.max(
|
|
4306
|
+
(r - n) / 2 - 15 - 240,
|
|
4307
|
+
40
|
|
4308
|
+
);
|
|
4309
|
+
console.log("nerd", t);
|
|
4310
|
+
const c = 0, m = window.innerHeight;
|
|
4311
|
+
for (const [, u] of this.commentRanges) {
|
|
4312
|
+
if (!u.panelElement || u.highlightElements.length === 0) continue;
|
|
4313
|
+
const p = u.highlightElements[0].getBoundingClientRect();
|
|
4314
|
+
p.bottom > c && p.top < m ? (u.panelElement.style.display = "block", u.panelElement.style.right = `${s}px`, u.panelElement.style.top = `${p.top}px`) : u.panelElement.style.display = "none";
|
|
4284
4315
|
}
|
|
4285
4316
|
}
|
|
4286
4317
|
/**
|
|
@@ -4308,8 +4339,8 @@ class Ie {
|
|
|
4308
4339
|
drawCommentLine(e, t) {
|
|
4309
4340
|
const r = this.commentRanges.get(e);
|
|
4310
4341
|
if (!r || !r.highlightElements.length || !r.panelElement || !this.svgLayer || r.panelElement.style.display === "none") return;
|
|
4311
|
-
const n = r.highlightElements[0].getBoundingClientRect(), a = r.panelElement.getBoundingClientRect(), o = n.right, s = n.top + n.height / 2, c = a.left,
|
|
4312
|
-
|
|
4342
|
+
const n = r.highlightElements[0].getBoundingClientRect(), a = r.panelElement.getBoundingClientRect(), o = n.right, s = n.top + n.height / 2, c = a.left, m = s, u = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
4343
|
+
u.setAttribute("x1", String(o)), u.setAttribute("y1", String(s)), u.setAttribute("x2", String(c)), u.setAttribute("y2", String(m)), u.setAttribute("stroke", "#ef4444"), u.setAttribute("stroke-width", t ? "2" : "1"), this.svgLayer.appendChild(u);
|
|
4313
4344
|
}
|
|
4314
4345
|
/**
|
|
4315
4346
|
* 渲染元素
|
|
@@ -4390,18 +4421,21 @@ class Ie {
|
|
|
4390
4421
|
* 渲染编号
|
|
4391
4422
|
*/
|
|
4392
4423
|
renderNumbering(e) {
|
|
4393
|
-
var
|
|
4394
|
-
if (!(e != null && e.numbering) || !((
|
|
4424
|
+
var u, y;
|
|
4425
|
+
if (!(e != null && e.numbering) || !((u = this.document) != null && u.numberingMap))
|
|
4395
4426
|
return null;
|
|
4396
4427
|
const { id: t, level: r } = e.numbering, n = this.document.numberingMap.get(t);
|
|
4397
4428
|
if (!n)
|
|
4398
4429
|
return null;
|
|
4399
|
-
const a = n.levels.find((
|
|
4430
|
+
const a = n.levels.find((p) => p.level === r);
|
|
4400
4431
|
if (!a)
|
|
4401
4432
|
return null;
|
|
4402
4433
|
const o = this.getNumberingContent(n, a, t, r), s = this.createElement("span", `${this.classPrefix}-numbering`);
|
|
4403
4434
|
s.textContent = o, a.runProps && this.applyRunStyles(s, a.runProps);
|
|
4404
|
-
const c = this.createElement(
|
|
4435
|
+
const c = this.createElement(
|
|
4436
|
+
"span",
|
|
4437
|
+
`${this.classPrefix}-numbering-suffix`
|
|
4438
|
+
);
|
|
4405
4439
|
switch (a.suffix) {
|
|
4406
4440
|
case "tab":
|
|
4407
4441
|
c.innerHTML = " ";
|
|
@@ -4410,12 +4444,15 @@ class Ie {
|
|
|
4410
4444
|
c.innerHTML = " ";
|
|
4411
4445
|
break;
|
|
4412
4446
|
}
|
|
4413
|
-
const
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4447
|
+
const m = this.createElement(
|
|
4448
|
+
"span",
|
|
4449
|
+
`${this.classPrefix}-numbering-wrapper`
|
|
4450
|
+
);
|
|
4451
|
+
if (m.appendChild(s), m.appendChild(c), (y = a.paragraphProps) != null && y.indentation) {
|
|
4452
|
+
const p = a.paragraphProps.indentation;
|
|
4453
|
+
p.left && (m.style.marginLeft = p.left), p.hanging && (m.style.textIndent = `-${p.hanging}`, m.style.paddingLeft = p.hanging);
|
|
4417
4454
|
}
|
|
4418
|
-
return
|
|
4455
|
+
return m;
|
|
4419
4456
|
}
|
|
4420
4457
|
/**
|
|
4421
4458
|
* 获取编号内容
|
|
@@ -4427,14 +4464,14 @@ class Ie {
|
|
|
4427
4464
|
const s = `${r}-${n}`;
|
|
4428
4465
|
let c = this.numberingCounters.get(s) ?? t.start - 1;
|
|
4429
4466
|
c++, this.numberingCounters.set(s, c);
|
|
4430
|
-
for (let
|
|
4431
|
-
this.numberingCounters.delete(`${r}-${
|
|
4432
|
-
let
|
|
4433
|
-
for (let
|
|
4434
|
-
const y = this.numberingCounters.get(`${r}-${
|
|
4435
|
-
|
|
4467
|
+
for (let u = n + 1; u <= 8; u++)
|
|
4468
|
+
this.numberingCounters.delete(`${r}-${u}`);
|
|
4469
|
+
let m = o;
|
|
4470
|
+
for (let u = 0; u <= n; u++) {
|
|
4471
|
+
const y = this.numberingCounters.get(`${r}-${u}`) ?? 1, p = e.levels.find((d) => d.level === u), h = (p == null ? void 0 : p.format) || "decimal", b = this.formatNumber(y, h);
|
|
4472
|
+
m = m.replace(`%${u + 1}`, b);
|
|
4436
4473
|
}
|
|
4437
|
-
return
|
|
4474
|
+
return m;
|
|
4438
4475
|
}
|
|
4439
4476
|
/**
|
|
4440
4477
|
* 格式化编号
|
|
@@ -4517,14 +4554,28 @@ class Ie {
|
|
|
4517
4554
|
* 数字转中文传统数字(甲乙丙丁...)
|
|
4518
4555
|
*/
|
|
4519
4556
|
toChineseTraditional(e) {
|
|
4520
|
-
const t = [
|
|
4557
|
+
const t = [
|
|
4558
|
+
"甲",
|
|
4559
|
+
"乙",
|
|
4560
|
+
"丙",
|
|
4561
|
+
"丁",
|
|
4562
|
+
"戊",
|
|
4563
|
+
"己",
|
|
4564
|
+
"庚",
|
|
4565
|
+
"辛",
|
|
4566
|
+
"壬",
|
|
4567
|
+
"癸"
|
|
4568
|
+
];
|
|
4521
4569
|
return e >= 1 && e <= 10 ? t[e - 1] : String(e);
|
|
4522
4570
|
}
|
|
4523
4571
|
/**
|
|
4524
4572
|
* 创建评论气泡
|
|
4525
4573
|
*/
|
|
4526
4574
|
createCommentBubble(e) {
|
|
4527
|
-
const t = this.createElement(
|
|
4575
|
+
const t = this.createElement(
|
|
4576
|
+
"div",
|
|
4577
|
+
`${this.classPrefix}-comment-bubble`
|
|
4578
|
+
);
|
|
4528
4579
|
t.dataset.commentId = e.id;
|
|
4529
4580
|
const r = e.initials || e.author.charAt(0).toUpperCase(), n = this.formatDate(e.date), a = this.getCommentText(e), s = this.options.enableCommentEdit || this.options.onCommentAccept || this.options.onCommentReject ? `
|
|
4530
4581
|
<div class="${this.classPrefix}-comment-actions">
|
|
@@ -4558,26 +4609,32 @@ class Ie {
|
|
|
4558
4609
|
</div>
|
|
4559
4610
|
<div class="${this.classPrefix}-comment-content">${this.escapeHtml(a)}</div>
|
|
4560
4611
|
${s}
|
|
4561
|
-
`, t.addEventListener(
|
|
4612
|
+
`, t.addEventListener(
|
|
4613
|
+
"mouseenter",
|
|
4614
|
+
() => this.highlightComment(e.id)
|
|
4615
|
+
), t.addEventListener(
|
|
4616
|
+
"mouseleave",
|
|
4617
|
+
() => this.unhighlightComment(e.id)
|
|
4618
|
+
), t.addEventListener("click", () => {
|
|
4562
4619
|
this.selectComment(e.id), this.options.onCommentClick(e);
|
|
4563
4620
|
});
|
|
4564
4621
|
const c = t.querySelector(".accept");
|
|
4565
|
-
c == null || c.addEventListener("click", (
|
|
4622
|
+
c == null || c.addEventListener("click", (p) => {
|
|
4566
4623
|
var h, b;
|
|
4567
|
-
|
|
4624
|
+
p.stopPropagation(), (b = (h = this.options).onCommentAccept) == null || b.call(h, e);
|
|
4568
4625
|
});
|
|
4569
|
-
const
|
|
4570
|
-
|
|
4626
|
+
const m = t.querySelector(".reject");
|
|
4627
|
+
m == null || m.addEventListener("click", (p) => {
|
|
4571
4628
|
var h, b;
|
|
4572
|
-
|
|
4629
|
+
p.stopPropagation(), (b = (h = this.options).onCommentReject) == null || b.call(h, e);
|
|
4573
4630
|
});
|
|
4574
|
-
const
|
|
4575
|
-
|
|
4576
|
-
|
|
4631
|
+
const u = t.querySelector(".edit");
|
|
4632
|
+
u == null || u.addEventListener("click", (p) => {
|
|
4633
|
+
p.stopPropagation(), this.editComment(e);
|
|
4577
4634
|
});
|
|
4578
4635
|
const y = t.querySelector(".delete");
|
|
4579
|
-
return y == null || y.addEventListener("click", (
|
|
4580
|
-
|
|
4636
|
+
return y == null || y.addEventListener("click", (p) => {
|
|
4637
|
+
p.stopPropagation(), this.deleteComment(e.id);
|
|
4581
4638
|
}), t;
|
|
4582
4639
|
}
|
|
4583
4640
|
/**
|
|
@@ -4590,7 +4647,12 @@ class Ie {
|
|
|
4590
4647
|
};
|
|
4591
4648
|
r(e.children || []);
|
|
4592
4649
|
const n = t.join("");
|
|
4593
|
-
return !n && e.rawText ? (console.log(
|
|
4650
|
+
return !n && e.rawText ? (console.log(
|
|
4651
|
+
"[DEBUG] Comment",
|
|
4652
|
+
e.id,
|
|
4653
|
+
"using rawText:",
|
|
4654
|
+
e.rawText
|
|
4655
|
+
), e.rawText) : (console.log("[DEBUG] Comment", e.id, "text result:", n), n || "");
|
|
4594
4656
|
}
|
|
4595
4657
|
/**
|
|
4596
4658
|
* 高亮评论
|
|
@@ -4601,7 +4663,9 @@ class Ie {
|
|
|
4601
4663
|
const t = this.commentRanges.get(e);
|
|
4602
4664
|
t && (t.highlightElements.forEach((n) => {
|
|
4603
4665
|
n.classList.add(`${this.classPrefix}-highlight--active`);
|
|
4604
|
-
}), (r = t.panelElement) == null || r.classList.add(
|
|
4666
|
+
}), (r = t.panelElement) == null || r.classList.add(
|
|
4667
|
+
`${this.classPrefix}-comment-bubble--active`
|
|
4668
|
+
)), this.updateLines();
|
|
4605
4669
|
}
|
|
4606
4670
|
/**
|
|
4607
4671
|
* 取消高亮评论
|
|
@@ -4612,7 +4676,9 @@ class Ie {
|
|
|
4612
4676
|
const t = this.commentRanges.get(e);
|
|
4613
4677
|
t && (t.highlightElements.forEach((n) => {
|
|
4614
4678
|
n.classList.remove(`${this.classPrefix}-highlight--active`);
|
|
4615
|
-
}), (r = t.panelElement) == null || r.classList.remove(
|
|
4679
|
+
}), (r = t.panelElement) == null || r.classList.remove(
|
|
4680
|
+
`${this.classPrefix}-comment-bubble--active`
|
|
4681
|
+
)), this.updateLines();
|
|
4616
4682
|
}
|
|
4617
4683
|
/**
|
|
4618
4684
|
* 选中评论
|
|
@@ -4626,11 +4692,16 @@ class Ie {
|
|
|
4626
4692
|
editComment(e) {
|
|
4627
4693
|
const t = this.getCommentText(e), r = prompt("编辑评论:", t);
|
|
4628
4694
|
if (r !== null && r !== t) {
|
|
4629
|
-
const n = { type: X.Text, text: r }, a = { type: X.Run, children: [n] }, o = {
|
|
4695
|
+
const n = { type: X.Text, text: r }, a = { type: X.Run, children: [n] }, o = {
|
|
4696
|
+
type: X.Paragraph,
|
|
4697
|
+
children: [a]
|
|
4698
|
+
};
|
|
4630
4699
|
e.children = [o];
|
|
4631
4700
|
const s = this.commentRanges.get(e.id);
|
|
4632
4701
|
if (s != null && s.panelElement) {
|
|
4633
|
-
const c = s.panelElement.querySelector(
|
|
4702
|
+
const c = s.panelElement.querySelector(
|
|
4703
|
+
`.${this.classPrefix}-comment-content`
|
|
4704
|
+
);
|
|
4634
4705
|
c && (c.textContent = r);
|
|
4635
4706
|
}
|
|
4636
4707
|
this.options.onCommentChange(e, "update");
|
|
@@ -4732,7 +4803,9 @@ class Ie {
|
|
|
4732
4803
|
lightGray: "#c0c0c0",
|
|
4733
4804
|
black: "#000000"
|
|
4734
4805
|
};
|
|
4735
|
-
r.push(
|
|
4806
|
+
r.push(
|
|
4807
|
+
`background-color: ${a[t.highlight] || t.highlight}`
|
|
4808
|
+
);
|
|
4736
4809
|
}
|
|
4737
4810
|
r.length > 0 && (e.style.cssText = r.join("; "));
|
|
4738
4811
|
}
|
|
@@ -4777,7 +4850,10 @@ class Ie {
|
|
|
4777
4850
|
const t = this.createElement("div", `${this.classPrefix}-page-break`);
|
|
4778
4851
|
return t.style.pageBreakAfter = "always", t;
|
|
4779
4852
|
case "column":
|
|
4780
|
-
const r = this.createElement(
|
|
4853
|
+
const r = this.createElement(
|
|
4854
|
+
"span",
|
|
4855
|
+
`${this.classPrefix}-column-break`
|
|
4856
|
+
);
|
|
4781
4857
|
return r.style.breakAfter = "column", r;
|
|
4782
4858
|
default:
|
|
4783
4859
|
return document.createElement("br");
|
|
@@ -4818,7 +4894,9 @@ class Ie {
|
|
|
4818
4894
|
case "begin":
|
|
4819
4895
|
return this.inComplexField = !0, this.skipFieldContent = !1, this.currentFieldInstruction = "", null;
|
|
4820
4896
|
case "separate":
|
|
4821
|
-
const t = this.evaluateFieldInstruction(
|
|
4897
|
+
const t = this.evaluateFieldInstruction(
|
|
4898
|
+
this.currentFieldInstruction.trim().toUpperCase()
|
|
4899
|
+
);
|
|
4822
4900
|
if (t !== null) {
|
|
4823
4901
|
this.skipFieldContent = !0;
|
|
4824
4902
|
const r = this.createElement("span", `${this.classPrefix}-field`);
|
|
@@ -4863,8 +4941,8 @@ class Ie {
|
|
|
4863
4941
|
if (this.tableVerticalMerges.push(this.currentVerticalMerge), this.currentVerticalMerge = /* @__PURE__ */ new Map(), this.tableBordersStack.push(this.currentTableBorders), this.currentTableBorders = (n = e.props) == null ? void 0 : n.borders, this.currentTableRowCount = ((a = e.children) == null ? void 0 : a.length) || 0, this.currentTableColCount = ((o = e.columns) == null ? void 0 : o.length) || 0, this.currentTableRowIndex = 0, e.columns && e.columns.length > 0) {
|
|
4864
4942
|
const s = document.createElement("colgroup");
|
|
4865
4943
|
for (const c of e.columns) {
|
|
4866
|
-
const
|
|
4867
|
-
c.width && (
|
|
4944
|
+
const m = document.createElement("col");
|
|
4945
|
+
c.width && (m.style.width = c.width), s.appendChild(m);
|
|
4868
4946
|
}
|
|
4869
4947
|
t.appendChild(s);
|
|
4870
4948
|
}
|
|
@@ -4962,15 +5040,15 @@ class Ie {
|
|
|
4962
5040
|
* 应用单元格边框样式
|
|
4963
5041
|
*/
|
|
4964
5042
|
applyCellBorders(e, t, r, n, a) {
|
|
4965
|
-
const o = this.currentTableBorders, s = r === 0, c = r === this.currentTableRowCount - 1,
|
|
5043
|
+
const o = this.currentTableBorders, s = r === 0, c = r === this.currentTableRowCount - 1, m = n === 0, u = n + a >= this.currentTableColCount;
|
|
4966
5044
|
let y = t == null ? void 0 : t.top;
|
|
4967
5045
|
y || (s ? y = o == null ? void 0 : o.top : y = o == null ? void 0 : o.insideH), y && (e.style.borderTop = this.borderToCss(y));
|
|
4968
|
-
let
|
|
4969
|
-
|
|
5046
|
+
let p = t == null ? void 0 : t.bottom;
|
|
5047
|
+
p || (c ? p = o == null ? void 0 : o.bottom : p = o == null ? void 0 : o.insideH), p && (e.style.borderBottom = this.borderToCss(p));
|
|
4970
5048
|
let h = t == null ? void 0 : t.left;
|
|
4971
|
-
h || (
|
|
5049
|
+
h || (m ? h = o == null ? void 0 : o.left : h = o == null ? void 0 : o.insideV), h && (e.style.borderLeft = this.borderToCss(h));
|
|
4972
5050
|
let b = t == null ? void 0 : t.right;
|
|
4973
|
-
b || (
|
|
5051
|
+
b || (u ? b = o == null ? void 0 : o.right : b = o == null ? void 0 : o.insideV), b && (e.style.borderRight = this.borderToCss(b));
|
|
4974
5052
|
}
|
|
4975
5053
|
/**
|
|
4976
5054
|
* 渲染表格行
|
|
@@ -4988,7 +5066,10 @@ class Ie {
|
|
|
4988
5066
|
* 渲染表格单元格
|
|
4989
5067
|
*/
|
|
4990
5068
|
renderTableCell(e) {
|
|
4991
|
-
const t = this.createElement(
|
|
5069
|
+
const t = this.createElement(
|
|
5070
|
+
"td",
|
|
5071
|
+
`${this.classPrefix}-td`
|
|
5072
|
+
), r = e.props, n = this.currentCellCol, a = (r == null ? void 0 : r.gridSpan) || 1;
|
|
4992
5073
|
if (r != null && r.verticalMerge)
|
|
4993
5074
|
if (r.verticalMerge === "restart")
|
|
4994
5075
|
this.currentVerticalMerge.set(n, t), t.rowSpan = 1;
|
|
@@ -5033,7 +5114,10 @@ class Ie {
|
|
|
5033
5114
|
*/
|
|
5034
5115
|
renderCommentRangeStart(e) {
|
|
5035
5116
|
this.currentCommentIds.add(e.id), this.commentStartInParagraph.add(e.id);
|
|
5036
|
-
const t = this.createElement(
|
|
5117
|
+
const t = this.createElement(
|
|
5118
|
+
"span",
|
|
5119
|
+
`${this.classPrefix}-comment-start`
|
|
5120
|
+
);
|
|
5037
5121
|
t.dataset.commentId = e.id;
|
|
5038
5122
|
const r = this.commentRanges.get(e.id);
|
|
5039
5123
|
return r && (r.startElement = t), t;
|
|
@@ -5043,7 +5127,10 @@ class Ie {
|
|
|
5043
5127
|
*/
|
|
5044
5128
|
renderCommentRangeEnd(e) {
|
|
5045
5129
|
this.currentCommentIds.delete(e.id);
|
|
5046
|
-
const t = this.createElement(
|
|
5130
|
+
const t = this.createElement(
|
|
5131
|
+
"span",
|
|
5132
|
+
`${this.classPrefix}-comment-end`
|
|
5133
|
+
);
|
|
5047
5134
|
t.dataset.commentId = e.id;
|
|
5048
5135
|
const r = this.commentRanges.get(e.id);
|
|
5049
5136
|
return r && (r.endElement = t), t;
|
|
@@ -5052,7 +5139,10 @@ class Ie {
|
|
|
5052
5139
|
* 渲染评论引用
|
|
5053
5140
|
*/
|
|
5054
5141
|
renderCommentReference(e) {
|
|
5055
|
-
const t = this.createElement(
|
|
5142
|
+
const t = this.createElement(
|
|
5143
|
+
"span",
|
|
5144
|
+
`${this.classPrefix}-comment-ref`
|
|
5145
|
+
);
|
|
5056
5146
|
return t.dataset.commentId = e.id, t.textContent = "📝", t.title = "查看评论", t.addEventListener("click", () => {
|
|
5057
5147
|
this.highlightComment(e.id);
|
|
5058
5148
|
}), t;
|
|
@@ -5081,7 +5171,9 @@ class Ie {
|
|
|
5081
5171
|
this.footnoteCounter++, this.currentFootnoteIds.push(e.id);
|
|
5082
5172
|
const t = this.createElement("sup", `${this.classPrefix}-footnote-ref`);
|
|
5083
5173
|
return t.dataset.footnoteId = e.id, t.textContent = String(this.footnoteCounter), t.title = "脚注", t.addEventListener("click", () => {
|
|
5084
|
-
const r = document.getElementById(
|
|
5174
|
+
const r = document.getElementById(
|
|
5175
|
+
`${this.classPrefix}-footnote-${e.id}`
|
|
5176
|
+
);
|
|
5085
5177
|
r == null || r.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
5086
5178
|
}), t;
|
|
5087
5179
|
}
|
|
@@ -5092,7 +5184,9 @@ class Ie {
|
|
|
5092
5184
|
this.endnoteCounter++, this.currentEndnoteIds.push(e.id);
|
|
5093
5185
|
const t = this.createElement("sup", `${this.classPrefix}-endnote-ref`);
|
|
5094
5186
|
return t.dataset.endnoteId = e.id, t.textContent = String(this.endnoteCounter), t.title = "尾注", t.addEventListener("click", () => {
|
|
5095
|
-
const r = document.getElementById(
|
|
5187
|
+
const r = document.getElementById(
|
|
5188
|
+
`${this.classPrefix}-endnote-${e.id}`
|
|
5189
|
+
);
|
|
5096
5190
|
r == null || r.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
5097
5191
|
}), t;
|
|
5098
5192
|
}
|
|
@@ -5116,14 +5210,20 @@ class Ie {
|
|
|
5116
5210
|
renderPageFootnotes(e, t) {
|
|
5117
5211
|
var o;
|
|
5118
5212
|
if (e.length === 0 || !((o = this.document) != null && o.footnotes)) return;
|
|
5119
|
-
const r = this.createElement(
|
|
5213
|
+
const r = this.createElement(
|
|
5214
|
+
"div",
|
|
5215
|
+
`${this.classPrefix}-footnotes-section`
|
|
5216
|
+
), n = this.createElement(
|
|
5217
|
+
"hr",
|
|
5218
|
+
`${this.classPrefix}-footnotes-separator`
|
|
5219
|
+
);
|
|
5120
5220
|
r.appendChild(n);
|
|
5121
5221
|
const a = this.createElement("ol", `${this.classPrefix}-footnotes-list`);
|
|
5122
5222
|
for (const s of e) {
|
|
5123
5223
|
const c = this.document.footnotes.get(s);
|
|
5124
5224
|
if (c) {
|
|
5125
|
-
const
|
|
5126
|
-
a.appendChild(
|
|
5225
|
+
const m = this.renderFootnote(c);
|
|
5226
|
+
a.appendChild(m);
|
|
5127
5227
|
}
|
|
5128
5228
|
}
|
|
5129
5229
|
r.appendChild(a), t.appendChild(r);
|
|
@@ -5134,7 +5234,13 @@ class Ie {
|
|
|
5134
5234
|
renderDocumentEndnotes(e) {
|
|
5135
5235
|
var a;
|
|
5136
5236
|
if (this.currentEndnoteIds.length === 0 || !((a = this.document) != null && a.endnotes)) return;
|
|
5137
|
-
const t = this.createElement(
|
|
5237
|
+
const t = this.createElement(
|
|
5238
|
+
"div",
|
|
5239
|
+
`${this.classPrefix}-endnotes-section`
|
|
5240
|
+
), r = this.createElement(
|
|
5241
|
+
"h3",
|
|
5242
|
+
`${this.classPrefix}-endnotes-title`
|
|
5243
|
+
);
|
|
5138
5244
|
r.textContent = "尾注", t.appendChild(r);
|
|
5139
5245
|
const n = this.createElement("ol", `${this.classPrefix}-endnotes-list`);
|
|
5140
5246
|
for (const o of this.currentEndnoteIds) {
|