@vctrl/hooks 0.2.2 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +283 -125
- package/_commonjsHelpers-CT5_WOk_.js +1271 -0
- package/_commonjsHelpers-DZAafUiT.cjs +18 -0
- package/index.cjs.js +1 -1
- package/index.es.js +2 -2
- package/{model-context-CjwVhPEC.cjs → model-context-BBYdA-gO.cjs} +1 -1
- package/{model-context-DJcsllu0.js → model-context-Bvjdyghq.js} +3 -3
- package/package.json +1 -1
- package/{three.module-MSVrkZDe.js → three.module-7bSgh1t6.js} +94 -94
- package/use-export-model/index.d.ts +1 -0
- package/use-export-model/types.d.ts +19 -0
- package/use-export-model/use-export-model.d.ts +14 -0
- package/use-export-model/utils/data-uri-to-blob.d.ts +9 -0
- package/use-export-model/utils/export-handlers.d.ts +23 -0
- package/use-export-model/utils/file-helpers.d.ts +17 -0
- package/use-export-model/utils/index.d.ts +3 -0
- package/use-export-model.cjs.js +12 -0
- package/use-export-model.es.js +2461 -0
- package/use-load-model.cjs.js +1 -1
- package/use-load-model.es.js +1 -1
- package/use-optimize-model-DMZVYv9U.cjs +20 -0
- package/{use-optimize-model-D1qG_kQN.js → use-optimize-model-DRrg3MLA.js} +2588 -3852
- package/use-optimize-model.cjs.js +1 -1
- package/use-optimize-model.es.js +1 -1
- package/use-optimize-model-D7TsYCC3.cjs +0 -37
|
@@ -0,0 +1,2461 @@
|
|
|
1
|
+
import { c as mt, g as Rt, G as Tt } from "./_commonjsHelpers-CT5_WOk_.js";
|
|
2
|
+
function wt(et) {
|
|
3
|
+
throw new Error('Could not dynamically require "' + et + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
|
+
}
|
|
5
|
+
var Et = { exports: {} };
|
|
6
|
+
/*!
|
|
7
|
+
|
|
8
|
+
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
9
|
+
<http://stuartk.com/jszip>
|
|
10
|
+
|
|
11
|
+
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
|
12
|
+
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
|
|
13
|
+
|
|
14
|
+
JSZip uses the library pako released under the MIT license :
|
|
15
|
+
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
16
|
+
*/
|
|
17
|
+
(function(et, ot) {
|
|
18
|
+
(function(g) {
|
|
19
|
+
et.exports = g();
|
|
20
|
+
})(function() {
|
|
21
|
+
return function g(I, w, s) {
|
|
22
|
+
function o(c, v) {
|
|
23
|
+
if (!w[c]) {
|
|
24
|
+
if (!I[c]) {
|
|
25
|
+
var _ = typeof wt == "function" && wt;
|
|
26
|
+
if (!v && _) return _(c, !0);
|
|
27
|
+
if (n) return n(c, !0);
|
|
28
|
+
var m = new Error("Cannot find module '" + c + "'");
|
|
29
|
+
throw m.code = "MODULE_NOT_FOUND", m;
|
|
30
|
+
}
|
|
31
|
+
var i = w[c] = { exports: {} };
|
|
32
|
+
I[c][0].call(i.exports, function(d) {
|
|
33
|
+
var r = I[c][1][d];
|
|
34
|
+
return o(r || d);
|
|
35
|
+
}, i, i.exports, g, I, w, s);
|
|
36
|
+
}
|
|
37
|
+
return w[c].exports;
|
|
38
|
+
}
|
|
39
|
+
for (var n = typeof wt == "function" && wt, u = 0; u < s.length; u++) o(s[u]);
|
|
40
|
+
return o;
|
|
41
|
+
}({ 1: [function(g, I, w) {
|
|
42
|
+
var s = g("./utils"), o = g("./support"), n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
43
|
+
w.encode = function(u) {
|
|
44
|
+
for (var c, v, _, m, i, d, r, l = [], a = 0, p = u.length, y = p, S = s.getTypeOf(u) !== "string"; a < u.length; ) y = p - a, _ = S ? (c = u[a++], v = a < p ? u[a++] : 0, a < p ? u[a++] : 0) : (c = u.charCodeAt(a++), v = a < p ? u.charCodeAt(a++) : 0, a < p ? u.charCodeAt(a++) : 0), m = c >> 2, i = (3 & c) << 4 | v >> 4, d = 1 < y ? (15 & v) << 2 | _ >> 6 : 64, r = 2 < y ? 63 & _ : 64, l.push(n.charAt(m) + n.charAt(i) + n.charAt(d) + n.charAt(r));
|
|
45
|
+
return l.join("");
|
|
46
|
+
}, w.decode = function(u) {
|
|
47
|
+
var c, v, _, m, i, d, r = 0, l = 0, a = "data:";
|
|
48
|
+
if (u.substr(0, a.length) === a) throw new Error("Invalid base64 input, it looks like a data url.");
|
|
49
|
+
var p, y = 3 * (u = u.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4;
|
|
50
|
+
if (u.charAt(u.length - 1) === n.charAt(64) && y--, u.charAt(u.length - 2) === n.charAt(64) && y--, y % 1 != 0) throw new Error("Invalid base64 input, bad content length.");
|
|
51
|
+
for (p = o.uint8array ? new Uint8Array(0 | y) : new Array(0 | y); r < u.length; ) c = n.indexOf(u.charAt(r++)) << 2 | (m = n.indexOf(u.charAt(r++))) >> 4, v = (15 & m) << 4 | (i = n.indexOf(u.charAt(r++))) >> 2, _ = (3 & i) << 6 | (d = n.indexOf(u.charAt(r++))), p[l++] = c, i !== 64 && (p[l++] = v), d !== 64 && (p[l++] = _);
|
|
52
|
+
return p;
|
|
53
|
+
};
|
|
54
|
+
}, { "./support": 30, "./utils": 32 }], 2: [function(g, I, w) {
|
|
55
|
+
var s = g("./external"), o = g("./stream/DataWorker"), n = g("./stream/Crc32Probe"), u = g("./stream/DataLengthProbe");
|
|
56
|
+
function c(v, _, m, i, d) {
|
|
57
|
+
this.compressedSize = v, this.uncompressedSize = _, this.crc32 = m, this.compression = i, this.compressedContent = d;
|
|
58
|
+
}
|
|
59
|
+
c.prototype = { getContentWorker: function() {
|
|
60
|
+
var v = new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")), _ = this;
|
|
61
|
+
return v.on("end", function() {
|
|
62
|
+
if (this.streamInfo.data_length !== _.uncompressedSize) throw new Error("Bug : uncompressed data size mismatch");
|
|
63
|
+
}), v;
|
|
64
|
+
}, getCompressedWorker: function() {
|
|
65
|
+
return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression);
|
|
66
|
+
} }, c.createWorkerFrom = function(v, _, m) {
|
|
67
|
+
return v.pipe(new n()).pipe(new u("uncompressedSize")).pipe(_.compressWorker(m)).pipe(new u("compressedSize")).withStreamInfo("compression", _);
|
|
68
|
+
}, I.exports = c;
|
|
69
|
+
}, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(g, I, w) {
|
|
70
|
+
var s = g("./stream/GenericWorker");
|
|
71
|
+
w.STORE = { magic: "\0\0", compressWorker: function() {
|
|
72
|
+
return new s("STORE compression");
|
|
73
|
+
}, uncompressWorker: function() {
|
|
74
|
+
return new s("STORE decompression");
|
|
75
|
+
} }, w.DEFLATE = g("./flate");
|
|
76
|
+
}, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(g, I, w) {
|
|
77
|
+
var s = g("./utils"), o = function() {
|
|
78
|
+
for (var n, u = [], c = 0; c < 256; c++) {
|
|
79
|
+
n = c;
|
|
80
|
+
for (var v = 0; v < 8; v++) n = 1 & n ? 3988292384 ^ n >>> 1 : n >>> 1;
|
|
81
|
+
u[c] = n;
|
|
82
|
+
}
|
|
83
|
+
return u;
|
|
84
|
+
}();
|
|
85
|
+
I.exports = function(n, u) {
|
|
86
|
+
return n !== void 0 && n.length ? s.getTypeOf(n) !== "string" ? function(c, v, _, m) {
|
|
87
|
+
var i = o, d = m + _;
|
|
88
|
+
c ^= -1;
|
|
89
|
+
for (var r = m; r < d; r++) c = c >>> 8 ^ i[255 & (c ^ v[r])];
|
|
90
|
+
return -1 ^ c;
|
|
91
|
+
}(0 | u, n, n.length, 0) : function(c, v, _, m) {
|
|
92
|
+
var i = o, d = m + _;
|
|
93
|
+
c ^= -1;
|
|
94
|
+
for (var r = m; r < d; r++) c = c >>> 8 ^ i[255 & (c ^ v.charCodeAt(r))];
|
|
95
|
+
return -1 ^ c;
|
|
96
|
+
}(0 | u, n, n.length, 0) : 0;
|
|
97
|
+
};
|
|
98
|
+
}, { "./utils": 32 }], 5: [function(g, I, w) {
|
|
99
|
+
w.base64 = !1, w.binary = !1, w.dir = !1, w.createFolders = !0, w.date = null, w.compression = null, w.compressionOptions = null, w.comment = null, w.unixPermissions = null, w.dosPermissions = null;
|
|
100
|
+
}, {}], 6: [function(g, I, w) {
|
|
101
|
+
var s = null;
|
|
102
|
+
s = typeof Promise < "u" ? Promise : g("lie"), I.exports = { Promise: s };
|
|
103
|
+
}, { lie: 37 }], 7: [function(g, I, w) {
|
|
104
|
+
var s = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Uint32Array < "u", o = g("pako"), n = g("./utils"), u = g("./stream/GenericWorker"), c = s ? "uint8array" : "array";
|
|
105
|
+
function v(_, m) {
|
|
106
|
+
u.call(this, "FlateWorker/" + _), this._pako = null, this._pakoAction = _, this._pakoOptions = m, this.meta = {};
|
|
107
|
+
}
|
|
108
|
+
w.magic = "\b\0", n.inherits(v, u), v.prototype.processChunk = function(_) {
|
|
109
|
+
this.meta = _.meta, this._pako === null && this._createPako(), this._pako.push(n.transformTo(c, _.data), !1);
|
|
110
|
+
}, v.prototype.flush = function() {
|
|
111
|
+
u.prototype.flush.call(this), this._pako === null && this._createPako(), this._pako.push([], !0);
|
|
112
|
+
}, v.prototype.cleanUp = function() {
|
|
113
|
+
u.prototype.cleanUp.call(this), this._pako = null;
|
|
114
|
+
}, v.prototype._createPako = function() {
|
|
115
|
+
this._pako = new o[this._pakoAction]({ raw: !0, level: this._pakoOptions.level || -1 });
|
|
116
|
+
var _ = this;
|
|
117
|
+
this._pako.onData = function(m) {
|
|
118
|
+
_.push({ data: m, meta: _.meta });
|
|
119
|
+
};
|
|
120
|
+
}, w.compressWorker = function(_) {
|
|
121
|
+
return new v("Deflate", _);
|
|
122
|
+
}, w.uncompressWorker = function() {
|
|
123
|
+
return new v("Inflate", {});
|
|
124
|
+
};
|
|
125
|
+
}, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(g, I, w) {
|
|
126
|
+
function s(i, d) {
|
|
127
|
+
var r, l = "";
|
|
128
|
+
for (r = 0; r < d; r++) l += String.fromCharCode(255 & i), i >>>= 8;
|
|
129
|
+
return l;
|
|
130
|
+
}
|
|
131
|
+
function o(i, d, r, l, a, p) {
|
|
132
|
+
var y, S, x = i.file, F = i.compression, B = p !== c.utf8encode, P = n.transformTo("string", p(x.name)), O = n.transformTo("string", c.utf8encode(x.name)), W = x.comment, q = n.transformTo("string", p(W)), b = n.transformTo("string", c.utf8encode(W)), R = O.length !== x.name.length, e = b.length !== W.length, D = "", J = "", L = "", $ = x.dir, j = x.date, V = { crc32: 0, compressedSize: 0, uncompressedSize: 0 };
|
|
133
|
+
d && !r || (V.crc32 = i.crc32, V.compressedSize = i.compressedSize, V.uncompressedSize = i.uncompressedSize);
|
|
134
|
+
var A = 0;
|
|
135
|
+
d && (A |= 8), B || !R && !e || (A |= 2048);
|
|
136
|
+
var z = 0, X = 0;
|
|
137
|
+
$ && (z |= 16), a === "UNIX" ? (X = 798, z |= function(H, it) {
|
|
138
|
+
var ut = H;
|
|
139
|
+
return H || (ut = it ? 16893 : 33204), (65535 & ut) << 16;
|
|
140
|
+
}(x.unixPermissions, $)) : (X = 20, z |= function(H) {
|
|
141
|
+
return 63 & (H || 0);
|
|
142
|
+
}(x.dosPermissions)), y = j.getUTCHours(), y <<= 6, y |= j.getUTCMinutes(), y <<= 5, y |= j.getUTCSeconds() / 2, S = j.getUTCFullYear() - 1980, S <<= 4, S |= j.getUTCMonth() + 1, S <<= 5, S |= j.getUTCDate(), R && (J = s(1, 1) + s(v(P), 4) + O, D += "up" + s(J.length, 2) + J), e && (L = s(1, 1) + s(v(q), 4) + b, D += "uc" + s(L.length, 2) + L);
|
|
143
|
+
var G = "";
|
|
144
|
+
return G += `
|
|
145
|
+
\0`, G += s(A, 2), G += F.magic, G += s(y, 2), G += s(S, 2), G += s(V.crc32, 4), G += s(V.compressedSize, 4), G += s(V.uncompressedSize, 4), G += s(P.length, 2), G += s(D.length, 2), { fileRecord: _.LOCAL_FILE_HEADER + G + P + D, dirRecord: _.CENTRAL_FILE_HEADER + s(X, 2) + G + s(q.length, 2) + "\0\0\0\0" + s(z, 4) + s(l, 4) + P + D + q };
|
|
146
|
+
}
|
|
147
|
+
var n = g("../utils"), u = g("../stream/GenericWorker"), c = g("../utf8"), v = g("../crc32"), _ = g("../signature");
|
|
148
|
+
function m(i, d, r, l) {
|
|
149
|
+
u.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = d, this.zipPlatform = r, this.encodeFileName = l, this.streamFiles = i, this.accumulate = !1, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = [];
|
|
150
|
+
}
|
|
151
|
+
n.inherits(m, u), m.prototype.push = function(i) {
|
|
152
|
+
var d = i.meta.percent || 0, r = this.entriesCount, l = this._sources.length;
|
|
153
|
+
this.accumulate ? this.contentBuffer.push(i) : (this.bytesWritten += i.data.length, u.prototype.push.call(this, { data: i.data, meta: { currentFile: this.currentFile, percent: r ? (d + 100 * (r - l - 1)) / r : 100 } }));
|
|
154
|
+
}, m.prototype.openedSource = function(i) {
|
|
155
|
+
this.currentSourceOffset = this.bytesWritten, this.currentFile = i.file.name;
|
|
156
|
+
var d = this.streamFiles && !i.file.dir;
|
|
157
|
+
if (d) {
|
|
158
|
+
var r = o(i, d, !1, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
|
|
159
|
+
this.push({ data: r.fileRecord, meta: { percent: 0 } });
|
|
160
|
+
} else this.accumulate = !0;
|
|
161
|
+
}, m.prototype.closedSource = function(i) {
|
|
162
|
+
this.accumulate = !1;
|
|
163
|
+
var d = this.streamFiles && !i.file.dir, r = o(i, d, !0, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
|
|
164
|
+
if (this.dirRecords.push(r.dirRecord), d) this.push({ data: function(l) {
|
|
165
|
+
return _.DATA_DESCRIPTOR + s(l.crc32, 4) + s(l.compressedSize, 4) + s(l.uncompressedSize, 4);
|
|
166
|
+
}(i), meta: { percent: 100 } });
|
|
167
|
+
else for (this.push({ data: r.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift());
|
|
168
|
+
this.currentFile = null;
|
|
169
|
+
}, m.prototype.flush = function() {
|
|
170
|
+
for (var i = this.bytesWritten, d = 0; d < this.dirRecords.length; d++) this.push({ data: this.dirRecords[d], meta: { percent: 100 } });
|
|
171
|
+
var r = this.bytesWritten - i, l = function(a, p, y, S, x) {
|
|
172
|
+
var F = n.transformTo("string", x(S));
|
|
173
|
+
return _.CENTRAL_DIRECTORY_END + "\0\0\0\0" + s(a, 2) + s(a, 2) + s(p, 4) + s(y, 4) + s(F.length, 2) + F;
|
|
174
|
+
}(this.dirRecords.length, r, i, this.zipComment, this.encodeFileName);
|
|
175
|
+
this.push({ data: l, meta: { percent: 100 } });
|
|
176
|
+
}, m.prototype.prepareNextSource = function() {
|
|
177
|
+
this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume();
|
|
178
|
+
}, m.prototype.registerPrevious = function(i) {
|
|
179
|
+
this._sources.push(i);
|
|
180
|
+
var d = this;
|
|
181
|
+
return i.on("data", function(r) {
|
|
182
|
+
d.processChunk(r);
|
|
183
|
+
}), i.on("end", function() {
|
|
184
|
+
d.closedSource(d.previous.streamInfo), d._sources.length ? d.prepareNextSource() : d.end();
|
|
185
|
+
}), i.on("error", function(r) {
|
|
186
|
+
d.error(r);
|
|
187
|
+
}), this;
|
|
188
|
+
}, m.prototype.resume = function() {
|
|
189
|
+
return !!u.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), !0) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), !0));
|
|
190
|
+
}, m.prototype.error = function(i) {
|
|
191
|
+
var d = this._sources;
|
|
192
|
+
if (!u.prototype.error.call(this, i)) return !1;
|
|
193
|
+
for (var r = 0; r < d.length; r++) try {
|
|
194
|
+
d[r].error(i);
|
|
195
|
+
} catch {
|
|
196
|
+
}
|
|
197
|
+
return !0;
|
|
198
|
+
}, m.prototype.lock = function() {
|
|
199
|
+
u.prototype.lock.call(this);
|
|
200
|
+
for (var i = this._sources, d = 0; d < i.length; d++) i[d].lock();
|
|
201
|
+
}, I.exports = m;
|
|
202
|
+
}, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(g, I, w) {
|
|
203
|
+
var s = g("../compressions"), o = g("./ZipFileWorker");
|
|
204
|
+
w.generateWorker = function(n, u, c) {
|
|
205
|
+
var v = new o(u.streamFiles, c, u.platform, u.encodeFileName), _ = 0;
|
|
206
|
+
try {
|
|
207
|
+
n.forEach(function(m, i) {
|
|
208
|
+
_++;
|
|
209
|
+
var d = function(p, y) {
|
|
210
|
+
var S = p || y, x = s[S];
|
|
211
|
+
if (!x) throw new Error(S + " is not a valid compression method !");
|
|
212
|
+
return x;
|
|
213
|
+
}(i.options.compression, u.compression), r = i.options.compressionOptions || u.compressionOptions || {}, l = i.dir, a = i.date;
|
|
214
|
+
i._compressWorker(d, r).withStreamInfo("file", { name: m, dir: l, date: a, comment: i.comment || "", unixPermissions: i.unixPermissions, dosPermissions: i.dosPermissions }).pipe(v);
|
|
215
|
+
}), v.entriesCount = _;
|
|
216
|
+
} catch (m) {
|
|
217
|
+
v.error(m);
|
|
218
|
+
}
|
|
219
|
+
return v;
|
|
220
|
+
};
|
|
221
|
+
}, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(g, I, w) {
|
|
222
|
+
function s() {
|
|
223
|
+
if (!(this instanceof s)) return new s();
|
|
224
|
+
if (arguments.length) throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
225
|
+
this.files = /* @__PURE__ */ Object.create(null), this.comment = null, this.root = "", this.clone = function() {
|
|
226
|
+
var o = new s();
|
|
227
|
+
for (var n in this) typeof this[n] != "function" && (o[n] = this[n]);
|
|
228
|
+
return o;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
(s.prototype = g("./object")).loadAsync = g("./load"), s.support = g("./support"), s.defaults = g("./defaults"), s.version = "3.10.1", s.loadAsync = function(o, n) {
|
|
232
|
+
return new s().loadAsync(o, n);
|
|
233
|
+
}, s.external = g("./external"), I.exports = s;
|
|
234
|
+
}, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(g, I, w) {
|
|
235
|
+
var s = g("./utils"), o = g("./external"), n = g("./utf8"), u = g("./zipEntries"), c = g("./stream/Crc32Probe"), v = g("./nodejsUtils");
|
|
236
|
+
function _(m) {
|
|
237
|
+
return new o.Promise(function(i, d) {
|
|
238
|
+
var r = m.decompressed.getContentWorker().pipe(new c());
|
|
239
|
+
r.on("error", function(l) {
|
|
240
|
+
d(l);
|
|
241
|
+
}).on("end", function() {
|
|
242
|
+
r.streamInfo.crc32 !== m.decompressed.crc32 ? d(new Error("Corrupted zip : CRC32 mismatch")) : i();
|
|
243
|
+
}).resume();
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
I.exports = function(m, i) {
|
|
247
|
+
var d = this;
|
|
248
|
+
return i = s.extend(i || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: n.utf8decode }), v.isNode && v.isStream(m) ? o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : s.prepareContent("the loaded zip file", m, !0, i.optimizedBinaryString, i.base64).then(function(r) {
|
|
249
|
+
var l = new u(i);
|
|
250
|
+
return l.load(r), l;
|
|
251
|
+
}).then(function(r) {
|
|
252
|
+
var l = [o.Promise.resolve(r)], a = r.files;
|
|
253
|
+
if (i.checkCRC32) for (var p = 0; p < a.length; p++) l.push(_(a[p]));
|
|
254
|
+
return o.Promise.all(l);
|
|
255
|
+
}).then(function(r) {
|
|
256
|
+
for (var l = r.shift(), a = l.files, p = 0; p < a.length; p++) {
|
|
257
|
+
var y = a[p], S = y.fileNameStr, x = s.resolve(y.fileNameStr);
|
|
258
|
+
d.file(x, y.decompressed, { binary: !0, optimizedBinaryString: !0, date: y.date, dir: y.dir, comment: y.fileCommentStr.length ? y.fileCommentStr : null, unixPermissions: y.unixPermissions, dosPermissions: y.dosPermissions, createFolders: i.createFolders }), y.dir || (d.file(x).unsafeOriginalName = S);
|
|
259
|
+
}
|
|
260
|
+
return l.zipComment.length && (d.comment = l.zipComment), d;
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
}, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(g, I, w) {
|
|
264
|
+
var s = g("../utils"), o = g("../stream/GenericWorker");
|
|
265
|
+
function n(u, c) {
|
|
266
|
+
o.call(this, "Nodejs stream input adapter for " + u), this._upstreamEnded = !1, this._bindStream(c);
|
|
267
|
+
}
|
|
268
|
+
s.inherits(n, o), n.prototype._bindStream = function(u) {
|
|
269
|
+
var c = this;
|
|
270
|
+
(this._stream = u).pause(), u.on("data", function(v) {
|
|
271
|
+
c.push({ data: v, meta: { percent: 0 } });
|
|
272
|
+
}).on("error", function(v) {
|
|
273
|
+
c.isPaused ? this.generatedError = v : c.error(v);
|
|
274
|
+
}).on("end", function() {
|
|
275
|
+
c.isPaused ? c._upstreamEnded = !0 : c.end();
|
|
276
|
+
});
|
|
277
|
+
}, n.prototype.pause = function() {
|
|
278
|
+
return !!o.prototype.pause.call(this) && (this._stream.pause(), !0);
|
|
279
|
+
}, n.prototype.resume = function() {
|
|
280
|
+
return !!o.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), !0);
|
|
281
|
+
}, I.exports = n;
|
|
282
|
+
}, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(g, I, w) {
|
|
283
|
+
var s = g("readable-stream").Readable;
|
|
284
|
+
function o(n, u, c) {
|
|
285
|
+
s.call(this, u), this._helper = n;
|
|
286
|
+
var v = this;
|
|
287
|
+
n.on("data", function(_, m) {
|
|
288
|
+
v.push(_) || v._helper.pause(), c && c(m);
|
|
289
|
+
}).on("error", function(_) {
|
|
290
|
+
v.emit("error", _);
|
|
291
|
+
}).on("end", function() {
|
|
292
|
+
v.push(null);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
g("../utils").inherits(o, s), o.prototype._read = function() {
|
|
296
|
+
this._helper.resume();
|
|
297
|
+
}, I.exports = o;
|
|
298
|
+
}, { "../utils": 32, "readable-stream": 16 }], 14: [function(g, I, w) {
|
|
299
|
+
I.exports = { isNode: typeof Buffer < "u", newBufferFrom: function(s, o) {
|
|
300
|
+
if (Buffer.from && Buffer.from !== Uint8Array.from) return Buffer.from(s, o);
|
|
301
|
+
if (typeof s == "number") throw new Error('The "data" argument must not be a number');
|
|
302
|
+
return new Buffer(s, o);
|
|
303
|
+
}, allocBuffer: function(s) {
|
|
304
|
+
if (Buffer.alloc) return Buffer.alloc(s);
|
|
305
|
+
var o = new Buffer(s);
|
|
306
|
+
return o.fill(0), o;
|
|
307
|
+
}, isBuffer: function(s) {
|
|
308
|
+
return Buffer.isBuffer(s);
|
|
309
|
+
}, isStream: function(s) {
|
|
310
|
+
return s && typeof s.on == "function" && typeof s.pause == "function" && typeof s.resume == "function";
|
|
311
|
+
} };
|
|
312
|
+
}, {}], 15: [function(g, I, w) {
|
|
313
|
+
function s(x, F, B) {
|
|
314
|
+
var P, O = n.getTypeOf(F), W = n.extend(B || {}, v);
|
|
315
|
+
W.date = W.date || /* @__PURE__ */ new Date(), W.compression !== null && (W.compression = W.compression.toUpperCase()), typeof W.unixPermissions == "string" && (W.unixPermissions = parseInt(W.unixPermissions, 8)), W.unixPermissions && 16384 & W.unixPermissions && (W.dir = !0), W.dosPermissions && 16 & W.dosPermissions && (W.dir = !0), W.dir && (x = a(x)), W.createFolders && (P = l(x)) && p.call(this, P, !0);
|
|
316
|
+
var q = O === "string" && W.binary === !1 && W.base64 === !1;
|
|
317
|
+
B && B.binary !== void 0 || (W.binary = !q), (F instanceof _ && F.uncompressedSize === 0 || W.dir || !F || F.length === 0) && (W.base64 = !1, W.binary = !0, F = "", W.compression = "STORE", O = "string");
|
|
318
|
+
var b = null;
|
|
319
|
+
b = F instanceof _ || F instanceof u ? F : d.isNode && d.isStream(F) ? new r(x, F) : n.prepareContent(x, F, W.binary, W.optimizedBinaryString, W.base64);
|
|
320
|
+
var R = new m(x, b, W);
|
|
321
|
+
this.files[x] = R;
|
|
322
|
+
}
|
|
323
|
+
var o = g("./utf8"), n = g("./utils"), u = g("./stream/GenericWorker"), c = g("./stream/StreamHelper"), v = g("./defaults"), _ = g("./compressedObject"), m = g("./zipObject"), i = g("./generate"), d = g("./nodejsUtils"), r = g("./nodejs/NodejsStreamInputAdapter"), l = function(x) {
|
|
324
|
+
x.slice(-1) === "/" && (x = x.substring(0, x.length - 1));
|
|
325
|
+
var F = x.lastIndexOf("/");
|
|
326
|
+
return 0 < F ? x.substring(0, F) : "";
|
|
327
|
+
}, a = function(x) {
|
|
328
|
+
return x.slice(-1) !== "/" && (x += "/"), x;
|
|
329
|
+
}, p = function(x, F) {
|
|
330
|
+
return F = F !== void 0 ? F : v.createFolders, x = a(x), this.files[x] || s.call(this, x, null, { dir: !0, createFolders: F }), this.files[x];
|
|
331
|
+
};
|
|
332
|
+
function y(x) {
|
|
333
|
+
return Object.prototype.toString.call(x) === "[object RegExp]";
|
|
334
|
+
}
|
|
335
|
+
var S = { load: function() {
|
|
336
|
+
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
337
|
+
}, forEach: function(x) {
|
|
338
|
+
var F, B, P;
|
|
339
|
+
for (F in this.files) P = this.files[F], (B = F.slice(this.root.length, F.length)) && F.slice(0, this.root.length) === this.root && x(B, P);
|
|
340
|
+
}, filter: function(x) {
|
|
341
|
+
var F = [];
|
|
342
|
+
return this.forEach(function(B, P) {
|
|
343
|
+
x(B, P) && F.push(P);
|
|
344
|
+
}), F;
|
|
345
|
+
}, file: function(x, F, B) {
|
|
346
|
+
if (arguments.length !== 1) return x = this.root + x, s.call(this, x, F, B), this;
|
|
347
|
+
if (y(x)) {
|
|
348
|
+
var P = x;
|
|
349
|
+
return this.filter(function(W, q) {
|
|
350
|
+
return !q.dir && P.test(W);
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
var O = this.files[this.root + x];
|
|
354
|
+
return O && !O.dir ? O : null;
|
|
355
|
+
}, folder: function(x) {
|
|
356
|
+
if (!x) return this;
|
|
357
|
+
if (y(x)) return this.filter(function(O, W) {
|
|
358
|
+
return W.dir && x.test(O);
|
|
359
|
+
});
|
|
360
|
+
var F = this.root + x, B = p.call(this, F), P = this.clone();
|
|
361
|
+
return P.root = B.name, P;
|
|
362
|
+
}, remove: function(x) {
|
|
363
|
+
x = this.root + x;
|
|
364
|
+
var F = this.files[x];
|
|
365
|
+
if (F || (x.slice(-1) !== "/" && (x += "/"), F = this.files[x]), F && !F.dir) delete this.files[x];
|
|
366
|
+
else for (var B = this.filter(function(O, W) {
|
|
367
|
+
return W.name.slice(0, x.length) === x;
|
|
368
|
+
}), P = 0; P < B.length; P++) delete this.files[B[P].name];
|
|
369
|
+
return this;
|
|
370
|
+
}, generate: function() {
|
|
371
|
+
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
372
|
+
}, generateInternalStream: function(x) {
|
|
373
|
+
var F, B = {};
|
|
374
|
+
try {
|
|
375
|
+
if ((B = n.extend(x || {}, { streamFiles: !1, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: o.utf8encode })).type = B.type.toLowerCase(), B.compression = B.compression.toUpperCase(), B.type === "binarystring" && (B.type = "string"), !B.type) throw new Error("No output type specified.");
|
|
376
|
+
n.checkSupport(B.type), B.platform !== "darwin" && B.platform !== "freebsd" && B.platform !== "linux" && B.platform !== "sunos" || (B.platform = "UNIX"), B.platform === "win32" && (B.platform = "DOS");
|
|
377
|
+
var P = B.comment || this.comment || "";
|
|
378
|
+
F = i.generateWorker(this, B, P);
|
|
379
|
+
} catch (O) {
|
|
380
|
+
(F = new u("error")).error(O);
|
|
381
|
+
}
|
|
382
|
+
return new c(F, B.type || "string", B.mimeType);
|
|
383
|
+
}, generateAsync: function(x, F) {
|
|
384
|
+
return this.generateInternalStream(x).accumulate(F);
|
|
385
|
+
}, generateNodeStream: function(x, F) {
|
|
386
|
+
return (x = x || {}).type || (x.type = "nodebuffer"), this.generateInternalStream(x).toNodejsStream(F);
|
|
387
|
+
} };
|
|
388
|
+
I.exports = S;
|
|
389
|
+
}, { "./compressedObject": 2, "./defaults": 5, "./generate": 9, "./nodejs/NodejsStreamInputAdapter": 12, "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31, "./utils": 32, "./zipObject": 35 }], 16: [function(g, I, w) {
|
|
390
|
+
I.exports = g("stream");
|
|
391
|
+
}, { stream: void 0 }], 17: [function(g, I, w) {
|
|
392
|
+
var s = g("./DataReader");
|
|
393
|
+
function o(n) {
|
|
394
|
+
s.call(this, n);
|
|
395
|
+
for (var u = 0; u < this.data.length; u++) n[u] = 255 & n[u];
|
|
396
|
+
}
|
|
397
|
+
g("../utils").inherits(o, s), o.prototype.byteAt = function(n) {
|
|
398
|
+
return this.data[this.zero + n];
|
|
399
|
+
}, o.prototype.lastIndexOfSignature = function(n) {
|
|
400
|
+
for (var u = n.charCodeAt(0), c = n.charCodeAt(1), v = n.charCodeAt(2), _ = n.charCodeAt(3), m = this.length - 4; 0 <= m; --m) if (this.data[m] === u && this.data[m + 1] === c && this.data[m + 2] === v && this.data[m + 3] === _) return m - this.zero;
|
|
401
|
+
return -1;
|
|
402
|
+
}, o.prototype.readAndCheckSignature = function(n) {
|
|
403
|
+
var u = n.charCodeAt(0), c = n.charCodeAt(1), v = n.charCodeAt(2), _ = n.charCodeAt(3), m = this.readData(4);
|
|
404
|
+
return u === m[0] && c === m[1] && v === m[2] && _ === m[3];
|
|
405
|
+
}, o.prototype.readData = function(n) {
|
|
406
|
+
if (this.checkOffset(n), n === 0) return [];
|
|
407
|
+
var u = this.data.slice(this.zero + this.index, this.zero + this.index + n);
|
|
408
|
+
return this.index += n, u;
|
|
409
|
+
}, I.exports = o;
|
|
410
|
+
}, { "../utils": 32, "./DataReader": 18 }], 18: [function(g, I, w) {
|
|
411
|
+
var s = g("../utils");
|
|
412
|
+
function o(n) {
|
|
413
|
+
this.data = n, this.length = n.length, this.index = 0, this.zero = 0;
|
|
414
|
+
}
|
|
415
|
+
o.prototype = { checkOffset: function(n) {
|
|
416
|
+
this.checkIndex(this.index + n);
|
|
417
|
+
}, checkIndex: function(n) {
|
|
418
|
+
if (this.length < this.zero + n || n < 0) throw new Error("End of data reached (data length = " + this.length + ", asked index = " + n + "). Corrupted zip ?");
|
|
419
|
+
}, setIndex: function(n) {
|
|
420
|
+
this.checkIndex(n), this.index = n;
|
|
421
|
+
}, skip: function(n) {
|
|
422
|
+
this.setIndex(this.index + n);
|
|
423
|
+
}, byteAt: function() {
|
|
424
|
+
}, readInt: function(n) {
|
|
425
|
+
var u, c = 0;
|
|
426
|
+
for (this.checkOffset(n), u = this.index + n - 1; u >= this.index; u--) c = (c << 8) + this.byteAt(u);
|
|
427
|
+
return this.index += n, c;
|
|
428
|
+
}, readString: function(n) {
|
|
429
|
+
return s.transformTo("string", this.readData(n));
|
|
430
|
+
}, readData: function() {
|
|
431
|
+
}, lastIndexOfSignature: function() {
|
|
432
|
+
}, readAndCheckSignature: function() {
|
|
433
|
+
}, readDate: function() {
|
|
434
|
+
var n = this.readInt(4);
|
|
435
|
+
return new Date(Date.UTC(1980 + (n >> 25 & 127), (n >> 21 & 15) - 1, n >> 16 & 31, n >> 11 & 31, n >> 5 & 63, (31 & n) << 1));
|
|
436
|
+
} }, I.exports = o;
|
|
437
|
+
}, { "../utils": 32 }], 19: [function(g, I, w) {
|
|
438
|
+
var s = g("./Uint8ArrayReader");
|
|
439
|
+
function o(n) {
|
|
440
|
+
s.call(this, n);
|
|
441
|
+
}
|
|
442
|
+
g("../utils").inherits(o, s), o.prototype.readData = function(n) {
|
|
443
|
+
this.checkOffset(n);
|
|
444
|
+
var u = this.data.slice(this.zero + this.index, this.zero + this.index + n);
|
|
445
|
+
return this.index += n, u;
|
|
446
|
+
}, I.exports = o;
|
|
447
|
+
}, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function(g, I, w) {
|
|
448
|
+
var s = g("./DataReader");
|
|
449
|
+
function o(n) {
|
|
450
|
+
s.call(this, n);
|
|
451
|
+
}
|
|
452
|
+
g("../utils").inherits(o, s), o.prototype.byteAt = function(n) {
|
|
453
|
+
return this.data.charCodeAt(this.zero + n);
|
|
454
|
+
}, o.prototype.lastIndexOfSignature = function(n) {
|
|
455
|
+
return this.data.lastIndexOf(n) - this.zero;
|
|
456
|
+
}, o.prototype.readAndCheckSignature = function(n) {
|
|
457
|
+
return n === this.readData(4);
|
|
458
|
+
}, o.prototype.readData = function(n) {
|
|
459
|
+
this.checkOffset(n);
|
|
460
|
+
var u = this.data.slice(this.zero + this.index, this.zero + this.index + n);
|
|
461
|
+
return this.index += n, u;
|
|
462
|
+
}, I.exports = o;
|
|
463
|
+
}, { "../utils": 32, "./DataReader": 18 }], 21: [function(g, I, w) {
|
|
464
|
+
var s = g("./ArrayReader");
|
|
465
|
+
function o(n) {
|
|
466
|
+
s.call(this, n);
|
|
467
|
+
}
|
|
468
|
+
g("../utils").inherits(o, s), o.prototype.readData = function(n) {
|
|
469
|
+
if (this.checkOffset(n), n === 0) return new Uint8Array(0);
|
|
470
|
+
var u = this.data.subarray(this.zero + this.index, this.zero + this.index + n);
|
|
471
|
+
return this.index += n, u;
|
|
472
|
+
}, I.exports = o;
|
|
473
|
+
}, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(g, I, w) {
|
|
474
|
+
var s = g("../utils"), o = g("../support"), n = g("./ArrayReader"), u = g("./StringReader"), c = g("./NodeBufferReader"), v = g("./Uint8ArrayReader");
|
|
475
|
+
I.exports = function(_) {
|
|
476
|
+
var m = s.getTypeOf(_);
|
|
477
|
+
return s.checkSupport(m), m !== "string" || o.uint8array ? m === "nodebuffer" ? new c(_) : o.uint8array ? new v(s.transformTo("uint8array", _)) : new n(s.transformTo("array", _)) : new u(_);
|
|
478
|
+
};
|
|
479
|
+
}, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(g, I, w) {
|
|
480
|
+
w.LOCAL_FILE_HEADER = "PK", w.CENTRAL_FILE_HEADER = "PK", w.CENTRAL_DIRECTORY_END = "PK", w.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", w.ZIP64_CENTRAL_DIRECTORY_END = "PK", w.DATA_DESCRIPTOR = "PK\x07\b";
|
|
481
|
+
}, {}], 24: [function(g, I, w) {
|
|
482
|
+
var s = g("./GenericWorker"), o = g("../utils");
|
|
483
|
+
function n(u) {
|
|
484
|
+
s.call(this, "ConvertWorker to " + u), this.destType = u;
|
|
485
|
+
}
|
|
486
|
+
o.inherits(n, s), n.prototype.processChunk = function(u) {
|
|
487
|
+
this.push({ data: o.transformTo(this.destType, u.data), meta: u.meta });
|
|
488
|
+
}, I.exports = n;
|
|
489
|
+
}, { "../utils": 32, "./GenericWorker": 28 }], 25: [function(g, I, w) {
|
|
490
|
+
var s = g("./GenericWorker"), o = g("../crc32");
|
|
491
|
+
function n() {
|
|
492
|
+
s.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0);
|
|
493
|
+
}
|
|
494
|
+
g("../utils").inherits(n, s), n.prototype.processChunk = function(u) {
|
|
495
|
+
this.streamInfo.crc32 = o(u.data, this.streamInfo.crc32 || 0), this.push(u);
|
|
496
|
+
}, I.exports = n;
|
|
497
|
+
}, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function(g, I, w) {
|
|
498
|
+
var s = g("../utils"), o = g("./GenericWorker");
|
|
499
|
+
function n(u) {
|
|
500
|
+
o.call(this, "DataLengthProbe for " + u), this.propName = u, this.withStreamInfo(u, 0);
|
|
501
|
+
}
|
|
502
|
+
s.inherits(n, o), n.prototype.processChunk = function(u) {
|
|
503
|
+
if (u) {
|
|
504
|
+
var c = this.streamInfo[this.propName] || 0;
|
|
505
|
+
this.streamInfo[this.propName] = c + u.data.length;
|
|
506
|
+
}
|
|
507
|
+
o.prototype.processChunk.call(this, u);
|
|
508
|
+
}, I.exports = n;
|
|
509
|
+
}, { "../utils": 32, "./GenericWorker": 28 }], 27: [function(g, I, w) {
|
|
510
|
+
var s = g("../utils"), o = g("./GenericWorker");
|
|
511
|
+
function n(u) {
|
|
512
|
+
o.call(this, "DataWorker");
|
|
513
|
+
var c = this;
|
|
514
|
+
this.dataIsReady = !1, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = !1, u.then(function(v) {
|
|
515
|
+
c.dataIsReady = !0, c.data = v, c.max = v && v.length || 0, c.type = s.getTypeOf(v), c.isPaused || c._tickAndRepeat();
|
|
516
|
+
}, function(v) {
|
|
517
|
+
c.error(v);
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
s.inherits(n, o), n.prototype.cleanUp = function() {
|
|
521
|
+
o.prototype.cleanUp.call(this), this.data = null;
|
|
522
|
+
}, n.prototype.resume = function() {
|
|
523
|
+
return !!o.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = !0, s.delay(this._tickAndRepeat, [], this)), !0);
|
|
524
|
+
}, n.prototype._tickAndRepeat = function() {
|
|
525
|
+
this._tickScheduled = !1, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (s.delay(this._tickAndRepeat, [], this), this._tickScheduled = !0));
|
|
526
|
+
}, n.prototype._tick = function() {
|
|
527
|
+
if (this.isPaused || this.isFinished) return !1;
|
|
528
|
+
var u = null, c = Math.min(this.max, this.index + 16384);
|
|
529
|
+
if (this.index >= this.max) return this.end();
|
|
530
|
+
switch (this.type) {
|
|
531
|
+
case "string":
|
|
532
|
+
u = this.data.substring(this.index, c);
|
|
533
|
+
break;
|
|
534
|
+
case "uint8array":
|
|
535
|
+
u = this.data.subarray(this.index, c);
|
|
536
|
+
break;
|
|
537
|
+
case "array":
|
|
538
|
+
case "nodebuffer":
|
|
539
|
+
u = this.data.slice(this.index, c);
|
|
540
|
+
}
|
|
541
|
+
return this.index = c, this.push({ data: u, meta: { percent: this.max ? this.index / this.max * 100 : 0 } });
|
|
542
|
+
}, I.exports = n;
|
|
543
|
+
}, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(g, I, w) {
|
|
544
|
+
function s(o) {
|
|
545
|
+
this.name = o || "default", this.streamInfo = {}, this.generatedError = null, this.extraStreamInfo = {}, this.isPaused = !0, this.isFinished = !1, this.isLocked = !1, this._listeners = { data: [], end: [], error: [] }, this.previous = null;
|
|
546
|
+
}
|
|
547
|
+
s.prototype = { push: function(o) {
|
|
548
|
+
this.emit("data", o);
|
|
549
|
+
}, end: function() {
|
|
550
|
+
if (this.isFinished) return !1;
|
|
551
|
+
this.flush();
|
|
552
|
+
try {
|
|
553
|
+
this.emit("end"), this.cleanUp(), this.isFinished = !0;
|
|
554
|
+
} catch (o) {
|
|
555
|
+
this.emit("error", o);
|
|
556
|
+
}
|
|
557
|
+
return !0;
|
|
558
|
+
}, error: function(o) {
|
|
559
|
+
return !this.isFinished && (this.isPaused ? this.generatedError = o : (this.isFinished = !0, this.emit("error", o), this.previous && this.previous.error(o), this.cleanUp()), !0);
|
|
560
|
+
}, on: function(o, n) {
|
|
561
|
+
return this._listeners[o].push(n), this;
|
|
562
|
+
}, cleanUp: function() {
|
|
563
|
+
this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = [];
|
|
564
|
+
}, emit: function(o, n) {
|
|
565
|
+
if (this._listeners[o]) for (var u = 0; u < this._listeners[o].length; u++) this._listeners[o][u].call(this, n);
|
|
566
|
+
}, pipe: function(o) {
|
|
567
|
+
return o.registerPrevious(this);
|
|
568
|
+
}, registerPrevious: function(o) {
|
|
569
|
+
if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.");
|
|
570
|
+
this.streamInfo = o.streamInfo, this.mergeStreamInfo(), this.previous = o;
|
|
571
|
+
var n = this;
|
|
572
|
+
return o.on("data", function(u) {
|
|
573
|
+
n.processChunk(u);
|
|
574
|
+
}), o.on("end", function() {
|
|
575
|
+
n.end();
|
|
576
|
+
}), o.on("error", function(u) {
|
|
577
|
+
n.error(u);
|
|
578
|
+
}), this;
|
|
579
|
+
}, pause: function() {
|
|
580
|
+
return !this.isPaused && !this.isFinished && (this.isPaused = !0, this.previous && this.previous.pause(), !0);
|
|
581
|
+
}, resume: function() {
|
|
582
|
+
if (!this.isPaused || this.isFinished) return !1;
|
|
583
|
+
var o = this.isPaused = !1;
|
|
584
|
+
return this.generatedError && (this.error(this.generatedError), o = !0), this.previous && this.previous.resume(), !o;
|
|
585
|
+
}, flush: function() {
|
|
586
|
+
}, processChunk: function(o) {
|
|
587
|
+
this.push(o);
|
|
588
|
+
}, withStreamInfo: function(o, n) {
|
|
589
|
+
return this.extraStreamInfo[o] = n, this.mergeStreamInfo(), this;
|
|
590
|
+
}, mergeStreamInfo: function() {
|
|
591
|
+
for (var o in this.extraStreamInfo) Object.prototype.hasOwnProperty.call(this.extraStreamInfo, o) && (this.streamInfo[o] = this.extraStreamInfo[o]);
|
|
592
|
+
}, lock: function() {
|
|
593
|
+
if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.");
|
|
594
|
+
this.isLocked = !0, this.previous && this.previous.lock();
|
|
595
|
+
}, toString: function() {
|
|
596
|
+
var o = "Worker " + this.name;
|
|
597
|
+
return this.previous ? this.previous + " -> " + o : o;
|
|
598
|
+
} }, I.exports = s;
|
|
599
|
+
}, {}], 29: [function(g, I, w) {
|
|
600
|
+
var s = g("../utils"), o = g("./ConvertWorker"), n = g("./GenericWorker"), u = g("../base64"), c = g("../support"), v = g("../external"), _ = null;
|
|
601
|
+
if (c.nodestream) try {
|
|
602
|
+
_ = g("../nodejs/NodejsStreamOutputAdapter");
|
|
603
|
+
} catch {
|
|
604
|
+
}
|
|
605
|
+
function m(d, r) {
|
|
606
|
+
return new v.Promise(function(l, a) {
|
|
607
|
+
var p = [], y = d._internalType, S = d._outputType, x = d._mimeType;
|
|
608
|
+
d.on("data", function(F, B) {
|
|
609
|
+
p.push(F), r && r(B);
|
|
610
|
+
}).on("error", function(F) {
|
|
611
|
+
p = [], a(F);
|
|
612
|
+
}).on("end", function() {
|
|
613
|
+
try {
|
|
614
|
+
var F = function(B, P, O) {
|
|
615
|
+
switch (B) {
|
|
616
|
+
case "blob":
|
|
617
|
+
return s.newBlob(s.transformTo("arraybuffer", P), O);
|
|
618
|
+
case "base64":
|
|
619
|
+
return u.encode(P);
|
|
620
|
+
default:
|
|
621
|
+
return s.transformTo(B, P);
|
|
622
|
+
}
|
|
623
|
+
}(S, function(B, P) {
|
|
624
|
+
var O, W = 0, q = null, b = 0;
|
|
625
|
+
for (O = 0; O < P.length; O++) b += P[O].length;
|
|
626
|
+
switch (B) {
|
|
627
|
+
case "string":
|
|
628
|
+
return P.join("");
|
|
629
|
+
case "array":
|
|
630
|
+
return Array.prototype.concat.apply([], P);
|
|
631
|
+
case "uint8array":
|
|
632
|
+
for (q = new Uint8Array(b), O = 0; O < P.length; O++) q.set(P[O], W), W += P[O].length;
|
|
633
|
+
return q;
|
|
634
|
+
case "nodebuffer":
|
|
635
|
+
return Buffer.concat(P);
|
|
636
|
+
default:
|
|
637
|
+
throw new Error("concat : unsupported type '" + B + "'");
|
|
638
|
+
}
|
|
639
|
+
}(y, p), x);
|
|
640
|
+
l(F);
|
|
641
|
+
} catch (B) {
|
|
642
|
+
a(B);
|
|
643
|
+
}
|
|
644
|
+
p = [];
|
|
645
|
+
}).resume();
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
function i(d, r, l) {
|
|
649
|
+
var a = r;
|
|
650
|
+
switch (r) {
|
|
651
|
+
case "blob":
|
|
652
|
+
case "arraybuffer":
|
|
653
|
+
a = "uint8array";
|
|
654
|
+
break;
|
|
655
|
+
case "base64":
|
|
656
|
+
a = "string";
|
|
657
|
+
}
|
|
658
|
+
try {
|
|
659
|
+
this._internalType = a, this._outputType = r, this._mimeType = l, s.checkSupport(a), this._worker = d.pipe(new o(a)), d.lock();
|
|
660
|
+
} catch (p) {
|
|
661
|
+
this._worker = new n("error"), this._worker.error(p);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
i.prototype = { accumulate: function(d) {
|
|
665
|
+
return m(this, d);
|
|
666
|
+
}, on: function(d, r) {
|
|
667
|
+
var l = this;
|
|
668
|
+
return d === "data" ? this._worker.on(d, function(a) {
|
|
669
|
+
r.call(l, a.data, a.meta);
|
|
670
|
+
}) : this._worker.on(d, function() {
|
|
671
|
+
s.delay(r, arguments, l);
|
|
672
|
+
}), this;
|
|
673
|
+
}, resume: function() {
|
|
674
|
+
return s.delay(this._worker.resume, [], this._worker), this;
|
|
675
|
+
}, pause: function() {
|
|
676
|
+
return this._worker.pause(), this;
|
|
677
|
+
}, toNodejsStream: function(d) {
|
|
678
|
+
if (s.checkSupport("nodestream"), this._outputType !== "nodebuffer") throw new Error(this._outputType + " is not supported by this method");
|
|
679
|
+
return new _(this, { objectMode: this._outputType !== "nodebuffer" }, d);
|
|
680
|
+
} }, I.exports = i;
|
|
681
|
+
}, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function(g, I, w) {
|
|
682
|
+
if (w.base64 = !0, w.array = !0, w.string = !0, w.arraybuffer = typeof ArrayBuffer < "u" && typeof Uint8Array < "u", w.nodebuffer = typeof Buffer < "u", w.uint8array = typeof Uint8Array < "u", typeof ArrayBuffer > "u") w.blob = !1;
|
|
683
|
+
else {
|
|
684
|
+
var s = new ArrayBuffer(0);
|
|
685
|
+
try {
|
|
686
|
+
w.blob = new Blob([s], { type: "application/zip" }).size === 0;
|
|
687
|
+
} catch {
|
|
688
|
+
try {
|
|
689
|
+
var o = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
|
|
690
|
+
o.append(s), w.blob = o.getBlob("application/zip").size === 0;
|
|
691
|
+
} catch {
|
|
692
|
+
w.blob = !1;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
try {
|
|
697
|
+
w.nodestream = !!g("readable-stream").Readable;
|
|
698
|
+
} catch {
|
|
699
|
+
w.nodestream = !1;
|
|
700
|
+
}
|
|
701
|
+
}, { "readable-stream": 16 }], 31: [function(g, I, w) {
|
|
702
|
+
for (var s = g("./utils"), o = g("./support"), n = g("./nodejsUtils"), u = g("./stream/GenericWorker"), c = new Array(256), v = 0; v < 256; v++) c[v] = 252 <= v ? 6 : 248 <= v ? 5 : 240 <= v ? 4 : 224 <= v ? 3 : 192 <= v ? 2 : 1;
|
|
703
|
+
c[254] = c[254] = 1;
|
|
704
|
+
function _() {
|
|
705
|
+
u.call(this, "utf-8 decode"), this.leftOver = null;
|
|
706
|
+
}
|
|
707
|
+
function m() {
|
|
708
|
+
u.call(this, "utf-8 encode");
|
|
709
|
+
}
|
|
710
|
+
w.utf8encode = function(i) {
|
|
711
|
+
return o.nodebuffer ? n.newBufferFrom(i, "utf-8") : function(d) {
|
|
712
|
+
var r, l, a, p, y, S = d.length, x = 0;
|
|
713
|
+
for (p = 0; p < S; p++) (64512 & (l = d.charCodeAt(p))) == 55296 && p + 1 < S && (64512 & (a = d.charCodeAt(p + 1))) == 56320 && (l = 65536 + (l - 55296 << 10) + (a - 56320), p++), x += l < 128 ? 1 : l < 2048 ? 2 : l < 65536 ? 3 : 4;
|
|
714
|
+
for (r = o.uint8array ? new Uint8Array(x) : new Array(x), p = y = 0; y < x; p++) (64512 & (l = d.charCodeAt(p))) == 55296 && p + 1 < S && (64512 & (a = d.charCodeAt(p + 1))) == 56320 && (l = 65536 + (l - 55296 << 10) + (a - 56320), p++), l < 128 ? r[y++] = l : (l < 2048 ? r[y++] = 192 | l >>> 6 : (l < 65536 ? r[y++] = 224 | l >>> 12 : (r[y++] = 240 | l >>> 18, r[y++] = 128 | l >>> 12 & 63), r[y++] = 128 | l >>> 6 & 63), r[y++] = 128 | 63 & l);
|
|
715
|
+
return r;
|
|
716
|
+
}(i);
|
|
717
|
+
}, w.utf8decode = function(i) {
|
|
718
|
+
return o.nodebuffer ? s.transformTo("nodebuffer", i).toString("utf-8") : function(d) {
|
|
719
|
+
var r, l, a, p, y = d.length, S = new Array(2 * y);
|
|
720
|
+
for (r = l = 0; r < y; ) if ((a = d[r++]) < 128) S[l++] = a;
|
|
721
|
+
else if (4 < (p = c[a])) S[l++] = 65533, r += p - 1;
|
|
722
|
+
else {
|
|
723
|
+
for (a &= p === 2 ? 31 : p === 3 ? 15 : 7; 1 < p && r < y; ) a = a << 6 | 63 & d[r++], p--;
|
|
724
|
+
1 < p ? S[l++] = 65533 : a < 65536 ? S[l++] = a : (a -= 65536, S[l++] = 55296 | a >> 10 & 1023, S[l++] = 56320 | 1023 & a);
|
|
725
|
+
}
|
|
726
|
+
return S.length !== l && (S.subarray ? S = S.subarray(0, l) : S.length = l), s.applyFromCharCode(S);
|
|
727
|
+
}(i = s.transformTo(o.uint8array ? "uint8array" : "array", i));
|
|
728
|
+
}, s.inherits(_, u), _.prototype.processChunk = function(i) {
|
|
729
|
+
var d = s.transformTo(o.uint8array ? "uint8array" : "array", i.data);
|
|
730
|
+
if (this.leftOver && this.leftOver.length) {
|
|
731
|
+
if (o.uint8array) {
|
|
732
|
+
var r = d;
|
|
733
|
+
(d = new Uint8Array(r.length + this.leftOver.length)).set(this.leftOver, 0), d.set(r, this.leftOver.length);
|
|
734
|
+
} else d = this.leftOver.concat(d);
|
|
735
|
+
this.leftOver = null;
|
|
736
|
+
}
|
|
737
|
+
var l = function(p, y) {
|
|
738
|
+
var S;
|
|
739
|
+
for ((y = y || p.length) > p.length && (y = p.length), S = y - 1; 0 <= S && (192 & p[S]) == 128; ) S--;
|
|
740
|
+
return S < 0 || S === 0 ? y : S + c[p[S]] > y ? S : y;
|
|
741
|
+
}(d), a = d;
|
|
742
|
+
l !== d.length && (o.uint8array ? (a = d.subarray(0, l), this.leftOver = d.subarray(l, d.length)) : (a = d.slice(0, l), this.leftOver = d.slice(l, d.length))), this.push({ data: w.utf8decode(a), meta: i.meta });
|
|
743
|
+
}, _.prototype.flush = function() {
|
|
744
|
+
this.leftOver && this.leftOver.length && (this.push({ data: w.utf8decode(this.leftOver), meta: {} }), this.leftOver = null);
|
|
745
|
+
}, w.Utf8DecodeWorker = _, s.inherits(m, u), m.prototype.processChunk = function(i) {
|
|
746
|
+
this.push({ data: w.utf8encode(i.data), meta: i.meta });
|
|
747
|
+
}, w.Utf8EncodeWorker = m;
|
|
748
|
+
}, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(g, I, w) {
|
|
749
|
+
var s = g("./support"), o = g("./base64"), n = g("./nodejsUtils"), u = g("./external");
|
|
750
|
+
function c(r) {
|
|
751
|
+
return r;
|
|
752
|
+
}
|
|
753
|
+
function v(r, l) {
|
|
754
|
+
for (var a = 0; a < r.length; ++a) l[a] = 255 & r.charCodeAt(a);
|
|
755
|
+
return l;
|
|
756
|
+
}
|
|
757
|
+
g("setimmediate"), w.newBlob = function(r, l) {
|
|
758
|
+
w.checkSupport("blob");
|
|
759
|
+
try {
|
|
760
|
+
return new Blob([r], { type: l });
|
|
761
|
+
} catch {
|
|
762
|
+
try {
|
|
763
|
+
var a = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
|
|
764
|
+
return a.append(r), a.getBlob(l);
|
|
765
|
+
} catch {
|
|
766
|
+
throw new Error("Bug : can't construct the Blob.");
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
var _ = { stringifyByChunk: function(r, l, a) {
|
|
771
|
+
var p = [], y = 0, S = r.length;
|
|
772
|
+
if (S <= a) return String.fromCharCode.apply(null, r);
|
|
773
|
+
for (; y < S; ) l === "array" || l === "nodebuffer" ? p.push(String.fromCharCode.apply(null, r.slice(y, Math.min(y + a, S)))) : p.push(String.fromCharCode.apply(null, r.subarray(y, Math.min(y + a, S)))), y += a;
|
|
774
|
+
return p.join("");
|
|
775
|
+
}, stringifyByChar: function(r) {
|
|
776
|
+
for (var l = "", a = 0; a < r.length; a++) l += String.fromCharCode(r[a]);
|
|
777
|
+
return l;
|
|
778
|
+
}, applyCanBeUsed: { uint8array: function() {
|
|
779
|
+
try {
|
|
780
|
+
return s.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1;
|
|
781
|
+
} catch {
|
|
782
|
+
return !1;
|
|
783
|
+
}
|
|
784
|
+
}(), nodebuffer: function() {
|
|
785
|
+
try {
|
|
786
|
+
return s.nodebuffer && String.fromCharCode.apply(null, n.allocBuffer(1)).length === 1;
|
|
787
|
+
} catch {
|
|
788
|
+
return !1;
|
|
789
|
+
}
|
|
790
|
+
}() } };
|
|
791
|
+
function m(r) {
|
|
792
|
+
var l = 65536, a = w.getTypeOf(r), p = !0;
|
|
793
|
+
if (a === "uint8array" ? p = _.applyCanBeUsed.uint8array : a === "nodebuffer" && (p = _.applyCanBeUsed.nodebuffer), p) for (; 1 < l; ) try {
|
|
794
|
+
return _.stringifyByChunk(r, a, l);
|
|
795
|
+
} catch {
|
|
796
|
+
l = Math.floor(l / 2);
|
|
797
|
+
}
|
|
798
|
+
return _.stringifyByChar(r);
|
|
799
|
+
}
|
|
800
|
+
function i(r, l) {
|
|
801
|
+
for (var a = 0; a < r.length; a++) l[a] = r[a];
|
|
802
|
+
return l;
|
|
803
|
+
}
|
|
804
|
+
w.applyFromCharCode = m;
|
|
805
|
+
var d = {};
|
|
806
|
+
d.string = { string: c, array: function(r) {
|
|
807
|
+
return v(r, new Array(r.length));
|
|
808
|
+
}, arraybuffer: function(r) {
|
|
809
|
+
return d.string.uint8array(r).buffer;
|
|
810
|
+
}, uint8array: function(r) {
|
|
811
|
+
return v(r, new Uint8Array(r.length));
|
|
812
|
+
}, nodebuffer: function(r) {
|
|
813
|
+
return v(r, n.allocBuffer(r.length));
|
|
814
|
+
} }, d.array = { string: m, array: c, arraybuffer: function(r) {
|
|
815
|
+
return new Uint8Array(r).buffer;
|
|
816
|
+
}, uint8array: function(r) {
|
|
817
|
+
return new Uint8Array(r);
|
|
818
|
+
}, nodebuffer: function(r) {
|
|
819
|
+
return n.newBufferFrom(r);
|
|
820
|
+
} }, d.arraybuffer = { string: function(r) {
|
|
821
|
+
return m(new Uint8Array(r));
|
|
822
|
+
}, array: function(r) {
|
|
823
|
+
return i(new Uint8Array(r), new Array(r.byteLength));
|
|
824
|
+
}, arraybuffer: c, uint8array: function(r) {
|
|
825
|
+
return new Uint8Array(r);
|
|
826
|
+
}, nodebuffer: function(r) {
|
|
827
|
+
return n.newBufferFrom(new Uint8Array(r));
|
|
828
|
+
} }, d.uint8array = { string: m, array: function(r) {
|
|
829
|
+
return i(r, new Array(r.length));
|
|
830
|
+
}, arraybuffer: function(r) {
|
|
831
|
+
return r.buffer;
|
|
832
|
+
}, uint8array: c, nodebuffer: function(r) {
|
|
833
|
+
return n.newBufferFrom(r);
|
|
834
|
+
} }, d.nodebuffer = { string: m, array: function(r) {
|
|
835
|
+
return i(r, new Array(r.length));
|
|
836
|
+
}, arraybuffer: function(r) {
|
|
837
|
+
return d.nodebuffer.uint8array(r).buffer;
|
|
838
|
+
}, uint8array: function(r) {
|
|
839
|
+
return i(r, new Uint8Array(r.length));
|
|
840
|
+
}, nodebuffer: c }, w.transformTo = function(r, l) {
|
|
841
|
+
if (l = l || "", !r) return l;
|
|
842
|
+
w.checkSupport(r);
|
|
843
|
+
var a = w.getTypeOf(l);
|
|
844
|
+
return d[a][r](l);
|
|
845
|
+
}, w.resolve = function(r) {
|
|
846
|
+
for (var l = r.split("/"), a = [], p = 0; p < l.length; p++) {
|
|
847
|
+
var y = l[p];
|
|
848
|
+
y === "." || y === "" && p !== 0 && p !== l.length - 1 || (y === ".." ? a.pop() : a.push(y));
|
|
849
|
+
}
|
|
850
|
+
return a.join("/");
|
|
851
|
+
}, w.getTypeOf = function(r) {
|
|
852
|
+
return typeof r == "string" ? "string" : Object.prototype.toString.call(r) === "[object Array]" ? "array" : s.nodebuffer && n.isBuffer(r) ? "nodebuffer" : s.uint8array && r instanceof Uint8Array ? "uint8array" : s.arraybuffer && r instanceof ArrayBuffer ? "arraybuffer" : void 0;
|
|
853
|
+
}, w.checkSupport = function(r) {
|
|
854
|
+
if (!s[r.toLowerCase()]) throw new Error(r + " is not supported by this platform");
|
|
855
|
+
}, w.MAX_VALUE_16BITS = 65535, w.MAX_VALUE_32BITS = -1, w.pretty = function(r) {
|
|
856
|
+
var l, a, p = "";
|
|
857
|
+
for (a = 0; a < (r || "").length; a++) p += "\\x" + ((l = r.charCodeAt(a)) < 16 ? "0" : "") + l.toString(16).toUpperCase();
|
|
858
|
+
return p;
|
|
859
|
+
}, w.delay = function(r, l, a) {
|
|
860
|
+
setImmediate(function() {
|
|
861
|
+
r.apply(a || null, l || []);
|
|
862
|
+
});
|
|
863
|
+
}, w.inherits = function(r, l) {
|
|
864
|
+
function a() {
|
|
865
|
+
}
|
|
866
|
+
a.prototype = l.prototype, r.prototype = new a();
|
|
867
|
+
}, w.extend = function() {
|
|
868
|
+
var r, l, a = {};
|
|
869
|
+
for (r = 0; r < arguments.length; r++) for (l in arguments[r]) Object.prototype.hasOwnProperty.call(arguments[r], l) && a[l] === void 0 && (a[l] = arguments[r][l]);
|
|
870
|
+
return a;
|
|
871
|
+
}, w.prepareContent = function(r, l, a, p, y) {
|
|
872
|
+
return u.Promise.resolve(l).then(function(S) {
|
|
873
|
+
return s.blob && (S instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(S)) !== -1) && typeof FileReader < "u" ? new u.Promise(function(x, F) {
|
|
874
|
+
var B = new FileReader();
|
|
875
|
+
B.onload = function(P) {
|
|
876
|
+
x(P.target.result);
|
|
877
|
+
}, B.onerror = function(P) {
|
|
878
|
+
F(P.target.error);
|
|
879
|
+
}, B.readAsArrayBuffer(S);
|
|
880
|
+
}) : S;
|
|
881
|
+
}).then(function(S) {
|
|
882
|
+
var x = w.getTypeOf(S);
|
|
883
|
+
return x ? (x === "arraybuffer" ? S = w.transformTo("uint8array", S) : x === "string" && (y ? S = o.decode(S) : a && p !== !0 && (S = function(F) {
|
|
884
|
+
return v(F, s.uint8array ? new Uint8Array(F.length) : new Array(F.length));
|
|
885
|
+
}(S))), S) : u.Promise.reject(new Error("Can't read the data of '" + r + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
|
|
886
|
+
});
|
|
887
|
+
};
|
|
888
|
+
}, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function(g, I, w) {
|
|
889
|
+
var s = g("./reader/readerFor"), o = g("./utils"), n = g("./signature"), u = g("./zipEntry"), c = g("./support");
|
|
890
|
+
function v(_) {
|
|
891
|
+
this.files = [], this.loadOptions = _;
|
|
892
|
+
}
|
|
893
|
+
v.prototype = { checkSignature: function(_) {
|
|
894
|
+
if (!this.reader.readAndCheckSignature(_)) {
|
|
895
|
+
this.reader.index -= 4;
|
|
896
|
+
var m = this.reader.readString(4);
|
|
897
|
+
throw new Error("Corrupted zip or bug: unexpected signature (" + o.pretty(m) + ", expected " + o.pretty(_) + ")");
|
|
898
|
+
}
|
|
899
|
+
}, isSignature: function(_, m) {
|
|
900
|
+
var i = this.reader.index;
|
|
901
|
+
this.reader.setIndex(_);
|
|
902
|
+
var d = this.reader.readString(4) === m;
|
|
903
|
+
return this.reader.setIndex(i), d;
|
|
904
|
+
}, readBlockEndOfCentral: function() {
|
|
905
|
+
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);
|
|
906
|
+
var _ = this.reader.readData(this.zipCommentLength), m = c.uint8array ? "uint8array" : "array", i = o.transformTo(m, _);
|
|
907
|
+
this.zipComment = this.loadOptions.decodeFileName(i);
|
|
908
|
+
}, readBlockZip64EndOfCentral: function() {
|
|
909
|
+
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 = {};
|
|
910
|
+
for (var _, m, i, d = this.zip64EndOfCentralSize - 44; 0 < d; ) _ = this.reader.readInt(2), m = this.reader.readInt(4), i = this.reader.readData(m), this.zip64ExtensibleData[_] = { id: _, length: m, value: i };
|
|
911
|
+
}, readBlockZip64EndOfCentralLocator: function() {
|
|
912
|
+
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");
|
|
913
|
+
}, readLocalFiles: function() {
|
|
914
|
+
var _, m;
|
|
915
|
+
for (_ = 0; _ < this.files.length; _++) m = this.files[_], this.reader.setIndex(m.localHeaderOffset), this.checkSignature(n.LOCAL_FILE_HEADER), m.readLocalPart(this.reader), m.handleUTF8(), m.processAttributes();
|
|
916
|
+
}, readCentralDir: function() {
|
|
917
|
+
var _;
|
|
918
|
+
for (this.reader.setIndex(this.centralDirOffset); this.reader.readAndCheckSignature(n.CENTRAL_FILE_HEADER); ) (_ = new u({ zip64: this.zip64 }, this.loadOptions)).readCentralPart(this.reader), this.files.push(_);
|
|
919
|
+
if (this.centralDirRecords !== this.files.length && this.centralDirRecords !== 0 && this.files.length === 0) throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length);
|
|
920
|
+
}, readEndOfCentral: function() {
|
|
921
|
+
var _ = this.reader.lastIndexOfSignature(n.CENTRAL_DIRECTORY_END);
|
|
922
|
+
if (_ < 0) throw this.isSignature(0, n.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");
|
|
923
|
+
this.reader.setIndex(_);
|
|
924
|
+
var m = _;
|
|
925
|
+
if (this.checkSignature(n.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) {
|
|
926
|
+
if (this.zip64 = !0, (_ = this.reader.lastIndexOfSignature(n.ZIP64_CENTRAL_DIRECTORY_LOCATOR)) < 0) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");
|
|
927
|
+
if (this.reader.setIndex(_), this.checkSignature(n.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), !this.isSignature(this.relativeOffsetEndOfZip64CentralDir, n.ZIP64_CENTRAL_DIRECTORY_END) && (this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(n.ZIP64_CENTRAL_DIRECTORY_END), this.relativeOffsetEndOfZip64CentralDir < 0)) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");
|
|
928
|
+
this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(n.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral();
|
|
929
|
+
}
|
|
930
|
+
var i = this.centralDirOffset + this.centralDirSize;
|
|
931
|
+
this.zip64 && (i += 20, i += 12 + this.zip64EndOfCentralSize);
|
|
932
|
+
var d = m - i;
|
|
933
|
+
if (0 < d) this.isSignature(m, n.CENTRAL_FILE_HEADER) || (this.reader.zero = d);
|
|
934
|
+
else if (d < 0) throw new Error("Corrupted zip: missing " + Math.abs(d) + " bytes.");
|
|
935
|
+
}, prepareReader: function(_) {
|
|
936
|
+
this.reader = s(_);
|
|
937
|
+
}, load: function(_) {
|
|
938
|
+
this.prepareReader(_), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles();
|
|
939
|
+
} }, I.exports = v;
|
|
940
|
+
}, { "./reader/readerFor": 22, "./signature": 23, "./support": 30, "./utils": 32, "./zipEntry": 34 }], 34: [function(g, I, w) {
|
|
941
|
+
var s = g("./reader/readerFor"), o = g("./utils"), n = g("./compressedObject"), u = g("./crc32"), c = g("./utf8"), v = g("./compressions"), _ = g("./support");
|
|
942
|
+
function m(i, d) {
|
|
943
|
+
this.options = i, this.loadOptions = d;
|
|
944
|
+
}
|
|
945
|
+
m.prototype = { isEncrypted: function() {
|
|
946
|
+
return (1 & this.bitFlag) == 1;
|
|
947
|
+
}, useUTF8: function() {
|
|
948
|
+
return (2048 & this.bitFlag) == 2048;
|
|
949
|
+
}, readLocalPart: function(i) {
|
|
950
|
+
var d, r;
|
|
951
|
+
if (i.skip(22), this.fileNameLength = i.readInt(2), r = i.readInt(2), this.fileName = i.readData(this.fileNameLength), i.skip(r), 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)");
|
|
952
|
+
if ((d = function(l) {
|
|
953
|
+
for (var a in v) if (Object.prototype.hasOwnProperty.call(v, a) && v[a].magic === l) return v[a];
|
|
954
|
+
return null;
|
|
955
|
+
}(this.compressionMethod)) === null) throw new Error("Corrupted zip : compression " + o.pretty(this.compressionMethod) + " unknown (inner file : " + o.transformTo("string", this.fileName) + ")");
|
|
956
|
+
this.decompressed = new n(this.compressedSize, this.uncompressedSize, this.crc32, d, i.readData(this.compressedSize));
|
|
957
|
+
}, readCentralPart: function(i) {
|
|
958
|
+
this.versionMadeBy = i.readInt(2), i.skip(2), this.bitFlag = i.readInt(2), this.compressionMethod = i.readString(2), this.date = i.readDate(), this.crc32 = i.readInt(4), this.compressedSize = i.readInt(4), this.uncompressedSize = i.readInt(4);
|
|
959
|
+
var d = i.readInt(2);
|
|
960
|
+
if (this.extraFieldsLength = i.readInt(2), this.fileCommentLength = i.readInt(2), this.diskNumberStart = i.readInt(2), this.internalFileAttributes = i.readInt(2), this.externalFileAttributes = i.readInt(4), this.localHeaderOffset = i.readInt(4), this.isEncrypted()) throw new Error("Encrypted zip are not supported");
|
|
961
|
+
i.skip(d), this.readExtraFields(i), this.parseZIP64ExtraField(i), this.fileComment = i.readData(this.fileCommentLength);
|
|
962
|
+
}, processAttributes: function() {
|
|
963
|
+
this.unixPermissions = null, this.dosPermissions = null;
|
|
964
|
+
var i = this.versionMadeBy >> 8;
|
|
965
|
+
this.dir = !!(16 & this.externalFileAttributes), i == 0 && (this.dosPermissions = 63 & this.externalFileAttributes), i == 3 && (this.unixPermissions = this.externalFileAttributes >> 16 & 65535), this.dir || this.fileNameStr.slice(-1) !== "/" || (this.dir = !0);
|
|
966
|
+
}, parseZIP64ExtraField: function() {
|
|
967
|
+
if (this.extraFields[1]) {
|
|
968
|
+
var i = s(this.extraFields[1].value);
|
|
969
|
+
this.uncompressedSize === o.MAX_VALUE_32BITS && (this.uncompressedSize = i.readInt(8)), this.compressedSize === o.MAX_VALUE_32BITS && (this.compressedSize = i.readInt(8)), this.localHeaderOffset === o.MAX_VALUE_32BITS && (this.localHeaderOffset = i.readInt(8)), this.diskNumberStart === o.MAX_VALUE_32BITS && (this.diskNumberStart = i.readInt(4));
|
|
970
|
+
}
|
|
971
|
+
}, readExtraFields: function(i) {
|
|
972
|
+
var d, r, l, a = i.index + this.extraFieldsLength;
|
|
973
|
+
for (this.extraFields || (this.extraFields = {}); i.index + 4 < a; ) d = i.readInt(2), r = i.readInt(2), l = i.readData(r), this.extraFields[d] = { id: d, length: r, value: l };
|
|
974
|
+
i.setIndex(a);
|
|
975
|
+
}, handleUTF8: function() {
|
|
976
|
+
var i = _.uint8array ? "uint8array" : "array";
|
|
977
|
+
if (this.useUTF8()) this.fileNameStr = c.utf8decode(this.fileName), this.fileCommentStr = c.utf8decode(this.fileComment);
|
|
978
|
+
else {
|
|
979
|
+
var d = this.findExtraFieldUnicodePath();
|
|
980
|
+
if (d !== null) this.fileNameStr = d;
|
|
981
|
+
else {
|
|
982
|
+
var r = o.transformTo(i, this.fileName);
|
|
983
|
+
this.fileNameStr = this.loadOptions.decodeFileName(r);
|
|
984
|
+
}
|
|
985
|
+
var l = this.findExtraFieldUnicodeComment();
|
|
986
|
+
if (l !== null) this.fileCommentStr = l;
|
|
987
|
+
else {
|
|
988
|
+
var a = o.transformTo(i, this.fileComment);
|
|
989
|
+
this.fileCommentStr = this.loadOptions.decodeFileName(a);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
}, findExtraFieldUnicodePath: function() {
|
|
993
|
+
var i = this.extraFields[28789];
|
|
994
|
+
if (i) {
|
|
995
|
+
var d = s(i.value);
|
|
996
|
+
return d.readInt(1) !== 1 || u(this.fileName) !== d.readInt(4) ? null : c.utf8decode(d.readData(i.length - 5));
|
|
997
|
+
}
|
|
998
|
+
return null;
|
|
999
|
+
}, findExtraFieldUnicodeComment: function() {
|
|
1000
|
+
var i = this.extraFields[25461];
|
|
1001
|
+
if (i) {
|
|
1002
|
+
var d = s(i.value);
|
|
1003
|
+
return d.readInt(1) !== 1 || u(this.fileComment) !== d.readInt(4) ? null : c.utf8decode(d.readData(i.length - 5));
|
|
1004
|
+
}
|
|
1005
|
+
return null;
|
|
1006
|
+
} }, I.exports = m;
|
|
1007
|
+
}, { "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./reader/readerFor": 22, "./support": 30, "./utf8": 31, "./utils": 32 }], 35: [function(g, I, w) {
|
|
1008
|
+
function s(d, r, l) {
|
|
1009
|
+
this.name = d, this.dir = l.dir, this.date = l.date, this.comment = l.comment, this.unixPermissions = l.unixPermissions, this.dosPermissions = l.dosPermissions, this._data = r, this._dataBinary = l.binary, this.options = { compression: l.compression, compressionOptions: l.compressionOptions };
|
|
1010
|
+
}
|
|
1011
|
+
var o = g("./stream/StreamHelper"), n = g("./stream/DataWorker"), u = g("./utf8"), c = g("./compressedObject"), v = g("./stream/GenericWorker");
|
|
1012
|
+
s.prototype = { internalStream: function(d) {
|
|
1013
|
+
var r = null, l = "string";
|
|
1014
|
+
try {
|
|
1015
|
+
if (!d) throw new Error("No output type specified.");
|
|
1016
|
+
var a = (l = d.toLowerCase()) === "string" || l === "text";
|
|
1017
|
+
l !== "binarystring" && l !== "text" || (l = "string"), r = this._decompressWorker();
|
|
1018
|
+
var p = !this._dataBinary;
|
|
1019
|
+
p && !a && (r = r.pipe(new u.Utf8EncodeWorker())), !p && a && (r = r.pipe(new u.Utf8DecodeWorker()));
|
|
1020
|
+
} catch (y) {
|
|
1021
|
+
(r = new v("error")).error(y);
|
|
1022
|
+
}
|
|
1023
|
+
return new o(r, l, "");
|
|
1024
|
+
}, async: function(d, r) {
|
|
1025
|
+
return this.internalStream(d).accumulate(r);
|
|
1026
|
+
}, nodeStream: function(d, r) {
|
|
1027
|
+
return this.internalStream(d || "nodebuffer").toNodejsStream(r);
|
|
1028
|
+
}, _compressWorker: function(d, r) {
|
|
1029
|
+
if (this._data instanceof c && this._data.compression.magic === d.magic) return this._data.getCompressedWorker();
|
|
1030
|
+
var l = this._decompressWorker();
|
|
1031
|
+
return this._dataBinary || (l = l.pipe(new u.Utf8EncodeWorker())), c.createWorkerFrom(l, d, r);
|
|
1032
|
+
}, _decompressWorker: function() {
|
|
1033
|
+
return this._data instanceof c ? this._data.getContentWorker() : this._data instanceof v ? this._data : new n(this._data);
|
|
1034
|
+
} };
|
|
1035
|
+
for (var _ = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"], m = function() {
|
|
1036
|
+
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
1037
|
+
}, i = 0; i < _.length; i++) s.prototype[_[i]] = m;
|
|
1038
|
+
I.exports = s;
|
|
1039
|
+
}, { "./compressedObject": 2, "./stream/DataWorker": 27, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31 }], 36: [function(g, I, w) {
|
|
1040
|
+
(function(s) {
|
|
1041
|
+
var o, n, u = s.MutationObserver || s.WebKitMutationObserver;
|
|
1042
|
+
if (u) {
|
|
1043
|
+
var c = 0, v = new u(d), _ = s.document.createTextNode("");
|
|
1044
|
+
v.observe(_, { characterData: !0 }), o = function() {
|
|
1045
|
+
_.data = c = ++c % 2;
|
|
1046
|
+
};
|
|
1047
|
+
} else if (s.setImmediate || s.MessageChannel === void 0) o = "document" in s && "onreadystatechange" in s.document.createElement("script") ? function() {
|
|
1048
|
+
var r = s.document.createElement("script");
|
|
1049
|
+
r.onreadystatechange = function() {
|
|
1050
|
+
d(), r.onreadystatechange = null, r.parentNode.removeChild(r), r = null;
|
|
1051
|
+
}, s.document.documentElement.appendChild(r);
|
|
1052
|
+
} : function() {
|
|
1053
|
+
setTimeout(d, 0);
|
|
1054
|
+
};
|
|
1055
|
+
else {
|
|
1056
|
+
var m = new s.MessageChannel();
|
|
1057
|
+
m.port1.onmessage = d, o = function() {
|
|
1058
|
+
m.port2.postMessage(0);
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
var i = [];
|
|
1062
|
+
function d() {
|
|
1063
|
+
var r, l;
|
|
1064
|
+
n = !0;
|
|
1065
|
+
for (var a = i.length; a; ) {
|
|
1066
|
+
for (l = i, i = [], r = -1; ++r < a; ) l[r]();
|
|
1067
|
+
a = i.length;
|
|
1068
|
+
}
|
|
1069
|
+
n = !1;
|
|
1070
|
+
}
|
|
1071
|
+
I.exports = function(r) {
|
|
1072
|
+
i.push(r) !== 1 || n || o();
|
|
1073
|
+
};
|
|
1074
|
+
}).call(this, typeof mt < "u" ? mt : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
1075
|
+
}, {}], 37: [function(g, I, w) {
|
|
1076
|
+
var s = g("immediate");
|
|
1077
|
+
function o() {
|
|
1078
|
+
}
|
|
1079
|
+
var n = {}, u = ["REJECTED"], c = ["FULFILLED"], v = ["PENDING"];
|
|
1080
|
+
function _(a) {
|
|
1081
|
+
if (typeof a != "function") throw new TypeError("resolver must be a function");
|
|
1082
|
+
this.state = v, this.queue = [], this.outcome = void 0, a !== o && r(this, a);
|
|
1083
|
+
}
|
|
1084
|
+
function m(a, p, y) {
|
|
1085
|
+
this.promise = a, typeof p == "function" && (this.onFulfilled = p, this.callFulfilled = this.otherCallFulfilled), typeof y == "function" && (this.onRejected = y, this.callRejected = this.otherCallRejected);
|
|
1086
|
+
}
|
|
1087
|
+
function i(a, p, y) {
|
|
1088
|
+
s(function() {
|
|
1089
|
+
var S;
|
|
1090
|
+
try {
|
|
1091
|
+
S = p(y);
|
|
1092
|
+
} catch (x) {
|
|
1093
|
+
return n.reject(a, x);
|
|
1094
|
+
}
|
|
1095
|
+
S === a ? n.reject(a, new TypeError("Cannot resolve promise with itself")) : n.resolve(a, S);
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
function d(a) {
|
|
1099
|
+
var p = a && a.then;
|
|
1100
|
+
if (a && (typeof a == "object" || typeof a == "function") && typeof p == "function") return function() {
|
|
1101
|
+
p.apply(a, arguments);
|
|
1102
|
+
};
|
|
1103
|
+
}
|
|
1104
|
+
function r(a, p) {
|
|
1105
|
+
var y = !1;
|
|
1106
|
+
function S(B) {
|
|
1107
|
+
y || (y = !0, n.reject(a, B));
|
|
1108
|
+
}
|
|
1109
|
+
function x(B) {
|
|
1110
|
+
y || (y = !0, n.resolve(a, B));
|
|
1111
|
+
}
|
|
1112
|
+
var F = l(function() {
|
|
1113
|
+
p(x, S);
|
|
1114
|
+
});
|
|
1115
|
+
F.status === "error" && S(F.value);
|
|
1116
|
+
}
|
|
1117
|
+
function l(a, p) {
|
|
1118
|
+
var y = {};
|
|
1119
|
+
try {
|
|
1120
|
+
y.value = a(p), y.status = "success";
|
|
1121
|
+
} catch (S) {
|
|
1122
|
+
y.status = "error", y.value = S;
|
|
1123
|
+
}
|
|
1124
|
+
return y;
|
|
1125
|
+
}
|
|
1126
|
+
(I.exports = _).prototype.finally = function(a) {
|
|
1127
|
+
if (typeof a != "function") return this;
|
|
1128
|
+
var p = this.constructor;
|
|
1129
|
+
return this.then(function(y) {
|
|
1130
|
+
return p.resolve(a()).then(function() {
|
|
1131
|
+
return y;
|
|
1132
|
+
});
|
|
1133
|
+
}, function(y) {
|
|
1134
|
+
return p.resolve(a()).then(function() {
|
|
1135
|
+
throw y;
|
|
1136
|
+
});
|
|
1137
|
+
});
|
|
1138
|
+
}, _.prototype.catch = function(a) {
|
|
1139
|
+
return this.then(null, a);
|
|
1140
|
+
}, _.prototype.then = function(a, p) {
|
|
1141
|
+
if (typeof a != "function" && this.state === c || typeof p != "function" && this.state === u) return this;
|
|
1142
|
+
var y = new this.constructor(o);
|
|
1143
|
+
return this.state !== v ? i(y, this.state === c ? a : p, this.outcome) : this.queue.push(new m(y, a, p)), y;
|
|
1144
|
+
}, m.prototype.callFulfilled = function(a) {
|
|
1145
|
+
n.resolve(this.promise, a);
|
|
1146
|
+
}, m.prototype.otherCallFulfilled = function(a) {
|
|
1147
|
+
i(this.promise, this.onFulfilled, a);
|
|
1148
|
+
}, m.prototype.callRejected = function(a) {
|
|
1149
|
+
n.reject(this.promise, a);
|
|
1150
|
+
}, m.prototype.otherCallRejected = function(a) {
|
|
1151
|
+
i(this.promise, this.onRejected, a);
|
|
1152
|
+
}, n.resolve = function(a, p) {
|
|
1153
|
+
var y = l(d, p);
|
|
1154
|
+
if (y.status === "error") return n.reject(a, y.value);
|
|
1155
|
+
var S = y.value;
|
|
1156
|
+
if (S) r(a, S);
|
|
1157
|
+
else {
|
|
1158
|
+
a.state = c, a.outcome = p;
|
|
1159
|
+
for (var x = -1, F = a.queue.length; ++x < F; ) a.queue[x].callFulfilled(p);
|
|
1160
|
+
}
|
|
1161
|
+
return a;
|
|
1162
|
+
}, n.reject = function(a, p) {
|
|
1163
|
+
a.state = u, a.outcome = p;
|
|
1164
|
+
for (var y = -1, S = a.queue.length; ++y < S; ) a.queue[y].callRejected(p);
|
|
1165
|
+
return a;
|
|
1166
|
+
}, _.resolve = function(a) {
|
|
1167
|
+
return a instanceof this ? a : n.resolve(new this(o), a);
|
|
1168
|
+
}, _.reject = function(a) {
|
|
1169
|
+
var p = new this(o);
|
|
1170
|
+
return n.reject(p, a);
|
|
1171
|
+
}, _.all = function(a) {
|
|
1172
|
+
var p = this;
|
|
1173
|
+
if (Object.prototype.toString.call(a) !== "[object Array]") return this.reject(new TypeError("must be an array"));
|
|
1174
|
+
var y = a.length, S = !1;
|
|
1175
|
+
if (!y) return this.resolve([]);
|
|
1176
|
+
for (var x = new Array(y), F = 0, B = -1, P = new this(o); ++B < y; ) O(a[B], B);
|
|
1177
|
+
return P;
|
|
1178
|
+
function O(W, q) {
|
|
1179
|
+
p.resolve(W).then(function(b) {
|
|
1180
|
+
x[q] = b, ++F !== y || S || (S = !0, n.resolve(P, x));
|
|
1181
|
+
}, function(b) {
|
|
1182
|
+
S || (S = !0, n.reject(P, b));
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
}, _.race = function(a) {
|
|
1186
|
+
var p = this;
|
|
1187
|
+
if (Object.prototype.toString.call(a) !== "[object Array]") return this.reject(new TypeError("must be an array"));
|
|
1188
|
+
var y = a.length, S = !1;
|
|
1189
|
+
if (!y) return this.resolve([]);
|
|
1190
|
+
for (var x = -1, F = new this(o); ++x < y; ) B = a[x], p.resolve(B).then(function(P) {
|
|
1191
|
+
S || (S = !0, n.resolve(F, P));
|
|
1192
|
+
}, function(P) {
|
|
1193
|
+
S || (S = !0, n.reject(F, P));
|
|
1194
|
+
});
|
|
1195
|
+
var B;
|
|
1196
|
+
return F;
|
|
1197
|
+
};
|
|
1198
|
+
}, { immediate: 36 }], 38: [function(g, I, w) {
|
|
1199
|
+
var s = {};
|
|
1200
|
+
(0, g("./lib/utils/common").assign)(s, g("./lib/deflate"), g("./lib/inflate"), g("./lib/zlib/constants")), I.exports = s;
|
|
1201
|
+
}, { "./lib/deflate": 39, "./lib/inflate": 40, "./lib/utils/common": 41, "./lib/zlib/constants": 44 }], 39: [function(g, I, w) {
|
|
1202
|
+
var s = g("./zlib/deflate"), o = g("./utils/common"), n = g("./utils/strings"), u = g("./zlib/messages"), c = g("./zlib/zstream"), v = Object.prototype.toString, _ = 0, m = -1, i = 0, d = 8;
|
|
1203
|
+
function r(a) {
|
|
1204
|
+
if (!(this instanceof r)) return new r(a);
|
|
1205
|
+
this.options = o.assign({ level: m, method: d, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: i, to: "" }, a || {});
|
|
1206
|
+
var p = this.options;
|
|
1207
|
+
p.raw && 0 < p.windowBits ? p.windowBits = -p.windowBits : p.gzip && 0 < p.windowBits && p.windowBits < 16 && (p.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new c(), this.strm.avail_out = 0;
|
|
1208
|
+
var y = s.deflateInit2(this.strm, p.level, p.method, p.windowBits, p.memLevel, p.strategy);
|
|
1209
|
+
if (y !== _) throw new Error(u[y]);
|
|
1210
|
+
if (p.header && s.deflateSetHeader(this.strm, p.header), p.dictionary) {
|
|
1211
|
+
var S;
|
|
1212
|
+
if (S = typeof p.dictionary == "string" ? n.string2buf(p.dictionary) : v.call(p.dictionary) === "[object ArrayBuffer]" ? new Uint8Array(p.dictionary) : p.dictionary, (y = s.deflateSetDictionary(this.strm, S)) !== _) throw new Error(u[y]);
|
|
1213
|
+
this._dict_set = !0;
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
function l(a, p) {
|
|
1217
|
+
var y = new r(p);
|
|
1218
|
+
if (y.push(a, !0), y.err) throw y.msg || u[y.err];
|
|
1219
|
+
return y.result;
|
|
1220
|
+
}
|
|
1221
|
+
r.prototype.push = function(a, p) {
|
|
1222
|
+
var y, S, x = this.strm, F = this.options.chunkSize;
|
|
1223
|
+
if (this.ended) return !1;
|
|
1224
|
+
S = p === ~~p ? p : p === !0 ? 4 : 0, typeof a == "string" ? x.input = n.string2buf(a) : v.call(a) === "[object ArrayBuffer]" ? x.input = new Uint8Array(a) : x.input = a, x.next_in = 0, x.avail_in = x.input.length;
|
|
1225
|
+
do {
|
|
1226
|
+
if (x.avail_out === 0 && (x.output = new o.Buf8(F), x.next_out = 0, x.avail_out = F), (y = s.deflate(x, S)) !== 1 && y !== _) return this.onEnd(y), !(this.ended = !0);
|
|
1227
|
+
x.avail_out !== 0 && (x.avail_in !== 0 || S !== 4 && S !== 2) || (this.options.to === "string" ? this.onData(n.buf2binstring(o.shrinkBuf(x.output, x.next_out))) : this.onData(o.shrinkBuf(x.output, x.next_out)));
|
|
1228
|
+
} while ((0 < x.avail_in || x.avail_out === 0) && y !== 1);
|
|
1229
|
+
return S === 4 ? (y = s.deflateEnd(this.strm), this.onEnd(y), this.ended = !0, y === _) : S !== 2 || (this.onEnd(_), !(x.avail_out = 0));
|
|
1230
|
+
}, r.prototype.onData = function(a) {
|
|
1231
|
+
this.chunks.push(a);
|
|
1232
|
+
}, r.prototype.onEnd = function(a) {
|
|
1233
|
+
a === _ && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = a, this.msg = this.strm.msg;
|
|
1234
|
+
}, w.Deflate = r, w.deflate = l, w.deflateRaw = function(a, p) {
|
|
1235
|
+
return (p = p || {}).raw = !0, l(a, p);
|
|
1236
|
+
}, w.gzip = function(a, p) {
|
|
1237
|
+
return (p = p || {}).gzip = !0, l(a, p);
|
|
1238
|
+
};
|
|
1239
|
+
}, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function(g, I, w) {
|
|
1240
|
+
var s = g("./zlib/inflate"), o = g("./utils/common"), n = g("./utils/strings"), u = g("./zlib/constants"), c = g("./zlib/messages"), v = g("./zlib/zstream"), _ = g("./zlib/gzheader"), m = Object.prototype.toString;
|
|
1241
|
+
function i(r) {
|
|
1242
|
+
if (!(this instanceof i)) return new i(r);
|
|
1243
|
+
this.options = o.assign({ chunkSize: 16384, windowBits: 0, to: "" }, r || {});
|
|
1244
|
+
var l = this.options;
|
|
1245
|
+
l.raw && 0 <= l.windowBits && l.windowBits < 16 && (l.windowBits = -l.windowBits, l.windowBits === 0 && (l.windowBits = -15)), !(0 <= l.windowBits && l.windowBits < 16) || r && r.windowBits || (l.windowBits += 32), 15 < l.windowBits && l.windowBits < 48 && !(15 & l.windowBits) && (l.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new v(), this.strm.avail_out = 0;
|
|
1246
|
+
var a = s.inflateInit2(this.strm, l.windowBits);
|
|
1247
|
+
if (a !== u.Z_OK) throw new Error(c[a]);
|
|
1248
|
+
this.header = new _(), s.inflateGetHeader(this.strm, this.header);
|
|
1249
|
+
}
|
|
1250
|
+
function d(r, l) {
|
|
1251
|
+
var a = new i(l);
|
|
1252
|
+
if (a.push(r, !0), a.err) throw a.msg || c[a.err];
|
|
1253
|
+
return a.result;
|
|
1254
|
+
}
|
|
1255
|
+
i.prototype.push = function(r, l) {
|
|
1256
|
+
var a, p, y, S, x, F, B = this.strm, P = this.options.chunkSize, O = this.options.dictionary, W = !1;
|
|
1257
|
+
if (this.ended) return !1;
|
|
1258
|
+
p = l === ~~l ? l : l === !0 ? u.Z_FINISH : u.Z_NO_FLUSH, typeof r == "string" ? B.input = n.binstring2buf(r) : m.call(r) === "[object ArrayBuffer]" ? B.input = new Uint8Array(r) : B.input = r, B.next_in = 0, B.avail_in = B.input.length;
|
|
1259
|
+
do {
|
|
1260
|
+
if (B.avail_out === 0 && (B.output = new o.Buf8(P), B.next_out = 0, B.avail_out = P), (a = s.inflate(B, u.Z_NO_FLUSH)) === u.Z_NEED_DICT && O && (F = typeof O == "string" ? n.string2buf(O) : m.call(O) === "[object ArrayBuffer]" ? new Uint8Array(O) : O, a = s.inflateSetDictionary(this.strm, F)), a === u.Z_BUF_ERROR && W === !0 && (a = u.Z_OK, W = !1), a !== u.Z_STREAM_END && a !== u.Z_OK) return this.onEnd(a), !(this.ended = !0);
|
|
1261
|
+
B.next_out && (B.avail_out !== 0 && a !== u.Z_STREAM_END && (B.avail_in !== 0 || p !== u.Z_FINISH && p !== u.Z_SYNC_FLUSH) || (this.options.to === "string" ? (y = n.utf8border(B.output, B.next_out), S = B.next_out - y, x = n.buf2string(B.output, y), B.next_out = S, B.avail_out = P - S, S && o.arraySet(B.output, B.output, y, S, 0), this.onData(x)) : this.onData(o.shrinkBuf(B.output, B.next_out)))), B.avail_in === 0 && B.avail_out === 0 && (W = !0);
|
|
1262
|
+
} while ((0 < B.avail_in || B.avail_out === 0) && a !== u.Z_STREAM_END);
|
|
1263
|
+
return a === u.Z_STREAM_END && (p = u.Z_FINISH), p === u.Z_FINISH ? (a = s.inflateEnd(this.strm), this.onEnd(a), this.ended = !0, a === u.Z_OK) : p !== u.Z_SYNC_FLUSH || (this.onEnd(u.Z_OK), !(B.avail_out = 0));
|
|
1264
|
+
}, i.prototype.onData = function(r) {
|
|
1265
|
+
this.chunks.push(r);
|
|
1266
|
+
}, i.prototype.onEnd = function(r) {
|
|
1267
|
+
r === u.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = r, this.msg = this.strm.msg;
|
|
1268
|
+
}, w.Inflate = i, w.inflate = d, w.inflateRaw = function(r, l) {
|
|
1269
|
+
return (l = l || {}).raw = !0, d(r, l);
|
|
1270
|
+
}, w.ungzip = d;
|
|
1271
|
+
}, { "./utils/common": 41, "./utils/strings": 42, "./zlib/constants": 44, "./zlib/gzheader": 47, "./zlib/inflate": 49, "./zlib/messages": 51, "./zlib/zstream": 53 }], 41: [function(g, I, w) {
|
|
1272
|
+
var s = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u";
|
|
1273
|
+
w.assign = function(u) {
|
|
1274
|
+
for (var c = Array.prototype.slice.call(arguments, 1); c.length; ) {
|
|
1275
|
+
var v = c.shift();
|
|
1276
|
+
if (v) {
|
|
1277
|
+
if (typeof v != "object") throw new TypeError(v + "must be non-object");
|
|
1278
|
+
for (var _ in v) v.hasOwnProperty(_) && (u[_] = v[_]);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
return u;
|
|
1282
|
+
}, w.shrinkBuf = function(u, c) {
|
|
1283
|
+
return u.length === c ? u : u.subarray ? u.subarray(0, c) : (u.length = c, u);
|
|
1284
|
+
};
|
|
1285
|
+
var o = { arraySet: function(u, c, v, _, m) {
|
|
1286
|
+
if (c.subarray && u.subarray) u.set(c.subarray(v, v + _), m);
|
|
1287
|
+
else for (var i = 0; i < _; i++) u[m + i] = c[v + i];
|
|
1288
|
+
}, flattenChunks: function(u) {
|
|
1289
|
+
var c, v, _, m, i, d;
|
|
1290
|
+
for (c = _ = 0, v = u.length; c < v; c++) _ += u[c].length;
|
|
1291
|
+
for (d = new Uint8Array(_), c = m = 0, v = u.length; c < v; c++) i = u[c], d.set(i, m), m += i.length;
|
|
1292
|
+
return d;
|
|
1293
|
+
} }, n = { arraySet: function(u, c, v, _, m) {
|
|
1294
|
+
for (var i = 0; i < _; i++) u[m + i] = c[v + i];
|
|
1295
|
+
}, flattenChunks: function(u) {
|
|
1296
|
+
return [].concat.apply([], u);
|
|
1297
|
+
} };
|
|
1298
|
+
w.setTyped = function(u) {
|
|
1299
|
+
u ? (w.Buf8 = Uint8Array, w.Buf16 = Uint16Array, w.Buf32 = Int32Array, w.assign(w, o)) : (w.Buf8 = Array, w.Buf16 = Array, w.Buf32 = Array, w.assign(w, n));
|
|
1300
|
+
}, w.setTyped(s);
|
|
1301
|
+
}, {}], 42: [function(g, I, w) {
|
|
1302
|
+
var s = g("./common"), o = !0, n = !0;
|
|
1303
|
+
try {
|
|
1304
|
+
String.fromCharCode.apply(null, [0]);
|
|
1305
|
+
} catch {
|
|
1306
|
+
o = !1;
|
|
1307
|
+
}
|
|
1308
|
+
try {
|
|
1309
|
+
String.fromCharCode.apply(null, new Uint8Array(1));
|
|
1310
|
+
} catch {
|
|
1311
|
+
n = !1;
|
|
1312
|
+
}
|
|
1313
|
+
for (var u = new s.Buf8(256), c = 0; c < 256; c++) u[c] = 252 <= c ? 6 : 248 <= c ? 5 : 240 <= c ? 4 : 224 <= c ? 3 : 192 <= c ? 2 : 1;
|
|
1314
|
+
function v(_, m) {
|
|
1315
|
+
if (m < 65537 && (_.subarray && n || !_.subarray && o)) return String.fromCharCode.apply(null, s.shrinkBuf(_, m));
|
|
1316
|
+
for (var i = "", d = 0; d < m; d++) i += String.fromCharCode(_[d]);
|
|
1317
|
+
return i;
|
|
1318
|
+
}
|
|
1319
|
+
u[254] = u[254] = 1, w.string2buf = function(_) {
|
|
1320
|
+
var m, i, d, r, l, a = _.length, p = 0;
|
|
1321
|
+
for (r = 0; r < a; r++) (64512 & (i = _.charCodeAt(r))) == 55296 && r + 1 < a && (64512 & (d = _.charCodeAt(r + 1))) == 56320 && (i = 65536 + (i - 55296 << 10) + (d - 56320), r++), p += i < 128 ? 1 : i < 2048 ? 2 : i < 65536 ? 3 : 4;
|
|
1322
|
+
for (m = new s.Buf8(p), r = l = 0; l < p; r++) (64512 & (i = _.charCodeAt(r))) == 55296 && r + 1 < a && (64512 & (d = _.charCodeAt(r + 1))) == 56320 && (i = 65536 + (i - 55296 << 10) + (d - 56320), r++), i < 128 ? m[l++] = i : (i < 2048 ? m[l++] = 192 | i >>> 6 : (i < 65536 ? m[l++] = 224 | i >>> 12 : (m[l++] = 240 | i >>> 18, m[l++] = 128 | i >>> 12 & 63), m[l++] = 128 | i >>> 6 & 63), m[l++] = 128 | 63 & i);
|
|
1323
|
+
return m;
|
|
1324
|
+
}, w.buf2binstring = function(_) {
|
|
1325
|
+
return v(_, _.length);
|
|
1326
|
+
}, w.binstring2buf = function(_) {
|
|
1327
|
+
for (var m = new s.Buf8(_.length), i = 0, d = m.length; i < d; i++) m[i] = _.charCodeAt(i);
|
|
1328
|
+
return m;
|
|
1329
|
+
}, w.buf2string = function(_, m) {
|
|
1330
|
+
var i, d, r, l, a = m || _.length, p = new Array(2 * a);
|
|
1331
|
+
for (i = d = 0; i < a; ) if ((r = _[i++]) < 128) p[d++] = r;
|
|
1332
|
+
else if (4 < (l = u[r])) p[d++] = 65533, i += l - 1;
|
|
1333
|
+
else {
|
|
1334
|
+
for (r &= l === 2 ? 31 : l === 3 ? 15 : 7; 1 < l && i < a; ) r = r << 6 | 63 & _[i++], l--;
|
|
1335
|
+
1 < l ? p[d++] = 65533 : r < 65536 ? p[d++] = r : (r -= 65536, p[d++] = 55296 | r >> 10 & 1023, p[d++] = 56320 | 1023 & r);
|
|
1336
|
+
}
|
|
1337
|
+
return v(p, d);
|
|
1338
|
+
}, w.utf8border = function(_, m) {
|
|
1339
|
+
var i;
|
|
1340
|
+
for ((m = m || _.length) > _.length && (m = _.length), i = m - 1; 0 <= i && (192 & _[i]) == 128; ) i--;
|
|
1341
|
+
return i < 0 || i === 0 ? m : i + u[_[i]] > m ? i : m;
|
|
1342
|
+
};
|
|
1343
|
+
}, { "./common": 41 }], 43: [function(g, I, w) {
|
|
1344
|
+
I.exports = function(s, o, n, u) {
|
|
1345
|
+
for (var c = 65535 & s | 0, v = s >>> 16 & 65535 | 0, _ = 0; n !== 0; ) {
|
|
1346
|
+
for (n -= _ = 2e3 < n ? 2e3 : n; v = v + (c = c + o[u++] | 0) | 0, --_; ) ;
|
|
1347
|
+
c %= 65521, v %= 65521;
|
|
1348
|
+
}
|
|
1349
|
+
return c | v << 16 | 0;
|
|
1350
|
+
};
|
|
1351
|
+
}, {}], 44: [function(g, I, w) {
|
|
1352
|
+
I.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 };
|
|
1353
|
+
}, {}], 45: [function(g, I, w) {
|
|
1354
|
+
var s = function() {
|
|
1355
|
+
for (var o, n = [], u = 0; u < 256; u++) {
|
|
1356
|
+
o = u;
|
|
1357
|
+
for (var c = 0; c < 8; c++) o = 1 & o ? 3988292384 ^ o >>> 1 : o >>> 1;
|
|
1358
|
+
n[u] = o;
|
|
1359
|
+
}
|
|
1360
|
+
return n;
|
|
1361
|
+
}();
|
|
1362
|
+
I.exports = function(o, n, u, c) {
|
|
1363
|
+
var v = s, _ = c + u;
|
|
1364
|
+
o ^= -1;
|
|
1365
|
+
for (var m = c; m < _; m++) o = o >>> 8 ^ v[255 & (o ^ n[m])];
|
|
1366
|
+
return -1 ^ o;
|
|
1367
|
+
};
|
|
1368
|
+
}, {}], 46: [function(g, I, w) {
|
|
1369
|
+
var s, o = g("../utils/common"), n = g("./trees"), u = g("./adler32"), c = g("./crc32"), v = g("./messages"), _ = 0, m = 4, i = 0, d = -2, r = -1, l = 4, a = 2, p = 8, y = 9, S = 286, x = 30, F = 19, B = 2 * S + 1, P = 15, O = 3, W = 258, q = W + O + 1, b = 42, R = 113, e = 1, D = 2, J = 3, L = 4;
|
|
1370
|
+
function $(t, T) {
|
|
1371
|
+
return t.msg = v[T], T;
|
|
1372
|
+
}
|
|
1373
|
+
function j(t) {
|
|
1374
|
+
return (t << 1) - (4 < t ? 9 : 0);
|
|
1375
|
+
}
|
|
1376
|
+
function V(t) {
|
|
1377
|
+
for (var T = t.length; 0 <= --T; ) t[T] = 0;
|
|
1378
|
+
}
|
|
1379
|
+
function A(t) {
|
|
1380
|
+
var T = t.state, C = T.pending;
|
|
1381
|
+
C > t.avail_out && (C = t.avail_out), C !== 0 && (o.arraySet(t.output, T.pending_buf, T.pending_out, C, t.next_out), t.next_out += C, T.pending_out += C, t.total_out += C, t.avail_out -= C, T.pending -= C, T.pending === 0 && (T.pending_out = 0));
|
|
1382
|
+
}
|
|
1383
|
+
function z(t, T) {
|
|
1384
|
+
n._tr_flush_block(t, 0 <= t.block_start ? t.block_start : -1, t.strstart - t.block_start, T), t.block_start = t.strstart, A(t.strm);
|
|
1385
|
+
}
|
|
1386
|
+
function X(t, T) {
|
|
1387
|
+
t.pending_buf[t.pending++] = T;
|
|
1388
|
+
}
|
|
1389
|
+
function G(t, T) {
|
|
1390
|
+
t.pending_buf[t.pending++] = T >>> 8 & 255, t.pending_buf[t.pending++] = 255 & T;
|
|
1391
|
+
}
|
|
1392
|
+
function H(t, T) {
|
|
1393
|
+
var C, f, h = t.max_chain_length, k = t.strstart, U = t.prev_length, N = t.nice_match, E = t.strstart > t.w_size - q ? t.strstart - (t.w_size - q) : 0, Z = t.window, K = t.w_mask, M = t.prev, Y = t.strstart + W, nt = Z[k + U - 1], tt = Z[k + U];
|
|
1394
|
+
t.prev_length >= t.good_match && (h >>= 2), N > t.lookahead && (N = t.lookahead);
|
|
1395
|
+
do
|
|
1396
|
+
if (Z[(C = T) + U] === tt && Z[C + U - 1] === nt && Z[C] === Z[k] && Z[++C] === Z[k + 1]) {
|
|
1397
|
+
k += 2, C++;
|
|
1398
|
+
do
|
|
1399
|
+
;
|
|
1400
|
+
while (Z[++k] === Z[++C] && Z[++k] === Z[++C] && Z[++k] === Z[++C] && Z[++k] === Z[++C] && Z[++k] === Z[++C] && Z[++k] === Z[++C] && Z[++k] === Z[++C] && Z[++k] === Z[++C] && k < Y);
|
|
1401
|
+
if (f = W - (Y - k), k = Y - W, U < f) {
|
|
1402
|
+
if (t.match_start = T, N <= (U = f)) break;
|
|
1403
|
+
nt = Z[k + U - 1], tt = Z[k + U];
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
while ((T = M[T & K]) > E && --h != 0);
|
|
1407
|
+
return U <= t.lookahead ? U : t.lookahead;
|
|
1408
|
+
}
|
|
1409
|
+
function it(t) {
|
|
1410
|
+
var T, C, f, h, k, U, N, E, Z, K, M = t.w_size;
|
|
1411
|
+
do {
|
|
1412
|
+
if (h = t.window_size - t.lookahead - t.strstart, t.strstart >= M + (M - q)) {
|
|
1413
|
+
for (o.arraySet(t.window, t.window, M, M, 0), t.match_start -= M, t.strstart -= M, t.block_start -= M, T = C = t.hash_size; f = t.head[--T], t.head[T] = M <= f ? f - M : 0, --C; ) ;
|
|
1414
|
+
for (T = C = M; f = t.prev[--T], t.prev[T] = M <= f ? f - M : 0, --C; ) ;
|
|
1415
|
+
h += M;
|
|
1416
|
+
}
|
|
1417
|
+
if (t.strm.avail_in === 0) break;
|
|
1418
|
+
if (U = t.strm, N = t.window, E = t.strstart + t.lookahead, Z = h, K = void 0, K = U.avail_in, Z < K && (K = Z), C = K === 0 ? 0 : (U.avail_in -= K, o.arraySet(N, U.input, U.next_in, K, E), U.state.wrap === 1 ? U.adler = u(U.adler, N, K, E) : U.state.wrap === 2 && (U.adler = c(U.adler, N, K, E)), U.next_in += K, U.total_in += K, K), t.lookahead += C, t.lookahead + t.insert >= O) for (k = t.strstart - t.insert, t.ins_h = t.window[k], t.ins_h = (t.ins_h << t.hash_shift ^ t.window[k + 1]) & t.hash_mask; t.insert && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[k + O - 1]) & t.hash_mask, t.prev[k & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = k, k++, t.insert--, !(t.lookahead + t.insert < O)); ) ;
|
|
1419
|
+
} while (t.lookahead < q && t.strm.avail_in !== 0);
|
|
1420
|
+
}
|
|
1421
|
+
function ut(t, T) {
|
|
1422
|
+
for (var C, f; ; ) {
|
|
1423
|
+
if (t.lookahead < q) {
|
|
1424
|
+
if (it(t), t.lookahead < q && T === _) return e;
|
|
1425
|
+
if (t.lookahead === 0) break;
|
|
1426
|
+
}
|
|
1427
|
+
if (C = 0, t.lookahead >= O && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + O - 1]) & t.hash_mask, C = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), C !== 0 && t.strstart - C <= t.w_size - q && (t.match_length = H(t, C)), t.match_length >= O) if (f = n._tr_tally(t, t.strstart - t.match_start, t.match_length - O), t.lookahead -= t.match_length, t.match_length <= t.max_lazy_match && t.lookahead >= O) {
|
|
1428
|
+
for (t.match_length--; t.strstart++, t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + O - 1]) & t.hash_mask, C = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart, --t.match_length != 0; ) ;
|
|
1429
|
+
t.strstart++;
|
|
1430
|
+
} else t.strstart += t.match_length, t.match_length = 0, t.ins_h = t.window[t.strstart], t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + 1]) & t.hash_mask;
|
|
1431
|
+
else f = n._tr_tally(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++;
|
|
1432
|
+
if (f && (z(t, !1), t.strm.avail_out === 0)) return e;
|
|
1433
|
+
}
|
|
1434
|
+
return t.insert = t.strstart < O - 1 ? t.strstart : O - 1, T === m ? (z(t, !0), t.strm.avail_out === 0 ? J : L) : t.last_lit && (z(t, !1), t.strm.avail_out === 0) ? e : D;
|
|
1435
|
+
}
|
|
1436
|
+
function Q(t, T) {
|
|
1437
|
+
for (var C, f, h; ; ) {
|
|
1438
|
+
if (t.lookahead < q) {
|
|
1439
|
+
if (it(t), t.lookahead < q && T === _) return e;
|
|
1440
|
+
if (t.lookahead === 0) break;
|
|
1441
|
+
}
|
|
1442
|
+
if (C = 0, t.lookahead >= O && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + O - 1]) & t.hash_mask, C = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), t.prev_length = t.match_length, t.prev_match = t.match_start, t.match_length = O - 1, C !== 0 && t.prev_length < t.max_lazy_match && t.strstart - C <= t.w_size - q && (t.match_length = H(t, C), t.match_length <= 5 && (t.strategy === 1 || t.match_length === O && 4096 < t.strstart - t.match_start) && (t.match_length = O - 1)), t.prev_length >= O && t.match_length <= t.prev_length) {
|
|
1443
|
+
for (h = t.strstart + t.lookahead - O, f = n._tr_tally(t, t.strstart - 1 - t.prev_match, t.prev_length - O), t.lookahead -= t.prev_length - 1, t.prev_length -= 2; ++t.strstart <= h && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + O - 1]) & t.hash_mask, C = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), --t.prev_length != 0; ) ;
|
|
1444
|
+
if (t.match_available = 0, t.match_length = O - 1, t.strstart++, f && (z(t, !1), t.strm.avail_out === 0)) return e;
|
|
1445
|
+
} else if (t.match_available) {
|
|
1446
|
+
if ((f = n._tr_tally(t, 0, t.window[t.strstart - 1])) && z(t, !1), t.strstart++, t.lookahead--, t.strm.avail_out === 0) return e;
|
|
1447
|
+
} else t.match_available = 1, t.strstart++, t.lookahead--;
|
|
1448
|
+
}
|
|
1449
|
+
return t.match_available && (f = n._tr_tally(t, 0, t.window[t.strstart - 1]), t.match_available = 0), t.insert = t.strstart < O - 1 ? t.strstart : O - 1, T === m ? (z(t, !0), t.strm.avail_out === 0 ? J : L) : t.last_lit && (z(t, !1), t.strm.avail_out === 0) ? e : D;
|
|
1450
|
+
}
|
|
1451
|
+
function rt(t, T, C, f, h) {
|
|
1452
|
+
this.good_length = t, this.max_lazy = T, this.nice_length = C, this.max_chain = f, this.func = h;
|
|
1453
|
+
}
|
|
1454
|
+
function ht() {
|
|
1455
|
+
this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = p, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new o.Buf16(2 * B), this.dyn_dtree = new o.Buf16(2 * (2 * x + 1)), this.bl_tree = new o.Buf16(2 * (2 * F + 1)), V(this.dyn_ltree), V(this.dyn_dtree), V(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new o.Buf16(P + 1), this.heap = new o.Buf16(2 * S + 1), V(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new o.Buf16(2 * S + 1), V(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
|
|
1456
|
+
}
|
|
1457
|
+
function at(t) {
|
|
1458
|
+
var T;
|
|
1459
|
+
return t && t.state ? (t.total_in = t.total_out = 0, t.data_type = a, (T = t.state).pending = 0, T.pending_out = 0, T.wrap < 0 && (T.wrap = -T.wrap), T.status = T.wrap ? b : R, t.adler = T.wrap === 2 ? 0 : 1, T.last_flush = _, n._tr_init(T), i) : $(t, d);
|
|
1460
|
+
}
|
|
1461
|
+
function ct(t) {
|
|
1462
|
+
var T = at(t);
|
|
1463
|
+
return T === i && function(C) {
|
|
1464
|
+
C.window_size = 2 * C.w_size, V(C.head), C.max_lazy_match = s[C.level].max_lazy, C.good_match = s[C.level].good_length, C.nice_match = s[C.level].nice_length, C.max_chain_length = s[C.level].max_chain, C.strstart = 0, C.block_start = 0, C.lookahead = 0, C.insert = 0, C.match_length = C.prev_length = O - 1, C.match_available = 0, C.ins_h = 0;
|
|
1465
|
+
}(t.state), T;
|
|
1466
|
+
}
|
|
1467
|
+
function ft(t, T, C, f, h, k) {
|
|
1468
|
+
if (!t) return d;
|
|
1469
|
+
var U = 1;
|
|
1470
|
+
if (T === r && (T = 6), f < 0 ? (U = 0, f = -f) : 15 < f && (U = 2, f -= 16), h < 1 || y < h || C !== p || f < 8 || 15 < f || T < 0 || 9 < T || k < 0 || l < k) return $(t, d);
|
|
1471
|
+
f === 8 && (f = 9);
|
|
1472
|
+
var N = new ht();
|
|
1473
|
+
return (t.state = N).strm = t, N.wrap = U, N.gzhead = null, N.w_bits = f, N.w_size = 1 << N.w_bits, N.w_mask = N.w_size - 1, N.hash_bits = h + 7, N.hash_size = 1 << N.hash_bits, N.hash_mask = N.hash_size - 1, N.hash_shift = ~~((N.hash_bits + O - 1) / O), N.window = new o.Buf8(2 * N.w_size), N.head = new o.Buf16(N.hash_size), N.prev = new o.Buf16(N.w_size), N.lit_bufsize = 1 << h + 6, N.pending_buf_size = 4 * N.lit_bufsize, N.pending_buf = new o.Buf8(N.pending_buf_size), N.d_buf = 1 * N.lit_bufsize, N.l_buf = 3 * N.lit_bufsize, N.level = T, N.strategy = k, N.method = C, ct(t);
|
|
1474
|
+
}
|
|
1475
|
+
s = [new rt(0, 0, 0, 0, function(t, T) {
|
|
1476
|
+
var C = 65535;
|
|
1477
|
+
for (C > t.pending_buf_size - 5 && (C = t.pending_buf_size - 5); ; ) {
|
|
1478
|
+
if (t.lookahead <= 1) {
|
|
1479
|
+
if (it(t), t.lookahead === 0 && T === _) return e;
|
|
1480
|
+
if (t.lookahead === 0) break;
|
|
1481
|
+
}
|
|
1482
|
+
t.strstart += t.lookahead, t.lookahead = 0;
|
|
1483
|
+
var f = t.block_start + C;
|
|
1484
|
+
if ((t.strstart === 0 || t.strstart >= f) && (t.lookahead = t.strstart - f, t.strstart = f, z(t, !1), t.strm.avail_out === 0) || t.strstart - t.block_start >= t.w_size - q && (z(t, !1), t.strm.avail_out === 0)) return e;
|
|
1485
|
+
}
|
|
1486
|
+
return t.insert = 0, T === m ? (z(t, !0), t.strm.avail_out === 0 ? J : L) : (t.strstart > t.block_start && (z(t, !1), t.strm.avail_out), e);
|
|
1487
|
+
}), new rt(4, 4, 8, 4, ut), new rt(4, 5, 16, 8, ut), new rt(4, 6, 32, 32, ut), new rt(4, 4, 16, 16, Q), new rt(8, 16, 32, 32, Q), new rt(8, 16, 128, 128, Q), new rt(8, 32, 128, 256, Q), new rt(32, 128, 258, 1024, Q), new rt(32, 258, 258, 4096, Q)], w.deflateInit = function(t, T) {
|
|
1488
|
+
return ft(t, T, p, 15, 8, 0);
|
|
1489
|
+
}, w.deflateInit2 = ft, w.deflateReset = ct, w.deflateResetKeep = at, w.deflateSetHeader = function(t, T) {
|
|
1490
|
+
return t && t.state ? t.state.wrap !== 2 ? d : (t.state.gzhead = T, i) : d;
|
|
1491
|
+
}, w.deflate = function(t, T) {
|
|
1492
|
+
var C, f, h, k;
|
|
1493
|
+
if (!t || !t.state || 5 < T || T < 0) return t ? $(t, d) : d;
|
|
1494
|
+
if (f = t.state, !t.output || !t.input && t.avail_in !== 0 || f.status === 666 && T !== m) return $(t, t.avail_out === 0 ? -5 : d);
|
|
1495
|
+
if (f.strm = t, C = f.last_flush, f.last_flush = T, f.status === b) if (f.wrap === 2) t.adler = 0, X(f, 31), X(f, 139), X(f, 8), f.gzhead ? (X(f, (f.gzhead.text ? 1 : 0) + (f.gzhead.hcrc ? 2 : 0) + (f.gzhead.extra ? 4 : 0) + (f.gzhead.name ? 8 : 0) + (f.gzhead.comment ? 16 : 0)), X(f, 255 & f.gzhead.time), X(f, f.gzhead.time >> 8 & 255), X(f, f.gzhead.time >> 16 & 255), X(f, f.gzhead.time >> 24 & 255), X(f, f.level === 9 ? 2 : 2 <= f.strategy || f.level < 2 ? 4 : 0), X(f, 255 & f.gzhead.os), f.gzhead.extra && f.gzhead.extra.length && (X(f, 255 & f.gzhead.extra.length), X(f, f.gzhead.extra.length >> 8 & 255)), f.gzhead.hcrc && (t.adler = c(t.adler, f.pending_buf, f.pending, 0)), f.gzindex = 0, f.status = 69) : (X(f, 0), X(f, 0), X(f, 0), X(f, 0), X(f, 0), X(f, f.level === 9 ? 2 : 2 <= f.strategy || f.level < 2 ? 4 : 0), X(f, 3), f.status = R);
|
|
1496
|
+
else {
|
|
1497
|
+
var U = p + (f.w_bits - 8 << 4) << 8;
|
|
1498
|
+
U |= (2 <= f.strategy || f.level < 2 ? 0 : f.level < 6 ? 1 : f.level === 6 ? 2 : 3) << 6, f.strstart !== 0 && (U |= 32), U += 31 - U % 31, f.status = R, G(f, U), f.strstart !== 0 && (G(f, t.adler >>> 16), G(f, 65535 & t.adler)), t.adler = 1;
|
|
1499
|
+
}
|
|
1500
|
+
if (f.status === 69) if (f.gzhead.extra) {
|
|
1501
|
+
for (h = f.pending; f.gzindex < (65535 & f.gzhead.extra.length) && (f.pending !== f.pending_buf_size || (f.gzhead.hcrc && f.pending > h && (t.adler = c(t.adler, f.pending_buf, f.pending - h, h)), A(t), h = f.pending, f.pending !== f.pending_buf_size)); ) X(f, 255 & f.gzhead.extra[f.gzindex]), f.gzindex++;
|
|
1502
|
+
f.gzhead.hcrc && f.pending > h && (t.adler = c(t.adler, f.pending_buf, f.pending - h, h)), f.gzindex === f.gzhead.extra.length && (f.gzindex = 0, f.status = 73);
|
|
1503
|
+
} else f.status = 73;
|
|
1504
|
+
if (f.status === 73) if (f.gzhead.name) {
|
|
1505
|
+
h = f.pending;
|
|
1506
|
+
do {
|
|
1507
|
+
if (f.pending === f.pending_buf_size && (f.gzhead.hcrc && f.pending > h && (t.adler = c(t.adler, f.pending_buf, f.pending - h, h)), A(t), h = f.pending, f.pending === f.pending_buf_size)) {
|
|
1508
|
+
k = 1;
|
|
1509
|
+
break;
|
|
1510
|
+
}
|
|
1511
|
+
k = f.gzindex < f.gzhead.name.length ? 255 & f.gzhead.name.charCodeAt(f.gzindex++) : 0, X(f, k);
|
|
1512
|
+
} while (k !== 0);
|
|
1513
|
+
f.gzhead.hcrc && f.pending > h && (t.adler = c(t.adler, f.pending_buf, f.pending - h, h)), k === 0 && (f.gzindex = 0, f.status = 91);
|
|
1514
|
+
} else f.status = 91;
|
|
1515
|
+
if (f.status === 91) if (f.gzhead.comment) {
|
|
1516
|
+
h = f.pending;
|
|
1517
|
+
do {
|
|
1518
|
+
if (f.pending === f.pending_buf_size && (f.gzhead.hcrc && f.pending > h && (t.adler = c(t.adler, f.pending_buf, f.pending - h, h)), A(t), h = f.pending, f.pending === f.pending_buf_size)) {
|
|
1519
|
+
k = 1;
|
|
1520
|
+
break;
|
|
1521
|
+
}
|
|
1522
|
+
k = f.gzindex < f.gzhead.comment.length ? 255 & f.gzhead.comment.charCodeAt(f.gzindex++) : 0, X(f, k);
|
|
1523
|
+
} while (k !== 0);
|
|
1524
|
+
f.gzhead.hcrc && f.pending > h && (t.adler = c(t.adler, f.pending_buf, f.pending - h, h)), k === 0 && (f.status = 103);
|
|
1525
|
+
} else f.status = 103;
|
|
1526
|
+
if (f.status === 103 && (f.gzhead.hcrc ? (f.pending + 2 > f.pending_buf_size && A(t), f.pending + 2 <= f.pending_buf_size && (X(f, 255 & t.adler), X(f, t.adler >> 8 & 255), t.adler = 0, f.status = R)) : f.status = R), f.pending !== 0) {
|
|
1527
|
+
if (A(t), t.avail_out === 0) return f.last_flush = -1, i;
|
|
1528
|
+
} else if (t.avail_in === 0 && j(T) <= j(C) && T !== m) return $(t, -5);
|
|
1529
|
+
if (f.status === 666 && t.avail_in !== 0) return $(t, -5);
|
|
1530
|
+
if (t.avail_in !== 0 || f.lookahead !== 0 || T !== _ && f.status !== 666) {
|
|
1531
|
+
var N = f.strategy === 2 ? function(E, Z) {
|
|
1532
|
+
for (var K; ; ) {
|
|
1533
|
+
if (E.lookahead === 0 && (it(E), E.lookahead === 0)) {
|
|
1534
|
+
if (Z === _) return e;
|
|
1535
|
+
break;
|
|
1536
|
+
}
|
|
1537
|
+
if (E.match_length = 0, K = n._tr_tally(E, 0, E.window[E.strstart]), E.lookahead--, E.strstart++, K && (z(E, !1), E.strm.avail_out === 0)) return e;
|
|
1538
|
+
}
|
|
1539
|
+
return E.insert = 0, Z === m ? (z(E, !0), E.strm.avail_out === 0 ? J : L) : E.last_lit && (z(E, !1), E.strm.avail_out === 0) ? e : D;
|
|
1540
|
+
}(f, T) : f.strategy === 3 ? function(E, Z) {
|
|
1541
|
+
for (var K, M, Y, nt, tt = E.window; ; ) {
|
|
1542
|
+
if (E.lookahead <= W) {
|
|
1543
|
+
if (it(E), E.lookahead <= W && Z === _) return e;
|
|
1544
|
+
if (E.lookahead === 0) break;
|
|
1545
|
+
}
|
|
1546
|
+
if (E.match_length = 0, E.lookahead >= O && 0 < E.strstart && (M = tt[Y = E.strstart - 1]) === tt[++Y] && M === tt[++Y] && M === tt[++Y]) {
|
|
1547
|
+
nt = E.strstart + W;
|
|
1548
|
+
do
|
|
1549
|
+
;
|
|
1550
|
+
while (M === tt[++Y] && M === tt[++Y] && M === tt[++Y] && M === tt[++Y] && M === tt[++Y] && M === tt[++Y] && M === tt[++Y] && M === tt[++Y] && Y < nt);
|
|
1551
|
+
E.match_length = W - (nt - Y), E.match_length > E.lookahead && (E.match_length = E.lookahead);
|
|
1552
|
+
}
|
|
1553
|
+
if (E.match_length >= O ? (K = n._tr_tally(E, 1, E.match_length - O), E.lookahead -= E.match_length, E.strstart += E.match_length, E.match_length = 0) : (K = n._tr_tally(E, 0, E.window[E.strstart]), E.lookahead--, E.strstart++), K && (z(E, !1), E.strm.avail_out === 0)) return e;
|
|
1554
|
+
}
|
|
1555
|
+
return E.insert = 0, Z === m ? (z(E, !0), E.strm.avail_out === 0 ? J : L) : E.last_lit && (z(E, !1), E.strm.avail_out === 0) ? e : D;
|
|
1556
|
+
}(f, T) : s[f.level].func(f, T);
|
|
1557
|
+
if (N !== J && N !== L || (f.status = 666), N === e || N === J) return t.avail_out === 0 && (f.last_flush = -1), i;
|
|
1558
|
+
if (N === D && (T === 1 ? n._tr_align(f) : T !== 5 && (n._tr_stored_block(f, 0, 0, !1), T === 3 && (V(f.head), f.lookahead === 0 && (f.strstart = 0, f.block_start = 0, f.insert = 0))), A(t), t.avail_out === 0)) return f.last_flush = -1, i;
|
|
1559
|
+
}
|
|
1560
|
+
return T !== m ? i : f.wrap <= 0 ? 1 : (f.wrap === 2 ? (X(f, 255 & t.adler), X(f, t.adler >> 8 & 255), X(f, t.adler >> 16 & 255), X(f, t.adler >> 24 & 255), X(f, 255 & t.total_in), X(f, t.total_in >> 8 & 255), X(f, t.total_in >> 16 & 255), X(f, t.total_in >> 24 & 255)) : (G(f, t.adler >>> 16), G(f, 65535 & t.adler)), A(t), 0 < f.wrap && (f.wrap = -f.wrap), f.pending !== 0 ? i : 1);
|
|
1561
|
+
}, w.deflateEnd = function(t) {
|
|
1562
|
+
var T;
|
|
1563
|
+
return t && t.state ? (T = t.state.status) !== b && T !== 69 && T !== 73 && T !== 91 && T !== 103 && T !== R && T !== 666 ? $(t, d) : (t.state = null, T === R ? $(t, -3) : i) : d;
|
|
1564
|
+
}, w.deflateSetDictionary = function(t, T) {
|
|
1565
|
+
var C, f, h, k, U, N, E, Z, K = T.length;
|
|
1566
|
+
if (!t || !t.state || (k = (C = t.state).wrap) === 2 || k === 1 && C.status !== b || C.lookahead) return d;
|
|
1567
|
+
for (k === 1 && (t.adler = u(t.adler, T, K, 0)), C.wrap = 0, K >= C.w_size && (k === 0 && (V(C.head), C.strstart = 0, C.block_start = 0, C.insert = 0), Z = new o.Buf8(C.w_size), o.arraySet(Z, T, K - C.w_size, C.w_size, 0), T = Z, K = C.w_size), U = t.avail_in, N = t.next_in, E = t.input, t.avail_in = K, t.next_in = 0, t.input = T, it(C); C.lookahead >= O; ) {
|
|
1568
|
+
for (f = C.strstart, h = C.lookahead - (O - 1); C.ins_h = (C.ins_h << C.hash_shift ^ C.window[f + O - 1]) & C.hash_mask, C.prev[f & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = f, f++, --h; ) ;
|
|
1569
|
+
C.strstart = f, C.lookahead = O - 1, it(C);
|
|
1570
|
+
}
|
|
1571
|
+
return C.strstart += C.lookahead, C.block_start = C.strstart, C.insert = C.lookahead, C.lookahead = 0, C.match_length = C.prev_length = O - 1, C.match_available = 0, t.next_in = N, t.input = E, t.avail_in = U, C.wrap = k, i;
|
|
1572
|
+
}, w.deflateInfo = "pako deflate (from Nodeca project)";
|
|
1573
|
+
}, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./messages": 51, "./trees": 52 }], 47: [function(g, I, w) {
|
|
1574
|
+
I.exports = function() {
|
|
1575
|
+
this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1;
|
|
1576
|
+
};
|
|
1577
|
+
}, {}], 48: [function(g, I, w) {
|
|
1578
|
+
I.exports = function(s, o) {
|
|
1579
|
+
var n, u, c, v, _, m, i, d, r, l, a, p, y, S, x, F, B, P, O, W, q, b, R, e, D;
|
|
1580
|
+
n = s.state, u = s.next_in, e = s.input, c = u + (s.avail_in - 5), v = s.next_out, D = s.output, _ = v - (o - s.avail_out), m = v + (s.avail_out - 257), i = n.dmax, d = n.wsize, r = n.whave, l = n.wnext, a = n.window, p = n.hold, y = n.bits, S = n.lencode, x = n.distcode, F = (1 << n.lenbits) - 1, B = (1 << n.distbits) - 1;
|
|
1581
|
+
t: do {
|
|
1582
|
+
y < 15 && (p += e[u++] << y, y += 8, p += e[u++] << y, y += 8), P = S[p & F];
|
|
1583
|
+
e: for (; ; ) {
|
|
1584
|
+
if (p >>>= O = P >>> 24, y -= O, (O = P >>> 16 & 255) === 0) D[v++] = 65535 & P;
|
|
1585
|
+
else {
|
|
1586
|
+
if (!(16 & O)) {
|
|
1587
|
+
if (!(64 & O)) {
|
|
1588
|
+
P = S[(65535 & P) + (p & (1 << O) - 1)];
|
|
1589
|
+
continue e;
|
|
1590
|
+
}
|
|
1591
|
+
if (32 & O) {
|
|
1592
|
+
n.mode = 12;
|
|
1593
|
+
break t;
|
|
1594
|
+
}
|
|
1595
|
+
s.msg = "invalid literal/length code", n.mode = 30;
|
|
1596
|
+
break t;
|
|
1597
|
+
}
|
|
1598
|
+
W = 65535 & P, (O &= 15) && (y < O && (p += e[u++] << y, y += 8), W += p & (1 << O) - 1, p >>>= O, y -= O), y < 15 && (p += e[u++] << y, y += 8, p += e[u++] << y, y += 8), P = x[p & B];
|
|
1599
|
+
r: for (; ; ) {
|
|
1600
|
+
if (p >>>= O = P >>> 24, y -= O, !(16 & (O = P >>> 16 & 255))) {
|
|
1601
|
+
if (!(64 & O)) {
|
|
1602
|
+
P = x[(65535 & P) + (p & (1 << O) - 1)];
|
|
1603
|
+
continue r;
|
|
1604
|
+
}
|
|
1605
|
+
s.msg = "invalid distance code", n.mode = 30;
|
|
1606
|
+
break t;
|
|
1607
|
+
}
|
|
1608
|
+
if (q = 65535 & P, y < (O &= 15) && (p += e[u++] << y, (y += 8) < O && (p += e[u++] << y, y += 8)), i < (q += p & (1 << O) - 1)) {
|
|
1609
|
+
s.msg = "invalid distance too far back", n.mode = 30;
|
|
1610
|
+
break t;
|
|
1611
|
+
}
|
|
1612
|
+
if (p >>>= O, y -= O, (O = v - _) < q) {
|
|
1613
|
+
if (r < (O = q - O) && n.sane) {
|
|
1614
|
+
s.msg = "invalid distance too far back", n.mode = 30;
|
|
1615
|
+
break t;
|
|
1616
|
+
}
|
|
1617
|
+
if (R = a, (b = 0) === l) {
|
|
1618
|
+
if (b += d - O, O < W) {
|
|
1619
|
+
for (W -= O; D[v++] = a[b++], --O; ) ;
|
|
1620
|
+
b = v - q, R = D;
|
|
1621
|
+
}
|
|
1622
|
+
} else if (l < O) {
|
|
1623
|
+
if (b += d + l - O, (O -= l) < W) {
|
|
1624
|
+
for (W -= O; D[v++] = a[b++], --O; ) ;
|
|
1625
|
+
if (b = 0, l < W) {
|
|
1626
|
+
for (W -= O = l; D[v++] = a[b++], --O; ) ;
|
|
1627
|
+
b = v - q, R = D;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
} else if (b += l - O, O < W) {
|
|
1631
|
+
for (W -= O; D[v++] = a[b++], --O; ) ;
|
|
1632
|
+
b = v - q, R = D;
|
|
1633
|
+
}
|
|
1634
|
+
for (; 2 < W; ) D[v++] = R[b++], D[v++] = R[b++], D[v++] = R[b++], W -= 3;
|
|
1635
|
+
W && (D[v++] = R[b++], 1 < W && (D[v++] = R[b++]));
|
|
1636
|
+
} else {
|
|
1637
|
+
for (b = v - q; D[v++] = D[b++], D[v++] = D[b++], D[v++] = D[b++], 2 < (W -= 3); ) ;
|
|
1638
|
+
W && (D[v++] = D[b++], 1 < W && (D[v++] = D[b++]));
|
|
1639
|
+
}
|
|
1640
|
+
break;
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
break;
|
|
1644
|
+
}
|
|
1645
|
+
} while (u < c && v < m);
|
|
1646
|
+
u -= W = y >> 3, p &= (1 << (y -= W << 3)) - 1, s.next_in = u, s.next_out = v, s.avail_in = u < c ? c - u + 5 : 5 - (u - c), s.avail_out = v < m ? m - v + 257 : 257 - (v - m), n.hold = p, n.bits = y;
|
|
1647
|
+
};
|
|
1648
|
+
}, {}], 49: [function(g, I, w) {
|
|
1649
|
+
var s = g("../utils/common"), o = g("./adler32"), n = g("./crc32"), u = g("./inffast"), c = g("./inftrees"), v = 1, _ = 2, m = 0, i = -2, d = 1, r = 852, l = 592;
|
|
1650
|
+
function a(b) {
|
|
1651
|
+
return (b >>> 24 & 255) + (b >>> 8 & 65280) + ((65280 & b) << 8) + ((255 & b) << 24);
|
|
1652
|
+
}
|
|
1653
|
+
function p() {
|
|
1654
|
+
this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new s.Buf16(320), this.work = new s.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
|
|
1655
|
+
}
|
|
1656
|
+
function y(b) {
|
|
1657
|
+
var R;
|
|
1658
|
+
return b && b.state ? (R = b.state, b.total_in = b.total_out = R.total = 0, b.msg = "", R.wrap && (b.adler = 1 & R.wrap), R.mode = d, R.last = 0, R.havedict = 0, R.dmax = 32768, R.head = null, R.hold = 0, R.bits = 0, R.lencode = R.lendyn = new s.Buf32(r), R.distcode = R.distdyn = new s.Buf32(l), R.sane = 1, R.back = -1, m) : i;
|
|
1659
|
+
}
|
|
1660
|
+
function S(b) {
|
|
1661
|
+
var R;
|
|
1662
|
+
return b && b.state ? ((R = b.state).wsize = 0, R.whave = 0, R.wnext = 0, y(b)) : i;
|
|
1663
|
+
}
|
|
1664
|
+
function x(b, R) {
|
|
1665
|
+
var e, D;
|
|
1666
|
+
return b && b.state ? (D = b.state, R < 0 ? (e = 0, R = -R) : (e = 1 + (R >> 4), R < 48 && (R &= 15)), R && (R < 8 || 15 < R) ? i : (D.window !== null && D.wbits !== R && (D.window = null), D.wrap = e, D.wbits = R, S(b))) : i;
|
|
1667
|
+
}
|
|
1668
|
+
function F(b, R) {
|
|
1669
|
+
var e, D;
|
|
1670
|
+
return b ? (D = new p(), (b.state = D).window = null, (e = x(b, R)) !== m && (b.state = null), e) : i;
|
|
1671
|
+
}
|
|
1672
|
+
var B, P, O = !0;
|
|
1673
|
+
function W(b) {
|
|
1674
|
+
if (O) {
|
|
1675
|
+
var R;
|
|
1676
|
+
for (B = new s.Buf32(512), P = new s.Buf32(32), R = 0; R < 144; ) b.lens[R++] = 8;
|
|
1677
|
+
for (; R < 256; ) b.lens[R++] = 9;
|
|
1678
|
+
for (; R < 280; ) b.lens[R++] = 7;
|
|
1679
|
+
for (; R < 288; ) b.lens[R++] = 8;
|
|
1680
|
+
for (c(v, b.lens, 0, 288, B, 0, b.work, { bits: 9 }), R = 0; R < 32; ) b.lens[R++] = 5;
|
|
1681
|
+
c(_, b.lens, 0, 32, P, 0, b.work, { bits: 5 }), O = !1;
|
|
1682
|
+
}
|
|
1683
|
+
b.lencode = B, b.lenbits = 9, b.distcode = P, b.distbits = 5;
|
|
1684
|
+
}
|
|
1685
|
+
function q(b, R, e, D) {
|
|
1686
|
+
var J, L = b.state;
|
|
1687
|
+
return L.window === null && (L.wsize = 1 << L.wbits, L.wnext = 0, L.whave = 0, L.window = new s.Buf8(L.wsize)), D >= L.wsize ? (s.arraySet(L.window, R, e - L.wsize, L.wsize, 0), L.wnext = 0, L.whave = L.wsize) : (D < (J = L.wsize - L.wnext) && (J = D), s.arraySet(L.window, R, e - D, J, L.wnext), (D -= J) ? (s.arraySet(L.window, R, e - D, D, 0), L.wnext = D, L.whave = L.wsize) : (L.wnext += J, L.wnext === L.wsize && (L.wnext = 0), L.whave < L.wsize && (L.whave += J))), 0;
|
|
1688
|
+
}
|
|
1689
|
+
w.inflateReset = S, w.inflateReset2 = x, w.inflateResetKeep = y, w.inflateInit = function(b) {
|
|
1690
|
+
return F(b, 15);
|
|
1691
|
+
}, w.inflateInit2 = F, w.inflate = function(b, R) {
|
|
1692
|
+
var e, D, J, L, $, j, V, A, z, X, G, H, it, ut, Q, rt, ht, at, ct, ft, t, T, C, f, h = 0, k = new s.Buf8(4), U = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
|
|
1693
|
+
if (!b || !b.state || !b.output || !b.input && b.avail_in !== 0) return i;
|
|
1694
|
+
(e = b.state).mode === 12 && (e.mode = 13), $ = b.next_out, J = b.output, V = b.avail_out, L = b.next_in, D = b.input, j = b.avail_in, A = e.hold, z = e.bits, X = j, G = V, T = m;
|
|
1695
|
+
t: for (; ; ) switch (e.mode) {
|
|
1696
|
+
case d:
|
|
1697
|
+
if (e.wrap === 0) {
|
|
1698
|
+
e.mode = 13;
|
|
1699
|
+
break;
|
|
1700
|
+
}
|
|
1701
|
+
for (; z < 16; ) {
|
|
1702
|
+
if (j === 0) break t;
|
|
1703
|
+
j--, A += D[L++] << z, z += 8;
|
|
1704
|
+
}
|
|
1705
|
+
if (2 & e.wrap && A === 35615) {
|
|
1706
|
+
k[e.check = 0] = 255 & A, k[1] = A >>> 8 & 255, e.check = n(e.check, k, 2, 0), z = A = 0, e.mode = 2;
|
|
1707
|
+
break;
|
|
1708
|
+
}
|
|
1709
|
+
if (e.flags = 0, e.head && (e.head.done = !1), !(1 & e.wrap) || (((255 & A) << 8) + (A >> 8)) % 31) {
|
|
1710
|
+
b.msg = "incorrect header check", e.mode = 30;
|
|
1711
|
+
break;
|
|
1712
|
+
}
|
|
1713
|
+
if ((15 & A) != 8) {
|
|
1714
|
+
b.msg = "unknown compression method", e.mode = 30;
|
|
1715
|
+
break;
|
|
1716
|
+
}
|
|
1717
|
+
if (z -= 4, t = 8 + (15 & (A >>>= 4)), e.wbits === 0) e.wbits = t;
|
|
1718
|
+
else if (t > e.wbits) {
|
|
1719
|
+
b.msg = "invalid window size", e.mode = 30;
|
|
1720
|
+
break;
|
|
1721
|
+
}
|
|
1722
|
+
e.dmax = 1 << t, b.adler = e.check = 1, e.mode = 512 & A ? 10 : 12, z = A = 0;
|
|
1723
|
+
break;
|
|
1724
|
+
case 2:
|
|
1725
|
+
for (; z < 16; ) {
|
|
1726
|
+
if (j === 0) break t;
|
|
1727
|
+
j--, A += D[L++] << z, z += 8;
|
|
1728
|
+
}
|
|
1729
|
+
if (e.flags = A, (255 & e.flags) != 8) {
|
|
1730
|
+
b.msg = "unknown compression method", e.mode = 30;
|
|
1731
|
+
break;
|
|
1732
|
+
}
|
|
1733
|
+
if (57344 & e.flags) {
|
|
1734
|
+
b.msg = "unknown header flags set", e.mode = 30;
|
|
1735
|
+
break;
|
|
1736
|
+
}
|
|
1737
|
+
e.head && (e.head.text = A >> 8 & 1), 512 & e.flags && (k[0] = 255 & A, k[1] = A >>> 8 & 255, e.check = n(e.check, k, 2, 0)), z = A = 0, e.mode = 3;
|
|
1738
|
+
case 3:
|
|
1739
|
+
for (; z < 32; ) {
|
|
1740
|
+
if (j === 0) break t;
|
|
1741
|
+
j--, A += D[L++] << z, z += 8;
|
|
1742
|
+
}
|
|
1743
|
+
e.head && (e.head.time = A), 512 & e.flags && (k[0] = 255 & A, k[1] = A >>> 8 & 255, k[2] = A >>> 16 & 255, k[3] = A >>> 24 & 255, e.check = n(e.check, k, 4, 0)), z = A = 0, e.mode = 4;
|
|
1744
|
+
case 4:
|
|
1745
|
+
for (; z < 16; ) {
|
|
1746
|
+
if (j === 0) break t;
|
|
1747
|
+
j--, A += D[L++] << z, z += 8;
|
|
1748
|
+
}
|
|
1749
|
+
e.head && (e.head.xflags = 255 & A, e.head.os = A >> 8), 512 & e.flags && (k[0] = 255 & A, k[1] = A >>> 8 & 255, e.check = n(e.check, k, 2, 0)), z = A = 0, e.mode = 5;
|
|
1750
|
+
case 5:
|
|
1751
|
+
if (1024 & e.flags) {
|
|
1752
|
+
for (; z < 16; ) {
|
|
1753
|
+
if (j === 0) break t;
|
|
1754
|
+
j--, A += D[L++] << z, z += 8;
|
|
1755
|
+
}
|
|
1756
|
+
e.length = A, e.head && (e.head.extra_len = A), 512 & e.flags && (k[0] = 255 & A, k[1] = A >>> 8 & 255, e.check = n(e.check, k, 2, 0)), z = A = 0;
|
|
1757
|
+
} else e.head && (e.head.extra = null);
|
|
1758
|
+
e.mode = 6;
|
|
1759
|
+
case 6:
|
|
1760
|
+
if (1024 & e.flags && (j < (H = e.length) && (H = j), H && (e.head && (t = e.head.extra_len - e.length, e.head.extra || (e.head.extra = new Array(e.head.extra_len)), s.arraySet(e.head.extra, D, L, H, t)), 512 & e.flags && (e.check = n(e.check, D, H, L)), j -= H, L += H, e.length -= H), e.length)) break t;
|
|
1761
|
+
e.length = 0, e.mode = 7;
|
|
1762
|
+
case 7:
|
|
1763
|
+
if (2048 & e.flags) {
|
|
1764
|
+
if (j === 0) break t;
|
|
1765
|
+
for (H = 0; t = D[L + H++], e.head && t && e.length < 65536 && (e.head.name += String.fromCharCode(t)), t && H < j; ) ;
|
|
1766
|
+
if (512 & e.flags && (e.check = n(e.check, D, H, L)), j -= H, L += H, t) break t;
|
|
1767
|
+
} else e.head && (e.head.name = null);
|
|
1768
|
+
e.length = 0, e.mode = 8;
|
|
1769
|
+
case 8:
|
|
1770
|
+
if (4096 & e.flags) {
|
|
1771
|
+
if (j === 0) break t;
|
|
1772
|
+
for (H = 0; t = D[L + H++], e.head && t && e.length < 65536 && (e.head.comment += String.fromCharCode(t)), t && H < j; ) ;
|
|
1773
|
+
if (512 & e.flags && (e.check = n(e.check, D, H, L)), j -= H, L += H, t) break t;
|
|
1774
|
+
} else e.head && (e.head.comment = null);
|
|
1775
|
+
e.mode = 9;
|
|
1776
|
+
case 9:
|
|
1777
|
+
if (512 & e.flags) {
|
|
1778
|
+
for (; z < 16; ) {
|
|
1779
|
+
if (j === 0) break t;
|
|
1780
|
+
j--, A += D[L++] << z, z += 8;
|
|
1781
|
+
}
|
|
1782
|
+
if (A !== (65535 & e.check)) {
|
|
1783
|
+
b.msg = "header crc mismatch", e.mode = 30;
|
|
1784
|
+
break;
|
|
1785
|
+
}
|
|
1786
|
+
z = A = 0;
|
|
1787
|
+
}
|
|
1788
|
+
e.head && (e.head.hcrc = e.flags >> 9 & 1, e.head.done = !0), b.adler = e.check = 0, e.mode = 12;
|
|
1789
|
+
break;
|
|
1790
|
+
case 10:
|
|
1791
|
+
for (; z < 32; ) {
|
|
1792
|
+
if (j === 0) break t;
|
|
1793
|
+
j--, A += D[L++] << z, z += 8;
|
|
1794
|
+
}
|
|
1795
|
+
b.adler = e.check = a(A), z = A = 0, e.mode = 11;
|
|
1796
|
+
case 11:
|
|
1797
|
+
if (e.havedict === 0) return b.next_out = $, b.avail_out = V, b.next_in = L, b.avail_in = j, e.hold = A, e.bits = z, 2;
|
|
1798
|
+
b.adler = e.check = 1, e.mode = 12;
|
|
1799
|
+
case 12:
|
|
1800
|
+
if (R === 5 || R === 6) break t;
|
|
1801
|
+
case 13:
|
|
1802
|
+
if (e.last) {
|
|
1803
|
+
A >>>= 7 & z, z -= 7 & z, e.mode = 27;
|
|
1804
|
+
break;
|
|
1805
|
+
}
|
|
1806
|
+
for (; z < 3; ) {
|
|
1807
|
+
if (j === 0) break t;
|
|
1808
|
+
j--, A += D[L++] << z, z += 8;
|
|
1809
|
+
}
|
|
1810
|
+
switch (e.last = 1 & A, z -= 1, 3 & (A >>>= 1)) {
|
|
1811
|
+
case 0:
|
|
1812
|
+
e.mode = 14;
|
|
1813
|
+
break;
|
|
1814
|
+
case 1:
|
|
1815
|
+
if (W(e), e.mode = 20, R !== 6) break;
|
|
1816
|
+
A >>>= 2, z -= 2;
|
|
1817
|
+
break t;
|
|
1818
|
+
case 2:
|
|
1819
|
+
e.mode = 17;
|
|
1820
|
+
break;
|
|
1821
|
+
case 3:
|
|
1822
|
+
b.msg = "invalid block type", e.mode = 30;
|
|
1823
|
+
}
|
|
1824
|
+
A >>>= 2, z -= 2;
|
|
1825
|
+
break;
|
|
1826
|
+
case 14:
|
|
1827
|
+
for (A >>>= 7 & z, z -= 7 & z; z < 32; ) {
|
|
1828
|
+
if (j === 0) break t;
|
|
1829
|
+
j--, A += D[L++] << z, z += 8;
|
|
1830
|
+
}
|
|
1831
|
+
if ((65535 & A) != (A >>> 16 ^ 65535)) {
|
|
1832
|
+
b.msg = "invalid stored block lengths", e.mode = 30;
|
|
1833
|
+
break;
|
|
1834
|
+
}
|
|
1835
|
+
if (e.length = 65535 & A, z = A = 0, e.mode = 15, R === 6) break t;
|
|
1836
|
+
case 15:
|
|
1837
|
+
e.mode = 16;
|
|
1838
|
+
case 16:
|
|
1839
|
+
if (H = e.length) {
|
|
1840
|
+
if (j < H && (H = j), V < H && (H = V), H === 0) break t;
|
|
1841
|
+
s.arraySet(J, D, L, H, $), j -= H, L += H, V -= H, $ += H, e.length -= H;
|
|
1842
|
+
break;
|
|
1843
|
+
}
|
|
1844
|
+
e.mode = 12;
|
|
1845
|
+
break;
|
|
1846
|
+
case 17:
|
|
1847
|
+
for (; z < 14; ) {
|
|
1848
|
+
if (j === 0) break t;
|
|
1849
|
+
j--, A += D[L++] << z, z += 8;
|
|
1850
|
+
}
|
|
1851
|
+
if (e.nlen = 257 + (31 & A), A >>>= 5, z -= 5, e.ndist = 1 + (31 & A), A >>>= 5, z -= 5, e.ncode = 4 + (15 & A), A >>>= 4, z -= 4, 286 < e.nlen || 30 < e.ndist) {
|
|
1852
|
+
b.msg = "too many length or distance symbols", e.mode = 30;
|
|
1853
|
+
break;
|
|
1854
|
+
}
|
|
1855
|
+
e.have = 0, e.mode = 18;
|
|
1856
|
+
case 18:
|
|
1857
|
+
for (; e.have < e.ncode; ) {
|
|
1858
|
+
for (; z < 3; ) {
|
|
1859
|
+
if (j === 0) break t;
|
|
1860
|
+
j--, A += D[L++] << z, z += 8;
|
|
1861
|
+
}
|
|
1862
|
+
e.lens[U[e.have++]] = 7 & A, A >>>= 3, z -= 3;
|
|
1863
|
+
}
|
|
1864
|
+
for (; e.have < 19; ) e.lens[U[e.have++]] = 0;
|
|
1865
|
+
if (e.lencode = e.lendyn, e.lenbits = 7, C = { bits: e.lenbits }, T = c(0, e.lens, 0, 19, e.lencode, 0, e.work, C), e.lenbits = C.bits, T) {
|
|
1866
|
+
b.msg = "invalid code lengths set", e.mode = 30;
|
|
1867
|
+
break;
|
|
1868
|
+
}
|
|
1869
|
+
e.have = 0, e.mode = 19;
|
|
1870
|
+
case 19:
|
|
1871
|
+
for (; e.have < e.nlen + e.ndist; ) {
|
|
1872
|
+
for (; rt = (h = e.lencode[A & (1 << e.lenbits) - 1]) >>> 16 & 255, ht = 65535 & h, !((Q = h >>> 24) <= z); ) {
|
|
1873
|
+
if (j === 0) break t;
|
|
1874
|
+
j--, A += D[L++] << z, z += 8;
|
|
1875
|
+
}
|
|
1876
|
+
if (ht < 16) A >>>= Q, z -= Q, e.lens[e.have++] = ht;
|
|
1877
|
+
else {
|
|
1878
|
+
if (ht === 16) {
|
|
1879
|
+
for (f = Q + 2; z < f; ) {
|
|
1880
|
+
if (j === 0) break t;
|
|
1881
|
+
j--, A += D[L++] << z, z += 8;
|
|
1882
|
+
}
|
|
1883
|
+
if (A >>>= Q, z -= Q, e.have === 0) {
|
|
1884
|
+
b.msg = "invalid bit length repeat", e.mode = 30;
|
|
1885
|
+
break;
|
|
1886
|
+
}
|
|
1887
|
+
t = e.lens[e.have - 1], H = 3 + (3 & A), A >>>= 2, z -= 2;
|
|
1888
|
+
} else if (ht === 17) {
|
|
1889
|
+
for (f = Q + 3; z < f; ) {
|
|
1890
|
+
if (j === 0) break t;
|
|
1891
|
+
j--, A += D[L++] << z, z += 8;
|
|
1892
|
+
}
|
|
1893
|
+
z -= Q, t = 0, H = 3 + (7 & (A >>>= Q)), A >>>= 3, z -= 3;
|
|
1894
|
+
} else {
|
|
1895
|
+
for (f = Q + 7; z < f; ) {
|
|
1896
|
+
if (j === 0) break t;
|
|
1897
|
+
j--, A += D[L++] << z, z += 8;
|
|
1898
|
+
}
|
|
1899
|
+
z -= Q, t = 0, H = 11 + (127 & (A >>>= Q)), A >>>= 7, z -= 7;
|
|
1900
|
+
}
|
|
1901
|
+
if (e.have + H > e.nlen + e.ndist) {
|
|
1902
|
+
b.msg = "invalid bit length repeat", e.mode = 30;
|
|
1903
|
+
break;
|
|
1904
|
+
}
|
|
1905
|
+
for (; H--; ) e.lens[e.have++] = t;
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
if (e.mode === 30) break;
|
|
1909
|
+
if (e.lens[256] === 0) {
|
|
1910
|
+
b.msg = "invalid code -- missing end-of-block", e.mode = 30;
|
|
1911
|
+
break;
|
|
1912
|
+
}
|
|
1913
|
+
if (e.lenbits = 9, C = { bits: e.lenbits }, T = c(v, e.lens, 0, e.nlen, e.lencode, 0, e.work, C), e.lenbits = C.bits, T) {
|
|
1914
|
+
b.msg = "invalid literal/lengths set", e.mode = 30;
|
|
1915
|
+
break;
|
|
1916
|
+
}
|
|
1917
|
+
if (e.distbits = 6, e.distcode = e.distdyn, C = { bits: e.distbits }, T = c(_, e.lens, e.nlen, e.ndist, e.distcode, 0, e.work, C), e.distbits = C.bits, T) {
|
|
1918
|
+
b.msg = "invalid distances set", e.mode = 30;
|
|
1919
|
+
break;
|
|
1920
|
+
}
|
|
1921
|
+
if (e.mode = 20, R === 6) break t;
|
|
1922
|
+
case 20:
|
|
1923
|
+
e.mode = 21;
|
|
1924
|
+
case 21:
|
|
1925
|
+
if (6 <= j && 258 <= V) {
|
|
1926
|
+
b.next_out = $, b.avail_out = V, b.next_in = L, b.avail_in = j, e.hold = A, e.bits = z, u(b, G), $ = b.next_out, J = b.output, V = b.avail_out, L = b.next_in, D = b.input, j = b.avail_in, A = e.hold, z = e.bits, e.mode === 12 && (e.back = -1);
|
|
1927
|
+
break;
|
|
1928
|
+
}
|
|
1929
|
+
for (e.back = 0; rt = (h = e.lencode[A & (1 << e.lenbits) - 1]) >>> 16 & 255, ht = 65535 & h, !((Q = h >>> 24) <= z); ) {
|
|
1930
|
+
if (j === 0) break t;
|
|
1931
|
+
j--, A += D[L++] << z, z += 8;
|
|
1932
|
+
}
|
|
1933
|
+
if (rt && !(240 & rt)) {
|
|
1934
|
+
for (at = Q, ct = rt, ft = ht; rt = (h = e.lencode[ft + ((A & (1 << at + ct) - 1) >> at)]) >>> 16 & 255, ht = 65535 & h, !(at + (Q = h >>> 24) <= z); ) {
|
|
1935
|
+
if (j === 0) break t;
|
|
1936
|
+
j--, A += D[L++] << z, z += 8;
|
|
1937
|
+
}
|
|
1938
|
+
A >>>= at, z -= at, e.back += at;
|
|
1939
|
+
}
|
|
1940
|
+
if (A >>>= Q, z -= Q, e.back += Q, e.length = ht, rt === 0) {
|
|
1941
|
+
e.mode = 26;
|
|
1942
|
+
break;
|
|
1943
|
+
}
|
|
1944
|
+
if (32 & rt) {
|
|
1945
|
+
e.back = -1, e.mode = 12;
|
|
1946
|
+
break;
|
|
1947
|
+
}
|
|
1948
|
+
if (64 & rt) {
|
|
1949
|
+
b.msg = "invalid literal/length code", e.mode = 30;
|
|
1950
|
+
break;
|
|
1951
|
+
}
|
|
1952
|
+
e.extra = 15 & rt, e.mode = 22;
|
|
1953
|
+
case 22:
|
|
1954
|
+
if (e.extra) {
|
|
1955
|
+
for (f = e.extra; z < f; ) {
|
|
1956
|
+
if (j === 0) break t;
|
|
1957
|
+
j--, A += D[L++] << z, z += 8;
|
|
1958
|
+
}
|
|
1959
|
+
e.length += A & (1 << e.extra) - 1, A >>>= e.extra, z -= e.extra, e.back += e.extra;
|
|
1960
|
+
}
|
|
1961
|
+
e.was = e.length, e.mode = 23;
|
|
1962
|
+
case 23:
|
|
1963
|
+
for (; rt = (h = e.distcode[A & (1 << e.distbits) - 1]) >>> 16 & 255, ht = 65535 & h, !((Q = h >>> 24) <= z); ) {
|
|
1964
|
+
if (j === 0) break t;
|
|
1965
|
+
j--, A += D[L++] << z, z += 8;
|
|
1966
|
+
}
|
|
1967
|
+
if (!(240 & rt)) {
|
|
1968
|
+
for (at = Q, ct = rt, ft = ht; rt = (h = e.distcode[ft + ((A & (1 << at + ct) - 1) >> at)]) >>> 16 & 255, ht = 65535 & h, !(at + (Q = h >>> 24) <= z); ) {
|
|
1969
|
+
if (j === 0) break t;
|
|
1970
|
+
j--, A += D[L++] << z, z += 8;
|
|
1971
|
+
}
|
|
1972
|
+
A >>>= at, z -= at, e.back += at;
|
|
1973
|
+
}
|
|
1974
|
+
if (A >>>= Q, z -= Q, e.back += Q, 64 & rt) {
|
|
1975
|
+
b.msg = "invalid distance code", e.mode = 30;
|
|
1976
|
+
break;
|
|
1977
|
+
}
|
|
1978
|
+
e.offset = ht, e.extra = 15 & rt, e.mode = 24;
|
|
1979
|
+
case 24:
|
|
1980
|
+
if (e.extra) {
|
|
1981
|
+
for (f = e.extra; z < f; ) {
|
|
1982
|
+
if (j === 0) break t;
|
|
1983
|
+
j--, A += D[L++] << z, z += 8;
|
|
1984
|
+
}
|
|
1985
|
+
e.offset += A & (1 << e.extra) - 1, A >>>= e.extra, z -= e.extra, e.back += e.extra;
|
|
1986
|
+
}
|
|
1987
|
+
if (e.offset > e.dmax) {
|
|
1988
|
+
b.msg = "invalid distance too far back", e.mode = 30;
|
|
1989
|
+
break;
|
|
1990
|
+
}
|
|
1991
|
+
e.mode = 25;
|
|
1992
|
+
case 25:
|
|
1993
|
+
if (V === 0) break t;
|
|
1994
|
+
if (H = G - V, e.offset > H) {
|
|
1995
|
+
if ((H = e.offset - H) > e.whave && e.sane) {
|
|
1996
|
+
b.msg = "invalid distance too far back", e.mode = 30;
|
|
1997
|
+
break;
|
|
1998
|
+
}
|
|
1999
|
+
it = H > e.wnext ? (H -= e.wnext, e.wsize - H) : e.wnext - H, H > e.length && (H = e.length), ut = e.window;
|
|
2000
|
+
} else ut = J, it = $ - e.offset, H = e.length;
|
|
2001
|
+
for (V < H && (H = V), V -= H, e.length -= H; J[$++] = ut[it++], --H; ) ;
|
|
2002
|
+
e.length === 0 && (e.mode = 21);
|
|
2003
|
+
break;
|
|
2004
|
+
case 26:
|
|
2005
|
+
if (V === 0) break t;
|
|
2006
|
+
J[$++] = e.length, V--, e.mode = 21;
|
|
2007
|
+
break;
|
|
2008
|
+
case 27:
|
|
2009
|
+
if (e.wrap) {
|
|
2010
|
+
for (; z < 32; ) {
|
|
2011
|
+
if (j === 0) break t;
|
|
2012
|
+
j--, A |= D[L++] << z, z += 8;
|
|
2013
|
+
}
|
|
2014
|
+
if (G -= V, b.total_out += G, e.total += G, G && (b.adler = e.check = e.flags ? n(e.check, J, G, $ - G) : o(e.check, J, G, $ - G)), G = V, (e.flags ? A : a(A)) !== e.check) {
|
|
2015
|
+
b.msg = "incorrect data check", e.mode = 30;
|
|
2016
|
+
break;
|
|
2017
|
+
}
|
|
2018
|
+
z = A = 0;
|
|
2019
|
+
}
|
|
2020
|
+
e.mode = 28;
|
|
2021
|
+
case 28:
|
|
2022
|
+
if (e.wrap && e.flags) {
|
|
2023
|
+
for (; z < 32; ) {
|
|
2024
|
+
if (j === 0) break t;
|
|
2025
|
+
j--, A += D[L++] << z, z += 8;
|
|
2026
|
+
}
|
|
2027
|
+
if (A !== (4294967295 & e.total)) {
|
|
2028
|
+
b.msg = "incorrect length check", e.mode = 30;
|
|
2029
|
+
break;
|
|
2030
|
+
}
|
|
2031
|
+
z = A = 0;
|
|
2032
|
+
}
|
|
2033
|
+
e.mode = 29;
|
|
2034
|
+
case 29:
|
|
2035
|
+
T = 1;
|
|
2036
|
+
break t;
|
|
2037
|
+
case 30:
|
|
2038
|
+
T = -3;
|
|
2039
|
+
break t;
|
|
2040
|
+
case 31:
|
|
2041
|
+
return -4;
|
|
2042
|
+
case 32:
|
|
2043
|
+
default:
|
|
2044
|
+
return i;
|
|
2045
|
+
}
|
|
2046
|
+
return b.next_out = $, b.avail_out = V, b.next_in = L, b.avail_in = j, e.hold = A, e.bits = z, (e.wsize || G !== b.avail_out && e.mode < 30 && (e.mode < 27 || R !== 4)) && q(b, b.output, b.next_out, G - b.avail_out) ? (e.mode = 31, -4) : (X -= b.avail_in, G -= b.avail_out, b.total_in += X, b.total_out += G, e.total += G, e.wrap && G && (b.adler = e.check = e.flags ? n(e.check, J, G, b.next_out - G) : o(e.check, J, G, b.next_out - G)), b.data_type = e.bits + (e.last ? 64 : 0) + (e.mode === 12 ? 128 : 0) + (e.mode === 20 || e.mode === 15 ? 256 : 0), (X == 0 && G === 0 || R === 4) && T === m && (T = -5), T);
|
|
2047
|
+
}, w.inflateEnd = function(b) {
|
|
2048
|
+
if (!b || !b.state) return i;
|
|
2049
|
+
var R = b.state;
|
|
2050
|
+
return R.window && (R.window = null), b.state = null, m;
|
|
2051
|
+
}, w.inflateGetHeader = function(b, R) {
|
|
2052
|
+
var e;
|
|
2053
|
+
return b && b.state && 2 & (e = b.state).wrap ? ((e.head = R).done = !1, m) : i;
|
|
2054
|
+
}, w.inflateSetDictionary = function(b, R) {
|
|
2055
|
+
var e, D = R.length;
|
|
2056
|
+
return b && b.state ? (e = b.state).wrap !== 0 && e.mode !== 11 ? i : e.mode === 11 && o(1, R, D, 0) !== e.check ? -3 : q(b, R, D, D) ? (e.mode = 31, -4) : (e.havedict = 1, m) : i;
|
|
2057
|
+
}, w.inflateInfo = "pako inflate (from Nodeca project)";
|
|
2058
|
+
}, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function(g, I, w) {
|
|
2059
|
+
var s = g("../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], n = [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], u = [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], c = [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];
|
|
2060
|
+
I.exports = function(v, _, m, i, d, r, l, a) {
|
|
2061
|
+
var p, y, S, x, F, B, P, O, W, q = a.bits, b = 0, R = 0, e = 0, D = 0, J = 0, L = 0, $ = 0, j = 0, V = 0, A = 0, z = null, X = 0, G = new s.Buf16(16), H = new s.Buf16(16), it = null, ut = 0;
|
|
2062
|
+
for (b = 0; b <= 15; b++) G[b] = 0;
|
|
2063
|
+
for (R = 0; R < i; R++) G[_[m + R]]++;
|
|
2064
|
+
for (J = q, D = 15; 1 <= D && G[D] === 0; D--) ;
|
|
2065
|
+
if (D < J && (J = D), D === 0) return d[r++] = 20971520, d[r++] = 20971520, a.bits = 1, 0;
|
|
2066
|
+
for (e = 1; e < D && G[e] === 0; e++) ;
|
|
2067
|
+
for (J < e && (J = e), b = j = 1; b <= 15; b++) if (j <<= 1, (j -= G[b]) < 0) return -1;
|
|
2068
|
+
if (0 < j && (v === 0 || D !== 1)) return -1;
|
|
2069
|
+
for (H[1] = 0, b = 1; b < 15; b++) H[b + 1] = H[b] + G[b];
|
|
2070
|
+
for (R = 0; R < i; R++) _[m + R] !== 0 && (l[H[_[m + R]]++] = R);
|
|
2071
|
+
if (B = v === 0 ? (z = it = l, 19) : v === 1 ? (z = o, X -= 257, it = n, ut -= 257, 256) : (z = u, it = c, -1), b = e, F = r, $ = R = A = 0, S = -1, x = (V = 1 << (L = J)) - 1, v === 1 && 852 < V || v === 2 && 592 < V) return 1;
|
|
2072
|
+
for (; ; ) {
|
|
2073
|
+
for (P = b - $, W = l[R] < B ? (O = 0, l[R]) : l[R] > B ? (O = it[ut + l[R]], z[X + l[R]]) : (O = 96, 0), p = 1 << b - $, e = y = 1 << L; d[F + (A >> $) + (y -= p)] = P << 24 | O << 16 | W | 0, y !== 0; ) ;
|
|
2074
|
+
for (p = 1 << b - 1; A & p; ) p >>= 1;
|
|
2075
|
+
if (p !== 0 ? (A &= p - 1, A += p) : A = 0, R++, --G[b] == 0) {
|
|
2076
|
+
if (b === D) break;
|
|
2077
|
+
b = _[m + l[R]];
|
|
2078
|
+
}
|
|
2079
|
+
if (J < b && (A & x) !== S) {
|
|
2080
|
+
for ($ === 0 && ($ = J), F += e, j = 1 << (L = b - $); L + $ < D && !((j -= G[L + $]) <= 0); ) L++, j <<= 1;
|
|
2081
|
+
if (V += 1 << L, v === 1 && 852 < V || v === 2 && 592 < V) return 1;
|
|
2082
|
+
d[S = A & x] = J << 24 | L << 16 | F - r | 0;
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
return A !== 0 && (d[F + A] = b - $ << 24 | 64 << 16 | 0), a.bits = J, 0;
|
|
2086
|
+
};
|
|
2087
|
+
}, { "../utils/common": 41 }], 51: [function(g, I, w) {
|
|
2088
|
+
I.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" };
|
|
2089
|
+
}, {}], 52: [function(g, I, w) {
|
|
2090
|
+
var s = g("../utils/common"), o = 0, n = 1;
|
|
2091
|
+
function u(h) {
|
|
2092
|
+
for (var k = h.length; 0 <= --k; ) h[k] = 0;
|
|
2093
|
+
}
|
|
2094
|
+
var c = 0, v = 29, _ = 256, m = _ + 1 + v, i = 30, d = 19, r = 2 * m + 1, l = 15, a = 16, p = 7, y = 256, S = 16, x = 17, F = 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], P = [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], O = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], W = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], q = new Array(2 * (m + 2));
|
|
2095
|
+
u(q);
|
|
2096
|
+
var b = new Array(2 * i);
|
|
2097
|
+
u(b);
|
|
2098
|
+
var R = new Array(512);
|
|
2099
|
+
u(R);
|
|
2100
|
+
var e = new Array(256);
|
|
2101
|
+
u(e);
|
|
2102
|
+
var D = new Array(v);
|
|
2103
|
+
u(D);
|
|
2104
|
+
var J, L, $, j = new Array(i);
|
|
2105
|
+
function V(h, k, U, N, E) {
|
|
2106
|
+
this.static_tree = h, this.extra_bits = k, this.extra_base = U, this.elems = N, this.max_length = E, this.has_stree = h && h.length;
|
|
2107
|
+
}
|
|
2108
|
+
function A(h, k) {
|
|
2109
|
+
this.dyn_tree = h, this.max_code = 0, this.stat_desc = k;
|
|
2110
|
+
}
|
|
2111
|
+
function z(h) {
|
|
2112
|
+
return h < 256 ? R[h] : R[256 + (h >>> 7)];
|
|
2113
|
+
}
|
|
2114
|
+
function X(h, k) {
|
|
2115
|
+
h.pending_buf[h.pending++] = 255 & k, h.pending_buf[h.pending++] = k >>> 8 & 255;
|
|
2116
|
+
}
|
|
2117
|
+
function G(h, k, U) {
|
|
2118
|
+
h.bi_valid > a - U ? (h.bi_buf |= k << h.bi_valid & 65535, X(h, h.bi_buf), h.bi_buf = k >> a - h.bi_valid, h.bi_valid += U - a) : (h.bi_buf |= k << h.bi_valid & 65535, h.bi_valid += U);
|
|
2119
|
+
}
|
|
2120
|
+
function H(h, k, U) {
|
|
2121
|
+
G(h, U[2 * k], U[2 * k + 1]);
|
|
2122
|
+
}
|
|
2123
|
+
function it(h, k) {
|
|
2124
|
+
for (var U = 0; U |= 1 & h, h >>>= 1, U <<= 1, 0 < --k; ) ;
|
|
2125
|
+
return U >>> 1;
|
|
2126
|
+
}
|
|
2127
|
+
function ut(h, k, U) {
|
|
2128
|
+
var N, E, Z = new Array(l + 1), K = 0;
|
|
2129
|
+
for (N = 1; N <= l; N++) Z[N] = K = K + U[N - 1] << 1;
|
|
2130
|
+
for (E = 0; E <= k; E++) {
|
|
2131
|
+
var M = h[2 * E + 1];
|
|
2132
|
+
M !== 0 && (h[2 * E] = it(Z[M]++, M));
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
function Q(h) {
|
|
2136
|
+
var k;
|
|
2137
|
+
for (k = 0; k < m; k++) h.dyn_ltree[2 * k] = 0;
|
|
2138
|
+
for (k = 0; k < i; k++) h.dyn_dtree[2 * k] = 0;
|
|
2139
|
+
for (k = 0; k < d; k++) h.bl_tree[2 * k] = 0;
|
|
2140
|
+
h.dyn_ltree[2 * y] = 1, h.opt_len = h.static_len = 0, h.last_lit = h.matches = 0;
|
|
2141
|
+
}
|
|
2142
|
+
function rt(h) {
|
|
2143
|
+
8 < h.bi_valid ? X(h, h.bi_buf) : 0 < h.bi_valid && (h.pending_buf[h.pending++] = h.bi_buf), h.bi_buf = 0, h.bi_valid = 0;
|
|
2144
|
+
}
|
|
2145
|
+
function ht(h, k, U, N) {
|
|
2146
|
+
var E = 2 * k, Z = 2 * U;
|
|
2147
|
+
return h[E] < h[Z] || h[E] === h[Z] && N[k] <= N[U];
|
|
2148
|
+
}
|
|
2149
|
+
function at(h, k, U) {
|
|
2150
|
+
for (var N = h.heap[U], E = U << 1; E <= h.heap_len && (E < h.heap_len && ht(k, h.heap[E + 1], h.heap[E], h.depth) && E++, !ht(k, N, h.heap[E], h.depth)); ) h.heap[U] = h.heap[E], U = E, E <<= 1;
|
|
2151
|
+
h.heap[U] = N;
|
|
2152
|
+
}
|
|
2153
|
+
function ct(h, k, U) {
|
|
2154
|
+
var N, E, Z, K, M = 0;
|
|
2155
|
+
if (h.last_lit !== 0) for (; N = h.pending_buf[h.d_buf + 2 * M] << 8 | h.pending_buf[h.d_buf + 2 * M + 1], E = h.pending_buf[h.l_buf + M], M++, N === 0 ? H(h, E, k) : (H(h, (Z = e[E]) + _ + 1, k), (K = B[Z]) !== 0 && G(h, E -= D[Z], K), H(h, Z = z(--N), U), (K = P[Z]) !== 0 && G(h, N -= j[Z], K)), M < h.last_lit; ) ;
|
|
2156
|
+
H(h, y, k);
|
|
2157
|
+
}
|
|
2158
|
+
function ft(h, k) {
|
|
2159
|
+
var U, N, E, Z = k.dyn_tree, K = k.stat_desc.static_tree, M = k.stat_desc.has_stree, Y = k.stat_desc.elems, nt = -1;
|
|
2160
|
+
for (h.heap_len = 0, h.heap_max = r, U = 0; U < Y; U++) Z[2 * U] !== 0 ? (h.heap[++h.heap_len] = nt = U, h.depth[U] = 0) : Z[2 * U + 1] = 0;
|
|
2161
|
+
for (; h.heap_len < 2; ) Z[2 * (E = h.heap[++h.heap_len] = nt < 2 ? ++nt : 0)] = 1, h.depth[E] = 0, h.opt_len--, M && (h.static_len -= K[2 * E + 1]);
|
|
2162
|
+
for (k.max_code = nt, U = h.heap_len >> 1; 1 <= U; U--) at(h, Z, U);
|
|
2163
|
+
for (E = Y; U = h.heap[1], h.heap[1] = h.heap[h.heap_len--], at(h, Z, 1), N = h.heap[1], h.heap[--h.heap_max] = U, h.heap[--h.heap_max] = N, Z[2 * E] = Z[2 * U] + Z[2 * N], h.depth[E] = (h.depth[U] >= h.depth[N] ? h.depth[U] : h.depth[N]) + 1, Z[2 * U + 1] = Z[2 * N + 1] = E, h.heap[1] = E++, at(h, Z, 1), 2 <= h.heap_len; ) ;
|
|
2164
|
+
h.heap[--h.heap_max] = h.heap[1], function(tt, lt) {
|
|
2165
|
+
var _t, dt, gt, st, bt, kt, pt = lt.dyn_tree, xt = lt.max_code, It = lt.stat_desc.static_tree, Ot = lt.stat_desc.has_stree, Bt = lt.stat_desc.extra_bits, St = lt.stat_desc.extra_base, vt = lt.stat_desc.max_length, yt = 0;
|
|
2166
|
+
for (st = 0; st <= l; st++) tt.bl_count[st] = 0;
|
|
2167
|
+
for (pt[2 * tt.heap[tt.heap_max] + 1] = 0, _t = tt.heap_max + 1; _t < r; _t++) vt < (st = pt[2 * pt[2 * (dt = tt.heap[_t]) + 1] + 1] + 1) && (st = vt, yt++), pt[2 * dt + 1] = st, xt < dt || (tt.bl_count[st]++, bt = 0, St <= dt && (bt = Bt[dt - St]), kt = pt[2 * dt], tt.opt_len += kt * (st + bt), Ot && (tt.static_len += kt * (It[2 * dt + 1] + bt)));
|
|
2168
|
+
if (yt !== 0) {
|
|
2169
|
+
do {
|
|
2170
|
+
for (st = vt - 1; tt.bl_count[st] === 0; ) st--;
|
|
2171
|
+
tt.bl_count[st]--, tt.bl_count[st + 1] += 2, tt.bl_count[vt]--, yt -= 2;
|
|
2172
|
+
} while (0 < yt);
|
|
2173
|
+
for (st = vt; st !== 0; st--) for (dt = tt.bl_count[st]; dt !== 0; ) xt < (gt = tt.heap[--_t]) || (pt[2 * gt + 1] !== st && (tt.opt_len += (st - pt[2 * gt + 1]) * pt[2 * gt], pt[2 * gt + 1] = st), dt--);
|
|
2174
|
+
}
|
|
2175
|
+
}(h, k), ut(Z, nt, h.bl_count);
|
|
2176
|
+
}
|
|
2177
|
+
function t(h, k, U) {
|
|
2178
|
+
var N, E, Z = -1, K = k[1], M = 0, Y = 7, nt = 4;
|
|
2179
|
+
for (K === 0 && (Y = 138, nt = 3), k[2 * (U + 1) + 1] = 65535, N = 0; N <= U; N++) E = K, K = k[2 * (N + 1) + 1], ++M < Y && E === K || (M < nt ? h.bl_tree[2 * E] += M : E !== 0 ? (E !== Z && h.bl_tree[2 * E]++, h.bl_tree[2 * S]++) : M <= 10 ? h.bl_tree[2 * x]++ : h.bl_tree[2 * F]++, Z = E, nt = (M = 0) === K ? (Y = 138, 3) : E === K ? (Y = 6, 3) : (Y = 7, 4));
|
|
2180
|
+
}
|
|
2181
|
+
function T(h, k, U) {
|
|
2182
|
+
var N, E, Z = -1, K = k[1], M = 0, Y = 7, nt = 4;
|
|
2183
|
+
for (K === 0 && (Y = 138, nt = 3), N = 0; N <= U; N++) if (E = K, K = k[2 * (N + 1) + 1], !(++M < Y && E === K)) {
|
|
2184
|
+
if (M < nt) for (; H(h, E, h.bl_tree), --M != 0; ) ;
|
|
2185
|
+
else E !== 0 ? (E !== Z && (H(h, E, h.bl_tree), M--), H(h, S, h.bl_tree), G(h, M - 3, 2)) : M <= 10 ? (H(h, x, h.bl_tree), G(h, M - 3, 3)) : (H(h, F, h.bl_tree), G(h, M - 11, 7));
|
|
2186
|
+
Z = E, nt = (M = 0) === K ? (Y = 138, 3) : E === K ? (Y = 6, 3) : (Y = 7, 4);
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
u(j);
|
|
2190
|
+
var C = !1;
|
|
2191
|
+
function f(h, k, U, N) {
|
|
2192
|
+
G(h, (c << 1) + (N ? 1 : 0), 3), function(E, Z, K, M) {
|
|
2193
|
+
rt(E), X(E, K), X(E, ~K), s.arraySet(E.pending_buf, E.window, Z, K, E.pending), E.pending += K;
|
|
2194
|
+
}(h, k, U);
|
|
2195
|
+
}
|
|
2196
|
+
w._tr_init = function(h) {
|
|
2197
|
+
C || (function() {
|
|
2198
|
+
var k, U, N, E, Z, K = new Array(l + 1);
|
|
2199
|
+
for (E = N = 0; E < v - 1; E++) for (D[E] = N, k = 0; k < 1 << B[E]; k++) e[N++] = E;
|
|
2200
|
+
for (e[N - 1] = E, E = Z = 0; E < 16; E++) for (j[E] = Z, k = 0; k < 1 << P[E]; k++) R[Z++] = E;
|
|
2201
|
+
for (Z >>= 7; E < i; E++) for (j[E] = Z << 7, k = 0; k < 1 << P[E] - 7; k++) R[256 + Z++] = E;
|
|
2202
|
+
for (U = 0; U <= l; U++) K[U] = 0;
|
|
2203
|
+
for (k = 0; k <= 143; ) q[2 * k + 1] = 8, k++, K[8]++;
|
|
2204
|
+
for (; k <= 255; ) q[2 * k + 1] = 9, k++, K[9]++;
|
|
2205
|
+
for (; k <= 279; ) q[2 * k + 1] = 7, k++, K[7]++;
|
|
2206
|
+
for (; k <= 287; ) q[2 * k + 1] = 8, k++, K[8]++;
|
|
2207
|
+
for (ut(q, m + 1, K), k = 0; k < i; k++) b[2 * k + 1] = 5, b[2 * k] = it(k, 5);
|
|
2208
|
+
J = new V(q, B, _ + 1, m, l), L = new V(b, P, 0, i, l), $ = new V(new Array(0), O, 0, d, p);
|
|
2209
|
+
}(), C = !0), h.l_desc = new A(h.dyn_ltree, J), h.d_desc = new A(h.dyn_dtree, L), h.bl_desc = new A(h.bl_tree, $), h.bi_buf = 0, h.bi_valid = 0, Q(h);
|
|
2210
|
+
}, w._tr_stored_block = f, w._tr_flush_block = function(h, k, U, N) {
|
|
2211
|
+
var E, Z, K = 0;
|
|
2212
|
+
0 < h.level ? (h.strm.data_type === 2 && (h.strm.data_type = function(M) {
|
|
2213
|
+
var Y, nt = 4093624447;
|
|
2214
|
+
for (Y = 0; Y <= 31; Y++, nt >>>= 1) if (1 & nt && M.dyn_ltree[2 * Y] !== 0) return o;
|
|
2215
|
+
if (M.dyn_ltree[18] !== 0 || M.dyn_ltree[20] !== 0 || M.dyn_ltree[26] !== 0) return n;
|
|
2216
|
+
for (Y = 32; Y < _; Y++) if (M.dyn_ltree[2 * Y] !== 0) return n;
|
|
2217
|
+
return o;
|
|
2218
|
+
}(h)), ft(h, h.l_desc), ft(h, h.d_desc), K = function(M) {
|
|
2219
|
+
var Y;
|
|
2220
|
+
for (t(M, M.dyn_ltree, M.l_desc.max_code), t(M, M.dyn_dtree, M.d_desc.max_code), ft(M, M.bl_desc), Y = d - 1; 3 <= Y && M.bl_tree[2 * W[Y] + 1] === 0; Y--) ;
|
|
2221
|
+
return M.opt_len += 3 * (Y + 1) + 5 + 5 + 4, Y;
|
|
2222
|
+
}(h), E = h.opt_len + 3 + 7 >>> 3, (Z = h.static_len + 3 + 7 >>> 3) <= E && (E = Z)) : E = Z = U + 5, U + 4 <= E && k !== -1 ? f(h, k, U, N) : h.strategy === 4 || Z === E ? (G(h, 2 + (N ? 1 : 0), 3), ct(h, q, b)) : (G(h, 4 + (N ? 1 : 0), 3), function(M, Y, nt, tt) {
|
|
2223
|
+
var lt;
|
|
2224
|
+
for (G(M, Y - 257, 5), G(M, nt - 1, 5), G(M, tt - 4, 4), lt = 0; lt < tt; lt++) G(M, M.bl_tree[2 * W[lt] + 1], 3);
|
|
2225
|
+
T(M, M.dyn_ltree, Y - 1), T(M, M.dyn_dtree, nt - 1);
|
|
2226
|
+
}(h, h.l_desc.max_code + 1, h.d_desc.max_code + 1, K + 1), ct(h, h.dyn_ltree, h.dyn_dtree)), Q(h), N && rt(h);
|
|
2227
|
+
}, w._tr_tally = function(h, k, U) {
|
|
2228
|
+
return h.pending_buf[h.d_buf + 2 * h.last_lit] = k >>> 8 & 255, h.pending_buf[h.d_buf + 2 * h.last_lit + 1] = 255 & k, h.pending_buf[h.l_buf + h.last_lit] = 255 & U, h.last_lit++, k === 0 ? h.dyn_ltree[2 * U]++ : (h.matches++, k--, h.dyn_ltree[2 * (e[U] + _ + 1)]++, h.dyn_dtree[2 * z(k)]++), h.last_lit === h.lit_bufsize - 1;
|
|
2229
|
+
}, w._tr_align = function(h) {
|
|
2230
|
+
G(h, 2, 3), H(h, y, q), function(k) {
|
|
2231
|
+
k.bi_valid === 16 ? (X(k, k.bi_buf), k.bi_buf = 0, k.bi_valid = 0) : 8 <= k.bi_valid && (k.pending_buf[k.pending++] = 255 & k.bi_buf, k.bi_buf >>= 8, k.bi_valid -= 8);
|
|
2232
|
+
}(h);
|
|
2233
|
+
};
|
|
2234
|
+
}, { "../utils/common": 41 }], 53: [function(g, I, w) {
|
|
2235
|
+
I.exports = function() {
|
|
2236
|
+
this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
|
|
2237
|
+
};
|
|
2238
|
+
}, {}], 54: [function(g, I, w) {
|
|
2239
|
+
(function(s) {
|
|
2240
|
+
(function(o, n) {
|
|
2241
|
+
if (!o.setImmediate) {
|
|
2242
|
+
var u, c, v, _, m = 1, i = {}, d = !1, r = o.document, l = Object.getPrototypeOf && Object.getPrototypeOf(o);
|
|
2243
|
+
l = l && l.setTimeout ? l : o, u = {}.toString.call(o.process) === "[object process]" ? function(S) {
|
|
2244
|
+
process.nextTick(function() {
|
|
2245
|
+
p(S);
|
|
2246
|
+
});
|
|
2247
|
+
} : function() {
|
|
2248
|
+
if (o.postMessage && !o.importScripts) {
|
|
2249
|
+
var S = !0, x = o.onmessage;
|
|
2250
|
+
return o.onmessage = function() {
|
|
2251
|
+
S = !1;
|
|
2252
|
+
}, o.postMessage("", "*"), o.onmessage = x, S;
|
|
2253
|
+
}
|
|
2254
|
+
}() ? (_ = "setImmediate$" + Math.random() + "$", o.addEventListener ? o.addEventListener("message", y, !1) : o.attachEvent("onmessage", y), function(S) {
|
|
2255
|
+
o.postMessage(_ + S, "*");
|
|
2256
|
+
}) : o.MessageChannel ? ((v = new MessageChannel()).port1.onmessage = function(S) {
|
|
2257
|
+
p(S.data);
|
|
2258
|
+
}, function(S) {
|
|
2259
|
+
v.port2.postMessage(S);
|
|
2260
|
+
}) : r && "onreadystatechange" in r.createElement("script") ? (c = r.documentElement, function(S) {
|
|
2261
|
+
var x = r.createElement("script");
|
|
2262
|
+
x.onreadystatechange = function() {
|
|
2263
|
+
p(S), x.onreadystatechange = null, c.removeChild(x), x = null;
|
|
2264
|
+
}, c.appendChild(x);
|
|
2265
|
+
}) : function(S) {
|
|
2266
|
+
setTimeout(p, 0, S);
|
|
2267
|
+
}, l.setImmediate = function(S) {
|
|
2268
|
+
typeof S != "function" && (S = new Function("" + S));
|
|
2269
|
+
for (var x = new Array(arguments.length - 1), F = 0; F < x.length; F++) x[F] = arguments[F + 1];
|
|
2270
|
+
var B = { callback: S, args: x };
|
|
2271
|
+
return i[m] = B, u(m), m++;
|
|
2272
|
+
}, l.clearImmediate = a;
|
|
2273
|
+
}
|
|
2274
|
+
function a(S) {
|
|
2275
|
+
delete i[S];
|
|
2276
|
+
}
|
|
2277
|
+
function p(S) {
|
|
2278
|
+
if (d) setTimeout(p, 0, S);
|
|
2279
|
+
else {
|
|
2280
|
+
var x = i[S];
|
|
2281
|
+
if (x) {
|
|
2282
|
+
d = !0;
|
|
2283
|
+
try {
|
|
2284
|
+
(function(F) {
|
|
2285
|
+
var B = F.callback, P = F.args;
|
|
2286
|
+
switch (P.length) {
|
|
2287
|
+
case 0:
|
|
2288
|
+
B();
|
|
2289
|
+
break;
|
|
2290
|
+
case 1:
|
|
2291
|
+
B(P[0]);
|
|
2292
|
+
break;
|
|
2293
|
+
case 2:
|
|
2294
|
+
B(P[0], P[1]);
|
|
2295
|
+
break;
|
|
2296
|
+
case 3:
|
|
2297
|
+
B(P[0], P[1], P[2]);
|
|
2298
|
+
break;
|
|
2299
|
+
default:
|
|
2300
|
+
B.apply(n, P);
|
|
2301
|
+
}
|
|
2302
|
+
})(x);
|
|
2303
|
+
} finally {
|
|
2304
|
+
a(S), d = !1;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
function y(S) {
|
|
2310
|
+
S.source === o && typeof S.data == "string" && S.data.indexOf(_) === 0 && p(+S.data.slice(_.length));
|
|
2311
|
+
}
|
|
2312
|
+
})(typeof self > "u" ? s === void 0 ? this : s : self);
|
|
2313
|
+
}).call(this, typeof mt < "u" ? mt : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
2314
|
+
}, {}] }, {}, [10])(10);
|
|
2315
|
+
});
|
|
2316
|
+
})(Et);
|
|
2317
|
+
var Dt = Et.exports;
|
|
2318
|
+
const Ft = /* @__PURE__ */ Rt(Dt);
|
|
2319
|
+
var zt = { exports: {} };
|
|
2320
|
+
(function(et, ot) {
|
|
2321
|
+
(function(g, I) {
|
|
2322
|
+
I();
|
|
2323
|
+
})(mt, function() {
|
|
2324
|
+
function g(c, v) {
|
|
2325
|
+
return typeof v > "u" ? v = { autoBom: !1 } : typeof v != "object" && (console.warn("Deprecated: Expected third argument to be a object"), v = { autoBom: !v }), v.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type) ? new Blob(["\uFEFF", c], { type: c.type }) : c;
|
|
2326
|
+
}
|
|
2327
|
+
function I(c, v, _) {
|
|
2328
|
+
var m = new XMLHttpRequest();
|
|
2329
|
+
m.open("GET", c), m.responseType = "blob", m.onload = function() {
|
|
2330
|
+
u(m.response, v, _);
|
|
2331
|
+
}, m.onerror = function() {
|
|
2332
|
+
console.error("could not download file");
|
|
2333
|
+
}, m.send();
|
|
2334
|
+
}
|
|
2335
|
+
function w(c) {
|
|
2336
|
+
var v = new XMLHttpRequest();
|
|
2337
|
+
v.open("HEAD", c, !1);
|
|
2338
|
+
try {
|
|
2339
|
+
v.send();
|
|
2340
|
+
} catch {
|
|
2341
|
+
}
|
|
2342
|
+
return 200 <= v.status && 299 >= v.status;
|
|
2343
|
+
}
|
|
2344
|
+
function s(c) {
|
|
2345
|
+
try {
|
|
2346
|
+
c.dispatchEvent(new MouseEvent("click"));
|
|
2347
|
+
} catch {
|
|
2348
|
+
var v = document.createEvent("MouseEvents");
|
|
2349
|
+
v.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), c.dispatchEvent(v);
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
var o = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof mt == "object" && mt.global === mt ? mt : void 0, n = o.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), u = o.saveAs || (typeof window != "object" || window !== o ? function() {
|
|
2353
|
+
} : "download" in HTMLAnchorElement.prototype && !n ? function(c, v, _) {
|
|
2354
|
+
var m = o.URL || o.webkitURL, i = document.createElement("a");
|
|
2355
|
+
v = v || c.name || "download", i.download = v, i.rel = "noopener", typeof c == "string" ? (i.href = c, i.origin === location.origin ? s(i) : w(i.href) ? I(c, v, _) : s(i, i.target = "_blank")) : (i.href = m.createObjectURL(c), setTimeout(function() {
|
|
2356
|
+
m.revokeObjectURL(i.href);
|
|
2357
|
+
}, 4e4), setTimeout(function() {
|
|
2358
|
+
s(i);
|
|
2359
|
+
}, 0));
|
|
2360
|
+
} : "msSaveOrOpenBlob" in navigator ? function(c, v, _) {
|
|
2361
|
+
if (v = v || c.name || "download", typeof c != "string") navigator.msSaveOrOpenBlob(g(c, _), v);
|
|
2362
|
+
else if (w(c)) I(c, v, _);
|
|
2363
|
+
else {
|
|
2364
|
+
var m = document.createElement("a");
|
|
2365
|
+
m.href = c, m.target = "_blank", setTimeout(function() {
|
|
2366
|
+
s(m);
|
|
2367
|
+
});
|
|
2368
|
+
}
|
|
2369
|
+
} : function(c, v, _, m) {
|
|
2370
|
+
if (m = m || open("", "_blank"), m && (m.document.title = m.document.body.innerText = "downloading..."), typeof c == "string") return I(c, v, _);
|
|
2371
|
+
var i = c.type === "application/octet-stream", d = /constructor/i.test(o.HTMLElement) || o.safari, r = /CriOS\/[\d]+/.test(navigator.userAgent);
|
|
2372
|
+
if ((r || i && d || n) && typeof FileReader < "u") {
|
|
2373
|
+
var l = new FileReader();
|
|
2374
|
+
l.onloadend = function() {
|
|
2375
|
+
var y = l.result;
|
|
2376
|
+
y = r ? y : y.replace(/^data:[^;]*;/, "data:attachment/file;"), m ? m.location.href = y : location = y, m = null;
|
|
2377
|
+
}, l.readAsDataURL(c);
|
|
2378
|
+
} else {
|
|
2379
|
+
var a = o.URL || o.webkitURL, p = a.createObjectURL(c);
|
|
2380
|
+
m ? m.location = p : location.href = p, m = null, setTimeout(function() {
|
|
2381
|
+
a.revokeObjectURL(p);
|
|
2382
|
+
}, 4e4);
|
|
2383
|
+
}
|
|
2384
|
+
});
|
|
2385
|
+
o.saveAs = u.saveAs = u, et.exports = u;
|
|
2386
|
+
});
|
|
2387
|
+
})(zt);
|
|
2388
|
+
var At = zt.exports;
|
|
2389
|
+
const Ct = (et) => {
|
|
2390
|
+
const ot = atob(et.split(",")[1]), g = et.split(",")[0].split(":")[1].split(";")[0], I = new ArrayBuffer(ot.length), w = new Uint8Array(I);
|
|
2391
|
+
for (let s = 0; s < ot.length; s++)
|
|
2392
|
+
w[s] = ot.charCodeAt(s);
|
|
2393
|
+
return new Blob([I], { type: g });
|
|
2394
|
+
};
|
|
2395
|
+
function Ut(et, ot) {
|
|
2396
|
+
var I;
|
|
2397
|
+
const g = (I = et.split(".").pop()) == null ? void 0 : I.split("?")[0];
|
|
2398
|
+
return g && g !== et ? g : ot && ot.split("/").pop() || "png";
|
|
2399
|
+
}
|
|
2400
|
+
function Nt(et) {
|
|
2401
|
+
return (et == null ? void 0 : et.split(".").shift()) || "scene";
|
|
2402
|
+
}
|
|
2403
|
+
const Lt = (et, ot, g) => {
|
|
2404
|
+
ot.forEach((I, w) => {
|
|
2405
|
+
const s = et[I.source];
|
|
2406
|
+
if (!s.uri) return;
|
|
2407
|
+
const o = Ut(s.uri, s.mimeType), u = `${I.name || `texture_${w}`}.${o}`;
|
|
2408
|
+
if (s.data instanceof ArrayBuffer || s.data instanceof Uint8Array) {
|
|
2409
|
+
const c = s.data instanceof Uint8Array ? s.data.buffer : s.data;
|
|
2410
|
+
g.file(u, c, { binary: !0 });
|
|
2411
|
+
} else if (s.uri.startsWith("data:")) {
|
|
2412
|
+
const c = Ct(s.uri);
|
|
2413
|
+
g.file(u, c, { binary: !0 });
|
|
2414
|
+
} else
|
|
2415
|
+
console.warn(`Image at index ${w} has unsupported data format`);
|
|
2416
|
+
});
|
|
2417
|
+
}, Pt = (et, ot, g) => {
|
|
2418
|
+
et.forEach((I, w) => {
|
|
2419
|
+
const s = `${g}.bin`;
|
|
2420
|
+
if (I instanceof ArrayBuffer)
|
|
2421
|
+
ot.file(s, I, { binary: !0 });
|
|
2422
|
+
else if (I.uri) {
|
|
2423
|
+
const o = Ct(I.uri);
|
|
2424
|
+
ot.file(s, o, { binary: !0 });
|
|
2425
|
+
} else
|
|
2426
|
+
console.warn(
|
|
2427
|
+
`Buffer at index ${w} is not an ArrayBuffer or does not have a URI`
|
|
2428
|
+
);
|
|
2429
|
+
});
|
|
2430
|
+
}, jt = (et, ot) => {
|
|
2431
|
+
const g = new Ft();
|
|
2432
|
+
g.file(`${ot}.gltf`, JSON.stringify(et, null, 2)), et.buffers && Pt(et.buffers, g, ot), et.images && et.textures && Lt(et.images, et.textures, g), g.generateAsync({ type: "blob" }).then((I) => {
|
|
2433
|
+
At.saveAs(I, `${ot}.zip`);
|
|
2434
|
+
});
|
|
2435
|
+
}, Wt = (et, ot) => ({
|
|
2436
|
+
handleGltfExport: (I, w) => {
|
|
2437
|
+
const s = I == null ? void 0 : I.model;
|
|
2438
|
+
if (!s) {
|
|
2439
|
+
console.error("Scene not initialized");
|
|
2440
|
+
return;
|
|
2441
|
+
}
|
|
2442
|
+
const o = new Tt(), n = {
|
|
2443
|
+
binary: w,
|
|
2444
|
+
includeCustomExtensions: !0
|
|
2445
|
+
};
|
|
2446
|
+
o.parse(
|
|
2447
|
+
s,
|
|
2448
|
+
(u) => {
|
|
2449
|
+
const c = Nt(I.name);
|
|
2450
|
+
u instanceof ArrayBuffer ? (At.saveAs(new Blob([u]), `${c}.glb`), et && et()) : (jt(u, c), et && et());
|
|
2451
|
+
},
|
|
2452
|
+
(u) => {
|
|
2453
|
+
console.error(u), ot && ot(u);
|
|
2454
|
+
},
|
|
2455
|
+
n
|
|
2456
|
+
);
|
|
2457
|
+
}
|
|
2458
|
+
});
|
|
2459
|
+
export {
|
|
2460
|
+
Wt as useExportModel
|
|
2461
|
+
};
|