@giszhc/file-utils 0.0.3 → 0.0.5
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 +232 -0
- package/dist/file-utils.js +2815 -265
- package/package.json +4 -1
- package/types/compress.d.ts +28 -0
- package/types/convert.d.ts +13 -0
- package/types/helpers.d.ts +140 -0
- package/types/index.d.ts +21 -2
- package/types/types.d.ts +165 -0
- package/types/verify.d.ts +93 -0
package/dist/file-utils.js
CHANGED
|
@@ -1,403 +1,2953 @@
|
|
|
1
|
-
function
|
|
2
|
-
return new Promise((
|
|
3
|
-
const
|
|
4
|
-
switch (
|
|
1
|
+
function Et(E, S = "text") {
|
|
2
|
+
return new Promise((r, w) => {
|
|
3
|
+
const f = new FileReader();
|
|
4
|
+
switch (S) {
|
|
5
5
|
case "text":
|
|
6
|
-
|
|
6
|
+
f.readAsText(E);
|
|
7
7
|
break;
|
|
8
8
|
case "arrayBuffer":
|
|
9
|
-
|
|
9
|
+
f.readAsArrayBuffer(E);
|
|
10
10
|
break;
|
|
11
11
|
case "dataURL":
|
|
12
|
-
|
|
12
|
+
f.readAsDataURL(E);
|
|
13
13
|
break;
|
|
14
14
|
case "binaryString":
|
|
15
|
-
|
|
15
|
+
f.readAsBinaryString(E);
|
|
16
16
|
break;
|
|
17
17
|
default:
|
|
18
|
-
|
|
18
|
+
f.readAsText(E);
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
|
|
20
|
+
f.onload = (i) => {
|
|
21
|
+
const o = i.target?.result;
|
|
22
|
+
o !== void 0 ? r(o) : w(new Error("文件读取失败"));
|
|
23
|
+
}, f.onerror = () => {
|
|
24
|
+
w(new Error("文件读取错误"));
|
|
25
|
+
}, f.onabort = () => {
|
|
26
|
+
w(new Error("文件读取被中止"));
|
|
27
27
|
};
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
async function
|
|
31
|
-
return new Promise((
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
30
|
+
async function Gt(E, S = "utf-8") {
|
|
31
|
+
return new Promise((r, w) => {
|
|
32
|
+
const f = new FileReader();
|
|
33
|
+
f.readAsText(E, S), f.onload = (i) => {
|
|
34
|
+
const o = i.target?.result;
|
|
35
|
+
o !== void 0 ? r(o) : w(new Error("文件读取失败"));
|
|
36
|
+
}, f.onerror = () => {
|
|
37
|
+
w(new Error("文件读取错误"));
|
|
38
|
+
}, f.onabort = () => {
|
|
39
|
+
w(new Error("文件读取被中止"));
|
|
40
40
|
};
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
async function
|
|
44
|
-
const { separator:
|
|
45
|
-
if (!
|
|
43
|
+
async function Kt(E, S = {}) {
|
|
44
|
+
const { separator: r = ",", hasHeader: w = !0 } = S, f = await Et(E, "text");
|
|
45
|
+
if (!f.trim())
|
|
46
46
|
return [];
|
|
47
|
-
const i =
|
|
47
|
+
const i = f.split(/\r?\n/).filter((y) => y.trim() !== "");
|
|
48
48
|
if (i.length === 0)
|
|
49
49
|
return [];
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
for (let
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}),
|
|
50
|
+
let o = [], n = 0;
|
|
51
|
+
w && (o = Tt(i[0], r), n = 1);
|
|
52
|
+
const h = [];
|
|
53
|
+
for (let y = n; y < i.length; y++) {
|
|
54
|
+
const v = Tt(i[y], r);
|
|
55
|
+
if (w && o.length > 0) {
|
|
56
|
+
const _ = {};
|
|
57
|
+
o.forEach((g, a) => {
|
|
58
|
+
_[g] = v[a] || "";
|
|
59
|
+
}), h.push(_);
|
|
60
60
|
} else
|
|
61
|
-
|
|
61
|
+
h.push(v);
|
|
62
62
|
}
|
|
63
|
-
return
|
|
64
|
-
}
|
|
65
|
-
function
|
|
66
|
-
const
|
|
67
|
-
let
|
|
68
|
-
for (let i = 0; i <
|
|
69
|
-
const
|
|
70
|
-
|
|
63
|
+
return h;
|
|
64
|
+
}
|
|
65
|
+
function Tt(E, S) {
|
|
66
|
+
const r = [];
|
|
67
|
+
let w = "", f = !1;
|
|
68
|
+
for (let i = 0; i < E.length; i++) {
|
|
69
|
+
const o = E[i], n = E[i + 1];
|
|
70
|
+
o === '"' ? f && n === '"' ? (w += '"', i++) : f = !f : o === S && !f ? (r.push(w.trim()), w = "") : w += o;
|
|
71
71
|
}
|
|
72
|
-
return
|
|
72
|
+
return r.push(w.trim()), r;
|
|
73
73
|
}
|
|
74
|
-
async function
|
|
75
|
-
const
|
|
74
|
+
async function Jt(E) {
|
|
75
|
+
const S = await Et(E, "text");
|
|
76
76
|
try {
|
|
77
|
-
return JSON.parse(
|
|
78
|
-
} catch (
|
|
79
|
-
throw new Error(`JSON 解析失败:${
|
|
77
|
+
return JSON.parse(S);
|
|
78
|
+
} catch (r) {
|
|
79
|
+
throw new Error(`JSON 解析失败:${r instanceof Error ? r.message : "未知错误"}`);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
async function
|
|
82
|
+
async function Dt(E, S, r) {
|
|
83
83
|
try {
|
|
84
|
-
const
|
|
85
|
-
if (!
|
|
86
|
-
throw new Error(`下载失败:${
|
|
87
|
-
const
|
|
88
|
-
let i =
|
|
84
|
+
const w = await fetch(E, r?.fetchOptions);
|
|
85
|
+
if (!w.ok)
|
|
86
|
+
throw new Error(`下载失败:${w.status} ${w.statusText}`);
|
|
87
|
+
const f = await w.blob();
|
|
88
|
+
let i = S;
|
|
89
89
|
if (!i) {
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
|
|
90
|
+
const o = w.headers.get("Content-Disposition");
|
|
91
|
+
if (o) {
|
|
92
|
+
const n = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(o);
|
|
93
|
+
n && n[1] && (i = decodeURIComponent(n[1].replace(/['"]/g, "")));
|
|
94
94
|
}
|
|
95
|
-
i || (i =
|
|
95
|
+
i || (i = E.split("/").pop() || "download");
|
|
96
96
|
}
|
|
97
|
-
f
|
|
98
|
-
} catch (
|
|
99
|
-
throw console.error("文件下载失败:",
|
|
97
|
+
mt(f, i, r);
|
|
98
|
+
} catch (w) {
|
|
99
|
+
throw console.error("文件下载失败:", w), w;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
const
|
|
104
|
-
|
|
102
|
+
function mt(E, S, r) {
|
|
103
|
+
const w = URL.createObjectURL(E), f = document.createElement("a");
|
|
104
|
+
f.href = w, f.download = S, r?.newWindow && (f.target = "_blank"), document.body.appendChild(f), f.click(), document.body.removeChild(f), URL.revokeObjectURL(w);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
for (let
|
|
110
|
-
i[
|
|
111
|
-
const
|
|
112
|
-
|
|
106
|
+
function Yt(E, S, r) {
|
|
107
|
+
E.startsWith("data:") ? (r = E.split(",")[0].split(":")[1].split(";")[0], E = E.split(",")[1]) : r || (r = "application/octet-stream");
|
|
108
|
+
const f = atob(E), i = new Array(f.length);
|
|
109
|
+
for (let h = 0; h < f.length; h++)
|
|
110
|
+
i[h] = f.charCodeAt(h);
|
|
111
|
+
const o = new Uint8Array(i), n = new Blob([o], { type: r });
|
|
112
|
+
mt(n, S);
|
|
113
113
|
}
|
|
114
|
-
async function
|
|
115
|
-
for (let
|
|
114
|
+
async function Vt(E, S = 500) {
|
|
115
|
+
for (let r = 0; r < E.length; r++)
|
|
116
116
|
try {
|
|
117
|
-
await
|
|
118
|
-
} catch (
|
|
119
|
-
console.error(`第 ${
|
|
117
|
+
await Dt(E[r]), r < E.length - 1 && await new Promise((w) => setTimeout(w, S));
|
|
118
|
+
} catch (w) {
|
|
119
|
+
console.error(`第 ${r + 1} 个文件下载失败:`, w);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
122
|
+
function Xt(E) {
|
|
123
|
+
return Et(E, "dataURL");
|
|
124
|
+
}
|
|
125
|
+
function qt(E, S) {
|
|
126
|
+
E.startsWith("data:") ? (S = E.split(",")[0].split(":")[1].split(";")[0], E = E.split(",")[1]) : S || (S = "application/octet-stream");
|
|
127
|
+
const w = atob(E), f = new Array(w.length);
|
|
128
|
+
for (let o = 0; o < w.length; o++)
|
|
129
|
+
f[o] = w.charCodeAt(o);
|
|
130
|
+
const i = new Uint8Array(f);
|
|
131
|
+
return new Blob([i], { type: S });
|
|
132
|
+
}
|
|
133
|
+
function Nt(E, S) {
|
|
134
|
+
return new File([E], S, { type: E.type });
|
|
135
|
+
}
|
|
136
|
+
var vt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
137
|
+
function Qt(E) {
|
|
138
|
+
return E && E.__esModule && Object.prototype.hasOwnProperty.call(E, "default") ? E.default : E;
|
|
124
139
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
const n = atob(e), o = new Array(n.length);
|
|
128
|
-
for (let a = 0; a < n.length; a++)
|
|
129
|
-
o[a] = n.charCodeAt(a);
|
|
130
|
-
const i = new Uint8Array(o);
|
|
131
|
-
return new Blob([i], { type: r });
|
|
140
|
+
function kt(E) {
|
|
141
|
+
throw new Error('Could not dynamically require "' + E + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
132
142
|
}
|
|
133
|
-
|
|
143
|
+
var zt = { exports: {} };
|
|
144
|
+
var Rt;
|
|
145
|
+
function te() {
|
|
146
|
+
return Rt || (Rt = 1, (function(E, S) {
|
|
147
|
+
(function(r) {
|
|
148
|
+
E.exports = r();
|
|
149
|
+
})(function() {
|
|
150
|
+
return (function r(w, f, i) {
|
|
151
|
+
function o(y, v) {
|
|
152
|
+
if (!f[y]) {
|
|
153
|
+
if (!w[y]) {
|
|
154
|
+
var _ = typeof kt == "function" && kt;
|
|
155
|
+
if (!v && _) return _(y, !0);
|
|
156
|
+
if (n) return n(y, !0);
|
|
157
|
+
var g = new Error("Cannot find module '" + y + "'");
|
|
158
|
+
throw g.code = "MODULE_NOT_FOUND", g;
|
|
159
|
+
}
|
|
160
|
+
var a = f[y] = { exports: {} };
|
|
161
|
+
w[y][0].call(a.exports, function(p) {
|
|
162
|
+
var s = w[y][1][p];
|
|
163
|
+
return o(s || p);
|
|
164
|
+
}, a, a.exports, r, w, f, i);
|
|
165
|
+
}
|
|
166
|
+
return f[y].exports;
|
|
167
|
+
}
|
|
168
|
+
for (var n = typeof kt == "function" && kt, h = 0; h < i.length; h++) o(i[h]);
|
|
169
|
+
return o;
|
|
170
|
+
})({ 1: [function(r, w, f) {
|
|
171
|
+
var i = r("./utils"), o = r("./support"), n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
172
|
+
f.encode = function(h) {
|
|
173
|
+
for (var y, v, _, g, a, p, s, c = [], l = 0, m = h.length, k = m, z = i.getTypeOf(h) !== "string"; l < h.length; ) k = m - l, _ = z ? (y = h[l++], v = l < m ? h[l++] : 0, l < m ? h[l++] : 0) : (y = h.charCodeAt(l++), v = l < m ? h.charCodeAt(l++) : 0, l < m ? h.charCodeAt(l++) : 0), g = y >> 2, a = (3 & y) << 4 | v >> 4, p = 1 < k ? (15 & v) << 2 | _ >> 6 : 64, s = 2 < k ? 63 & _ : 64, c.push(n.charAt(g) + n.charAt(a) + n.charAt(p) + n.charAt(s));
|
|
174
|
+
return c.join("");
|
|
175
|
+
}, f.decode = function(h) {
|
|
176
|
+
var y, v, _, g, a, p, s = 0, c = 0, l = "data:";
|
|
177
|
+
if (h.substr(0, l.length) === l) throw new Error("Invalid base64 input, it looks like a data url.");
|
|
178
|
+
var m, k = 3 * (h = h.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4;
|
|
179
|
+
if (h.charAt(h.length - 1) === n.charAt(64) && k--, h.charAt(h.length - 2) === n.charAt(64) && k--, k % 1 != 0) throw new Error("Invalid base64 input, bad content length.");
|
|
180
|
+
for (m = o.uint8array ? new Uint8Array(0 | k) : new Array(0 | k); s < h.length; ) y = n.indexOf(h.charAt(s++)) << 2 | (g = n.indexOf(h.charAt(s++))) >> 4, v = (15 & g) << 4 | (a = n.indexOf(h.charAt(s++))) >> 2, _ = (3 & a) << 6 | (p = n.indexOf(h.charAt(s++))), m[c++] = y, a !== 64 && (m[c++] = v), p !== 64 && (m[c++] = _);
|
|
181
|
+
return m;
|
|
182
|
+
};
|
|
183
|
+
}, { "./support": 30, "./utils": 32 }], 2: [function(r, w, f) {
|
|
184
|
+
var i = r("./external"), o = r("./stream/DataWorker"), n = r("./stream/Crc32Probe"), h = r("./stream/DataLengthProbe");
|
|
185
|
+
function y(v, _, g, a, p) {
|
|
186
|
+
this.compressedSize = v, this.uncompressedSize = _, this.crc32 = g, this.compression = a, this.compressedContent = p;
|
|
187
|
+
}
|
|
188
|
+
y.prototype = { getContentWorker: function() {
|
|
189
|
+
var v = new o(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new h("data_length")), _ = this;
|
|
190
|
+
return v.on("end", function() {
|
|
191
|
+
if (this.streamInfo.data_length !== _.uncompressedSize) throw new Error("Bug : uncompressed data size mismatch");
|
|
192
|
+
}), v;
|
|
193
|
+
}, getCompressedWorker: function() {
|
|
194
|
+
return new o(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression);
|
|
195
|
+
} }, y.createWorkerFrom = function(v, _, g) {
|
|
196
|
+
return v.pipe(new n()).pipe(new h("uncompressedSize")).pipe(_.compressWorker(g)).pipe(new h("compressedSize")).withStreamInfo("compression", _);
|
|
197
|
+
}, w.exports = y;
|
|
198
|
+
}, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(r, w, f) {
|
|
199
|
+
var i = r("./stream/GenericWorker");
|
|
200
|
+
f.STORE = { magic: "\0\0", compressWorker: function() {
|
|
201
|
+
return new i("STORE compression");
|
|
202
|
+
}, uncompressWorker: function() {
|
|
203
|
+
return new i("STORE decompression");
|
|
204
|
+
} }, f.DEFLATE = r("./flate");
|
|
205
|
+
}, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(r, w, f) {
|
|
206
|
+
var i = r("./utils"), o = (function() {
|
|
207
|
+
for (var n, h = [], y = 0; y < 256; y++) {
|
|
208
|
+
n = y;
|
|
209
|
+
for (var v = 0; v < 8; v++) n = 1 & n ? 3988292384 ^ n >>> 1 : n >>> 1;
|
|
210
|
+
h[y] = n;
|
|
211
|
+
}
|
|
212
|
+
return h;
|
|
213
|
+
})();
|
|
214
|
+
w.exports = function(n, h) {
|
|
215
|
+
return n !== void 0 && n.length ? i.getTypeOf(n) !== "string" ? (function(y, v, _, g) {
|
|
216
|
+
var a = o, p = g + _;
|
|
217
|
+
y ^= -1;
|
|
218
|
+
for (var s = g; s < p; s++) y = y >>> 8 ^ a[255 & (y ^ v[s])];
|
|
219
|
+
return -1 ^ y;
|
|
220
|
+
})(0 | h, n, n.length, 0) : (function(y, v, _, g) {
|
|
221
|
+
var a = o, p = g + _;
|
|
222
|
+
y ^= -1;
|
|
223
|
+
for (var s = g; s < p; s++) y = y >>> 8 ^ a[255 & (y ^ v.charCodeAt(s))];
|
|
224
|
+
return -1 ^ y;
|
|
225
|
+
})(0 | h, n, n.length, 0) : 0;
|
|
226
|
+
};
|
|
227
|
+
}, { "./utils": 32 }], 5: [function(r, w, f) {
|
|
228
|
+
f.base64 = !1, f.binary = !1, f.dir = !1, f.createFolders = !0, f.date = null, f.compression = null, f.compressionOptions = null, f.comment = null, f.unixPermissions = null, f.dosPermissions = null;
|
|
229
|
+
}, {}], 6: [function(r, w, f) {
|
|
230
|
+
var i = null;
|
|
231
|
+
i = typeof Promise < "u" ? Promise : r("lie"), w.exports = { Promise: i };
|
|
232
|
+
}, { lie: 37 }], 7: [function(r, w, f) {
|
|
233
|
+
var i = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Uint32Array < "u", o = r("pako"), n = r("./utils"), h = r("./stream/GenericWorker"), y = i ? "uint8array" : "array";
|
|
234
|
+
function v(_, g) {
|
|
235
|
+
h.call(this, "FlateWorker/" + _), this._pako = null, this._pakoAction = _, this._pakoOptions = g, this.meta = {};
|
|
236
|
+
}
|
|
237
|
+
f.magic = "\b\0", n.inherits(v, h), v.prototype.processChunk = function(_) {
|
|
238
|
+
this.meta = _.meta, this._pako === null && this._createPako(), this._pako.push(n.transformTo(y, _.data), !1);
|
|
239
|
+
}, v.prototype.flush = function() {
|
|
240
|
+
h.prototype.flush.call(this), this._pako === null && this._createPako(), this._pako.push([], !0);
|
|
241
|
+
}, v.prototype.cleanUp = function() {
|
|
242
|
+
h.prototype.cleanUp.call(this), this._pako = null;
|
|
243
|
+
}, v.prototype._createPako = function() {
|
|
244
|
+
this._pako = new o[this._pakoAction]({ raw: !0, level: this._pakoOptions.level || -1 });
|
|
245
|
+
var _ = this;
|
|
246
|
+
this._pako.onData = function(g) {
|
|
247
|
+
_.push({ data: g, meta: _.meta });
|
|
248
|
+
};
|
|
249
|
+
}, f.compressWorker = function(_) {
|
|
250
|
+
return new v("Deflate", _);
|
|
251
|
+
}, f.uncompressWorker = function() {
|
|
252
|
+
return new v("Inflate", {});
|
|
253
|
+
};
|
|
254
|
+
}, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(r, w, f) {
|
|
255
|
+
function i(a, p) {
|
|
256
|
+
var s, c = "";
|
|
257
|
+
for (s = 0; s < p; s++) c += String.fromCharCode(255 & a), a >>>= 8;
|
|
258
|
+
return c;
|
|
259
|
+
}
|
|
260
|
+
function o(a, p, s, c, l, m) {
|
|
261
|
+
var k, z, C = a.file, U = a.compression, T = m !== y.utf8encode, W = n.transformTo("string", m(C.name)), F = n.transformTo("string", y.utf8encode(C.name)), H = C.comment, X = n.transformTo("string", m(H)), b = n.transformTo("string", y.utf8encode(H)), R = F.length !== C.name.length, e = b.length !== H.length, N = "", Q = "", L = "", tt = C.dir, Z = C.date, q = { crc32: 0, compressedSize: 0, uncompressedSize: 0 };
|
|
262
|
+
p && !s || (q.crc32 = a.crc32, q.compressedSize = a.compressedSize, q.uncompressedSize = a.uncompressedSize);
|
|
263
|
+
var O = 0;
|
|
264
|
+
p && (O |= 8), T || !R && !e || (O |= 2048);
|
|
265
|
+
var I = 0, V = 0;
|
|
266
|
+
tt && (I |= 16), l === "UNIX" ? (V = 798, I |= (function(G, st) {
|
|
267
|
+
var ut = G;
|
|
268
|
+
return G || (ut = st ? 16893 : 33204), (65535 & ut) << 16;
|
|
269
|
+
})(C.unixPermissions, tt)) : (V = 20, I |= (function(G) {
|
|
270
|
+
return 63 & (G || 0);
|
|
271
|
+
})(C.dosPermissions)), k = Z.getUTCHours(), k <<= 6, k |= Z.getUTCMinutes(), k <<= 5, k |= Z.getUTCSeconds() / 2, z = Z.getUTCFullYear() - 1980, z <<= 4, z |= Z.getUTCMonth() + 1, z <<= 5, z |= Z.getUTCDate(), R && (Q = i(1, 1) + i(v(W), 4) + F, N += "up" + i(Q.length, 2) + Q), e && (L = i(1, 1) + i(v(X), 4) + b, N += "uc" + i(L.length, 2) + L);
|
|
272
|
+
var K = "";
|
|
273
|
+
return K += `
|
|
274
|
+
\0`, K += i(O, 2), K += U.magic, K += i(k, 2), K += i(z, 2), K += i(q.crc32, 4), K += i(q.compressedSize, 4), K += i(q.uncompressedSize, 4), K += i(W.length, 2), K += i(N.length, 2), { fileRecord: _.LOCAL_FILE_HEADER + K + W + N, dirRecord: _.CENTRAL_FILE_HEADER + i(V, 2) + K + i(X.length, 2) + "\0\0\0\0" + i(I, 4) + i(c, 4) + W + N + X };
|
|
275
|
+
}
|
|
276
|
+
var n = r("../utils"), h = r("../stream/GenericWorker"), y = r("../utf8"), v = r("../crc32"), _ = r("../signature");
|
|
277
|
+
function g(a, p, s, c) {
|
|
278
|
+
h.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = p, this.zipPlatform = s, this.encodeFileName = c, this.streamFiles = a, this.accumulate = !1, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = [];
|
|
279
|
+
}
|
|
280
|
+
n.inherits(g, h), g.prototype.push = function(a) {
|
|
281
|
+
var p = a.meta.percent || 0, s = this.entriesCount, c = this._sources.length;
|
|
282
|
+
this.accumulate ? this.contentBuffer.push(a) : (this.bytesWritten += a.data.length, h.prototype.push.call(this, { data: a.data, meta: { currentFile: this.currentFile, percent: s ? (p + 100 * (s - c - 1)) / s : 100 } }));
|
|
283
|
+
}, g.prototype.openedSource = function(a) {
|
|
284
|
+
this.currentSourceOffset = this.bytesWritten, this.currentFile = a.file.name;
|
|
285
|
+
var p = this.streamFiles && !a.file.dir;
|
|
286
|
+
if (p) {
|
|
287
|
+
var s = o(a, p, !1, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
|
|
288
|
+
this.push({ data: s.fileRecord, meta: { percent: 0 } });
|
|
289
|
+
} else this.accumulate = !0;
|
|
290
|
+
}, g.prototype.closedSource = function(a) {
|
|
291
|
+
this.accumulate = !1;
|
|
292
|
+
var p = this.streamFiles && !a.file.dir, s = o(a, p, !0, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
|
|
293
|
+
if (this.dirRecords.push(s.dirRecord), p) this.push({ data: (function(c) {
|
|
294
|
+
return _.DATA_DESCRIPTOR + i(c.crc32, 4) + i(c.compressedSize, 4) + i(c.uncompressedSize, 4);
|
|
295
|
+
})(a), meta: { percent: 100 } });
|
|
296
|
+
else for (this.push({ data: s.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift());
|
|
297
|
+
this.currentFile = null;
|
|
298
|
+
}, g.prototype.flush = function() {
|
|
299
|
+
for (var a = this.bytesWritten, p = 0; p < this.dirRecords.length; p++) this.push({ data: this.dirRecords[p], meta: { percent: 100 } });
|
|
300
|
+
var s = this.bytesWritten - a, c = (function(l, m, k, z, C) {
|
|
301
|
+
var U = n.transformTo("string", C(z));
|
|
302
|
+
return _.CENTRAL_DIRECTORY_END + "\0\0\0\0" + i(l, 2) + i(l, 2) + i(m, 4) + i(k, 4) + i(U.length, 2) + U;
|
|
303
|
+
})(this.dirRecords.length, s, a, this.zipComment, this.encodeFileName);
|
|
304
|
+
this.push({ data: c, meta: { percent: 100 } });
|
|
305
|
+
}, g.prototype.prepareNextSource = function() {
|
|
306
|
+
this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume();
|
|
307
|
+
}, g.prototype.registerPrevious = function(a) {
|
|
308
|
+
this._sources.push(a);
|
|
309
|
+
var p = this;
|
|
310
|
+
return a.on("data", function(s) {
|
|
311
|
+
p.processChunk(s);
|
|
312
|
+
}), a.on("end", function() {
|
|
313
|
+
p.closedSource(p.previous.streamInfo), p._sources.length ? p.prepareNextSource() : p.end();
|
|
314
|
+
}), a.on("error", function(s) {
|
|
315
|
+
p.error(s);
|
|
316
|
+
}), this;
|
|
317
|
+
}, g.prototype.resume = function() {
|
|
318
|
+
return !!h.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), !0) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), !0));
|
|
319
|
+
}, g.prototype.error = function(a) {
|
|
320
|
+
var p = this._sources;
|
|
321
|
+
if (!h.prototype.error.call(this, a)) return !1;
|
|
322
|
+
for (var s = 0; s < p.length; s++) try {
|
|
323
|
+
p[s].error(a);
|
|
324
|
+
} catch {
|
|
325
|
+
}
|
|
326
|
+
return !0;
|
|
327
|
+
}, g.prototype.lock = function() {
|
|
328
|
+
h.prototype.lock.call(this);
|
|
329
|
+
for (var a = this._sources, p = 0; p < a.length; p++) a[p].lock();
|
|
330
|
+
}, w.exports = g;
|
|
331
|
+
}, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(r, w, f) {
|
|
332
|
+
var i = r("../compressions"), o = r("./ZipFileWorker");
|
|
333
|
+
f.generateWorker = function(n, h, y) {
|
|
334
|
+
var v = new o(h.streamFiles, y, h.platform, h.encodeFileName), _ = 0;
|
|
335
|
+
try {
|
|
336
|
+
n.forEach(function(g, a) {
|
|
337
|
+
_++;
|
|
338
|
+
var p = (function(m, k) {
|
|
339
|
+
var z = m || k, C = i[z];
|
|
340
|
+
if (!C) throw new Error(z + " is not a valid compression method !");
|
|
341
|
+
return C;
|
|
342
|
+
})(a.options.compression, h.compression), s = a.options.compressionOptions || h.compressionOptions || {}, c = a.dir, l = a.date;
|
|
343
|
+
a._compressWorker(p, s).withStreamInfo("file", { name: g, dir: c, date: l, comment: a.comment || "", unixPermissions: a.unixPermissions, dosPermissions: a.dosPermissions }).pipe(v);
|
|
344
|
+
}), v.entriesCount = _;
|
|
345
|
+
} catch (g) {
|
|
346
|
+
v.error(g);
|
|
347
|
+
}
|
|
348
|
+
return v;
|
|
349
|
+
};
|
|
350
|
+
}, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(r, w, f) {
|
|
351
|
+
function i() {
|
|
352
|
+
if (!(this instanceof i)) return new i();
|
|
353
|
+
if (arguments.length) throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
354
|
+
this.files = /* @__PURE__ */ Object.create(null), this.comment = null, this.root = "", this.clone = function() {
|
|
355
|
+
var o = new i();
|
|
356
|
+
for (var n in this) typeof this[n] != "function" && (o[n] = this[n]);
|
|
357
|
+
return o;
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
(i.prototype = r("./object")).loadAsync = r("./load"), i.support = r("./support"), i.defaults = r("./defaults"), i.version = "3.10.1", i.loadAsync = function(o, n) {
|
|
361
|
+
return new i().loadAsync(o, n);
|
|
362
|
+
}, i.external = r("./external"), w.exports = i;
|
|
363
|
+
}, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(r, w, f) {
|
|
364
|
+
var i = r("./utils"), o = r("./external"), n = r("./utf8"), h = r("./zipEntries"), y = r("./stream/Crc32Probe"), v = r("./nodejsUtils");
|
|
365
|
+
function _(g) {
|
|
366
|
+
return new o.Promise(function(a, p) {
|
|
367
|
+
var s = g.decompressed.getContentWorker().pipe(new y());
|
|
368
|
+
s.on("error", function(c) {
|
|
369
|
+
p(c);
|
|
370
|
+
}).on("end", function() {
|
|
371
|
+
s.streamInfo.crc32 !== g.decompressed.crc32 ? p(new Error("Corrupted zip : CRC32 mismatch")) : a();
|
|
372
|
+
}).resume();
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
w.exports = function(g, a) {
|
|
376
|
+
var p = this;
|
|
377
|
+
return a = i.extend(a || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: n.utf8decode }), v.isNode && v.isStream(g) ? o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : i.prepareContent("the loaded zip file", g, !0, a.optimizedBinaryString, a.base64).then(function(s) {
|
|
378
|
+
var c = new h(a);
|
|
379
|
+
return c.load(s), c;
|
|
380
|
+
}).then(function(s) {
|
|
381
|
+
var c = [o.Promise.resolve(s)], l = s.files;
|
|
382
|
+
if (a.checkCRC32) for (var m = 0; m < l.length; m++) c.push(_(l[m]));
|
|
383
|
+
return o.Promise.all(c);
|
|
384
|
+
}).then(function(s) {
|
|
385
|
+
for (var c = s.shift(), l = c.files, m = 0; m < l.length; m++) {
|
|
386
|
+
var k = l[m], z = k.fileNameStr, C = i.resolve(k.fileNameStr);
|
|
387
|
+
p.file(C, k.decompressed, { binary: !0, optimizedBinaryString: !0, date: k.date, dir: k.dir, comment: k.fileCommentStr.length ? k.fileCommentStr : null, unixPermissions: k.unixPermissions, dosPermissions: k.dosPermissions, createFolders: a.createFolders }), k.dir || (p.file(C).unsafeOriginalName = z);
|
|
388
|
+
}
|
|
389
|
+
return c.zipComment.length && (p.comment = c.zipComment), p;
|
|
390
|
+
});
|
|
391
|
+
};
|
|
392
|
+
}, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(r, w, f) {
|
|
393
|
+
var i = r("../utils"), o = r("../stream/GenericWorker");
|
|
394
|
+
function n(h, y) {
|
|
395
|
+
o.call(this, "Nodejs stream input adapter for " + h), this._upstreamEnded = !1, this._bindStream(y);
|
|
396
|
+
}
|
|
397
|
+
i.inherits(n, o), n.prototype._bindStream = function(h) {
|
|
398
|
+
var y = this;
|
|
399
|
+
(this._stream = h).pause(), h.on("data", function(v) {
|
|
400
|
+
y.push({ data: v, meta: { percent: 0 } });
|
|
401
|
+
}).on("error", function(v) {
|
|
402
|
+
y.isPaused ? this.generatedError = v : y.error(v);
|
|
403
|
+
}).on("end", function() {
|
|
404
|
+
y.isPaused ? y._upstreamEnded = !0 : y.end();
|
|
405
|
+
});
|
|
406
|
+
}, n.prototype.pause = function() {
|
|
407
|
+
return !!o.prototype.pause.call(this) && (this._stream.pause(), !0);
|
|
408
|
+
}, n.prototype.resume = function() {
|
|
409
|
+
return !!o.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), !0);
|
|
410
|
+
}, w.exports = n;
|
|
411
|
+
}, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(r, w, f) {
|
|
412
|
+
var i = r("readable-stream").Readable;
|
|
413
|
+
function o(n, h, y) {
|
|
414
|
+
i.call(this, h), this._helper = n;
|
|
415
|
+
var v = this;
|
|
416
|
+
n.on("data", function(_, g) {
|
|
417
|
+
v.push(_) || v._helper.pause(), y && y(g);
|
|
418
|
+
}).on("error", function(_) {
|
|
419
|
+
v.emit("error", _);
|
|
420
|
+
}).on("end", function() {
|
|
421
|
+
v.push(null);
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
r("../utils").inherits(o, i), o.prototype._read = function() {
|
|
425
|
+
this._helper.resume();
|
|
426
|
+
}, w.exports = o;
|
|
427
|
+
}, { "../utils": 32, "readable-stream": 16 }], 14: [function(r, w, f) {
|
|
428
|
+
w.exports = { isNode: typeof Buffer < "u", newBufferFrom: function(i, o) {
|
|
429
|
+
if (Buffer.from && Buffer.from !== Uint8Array.from) return Buffer.from(i, o);
|
|
430
|
+
if (typeof i == "number") throw new Error('The "data" argument must not be a number');
|
|
431
|
+
return new Buffer(i, o);
|
|
432
|
+
}, allocBuffer: function(i) {
|
|
433
|
+
if (Buffer.alloc) return Buffer.alloc(i);
|
|
434
|
+
var o = new Buffer(i);
|
|
435
|
+
return o.fill(0), o;
|
|
436
|
+
}, isBuffer: function(i) {
|
|
437
|
+
return Buffer.isBuffer(i);
|
|
438
|
+
}, isStream: function(i) {
|
|
439
|
+
return i && typeof i.on == "function" && typeof i.pause == "function" && typeof i.resume == "function";
|
|
440
|
+
} };
|
|
441
|
+
}, {}], 15: [function(r, w, f) {
|
|
442
|
+
function i(C, U, T) {
|
|
443
|
+
var W, F = n.getTypeOf(U), H = n.extend(T || {}, v);
|
|
444
|
+
H.date = H.date || /* @__PURE__ */ new Date(), H.compression !== null && (H.compression = H.compression.toUpperCase()), typeof H.unixPermissions == "string" && (H.unixPermissions = parseInt(H.unixPermissions, 8)), H.unixPermissions && 16384 & H.unixPermissions && (H.dir = !0), H.dosPermissions && 16 & H.dosPermissions && (H.dir = !0), H.dir && (C = l(C)), H.createFolders && (W = c(C)) && m.call(this, W, !0);
|
|
445
|
+
var X = F === "string" && H.binary === !1 && H.base64 === !1;
|
|
446
|
+
T && T.binary !== void 0 || (H.binary = !X), (U instanceof _ && U.uncompressedSize === 0 || H.dir || !U || U.length === 0) && (H.base64 = !1, H.binary = !0, U = "", H.compression = "STORE", F = "string");
|
|
447
|
+
var b = null;
|
|
448
|
+
b = U instanceof _ || U instanceof h ? U : p.isNode && p.isStream(U) ? new s(C, U) : n.prepareContent(C, U, H.binary, H.optimizedBinaryString, H.base64);
|
|
449
|
+
var R = new g(C, b, H);
|
|
450
|
+
this.files[C] = R;
|
|
451
|
+
}
|
|
452
|
+
var o = r("./utf8"), n = r("./utils"), h = r("./stream/GenericWorker"), y = r("./stream/StreamHelper"), v = r("./defaults"), _ = r("./compressedObject"), g = r("./zipObject"), a = r("./generate"), p = r("./nodejsUtils"), s = r("./nodejs/NodejsStreamInputAdapter"), c = function(C) {
|
|
453
|
+
C.slice(-1) === "/" && (C = C.substring(0, C.length - 1));
|
|
454
|
+
var U = C.lastIndexOf("/");
|
|
455
|
+
return 0 < U ? C.substring(0, U) : "";
|
|
456
|
+
}, l = function(C) {
|
|
457
|
+
return C.slice(-1) !== "/" && (C += "/"), C;
|
|
458
|
+
}, m = function(C, U) {
|
|
459
|
+
return U = U !== void 0 ? U : v.createFolders, C = l(C), this.files[C] || i.call(this, C, null, { dir: !0, createFolders: U }), this.files[C];
|
|
460
|
+
};
|
|
461
|
+
function k(C) {
|
|
462
|
+
return Object.prototype.toString.call(C) === "[object RegExp]";
|
|
463
|
+
}
|
|
464
|
+
var z = { load: function() {
|
|
465
|
+
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
466
|
+
}, forEach: function(C) {
|
|
467
|
+
var U, T, W;
|
|
468
|
+
for (U in this.files) W = this.files[U], (T = U.slice(this.root.length, U.length)) && U.slice(0, this.root.length) === this.root && C(T, W);
|
|
469
|
+
}, filter: function(C) {
|
|
470
|
+
var U = [];
|
|
471
|
+
return this.forEach(function(T, W) {
|
|
472
|
+
C(T, W) && U.push(W);
|
|
473
|
+
}), U;
|
|
474
|
+
}, file: function(C, U, T) {
|
|
475
|
+
if (arguments.length !== 1) return C = this.root + C, i.call(this, C, U, T), this;
|
|
476
|
+
if (k(C)) {
|
|
477
|
+
var W = C;
|
|
478
|
+
return this.filter(function(H, X) {
|
|
479
|
+
return !X.dir && W.test(H);
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
var F = this.files[this.root + C];
|
|
483
|
+
return F && !F.dir ? F : null;
|
|
484
|
+
}, folder: function(C) {
|
|
485
|
+
if (!C) return this;
|
|
486
|
+
if (k(C)) return this.filter(function(F, H) {
|
|
487
|
+
return H.dir && C.test(F);
|
|
488
|
+
});
|
|
489
|
+
var U = this.root + C, T = m.call(this, U), W = this.clone();
|
|
490
|
+
return W.root = T.name, W;
|
|
491
|
+
}, remove: function(C) {
|
|
492
|
+
C = this.root + C;
|
|
493
|
+
var U = this.files[C];
|
|
494
|
+
if (U || (C.slice(-1) !== "/" && (C += "/"), U = this.files[C]), U && !U.dir) delete this.files[C];
|
|
495
|
+
else for (var T = this.filter(function(F, H) {
|
|
496
|
+
return H.name.slice(0, C.length) === C;
|
|
497
|
+
}), W = 0; W < T.length; W++) delete this.files[T[W].name];
|
|
498
|
+
return this;
|
|
499
|
+
}, generate: function() {
|
|
500
|
+
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
501
|
+
}, generateInternalStream: function(C) {
|
|
502
|
+
var U, T = {};
|
|
503
|
+
try {
|
|
504
|
+
if ((T = n.extend(C || {}, { streamFiles: !1, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: o.utf8encode })).type = T.type.toLowerCase(), T.compression = T.compression.toUpperCase(), T.type === "binarystring" && (T.type = "string"), !T.type) throw new Error("No output type specified.");
|
|
505
|
+
n.checkSupport(T.type), T.platform !== "darwin" && T.platform !== "freebsd" && T.platform !== "linux" && T.platform !== "sunos" || (T.platform = "UNIX"), T.platform === "win32" && (T.platform = "DOS");
|
|
506
|
+
var W = T.comment || this.comment || "";
|
|
507
|
+
U = a.generateWorker(this, T, W);
|
|
508
|
+
} catch (F) {
|
|
509
|
+
(U = new h("error")).error(F);
|
|
510
|
+
}
|
|
511
|
+
return new y(U, T.type || "string", T.mimeType);
|
|
512
|
+
}, generateAsync: function(C, U) {
|
|
513
|
+
return this.generateInternalStream(C).accumulate(U);
|
|
514
|
+
}, generateNodeStream: function(C, U) {
|
|
515
|
+
return (C = C || {}).type || (C.type = "nodebuffer"), this.generateInternalStream(C).toNodejsStream(U);
|
|
516
|
+
} };
|
|
517
|
+
w.exports = z;
|
|
518
|
+
}, { "./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(r, w, f) {
|
|
519
|
+
w.exports = r("stream");
|
|
520
|
+
}, { stream: void 0 }], 17: [function(r, w, f) {
|
|
521
|
+
var i = r("./DataReader");
|
|
522
|
+
function o(n) {
|
|
523
|
+
i.call(this, n);
|
|
524
|
+
for (var h = 0; h < this.data.length; h++) n[h] = 255 & n[h];
|
|
525
|
+
}
|
|
526
|
+
r("../utils").inherits(o, i), o.prototype.byteAt = function(n) {
|
|
527
|
+
return this.data[this.zero + n];
|
|
528
|
+
}, o.prototype.lastIndexOfSignature = function(n) {
|
|
529
|
+
for (var h = n.charCodeAt(0), y = n.charCodeAt(1), v = n.charCodeAt(2), _ = n.charCodeAt(3), g = this.length - 4; 0 <= g; --g) if (this.data[g] === h && this.data[g + 1] === y && this.data[g + 2] === v && this.data[g + 3] === _) return g - this.zero;
|
|
530
|
+
return -1;
|
|
531
|
+
}, o.prototype.readAndCheckSignature = function(n) {
|
|
532
|
+
var h = n.charCodeAt(0), y = n.charCodeAt(1), v = n.charCodeAt(2), _ = n.charCodeAt(3), g = this.readData(4);
|
|
533
|
+
return h === g[0] && y === g[1] && v === g[2] && _ === g[3];
|
|
534
|
+
}, o.prototype.readData = function(n) {
|
|
535
|
+
if (this.checkOffset(n), n === 0) return [];
|
|
536
|
+
var h = this.data.slice(this.zero + this.index, this.zero + this.index + n);
|
|
537
|
+
return this.index += n, h;
|
|
538
|
+
}, w.exports = o;
|
|
539
|
+
}, { "../utils": 32, "./DataReader": 18 }], 18: [function(r, w, f) {
|
|
540
|
+
var i = r("../utils");
|
|
541
|
+
function o(n) {
|
|
542
|
+
this.data = n, this.length = n.length, this.index = 0, this.zero = 0;
|
|
543
|
+
}
|
|
544
|
+
o.prototype = { checkOffset: function(n) {
|
|
545
|
+
this.checkIndex(this.index + n);
|
|
546
|
+
}, checkIndex: function(n) {
|
|
547
|
+
if (this.length < this.zero + n || n < 0) throw new Error("End of data reached (data length = " + this.length + ", asked index = " + n + "). Corrupted zip ?");
|
|
548
|
+
}, setIndex: function(n) {
|
|
549
|
+
this.checkIndex(n), this.index = n;
|
|
550
|
+
}, skip: function(n) {
|
|
551
|
+
this.setIndex(this.index + n);
|
|
552
|
+
}, byteAt: function() {
|
|
553
|
+
}, readInt: function(n) {
|
|
554
|
+
var h, y = 0;
|
|
555
|
+
for (this.checkOffset(n), h = this.index + n - 1; h >= this.index; h--) y = (y << 8) + this.byteAt(h);
|
|
556
|
+
return this.index += n, y;
|
|
557
|
+
}, readString: function(n) {
|
|
558
|
+
return i.transformTo("string", this.readData(n));
|
|
559
|
+
}, readData: function() {
|
|
560
|
+
}, lastIndexOfSignature: function() {
|
|
561
|
+
}, readAndCheckSignature: function() {
|
|
562
|
+
}, readDate: function() {
|
|
563
|
+
var n = this.readInt(4);
|
|
564
|
+
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));
|
|
565
|
+
} }, w.exports = o;
|
|
566
|
+
}, { "../utils": 32 }], 19: [function(r, w, f) {
|
|
567
|
+
var i = r("./Uint8ArrayReader");
|
|
568
|
+
function o(n) {
|
|
569
|
+
i.call(this, n);
|
|
570
|
+
}
|
|
571
|
+
r("../utils").inherits(o, i), o.prototype.readData = function(n) {
|
|
572
|
+
this.checkOffset(n);
|
|
573
|
+
var h = this.data.slice(this.zero + this.index, this.zero + this.index + n);
|
|
574
|
+
return this.index += n, h;
|
|
575
|
+
}, w.exports = o;
|
|
576
|
+
}, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function(r, w, f) {
|
|
577
|
+
var i = r("./DataReader");
|
|
578
|
+
function o(n) {
|
|
579
|
+
i.call(this, n);
|
|
580
|
+
}
|
|
581
|
+
r("../utils").inherits(o, i), o.prototype.byteAt = function(n) {
|
|
582
|
+
return this.data.charCodeAt(this.zero + n);
|
|
583
|
+
}, o.prototype.lastIndexOfSignature = function(n) {
|
|
584
|
+
return this.data.lastIndexOf(n) - this.zero;
|
|
585
|
+
}, o.prototype.readAndCheckSignature = function(n) {
|
|
586
|
+
return n === this.readData(4);
|
|
587
|
+
}, o.prototype.readData = function(n) {
|
|
588
|
+
this.checkOffset(n);
|
|
589
|
+
var h = this.data.slice(this.zero + this.index, this.zero + this.index + n);
|
|
590
|
+
return this.index += n, h;
|
|
591
|
+
}, w.exports = o;
|
|
592
|
+
}, { "../utils": 32, "./DataReader": 18 }], 21: [function(r, w, f) {
|
|
593
|
+
var i = r("./ArrayReader");
|
|
594
|
+
function o(n) {
|
|
595
|
+
i.call(this, n);
|
|
596
|
+
}
|
|
597
|
+
r("../utils").inherits(o, i), o.prototype.readData = function(n) {
|
|
598
|
+
if (this.checkOffset(n), n === 0) return new Uint8Array(0);
|
|
599
|
+
var h = this.data.subarray(this.zero + this.index, this.zero + this.index + n);
|
|
600
|
+
return this.index += n, h;
|
|
601
|
+
}, w.exports = o;
|
|
602
|
+
}, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(r, w, f) {
|
|
603
|
+
var i = r("../utils"), o = r("../support"), n = r("./ArrayReader"), h = r("./StringReader"), y = r("./NodeBufferReader"), v = r("./Uint8ArrayReader");
|
|
604
|
+
w.exports = function(_) {
|
|
605
|
+
var g = i.getTypeOf(_);
|
|
606
|
+
return i.checkSupport(g), g !== "string" || o.uint8array ? g === "nodebuffer" ? new y(_) : o.uint8array ? new v(i.transformTo("uint8array", _)) : new n(i.transformTo("array", _)) : new h(_);
|
|
607
|
+
};
|
|
608
|
+
}, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(r, w, f) {
|
|
609
|
+
f.LOCAL_FILE_HEADER = "PK", f.CENTRAL_FILE_HEADER = "PK", f.CENTRAL_DIRECTORY_END = "PK", f.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", f.ZIP64_CENTRAL_DIRECTORY_END = "PK", f.DATA_DESCRIPTOR = "PK\x07\b";
|
|
610
|
+
}, {}], 24: [function(r, w, f) {
|
|
611
|
+
var i = r("./GenericWorker"), o = r("../utils");
|
|
612
|
+
function n(h) {
|
|
613
|
+
i.call(this, "ConvertWorker to " + h), this.destType = h;
|
|
614
|
+
}
|
|
615
|
+
o.inherits(n, i), n.prototype.processChunk = function(h) {
|
|
616
|
+
this.push({ data: o.transformTo(this.destType, h.data), meta: h.meta });
|
|
617
|
+
}, w.exports = n;
|
|
618
|
+
}, { "../utils": 32, "./GenericWorker": 28 }], 25: [function(r, w, f) {
|
|
619
|
+
var i = r("./GenericWorker"), o = r("../crc32");
|
|
620
|
+
function n() {
|
|
621
|
+
i.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0);
|
|
622
|
+
}
|
|
623
|
+
r("../utils").inherits(n, i), n.prototype.processChunk = function(h) {
|
|
624
|
+
this.streamInfo.crc32 = o(h.data, this.streamInfo.crc32 || 0), this.push(h);
|
|
625
|
+
}, w.exports = n;
|
|
626
|
+
}, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function(r, w, f) {
|
|
627
|
+
var i = r("../utils"), o = r("./GenericWorker");
|
|
628
|
+
function n(h) {
|
|
629
|
+
o.call(this, "DataLengthProbe for " + h), this.propName = h, this.withStreamInfo(h, 0);
|
|
630
|
+
}
|
|
631
|
+
i.inherits(n, o), n.prototype.processChunk = function(h) {
|
|
632
|
+
if (h) {
|
|
633
|
+
var y = this.streamInfo[this.propName] || 0;
|
|
634
|
+
this.streamInfo[this.propName] = y + h.data.length;
|
|
635
|
+
}
|
|
636
|
+
o.prototype.processChunk.call(this, h);
|
|
637
|
+
}, w.exports = n;
|
|
638
|
+
}, { "../utils": 32, "./GenericWorker": 28 }], 27: [function(r, w, f) {
|
|
639
|
+
var i = r("../utils"), o = r("./GenericWorker");
|
|
640
|
+
function n(h) {
|
|
641
|
+
o.call(this, "DataWorker");
|
|
642
|
+
var y = this;
|
|
643
|
+
this.dataIsReady = !1, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = !1, h.then(function(v) {
|
|
644
|
+
y.dataIsReady = !0, y.data = v, y.max = v && v.length || 0, y.type = i.getTypeOf(v), y.isPaused || y._tickAndRepeat();
|
|
645
|
+
}, function(v) {
|
|
646
|
+
y.error(v);
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
i.inherits(n, o), n.prototype.cleanUp = function() {
|
|
650
|
+
o.prototype.cleanUp.call(this), this.data = null;
|
|
651
|
+
}, n.prototype.resume = function() {
|
|
652
|
+
return !!o.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = !0, i.delay(this._tickAndRepeat, [], this)), !0);
|
|
653
|
+
}, n.prototype._tickAndRepeat = function() {
|
|
654
|
+
this._tickScheduled = !1, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (i.delay(this._tickAndRepeat, [], this), this._tickScheduled = !0));
|
|
655
|
+
}, n.prototype._tick = function() {
|
|
656
|
+
if (this.isPaused || this.isFinished) return !1;
|
|
657
|
+
var h = null, y = Math.min(this.max, this.index + 16384);
|
|
658
|
+
if (this.index >= this.max) return this.end();
|
|
659
|
+
switch (this.type) {
|
|
660
|
+
case "string":
|
|
661
|
+
h = this.data.substring(this.index, y);
|
|
662
|
+
break;
|
|
663
|
+
case "uint8array":
|
|
664
|
+
h = this.data.subarray(this.index, y);
|
|
665
|
+
break;
|
|
666
|
+
case "array":
|
|
667
|
+
case "nodebuffer":
|
|
668
|
+
h = this.data.slice(this.index, y);
|
|
669
|
+
}
|
|
670
|
+
return this.index = y, this.push({ data: h, meta: { percent: this.max ? this.index / this.max * 100 : 0 } });
|
|
671
|
+
}, w.exports = n;
|
|
672
|
+
}, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(r, w, f) {
|
|
673
|
+
function i(o) {
|
|
674
|
+
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;
|
|
675
|
+
}
|
|
676
|
+
i.prototype = { push: function(o) {
|
|
677
|
+
this.emit("data", o);
|
|
678
|
+
}, end: function() {
|
|
679
|
+
if (this.isFinished) return !1;
|
|
680
|
+
this.flush();
|
|
681
|
+
try {
|
|
682
|
+
this.emit("end"), this.cleanUp(), this.isFinished = !0;
|
|
683
|
+
} catch (o) {
|
|
684
|
+
this.emit("error", o);
|
|
685
|
+
}
|
|
686
|
+
return !0;
|
|
687
|
+
}, error: function(o) {
|
|
688
|
+
return !this.isFinished && (this.isPaused ? this.generatedError = o : (this.isFinished = !0, this.emit("error", o), this.previous && this.previous.error(o), this.cleanUp()), !0);
|
|
689
|
+
}, on: function(o, n) {
|
|
690
|
+
return this._listeners[o].push(n), this;
|
|
691
|
+
}, cleanUp: function() {
|
|
692
|
+
this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = [];
|
|
693
|
+
}, emit: function(o, n) {
|
|
694
|
+
if (this._listeners[o]) for (var h = 0; h < this._listeners[o].length; h++) this._listeners[o][h].call(this, n);
|
|
695
|
+
}, pipe: function(o) {
|
|
696
|
+
return o.registerPrevious(this);
|
|
697
|
+
}, registerPrevious: function(o) {
|
|
698
|
+
if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.");
|
|
699
|
+
this.streamInfo = o.streamInfo, this.mergeStreamInfo(), this.previous = o;
|
|
700
|
+
var n = this;
|
|
701
|
+
return o.on("data", function(h) {
|
|
702
|
+
n.processChunk(h);
|
|
703
|
+
}), o.on("end", function() {
|
|
704
|
+
n.end();
|
|
705
|
+
}), o.on("error", function(h) {
|
|
706
|
+
n.error(h);
|
|
707
|
+
}), this;
|
|
708
|
+
}, pause: function() {
|
|
709
|
+
return !this.isPaused && !this.isFinished && (this.isPaused = !0, this.previous && this.previous.pause(), !0);
|
|
710
|
+
}, resume: function() {
|
|
711
|
+
if (!this.isPaused || this.isFinished) return !1;
|
|
712
|
+
var o = this.isPaused = !1;
|
|
713
|
+
return this.generatedError && (this.error(this.generatedError), o = !0), this.previous && this.previous.resume(), !o;
|
|
714
|
+
}, flush: function() {
|
|
715
|
+
}, processChunk: function(o) {
|
|
716
|
+
this.push(o);
|
|
717
|
+
}, withStreamInfo: function(o, n) {
|
|
718
|
+
return this.extraStreamInfo[o] = n, this.mergeStreamInfo(), this;
|
|
719
|
+
}, mergeStreamInfo: function() {
|
|
720
|
+
for (var o in this.extraStreamInfo) Object.prototype.hasOwnProperty.call(this.extraStreamInfo, o) && (this.streamInfo[o] = this.extraStreamInfo[o]);
|
|
721
|
+
}, lock: function() {
|
|
722
|
+
if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.");
|
|
723
|
+
this.isLocked = !0, this.previous && this.previous.lock();
|
|
724
|
+
}, toString: function() {
|
|
725
|
+
var o = "Worker " + this.name;
|
|
726
|
+
return this.previous ? this.previous + " -> " + o : o;
|
|
727
|
+
} }, w.exports = i;
|
|
728
|
+
}, {}], 29: [function(r, w, f) {
|
|
729
|
+
var i = r("../utils"), o = r("./ConvertWorker"), n = r("./GenericWorker"), h = r("../base64"), y = r("../support"), v = r("../external"), _ = null;
|
|
730
|
+
if (y.nodestream) try {
|
|
731
|
+
_ = r("../nodejs/NodejsStreamOutputAdapter");
|
|
732
|
+
} catch {
|
|
733
|
+
}
|
|
734
|
+
function g(p, s) {
|
|
735
|
+
return new v.Promise(function(c, l) {
|
|
736
|
+
var m = [], k = p._internalType, z = p._outputType, C = p._mimeType;
|
|
737
|
+
p.on("data", function(U, T) {
|
|
738
|
+
m.push(U), s && s(T);
|
|
739
|
+
}).on("error", function(U) {
|
|
740
|
+
m = [], l(U);
|
|
741
|
+
}).on("end", function() {
|
|
742
|
+
try {
|
|
743
|
+
var U = (function(T, W, F) {
|
|
744
|
+
switch (T) {
|
|
745
|
+
case "blob":
|
|
746
|
+
return i.newBlob(i.transformTo("arraybuffer", W), F);
|
|
747
|
+
case "base64":
|
|
748
|
+
return h.encode(W);
|
|
749
|
+
default:
|
|
750
|
+
return i.transformTo(T, W);
|
|
751
|
+
}
|
|
752
|
+
})(z, (function(T, W) {
|
|
753
|
+
var F, H = 0, X = null, b = 0;
|
|
754
|
+
for (F = 0; F < W.length; F++) b += W[F].length;
|
|
755
|
+
switch (T) {
|
|
756
|
+
case "string":
|
|
757
|
+
return W.join("");
|
|
758
|
+
case "array":
|
|
759
|
+
return Array.prototype.concat.apply([], W);
|
|
760
|
+
case "uint8array":
|
|
761
|
+
for (X = new Uint8Array(b), F = 0; F < W.length; F++) X.set(W[F], H), H += W[F].length;
|
|
762
|
+
return X;
|
|
763
|
+
case "nodebuffer":
|
|
764
|
+
return Buffer.concat(W);
|
|
765
|
+
default:
|
|
766
|
+
throw new Error("concat : unsupported type '" + T + "'");
|
|
767
|
+
}
|
|
768
|
+
})(k, m), C);
|
|
769
|
+
c(U);
|
|
770
|
+
} catch (T) {
|
|
771
|
+
l(T);
|
|
772
|
+
}
|
|
773
|
+
m = [];
|
|
774
|
+
}).resume();
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
function a(p, s, c) {
|
|
778
|
+
var l = s;
|
|
779
|
+
switch (s) {
|
|
780
|
+
case "blob":
|
|
781
|
+
case "arraybuffer":
|
|
782
|
+
l = "uint8array";
|
|
783
|
+
break;
|
|
784
|
+
case "base64":
|
|
785
|
+
l = "string";
|
|
786
|
+
}
|
|
787
|
+
try {
|
|
788
|
+
this._internalType = l, this._outputType = s, this._mimeType = c, i.checkSupport(l), this._worker = p.pipe(new o(l)), p.lock();
|
|
789
|
+
} catch (m) {
|
|
790
|
+
this._worker = new n("error"), this._worker.error(m);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
a.prototype = { accumulate: function(p) {
|
|
794
|
+
return g(this, p);
|
|
795
|
+
}, on: function(p, s) {
|
|
796
|
+
var c = this;
|
|
797
|
+
return p === "data" ? this._worker.on(p, function(l) {
|
|
798
|
+
s.call(c, l.data, l.meta);
|
|
799
|
+
}) : this._worker.on(p, function() {
|
|
800
|
+
i.delay(s, arguments, c);
|
|
801
|
+
}), this;
|
|
802
|
+
}, resume: function() {
|
|
803
|
+
return i.delay(this._worker.resume, [], this._worker), this;
|
|
804
|
+
}, pause: function() {
|
|
805
|
+
return this._worker.pause(), this;
|
|
806
|
+
}, toNodejsStream: function(p) {
|
|
807
|
+
if (i.checkSupport("nodestream"), this._outputType !== "nodebuffer") throw new Error(this._outputType + " is not supported by this method");
|
|
808
|
+
return new _(this, { objectMode: this._outputType !== "nodebuffer" }, p);
|
|
809
|
+
} }, w.exports = a;
|
|
810
|
+
}, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function(r, w, f) {
|
|
811
|
+
if (f.base64 = !0, f.array = !0, f.string = !0, f.arraybuffer = typeof ArrayBuffer < "u" && typeof Uint8Array < "u", f.nodebuffer = typeof Buffer < "u", f.uint8array = typeof Uint8Array < "u", typeof ArrayBuffer > "u") f.blob = !1;
|
|
812
|
+
else {
|
|
813
|
+
var i = new ArrayBuffer(0);
|
|
814
|
+
try {
|
|
815
|
+
f.blob = new Blob([i], { type: "application/zip" }).size === 0;
|
|
816
|
+
} catch {
|
|
817
|
+
try {
|
|
818
|
+
var o = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
|
|
819
|
+
o.append(i), f.blob = o.getBlob("application/zip").size === 0;
|
|
820
|
+
} catch {
|
|
821
|
+
f.blob = !1;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
try {
|
|
826
|
+
f.nodestream = !!r("readable-stream").Readable;
|
|
827
|
+
} catch {
|
|
828
|
+
f.nodestream = !1;
|
|
829
|
+
}
|
|
830
|
+
}, { "readable-stream": 16 }], 31: [function(r, w, f) {
|
|
831
|
+
for (var i = r("./utils"), o = r("./support"), n = r("./nodejsUtils"), h = r("./stream/GenericWorker"), y = new Array(256), v = 0; v < 256; v++) y[v] = 252 <= v ? 6 : 248 <= v ? 5 : 240 <= v ? 4 : 224 <= v ? 3 : 192 <= v ? 2 : 1;
|
|
832
|
+
y[254] = y[254] = 1;
|
|
833
|
+
function _() {
|
|
834
|
+
h.call(this, "utf-8 decode"), this.leftOver = null;
|
|
835
|
+
}
|
|
836
|
+
function g() {
|
|
837
|
+
h.call(this, "utf-8 encode");
|
|
838
|
+
}
|
|
839
|
+
f.utf8encode = function(a) {
|
|
840
|
+
return o.nodebuffer ? n.newBufferFrom(a, "utf-8") : (function(p) {
|
|
841
|
+
var s, c, l, m, k, z = p.length, C = 0;
|
|
842
|
+
for (m = 0; m < z; m++) (64512 & (c = p.charCodeAt(m))) == 55296 && m + 1 < z && (64512 & (l = p.charCodeAt(m + 1))) == 56320 && (c = 65536 + (c - 55296 << 10) + (l - 56320), m++), C += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4;
|
|
843
|
+
for (s = o.uint8array ? new Uint8Array(C) : new Array(C), m = k = 0; k < C; m++) (64512 & (c = p.charCodeAt(m))) == 55296 && m + 1 < z && (64512 & (l = p.charCodeAt(m + 1))) == 56320 && (c = 65536 + (c - 55296 << 10) + (l - 56320), m++), c < 128 ? s[k++] = c : (c < 2048 ? s[k++] = 192 | c >>> 6 : (c < 65536 ? s[k++] = 224 | c >>> 12 : (s[k++] = 240 | c >>> 18, s[k++] = 128 | c >>> 12 & 63), s[k++] = 128 | c >>> 6 & 63), s[k++] = 128 | 63 & c);
|
|
844
|
+
return s;
|
|
845
|
+
})(a);
|
|
846
|
+
}, f.utf8decode = function(a) {
|
|
847
|
+
return o.nodebuffer ? i.transformTo("nodebuffer", a).toString("utf-8") : (function(p) {
|
|
848
|
+
var s, c, l, m, k = p.length, z = new Array(2 * k);
|
|
849
|
+
for (s = c = 0; s < k; ) if ((l = p[s++]) < 128) z[c++] = l;
|
|
850
|
+
else if (4 < (m = y[l])) z[c++] = 65533, s += m - 1;
|
|
851
|
+
else {
|
|
852
|
+
for (l &= m === 2 ? 31 : m === 3 ? 15 : 7; 1 < m && s < k; ) l = l << 6 | 63 & p[s++], m--;
|
|
853
|
+
1 < m ? z[c++] = 65533 : l < 65536 ? z[c++] = l : (l -= 65536, z[c++] = 55296 | l >> 10 & 1023, z[c++] = 56320 | 1023 & l);
|
|
854
|
+
}
|
|
855
|
+
return z.length !== c && (z.subarray ? z = z.subarray(0, c) : z.length = c), i.applyFromCharCode(z);
|
|
856
|
+
})(a = i.transformTo(o.uint8array ? "uint8array" : "array", a));
|
|
857
|
+
}, i.inherits(_, h), _.prototype.processChunk = function(a) {
|
|
858
|
+
var p = i.transformTo(o.uint8array ? "uint8array" : "array", a.data);
|
|
859
|
+
if (this.leftOver && this.leftOver.length) {
|
|
860
|
+
if (o.uint8array) {
|
|
861
|
+
var s = p;
|
|
862
|
+
(p = new Uint8Array(s.length + this.leftOver.length)).set(this.leftOver, 0), p.set(s, this.leftOver.length);
|
|
863
|
+
} else p = this.leftOver.concat(p);
|
|
864
|
+
this.leftOver = null;
|
|
865
|
+
}
|
|
866
|
+
var c = (function(m, k) {
|
|
867
|
+
var z;
|
|
868
|
+
for ((k = k || m.length) > m.length && (k = m.length), z = k - 1; 0 <= z && (192 & m[z]) == 128; ) z--;
|
|
869
|
+
return z < 0 || z === 0 ? k : z + y[m[z]] > k ? z : k;
|
|
870
|
+
})(p), l = p;
|
|
871
|
+
c !== p.length && (o.uint8array ? (l = p.subarray(0, c), this.leftOver = p.subarray(c, p.length)) : (l = p.slice(0, c), this.leftOver = p.slice(c, p.length))), this.push({ data: f.utf8decode(l), meta: a.meta });
|
|
872
|
+
}, _.prototype.flush = function() {
|
|
873
|
+
this.leftOver && this.leftOver.length && (this.push({ data: f.utf8decode(this.leftOver), meta: {} }), this.leftOver = null);
|
|
874
|
+
}, f.Utf8DecodeWorker = _, i.inherits(g, h), g.prototype.processChunk = function(a) {
|
|
875
|
+
this.push({ data: f.utf8encode(a.data), meta: a.meta });
|
|
876
|
+
}, f.Utf8EncodeWorker = g;
|
|
877
|
+
}, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(r, w, f) {
|
|
878
|
+
var i = r("./support"), o = r("./base64"), n = r("./nodejsUtils"), h = r("./external");
|
|
879
|
+
function y(s) {
|
|
880
|
+
return s;
|
|
881
|
+
}
|
|
882
|
+
function v(s, c) {
|
|
883
|
+
for (var l = 0; l < s.length; ++l) c[l] = 255 & s.charCodeAt(l);
|
|
884
|
+
return c;
|
|
885
|
+
}
|
|
886
|
+
r("setimmediate"), f.newBlob = function(s, c) {
|
|
887
|
+
f.checkSupport("blob");
|
|
888
|
+
try {
|
|
889
|
+
return new Blob([s], { type: c });
|
|
890
|
+
} catch {
|
|
891
|
+
try {
|
|
892
|
+
var l = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
|
|
893
|
+
return l.append(s), l.getBlob(c);
|
|
894
|
+
} catch {
|
|
895
|
+
throw new Error("Bug : can't construct the Blob.");
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
var _ = { stringifyByChunk: function(s, c, l) {
|
|
900
|
+
var m = [], k = 0, z = s.length;
|
|
901
|
+
if (z <= l) return String.fromCharCode.apply(null, s);
|
|
902
|
+
for (; k < z; ) c === "array" || c === "nodebuffer" ? m.push(String.fromCharCode.apply(null, s.slice(k, Math.min(k + l, z)))) : m.push(String.fromCharCode.apply(null, s.subarray(k, Math.min(k + l, z)))), k += l;
|
|
903
|
+
return m.join("");
|
|
904
|
+
}, stringifyByChar: function(s) {
|
|
905
|
+
for (var c = "", l = 0; l < s.length; l++) c += String.fromCharCode(s[l]);
|
|
906
|
+
return c;
|
|
907
|
+
}, applyCanBeUsed: { uint8array: (function() {
|
|
908
|
+
try {
|
|
909
|
+
return i.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1;
|
|
910
|
+
} catch {
|
|
911
|
+
return !1;
|
|
912
|
+
}
|
|
913
|
+
})(), nodebuffer: (function() {
|
|
914
|
+
try {
|
|
915
|
+
return i.nodebuffer && String.fromCharCode.apply(null, n.allocBuffer(1)).length === 1;
|
|
916
|
+
} catch {
|
|
917
|
+
return !1;
|
|
918
|
+
}
|
|
919
|
+
})() } };
|
|
920
|
+
function g(s) {
|
|
921
|
+
var c = 65536, l = f.getTypeOf(s), m = !0;
|
|
922
|
+
if (l === "uint8array" ? m = _.applyCanBeUsed.uint8array : l === "nodebuffer" && (m = _.applyCanBeUsed.nodebuffer), m) for (; 1 < c; ) try {
|
|
923
|
+
return _.stringifyByChunk(s, l, c);
|
|
924
|
+
} catch {
|
|
925
|
+
c = Math.floor(c / 2);
|
|
926
|
+
}
|
|
927
|
+
return _.stringifyByChar(s);
|
|
928
|
+
}
|
|
929
|
+
function a(s, c) {
|
|
930
|
+
for (var l = 0; l < s.length; l++) c[l] = s[l];
|
|
931
|
+
return c;
|
|
932
|
+
}
|
|
933
|
+
f.applyFromCharCode = g;
|
|
934
|
+
var p = {};
|
|
935
|
+
p.string = { string: y, array: function(s) {
|
|
936
|
+
return v(s, new Array(s.length));
|
|
937
|
+
}, arraybuffer: function(s) {
|
|
938
|
+
return p.string.uint8array(s).buffer;
|
|
939
|
+
}, uint8array: function(s) {
|
|
940
|
+
return v(s, new Uint8Array(s.length));
|
|
941
|
+
}, nodebuffer: function(s) {
|
|
942
|
+
return v(s, n.allocBuffer(s.length));
|
|
943
|
+
} }, p.array = { string: g, array: y, arraybuffer: function(s) {
|
|
944
|
+
return new Uint8Array(s).buffer;
|
|
945
|
+
}, uint8array: function(s) {
|
|
946
|
+
return new Uint8Array(s);
|
|
947
|
+
}, nodebuffer: function(s) {
|
|
948
|
+
return n.newBufferFrom(s);
|
|
949
|
+
} }, p.arraybuffer = { string: function(s) {
|
|
950
|
+
return g(new Uint8Array(s));
|
|
951
|
+
}, array: function(s) {
|
|
952
|
+
return a(new Uint8Array(s), new Array(s.byteLength));
|
|
953
|
+
}, arraybuffer: y, uint8array: function(s) {
|
|
954
|
+
return new Uint8Array(s);
|
|
955
|
+
}, nodebuffer: function(s) {
|
|
956
|
+
return n.newBufferFrom(new Uint8Array(s));
|
|
957
|
+
} }, p.uint8array = { string: g, array: function(s) {
|
|
958
|
+
return a(s, new Array(s.length));
|
|
959
|
+
}, arraybuffer: function(s) {
|
|
960
|
+
return s.buffer;
|
|
961
|
+
}, uint8array: y, nodebuffer: function(s) {
|
|
962
|
+
return n.newBufferFrom(s);
|
|
963
|
+
} }, p.nodebuffer = { string: g, array: function(s) {
|
|
964
|
+
return a(s, new Array(s.length));
|
|
965
|
+
}, arraybuffer: function(s) {
|
|
966
|
+
return p.nodebuffer.uint8array(s).buffer;
|
|
967
|
+
}, uint8array: function(s) {
|
|
968
|
+
return a(s, new Uint8Array(s.length));
|
|
969
|
+
}, nodebuffer: y }, f.transformTo = function(s, c) {
|
|
970
|
+
if (c = c || "", !s) return c;
|
|
971
|
+
f.checkSupport(s);
|
|
972
|
+
var l = f.getTypeOf(c);
|
|
973
|
+
return p[l][s](c);
|
|
974
|
+
}, f.resolve = function(s) {
|
|
975
|
+
for (var c = s.split("/"), l = [], m = 0; m < c.length; m++) {
|
|
976
|
+
var k = c[m];
|
|
977
|
+
k === "." || k === "" && m !== 0 && m !== c.length - 1 || (k === ".." ? l.pop() : l.push(k));
|
|
978
|
+
}
|
|
979
|
+
return l.join("/");
|
|
980
|
+
}, f.getTypeOf = function(s) {
|
|
981
|
+
return typeof s == "string" ? "string" : Object.prototype.toString.call(s) === "[object Array]" ? "array" : i.nodebuffer && n.isBuffer(s) ? "nodebuffer" : i.uint8array && s instanceof Uint8Array ? "uint8array" : i.arraybuffer && s instanceof ArrayBuffer ? "arraybuffer" : void 0;
|
|
982
|
+
}, f.checkSupport = function(s) {
|
|
983
|
+
if (!i[s.toLowerCase()]) throw new Error(s + " is not supported by this platform");
|
|
984
|
+
}, f.MAX_VALUE_16BITS = 65535, f.MAX_VALUE_32BITS = -1, f.pretty = function(s) {
|
|
985
|
+
var c, l, m = "";
|
|
986
|
+
for (l = 0; l < (s || "").length; l++) m += "\\x" + ((c = s.charCodeAt(l)) < 16 ? "0" : "") + c.toString(16).toUpperCase();
|
|
987
|
+
return m;
|
|
988
|
+
}, f.delay = function(s, c, l) {
|
|
989
|
+
setImmediate(function() {
|
|
990
|
+
s.apply(l || null, c || []);
|
|
991
|
+
});
|
|
992
|
+
}, f.inherits = function(s, c) {
|
|
993
|
+
function l() {
|
|
994
|
+
}
|
|
995
|
+
l.prototype = c.prototype, s.prototype = new l();
|
|
996
|
+
}, f.extend = function() {
|
|
997
|
+
var s, c, l = {};
|
|
998
|
+
for (s = 0; s < arguments.length; s++) for (c in arguments[s]) Object.prototype.hasOwnProperty.call(arguments[s], c) && l[c] === void 0 && (l[c] = arguments[s][c]);
|
|
999
|
+
return l;
|
|
1000
|
+
}, f.prepareContent = function(s, c, l, m, k) {
|
|
1001
|
+
return h.Promise.resolve(c).then(function(z) {
|
|
1002
|
+
return i.blob && (z instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(z)) !== -1) && typeof FileReader < "u" ? new h.Promise(function(C, U) {
|
|
1003
|
+
var T = new FileReader();
|
|
1004
|
+
T.onload = function(W) {
|
|
1005
|
+
C(W.target.result);
|
|
1006
|
+
}, T.onerror = function(W) {
|
|
1007
|
+
U(W.target.error);
|
|
1008
|
+
}, T.readAsArrayBuffer(z);
|
|
1009
|
+
}) : z;
|
|
1010
|
+
}).then(function(z) {
|
|
1011
|
+
var C = f.getTypeOf(z);
|
|
1012
|
+
return C ? (C === "arraybuffer" ? z = f.transformTo("uint8array", z) : C === "string" && (k ? z = o.decode(z) : l && m !== !0 && (z = (function(U) {
|
|
1013
|
+
return v(U, i.uint8array ? new Uint8Array(U.length) : new Array(U.length));
|
|
1014
|
+
})(z))), z) : h.Promise.reject(new Error("Can't read the data of '" + s + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
|
|
1015
|
+
});
|
|
1016
|
+
};
|
|
1017
|
+
}, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function(r, w, f) {
|
|
1018
|
+
var i = r("./reader/readerFor"), o = r("./utils"), n = r("./signature"), h = r("./zipEntry"), y = r("./support");
|
|
1019
|
+
function v(_) {
|
|
1020
|
+
this.files = [], this.loadOptions = _;
|
|
1021
|
+
}
|
|
1022
|
+
v.prototype = { checkSignature: function(_) {
|
|
1023
|
+
if (!this.reader.readAndCheckSignature(_)) {
|
|
1024
|
+
this.reader.index -= 4;
|
|
1025
|
+
var g = this.reader.readString(4);
|
|
1026
|
+
throw new Error("Corrupted zip or bug: unexpected signature (" + o.pretty(g) + ", expected " + o.pretty(_) + ")");
|
|
1027
|
+
}
|
|
1028
|
+
}, isSignature: function(_, g) {
|
|
1029
|
+
var a = this.reader.index;
|
|
1030
|
+
this.reader.setIndex(_);
|
|
1031
|
+
var p = this.reader.readString(4) === g;
|
|
1032
|
+
return this.reader.setIndex(a), p;
|
|
1033
|
+
}, readBlockEndOfCentral: function() {
|
|
1034
|
+
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);
|
|
1035
|
+
var _ = this.reader.readData(this.zipCommentLength), g = y.uint8array ? "uint8array" : "array", a = o.transformTo(g, _);
|
|
1036
|
+
this.zipComment = this.loadOptions.decodeFileName(a);
|
|
1037
|
+
}, readBlockZip64EndOfCentral: function() {
|
|
1038
|
+
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 = {};
|
|
1039
|
+
for (var _, g, a, p = this.zip64EndOfCentralSize - 44; 0 < p; ) _ = this.reader.readInt(2), g = this.reader.readInt(4), a = this.reader.readData(g), this.zip64ExtensibleData[_] = { id: _, length: g, value: a };
|
|
1040
|
+
}, readBlockZip64EndOfCentralLocator: function() {
|
|
1041
|
+
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");
|
|
1042
|
+
}, readLocalFiles: function() {
|
|
1043
|
+
var _, g;
|
|
1044
|
+
for (_ = 0; _ < this.files.length; _++) g = this.files[_], this.reader.setIndex(g.localHeaderOffset), this.checkSignature(n.LOCAL_FILE_HEADER), g.readLocalPart(this.reader), g.handleUTF8(), g.processAttributes();
|
|
1045
|
+
}, readCentralDir: function() {
|
|
1046
|
+
var _;
|
|
1047
|
+
for (this.reader.setIndex(this.centralDirOffset); this.reader.readAndCheckSignature(n.CENTRAL_FILE_HEADER); ) (_ = new h({ zip64: this.zip64 }, this.loadOptions)).readCentralPart(this.reader), this.files.push(_);
|
|
1048
|
+
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);
|
|
1049
|
+
}, readEndOfCentral: function() {
|
|
1050
|
+
var _ = this.reader.lastIndexOfSignature(n.CENTRAL_DIRECTORY_END);
|
|
1051
|
+
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");
|
|
1052
|
+
this.reader.setIndex(_);
|
|
1053
|
+
var g = _;
|
|
1054
|
+
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) {
|
|
1055
|
+
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");
|
|
1056
|
+
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");
|
|
1057
|
+
this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(n.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral();
|
|
1058
|
+
}
|
|
1059
|
+
var a = this.centralDirOffset + this.centralDirSize;
|
|
1060
|
+
this.zip64 && (a += 20, a += 12 + this.zip64EndOfCentralSize);
|
|
1061
|
+
var p = g - a;
|
|
1062
|
+
if (0 < p) this.isSignature(g, n.CENTRAL_FILE_HEADER) || (this.reader.zero = p);
|
|
1063
|
+
else if (p < 0) throw new Error("Corrupted zip: missing " + Math.abs(p) + " bytes.");
|
|
1064
|
+
}, prepareReader: function(_) {
|
|
1065
|
+
this.reader = i(_);
|
|
1066
|
+
}, load: function(_) {
|
|
1067
|
+
this.prepareReader(_), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles();
|
|
1068
|
+
} }, w.exports = v;
|
|
1069
|
+
}, { "./reader/readerFor": 22, "./signature": 23, "./support": 30, "./utils": 32, "./zipEntry": 34 }], 34: [function(r, w, f) {
|
|
1070
|
+
var i = r("./reader/readerFor"), o = r("./utils"), n = r("./compressedObject"), h = r("./crc32"), y = r("./utf8"), v = r("./compressions"), _ = r("./support");
|
|
1071
|
+
function g(a, p) {
|
|
1072
|
+
this.options = a, this.loadOptions = p;
|
|
1073
|
+
}
|
|
1074
|
+
g.prototype = { isEncrypted: function() {
|
|
1075
|
+
return (1 & this.bitFlag) == 1;
|
|
1076
|
+
}, useUTF8: function() {
|
|
1077
|
+
return (2048 & this.bitFlag) == 2048;
|
|
1078
|
+
}, readLocalPart: function(a) {
|
|
1079
|
+
var p, s;
|
|
1080
|
+
if (a.skip(22), this.fileNameLength = a.readInt(2), s = a.readInt(2), this.fileName = a.readData(this.fileNameLength), a.skip(s), 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)");
|
|
1081
|
+
if ((p = (function(c) {
|
|
1082
|
+
for (var l in v) if (Object.prototype.hasOwnProperty.call(v, l) && v[l].magic === c) return v[l];
|
|
1083
|
+
return null;
|
|
1084
|
+
})(this.compressionMethod)) === null) throw new Error("Corrupted zip : compression " + o.pretty(this.compressionMethod) + " unknown (inner file : " + o.transformTo("string", this.fileName) + ")");
|
|
1085
|
+
this.decompressed = new n(this.compressedSize, this.uncompressedSize, this.crc32, p, a.readData(this.compressedSize));
|
|
1086
|
+
}, readCentralPart: function(a) {
|
|
1087
|
+
this.versionMadeBy = a.readInt(2), a.skip(2), this.bitFlag = a.readInt(2), this.compressionMethod = a.readString(2), this.date = a.readDate(), this.crc32 = a.readInt(4), this.compressedSize = a.readInt(4), this.uncompressedSize = a.readInt(4);
|
|
1088
|
+
var p = a.readInt(2);
|
|
1089
|
+
if (this.extraFieldsLength = a.readInt(2), this.fileCommentLength = a.readInt(2), this.diskNumberStart = a.readInt(2), this.internalFileAttributes = a.readInt(2), this.externalFileAttributes = a.readInt(4), this.localHeaderOffset = a.readInt(4), this.isEncrypted()) throw new Error("Encrypted zip are not supported");
|
|
1090
|
+
a.skip(p), this.readExtraFields(a), this.parseZIP64ExtraField(a), this.fileComment = a.readData(this.fileCommentLength);
|
|
1091
|
+
}, processAttributes: function() {
|
|
1092
|
+
this.unixPermissions = null, this.dosPermissions = null;
|
|
1093
|
+
var a = this.versionMadeBy >> 8;
|
|
1094
|
+
this.dir = !!(16 & this.externalFileAttributes), a == 0 && (this.dosPermissions = 63 & this.externalFileAttributes), a == 3 && (this.unixPermissions = this.externalFileAttributes >> 16 & 65535), this.dir || this.fileNameStr.slice(-1) !== "/" || (this.dir = !0);
|
|
1095
|
+
}, parseZIP64ExtraField: function() {
|
|
1096
|
+
if (this.extraFields[1]) {
|
|
1097
|
+
var a = i(this.extraFields[1].value);
|
|
1098
|
+
this.uncompressedSize === o.MAX_VALUE_32BITS && (this.uncompressedSize = a.readInt(8)), this.compressedSize === o.MAX_VALUE_32BITS && (this.compressedSize = a.readInt(8)), this.localHeaderOffset === o.MAX_VALUE_32BITS && (this.localHeaderOffset = a.readInt(8)), this.diskNumberStart === o.MAX_VALUE_32BITS && (this.diskNumberStart = a.readInt(4));
|
|
1099
|
+
}
|
|
1100
|
+
}, readExtraFields: function(a) {
|
|
1101
|
+
var p, s, c, l = a.index + this.extraFieldsLength;
|
|
1102
|
+
for (this.extraFields || (this.extraFields = {}); a.index + 4 < l; ) p = a.readInt(2), s = a.readInt(2), c = a.readData(s), this.extraFields[p] = { id: p, length: s, value: c };
|
|
1103
|
+
a.setIndex(l);
|
|
1104
|
+
}, handleUTF8: function() {
|
|
1105
|
+
var a = _.uint8array ? "uint8array" : "array";
|
|
1106
|
+
if (this.useUTF8()) this.fileNameStr = y.utf8decode(this.fileName), this.fileCommentStr = y.utf8decode(this.fileComment);
|
|
1107
|
+
else {
|
|
1108
|
+
var p = this.findExtraFieldUnicodePath();
|
|
1109
|
+
if (p !== null) this.fileNameStr = p;
|
|
1110
|
+
else {
|
|
1111
|
+
var s = o.transformTo(a, this.fileName);
|
|
1112
|
+
this.fileNameStr = this.loadOptions.decodeFileName(s);
|
|
1113
|
+
}
|
|
1114
|
+
var c = this.findExtraFieldUnicodeComment();
|
|
1115
|
+
if (c !== null) this.fileCommentStr = c;
|
|
1116
|
+
else {
|
|
1117
|
+
var l = o.transformTo(a, this.fileComment);
|
|
1118
|
+
this.fileCommentStr = this.loadOptions.decodeFileName(l);
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
}, findExtraFieldUnicodePath: function() {
|
|
1122
|
+
var a = this.extraFields[28789];
|
|
1123
|
+
if (a) {
|
|
1124
|
+
var p = i(a.value);
|
|
1125
|
+
return p.readInt(1) !== 1 || h(this.fileName) !== p.readInt(4) ? null : y.utf8decode(p.readData(a.length - 5));
|
|
1126
|
+
}
|
|
1127
|
+
return null;
|
|
1128
|
+
}, findExtraFieldUnicodeComment: function() {
|
|
1129
|
+
var a = this.extraFields[25461];
|
|
1130
|
+
if (a) {
|
|
1131
|
+
var p = i(a.value);
|
|
1132
|
+
return p.readInt(1) !== 1 || h(this.fileComment) !== p.readInt(4) ? null : y.utf8decode(p.readData(a.length - 5));
|
|
1133
|
+
}
|
|
1134
|
+
return null;
|
|
1135
|
+
} }, w.exports = g;
|
|
1136
|
+
}, { "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./reader/readerFor": 22, "./support": 30, "./utf8": 31, "./utils": 32 }], 35: [function(r, w, f) {
|
|
1137
|
+
function i(p, s, c) {
|
|
1138
|
+
this.name = p, this.dir = c.dir, this.date = c.date, this.comment = c.comment, this.unixPermissions = c.unixPermissions, this.dosPermissions = c.dosPermissions, this._data = s, this._dataBinary = c.binary, this.options = { compression: c.compression, compressionOptions: c.compressionOptions };
|
|
1139
|
+
}
|
|
1140
|
+
var o = r("./stream/StreamHelper"), n = r("./stream/DataWorker"), h = r("./utf8"), y = r("./compressedObject"), v = r("./stream/GenericWorker");
|
|
1141
|
+
i.prototype = { internalStream: function(p) {
|
|
1142
|
+
var s = null, c = "string";
|
|
1143
|
+
try {
|
|
1144
|
+
if (!p) throw new Error("No output type specified.");
|
|
1145
|
+
var l = (c = p.toLowerCase()) === "string" || c === "text";
|
|
1146
|
+
c !== "binarystring" && c !== "text" || (c = "string"), s = this._decompressWorker();
|
|
1147
|
+
var m = !this._dataBinary;
|
|
1148
|
+
m && !l && (s = s.pipe(new h.Utf8EncodeWorker())), !m && l && (s = s.pipe(new h.Utf8DecodeWorker()));
|
|
1149
|
+
} catch (k) {
|
|
1150
|
+
(s = new v("error")).error(k);
|
|
1151
|
+
}
|
|
1152
|
+
return new o(s, c, "");
|
|
1153
|
+
}, async: function(p, s) {
|
|
1154
|
+
return this.internalStream(p).accumulate(s);
|
|
1155
|
+
}, nodeStream: function(p, s) {
|
|
1156
|
+
return this.internalStream(p || "nodebuffer").toNodejsStream(s);
|
|
1157
|
+
}, _compressWorker: function(p, s) {
|
|
1158
|
+
if (this._data instanceof y && this._data.compression.magic === p.magic) return this._data.getCompressedWorker();
|
|
1159
|
+
var c = this._decompressWorker();
|
|
1160
|
+
return this._dataBinary || (c = c.pipe(new h.Utf8EncodeWorker())), y.createWorkerFrom(c, p, s);
|
|
1161
|
+
}, _decompressWorker: function() {
|
|
1162
|
+
return this._data instanceof y ? this._data.getContentWorker() : this._data instanceof v ? this._data : new n(this._data);
|
|
1163
|
+
} };
|
|
1164
|
+
for (var _ = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"], g = function() {
|
|
1165
|
+
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
1166
|
+
}, a = 0; a < _.length; a++) i.prototype[_[a]] = g;
|
|
1167
|
+
w.exports = i;
|
|
1168
|
+
}, { "./compressedObject": 2, "./stream/DataWorker": 27, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31 }], 36: [function(r, w, f) {
|
|
1169
|
+
(function(i) {
|
|
1170
|
+
var o, n, h = i.MutationObserver || i.WebKitMutationObserver;
|
|
1171
|
+
if (h) {
|
|
1172
|
+
var y = 0, v = new h(p), _ = i.document.createTextNode("");
|
|
1173
|
+
v.observe(_, { characterData: !0 }), o = function() {
|
|
1174
|
+
_.data = y = ++y % 2;
|
|
1175
|
+
};
|
|
1176
|
+
} else if (i.setImmediate || i.MessageChannel === void 0) o = "document" in i && "onreadystatechange" in i.document.createElement("script") ? function() {
|
|
1177
|
+
var s = i.document.createElement("script");
|
|
1178
|
+
s.onreadystatechange = function() {
|
|
1179
|
+
p(), s.onreadystatechange = null, s.parentNode.removeChild(s), s = null;
|
|
1180
|
+
}, i.document.documentElement.appendChild(s);
|
|
1181
|
+
} : function() {
|
|
1182
|
+
setTimeout(p, 0);
|
|
1183
|
+
};
|
|
1184
|
+
else {
|
|
1185
|
+
var g = new i.MessageChannel();
|
|
1186
|
+
g.port1.onmessage = p, o = function() {
|
|
1187
|
+
g.port2.postMessage(0);
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
var a = [];
|
|
1191
|
+
function p() {
|
|
1192
|
+
var s, c;
|
|
1193
|
+
n = !0;
|
|
1194
|
+
for (var l = a.length; l; ) {
|
|
1195
|
+
for (c = a, a = [], s = -1; ++s < l; ) c[s]();
|
|
1196
|
+
l = a.length;
|
|
1197
|
+
}
|
|
1198
|
+
n = !1;
|
|
1199
|
+
}
|
|
1200
|
+
w.exports = function(s) {
|
|
1201
|
+
a.push(s) !== 1 || n || o();
|
|
1202
|
+
};
|
|
1203
|
+
}).call(this, typeof vt < "u" ? vt : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
1204
|
+
}, {}], 37: [function(r, w, f) {
|
|
1205
|
+
var i = r("immediate");
|
|
1206
|
+
function o() {
|
|
1207
|
+
}
|
|
1208
|
+
var n = {}, h = ["REJECTED"], y = ["FULFILLED"], v = ["PENDING"];
|
|
1209
|
+
function _(l) {
|
|
1210
|
+
if (typeof l != "function") throw new TypeError("resolver must be a function");
|
|
1211
|
+
this.state = v, this.queue = [], this.outcome = void 0, l !== o && s(this, l);
|
|
1212
|
+
}
|
|
1213
|
+
function g(l, m, k) {
|
|
1214
|
+
this.promise = l, typeof m == "function" && (this.onFulfilled = m, this.callFulfilled = this.otherCallFulfilled), typeof k == "function" && (this.onRejected = k, this.callRejected = this.otherCallRejected);
|
|
1215
|
+
}
|
|
1216
|
+
function a(l, m, k) {
|
|
1217
|
+
i(function() {
|
|
1218
|
+
var z;
|
|
1219
|
+
try {
|
|
1220
|
+
z = m(k);
|
|
1221
|
+
} catch (C) {
|
|
1222
|
+
return n.reject(l, C);
|
|
1223
|
+
}
|
|
1224
|
+
z === l ? n.reject(l, new TypeError("Cannot resolve promise with itself")) : n.resolve(l, z);
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
function p(l) {
|
|
1228
|
+
var m = l && l.then;
|
|
1229
|
+
if (l && (typeof l == "object" || typeof l == "function") && typeof m == "function") return function() {
|
|
1230
|
+
m.apply(l, arguments);
|
|
1231
|
+
};
|
|
1232
|
+
}
|
|
1233
|
+
function s(l, m) {
|
|
1234
|
+
var k = !1;
|
|
1235
|
+
function z(T) {
|
|
1236
|
+
k || (k = !0, n.reject(l, T));
|
|
1237
|
+
}
|
|
1238
|
+
function C(T) {
|
|
1239
|
+
k || (k = !0, n.resolve(l, T));
|
|
1240
|
+
}
|
|
1241
|
+
var U = c(function() {
|
|
1242
|
+
m(C, z);
|
|
1243
|
+
});
|
|
1244
|
+
U.status === "error" && z(U.value);
|
|
1245
|
+
}
|
|
1246
|
+
function c(l, m) {
|
|
1247
|
+
var k = {};
|
|
1248
|
+
try {
|
|
1249
|
+
k.value = l(m), k.status = "success";
|
|
1250
|
+
} catch (z) {
|
|
1251
|
+
k.status = "error", k.value = z;
|
|
1252
|
+
}
|
|
1253
|
+
return k;
|
|
1254
|
+
}
|
|
1255
|
+
(w.exports = _).prototype.finally = function(l) {
|
|
1256
|
+
if (typeof l != "function") return this;
|
|
1257
|
+
var m = this.constructor;
|
|
1258
|
+
return this.then(function(k) {
|
|
1259
|
+
return m.resolve(l()).then(function() {
|
|
1260
|
+
return k;
|
|
1261
|
+
});
|
|
1262
|
+
}, function(k) {
|
|
1263
|
+
return m.resolve(l()).then(function() {
|
|
1264
|
+
throw k;
|
|
1265
|
+
});
|
|
1266
|
+
});
|
|
1267
|
+
}, _.prototype.catch = function(l) {
|
|
1268
|
+
return this.then(null, l);
|
|
1269
|
+
}, _.prototype.then = function(l, m) {
|
|
1270
|
+
if (typeof l != "function" && this.state === y || typeof m != "function" && this.state === h) return this;
|
|
1271
|
+
var k = new this.constructor(o);
|
|
1272
|
+
return this.state !== v ? a(k, this.state === y ? l : m, this.outcome) : this.queue.push(new g(k, l, m)), k;
|
|
1273
|
+
}, g.prototype.callFulfilled = function(l) {
|
|
1274
|
+
n.resolve(this.promise, l);
|
|
1275
|
+
}, g.prototype.otherCallFulfilled = function(l) {
|
|
1276
|
+
a(this.promise, this.onFulfilled, l);
|
|
1277
|
+
}, g.prototype.callRejected = function(l) {
|
|
1278
|
+
n.reject(this.promise, l);
|
|
1279
|
+
}, g.prototype.otherCallRejected = function(l) {
|
|
1280
|
+
a(this.promise, this.onRejected, l);
|
|
1281
|
+
}, n.resolve = function(l, m) {
|
|
1282
|
+
var k = c(p, m);
|
|
1283
|
+
if (k.status === "error") return n.reject(l, k.value);
|
|
1284
|
+
var z = k.value;
|
|
1285
|
+
if (z) s(l, z);
|
|
1286
|
+
else {
|
|
1287
|
+
l.state = y, l.outcome = m;
|
|
1288
|
+
for (var C = -1, U = l.queue.length; ++C < U; ) l.queue[C].callFulfilled(m);
|
|
1289
|
+
}
|
|
1290
|
+
return l;
|
|
1291
|
+
}, n.reject = function(l, m) {
|
|
1292
|
+
l.state = h, l.outcome = m;
|
|
1293
|
+
for (var k = -1, z = l.queue.length; ++k < z; ) l.queue[k].callRejected(m);
|
|
1294
|
+
return l;
|
|
1295
|
+
}, _.resolve = function(l) {
|
|
1296
|
+
return l instanceof this ? l : n.resolve(new this(o), l);
|
|
1297
|
+
}, _.reject = function(l) {
|
|
1298
|
+
var m = new this(o);
|
|
1299
|
+
return n.reject(m, l);
|
|
1300
|
+
}, _.all = function(l) {
|
|
1301
|
+
var m = this;
|
|
1302
|
+
if (Object.prototype.toString.call(l) !== "[object Array]") return this.reject(new TypeError("must be an array"));
|
|
1303
|
+
var k = l.length, z = !1;
|
|
1304
|
+
if (!k) return this.resolve([]);
|
|
1305
|
+
for (var C = new Array(k), U = 0, T = -1, W = new this(o); ++T < k; ) F(l[T], T);
|
|
1306
|
+
return W;
|
|
1307
|
+
function F(H, X) {
|
|
1308
|
+
m.resolve(H).then(function(b) {
|
|
1309
|
+
C[X] = b, ++U !== k || z || (z = !0, n.resolve(W, C));
|
|
1310
|
+
}, function(b) {
|
|
1311
|
+
z || (z = !0, n.reject(W, b));
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
}, _.race = function(l) {
|
|
1315
|
+
var m = this;
|
|
1316
|
+
if (Object.prototype.toString.call(l) !== "[object Array]") return this.reject(new TypeError("must be an array"));
|
|
1317
|
+
var k = l.length, z = !1;
|
|
1318
|
+
if (!k) return this.resolve([]);
|
|
1319
|
+
for (var C = -1, U = new this(o); ++C < k; ) T = l[C], m.resolve(T).then(function(W) {
|
|
1320
|
+
z || (z = !0, n.resolve(U, W));
|
|
1321
|
+
}, function(W) {
|
|
1322
|
+
z || (z = !0, n.reject(U, W));
|
|
1323
|
+
});
|
|
1324
|
+
var T;
|
|
1325
|
+
return U;
|
|
1326
|
+
};
|
|
1327
|
+
}, { immediate: 36 }], 38: [function(r, w, f) {
|
|
1328
|
+
var i = {};
|
|
1329
|
+
(0, r("./lib/utils/common").assign)(i, r("./lib/deflate"), r("./lib/inflate"), r("./lib/zlib/constants")), w.exports = i;
|
|
1330
|
+
}, { "./lib/deflate": 39, "./lib/inflate": 40, "./lib/utils/common": 41, "./lib/zlib/constants": 44 }], 39: [function(r, w, f) {
|
|
1331
|
+
var i = r("./zlib/deflate"), o = r("./utils/common"), n = r("./utils/strings"), h = r("./zlib/messages"), y = r("./zlib/zstream"), v = Object.prototype.toString, _ = 0, g = -1, a = 0, p = 8;
|
|
1332
|
+
function s(l) {
|
|
1333
|
+
if (!(this instanceof s)) return new s(l);
|
|
1334
|
+
this.options = o.assign({ level: g, method: p, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: a, to: "" }, l || {});
|
|
1335
|
+
var m = this.options;
|
|
1336
|
+
m.raw && 0 < m.windowBits ? m.windowBits = -m.windowBits : m.gzip && 0 < m.windowBits && m.windowBits < 16 && (m.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new y(), this.strm.avail_out = 0;
|
|
1337
|
+
var k = i.deflateInit2(this.strm, m.level, m.method, m.windowBits, m.memLevel, m.strategy);
|
|
1338
|
+
if (k !== _) throw new Error(h[k]);
|
|
1339
|
+
if (m.header && i.deflateSetHeader(this.strm, m.header), m.dictionary) {
|
|
1340
|
+
var z;
|
|
1341
|
+
if (z = typeof m.dictionary == "string" ? n.string2buf(m.dictionary) : v.call(m.dictionary) === "[object ArrayBuffer]" ? new Uint8Array(m.dictionary) : m.dictionary, (k = i.deflateSetDictionary(this.strm, z)) !== _) throw new Error(h[k]);
|
|
1342
|
+
this._dict_set = !0;
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
function c(l, m) {
|
|
1346
|
+
var k = new s(m);
|
|
1347
|
+
if (k.push(l, !0), k.err) throw k.msg || h[k.err];
|
|
1348
|
+
return k.result;
|
|
1349
|
+
}
|
|
1350
|
+
s.prototype.push = function(l, m) {
|
|
1351
|
+
var k, z, C = this.strm, U = this.options.chunkSize;
|
|
1352
|
+
if (this.ended) return !1;
|
|
1353
|
+
z = m === ~~m ? m : m === !0 ? 4 : 0, typeof l == "string" ? C.input = n.string2buf(l) : v.call(l) === "[object ArrayBuffer]" ? C.input = new Uint8Array(l) : C.input = l, C.next_in = 0, C.avail_in = C.input.length;
|
|
1354
|
+
do {
|
|
1355
|
+
if (C.avail_out === 0 && (C.output = new o.Buf8(U), C.next_out = 0, C.avail_out = U), (k = i.deflate(C, z)) !== 1 && k !== _) return this.onEnd(k), !(this.ended = !0);
|
|
1356
|
+
C.avail_out !== 0 && (C.avail_in !== 0 || z !== 4 && z !== 2) || (this.options.to === "string" ? this.onData(n.buf2binstring(o.shrinkBuf(C.output, C.next_out))) : this.onData(o.shrinkBuf(C.output, C.next_out)));
|
|
1357
|
+
} while ((0 < C.avail_in || C.avail_out === 0) && k !== 1);
|
|
1358
|
+
return z === 4 ? (k = i.deflateEnd(this.strm), this.onEnd(k), this.ended = !0, k === _) : z !== 2 || (this.onEnd(_), !(C.avail_out = 0));
|
|
1359
|
+
}, s.prototype.onData = function(l) {
|
|
1360
|
+
this.chunks.push(l);
|
|
1361
|
+
}, s.prototype.onEnd = function(l) {
|
|
1362
|
+
l === _ && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = l, this.msg = this.strm.msg;
|
|
1363
|
+
}, f.Deflate = s, f.deflate = c, f.deflateRaw = function(l, m) {
|
|
1364
|
+
return (m = m || {}).raw = !0, c(l, m);
|
|
1365
|
+
}, f.gzip = function(l, m) {
|
|
1366
|
+
return (m = m || {}).gzip = !0, c(l, m);
|
|
1367
|
+
};
|
|
1368
|
+
}, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function(r, w, f) {
|
|
1369
|
+
var i = r("./zlib/inflate"), o = r("./utils/common"), n = r("./utils/strings"), h = r("./zlib/constants"), y = r("./zlib/messages"), v = r("./zlib/zstream"), _ = r("./zlib/gzheader"), g = Object.prototype.toString;
|
|
1370
|
+
function a(s) {
|
|
1371
|
+
if (!(this instanceof a)) return new a(s);
|
|
1372
|
+
this.options = o.assign({ chunkSize: 16384, windowBits: 0, to: "" }, s || {});
|
|
1373
|
+
var c = this.options;
|
|
1374
|
+
c.raw && 0 <= c.windowBits && c.windowBits < 16 && (c.windowBits = -c.windowBits, c.windowBits === 0 && (c.windowBits = -15)), !(0 <= c.windowBits && c.windowBits < 16) || s && s.windowBits || (c.windowBits += 32), 15 < c.windowBits && c.windowBits < 48 && (15 & c.windowBits) == 0 && (c.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new v(), this.strm.avail_out = 0;
|
|
1375
|
+
var l = i.inflateInit2(this.strm, c.windowBits);
|
|
1376
|
+
if (l !== h.Z_OK) throw new Error(y[l]);
|
|
1377
|
+
this.header = new _(), i.inflateGetHeader(this.strm, this.header);
|
|
1378
|
+
}
|
|
1379
|
+
function p(s, c) {
|
|
1380
|
+
var l = new a(c);
|
|
1381
|
+
if (l.push(s, !0), l.err) throw l.msg || y[l.err];
|
|
1382
|
+
return l.result;
|
|
1383
|
+
}
|
|
1384
|
+
a.prototype.push = function(s, c) {
|
|
1385
|
+
var l, m, k, z, C, U, T = this.strm, W = this.options.chunkSize, F = this.options.dictionary, H = !1;
|
|
1386
|
+
if (this.ended) return !1;
|
|
1387
|
+
m = c === ~~c ? c : c === !0 ? h.Z_FINISH : h.Z_NO_FLUSH, typeof s == "string" ? T.input = n.binstring2buf(s) : g.call(s) === "[object ArrayBuffer]" ? T.input = new Uint8Array(s) : T.input = s, T.next_in = 0, T.avail_in = T.input.length;
|
|
1388
|
+
do {
|
|
1389
|
+
if (T.avail_out === 0 && (T.output = new o.Buf8(W), T.next_out = 0, T.avail_out = W), (l = i.inflate(T, h.Z_NO_FLUSH)) === h.Z_NEED_DICT && F && (U = typeof F == "string" ? n.string2buf(F) : g.call(F) === "[object ArrayBuffer]" ? new Uint8Array(F) : F, l = i.inflateSetDictionary(this.strm, U)), l === h.Z_BUF_ERROR && H === !0 && (l = h.Z_OK, H = !1), l !== h.Z_STREAM_END && l !== h.Z_OK) return this.onEnd(l), !(this.ended = !0);
|
|
1390
|
+
T.next_out && (T.avail_out !== 0 && l !== h.Z_STREAM_END && (T.avail_in !== 0 || m !== h.Z_FINISH && m !== h.Z_SYNC_FLUSH) || (this.options.to === "string" ? (k = n.utf8border(T.output, T.next_out), z = T.next_out - k, C = n.buf2string(T.output, k), T.next_out = z, T.avail_out = W - z, z && o.arraySet(T.output, T.output, k, z, 0), this.onData(C)) : this.onData(o.shrinkBuf(T.output, T.next_out)))), T.avail_in === 0 && T.avail_out === 0 && (H = !0);
|
|
1391
|
+
} while ((0 < T.avail_in || T.avail_out === 0) && l !== h.Z_STREAM_END);
|
|
1392
|
+
return l === h.Z_STREAM_END && (m = h.Z_FINISH), m === h.Z_FINISH ? (l = i.inflateEnd(this.strm), this.onEnd(l), this.ended = !0, l === h.Z_OK) : m !== h.Z_SYNC_FLUSH || (this.onEnd(h.Z_OK), !(T.avail_out = 0));
|
|
1393
|
+
}, a.prototype.onData = function(s) {
|
|
1394
|
+
this.chunks.push(s);
|
|
1395
|
+
}, a.prototype.onEnd = function(s) {
|
|
1396
|
+
s === h.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = s, this.msg = this.strm.msg;
|
|
1397
|
+
}, f.Inflate = a, f.inflate = p, f.inflateRaw = function(s, c) {
|
|
1398
|
+
return (c = c || {}).raw = !0, p(s, c);
|
|
1399
|
+
}, f.ungzip = p;
|
|
1400
|
+
}, { "./utils/common": 41, "./utils/strings": 42, "./zlib/constants": 44, "./zlib/gzheader": 47, "./zlib/inflate": 49, "./zlib/messages": 51, "./zlib/zstream": 53 }], 41: [function(r, w, f) {
|
|
1401
|
+
var i = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u";
|
|
1402
|
+
f.assign = function(h) {
|
|
1403
|
+
for (var y = Array.prototype.slice.call(arguments, 1); y.length; ) {
|
|
1404
|
+
var v = y.shift();
|
|
1405
|
+
if (v) {
|
|
1406
|
+
if (typeof v != "object") throw new TypeError(v + "must be non-object");
|
|
1407
|
+
for (var _ in v) v.hasOwnProperty(_) && (h[_] = v[_]);
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
return h;
|
|
1411
|
+
}, f.shrinkBuf = function(h, y) {
|
|
1412
|
+
return h.length === y ? h : h.subarray ? h.subarray(0, y) : (h.length = y, h);
|
|
1413
|
+
};
|
|
1414
|
+
var o = { arraySet: function(h, y, v, _, g) {
|
|
1415
|
+
if (y.subarray && h.subarray) h.set(y.subarray(v, v + _), g);
|
|
1416
|
+
else for (var a = 0; a < _; a++) h[g + a] = y[v + a];
|
|
1417
|
+
}, flattenChunks: function(h) {
|
|
1418
|
+
var y, v, _, g, a, p;
|
|
1419
|
+
for (y = _ = 0, v = h.length; y < v; y++) _ += h[y].length;
|
|
1420
|
+
for (p = new Uint8Array(_), y = g = 0, v = h.length; y < v; y++) a = h[y], p.set(a, g), g += a.length;
|
|
1421
|
+
return p;
|
|
1422
|
+
} }, n = { arraySet: function(h, y, v, _, g) {
|
|
1423
|
+
for (var a = 0; a < _; a++) h[g + a] = y[v + a];
|
|
1424
|
+
}, flattenChunks: function(h) {
|
|
1425
|
+
return [].concat.apply([], h);
|
|
1426
|
+
} };
|
|
1427
|
+
f.setTyped = function(h) {
|
|
1428
|
+
h ? (f.Buf8 = Uint8Array, f.Buf16 = Uint16Array, f.Buf32 = Int32Array, f.assign(f, o)) : (f.Buf8 = Array, f.Buf16 = Array, f.Buf32 = Array, f.assign(f, n));
|
|
1429
|
+
}, f.setTyped(i);
|
|
1430
|
+
}, {}], 42: [function(r, w, f) {
|
|
1431
|
+
var i = r("./common"), o = !0, n = !0;
|
|
1432
|
+
try {
|
|
1433
|
+
String.fromCharCode.apply(null, [0]);
|
|
1434
|
+
} catch {
|
|
1435
|
+
o = !1;
|
|
1436
|
+
}
|
|
1437
|
+
try {
|
|
1438
|
+
String.fromCharCode.apply(null, new Uint8Array(1));
|
|
1439
|
+
} catch {
|
|
1440
|
+
n = !1;
|
|
1441
|
+
}
|
|
1442
|
+
for (var h = new i.Buf8(256), y = 0; y < 256; y++) h[y] = 252 <= y ? 6 : 248 <= y ? 5 : 240 <= y ? 4 : 224 <= y ? 3 : 192 <= y ? 2 : 1;
|
|
1443
|
+
function v(_, g) {
|
|
1444
|
+
if (g < 65537 && (_.subarray && n || !_.subarray && o)) return String.fromCharCode.apply(null, i.shrinkBuf(_, g));
|
|
1445
|
+
for (var a = "", p = 0; p < g; p++) a += String.fromCharCode(_[p]);
|
|
1446
|
+
return a;
|
|
1447
|
+
}
|
|
1448
|
+
h[254] = h[254] = 1, f.string2buf = function(_) {
|
|
1449
|
+
var g, a, p, s, c, l = _.length, m = 0;
|
|
1450
|
+
for (s = 0; s < l; s++) (64512 & (a = _.charCodeAt(s))) == 55296 && s + 1 < l && (64512 & (p = _.charCodeAt(s + 1))) == 56320 && (a = 65536 + (a - 55296 << 10) + (p - 56320), s++), m += a < 128 ? 1 : a < 2048 ? 2 : a < 65536 ? 3 : 4;
|
|
1451
|
+
for (g = new i.Buf8(m), s = c = 0; c < m; s++) (64512 & (a = _.charCodeAt(s))) == 55296 && s + 1 < l && (64512 & (p = _.charCodeAt(s + 1))) == 56320 && (a = 65536 + (a - 55296 << 10) + (p - 56320), s++), a < 128 ? g[c++] = a : (a < 2048 ? g[c++] = 192 | a >>> 6 : (a < 65536 ? g[c++] = 224 | a >>> 12 : (g[c++] = 240 | a >>> 18, g[c++] = 128 | a >>> 12 & 63), g[c++] = 128 | a >>> 6 & 63), g[c++] = 128 | 63 & a);
|
|
1452
|
+
return g;
|
|
1453
|
+
}, f.buf2binstring = function(_) {
|
|
1454
|
+
return v(_, _.length);
|
|
1455
|
+
}, f.binstring2buf = function(_) {
|
|
1456
|
+
for (var g = new i.Buf8(_.length), a = 0, p = g.length; a < p; a++) g[a] = _.charCodeAt(a);
|
|
1457
|
+
return g;
|
|
1458
|
+
}, f.buf2string = function(_, g) {
|
|
1459
|
+
var a, p, s, c, l = g || _.length, m = new Array(2 * l);
|
|
1460
|
+
for (a = p = 0; a < l; ) if ((s = _[a++]) < 128) m[p++] = s;
|
|
1461
|
+
else if (4 < (c = h[s])) m[p++] = 65533, a += c - 1;
|
|
1462
|
+
else {
|
|
1463
|
+
for (s &= c === 2 ? 31 : c === 3 ? 15 : 7; 1 < c && a < l; ) s = s << 6 | 63 & _[a++], c--;
|
|
1464
|
+
1 < c ? m[p++] = 65533 : s < 65536 ? m[p++] = s : (s -= 65536, m[p++] = 55296 | s >> 10 & 1023, m[p++] = 56320 | 1023 & s);
|
|
1465
|
+
}
|
|
1466
|
+
return v(m, p);
|
|
1467
|
+
}, f.utf8border = function(_, g) {
|
|
1468
|
+
var a;
|
|
1469
|
+
for ((g = g || _.length) > _.length && (g = _.length), a = g - 1; 0 <= a && (192 & _[a]) == 128; ) a--;
|
|
1470
|
+
return a < 0 || a === 0 ? g : a + h[_[a]] > g ? a : g;
|
|
1471
|
+
};
|
|
1472
|
+
}, { "./common": 41 }], 43: [function(r, w, f) {
|
|
1473
|
+
w.exports = function(i, o, n, h) {
|
|
1474
|
+
for (var y = 65535 & i | 0, v = i >>> 16 & 65535 | 0, _ = 0; n !== 0; ) {
|
|
1475
|
+
for (n -= _ = 2e3 < n ? 2e3 : n; v = v + (y = y + o[h++] | 0) | 0, --_; ) ;
|
|
1476
|
+
y %= 65521, v %= 65521;
|
|
1477
|
+
}
|
|
1478
|
+
return y | v << 16 | 0;
|
|
1479
|
+
};
|
|
1480
|
+
}, {}], 44: [function(r, w, f) {
|
|
1481
|
+
w.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 };
|
|
1482
|
+
}, {}], 45: [function(r, w, f) {
|
|
1483
|
+
var i = (function() {
|
|
1484
|
+
for (var o, n = [], h = 0; h < 256; h++) {
|
|
1485
|
+
o = h;
|
|
1486
|
+
for (var y = 0; y < 8; y++) o = 1 & o ? 3988292384 ^ o >>> 1 : o >>> 1;
|
|
1487
|
+
n[h] = o;
|
|
1488
|
+
}
|
|
1489
|
+
return n;
|
|
1490
|
+
})();
|
|
1491
|
+
w.exports = function(o, n, h, y) {
|
|
1492
|
+
var v = i, _ = y + h;
|
|
1493
|
+
o ^= -1;
|
|
1494
|
+
for (var g = y; g < _; g++) o = o >>> 8 ^ v[255 & (o ^ n[g])];
|
|
1495
|
+
return -1 ^ o;
|
|
1496
|
+
};
|
|
1497
|
+
}, {}], 46: [function(r, w, f) {
|
|
1498
|
+
var i, o = r("../utils/common"), n = r("./trees"), h = r("./adler32"), y = r("./crc32"), v = r("./messages"), _ = 0, g = 4, a = 0, p = -2, s = -1, c = 4, l = 2, m = 8, k = 9, z = 286, C = 30, U = 19, T = 2 * z + 1, W = 15, F = 3, H = 258, X = H + F + 1, b = 42, R = 113, e = 1, N = 2, Q = 3, L = 4;
|
|
1499
|
+
function tt(t, D) {
|
|
1500
|
+
return t.msg = v[D], D;
|
|
1501
|
+
}
|
|
1502
|
+
function Z(t) {
|
|
1503
|
+
return (t << 1) - (4 < t ? 9 : 0);
|
|
1504
|
+
}
|
|
1505
|
+
function q(t) {
|
|
1506
|
+
for (var D = t.length; 0 <= --D; ) t[D] = 0;
|
|
1507
|
+
}
|
|
1508
|
+
function O(t) {
|
|
1509
|
+
var D = t.state, B = D.pending;
|
|
1510
|
+
B > t.avail_out && (B = t.avail_out), B !== 0 && (o.arraySet(t.output, D.pending_buf, D.pending_out, B, t.next_out), t.next_out += B, D.pending_out += B, t.total_out += B, t.avail_out -= B, D.pending -= B, D.pending === 0 && (D.pending_out = 0));
|
|
1511
|
+
}
|
|
1512
|
+
function I(t, D) {
|
|
1513
|
+
n._tr_flush_block(t, 0 <= t.block_start ? t.block_start : -1, t.strstart - t.block_start, D), t.block_start = t.strstart, O(t.strm);
|
|
1514
|
+
}
|
|
1515
|
+
function V(t, D) {
|
|
1516
|
+
t.pending_buf[t.pending++] = D;
|
|
1517
|
+
}
|
|
1518
|
+
function K(t, D) {
|
|
1519
|
+
t.pending_buf[t.pending++] = D >>> 8 & 255, t.pending_buf[t.pending++] = 255 & D;
|
|
1520
|
+
}
|
|
1521
|
+
function G(t, D) {
|
|
1522
|
+
var B, d, u = t.max_chain_length, x = t.strstart, P = t.prev_length, j = t.nice_match, A = t.strstart > t.w_size - X ? t.strstart - (t.w_size - X) : 0, M = t.window, J = t.w_mask, $ = t.prev, Y = t.strstart + H, it = M[x + P - 1], rt = M[x + P];
|
|
1523
|
+
t.prev_length >= t.good_match && (u >>= 2), j > t.lookahead && (j = t.lookahead);
|
|
1524
|
+
do
|
|
1525
|
+
if (M[(B = D) + P] === rt && M[B + P - 1] === it && M[B] === M[x] && M[++B] === M[x + 1]) {
|
|
1526
|
+
x += 2, B++;
|
|
1527
|
+
do
|
|
1528
|
+
;
|
|
1529
|
+
while (M[++x] === M[++B] && M[++x] === M[++B] && M[++x] === M[++B] && M[++x] === M[++B] && M[++x] === M[++B] && M[++x] === M[++B] && M[++x] === M[++B] && M[++x] === M[++B] && x < Y);
|
|
1530
|
+
if (d = H - (Y - x), x = Y - H, P < d) {
|
|
1531
|
+
if (t.match_start = D, j <= (P = d)) break;
|
|
1532
|
+
it = M[x + P - 1], rt = M[x + P];
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
while ((D = $[D & J]) > A && --u != 0);
|
|
1536
|
+
return P <= t.lookahead ? P : t.lookahead;
|
|
1537
|
+
}
|
|
1538
|
+
function st(t) {
|
|
1539
|
+
var D, B, d, u, x, P, j, A, M, J, $ = t.w_size;
|
|
1540
|
+
do {
|
|
1541
|
+
if (u = t.window_size - t.lookahead - t.strstart, t.strstart >= $ + ($ - X)) {
|
|
1542
|
+
for (o.arraySet(t.window, t.window, $, $, 0), t.match_start -= $, t.strstart -= $, t.block_start -= $, D = B = t.hash_size; d = t.head[--D], t.head[D] = $ <= d ? d - $ : 0, --B; ) ;
|
|
1543
|
+
for (D = B = $; d = t.prev[--D], t.prev[D] = $ <= d ? d - $ : 0, --B; ) ;
|
|
1544
|
+
u += $;
|
|
1545
|
+
}
|
|
1546
|
+
if (t.strm.avail_in === 0) break;
|
|
1547
|
+
if (P = t.strm, j = t.window, A = t.strstart + t.lookahead, M = u, J = void 0, J = P.avail_in, M < J && (J = M), B = J === 0 ? 0 : (P.avail_in -= J, o.arraySet(j, P.input, P.next_in, J, A), P.state.wrap === 1 ? P.adler = h(P.adler, j, J, A) : P.state.wrap === 2 && (P.adler = y(P.adler, j, J, A)), P.next_in += J, P.total_in += J, J), t.lookahead += B, t.lookahead + t.insert >= F) for (x = t.strstart - t.insert, t.ins_h = t.window[x], t.ins_h = (t.ins_h << t.hash_shift ^ t.window[x + 1]) & t.hash_mask; t.insert && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[x + F - 1]) & t.hash_mask, t.prev[x & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = x, x++, t.insert--, !(t.lookahead + t.insert < F)); ) ;
|
|
1548
|
+
} while (t.lookahead < X && t.strm.avail_in !== 0);
|
|
1549
|
+
}
|
|
1550
|
+
function ut(t, D) {
|
|
1551
|
+
for (var B, d; ; ) {
|
|
1552
|
+
if (t.lookahead < X) {
|
|
1553
|
+
if (st(t), t.lookahead < X && D === _) return e;
|
|
1554
|
+
if (t.lookahead === 0) break;
|
|
1555
|
+
}
|
|
1556
|
+
if (B = 0, t.lookahead >= F && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + F - 1]) & t.hash_mask, B = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), B !== 0 && t.strstart - B <= t.w_size - X && (t.match_length = G(t, B)), t.match_length >= F) if (d = n._tr_tally(t, t.strstart - t.match_start, t.match_length - F), t.lookahead -= t.match_length, t.match_length <= t.max_lazy_match && t.lookahead >= F) {
|
|
1557
|
+
for (t.match_length--; t.strstart++, t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + F - 1]) & t.hash_mask, B = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart, --t.match_length != 0; ) ;
|
|
1558
|
+
t.strstart++;
|
|
1559
|
+
} 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;
|
|
1560
|
+
else d = n._tr_tally(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++;
|
|
1561
|
+
if (d && (I(t, !1), t.strm.avail_out === 0)) return e;
|
|
1562
|
+
}
|
|
1563
|
+
return t.insert = t.strstart < F - 1 ? t.strstart : F - 1, D === g ? (I(t, !0), t.strm.avail_out === 0 ? Q : L) : t.last_lit && (I(t, !1), t.strm.avail_out === 0) ? e : N;
|
|
1564
|
+
}
|
|
1565
|
+
function et(t, D) {
|
|
1566
|
+
for (var B, d, u; ; ) {
|
|
1567
|
+
if (t.lookahead < X) {
|
|
1568
|
+
if (st(t), t.lookahead < X && D === _) return e;
|
|
1569
|
+
if (t.lookahead === 0) break;
|
|
1570
|
+
}
|
|
1571
|
+
if (B = 0, t.lookahead >= F && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + F - 1]) & t.hash_mask, B = 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 = F - 1, B !== 0 && t.prev_length < t.max_lazy_match && t.strstart - B <= t.w_size - X && (t.match_length = G(t, B), t.match_length <= 5 && (t.strategy === 1 || t.match_length === F && 4096 < t.strstart - t.match_start) && (t.match_length = F - 1)), t.prev_length >= F && t.match_length <= t.prev_length) {
|
|
1572
|
+
for (u = t.strstart + t.lookahead - F, d = n._tr_tally(t, t.strstart - 1 - t.prev_match, t.prev_length - F), t.lookahead -= t.prev_length - 1, t.prev_length -= 2; ++t.strstart <= u && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + F - 1]) & t.hash_mask, B = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), --t.prev_length != 0; ) ;
|
|
1573
|
+
if (t.match_available = 0, t.match_length = F - 1, t.strstart++, d && (I(t, !1), t.strm.avail_out === 0)) return e;
|
|
1574
|
+
} else if (t.match_available) {
|
|
1575
|
+
if ((d = n._tr_tally(t, 0, t.window[t.strstart - 1])) && I(t, !1), t.strstart++, t.lookahead--, t.strm.avail_out === 0) return e;
|
|
1576
|
+
} else t.match_available = 1, t.strstart++, t.lookahead--;
|
|
1577
|
+
}
|
|
1578
|
+
return t.match_available && (d = n._tr_tally(t, 0, t.window[t.strstart - 1]), t.match_available = 0), t.insert = t.strstart < F - 1 ? t.strstart : F - 1, D === g ? (I(t, !0), t.strm.avail_out === 0 ? Q : L) : t.last_lit && (I(t, !1), t.strm.avail_out === 0) ? e : N;
|
|
1579
|
+
}
|
|
1580
|
+
function nt(t, D, B, d, u) {
|
|
1581
|
+
this.good_length = t, this.max_lazy = D, this.nice_length = B, this.max_chain = d, this.func = u;
|
|
1582
|
+
}
|
|
1583
|
+
function lt() {
|
|
1584
|
+
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 = m, 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 * T), this.dyn_dtree = new o.Buf16(2 * (2 * C + 1)), this.bl_tree = new o.Buf16(2 * (2 * U + 1)), q(this.dyn_ltree), q(this.dyn_dtree), q(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new o.Buf16(W + 1), this.heap = new o.Buf16(2 * z + 1), q(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new o.Buf16(2 * z + 1), q(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;
|
|
1585
|
+
}
|
|
1586
|
+
function at(t) {
|
|
1587
|
+
var D;
|
|
1588
|
+
return t && t.state ? (t.total_in = t.total_out = 0, t.data_type = l, (D = t.state).pending = 0, D.pending_out = 0, D.wrap < 0 && (D.wrap = -D.wrap), D.status = D.wrap ? b : R, t.adler = D.wrap === 2 ? 0 : 1, D.last_flush = _, n._tr_init(D), a) : tt(t, p);
|
|
1589
|
+
}
|
|
1590
|
+
function ct(t) {
|
|
1591
|
+
var D = at(t);
|
|
1592
|
+
return D === a && (function(B) {
|
|
1593
|
+
B.window_size = 2 * B.w_size, q(B.head), B.max_lazy_match = i[B.level].max_lazy, B.good_match = i[B.level].good_length, B.nice_match = i[B.level].nice_length, B.max_chain_length = i[B.level].max_chain, B.strstart = 0, B.block_start = 0, B.lookahead = 0, B.insert = 0, B.match_length = B.prev_length = F - 1, B.match_available = 0, B.ins_h = 0;
|
|
1594
|
+
})(t.state), D;
|
|
1595
|
+
}
|
|
1596
|
+
function ft(t, D, B, d, u, x) {
|
|
1597
|
+
if (!t) return p;
|
|
1598
|
+
var P = 1;
|
|
1599
|
+
if (D === s && (D = 6), d < 0 ? (P = 0, d = -d) : 15 < d && (P = 2, d -= 16), u < 1 || k < u || B !== m || d < 8 || 15 < d || D < 0 || 9 < D || x < 0 || c < x) return tt(t, p);
|
|
1600
|
+
d === 8 && (d = 9);
|
|
1601
|
+
var j = new lt();
|
|
1602
|
+
return (t.state = j).strm = t, j.wrap = P, j.gzhead = null, j.w_bits = d, j.w_size = 1 << j.w_bits, j.w_mask = j.w_size - 1, j.hash_bits = u + 7, j.hash_size = 1 << j.hash_bits, j.hash_mask = j.hash_size - 1, j.hash_shift = ~~((j.hash_bits + F - 1) / F), j.window = new o.Buf8(2 * j.w_size), j.head = new o.Buf16(j.hash_size), j.prev = new o.Buf16(j.w_size), j.lit_bufsize = 1 << u + 6, j.pending_buf_size = 4 * j.lit_bufsize, j.pending_buf = new o.Buf8(j.pending_buf_size), j.d_buf = 1 * j.lit_bufsize, j.l_buf = 3 * j.lit_bufsize, j.level = D, j.strategy = x, j.method = B, ct(t);
|
|
1603
|
+
}
|
|
1604
|
+
i = [new nt(0, 0, 0, 0, function(t, D) {
|
|
1605
|
+
var B = 65535;
|
|
1606
|
+
for (B > t.pending_buf_size - 5 && (B = t.pending_buf_size - 5); ; ) {
|
|
1607
|
+
if (t.lookahead <= 1) {
|
|
1608
|
+
if (st(t), t.lookahead === 0 && D === _) return e;
|
|
1609
|
+
if (t.lookahead === 0) break;
|
|
1610
|
+
}
|
|
1611
|
+
t.strstart += t.lookahead, t.lookahead = 0;
|
|
1612
|
+
var d = t.block_start + B;
|
|
1613
|
+
if ((t.strstart === 0 || t.strstart >= d) && (t.lookahead = t.strstart - d, t.strstart = d, I(t, !1), t.strm.avail_out === 0) || t.strstart - t.block_start >= t.w_size - X && (I(t, !1), t.strm.avail_out === 0)) return e;
|
|
1614
|
+
}
|
|
1615
|
+
return t.insert = 0, D === g ? (I(t, !0), t.strm.avail_out === 0 ? Q : L) : (t.strstart > t.block_start && (I(t, !1), t.strm.avail_out), e);
|
|
1616
|
+
}), new nt(4, 4, 8, 4, ut), new nt(4, 5, 16, 8, ut), new nt(4, 6, 32, 32, ut), new nt(4, 4, 16, 16, et), new nt(8, 16, 32, 32, et), new nt(8, 16, 128, 128, et), new nt(8, 32, 128, 256, et), new nt(32, 128, 258, 1024, et), new nt(32, 258, 258, 4096, et)], f.deflateInit = function(t, D) {
|
|
1617
|
+
return ft(t, D, m, 15, 8, 0);
|
|
1618
|
+
}, f.deflateInit2 = ft, f.deflateReset = ct, f.deflateResetKeep = at, f.deflateSetHeader = function(t, D) {
|
|
1619
|
+
return t && t.state ? t.state.wrap !== 2 ? p : (t.state.gzhead = D, a) : p;
|
|
1620
|
+
}, f.deflate = function(t, D) {
|
|
1621
|
+
var B, d, u, x;
|
|
1622
|
+
if (!t || !t.state || 5 < D || D < 0) return t ? tt(t, p) : p;
|
|
1623
|
+
if (d = t.state, !t.output || !t.input && t.avail_in !== 0 || d.status === 666 && D !== g) return tt(t, t.avail_out === 0 ? -5 : p);
|
|
1624
|
+
if (d.strm = t, B = d.last_flush, d.last_flush = D, d.status === b) if (d.wrap === 2) t.adler = 0, V(d, 31), V(d, 139), V(d, 8), d.gzhead ? (V(d, (d.gzhead.text ? 1 : 0) + (d.gzhead.hcrc ? 2 : 0) + (d.gzhead.extra ? 4 : 0) + (d.gzhead.name ? 8 : 0) + (d.gzhead.comment ? 16 : 0)), V(d, 255 & d.gzhead.time), V(d, d.gzhead.time >> 8 & 255), V(d, d.gzhead.time >> 16 & 255), V(d, d.gzhead.time >> 24 & 255), V(d, d.level === 9 ? 2 : 2 <= d.strategy || d.level < 2 ? 4 : 0), V(d, 255 & d.gzhead.os), d.gzhead.extra && d.gzhead.extra.length && (V(d, 255 & d.gzhead.extra.length), V(d, d.gzhead.extra.length >> 8 & 255)), d.gzhead.hcrc && (t.adler = y(t.adler, d.pending_buf, d.pending, 0)), d.gzindex = 0, d.status = 69) : (V(d, 0), V(d, 0), V(d, 0), V(d, 0), V(d, 0), V(d, d.level === 9 ? 2 : 2 <= d.strategy || d.level < 2 ? 4 : 0), V(d, 3), d.status = R);
|
|
1625
|
+
else {
|
|
1626
|
+
var P = m + (d.w_bits - 8 << 4) << 8;
|
|
1627
|
+
P |= (2 <= d.strategy || d.level < 2 ? 0 : d.level < 6 ? 1 : d.level === 6 ? 2 : 3) << 6, d.strstart !== 0 && (P |= 32), P += 31 - P % 31, d.status = R, K(d, P), d.strstart !== 0 && (K(d, t.adler >>> 16), K(d, 65535 & t.adler)), t.adler = 1;
|
|
1628
|
+
}
|
|
1629
|
+
if (d.status === 69) if (d.gzhead.extra) {
|
|
1630
|
+
for (u = d.pending; d.gzindex < (65535 & d.gzhead.extra.length) && (d.pending !== d.pending_buf_size || (d.gzhead.hcrc && d.pending > u && (t.adler = y(t.adler, d.pending_buf, d.pending - u, u)), O(t), u = d.pending, d.pending !== d.pending_buf_size)); ) V(d, 255 & d.gzhead.extra[d.gzindex]), d.gzindex++;
|
|
1631
|
+
d.gzhead.hcrc && d.pending > u && (t.adler = y(t.adler, d.pending_buf, d.pending - u, u)), d.gzindex === d.gzhead.extra.length && (d.gzindex = 0, d.status = 73);
|
|
1632
|
+
} else d.status = 73;
|
|
1633
|
+
if (d.status === 73) if (d.gzhead.name) {
|
|
1634
|
+
u = d.pending;
|
|
1635
|
+
do {
|
|
1636
|
+
if (d.pending === d.pending_buf_size && (d.gzhead.hcrc && d.pending > u && (t.adler = y(t.adler, d.pending_buf, d.pending - u, u)), O(t), u = d.pending, d.pending === d.pending_buf_size)) {
|
|
1637
|
+
x = 1;
|
|
1638
|
+
break;
|
|
1639
|
+
}
|
|
1640
|
+
x = d.gzindex < d.gzhead.name.length ? 255 & d.gzhead.name.charCodeAt(d.gzindex++) : 0, V(d, x);
|
|
1641
|
+
} while (x !== 0);
|
|
1642
|
+
d.gzhead.hcrc && d.pending > u && (t.adler = y(t.adler, d.pending_buf, d.pending - u, u)), x === 0 && (d.gzindex = 0, d.status = 91);
|
|
1643
|
+
} else d.status = 91;
|
|
1644
|
+
if (d.status === 91) if (d.gzhead.comment) {
|
|
1645
|
+
u = d.pending;
|
|
1646
|
+
do {
|
|
1647
|
+
if (d.pending === d.pending_buf_size && (d.gzhead.hcrc && d.pending > u && (t.adler = y(t.adler, d.pending_buf, d.pending - u, u)), O(t), u = d.pending, d.pending === d.pending_buf_size)) {
|
|
1648
|
+
x = 1;
|
|
1649
|
+
break;
|
|
1650
|
+
}
|
|
1651
|
+
x = d.gzindex < d.gzhead.comment.length ? 255 & d.gzhead.comment.charCodeAt(d.gzindex++) : 0, V(d, x);
|
|
1652
|
+
} while (x !== 0);
|
|
1653
|
+
d.gzhead.hcrc && d.pending > u && (t.adler = y(t.adler, d.pending_buf, d.pending - u, u)), x === 0 && (d.status = 103);
|
|
1654
|
+
} else d.status = 103;
|
|
1655
|
+
if (d.status === 103 && (d.gzhead.hcrc ? (d.pending + 2 > d.pending_buf_size && O(t), d.pending + 2 <= d.pending_buf_size && (V(d, 255 & t.adler), V(d, t.adler >> 8 & 255), t.adler = 0, d.status = R)) : d.status = R), d.pending !== 0) {
|
|
1656
|
+
if (O(t), t.avail_out === 0) return d.last_flush = -1, a;
|
|
1657
|
+
} else if (t.avail_in === 0 && Z(D) <= Z(B) && D !== g) return tt(t, -5);
|
|
1658
|
+
if (d.status === 666 && t.avail_in !== 0) return tt(t, -5);
|
|
1659
|
+
if (t.avail_in !== 0 || d.lookahead !== 0 || D !== _ && d.status !== 666) {
|
|
1660
|
+
var j = d.strategy === 2 ? (function(A, M) {
|
|
1661
|
+
for (var J; ; ) {
|
|
1662
|
+
if (A.lookahead === 0 && (st(A), A.lookahead === 0)) {
|
|
1663
|
+
if (M === _) return e;
|
|
1664
|
+
break;
|
|
1665
|
+
}
|
|
1666
|
+
if (A.match_length = 0, J = n._tr_tally(A, 0, A.window[A.strstart]), A.lookahead--, A.strstart++, J && (I(A, !1), A.strm.avail_out === 0)) return e;
|
|
1667
|
+
}
|
|
1668
|
+
return A.insert = 0, M === g ? (I(A, !0), A.strm.avail_out === 0 ? Q : L) : A.last_lit && (I(A, !1), A.strm.avail_out === 0) ? e : N;
|
|
1669
|
+
})(d, D) : d.strategy === 3 ? (function(A, M) {
|
|
1670
|
+
for (var J, $, Y, it, rt = A.window; ; ) {
|
|
1671
|
+
if (A.lookahead <= H) {
|
|
1672
|
+
if (st(A), A.lookahead <= H && M === _) return e;
|
|
1673
|
+
if (A.lookahead === 0) break;
|
|
1674
|
+
}
|
|
1675
|
+
if (A.match_length = 0, A.lookahead >= F && 0 < A.strstart && ($ = rt[Y = A.strstart - 1]) === rt[++Y] && $ === rt[++Y] && $ === rt[++Y]) {
|
|
1676
|
+
it = A.strstart + H;
|
|
1677
|
+
do
|
|
1678
|
+
;
|
|
1679
|
+
while ($ === rt[++Y] && $ === rt[++Y] && $ === rt[++Y] && $ === rt[++Y] && $ === rt[++Y] && $ === rt[++Y] && $ === rt[++Y] && $ === rt[++Y] && Y < it);
|
|
1680
|
+
A.match_length = H - (it - Y), A.match_length > A.lookahead && (A.match_length = A.lookahead);
|
|
1681
|
+
}
|
|
1682
|
+
if (A.match_length >= F ? (J = n._tr_tally(A, 1, A.match_length - F), A.lookahead -= A.match_length, A.strstart += A.match_length, A.match_length = 0) : (J = n._tr_tally(A, 0, A.window[A.strstart]), A.lookahead--, A.strstart++), J && (I(A, !1), A.strm.avail_out === 0)) return e;
|
|
1683
|
+
}
|
|
1684
|
+
return A.insert = 0, M === g ? (I(A, !0), A.strm.avail_out === 0 ? Q : L) : A.last_lit && (I(A, !1), A.strm.avail_out === 0) ? e : N;
|
|
1685
|
+
})(d, D) : i[d.level].func(d, D);
|
|
1686
|
+
if (j !== Q && j !== L || (d.status = 666), j === e || j === Q) return t.avail_out === 0 && (d.last_flush = -1), a;
|
|
1687
|
+
if (j === N && (D === 1 ? n._tr_align(d) : D !== 5 && (n._tr_stored_block(d, 0, 0, !1), D === 3 && (q(d.head), d.lookahead === 0 && (d.strstart = 0, d.block_start = 0, d.insert = 0))), O(t), t.avail_out === 0)) return d.last_flush = -1, a;
|
|
1688
|
+
}
|
|
1689
|
+
return D !== g ? a : d.wrap <= 0 ? 1 : (d.wrap === 2 ? (V(d, 255 & t.adler), V(d, t.adler >> 8 & 255), V(d, t.adler >> 16 & 255), V(d, t.adler >> 24 & 255), V(d, 255 & t.total_in), V(d, t.total_in >> 8 & 255), V(d, t.total_in >> 16 & 255), V(d, t.total_in >> 24 & 255)) : (K(d, t.adler >>> 16), K(d, 65535 & t.adler)), O(t), 0 < d.wrap && (d.wrap = -d.wrap), d.pending !== 0 ? a : 1);
|
|
1690
|
+
}, f.deflateEnd = function(t) {
|
|
1691
|
+
var D;
|
|
1692
|
+
return t && t.state ? (D = t.state.status) !== b && D !== 69 && D !== 73 && D !== 91 && D !== 103 && D !== R && D !== 666 ? tt(t, p) : (t.state = null, D === R ? tt(t, -3) : a) : p;
|
|
1693
|
+
}, f.deflateSetDictionary = function(t, D) {
|
|
1694
|
+
var B, d, u, x, P, j, A, M, J = D.length;
|
|
1695
|
+
if (!t || !t.state || (x = (B = t.state).wrap) === 2 || x === 1 && B.status !== b || B.lookahead) return p;
|
|
1696
|
+
for (x === 1 && (t.adler = h(t.adler, D, J, 0)), B.wrap = 0, J >= B.w_size && (x === 0 && (q(B.head), B.strstart = 0, B.block_start = 0, B.insert = 0), M = new o.Buf8(B.w_size), o.arraySet(M, D, J - B.w_size, B.w_size, 0), D = M, J = B.w_size), P = t.avail_in, j = t.next_in, A = t.input, t.avail_in = J, t.next_in = 0, t.input = D, st(B); B.lookahead >= F; ) {
|
|
1697
|
+
for (d = B.strstart, u = B.lookahead - (F - 1); B.ins_h = (B.ins_h << B.hash_shift ^ B.window[d + F - 1]) & B.hash_mask, B.prev[d & B.w_mask] = B.head[B.ins_h], B.head[B.ins_h] = d, d++, --u; ) ;
|
|
1698
|
+
B.strstart = d, B.lookahead = F - 1, st(B);
|
|
1699
|
+
}
|
|
1700
|
+
return B.strstart += B.lookahead, B.block_start = B.strstart, B.insert = B.lookahead, B.lookahead = 0, B.match_length = B.prev_length = F - 1, B.match_available = 0, t.next_in = j, t.input = A, t.avail_in = P, B.wrap = x, a;
|
|
1701
|
+
}, f.deflateInfo = "pako deflate (from Nodeca project)";
|
|
1702
|
+
}, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./messages": 51, "./trees": 52 }], 47: [function(r, w, f) {
|
|
1703
|
+
w.exports = function() {
|
|
1704
|
+
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;
|
|
1705
|
+
};
|
|
1706
|
+
}, {}], 48: [function(r, w, f) {
|
|
1707
|
+
w.exports = function(i, o) {
|
|
1708
|
+
var n, h, y, v, _, g, a, p, s, c, l, m, k, z, C, U, T, W, F, H, X, b, R, e, N;
|
|
1709
|
+
n = i.state, h = i.next_in, e = i.input, y = h + (i.avail_in - 5), v = i.next_out, N = i.output, _ = v - (o - i.avail_out), g = v + (i.avail_out - 257), a = n.dmax, p = n.wsize, s = n.whave, c = n.wnext, l = n.window, m = n.hold, k = n.bits, z = n.lencode, C = n.distcode, U = (1 << n.lenbits) - 1, T = (1 << n.distbits) - 1;
|
|
1710
|
+
t: do {
|
|
1711
|
+
k < 15 && (m += e[h++] << k, k += 8, m += e[h++] << k, k += 8), W = z[m & U];
|
|
1712
|
+
e: for (; ; ) {
|
|
1713
|
+
if (m >>>= F = W >>> 24, k -= F, (F = W >>> 16 & 255) === 0) N[v++] = 65535 & W;
|
|
1714
|
+
else {
|
|
1715
|
+
if (!(16 & F)) {
|
|
1716
|
+
if ((64 & F) == 0) {
|
|
1717
|
+
W = z[(65535 & W) + (m & (1 << F) - 1)];
|
|
1718
|
+
continue e;
|
|
1719
|
+
}
|
|
1720
|
+
if (32 & F) {
|
|
1721
|
+
n.mode = 12;
|
|
1722
|
+
break t;
|
|
1723
|
+
}
|
|
1724
|
+
i.msg = "invalid literal/length code", n.mode = 30;
|
|
1725
|
+
break t;
|
|
1726
|
+
}
|
|
1727
|
+
H = 65535 & W, (F &= 15) && (k < F && (m += e[h++] << k, k += 8), H += m & (1 << F) - 1, m >>>= F, k -= F), k < 15 && (m += e[h++] << k, k += 8, m += e[h++] << k, k += 8), W = C[m & T];
|
|
1728
|
+
r: for (; ; ) {
|
|
1729
|
+
if (m >>>= F = W >>> 24, k -= F, !(16 & (F = W >>> 16 & 255))) {
|
|
1730
|
+
if ((64 & F) == 0) {
|
|
1731
|
+
W = C[(65535 & W) + (m & (1 << F) - 1)];
|
|
1732
|
+
continue r;
|
|
1733
|
+
}
|
|
1734
|
+
i.msg = "invalid distance code", n.mode = 30;
|
|
1735
|
+
break t;
|
|
1736
|
+
}
|
|
1737
|
+
if (X = 65535 & W, k < (F &= 15) && (m += e[h++] << k, (k += 8) < F && (m += e[h++] << k, k += 8)), a < (X += m & (1 << F) - 1)) {
|
|
1738
|
+
i.msg = "invalid distance too far back", n.mode = 30;
|
|
1739
|
+
break t;
|
|
1740
|
+
}
|
|
1741
|
+
if (m >>>= F, k -= F, (F = v - _) < X) {
|
|
1742
|
+
if (s < (F = X - F) && n.sane) {
|
|
1743
|
+
i.msg = "invalid distance too far back", n.mode = 30;
|
|
1744
|
+
break t;
|
|
1745
|
+
}
|
|
1746
|
+
if (R = l, (b = 0) === c) {
|
|
1747
|
+
if (b += p - F, F < H) {
|
|
1748
|
+
for (H -= F; N[v++] = l[b++], --F; ) ;
|
|
1749
|
+
b = v - X, R = N;
|
|
1750
|
+
}
|
|
1751
|
+
} else if (c < F) {
|
|
1752
|
+
if (b += p + c - F, (F -= c) < H) {
|
|
1753
|
+
for (H -= F; N[v++] = l[b++], --F; ) ;
|
|
1754
|
+
if (b = 0, c < H) {
|
|
1755
|
+
for (H -= F = c; N[v++] = l[b++], --F; ) ;
|
|
1756
|
+
b = v - X, R = N;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
} else if (b += c - F, F < H) {
|
|
1760
|
+
for (H -= F; N[v++] = l[b++], --F; ) ;
|
|
1761
|
+
b = v - X, R = N;
|
|
1762
|
+
}
|
|
1763
|
+
for (; 2 < H; ) N[v++] = R[b++], N[v++] = R[b++], N[v++] = R[b++], H -= 3;
|
|
1764
|
+
H && (N[v++] = R[b++], 1 < H && (N[v++] = R[b++]));
|
|
1765
|
+
} else {
|
|
1766
|
+
for (b = v - X; N[v++] = N[b++], N[v++] = N[b++], N[v++] = N[b++], 2 < (H -= 3); ) ;
|
|
1767
|
+
H && (N[v++] = N[b++], 1 < H && (N[v++] = N[b++]));
|
|
1768
|
+
}
|
|
1769
|
+
break;
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
break;
|
|
1773
|
+
}
|
|
1774
|
+
} while (h < y && v < g);
|
|
1775
|
+
h -= H = k >> 3, m &= (1 << (k -= H << 3)) - 1, i.next_in = h, i.next_out = v, i.avail_in = h < y ? y - h + 5 : 5 - (h - y), i.avail_out = v < g ? g - v + 257 : 257 - (v - g), n.hold = m, n.bits = k;
|
|
1776
|
+
};
|
|
1777
|
+
}, {}], 49: [function(r, w, f) {
|
|
1778
|
+
var i = r("../utils/common"), o = r("./adler32"), n = r("./crc32"), h = r("./inffast"), y = r("./inftrees"), v = 1, _ = 2, g = 0, a = -2, p = 1, s = 852, c = 592;
|
|
1779
|
+
function l(b) {
|
|
1780
|
+
return (b >>> 24 & 255) + (b >>> 8 & 65280) + ((65280 & b) << 8) + ((255 & b) << 24);
|
|
1781
|
+
}
|
|
1782
|
+
function m() {
|
|
1783
|
+
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 i.Buf16(320), this.work = new i.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
|
|
1784
|
+
}
|
|
1785
|
+
function k(b) {
|
|
1786
|
+
var R;
|
|
1787
|
+
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 = p, R.last = 0, R.havedict = 0, R.dmax = 32768, R.head = null, R.hold = 0, R.bits = 0, R.lencode = R.lendyn = new i.Buf32(s), R.distcode = R.distdyn = new i.Buf32(c), R.sane = 1, R.back = -1, g) : a;
|
|
1788
|
+
}
|
|
1789
|
+
function z(b) {
|
|
1790
|
+
var R;
|
|
1791
|
+
return b && b.state ? ((R = b.state).wsize = 0, R.whave = 0, R.wnext = 0, k(b)) : a;
|
|
1792
|
+
}
|
|
1793
|
+
function C(b, R) {
|
|
1794
|
+
var e, N;
|
|
1795
|
+
return b && b.state ? (N = b.state, R < 0 ? (e = 0, R = -R) : (e = 1 + (R >> 4), R < 48 && (R &= 15)), R && (R < 8 || 15 < R) ? a : (N.window !== null && N.wbits !== R && (N.window = null), N.wrap = e, N.wbits = R, z(b))) : a;
|
|
1796
|
+
}
|
|
1797
|
+
function U(b, R) {
|
|
1798
|
+
var e, N;
|
|
1799
|
+
return b ? (N = new m(), (b.state = N).window = null, (e = C(b, R)) !== g && (b.state = null), e) : a;
|
|
1800
|
+
}
|
|
1801
|
+
var T, W, F = !0;
|
|
1802
|
+
function H(b) {
|
|
1803
|
+
if (F) {
|
|
1804
|
+
var R;
|
|
1805
|
+
for (T = new i.Buf32(512), W = new i.Buf32(32), R = 0; R < 144; ) b.lens[R++] = 8;
|
|
1806
|
+
for (; R < 256; ) b.lens[R++] = 9;
|
|
1807
|
+
for (; R < 280; ) b.lens[R++] = 7;
|
|
1808
|
+
for (; R < 288; ) b.lens[R++] = 8;
|
|
1809
|
+
for (y(v, b.lens, 0, 288, T, 0, b.work, { bits: 9 }), R = 0; R < 32; ) b.lens[R++] = 5;
|
|
1810
|
+
y(_, b.lens, 0, 32, W, 0, b.work, { bits: 5 }), F = !1;
|
|
1811
|
+
}
|
|
1812
|
+
b.lencode = T, b.lenbits = 9, b.distcode = W, b.distbits = 5;
|
|
1813
|
+
}
|
|
1814
|
+
function X(b, R, e, N) {
|
|
1815
|
+
var Q, L = b.state;
|
|
1816
|
+
return L.window === null && (L.wsize = 1 << L.wbits, L.wnext = 0, L.whave = 0, L.window = new i.Buf8(L.wsize)), N >= L.wsize ? (i.arraySet(L.window, R, e - L.wsize, L.wsize, 0), L.wnext = 0, L.whave = L.wsize) : (N < (Q = L.wsize - L.wnext) && (Q = N), i.arraySet(L.window, R, e - N, Q, L.wnext), (N -= Q) ? (i.arraySet(L.window, R, e - N, N, 0), L.wnext = N, L.whave = L.wsize) : (L.wnext += Q, L.wnext === L.wsize && (L.wnext = 0), L.whave < L.wsize && (L.whave += Q))), 0;
|
|
1817
|
+
}
|
|
1818
|
+
f.inflateReset = z, f.inflateReset2 = C, f.inflateResetKeep = k, f.inflateInit = function(b) {
|
|
1819
|
+
return U(b, 15);
|
|
1820
|
+
}, f.inflateInit2 = U, f.inflate = function(b, R) {
|
|
1821
|
+
var e, N, Q, L, tt, Z, q, O, I, V, K, G, st, ut, et, nt, lt, at, ct, ft, t, D, B, d, u = 0, x = new i.Buf8(4), P = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
|
|
1822
|
+
if (!b || !b.state || !b.output || !b.input && b.avail_in !== 0) return a;
|
|
1823
|
+
(e = b.state).mode === 12 && (e.mode = 13), tt = b.next_out, Q = b.output, q = b.avail_out, L = b.next_in, N = b.input, Z = b.avail_in, O = e.hold, I = e.bits, V = Z, K = q, D = g;
|
|
1824
|
+
t: for (; ; ) switch (e.mode) {
|
|
1825
|
+
case p:
|
|
1826
|
+
if (e.wrap === 0) {
|
|
1827
|
+
e.mode = 13;
|
|
1828
|
+
break;
|
|
1829
|
+
}
|
|
1830
|
+
for (; I < 16; ) {
|
|
1831
|
+
if (Z === 0) break t;
|
|
1832
|
+
Z--, O += N[L++] << I, I += 8;
|
|
1833
|
+
}
|
|
1834
|
+
if (2 & e.wrap && O === 35615) {
|
|
1835
|
+
x[e.check = 0] = 255 & O, x[1] = O >>> 8 & 255, e.check = n(e.check, x, 2, 0), I = O = 0, e.mode = 2;
|
|
1836
|
+
break;
|
|
1837
|
+
}
|
|
1838
|
+
if (e.flags = 0, e.head && (e.head.done = !1), !(1 & e.wrap) || (((255 & O) << 8) + (O >> 8)) % 31) {
|
|
1839
|
+
b.msg = "incorrect header check", e.mode = 30;
|
|
1840
|
+
break;
|
|
1841
|
+
}
|
|
1842
|
+
if ((15 & O) != 8) {
|
|
1843
|
+
b.msg = "unknown compression method", e.mode = 30;
|
|
1844
|
+
break;
|
|
1845
|
+
}
|
|
1846
|
+
if (I -= 4, t = 8 + (15 & (O >>>= 4)), e.wbits === 0) e.wbits = t;
|
|
1847
|
+
else if (t > e.wbits) {
|
|
1848
|
+
b.msg = "invalid window size", e.mode = 30;
|
|
1849
|
+
break;
|
|
1850
|
+
}
|
|
1851
|
+
e.dmax = 1 << t, b.adler = e.check = 1, e.mode = 512 & O ? 10 : 12, I = O = 0;
|
|
1852
|
+
break;
|
|
1853
|
+
case 2:
|
|
1854
|
+
for (; I < 16; ) {
|
|
1855
|
+
if (Z === 0) break t;
|
|
1856
|
+
Z--, O += N[L++] << I, I += 8;
|
|
1857
|
+
}
|
|
1858
|
+
if (e.flags = O, (255 & e.flags) != 8) {
|
|
1859
|
+
b.msg = "unknown compression method", e.mode = 30;
|
|
1860
|
+
break;
|
|
1861
|
+
}
|
|
1862
|
+
if (57344 & e.flags) {
|
|
1863
|
+
b.msg = "unknown header flags set", e.mode = 30;
|
|
1864
|
+
break;
|
|
1865
|
+
}
|
|
1866
|
+
e.head && (e.head.text = O >> 8 & 1), 512 & e.flags && (x[0] = 255 & O, x[1] = O >>> 8 & 255, e.check = n(e.check, x, 2, 0)), I = O = 0, e.mode = 3;
|
|
1867
|
+
case 3:
|
|
1868
|
+
for (; I < 32; ) {
|
|
1869
|
+
if (Z === 0) break t;
|
|
1870
|
+
Z--, O += N[L++] << I, I += 8;
|
|
1871
|
+
}
|
|
1872
|
+
e.head && (e.head.time = O), 512 & e.flags && (x[0] = 255 & O, x[1] = O >>> 8 & 255, x[2] = O >>> 16 & 255, x[3] = O >>> 24 & 255, e.check = n(e.check, x, 4, 0)), I = O = 0, e.mode = 4;
|
|
1873
|
+
case 4:
|
|
1874
|
+
for (; I < 16; ) {
|
|
1875
|
+
if (Z === 0) break t;
|
|
1876
|
+
Z--, O += N[L++] << I, I += 8;
|
|
1877
|
+
}
|
|
1878
|
+
e.head && (e.head.xflags = 255 & O, e.head.os = O >> 8), 512 & e.flags && (x[0] = 255 & O, x[1] = O >>> 8 & 255, e.check = n(e.check, x, 2, 0)), I = O = 0, e.mode = 5;
|
|
1879
|
+
case 5:
|
|
1880
|
+
if (1024 & e.flags) {
|
|
1881
|
+
for (; I < 16; ) {
|
|
1882
|
+
if (Z === 0) break t;
|
|
1883
|
+
Z--, O += N[L++] << I, I += 8;
|
|
1884
|
+
}
|
|
1885
|
+
e.length = O, e.head && (e.head.extra_len = O), 512 & e.flags && (x[0] = 255 & O, x[1] = O >>> 8 & 255, e.check = n(e.check, x, 2, 0)), I = O = 0;
|
|
1886
|
+
} else e.head && (e.head.extra = null);
|
|
1887
|
+
e.mode = 6;
|
|
1888
|
+
case 6:
|
|
1889
|
+
if (1024 & e.flags && (Z < (G = e.length) && (G = Z), G && (e.head && (t = e.head.extra_len - e.length, e.head.extra || (e.head.extra = new Array(e.head.extra_len)), i.arraySet(e.head.extra, N, L, G, t)), 512 & e.flags && (e.check = n(e.check, N, G, L)), Z -= G, L += G, e.length -= G), e.length)) break t;
|
|
1890
|
+
e.length = 0, e.mode = 7;
|
|
1891
|
+
case 7:
|
|
1892
|
+
if (2048 & e.flags) {
|
|
1893
|
+
if (Z === 0) break t;
|
|
1894
|
+
for (G = 0; t = N[L + G++], e.head && t && e.length < 65536 && (e.head.name += String.fromCharCode(t)), t && G < Z; ) ;
|
|
1895
|
+
if (512 & e.flags && (e.check = n(e.check, N, G, L)), Z -= G, L += G, t) break t;
|
|
1896
|
+
} else e.head && (e.head.name = null);
|
|
1897
|
+
e.length = 0, e.mode = 8;
|
|
1898
|
+
case 8:
|
|
1899
|
+
if (4096 & e.flags) {
|
|
1900
|
+
if (Z === 0) break t;
|
|
1901
|
+
for (G = 0; t = N[L + G++], e.head && t && e.length < 65536 && (e.head.comment += String.fromCharCode(t)), t && G < Z; ) ;
|
|
1902
|
+
if (512 & e.flags && (e.check = n(e.check, N, G, L)), Z -= G, L += G, t) break t;
|
|
1903
|
+
} else e.head && (e.head.comment = null);
|
|
1904
|
+
e.mode = 9;
|
|
1905
|
+
case 9:
|
|
1906
|
+
if (512 & e.flags) {
|
|
1907
|
+
for (; I < 16; ) {
|
|
1908
|
+
if (Z === 0) break t;
|
|
1909
|
+
Z--, O += N[L++] << I, I += 8;
|
|
1910
|
+
}
|
|
1911
|
+
if (O !== (65535 & e.check)) {
|
|
1912
|
+
b.msg = "header crc mismatch", e.mode = 30;
|
|
1913
|
+
break;
|
|
1914
|
+
}
|
|
1915
|
+
I = O = 0;
|
|
1916
|
+
}
|
|
1917
|
+
e.head && (e.head.hcrc = e.flags >> 9 & 1, e.head.done = !0), b.adler = e.check = 0, e.mode = 12;
|
|
1918
|
+
break;
|
|
1919
|
+
case 10:
|
|
1920
|
+
for (; I < 32; ) {
|
|
1921
|
+
if (Z === 0) break t;
|
|
1922
|
+
Z--, O += N[L++] << I, I += 8;
|
|
1923
|
+
}
|
|
1924
|
+
b.adler = e.check = l(O), I = O = 0, e.mode = 11;
|
|
1925
|
+
case 11:
|
|
1926
|
+
if (e.havedict === 0) return b.next_out = tt, b.avail_out = q, b.next_in = L, b.avail_in = Z, e.hold = O, e.bits = I, 2;
|
|
1927
|
+
b.adler = e.check = 1, e.mode = 12;
|
|
1928
|
+
case 12:
|
|
1929
|
+
if (R === 5 || R === 6) break t;
|
|
1930
|
+
case 13:
|
|
1931
|
+
if (e.last) {
|
|
1932
|
+
O >>>= 7 & I, I -= 7 & I, e.mode = 27;
|
|
1933
|
+
break;
|
|
1934
|
+
}
|
|
1935
|
+
for (; I < 3; ) {
|
|
1936
|
+
if (Z === 0) break t;
|
|
1937
|
+
Z--, O += N[L++] << I, I += 8;
|
|
1938
|
+
}
|
|
1939
|
+
switch (e.last = 1 & O, I -= 1, 3 & (O >>>= 1)) {
|
|
1940
|
+
case 0:
|
|
1941
|
+
e.mode = 14;
|
|
1942
|
+
break;
|
|
1943
|
+
case 1:
|
|
1944
|
+
if (H(e), e.mode = 20, R !== 6) break;
|
|
1945
|
+
O >>>= 2, I -= 2;
|
|
1946
|
+
break t;
|
|
1947
|
+
case 2:
|
|
1948
|
+
e.mode = 17;
|
|
1949
|
+
break;
|
|
1950
|
+
case 3:
|
|
1951
|
+
b.msg = "invalid block type", e.mode = 30;
|
|
1952
|
+
}
|
|
1953
|
+
O >>>= 2, I -= 2;
|
|
1954
|
+
break;
|
|
1955
|
+
case 14:
|
|
1956
|
+
for (O >>>= 7 & I, I -= 7 & I; I < 32; ) {
|
|
1957
|
+
if (Z === 0) break t;
|
|
1958
|
+
Z--, O += N[L++] << I, I += 8;
|
|
1959
|
+
}
|
|
1960
|
+
if ((65535 & O) != (O >>> 16 ^ 65535)) {
|
|
1961
|
+
b.msg = "invalid stored block lengths", e.mode = 30;
|
|
1962
|
+
break;
|
|
1963
|
+
}
|
|
1964
|
+
if (e.length = 65535 & O, I = O = 0, e.mode = 15, R === 6) break t;
|
|
1965
|
+
case 15:
|
|
1966
|
+
e.mode = 16;
|
|
1967
|
+
case 16:
|
|
1968
|
+
if (G = e.length) {
|
|
1969
|
+
if (Z < G && (G = Z), q < G && (G = q), G === 0) break t;
|
|
1970
|
+
i.arraySet(Q, N, L, G, tt), Z -= G, L += G, q -= G, tt += G, e.length -= G;
|
|
1971
|
+
break;
|
|
1972
|
+
}
|
|
1973
|
+
e.mode = 12;
|
|
1974
|
+
break;
|
|
1975
|
+
case 17:
|
|
1976
|
+
for (; I < 14; ) {
|
|
1977
|
+
if (Z === 0) break t;
|
|
1978
|
+
Z--, O += N[L++] << I, I += 8;
|
|
1979
|
+
}
|
|
1980
|
+
if (e.nlen = 257 + (31 & O), O >>>= 5, I -= 5, e.ndist = 1 + (31 & O), O >>>= 5, I -= 5, e.ncode = 4 + (15 & O), O >>>= 4, I -= 4, 286 < e.nlen || 30 < e.ndist) {
|
|
1981
|
+
b.msg = "too many length or distance symbols", e.mode = 30;
|
|
1982
|
+
break;
|
|
1983
|
+
}
|
|
1984
|
+
e.have = 0, e.mode = 18;
|
|
1985
|
+
case 18:
|
|
1986
|
+
for (; e.have < e.ncode; ) {
|
|
1987
|
+
for (; I < 3; ) {
|
|
1988
|
+
if (Z === 0) break t;
|
|
1989
|
+
Z--, O += N[L++] << I, I += 8;
|
|
1990
|
+
}
|
|
1991
|
+
e.lens[P[e.have++]] = 7 & O, O >>>= 3, I -= 3;
|
|
1992
|
+
}
|
|
1993
|
+
for (; e.have < 19; ) e.lens[P[e.have++]] = 0;
|
|
1994
|
+
if (e.lencode = e.lendyn, e.lenbits = 7, B = { bits: e.lenbits }, D = y(0, e.lens, 0, 19, e.lencode, 0, e.work, B), e.lenbits = B.bits, D) {
|
|
1995
|
+
b.msg = "invalid code lengths set", e.mode = 30;
|
|
1996
|
+
break;
|
|
1997
|
+
}
|
|
1998
|
+
e.have = 0, e.mode = 19;
|
|
1999
|
+
case 19:
|
|
2000
|
+
for (; e.have < e.nlen + e.ndist; ) {
|
|
2001
|
+
for (; nt = (u = e.lencode[O & (1 << e.lenbits) - 1]) >>> 16 & 255, lt = 65535 & u, !((et = u >>> 24) <= I); ) {
|
|
2002
|
+
if (Z === 0) break t;
|
|
2003
|
+
Z--, O += N[L++] << I, I += 8;
|
|
2004
|
+
}
|
|
2005
|
+
if (lt < 16) O >>>= et, I -= et, e.lens[e.have++] = lt;
|
|
2006
|
+
else {
|
|
2007
|
+
if (lt === 16) {
|
|
2008
|
+
for (d = et + 2; I < d; ) {
|
|
2009
|
+
if (Z === 0) break t;
|
|
2010
|
+
Z--, O += N[L++] << I, I += 8;
|
|
2011
|
+
}
|
|
2012
|
+
if (O >>>= et, I -= et, e.have === 0) {
|
|
2013
|
+
b.msg = "invalid bit length repeat", e.mode = 30;
|
|
2014
|
+
break;
|
|
2015
|
+
}
|
|
2016
|
+
t = e.lens[e.have - 1], G = 3 + (3 & O), O >>>= 2, I -= 2;
|
|
2017
|
+
} else if (lt === 17) {
|
|
2018
|
+
for (d = et + 3; I < d; ) {
|
|
2019
|
+
if (Z === 0) break t;
|
|
2020
|
+
Z--, O += N[L++] << I, I += 8;
|
|
2021
|
+
}
|
|
2022
|
+
I -= et, t = 0, G = 3 + (7 & (O >>>= et)), O >>>= 3, I -= 3;
|
|
2023
|
+
} else {
|
|
2024
|
+
for (d = et + 7; I < d; ) {
|
|
2025
|
+
if (Z === 0) break t;
|
|
2026
|
+
Z--, O += N[L++] << I, I += 8;
|
|
2027
|
+
}
|
|
2028
|
+
I -= et, t = 0, G = 11 + (127 & (O >>>= et)), O >>>= 7, I -= 7;
|
|
2029
|
+
}
|
|
2030
|
+
if (e.have + G > e.nlen + e.ndist) {
|
|
2031
|
+
b.msg = "invalid bit length repeat", e.mode = 30;
|
|
2032
|
+
break;
|
|
2033
|
+
}
|
|
2034
|
+
for (; G--; ) e.lens[e.have++] = t;
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
if (e.mode === 30) break;
|
|
2038
|
+
if (e.lens[256] === 0) {
|
|
2039
|
+
b.msg = "invalid code -- missing end-of-block", e.mode = 30;
|
|
2040
|
+
break;
|
|
2041
|
+
}
|
|
2042
|
+
if (e.lenbits = 9, B = { bits: e.lenbits }, D = y(v, e.lens, 0, e.nlen, e.lencode, 0, e.work, B), e.lenbits = B.bits, D) {
|
|
2043
|
+
b.msg = "invalid literal/lengths set", e.mode = 30;
|
|
2044
|
+
break;
|
|
2045
|
+
}
|
|
2046
|
+
if (e.distbits = 6, e.distcode = e.distdyn, B = { bits: e.distbits }, D = y(_, e.lens, e.nlen, e.ndist, e.distcode, 0, e.work, B), e.distbits = B.bits, D) {
|
|
2047
|
+
b.msg = "invalid distances set", e.mode = 30;
|
|
2048
|
+
break;
|
|
2049
|
+
}
|
|
2050
|
+
if (e.mode = 20, R === 6) break t;
|
|
2051
|
+
case 20:
|
|
2052
|
+
e.mode = 21;
|
|
2053
|
+
case 21:
|
|
2054
|
+
if (6 <= Z && 258 <= q) {
|
|
2055
|
+
b.next_out = tt, b.avail_out = q, b.next_in = L, b.avail_in = Z, e.hold = O, e.bits = I, h(b, K), tt = b.next_out, Q = b.output, q = b.avail_out, L = b.next_in, N = b.input, Z = b.avail_in, O = e.hold, I = e.bits, e.mode === 12 && (e.back = -1);
|
|
2056
|
+
break;
|
|
2057
|
+
}
|
|
2058
|
+
for (e.back = 0; nt = (u = e.lencode[O & (1 << e.lenbits) - 1]) >>> 16 & 255, lt = 65535 & u, !((et = u >>> 24) <= I); ) {
|
|
2059
|
+
if (Z === 0) break t;
|
|
2060
|
+
Z--, O += N[L++] << I, I += 8;
|
|
2061
|
+
}
|
|
2062
|
+
if (nt && (240 & nt) == 0) {
|
|
2063
|
+
for (at = et, ct = nt, ft = lt; nt = (u = e.lencode[ft + ((O & (1 << at + ct) - 1) >> at)]) >>> 16 & 255, lt = 65535 & u, !(at + (et = u >>> 24) <= I); ) {
|
|
2064
|
+
if (Z === 0) break t;
|
|
2065
|
+
Z--, O += N[L++] << I, I += 8;
|
|
2066
|
+
}
|
|
2067
|
+
O >>>= at, I -= at, e.back += at;
|
|
2068
|
+
}
|
|
2069
|
+
if (O >>>= et, I -= et, e.back += et, e.length = lt, nt === 0) {
|
|
2070
|
+
e.mode = 26;
|
|
2071
|
+
break;
|
|
2072
|
+
}
|
|
2073
|
+
if (32 & nt) {
|
|
2074
|
+
e.back = -1, e.mode = 12;
|
|
2075
|
+
break;
|
|
2076
|
+
}
|
|
2077
|
+
if (64 & nt) {
|
|
2078
|
+
b.msg = "invalid literal/length code", e.mode = 30;
|
|
2079
|
+
break;
|
|
2080
|
+
}
|
|
2081
|
+
e.extra = 15 & nt, e.mode = 22;
|
|
2082
|
+
case 22:
|
|
2083
|
+
if (e.extra) {
|
|
2084
|
+
for (d = e.extra; I < d; ) {
|
|
2085
|
+
if (Z === 0) break t;
|
|
2086
|
+
Z--, O += N[L++] << I, I += 8;
|
|
2087
|
+
}
|
|
2088
|
+
e.length += O & (1 << e.extra) - 1, O >>>= e.extra, I -= e.extra, e.back += e.extra;
|
|
2089
|
+
}
|
|
2090
|
+
e.was = e.length, e.mode = 23;
|
|
2091
|
+
case 23:
|
|
2092
|
+
for (; nt = (u = e.distcode[O & (1 << e.distbits) - 1]) >>> 16 & 255, lt = 65535 & u, !((et = u >>> 24) <= I); ) {
|
|
2093
|
+
if (Z === 0) break t;
|
|
2094
|
+
Z--, O += N[L++] << I, I += 8;
|
|
2095
|
+
}
|
|
2096
|
+
if ((240 & nt) == 0) {
|
|
2097
|
+
for (at = et, ct = nt, ft = lt; nt = (u = e.distcode[ft + ((O & (1 << at + ct) - 1) >> at)]) >>> 16 & 255, lt = 65535 & u, !(at + (et = u >>> 24) <= I); ) {
|
|
2098
|
+
if (Z === 0) break t;
|
|
2099
|
+
Z--, O += N[L++] << I, I += 8;
|
|
2100
|
+
}
|
|
2101
|
+
O >>>= at, I -= at, e.back += at;
|
|
2102
|
+
}
|
|
2103
|
+
if (O >>>= et, I -= et, e.back += et, 64 & nt) {
|
|
2104
|
+
b.msg = "invalid distance code", e.mode = 30;
|
|
2105
|
+
break;
|
|
2106
|
+
}
|
|
2107
|
+
e.offset = lt, e.extra = 15 & nt, e.mode = 24;
|
|
2108
|
+
case 24:
|
|
2109
|
+
if (e.extra) {
|
|
2110
|
+
for (d = e.extra; I < d; ) {
|
|
2111
|
+
if (Z === 0) break t;
|
|
2112
|
+
Z--, O += N[L++] << I, I += 8;
|
|
2113
|
+
}
|
|
2114
|
+
e.offset += O & (1 << e.extra) - 1, O >>>= e.extra, I -= e.extra, e.back += e.extra;
|
|
2115
|
+
}
|
|
2116
|
+
if (e.offset > e.dmax) {
|
|
2117
|
+
b.msg = "invalid distance too far back", e.mode = 30;
|
|
2118
|
+
break;
|
|
2119
|
+
}
|
|
2120
|
+
e.mode = 25;
|
|
2121
|
+
case 25:
|
|
2122
|
+
if (q === 0) break t;
|
|
2123
|
+
if (G = K - q, e.offset > G) {
|
|
2124
|
+
if ((G = e.offset - G) > e.whave && e.sane) {
|
|
2125
|
+
b.msg = "invalid distance too far back", e.mode = 30;
|
|
2126
|
+
break;
|
|
2127
|
+
}
|
|
2128
|
+
st = G > e.wnext ? (G -= e.wnext, e.wsize - G) : e.wnext - G, G > e.length && (G = e.length), ut = e.window;
|
|
2129
|
+
} else ut = Q, st = tt - e.offset, G = e.length;
|
|
2130
|
+
for (q < G && (G = q), q -= G, e.length -= G; Q[tt++] = ut[st++], --G; ) ;
|
|
2131
|
+
e.length === 0 && (e.mode = 21);
|
|
2132
|
+
break;
|
|
2133
|
+
case 26:
|
|
2134
|
+
if (q === 0) break t;
|
|
2135
|
+
Q[tt++] = e.length, q--, e.mode = 21;
|
|
2136
|
+
break;
|
|
2137
|
+
case 27:
|
|
2138
|
+
if (e.wrap) {
|
|
2139
|
+
for (; I < 32; ) {
|
|
2140
|
+
if (Z === 0) break t;
|
|
2141
|
+
Z--, O |= N[L++] << I, I += 8;
|
|
2142
|
+
}
|
|
2143
|
+
if (K -= q, b.total_out += K, e.total += K, K && (b.adler = e.check = e.flags ? n(e.check, Q, K, tt - K) : o(e.check, Q, K, tt - K)), K = q, (e.flags ? O : l(O)) !== e.check) {
|
|
2144
|
+
b.msg = "incorrect data check", e.mode = 30;
|
|
2145
|
+
break;
|
|
2146
|
+
}
|
|
2147
|
+
I = O = 0;
|
|
2148
|
+
}
|
|
2149
|
+
e.mode = 28;
|
|
2150
|
+
case 28:
|
|
2151
|
+
if (e.wrap && e.flags) {
|
|
2152
|
+
for (; I < 32; ) {
|
|
2153
|
+
if (Z === 0) break t;
|
|
2154
|
+
Z--, O += N[L++] << I, I += 8;
|
|
2155
|
+
}
|
|
2156
|
+
if (O !== (4294967295 & e.total)) {
|
|
2157
|
+
b.msg = "incorrect length check", e.mode = 30;
|
|
2158
|
+
break;
|
|
2159
|
+
}
|
|
2160
|
+
I = O = 0;
|
|
2161
|
+
}
|
|
2162
|
+
e.mode = 29;
|
|
2163
|
+
case 29:
|
|
2164
|
+
D = 1;
|
|
2165
|
+
break t;
|
|
2166
|
+
case 30:
|
|
2167
|
+
D = -3;
|
|
2168
|
+
break t;
|
|
2169
|
+
case 31:
|
|
2170
|
+
return -4;
|
|
2171
|
+
default:
|
|
2172
|
+
return a;
|
|
2173
|
+
}
|
|
2174
|
+
return b.next_out = tt, b.avail_out = q, b.next_in = L, b.avail_in = Z, e.hold = O, e.bits = I, (e.wsize || K !== b.avail_out && e.mode < 30 && (e.mode < 27 || R !== 4)) && X(b, b.output, b.next_out, K - b.avail_out) ? (e.mode = 31, -4) : (V -= b.avail_in, K -= b.avail_out, b.total_in += V, b.total_out += K, e.total += K, e.wrap && K && (b.adler = e.check = e.flags ? n(e.check, Q, K, b.next_out - K) : o(e.check, Q, K, b.next_out - K)), b.data_type = e.bits + (e.last ? 64 : 0) + (e.mode === 12 ? 128 : 0) + (e.mode === 20 || e.mode === 15 ? 256 : 0), (V == 0 && K === 0 || R === 4) && D === g && (D = -5), D);
|
|
2175
|
+
}, f.inflateEnd = function(b) {
|
|
2176
|
+
if (!b || !b.state) return a;
|
|
2177
|
+
var R = b.state;
|
|
2178
|
+
return R.window && (R.window = null), b.state = null, g;
|
|
2179
|
+
}, f.inflateGetHeader = function(b, R) {
|
|
2180
|
+
var e;
|
|
2181
|
+
return b && b.state ? (2 & (e = b.state).wrap) == 0 ? a : ((e.head = R).done = !1, g) : a;
|
|
2182
|
+
}, f.inflateSetDictionary = function(b, R) {
|
|
2183
|
+
var e, N = R.length;
|
|
2184
|
+
return b && b.state ? (e = b.state).wrap !== 0 && e.mode !== 11 ? a : e.mode === 11 && o(1, R, N, 0) !== e.check ? -3 : X(b, R, N, N) ? (e.mode = 31, -4) : (e.havedict = 1, g) : a;
|
|
2185
|
+
}, f.inflateInfo = "pako inflate (from Nodeca project)";
|
|
2186
|
+
}, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function(r, w, f) {
|
|
2187
|
+
var i = r("../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], h = [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], y = [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];
|
|
2188
|
+
w.exports = function(v, _, g, a, p, s, c, l) {
|
|
2189
|
+
var m, k, z, C, U, T, W, F, H, X = l.bits, b = 0, R = 0, e = 0, N = 0, Q = 0, L = 0, tt = 0, Z = 0, q = 0, O = 0, I = null, V = 0, K = new i.Buf16(16), G = new i.Buf16(16), st = null, ut = 0;
|
|
2190
|
+
for (b = 0; b <= 15; b++) K[b] = 0;
|
|
2191
|
+
for (R = 0; R < a; R++) K[_[g + R]]++;
|
|
2192
|
+
for (Q = X, N = 15; 1 <= N && K[N] === 0; N--) ;
|
|
2193
|
+
if (N < Q && (Q = N), N === 0) return p[s++] = 20971520, p[s++] = 20971520, l.bits = 1, 0;
|
|
2194
|
+
for (e = 1; e < N && K[e] === 0; e++) ;
|
|
2195
|
+
for (Q < e && (Q = e), b = Z = 1; b <= 15; b++) if (Z <<= 1, (Z -= K[b]) < 0) return -1;
|
|
2196
|
+
if (0 < Z && (v === 0 || N !== 1)) return -1;
|
|
2197
|
+
for (G[1] = 0, b = 1; b < 15; b++) G[b + 1] = G[b] + K[b];
|
|
2198
|
+
for (R = 0; R < a; R++) _[g + R] !== 0 && (c[G[_[g + R]]++] = R);
|
|
2199
|
+
if (T = v === 0 ? (I = st = c, 19) : v === 1 ? (I = o, V -= 257, st = n, ut -= 257, 256) : (I = h, st = y, -1), b = e, U = s, tt = R = O = 0, z = -1, C = (q = 1 << (L = Q)) - 1, v === 1 && 852 < q || v === 2 && 592 < q) return 1;
|
|
2200
|
+
for (; ; ) {
|
|
2201
|
+
for (W = b - tt, H = c[R] < T ? (F = 0, c[R]) : c[R] > T ? (F = st[ut + c[R]], I[V + c[R]]) : (F = 96, 0), m = 1 << b - tt, e = k = 1 << L; p[U + (O >> tt) + (k -= m)] = W << 24 | F << 16 | H | 0, k !== 0; ) ;
|
|
2202
|
+
for (m = 1 << b - 1; O & m; ) m >>= 1;
|
|
2203
|
+
if (m !== 0 ? (O &= m - 1, O += m) : O = 0, R++, --K[b] == 0) {
|
|
2204
|
+
if (b === N) break;
|
|
2205
|
+
b = _[g + c[R]];
|
|
2206
|
+
}
|
|
2207
|
+
if (Q < b && (O & C) !== z) {
|
|
2208
|
+
for (tt === 0 && (tt = Q), U += e, Z = 1 << (L = b - tt); L + tt < N && !((Z -= K[L + tt]) <= 0); ) L++, Z <<= 1;
|
|
2209
|
+
if (q += 1 << L, v === 1 && 852 < q || v === 2 && 592 < q) return 1;
|
|
2210
|
+
p[z = O & C] = Q << 24 | L << 16 | U - s | 0;
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
return O !== 0 && (p[U + O] = b - tt << 24 | 64 << 16 | 0), l.bits = Q, 0;
|
|
2214
|
+
};
|
|
2215
|
+
}, { "../utils/common": 41 }], 51: [function(r, w, f) {
|
|
2216
|
+
w.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" };
|
|
2217
|
+
}, {}], 52: [function(r, w, f) {
|
|
2218
|
+
var i = r("../utils/common"), o = 0, n = 1;
|
|
2219
|
+
function h(u) {
|
|
2220
|
+
for (var x = u.length; 0 <= --x; ) u[x] = 0;
|
|
2221
|
+
}
|
|
2222
|
+
var y = 0, v = 29, _ = 256, g = _ + 1 + v, a = 30, p = 19, s = 2 * g + 1, c = 15, l = 16, m = 7, k = 256, z = 16, C = 17, U = 18, T = [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], W = [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], F = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], H = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], X = new Array(2 * (g + 2));
|
|
2223
|
+
h(X);
|
|
2224
|
+
var b = new Array(2 * a);
|
|
2225
|
+
h(b);
|
|
2226
|
+
var R = new Array(512);
|
|
2227
|
+
h(R);
|
|
2228
|
+
var e = new Array(256);
|
|
2229
|
+
h(e);
|
|
2230
|
+
var N = new Array(v);
|
|
2231
|
+
h(N);
|
|
2232
|
+
var Q, L, tt, Z = new Array(a);
|
|
2233
|
+
function q(u, x, P, j, A) {
|
|
2234
|
+
this.static_tree = u, this.extra_bits = x, this.extra_base = P, this.elems = j, this.max_length = A, this.has_stree = u && u.length;
|
|
2235
|
+
}
|
|
2236
|
+
function O(u, x) {
|
|
2237
|
+
this.dyn_tree = u, this.max_code = 0, this.stat_desc = x;
|
|
2238
|
+
}
|
|
2239
|
+
function I(u) {
|
|
2240
|
+
return u < 256 ? R[u] : R[256 + (u >>> 7)];
|
|
2241
|
+
}
|
|
2242
|
+
function V(u, x) {
|
|
2243
|
+
u.pending_buf[u.pending++] = 255 & x, u.pending_buf[u.pending++] = x >>> 8 & 255;
|
|
2244
|
+
}
|
|
2245
|
+
function K(u, x, P) {
|
|
2246
|
+
u.bi_valid > l - P ? (u.bi_buf |= x << u.bi_valid & 65535, V(u, u.bi_buf), u.bi_buf = x >> l - u.bi_valid, u.bi_valid += P - l) : (u.bi_buf |= x << u.bi_valid & 65535, u.bi_valid += P);
|
|
2247
|
+
}
|
|
2248
|
+
function G(u, x, P) {
|
|
2249
|
+
K(u, P[2 * x], P[2 * x + 1]);
|
|
2250
|
+
}
|
|
2251
|
+
function st(u, x) {
|
|
2252
|
+
for (var P = 0; P |= 1 & u, u >>>= 1, P <<= 1, 0 < --x; ) ;
|
|
2253
|
+
return P >>> 1;
|
|
2254
|
+
}
|
|
2255
|
+
function ut(u, x, P) {
|
|
2256
|
+
var j, A, M = new Array(c + 1), J = 0;
|
|
2257
|
+
for (j = 1; j <= c; j++) M[j] = J = J + P[j - 1] << 1;
|
|
2258
|
+
for (A = 0; A <= x; A++) {
|
|
2259
|
+
var $ = u[2 * A + 1];
|
|
2260
|
+
$ !== 0 && (u[2 * A] = st(M[$]++, $));
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
function et(u) {
|
|
2264
|
+
var x;
|
|
2265
|
+
for (x = 0; x < g; x++) u.dyn_ltree[2 * x] = 0;
|
|
2266
|
+
for (x = 0; x < a; x++) u.dyn_dtree[2 * x] = 0;
|
|
2267
|
+
for (x = 0; x < p; x++) u.bl_tree[2 * x] = 0;
|
|
2268
|
+
u.dyn_ltree[2 * k] = 1, u.opt_len = u.static_len = 0, u.last_lit = u.matches = 0;
|
|
2269
|
+
}
|
|
2270
|
+
function nt(u) {
|
|
2271
|
+
8 < u.bi_valid ? V(u, u.bi_buf) : 0 < u.bi_valid && (u.pending_buf[u.pending++] = u.bi_buf), u.bi_buf = 0, u.bi_valid = 0;
|
|
2272
|
+
}
|
|
2273
|
+
function lt(u, x, P, j) {
|
|
2274
|
+
var A = 2 * x, M = 2 * P;
|
|
2275
|
+
return u[A] < u[M] || u[A] === u[M] && j[x] <= j[P];
|
|
2276
|
+
}
|
|
2277
|
+
function at(u, x, P) {
|
|
2278
|
+
for (var j = u.heap[P], A = P << 1; A <= u.heap_len && (A < u.heap_len && lt(x, u.heap[A + 1], u.heap[A], u.depth) && A++, !lt(x, j, u.heap[A], u.depth)); ) u.heap[P] = u.heap[A], P = A, A <<= 1;
|
|
2279
|
+
u.heap[P] = j;
|
|
2280
|
+
}
|
|
2281
|
+
function ct(u, x, P) {
|
|
2282
|
+
var j, A, M, J, $ = 0;
|
|
2283
|
+
if (u.last_lit !== 0) for (; j = u.pending_buf[u.d_buf + 2 * $] << 8 | u.pending_buf[u.d_buf + 2 * $ + 1], A = u.pending_buf[u.l_buf + $], $++, j === 0 ? G(u, A, x) : (G(u, (M = e[A]) + _ + 1, x), (J = T[M]) !== 0 && K(u, A -= N[M], J), G(u, M = I(--j), P), (J = W[M]) !== 0 && K(u, j -= Z[M], J)), $ < u.last_lit; ) ;
|
|
2284
|
+
G(u, k, x);
|
|
2285
|
+
}
|
|
2286
|
+
function ft(u, x) {
|
|
2287
|
+
var P, j, A, M = x.dyn_tree, J = x.stat_desc.static_tree, $ = x.stat_desc.has_stree, Y = x.stat_desc.elems, it = -1;
|
|
2288
|
+
for (u.heap_len = 0, u.heap_max = s, P = 0; P < Y; P++) M[2 * P] !== 0 ? (u.heap[++u.heap_len] = it = P, u.depth[P] = 0) : M[2 * P + 1] = 0;
|
|
2289
|
+
for (; u.heap_len < 2; ) M[2 * (A = u.heap[++u.heap_len] = it < 2 ? ++it : 0)] = 1, u.depth[A] = 0, u.opt_len--, $ && (u.static_len -= J[2 * A + 1]);
|
|
2290
|
+
for (x.max_code = it, P = u.heap_len >> 1; 1 <= P; P--) at(u, M, P);
|
|
2291
|
+
for (A = Y; P = u.heap[1], u.heap[1] = u.heap[u.heap_len--], at(u, M, 1), j = u.heap[1], u.heap[--u.heap_max] = P, u.heap[--u.heap_max] = j, M[2 * A] = M[2 * P] + M[2 * j], u.depth[A] = (u.depth[P] >= u.depth[j] ? u.depth[P] : u.depth[j]) + 1, M[2 * P + 1] = M[2 * j + 1] = A, u.heap[1] = A++, at(u, M, 1), 2 <= u.heap_len; ) ;
|
|
2292
|
+
u.heap[--u.heap_max] = u.heap[1], (function(rt, ht) {
|
|
2293
|
+
var _t, dt, gt, ot, yt, Ct, pt = ht.dyn_tree, Bt = ht.max_code, Mt = ht.stat_desc.static_tree, Ht = ht.stat_desc.has_stree, $t = ht.stat_desc.extra_bits, Ft = ht.stat_desc.extra_base, bt = ht.stat_desc.max_length, wt = 0;
|
|
2294
|
+
for (ot = 0; ot <= c; ot++) rt.bl_count[ot] = 0;
|
|
2295
|
+
for (pt[2 * rt.heap[rt.heap_max] + 1] = 0, _t = rt.heap_max + 1; _t < s; _t++) bt < (ot = pt[2 * pt[2 * (dt = rt.heap[_t]) + 1] + 1] + 1) && (ot = bt, wt++), pt[2 * dt + 1] = ot, Bt < dt || (rt.bl_count[ot]++, yt = 0, Ft <= dt && (yt = $t[dt - Ft]), Ct = pt[2 * dt], rt.opt_len += Ct * (ot + yt), Ht && (rt.static_len += Ct * (Mt[2 * dt + 1] + yt)));
|
|
2296
|
+
if (wt !== 0) {
|
|
2297
|
+
do {
|
|
2298
|
+
for (ot = bt - 1; rt.bl_count[ot] === 0; ) ot--;
|
|
2299
|
+
rt.bl_count[ot]--, rt.bl_count[ot + 1] += 2, rt.bl_count[bt]--, wt -= 2;
|
|
2300
|
+
} while (0 < wt);
|
|
2301
|
+
for (ot = bt; ot !== 0; ot--) for (dt = rt.bl_count[ot]; dt !== 0; ) Bt < (gt = rt.heap[--_t]) || (pt[2 * gt + 1] !== ot && (rt.opt_len += (ot - pt[2 * gt + 1]) * pt[2 * gt], pt[2 * gt + 1] = ot), dt--);
|
|
2302
|
+
}
|
|
2303
|
+
})(u, x), ut(M, it, u.bl_count);
|
|
2304
|
+
}
|
|
2305
|
+
function t(u, x, P) {
|
|
2306
|
+
var j, A, M = -1, J = x[1], $ = 0, Y = 7, it = 4;
|
|
2307
|
+
for (J === 0 && (Y = 138, it = 3), x[2 * (P + 1) + 1] = 65535, j = 0; j <= P; j++) A = J, J = x[2 * (j + 1) + 1], ++$ < Y && A === J || ($ < it ? u.bl_tree[2 * A] += $ : A !== 0 ? (A !== M && u.bl_tree[2 * A]++, u.bl_tree[2 * z]++) : $ <= 10 ? u.bl_tree[2 * C]++ : u.bl_tree[2 * U]++, M = A, it = ($ = 0) === J ? (Y = 138, 3) : A === J ? (Y = 6, 3) : (Y = 7, 4));
|
|
2308
|
+
}
|
|
2309
|
+
function D(u, x, P) {
|
|
2310
|
+
var j, A, M = -1, J = x[1], $ = 0, Y = 7, it = 4;
|
|
2311
|
+
for (J === 0 && (Y = 138, it = 3), j = 0; j <= P; j++) if (A = J, J = x[2 * (j + 1) + 1], !(++$ < Y && A === J)) {
|
|
2312
|
+
if ($ < it) for (; G(u, A, u.bl_tree), --$ != 0; ) ;
|
|
2313
|
+
else A !== 0 ? (A !== M && (G(u, A, u.bl_tree), $--), G(u, z, u.bl_tree), K(u, $ - 3, 2)) : $ <= 10 ? (G(u, C, u.bl_tree), K(u, $ - 3, 3)) : (G(u, U, u.bl_tree), K(u, $ - 11, 7));
|
|
2314
|
+
M = A, it = ($ = 0) === J ? (Y = 138, 3) : A === J ? (Y = 6, 3) : (Y = 7, 4);
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
h(Z);
|
|
2318
|
+
var B = !1;
|
|
2319
|
+
function d(u, x, P, j) {
|
|
2320
|
+
K(u, (y << 1) + (j ? 1 : 0), 3), (function(A, M, J, $) {
|
|
2321
|
+
nt(A), V(A, J), V(A, ~J), i.arraySet(A.pending_buf, A.window, M, J, A.pending), A.pending += J;
|
|
2322
|
+
})(u, x, P);
|
|
2323
|
+
}
|
|
2324
|
+
f._tr_init = function(u) {
|
|
2325
|
+
B || ((function() {
|
|
2326
|
+
var x, P, j, A, M, J = new Array(c + 1);
|
|
2327
|
+
for (A = j = 0; A < v - 1; A++) for (N[A] = j, x = 0; x < 1 << T[A]; x++) e[j++] = A;
|
|
2328
|
+
for (e[j - 1] = A, A = M = 0; A < 16; A++) for (Z[A] = M, x = 0; x < 1 << W[A]; x++) R[M++] = A;
|
|
2329
|
+
for (M >>= 7; A < a; A++) for (Z[A] = M << 7, x = 0; x < 1 << W[A] - 7; x++) R[256 + M++] = A;
|
|
2330
|
+
for (P = 0; P <= c; P++) J[P] = 0;
|
|
2331
|
+
for (x = 0; x <= 143; ) X[2 * x + 1] = 8, x++, J[8]++;
|
|
2332
|
+
for (; x <= 255; ) X[2 * x + 1] = 9, x++, J[9]++;
|
|
2333
|
+
for (; x <= 279; ) X[2 * x + 1] = 7, x++, J[7]++;
|
|
2334
|
+
for (; x <= 287; ) X[2 * x + 1] = 8, x++, J[8]++;
|
|
2335
|
+
for (ut(X, g + 1, J), x = 0; x < a; x++) b[2 * x + 1] = 5, b[2 * x] = st(x, 5);
|
|
2336
|
+
Q = new q(X, T, _ + 1, g, c), L = new q(b, W, 0, a, c), tt = new q(new Array(0), F, 0, p, m);
|
|
2337
|
+
})(), B = !0), u.l_desc = new O(u.dyn_ltree, Q), u.d_desc = new O(u.dyn_dtree, L), u.bl_desc = new O(u.bl_tree, tt), u.bi_buf = 0, u.bi_valid = 0, et(u);
|
|
2338
|
+
}, f._tr_stored_block = d, f._tr_flush_block = function(u, x, P, j) {
|
|
2339
|
+
var A, M, J = 0;
|
|
2340
|
+
0 < u.level ? (u.strm.data_type === 2 && (u.strm.data_type = (function($) {
|
|
2341
|
+
var Y, it = 4093624447;
|
|
2342
|
+
for (Y = 0; Y <= 31; Y++, it >>>= 1) if (1 & it && $.dyn_ltree[2 * Y] !== 0) return o;
|
|
2343
|
+
if ($.dyn_ltree[18] !== 0 || $.dyn_ltree[20] !== 0 || $.dyn_ltree[26] !== 0) return n;
|
|
2344
|
+
for (Y = 32; Y < _; Y++) if ($.dyn_ltree[2 * Y] !== 0) return n;
|
|
2345
|
+
return o;
|
|
2346
|
+
})(u)), ft(u, u.l_desc), ft(u, u.d_desc), J = (function($) {
|
|
2347
|
+
var Y;
|
|
2348
|
+
for (t($, $.dyn_ltree, $.l_desc.max_code), t($, $.dyn_dtree, $.d_desc.max_code), ft($, $.bl_desc), Y = p - 1; 3 <= Y && $.bl_tree[2 * H[Y] + 1] === 0; Y--) ;
|
|
2349
|
+
return $.opt_len += 3 * (Y + 1) + 5 + 5 + 4, Y;
|
|
2350
|
+
})(u), A = u.opt_len + 3 + 7 >>> 3, (M = u.static_len + 3 + 7 >>> 3) <= A && (A = M)) : A = M = P + 5, P + 4 <= A && x !== -1 ? d(u, x, P, j) : u.strategy === 4 || M === A ? (K(u, 2 + (j ? 1 : 0), 3), ct(u, X, b)) : (K(u, 4 + (j ? 1 : 0), 3), (function($, Y, it, rt) {
|
|
2351
|
+
var ht;
|
|
2352
|
+
for (K($, Y - 257, 5), K($, it - 1, 5), K($, rt - 4, 4), ht = 0; ht < rt; ht++) K($, $.bl_tree[2 * H[ht] + 1], 3);
|
|
2353
|
+
D($, $.dyn_ltree, Y - 1), D($, $.dyn_dtree, it - 1);
|
|
2354
|
+
})(u, u.l_desc.max_code + 1, u.d_desc.max_code + 1, J + 1), ct(u, u.dyn_ltree, u.dyn_dtree)), et(u), j && nt(u);
|
|
2355
|
+
}, f._tr_tally = function(u, x, P) {
|
|
2356
|
+
return u.pending_buf[u.d_buf + 2 * u.last_lit] = x >>> 8 & 255, u.pending_buf[u.d_buf + 2 * u.last_lit + 1] = 255 & x, u.pending_buf[u.l_buf + u.last_lit] = 255 & P, u.last_lit++, x === 0 ? u.dyn_ltree[2 * P]++ : (u.matches++, x--, u.dyn_ltree[2 * (e[P] + _ + 1)]++, u.dyn_dtree[2 * I(x)]++), u.last_lit === u.lit_bufsize - 1;
|
|
2357
|
+
}, f._tr_align = function(u) {
|
|
2358
|
+
K(u, 2, 3), G(u, k, X), (function(x) {
|
|
2359
|
+
x.bi_valid === 16 ? (V(x, x.bi_buf), x.bi_buf = 0, x.bi_valid = 0) : 8 <= x.bi_valid && (x.pending_buf[x.pending++] = 255 & x.bi_buf, x.bi_buf >>= 8, x.bi_valid -= 8);
|
|
2360
|
+
})(u);
|
|
2361
|
+
};
|
|
2362
|
+
}, { "../utils/common": 41 }], 53: [function(r, w, f) {
|
|
2363
|
+
w.exports = function() {
|
|
2364
|
+
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;
|
|
2365
|
+
};
|
|
2366
|
+
}, {}], 54: [function(r, w, f) {
|
|
2367
|
+
(function(i) {
|
|
2368
|
+
(function(o, n) {
|
|
2369
|
+
if (!o.setImmediate) {
|
|
2370
|
+
var h, y, v, _, g = 1, a = {}, p = !1, s = o.document, c = Object.getPrototypeOf && Object.getPrototypeOf(o);
|
|
2371
|
+
c = c && c.setTimeout ? c : o, h = {}.toString.call(o.process) === "[object process]" ? function(z) {
|
|
2372
|
+
process.nextTick(function() {
|
|
2373
|
+
m(z);
|
|
2374
|
+
});
|
|
2375
|
+
} : (function() {
|
|
2376
|
+
if (o.postMessage && !o.importScripts) {
|
|
2377
|
+
var z = !0, C = o.onmessage;
|
|
2378
|
+
return o.onmessage = function() {
|
|
2379
|
+
z = !1;
|
|
2380
|
+
}, o.postMessage("", "*"), o.onmessage = C, z;
|
|
2381
|
+
}
|
|
2382
|
+
})() ? (_ = "setImmediate$" + Math.random() + "$", o.addEventListener ? o.addEventListener("message", k, !1) : o.attachEvent("onmessage", k), function(z) {
|
|
2383
|
+
o.postMessage(_ + z, "*");
|
|
2384
|
+
}) : o.MessageChannel ? ((v = new MessageChannel()).port1.onmessage = function(z) {
|
|
2385
|
+
m(z.data);
|
|
2386
|
+
}, function(z) {
|
|
2387
|
+
v.port2.postMessage(z);
|
|
2388
|
+
}) : s && "onreadystatechange" in s.createElement("script") ? (y = s.documentElement, function(z) {
|
|
2389
|
+
var C = s.createElement("script");
|
|
2390
|
+
C.onreadystatechange = function() {
|
|
2391
|
+
m(z), C.onreadystatechange = null, y.removeChild(C), C = null;
|
|
2392
|
+
}, y.appendChild(C);
|
|
2393
|
+
}) : function(z) {
|
|
2394
|
+
setTimeout(m, 0, z);
|
|
2395
|
+
}, c.setImmediate = function(z) {
|
|
2396
|
+
typeof z != "function" && (z = new Function("" + z));
|
|
2397
|
+
for (var C = new Array(arguments.length - 1), U = 0; U < C.length; U++) C[U] = arguments[U + 1];
|
|
2398
|
+
var T = { callback: z, args: C };
|
|
2399
|
+
return a[g] = T, h(g), g++;
|
|
2400
|
+
}, c.clearImmediate = l;
|
|
2401
|
+
}
|
|
2402
|
+
function l(z) {
|
|
2403
|
+
delete a[z];
|
|
2404
|
+
}
|
|
2405
|
+
function m(z) {
|
|
2406
|
+
if (p) setTimeout(m, 0, z);
|
|
2407
|
+
else {
|
|
2408
|
+
var C = a[z];
|
|
2409
|
+
if (C) {
|
|
2410
|
+
p = !0;
|
|
2411
|
+
try {
|
|
2412
|
+
(function(U) {
|
|
2413
|
+
var T = U.callback, W = U.args;
|
|
2414
|
+
switch (W.length) {
|
|
2415
|
+
case 0:
|
|
2416
|
+
T();
|
|
2417
|
+
break;
|
|
2418
|
+
case 1:
|
|
2419
|
+
T(W[0]);
|
|
2420
|
+
break;
|
|
2421
|
+
case 2:
|
|
2422
|
+
T(W[0], W[1]);
|
|
2423
|
+
break;
|
|
2424
|
+
case 3:
|
|
2425
|
+
T(W[0], W[1], W[2]);
|
|
2426
|
+
break;
|
|
2427
|
+
default:
|
|
2428
|
+
T.apply(n, W);
|
|
2429
|
+
}
|
|
2430
|
+
})(C);
|
|
2431
|
+
} finally {
|
|
2432
|
+
l(z), p = !1;
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
function k(z) {
|
|
2438
|
+
z.source === o && typeof z.data == "string" && z.data.indexOf(_) === 0 && m(+z.data.slice(_.length));
|
|
2439
|
+
}
|
|
2440
|
+
})(typeof self > "u" ? i === void 0 ? this : i : self);
|
|
2441
|
+
}).call(this, typeof vt < "u" ? vt : typeof self < "u" ? self : typeof window < "u" ? window : {});
|
|
2442
|
+
}, {}] }, {}, [10])(10);
|
|
2443
|
+
});
|
|
2444
|
+
})(zt)), zt.exports;
|
|
2445
|
+
}
|
|
2446
|
+
var ee = te();
|
|
2447
|
+
const re = /* @__PURE__ */ Qt(ee), Ut = function(E, S) {
|
|
2448
|
+
return new Promise((r, w) => {
|
|
2449
|
+
const f = new re();
|
|
2450
|
+
E.forEach((i) => {
|
|
2451
|
+
f.file(i.name, i);
|
|
2452
|
+
}), f.generateAsync({ type: "blob" }).then((i) => {
|
|
2453
|
+
const o = Nt(i, `${S}.zip`);
|
|
2454
|
+
r(o);
|
|
2455
|
+
}, w);
|
|
2456
|
+
});
|
|
2457
|
+
}, ne = async function(E, S) {
|
|
2458
|
+
const r = await Ut(E, S);
|
|
2459
|
+
await mt(r, r.name);
|
|
2460
|
+
};
|
|
2461
|
+
async function ie(E, S) {
|
|
134
2462
|
try {
|
|
135
2463
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
136
|
-
await navigator.clipboard.writeText(
|
|
2464
|
+
await navigator.clipboard.writeText(E), S?.onSuccess && S.onSuccess(E);
|
|
137
2465
|
return;
|
|
138
2466
|
}
|
|
139
|
-
const
|
|
140
|
-
|
|
2467
|
+
const r = document.createElement("textarea");
|
|
2468
|
+
r.value = E, r.style.position = "fixed", r.style.top = "0", r.style.left = "0", r.style.width = "2em", r.style.height = "2em", r.style.padding = "0", r.style.border = "none", r.style.outline = "none", r.style.boxShadow = "none", r.style.background = "transparent", r.style.opacity = "0", document.body.appendChild(r), r.focus(), r.select();
|
|
141
2469
|
try {
|
|
142
2470
|
if (document.execCommand("copy"))
|
|
143
|
-
|
|
2471
|
+
S?.onSuccess && S.onSuccess(E);
|
|
144
2472
|
else
|
|
145
2473
|
throw new Error("execCommand 复制失败");
|
|
146
2474
|
} catch {
|
|
147
2475
|
throw new Error("无法使用 execCommand 复制文本");
|
|
148
2476
|
} finally {
|
|
149
|
-
document.body.removeChild(
|
|
2477
|
+
document.body.removeChild(r);
|
|
150
2478
|
}
|
|
151
|
-
} catch (
|
|
152
|
-
const
|
|
153
|
-
throw
|
|
2479
|
+
} catch (r) {
|
|
2480
|
+
const w = r instanceof Error ? r : new Error("未知错误");
|
|
2481
|
+
throw S?.onError ? S.onError(w) : console.error("复制到剪贴板失败:", w), w;
|
|
154
2482
|
}
|
|
155
2483
|
}
|
|
156
|
-
async function
|
|
2484
|
+
async function se() {
|
|
157
2485
|
try {
|
|
158
2486
|
if (navigator.clipboard && navigator.clipboard.readText)
|
|
159
2487
|
return await navigator.clipboard.readText();
|
|
160
2488
|
throw new Error("当前浏览器不支持读取剪贴板");
|
|
161
|
-
} catch (
|
|
162
|
-
throw console.error("从剪贴板读取失败:",
|
|
2489
|
+
} catch (E) {
|
|
2490
|
+
throw console.error("从剪贴板读取失败:", E), new Error("无法从剪贴板读取内容,请检查浏览器权限");
|
|
163
2491
|
}
|
|
164
2492
|
}
|
|
165
|
-
function
|
|
2493
|
+
function ae(E, S, r) {
|
|
166
2494
|
const {
|
|
167
|
-
download:
|
|
168
|
-
encoding:
|
|
169
|
-
} =
|
|
170
|
-
if (
|
|
171
|
-
|
|
2495
|
+
download: w = !0,
|
|
2496
|
+
encoding: f = "utf-8"
|
|
2497
|
+
} = r || {}, i = new Blob([E], { type: `text/plain;charset=${f}` });
|
|
2498
|
+
if (w) {
|
|
2499
|
+
mt(i, S);
|
|
172
2500
|
return;
|
|
173
2501
|
}
|
|
174
|
-
return new File([i],
|
|
2502
|
+
return new File([i], S, { type: `text/plain;charset=${f}` });
|
|
175
2503
|
}
|
|
176
|
-
function
|
|
177
|
-
if (
|
|
2504
|
+
function xt(E, S) {
|
|
2505
|
+
if (E == null)
|
|
178
2506
|
return "";
|
|
179
|
-
const
|
|
180
|
-
return
|
|
181
|
-
`) ||
|
|
2507
|
+
const r = String(E);
|
|
2508
|
+
return r.includes(S) || r.includes('"') || r.includes(`
|
|
2509
|
+
`) || r.includes("\r") ? `"${r.replace(/"/g, '""')}"` : r;
|
|
182
2510
|
}
|
|
183
|
-
function
|
|
2511
|
+
function oe(E, S, r = {}) {
|
|
184
2512
|
const {
|
|
185
|
-
separator:
|
|
186
|
-
includeHeader:
|
|
2513
|
+
separator: w = ",",
|
|
2514
|
+
includeHeader: f = !0,
|
|
187
2515
|
download: i = !0,
|
|
188
|
-
encoding:
|
|
189
|
-
} =
|
|
190
|
-
if (
|
|
2516
|
+
encoding: o = "utf-8"
|
|
2517
|
+
} = r;
|
|
2518
|
+
if (E.length === 0)
|
|
191
2519
|
throw new Error("数据不能为空");
|
|
192
|
-
let
|
|
193
|
-
if (typeof
|
|
194
|
-
const
|
|
195
|
-
new Set(
|
|
2520
|
+
let n = "";
|
|
2521
|
+
if (typeof E[0] == "object" && !Array.isArray(E[0])) {
|
|
2522
|
+
const _ = E, g = Array.from(
|
|
2523
|
+
new Set(_.flatMap((a) => Object.keys(a)))
|
|
196
2524
|
);
|
|
197
|
-
|
|
198
|
-
`),
|
|
199
|
-
const
|
|
200
|
-
const
|
|
201
|
-
return
|
|
2525
|
+
f && (n += g.join(w) + `
|
|
2526
|
+
`), _.forEach((a) => {
|
|
2527
|
+
const p = g.map((s) => {
|
|
2528
|
+
const c = a[s];
|
|
2529
|
+
return xt(c, w);
|
|
202
2530
|
});
|
|
203
|
-
|
|
2531
|
+
n += p.join(w) + `
|
|
204
2532
|
`;
|
|
205
2533
|
});
|
|
206
2534
|
} else {
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
const
|
|
210
|
-
(
|
|
2535
|
+
const _ = E;
|
|
2536
|
+
if (f && _.length > 0) {
|
|
2537
|
+
const g = _[0].map(
|
|
2538
|
+
(a) => xt(a, w)
|
|
211
2539
|
);
|
|
212
|
-
|
|
2540
|
+
n += g.join(w) + `
|
|
213
2541
|
`;
|
|
214
|
-
for (let
|
|
215
|
-
const
|
|
216
|
-
(
|
|
2542
|
+
for (let a = 1; a < _.length; a++) {
|
|
2543
|
+
const p = _[a].map(
|
|
2544
|
+
(s) => xt(s, w)
|
|
217
2545
|
);
|
|
218
|
-
|
|
2546
|
+
n += p.join(w) + `
|
|
219
2547
|
`;
|
|
220
2548
|
}
|
|
221
|
-
} else
|
|
222
|
-
const
|
|
223
|
-
(
|
|
2549
|
+
} else f || _.forEach((g) => {
|
|
2550
|
+
const a = g.map(
|
|
2551
|
+
(p) => xt(p, w)
|
|
224
2552
|
);
|
|
225
|
-
|
|
2553
|
+
n += a.join(w) + `
|
|
226
2554
|
`;
|
|
227
2555
|
});
|
|
228
2556
|
}
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
type: `text/csv;charset=${
|
|
2557
|
+
n = n.trimEnd();
|
|
2558
|
+
const y = "\uFEFF", v = new Blob([y + n], {
|
|
2559
|
+
type: `text/csv;charset=${o}`
|
|
232
2560
|
});
|
|
233
2561
|
if (i) {
|
|
234
|
-
|
|
2562
|
+
mt(v, S);
|
|
235
2563
|
return;
|
|
236
2564
|
}
|
|
237
|
-
return new File([
|
|
2565
|
+
return new File([v], S, { type: `text/csv;charset=${o}` });
|
|
238
2566
|
}
|
|
239
|
-
function
|
|
2567
|
+
function le(E, S, r = {}) {
|
|
240
2568
|
const {
|
|
241
|
-
pretty:
|
|
242
|
-
spaces:
|
|
2569
|
+
pretty: w = !0,
|
|
2570
|
+
spaces: f = 2,
|
|
243
2571
|
download: i = !0,
|
|
244
|
-
encoding:
|
|
245
|
-
} =
|
|
2572
|
+
encoding: o = "utf-8"
|
|
2573
|
+
} = r;
|
|
246
2574
|
try {
|
|
247
|
-
const
|
|
248
|
-
type: `application/json;charset=${
|
|
2575
|
+
const n = w ? JSON.stringify(E, null, f) : JSON.stringify(E), h = new Blob([n], {
|
|
2576
|
+
type: `application/json;charset=${o}`
|
|
249
2577
|
});
|
|
250
2578
|
if (i) {
|
|
251
|
-
|
|
2579
|
+
mt(h, S);
|
|
252
2580
|
return;
|
|
253
2581
|
}
|
|
254
|
-
return new File([
|
|
255
|
-
} catch (
|
|
256
|
-
throw console.error("JSON 序列化失败:",
|
|
2582
|
+
return new File([h], S, { type: `application/json;charset=${o}` });
|
|
2583
|
+
} catch (n) {
|
|
2584
|
+
throw console.error("JSON 序列化失败:", n), new Error("数据无法序列化为 JSON");
|
|
257
2585
|
}
|
|
258
2586
|
}
|
|
259
|
-
function
|
|
260
|
-
const
|
|
261
|
-
return
|
|
2587
|
+
function Ot(E) {
|
|
2588
|
+
const S = typeof E == "string" ? E : E.name, r = S.lastIndexOf(".");
|
|
2589
|
+
return r === -1 || r === S.length - 1 ? "" : S.slice(r).toLowerCase();
|
|
262
2590
|
}
|
|
263
|
-
function
|
|
264
|
-
const
|
|
265
|
-
return
|
|
2591
|
+
function ue(E) {
|
|
2592
|
+
const S = typeof E == "string" ? E : E.name, r = S.lastIndexOf(".");
|
|
2593
|
+
return r === -1 ? S : S.slice(0, r);
|
|
266
2594
|
}
|
|
267
|
-
function
|
|
2595
|
+
function he(E) {
|
|
268
2596
|
return {
|
|
269
|
-
name:
|
|
270
|
-
size:
|
|
271
|
-
type:
|
|
272
|
-
lastModified:
|
|
2597
|
+
name: E.name,
|
|
2598
|
+
size: E.size,
|
|
2599
|
+
type: E.type,
|
|
2600
|
+
lastModified: E.lastModified
|
|
273
2601
|
};
|
|
274
2602
|
}
|
|
275
|
-
function E
|
|
276
|
-
if (!
|
|
2603
|
+
function Pt(E, S) {
|
|
2604
|
+
if (!E || !S || S.length === 0)
|
|
277
2605
|
return !1;
|
|
278
|
-
const
|
|
279
|
-
return
|
|
280
|
-
const i =
|
|
2606
|
+
const r = E.type.toLowerCase(), w = Ot(E).toLowerCase();
|
|
2607
|
+
return S.some((f) => {
|
|
2608
|
+
const i = f.toLowerCase();
|
|
281
2609
|
if (i.endsWith("/*")) {
|
|
282
|
-
const
|
|
283
|
-
return
|
|
2610
|
+
const o = i.split("/")[0];
|
|
2611
|
+
return r.startsWith(`${o}/`);
|
|
284
2612
|
}
|
|
285
|
-
return i.startsWith(".") ?
|
|
2613
|
+
return i.startsWith(".") ? w === i : r === i;
|
|
286
2614
|
});
|
|
287
2615
|
}
|
|
288
|
-
function
|
|
289
|
-
return
|
|
2616
|
+
function jt(E, S) {
|
|
2617
|
+
return E ? E.size <= S : !1;
|
|
290
2618
|
}
|
|
291
|
-
function
|
|
292
|
-
if (!
|
|
2619
|
+
function St(E) {
|
|
2620
|
+
if (!E)
|
|
293
2621
|
return !1;
|
|
294
|
-
if (
|
|
2622
|
+
if (E.type.startsWith("image/"))
|
|
295
2623
|
return !0;
|
|
296
|
-
const
|
|
297
|
-
return
|
|
2624
|
+
const S = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico"], r = Ot(E);
|
|
2625
|
+
return S.includes(r);
|
|
298
2626
|
}
|
|
299
|
-
function
|
|
300
|
-
return new Promise((
|
|
301
|
-
if (!
|
|
302
|
-
|
|
2627
|
+
function Lt(E) {
|
|
2628
|
+
return new Promise((S, r) => {
|
|
2629
|
+
if (!St(E)) {
|
|
2630
|
+
r(new Error("文件不是有效的图片格式"));
|
|
303
2631
|
return;
|
|
304
2632
|
}
|
|
305
|
-
const
|
|
306
|
-
|
|
2633
|
+
const w = new FileReader();
|
|
2634
|
+
w.onload = (f) => {
|
|
307
2635
|
const i = new Image();
|
|
308
2636
|
i.onload = () => {
|
|
309
|
-
|
|
2637
|
+
S({
|
|
310
2638
|
width: i.width,
|
|
311
2639
|
height: i.height
|
|
312
2640
|
});
|
|
313
2641
|
}, i.onerror = () => {
|
|
314
|
-
|
|
315
|
-
}, i.src =
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
},
|
|
2642
|
+
r(new Error("图片加载失败"));
|
|
2643
|
+
}, i.src = f.target?.result;
|
|
2644
|
+
}, w.onerror = () => {
|
|
2645
|
+
r(new Error("文件读取失败"));
|
|
2646
|
+
}, w.readAsDataURL(E);
|
|
319
2647
|
});
|
|
320
2648
|
}
|
|
321
|
-
async function
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
324
|
-
const
|
|
325
|
-
|
|
2649
|
+
async function fe(E, S = {}) {
|
|
2650
|
+
const r = [];
|
|
2651
|
+
if (S.acceptTypes && S.acceptTypes.length > 0 && (Pt(E, S.acceptTypes) || r.push(`不支持的文件类型。接受:${S.acceptTypes.join(", ")}`)), S.maxSize !== void 0 && !jt(E, S.maxSize)) {
|
|
2652
|
+
const w = Wt(S.maxSize);
|
|
2653
|
+
r.push(`文件过大。最大允许:${w}`);
|
|
326
2654
|
}
|
|
327
|
-
if (
|
|
2655
|
+
if (S.mustBeImage && !St(E) && r.push("文件必须是图片格式"), St(E) && (S.minWidth !== void 0 || S.maxWidth !== void 0 || S.minHeight !== void 0 || S.maxHeight !== void 0))
|
|
328
2656
|
try {
|
|
329
|
-
const
|
|
330
|
-
|
|
2657
|
+
const w = await Lt(E);
|
|
2658
|
+
S.minWidth !== void 0 && w.width < S.minWidth && r.push(`图片宽度过小。最小宽度:${S.minWidth}px`), S.maxWidth !== void 0 && w.width > S.maxWidth && r.push(`图片宽度过大。最大宽度:${S.maxWidth}px`), S.minHeight !== void 0 && w.height < S.minHeight && r.push(`图片高度过小。最小高度:${S.minHeight}px`), S.maxHeight !== void 0 && w.height > S.maxHeight && r.push(`图片高度过大。最大高度:${S.maxHeight}px`);
|
|
331
2659
|
} catch {
|
|
332
|
-
|
|
2660
|
+
r.push("无法获取图片尺寸");
|
|
333
2661
|
}
|
|
334
2662
|
return {
|
|
335
|
-
valid:
|
|
336
|
-
errors:
|
|
2663
|
+
valid: r.length === 0,
|
|
2664
|
+
errors: r
|
|
337
2665
|
};
|
|
338
2666
|
}
|
|
339
|
-
function
|
|
340
|
-
if (
|
|
341
|
-
const
|
|
342
|
-
return parseFloat((
|
|
2667
|
+
function Wt(E, S = 2) {
|
|
2668
|
+
if (E === 0) return "0 B";
|
|
2669
|
+
const r = ["B", "KB", "MB", "GB", "TB"], w = 1024, f = Math.floor(Math.log(E) / Math.log(w));
|
|
2670
|
+
return parseFloat((E / Math.pow(w, f)).toFixed(S)) + " " + r[f];
|
|
2671
|
+
}
|
|
2672
|
+
function At(E) {
|
|
2673
|
+
if (E === null || typeof E != "object")
|
|
2674
|
+
return E;
|
|
2675
|
+
if (E instanceof Date)
|
|
2676
|
+
return new Date(E.getTime());
|
|
2677
|
+
if (E instanceof RegExp)
|
|
2678
|
+
return new RegExp(E.source, E.flags);
|
|
2679
|
+
if (Array.isArray(E))
|
|
2680
|
+
return E.map((r) => At(r));
|
|
2681
|
+
const S = {};
|
|
2682
|
+
for (const r in E)
|
|
2683
|
+
Object.prototype.hasOwnProperty.call(E, r) && (S[r] = At(E[r]));
|
|
2684
|
+
return S;
|
|
2685
|
+
}
|
|
2686
|
+
const ce = function(E, S = 2) {
|
|
2687
|
+
return Number(E.toFixed(S));
|
|
2688
|
+
};
|
|
2689
|
+
function de(E = location.href) {
|
|
2690
|
+
const S = {};
|
|
2691
|
+
return new URL(E).searchParams.forEach((w, f) => {
|
|
2692
|
+
S[f] = w;
|
|
2693
|
+
}), S;
|
|
2694
|
+
}
|
|
2695
|
+
function It(E, S) {
|
|
2696
|
+
const r = S || new FormData();
|
|
2697
|
+
return Object.keys(E).forEach((w) => {
|
|
2698
|
+
const f = E[w];
|
|
2699
|
+
f instanceof File ? r.append(w, f) : Array.isArray(f) ? f.forEach((i, o) => {
|
|
2700
|
+
typeof i == "object" && i !== null ? It({ [`${w}[${o}]`]: i }, r) : r.append(`${w}[${o}]`, i);
|
|
2701
|
+
}) : typeof f == "object" && f !== null && !(f instanceof Blob) ? It(f, r) : r.append(w, f);
|
|
2702
|
+
}), r;
|
|
2703
|
+
}
|
|
2704
|
+
function pe(E, S, r = !1) {
|
|
2705
|
+
const w = {}, f = new Set(S);
|
|
2706
|
+
if (r)
|
|
2707
|
+
for (const i of S)
|
|
2708
|
+
i in E && (w[i] = E[i]);
|
|
2709
|
+
else
|
|
2710
|
+
for (const i in E)
|
|
2711
|
+
Object.prototype.hasOwnProperty.call(E, i) && !f.has(i) && (w[i] = E[i]);
|
|
2712
|
+
return w;
|
|
2713
|
+
}
|
|
2714
|
+
function me(E = !1) {
|
|
2715
|
+
const S = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r) => {
|
|
2716
|
+
const w = Math.random() * 16 | 0;
|
|
2717
|
+
return (r === "x" ? w : w & 3 | 8).toString(16);
|
|
2718
|
+
});
|
|
2719
|
+
return E ? S.replace(/-/g, "") : S;
|
|
2720
|
+
}
|
|
2721
|
+
function _e(E) {
|
|
2722
|
+
return E.reduce((S, r) => S + r, 0);
|
|
2723
|
+
}
|
|
2724
|
+
function ge(E, S = 2) {
|
|
2725
|
+
if (isNaN(E)) return "0";
|
|
2726
|
+
const w = E.toFixed(S).split(".");
|
|
2727
|
+
return w[0] = w[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), w.join(".");
|
|
2728
|
+
}
|
|
2729
|
+
function Zt(E, S = 3, r = 4, w = "*") {
|
|
2730
|
+
if (!E || typeof E != "string") return "";
|
|
2731
|
+
const f = E.length;
|
|
2732
|
+
if (f <= S + r)
|
|
2733
|
+
return w.repeat(f);
|
|
2734
|
+
const i = E.substring(0, S), o = E.substring(f - r), n = f - S - r;
|
|
2735
|
+
return i + w.repeat(n) + o;
|
|
2736
|
+
}
|
|
2737
|
+
function be(E, S = "*") {
|
|
2738
|
+
return !E || E.length < 7 ? E : Zt(E, 3, 4, S);
|
|
2739
|
+
}
|
|
2740
|
+
class ye {
|
|
2741
|
+
// 提示语映射
|
|
2742
|
+
static messages = {
|
|
2743
|
+
email: "请输入正确的邮箱地址",
|
|
2744
|
+
number: "请输入合法的数字",
|
|
2745
|
+
phone: "请输入正确的 11 位手机号码",
|
|
2746
|
+
url: "请输入以 http/https/ftp/mapbox 开头的合法链接",
|
|
2747
|
+
ip: "请输入正确的 IP 地址 (0-255.0-255.0-255.0-255)",
|
|
2748
|
+
longitude: "经度应在 -180 到 180 之间",
|
|
2749
|
+
latitude: "纬度应在 -90 到 90 之间",
|
|
2750
|
+
noSpace: "内容不能包含空格",
|
|
2751
|
+
password: "密码需 8-18 位,含大小写字母、数字及特殊符号 (.|@|_)",
|
|
2752
|
+
empty: "内容不能为空",
|
|
2753
|
+
chinese: "内容必须包含中文",
|
|
2754
|
+
inputCoordinates: "坐标格式不正确或数值超出经纬度范围"
|
|
2755
|
+
};
|
|
2756
|
+
// --- 基础验证方法 ---
|
|
2757
|
+
static isEmail = (S) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(S);
|
|
2758
|
+
static isNumber = (S) => /^-?\d+(\.\d+)?$/.test(S);
|
|
2759
|
+
static isPhone = (S) => /^1[3-9]\d{9}$/.test(S);
|
|
2760
|
+
static isUrl = (S) => /^(https?|ftp|mapbox):\/\/[^\s/$.?#].[^\s]*$/i.test(S);
|
|
2761
|
+
static isIP = (S) => /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(S);
|
|
2762
|
+
static isNoSpace = (S) => typeof S == "string" && !/\s/.test(S);
|
|
2763
|
+
static isChinese = (S) => /[\u4e00-\u9fa5]/.test(S);
|
|
2764
|
+
static isPassword = (S) => /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[.@_])[\da-zA-Z.@_]{8,18}$/.test(S);
|
|
2765
|
+
/**
|
|
2766
|
+
* 验证经度
|
|
2767
|
+
* @param lng - 经度值
|
|
2768
|
+
* @returns boolean - 是否在 -180 到 180 之间
|
|
2769
|
+
*/
|
|
2770
|
+
static isLongitude(S) {
|
|
2771
|
+
const r = Number(S);
|
|
2772
|
+
return !isNaN(r) && r >= -180 && r <= 180;
|
|
2773
|
+
}
|
|
2774
|
+
/**
|
|
2775
|
+
* 验证纬度
|
|
2776
|
+
* @param lat - 纬度值
|
|
2777
|
+
* @returns boolean - 是否在 -90 到 90 之间
|
|
2778
|
+
*/
|
|
2779
|
+
static isLatitude(S) {
|
|
2780
|
+
const r = Number(S);
|
|
2781
|
+
return !isNaN(r) && r >= -90 && r <= 90;
|
|
2782
|
+
}
|
|
2783
|
+
/**
|
|
2784
|
+
* 检查是否为空
|
|
2785
|
+
* @param value - 需要检查的值
|
|
2786
|
+
* @returns boolean - 是否为空
|
|
2787
|
+
*/
|
|
2788
|
+
static isEmpty(S) {
|
|
2789
|
+
return S == null || S === "null" || S === "undefined" ? !0 : typeof S == "string" ? S.trim() === "" : Array.isArray(S) ? S.length === 0 : typeof S == "object" ? Object.keys(S).length === 0 : !1;
|
|
2790
|
+
}
|
|
2791
|
+
/**
|
|
2792
|
+
* 验证输入坐标串 (递归平铺校验)
|
|
2793
|
+
* 支持格式:"lng,lat" 或 "lng,lat;lng,lat" 或 "lng,lat;lng,lat|lng,lat"
|
|
2794
|
+
* @param latLngS - 坐标字符串
|
|
2795
|
+
* @returns boolean - 坐标格式是否正确
|
|
2796
|
+
*/
|
|
2797
|
+
static isInputCoordinates(S) {
|
|
2798
|
+
if (this.isEmpty(S)) return !1;
|
|
2799
|
+
try {
|
|
2800
|
+
const r = this.generateCoordinates(S);
|
|
2801
|
+
if (!r || r.length === 0) return !1;
|
|
2802
|
+
const w = (f) => typeof f[0] == "number" ? this.isLongitude(f[0]) && this.isLatitude(f[1]) : f.every((i) => w(i));
|
|
2803
|
+
return w(r);
|
|
2804
|
+
} catch {
|
|
2805
|
+
return !1;
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
/**
|
|
2809
|
+
* 生成坐标数组 (支持多级分隔符)
|
|
2810
|
+
* @param latLngS - 坐标字符串
|
|
2811
|
+
* @returns any[] | null - 解析后的坐标数组
|
|
2812
|
+
*/
|
|
2813
|
+
static generateCoordinates(S) {
|
|
2814
|
+
if (typeof S != "string") return null;
|
|
2815
|
+
if (S.includes("|"))
|
|
2816
|
+
return S.split("|").map((r) => this.generateCoordinates(r));
|
|
2817
|
+
if (S.includes(";"))
|
|
2818
|
+
return S.split(";").map((r) => this.generateCoordinates(r));
|
|
2819
|
+
if (S.includes(",")) {
|
|
2820
|
+
const r = S.split(",").map((w) => Number(w.trim()));
|
|
2821
|
+
return r.length >= 2 ? r : null;
|
|
2822
|
+
}
|
|
2823
|
+
return null;
|
|
2824
|
+
}
|
|
2825
|
+
/**
|
|
2826
|
+
* 快速生成 Form 表单校验规则
|
|
2827
|
+
* @param type - 对应 messages 的 key
|
|
2828
|
+
* @param trigger - 触发方式 'blur' | 'change'
|
|
2829
|
+
* @returns any - Element UI 表单验证规则对象
|
|
2830
|
+
*/
|
|
2831
|
+
static getRule(S, r = "blur") {
|
|
2832
|
+
return {
|
|
2833
|
+
validator: (w, f, i) => {
|
|
2834
|
+
if (this.isEmpty(f)) return i();
|
|
2835
|
+
const o = `is${S.charAt(0).toUpperCase() + S.slice(1)}`, n = this[o];
|
|
2836
|
+
if (n && !n.call(this, f))
|
|
2837
|
+
return i(new Error(this.messages[S] || "输入格式有误"));
|
|
2838
|
+
i();
|
|
2839
|
+
},
|
|
2840
|
+
trigger: r
|
|
2841
|
+
};
|
|
2842
|
+
}
|
|
2843
|
+
/**
|
|
2844
|
+
* 带错误消息的验证
|
|
2845
|
+
* @param type - 验证类型
|
|
2846
|
+
* @param value - 验证值
|
|
2847
|
+
* @returns IVerifyResult - 验证结果
|
|
2848
|
+
*/
|
|
2849
|
+
static validate(S, r) {
|
|
2850
|
+
const w = `is${S.charAt(0).toUpperCase() + S.slice(1)}`, f = this[w];
|
|
2851
|
+
if (f) {
|
|
2852
|
+
const i = f.call(this, r);
|
|
2853
|
+
return {
|
|
2854
|
+
valid: i,
|
|
2855
|
+
message: i ? void 0 : this.messages[S]
|
|
2856
|
+
};
|
|
2857
|
+
}
|
|
2858
|
+
return {
|
|
2859
|
+
valid: !1,
|
|
2860
|
+
message: "未知的验证类型"
|
|
2861
|
+
};
|
|
2862
|
+
}
|
|
343
2863
|
}
|
|
344
|
-
const
|
|
2864
|
+
const we = {
|
|
345
2865
|
// 读取
|
|
346
|
-
readFile:
|
|
347
|
-
readTxtFile:
|
|
348
|
-
readCsvFile:
|
|
349
|
-
readJsonFile:
|
|
2866
|
+
readFile: Et,
|
|
2867
|
+
readTxtFile: Gt,
|
|
2868
|
+
readCsvFile: Kt,
|
|
2869
|
+
readJsonFile: Jt,
|
|
350
2870
|
// 下载
|
|
351
|
-
downloadFile:
|
|
352
|
-
downloadBlob:
|
|
353
|
-
downloadBase64:
|
|
354
|
-
downloadMultiple:
|
|
2871
|
+
downloadFile: Dt,
|
|
2872
|
+
downloadBlob: mt,
|
|
2873
|
+
downloadBase64: Yt,
|
|
2874
|
+
downloadMultiple: Vt,
|
|
355
2875
|
// 转换
|
|
356
|
-
fileToBase64:
|
|
357
|
-
base64ToBlob:
|
|
2876
|
+
fileToBase64: Xt,
|
|
2877
|
+
base64ToBlob: qt,
|
|
2878
|
+
blobToFile: Nt,
|
|
2879
|
+
// 压缩
|
|
2880
|
+
fileListToZip: Ut,
|
|
2881
|
+
downloadFileListAsZip: ne,
|
|
358
2882
|
// 剪贴板
|
|
359
|
-
copyToClipboard:
|
|
360
|
-
pasteFromClipboard:
|
|
2883
|
+
copyToClipboard: ie,
|
|
2884
|
+
pasteFromClipboard: se,
|
|
361
2885
|
// 生成
|
|
362
|
-
generateTxtFile:
|
|
363
|
-
generateCsvFile:
|
|
364
|
-
generateJsonFile:
|
|
2886
|
+
generateTxtFile: ae,
|
|
2887
|
+
generateCsvFile: oe,
|
|
2888
|
+
generateJsonFile: le,
|
|
365
2889
|
// 验证
|
|
366
|
-
checkFileType:
|
|
367
|
-
checkFileSize:
|
|
368
|
-
isImage:
|
|
369
|
-
getImageDimensions:
|
|
370
|
-
validateFile:
|
|
371
|
-
formatFileSize:
|
|
2890
|
+
checkFileType: Pt,
|
|
2891
|
+
checkFileSize: jt,
|
|
2892
|
+
isImage: St,
|
|
2893
|
+
getImageDimensions: Lt,
|
|
2894
|
+
validateFile: fe,
|
|
2895
|
+
formatFileSize: Wt,
|
|
372
2896
|
// 工具
|
|
373
|
-
getFileExtension:
|
|
374
|
-
getFileNameWithoutExtension:
|
|
375
|
-
getFileInfo:
|
|
2897
|
+
getFileExtension: Ot,
|
|
2898
|
+
getFileNameWithoutExtension: ue,
|
|
2899
|
+
getFileInfo: he,
|
|
2900
|
+
// 辅助工具
|
|
2901
|
+
deepClone: At,
|
|
2902
|
+
numberFixed: ce,
|
|
2903
|
+
parseUrlParams: de,
|
|
2904
|
+
objectToFormData: It,
|
|
2905
|
+
omitKeys: pe,
|
|
2906
|
+
generateUUID: me,
|
|
2907
|
+
arraySum: _e,
|
|
2908
|
+
formatAmount: ge,
|
|
2909
|
+
maskString: Zt,
|
|
2910
|
+
formatPhone: be,
|
|
2911
|
+
VerifyUtils: ye
|
|
376
2912
|
};
|
|
377
2913
|
export {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
2914
|
+
ye as VerifyUtils,
|
|
2915
|
+
_e as arraySum,
|
|
2916
|
+
qt as base64ToBlob,
|
|
2917
|
+
Nt as blobToFile,
|
|
2918
|
+
jt as checkFileSize,
|
|
2919
|
+
Pt as checkFileType,
|
|
2920
|
+
ie as copyToClipboard,
|
|
2921
|
+
At as deepClone,
|
|
2922
|
+
we as default,
|
|
2923
|
+
Yt as downloadBase64,
|
|
2924
|
+
mt as downloadBlob,
|
|
2925
|
+
Dt as downloadFile,
|
|
2926
|
+
ne as downloadFileListAsZip,
|
|
2927
|
+
Vt as downloadMultiple,
|
|
2928
|
+
Ut as fileListToZip,
|
|
2929
|
+
Xt as fileToBase64,
|
|
2930
|
+
ge as formatAmount,
|
|
2931
|
+
Wt as formatFileSize,
|
|
2932
|
+
be as formatPhone,
|
|
2933
|
+
oe as generateCsvFile,
|
|
2934
|
+
le as generateJsonFile,
|
|
2935
|
+
ae as generateTxtFile,
|
|
2936
|
+
me as generateUUID,
|
|
2937
|
+
Ot as getFileExtension,
|
|
2938
|
+
he as getFileInfo,
|
|
2939
|
+
ue as getFileNameWithoutExtension,
|
|
2940
|
+
Lt as getImageDimensions,
|
|
2941
|
+
St as isImage,
|
|
2942
|
+
Zt as maskString,
|
|
2943
|
+
ce as numberFixed,
|
|
2944
|
+
It as objectToFormData,
|
|
2945
|
+
pe as omitKeys,
|
|
2946
|
+
de as parseUrlParams,
|
|
2947
|
+
se as pasteFromClipboard,
|
|
2948
|
+
Kt as readCsvFile,
|
|
2949
|
+
Et as readFile,
|
|
2950
|
+
Jt as readJsonFile,
|
|
2951
|
+
Gt as readTxtFile,
|
|
2952
|
+
fe as validateFile
|
|
403
2953
|
};
|