(function webpackUniversalModuleDefinition(root, factory) { if (typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if (typeof define === 'function' && define.amd) define([], factory); else if (typeof exports === 'object') exports['loaders'] = factory(); else root['loaders'] = factory();})(globalThis, function () { "use strict"; var __exports__ = (() => { var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) { if (typeof require !== "undefined") return require.apply(this, arguments); throw new Error('Dynamic require of "' + x + '" is not supported'); }); var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // external-global-plugin:@loaders.gl/core var require_core = __commonJS({ "external-global-plugin:@loaders.gl/core"(exports, module) { module.exports = globalThis.loaders; } }); // ../../node_modules/jszip/dist/jszip.min.js var require_jszip_min = __commonJS({ "../../node_modules/jszip/dist/jszip.min.js"(exports, module) { !function(e) { if ("object" == typeof exports && "undefined" != typeof module) module.exports = e(); else if ("function" == typeof define && define.amd) define([], e); else { ("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).JSZip = e(); } }(function() { return function s(a, o, h) { function u(r, e2) { if (!o[r]) { if (!a[r]) { var t = "function" == typeof __require && __require; if (!e2 && t) return t(r, true); if (l) return l(r, true); var n = new Error("Cannot find module '" + r + "'"); throw n.code = "MODULE_NOT_FOUND", n; } var i = o[r] = { exports: {} }; a[r][0].call(i.exports, function(e3) { var t2 = a[r][1][e3]; return u(t2 || e3); }, i, i.exports, s, a, o, h); } return o[r].exports; } for (var l = "function" == typeof __require && __require, e = 0; e < h.length; e++) u(h[e]); return u; }({ 1: [function(e, t, r) { "use strict"; var d = e("./utils"), c = e("./support"), p = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; r.encode = function(e2) { for (var t2, r2, n, i, s, a, o, h = [], u = 0, l = e2.length, f = l, c2 = "string" !== d.getTypeOf(e2); u < e2.length; ) f = l - u, n = c2 ? (t2 = e2[u++], r2 = u < l ? e2[u++] : 0, u < l ? e2[u++] : 0) : (t2 = e2.charCodeAt(u++), r2 = u < l ? e2.charCodeAt(u++) : 0, u < l ? e2.charCodeAt(u++) : 0), i = t2 >> 2, s = (3 & t2) << 4 | r2 >> 4, a = 1 < f ? (15 & r2) << 2 | n >> 6 : 64, o = 2 < f ? 63 & n : 64, h.push(p.charAt(i) + p.charAt(s) + p.charAt(a) + p.charAt(o)); return h.join(""); }, r.decode = function(e2) { var t2, r2, n, i, s, a, o = 0, h = 0, u = "data:"; if (e2.substr(0, u.length) === u) throw new Error("Invalid base64 input, it looks like a data url."); var l, f = 3 * (e2 = e2.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4; if (e2.charAt(e2.length - 1) === p.charAt(64) && f--, e2.charAt(e2.length - 2) === p.charAt(64) && f--, f % 1 != 0) throw new Error("Invalid base64 input, bad content length."); for (l = c.uint8array ? new Uint8Array(0 | f) : new Array(0 | f); o < e2.length; ) t2 = p.indexOf(e2.charAt(o++)) << 2 | (i = p.indexOf(e2.charAt(o++))) >> 4, r2 = (15 & i) << 4 | (s = p.indexOf(e2.charAt(o++))) >> 2, n = (3 & s) << 6 | (a = p.indexOf(e2.charAt(o++))), l[h++] = t2, 64 !== s && (l[h++] = r2), 64 !== a && (l[h++] = n); return l; }; }, { "./support": 30, "./utils": 32 }], 2: [function(e, t, r) { "use strict"; var n = e("./external"), i = e("./stream/DataWorker"), s = e("./stream/Crc32Probe"), a = e("./stream/DataLengthProbe"); function o(e2, t2, r2, n2, i2) { this.compressedSize = e2, this.uncompressedSize = t2, this.crc32 = r2, this.compression = n2, this.compressedContent = i2; } o.prototype = { getContentWorker: function() { var e2 = new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")), t2 = this; return e2.on("end", function() { if (this.streamInfo.data_length !== t2.uncompressedSize) throw new Error("Bug : uncompressed data size mismatch"); }), e2; }, getCompressedWorker: function() { return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression); } }, o.createWorkerFrom = function(e2, t2, r2) { return e2.pipe(new s()).pipe(new a("uncompressedSize")).pipe(t2.compressWorker(r2)).pipe(new a("compressedSize")).withStreamInfo("compression", t2); }, t.exports = o; }, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(e, t, r) { "use strict"; var n = e("./stream/GenericWorker"); r.STORE = { magic: "\0\0", compressWorker: function() { return new n("STORE compression"); }, uncompressWorker: function() { return new n("STORE decompression"); } }, r.DEFLATE = e("./flate"); }, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(e, t, r) { "use strict"; var n = e("./utils"); var o = function() { for (var e2, t2 = [], r2 = 0; r2 < 256; r2++) { e2 = r2; for (var n2 = 0; n2 < 8; n2++) e2 = 1 & e2 ? 3988292384 ^ e2 >>> 1 : e2 >>> 1; t2[r2] = e2; } return t2; }(); t.exports = function(e2, t2) { return void 0 !== e2 && e2.length ? "string" !== n.getTypeOf(e2) ? function(e3, t3, r2, n2) { var i = o, s = n2 + r2; e3 ^= -1; for (var a = n2; a < s; a++) e3 = e3 >>> 8 ^ i[255 & (e3 ^ t3[a])]; return -1 ^ e3; }(0 | t2, e2, e2.length, 0) : function(e3, t3, r2, n2) { var i = o, s = n2 + r2; e3 ^= -1; for (var a = n2; a < s; a++) e3 = e3 >>> 8 ^ i[255 & (e3 ^ t3.charCodeAt(a))]; return -1 ^ e3; }(0 | t2, e2, e2.length, 0) : 0; }; }, { "./utils": 32 }], 5: [function(e, t, r) { "use strict"; r.base64 = false, r.binary = false, r.dir = false, r.createFolders = true, r.date = null, r.compression = null, r.compressionOptions = null, r.comment = null, r.unixPermissions = null, r.dosPermissions = null; }, {}], 6: [function(e, t, r) { "use strict"; var n = null; n = "undefined" != typeof Promise ? Promise : e("lie"), t.exports = { Promise: n }; }, { lie: 37 }], 7: [function(e, t, r) { "use strict"; var n = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Uint32Array, i = e("pako"), s = e("./utils"), a = e("./stream/GenericWorker"), o = n ? "uint8array" : "array"; function h(e2, t2) { a.call(this, "FlateWorker/" + e2), this._pako = null, this._pakoAction = e2, this._pakoOptions = t2, this.meta = {}; } r.magic = "\b\0", s.inherits(h, a), h.prototype.processChunk = function(e2) { this.meta = e2.meta, null === this._pako && this._createPako(), this._pako.push(s.transformTo(o, e2.data), false); }, h.prototype.flush = function() { a.prototype.flush.call(this), null === this._pako && this._createPako(), this._pako.push([], true); }, h.prototype.cleanUp = function() { a.prototype.cleanUp.call(this), this._pako = null; }, h.prototype._createPako = function() { this._pako = new i[this._pakoAction]({ raw: true, level: this._pakoOptions.level || -1 }); var t2 = this; this._pako.onData = function(e2) { t2.push({ data: e2, meta: t2.meta }); }; }, r.compressWorker = function(e2) { return new h("Deflate", e2); }, r.uncompressWorker = function() { return new h("Inflate", {}); }; }, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(e, t, r) { "use strict"; function A(e2, t2) { var r2, n2 = ""; for (r2 = 0; r2 < t2; r2++) n2 += String.fromCharCode(255 & e2), e2 >>>= 8; return n2; } function n(e2, t2, r2, n2, i2, s2) { var a, o, h = e2.file, u = e2.compression, l = s2 !== O.utf8encode, f = I.transformTo("string", s2(h.name)), c = I.transformTo("string", O.utf8encode(h.name)), d = h.comment, p = I.transformTo("string", s2(d)), m = I.transformTo("string", O.utf8encode(d)), _ = c.length !== h.name.length, g = m.length !== d.length, b = "", v = "", y = "", w = h.dir, k = h.date, x = { crc32: 0, compressedSize: 0, uncompressedSize: 0 }; t2 && !r2 || (x.crc32 = e2.crc32, x.compressedSize = e2.compressedSize, x.uncompressedSize = e2.uncompressedSize); var S = 0; t2 && (S |= 8), l || !_ && !g || (S |= 2048); var z = 0, C = 0; w && (z |= 16), "UNIX" === i2 ? (C = 798, z |= function(e3, t3) { var r3 = e3; return e3 || (r3 = t3 ? 16893 : 33204), (65535 & r3) << 16; }(h.unixPermissions, w)) : (C = 20, z |= function(e3) { return 63 & (e3 || 0); }(h.dosPermissions)), a = k.getUTCHours(), a <<= 6, a |= k.getUTCMinutes(), a <<= 5, a |= k.getUTCSeconds() / 2, o = k.getUTCFullYear() - 1980, o <<= 4, o |= k.getUTCMonth() + 1, o <<= 5, o |= k.getUTCDate(), _ && (v = A(1, 1) + A(B(f), 4) + c, b += "up" + A(v.length, 2) + v), g && (y = A(1, 1) + A(B(p), 4) + m, b += "uc" + A(y.length, 2) + y); var E = ""; return E += "\n\0", E += A(S, 2), E += u.magic, E += A(a, 2), E += A(o, 2), E += A(x.crc32, 4), E += A(x.compressedSize, 4), E += A(x.uncompressedSize, 4), E += A(f.length, 2), E += A(b.length, 2), { fileRecord: R.LOCAL_FILE_HEADER + E + f + b, dirRecord: R.CENTRAL_FILE_HEADER + A(C, 2) + E + A(p.length, 2) + "\0\0\0\0" + A(z, 4) + A(n2, 4) + f + b + p }; } var I = e("../utils"), i = e("../stream/GenericWorker"), O = e("../utf8"), B = e("../crc32"), R = e("../signature"); function s(e2, t2, r2, n2) { i.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = t2, this.zipPlatform = r2, this.encodeFileName = n2, this.streamFiles = e2, this.accumulate = false, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = []; } I.inherits(s, i), s.prototype.push = function(e2) { var t2 = e2.meta.percent || 0, r2 = this.entriesCount, n2 = this._sources.length; this.accumulate ? this.contentBuffer.push(e2) : (this.bytesWritten += e2.data.length, i.prototype.push.call(this, { data: e2.data, meta: { currentFile: this.currentFile, percent: r2 ? (t2 + 100 * (r2 - n2 - 1)) / r2 : 100 } })); }, s.prototype.openedSource = function(e2) { this.currentSourceOffset = this.bytesWritten, this.currentFile = e2.file.name; var t2 = this.streamFiles && !e2.file.dir; if (t2) { var r2 = n(e2, t2, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); this.push({ data: r2.fileRecord, meta: { percent: 0 } }); } else this.accumulate = true; }, s.prototype.closedSource = function(e2) { this.accumulate = false; var t2 = this.streamFiles && !e2.file.dir, r2 = n(e2, t2, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); if (this.dirRecords.push(r2.dirRecord), t2) this.push({ data: function(e3) { return R.DATA_DESCRIPTOR + A(e3.crc32, 4) + A(e3.compressedSize, 4) + A(e3.uncompressedSize, 4); }(e2), meta: { percent: 100 } }); else for (this.push({ data: r2.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift()); this.currentFile = null; }, s.prototype.flush = function() { for (var e2 = this.bytesWritten, t2 = 0; t2 < this.dirRecords.length; t2++) this.push({ data: this.dirRecords[t2], meta: { percent: 100 } }); var r2 = this.bytesWritten - e2, n2 = function(e3, t3, r3, n3, i2) { var s2 = I.transformTo("string", i2(n3)); return R.CENTRAL_DIRECTORY_END + "\0\0\0\0" + A(e3, 2) + A(e3, 2) + A(t3, 4) + A(r3, 4) + A(s2.length, 2) + s2; }(this.dirRecords.length, r2, e2, this.zipComment, this.encodeFileName); this.push({ data: n2, meta: { percent: 100 } }); }, s.prototype.prepareNextSource = function() { this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume(); }, s.prototype.registerPrevious = function(e2) { this._sources.push(e2); var t2 = this; return e2.on("data", function(e3) { t2.processChunk(e3); }), e2.on("end", function() { t2.closedSource(t2.previous.streamInfo), t2._sources.length ? t2.prepareNextSource() : t2.end(); }), e2.on("error", function(e3) { t2.error(e3); }), this; }, s.prototype.resume = function() { return !!i.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), true) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), true)); }, s.prototype.error = function(e2) { var t2 = this._sources; if (!i.prototype.error.call(this, e2)) return false; for (var r2 = 0; r2 < t2.length; r2++) try { t2[r2].error(e2); } catch (e3) { } return true; }, s.prototype.lock = function() { i.prototype.lock.call(this); for (var e2 = this._sources, t2 = 0; t2 < e2.length; t2++) e2[t2].lock(); }, t.exports = s; }, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(e, t, r) { "use strict"; var u = e("../compressions"), n = e("./ZipFileWorker"); r.generateWorker = function(e2, a, t2) { var o = new n(a.streamFiles, t2, a.platform, a.encodeFileName), h = 0; try { e2.forEach(function(e3, t3) { h++; var r2 = function(e4, t4) { var r3 = e4 || t4, n3 = u[r3]; if (!n3) throw new Error(r3 + " is not a valid compression method !"); return n3; }(t3.options.compression, a.compression), n2 = t3.options.compressionOptions || a.compressionOptions || {}, i = t3.dir, s = t3.date; t3._compressWorker(r2, n2).withStreamInfo("file", { name: e3, dir: i, date: s, comment: t3.comment || "", unixPermissions: t3.unixPermissions, dosPermissions: t3.dosPermissions }).pipe(o); }), o.entriesCount = h; } catch (e3) { o.error(e3); } return o; }; }, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(e, t, r) { "use strict"; function n() { if (!(this instanceof n)) return new n(); if (arguments.length) throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide."); this.files = /* @__PURE__ */ Object.create(null), this.comment = null, this.root = "", this.clone = function() { var e2 = new n(); for (var t2 in this) "function" != typeof this[t2] && (e2[t2] = this[t2]); return e2; }; } (n.prototype = e("./object")).loadAsync = e("./load"), n.support = e("./support"), n.defaults = e("./defaults"), n.version = "3.10.1", n.loadAsync = function(e2, t2) { return new n().loadAsync(e2, t2); }, n.external = e("./external"), t.exports = n; }, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(e, t, r) { "use strict"; var u = e("./utils"), i = e("./external"), n = e("./utf8"), s = e("./zipEntries"), a = e("./stream/Crc32Probe"), l = e("./nodejsUtils"); function f(n2) { return new i.Promise(function(e2, t2) { var r2 = n2.decompressed.getContentWorker().pipe(new a()); r2.on("error", function(e3) { t2(e3); }).on("end", function() { r2.streamInfo.crc32 !== n2.decompressed.crc32 ? t2(new Error("Corrupted zip : CRC32 mismatch")) : e2(); }).resume(); }); } t.exports = function(e2, o) { var h = this; return o = u.extend(o || {}, { base64: false, checkCRC32: false, optimizedBinaryString: false, createFolders: false, decodeFileName: n.utf8decode }), l.isNode && l.isStream(e2) ? i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : u.prepareContent("the loaded zip file", e2, true, o.optimizedBinaryString, o.base64).then(function(e3) { var t2 = new s(o); return t2.load(e3), t2; }).then(function(e3) { var t2 = [i.Promise.resolve(e3)], r2 = e3.files; if (o.checkCRC32) for (var n2 = 0; n2 < r2.length; n2++) t2.push(f(r2[n2])); return i.Promise.all(t2); }).then(function(e3) { for (var t2 = e3.shift(), r2 = t2.files, n2 = 0; n2 < r2.length; n2++) { var i2 = r2[n2], s2 = i2.fileNameStr, a2 = u.resolve(i2.fileNameStr); h.file(a2, i2.decompressed, { binary: true, optimizedBinaryString: true, date: i2.date, dir: i2.dir, comment: i2.fileCommentStr.length ? i2.fileCommentStr : null, unixPermissions: i2.unixPermissions, dosPermissions: i2.dosPermissions, createFolders: o.createFolders }), i2.dir || (h.file(a2).unsafeOriginalName = s2); } return t2.zipComment.length && (h.comment = t2.zipComment), h; }); }; }, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(e, t, r) { "use strict"; var n = e("../utils"), i = e("../stream/GenericWorker"); function s(e2, t2) { i.call(this, "Nodejs stream input adapter for " + e2), this._upstreamEnded = false, this._bindStream(t2); } n.inherits(s, i), s.prototype._bindStream = function(e2) { var t2 = this; (this._stream = e2).pause(), e2.on("data", function(e3) { t2.push({ data: e3, meta: { percent: 0 } }); }).on("error", function(e3) { t2.isPaused ? this.generatedError = e3 : t2.error(e3); }).on("end", function() { t2.isPaused ? t2._upstreamEnded = true : t2.end(); }); }, s.prototype.pause = function() { return !!i.prototype.pause.call(this) && (this._stream.pause(), true); }, s.prototype.resume = function() { return !!i.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), true); }, t.exports = s; }, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(e, t, r) { "use strict"; var i = e("readable-stream").Readable; function n(e2, t2, r2) { i.call(this, t2), this._helper = e2; var n2 = this; e2.on("data", function(e3, t3) { n2.push(e3) || n2._helper.pause(), r2 && r2(t3); }).on("error", function(e3) { n2.emit("error", e3); }).on("end", function() { n2.push(null); }); } e("../utils").inherits(n, i), n.prototype._read = function() { this._helper.resume(); }, t.exports = n; }, { "../utils": 32, "readable-stream": 16 }], 14: [function(e, t, r) { "use strict"; t.exports = { isNode: "undefined" != typeof Buffer, newBufferFrom: function(e2, t2) { if (Buffer.from && Buffer.from !== Uint8Array.from) return Buffer.from(e2, t2); if ("number" == typeof e2) throw new Error('The "data" argument must not be a number'); return new Buffer(e2, t2); }, allocBuffer: function(e2) { if (Buffer.alloc) return Buffer.alloc(e2); var t2 = new Buffer(e2); return t2.fill(0), t2; }, isBuffer: function(e2) { return Buffer.isBuffer(e2); }, isStream: function(e2) { return e2 && "function" == typeof e2.on && "function" == typeof e2.pause && "function" == typeof e2.resume; } }; }, {}], 15: [function(e, t, r) { "use strict"; function s(e2, t2, r2) { var n2, i2 = u.getTypeOf(t2), s2 = u.extend(r2 || {}, f); s2.date = s2.date || new Date(), null !== s2.compression && (s2.compression = s2.compression.toUpperCase()), "string" == typeof s2.unixPermissions && (s2.unixPermissions = parseInt(s2.unixPermissions, 8)), s2.unixPermissions && 16384 & s2.unixPermissions && (s2.dir = true), s2.dosPermissions && 16 & s2.dosPermissions && (s2.dir = true), s2.dir && (e2 = g(e2)), s2.createFolders && (n2 = _(e2)) && b.call(this, n2, true); var a2 = "string" === i2 && false === s2.binary && false === s2.base64; r2 && void 0 !== r2.binary || (s2.binary = !a2), (t2 instanceof c && 0 === t2.uncompressedSize || s2.dir || !t2 || 0 === t2.length) && (s2.base64 = false, s2.binary = true, t2 = "", s2.compression = "STORE", i2 = "string"); var o2 = null; o2 = t2 instanceof c || t2 instanceof l ? t2 : p.isNode && p.isStream(t2) ? new m(e2, t2) : u.prepareContent(e2, t2, s2.binary, s2.optimizedBinaryString, s2.base64); var h2 = new d(e2, o2, s2); this.files[e2] = h2; } var i = e("./utf8"), u = e("./utils"), l = e("./stream/GenericWorker"), a = e("./stream/StreamHelper"), f = e("./defaults"), c = e("./compressedObject"), d = e("./zipObject"), o = e("./generate"), p = e("./nodejsUtils"), m = e("./nodejs/NodejsStreamInputAdapter"), _ = function(e2) { "/" === e2.slice(-1) && (e2 = e2.substring(0, e2.length - 1)); var t2 = e2.lastIndexOf("/"); return 0 < t2 ? e2.substring(0, t2) : ""; }, g = function(e2) { return "/" !== e2.slice(-1) && (e2 += "/"), e2; }, b = function(e2, t2) { return t2 = void 0 !== t2 ? t2 : f.createFolders, e2 = g(e2), this.files[e2] || s.call(this, e2, null, { dir: true, createFolders: t2 }), this.files[e2]; }; function h(e2) { return "[object RegExp]" === Object.prototype.toString.call(e2); } var n = { load: function() { throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); }, forEach: function(e2) { var t2, r2, n2; for (t2 in this.files) n2 = this.files[t2], (r2 = t2.slice(this.root.length, t2.length)) && t2.slice(0, this.root.length) === this.root && e2(r2, n2); }, filter: function(r2) { var n2 = []; return this.forEach(function(e2, t2) { r2(e2, t2) && n2.push(t2); }), n2; }, file: function(e2, t2, r2) { if (1 !== arguments.length) return e2 = this.root + e2, s.call(this, e2, t2, r2), this; if (h(e2)) { var n2 = e2; return this.filter(function(e3, t3) { return !t3.dir && n2.test(e3); }); } var i2 = this.files[this.root + e2]; return i2 && !i2.dir ? i2 : null; }, folder: function(r2) { if (!r2) return this; if (h(r2)) return this.filter(function(e3, t3) { return t3.dir && r2.test(e3); }); var e2 = this.root + r2, t2 = b.call(this, e2), n2 = this.clone(); return n2.root = t2.name, n2; }, remove: function(r2) { r2 = this.root + r2; var e2 = this.files[r2]; if (e2 || ("/" !== r2.slice(-1) && (r2 += "/"), e2 = this.files[r2]), e2 && !e2.dir) delete this.files[r2]; else for (var t2 = this.filter(function(e3, t3) { return t3.name.slice(0, r2.length) === r2; }), n2 = 0; n2 < t2.length; n2++) delete this.files[t2[n2].name]; return this; }, generate: function() { throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); }, generateInternalStream: function(e2) { var t2, r2 = {}; try { if ((r2 = u.extend(e2 || {}, { streamFiles: false, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: i.utf8encode })).type = r2.type.toLowerCase(), r2.compression = r2.compression.toUpperCase(), "binarystring" === r2.type && (r2.type = "string"), !r2.type) throw new Error("No output type specified."); u.checkSupport(r2.type), "darwin" !== r2.platform && "freebsd" !== r2.platform && "linux" !== r2.platform && "sunos" !== r2.platform || (r2.platform = "UNIX"), "win32" === r2.platform && (r2.platform = "DOS"); var n2 = r2.comment || this.comment || ""; t2 = o.generateWorker(this, r2, n2); } catch (e3) { (t2 = new l("error")).error(e3); } return new a(t2, r2.type || "string", r2.mimeType); }, generateAsync: function(e2, t2) { return this.generateInternalStream(e2).accumulate(t2); }, generateNodeStream: function(e2, t2) { return (e2 = e2 || {}).type || (e2.type = "nodebuffer"), this.generateInternalStream(e2).toNodejsStream(t2); } }; t.exports = n; }, { "./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(e, t, r) { "use strict"; t.exports = e("stream"); }, { stream: void 0 }], 17: [function(e, t, r) { "use strict"; var n = e("./DataReader"); function i(e2) { n.call(this, e2); for (var t2 = 0; t2 < this.data.length; t2++) e2[t2] = 255 & e2[t2]; } e("../utils").inherits(i, n), i.prototype.byteAt = function(e2) { return this.data[this.zero + e2]; }, i.prototype.lastIndexOfSignature = function(e2) { for (var t2 = e2.charCodeAt(0), r2 = e2.charCodeAt(1), n2 = e2.charCodeAt(2), i2 = e2.charCodeAt(3), s = this.length - 4; 0 <= s; --s) if (this.data[s] === t2 && this.data[s + 1] === r2 && this.data[s + 2] === n2 && this.data[s + 3] === i2) return s - this.zero; return -1; }, i.prototype.readAndCheckSignature = function(e2) { var t2 = e2.charCodeAt(0), r2 = e2.charCodeAt(1), n2 = e2.charCodeAt(2), i2 = e2.charCodeAt(3), s = this.readData(4); return t2 === s[0] && r2 === s[1] && n2 === s[2] && i2 === s[3]; }, i.prototype.readData = function(e2) { if (this.checkOffset(e2), 0 === e2) return []; var t2 = this.data.slice(this.zero + this.index, this.zero + this.index + e2); return this.index += e2, t2; }, t.exports = i; }, { "../utils": 32, "./DataReader": 18 }], 18: [function(e, t, r) { "use strict"; var n = e("../utils"); function i(e2) { this.data = e2, this.length = e2.length, this.index = 0, this.zero = 0; } i.prototype = { checkOffset: function(e2) { this.checkIndex(this.index + e2); }, checkIndex: function(e2) { if (this.length < this.zero + e2 || e2 < 0) throw new Error("End of data reached (data length = " + this.length + ", asked index = " + e2 + "). Corrupted zip ?"); }, setIndex: function(e2) { this.checkIndex(e2), this.index = e2; }, skip: function(e2) { this.setIndex(this.index + e2); }, byteAt: function() { }, readInt: function(e2) { var t2, r2 = 0; for (this.checkOffset(e2), t2 = this.index + e2 - 1; t2 >= this.index; t2--) r2 = (r2 << 8) + this.byteAt(t2); return this.index += e2, r2; }, readString: function(e2) { return n.transformTo("string", this.readData(e2)); }, readData: function() { }, lastIndexOfSignature: function() { }, readAndCheckSignature: function() { }, readDate: function() { var e2 = this.readInt(4); return new Date(Date.UTC(1980 + (e2 >> 25 & 127), (e2 >> 21 & 15) - 1, e2 >> 16 & 31, e2 >> 11 & 31, e2 >> 5 & 63, (31 & e2) << 1)); } }, t.exports = i; }, { "../utils": 32 }], 19: [function(e, t, r) { "use strict"; var n = e("./Uint8ArrayReader"); function i(e2) { n.call(this, e2); } e("../utils").inherits(i, n), i.prototype.readData = function(e2) { this.checkOffset(e2); var t2 = this.data.slice(this.zero + this.index, this.zero + this.index + e2); return this.index += e2, t2; }, t.exports = i; }, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function(e, t, r) { "use strict"; var n = e("./DataReader"); function i(e2) { n.call(this, e2); } e("../utils").inherits(i, n), i.prototype.byteAt = function(e2) { return this.data.charCodeAt(this.zero + e2); }, i.prototype.lastIndexOfSignature = function(e2) { return this.data.lastIndexOf(e2) - this.zero; }, i.prototype.readAndCheckSignature = function(e2) { return e2 === this.readData(4); }, i.prototype.readData = function(e2) { this.checkOffset(e2); var t2 = this.data.slice(this.zero + this.index, this.zero + this.index + e2); return this.index += e2, t2; }, t.exports = i; }, { "../utils": 32, "./DataReader": 18 }], 21: [function(e, t, r) { "use strict"; var n = e("./ArrayReader"); function i(e2) { n.call(this, e2); } e("../utils").inherits(i, n), i.prototype.readData = function(e2) { if (this.checkOffset(e2), 0 === e2) return new Uint8Array(0); var t2 = this.data.subarray(this.zero + this.index, this.zero + this.index + e2); return this.index += e2, t2; }, t.exports = i; }, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(e, t, r) { "use strict"; var n = e("../utils"), i = e("../support"), s = e("./ArrayReader"), a = e("./StringReader"), o = e("./NodeBufferReader"), h = e("./Uint8ArrayReader"); t.exports = function(e2) { var t2 = n.getTypeOf(e2); return n.checkSupport(t2), "string" !== t2 || i.uint8array ? "nodebuffer" === t2 ? new o(e2) : i.uint8array ? new h(n.transformTo("uint8array", e2)) : new s(n.transformTo("array", e2)) : new a(e2); }; }, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(e, t, r) { "use strict"; r.LOCAL_FILE_HEADER = "PK", r.CENTRAL_FILE_HEADER = "PK", r.CENTRAL_DIRECTORY_END = "PK", r.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", r.ZIP64_CENTRAL_DIRECTORY_END = "PK", r.DATA_DESCRIPTOR = "PK\x07\b"; }, {}], 24: [function(e, t, r) { "use strict"; var n = e("./GenericWorker"), i = e("../utils"); function s(e2) { n.call(this, "ConvertWorker to " + e2), this.destType = e2; } i.inherits(s, n), s.prototype.processChunk = function(e2) { this.push({ data: i.transformTo(this.destType, e2.data), meta: e2.meta }); }, t.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 25: [function(e, t, r) { "use strict"; var n = e("./GenericWorker"), i = e("../crc32"); function s() { n.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0); } e("../utils").inherits(s, n), s.prototype.processChunk = function(e2) { this.streamInfo.crc32 = i(e2.data, this.streamInfo.crc32 || 0), this.push(e2); }, t.exports = s; }, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function(e, t, r) { "use strict"; var n = e("../utils"), i = e("./GenericWorker"); function s(e2) { i.call(this, "DataLengthProbe for " + e2), this.propName = e2, this.withStreamInfo(e2, 0); } n.inherits(s, i), s.prototype.processChunk = function(e2) { if (e2) { var t2 = this.streamInfo[this.propName] || 0; this.streamInfo[this.propName] = t2 + e2.data.length; } i.prototype.processChunk.call(this, e2); }, t.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 27: [function(e, t, r) { "use strict"; var n = e("../utils"), i = e("./GenericWorker"); function s(e2) { i.call(this, "DataWorker"); var t2 = this; this.dataIsReady = false, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = false, e2.then(function(e3) { t2.dataIsReady = true, t2.data = e3, t2.max = e3 && e3.length || 0, t2.type = n.getTypeOf(e3), t2.isPaused || t2._tickAndRepeat(); }, function(e3) { t2.error(e3); }); } n.inherits(s, i), s.prototype.cleanUp = function() { i.prototype.cleanUp.call(this), this.data = null; }, s.prototype.resume = function() { return !!i.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = true, n.delay(this._tickAndRepeat, [], this)), true); }, s.prototype._tickAndRepeat = function() { this._tickScheduled = false, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (n.delay(this._tickAndRepeat, [], this), this._tickScheduled = true)); }, s.prototype._tick = function() { if (this.isPaused || this.isFinished) return false; var e2 = null, t2 = Math.min(this.max, this.index + 16384); if (this.index >= this.max) return this.end(); switch (this.type) { case "string": e2 = this.data.substring(this.index, t2); break; case "uint8array": e2 = this.data.subarray(this.index, t2); break; case "array": case "nodebuffer": e2 = this.data.slice(this.index, t2); } return this.index = t2, this.push({ data: e2, meta: { percent: this.max ? this.index / this.max * 100 : 0 } }); }, t.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(e, t, r) { "use strict"; function n(e2) { this.name = e2 || "default", this.streamInfo = {}, this.generatedError = null, this.extraStreamInfo = {}, this.isPaused = true, this.isFinished = false, this.isLocked = false, this._listeners = { data: [], end: [], error: [] }, this.previous = null; } n.prototype = { push: function(e2) { this.emit("data", e2); }, end: function() { if (this.isFinished) return false; this.flush(); try { this.emit("end"), this.cleanUp(), this.isFinished = true; } catch (e2) { this.emit("error", e2); } return true; }, error: function(e2) { return !this.isFinished && (this.isPaused ? this.generatedError = e2 : (this.isFinished = true, this.emit("error", e2), this.previous && this.previous.error(e2), this.cleanUp()), true); }, on: function(e2, t2) { return this._listeners[e2].push(t2), this; }, cleanUp: function() { this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = []; }, emit: function(e2, t2) { if (this._listeners[e2]) for (var r2 = 0; r2 < this._listeners[e2].length; r2++) this._listeners[e2][r2].call(this, t2); }, pipe: function(e2) { return e2.registerPrevious(this); }, registerPrevious: function(e2) { if (this.isLocked) throw new Error("The stream '" + this + "' has already been used."); this.streamInfo = e2.streamInfo, this.mergeStreamInfo(), this.previous = e2; var t2 = this; return e2.on("data", function(e3) { t2.processChunk(e3); }), e2.on("end", function() { t2.end(); }), e2.on("error", function(e3) { t2.error(e3); }), this; }, pause: function() { return !this.isPaused && !this.isFinished && (this.isPaused = true, this.previous && this.previous.pause(), true); }, resume: function() { if (!this.isPaused || this.isFinished) return false; var e2 = this.isPaused = false; return this.generatedError && (this.error(this.generatedError), e2 = true), this.previous && this.previous.resume(), !e2; }, flush: function() { }, processChunk: function(e2) { this.push(e2); }, withStreamInfo: function(e2, t2) { return this.extraStreamInfo[e2] = t2, this.mergeStreamInfo(), this; }, mergeStreamInfo: function() { for (var e2 in this.extraStreamInfo) Object.prototype.hasOwnProperty.call(this.extraStreamInfo, e2) && (this.streamInfo[e2] = this.extraStreamInfo[e2]); }, lock: function() { if (this.isLocked) throw new Error("The stream '" + this + "' has already been used."); this.isLocked = true, this.previous && this.previous.lock(); }, toString: function() { var e2 = "Worker " + this.name; return this.previous ? this.previous + " -> " + e2 : e2; } }, t.exports = n; }, {}], 29: [function(e, t, r) { "use strict"; var h = e("../utils"), i = e("./ConvertWorker"), s = e("./GenericWorker"), u = e("../base64"), n = e("../support"), a = e("../external"), o = null; if (n.nodestream) try { o = e("../nodejs/NodejsStreamOutputAdapter"); } catch (e2) { } function l(e2, o2) { return new a.Promise(function(t2, r2) { var n2 = [], i2 = e2._internalType, s2 = e2._outputType, a2 = e2._mimeType; e2.on("data", function(e3, t3) { n2.push(e3), o2 && o2(t3); }).on("error", function(e3) { n2 = [], r2(e3); }).on("end", function() { try { var e3 = function(e4, t3, r3) { switch (e4) { case "blob": return h.newBlob(h.transformTo("arraybuffer", t3), r3); case "base64": return u.encode(t3); default: return h.transformTo(e4, t3); } }(s2, function(e4, t3) { var r3, n3 = 0, i3 = null, s3 = 0; for (r3 = 0; r3 < t3.length; r3++) s3 += t3[r3].length; switch (e4) { case "string": return t3.join(""); case "array": return Array.prototype.concat.apply([], t3); case "uint8array": for (i3 = new Uint8Array(s3), r3 = 0; r3 < t3.length; r3++) i3.set(t3[r3], n3), n3 += t3[r3].length; return i3; case "nodebuffer": return Buffer.concat(t3); default: throw new Error("concat : unsupported type '" + e4 + "'"); } }(i2, n2), a2); t2(e3); } catch (e4) { r2(e4); } n2 = []; }).resume(); }); } function f(e2, t2, r2) { var n2 = t2; switch (t2) { case "blob": case "arraybuffer": n2 = "uint8array"; break; case "base64": n2 = "string"; } try { this._internalType = n2, this._outputType = t2, this._mimeType = r2, h.checkSupport(n2), this._worker = e2.pipe(new i(n2)), e2.lock(); } catch (e3) { this._worker = new s("error"), this._worker.error(e3); } } f.prototype = { accumulate: function(e2) { return l(this, e2); }, on: function(e2, t2) { var r2 = this; return "data" === e2 ? this._worker.on(e2, function(e3) { t2.call(r2, e3.data, e3.meta); }) : this._worker.on(e2, function() { h.delay(t2, arguments, r2); }), this; }, resume: function() { return h.delay(this._worker.resume, [], this._worker), this; }, pause: function() { return this._worker.pause(), this; }, toNodejsStream: function(e2) { if (h.checkSupport("nodestream"), "nodebuffer" !== this._outputType) throw new Error(this._outputType + " is not supported by this method"); return new o(this, { objectMode: "nodebuffer" !== this._outputType }, e2); } }, t.exports = f; }, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function(e, t, r) { "use strict"; if (r.base64 = true, r.array = true, r.string = true, r.arraybuffer = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array, r.nodebuffer = "undefined" != typeof Buffer, r.uint8array = "undefined" != typeof Uint8Array, "undefined" == typeof ArrayBuffer) r.blob = false; else { var n = new ArrayBuffer(0); try { r.blob = 0 === new Blob([n], { type: "application/zip" }).size; } catch (e2) { try { var i = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)(); i.append(n), r.blob = 0 === i.getBlob("application/zip").size; } catch (e3) { r.blob = false; } } } try { r.nodestream = !!e("readable-stream").Readable; } catch (e2) { r.nodestream = false; } }, { "readable-stream": 16 }], 31: [function(e, t, s) { "use strict"; for (var o = e("./utils"), h = e("./support"), r = e("./nodejsUtils"), n = e("./stream/GenericWorker"), u = new Array(256), i = 0; i < 256; i++) u[i] = 252 <= i ? 6 : 248 <= i ? 5 : 240 <= i ? 4 : 224 <= i ? 3 : 192 <= i ? 2 : 1; u[254] = u[254] = 1; function a() { n.call(this, "utf-8 decode"), this.leftOver = null; } function l() { n.call(this, "utf-8 encode"); } s.utf8encode = function(e2) { return h.nodebuffer ? r.newBufferFrom(e2, "utf-8") : function(e3) { var t2, r2, n2, i2, s2, a2 = e3.length, o2 = 0; for (i2 = 0; i2 < a2; i2++) 55296 == (64512 & (r2 = e3.charCodeAt(i2))) && i2 + 1 < a2 && 56320 == (64512 & (n2 = e3.charCodeAt(i2 + 1))) && (r2 = 65536 + (r2 - 55296 << 10) + (n2 - 56320), i2++), o2 += r2 < 128 ? 1 : r2 < 2048 ? 2 : r2 < 65536 ? 3 : 4; for (t2 = h.uint8array ? new Uint8Array(o2) : new Array(o2), i2 = s2 = 0; s2 < o2; i2++) 55296 == (64512 & (r2 = e3.charCodeAt(i2))) && i2 + 1 < a2 && 56320 == (64512 & (n2 = e3.charCodeAt(i2 + 1))) && (r2 = 65536 + (r2 - 55296 << 10) + (n2 - 56320), i2++), r2 < 128 ? t2[s2++] = r2 : (r2 < 2048 ? t2[s2++] = 192 | r2 >>> 6 : (r2 < 65536 ? t2[s2++] = 224 | r2 >>> 12 : (t2[s2++] = 240 | r2 >>> 18, t2[s2++] = 128 | r2 >>> 12 & 63), t2[s2++] = 128 | r2 >>> 6 & 63), t2[s2++] = 128 | 63 & r2); return t2; }(e2); }, s.utf8decode = function(e2) { return h.nodebuffer ? o.transformTo("nodebuffer", e2).toString("utf-8") : function(e3) { var t2, r2, n2, i2, s2 = e3.length, a2 = new Array(2 * s2); for (t2 = r2 = 0; t2 < s2; ) if ((n2 = e3[t2++]) < 128) a2[r2++] = n2; else if (4 < (i2 = u[n2])) a2[r2++] = 65533, t2 += i2 - 1; else { for (n2 &= 2 === i2 ? 31 : 3 === i2 ? 15 : 7; 1 < i2 && t2 < s2; ) n2 = n2 << 6 | 63 & e3[t2++], i2--; 1 < i2 ? a2[r2++] = 65533 : n2 < 65536 ? a2[r2++] = n2 : (n2 -= 65536, a2[r2++] = 55296 | n2 >> 10 & 1023, a2[r2++] = 56320 | 1023 & n2); } return a2.length !== r2 && (a2.subarray ? a2 = a2.subarray(0, r2) : a2.length = r2), o.applyFromCharCode(a2); }(e2 = o.transformTo(h.uint8array ? "uint8array" : "array", e2)); }, o.inherits(a, n), a.prototype.processChunk = function(e2) { var t2 = o.transformTo(h.uint8array ? "uint8array" : "array", e2.data); if (this.leftOver && this.leftOver.length) { if (h.uint8array) { var r2 = t2; (t2 = new Uint8Array(r2.length + this.leftOver.length)).set(this.leftOver, 0), t2.set(r2, this.leftOver.length); } else t2 = this.leftOver.concat(t2); this.leftOver = null; } var n2 = function(e3, t3) { var r3; for ((t3 = t3 || e3.length) > e3.length && (t3 = e3.length), r3 = t3 - 1; 0 <= r3 && 128 == (192 & e3[r3]); ) r3--; return r3 < 0 ? t3 : 0 === r3 ? t3 : r3 + u[e3[r3]] > t3 ? r3 : t3; }(t2), i2 = t2; n2 !== t2.length && (h.uint8array ? (i2 = t2.subarray(0, n2), this.leftOver = t2.subarray(n2, t2.length)) : (i2 = t2.slice(0, n2), this.leftOver = t2.slice(n2, t2.length))), this.push({ data: s.utf8decode(i2), meta: e2.meta }); }, a.prototype.flush = function() { this.leftOver && this.leftOver.length && (this.push({ data: s.utf8decode(this.leftOver), meta: {} }), this.leftOver = null); }, s.Utf8DecodeWorker = a, o.inherits(l, n), l.prototype.processChunk = function(e2) { this.push({ data: s.utf8encode(e2.data), meta: e2.meta }); }, s.Utf8EncodeWorker = l; }, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(e, t, a) { "use strict"; var o = e("./support"), h = e("./base64"), r = e("./nodejsUtils"), u = e("./external"); function n(e2) { return e2; } function l(e2, t2) { for (var r2 = 0; r2 < e2.length; ++r2) t2[r2] = 255 & e2.charCodeAt(r2); return t2; } e("setimmediate"), a.newBlob = function(t2, r2) { a.checkSupport("blob"); try { return new Blob([t2], { type: r2 }); } catch (e2) { try { var n2 = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)(); return n2.append(t2), n2.getBlob(r2); } catch (e3) { throw new Error("Bug : can't construct the Blob."); } } }; var i = { stringifyByChunk: function(e2, t2, r2) { var n2 = [], i2 = 0, s2 = e2.length; if (s2 <= r2) return String.fromCharCode.apply(null, e2); for (; i2 < s2; ) "array" === t2 || "nodebuffer" === t2 ? n2.push(String.fromCharCode.apply(null, e2.slice(i2, Math.min(i2 + r2, s2)))) : n2.push(String.fromCharCode.apply(null, e2.subarray(i2, Math.min(i2 + r2, s2)))), i2 += r2; return n2.join(""); }, stringifyByChar: function(e2) { for (var t2 = "", r2 = 0; r2 < e2.length; r2++) t2 += String.fromCharCode(e2[r2]); return t2; }, applyCanBeUsed: { uint8array: function() { try { return o.uint8array && 1 === String.fromCharCode.apply(null, new Uint8Array(1)).length; } catch (e2) { return false; } }(), nodebuffer: function() { try { return o.nodebuffer && 1 === String.fromCharCode.apply(null, r.allocBuffer(1)).length; } catch (e2) { return false; } }() } }; function s(e2) { var t2 = 65536, r2 = a.getTypeOf(e2), n2 = true; if ("uint8array" === r2 ? n2 = i.applyCanBeUsed.uint8array : "nodebuffer" === r2 && (n2 = i.applyCanBeUsed.nodebuffer), n2) for (; 1 < t2; ) try { return i.stringifyByChunk(e2, r2, t2); } catch (e3) { t2 = Math.floor(t2 / 2); } return i.stringifyByChar(e2); } function f(e2, t2) { for (var r2 = 0; r2 < e2.length; r2++) t2[r2] = e2[r2]; return t2; } a.applyFromCharCode = s; var c = {}; c.string = { string: n, array: function(e2) { return l(e2, new Array(e2.length)); }, arraybuffer: function(e2) { return c.string.uint8array(e2).buffer; }, uint8array: function(e2) { return l(e2, new Uint8Array(e2.length)); }, nodebuffer: function(e2) { return l(e2, r.allocBuffer(e2.length)); } }, c.array = { string: s, array: n, arraybuffer: function(e2) { return new Uint8Array(e2).buffer; }, uint8array: function(e2) { return new Uint8Array(e2); }, nodebuffer: function(e2) { return r.newBufferFrom(e2); } }, c.arraybuffer = { string: function(e2) { return s(new Uint8Array(e2)); }, array: function(e2) { return f(new Uint8Array(e2), new Array(e2.byteLength)); }, arraybuffer: n, uint8array: function(e2) { return new Uint8Array(e2); }, nodebuffer: function(e2) { return r.newBufferFrom(new Uint8Array(e2)); } }, c.uint8array = { string: s, array: function(e2) { return f(e2, new Array(e2.length)); }, arraybuffer: function(e2) { return e2.buffer; }, uint8array: n, nodebuffer: function(e2) { return r.newBufferFrom(e2); } }, c.nodebuffer = { string: s, array: function(e2) { return f(e2, new Array(e2.length)); }, arraybuffer: function(e2) { return c.nodebuffer.uint8array(e2).buffer; }, uint8array: function(e2) { return f(e2, new Uint8Array(e2.length)); }, nodebuffer: n }, a.transformTo = function(e2, t2) { if (t2 = t2 || "", !e2) return t2; a.checkSupport(e2); var r2 = a.getTypeOf(t2); return c[r2][e2](t2); }, a.resolve = function(e2) { for (var t2 = e2.split("/"), r2 = [], n2 = 0; n2 < t2.length; n2++) { var i2 = t2[n2]; "." === i2 || "" === i2 && 0 !== n2 && n2 !== t2.length - 1 || (".." === i2 ? r2.pop() : r2.push(i2)); } return r2.join("/"); }, a.getTypeOf = function(e2) { return "string" == typeof e2 ? "string" : "[object Array]" === Object.prototype.toString.call(e2) ? "array" : o.nodebuffer && r.isBuffer(e2) ? "nodebuffer" : o.uint8array && e2 instanceof Uint8Array ? "uint8array" : o.arraybuffer && e2 instanceof ArrayBuffer ? "arraybuffer" : void 0; }, a.checkSupport = function(e2) { if (!o[e2.toLowerCase()]) throw new Error(e2 + " is not supported by this platform"); }, a.MAX_VALUE_16BITS = 65535, a.MAX_VALUE_32BITS = -1, a.pretty = function(e2) { var t2, r2, n2 = ""; for (r2 = 0; r2 < (e2 || "").length; r2++) n2 += "\\x" + ((t2 = e2.charCodeAt(r2)) < 16 ? "0" : "") + t2.toString(16).toUpperCase(); return n2; }, a.delay = function(e2, t2, r2) { setImmediate(function() { e2.apply(r2 || null, t2 || []); }); }, a.inherits = function(e2, t2) { function r2() { } r2.prototype = t2.prototype, e2.prototype = new r2(); }, a.extend = function() { var e2, t2, r2 = {}; for (e2 = 0; e2 < arguments.length; e2++) for (t2 in arguments[e2]) Object.prototype.hasOwnProperty.call(arguments[e2], t2) && void 0 === r2[t2] && (r2[t2] = arguments[e2][t2]); return r2; }, a.prepareContent = function(r2, e2, n2, i2, s2) { return u.Promise.resolve(e2).then(function(n3) { return o.blob && (n3 instanceof Blob || -1 !== ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(n3))) && "undefined" != typeof FileReader ? new u.Promise(function(t2, r3) { var e3 = new FileReader(); e3.onload = function(e4) { t2(e4.target.result); }, e3.onerror = function(e4) { r3(e4.target.error); }, e3.readAsArrayBuffer(n3); }) : n3; }).then(function(e3) { var t2 = a.getTypeOf(e3); return t2 ? ("arraybuffer" === t2 ? e3 = a.transformTo("uint8array", e3) : "string" === t2 && (s2 ? e3 = h.decode(e3) : n2 && true !== i2 && (e3 = function(e4) { return l(e4, o.uint8array ? new Uint8Array(e4.length) : new Array(e4.length)); }(e3))), e3) : u.Promise.reject(new Error("Can't read the data of '" + r2 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?")); }); }; }, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function(e, t, r) { "use strict"; var n = e("./reader/readerFor"), i = e("./utils"), s = e("./signature"), a = e("./zipEntry"), o = e("./support"); function h(e2) { this.files = [], this.loadOptions = e2; } h.prototype = { checkSignature: function(e2) { if (!this.reader.readAndCheckSignature(e2)) { this.reader.index -= 4; var t2 = this.reader.readString(4); throw new Error("Corrupted zip or bug: unexpected signature (" + i.pretty(t2) + ", expected " + i.pretty(e2) + ")"); } }, isSignature: function(e2, t2) { var r2 = this.reader.index; this.reader.setIndex(e2); var n2 = this.reader.readString(4) === t2; return this.reader.setIndex(r2), n2; }, readBlockEndOfCentral: function() { 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); var e2 = this.reader.readData(this.zipCommentLength), t2 = o.uint8array ? "uint8array" : "array", r2 = i.transformTo(t2, e2); this.zipComment = this.loadOptions.decodeFileName(r2); }, readBlockZip64EndOfCentral: function() { 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 = {}; for (var e2, t2, r2, n2 = this.zip64EndOfCentralSize - 44; 0 < n2; ) e2 = this.reader.readInt(2), t2 = this.reader.readInt(4), r2 = this.reader.readData(t2), this.zip64ExtensibleData[e2] = { id: e2, length: t2, value: r2 }; }, readBlockZip64EndOfCentralLocator: function() { 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"); }, readLocalFiles: function() { var e2, t2; for (e2 = 0; e2 < this.files.length; e2++) t2 = this.files[e2], this.reader.setIndex(t2.localHeaderOffset), this.checkSignature(s.LOCAL_FILE_HEADER), t2.readLocalPart(this.reader), t2.handleUTF8(), t2.processAttributes(); }, readCentralDir: function() { var e2; for (this.reader.setIndex(this.centralDirOffset); this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER); ) (e2 = new a({ zip64: this.zip64 }, this.loadOptions)).readCentralPart(this.reader), this.files.push(e2); if (this.centralDirRecords !== this.files.length && 0 !== this.centralDirRecords && 0 === this.files.length) throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length); }, readEndOfCentral: function() { var e2 = this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END); if (e2 < 0) throw !this.isSignature(0, s.LOCAL_FILE_HEADER) ? 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") : new Error("Corrupted zip: can't find end of central directory"); this.reader.setIndex(e2); var t2 = e2; if (this.checkSignature(s.CENTRAL_DIRECTORY_END), this.readBlockEndOfCentral(), this.diskNumber === i.MAX_VALUE_16BITS || this.diskWithCentralDirStart === i.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === i.MAX_VALUE_16BITS || this.centralDirRecords === i.MAX_VALUE_16BITS || this.centralDirSize === i.MAX_VALUE_32BITS || this.centralDirOffset === i.MAX_VALUE_32BITS) { if (this.zip64 = true, (e2 = this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR)) < 0) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator"); if (this.reader.setIndex(e2), this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), !this.isSignature(this.relativeOffsetEndOfZip64CentralDir, s.ZIP64_CENTRAL_DIRECTORY_END) && (this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END), this.relativeOffsetEndOfZip64CentralDir < 0)) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory"); this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral(); } var r2 = this.centralDirOffset + this.centralDirSize; this.zip64 && (r2 += 20, r2 += 12 + this.zip64EndOfCentralSize); var n2 = t2 - r2; if (0 < n2) this.isSignature(t2, s.CENTRAL_FILE_HEADER) || (this.reader.zero = n2); else if (n2 < 0) throw new Error("Corrupted zip: missing " + Math.abs(n2) + " bytes."); }, prepareReader: function(e2) { this.reader = n(e2); }, load: function(e2) { this.prepareReader(e2), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles(); } }, t.exports = h; }, { "./reader/readerFor": 22, "./signature": 23, "./support": 30, "./utils": 32, "./zipEntry": 34 }], 34: [function(e, t, r) { "use strict"; var n = e("./reader/readerFor"), s = e("./utils"), i = e("./compressedObject"), a = e("./crc32"), o = e("./utf8"), h = e("./compressions"), u = e("./support"); function l(e2, t2) { this.options = e2, this.loadOptions = t2; } l.prototype = { isEncrypted: function() { return 1 == (1 & this.bitFlag); }, useUTF8: function() { return 2048 == (2048 & this.bitFlag); }, readLocalPart: function(e2) { var t2, r2; if (e2.skip(22), this.fileNameLength = e2.readInt(2), r2 = e2.readInt(2), this.fileName = e2.readData(this.fileNameLength), e2.skip(r2), -1 === this.compressedSize || -1 === this.uncompressedSize) throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)"); if (null === (t2 = function(e3) { for (var t3 in h) if (Object.prototype.hasOwnProperty.call(h, t3) && h[t3].magic === e3) return h[t3]; return null; }(this.compressionMethod))) throw new Error("Corrupted zip : compression " + s.pretty(this.compressionMethod) + " unknown (inner file : " + s.transformTo("string", this.fileName) + ")"); this.decompressed = new i(this.compressedSize, this.uncompressedSize, this.crc32, t2, e2.readData(this.compressedSize)); }, readCentralPart: function(e2) { this.versionMadeBy = e2.readInt(2), e2.skip(2), this.bitFlag = e2.readInt(2), this.compressionMethod = e2.readString(2), this.date = e2.readDate(), this.crc32 = e2.readInt(4), this.compressedSize = e2.readInt(4), this.uncompressedSize = e2.readInt(4); var t2 = e2.readInt(2); if (this.extraFieldsLength = e2.readInt(2), this.fileCommentLength = e2.readInt(2), this.diskNumberStart = e2.readInt(2), this.internalFileAttributes = e2.readInt(2), this.externalFileAttributes = e2.readInt(4), this.localHeaderOffset = e2.readInt(4), this.isEncrypted()) throw new Error("Encrypted zip are not supported"); e2.skip(t2), this.readExtraFields(e2), this.parseZIP64ExtraField(e2), this.fileComment = e2.readData(this.fileCommentLength); }, processAttributes: function() { this.unixPermissions = null, this.dosPermissions = null; var e2 = this.versionMadeBy >> 8; this.dir = !!(16 & this.externalFileAttributes), 0 == e2 && (this.dosPermissions = 63 & this.externalFileAttributes), 3 == e2 && (this.unixPermissions = this.externalFileAttributes >> 16 & 65535), this.dir || "/" !== this.fileNameStr.slice(-1) || (this.dir = true); }, parseZIP64ExtraField: function() { if (this.extraFields[1]) { var e2 = n(this.extraFields[1].value); this.uncompressedSize === s.MAX_VALUE_32BITS && (this.uncompressedSize = e2.readInt(8)), this.compressedSize === s.MAX_VALUE_32BITS && (this.compressedSize = e2.readInt(8)), this.localHeaderOffset === s.MAX_VALUE_32BITS && (this.localHeaderOffset = e2.readInt(8)), this.diskNumberStart === s.MAX_VALUE_32BITS && (this.diskNumberStart = e2.readInt(4)); } }, readExtraFields: function(e2) { var t2, r2, n2, i2 = e2.index + this.extraFieldsLength; for (this.extraFields || (this.extraFields = {}); e2.index + 4 < i2; ) t2 = e2.readInt(2), r2 = e2.readInt(2), n2 = e2.readData(r2), this.extraFields[t2] = { id: t2, length: r2, value: n2 }; e2.setIndex(i2); }, handleUTF8: function() { var e2 = u.uint8array ? "uint8array" : "array"; if (this.useUTF8()) this.fileNameStr = o.utf8decode(this.fileName), this.fileCommentStr = o.utf8decode(this.fileComment); else { var t2 = this.findExtraFieldUnicodePath(); if (null !== t2) this.fileNameStr = t2; else { var r2 = s.transformTo(e2, this.fileName); this.fileNameStr = this.loadOptions.decodeFileName(r2); } var n2 = this.findExtraFieldUnicodeComment(); if (null !== n2) this.fileCommentStr = n2; else { var i2 = s.transformTo(e2, this.fileComment); this.fileCommentStr = this.loadOptions.decodeFileName(i2); } } }, findExtraFieldUnicodePath: function() { var e2 = this.extraFields[28789]; if (e2) { var t2 = n(e2.value); return 1 !== t2.readInt(1) ? null : a(this.fileName) !== t2.readInt(4) ? null : o.utf8decode(t2.readData(e2.length - 5)); } return null; }, findExtraFieldUnicodeComment: function() { var e2 = this.extraFields[25461]; if (e2) { var t2 = n(e2.value); return 1 !== t2.readInt(1) ? null : a(this.fileComment) !== t2.readInt(4) ? null : o.utf8decode(t2.readData(e2.length - 5)); } return null; } }, t.exports = l; }, { "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./reader/readerFor": 22, "./support": 30, "./utf8": 31, "./utils": 32 }], 35: [function(e, t, r) { "use strict"; function n(e2, t2, r2) { this.name = e2, this.dir = r2.dir, this.date = r2.date, this.comment = r2.comment, this.unixPermissions = r2.unixPermissions, this.dosPermissions = r2.dosPermissions, this._data = t2, this._dataBinary = r2.binary, this.options = { compression: r2.compression, compressionOptions: r2.compressionOptions }; } var s = e("./stream/StreamHelper"), i = e("./stream/DataWorker"), a = e("./utf8"), o = e("./compressedObject"), h = e("./stream/GenericWorker"); n.prototype = { internalStream: function(e2) { var t2 = null, r2 = "string"; try { if (!e2) throw new Error("No output type specified."); var n2 = "string" === (r2 = e2.toLowerCase()) || "text" === r2; "binarystring" !== r2 && "text" !== r2 || (r2 = "string"), t2 = this._decompressWorker(); var i2 = !this._dataBinary; i2 && !n2 && (t2 = t2.pipe(new a.Utf8EncodeWorker())), !i2 && n2 && (t2 = t2.pipe(new a.Utf8DecodeWorker())); } catch (e3) { (t2 = new h("error")).error(e3); } return new s(t2, r2, ""); }, async: function(e2, t2) { return this.internalStream(e2).accumulate(t2); }, nodeStream: function(e2, t2) { return this.internalStream(e2 || "nodebuffer").toNodejsStream(t2); }, _compressWorker: function(e2, t2) { if (this._data instanceof o && this._data.compression.magic === e2.magic) return this._data.getCompressedWorker(); var r2 = this._decompressWorker(); return this._dataBinary || (r2 = r2.pipe(new a.Utf8EncodeWorker())), o.createWorkerFrom(r2, e2, t2); }, _decompressWorker: function() { return this._data instanceof o ? this._data.getContentWorker() : this._data instanceof h ? this._data : new i(this._data); } }; for (var u = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"], l = function() { throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); }, f = 0; f < u.length; f++) n.prototype[u[f]] = l; t.exports = n; }, { "./compressedObject": 2, "./stream/DataWorker": 27, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31 }], 36: [function(e, l, t) { (function(t2) { "use strict"; var r, n, e2 = t2.MutationObserver || t2.WebKitMutationObserver; if (e2) { var i = 0, s = new e2(u), a = t2.document.createTextNode(""); s.observe(a, { characterData: true }), r = function() { a.data = i = ++i % 2; }; } else if (t2.setImmediate || void 0 === t2.MessageChannel) r = "document" in t2 && "onreadystatechange" in t2.document.createElement("script") ? function() { var e3 = t2.document.createElement("script"); e3.onreadystatechange = function() { u(), e3.onreadystatechange = null, e3.parentNode.removeChild(e3), e3 = null; }, t2.document.documentElement.appendChild(e3); } : function() { setTimeout(u, 0); }; else { var o = new t2.MessageChannel(); o.port1.onmessage = u, r = function() { o.port2.postMessage(0); }; } var h = []; function u() { var e3, t3; n = true; for (var r2 = h.length; r2; ) { for (t3 = h, h = [], e3 = -1; ++e3 < r2; ) t3[e3](); r2 = h.length; } n = false; } l.exports = function(e3) { 1 !== h.push(e3) || n || r(); }; }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); }, {}], 37: [function(e, t, r) { "use strict"; var i = e("immediate"); function u() { } var l = {}, s = ["REJECTED"], a = ["FULFILLED"], n = ["PENDING"]; function o(e2) { if ("function" != typeof e2) throw new TypeError("resolver must be a function"); this.state = n, this.queue = [], this.outcome = void 0, e2 !== u && d(this, e2); } function h(e2, t2, r2) { this.promise = e2, "function" == typeof t2 && (this.onFulfilled = t2, this.callFulfilled = this.otherCallFulfilled), "function" == typeof r2 && (this.onRejected = r2, this.callRejected = this.otherCallRejected); } function f(t2, r2, n2) { i(function() { var e2; try { e2 = r2(n2); } catch (e3) { return l.reject(t2, e3); } e2 === t2 ? l.reject(t2, new TypeError("Cannot resolve promise with itself")) : l.resolve(t2, e2); }); } function c(e2) { var t2 = e2 && e2.then; if (e2 && ("object" == typeof e2 || "function" == typeof e2) && "function" == typeof t2) return function() { t2.apply(e2, arguments); }; } function d(t2, e2) { var r2 = false; function n2(e3) { r2 || (r2 = true, l.reject(t2, e3)); } function i2(e3) { r2 || (r2 = true, l.resolve(t2, e3)); } var s2 = p(function() { e2(i2, n2); }); "error" === s2.status && n2(s2.value); } function p(e2, t2) { var r2 = {}; try { r2.value = e2(t2), r2.status = "success"; } catch (e3) { r2.status = "error", r2.value = e3; } return r2; } (t.exports = o).prototype.finally = function(t2) { if ("function" != typeof t2) return this; var r2 = this.constructor; return this.then(function(e2) { return r2.resolve(t2()).then(function() { return e2; }); }, function(e2) { return r2.resolve(t2()).then(function() { throw e2; }); }); }, o.prototype.catch = function(e2) { return this.then(null, e2); }, o.prototype.then = function(e2, t2) { if ("function" != typeof e2 && this.state === a || "function" != typeof t2 && this.state === s) return this; var r2 = new this.constructor(u); this.state !== n ? f(r2, this.state === a ? e2 : t2, this.outcome) : this.queue.push(new h(r2, e2, t2)); return r2; }, h.prototype.callFulfilled = function(e2) { l.resolve(this.promise, e2); }, h.prototype.otherCallFulfilled = function(e2) { f(this.promise, this.onFulfilled, e2); }, h.prototype.callRejected = function(e2) { l.reject(this.promise, e2); }, h.prototype.otherCallRejected = function(e2) { f(this.promise, this.onRejected, e2); }, l.resolve = function(e2, t2) { var r2 = p(c, t2); if ("error" === r2.status) return l.reject(e2, r2.value); var n2 = r2.value; if (n2) d(e2, n2); else { e2.state = a, e2.outcome = t2; for (var i2 = -1, s2 = e2.queue.length; ++i2 < s2; ) e2.queue[i2].callFulfilled(t2); } return e2; }, l.reject = function(e2, t2) { e2.state = s, e2.outcome = t2; for (var r2 = -1, n2 = e2.queue.length; ++r2 < n2; ) e2.queue[r2].callRejected(t2); return e2; }, o.resolve = function(e2) { if (e2 instanceof this) return e2; return l.resolve(new this(u), e2); }, o.reject = function(e2) { var t2 = new this(u); return l.reject(t2, e2); }, o.all = function(e2) { var r2 = this; if ("[object Array]" !== Object.prototype.toString.call(e2)) return this.reject(new TypeError("must be an array")); var n2 = e2.length, i2 = false; if (!n2) return this.resolve([]); var s2 = new Array(n2), a2 = 0, t2 = -1, o2 = new this(u); for (; ++t2 < n2; ) h2(e2[t2], t2); return o2; function h2(e3, t3) { r2.resolve(e3).then(function(e4) { s2[t3] = e4, ++a2 !== n2 || i2 || (i2 = true, l.resolve(o2, s2)); }, function(e4) { i2 || (i2 = true, l.reject(o2, e4)); }); } }, o.race = function(e2) { var t2 = this; if ("[object Array]" !== Object.prototype.toString.call(e2)) return this.reject(new TypeError("must be an array")); var r2 = e2.length, n2 = false; if (!r2) return this.resolve([]); var i2 = -1, s2 = new this(u); for (; ++i2 < r2; ) a2 = e2[i2], t2.resolve(a2).then(function(e3) { n2 || (n2 = true, l.resolve(s2, e3)); }, function(e3) { n2 || (n2 = true, l.reject(s2, e3)); }); var a2; return s2; }; }, { immediate: 36 }], 38: [function(e, t, r) { "use strict"; var n = {}; (0, e("./lib/utils/common").assign)(n, e("./lib/deflate"), e("./lib/inflate"), e("./lib/zlib/constants")), t.exports = n; }, { "./lib/deflate": 39, "./lib/inflate": 40, "./lib/utils/common": 41, "./lib/zlib/constants": 44 }], 39: [function(e, t, r) { "use strict"; var a = e("./zlib/deflate"), o = e("./utils/common"), h = e("./utils/strings"), i = e("./zlib/messages"), s = e("./zlib/zstream"), u = Object.prototype.toString, l = 0, f = -1, c = 0, d = 8; function p(e2) { if (!(this instanceof p)) return new p(e2); this.options = o.assign({ level: f, method: d, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: c, to: "" }, e2 || {}); var t2 = this.options; t2.raw && 0 < t2.windowBits ? t2.windowBits = -t2.windowBits : t2.gzip && 0 < t2.windowBits && t2.windowBits < 16 && (t2.windowBits += 16), this.err = 0, this.msg = "", this.ended = false, this.chunks = [], this.strm = new s(), this.strm.avail_out = 0; var r2 = a.deflateInit2(this.strm, t2.level, t2.method, t2.windowBits, t2.memLevel, t2.strategy); if (r2 !== l) throw new Error(i[r2]); if (t2.header && a.deflateSetHeader(this.strm, t2.header), t2.dictionary) { var n2; if (n2 = "string" == typeof t2.dictionary ? h.string2buf(t2.dictionary) : "[object ArrayBuffer]" === u.call(t2.dictionary) ? new Uint8Array(t2.dictionary) : t2.dictionary, (r2 = a.deflateSetDictionary(this.strm, n2)) !== l) throw new Error(i[r2]); this._dict_set = true; } } function n(e2, t2) { var r2 = new p(t2); if (r2.push(e2, true), r2.err) throw r2.msg || i[r2.err]; return r2.result; } p.prototype.push = function(e2, t2) { var r2, n2, i2 = this.strm, s2 = this.options.chunkSize; if (this.ended) return false; n2 = t2 === ~~t2 ? t2 : true === t2 ? 4 : 0, "string" == typeof e2 ? i2.input = h.string2buf(e2) : "[object ArrayBuffer]" === u.call(e2) ? i2.input = new Uint8Array(e2) : i2.input = e2, i2.next_in = 0, i2.avail_in = i2.input.length; do { if (0 === i2.avail_out && (i2.output = new o.Buf8(s2), i2.next_out = 0, i2.avail_out = s2), 1 !== (r2 = a.deflate(i2, n2)) && r2 !== l) return this.onEnd(r2), !(this.ended = true); 0 !== i2.avail_out && (0 !== i2.avail_in || 4 !== n2 && 2 !== n2) || ("string" === this.options.to ? this.onData(h.buf2binstring(o.shrinkBuf(i2.output, i2.next_out))) : this.onData(o.shrinkBuf(i2.output, i2.next_out))); } while ((0 < i2.avail_in || 0 === i2.avail_out) && 1 !== r2); return 4 === n2 ? (r2 = a.deflateEnd(this.strm), this.onEnd(r2), this.ended = true, r2 === l) : 2 !== n2 || (this.onEnd(l), !(i2.avail_out = 0)); }, p.prototype.onData = function(e2) { this.chunks.push(e2); }, p.prototype.onEnd = function(e2) { e2 === l && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = e2, this.msg = this.strm.msg; }, r.Deflate = p, r.deflate = n, r.deflateRaw = function(e2, t2) { return (t2 = t2 || {}).raw = true, n(e2, t2); }, r.gzip = function(e2, t2) { return (t2 = t2 || {}).gzip = true, n(e2, t2); }; }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function(e, t, r) { "use strict"; var c = e("./zlib/inflate"), d = e("./utils/common"), p = e("./utils/strings"), m = e("./zlib/constants"), n = e("./zlib/messages"), i = e("./zlib/zstream"), s = e("./zlib/gzheader"), _ = Object.prototype.toString; function a(e2) { if (!(this instanceof a)) return new a(e2); this.options = d.assign({ chunkSize: 16384, windowBits: 0, to: "" }, e2 || {}); var t2 = this.options; t2.raw && 0 <= t2.windowBits && t2.windowBits < 16 && (t2.windowBits = -t2.windowBits, 0 === t2.windowBits && (t2.windowBits = -15)), !(0 <= t2.windowBits && t2.windowBits < 16) || e2 && e2.windowBits || (t2.windowBits += 32), 15 < t2.windowBits && t2.windowBits < 48 && 0 == (15 & t2.windowBits) && (t2.windowBits |= 15), this.err = 0, this.msg = "", this.ended = false, this.chunks = [], this.strm = new i(), this.strm.avail_out = 0; var r2 = c.inflateInit2(this.strm, t2.windowBits); if (r2 !== m.Z_OK) throw new Error(n[r2]); this.header = new s(), c.inflateGetHeader(this.strm, this.header); } function o(e2, t2) { var r2 = new a(t2); if (r2.push(e2, true), r2.err) throw r2.msg || n[r2.err]; return r2.result; } a.prototype.push = function(e2, t2) { var r2, n2, i2, s2, a2, o2, h = this.strm, u = this.options.chunkSize, l = this.options.dictionary, f = false; if (this.ended) return false; n2 = t2 === ~~t2 ? t2 : true === t2 ? m.Z_FINISH : m.Z_NO_FLUSH, "string" == typeof e2 ? h.input = p.binstring2buf(e2) : "[object ArrayBuffer]" === _.call(e2) ? h.input = new Uint8Array(e2) : h.input = e2, h.next_in = 0, h.avail_in = h.input.length; do { if (0 === h.avail_out && (h.output = new d.Buf8(u), h.next_out = 0, h.avail_out = u), (r2 = c.inflate(h, m.Z_NO_FLUSH)) === m.Z_NEED_DICT && l && (o2 = "string" == typeof l ? p.string2buf(l) : "[object ArrayBuffer]" === _.call(l) ? new Uint8Array(l) : l, r2 = c.inflateSetDictionary(this.strm, o2)), r2 === m.Z_BUF_ERROR && true === f && (r2 = m.Z_OK, f = false), r2 !== m.Z_STREAM_END && r2 !== m.Z_OK) return this.onEnd(r2), !(this.ended = true); h.next_out && (0 !== h.avail_out && r2 !== m.Z_STREAM_END && (0 !== h.avail_in || n2 !== m.Z_FINISH && n2 !== m.Z_SYNC_FLUSH) || ("string" === this.options.to ? (i2 = p.utf8border(h.output, h.next_out), s2 = h.next_out - i2, a2 = p.buf2string(h.output, i2), h.next_out = s2, h.avail_out = u - s2, s2 && d.arraySet(h.output, h.output, i2, s2, 0), this.onData(a2)) : this.onData(d.shrinkBuf(h.output, h.next_out)))), 0 === h.avail_in && 0 === h.avail_out && (f = true); } while ((0 < h.avail_in || 0 === h.avail_out) && r2 !== m.Z_STREAM_END); return r2 === m.Z_STREAM_END && (n2 = m.Z_FINISH), n2 === m.Z_FINISH ? (r2 = c.inflateEnd(this.strm), this.onEnd(r2), this.ended = true, r2 === m.Z_OK) : n2 !== m.Z_SYNC_FLUSH || (this.onEnd(m.Z_OK), !(h.avail_out = 0)); }, a.prototype.onData = function(e2) { this.chunks.push(e2); }, a.prototype.onEnd = function(e2) { e2 === m.Z_OK && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = d.flattenChunks(this.chunks)), this.chunks = [], this.err = e2, this.msg = this.strm.msg; }, r.Inflate = a, r.inflate = o, r.inflateRaw = function(e2, t2) { return (t2 = t2 || {}).raw = true, o(e2, t2); }, r.ungzip = o; }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/constants": 44, "./zlib/gzheader": 47, "./zlib/inflate": 49, "./zlib/messages": 51, "./zlib/zstream": 53 }], 41: [function(e, t, r) { "use strict"; var n = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array; r.assign = function(e2) { for (var t2 = Array.prototype.slice.call(arguments, 1); t2.length; ) { var r2 = t2.shift(); if (r2) { if ("object" != typeof r2) throw new TypeError(r2 + "must be non-object"); for (var n2 in r2) r2.hasOwnProperty(n2) && (e2[n2] = r2[n2]); } } return e2; }, r.shrinkBuf = function(e2, t2) { return e2.length === t2 ? e2 : e2.subarray ? e2.subarray(0, t2) : (e2.length = t2, e2); }; var i = { arraySet: function(e2, t2, r2, n2, i2) { if (t2.subarray && e2.subarray) e2.set(t2.subarray(r2, r2 + n2), i2); else for (var s2 = 0; s2 < n2; s2++) e2[i2 + s2] = t2[r2 + s2]; }, flattenChunks: function(e2) { var t2, r2, n2, i2, s2, a; for (t2 = n2 = 0, r2 = e2.length; t2 < r2; t2++) n2 += e2[t2].length; for (a = new Uint8Array(n2), t2 = i2 = 0, r2 = e2.length; t2 < r2; t2++) s2 = e2[t2], a.set(s2, i2), i2 += s2.length; return a; } }, s = { arraySet: function(e2, t2, r2, n2, i2) { for (var s2 = 0; s2 < n2; s2++) e2[i2 + s2] = t2[r2 + s2]; }, flattenChunks: function(e2) { return [].concat.apply([], e2); } }; r.setTyped = function(e2) { e2 ? (r.Buf8 = Uint8Array, r.Buf16 = Uint16Array, r.Buf32 = Int32Array, r.assign(r, i)) : (r.Buf8 = Array, r.Buf16 = Array, r.Buf32 = Array, r.assign(r, s)); }, r.setTyped(n); }, {}], 42: [function(e, t, r) { "use strict"; var h = e("./common"), i = true, s = true; try { String.fromCharCode.apply(null, [0]); } catch (e2) { i = false; } try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (e2) { s = false; } for (var u = new h.Buf8(256), n = 0; n < 256; n++) u[n] = 252 <= n ? 6 : 248 <= n ? 5 : 240 <= n ? 4 : 224 <= n ? 3 : 192 <= n ? 2 : 1; function l(e2, t2) { if (t2 < 65537 && (e2.subarray && s || !e2.subarray && i)) return String.fromCharCode.apply(null, h.shrinkBuf(e2, t2)); for (var r2 = "", n2 = 0; n2 < t2; n2++) r2 += String.fromCharCode(e2[n2]); return r2; } u[254] = u[254] = 1, r.string2buf = function(e2) { var t2, r2, n2, i2, s2, a = e2.length, o = 0; for (i2 = 0; i2 < a; i2++) 55296 == (64512 & (r2 = e2.charCodeAt(i2))) && i2 + 1 < a && 56320 == (64512 & (n2 = e2.charCodeAt(i2 + 1))) && (r2 = 65536 + (r2 - 55296 << 10) + (n2 - 56320), i2++), o += r2 < 128 ? 1 : r2 < 2048 ? 2 : r2 < 65536 ? 3 : 4; for (t2 = new h.Buf8(o), i2 = s2 = 0; s2 < o; i2++) 55296 == (64512 & (r2 = e2.charCodeAt(i2))) && i2 + 1 < a && 56320 == (64512 & (n2 = e2.charCodeAt(i2 + 1))) && (r2 = 65536 + (r2 - 55296 << 10) + (n2 - 56320), i2++), r2 < 128 ? t2[s2++] = r2 : (r2 < 2048 ? t2[s2++] = 192 | r2 >>> 6 : (r2 < 65536 ? t2[s2++] = 224 | r2 >>> 12 : (t2[s2++] = 240 | r2 >>> 18, t2[s2++] = 128 | r2 >>> 12 & 63), t2[s2++] = 128 | r2 >>> 6 & 63), t2[s2++] = 128 | 63 & r2); return t2; }, r.buf2binstring = function(e2) { return l(e2, e2.length); }, r.binstring2buf = function(e2) { for (var t2 = new h.Buf8(e2.length), r2 = 0, n2 = t2.length; r2 < n2; r2++) t2[r2] = e2.charCodeAt(r2); return t2; }, r.buf2string = function(e2, t2) { var r2, n2, i2, s2, a = t2 || e2.length, o = new Array(2 * a); for (r2 = n2 = 0; r2 < a; ) if ((i2 = e2[r2++]) < 128) o[n2++] = i2; else if (4 < (s2 = u[i2])) o[n2++] = 65533, r2 += s2 - 1; else { for (i2 &= 2 === s2 ? 31 : 3 === s2 ? 15 : 7; 1 < s2 && r2 < a; ) i2 = i2 << 6 | 63 & e2[r2++], s2--; 1 < s2 ? o[n2++] = 65533 : i2 < 65536 ? o[n2++] = i2 : (i2 -= 65536, o[n2++] = 55296 | i2 >> 10 & 1023, o[n2++] = 56320 | 1023 & i2); } return l(o, n2); }, r.utf8border = function(e2, t2) { var r2; for ((t2 = t2 || e2.length) > e2.length && (t2 = e2.length), r2 = t2 - 1; 0 <= r2 && 128 == (192 & e2[r2]); ) r2--; return r2 < 0 ? t2 : 0 === r2 ? t2 : r2 + u[e2[r2]] > t2 ? r2 : t2; }; }, { "./common": 41 }], 43: [function(e, t, r) { "use strict"; t.exports = function(e2, t2, r2, n) { for (var i = 65535 & e2 | 0, s = e2 >>> 16 & 65535 | 0, a = 0; 0 !== r2; ) { for (r2 -= a = 2e3 < r2 ? 2e3 : r2; s = s + (i = i + t2[n++] | 0) | 0, --a; ) ; i %= 65521, s %= 65521; } return i | s << 16 | 0; }; }, {}], 44: [function(e, t, r) { "use strict"; t.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 }; }, {}], 45: [function(e, t, r) { "use strict"; var o = function() { for (var e2, t2 = [], r2 = 0; r2 < 256; r2++) { e2 = r2; for (var n = 0; n < 8; n++) e2 = 1 & e2 ? 3988292384 ^ e2 >>> 1 : e2 >>> 1; t2[r2] = e2; } return t2; }(); t.exports = function(e2, t2, r2, n) { var i = o, s = n + r2; e2 ^= -1; for (var a = n; a < s; a++) e2 = e2 >>> 8 ^ i[255 & (e2 ^ t2[a])]; return -1 ^ e2; }; }, {}], 46: [function(e, t, r) { "use strict"; var h, c = e("../utils/common"), u = e("./trees"), d = e("./adler32"), p = e("./crc32"), n = e("./messages"), l = 0, f = 4, m = 0, _ = -2, g = -1, b = 4, i = 2, v = 8, y = 9, s = 286, a = 30, o = 19, w = 2 * s + 1, k = 15, x = 3, S = 258, z = S + x + 1, C = 42, E = 113, A = 1, I = 2, O = 3, B = 4; function R(e2, t2) { return e2.msg = n[t2], t2; } function T(e2) { return (e2 << 1) - (4 < e2 ? 9 : 0); } function D(e2) { for (var t2 = e2.length; 0 <= --t2; ) e2[t2] = 0; } function F(e2) { var t2 = e2.state, r2 = t2.pending; r2 > e2.avail_out && (r2 = e2.avail_out), 0 !== r2 && (c.arraySet(e2.output, t2.pending_buf, t2.pending_out, r2, e2.next_out), e2.next_out += r2, t2.pending_out += r2, e2.total_out += r2, e2.avail_out -= r2, t2.pending -= r2, 0 === t2.pending && (t2.pending_out = 0)); } function N(e2, t2) { u._tr_flush_block(e2, 0 <= e2.block_start ? e2.block_start : -1, e2.strstart - e2.block_start, t2), e2.block_start = e2.strstart, F(e2.strm); } function U(e2, t2) { e2.pending_buf[e2.pending++] = t2; } function P(e2, t2) { e2.pending_buf[e2.pending++] = t2 >>> 8 & 255, e2.pending_buf[e2.pending++] = 255 & t2; } function L(e2, t2) { var r2, n2, i2 = e2.max_chain_length, s2 = e2.strstart, a2 = e2.prev_length, o2 = e2.nice_match, h2 = e2.strstart > e2.w_size - z ? e2.strstart - (e2.w_size - z) : 0, u2 = e2.window, l2 = e2.w_mask, f2 = e2.prev, c2 = e2.strstart + S, d2 = u2[s2 + a2 - 1], p2 = u2[s2 + a2]; e2.prev_length >= e2.good_match && (i2 >>= 2), o2 > e2.lookahead && (o2 = e2.lookahead); do { if (u2[(r2 = t2) + a2] === p2 && u2[r2 + a2 - 1] === d2 && u2[r2] === u2[s2] && u2[++r2] === u2[s2 + 1]) { s2 += 2, r2++; do { } while (u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && u2[++s2] === u2[++r2] && s2 < c2); if (n2 = S - (c2 - s2), s2 = c2 - S, a2 < n2) { if (e2.match_start = t2, o2 <= (a2 = n2)) break; d2 = u2[s2 + a2 - 1], p2 = u2[s2 + a2]; } } } while ((t2 = f2[t2 & l2]) > h2 && 0 != --i2); return a2 <= e2.lookahead ? a2 : e2.lookahead; } function j(e2) { var t2, r2, n2, i2, s2, a2, o2, h2, u2, l2, f2 = e2.w_size; do { if (i2 = e2.window_size - e2.lookahead - e2.strstart, e2.strstart >= f2 + (f2 - z)) { for (c.arraySet(e2.window, e2.window, f2, f2, 0), e2.match_start -= f2, e2.strstart -= f2, e2.block_start -= f2, t2 = r2 = e2.hash_size; n2 = e2.head[--t2], e2.head[t2] = f2 <= n2 ? n2 - f2 : 0, --r2; ) ; for (t2 = r2 = f2; n2 = e2.prev[--t2], e2.prev[t2] = f2 <= n2 ? n2 - f2 : 0, --r2; ) ; i2 += f2; } if (0 === e2.strm.avail_in) break; if (a2 = e2.strm, o2 = e2.window, h2 = e2.strstart + e2.lookahead, u2 = i2, l2 = void 0, l2 = a2.avail_in, u2 < l2 && (l2 = u2), r2 = 0 === l2 ? 0 : (a2.avail_in -= l2, c.arraySet(o2, a2.input, a2.next_in, l2, h2), 1 === a2.state.wrap ? a2.adler = d(a2.adler, o2, l2, h2) : 2 === a2.state.wrap && (a2.adler = p(a2.adler, o2, l2, h2)), a2.next_in += l2, a2.total_in += l2, l2), e2.lookahead += r2, e2.lookahead + e2.insert >= x) for (s2 = e2.strstart - e2.insert, e2.ins_h = e2.window[s2], e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[s2 + 1]) & e2.hash_mask; e2.insert && (e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[s2 + x - 1]) & e2.hash_mask, e2.prev[s2 & e2.w_mask] = e2.head[e2.ins_h], e2.head[e2.ins_h] = s2, s2++, e2.insert--, !(e2.lookahead + e2.insert < x)); ) ; } while (e2.lookahead < z && 0 !== e2.strm.avail_in); } function Z(e2, t2) { for (var r2, n2; ; ) { if (e2.lookahead < z) { if (j(e2), e2.lookahead < z && t2 === l) return A; if (0 === e2.lookahead) break; } if (r2 = 0, e2.lookahead >= x && (e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[e2.strstart + x - 1]) & e2.hash_mask, r2 = e2.prev[e2.strstart & e2.w_mask] = e2.head[e2.ins_h], e2.head[e2.ins_h] = e2.strstart), 0 !== r2 && e2.strstart - r2 <= e2.w_size - z && (e2.match_length = L(e2, r2)), e2.match_length >= x) if (n2 = u._tr_tally(e2, e2.strstart - e2.match_start, e2.match_length - x), e2.lookahead -= e2.match_length, e2.match_length <= e2.max_lazy_match && e2.lookahead >= x) { for (e2.match_length--; e2.strstart++, e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[e2.strstart + x - 1]) & e2.hash_mask, r2 = e2.prev[e2.strstart & e2.w_mask] = e2.head[e2.ins_h], e2.head[e2.ins_h] = e2.strstart, 0 != --e2.match_length; ) ; e2.strstart++; } else e2.strstart += e2.match_length, e2.match_length = 0, e2.ins_h = e2.window[e2.strstart], e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[e2.strstart + 1]) & e2.hash_mask; else n2 = u._tr_tally(e2, 0, e2.window[e2.strstart]), e2.lookahead--, e2.strstart++; if (n2 && (N(e2, false), 0 === e2.strm.avail_out)) return A; } return e2.insert = e2.strstart < x - 1 ? e2.strstart : x - 1, t2 === f ? (N(e2, true), 0 === e2.strm.avail_out ? O : B) : e2.last_lit && (N(e2, false), 0 === e2.strm.avail_out) ? A : I; } function W(e2, t2) { for (var r2, n2, i2; ; ) { if (e2.lookahead < z) { if (j(e2), e2.lookahead < z && t2 === l) return A; if (0 === e2.lookahead) break; } if (r2 = 0, e2.lookahead >= x && (e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[e2.strstart + x - 1]) & e2.hash_mask, r2 = e2.prev[e2.strstart & e2.w_mask] = e2.head[e2.ins_h], e2.head[e2.ins_h] = e2.strstart), e2.prev_length = e2.match_length, e2.prev_match = e2.match_start, e2.match_length = x - 1, 0 !== r2 && e2.prev_length < e2.max_lazy_match && e2.strstart - r2 <= e2.w_size - z && (e2.match_length = L(e2, r2), e2.match_length <= 5 && (1 === e2.strategy || e2.match_length === x && 4096 < e2.strstart - e2.match_start) && (e2.match_length = x - 1)), e2.prev_length >= x && e2.match_length <= e2.prev_length) { for (i2 = e2.strstart + e2.lookahead - x, n2 = u._tr_tally(e2, e2.strstart - 1 - e2.prev_match, e2.prev_length - x), e2.lookahead -= e2.prev_length - 1, e2.prev_length -= 2; ++e2.strstart <= i2 && (e2.ins_h = (e2.ins_h << e2.hash_shift ^ e2.window[e2.strstart + x - 1]) & e2.hash_mask, r2 = e2.prev[e2.strstart & e2.w_mask] = e2.head[e2.ins_h], e2.head[e2.ins_h] = e2.strstart), 0 != --e2.prev_length; ) ; if (e2.match_available = 0, e2.match_length = x - 1, e2.strstart++, n2 && (N(e2, false), 0 === e2.strm.avail_out)) return A; } else if (e2.match_available) { if ((n2 = u._tr_tally(e2, 0, e2.window[e2.strstart - 1])) && N(e2, false), e2.strstart++, e2.lookahead--, 0 === e2.strm.avail_out) return A; } else e2.match_available = 1, e2.strstart++, e2.lookahead--; } return e2.match_available && (n2 = u._tr_tally(e2, 0, e2.window[e2.strstart - 1]), e2.match_available = 0), e2.insert = e2.strstart < x - 1 ? e2.strstart : x - 1, t2 === f ? (N(e2, true), 0 === e2.strm.avail_out ? O : B) : e2.last_lit && (N(e2, false), 0 === e2.strm.avail_out) ? A : I; } function M(e2, t2, r2, n2, i2) { this.good_length = e2, this.max_lazy = t2, this.nice_length = r2, this.max_chain = n2, this.func = i2; } function H() { 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 = v, 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 c.Buf16(2 * w), this.dyn_dtree = new c.Buf16(2 * (2 * a + 1)), this.bl_tree = new c.Buf16(2 * (2 * o + 1)), D(this.dyn_ltree), D(this.dyn_dtree), D(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new c.Buf16(k + 1), this.heap = new c.Buf16(2 * s + 1), D(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new c.Buf16(2 * s + 1), D(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; } function G(e2) { var t2; return e2 && e2.state ? (e2.total_in = e2.total_out = 0, e2.data_type = i, (t2 = e2.state).pending = 0, t2.pending_out = 0, t2.wrap < 0 && (t2.wrap = -t2.wrap), t2.status = t2.wrap ? C : E, e2.adler = 2 === t2.wrap ? 0 : 1, t2.last_flush = l, u._tr_init(t2), m) : R(e2, _); } function K(e2) { var t2 = G(e2); return t2 === m && function(e3) { e3.window_size = 2 * e3.w_size, D(e3.head), e3.max_lazy_match = h[e3.level].max_lazy, e3.good_match = h[e3.level].good_length, e3.nice_match = h[e3.level].nice_length, e3.max_chain_length = h[e3.level].max_chain, e3.strstart = 0, e3.block_start = 0, e3.lookahead = 0, e3.insert = 0, e3.match_length = e3.prev_length = x - 1, e3.match_available = 0, e3.ins_h = 0; }(e2.state), t2; } function Y(e2, t2, r2, n2, i2, s2) { if (!e2) return _; var a2 = 1; if (t2 === g && (t2 = 6), n2 < 0 ? (a2 = 0, n2 = -n2) : 15 < n2 && (a2 = 2, n2 -= 16), i2 < 1 || y < i2 || r2 !== v || n2 < 8 || 15 < n2 || t2 < 0 || 9 < t2 || s2 < 0 || b < s2) return R(e2, _); 8 === n2 && (n2 = 9); var o2 = new H(); return (e2.state = o2).strm = e2, o2.wrap = a2, o2.gzhead = null, o2.w_bits = n2, o2.w_size = 1 << o2.w_bits, o2.w_mask = o2.w_size - 1, o2.hash_bits = i2 + 7, o2.hash_size = 1 << o2.hash_bits, o2.hash_mask = o2.hash_size - 1, o2.hash_shift = ~~((o2.hash_bits + x - 1) / x), o2.window = new c.Buf8(2 * o2.w_size), o2.head = new c.Buf16(o2.hash_size), o2.prev = new c.Buf16(o2.w_size), o2.lit_bufsize = 1 << i2 + 6, o2.pending_buf_size = 4 * o2.lit_bufsize, o2.pending_buf = new c.Buf8(o2.pending_buf_size), o2.d_buf = 1 * o2.lit_bufsize, o2.l_buf = 3 * o2.lit_bufsize, o2.level = t2, o2.strategy = s2, o2.method = r2, K(e2); } h = [new M(0, 0, 0, 0, function(e2, t2) { var r2 = 65535; for (r2 > e2.pending_buf_size - 5 && (r2 = e2.pending_buf_size - 5); ; ) { if (e2.lookahead <= 1) { if (j(e2), 0 === e2.lookahead && t2 === l) return A; if (0 === e2.lookahead) break; } e2.strstart += e2.lookahead, e2.lookahead = 0; var n2 = e2.block_start + r2; if ((0 === e2.strstart || e2.strstart >= n2) && (e2.lookahead = e2.strstart - n2, e2.strstart = n2, N(e2, false), 0 === e2.strm.avail_out)) return A; if (e2.strstart - e2.block_start >= e2.w_size - z && (N(e2, false), 0 === e2.strm.avail_out)) return A; } return e2.insert = 0, t2 === f ? (N(e2, true), 0 === e2.strm.avail_out ? O : B) : (e2.strstart > e2.block_start && (N(e2, false), e2.strm.avail_out), A); }), new M(4, 4, 8, 4, Z), new M(4, 5, 16, 8, Z), new M(4, 6, 32, 32, Z), new M(4, 4, 16, 16, W), new M(8, 16, 32, 32, W), new M(8, 16, 128, 128, W), new M(8, 32, 128, 256, W), new M(32, 128, 258, 1024, W), new M(32, 258, 258, 4096, W)], r.deflateInit = function(e2, t2) { return Y(e2, t2, v, 15, 8, 0); }, r.deflateInit2 = Y, r.deflateReset = K, r.deflateResetKeep = G, r.deflateSetHeader = function(e2, t2) { return e2 && e2.state ? 2 !== e2.state.wrap ? _ : (e2.state.gzhead = t2, m) : _; }, r.deflate = function(e2, t2) { var r2, n2, i2, s2; if (!e2 || !e2.state || 5 < t2 || t2 < 0) return e2 ? R(e2, _) : _; if (n2 = e2.state, !e2.output || !e2.input && 0 !== e2.avail_in || 666 === n2.status && t2 !== f) return R(e2, 0 === e2.avail_out ? -5 : _); if (n2.strm = e2, r2 = n2.last_flush, n2.last_flush = t2, n2.status === C) if (2 === n2.wrap) e2.adler = 0, U(n2, 31), U(n2, 139), U(n2, 8), n2.gzhead ? (U(n2, (n2.gzhead.text ? 1 : 0) + (n2.gzhead.hcrc ? 2 : 0) + (n2.gzhead.extra ? 4 : 0) + (n2.gzhead.name ? 8 : 0) + (n2.gzhead.comment ? 16 : 0)), U(n2, 255 & n2.gzhead.time), U(n2, n2.gzhead.time >> 8 & 255), U(n2, n2.gzhead.time >> 16 & 255), U(n2, n2.gzhead.time >> 24 & 255), U(n2, 9 === n2.level ? 2 : 2 <= n2.strategy || n2.level < 2 ? 4 : 0), U(n2, 255 & n2.gzhead.os), n2.gzhead.extra && n2.gzhead.extra.length && (U(n2, 255 & n2.gzhead.extra.length), U(n2, n2.gzhead.extra.length >> 8 & 255)), n2.gzhead.hcrc && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending, 0)), n2.gzindex = 0, n2.status = 69) : (U(n2, 0), U(n2, 0), U(n2, 0), U(n2, 0), U(n2, 0), U(n2, 9 === n2.level ? 2 : 2 <= n2.strategy || n2.level < 2 ? 4 : 0), U(n2, 3), n2.status = E); else { var a2 = v + (n2.w_bits - 8 << 4) << 8; a2 |= (2 <= n2.strategy || n2.level < 2 ? 0 : n2.level < 6 ? 1 : 6 === n2.level ? 2 : 3) << 6, 0 !== n2.strstart && (a2 |= 32), a2 += 31 - a2 % 31, n2.status = E, P(n2, a2), 0 !== n2.strstart && (P(n2, e2.adler >>> 16), P(n2, 65535 & e2.adler)), e2.adler = 1; } if (69 === n2.status) if (n2.gzhead.extra) { for (i2 = n2.pending; n2.gzindex < (65535 & n2.gzhead.extra.length) && (n2.pending !== n2.pending_buf_size || (n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), F(e2), i2 = n2.pending, n2.pending !== n2.pending_buf_size)); ) U(n2, 255 & n2.gzhead.extra[n2.gzindex]), n2.gzindex++; n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), n2.gzindex === n2.gzhead.extra.length && (n2.gzindex = 0, n2.status = 73); } else n2.status = 73; if (73 === n2.status) if (n2.gzhead.name) { i2 = n2.pending; do { if (n2.pending === n2.pending_buf_size && (n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), F(e2), i2 = n2.pending, n2.pending === n2.pending_buf_size)) { s2 = 1; break; } s2 = n2.gzindex < n2.gzhead.name.length ? 255 & n2.gzhead.name.charCodeAt(n2.gzindex++) : 0, U(n2, s2); } while (0 !== s2); n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), 0 === s2 && (n2.gzindex = 0, n2.status = 91); } else n2.status = 91; if (91 === n2.status) if (n2.gzhead.comment) { i2 = n2.pending; do { if (n2.pending === n2.pending_buf_size && (n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), F(e2), i2 = n2.pending, n2.pending === n2.pending_buf_size)) { s2 = 1; break; } s2 = n2.gzindex < n2.gzhead.comment.length ? 255 & n2.gzhead.comment.charCodeAt(n2.gzindex++) : 0, U(n2, s2); } while (0 !== s2); n2.gzhead.hcrc && n2.pending > i2 && (e2.adler = p(e2.adler, n2.pending_buf, n2.pending - i2, i2)), 0 === s2 && (n2.status = 103); } else n2.status = 103; if (103 === n2.status && (n2.gzhead.hcrc ? (n2.pending + 2 > n2.pending_buf_size && F(e2), n2.pending + 2 <= n2.pending_buf_size && (U(n2, 255 & e2.adler), U(n2, e2.adler >> 8 & 255), e2.adler = 0, n2.status = E)) : n2.status = E), 0 !== n2.pending) { if (F(e2), 0 === e2.avail_out) return n2.last_flush = -1, m; } else if (0 === e2.avail_in && T(t2) <= T(r2) && t2 !== f) return R(e2, -5); if (666 === n2.status && 0 !== e2.avail_in) return R(e2, -5); if (0 !== e2.avail_in || 0 !== n2.lookahead || t2 !== l && 666 !== n2.status) { var o2 = 2 === n2.strategy ? function(e3, t3) { for (var r3; ; ) { if (0 === e3.lookahead && (j(e3), 0 === e3.lookahead)) { if (t3 === l) return A; break; } if (e3.match_length = 0, r3 = u._tr_tally(e3, 0, e3.window[e3.strstart]), e3.lookahead--, e3.strstart++, r3 && (N(e3, false), 0 === e3.strm.avail_out)) return A; } return e3.insert = 0, t3 === f ? (N(e3, true), 0 === e3.strm.avail_out ? O : B) : e3.last_lit && (N(e3, false), 0 === e3.strm.avail_out) ? A : I; }(n2, t2) : 3 === n2.strategy ? function(e3, t3) { for (var r3, n3, i3, s3, a3 = e3.window; ; ) { if (e3.lookahead <= S) { if (j(e3), e3.lookahead <= S && t3 === l) return A; if (0 === e3.lookahead) break; } if (e3.match_length = 0, e3.lookahead >= x && 0 < e3.strstart && (n3 = a3[i3 = e3.strstart - 1]) === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3]) { s3 = e3.strstart + S; do { } while (n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && n3 === a3[++i3] && i3 < s3); e3.match_length = S - (s3 - i3), e3.match_length > e3.lookahead && (e3.match_length = e3.lookahead); } if (e3.match_length >= x ? (r3 = u._tr_tally(e3, 1, e3.match_length - x), e3.lookahead -= e3.match_length, e3.strstart += e3.match_length, e3.match_length = 0) : (r3 = u._tr_tally(e3, 0, e3.window[e3.strstart]), e3.lookahead--, e3.strstart++), r3 && (N(e3, false), 0 === e3.strm.avail_out)) return A; } return e3.insert = 0, t3 === f ? (N(e3, true), 0 === e3.strm.avail_out ? O : B) : e3.last_lit && (N(e3, false), 0 === e3.strm.avail_out) ? A : I; }(n2, t2) : h[n2.level].func(n2, t2); if (o2 !== O && o2 !== B || (n2.status = 666), o2 === A || o2 === O) return 0 === e2.avail_out && (n2.last_flush = -1), m; if (o2 === I && (1 === t2 ? u._tr_align(n2) : 5 !== t2 && (u._tr_stored_block(n2, 0, 0, false), 3 === t2 && (D(n2.head), 0 === n2.lookahead && (n2.strstart = 0, n2.block_start = 0, n2.insert = 0))), F(e2), 0 === e2.avail_out)) return n2.last_flush = -1, m; } return t2 !== f ? m : n2.wrap <= 0 ? 1 : (2 === n2.wrap ? (U(n2, 255 & e2.adler), U(n2, e2.adler >> 8 & 255), U(n2, e2.adler >> 16 & 255), U(n2, e2.adler >> 24 & 255), U(n2, 255 & e2.total_in), U(n2, e2.total_in >> 8 & 255), U(n2, e2.total_in >> 16 & 255), U(n2, e2.total_in >> 24 & 255)) : (P(n2, e2.adler >>> 16), P(n2, 65535 & e2.adler)), F(e2), 0 < n2.wrap && (n2.wrap = -n2.wrap), 0 !== n2.pending ? m : 1); }, r.deflateEnd = function(e2) { var t2; return e2 && e2.state ? (t2 = e2.state.status) !== C && 69 !== t2 && 73 !== t2 && 91 !== t2 && 103 !== t2 && t2 !== E && 666 !== t2 ? R(e2, _) : (e2.state = null, t2 === E ? R(e2, -3) : m) : _; }, r.deflateSetDictionary = function(e2, t2) { var r2, n2, i2, s2, a2, o2, h2, u2, l2 = t2.length; if (!e2 || !e2.state) return _; if (2 === (s2 = (r2 = e2.state).wrap) || 1 === s2 && r2.status !== C || r2.lookahead) return _; for (1 === s2 && (e2.adler = d(e2.adler, t2, l2, 0)), r2.wrap = 0, l2 >= r2.w_size && (0 === s2 && (D(r2.head), r2.strstart = 0, r2.block_start = 0, r2.insert = 0), u2 = new c.Buf8(r2.w_size), c.arraySet(u2, t2, l2 - r2.w_size, r2.w_size, 0), t2 = u2, l2 = r2.w_size), a2 = e2.avail_in, o2 = e2.next_in, h2 = e2.input, e2.avail_in = l2, e2.next_in = 0, e2.input = t2, j(r2); r2.lookahead >= x; ) { for (n2 = r2.strstart, i2 = r2.lookahead - (x - 1); r2.ins_h = (r2.ins_h << r2.hash_shift ^ r2.window[n2 + x - 1]) & r2.hash_mask, r2.prev[n2 & r2.w_mask] = r2.head[r2.ins_h], r2.head[r2.ins_h] = n2, n2++, --i2; ) ; r2.strstart = n2, r2.lookahead = x - 1, j(r2); } return r2.strstart += r2.lookahead, r2.block_start = r2.strstart, r2.insert = r2.lookahead, r2.lookahead = 0, r2.match_length = r2.prev_length = x - 1, r2.match_available = 0, e2.next_in = o2, e2.input = h2, e2.avail_in = a2, r2.wrap = s2, m; }, r.deflateInfo = "pako deflate (from Nodeca project)"; }, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./messages": 51, "./trees": 52 }], 47: [function(e, t, r) { "use strict"; t.exports = function() { 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 = false; }; }, {}], 48: [function(e, t, r) { "use strict"; t.exports = function(e2, t2) { var r2, n, i, s, a, o, h, u, l, f, c, d, p, m, _, g, b, v, y, w, k, x, S, z, C; r2 = e2.state, n = e2.next_in, z = e2.input, i = n + (e2.avail_in - 5), s = e2.next_out, C = e2.output, a = s - (t2 - e2.avail_out), o = s + (e2.avail_out - 257), h = r2.dmax, u = r2.wsize, l = r2.whave, f = r2.wnext, c = r2.window, d = r2.hold, p = r2.bits, m = r2.lencode, _ = r2.distcode, g = (1 << r2.lenbits) - 1, b = (1 << r2.distbits) - 1; e: do { p < 15 && (d += z[n++] << p, p += 8, d += z[n++] << p, p += 8), v = m[d & g]; t: for (; ; ) { if (d >>>= y = v >>> 24, p -= y, 0 === (y = v >>> 16 & 255)) C[s++] = 65535 & v; else { if (!(16 & y)) { if (0 == (64 & y)) { v = m[(65535 & v) + (d & (1 << y) - 1)]; continue t; } if (32 & y) { r2.mode = 12; break e; } e2.msg = "invalid literal/length code", r2.mode = 30; break e; } w = 65535 & v, (y &= 15) && (p < y && (d += z[n++] << p, p += 8), w += d & (1 << y) - 1, d >>>= y, p -= y), p < 15 && (d += z[n++] << p, p += 8, d += z[n++] << p, p += 8), v = _[d & b]; r: for (; ; ) { if (d >>>= y = v >>> 24, p -= y, !(16 & (y = v >>> 16 & 255))) { if (0 == (64 & y)) { v = _[(65535 & v) + (d & (1 << y) - 1)]; continue r; } e2.msg = "invalid distance code", r2.mode = 30; break e; } if (k = 65535 & v, p < (y &= 15) && (d += z[n++] << p, (p += 8) < y && (d += z[n++] << p, p += 8)), h < (k += d & (1 << y) - 1)) { e2.msg = "invalid distance too far back", r2.mode = 30; break e; } if (d >>>= y, p -= y, (y = s - a) < k) { if (l < (y = k - y) && r2.sane) { e2.msg = "invalid distance too far back", r2.mode = 30; break e; } if (S = c, (x = 0) === f) { if (x += u - y, y < w) { for (w -= y; C[s++] = c[x++], --y; ) ; x = s - k, S = C; } } else if (f < y) { if (x += u + f - y, (y -= f) < w) { for (w -= y; C[s++] = c[x++], --y; ) ; if (x = 0, f < w) { for (w -= y = f; C[s++] = c[x++], --y; ) ; x = s - k, S = C; } } } else if (x += f - y, y < w) { for (w -= y; C[s++] = c[x++], --y; ) ; x = s - k, S = C; } for (; 2 < w; ) C[s++] = S[x++], C[s++] = S[x++], C[s++] = S[x++], w -= 3; w && (C[s++] = S[x++], 1 < w && (C[s++] = S[x++])); } else { for (x = s - k; C[s++] = C[x++], C[s++] = C[x++], C[s++] = C[x++], 2 < (w -= 3); ) ; w && (C[s++] = C[x++], 1 < w && (C[s++] = C[x++])); } break; } } break; } } while (n < i && s < o); n -= w = p >> 3, d &= (1 << (p -= w << 3)) - 1, e2.next_in = n, e2.next_out = s, e2.avail_in = n < i ? i - n + 5 : 5 - (n - i), e2.avail_out = s < o ? o - s + 257 : 257 - (s - o), r2.hold = d, r2.bits = p; }; }, {}], 49: [function(e, t, r) { "use strict"; var I = e("../utils/common"), O = e("./adler32"), B = e("./crc32"), R = e("./inffast"), T = e("./inftrees"), D = 1, F = 2, N = 0, U = -2, P = 1, n = 852, i = 592; function L(e2) { return (e2 >>> 24 & 255) + (e2 >>> 8 & 65280) + ((65280 & e2) << 8) + ((255 & e2) << 24); } function s() { this.mode = 0, this.last = false, this.wrap = 0, this.havedict = false, 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; } function a(e2) { var t2; return e2 && e2.state ? (t2 = e2.state, e2.total_in = e2.total_out = t2.total = 0, e2.msg = "", t2.wrap && (e2.adler = 1 & t2.wrap), t2.mode = P, t2.last = 0, t2.havedict = 0, t2.dmax = 32768, t2.head = null, t2.hold = 0, t2.bits = 0, t2.lencode = t2.lendyn = new I.Buf32(n), t2.distcode = t2.distdyn = new I.Buf32(i), t2.sane = 1, t2.back = -1, N) : U; } function o(e2) { var t2; return e2 && e2.state ? ((t2 = e2.state).wsize = 0, t2.whave = 0, t2.wnext = 0, a(e2)) : U; } function h(e2, t2) { var r2, n2; return e2 && e2.state ? (n2 = e2.state, t2 < 0 ? (r2 = 0, t2 = -t2) : (r2 = 1 + (t2 >> 4), t2 < 48 && (t2 &= 15)), t2 && (t2 < 8 || 15 < t2) ? U : (null !== n2.window && n2.wbits !== t2 && (n2.window = null), n2.wrap = r2, n2.wbits = t2, o(e2))) : U; } function u(e2, t2) { var r2, n2; return e2 ? (n2 = new s(), (e2.state = n2).window = null, (r2 = h(e2, t2)) !== N && (e2.state = null), r2) : U; } var l, f, c = true; function j(e2) { if (c) { var t2; for (l = new I.Buf32(512), f = new I.Buf32(32), t2 = 0; t2 < 144; ) e2.lens[t2++] = 8; for (; t2 < 256; ) e2.lens[t2++] = 9; for (; t2 < 280; ) e2.lens[t2++] = 7; for (; t2 < 288; ) e2.lens[t2++] = 8; for (T(D, e2.lens, 0, 288, l, 0, e2.work, { bits: 9 }), t2 = 0; t2 < 32; ) e2.lens[t2++] = 5; T(F, e2.lens, 0, 32, f, 0, e2.work, { bits: 5 }), c = false; } e2.lencode = l, e2.lenbits = 9, e2.distcode = f, e2.distbits = 5; } function Z(e2, t2, r2, n2) { var i2, s2 = e2.state; return null === s2.window && (s2.wsize = 1 << s2.wbits, s2.wnext = 0, s2.whave = 0, s2.window = new I.Buf8(s2.wsize)), n2 >= s2.wsize ? (I.arraySet(s2.window, t2, r2 - s2.wsize, s2.wsize, 0), s2.wnext = 0, s2.whave = s2.wsize) : (n2 < (i2 = s2.wsize - s2.wnext) && (i2 = n2), I.arraySet(s2.window, t2, r2 - n2, i2, s2.wnext), (n2 -= i2) ? (I.arraySet(s2.window, t2, r2 - n2, n2, 0), s2.wnext = n2, s2.whave = s2.wsize) : (s2.wnext += i2, s2.wnext === s2.wsize && (s2.wnext = 0), s2.whave < s2.wsize && (s2.whave += i2))), 0; } r.inflateReset = o, r.inflateReset2 = h, r.inflateResetKeep = a, r.inflateInit = function(e2) { return u(e2, 15); }, r.inflateInit2 = u, r.inflate = function(e2, t2) { var r2, n2, i2, s2, a2, o2, h2, u2, l2, f2, c2, d, p, m, _, g, b, v, y, w, k, x, S, z, C = 0, E = new I.Buf8(4), A = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; if (!e2 || !e2.state || !e2.output || !e2.input && 0 !== e2.avail_in) return U; 12 === (r2 = e2.state).mode && (r2.mode = 13), a2 = e2.next_out, i2 = e2.output, h2 = e2.avail_out, s2 = e2.next_in, n2 = e2.input, o2 = e2.avail_in, u2 = r2.hold, l2 = r2.bits, f2 = o2, c2 = h2, x = N; e: for (; ; ) switch (r2.mode) { case P: if (0 === r2.wrap) { r2.mode = 13; break; } for (; l2 < 16; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } if (2 & r2.wrap && 35615 === u2) { E[r2.check = 0] = 255 & u2, E[1] = u2 >>> 8 & 255, r2.check = B(r2.check, E, 2, 0), l2 = u2 = 0, r2.mode = 2; break; } if (r2.flags = 0, r2.head && (r2.head.done = false), !(1 & r2.wrap) || (((255 & u2) << 8) + (u2 >> 8)) % 31) { e2.msg = "incorrect header check", r2.mode = 30; break; } if (8 != (15 & u2)) { e2.msg = "unknown compression method", r2.mode = 30; break; } if (l2 -= 4, k = 8 + (15 & (u2 >>>= 4)), 0 === r2.wbits) r2.wbits = k; else if (k > r2.wbits) { e2.msg = "invalid window size", r2.mode = 30; break; } r2.dmax = 1 << k, e2.adler = r2.check = 1, r2.mode = 512 & u2 ? 10 : 12, l2 = u2 = 0; break; case 2: for (; l2 < 16; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } if (r2.flags = u2, 8 != (255 & r2.flags)) { e2.msg = "unknown compression method", r2.mode = 30; break; } if (57344 & r2.flags) { e2.msg = "unknown header flags set", r2.mode = 30; break; } r2.head && (r2.head.text = u2 >> 8 & 1), 512 & r2.flags && (E[0] = 255 & u2, E[1] = u2 >>> 8 & 255, r2.check = B(r2.check, E, 2, 0)), l2 = u2 = 0, r2.mode = 3; case 3: for (; l2 < 32; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } r2.head && (r2.head.time = u2), 512 & r2.flags && (E[0] = 255 & u2, E[1] = u2 >>> 8 & 255, E[2] = u2 >>> 16 & 255, E[3] = u2 >>> 24 & 255, r2.check = B(r2.check, E, 4, 0)), l2 = u2 = 0, r2.mode = 4; case 4: for (; l2 < 16; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } r2.head && (r2.head.xflags = 255 & u2, r2.head.os = u2 >> 8), 512 & r2.flags && (E[0] = 255 & u2, E[1] = u2 >>> 8 & 255, r2.check = B(r2.check, E, 2, 0)), l2 = u2 = 0, r2.mode = 5; case 5: if (1024 & r2.flags) { for (; l2 < 16; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } r2.length = u2, r2.head && (r2.head.extra_len = u2), 512 & r2.flags && (E[0] = 255 & u2, E[1] = u2 >>> 8 & 255, r2.check = B(r2.check, E, 2, 0)), l2 = u2 = 0; } else r2.head && (r2.head.extra = null); r2.mode = 6; case 6: if (1024 & r2.flags && (o2 < (d = r2.length) && (d = o2), d && (r2.head && (k = r2.head.extra_len - r2.length, r2.head.extra || (r2.head.extra = new Array(r2.head.extra_len)), I.arraySet(r2.head.extra, n2, s2, d, k)), 512 & r2.flags && (r2.check = B(r2.check, n2, d, s2)), o2 -= d, s2 += d, r2.length -= d), r2.length)) break e; r2.length = 0, r2.mode = 7; case 7: if (2048 & r2.flags) { if (0 === o2) break e; for (d = 0; k = n2[s2 + d++], r2.head && k && r2.length < 65536 && (r2.head.name += String.fromCharCode(k)), k && d < o2; ) ; if (512 & r2.flags && (r2.check = B(r2.check, n2, d, s2)), o2 -= d, s2 += d, k) break e; } else r2.head && (r2.head.name = null); r2.length = 0, r2.mode = 8; case 8: if (4096 & r2.flags) { if (0 === o2) break e; for (d = 0; k = n2[s2 + d++], r2.head && k && r2.length < 65536 && (r2.head.comment += String.fromCharCode(k)), k && d < o2; ) ; if (512 & r2.flags && (r2.check = B(r2.check, n2, d, s2)), o2 -= d, s2 += d, k) break e; } else r2.head && (r2.head.comment = null); r2.mode = 9; case 9: if (512 & r2.flags) { for (; l2 < 16; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } if (u2 !== (65535 & r2.check)) { e2.msg = "header crc mismatch", r2.mode = 30; break; } l2 = u2 = 0; } r2.head && (r2.head.hcrc = r2.flags >> 9 & 1, r2.head.done = true), e2.adler = r2.check = 0, r2.mode = 12; break; case 10: for (; l2 < 32; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } e2.adler = r2.check = L(u2), l2 = u2 = 0, r2.mode = 11; case 11: if (0 === r2.havedict) return e2.next_out = a2, e2.avail_out = h2, e2.next_in = s2, e2.avail_in = o2, r2.hold = u2, r2.bits = l2, 2; e2.adler = r2.check = 1, r2.mode = 12; case 12: if (5 === t2 || 6 === t2) break e; case 13: if (r2.last) { u2 >>>= 7 & l2, l2 -= 7 & l2, r2.mode = 27; break; } for (; l2 < 3; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } switch (r2.last = 1 & u2, l2 -= 1, 3 & (u2 >>>= 1)) { case 0: r2.mode = 14; break; case 1: if (j(r2), r2.mode = 20, 6 !== t2) break; u2 >>>= 2, l2 -= 2; break e; case 2: r2.mode = 17; break; case 3: e2.msg = "invalid block type", r2.mode = 30; } u2 >>>= 2, l2 -= 2; break; case 14: for (u2 >>>= 7 & l2, l2 -= 7 & l2; l2 < 32; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } if ((65535 & u2) != (u2 >>> 16 ^ 65535)) { e2.msg = "invalid stored block lengths", r2.mode = 30; break; } if (r2.length = 65535 & u2, l2 = u2 = 0, r2.mode = 15, 6 === t2) break e; case 15: r2.mode = 16; case 16: if (d = r2.length) { if (o2 < d && (d = o2), h2 < d && (d = h2), 0 === d) break e; I.arraySet(i2, n2, s2, d, a2), o2 -= d, s2 += d, h2 -= d, a2 += d, r2.length -= d; break; } r2.mode = 12; break; case 17: for (; l2 < 14; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } if (r2.nlen = 257 + (31 & u2), u2 >>>= 5, l2 -= 5, r2.ndist = 1 + (31 & u2), u2 >>>= 5, l2 -= 5, r2.ncode = 4 + (15 & u2), u2 >>>= 4, l2 -= 4, 286 < r2.nlen || 30 < r2.ndist) { e2.msg = "too many length or distance symbols", r2.mode = 30; break; } r2.have = 0, r2.mode = 18; case 18: for (; r2.have < r2.ncode; ) { for (; l2 < 3; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } r2.lens[A[r2.have++]] = 7 & u2, u2 >>>= 3, l2 -= 3; } for (; r2.have < 19; ) r2.lens[A[r2.have++]] = 0; if (r2.lencode = r2.lendyn, r2.lenbits = 7, S = { bits: r2.lenbits }, x = T(0, r2.lens, 0, 19, r2.lencode, 0, r2.work, S), r2.lenbits = S.bits, x) { e2.msg = "invalid code lengths set", r2.mode = 30; break; } r2.have = 0, r2.mode = 19; case 19: for (; r2.have < r2.nlen + r2.ndist; ) { for (; g = (C = r2.lencode[u2 & (1 << r2.lenbits) - 1]) >>> 16 & 255, b = 65535 & C, !((_ = C >>> 24) <= l2); ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } if (b < 16) u2 >>>= _, l2 -= _, r2.lens[r2.have++] = b; else { if (16 === b) { for (z = _ + 2; l2 < z; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } if (u2 >>>= _, l2 -= _, 0 === r2.have) { e2.msg = "invalid bit length repeat", r2.mode = 30; break; } k = r2.lens[r2.have - 1], d = 3 + (3 & u2), u2 >>>= 2, l2 -= 2; } else if (17 === b) { for (z = _ + 3; l2 < z; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } l2 -= _, k = 0, d = 3 + (7 & (u2 >>>= _)), u2 >>>= 3, l2 -= 3; } else { for (z = _ + 7; l2 < z; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } l2 -= _, k = 0, d = 11 + (127 & (u2 >>>= _)), u2 >>>= 7, l2 -= 7; } if (r2.have + d > r2.nlen + r2.ndist) { e2.msg = "invalid bit length repeat", r2.mode = 30; break; } for (; d--; ) r2.lens[r2.have++] = k; } } if (30 === r2.mode) break; if (0 === r2.lens[256]) { e2.msg = "invalid code -- missing end-of-block", r2.mode = 30; break; } if (r2.lenbits = 9, S = { bits: r2.lenbits }, x = T(D, r2.lens, 0, r2.nlen, r2.lencode, 0, r2.work, S), r2.lenbits = S.bits, x) { e2.msg = "invalid literal/lengths set", r2.mode = 30; break; } if (r2.distbits = 6, r2.distcode = r2.distdyn, S = { bits: r2.distbits }, x = T(F, r2.lens, r2.nlen, r2.ndist, r2.distcode, 0, r2.work, S), r2.distbits = S.bits, x) { e2.msg = "invalid distances set", r2.mode = 30; break; } if (r2.mode = 20, 6 === t2) break e; case 20: r2.mode = 21; case 21: if (6 <= o2 && 258 <= h2) { e2.next_out = a2, e2.avail_out = h2, e2.next_in = s2, e2.avail_in = o2, r2.hold = u2, r2.bits = l2, R(e2, c2), a2 = e2.next_out, i2 = e2.output, h2 = e2.avail_out, s2 = e2.next_in, n2 = e2.input, o2 = e2.avail_in, u2 = r2.hold, l2 = r2.bits, 12 === r2.mode && (r2.back = -1); break; } for (r2.back = 0; g = (C = r2.lencode[u2 & (1 << r2.lenbits) - 1]) >>> 16 & 255, b = 65535 & C, !((_ = C >>> 24) <= l2); ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } if (g && 0 == (240 & g)) { for (v = _, y = g, w = b; g = (C = r2.lencode[w + ((u2 & (1 << v + y) - 1) >> v)]) >>> 16 & 255, b = 65535 & C, !(v + (_ = C >>> 24) <= l2); ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } u2 >>>= v, l2 -= v, r2.back += v; } if (u2 >>>= _, l2 -= _, r2.back += _, r2.length = b, 0 === g) { r2.mode = 26; break; } if (32 & g) { r2.back = -1, r2.mode = 12; break; } if (64 & g) { e2.msg = "invalid literal/length code", r2.mode = 30; break; } r2.extra = 15 & g, r2.mode = 22; case 22: if (r2.extra) { for (z = r2.extra; l2 < z; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } r2.length += u2 & (1 << r2.extra) - 1, u2 >>>= r2.extra, l2 -= r2.extra, r2.back += r2.extra; } r2.was = r2.length, r2.mode = 23; case 23: for (; g = (C = r2.distcode[u2 & (1 << r2.distbits) - 1]) >>> 16 & 255, b = 65535 & C, !((_ = C >>> 24) <= l2); ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } if (0 == (240 & g)) { for (v = _, y = g, w = b; g = (C = r2.distcode[w + ((u2 & (1 << v + y) - 1) >> v)]) >>> 16 & 255, b = 65535 & C, !(v + (_ = C >>> 24) <= l2); ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } u2 >>>= v, l2 -= v, r2.back += v; } if (u2 >>>= _, l2 -= _, r2.back += _, 64 & g) { e2.msg = "invalid distance code", r2.mode = 30; break; } r2.offset = b, r2.extra = 15 & g, r2.mode = 24; case 24: if (r2.extra) { for (z = r2.extra; l2 < z; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } r2.offset += u2 & (1 << r2.extra) - 1, u2 >>>= r2.extra, l2 -= r2.extra, r2.back += r2.extra; } if (r2.offset > r2.dmax) { e2.msg = "invalid distance too far back", r2.mode = 30; break; } r2.mode = 25; case 25: if (0 === h2) break e; if (d = c2 - h2, r2.offset > d) { if ((d = r2.offset - d) > r2.whave && r2.sane) { e2.msg = "invalid distance too far back", r2.mode = 30; break; } p = d > r2.wnext ? (d -= r2.wnext, r2.wsize - d) : r2.wnext - d, d > r2.length && (d = r2.length), m = r2.window; } else m = i2, p = a2 - r2.offset, d = r2.length; for (h2 < d && (d = h2), h2 -= d, r2.length -= d; i2[a2++] = m[p++], --d; ) ; 0 === r2.length && (r2.mode = 21); break; case 26: if (0 === h2) break e; i2[a2++] = r2.length, h2--, r2.mode = 21; break; case 27: if (r2.wrap) { for (; l2 < 32; ) { if (0 === o2) break e; o2--, u2 |= n2[s2++] << l2, l2 += 8; } if (c2 -= h2, e2.total_out += c2, r2.total += c2, c2 && (e2.adler = r2.check = r2.flags ? B(r2.check, i2, c2, a2 - c2) : O(r2.check, i2, c2, a2 - c2)), c2 = h2, (r2.flags ? u2 : L(u2)) !== r2.check) { e2.msg = "incorrect data check", r2.mode = 30; break; } l2 = u2 = 0; } r2.mode = 28; case 28: if (r2.wrap && r2.flags) { for (; l2 < 32; ) { if (0 === o2) break e; o2--, u2 += n2[s2++] << l2, l2 += 8; } if (u2 !== (4294967295 & r2.total)) { e2.msg = "incorrect length check", r2.mode = 30; break; } l2 = u2 = 0; } r2.mode = 29; case 29: x = 1; break e; case 30: x = -3; break e; case 31: return -4; case 32: default: return U; } return e2.next_out = a2, e2.avail_out = h2, e2.next_in = s2, e2.avail_in = o2, r2.hold = u2, r2.bits = l2, (r2.wsize || c2 !== e2.avail_out && r2.mode < 30 && (r2.mode < 27 || 4 !== t2)) && Z(e2, e2.output, e2.next_out, c2 - e2.avail_out) ? (r2.mode = 31, -4) : (f2 -= e2.avail_in, c2 -= e2.avail_out, e2.total_in += f2, e2.total_out += c2, r2.total += c2, r2.wrap && c2 && (e2.adler = r2.check = r2.flags ? B(r2.check, i2, c2, e2.next_out - c2) : O(r2.check, i2, c2, e2.next_out - c2)), e2.data_type = r2.bits + (r2.last ? 64 : 0) + (12 === r2.mode ? 128 : 0) + (20 === r2.mode || 15 === r2.mode ? 256 : 0), (0 == f2 && 0 === c2 || 4 === t2) && x === N && (x = -5), x); }, r.inflateEnd = function(e2) { if (!e2 || !e2.state) return U; var t2 = e2.state; return t2.window && (t2.window = null), e2.state = null, N; }, r.inflateGetHeader = function(e2, t2) { var r2; return e2 && e2.state ? 0 == (2 & (r2 = e2.state).wrap) ? U : ((r2.head = t2).done = false, N) : U; }, r.inflateSetDictionary = function(e2, t2) { var r2, n2 = t2.length; return e2 && e2.state ? 0 !== (r2 = e2.state).wrap && 11 !== r2.mode ? U : 11 === r2.mode && O(1, t2, n2, 0) !== r2.check ? -3 : Z(e2, t2, n2, n2) ? (r2.mode = 31, -4) : (r2.havedict = 1, N) : U; }, r.inflateInfo = "pako inflate (from Nodeca project)"; }, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function(e, t, r) { "use strict"; var D = e("../utils/common"), F = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], N = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], U = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], P = [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]; t.exports = function(e2, t2, r2, n, i, s, a, o) { var h, u, l, f, c, d, p, m, _, g = o.bits, b = 0, v = 0, y = 0, w = 0, k = 0, x = 0, S = 0, z = 0, C = 0, E = 0, A = null, I = 0, O = new D.Buf16(16), B = new D.Buf16(16), R = null, T = 0; for (b = 0; b <= 15; b++) O[b] = 0; for (v = 0; v < n; v++) O[t2[r2 + v]]++; for (k = g, w = 15; 1 <= w && 0 === O[w]; w--) ; if (w < k && (k = w), 0 === w) return i[s++] = 20971520, i[s++] = 20971520, o.bits = 1, 0; for (y = 1; y < w && 0 === O[y]; y++) ; for (k < y && (k = y), b = z = 1; b <= 15; b++) if (z <<= 1, (z -= O[b]) < 0) return -1; if (0 < z && (0 === e2 || 1 !== w)) return -1; for (B[1] = 0, b = 1; b < 15; b++) B[b + 1] = B[b] + O[b]; for (v = 0; v < n; v++) 0 !== t2[r2 + v] && (a[B[t2[r2 + v]]++] = v); if (d = 0 === e2 ? (A = R = a, 19) : 1 === e2 ? (A = F, I -= 257, R = N, T -= 257, 256) : (A = U, R = P, -1), b = y, c = s, S = v = E = 0, l = -1, f = (C = 1 << (x = k)) - 1, 1 === e2 && 852 < C || 2 === e2 && 592 < C) return 1; for (; ; ) { for (p = b - S, _ = a[v] < d ? (m = 0, a[v]) : a[v] > d ? (m = R[T + a[v]], A[I + a[v]]) : (m = 96, 0), h = 1 << b - S, y = u = 1 << x; i[c + (E >> S) + (u -= h)] = p << 24 | m << 16 | _ | 0, 0 !== u; ) ; for (h = 1 << b - 1; E & h; ) h >>= 1; if (0 !== h ? (E &= h - 1, E += h) : E = 0, v++, 0 == --O[b]) { if (b === w) break; b = t2[r2 + a[v]]; } if (k < b && (E & f) !== l) { for (0 === S && (S = k), c += y, z = 1 << (x = b - S); x + S < w && !((z -= O[x + S]) <= 0); ) x++, z <<= 1; if (C += 1 << x, 1 === e2 && 852 < C || 2 === e2 && 592 < C) return 1; i[l = E & f] = k << 24 | x << 16 | c - s | 0; } } return 0 !== E && (i[c + E] = b - S << 24 | 64 << 16 | 0), o.bits = k, 0; }; }, { "../utils/common": 41 }], 51: [function(e, t, r) { "use strict"; t.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" }; }, {}], 52: [function(e, t, r) { "use strict"; var i = e("../utils/common"), o = 0, h = 1; function n(e2) { for (var t2 = e2.length; 0 <= --t2; ) e2[t2] = 0; } var s = 0, a = 29, u = 256, l = u + 1 + a, f = 30, c = 19, _ = 2 * l + 1, g = 15, d = 16, p = 7, m = 256, b = 16, v = 17, y = 18, w = [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], k = [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], x = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], S = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], z = new Array(2 * (l + 2)); n(z); var C = new Array(2 * f); n(C); var E = new Array(512); n(E); var A = new Array(256); n(A); var I = new Array(a); n(I); var O, B, R, T = new Array(f); function D(e2, t2, r2, n2, i2) { this.static_tree = e2, this.extra_bits = t2, this.extra_base = r2, this.elems = n2, this.max_length = i2, this.has_stree = e2 && e2.length; } function F(e2, t2) { this.dyn_tree = e2, this.max_code = 0, this.stat_desc = t2; } function N(e2) { return e2 < 256 ? E[e2] : E[256 + (e2 >>> 7)]; } function U(e2, t2) { e2.pending_buf[e2.pending++] = 255 & t2, e2.pending_buf[e2.pending++] = t2 >>> 8 & 255; } function P(e2, t2, r2) { e2.bi_valid > d - r2 ? (e2.bi_buf |= t2 << e2.bi_valid & 65535, U(e2, e2.bi_buf), e2.bi_buf = t2 >> d - e2.bi_valid, e2.bi_valid += r2 - d) : (e2.bi_buf |= t2 << e2.bi_valid & 65535, e2.bi_valid += r2); } function L(e2, t2, r2) { P(e2, r2[2 * t2], r2[2 * t2 + 1]); } function j(e2, t2) { for (var r2 = 0; r2 |= 1 & e2, e2 >>>= 1, r2 <<= 1, 0 < --t2; ) ; return r2 >>> 1; } function Z(e2, t2, r2) { var n2, i2, s2 = new Array(g + 1), a2 = 0; for (n2 = 1; n2 <= g; n2++) s2[n2] = a2 = a2 + r2[n2 - 1] << 1; for (i2 = 0; i2 <= t2; i2++) { var o2 = e2[2 * i2 + 1]; 0 !== o2 && (e2[2 * i2] = j(s2[o2]++, o2)); } } function W(e2) { var t2; for (t2 = 0; t2 < l; t2++) e2.dyn_ltree[2 * t2] = 0; for (t2 = 0; t2 < f; t2++) e2.dyn_dtree[2 * t2] = 0; for (t2 = 0; t2 < c; t2++) e2.bl_tree[2 * t2] = 0; e2.dyn_ltree[2 * m] = 1, e2.opt_len = e2.static_len = 0, e2.last_lit = e2.matches = 0; } function M(e2) { 8 < e2.bi_valid ? U(e2, e2.bi_buf) : 0 < e2.bi_valid && (e2.pending_buf[e2.pending++] = e2.bi_buf), e2.bi_buf = 0, e2.bi_valid = 0; } function H(e2, t2, r2, n2) { var i2 = 2 * t2, s2 = 2 * r2; return e2[i2] < e2[s2] || e2[i2] === e2[s2] && n2[t2] <= n2[r2]; } function G(e2, t2, r2) { for (var n2 = e2.heap[r2], i2 = r2 << 1; i2 <= e2.heap_len && (i2 < e2.heap_len && H(t2, e2.heap[i2 + 1], e2.heap[i2], e2.depth) && i2++, !H(t2, n2, e2.heap[i2], e2.depth)); ) e2.heap[r2] = e2.heap[i2], r2 = i2, i2 <<= 1; e2.heap[r2] = n2; } function K(e2, t2, r2) { var n2, i2, s2, a2, o2 = 0; if (0 !== e2.last_lit) for (; n2 = e2.pending_buf[e2.d_buf + 2 * o2] << 8 | e2.pending_buf[e2.d_buf + 2 * o2 + 1], i2 = e2.pending_buf[e2.l_buf + o2], o2++, 0 === n2 ? L(e2, i2, t2) : (L(e2, (s2 = A[i2]) + u + 1, t2), 0 !== (a2 = w[s2]) && P(e2, i2 -= I[s2], a2), L(e2, s2 = N(--n2), r2), 0 !== (a2 = k[s2]) && P(e2, n2 -= T[s2], a2)), o2 < e2.last_lit; ) ; L(e2, m, t2); } function Y(e2, t2) { var r2, n2, i2, s2 = t2.dyn_tree, a2 = t2.stat_desc.static_tree, o2 = t2.stat_desc.has_stree, h2 = t2.stat_desc.elems, u2 = -1; for (e2.heap_len = 0, e2.heap_max = _, r2 = 0; r2 < h2; r2++) 0 !== s2[2 * r2] ? (e2.heap[++e2.heap_len] = u2 = r2, e2.depth[r2] = 0) : s2[2 * r2 + 1] = 0; for (; e2.heap_len < 2; ) s2[2 * (i2 = e2.heap[++e2.heap_len] = u2 < 2 ? ++u2 : 0)] = 1, e2.depth[i2] = 0, e2.opt_len--, o2 && (e2.static_len -= a2[2 * i2 + 1]); for (t2.max_code = u2, r2 = e2.heap_len >> 1; 1 <= r2; r2--) G(e2, s2, r2); for (i2 = h2; r2 = e2.heap[1], e2.heap[1] = e2.heap[e2.heap_len--], G(e2, s2, 1), n2 = e2.heap[1], e2.heap[--e2.heap_max] = r2, e2.heap[--e2.heap_max] = n2, s2[2 * i2] = s2[2 * r2] + s2[2 * n2], e2.depth[i2] = (e2.depth[r2] >= e2.depth[n2] ? e2.depth[r2] : e2.depth[n2]) + 1, s2[2 * r2 + 1] = s2[2 * n2 + 1] = i2, e2.heap[1] = i2++, G(e2, s2, 1), 2 <= e2.heap_len; ) ; e2.heap[--e2.heap_max] = e2.heap[1], function(e3, t3) { var r3, n3, i3, s3, a3, o3, h3 = t3.dyn_tree, u3 = t3.max_code, l2 = t3.stat_desc.static_tree, f2 = t3.stat_desc.has_stree, c2 = t3.stat_desc.extra_bits, d2 = t3.stat_desc.extra_base, p2 = t3.stat_desc.max_length, m2 = 0; for (s3 = 0; s3 <= g; s3++) e3.bl_count[s3] = 0; for (h3[2 * e3.heap[e3.heap_max] + 1] = 0, r3 = e3.heap_max + 1; r3 < _; r3++) p2 < (s3 = h3[2 * h3[2 * (n3 = e3.heap[r3]) + 1] + 1] + 1) && (s3 = p2, m2++), h3[2 * n3 + 1] = s3, u3 < n3 || (e3.bl_count[s3]++, a3 = 0, d2 <= n3 && (a3 = c2[n3 - d2]), o3 = h3[2 * n3], e3.opt_len += o3 * (s3 + a3), f2 && (e3.static_len += o3 * (l2[2 * n3 + 1] + a3))); if (0 !== m2) { do { for (s3 = p2 - 1; 0 === e3.bl_count[s3]; ) s3--; e3.bl_count[s3]--, e3.bl_count[s3 + 1] += 2, e3.bl_count[p2]--, m2 -= 2; } while (0 < m2); for (s3 = p2; 0 !== s3; s3--) for (n3 = e3.bl_count[s3]; 0 !== n3; ) u3 < (i3 = e3.heap[--r3]) || (h3[2 * i3 + 1] !== s3 && (e3.opt_len += (s3 - h3[2 * i3 + 1]) * h3[2 * i3], h3[2 * i3 + 1] = s3), n3--); } }(e2, t2), Z(s2, u2, e2.bl_count); } function X(e2, t2, r2) { var n2, i2, s2 = -1, a2 = t2[1], o2 = 0, h2 = 7, u2 = 4; for (0 === a2 && (h2 = 138, u2 = 3), t2[2 * (r2 + 1) + 1] = 65535, n2 = 0; n2 <= r2; n2++) i2 = a2, a2 = t2[2 * (n2 + 1) + 1], ++o2 < h2 && i2 === a2 || (o2 < u2 ? e2.bl_tree[2 * i2] += o2 : 0 !== i2 ? (i2 !== s2 && e2.bl_tree[2 * i2]++, e2.bl_tree[2 * b]++) : o2 <= 10 ? e2.bl_tree[2 * v]++ : e2.bl_tree[2 * y]++, s2 = i2, u2 = (o2 = 0) === a2 ? (h2 = 138, 3) : i2 === a2 ? (h2 = 6, 3) : (h2 = 7, 4)); } function V(e2, t2, r2) { var n2, i2, s2 = -1, a2 = t2[1], o2 = 0, h2 = 7, u2 = 4; for (0 === a2 && (h2 = 138, u2 = 3), n2 = 0; n2 <= r2; n2++) if (i2 = a2, a2 = t2[2 * (n2 + 1) + 1], !(++o2 < h2 && i2 === a2)) { if (o2 < u2) for (; L(e2, i2, e2.bl_tree), 0 != --o2; ) ; else 0 !== i2 ? (i2 !== s2 && (L(e2, i2, e2.bl_tree), o2--), L(e2, b, e2.bl_tree), P(e2, o2 - 3, 2)) : o2 <= 10 ? (L(e2, v, e2.bl_tree), P(e2, o2 - 3, 3)) : (L(e2, y, e2.bl_tree), P(e2, o2 - 11, 7)); s2 = i2, u2 = (o2 = 0) === a2 ? (h2 = 138, 3) : i2 === a2 ? (h2 = 6, 3) : (h2 = 7, 4); } } n(T); var q = false; function J(e2, t2, r2, n2) { P(e2, (s << 1) + (n2 ? 1 : 0), 3), function(e3, t3, r3, n3) { M(e3), n3 && (U(e3, r3), U(e3, ~r3)), i.arraySet(e3.pending_buf, e3.window, t3, r3, e3.pending), e3.pending += r3; }(e2, t2, r2, true); } r._tr_init = function(e2) { q || (function() { var e3, t2, r2, n2, i2, s2 = new Array(g + 1); for (n2 = r2 = 0; n2 < a - 1; n2++) for (I[n2] = r2, e3 = 0; e3 < 1 << w[n2]; e3++) A[r2++] = n2; for (A[r2 - 1] = n2, n2 = i2 = 0; n2 < 16; n2++) for (T[n2] = i2, e3 = 0; e3 < 1 << k[n2]; e3++) E[i2++] = n2; for (i2 >>= 7; n2 < f; n2++) for (T[n2] = i2 << 7, e3 = 0; e3 < 1 << k[n2] - 7; e3++) E[256 + i2++] = n2; for (t2 = 0; t2 <= g; t2++) s2[t2] = 0; for (e3 = 0; e3 <= 143; ) z[2 * e3 + 1] = 8, e3++, s2[8]++; for (; e3 <= 255; ) z[2 * e3 + 1] = 9, e3++, s2[9]++; for (; e3 <= 279; ) z[2 * e3 + 1] = 7, e3++, s2[7]++; for (; e3 <= 287; ) z[2 * e3 + 1] = 8, e3++, s2[8]++; for (Z(z, l + 1, s2), e3 = 0; e3 < f; e3++) C[2 * e3 + 1] = 5, C[2 * e3] = j(e3, 5); O = new D(z, w, u + 1, l, g), B = new D(C, k, 0, f, g), R = new D(new Array(0), x, 0, c, p); }(), q = true), e2.l_desc = new F(e2.dyn_ltree, O), e2.d_desc = new F(e2.dyn_dtree, B), e2.bl_desc = new F(e2.bl_tree, R), e2.bi_buf = 0, e2.bi_valid = 0, W(e2); }, r._tr_stored_block = J, r._tr_flush_block = function(e2, t2, r2, n2) { var i2, s2, a2 = 0; 0 < e2.level ? (2 === e2.strm.data_type && (e2.strm.data_type = function(e3) { var t3, r3 = 4093624447; for (t3 = 0; t3 <= 31; t3++, r3 >>>= 1) if (1 & r3 && 0 !== e3.dyn_ltree[2 * t3]) return o; if (0 !== e3.dyn_ltree[18] || 0 !== e3.dyn_ltree[20] || 0 !== e3.dyn_ltree[26]) return h; for (t3 = 32; t3 < u; t3++) if (0 !== e3.dyn_ltree[2 * t3]) return h; return o; }(e2)), Y(e2, e2.l_desc), Y(e2, e2.d_desc), a2 = function(e3) { var t3; for (X(e3, e3.dyn_ltree, e3.l_desc.max_code), X(e3, e3.dyn_dtree, e3.d_desc.max_code), Y(e3, e3.bl_desc), t3 = c - 1; 3 <= t3 && 0 === e3.bl_tree[2 * S[t3] + 1]; t3--) ; return e3.opt_len += 3 * (t3 + 1) + 5 + 5 + 4, t3; }(e2), i2 = e2.opt_len + 3 + 7 >>> 3, (s2 = e2.static_len + 3 + 7 >>> 3) <= i2 && (i2 = s2)) : i2 = s2 = r2 + 5, r2 + 4 <= i2 && -1 !== t2 ? J(e2, t2, r2, n2) : 4 === e2.strategy || s2 === i2 ? (P(e2, 2 + (n2 ? 1 : 0), 3), K(e2, z, C)) : (P(e2, 4 + (n2 ? 1 : 0), 3), function(e3, t3, r3, n3) { var i3; for (P(e3, t3 - 257, 5), P(e3, r3 - 1, 5), P(e3, n3 - 4, 4), i3 = 0; i3 < n3; i3++) P(e3, e3.bl_tree[2 * S[i3] + 1], 3); V(e3, e3.dyn_ltree, t3 - 1), V(e3, e3.dyn_dtree, r3 - 1); }(e2, e2.l_desc.max_code + 1, e2.d_desc.max_code + 1, a2 + 1), K(e2, e2.dyn_ltree, e2.dyn_dtree)), W(e2), n2 && M(e2); }, r._tr_tally = function(e2, t2, r2) { return e2.pending_buf[e2.d_buf + 2 * e2.last_lit] = t2 >>> 8 & 255, e2.pending_buf[e2.d_buf + 2 * e2.last_lit + 1] = 255 & t2, e2.pending_buf[e2.l_buf + e2.last_lit] = 255 & r2, e2.last_lit++, 0 === t2 ? e2.dyn_ltree[2 * r2]++ : (e2.matches++, t2--, e2.dyn_ltree[2 * (A[r2] + u + 1)]++, e2.dyn_dtree[2 * N(t2)]++), e2.last_lit === e2.lit_bufsize - 1; }, r._tr_align = function(e2) { P(e2, 2, 3), L(e2, m, z), function(e3) { 16 === e3.bi_valid ? (U(e3, e3.bi_buf), e3.bi_buf = 0, e3.bi_valid = 0) : 8 <= e3.bi_valid && (e3.pending_buf[e3.pending++] = 255 & e3.bi_buf, e3.bi_buf >>= 8, e3.bi_valid -= 8); }(e2); }; }, { "../utils/common": 41 }], 53: [function(e, t, r) { "use strict"; t.exports = function() { 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; }; }, {}], 54: [function(e, t, r) { (function(e2) { !function(r2, n) { "use strict"; if (!r2.setImmediate) { var i, s, t2, a, o = 1, h = {}, u = false, l = r2.document, e3 = Object.getPrototypeOf && Object.getPrototypeOf(r2); e3 = e3 && e3.setTimeout ? e3 : r2, i = "[object process]" === {}.toString.call(r2.process) ? function(e4) { process.nextTick(function() { c(e4); }); } : function() { if (r2.postMessage && !r2.importScripts) { var e4 = true, t3 = r2.onmessage; return r2.onmessage = function() { e4 = false; }, r2.postMessage("", "*"), r2.onmessage = t3, e4; } }() ? (a = "setImmediate$" + Math.random() + "$", r2.addEventListener ? r2.addEventListener("message", d, false) : r2.attachEvent("onmessage", d), function(e4) { r2.postMessage(a + e4, "*"); }) : r2.MessageChannel ? ((t2 = new MessageChannel()).port1.onmessage = function(e4) { c(e4.data); }, function(e4) { t2.port2.postMessage(e4); }) : l && "onreadystatechange" in l.createElement("script") ? (s = l.documentElement, function(e4) { var t3 = l.createElement("script"); t3.onreadystatechange = function() { c(e4), t3.onreadystatechange = null, s.removeChild(t3), t3 = null; }, s.appendChild(t3); }) : function(e4) { setTimeout(c, 0, e4); }, e3.setImmediate = function(e4) { "function" != typeof e4 && (e4 = new Function("" + e4)); for (var t3 = new Array(arguments.length - 1), r3 = 0; r3 < t3.length; r3++) t3[r3] = arguments[r3 + 1]; var n2 = { callback: e4, args: t3 }; return h[o] = n2, i(o), o++; }, e3.clearImmediate = f; } function f(e4) { delete h[e4]; } function c(e4) { if (u) setTimeout(c, 0, e4); else { var t3 = h[e4]; if (t3) { u = true; try { !function(e5) { var t4 = e5.callback, r3 = e5.args; switch (r3.length) { case 0: t4(); break; case 1: t4(r3[0]); break; case 2: t4(r3[0], r3[1]); break; case 3: t4(r3[0], r3[1], r3[2]); break; default: t4.apply(n, r3); } }(t3); } finally { f(e4), u = false; } } } } function d(e4) { e4.source === r2 && "string" == typeof e4.data && 0 === e4.data.indexOf(a) && c(+e4.data.slice(a.length)); } }("undefined" == typeof self ? void 0 === e2 ? this : e2 : self); }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); }, {}] }, {}, [10])(10); }); } }); // ../../node_modules/pako/lib/utils/common.js var require_common = __commonJS({ "../../node_modules/pako/lib/utils/common.js"(exports) { "use strict"; var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined"; function _has(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); } exports.assign = function(obj) { var sources = Array.prototype.slice.call(arguments, 1); while (sources.length) { var source = sources.shift(); if (!source) { continue; } if (typeof source !== "object") { throw new TypeError(source + "must be non-object"); } for (var p in source) { if (_has(source, p)) { obj[p] = source[p]; } } } return obj; }; exports.shrinkBuf = function(buf, size) { if (buf.length === size) { return buf; } if (buf.subarray) { return buf.subarray(0, size); } buf.length = size; return buf; }; var fnTyped = { arraySet: function(dest, src, src_offs, len, dest_offs) { if (src.subarray && dest.subarray) { dest.set(src.subarray(src_offs, src_offs + len), dest_offs); return; } for (var i = 0; i < len; i++) { dest[dest_offs + i] = src[src_offs + i]; } }, // Join array of chunks to single array. flattenChunks: function(chunks) { var i, l, len, pos, chunk, result; len = 0; for (i = 0, l = chunks.length; i < l; i++) { len += chunks[i].length; } result = new Uint8Array(len); pos = 0; for (i = 0, l = chunks.length; i < l; i++) { chunk = chunks[i]; result.set(chunk, pos); pos += chunk.length; } return result; } }; var fnUntyped = { arraySet: function(dest, src, src_offs, len, dest_offs) { for (var i = 0; i < len; i++) { dest[dest_offs + i] = src[src_offs + i]; } }, // Join array of chunks to single array. flattenChunks: function(chunks) { return [].concat.apply([], chunks); } }; exports.setTyped = function(on) { if (on) { exports.Buf8 = Uint8Array; exports.Buf16 = Uint16Array; exports.Buf32 = Int32Array; exports.assign(exports, fnTyped); } else { exports.Buf8 = Array; exports.Buf16 = Array; exports.Buf32 = Array; exports.assign(exports, fnUntyped); } }; exports.setTyped(TYPED_OK); } }); // ../../node_modules/pako/lib/zlib/trees.js var require_trees = __commonJS({ "../../node_modules/pako/lib/zlib/trees.js"(exports) { "use strict"; var utils = require_common(); var Z_FIXED = 4; var Z_BINARY = 0; var Z_TEXT = 1; var Z_UNKNOWN = 2; function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } var STORED_BLOCK = 0; var STATIC_TREES = 1; var DYN_TREES = 2; var MIN_MATCH = 3; var MAX_MATCH = 258; var LENGTH_CODES = 29; var LITERALS = 256; var L_CODES = LITERALS + 1 + LENGTH_CODES; var D_CODES = 30; var BL_CODES = 19; var HEAP_SIZE = 2 * L_CODES + 1; var MAX_BITS = 15; var Buf_size = 16; var MAX_BL_BITS = 7; var END_BLOCK = 256; var REP_3_6 = 16; var REPZ_3_10 = 17; var REPZ_11_138 = 18; var extra_lbits = ( /* extra bits for each length code */ [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] ); var extra_dbits = ( /* extra bits for each distance code */ [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] ); var extra_blbits = ( /* extra bits for each bit length code */ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7] ); var bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; var DIST_CODE_LEN = 512; var static_ltree = new Array((L_CODES + 2) * 2); zero(static_ltree); var static_dtree = new Array(D_CODES * 2); zero(static_dtree); var _dist_code = new Array(DIST_CODE_LEN); zero(_dist_code); var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); zero(_length_code); var base_length = new Array(LENGTH_CODES); zero(base_length); var base_dist = new Array(D_CODES); zero(base_dist); function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { this.static_tree = static_tree; this.extra_bits = extra_bits; this.extra_base = extra_base; this.elems = elems; this.max_length = max_length; this.has_stree = static_tree && static_tree.length; } var static_l_desc; var static_d_desc; var static_bl_desc; function TreeDesc(dyn_tree, stat_desc) { this.dyn_tree = dyn_tree; this.max_code = 0; this.stat_desc = stat_desc; } function d_code(dist) { return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; } function put_short(s, w) { s.pending_buf[s.pending++] = w & 255; s.pending_buf[s.pending++] = w >>> 8 & 255; } function send_bits(s, value, length) { if (s.bi_valid > Buf_size - length) { s.bi_buf |= value << s.bi_valid & 65535; put_short(s, s.bi_buf); s.bi_buf = value >> Buf_size - s.bi_valid; s.bi_valid += length - Buf_size; } else { s.bi_buf |= value << s.bi_valid & 65535; s.bi_valid += length; } } function send_code(s, c, tree) { send_bits( s, tree[c * 2], tree[c * 2 + 1] /*.Len*/ ); } function bi_reverse(code, len) { var res = 0; do { res |= code & 1; code >>>= 1; res <<= 1; } while (--len > 0); return res >>> 1; } function bi_flush(s) { if (s.bi_valid === 16) { put_short(s, s.bi_buf); s.bi_buf = 0; s.bi_valid = 0; } else if (s.bi_valid >= 8) { s.pending_buf[s.pending++] = s.bi_buf & 255; s.bi_buf >>= 8; s.bi_valid -= 8; } } function gen_bitlen(s, desc) { var tree = desc.dyn_tree; var max_code = desc.max_code; var stree = desc.stat_desc.static_tree; var has_stree = desc.stat_desc.has_stree; var extra = desc.stat_desc.extra_bits; var base = desc.stat_desc.extra_base; var max_length = desc.stat_desc.max_length; var h; var n, m; var bits; var xbits; var f; var overflow = 0; for (bits = 0; bits <= MAX_BITS; bits++) { s.bl_count[bits] = 0; } tree[s.heap[s.heap_max] * 2 + 1] = 0; for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { n = s.heap[h]; bits = tree[tree[n * 2 + 1] * 2 + 1] + 1; if (bits > max_length) { bits = max_length; overflow++; } tree[n * 2 + 1] = bits; if (n > max_code) { continue; } s.bl_count[bits]++; xbits = 0; if (n >= base) { xbits = extra[n - base]; } f = tree[n * 2]; s.opt_len += f * (bits + xbits); if (has_stree) { s.static_len += f * (stree[n * 2 + 1] + xbits); } } if (overflow === 0) { return; } do { bits = max_length - 1; while (s.bl_count[bits] === 0) { bits--; } s.bl_count[bits]--; s.bl_count[bits + 1] += 2; s.bl_count[max_length]--; overflow -= 2; } while (overflow > 0); for (bits = max_length; bits !== 0; bits--) { n = s.bl_count[bits]; while (n !== 0) { m = s.heap[--h]; if (m > max_code) { continue; } if (tree[m * 2 + 1] !== bits) { s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2]; tree[m * 2 + 1] = bits; } n--; } } } function gen_codes(tree, max_code, bl_count) { var next_code = new Array(MAX_BITS + 1); var code = 0; var bits; var n; for (bits = 1; bits <= MAX_BITS; bits++) { next_code[bits] = code = code + bl_count[bits - 1] << 1; } for (n = 0; n <= max_code; n++) { var len = tree[n * 2 + 1]; if (len === 0) { continue; } tree[n * 2] = bi_reverse(next_code[len]++, len); } } function tr_static_init() { var n; var bits; var length; var code; var dist; var bl_count = new Array(MAX_BITS + 1); length = 0; for (code = 0; code < LENGTH_CODES - 1; code++) { base_length[code] = length; for (n = 0; n < 1 << extra_lbits[code]; n++) { _length_code[length++] = code; } } _length_code[length - 1] = code; dist = 0; for (code = 0; code < 16; code++) { base_dist[code] = dist; for (n = 0; n < 1 << extra_dbits[code]; n++) { _dist_code[dist++] = code; } } dist >>= 7; for (; code < D_CODES; code++) { base_dist[code] = dist << 7; for (n = 0; n < 1 << extra_dbits[code] - 7; n++) { _dist_code[256 + dist++] = code; } } for (bits = 0; bits <= MAX_BITS; bits++) { bl_count[bits] = 0; } n = 0; while (n <= 143) { static_ltree[n * 2 + 1] = 8; n++; bl_count[8]++; } while (n <= 255) { static_ltree[n * 2 + 1] = 9; n++; bl_count[9]++; } while (n <= 279) { static_ltree[n * 2 + 1] = 7; n++; bl_count[7]++; } while (n <= 287) { static_ltree[n * 2 + 1] = 8; n++; bl_count[8]++; } gen_codes(static_ltree, L_CODES + 1, bl_count); for (n = 0; n < D_CODES; n++) { static_dtree[n * 2 + 1] = 5; static_dtree[n * 2] = bi_reverse(n, 5); } static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); } function init_block(s) { var n; for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2] = 0; } for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2] = 0; } for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2] = 0; } s.dyn_ltree[END_BLOCK * 2] = 1; s.opt_len = s.static_len = 0; s.last_lit = s.matches = 0; } function bi_windup(s) { if (s.bi_valid > 8) { put_short(s, s.bi_buf); } else if (s.bi_valid > 0) { s.pending_buf[s.pending++] = s.bi_buf; } s.bi_buf = 0; s.bi_valid = 0; } function copy_block(s, buf, len, header) { bi_windup(s); if (header) { put_short(s, len); put_short(s, ~len); } utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); s.pending += len; } function smaller(tree, n, m, depth) { var _n2 = n * 2; var _m2 = m * 2; return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m]; } function pqdownheap(s, tree, k) { var v = s.heap[k]; var j = k << 1; while (j <= s.heap_len) { if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { j++; } if (smaller(tree, v, s.heap[j], s.depth)) { break; } s.heap[k] = s.heap[j]; k = j; j <<= 1; } s.heap[k] = v; } function compress_block(s, ltree, dtree) { var dist; var lc; var lx = 0; var code; var extra; if (s.last_lit !== 0) { do { dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1]; lc = s.pending_buf[s.l_buf + lx]; lx++; if (dist === 0) { send_code(s, lc, ltree); } else { code = _length_code[lc]; send_code(s, code + LITERALS + 1, ltree); extra = extra_lbits[code]; if (extra !== 0) { lc -= base_length[code]; send_bits(s, lc, extra); } dist--; code = d_code(dist); send_code(s, code, dtree); extra = extra_dbits[code]; if (extra !== 0) { dist -= base_dist[code]; send_bits(s, dist, extra); } } } while (lx < s.last_lit); } send_code(s, END_BLOCK, ltree); } function build_tree(s, desc) { var tree = desc.dyn_tree; var stree = desc.stat_desc.static_tree; var has_stree = desc.stat_desc.has_stree; var elems = desc.stat_desc.elems; var n, m; var max_code = -1; var node; s.heap_len = 0; s.heap_max = HEAP_SIZE; for (n = 0; n < elems; n++) { if (tree[n * 2] !== 0) { s.heap[++s.heap_len] = max_code = n; s.depth[n] = 0; } else { tree[n * 2 + 1] = 0; } } while (s.heap_len < 2) { node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0; tree[node * 2] = 1; s.depth[node] = 0; s.opt_len--; if (has_stree) { s.static_len -= stree[node * 2 + 1]; } } desc.max_code = max_code; for (n = s.heap_len >> 1; n >= 1; n--) { pqdownheap(s, tree, n); } node = elems; do { n = s.heap[ 1 /*SMALLEST*/ ]; s.heap[ 1 /*SMALLEST*/ ] = s.heap[s.heap_len--]; pqdownheap( s, tree, 1 /*SMALLEST*/ ); m = s.heap[ 1 /*SMALLEST*/ ]; s.heap[--s.heap_max] = n; s.heap[--s.heap_max] = m; tree[node * 2] = tree[n * 2] + tree[m * 2]; s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; tree[n * 2 + 1] = tree[m * 2 + 1] = node; s.heap[ 1 /*SMALLEST*/ ] = node++; pqdownheap( s, tree, 1 /*SMALLEST*/ ); } while (s.heap_len >= 2); s.heap[--s.heap_max] = s.heap[ 1 /*SMALLEST*/ ]; gen_bitlen(s, desc); gen_codes(tree, max_code, s.bl_count); } function scan_tree(s, tree, max_code) { var n; var prevlen = -1; var curlen; var nextlen = tree[0 * 2 + 1]; var count = 0; var max_count = 7; var min_count = 4; if (nextlen === 0) { max_count = 138; min_count = 3; } tree[(max_code + 1) * 2 + 1] = 65535; for (n = 0; n <= max_code; n++) { curlen = nextlen; nextlen = tree[(n + 1) * 2 + 1]; if (++count < max_count && curlen === nextlen) { continue; } else if (count < min_count) { s.bl_tree[curlen * 2] += count; } else if (curlen !== 0) { if (curlen !== prevlen) { s.bl_tree[curlen * 2]++; } s.bl_tree[REP_3_6 * 2]++; } else if (count <= 10) { s.bl_tree[REPZ_3_10 * 2]++; } else { s.bl_tree[REPZ_11_138 * 2]++; } count = 0; prevlen = curlen; if (nextlen === 0) { max_count = 138; min_count = 3; } else if (curlen === nextlen) { max_count = 6; min_count = 3; } else { max_count = 7; min_count = 4; } } } function send_tree(s, tree, max_code) { var n; var prevlen = -1; var curlen; var nextlen = tree[0 * 2 + 1]; var count = 0; var max_count = 7; var min_count = 4; if (nextlen === 0) { max_count = 138; min_count = 3; } for (n = 0; n <= max_code; n++) { curlen = nextlen; nextlen = tree[(n + 1) * 2 + 1]; if (++count < max_count && curlen === nextlen) { continue; } else if (count < min_count) { do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); } else if (curlen !== 0) { if (curlen !== prevlen) { send_code(s, curlen, s.bl_tree); count--; } send_code(s, REP_3_6, s.bl_tree); send_bits(s, count - 3, 2); } else if (count <= 10) { send_code(s, REPZ_3_10, s.bl_tree); send_bits(s, count - 3, 3); } else { send_code(s, REPZ_11_138, s.bl_tree); send_bits(s, count - 11, 7); } count = 0; prevlen = curlen; if (nextlen === 0) { max_count = 138; min_count = 3; } else if (curlen === nextlen) { max_count = 6; min_count = 3; } else { max_count = 7; min_count = 4; } } } function build_bl_tree(s) { var max_blindex; scan_tree(s, s.dyn_ltree, s.l_desc.max_code); scan_tree(s, s.dyn_dtree, s.d_desc.max_code); build_tree(s, s.bl_desc); for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) { break; } } s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; return max_blindex; } function send_all_trees(s, lcodes, dcodes, blcodes) { var rank; send_bits(s, lcodes - 257, 5); send_bits(s, dcodes - 1, 5); send_bits(s, blcodes - 4, 4); for (rank = 0; rank < blcodes; rank++) { send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3); } send_tree(s, s.dyn_ltree, lcodes - 1); send_tree(s, s.dyn_dtree, dcodes - 1); } function detect_data_type(s) { var black_mask = 4093624447; var n; for (n = 0; n <= 31; n++, black_mask >>>= 1) { if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0) { return Z_BINARY; } } if (s.dyn_ltree[9 * 2] !== 0 || s.dyn_ltree[10 * 2] !== 0 || s.dyn_ltree[13 * 2] !== 0) { return Z_TEXT; } for (n = 32; n < LITERALS; n++) { if (s.dyn_ltree[n * 2] !== 0) { return Z_TEXT; } } return Z_BINARY; } var static_init_done = false; function _tr_init(s) { if (!static_init_done) { tr_static_init(); static_init_done = true; } s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); s.bi_buf = 0; s.bi_valid = 0; init_block(s); } function _tr_stored_block(s, buf, stored_len, last) { send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); copy_block(s, buf, stored_len, true); } function _tr_align(s) { send_bits(s, STATIC_TREES << 1, 3); send_code(s, END_BLOCK, static_ltree); bi_flush(s); } function _tr_flush_block(s, buf, stored_len, last) { var opt_lenb, static_lenb; var max_blindex = 0; if (s.level > 0) { if (s.strm.data_type === Z_UNKNOWN) { s.strm.data_type = detect_data_type(s); } build_tree(s, s.l_desc); build_tree(s, s.d_desc); max_blindex = build_bl_tree(s); opt_lenb = s.opt_len + 3 + 7 >>> 3; static_lenb = s.static_len + 3 + 7 >>> 3; if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } } else { opt_lenb = static_lenb = stored_len + 5; } if (stored_len + 4 <= opt_lenb && buf !== -1) { _tr_stored_block(s, buf, stored_len, last); } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); compress_block(s, static_ltree, static_dtree); } else { send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); compress_block(s, s.dyn_ltree, s.dyn_dtree); } init_block(s); if (last) { bi_windup(s); } } function _tr_tally(s, dist, lc) { s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255; s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255; s.pending_buf[s.l_buf + s.last_lit] = lc & 255; s.last_lit++; if (dist === 0) { s.dyn_ltree[lc * 2]++; } else { s.matches++; dist--; s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++; s.dyn_dtree[d_code(dist) * 2]++; } return s.last_lit === s.lit_bufsize - 1; } exports._tr_init = _tr_init; exports._tr_stored_block = _tr_stored_block; exports._tr_flush_block = _tr_flush_block; exports._tr_tally = _tr_tally; exports._tr_align = _tr_align; } }); // ../../node_modules/pako/lib/zlib/adler32.js var require_adler32 = __commonJS({ "../../node_modules/pako/lib/zlib/adler32.js"(exports, module) { "use strict"; function adler32(adler, buf, len, pos) { var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0; while (len !== 0) { n = len > 2e3 ? 2e3 : len; len -= n; do { s1 = s1 + buf[pos++] | 0; s2 = s2 + s1 | 0; } while (--n); s1 %= 65521; s2 %= 65521; } return s1 | s2 << 16 | 0; } module.exports = adler32; } }); // ../../node_modules/pako/lib/zlib/crc32.js var require_crc32 = __commonJS({ "../../node_modules/pako/lib/zlib/crc32.js"(exports, module) { "use strict"; function makeTable() { var c, table = []; for (var n = 0; n < 256; n++) { c = n; for (var k = 0; k < 8; k++) { c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1; } table[n] = c; } return table; } var crcTable = makeTable(); function crc32(crc, buf, len, pos) { var t = crcTable, end = pos + len; crc ^= -1; for (var i = pos; i < end; i++) { crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255]; } return crc ^ -1; } module.exports = crc32; } }); // ../../node_modules/pako/lib/zlib/messages.js var require_messages = __commonJS({ "../../node_modules/pako/lib/zlib/messages.js"(exports, module) { "use strict"; module.exports = { 2: "need dictionary", /* Z_NEED_DICT 2 */ 1: "stream end", /* Z_STREAM_END 1 */ 0: "", /* Z_OK 0 */ "-1": "file error", /* Z_ERRNO (-1) */ "-2": "stream error", /* Z_STREAM_ERROR (-2) */ "-3": "data error", /* Z_DATA_ERROR (-3) */ "-4": "insufficient memory", /* Z_MEM_ERROR (-4) */ "-5": "buffer error", /* Z_BUF_ERROR (-5) */ "-6": "incompatible version" /* Z_VERSION_ERROR (-6) */ }; } }); // ../../node_modules/pako/lib/zlib/deflate.js var require_deflate = __commonJS({ "../../node_modules/pako/lib/zlib/deflate.js"(exports) { "use strict"; var utils = require_common(); var trees = require_trees(); var adler32 = require_adler32(); var crc32 = require_crc32(); var msg = require_messages(); var Z_NO_FLUSH = 0; var Z_PARTIAL_FLUSH = 1; var Z_FULL_FLUSH = 3; var Z_FINISH = 4; var Z_BLOCK = 5; var Z_OK = 0; var Z_STREAM_END = 1; var Z_STREAM_ERROR = -2; var Z_DATA_ERROR = -3; var Z_BUF_ERROR = -5; var Z_DEFAULT_COMPRESSION = -1; var Z_FILTERED = 1; var Z_HUFFMAN_ONLY = 2; var Z_RLE = 3; var Z_FIXED = 4; var Z_DEFAULT_STRATEGY = 0; var Z_UNKNOWN = 2; var Z_DEFLATED = 8; var MAX_MEM_LEVEL = 9; var MAX_WBITS = 15; var DEF_MEM_LEVEL = 8; var LENGTH_CODES = 29; var LITERALS = 256; var L_CODES = LITERALS + 1 + LENGTH_CODES; var D_CODES = 30; var BL_CODES = 19; var HEAP_SIZE = 2 * L_CODES + 1; var MAX_BITS = 15; var MIN_MATCH = 3; var MAX_MATCH = 258; var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; var PRESET_DICT = 32; var INIT_STATE = 42; var EXTRA_STATE = 69; var NAME_STATE = 73; var COMMENT_STATE = 91; var HCRC_STATE = 103; var BUSY_STATE = 113; var FINISH_STATE = 666; var BS_NEED_MORE = 1; var BS_BLOCK_DONE = 2; var BS_FINISH_STARTED = 3; var BS_FINISH_DONE = 4; var OS_CODE = 3; function err(strm, errorCode) { strm.msg = msg[errorCode]; return errorCode; } function rank(f) { return (f << 1) - (f > 4 ? 9 : 0); } function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } function flush_pending(strm) { var s = strm.state; var len = s.pending; if (len > strm.avail_out) { len = strm.avail_out; } if (len === 0) { return; } utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); strm.next_out += len; s.pending_out += len; strm.total_out += len; strm.avail_out -= len; s.pending -= len; if (s.pending === 0) { s.pending_out = 0; } } function flush_block_only(s, last) { trees._tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last); s.block_start = s.strstart; flush_pending(s.strm); } function put_byte(s, b) { s.pending_buf[s.pending++] = b; } function putShortMSB(s, b) { s.pending_buf[s.pending++] = b >>> 8 & 255; s.pending_buf[s.pending++] = b & 255; } function read_buf(strm, buf, start, size) { var len = strm.avail_in; if (len > size) { len = size; } if (len === 0) { return 0; } strm.avail_in -= len; utils.arraySet(buf, strm.input, strm.next_in, len, start); if (strm.state.wrap === 1) { strm.adler = adler32(strm.adler, buf, len, start); } else if (strm.state.wrap === 2) { strm.adler = crc32(strm.adler, buf, len, start); } strm.next_in += len; strm.total_in += len; return len; } function longest_match(s, cur_match) { var chain_length = s.max_chain_length; var scan = s.strstart; var match; var len; var best_len = s.prev_length; var nice_match = s.nice_match; var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0; var _win = s.window; var wmask = s.w_mask; var prev = s.prev; var strend = s.strstart + MAX_MATCH; var scan_end1 = _win[scan + best_len - 1]; var scan_end = _win[scan + best_len]; if (s.prev_length >= s.good_match) { chain_length >>= 2; } if (nice_match > s.lookahead) { nice_match = s.lookahead; } do { match = cur_match; if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) { continue; } scan += 2; match++; do { } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); len = MAX_MATCH - (strend - scan); scan = strend - MAX_MATCH; if (len > best_len) { s.match_start = cur_match; best_len = len; if (len >= nice_match) { break; } scan_end1 = _win[scan + best_len - 1]; scan_end = _win[scan + best_len]; } } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); if (best_len <= s.lookahead) { return best_len; } return s.lookahead; } function fill_window(s) { var _w_size = s.w_size; var p, n, m, more, str; do { more = s.window_size - s.lookahead - s.strstart; if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { utils.arraySet(s.window, s.window, _w_size, _w_size, 0); s.match_start -= _w_size; s.strstart -= _w_size; s.block_start -= _w_size; n = s.hash_size; p = n; do { m = s.head[--p]; s.head[p] = m >= _w_size ? m - _w_size : 0; } while (--n); n = _w_size; p = n; do { m = s.prev[--p]; s.prev[p] = m >= _w_size ? m - _w_size : 0; } while (--n); more += _w_size; } if (s.strm.avail_in === 0) { break; } n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); s.lookahead += n; if (s.lookahead + s.insert >= MIN_MATCH) { str = s.strstart - s.insert; s.ins_h = s.window[str]; s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask; while (s.insert) { s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; s.insert--; if (s.lookahead + s.insert < MIN_MATCH) { break; } } } } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); } function deflate_stored(s, flush) { var max_block_size = 65535; if (max_block_size > s.pending_buf_size - 5) { max_block_size = s.pending_buf_size - 5; } for (; ; ) { if (s.lookahead <= 1) { fill_window(s); if (s.lookahead === 0 && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } } s.strstart += s.lookahead; s.lookahead = 0; var max_start = s.block_start + max_block_size; if (s.strstart === 0 || s.strstart >= max_start) { s.lookahead = s.strstart - max_start; s.strstart = max_start; flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) { flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } } s.insert = 0; if (flush === Z_FINISH) { flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } return BS_FINISH_DONE; } if (s.strstart > s.block_start) { flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } return BS_NEED_MORE; } function deflate_fast(s, flush) { var hash_head; var bflush; for (; ; ) { if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } } hash_head = 0; if (s.lookahead >= MIN_MATCH) { s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; } if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) { s.match_length = longest_match(s, hash_head); } if (s.match_length >= MIN_MATCH) { bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; if (s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) { s.match_length--; do { s.strstart++; s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; } while (--s.match_length !== 0); s.strstart++; } else { s.strstart += s.match_length; s.match_length = 0; s.ins_h = s.window[s.strstart]; s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; } } else { bflush = trees._tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; } if (bflush) { flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } } s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; if (flush === Z_FINISH) { flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } return BS_FINISH_DONE; } if (s.last_lit) { flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } return BS_BLOCK_DONE; } function deflate_slow(s, flush) { var hash_head; var bflush; var max_insert; for (; ; ) { if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } } hash_head = 0; if (s.lookahead >= MIN_MATCH) { s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; } s.prev_length = s.match_length; s.prev_match = s.match_start; s.match_length = MIN_MATCH - 1; if (hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) { s.match_length = longest_match(s, hash_head); if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096)) { s.match_length = MIN_MATCH - 1; } } if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { max_insert = s.strstart + s.lookahead - MIN_MATCH; bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); s.lookahead -= s.prev_length - 1; s.prev_length -= 2; do { if (++s.strstart <= max_insert) { s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; } } while (--s.prev_length !== 0); s.match_available = 0; s.match_length = MIN_MATCH - 1; s.strstart++; if (bflush) { flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } } else if (s.match_available) { bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); if (bflush) { flush_block_only(s, false); } s.strstart++; s.lookahead--; if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } else { s.match_available = 1; s.strstart++; s.lookahead--; } } if (s.match_available) { bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); s.match_available = 0; } s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; if (flush === Z_FINISH) { flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } return BS_FINISH_DONE; } if (s.last_lit) { flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } return BS_BLOCK_DONE; } function deflate_rle(s, flush) { var bflush; var prev; var scan, strend; var _win = s.window; for (; ; ) { if (s.lookahead <= MAX_MATCH) { fill_window(s); if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } } s.match_length = 0; if (s.lookahead >= MIN_MATCH && s.strstart > 0) { scan = s.strstart - 1; prev = _win[scan]; if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { strend = s.strstart + MAX_MATCH; do { } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); s.match_length = MAX_MATCH - (strend - scan); if (s.match_length > s.lookahead) { s.match_length = s.lookahead; } } } if (s.match_length >= MIN_MATCH) { bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; s.strstart += s.match_length; s.match_length = 0; } else { bflush = trees._tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; } if (bflush) { flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } } s.insert = 0; if (flush === Z_FINISH) { flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } return BS_FINISH_DONE; } if (s.last_lit) { flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } return BS_BLOCK_DONE; } function deflate_huff(s, flush) { var bflush; for (; ; ) { if (s.lookahead === 0) { fill_window(s); if (s.lookahead === 0) { if (flush === Z_NO_FLUSH) { return BS_NEED_MORE; } break; } } s.match_length = 0; bflush = trees._tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; if (bflush) { flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } } s.insert = 0; if (flush === Z_FINISH) { flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } return BS_FINISH_DONE; } if (s.last_lit) { flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } return BS_BLOCK_DONE; } function Config(good_length, max_lazy, nice_length, max_chain, func) { this.good_length = good_length; this.max_lazy = max_lazy; this.nice_length = nice_length; this.max_chain = max_chain; this.func = func; } var configuration_table; configuration_table = [ /* good lazy nice chain */ new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ new Config(4, 5, 16, 8, deflate_fast), /* 2 */ new Config(4, 6, 32, 32, deflate_fast), /* 3 */ new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ new Config(8, 16, 32, 32, deflate_slow), /* 5 */ new Config(8, 16, 128, 128, deflate_slow), /* 6 */ new Config(8, 32, 128, 256, deflate_slow), /* 7 */ new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ ]; function lm_init(s) { s.window_size = 2 * s.w_size; zero(s.head); s.max_lazy_match = configuration_table[s.level].max_lazy; s.good_match = configuration_table[s.level].good_length; s.nice_match = configuration_table[s.level].nice_length; s.max_chain_length = configuration_table[s.level].max_chain; s.strstart = 0; s.block_start = 0; s.lookahead = 0; s.insert = 0; s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; s.ins_h = 0; } function DeflateState() { 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 = Z_DEFLATED; 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 utils.Buf16(HEAP_SIZE * 2); this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); zero(this.dyn_ltree); zero(this.dyn_dtree); zero(this.bl_tree); this.l_desc = null; this.d_desc = null; this.bl_desc = null; this.bl_count = new utils.Buf16(MAX_BITS + 1); this.heap = new utils.Buf16(2 * L_CODES + 1); zero(this.heap); this.heap_len = 0; this.heap_max = 0; this.depth = new utils.Buf16(2 * L_CODES + 1); zero(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; } function deflateResetKeep(strm) { var s; if (!strm || !strm.state) { return err(strm, Z_STREAM_ERROR); } strm.total_in = strm.total_out = 0; strm.data_type = Z_UNKNOWN; s = strm.state; s.pending = 0; s.pending_out = 0; if (s.wrap < 0) { s.wrap = -s.wrap; } s.status = s.wrap ? INIT_STATE : BUSY_STATE; strm.adler = s.wrap === 2 ? 0 : 1; s.last_flush = Z_NO_FLUSH; trees._tr_init(s); return Z_OK; } function deflateReset(strm) { var ret = deflateResetKeep(strm); if (ret === Z_OK) { lm_init(strm.state); } return ret; } function deflateSetHeader(strm, head) { if (!strm || !strm.state) { return Z_STREAM_ERROR; } if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } strm.state.gzhead = head; return Z_OK; } function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { if (!strm) { return Z_STREAM_ERROR; } var wrap = 1; if (level === Z_DEFAULT_COMPRESSION) { level = 6; } if (windowBits < 0) { wrap = 0; windowBits = -windowBits; } else if (windowBits > 15) { wrap = 2; windowBits -= 16; } if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { return err(strm, Z_STREAM_ERROR); } if (windowBits === 8) { windowBits = 9; } var s = new DeflateState(); strm.state = s; s.strm = strm; s.wrap = wrap; s.gzhead = null; s.w_bits = windowBits; s.w_size = 1 << s.w_bits; s.w_mask = s.w_size - 1; s.hash_bits = memLevel + 7; s.hash_size = 1 << s.hash_bits; s.hash_mask = s.hash_size - 1; s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); s.window = new utils.Buf8(s.w_size * 2); s.head = new utils.Buf16(s.hash_size); s.prev = new utils.Buf16(s.w_size); s.lit_bufsize = 1 << memLevel + 6; s.pending_buf_size = s.lit_bufsize * 4; s.pending_buf = new utils.Buf8(s.pending_buf_size); s.d_buf = 1 * s.lit_bufsize; s.l_buf = (1 + 2) * s.lit_bufsize; s.level = level; s.strategy = strategy; s.method = method; return deflateReset(strm); } function deflateInit(strm, level) { return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); } function deflate(strm, flush) { var old_flush, s; var beg, val; if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) { return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; } s = strm.state; if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH) { return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR); } s.strm = strm; old_flush = s.last_flush; s.last_flush = flush; if (s.status === INIT_STATE) { if (s.wrap === 2) { strm.adler = 0; put_byte(s, 31); put_byte(s, 139); put_byte(s, 8); if (!s.gzhead) { put_byte(s, 0); put_byte(s, 0); put_byte(s, 0); put_byte(s, 0); put_byte(s, 0); put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0); put_byte(s, OS_CODE); s.status = BUSY_STATE; } else { put_byte( s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16) ); put_byte(s, s.gzhead.time & 255); put_byte(s, s.gzhead.time >> 8 & 255); put_byte(s, s.gzhead.time >> 16 & 255); put_byte(s, s.gzhead.time >> 24 & 255); put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0); put_byte(s, s.gzhead.os & 255); if (s.gzhead.extra && s.gzhead.extra.length) { put_byte(s, s.gzhead.extra.length & 255); put_byte(s, s.gzhead.extra.length >> 8 & 255); } if (s.gzhead.hcrc) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); } s.gzindex = 0; s.status = EXTRA_STATE; } } else { var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8; var level_flags = -1; if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { level_flags = 0; } else if (s.level < 6) { level_flags = 1; } else if (s.level === 6) { level_flags = 2; } else { level_flags = 3; } header |= level_flags << 6; if (s.strstart !== 0) { header |= PRESET_DICT; } header += 31 - header % 31; s.status = BUSY_STATE; putShortMSB(s, header); if (s.strstart !== 0) { putShortMSB(s, strm.adler >>> 16); putShortMSB(s, strm.adler & 65535); } strm.adler = 1; } } if (s.status === EXTRA_STATE) { if (s.gzhead.extra) { beg = s.pending; while (s.gzindex < (s.gzhead.extra.length & 65535)) { if (s.pending === s.pending_buf_size) { if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } flush_pending(strm); beg = s.pending; if (s.pending === s.pending_buf_size) { break; } } put_byte(s, s.gzhead.extra[s.gzindex] & 255); s.gzindex++; } if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } if (s.gzindex === s.gzhead.extra.length) { s.gzindex = 0; s.status = NAME_STATE; } } else { s.status = NAME_STATE; } } if (s.status === NAME_STATE) { if (s.gzhead.name) { beg = s.pending; do { if (s.pending === s.pending_buf_size) { if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } flush_pending(strm); beg = s.pending; if (s.pending === s.pending_buf_size) { val = 1; break; } } if (s.gzindex < s.gzhead.name.length) { val = s.gzhead.name.charCodeAt(s.gzindex++) & 255; } else { val = 0; } put_byte(s, val); } while (val !== 0); if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } if (val === 0) { s.gzindex = 0; s.status = COMMENT_STATE; } } else { s.status = COMMENT_STATE; } } if (s.status === COMMENT_STATE) { if (s.gzhead.comment) { beg = s.pending; do { if (s.pending === s.pending_buf_size) { if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } flush_pending(strm); beg = s.pending; if (s.pending === s.pending_buf_size) { val = 1; break; } } if (s.gzindex < s.gzhead.comment.length) { val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255; } else { val = 0; } put_byte(s, val); } while (val !== 0); if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); } if (val === 0) { s.status = HCRC_STATE; } } else { s.status = HCRC_STATE; } } if (s.status === HCRC_STATE) { if (s.gzhead.hcrc) { if (s.pending + 2 > s.pending_buf_size) { flush_pending(strm); } if (s.pending + 2 <= s.pending_buf_size) { put_byte(s, strm.adler & 255); put_byte(s, strm.adler >> 8 & 255); strm.adler = 0; s.status = BUSY_STATE; } } else { s.status = BUSY_STATE; } } if (s.pending !== 0) { flush_pending(strm); if (strm.avail_out === 0) { s.last_flush = -1; return Z_OK; } } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) { return err(strm, Z_BUF_ERROR); } if (s.status === FINISH_STATE && strm.avail_in !== 0) { return err(strm, Z_BUF_ERROR); } if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) { var bstate = s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush); if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { s.status = FINISH_STATE; } if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { if (strm.avail_out === 0) { s.last_flush = -1; } return Z_OK; } if (bstate === BS_BLOCK_DONE) { if (flush === Z_PARTIAL_FLUSH) { trees._tr_align(s); } else if (flush !== Z_BLOCK) { trees._tr_stored_block(s, 0, 0, false); if (flush === Z_FULL_FLUSH) { zero(s.head); if (s.lookahead === 0) { s.strstart = 0; s.block_start = 0; s.insert = 0; } } } flush_pending(strm); if (strm.avail_out === 0) { s.last_flush = -1; return Z_OK; } } } if (flush !== Z_FINISH) { return Z_OK; } if (s.wrap <= 0) { return Z_STREAM_END; } if (s.wrap === 2) { put_byte(s, strm.adler & 255); put_byte(s, strm.adler >> 8 & 255); put_byte(s, strm.adler >> 16 & 255); put_byte(s, strm.adler >> 24 & 255); put_byte(s, strm.total_in & 255); put_byte(s, strm.total_in >> 8 & 255); put_byte(s, strm.total_in >> 16 & 255); put_byte(s, strm.total_in >> 24 & 255); } else { putShortMSB(s, strm.adler >>> 16); putShortMSB(s, strm.adler & 65535); } flush_pending(strm); if (s.wrap > 0) { s.wrap = -s.wrap; } return s.pending !== 0 ? Z_OK : Z_STREAM_END; } function deflateEnd(strm) { var status; if (!strm || !strm.state) { return Z_STREAM_ERROR; } status = strm.state.status; if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE) { return err(strm, Z_STREAM_ERROR); } strm.state = null; return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; } function deflateSetDictionary(strm, dictionary) { var dictLength = dictionary.length; var s; var str, n; var wrap; var avail; var next; var input; var tmpDict; if (!strm || !strm.state) { return Z_STREAM_ERROR; } s = strm.state; wrap = s.wrap; if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) { return Z_STREAM_ERROR; } if (wrap === 1) { strm.adler = adler32(strm.adler, dictionary, dictLength, 0); } s.wrap = 0; if (dictLength >= s.w_size) { if (wrap === 0) { zero(s.head); s.strstart = 0; s.block_start = 0; s.insert = 0; } tmpDict = new utils.Buf8(s.w_size); utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); dictionary = tmpDict; dictLength = s.w_size; } avail = strm.avail_in; next = strm.next_in; input = strm.input; strm.avail_in = dictLength; strm.next_in = 0; strm.input = dictionary; fill_window(s); while (s.lookahead >= MIN_MATCH) { str = s.strstart; n = s.lookahead - (MIN_MATCH - 1); do { s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; } while (--n); s.strstart = str; s.lookahead = MIN_MATCH - 1; fill_window(s); } s.strstart += s.lookahead; s.block_start = s.strstart; s.insert = s.lookahead; s.lookahead = 0; s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; strm.next_in = next; strm.input = input; strm.avail_in = avail; s.wrap = wrap; return Z_OK; } exports.deflateInit = deflateInit; exports.deflateInit2 = deflateInit2; exports.deflateReset = deflateReset; exports.deflateResetKeep = deflateResetKeep; exports.deflateSetHeader = deflateSetHeader; exports.deflate = deflate; exports.deflateEnd = deflateEnd; exports.deflateSetDictionary = deflateSetDictionary; exports.deflateInfo = "pako deflate (from Nodeca project)"; } }); // ../../node_modules/pako/lib/utils/strings.js var require_strings = __commonJS({ "../../node_modules/pako/lib/utils/strings.js"(exports) { "use strict"; var utils = require_common(); var STR_APPLY_OK = true; var STR_APPLY_UIA_OK = true; try { String.fromCharCode.apply(null, [0]); } catch (__) { STR_APPLY_OK = false; } try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; } var _utf8len = new utils.Buf8(256); for (q = 0; q < 256; q++) { _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1; } var q; _utf8len[254] = _utf8len[254] = 1; exports.string2buf = function(str) { var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; for (m_pos = 0; m_pos < str_len; m_pos++) { c = str.charCodeAt(m_pos); if ((c & 64512) === 55296 && m_pos + 1 < str_len) { c2 = str.charCodeAt(m_pos + 1); if ((c2 & 64512) === 56320) { c = 65536 + (c - 55296 << 10) + (c2 - 56320); m_pos++; } } buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4; } buf = new utils.Buf8(buf_len); for (i = 0, m_pos = 0; i < buf_len; m_pos++) { c = str.charCodeAt(m_pos); if ((c & 64512) === 55296 && m_pos + 1 < str_len) { c2 = str.charCodeAt(m_pos + 1); if ((c2 & 64512) === 56320) { c = 65536 + (c - 55296 << 10) + (c2 - 56320); m_pos++; } } if (c < 128) { buf[i++] = c; } else if (c < 2048) { buf[i++] = 192 | c >>> 6; buf[i++] = 128 | c & 63; } else if (c < 65536) { buf[i++] = 224 | c >>> 12; buf[i++] = 128 | c >>> 6 & 63; buf[i++] = 128 | c & 63; } else { buf[i++] = 240 | c >>> 18; buf[i++] = 128 | c >>> 12 & 63; buf[i++] = 128 | c >>> 6 & 63; buf[i++] = 128 | c & 63; } } return buf; }; function buf2binstring(buf, len) { if (len < 65534) { if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) { return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); } } var result = ""; for (var i = 0; i < len; i++) { result += String.fromCharCode(buf[i]); } return result; } exports.buf2binstring = function(buf) { return buf2binstring(buf, buf.length); }; exports.binstring2buf = function(str) { var buf = new utils.Buf8(str.length); for (var i = 0, len = buf.length; i < len; i++) { buf[i] = str.charCodeAt(i); } return buf; }; exports.buf2string = function(buf, max) { var i, out, c, c_len; var len = max || buf.length; var utf16buf = new Array(len * 2); for (out = 0, i = 0; i < len; ) { c = buf[i++]; if (c < 128) { utf16buf[out++] = c; continue; } c_len = _utf8len[c]; if (c_len > 4) { utf16buf[out++] = 65533; i += c_len - 1; continue; } c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7; while (c_len > 1 && i < len) { c = c << 6 | buf[i++] & 63; c_len--; } if (c_len > 1) { utf16buf[out++] = 65533; continue; } if (c < 65536) { utf16buf[out++] = c; } else { c -= 65536; utf16buf[out++] = 55296 | c >> 10 & 1023; utf16buf[out++] = 56320 | c & 1023; } } return buf2binstring(utf16buf, out); }; exports.utf8border = function(buf, max) { var pos; max = max || buf.length; if (max > buf.length) { max = buf.length; } pos = max - 1; while (pos >= 0 && (buf[pos] & 192) === 128) { pos--; } if (pos < 0) { return max; } if (pos === 0) { return max; } return pos + _utf8len[buf[pos]] > max ? pos : max; }; } }); // ../../node_modules/pako/lib/zlib/zstream.js var require_zstream = __commonJS({ "../../node_modules/pako/lib/zlib/zstream.js"(exports, module) { "use strict"; function ZStream() { 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; } module.exports = ZStream; } }); // ../../node_modules/pako/lib/deflate.js var require_deflate2 = __commonJS({ "../../node_modules/pako/lib/deflate.js"(exports) { "use strict"; var zlib_deflate = require_deflate(); var utils = require_common(); var strings = require_strings(); var msg = require_messages(); var ZStream = require_zstream(); var toString = Object.prototype.toString; var Z_NO_FLUSH = 0; var Z_FINISH = 4; var Z_OK = 0; var Z_STREAM_END = 1; var Z_SYNC_FLUSH = 2; var Z_DEFAULT_COMPRESSION = -1; var Z_DEFAULT_STRATEGY = 0; var Z_DEFLATED = 8; function Deflate(options) { if (!(this instanceof Deflate)) return new Deflate(options); this.options = utils.assign({ level: Z_DEFAULT_COMPRESSION, method: Z_DEFLATED, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: Z_DEFAULT_STRATEGY, to: "" }, options || {}); var opt = this.options; if (opt.raw && opt.windowBits > 0) { opt.windowBits = -opt.windowBits; } else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) { opt.windowBits += 16; } this.err = 0; this.msg = ""; this.ended = false; this.chunks = []; this.strm = new ZStream(); this.strm.avail_out = 0; var status = zlib_deflate.deflateInit2( this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy ); if (status !== Z_OK) { throw new Error(msg[status]); } if (opt.header) { zlib_deflate.deflateSetHeader(this.strm, opt.header); } if (opt.dictionary) { var dict; if (typeof opt.dictionary === "string") { dict = strings.string2buf(opt.dictionary); } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") { dict = new Uint8Array(opt.dictionary); } else { dict = opt.dictionary; } status = zlib_deflate.deflateSetDictionary(this.strm, dict); if (status !== Z_OK) { throw new Error(msg[status]); } this._dict_set = true; } } Deflate.prototype.push = function(data, mode) { var strm = this.strm; var chunkSize = this.options.chunkSize; var status, _mode; if (this.ended) { return false; } _mode = mode === ~~mode ? mode : mode === true ? Z_FINISH : Z_NO_FLUSH; if (typeof data === "string") { strm.input = strings.string2buf(data); } else if (toString.call(data) === "[object ArrayBuffer]") { strm.input = new Uint8Array(data); } else { strm.input = data; } strm.next_in = 0; strm.avail_in = strm.input.length; do { if (strm.avail_out === 0) { strm.output = new utils.Buf8(chunkSize); strm.next_out = 0; strm.avail_out = chunkSize; } status = zlib_deflate.deflate(strm, _mode); if (status !== Z_STREAM_END && status !== Z_OK) { this.onEnd(status); this.ended = true; return false; } if (strm.avail_out === 0 || strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH)) { if (this.options.to === "string") { this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); } else { this.onData(utils.shrinkBuf(strm.output, strm.next_out)); } } } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); if (_mode === Z_FINISH) { status = zlib_deflate.deflateEnd(this.strm); this.onEnd(status); this.ended = true; return status === Z_OK; } if (_mode === Z_SYNC_FLUSH) { this.onEnd(Z_OK); strm.avail_out = 0; return true; } return true; }; Deflate.prototype.onData = function(chunk) { this.chunks.push(chunk); }; Deflate.prototype.onEnd = function(status) { if (status === Z_OK) { if (this.options.to === "string") { this.result = this.chunks.join(""); } else { this.result = utils.flattenChunks(this.chunks); } } this.chunks = []; this.err = status; this.msg = this.strm.msg; }; function deflate(input, options) { var deflator = new Deflate(options); deflator.push(input, true); if (deflator.err) { throw deflator.msg || msg[deflator.err]; } return deflator.result; } function deflateRaw(input, options) { options = options || {}; options.raw = true; return deflate(input, options); } function gzip(input, options) { options = options || {}; options.gzip = true; return deflate(input, options); } exports.Deflate = Deflate; exports.deflate = deflate; exports.deflateRaw = deflateRaw; exports.gzip = gzip; } }); // ../../node_modules/pako/lib/zlib/inffast.js var require_inffast = __commonJS({ "../../node_modules/pako/lib/zlib/inffast.js"(exports, module) { "use strict"; var BAD = 30; var TYPE = 12; module.exports = function inflate_fast(strm, start) { var state; var _in; var last; var _out; var beg; var end; var dmax; var wsize; var whave; var wnext; var s_window; var hold; var bits; var lcode; var dcode; var lmask; var dmask; var here; var op; var len; var dist; var from; var from_source; var input, output; state = strm.state; _in = strm.next_in; input = strm.input; last = _in + (strm.avail_in - 5); _out = strm.next_out; output = strm.output; beg = _out - (start - strm.avail_out); end = _out + (strm.avail_out - 257); dmax = state.dmax; wsize = state.wsize; whave = state.whave; wnext = state.wnext; s_window = state.window; hold = state.hold; bits = state.bits; lcode = state.lencode; dcode = state.distcode; lmask = (1 << state.lenbits) - 1; dmask = (1 << state.distbits) - 1; top: do { if (bits < 15) { hold += input[_in++] << bits; bits += 8; hold += input[_in++] << bits; bits += 8; } here = lcode[hold & lmask]; dolen: for (; ; ) { op = here >>> 24; hold >>>= op; bits -= op; op = here >>> 16 & 255; if (op === 0) { output[_out++] = here & 65535; } else if (op & 16) { len = here & 65535; op &= 15; if (op) { if (bits < op) { hold += input[_in++] << bits; bits += 8; } len += hold & (1 << op) - 1; hold >>>= op; bits -= op; } if (bits < 15) { hold += input[_in++] << bits; bits += 8; hold += input[_in++] << bits; bits += 8; } here = dcode[hold & dmask]; dodist: for (; ; ) { op = here >>> 24; hold >>>= op; bits -= op; op = here >>> 16 & 255; if (op & 16) { dist = here & 65535; op &= 15; if (bits < op) { hold += input[_in++] << bits; bits += 8; if (bits < op) { hold += input[_in++] << bits; bits += 8; } } dist += hold & (1 << op) - 1; if (dist > dmax) { strm.msg = "invalid distance too far back"; state.mode = BAD; break top; } hold >>>= op; bits -= op; op = _out - beg; if (dist > op) { op = dist - op; if (op > whave) { if (state.sane) { strm.msg = "invalid distance too far back"; state.mode = BAD; break top; } } from = 0; from_source = s_window; if (wnext === 0) { from += wsize - op; if (op < len) { len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = _out - dist; from_source = output; } } else if (wnext < op) { from += wsize + wnext - op; op -= wnext; if (op < len) { len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = 0; if (wnext < len) { op = wnext; len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = _out - dist; from_source = output; } } } else { from += wnext - op; if (op < len) { len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = _out - dist; from_source = output; } } while (len > 2) { output[_out++] = from_source[from++]; output[_out++] = from_source[from++]; output[_out++] = from_source[from++]; len -= 3; } if (len) { output[_out++] = from_source[from++]; if (len > 1) { output[_out++] = from_source[from++]; } } } else { from = _out - dist; do { output[_out++] = output[from++]; output[_out++] = output[from++]; output[_out++] = output[from++]; len -= 3; } while (len > 2); if (len) { output[_out++] = output[from++]; if (len > 1) { output[_out++] = output[from++]; } } } } else if ((op & 64) === 0) { here = dcode[(here & 65535) + (hold & (1 << op) - 1)]; continue dodist; } else { strm.msg = "invalid distance code"; state.mode = BAD; break top; } break; } } else if ((op & 64) === 0) { here = lcode[(here & 65535) + (hold & (1 << op) - 1)]; continue dolen; } else if (op & 32) { state.mode = TYPE; break top; } else { strm.msg = "invalid literal/length code"; state.mode = BAD; break top; } break; } } while (_in < last && _out < end); len = bits >> 3; _in -= len; bits -= len << 3; hold &= (1 << bits) - 1; strm.next_in = _in; strm.next_out = _out; strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last); strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end); state.hold = hold; state.bits = bits; return; }; } }); // ../../node_modules/pako/lib/zlib/inftrees.js var require_inftrees = __commonJS({ "../../node_modules/pako/lib/zlib/inftrees.js"(exports, module) { "use strict"; var utils = require_common(); var MAXBITS = 15; var ENOUGH_LENS = 852; var ENOUGH_DISTS = 592; var CODES = 0; var LENS = 1; var DISTS = 2; var lbase = [ /* Length codes 257..285 base */ 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 ]; var lext = [ /* Length codes 257..285 extra */ 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 ]; var dbase = [ /* Distance codes 0..29 base */ 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 ]; var dext = [ /* Distance codes 0..29 extra */ 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 ]; module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) { var bits = opts.bits; var len = 0; var sym = 0; var min = 0, max = 0; var root = 0; var curr = 0; var drop = 0; var left = 0; var used = 0; var huff = 0; var incr; var fill; var low; var mask; var next; var base = null; var base_index = 0; var end; var count = new utils.Buf16(MAXBITS + 1); var offs = new utils.Buf16(MAXBITS + 1); var extra = null; var extra_index = 0; var here_bits, here_op, here_val; for (len = 0; len <= MAXBITS; len++) { count[len] = 0; } for (sym = 0; sym < codes; sym++) { count[lens[lens_index + sym]]++; } root = bits; for (max = MAXBITS; max >= 1; max--) { if (count[max] !== 0) { break; } } if (root > max) { root = max; } if (max === 0) { table[table_index++] = 1 << 24 | 64 << 16 | 0; table[table_index++] = 1 << 24 | 64 << 16 | 0; opts.bits = 1; return 0; } for (min = 1; min < max; min++) { if (count[min] !== 0) { break; } } if (root < min) { root = min; } left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= count[len]; if (left < 0) { return -1; } } if (left > 0 && (type === CODES || max !== 1)) { return -1; } offs[1] = 0; for (len = 1; len < MAXBITS; len++) { offs[len + 1] = offs[len] + count[len]; } for (sym = 0; sym < codes; sym++) { if (lens[lens_index + sym] !== 0) { work[offs[lens[lens_index + sym]]++] = sym; } } if (type === CODES) { base = extra = work; end = 19; } else if (type === LENS) { base = lbase; base_index -= 257; extra = lext; extra_index -= 257; end = 256; } else { base = dbase; extra = dext; end = -1; } huff = 0; sym = 0; len = min; next = table_index; curr = root; drop = 0; low = -1; used = 1 << root; mask = used - 1; if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { return 1; } for (; ; ) { here_bits = len - drop; if (work[sym] < end) { here_op = 0; here_val = work[sym]; } else if (work[sym] > end) { here_op = extra[extra_index + work[sym]]; here_val = base[base_index + work[sym]]; } else { here_op = 32 + 64; here_val = 0; } incr = 1 << len - drop; fill = 1 << curr; min = fill; do { fill -= incr; table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0; } while (fill !== 0); incr = 1 << len - 1; while (huff & incr) { incr >>= 1; } if (incr !== 0) { huff &= incr - 1; huff += incr; } else { huff = 0; } sym++; if (--count[len] === 0) { if (len === max) { break; } len = lens[lens_index + work[sym]]; } if (len > root && (huff & mask) !== low) { if (drop === 0) { drop = root; } next += min; curr = len - drop; left = 1 << curr; while (curr + drop < max) { left -= count[curr + drop]; if (left <= 0) { break; } curr++; left <<= 1; } used += 1 << curr; if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { return 1; } low = huff & mask; table[low] = root << 24 | curr << 16 | next - table_index | 0; } } if (huff !== 0) { table[next + huff] = len - drop << 24 | 64 << 16 | 0; } opts.bits = root; return 0; }; } }); // ../../node_modules/pako/lib/zlib/inflate.js var require_inflate = __commonJS({ "../../node_modules/pako/lib/zlib/inflate.js"(exports) { "use strict"; var utils = require_common(); var adler32 = require_adler32(); var crc32 = require_crc32(); var inflate_fast = require_inffast(); var inflate_table = require_inftrees(); var CODES = 0; var LENS = 1; var DISTS = 2; var Z_FINISH = 4; var Z_BLOCK = 5; var Z_TREES = 6; var Z_OK = 0; var Z_STREAM_END = 1; var Z_NEED_DICT = 2; var Z_STREAM_ERROR = -2; var Z_DATA_ERROR = -3; var Z_MEM_ERROR = -4; var Z_BUF_ERROR = -5; var Z_DEFLATED = 8; var HEAD = 1; var FLAGS = 2; var TIME = 3; var OS = 4; var EXLEN = 5; var EXTRA = 6; var NAME = 7; var COMMENT = 8; var HCRC = 9; var DICTID = 10; var DICT = 11; var TYPE = 12; var TYPEDO = 13; var STORED = 14; var COPY_ = 15; var COPY = 16; var TABLE = 17; var LENLENS = 18; var CODELENS = 19; var LEN_ = 20; var LEN = 21; var LENEXT = 22; var DIST = 23; var DISTEXT = 24; var MATCH = 25; var LIT = 26; var CHECK = 27; var LENGTH = 28; var DONE = 29; var BAD = 30; var MEM = 31; var SYNC = 32; var ENOUGH_LENS = 852; var ENOUGH_DISTS = 592; var MAX_WBITS = 15; var DEF_WBITS = MAX_WBITS; function zswap32(q) { return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24); } function InflateState() { this.mode = 0; this.last = false; this.wrap = 0; this.havedict = false; 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 utils.Buf16(320); this.work = new utils.Buf16(288); this.lendyn = null; this.distdyn = null; this.sane = 0; this.back = 0; this.was = 0; } function inflateResetKeep(strm) { var state; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; strm.total_in = strm.total_out = state.total = 0; strm.msg = ""; if (state.wrap) { strm.adler = state.wrap & 1; } state.mode = HEAD; state.last = 0; state.havedict = 0; state.dmax = 32768; state.head = null; state.hold = 0; state.bits = 0; state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); state.sane = 1; state.back = -1; return Z_OK; } function inflateReset(strm) { var state; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; state.wsize = 0; state.whave = 0; state.wnext = 0; return inflateResetKeep(strm); } function inflateReset2(strm, windowBits) { var wrap; var state; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; if (windowBits < 0) { wrap = 0; windowBits = -windowBits; } else { wrap = (windowBits >> 4) + 1; if (windowBits < 48) { windowBits &= 15; } } if (windowBits && (windowBits < 8 || windowBits > 15)) { return Z_STREAM_ERROR; } if (state.window !== null && state.wbits !== windowBits) { state.window = null; } state.wrap = wrap; state.wbits = windowBits; return inflateReset(strm); } function inflateInit2(strm, windowBits) { var ret; var state; if (!strm) { return Z_STREAM_ERROR; } state = new InflateState(); strm.state = state; state.window = null; ret = inflateReset2(strm, windowBits); if (ret !== Z_OK) { strm.state = null; } return ret; } function inflateInit(strm) { return inflateInit2(strm, DEF_WBITS); } var virgin = true; var lenfix; var distfix; function fixedtables(state) { if (virgin) { var sym; lenfix = new utils.Buf32(512); distfix = new utils.Buf32(32); sym = 0; while (sym < 144) { state.lens[sym++] = 8; } while (sym < 256) { state.lens[sym++] = 9; } while (sym < 280) { state.lens[sym++] = 7; } while (sym < 288) { state.lens[sym++] = 8; } inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); sym = 0; while (sym < 32) { state.lens[sym++] = 5; } inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); virgin = false; } state.lencode = lenfix; state.lenbits = 9; state.distcode = distfix; state.distbits = 5; } function updatewindow(strm, src, end, copy) { var dist; var state = strm.state; if (state.window === null) { state.wsize = 1 << state.wbits; state.wnext = 0; state.whave = 0; state.window = new utils.Buf8(state.wsize); } if (copy >= state.wsize) { utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); state.wnext = 0; state.whave = state.wsize; } else { dist = state.wsize - state.wnext; if (dist > copy) { dist = copy; } utils.arraySet(state.window, src, end - copy, dist, state.wnext); copy -= dist; if (copy) { utils.arraySet(state.window, src, end - copy, copy, 0); state.wnext = copy; state.whave = state.wsize; } else { state.wnext += dist; if (state.wnext === state.wsize) { state.wnext = 0; } if (state.whave < state.wsize) { state.whave += dist; } } } return 0; } function inflate(strm, flush) { var state; var input, output; var next; var put; var have, left; var hold; var bits; var _in, _out; var copy; var from; var from_source; var here = 0; var here_bits, here_op, here_val; var last_bits, last_op, last_val; var len; var ret; var hbuf = new utils.Buf8(4); var opts; var n; var order = ( /* permutation of code lengths */ [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15] ); if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) { return Z_STREAM_ERROR; } state = strm.state; if (state.mode === TYPE) { state.mode = TYPEDO; } put = strm.next_out; output = strm.output; left = strm.avail_out; next = strm.next_in; input = strm.input; have = strm.avail_in; hold = state.hold; bits = state.bits; _in = have; _out = left; ret = Z_OK; inf_leave: for (; ; ) { switch (state.mode) { case HEAD: if (state.wrap === 0) { state.mode = TYPEDO; break; } while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (state.wrap & 2 && hold === 35615) { state.check = 0; hbuf[0] = hold & 255; hbuf[1] = hold >>> 8 & 255; state.check = crc32(state.check, hbuf, 2, 0); hold = 0; bits = 0; state.mode = FLAGS; break; } state.flags = 0; if (state.head) { state.head.done = false; } if (!(state.wrap & 1) || /* check if zlib header allowed */ (((hold & 255) << 8) + (hold >> 8)) % 31) { strm.msg = "incorrect header check"; state.mode = BAD; break; } if ((hold & 15) !== Z_DEFLATED) { strm.msg = "unknown compression method"; state.mode = BAD; break; } hold >>>= 4; bits -= 4; len = (hold & 15) + 8; if (state.wbits === 0) { state.wbits = len; } else if (len > state.wbits) { strm.msg = "invalid window size"; state.mode = BAD; break; } state.dmax = 1 << len; strm.adler = state.check = 1; state.mode = hold & 512 ? DICTID : TYPE; hold = 0; bits = 0; break; case FLAGS: while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.flags = hold; if ((state.flags & 255) !== Z_DEFLATED) { strm.msg = "unknown compression method"; state.mode = BAD; break; } if (state.flags & 57344) { strm.msg = "unknown header flags set"; state.mode = BAD; break; } if (state.head) { state.head.text = hold >> 8 & 1; } if (state.flags & 512) { hbuf[0] = hold & 255; hbuf[1] = hold >>> 8 & 255; state.check = crc32(state.check, hbuf, 2, 0); } hold = 0; bits = 0; state.mode = TIME; case TIME: while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (state.head) { state.head.time = hold; } if (state.flags & 512) { hbuf[0] = hold & 255; hbuf[1] = hold >>> 8 & 255; hbuf[2] = hold >>> 16 & 255; hbuf[3] = hold >>> 24 & 255; state.check = crc32(state.check, hbuf, 4, 0); } hold = 0; bits = 0; state.mode = OS; case OS: while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (state.head) { state.head.xflags = hold & 255; state.head.os = hold >> 8; } if (state.flags & 512) { hbuf[0] = hold & 255; hbuf[1] = hold >>> 8 & 255; state.check = crc32(state.check, hbuf, 2, 0); } hold = 0; bits = 0; state.mode = EXLEN; case EXLEN: if (state.flags & 1024) { while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.length = hold; if (state.head) { state.head.extra_len = hold; } if (state.flags & 512) { hbuf[0] = hold & 255; hbuf[1] = hold >>> 8 & 255; state.check = crc32(state.check, hbuf, 2, 0); } hold = 0; bits = 0; } else if (state.head) { state.head.extra = null; } state.mode = EXTRA; case EXTRA: if (state.flags & 1024) { copy = state.length; if (copy > have) { copy = have; } if (copy) { if (state.head) { len = state.head.extra_len - state.length; if (!state.head.extra) { state.head.extra = new Array(state.head.extra_len); } utils.arraySet( state.head.extra, input, next, // extra field is limited to 65536 bytes // - no need for additional size check copy, /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ len ); } if (state.flags & 512) { state.check = crc32(state.check, input, copy, next); } have -= copy; next += copy; state.length -= copy; } if (state.length) { break inf_leave; } } state.length = 0; state.mode = NAME; case NAME: if (state.flags & 2048) { if (have === 0) { break inf_leave; } copy = 0; do { len = input[next + copy++]; if (state.head && len && state.length < 65536) { state.head.name += String.fromCharCode(len); } } while (len && copy < have); if (state.flags & 512) { state.check = crc32(state.check, input, copy, next); } have -= copy; next += copy; if (len) { break inf_leave; } } else if (state.head) { state.head.name = null; } state.length = 0; state.mode = COMMENT; case COMMENT: if (state.flags & 4096) { if (have === 0) { break inf_leave; } copy = 0; do { len = input[next + copy++]; if (state.head && len && state.length < 65536) { state.head.comment += String.fromCharCode(len); } } while (len && copy < have); if (state.flags & 512) { state.check = crc32(state.check, input, copy, next); } have -= copy; next += copy; if (len) { break inf_leave; } } else if (state.head) { state.head.comment = null; } state.mode = HCRC; case HCRC: if (state.flags & 512) { while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (hold !== (state.check & 65535)) { strm.msg = "header crc mismatch"; state.mode = BAD; break; } hold = 0; bits = 0; } if (state.head) { state.head.hcrc = state.flags >> 9 & 1; state.head.done = true; } strm.adler = state.check = 0; state.mode = TYPE; break; case DICTID: while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } strm.adler = state.check = zswap32(hold); hold = 0; bits = 0; state.mode = DICT; case DICT: if (state.havedict === 0) { strm.next_out = put; strm.avail_out = left; strm.next_in = next; strm.avail_in = have; state.hold = hold; state.bits = bits; return Z_NEED_DICT; } strm.adler = state.check = 1; state.mode = TYPE; case TYPE: if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } case TYPEDO: if (state.last) { hold >>>= bits & 7; bits -= bits & 7; state.mode = CHECK; break; } while (bits < 3) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.last = hold & 1; hold >>>= 1; bits -= 1; switch (hold & 3) { case 0: state.mode = STORED; break; case 1: fixedtables(state); state.mode = LEN_; if (flush === Z_TREES) { hold >>>= 2; bits -= 2; break inf_leave; } break; case 2: state.mode = TABLE; break; case 3: strm.msg = "invalid block type"; state.mode = BAD; } hold >>>= 2; bits -= 2; break; case STORED: hold >>>= bits & 7; bits -= bits & 7; while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if ((hold & 65535) !== (hold >>> 16 ^ 65535)) { strm.msg = "invalid stored block lengths"; state.mode = BAD; break; } state.length = hold & 65535; hold = 0; bits = 0; state.mode = COPY_; if (flush === Z_TREES) { break inf_leave; } case COPY_: state.mode = COPY; case COPY: copy = state.length; if (copy) { if (copy > have) { copy = have; } if (copy > left) { copy = left; } if (copy === 0) { break inf_leave; } utils.arraySet(output, input, next, copy, put); have -= copy; next += copy; left -= copy; put += copy; state.length -= copy; break; } state.mode = TYPE; break; case TABLE: while (bits < 14) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.nlen = (hold & 31) + 257; hold >>>= 5; bits -= 5; state.ndist = (hold & 31) + 1; hold >>>= 5; bits -= 5; state.ncode = (hold & 15) + 4; hold >>>= 4; bits -= 4; if (state.nlen > 286 || state.ndist > 30) { strm.msg = "too many length or distance symbols"; state.mode = BAD; break; } state.have = 0; state.mode = LENLENS; case LENLENS: while (state.have < state.ncode) { while (bits < 3) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.lens[order[state.have++]] = hold & 7; hold >>>= 3; bits -= 3; } while (state.have < 19) { state.lens[order[state.have++]] = 0; } state.lencode = state.lendyn; state.lenbits = 7; opts = { bits: state.lenbits }; ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); state.lenbits = opts.bits; if (ret) { strm.msg = "invalid code lengths set"; state.mode = BAD; break; } state.have = 0; state.mode = CODELENS; case CODELENS: while (state.have < state.nlen + state.ndist) { for (; ; ) { here = state.lencode[hold & (1 << state.lenbits) - 1]; here_bits = here >>> 24; here_op = here >>> 16 & 255; here_val = here & 65535; if (here_bits <= bits) { break; } if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (here_val < 16) { hold >>>= here_bits; bits -= here_bits; state.lens[state.have++] = here_val; } else { if (here_val === 16) { n = here_bits + 2; while (bits < n) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } hold >>>= here_bits; bits -= here_bits; if (state.have === 0) { strm.msg = "invalid bit length repeat"; state.mode = BAD; break; } len = state.lens[state.have - 1]; copy = 3 + (hold & 3); hold >>>= 2; bits -= 2; } else if (here_val === 17) { n = here_bits + 3; while (bits < n) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } hold >>>= here_bits; bits -= here_bits; len = 0; copy = 3 + (hold & 7); hold >>>= 3; bits -= 3; } else { n = here_bits + 7; while (bits < n) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } hold >>>= here_bits; bits -= here_bits; len = 0; copy = 11 + (hold & 127); hold >>>= 7; bits -= 7; } if (state.have + copy > state.nlen + state.ndist) { strm.msg = "invalid bit length repeat"; state.mode = BAD; break; } while (copy--) { state.lens[state.have++] = len; } } } if (state.mode === BAD) { break; } if (state.lens[256] === 0) { strm.msg = "invalid code -- missing end-of-block"; state.mode = BAD; break; } state.lenbits = 9; opts = { bits: state.lenbits }; ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); state.lenbits = opts.bits; if (ret) { strm.msg = "invalid literal/lengths set"; state.mode = BAD; break; } state.distbits = 6; state.distcode = state.distdyn; opts = { bits: state.distbits }; ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); state.distbits = opts.bits; if (ret) { strm.msg = "invalid distances set"; state.mode = BAD; break; } state.mode = LEN_; if (flush === Z_TREES) { break inf_leave; } case LEN_: state.mode = LEN; case LEN: if (have >= 6 && left >= 258) { strm.next_out = put; strm.avail_out = left; strm.next_in = next; strm.avail_in = have; state.hold = hold; state.bits = bits; inflate_fast(strm, _out); put = strm.next_out; output = strm.output; left = strm.avail_out; next = strm.next_in; input = strm.input; have = strm.avail_in; hold = state.hold; bits = state.bits; if (state.mode === TYPE) { state.back = -1; } break; } state.back = 0; for (; ; ) { here = state.lencode[hold & (1 << state.lenbits) - 1]; here_bits = here >>> 24; here_op = here >>> 16 & 255; here_val = here & 65535; if (here_bits <= bits) { break; } if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (here_op && (here_op & 240) === 0) { last_bits = here_bits; last_op = here_op; last_val = here_val; for (; ; ) { here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; here_bits = here >>> 24; here_op = here >>> 16 & 255; here_val = here & 65535; if (last_bits + here_bits <= bits) { break; } if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } hold >>>= last_bits; bits -= last_bits; state.back += last_bits; } hold >>>= here_bits; bits -= here_bits; state.back += here_bits; state.length = here_val; if (here_op === 0) { state.mode = LIT; break; } if (here_op & 32) { state.back = -1; state.mode = TYPE; break; } if (here_op & 64) { strm.msg = "invalid literal/length code"; state.mode = BAD; break; } state.extra = here_op & 15; state.mode = LENEXT; case LENEXT: if (state.extra) { n = state.extra; while (bits < n) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.length += hold & (1 << state.extra) - 1; hold >>>= state.extra; bits -= state.extra; state.back += state.extra; } state.was = state.length; state.mode = DIST; case DIST: for (; ; ) { here = state.distcode[hold & (1 << state.distbits) - 1]; here_bits = here >>> 24; here_op = here >>> 16 & 255; here_val = here & 65535; if (here_bits <= bits) { break; } if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if ((here_op & 240) === 0) { last_bits = here_bits; last_op = here_op; last_val = here_val; for (; ; ) { here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; here_bits = here >>> 24; here_op = here >>> 16 & 255; here_val = here & 65535; if (last_bits + here_bits <= bits) { break; } if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } hold >>>= last_bits; bits -= last_bits; state.back += last_bits; } hold >>>= here_bits; bits -= here_bits; state.back += here_bits; if (here_op & 64) { strm.msg = "invalid distance code"; state.mode = BAD; break; } state.offset = here_val; state.extra = here_op & 15; state.mode = DISTEXT; case DISTEXT: if (state.extra) { n = state.extra; while (bits < n) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.offset += hold & (1 << state.extra) - 1; hold >>>= state.extra; bits -= state.extra; state.back += state.extra; } if (state.offset > state.dmax) { strm.msg = "invalid distance too far back"; state.mode = BAD; break; } state.mode = MATCH; case MATCH: if (left === 0) { break inf_leave; } copy = _out - left; if (state.offset > copy) { copy = state.offset - copy; if (copy > state.whave) { if (state.sane) { strm.msg = "invalid distance too far back"; state.mode = BAD; break; } } if (copy > state.wnext) { copy -= state.wnext; from = state.wsize - copy; } else { from = state.wnext - copy; } if (copy > state.length) { copy = state.length; } from_source = state.window; } else { from_source = output; from = put - state.offset; copy = state.length; } if (copy > left) { copy = left; } left -= copy; state.length -= copy; do { output[put++] = from_source[from++]; } while (--copy); if (state.length === 0) { state.mode = LEN; } break; case LIT: if (left === 0) { break inf_leave; } output[put++] = state.length; left--; state.mode = LEN; break; case CHECK: if (state.wrap) { while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold |= input[next++] << bits; bits += 8; } _out -= left; strm.total_out += _out; state.total += _out; if (_out) { strm.adler = state.check = /*UPDATE(state.check, put - _out, _out);*/ state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out); } _out = left; if ((state.flags ? hold : zswap32(hold)) !== state.check) { strm.msg = "incorrect data check"; state.mode = BAD; break; } hold = 0; bits = 0; } state.mode = LENGTH; case LENGTH: if (state.wrap && state.flags) { while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (hold !== (state.total & 4294967295)) { strm.msg = "incorrect length check"; state.mode = BAD; break; } hold = 0; bits = 0; } state.mode = DONE; case DONE: ret = Z_STREAM_END; break inf_leave; case BAD: ret = Z_DATA_ERROR; break inf_leave; case MEM: return Z_MEM_ERROR; case SYNC: default: return Z_STREAM_ERROR; } } strm.next_out = put; strm.avail_out = left; strm.next_in = next; strm.avail_in = have; state.hold = hold; state.bits = bits; if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) { if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { state.mode = MEM; return Z_MEM_ERROR; } } _in -= strm.avail_in; _out -= strm.avail_out; strm.total_in += _in; strm.total_out += _out; state.total += _out; if (state.wrap && _out) { strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out); } strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); if ((_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK) { ret = Z_BUF_ERROR; } return ret; } function inflateEnd(strm) { if (!strm || !strm.state) { return Z_STREAM_ERROR; } var state = strm.state; if (state.window) { state.window = null; } strm.state = null; return Z_OK; } function inflateGetHeader(strm, head) { var state; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } state.head = head; head.done = false; return Z_OK; } function inflateSetDictionary(strm, dictionary) { var dictLength = dictionary.length; var state; var dictid; var ret; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; if (state.wrap !== 0 && state.mode !== DICT) { return Z_STREAM_ERROR; } if (state.mode === DICT) { dictid = 1; dictid = adler32(dictid, dictionary, dictLength, 0); if (dictid !== state.check) { return Z_DATA_ERROR; } } ret = updatewindow(strm, dictionary, dictLength, dictLength); if (ret) { state.mode = MEM; return Z_MEM_ERROR; } state.havedict = 1; return Z_OK; } exports.inflateReset = inflateReset; exports.inflateReset2 = inflateReset2; exports.inflateResetKeep = inflateResetKeep; exports.inflateInit = inflateInit; exports.inflateInit2 = inflateInit2; exports.inflate = inflate; exports.inflateEnd = inflateEnd; exports.inflateGetHeader = inflateGetHeader; exports.inflateSetDictionary = inflateSetDictionary; exports.inflateInfo = "pako inflate (from Nodeca project)"; } }); // ../../node_modules/pako/lib/zlib/constants.js var require_constants = __commonJS({ "../../node_modules/pako/lib/zlib/constants.js"(exports, module) { "use strict"; module.exports = { /* Allowed flush values; see deflate() and inflate() below for details */ 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, /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, //Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, //Z_VERSION_ERROR: -6, /* compression levels */ 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, /* Possible values of the data_type field (though see inflate()) */ Z_BINARY: 0, Z_TEXT: 1, //Z_ASCII: 1, // = Z_TEXT (deprecated) Z_UNKNOWN: 2, /* The deflate compression method */ Z_DEFLATED: 8 //Z_NULL: null // Use -1 or null inline, depending on var type }; } }); // ../../node_modules/pako/lib/zlib/gzheader.js var require_gzheader = __commonJS({ "../../node_modules/pako/lib/zlib/gzheader.js"(exports, module) { "use strict"; function GZheader() { 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 = false; } module.exports = GZheader; } }); // ../../node_modules/pako/lib/inflate.js var require_inflate2 = __commonJS({ "../../node_modules/pako/lib/inflate.js"(exports) { "use strict"; var zlib_inflate = require_inflate(); var utils = require_common(); var strings = require_strings(); var c = require_constants(); var msg = require_messages(); var ZStream = require_zstream(); var GZheader = require_gzheader(); var toString = Object.prototype.toString; function Inflate(options) { if (!(this instanceof Inflate)) return new Inflate(options); this.options = utils.assign({ chunkSize: 16384, windowBits: 0, to: "" }, options || {}); var opt = this.options; if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) { opt.windowBits = -opt.windowBits; if (opt.windowBits === 0) { opt.windowBits = -15; } } if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) { opt.windowBits += 32; } if (opt.windowBits > 15 && opt.windowBits < 48) { if ((opt.windowBits & 15) === 0) { opt.windowBits |= 15; } } this.err = 0; this.msg = ""; this.ended = false; this.chunks = []; this.strm = new ZStream(); this.strm.avail_out = 0; var status = zlib_inflate.inflateInit2( this.strm, opt.windowBits ); if (status !== c.Z_OK) { throw new Error(msg[status]); } this.header = new GZheader(); zlib_inflate.inflateGetHeader(this.strm, this.header); if (opt.dictionary) { if (typeof opt.dictionary === "string") { opt.dictionary = strings.string2buf(opt.dictionary); } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") { opt.dictionary = new Uint8Array(opt.dictionary); } if (opt.raw) { status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary); if (status !== c.Z_OK) { throw new Error(msg[status]); } } } } Inflate.prototype.push = function(data, mode) { var strm = this.strm; var chunkSize = this.options.chunkSize; var dictionary = this.options.dictionary; var status, _mode; var next_out_utf8, tail, utf8str; var allowBufError = false; if (this.ended) { return false; } _mode = mode === ~~mode ? mode : mode === true ? c.Z_FINISH : c.Z_NO_FLUSH; if (typeof data === "string") { strm.input = strings.binstring2buf(data); } else if (toString.call(data) === "[object ArrayBuffer]") { strm.input = new Uint8Array(data); } else { strm.input = data; } strm.next_in = 0; strm.avail_in = strm.input.length; do { if (strm.avail_out === 0) { strm.output = new utils.Buf8(chunkSize); strm.next_out = 0; strm.avail_out = chunkSize; } status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); if (status === c.Z_NEED_DICT && dictionary) { status = zlib_inflate.inflateSetDictionary(this.strm, dictionary); } if (status === c.Z_BUF_ERROR && allowBufError === true) { status = c.Z_OK; allowBufError = false; } if (status !== c.Z_STREAM_END && status !== c.Z_OK) { this.onEnd(status); this.ended = true; return false; } if (strm.next_out) { if (strm.avail_out === 0 || status === c.Z_STREAM_END || strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH)) { if (this.options.to === "string") { next_out_utf8 = strings.utf8border(strm.output, strm.next_out); tail = strm.next_out - next_out_utf8; utf8str = strings.buf2string(strm.output, next_out_utf8); strm.next_out = tail; strm.avail_out = chunkSize - tail; if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } this.onData(utf8str); } else { this.onData(utils.shrinkBuf(strm.output, strm.next_out)); } } } if (strm.avail_in === 0 && strm.avail_out === 0) { allowBufError = true; } } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); if (status === c.Z_STREAM_END) { _mode = c.Z_FINISH; } if (_mode === c.Z_FINISH) { status = zlib_inflate.inflateEnd(this.strm); this.onEnd(status); this.ended = true; return status === c.Z_OK; } if (_mode === c.Z_SYNC_FLUSH) { this.onEnd(c.Z_OK); strm.avail_out = 0; return true; } return true; }; Inflate.prototype.onData = function(chunk) { this.chunks.push(chunk); }; Inflate.prototype.onEnd = function(status) { if (status === c.Z_OK) { if (this.options.to === "string") { this.result = this.chunks.join(""); } else { this.result = utils.flattenChunks(this.chunks); } } this.chunks = []; this.err = status; this.msg = this.strm.msg; }; function inflate(input, options) { var inflator = new Inflate(options); inflator.push(input, true); if (inflator.err) { throw inflator.msg || msg[inflator.err]; } return inflator.result; } function inflateRaw(input, options) { options = options || {}; options.raw = true; return inflate(input, options); } exports.Inflate = Inflate; exports.inflate = inflate; exports.inflateRaw = inflateRaw; exports.ungzip = inflate; } }); // ../../node_modules/pako/index.js var require_pako = __commonJS({ "../../node_modules/pako/index.js"(exports, module) { "use strict"; var assign = require_common().assign; var deflate = require_deflate2(); var inflate = require_inflate2(); var constants = require_constants(); var pako2 = {}; assign(pako2, deflate, inflate, constants); module.exports = pako2; } }); // (disabled):zlib var require_zlib = __commonJS({ "(disabled):zlib"() { } }); // bundle.ts var bundle_exports = {}; __export(bundle_exports, { CD_HEADER_SIGNATURE: () => signature2, IndexedArchive: () => IndexedArchive, TarBuilder: () => TarBuilder, ZIP_COMPRESSION_HANDLERS: () => ZIP_COMPRESSION_HANDLERS, ZipFileSystem: () => ZipFileSystem, ZipLoader: () => ZipLoader, ZipWriter: () => ZipWriter, addOneFile: () => addOneFile, composeHashFile: () => composeHashFile, createZip: () => createZip, generateCDHeader: () => generateCDHeader, generateLocalHeader: () => generateLocalHeader, localHeaderSignature: () => signature3, makeHashTableFromZipHeaders: () => makeHashTableFromZipHeaders, makeZipCDHeaderIterator: () => makeZipCDHeaderIterator, parseEoCDRecord: () => parseEoCDRecord, parseHashTable: () => parseHashTable, parseZipCDFileHeader: () => parseZipCDFileHeader, parseZipLocalFileHeader: () => parseZipLocalFileHeader, searchFromTheEnd: () => searchFromTheEnd }); __reExport(bundle_exports, __toESM(require_core(), 1)); // src/zip-loader.ts var import_jszip = __toESM(require_jszip_min(), 1); var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest"; var ZipLoader = { dataType: null, batchType: null, id: "zip", module: "zip", name: "Zip Archive", version: VERSION, extensions: ["zip"], mimeTypes: ["application/zip"], category: "archive", tests: ["PK"], options: {}, parse: parseZipAsync }; async function parseZipAsync(data, options = {}) { const promises = []; const fileMap = {}; try { const jsZip = new import_jszip.default(); const zip = await jsZip.loadAsync(data, options); zip.forEach((relativePath, zipEntry) => { const subFilename = zipEntry.name; const promise = loadZipEntry(jsZip, subFilename, options).then((arrayBufferOrError) => { fileMap[relativePath] = arrayBufferOrError; }); promises.push(promise); }); await Promise.all(promises); return fileMap; } catch (error) { options.log.error(`Unable to read zip archive: ${error}`); throw error; } } async function loadZipEntry(jsZip, subFilename, options = {}) { try { const arrayBuffer = await jsZip.file(subFilename).async(options.dataType || "arraybuffer"); return arrayBuffer; } catch (error) { options.log.error(`Unable to read ${subFilename} from zip archive: ${error}`); return error; } } // src/zip-writer.ts var import_jszip2 = __toESM(require_jszip_min(), 1); var VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest"; var ZipWriter = { name: "Zip Archive", id: "zip", module: "zip", version: VERSION2, extensions: ["zip"], category: "archive", mimeTypes: ["application/zip"], options: { zip: { onUpdate: () => { } }, jszip: {} }, encode: encodeZipAsync }; async function encodeZipAsync(fileMap, options = {}) { const jsZip = new import_jszip2.default(); for (const subFileName in fileMap) { const subFileData = fileMap[subFileName]; jsZip.file(subFileName, subFileData, options?.jszip || {}); } const zipOptions = { ...ZipWriter.options.zip, ...options?.zip }; const jszipOptions = { ...ZipWriter.options?.jszip, ...options.jszip }; try { return await jsZip.generateAsync( { ...jszipOptions, type: "arraybuffer" }, // generate an arraybuffer zipOptions.onUpdate ); } catch (error) { options.log.error(`Unable to encode zip archive: ${error}`); throw error; } } // src/lib/tar/utils.ts function clean(length) { let i; const buffer = new Uint8Array(length); for (i = 0; i < length; i += 1) { buffer[i] = 0; } return buffer; } function pad(num, bytes, base) { const numStr = num.toString(base || 8); return "000000000000".substr(numStr.length + 12 - bytes) + numStr; } function stringToUint8(input, out, offset) { let i; let length; out = out || clean(input.length); offset = offset || 0; for (i = 0, length = input.length; i < length; i += 1) { out[offset] = input.charCodeAt(i); offset += 1; } return out; } // src/lib/tar/header.ts var structure = { fileName: 100, fileMode: 8, uid: 8, gid: 8, fileSize: 12, mtime: 12, checksum: 8, type: 1, linkName: 100, ustar: 8, owner: 32, group: 32, majorNumber: 8, minorNumber: 8, filenamePrefix: 155, padding: 12 }; function format(data, cb) { const buffer = clean(512); let offset = 0; Object.entries(structure).forEach(([field, length]) => { const str = data[field] || ""; let i; let fieldLength; for (i = 0, fieldLength = str.length; i < fieldLength; i += 1) { buffer[offset] = str.charCodeAt(i); offset += 1; } offset += length - i; }); if (typeof cb === "function") { return cb(buffer, offset); } return buffer; } // src/lib/tar/tar.ts var blockSize; var headerLength; var inputLength; var recordSize = 512; var Tar = class { written; out; blocks = []; length; /** * @param [recordsPerBlock] */ constructor(recordsPerBlock) { this.written = 0; blockSize = (recordsPerBlock || 20) * recordSize; this.out = clean(blockSize); this.blocks = []; this.length = 0; this.save = this.save.bind(this); this.clear = this.clear.bind(this); this.append = this.append.bind(this); } /** * Append a file to the tar archive * @param filepath * @param input * @param [opts] */ // eslint-disable-next-line complexity append(filepath, input, opts) { let checksum; if (typeof input === "string") { input = stringToUint8(input); } else if (input.constructor && input.constructor !== Uint8Array.prototype.constructor) { const errorInputMatch = /function\s*([$A-Za-z_][0-9A-Za-z_]*)\s*\(/.exec( input.constructor.toString() ); const errorInput = errorInputMatch && errorInputMatch[1]; const errorMessage = `Invalid input type. You gave me: ${errorInput}`; throw errorMessage; } opts = opts || {}; const mode = opts.mode || parseInt("777", 8) & 4095; const mtime = opts.mtime || Math.floor(Number(new Date()) / 1e3); const uid = opts.uid || 0; const gid = opts.gid || 0; const data = { fileName: filepath, fileMode: pad(mode, 7), uid: pad(uid, 7), gid: pad(gid, 7), fileSize: pad(input.length, 11), mtime: pad(mtime, 11), checksum: " ", // 0 = just a file type: "0", ustar: "ustar ", owner: opts.owner || "", group: opts.group || "" }; checksum = 0; Object.keys(data).forEach((key) => { let i; const value = data[key]; let length; for (i = 0, length = value.length; i < length; i += 1) { checksum += value.charCodeAt(i); } }); data.checksum = `${pad(checksum, 6)}\0 `; const headerArr = format(data); headerLength = Math.ceil(headerArr.length / recordSize) * recordSize; inputLength = Math.ceil(input.length / recordSize) * recordSize; this.blocks.push({ header: headerArr, input, headerLength, inputLength }); } /** * Compiling data to a Blob object * @returns {Blob} */ save() { const buffers = []; const chunks = new Array(); let length = 0; const max = Math.pow(2, 20); let chunk = new Array(); this.blocks.forEach((b = []) => { if (length + b.headerLength + b.inputLength > max) { chunks.push({ blocks: chunk, length }); chunk = []; length = 0; } chunk.push(b); length += b.headerLength + b.inputLength; }); chunks.push({ blocks: chunk, length }); chunks.forEach((c = []) => { const buffer = new Uint8Array(c.length); let written = 0; c.blocks.forEach((b = []) => { buffer.set(b.header, written); written += b.headerLength; buffer.set(b.input, written); written += b.inputLength; }); buffers.push(buffer); }); buffers.push(new Uint8Array(2 * recordSize)); return new Blob(buffers, { type: "octet/stream" }); } /** * Clear the data by its blocksize */ clear() { this.written = 0; this.out = clean(blockSize); } }; var tar_default = Tar; // src/tar-builder.ts var TAR_BUILDER_OPTIONS = { recordsPerBlock: 20 }; var TarBuilder = class { static get properties() { return { id: "tar", name: "TAR", extensions: ["tar"], mimeTypes: ["application/x-tar"], builder: TarBuilder, options: TAR_BUILDER_OPTIONS }; } options; tape; count = 0; constructor(options) { this.options = { ...TAR_BUILDER_OPTIONS, ...options }; this.tape = new tar_default(this.options.recordsPerBlock); } /** Adds a file to the archive. */ addFile(filename2, buffer) { this.tape.append(filename2, new Uint8Array(buffer)); this.count++; } async build() { return new Response(this.tape.save()).arrayBuffer(); } }; // ../loader-utils/src/lib/env-utils/globals.ts var globals = { self: typeof self !== "undefined" && self, window: typeof window !== "undefined" && window, global: typeof global !== "undefined" && global, document: typeof document !== "undefined" && document }; var self_ = globals.self || globals.window || globals.global || {}; var window_ = globals.window || globals.self || globals.global || {}; var global_ = globals.global || globals.self || globals.window || {}; var document_ = globals.document || {}; var isBrowser = ( // @ts-ignore process does not exist on browser Boolean(typeof process !== "object" || String(process) !== "[object process]" || process.browser) ); var matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version); var nodeVersion = matches && parseFloat(matches[1]) || 0; // ../loader-utils/src/lib/module-utils/js-module-utils.ts function registerJSModules(modules) { globalThis.loaders ||= {}; globalThis.loaders.modules ||= {}; Object.assign(globalThis.loaders.modules, modules); } // ../loader-utils/src/lib/binary-utils/array-buffer-utils.ts function compareArrayBuffers(arrayBuffer1, arrayBuffer2, byteLength) { byteLength = byteLength || arrayBuffer1.byteLength; if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) { return false; } const array1 = new Uint8Array(arrayBuffer1); const array2 = new Uint8Array(arrayBuffer2); for (let i = 0; i < array1.length; ++i) { if (array1[i] !== array2[i]) { return false; } } return true; } function concatenateArrayBuffers(...sources) { return concatenateArrayBuffersFromArray(sources); } function concatenateArrayBuffersFromArray(sources) { const sourceArrays = sources.map( (source2) => source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2 ); const byteLength = sourceArrays.reduce((length, typedArray) => length + typedArray.byteLength, 0); const result = new Uint8Array(byteLength); let offset = 0; for (const sourceArray of sourceArrays) { result.set(sourceArray, offset); offset += sourceArray.byteLength; } return result.buffer; } // ../loader-utils/src/lib/iterators/async-iteration.ts async function concatenateArrayBuffersAsync(asyncIterator) { const arrayBuffers = []; for await (const chunk of asyncIterator) { arrayBuffers.push(chunk); } return concatenateArrayBuffers(...arrayBuffers); } // ../loader-utils/src/lib/node/buffer.browser.ts function toArrayBuffer(buffer) { return buffer; } // ../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts function isBuffer(value) { return value && typeof value === "object" && value.isBuffer; } function toArrayBuffer2(data) { if (isBuffer(data)) { return toArrayBuffer(data); } if (data instanceof ArrayBuffer) { return data; } if (ArrayBuffer.isView(data)) { if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) { return data.buffer; } return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength); } if (typeof data === "string") { const text = data; const uint8Array = new TextEncoder().encode(text); return uint8Array.buffer; } if (data && typeof data === "object" && data._toArrayBuffer) { return data._toArrayBuffer(); } throw new Error("toArrayBuffer"); } // ../loader-utils/src/lib/node/promisify.ts function promisify1(fn) { return (args) => new Promise( (resolve2, reject) => fn(args, (error, callbackArgs) => error ? reject(error) : resolve2(callbackArgs)) ); } // ../loader-utils/src/lib/path-utils/path.ts var path_exports = {}; __export(path_exports, { dirname: () => dirname, filename: () => filename, join: () => join, resolve: () => resolve }); // ../loader-utils/src/lib/path-utils/get-cwd.ts function getCWD() { if (typeof process !== "undefined" && typeof process.cwd !== "undefined") { return process.cwd(); } const pathname = window.location?.pathname; return pathname?.slice(0, pathname.lastIndexOf("/") + 1) || ""; } // ../loader-utils/src/lib/path-utils/path.ts function filename(url) { const slashIndex = url ? url.lastIndexOf("/") : -1; return slashIndex >= 0 ? url.substr(slashIndex + 1) : ""; } function dirname(url) { const slashIndex = url ? url.lastIndexOf("/") : -1; return slashIndex >= 0 ? url.substr(0, slashIndex) : ""; } function join(...parts) { const separator = "/"; parts = parts.map((part, index) => { if (index) { part = part.replace(new RegExp(`^${separator}`), ""); } if (index !== parts.length - 1) { part = part.replace(new RegExp(`${separator}$`), ""); } return part; }); return parts.join(separator); } function resolve(...components) { const paths = []; for (let _i = 0; _i < components.length; _i++) { paths[_i] = components[_i]; } let resolvedPath = ""; let resolvedAbsolute = false; let cwd; for (let i = paths.length - 1; i >= -1 && !resolvedAbsolute; i--) { let path; if (i >= 0) { path = paths[i]; } else { if (cwd === void 0) { cwd = getCWD(); } path = cwd; } if (path.length === 0) { continue; } resolvedPath = `${path}/${resolvedPath}`; resolvedAbsolute = path.charCodeAt(0) === SLASH; } resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute); if (resolvedAbsolute) { return `/${resolvedPath}`; } else if (resolvedPath.length > 0) { return resolvedPath; } return "."; } var SLASH = 47; var DOT = 46; function normalizeStringPosix(path, allowAboveRoot) { let res = ""; let lastSlash = -1; let dots = 0; let code; let isAboveRoot = false; for (let i = 0; i <= path.length; ++i) { if (i < path.length) { code = path.charCodeAt(i); } else if (code === SLASH) { break; } else { code = SLASH; } if (code === SLASH) { if (lastSlash === i - 1 || dots === 1) { } else if (lastSlash !== i - 1 && dots === 2) { if (res.length < 2 || !isAboveRoot || res.charCodeAt(res.length - 1) !== DOT || res.charCodeAt(res.length - 2) !== DOT) { if (res.length > 2) { const start = res.length - 1; let j = start; for (; j >= 0; --j) { if (res.charCodeAt(j) === SLASH) { break; } } if (j !== start) { res = j === -1 ? "" : res.slice(0, j); lastSlash = i; dots = 0; isAboveRoot = false; continue; } } else if (res.length === 2 || res.length === 1) { res = ""; lastSlash = i; dots = 0; isAboveRoot = false; continue; } } if (allowAboveRoot) { if (res.length > 0) { res += "/.."; } else { res = ".."; } isAboveRoot = true; } } else { const slice = path.slice(lastSlash + 1, i); if (res.length > 0) { res += `/${slice}`; } else { res = slice; } isAboveRoot = false; } lastSlash = i; dots = 0; } else if (code === DOT && dots !== -1) { ++dots; } else { dots = -1; } } return res; } // ../loader-utils/src/lib/files/node-file-facade.ts var NOT_IMPLEMENTED = new Error("Not implemented"); var NodeFileFacade = class { handle; size = 0; bigsize = 0n; url = ""; constructor(url, flags, mode) { if (globalThis.loaders?.NodeFile) { return new globalThis.loaders.NodeFile(url, flags, mode); } if (isBrowser) { throw new Error("Can't instantiate NodeFile in browser."); } throw new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first."); } /** Read data */ async read(start, end) { throw NOT_IMPLEMENTED; } /** Write to file. The number of bytes written will be returned */ async write(arrayBuffer, offset, length) { throw NOT_IMPLEMENTED; } /** Get information about file */ async stat() { throw NOT_IMPLEMENTED; } /** Truncates the file descriptor. Only available on NodeFile. */ async truncate(length) { throw NOT_IMPLEMENTED; } /** Append data to a file. Only available on NodeFile. */ async append(data) { throw NOT_IMPLEMENTED; } /** Close the file */ async close() { } }; // ../loader-utils/src/lib/filesystems/node-filesystem-facade.ts var NOT_IMPLEMENTED2 = new Error("Not implemented"); var NodeFileSystemFacade = class { // implements FileSystem constructor(options) { if (globalThis.loaders?.NodeFileSystem) { return new globalThis.loaders.NodeFileSystem(options); } if (isBrowser) { throw new Error("Can't instantiate NodeFileSystem in browser."); } throw new Error( "Can't instantiate NodeFileSystem. Make sure to import @loaders.gl/polyfills first." ); } // DUMMY IMPLEMENTATION, not used (constructor returns a real NodeFileSystem instance) // implements RandomAccessReadFileSystem readable = true; writable = true; async openReadableFile(path, flags) { throw NOT_IMPLEMENTED2; } // implements RandomAccessWriteFileSystem async openWritableFile(path, flags, mode) { throw NOT_IMPLEMENTED2; } // Implements file system async readdir(dirname2 = ".", options) { throw NOT_IMPLEMENTED2; } async stat(path, options) { throw NOT_IMPLEMENTED2; } async unlink(path) { throw NOT_IMPLEMENTED2; } async fetch(path, options) { throw NOT_IMPLEMENTED2; } }; // ../loader-utils/src/lib/file-provider/file-provider-interface.ts var isFileProvider = (fileProvider) => { return fileProvider?.getUint8 && fileProvider?.slice && fileProvider?.length; }; // ../loader-utils/src/lib/file-provider/file-handle-file.ts var FileHandleFile = class { /** The FileHandle from which data is provided */ file; /** Create a new FileHandleFile */ constructor(path, append = false) { this.file = new NodeFileFacade(path, append ? "a+" : "r"); } /** * Truncates the file descriptor. * @param length desired file lenght */ async truncate(length) { await this.file.truncate(length); } /** * Append data to a file. * @param buffer data to append */ async append(buffer) { await this.file.append(buffer); } /** Close file */ async destroy() { await this.file.close(); } /** * Gets an unsigned 8-bit integer at the specified byte offset from the start of the file. * @param offset The offset, in bytes, from the start of the file where to read the data. */ async getUint8(offset) { const arrayBuffer = await this.file.read(offset, 1); const val = new Uint8Array(arrayBuffer).at(0); if (val === void 0) { throw new Error("something went wrong"); } return val; } /** * Gets an unsigned 16-bit integer at the specified byte offset from the start of the file. * @param offset The offset, in bytes, from the start of the file where to read the data. */ async getUint16(offset) { const arrayBuffer = await this.file.read(offset, 2); const val = new Uint16Array(arrayBuffer).at(0); if (val === void 0) { throw new Error("something went wrong"); } return val; } /** * Gets an unsigned 32-bit integer at the specified byte offset from the start of the file. * @param offset The offset, in bytes, from the start of the file where to read the data. */ async getUint32(offset) { const arrayBuffer = await this.file.read(offset, 4); const val = new Uint32Array(arrayBuffer).at(0); if (val === void 0) { throw new Error("something went wrong"); } return val; } /** * Gets an unsigned 32-bit integer at the specified byte offset from the start of the file. * @param offset The offset, in bytes, from the start of the file where to read the data. */ async getBigUint64(offset) { const arrayBuffer = await this.file.read(offset, 8); const val = new BigInt64Array(arrayBuffer).at(0); if (val === void 0) { throw new Error("something went wrong"); } return val; } /** * returns an ArrayBuffer whose contents are a copy of this file bytes from startOffset, inclusive, up to endOffset, exclusive. * @param startOffset The offset, in byte, from the start of the file where to start reading the data. * @param endOffset The offset, in bytes, from the start of the file where to end reading the data. */ async slice(startOffset, endOffset) { const bigLength = endOffset - startOffset; if (bigLength > Number.MAX_SAFE_INTEGER) { throw new Error("too big slice"); } const length = Number(bigLength); return await this.file.read(startOffset, length); } /** * the length (in bytes) of the data. */ get length() { return this.file.bigsize; } }; // ../loader-utils/src/lib/file-provider/data-view-file.ts var toNumber = (bigint) => { if (bigint > Number.MAX_SAFE_INTEGER) { throw new Error("Offset is out of bounds"); } return Number(bigint); }; var DataViewFile = class { /** The DataView from which data is provided */ file; constructor(file) { this.file = file; } async destroy() { } /** * Gets an unsigned 8-bit integer at the specified byte offset from the start of the file. * @param offset The offset, in bytes, from the start of the file where to read the data. */ async getUint8(offset) { return this.file.getUint8(toNumber(offset)); } /** * Gets an unsigned 16-bit intege at the specified byte offset from the start of the file. * @param offset The offset, in bytes, from the start of the file where to read the data. */ async getUint16(offset) { return this.file.getUint16(toNumber(offset), true); } /** * Gets an unsigned 32-bit integer at the specified byte offset from the start of the file. * @param offset The offset, in bytes, from the start of the file where to read the data. */ async getUint32(offset) { return this.file.getUint32(toNumber(offset), true); } /** * Gets an unsigned 64-bit integer at the specified byte offset from the start of the file. * @param offset The offset, in bytes, from the start of the file where to read the data. */ async getBigUint64(offset) { return this.file.getBigUint64(toNumber(offset), true); } /** * returns an ArrayBuffer whose contents are a copy of this file bytes from startOffset, inclusive, up to endOffset, exclusive. * @param startOffset The offset, in bytes, from the start of the file where to start reading the data. * @param endOffset The offset, in bytes, from the start of the file where to end reading the data. */ async slice(startOffset, endOffset) { return this.file.buffer.slice(toNumber(startOffset), toNumber(endOffset)); } /** the length (in bytes) of the data. */ get length() { return BigInt(this.file.byteLength); } }; // src/parse-zip/search-from-the-end.ts var buffLength = 1024; var searchFromTheEnd = async (file, target) => { const searchWindow = [ await file.getUint8(file.length - 1n), await file.getUint8(file.length - 2n), await file.getUint8(file.length - 3n), void 0 ]; let targetOffset = -1; let point = file.length - 4n; do { const prevPoint = point; point -= BigInt(buffLength); point = point >= 0n ? point : 0n; const buff = new Uint8Array(await file.slice(point, prevPoint)); for (let i = buff.length - 1; i > -1; i--) { searchWindow[3] = searchWindow[2]; searchWindow[2] = searchWindow[1]; searchWindow[1] = searchWindow[0]; searchWindow[0] = buff[i]; if (searchWindow.every((val, index) => val === target[index])) { targetOffset = i; break; } } } while (targetOffset === -1 && point > 0n); return point + BigInt(targetOffset); }; // src/parse-zip/zip64-info-generation.ts var signature = new Uint8Array([1, 0]); function createZip64Info(options) { const optionsToUse = { ...options, zip64Length: (options.offset ? 1 : 0) * 8 + (options.size ? 1 : 0) * 16 }; const arraysToConcat = []; for (const field of ZIP64_FIELDS) { if (!optionsToUse[field.name ?? ""] && !field.default) { continue; } const newValue = new DataView(new ArrayBuffer(field.size)); NUMBER_SETTERS[field.size](newValue, 0, optionsToUse[field.name ?? ""] ?? field.default); arraysToConcat.push(newValue.buffer); } return concatenateArrayBuffers(...arraysToConcat); } function setFieldToNumber(header, fieldSize, fieldOffset, value) { NUMBER_SETTERS[fieldSize](header, Number(fieldOffset), value); } var NUMBER_SETTERS = { 2: (header, offset, value) => { header.setUint16(offset, Number(value > 65535 ? 65535 : value), true); }, 4: (header, offset, value) => { header.setUint32(offset, Number(value > 4294967295 ? 4294967295 : value), true); }, 8: (header, offset, value) => { header.setBigUint64(offset, BigInt(value), true); } }; var ZIP64_FIELDS = [ // Header ID 0x0001 { size: 2, default: new DataView(signature.buffer).getUint16(0, true) }, // Size of the extra field chunk (8, 16, 24 or 28) { size: 2, name: "zip64Length" }, // Original uncompressed file size { size: 8, name: "size" }, // Size of compressed data { size: 8, name: "size" }, // Offset of local header record { size: 8, name: "offset" } ]; // src/parse-zip/end-of-central-directory.ts var eoCDSignature = new Uint8Array([80, 75, 5, 6]); var zip64EoCDLocatorSignature = new Uint8Array([80, 75, 6, 7]); var zip64EoCDSignature = new Uint8Array([80, 75, 6, 6]); var CD_RECORDS_NUMBER_OFFSET = 8n; var CD_RECORDS_NUMBER_ON_DISC_OFFSET = 10n; var CD_CD_BYTE_SIZE_OFFSET = 12n; var CD_START_OFFSET_OFFSET = 16n; var CD_COMMENT_OFFSET = 22n; var ZIP64_EOCD_START_OFFSET_OFFSET = 8n; var ZIP64_CD_RECORDS_NUMBER_OFFSET = 24n; var ZIP64_CD_RECORDS_NUMBER_ON_DISC_OFFSET = 32n; var ZIP64_CD_CD_BYTE_SIZE_OFFSET = 40n; var ZIP64_CD_START_OFFSET_OFFSET = 48n; var ZIP64_COMMENT_OFFSET = 56n; var parseEoCDRecord = async (file) => { const zipEoCDOffset = await searchFromTheEnd(file, eoCDSignature); let cdRecordsNumber = BigInt(await file.getUint16(zipEoCDOffset + CD_RECORDS_NUMBER_OFFSET)); let cdByteSize = BigInt(await file.getUint32(zipEoCDOffset + CD_CD_BYTE_SIZE_OFFSET)); let cdStartOffset = BigInt(await file.getUint32(zipEoCDOffset + CD_START_OFFSET_OFFSET)); let zip64EoCDLocatorOffset = zipEoCDOffset - 20n; let zip64EoCDOffset = 0n; const magicBytes = await file.slice(zip64EoCDLocatorOffset, zip64EoCDLocatorOffset + 4n); if (compareArrayBuffers(magicBytes, zip64EoCDLocatorSignature)) { zip64EoCDOffset = await file.getBigUint64( zip64EoCDLocatorOffset + ZIP64_EOCD_START_OFFSET_OFFSET ); const endOfCDMagicBytes = await file.slice(zip64EoCDOffset, zip64EoCDOffset + 4n); if (!compareArrayBuffers(endOfCDMagicBytes, zip64EoCDSignature.buffer)) { throw new Error("zip64 EoCD not found"); } cdRecordsNumber = await file.getBigUint64(zip64EoCDOffset + ZIP64_CD_RECORDS_NUMBER_OFFSET); cdByteSize = await file.getBigUint64(zip64EoCDOffset + ZIP64_CD_CD_BYTE_SIZE_OFFSET); cdStartOffset = await file.getBigUint64(zip64EoCDOffset + ZIP64_CD_START_OFFSET_OFFSET); } else { zip64EoCDLocatorOffset = 0n; } return { cdRecordsNumber, cdStartOffset, cdByteSize, offsets: { zip64EoCDOffset, zip64EoCDLocatorOffset, zipEoCDOffset } }; }; function updateEoCD(eocdBody, oldEoCDOffsets, newCDStartOffset, eocdStartOffset, newCDRecordsNumber) { const eocd = new DataView(eocdBody); const classicEoCDOffset = oldEoCDOffsets.zip64EoCDOffset ? oldEoCDOffsets.zipEoCDOffset - oldEoCDOffsets.zip64EoCDOffset : 0n; if (Number(newCDRecordsNumber) <= 65535) { setFieldToNumber(eocd, 2, classicEoCDOffset + CD_RECORDS_NUMBER_OFFSET, newCDRecordsNumber); setFieldToNumber( eocd, 2, classicEoCDOffset + CD_RECORDS_NUMBER_ON_DISC_OFFSET, newCDRecordsNumber ); } if (eocdStartOffset - newCDStartOffset <= 4294967295) { setFieldToNumber( eocd, 4, classicEoCDOffset + CD_CD_BYTE_SIZE_OFFSET, eocdStartOffset - newCDStartOffset ); } if (newCDStartOffset < 4294967295) { setFieldToNumber(eocd, 4, classicEoCDOffset + CD_START_OFFSET_OFFSET, newCDStartOffset); } if (oldEoCDOffsets.zip64EoCDLocatorOffset && oldEoCDOffsets.zip64EoCDOffset) { const locatorOffset = oldEoCDOffsets.zip64EoCDLocatorOffset - oldEoCDOffsets.zip64EoCDOffset; setFieldToNumber(eocd, 8, locatorOffset + ZIP64_EOCD_START_OFFSET_OFFSET, eocdStartOffset); setFieldToNumber(eocd, 8, ZIP64_CD_START_OFFSET_OFFSET, newCDStartOffset); setFieldToNumber(eocd, 8, ZIP64_CD_RECORDS_NUMBER_OFFSET, newCDRecordsNumber); setFieldToNumber(eocd, 8, ZIP64_CD_RECORDS_NUMBER_ON_DISC_OFFSET, newCDRecordsNumber); setFieldToNumber(eocd, 8, ZIP64_CD_CD_BYTE_SIZE_OFFSET, eocdStartOffset - newCDStartOffset); } return new Uint8Array(eocd.buffer); } function generateEoCD(options) { const header = new DataView(new ArrayBuffer(Number(CD_COMMENT_OFFSET))); for (const field of EOCD_FIELDS) { setFieldToNumber( header, field.size, field.offset, options[field.name ?? ""] ?? field.default ?? 0 ); } const locator = generateZip64InfoLocator(options); const zip64Record = generateZip64Info(options); return concatenateArrayBuffers(zip64Record, locator, header.buffer); } var EOCD_FIELDS = [ // End of central directory signature = 0x06054b50 { offset: 0, size: 4, default: new DataView(eoCDSignature.buffer).getUint32(0, true) }, // Number of this disk (or 0xffff for ZIP64) { offset: 4, size: 2, default: 0 }, // Disk where central directory starts (or 0xffff for ZIP64) { offset: 6, size: 2, default: 0 }, // Number of central directory records on this disk (or 0xffff for ZIP64) { offset: 8, size: 2, name: "recordsNumber" }, // Total number of central directory records (or 0xffff for ZIP64) { offset: 10, size: 2, name: "recordsNumber" }, // Size of central directory (bytes) (or 0xffffffff for ZIP64) { offset: 12, size: 4, name: "cdSize" }, // Offset of start of central directory, relative to start of archive (or 0xffffffff for ZIP64) { offset: 16, size: 4, name: "cdOffset" }, // Comment length (n) { offset: 20, size: 2, default: 0 } ]; function generateZip64Info(options) { const record = new DataView(new ArrayBuffer(Number(ZIP64_COMMENT_OFFSET))); for (const field of ZIP64_EOCD_FIELDS) { setFieldToNumber( record, field.size, field.offset, options[field.name ?? ""] ?? field.default ?? 0 ); } return record.buffer; } function generateZip64InfoLocator(options) { const locator = new DataView(new ArrayBuffer(Number(20))); for (const field of ZIP64_EOCD_LOCATOR_FIELDS) { setFieldToNumber( locator, field.size, field.offset, options[field.name ?? ""] ?? field.default ?? 0 ); } return locator.buffer; } var ZIP64_EOCD_LOCATOR_FIELDS = [ // zip64 end of central dir locator signature { offset: 0, size: 4, default: new DataView(zip64EoCDLocatorSignature.buffer).getUint32(0, true) }, // number of the disk with the start of the zip64 end of { offset: 4, size: 4, default: 0 }, // start of the zip64 end of central directory { offset: 8, size: 8, name: "eoCDStart" }, // total number of disks { offset: 16, size: 4, default: 1 } ]; var ZIP64_EOCD_FIELDS = [ // End of central directory signature = 0x06064b50 { offset: 0, size: 4, default: new DataView(zip64EoCDSignature.buffer).getUint32(0, true) }, // Size of the EOCD64 minus 12 { offset: 4, size: 8, default: 44 }, // Version made by { offset: 12, size: 2, default: 45 }, // Version needed to extract (minimum) { offset: 14, size: 2, default: 45 }, // Number of this disk { offset: 16, size: 4, default: 0 }, // Disk where central directory starts { offset: 20, size: 4, default: 0 }, // Number of central directory records on this disk { offset: 24, size: 8, name: "recordsNumber" }, // Total number of central directory records { offset: 32, size: 8, name: "recordsNumber" }, // Size of central directory (bytes) { offset: 40, size: 8, name: "cdSize" }, // Offset of start of central directory, relative to start of archive { offset: 48, size: 8, name: "cdOffset" } ]; // src/parse-zip/cd-file-header.ts var CD_COMPRESSED_SIZE_OFFSET = 20; var CD_UNCOMPRESSED_SIZE_OFFSET = 24; var CD_FILE_NAME_LENGTH_OFFSET = 28; var CD_EXTRA_FIELD_LENGTH_OFFSET = 30; var CD_START_DISK_OFFSET = 32; var CD_LOCAL_HEADER_OFFSET_OFFSET = 42; var CD_FILE_NAME_OFFSET = 46n; var signature2 = new Uint8Array([80, 75, 1, 2]); var parseZipCDFileHeader = async (headerOffset, file) => { if (headerOffset >= file.length) { return null; } const mainHeader = new DataView( await file.slice(headerOffset, headerOffset + CD_FILE_NAME_OFFSET) ); const magicBytes = mainHeader.buffer.slice(0, 4); if (!compareArrayBuffers(magicBytes, signature2.buffer)) { return null; } const compressedSize = BigInt(mainHeader.getUint32(CD_COMPRESSED_SIZE_OFFSET, true)); const uncompressedSize = BigInt(mainHeader.getUint32(CD_UNCOMPRESSED_SIZE_OFFSET, true)); const extraFieldLength = mainHeader.getUint16(CD_EXTRA_FIELD_LENGTH_OFFSET, true); const startDisk = BigInt(mainHeader.getUint16(CD_START_DISK_OFFSET, true)); const fileNameLength = mainHeader.getUint16(CD_FILE_NAME_LENGTH_OFFSET, true); const additionalHeader = await file.slice( headerOffset + CD_FILE_NAME_OFFSET, headerOffset + CD_FILE_NAME_OFFSET + BigInt(fileNameLength + extraFieldLength) ); const filenameBytes = additionalHeader.slice(0, fileNameLength); const fileName = new TextDecoder().decode(filenameBytes); const extraOffset = headerOffset + CD_FILE_NAME_OFFSET + BigInt(fileNameLength); const oldFormatOffset = mainHeader.getUint32(CD_LOCAL_HEADER_OFFSET_OFFSET, true); const localHeaderOffset = BigInt(oldFormatOffset); const extraField = new DataView( additionalHeader.slice(fileNameLength, additionalHeader.byteLength) ); const zip64data = { uncompressedSize, compressedSize, localHeaderOffset, startDisk }; const res = findZip64DataInExtra(zip64data, extraField); return { ...zip64data, ...res, extraFieldLength, fileNameLength, fileName, extraOffset }; }; async function* makeZipCDHeaderIterator(fileProvider) { const { cdStartOffset, cdByteSize } = await parseEoCDRecord(fileProvider); const centralDirectory = new DataViewFile( new DataView(await fileProvider.slice(cdStartOffset, cdStartOffset + cdByteSize)) ); let cdHeader = await parseZipCDFileHeader(0n, centralDirectory); while (cdHeader) { yield cdHeader; cdHeader = await parseZipCDFileHeader( cdHeader.extraOffset + BigInt(cdHeader.extraFieldLength), centralDirectory ); } } var getUint16 = (...bytes) => { return bytes[0] + bytes[1] * 16; }; var findZip64DataInExtra = (zip64data, extraField) => { const zip64dataList = findExpectedData(zip64data); const zip64DataRes = {}; if (zip64dataList.length > 0) { const zip64chunkSize = zip64dataList.reduce((sum, curr) => sum + curr.length, 0); const offsetInExtraData = new Uint8Array(extraField.buffer).findIndex( (_val, i, arr) => getUint16(arr[i], arr[i + 1]) === 1 && getUint16(arr[i + 2], arr[i + 3]) === zip64chunkSize ); let bytesRead = 0; for (const note of zip64dataList) { const offset = bytesRead; zip64DataRes[note.name] = extraField.getBigUint64(offsetInExtraData + 4 + offset, true); bytesRead = offset + note.length; } } return zip64DataRes; }; var findExpectedData = (zip64data) => { const zip64dataList = []; if (zip64data.uncompressedSize === BigInt(4294967295)) { zip64dataList.push({ name: "uncompressedSize", length: 8 }); } if (zip64data.compressedSize === BigInt(4294967295)) { zip64dataList.push({ name: "compressedSize", length: 8 }); } if (zip64data.localHeaderOffset === BigInt(4294967295)) { zip64dataList.push({ name: "localHeaderOffset", length: 8 }); } if (zip64data.startDisk === BigInt(4294967295)) { zip64dataList.push({ name: "startDisk", length: 4 }); } return zip64dataList; }; function generateCDHeader(options) { const optionsToUse = { ...options, fnlength: options.fileName.length, extraLength: 0 }; let zip64header = new ArrayBuffer(0); const optionsToZip64 = {}; if (optionsToUse.offset >= 4294967295) { optionsToZip64.offset = optionsToUse.offset; optionsToUse.offset = BigInt(4294967295); } if (optionsToUse.length >= 4294967295) { optionsToZip64.size = optionsToUse.length; optionsToUse.length = 4294967295; } if (Object.keys(optionsToZip64).length) { zip64header = createZip64Info(optionsToZip64); optionsToUse.extraLength = zip64header.byteLength; } const header = new DataView(new ArrayBuffer(Number(CD_FILE_NAME_OFFSET))); for (const field of ZIP_HEADER_FIELDS) { setFieldToNumber( header, field.size, field.offset, optionsToUse[field.name ?? ""] ?? field.default ?? 0 ); } const encodedName = new TextEncoder().encode(optionsToUse.fileName); const resHeader = concatenateArrayBuffers(header.buffer, encodedName, zip64header); return resHeader; } var ZIP_HEADER_FIELDS = [ // Central directory file header signature = 0x02014b50 { offset: 0, size: 4, default: new DataView(signature2.buffer).getUint32(0, true) }, // Version made by { offset: 4, size: 2, default: 45 }, // Version needed to extract (minimum) { offset: 6, size: 2, default: 45 }, // General purpose bit flag { offset: 8, size: 2, default: 0 }, // Compression method { offset: 10, size: 2, default: 0 }, // File last modification time { offset: 12, size: 2, default: 0 }, // File last modification date { offset: 14, size: 2, default: 0 }, // CRC-32 of uncompressed data { offset: 16, size: 4, name: "crc32" }, // Compressed size (or 0xffffffff for ZIP64) { offset: 20, size: 4, name: "length" }, // Uncompressed size (or 0xffffffff for ZIP64) { offset: 24, size: 4, name: "length" }, // File name length (n) { offset: 28, size: 2, name: "fnlength" }, // Extra field length (m) { offset: 30, size: 2, default: 0, name: "extraLength" }, // File comment length (k) { offset: 32, size: 2, default: 0 }, // Disk number where file starts (or 0xffff for ZIP64) { offset: 34, size: 2, default: 0 }, // Internal file attributes { offset: 36, size: 2, default: 0 }, // External file attributes { offset: 38, size: 4, default: 0 }, // Relative offset of local file header { offset: 42, size: 4, name: "offset" } ]; // src/parse-zip/local-file-header.ts var COMPRESSION_METHOD_OFFSET = 8; var COMPRESSED_SIZE_OFFSET = 18; var UNCOMPRESSED_SIZE_OFFSET = 22; var FILE_NAME_LENGTH_OFFSET = 26; var EXTRA_FIELD_LENGTH_OFFSET = 28; var FILE_NAME_OFFSET = 30n; var signature3 = new Uint8Array([80, 75, 3, 4]); var parseZipLocalFileHeader = async (headerOffset, file) => { const mainHeader = new DataView(await file.slice(headerOffset, headerOffset + FILE_NAME_OFFSET)); const magicBytes = mainHeader.buffer.slice(0, 4); if (!compareArrayBuffers(magicBytes, signature3)) { return null; } const fileNameLength = mainHeader.getUint16(FILE_NAME_LENGTH_OFFSET, true); const extraFieldLength = mainHeader.getUint16(EXTRA_FIELD_LENGTH_OFFSET, true); const additionalHeader = await file.slice( headerOffset + FILE_NAME_OFFSET, headerOffset + FILE_NAME_OFFSET + BigInt(fileNameLength + extraFieldLength) ); const fileNameBuffer = additionalHeader.slice(0, fileNameLength); const extraDataBuffer = new DataView( additionalHeader.slice(fileNameLength, additionalHeader.byteLength) ); const fileName = new TextDecoder().decode(fileNameBuffer).split("\\").join("/"); let fileDataOffset = headerOffset + FILE_NAME_OFFSET + BigInt(fileNameLength + extraFieldLength); const compressionMethod = mainHeader.getUint16(COMPRESSION_METHOD_OFFSET, true); let compressedSize = BigInt(mainHeader.getUint32(COMPRESSED_SIZE_OFFSET, true)); let uncompressedSize = BigInt(mainHeader.getUint32(UNCOMPRESSED_SIZE_OFFSET, true)); let offsetInZip64Data = 4; if (uncompressedSize === BigInt(4294967295)) { uncompressedSize = extraDataBuffer.getBigUint64(offsetInZip64Data, true); offsetInZip64Data += 8; } if (compressedSize === BigInt(4294967295)) { compressedSize = extraDataBuffer.getBigUint64(offsetInZip64Data, true); offsetInZip64Data += 8; } if (fileDataOffset === BigInt(4294967295)) { fileDataOffset = extraDataBuffer.getBigUint64(offsetInZip64Data, true); } return { fileNameLength, fileName, extraFieldLength, fileDataOffset, compressedSize, compressionMethod }; }; function generateLocalHeader(options) { const optionsToUse = { ...options, extraLength: 0, fnlength: options.fileName.length }; let zip64header = new ArrayBuffer(0); const optionsToZip64 = {}; if (optionsToUse.length >= 4294967295) { optionsToZip64.size = optionsToUse.length; optionsToUse.length = 4294967295; } if (Object.keys(optionsToZip64).length) { zip64header = createZip64Info(optionsToZip64); optionsToUse.extraLength = zip64header.byteLength; } const header = new DataView(new ArrayBuffer(Number(FILE_NAME_OFFSET))); for (const field of ZIP_HEADER_FIELDS2) { setFieldToNumber( header, field.size, field.offset, optionsToUse[field.name ?? ""] ?? field.default ?? 0 ); } const encodedName = new TextEncoder().encode(optionsToUse.fileName); const resHeader = concatenateArrayBuffers(header.buffer, encodedName, zip64header); return resHeader; } var ZIP_HEADER_FIELDS2 = [ // Local file header signature = 0x04034b50 { offset: 0, size: 4, default: new DataView(signature3.buffer).getUint32(0, true) }, // Version needed to extract (minimum) { offset: 4, size: 2, default: 45 }, // General purpose bit flag { offset: 6, size: 2, default: 0 }, // Compression method { offset: 8, size: 2, default: 0 }, // File last modification time { offset: 10, size: 2, default: 0 }, // File last modification date { offset: 12, size: 2, default: 0 }, // CRC-32 of uncompressed data { offset: 14, size: 4, name: "crc32" }, // Compressed size (or 0xffffffff for ZIP64) { offset: 18, size: 4, name: "length" }, // Uncompressed size (or 0xffffffff for ZIP64) { offset: 22, size: 4, name: "length" }, // File name length (n) { offset: 26, size: 2, name: "fnlength" }, // Extra field length (m) { offset: 28, size: 2, default: 0, name: "extraLength" } ]; // ../crypto/src/lib/hash.ts var Hash = class { constructor(options = {}) { this.hashBatches = this.hashBatches.bind(this); } async preload() { return; } async *hashBatches(asyncIterator, encoding = "base64") { const arrayBuffers = []; for await (const arrayBuffer of asyncIterator) { arrayBuffers.push(arrayBuffer); yield arrayBuffer; } const output = await this.concatenate(arrayBuffers); const hash = await this.hash(output, encoding); this.options.crypto?.onEnd?.({ hash }); } // HELPERS async concatenate(asyncIterator) { return await concatenateArrayBuffersAsync(asyncIterator); } }; // ../crypto/src/lib/algorithms/crc32.ts var CRC32 = class { crc; constructor() { this.crc = ~0; } update(arrayBuffer) { const CRC32_TABLE = getCRC32Table(); const byteArray = new Uint8Array(arrayBuffer); for (let i = 0; i < byteArray.byteLength; i++) { this.crc = this.crc >>> 8 ^ CRC32_TABLE[(this.crc ^ byteArray[i]) & 255]; } return this; } finalize() { this.crc = (this.crc ^ -1) >>> 0; return this.crc; } }; var CRC32TAB = Uint32Array.of( 0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117 ); function getCRC32Table() { return CRC32TAB; } // ../crypto/src/lib/utils/base64-utils.ts function asciiToBase64(string) { string = `${string}`; for (let i = 0; i < string.length; i++) { if (string.charCodeAt(i) > 255) { return null; } } let out = ""; for (let i = 0; i < string.length; i += 3) { const groupsOfSix = [void 0, void 0, void 0, void 0]; groupsOfSix[0] = string.charCodeAt(i) >> 2; groupsOfSix[1] = (string.charCodeAt(i) & 3) << 4; if (string.length > i + 1) { groupsOfSix[1] |= string.charCodeAt(i + 1) >> 4; groupsOfSix[2] = (string.charCodeAt(i + 1) & 15) << 2; } if (string.length > i + 2) { groupsOfSix[2] |= string.charCodeAt(i + 2) >> 6; groupsOfSix[3] = string.charCodeAt(i + 2) & 63; } for (let j = 0; j < groupsOfSix.length; j++) { if (typeof groupsOfSix[j] === "undefined") { out += "="; } else { out += btoaLookup(groupsOfSix[j]); } } } return out; } function btoaLookup(idx) { if (idx < 26) { return String.fromCharCode(idx + "A".charCodeAt(0)); } if (idx < 52) { return String.fromCharCode(idx - 26 + "a".charCodeAt(0)); } if (idx < 62) { return String.fromCharCode(idx - 52 + "0".charCodeAt(0)); } if (idx === 62) { return "+"; } if (idx === 63) { return "/"; } return void 0; } // ../crypto/src/lib/utils/digest-utils.ts function encodeNumber(number, encoding) { switch (encoding) { case "hex": return convertNumberToHex(number); case "base64": return convertHexToBase64(convertNumberToHex(number)); default: throw new Error(encoding); } } function encodeHex(hex, encoding) { switch (encoding) { case "hex": return hex; case "base64": return convertHexToBase64(hex); default: throw new Error(encoding); } } function convertHexToBase64(hexstring) { if (hexstring.length % 2 !== 0) { hexstring = `0${hexstring}`; } const matches2 = hexstring.match(/\w{2}/g) || []; const string = matches2.map((a) => String.fromCharCode(parseInt(a, 16))).join(""); return asciiToBase64(string) || ""; } function convertNumberToHex(cipher) { const hexString = cipher.toString(16); return hexString === "0" ? `0${hexString}` : hexString; } // ../crypto/src/lib/crc32-hash.ts var CRC32Hash = class extends Hash { name = "crc32"; options; constructor(options = {}) { super(); this.options = { crypto: {}, ...options }; this.hashBatches = this.hashBatches.bind(this); } /** * Atomic hash calculation * @returns base64 encoded hash */ async hash(input, encoding) { return this.hashSync(input, encoding); } hashSync(input, encoding) { const hash = new CRC32(); hash.update(input); const digest = hash.finalize(); return encodeNumber(digest, encoding); } async *hashBatches(asyncIterator, encoding = "base64") { const hash = new CRC32(); for await (const chunk of asyncIterator) { hash.update(chunk); yield chunk; } const digest = hash.finalize(); this.options.crypto?.onEnd?.({ hash: encodeNumber(digest, encoding) }); } }; // ../crypto/src/lib/algorithms/md5-wasm.ts var atb = typeof atob === "function" ? atob : typeof Buffer === "function" ? nodeATOB : identity; var wasmB64 = atb( "AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHCMJaigCACQRQSAjCWooAgAkEkEkIwlqKAIAJBNBKCMJaigCACQUQSwjCWooAgAkFUEwIwlqKAIAJBZBNCMJaigCACQXQTgjCWooAgAkGEE8IwlqKAIAJBkLCgAQBRAGEAcQCAsuAEH4yKq7fSMKahAYQdbunsZ+IwtqEBtB2+GBoQIjDGoQGkHunfeNfCMNahAZCy0AQa+f8Kt/Iw5qEBhBqoyfvAQjD2oQG0GTjMHBeiMQahAaQYGqmmojEWoQGQssAEHYsYLMBiMSahAYQa/vk9p4IxNqEBtBsbd9IxRqEBpBvq/zyngjFWoQGQstAEGiosDcBiMWahAYQZPj4WwjF2oQG0GOh+WzeiMYahAaQaGQ0M0EIxlqEBkLCgAQChALEAwQDQsuAEHiyviwfyMLahAcQcDmgoJ8IxBqEB9B0bT5sgIjFWoQHkGqj9vNfiMKahAdCy0AQd2gvLF9Iw9qEBxB06iQEiMUahAfQYHNh8V9IxlqEB5ByPfPvn4jDmoQHQsuAEHmm4ePAiMTahAcQdaP3Jl8IxhqEB9Bh5vUpn8jDWoQHkHtqeiqBCMSahAdCy0AQYXSj896IxdqEBxB+Me+ZyMMahAfQdmFvLsGIxFqEB5Bipmp6XgjFmoQHQsKABAPEBAQERASCysAQcLyaCMPahAgQYHtx7t4IxJqECNBosL17AYjFWoQIkGM8JRvIxhqECELLgBBxNT7pXojC2oQIEGpn/veBCMOahAjQeCW7bV/IxFqECJB8Pj+9XsjFGoQIQstAEHG/e3EAiMXahAgQfrPhNV+IwpqECNBheG8p30jDWoQIkGFuqAkIxBqECELLgBBuaDTzn0jE2oQIEHls+62fiMWahAjQfj5if0BIxlqECJB5ayxpXwjDGoQIQsKABAUEBUQFhAXCy0AQcTEpKF/IwpqECRBl/+rmQQjEWoQJ0Gnx9DceiMYahAmQbnAzmQjD2oQJQstAEHDs+2qBiMWahAkQZKZs/h4Iw1qECdB/ei/fyMUahAmQdG7kax4IwtqECULLQBBz/yh/QYjEmoQJEHgzbNxIxlqECdBlIaFmHojEGoQJkGho6DwBCMXahAlCy4AQYL9zbp/Iw5qECRBteTr6XsjFWoQJ0G7pd/WAiMMahAmQZGnm9x+IxNqECULKAEBf0F/IwFzIwNxIwEjAnFyIwBqIABqIgFBB3QgAUEZdnIjAWokAAsoAQF/QX8jAnMjAHEjAiMDcXIjAWogAGoiAUEWdCABQQp2ciMCaiQBCygBAX9BfyMDcyMBcSMDIwBxciMCaiAAaiIBQRF0IAFBD3ZyIwNqJAILKAEBf0F/IwBzIwJxIwAjAXFyIwNqIABqIgFBDHQgAUEUdnIjAGokAwsoAQF/IwJBfyMDc3EjASMDcXIjAGogAGoiAUEFdCABQRt2ciMBaiQACygBAX8jA0F/IwBzcSMCIwBxciMBaiAAaiIBQRR0IAFBDHZyIwJqJAELKAEBfyMAQX8jAXNxIwMjAXFyIwJqIABqIgFBDnQgAUESdnIjA2okAgsoAQF/IwFBfyMCc3EjACMCcXIjA2ogAGoiAUEJdCABQRd2ciMAaiQDCyIBAX8jASMCcyMDcyMAaiAAaiIBQQR0IAFBHHZyIwFqJAALIgEBfyMCIwNzIwBzIwFqIABqIgFBF3QgAUEJdnIjAmokAQsiAQF/IwMjAHMjAXMjAmogAGoiAUEQdCABQRB2ciMDaiQCCyIBAX8jACMBcyMCcyMDaiAAaiIBQQt0IAFBFXZyIwBqJAMLJQEBf0F/IwNzIwFyIwJzIwBqIABqIgFBBnQgAUEadnIjAWokAAslAQF/QX8jAHMjAnIjA3MjAWogAGoiAUEVdCABQQt2ciMCaiQBCyUBAX9BfyMBcyMDciMAcyMCaiAAaiIBQQ90IAFBEXZyIwNqJAILJQEBf0F/IwJzIwByIwFzIwNqIABqIgFBCnQgAUEWdnIjAGokAwsEACMACwQAIwELBAAjAgsEACMDCwQAIxoLBgAgACQACwYAIAAkAQsGACAAJAILBgAgACQDCwYAIAAkGgsA6gQEbmFtZQGSAzIAA2xvZwEFbG9vcHMCBGxvb3ADBXByaW1lBAVsb29wQQUGbG9vcEExBgZsb29wQTIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA=" ); var wasm = WebAssembly && atb !== identity ? str2AB(wasmB64).buffer : false; var crypt = makeCrypt(); var biteSize = 240 * 16 * 16; var bounder = Math.floor(biteSize * 16 * 1.066666667); var upperLimit = 268435456 - 65536; var parmTypeErrStr = "Parameter must be Buffer, ArrayBuffer or Uint8Array"; var tooBigErrStr = "Parameter exceeds max size of 255.9 Mbytes"; if (!wasm) { console.log( "WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript" ); } function md5WASM(data) { var mem, memView, importObj, imports, len, buff, thenFun, catchFun, result, endTime; const md5JS = makeMD5JS(), md5WA = makeMD5WA(), returnObj = {}, startTime = new Date().getTime(); returnObj["then"] = function(fun) { thenFun = fun; getThen(); return returnObj; }; returnObj["catch"] = function(fun) { catchFun = fun; return returnObj; }; if (true) { if (data && typeof data === "object") { if (typeof Buffer === "function" && data.constructor === Buffer) { buff = data; } else { if (data.constructor === Uint8Array || data.constructor === ArrayBuffer) { buff = data.constructor === ArrayBuffer ? new Uint8Array(data) : data; } else { getCatch(new TypeError(parmTypeErrStr)); } } } else { getCatch(new TypeError(parmTypeErrStr)); } } if (buff) { len = buff.length; if (wasm && len > bounder) { if (len > upperLimit) { getCatch(new Error(tooBigErrStr)); } else { mem = new WebAssembly.Memory({ initial: len > 32e6 ? len > 64e6 ? len > 128e6 ? 4096 : 2048 : 1024 : 512 }); memView = new Uint32Array(mem.buffer); imports = { mem, log: console.log }; importObj = { imports }; WebAssembly.instantiate(wasm, importObj).then(giterdone); } } else { getThen(md5JS(buff)); } } return returnObj; function giterdone(obj) { getThen(md5WA(buff, obj.instance.exports, memView)); } function getThen(r) { var res = Boolean(r) ? r : result; if (Boolean(r)) { endTime = new Date().getTime(); } if (typeof thenFun === "function") { if (Boolean(res)) { thenFun(res, endTime - startTime); thenFun = catchFun = null; } } else { if (Boolean(r)) { result = r; } } } function getCatch(err) { if (typeof catchFun === "function") { catchFun(err); } } } function makeMD5WA() { var loop, loops; var getA, setA, getB, setB, getC, setC, getD, setD, getX, setX, memView; var md5WA = function(message) { var m00, m01, m02, m03, m04, m05, m06, m07, m08, m09, m10, m11, m12, m13, m14, m15, aa, bb, cc, dd, m, k; var qwerty = new Date().getTime(); var md5Used = 0; var a = 1732584193, b = -271733879, c = -1732584194, d = 271733878, i = 0, l = message.length * 8, len; len = bytesToWordsNewer(message, memView); memView[l >>> 5] |= 128 << l % 32; memView[(l + 64 >>> 9 << 4) + 14] = l; len = (l + 64 >>> 9 << 4) + 15; m = memView; while (i < len) { if (len > i + bounder) { setA(a); setB(b); setC(c); setD(d); loops(biteSize); i = i + biteSize * 16; a = getA(); b = getB(); c = getC(); d = getD(); md5Used++; } else { aa = a; bb = b; cc = c; dd = d; m00 = m[i + 0] >>> 0; m01 = m[i + 1] >>> 0; m02 = m[i + 2] >>> 0; m03 = m[i + 3] >>> 0; m04 = m[i + 4] >>> 0; m05 = m[i + 5] >>> 0; m06 = m[i + 6] >>> 0; m07 = m[i + 7] >>> 0; m08 = m[i + 8] >>> 0; m09 = m[i + 9] >>> 0; m10 = m[i + 10] >>> 0; m11 = m[i + 11] >>> 0; m12 = m[i + 12] >>> 0; m13 = m[i + 13] >>> 0; m14 = m[i + 14] >>> 0; m15 = m[i + 15] >>> 0; a = ____(7, 25, a + (b & c | ~b & d) + m00 - 680876936) + b; d = ____(12, 20, d + (a & b | ~a & c) + m01 - 389564586) + a; c = ____(17, 15, c + (d & a | ~d & b) + m02 + 606105819) + d; b = ____(22, 10, b + (c & d | ~c & a) + m03 - 1044525330) + c; a = ____(7, 25, a + (b & c | ~b & d) + m04 - 176418897) + b; d = ____(12, 20, d + (a & b | ~a & c) + m05 + 1200080426) + a; c = ____(17, 15, c + (d & a | ~d & b) + m06 - 1473231341) + d; b = ____(22, 10, b + (c & d | ~c & a) + m07 - 45705983) + c; a = ____(7, 25, a + (b & c | ~b & d) + m08 + 1770035416) + b; d = ____(12, 20, d + (a & b | ~a & c) + m09 - 1958414417) + a; c = ____(17, 15, c + (d & a | ~d & b) + m10 - 42063) + d; b = ____(22, 10, b + (c & d | ~c & a) + m11 - 1990404162) + c; a = ____(7, 25, a + (b & c | ~b & d) + m12 + 1804603682) + b; d = ____(12, 20, d + (a & b | ~a & c) + m13 - 40341101) + a; c = ____(17, 15, c + (d & a | ~d & b) + m14 - 1502002290) + d; b = ____(22, 10, b + (c & d | ~c & a) + m15 + 1236535329) + c; a = ____(5, 27, a + (b & d | c & ~d) + m01 - 165796510) + b; d = ____(9, 23, d + (a & c | b & ~c) + m06 - 1069501632) + a; c = ____(14, 18, c + (d & b | a & ~b) + m11 + 643717713) + d; b = ____(20, 12, b + (c & a | d & ~a) + m00 - 373897302) + c; a = ____(5, 27, a + (b & d | c & ~d) + m05 - 701558691) + b; d = ____(9, 23, d + (a & c | b & ~c) + m10 + 38016083) + a; c = ____(14, 18, c + (d & b | a & ~b) + m15 - 660478335) + d; b = ____(20, 12, b + (c & a | d & ~a) + m04 - 405537848) + c; a = ____(5, 27, a + (b & d | c & ~d) + m09 + 568446438) + b; d = ____(9, 23, d + (a & c | b & ~c) + m14 - 1019803690) + a; c = ____(14, 18, c + (d & b | a & ~b) + m03 - 187363961) + d; b = ____(20, 12, b + (c & a | d & ~a) + m08 + 1163531501) + c; a = ____(5, 27, a + (b & d | c & ~d) + m13 - 1444681467) + b; d = ____(9, 23, d + (a & c | b & ~c) + m02 - 51403784) + a; c = ____(14, 18, c + (d & b | a & ~b) + m07 + 1735328473) + d; b = ____(20, 12, b + (c & a | d & ~a) + m12 - 1926607734) + c; a = ____(4, 28, a + (b ^ c ^ d) + m05 - 378558) + b; d = ____(11, 21, d + (a ^ b ^ c) + m08 - 2022574463) + a; c = ____(16, 16, c + (d ^ a ^ b) + m11 + 1839030562) + d; b = ____(23, 9, b + (c ^ d ^ a) + m14 - 35309556) + c; a = ____(4, 28, a + (b ^ c ^ d) + m01 - 1530992060) + b; d = ____(11, 21, d + (a ^ b ^ c) + m04 + 1272893353) + a; c = ____(16, 16, c + (d ^ a ^ b) + m07 - 155497632) + d; b = ____(23, 9, b + (c ^ d ^ a) + m10 - 1094730640) + c; a = ____(4, 28, a + (b ^ c ^ d) + m13 + 681279174) + b; d = ____(11, 21, d + (a ^ b ^ c) + m00 - 358537222) + a; c = ____(16, 16, c + (d ^ a ^ b) + m03 - 722521979) + d; b = ____(23, 9, b + (c ^ d ^ a) + m06 + 76029189) + c; a = ____(4, 28, a + (b ^ c ^ d) + m09 - 640364487) + b; d = ____(11, 21, d + (a ^ b ^ c) + m12 - 421815835) + a; c = ____(16, 16, c + (d ^ a ^ b) + m15 + 530742520) + d; b = ____(23, 9, b + (c ^ d ^ a) + m02 - 995338651) + c; a = ____(6, 26, a + (c ^ (b | ~d)) + m00 - 198630844) + b; d = ____(10, 22, d + (b ^ (a | ~c)) + m07 + 1126891415) + a; c = ____(15, 17, c + (a ^ (d | ~b)) + m14 - 1416354905) + d; b = ____(21, 11, b + (d ^ (c | ~a)) + m05 - 57434055) + c; a = ____(6, 26, a + (c ^ (b | ~d)) + m12 + 1700485571) + b; d = ____(10, 22, d + (b ^ (a | ~c)) + m03 - 1894986606) + a; c = ____(15, 17, c + (a ^ (d | ~b)) + m10 - 1051523) + d; b = ____(21, 11, b + (d ^ (c | ~a)) + m01 - 2054922799) + c; a = ____(6, 26, a + (c ^ (b | ~d)) + m08 + 1873313359) + b; d = ____(10, 22, d + (b ^ (a | ~c)) + m15 - 30611744) + a; c = ____(15, 17, c + (a ^ (d | ~b)) + m06 - 1560198380) + d; b = ____(21, 11, b + (d ^ (c | ~a)) + m13 + 1309151649) + c; a = ____(6, 26, a + (c ^ (b | ~d)) + m04 - 145523070) + b; d = ____(10, 22, d + (b ^ (a | ~c)) + m11 - 1120210379) + a; c = ____(15, 17, c + (a ^ (d | ~b)) + m02 + 718787259) + d; b = ____(21, 11, b + (d ^ (c | ~a)) + m09 - 343485551) + c; i = i + 16; a = a + aa >>> 0; b = b + bb >>> 0; c = c + cc >>> 0; d = d + dd >>> 0; } } return crypt.endian([a, b, c, d]); function ____(s, t, n) { return n << s | n >>> t; } function bytesToWordsNewer(bytes, words) { var i2 = -1, l2 = Math.floor((bytes.length - 1) / 4), j = 0, b0, b1, b2, b3; while (l2 - 8 > i2++) { j = i2 << 2; words[i2] = bytes[j + 0] | bytes[j + 1] << 8 | bytes[j + 2] << 16 | bytes[j + 3] << 24; } i2--; while (l2 > i2++) { j = i2 << 2; b0 = typeof bytes[j + 0] === "undefined" ? 0 : bytes[j + 0]; b1 = typeof bytes[j + 1] === "undefined" ? 0 : bytes[j + 1]; b2 = typeof bytes[j + 2] === "undefined" ? 0 : bytes[j + 2]; b3 = typeof bytes[j + 3] === "undefined" ? 0 : bytes[j + 3]; words[i2] = b0 | b1 << 8 | b2 << 16 | b3 << 24; } return l2 + 1; } }; return function(message, exports, mView, options) { var digestbytes; loops = exports.loops; loop = exports.loop; getA = exports.getA; getB = exports.getB; getC = exports.getC; getD = exports.getD; getX = exports.getX; setA = exports.setA; setB = exports.setB; setC = exports.setC; setD = exports.setD; setX = exports.setX; memView = mView; digestbytes = crypt.wordsToBytes(md5WA(message)); return options && options.asBytes ? digestbytes : crypt.bytesconvertNumberToHex(digestbytes); }; } function makeMD5JS() { var md5JS = function(message, options) { var m00, m01, m02, m03, m04, m05, m06, m07, m08, m09, m10, m11, m12, m13, m14, m15, aa, bb, cc, dd, m; var qwerty = new Date().getTime(); var a = 1732584193, b = -271733879, c = -1732584194, d = 271733878, l = message.length * 8; m = crypt.bytesToWords(message); for (var j = 0; j < m.length; j++) { m[j] = (m[j] << 8 | m[j] >>> 24) & 16711935 | (m[j] << 24 | m[j] >>> 8) & 4278255360; } m[l >>> 5] |= 128 << l % 32; m[(l + 64 >>> 9 << 4) + 14] = l; for (var i = 0; i < m.length; i += 16) { aa = a; bb = b; cc = c; dd = d; m00 = m[i + 0] >>> 0; m01 = m[i + 1] >>> 0; m02 = m[i + 2] >>> 0; m03 = m[i + 3] >>> 0; m04 = m[i + 4] >>> 0; m05 = m[i + 5] >>> 0; m06 = m[i + 6] >>> 0; m07 = m[i + 7] >>> 0; m08 = m[i + 8] >>> 0; m09 = m[i + 9] >>> 0; m10 = m[i + 10] >>> 0; m11 = m[i + 11] >>> 0; m12 = m[i + 12] >>> 0; m13 = m[i + 13] >>> 0; m14 = m[i + 14] >>> 0; m15 = m[i + 15] >>> 0; a = ____(7, 25, a + (b & c | ~b & d) + m00 - 680876936) + b; d = ____(12, 20, d + (a & b | ~a & c) + m01 - 389564586) + a; c = ____(17, 15, c + (d & a | ~d & b) + m02 + 606105819) + d; b = ____(22, 10, b + (c & d | ~c & a) + m03 - 1044525330) + c; a = ____(7, 25, a + (b & c | ~b & d) + m04 - 176418897) + b; d = ____(12, 20, d + (a & b | ~a & c) + m05 + 1200080426) + a; c = ____(17, 15, c + (d & a | ~d & b) + m06 - 1473231341) + d; b = ____(22, 10, b + (c & d | ~c & a) + m07 - 45705983) + c; a = ____(7, 25, a + (b & c | ~b & d) + m08 + 1770035416) + b; d = ____(12, 20, d + (a & b | ~a & c) + m09 - 1958414417) + a; c = ____(17, 15, c + (d & a | ~d & b) + m10 - 42063) + d; b = ____(22, 10, b + (c & d | ~c & a) + m11 - 1990404162) + c; a = ____(7, 25, a + (b & c | ~b & d) + m12 + 1804603682) + b; d = ____(12, 20, d + (a & b | ~a & c) + m13 - 40341101) + a; c = ____(17, 15, c + (d & a | ~d & b) + m14 - 1502002290) + d; b = ____(22, 10, b + (c & d | ~c & a) + m15 + 1236535329) + c; a = ____(5, 27, a + (b & d | c & ~d) + m01 - 165796510) + b; d = ____(9, 23, d + (a & c | b & ~c) + m06 - 1069501632) + a; c = ____(14, 18, c + (d & b | a & ~b) + m11 + 643717713) + d; b = ____(20, 12, b + (c & a | d & ~a) + m00 - 373897302) + c; a = ____(5, 27, a + (b & d | c & ~d) + m05 - 701558691) + b; d = ____(9, 23, d + (a & c | b & ~c) + m10 + 38016083) + a; c = ____(14, 18, c + (d & b | a & ~b) + m15 - 660478335) + d; b = ____(20, 12, b + (c & a | d & ~a) + m04 - 405537848) + c; a = ____(5, 27, a + (b & d | c & ~d) + m09 + 568446438) + b; d = ____(9, 23, d + (a & c | b & ~c) + m14 - 1019803690) + a; c = ____(14, 18, c + (d & b | a & ~b) + m03 - 187363961) + d; b = ____(20, 12, b + (c & a | d & ~a) + m08 + 1163531501) + c; a = ____(5, 27, a + (b & d | c & ~d) + m13 - 1444681467) + b; d = ____(9, 23, d + (a & c | b & ~c) + m02 - 51403784) + a; c = ____(14, 18, c + (d & b | a & ~b) + m07 + 1735328473) + d; b = ____(20, 12, b + (c & a | d & ~a) + m12 - 1926607734) + c; a = ____(4, 28, a + (b ^ c ^ d) + m05 - 378558) + b; d = ____(11, 21, d + (a ^ b ^ c) + m08 - 2022574463) + a; c = ____(16, 16, c + (d ^ a ^ b) + m11 + 1839030562) + d; b = ____(23, 9, b + (c ^ d ^ a) + m14 - 35309556) + c; a = ____(4, 28, a + (b ^ c ^ d) + m01 - 1530992060) + b; d = ____(11, 21, d + (a ^ b ^ c) + m04 + 1272893353) + a; c = ____(16, 16, c + (d ^ a ^ b) + m07 - 155497632) + d; b = ____(23, 9, b + (c ^ d ^ a) + m10 - 1094730640) + c; a = ____(4, 28, a + (b ^ c ^ d) + m13 + 681279174) + b; d = ____(11, 21, d + (a ^ b ^ c) + m00 - 358537222) + a; c = ____(16, 16, c + (d ^ a ^ b) + m03 - 722521979) + d; b = ____(23, 9, b + (c ^ d ^ a) + m06 + 76029189) + c; a = ____(4, 28, a + (b ^ c ^ d) + m09 - 640364487) + b; d = ____(11, 21, d + (a ^ b ^ c) + m12 - 421815835) + a; c = ____(16, 16, c + (d ^ a ^ b) + m15 + 530742520) + d; b = ____(23, 9, b + (c ^ d ^ a) + m02 - 995338651) + c; a = ____(6, 26, a + (c ^ (b | ~d)) + m00 - 198630844) + b; d = ____(10, 22, d + (b ^ (a | ~c)) + m07 + 1126891415) + a; c = ____(15, 17, c + (a ^ (d | ~b)) + m14 - 1416354905) + d; b = ____(21, 11, b + (d ^ (c | ~a)) + m05 - 57434055) + c; a = ____(6, 26, a + (c ^ (b | ~d)) + m12 + 1700485571) + b; d = ____(10, 22, d + (b ^ (a | ~c)) + m03 - 1894986606) + a; c = ____(15, 17, c + (a ^ (d | ~b)) + m10 - 1051523) + d; b = ____(21, 11, b + (d ^ (c | ~a)) + m01 - 2054922799) + c; a = ____(6, 26, a + (c ^ (b | ~d)) + m08 + 1873313359) + b; d = ____(10, 22, d + (b ^ (a | ~c)) + m15 - 30611744) + a; c = ____(15, 17, c + (a ^ (d | ~b)) + m06 - 1560198380) + d; b = ____(21, 11, b + (d ^ (c | ~a)) + m13 + 1309151649) + c; a = ____(6, 26, a + (c ^ (b | ~d)) + m04 - 145523070) + b; d = ____(10, 22, d + (b ^ (a | ~c)) + m11 - 1120210379) + a; c = ____(15, 17, c + (a ^ (d | ~b)) + m02 + 718787259) + d; b = ____(21, 11, b + (d ^ (c | ~a)) + m09 - 343485551) + c; a = a + aa >>> 0; b = b + bb >>> 0; c = c + cc >>> 0; d = d + dd >>> 0; } return crypt.endian([a, b, c, d]); function ____(s, t, n) { return n << s | n >>> t; } }; return function(message, options) { var digestbytes = crypt.wordsToBytes(md5JS(message, options)), result = options && options.asBytes ? digestbytes : crypt.bytesconvertNumberToHex(digestbytes); return result; }; } function str2AB(str) { var l, buff, buffView, i = -1; l = str.length - 1; buff = new ArrayBuffer(str.length); buffView = new Uint8Array(buff); while (l > i++) { buffView[i] = str.charCodeAt(i); } return buffView; } function nodeATOB(str) { return Buffer.from(str, "base64").toString("binary"); } function identity(x) { return x; } function makeCrypt() { var base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; return { rotl: function(n, b) { return n << b | n >>> 32 - b; }, endian: function(n) { if (n.constructor == Number) { return crypt.rotl(n, 8) & 16711935 | crypt.rotl(n, 24) & 4278255360; } for (var i = 0; i < n.length; i++) n[i] = crypt.endian(n[i]); return n; }, bytesToWords: function(bytes) { for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) words[b >>> 5] |= bytes[i] << 24 - b % 32; return words; }, wordsToBytes: function(words) { for (var bytes = [], b = 0; b < words.length * 32; b += 8) bytes.push(words[b >>> 5] >>> 24 - b % 32 & 255); return bytes; }, bytesconvertNumberToHex: function(bytes) { for (var hex = [], i = 0; i < bytes.length; i++) { hex.push((bytes[i] >>> 4).toString(16)); hex.push((bytes[i] & 15).toString(16)); } return hex.join(""); } }; } // ../crypto/src/lib/md5-hash.ts var MD5Hash = class extends Hash { name = "md5"; options; constructor(options = {}) { super(); this.options = options; } /** * Atomic hash calculation * @returns base64 encoded hash */ async hash(input, encoding) { const md5Promise = new Promise( (resolve2, reject) => ( // @ts-expect-error md5WASM(input).then(resolve2).catch(reject) ) ); const hex = await md5Promise; return encodeHex(hex, encoding); } }; // src/parse-zip/zip-composition.ts var import_core = __toESM(require_core(), 1); async function cutTheTailOff(provider) { const oldEoCDinfo = await parseEoCDRecord(provider); const oldCDStartOffset = oldEoCDinfo.cdStartOffset; const oldCDLength = Number( oldEoCDinfo.offsets.zip64EoCDOffset ? oldEoCDinfo.offsets.zip64EoCDOffset - oldCDStartOffset : oldEoCDinfo.offsets.zipEoCDOffset - oldCDStartOffset ); const zipEnding = await provider.slice(oldCDStartOffset, provider.length); await provider.truncate(Number(oldCDStartOffset)); const oldCDBody = zipEnding.slice(0, oldCDLength); const eocdBody = zipEnding.slice(oldCDLength, zipEnding.byteLength); return [oldCDBody, eocdBody, oldEoCDinfo]; } async function generateFileHeaders(fileName, fileToAdd, localFileHeaderOffset) { const newFileCRC322 = parseInt(await new CRC32Hash().hash(fileToAdd, "hex"), 16); const newFileLocalHeader = generateLocalHeader({ crc32: newFileCRC322, fileName, length: fileToAdd.byteLength }); const newFileCDHeader = generateCDHeader({ crc32: newFileCRC322, fileName, offset: localFileHeaderOffset, length: fileToAdd.byteLength }); return [ new Uint8Array(concatenateArrayBuffers(newFileLocalHeader, fileToAdd)), new Uint8Array(newFileCDHeader) ]; } async function addOneFile(zipUrl, fileToAdd, fileName) { const provider = new FileHandleFile(zipUrl, true); const [oldCDBody, eocdBody, oldEoCDinfo] = await cutTheTailOff(provider); const newFileOffset = provider.length; const [localPart, cdHeaderPart] = await generateFileHeaders(fileName, fileToAdd, newFileOffset); await provider.append(localPart); const newCDBody = concatenateArrayBuffers(oldCDBody, cdHeaderPart); const newCDStartOffset = provider.length; await provider.append(new Uint8Array(newCDBody)); const eocdOffset = provider.length; await provider.append( updateEoCD( eocdBody, oldEoCDinfo.offsets, newCDStartOffset, eocdOffset, oldEoCDinfo.cdRecordsNumber + 1n ) ); } async function createZip(inputPath, outputPath, createAdditionalData) { const fileIterator = getFileIterator(inputPath); const resFile = new NodeFileFacade(outputPath, "w"); const fileList = []; const cdArray = []; for await (const file of fileIterator) { await addFile(file, resFile, cdArray, fileList); } if (createAdditionalData) { const additionaldata = await createAdditionalData(fileList); await addFile(additionaldata, resFile, cdArray); } const cdOffset = (await resFile.stat()).bigsize; const cd = concatenateArrayBuffers(...cdArray); await resFile.append(new Uint8Array(cd)); const eoCDStart = (await resFile.stat()).bigsize; await resFile.append( new Uint8Array( generateEoCD({ recordsNumber: cdArray.length, cdSize: cd.byteLength, cdOffset, eoCDStart }) ) ); } async function addFile(file, resFile, cdArray, fileList) { const size = (await resFile.stat()).bigsize; fileList?.push({ fileName: file.path, localHeaderOffset: size }); const [localPart, cdHeaderPart] = await generateFileHeaders(file.path, file.file, size); await resFile.append(localPart); cdArray.push(cdHeaderPart); } function getFileIterator(inputPath) { async function* iterable() { const fileList = await getAllFiles(inputPath); for (const filePath of fileList) { const file = await (await (0, import_core.fetchFile)(path_exports.join(inputPath, filePath))).arrayBuffer(); yield { path: filePath, file }; } } return iterable(); } async function getAllFiles(basePath, subfolder = "", fsPassed) { const fs = fsPassed ? fsPassed : new NodeFileSystemFacade({}); const files = await fs.readdir(pathJoin(basePath, subfolder)); const arrayOfFiles = []; for (const file of files) { const fullPath = pathJoin(basePath, subfolder, file); if ((await fs.stat(fullPath)).isDirectory) { const files2 = await getAllFiles(basePath, pathJoin(subfolder, file)); arrayOfFiles.push(...files2); } else { arrayOfFiles.push(pathJoin(subfolder, file)); } } return arrayOfFiles; } function pathJoin(...paths) { const resPaths = paths.filter((val) => val.length); return path_exports.join(...resPaths); } // ../compression/src/lib/compression.ts var Compression = class { constructor(options) { this.compressBatches = this.compressBatches.bind(this); this.decompressBatches = this.decompressBatches.bind(this); } /** Preloads any dynamic libraries. May enable sync functions */ async preload(modules = {}) { registerJSModules(modules); return; } /** Asynchronously compress data */ async compress(input) { await this.preload(); return this.compressSync(input); } /** Asynchronously decompress data */ async decompress(input, size) { await this.preload(); return this.decompressSync(input, size); } /** Synchronously compress data */ compressSync(input) { throw new Error(`${this.name}: sync compression not supported`); } /** Synchronously compress data */ decompressSync(input, size) { throw new Error(`${this.name}: sync decompression not supported`); } /** Compress batches */ async *compressBatches(asyncIterator) { const input = await this.concatenate(asyncIterator); yield this.compress(input); } /** Decompress batches */ async *decompressBatches(asyncIterator) { const input = await this.concatenate(asyncIterator); yield this.decompress(input); } // HELPERS concatenate(asyncIterator) { return concatenateArrayBuffersAsync(asyncIterator); } improveError(error) { if (!error.message.includes(this.name)) { error.message = `${this.name} ${error.message}`; } return error; } }; // ../compression/src/lib/deflate-compression.ts var import_pako = __toESM(require_pako(), 1); var import_zlib = __toESM(require_zlib(), 1); var DeflateCompression = class extends Compression { name = "deflate"; extensions = []; contentEncodings = ["deflate"]; isSupported = true; options; _chunks = []; constructor(options = {}) { super(options); this.options = options; } async compress(input) { if (!isBrowser && this.options.deflate?.useZlib) { const buffer = this.options.deflate?.gzip ? await promisify1(import_zlib.default.gzip)(input) : await promisify1(import_zlib.default.deflate)(input); return toArrayBuffer2(buffer); } return this.compressSync(input); } async decompress(input) { if (!isBrowser && this.options.deflate?.useZlib) { const buffer = this.options.deflate?.gzip ? await promisify1(import_zlib.default.gunzip)(input) : await promisify1(import_zlib.default.inflate)(input); return toArrayBuffer2(buffer); } return this.decompressSync(input); } compressSync(input) { if (!isBrowser && this.options.deflate?.useZlib) { const buffer = this.options.deflate?.gzip ? import_zlib.default.gzipSync(input) : import_zlib.default.deflateSync(input); return toArrayBuffer2(buffer); } const pakoOptions = this.options?.deflate || {}; const inputArray = new Uint8Array(input); const deflate = this.options?.raw ? import_pako.default.deflateRaw : import_pako.default.deflate; return deflate(inputArray, pakoOptions).buffer; } decompressSync(input) { if (!isBrowser && this.options.deflate?.useZlib) { const buffer = this.options.deflate?.gzip ? import_zlib.default.gunzipSync(input) : import_zlib.default.inflateSync(input); return toArrayBuffer2(buffer); } const pakoOptions = this.options?.deflate || {}; const inputArray = new Uint8Array(input); const inflate = this.options?.raw ? import_pako.default.inflateRaw : import_pako.default.inflate; return inflate(inputArray, pakoOptions).buffer; } async *compressBatches(asyncIterator) { const pakoOptions = this.options?.deflate || {}; const pakoProcessor = new import_pako.default.Deflate(pakoOptions); yield* this.transformBatches(pakoProcessor, asyncIterator); } async *decompressBatches(asyncIterator) { const pakoOptions = this.options?.deflate || {}; const pakoProcessor = new import_pako.default.Inflate(pakoOptions); yield* this.transformBatches(pakoProcessor, asyncIterator); } async *transformBatches(pakoProcessor, asyncIterator) { pakoProcessor.onData = this._onData.bind(this); pakoProcessor.onEnd = this._onEnd.bind(this); for await (const chunk of asyncIterator) { const uint8Array = new Uint8Array(chunk); const ok2 = pakoProcessor.push(uint8Array, false); if (!ok2) { throw new Error(`${this._getError()}write`); } const chunks2 = this._getChunks(); yield* chunks2; } const emptyChunk = new Uint8Array(0); const ok = pakoProcessor.push(emptyChunk, true); if (!ok) { } const chunks = this._getChunks(); yield* chunks; } _onData(chunk) { this._chunks.push(chunk); } _onEnd(status) { if (status !== 0) { throw new Error(this._getError(status) + this._chunks.length); } } _getChunks() { const chunks = this._chunks; this._chunks = []; return chunks; } // TODO - For some reason we don't get the error message from pako in _onEnd? _getError(code = 0) { const MESSAGES = { /* Z_NEED_DICT 2 */ 2: "need dictionary", /* Z_STREAM_END 1 */ 1: "stream end", /* Z_OK 0 */ 0: "", /* Z_ERRNO (-1) */ "-1": "file error", /* Z_STREAM_ERROR (-2) */ "-2": "stream error", /* Z_DATA_ERROR (-3) */ "-3": "data error", /* Z_MEM_ERROR (-4) */ "-4": "insufficient memory", /* Z_BUF_ERROR (-5) */ "-5": "buffer error", /* Z_VERSION_ERROR (-6) */ "-6": "incompatible version" }; return `${this.name}: ${MESSAGES[code]}`; } }; // src/filesystems/zip-filesystem.ts var ZIP_COMPRESSION_HANDLERS = { /** No compression */ 0: async (compressedFile) => compressedFile, /** Deflation */ 8: async (compressedFile) => { const compression = new DeflateCompression({ raw: true }); const decompressedData = await compression.decompress(compressedFile); return decompressedData; } }; var ZipFileSystem = class { /** FileProvider instance promise */ fileProvider = null; fileName; archive = null; /** * Constructor * @param file - instance of FileProvider or file path string */ constructor(file) { if (typeof file === "string") { this.fileName = file; if (!isBrowser) { this.fileProvider = new FileHandleFile(file); } else { throw new Error("Cannot open file for random access in a WEB browser"); } } else if (file instanceof IndexedArchive) { this.fileProvider = file.fileProvider; this.archive = file; this.fileName = file.fileName; } else if (isFileProvider(file)) { this.fileProvider = file; } } /** Clean up resources */ async destroy() { if (this.fileProvider) { await this.fileProvider.destroy(); } } /** * Get file names list from zip archive * @returns array of file names */ async readdir() { if (!this.fileProvider) { throw new Error("No data detected in the zip archive"); } const fileNames = []; const zipCDIterator = makeZipCDHeaderIterator(this.fileProvider); for await (const cdHeader of zipCDIterator) { fileNames.push(cdHeader.fileName); } return fileNames; } /** * Get file metadata * @param filename - name of a file * @returns central directory data */ async stat(filename2) { const cdFileHeader = await this.getCDFileHeader(filename2); return { ...cdFileHeader, size: Number(cdFileHeader.uncompressedSize) }; } /** * Implementation of fetch against this file system * @param filename - name of a file * @returns - Response with file data */ async fetch(filename2) { if (this.fileName && filename2.indexOf(this.fileName) === 0) { filename2 = filename2.substring(this.fileName.length + 1); } let uncompressedFile; if (this.archive) { uncompressedFile = await this.archive.getFile(filename2, "http"); } else { if (!this.fileProvider) { throw new Error("No data detected in the zip archive"); } const cdFileHeader = await this.getCDFileHeader(filename2); const localFileHeader = await parseZipLocalFileHeader( cdFileHeader.localHeaderOffset, this.fileProvider ); if (!localFileHeader) { throw new Error("Local file header has not been found in the zip archive`"); } const compressionHandler = ZIP_COMPRESSION_HANDLERS[localFileHeader.compressionMethod.toString()]; if (!compressionHandler) { throw Error("Only Deflation compression is supported"); } const compressedFile = await this.fileProvider.slice( localFileHeader.fileDataOffset, localFileHeader.fileDataOffset + localFileHeader.compressedSize ); uncompressedFile = await compressionHandler(compressedFile); } const response = new Response(uncompressedFile); Object.defineProperty(response, "url", { value: filename2 ? `${this.fileName || ""}/${filename2}` : this.fileName || "" }); return response; } /** * Get central directory file header * @param filename - name of a file * @returns central directory file header */ async getCDFileHeader(filename2) { if (!this.fileProvider) { throw new Error("No data detected in the zip archive"); } const zipCDIterator = makeZipCDHeaderIterator(this.fileProvider); let result = null; for await (const cdHeader of zipCDIterator) { if (cdHeader.fileName === filename2) { result = cdHeader; break; } } if (!result) { throw new Error("File has not been found in the zip archive"); } return result; } }; // src/filesystems/IndexedArchive.ts var IndexedArchive = class { fileProvider; fileName; /** * Constructor * @param fileProvider - instance of a binary data reader * @param hashTable - pre-loaded hashTable. If presented, getFile will skip reading the hash file * @param fileName - name of the archive. It is used to add to an URL of a loader context */ constructor(fileProvider, hashTable, fileName) { this.fileProvider = fileProvider; this.fileName = fileName; } /** * Get file as from order ZIP arhive without using the hash file * @param filename - path to the internal file * @returns */ async getFileWithoutHash(filename2) { const zipFS = new ZipFileSystem(this.fileProvider); const response = await zipFS.fetch(filename2); return await response.arrayBuffer(); } }; // src/hash-file-utility.ts function parseHashTable(arrayBuffer) { const dataView = new DataView(arrayBuffer); const hashMap = {}; for (let i = 0; i < arrayBuffer.byteLength; i = i + 24) { const offset = dataView.getBigUint64(i + 16, true); const hash = bufferToHex(arrayBuffer, i, 16); hashMap[hash] = offset; } return hashMap; } function bufferToHex(buffer, start, length) { return [...new Uint8Array(buffer, start, length)].map((x) => x.toString(16).padStart(2, "0")).join(""); } async function makeHashTableFromZipHeaders(fileProvider) { const zipCDIterator = makeZipCDHeaderIterator(fileProvider); return getHashTable(zipCDIterator); } async function getHashTable(zipCDIterator) { const md5Hash = new MD5Hash(); const textEncoder = new TextEncoder(); const hashTable = {}; for await (const cdHeader of zipCDIterator) { const filename2 = cdHeader.fileName.split("\\").join("/").toLocaleLowerCase(); const arrayBuffer = textEncoder.encode(filename2).buffer; const md5 = await md5Hash.hash(arrayBuffer, "hex"); hashTable[md5] = cdHeader.localHeaderOffset; } return hashTable; } async function composeHashFile(zipCDIterator) { const md5Hash = new MD5Hash(); const textEncoder = new TextEncoder(); const hashArray = []; for await (const cdHeader of zipCDIterator) { let filename2 = cdHeader.fileName.split("\\").join("/"); if (filename2 !== "3dSceneLayer.json.gz") { filename2 = filename2.toLocaleLowerCase(); } const arrayBuffer = textEncoder.encode(filename2).buffer; const md5 = await md5Hash.hash(arrayBuffer, "hex"); hashArray.push( concatenateArrayBuffers(hexStringToBuffer(md5), bigintToBuffer(cdHeader.localHeaderOffset)) ); } const bufferArray = hashArray.sort(compareHashes); return concatenateArrayBuffersFromArray(bufferArray); } function compareHashes(arrA, arrB) { const a = new BigUint64Array(arrA); const b = new BigUint64Array(arrB); return Number(a[0] === b[0] ? a[1] - b[1] : a[0] - b[0]); } function hexStringToBuffer(str) { const byteArray = str.match(/../g)?.map((h) => parseInt(h, 16)); return new Uint8Array(byteArray ?? new Array(16)).buffer; } function bigintToBuffer(n) { return new BigUint64Array([n]).buffer; } return __toCommonJS(bundle_exports); })(); /*! Bundled license information: jszip/dist/jszip.min.js: (*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE *) */ return __exports__; });