UNPKG

@vue-pdf-viewer/viewer

Version:

A vue-pdf-viewer component for Vue and Nuxt. Suitable for vue-pdf document.

1,325 lines 434 kB
import { p as kt } from "./VPdfViewer.vue_vue_type_style_index_1_scoped_1bbfb09f_lang-F263kkuR.js"; function En(e, t) { for (var a = 0; a < t.length; a++) { const r = t[a]; if (typeof r != "string" && !Array.isArray(r)) { for (const i in r) if (i !== "default" && !(i in e)) { const s = Object.getOwnPropertyDescriptor(r, i); s && Object.defineProperty(e, i, s.get ? s : { enumerable: !0, get: () => r[i] }); } } } return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" })); } var xn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function Sn(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } function Tn(e) { if (e.__esModule) return e; var t = e.default; if (typeof t == "function") { var a = function r() { return this instanceof r ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments); }; a.prototype = t.prototype; } else a = {}; return Object.defineProperty(a, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) { var i = Object.getOwnPropertyDescriptor(e, r); Object.defineProperty(a, r, i.get ? i : { enumerable: !0, get: function() { return e[r]; } }); }), a; } var ee = { // default options options: { usePureJavaScript: !1 } }, Ei = {}, Gr = {}; Gr.byteLength = An; Gr.toByteArray = _n; Gr.fromByteArray = Rn; var xt = [], ot = [], In = typeof Uint8Array < "u" ? Uint8Array : Array, ra = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; for (var Jt = 0, Bn = ra.length; Jt < Bn; ++Jt) xt[Jt] = ra[Jt], ot[ra.charCodeAt(Jt)] = Jt; ot[45] = 62; ot[95] = 63; function xi(e) { var t = e.length; if (t % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4"); var a = e.indexOf("="); a === -1 && (a = t); var r = a === t ? 0 : 4 - a % 4; return [a, r]; } function An(e) { var t = xi(e), a = t[0], r = t[1]; return (a + r) * 3 / 4 - r; } function bn(e, t, a) { return (t + a) * 3 / 4 - a; } function _n(e) { var t, a = xi(e), r = a[0], i = a[1], s = new In(bn(e, r, i)), n = 0, o = i > 0 ? r - 4 : r, l; for (l = 0; l < o; l += 4) t = ot[e.charCodeAt(l)] << 18 | ot[e.charCodeAt(l + 1)] << 12 | ot[e.charCodeAt(l + 2)] << 6 | ot[e.charCodeAt(l + 3)], s[n++] = t >> 16 & 255, s[n++] = t >> 8 & 255, s[n++] = t & 255; return i === 2 && (t = ot[e.charCodeAt(l)] << 2 | ot[e.charCodeAt(l + 1)] >> 4, s[n++] = t & 255), i === 1 && (t = ot[e.charCodeAt(l)] << 10 | ot[e.charCodeAt(l + 1)] << 4 | ot[e.charCodeAt(l + 2)] >> 2, s[n++] = t >> 8 & 255, s[n++] = t & 255), s; } function wn(e) { return xt[e >> 18 & 63] + xt[e >> 12 & 63] + xt[e >> 6 & 63] + xt[e & 63]; } function Nn(e, t, a) { for (var r, i = [], s = t; s < a; s += 3) r = (e[s] << 16 & 16711680) + (e[s + 1] << 8 & 65280) + (e[s + 2] & 255), i.push(wn(r)); return i.join(""); } function Rn(e) { for (var t, a = e.length, r = a % 3, i = [], s = 16383, n = 0, o = a - r; n < o; n += s) i.push(Nn(e, n, n + s > o ? o : n + s)); return r === 1 ? (t = e[a - 1], i.push( xt[t >> 2] + xt[t << 4 & 63] + "==" )) : r === 2 && (t = (e[a - 2] << 8) + e[a - 1], i.push( xt[t >> 10] + xt[t >> 4 & 63] + xt[t << 2 & 63] + "=" )), i.join(""); } var Aa = {}; /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ Aa.read = function(e, t, a, r, i) { var s, n, o = i * 8 - r - 1, l = (1 << o) - 1, f = l >> 1, u = -7, p = a ? i - 1 : 0, m = a ? -1 : 1, S = e[t + p]; for (p += m, s = S & (1 << -u) - 1, S >>= -u, u += o; u > 0; s = s * 256 + e[t + p], p += m, u -= 8) ; for (n = s & (1 << -u) - 1, s >>= -u, u += r; u > 0; n = n * 256 + e[t + p], p += m, u -= 8) ; if (s === 0) s = 1 - f; else { if (s === l) return n ? NaN : (S ? -1 : 1) * (1 / 0); n = n + Math.pow(2, r), s = s - f; } return (S ? -1 : 1) * n * Math.pow(2, s - r); }; Aa.write = function(e, t, a, r, i, s) { var n, o, l, f = s * 8 - i - 1, u = (1 << f) - 1, p = u >> 1, m = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, S = r ? 0 : s - 1, C = r ? 1 : -1, A = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0; for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (o = isNaN(t) ? 1 : 0, n = u) : (n = Math.floor(Math.log(t) / Math.LN2), t * (l = Math.pow(2, -n)) < 1 && (n--, l *= 2), n + p >= 1 ? t += m / l : t += m * Math.pow(2, 1 - p), t * l >= 2 && (n++, l /= 2), n + p >= u ? (o = 0, n = u) : n + p >= 1 ? (o = (t * l - 1) * Math.pow(2, i), n = n + p) : (o = t * Math.pow(2, p - 1) * Math.pow(2, i), n = 0)); i >= 8; e[a + S] = o & 255, S += C, o /= 256, i -= 8) ; for (n = n << i | o, f += i; f > 0; e[a + S] = n & 255, S += C, n /= 256, f -= 8) ; e[a + S - C] |= A * 128; }; /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */ (function(e) { const t = Gr, a = Aa, r = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null; e.Buffer = u, e.SlowBuffer = K, e.INSPECT_MAX_BYTES = 50; const i = 2147483647; e.kMaxLength = i; const { Uint8Array: s, ArrayBuffer: n, SharedArrayBuffer: o } = globalThis; u.TYPED_ARRAY_SUPPORT = l(), !u.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error( "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support." ); function l() { try { const v = new s(1), c = { foo: function() { return 42; } }; return Object.setPrototypeOf(c, s.prototype), Object.setPrototypeOf(v, c), v.foo() === 42; } catch { return !1; } } Object.defineProperty(u.prototype, "parent", { enumerable: !0, get: function() { if (u.isBuffer(this)) return this.buffer; } }), Object.defineProperty(u.prototype, "offset", { enumerable: !0, get: function() { if (u.isBuffer(this)) return this.byteOffset; } }); function f(v) { if (v > i) throw new RangeError('The value "' + v + '" is invalid for option "size"'); const c = new s(v); return Object.setPrototypeOf(c, u.prototype), c; } function u(v, c, h) { if (typeof v == "number") { if (typeof c == "string") throw new TypeError( 'The "string" argument must be of type string. Received type number' ); return C(v); } return p(v, c, h); } u.poolSize = 8192; function p(v, c, h) { if (typeof v == "string") return A(v, c); if (n.isView(v)) return w(v); if (v == null) throw new TypeError( "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof v ); if (vt(v, n) || v && vt(v.buffer, n) || typeof o < "u" && (vt(v, o) || v && vt(v.buffer, o))) return U(v, c, h); if (typeof v == "number") throw new TypeError( 'The "value" argument must not be of type number. Received type number' ); const E = v.valueOf && v.valueOf(); if (E != null && E !== v) return u.from(E, c, h); const B = D(v); if (B) return B; if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof v[Symbol.toPrimitive] == "function") return u.from(v[Symbol.toPrimitive]("string"), c, h); throw new TypeError( "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof v ); } u.from = function(v, c, h) { return p(v, c, h); }, Object.setPrototypeOf(u.prototype, s.prototype), Object.setPrototypeOf(u, s); function m(v) { if (typeof v != "number") throw new TypeError('"size" argument must be of type number'); if (v < 0) throw new RangeError('The value "' + v + '" is invalid for option "size"'); } function S(v, c, h) { return m(v), v <= 0 ? f(v) : c !== void 0 ? typeof h == "string" ? f(v).fill(c, h) : f(v).fill(c) : f(v); } u.alloc = function(v, c, h) { return S(v, c, h); }; function C(v) { return m(v), f(v < 0 ? 0 : G(v) | 0); } u.allocUnsafe = function(v) { return C(v); }, u.allocUnsafeSlow = function(v) { return C(v); }; function A(v, c) { if ((typeof c != "string" || c === "") && (c = "utf8"), !u.isEncoding(c)) throw new TypeError("Unknown encoding: " + c); const h = F(v, c) | 0; let E = f(h); const B = E.write(v, c); return B !== h && (E = E.slice(0, B)), E; } function b(v) { const c = v.length < 0 ? 0 : G(v.length) | 0, h = f(c); for (let E = 0; E < c; E += 1) h[E] = v[E] & 255; return h; } function w(v) { if (vt(v, s)) { const c = new s(v); return U(c.buffer, c.byteOffset, c.byteLength); } return b(v); } function U(v, c, h) { if (c < 0 || v.byteLength < c) throw new RangeError('"offset" is outside of buffer bounds'); if (v.byteLength < c + (h || 0)) throw new RangeError('"length" is outside of buffer bounds'); let E; return c === void 0 && h === void 0 ? E = new s(v) : h === void 0 ? E = new s(v, c) : E = new s(v, c, h), Object.setPrototypeOf(E, u.prototype), E; } function D(v) { if (u.isBuffer(v)) { const c = G(v.length) | 0, h = f(c); return h.length === 0 || v.copy(h, 0, 0, c), h; } if (v.length !== void 0) return typeof v.length != "number" || ta(v.length) ? f(0) : b(v); if (v.type === "Buffer" && Array.isArray(v.data)) return b(v.data); } function G(v) { if (v >= i) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i.toString(16) + " bytes"); return v | 0; } function K(v) { return +v != v && (v = 0), u.alloc(+v); } u.isBuffer = function(c) { return c != null && c._isBuffer === !0 && c !== u.prototype; }, u.compare = function(c, h) { if (vt(c, s) && (c = u.from(c, c.offset, c.byteLength)), vt(h, s) && (h = u.from(h, h.offset, h.byteLength)), !u.isBuffer(c) || !u.isBuffer(h)) throw new TypeError( 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' ); if (c === h) return 0; let E = c.length, B = h.length; for (let N = 0, L = Math.min(E, B); N < L; ++N) if (c[N] !== h[N]) { E = c[N], B = h[N]; break; } return E < B ? -1 : B < E ? 1 : 0; }, u.isEncoding = function(c) { switch (String(c).toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "latin1": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return !0; default: return !1; } }, u.concat = function(c, h) { if (!Array.isArray(c)) throw new TypeError('"list" argument must be an Array of Buffers'); if (c.length === 0) return u.alloc(0); let E; if (h === void 0) for (h = 0, E = 0; E < c.length; ++E) h += c[E].length; const B = u.allocUnsafe(h); let N = 0; for (E = 0; E < c.length; ++E) { let L = c[E]; if (vt(L, s)) N + L.length > B.length ? (u.isBuffer(L) || (L = u.from(L)), L.copy(B, N)) : s.prototype.set.call( B, L, N ); else if (u.isBuffer(L)) L.copy(B, N); else throw new TypeError('"list" argument must be an Array of Buffers'); N += L.length; } return B; }; function F(v, c) { if (u.isBuffer(v)) return v.length; if (n.isView(v) || vt(v, n)) return v.byteLength; if (typeof v != "string") throw new TypeError( 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof v ); const h = v.length, E = arguments.length > 2 && arguments[2] === !0; if (!E && h === 0) return 0; let B = !1; for (; ; ) switch (c) { case "ascii": case "latin1": case "binary": return h; case "utf8": case "utf-8": return ea(v).length; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return h * 2; case "hex": return h >>> 1; case "base64": return za(v).length; default: if (B) return E ? -1 : ea(v).length; c = ("" + c).toLowerCase(), B = !0; } } u.byteLength = F; function $(v, c, h) { let E = !1; if ((c === void 0 || c < 0) && (c = 0), c > this.length || ((h === void 0 || h > this.length) && (h = this.length), h <= 0) || (h >>>= 0, c >>>= 0, h <= c)) return ""; for (v || (v = "utf8"); ; ) switch (v) { case "hex": return Le(this, c, h); case "utf8": case "utf-8": return z(this, c, h); case "ascii": return be(this, c, h); case "latin1": case "binary": return _e(this, c, h); case "base64": return Ae(this, c, h); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return He(this, c, h); default: if (E) throw new TypeError("Unknown encoding: " + v); v = (v + "").toLowerCase(), E = !0; } } u.prototype._isBuffer = !0; function j(v, c, h) { const E = v[c]; v[c] = v[h], v[h] = E; } u.prototype.swap16 = function() { const c = this.length; if (c % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits"); for (let h = 0; h < c; h += 2) j(this, h, h + 1); return this; }, u.prototype.swap32 = function() { const c = this.length; if (c % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits"); for (let h = 0; h < c; h += 4) j(this, h, h + 3), j(this, h + 1, h + 2); return this; }, u.prototype.swap64 = function() { const c = this.length; if (c % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits"); for (let h = 0; h < c; h += 8) j(this, h, h + 7), j(this, h + 1, h + 6), j(this, h + 2, h + 5), j(this, h + 3, h + 4); return this; }, u.prototype.toString = function() { const c = this.length; return c === 0 ? "" : arguments.length === 0 ? z(this, 0, c) : $.apply(this, arguments); }, u.prototype.toLocaleString = u.prototype.toString, u.prototype.equals = function(c) { if (!u.isBuffer(c)) throw new TypeError("Argument must be a Buffer"); return this === c ? !0 : u.compare(this, c) === 0; }, u.prototype.inspect = function() { let c = ""; const h = e.INSPECT_MAX_BYTES; return c = this.toString("hex", 0, h).replace(/(.{2})/g, "$1 ").trim(), this.length > h && (c += " ... "), "<Buffer " + c + ">"; }, r && (u.prototype[r] = u.prototype.inspect), u.prototype.compare = function(c, h, E, B, N) { if (vt(c, s) && (c = u.from(c, c.offset, c.byteLength)), !u.isBuffer(c)) throw new TypeError( 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof c ); if (h === void 0 && (h = 0), E === void 0 && (E = c ? c.length : 0), B === void 0 && (B = 0), N === void 0 && (N = this.length), h < 0 || E > c.length || B < 0 || N > this.length) throw new RangeError("out of range index"); if (B >= N && h >= E) return 0; if (B >= N) return -1; if (h >= E) return 1; if (h >>>= 0, E >>>= 0, B >>>= 0, N >>>= 0, this === c) return 0; let L = N - B, te = E - h; const we = Math.min(L, te), Te = this.slice(B, N), Ne = c.slice(h, E); for (let ge = 0; ge < we; ++ge) if (Te[ge] !== Ne[ge]) { L = Te[ge], te = Ne[ge]; break; } return L < te ? -1 : te < L ? 1 : 0; }; function le(v, c, h, E, B) { if (v.length === 0) return -1; if (typeof h == "string" ? (E = h, h = 0) : h > 2147483647 ? h = 2147483647 : h < -2147483648 && (h = -2147483648), h = +h, ta(h) && (h = B ? 0 : v.length - 1), h < 0 && (h = v.length + h), h >= v.length) { if (B) return -1; h = v.length - 1; } else if (h < 0) if (B) h = 0; else return -1; if (typeof c == "string" && (c = u.from(c, E)), u.isBuffer(c)) return c.length === 0 ? -1 : he(v, c, h, E, B); if (typeof c == "number") return c = c & 255, typeof s.prototype.indexOf == "function" ? B ? s.prototype.indexOf.call(v, c, h) : s.prototype.lastIndexOf.call(v, c, h) : he(v, [c], h, E, B); throw new TypeError("val must be string, number or Buffer"); } function he(v, c, h, E, B) { let N = 1, L = v.length, te = c.length; if (E !== void 0 && (E = String(E).toLowerCase(), E === "ucs2" || E === "ucs-2" || E === "utf16le" || E === "utf-16le")) { if (v.length < 2 || c.length < 2) return -1; N = 2, L /= 2, te /= 2, h /= 2; } function we(Ne, ge) { return N === 1 ? Ne[ge] : Ne.readUInt16BE(ge * N); } let Te; if (B) { let Ne = -1; for (Te = h; Te < L; Te++) if (we(v, Te) === we(c, Ne === -1 ? 0 : Te - Ne)) { if (Ne === -1 && (Ne = Te), Te - Ne + 1 === te) return Ne * N; } else Ne !== -1 && (Te -= Te - Ne), Ne = -1; } else for (h + te > L && (h = L - te), Te = h; Te >= 0; Te--) { let Ne = !0; for (let ge = 0; ge < te; ge++) if (we(v, Te + ge) !== we(c, ge)) { Ne = !1; break; } if (Ne) return Te; } return -1; } u.prototype.includes = function(c, h, E) { return this.indexOf(c, h, E) !== -1; }, u.prototype.indexOf = function(c, h, E) { return le(this, c, h, E, !0); }, u.prototype.lastIndexOf = function(c, h, E) { return le(this, c, h, E, !1); }; function de(v, c, h, E) { h = Number(h) || 0; const B = v.length - h; E ? (E = Number(E), E > B && (E = B)) : E = B; const N = c.length; E > N / 2 && (E = N / 2); let L; for (L = 0; L < E; ++L) { const te = parseInt(c.substr(L * 2, 2), 16); if (ta(te)) return L; v[h + L] = te; } return L; } function Ee(v, c, h, E) { return Br(ea(c, v.length - h), v, h, E); } function je(v, c, h, E) { return Br(gn(c), v, h, E); } function rt(v, c, h, E) { return Br(za(c), v, h, E); } function ye(v, c, h, E) { return Br(vn(c, v.length - h), v, h, E); } u.prototype.write = function(c, h, E, B) { if (h === void 0) B = "utf8", E = this.length, h = 0; else if (E === void 0 && typeof h == "string") B = h, E = this.length, h = 0; else if (isFinite(h)) h = h >>> 0, isFinite(E) ? (E = E >>> 0, B === void 0 && (B = "utf8")) : (B = E, E = void 0); else throw new Error( "Buffer.write(string, encoding, offset[, length]) is no longer supported" ); const N = this.length - h; if ((E === void 0 || E > N) && (E = N), c.length > 0 && (E < 0 || h < 0) || h > this.length) throw new RangeError("Attempt to write outside buffer bounds"); B || (B = "utf8"); let L = !1; for (; ; ) switch (B) { case "hex": return de(this, c, h, E); case "utf8": case "utf-8": return Ee(this, c, h, E); case "ascii": case "latin1": case "binary": return je(this, c, h, E); case "base64": return rt(this, c, h, E); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return ye(this, c, h, E); default: if (L) throw new TypeError("Unknown encoding: " + B); B = ("" + B).toLowerCase(), L = !0; } }, u.prototype.toJSON = function() { return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) }; }; function Ae(v, c, h) { return c === 0 && h === v.length ? t.fromByteArray(v) : t.fromByteArray(v.slice(c, h)); } function z(v, c, h) { h = Math.min(v.length, h); const E = []; let B = c; for (; B < h; ) { const N = v[B]; let L = null, te = N > 239 ? 4 : N > 223 ? 3 : N > 191 ? 2 : 1; if (B + te <= h) { let we, Te, Ne, ge; switch (te) { case 1: N < 128 && (L = N); break; case 2: we = v[B + 1], (we & 192) === 128 && (ge = (N & 31) << 6 | we & 63, ge > 127 && (L = ge)); break; case 3: we = v[B + 1], Te = v[B + 2], (we & 192) === 128 && (Te & 192) === 128 && (ge = (N & 15) << 12 | (we & 63) << 6 | Te & 63, ge > 2047 && (ge < 55296 || ge > 57343) && (L = ge)); break; case 4: we = v[B + 1], Te = v[B + 2], Ne = v[B + 3], (we & 192) === 128 && (Te & 192) === 128 && (Ne & 192) === 128 && (ge = (N & 15) << 18 | (we & 63) << 12 | (Te & 63) << 6 | Ne & 63, ge > 65535 && ge < 1114112 && (L = ge)); } } L === null ? (L = 65533, te = 1) : L > 65535 && (L -= 65536, E.push(L >>> 10 & 1023 | 55296), L = 56320 | L & 1023), E.push(L), B += te; } return Rt(E); } const gt = 4096; function Rt(v) { const c = v.length; if (c <= gt) return String.fromCharCode.apply(String, v); let h = "", E = 0; for (; E < c; ) h += String.fromCharCode.apply( String, v.slice(E, E += gt) ); return h; } function be(v, c, h) { let E = ""; h = Math.min(v.length, h); for (let B = c; B < h; ++B) E += String.fromCharCode(v[B] & 127); return E; } function _e(v, c, h) { let E = ""; h = Math.min(v.length, h); for (let B = c; B < h; ++B) E += String.fromCharCode(v[B]); return E; } function Le(v, c, h) { const E = v.length; (!c || c < 0) && (c = 0), (!h || h < 0 || h > E) && (h = E); let B = ""; for (let N = c; N < h; ++N) B += mn[v[N]]; return B; } function He(v, c, h) { const E = v.slice(c, h); let B = ""; for (let N = 0; N < E.length - 1; N += 2) B += String.fromCharCode(E[N] + E[N + 1] * 256); return B; } u.prototype.slice = function(c, h) { const E = this.length; c = ~~c, h = h === void 0 ? E : ~~h, c < 0 ? (c += E, c < 0 && (c = 0)) : c > E && (c = E), h < 0 ? (h += E, h < 0 && (h = 0)) : h > E && (h = E), h < c && (h = c); const B = this.subarray(c, h); return Object.setPrototypeOf(B, u.prototype), B; }; function se(v, c, h) { if (v % 1 !== 0 || v < 0) throw new RangeError("offset is not uint"); if (v + c > h) throw new RangeError("Trying to access beyond buffer length"); } u.prototype.readUintLE = u.prototype.readUIntLE = function(c, h, E) { c = c >>> 0, h = h >>> 0, E || se(c, h, this.length); let B = this[c], N = 1, L = 0; for (; ++L < h && (N *= 256); ) B += this[c + L] * N; return B; }, u.prototype.readUintBE = u.prototype.readUIntBE = function(c, h, E) { c = c >>> 0, h = h >>> 0, E || se(c, h, this.length); let B = this[c + --h], N = 1; for (; h > 0 && (N *= 256); ) B += this[c + --h] * N; return B; }, u.prototype.readUint8 = u.prototype.readUInt8 = function(c, h) { return c = c >>> 0, h || se(c, 1, this.length), this[c]; }, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(c, h) { return c = c >>> 0, h || se(c, 2, this.length), this[c] | this[c + 1] << 8; }, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(c, h) { return c = c >>> 0, h || se(c, 2, this.length), this[c] << 8 | this[c + 1]; }, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(c, h) { return c = c >>> 0, h || se(c, 4, this.length), (this[c] | this[c + 1] << 8 | this[c + 2] << 16) + this[c + 3] * 16777216; }, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(c, h) { return c = c >>> 0, h || se(c, 4, this.length), this[c] * 16777216 + (this[c + 1] << 16 | this[c + 2] << 8 | this[c + 3]); }, u.prototype.readBigUInt64LE = Lt(function(c) { c = c >>> 0, Zt(c, "offset"); const h = this[c], E = this[c + 7]; (h === void 0 || E === void 0) && hr(c, this.length - 8); const B = h + this[++c] * 2 ** 8 + this[++c] * 2 ** 16 + this[++c] * 2 ** 24, N = this[++c] + this[++c] * 2 ** 8 + this[++c] * 2 ** 16 + E * 2 ** 24; return BigInt(B) + (BigInt(N) << BigInt(32)); }), u.prototype.readBigUInt64BE = Lt(function(c) { c = c >>> 0, Zt(c, "offset"); const h = this[c], E = this[c + 7]; (h === void 0 || E === void 0) && hr(c, this.length - 8); const B = h * 2 ** 24 + this[++c] * 2 ** 16 + this[++c] * 2 ** 8 + this[++c], N = this[++c] * 2 ** 24 + this[++c] * 2 ** 16 + this[++c] * 2 ** 8 + E; return (BigInt(B) << BigInt(32)) + BigInt(N); }), u.prototype.readIntLE = function(c, h, E) { c = c >>> 0, h = h >>> 0, E || se(c, h, this.length); let B = this[c], N = 1, L = 0; for (; ++L < h && (N *= 256); ) B += this[c + L] * N; return N *= 128, B >= N && (B -= Math.pow(2, 8 * h)), B; }, u.prototype.readIntBE = function(c, h, E) { c = c >>> 0, h = h >>> 0, E || se(c, h, this.length); let B = h, N = 1, L = this[c + --B]; for (; B > 0 && (N *= 256); ) L += this[c + --B] * N; return N *= 128, L >= N && (L -= Math.pow(2, 8 * h)), L; }, u.prototype.readInt8 = function(c, h) { return c = c >>> 0, h || se(c, 1, this.length), this[c] & 128 ? (255 - this[c] + 1) * -1 : this[c]; }, u.prototype.readInt16LE = function(c, h) { c = c >>> 0, h || se(c, 2, this.length); const E = this[c] | this[c + 1] << 8; return E & 32768 ? E | 4294901760 : E; }, u.prototype.readInt16BE = function(c, h) { c = c >>> 0, h || se(c, 2, this.length); const E = this[c + 1] | this[c] << 8; return E & 32768 ? E | 4294901760 : E; }, u.prototype.readInt32LE = function(c, h) { return c = c >>> 0, h || se(c, 4, this.length), this[c] | this[c + 1] << 8 | this[c + 2] << 16 | this[c + 3] << 24; }, u.prototype.readInt32BE = function(c, h) { return c = c >>> 0, h || se(c, 4, this.length), this[c] << 24 | this[c + 1] << 16 | this[c + 2] << 8 | this[c + 3]; }, u.prototype.readBigInt64LE = Lt(function(c) { c = c >>> 0, Zt(c, "offset"); const h = this[c], E = this[c + 7]; (h === void 0 || E === void 0) && hr(c, this.length - 8); const B = this[c + 4] + this[c + 5] * 2 ** 8 + this[c + 6] * 2 ** 16 + (E << 24); return (BigInt(B) << BigInt(32)) + BigInt(h + this[++c] * 2 ** 8 + this[++c] * 2 ** 16 + this[++c] * 2 ** 24); }), u.prototype.readBigInt64BE = Lt(function(c) { c = c >>> 0, Zt(c, "offset"); const h = this[c], E = this[c + 7]; (h === void 0 || E === void 0) && hr(c, this.length - 8); const B = (h << 24) + // Overflow this[++c] * 2 ** 16 + this[++c] * 2 ** 8 + this[++c]; return (BigInt(B) << BigInt(32)) + BigInt(this[++c] * 2 ** 24 + this[++c] * 2 ** 16 + this[++c] * 2 ** 8 + E); }), u.prototype.readFloatLE = function(c, h) { return c = c >>> 0, h || se(c, 4, this.length), a.read(this, c, !0, 23, 4); }, u.prototype.readFloatBE = function(c, h) { return c = c >>> 0, h || se(c, 4, this.length), a.read(this, c, !1, 23, 4); }, u.prototype.readDoubleLE = function(c, h) { return c = c >>> 0, h || se(c, 8, this.length), a.read(this, c, !0, 52, 8); }, u.prototype.readDoubleBE = function(c, h) { return c = c >>> 0, h || se(c, 8, this.length), a.read(this, c, !1, 52, 8); }; function ce(v, c, h, E, B, N) { if (!u.isBuffer(v)) throw new TypeError('"buffer" argument must be a Buffer instance'); if (c > B || c < N) throw new RangeError('"value" argument is out of bounds'); if (h + E > v.length) throw new RangeError("Index out of range"); } u.prototype.writeUintLE = u.prototype.writeUIntLE = function(c, h, E, B) { if (c = +c, h = h >>> 0, E = E >>> 0, !B) { const te = Math.pow(2, 8 * E) - 1; ce(this, c, h, E, te, 0); } let N = 1, L = 0; for (this[h] = c & 255; ++L < E && (N *= 256); ) this[h + L] = c / N & 255; return h + E; }, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(c, h, E, B) { if (c = +c, h = h >>> 0, E = E >>> 0, !B) { const te = Math.pow(2, 8 * E) - 1; ce(this, c, h, E, te, 0); } let N = E - 1, L = 1; for (this[h + N] = c & 255; --N >= 0 && (L *= 256); ) this[h + N] = c / L & 255; return h + E; }, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(c, h, E) { return c = +c, h = h >>> 0, E || ce(this, c, h, 1, 255, 0), this[h] = c & 255, h + 1; }, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(c, h, E) { return c = +c, h = h >>> 0, E || ce(this, c, h, 2, 65535, 0), this[h] = c & 255, this[h + 1] = c >>> 8, h + 2; }, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(c, h, E) { return c = +c, h = h >>> 0, E || ce(this, c, h, 2, 65535, 0), this[h] = c >>> 8, this[h + 1] = c & 255, h + 2; }, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(c, h, E) { return c = +c, h = h >>> 0, E || ce(this, c, h, 4, 4294967295, 0), this[h + 3] = c >>> 24, this[h + 2] = c >>> 16, this[h + 1] = c >>> 8, this[h] = c & 255, h + 4; }, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(c, h, E) { return c = +c, h = h >>> 0, E || ce(this, c, h, 4, 4294967295, 0), this[h] = c >>> 24, this[h + 1] = c >>> 16, this[h + 2] = c >>> 8, this[h + 3] = c & 255, h + 4; }; function ke(v, c, h, E, B) { Me(c, E, B, v, h, 7); let N = Number(c & BigInt(4294967295)); v[h++] = N, N = N >> 8, v[h++] = N, N = N >> 8, v[h++] = N, N = N >> 8, v[h++] = N; let L = Number(c >> BigInt(32) & BigInt(4294967295)); return v[h++] = L, L = L >> 8, v[h++] = L, L = L >> 8, v[h++] = L, L = L >> 8, v[h++] = L, h; } function Pe(v, c, h, E, B) { Me(c, E, B, v, h, 7); let N = Number(c & BigInt(4294967295)); v[h + 7] = N, N = N >> 8, v[h + 6] = N, N = N >> 8, v[h + 5] = N, N = N >> 8, v[h + 4] = N; let L = Number(c >> BigInt(32) & BigInt(4294967295)); return v[h + 3] = L, L = L >> 8, v[h + 2] = L, L = L >> 8, v[h + 1] = L, L = L >> 8, v[h] = L, h + 8; } u.prototype.writeBigUInt64LE = Lt(function(c, h = 0) { return ke(this, c, h, BigInt(0), BigInt("0xffffffffffffffff")); }), u.prototype.writeBigUInt64BE = Lt(function(c, h = 0) { return Pe(this, c, h, BigInt(0), BigInt("0xffffffffffffffff")); }), u.prototype.writeIntLE = function(c, h, E, B) { if (c = +c, h = h >>> 0, !B) { const we = Math.pow(2, 8 * E - 1); ce(this, c, h, E, we - 1, -we); } let N = 0, L = 1, te = 0; for (this[h] = c & 255; ++N < E && (L *= 256); ) c < 0 && te === 0 && this[h + N - 1] !== 0 && (te = 1), this[h + N] = (c / L >> 0) - te & 255; return h + E; }, u.prototype.writeIntBE = function(c, h, E, B) { if (c = +c, h = h >>> 0, !B) { const we = Math.pow(2, 8 * E - 1); ce(this, c, h, E, we - 1, -we); } let N = E - 1, L = 1, te = 0; for (this[h + N] = c & 255; --N >= 0 && (L *= 256); ) c < 0 && te === 0 && this[h + N + 1] !== 0 && (te = 1), this[h + N] = (c / L >> 0) - te & 255; return h + E; }, u.prototype.writeInt8 = function(c, h, E) { return c = +c, h = h >>> 0, E || ce(this, c, h, 1, 127, -128), c < 0 && (c = 255 + c + 1), this[h] = c & 255, h + 1; }, u.prototype.writeInt16LE = function(c, h, E) { return c = +c, h = h >>> 0, E || ce(this, c, h, 2, 32767, -32768), this[h] = c & 255, this[h + 1] = c >>> 8, h + 2; }, u.prototype.writeInt16BE = function(c, h, E) { return c = +c, h = h >>> 0, E || ce(this, c, h, 2, 32767, -32768), this[h] = c >>> 8, this[h + 1] = c & 255, h + 2; }, u.prototype.writeInt32LE = function(c, h, E) { return c = +c, h = h >>> 0, E || ce(this, c, h, 4, 2147483647, -2147483648), this[h] = c & 255, this[h + 1] = c >>> 8, this[h + 2] = c >>> 16, this[h + 3] = c >>> 24, h + 4; }, u.prototype.writeInt32BE = function(c, h, E) { return c = +c, h = h >>> 0, E || ce(this, c, h, 4, 2147483647, -2147483648), c < 0 && (c = 4294967295 + c + 1), this[h] = c >>> 24, this[h + 1] = c >>> 16, this[h + 2] = c >>> 8, this[h + 3] = c & 255, h + 4; }, u.prototype.writeBigInt64LE = Lt(function(c, h = 0) { return ke(this, c, h, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); }), u.prototype.writeBigInt64BE = Lt(function(c, h = 0) { return Pe(this, c, h, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); }); function Ve(v, c, h, E, B, N) { if (h + E > v.length) throw new RangeError("Index out of range"); if (h < 0) throw new RangeError("Index out of range"); } function Fe(v, c, h, E, B) { return c = +c, h = h >>> 0, B || Ve(v, c, h, 4), a.write(v, c, h, E, 23, 4), h + 4; } u.prototype.writeFloatLE = function(c, h, E) { return Fe(this, c, h, !0, E); }, u.prototype.writeFloatBE = function(c, h, E) { return Fe(this, c, h, !1, E); }; function Oe(v, c, h, E, B) { return c = +c, h = h >>> 0, B || Ve(v, c, h, 8), a.write(v, c, h, E, 52, 8), h + 8; } u.prototype.writeDoubleLE = function(c, h, E) { return Oe(this, c, h, !0, E); }, u.prototype.writeDoubleBE = function(c, h, E) { return Oe(this, c, h, !1, E); }, u.prototype.copy = function(c, h, E, B) { if (!u.isBuffer(c)) throw new TypeError("argument should be a Buffer"); if (E || (E = 0), !B && B !== 0 && (B = this.length), h >= c.length && (h = c.length), h || (h = 0), B > 0 && B < E && (B = E), B === E || c.length === 0 || this.length === 0) return 0; if (h < 0) throw new RangeError("targetStart out of bounds"); if (E < 0 || E >= this.length) throw new RangeError("Index out of range"); if (B < 0) throw new RangeError("sourceEnd out of bounds"); B > this.length && (B = this.length), c.length - h < B - E && (B = c.length - h + E); const N = B - E; return this === c && typeof s.prototype.copyWithin == "function" ? this.copyWithin(h, E, B) : s.prototype.set.call( c, this.subarray(E, B), h ), N; }, u.prototype.fill = function(c, h, E, B) { if (typeof c == "string") { if (typeof h == "string" ? (B = h, h = 0, E = this.length) : typeof E == "string" && (B = E, E = this.length), B !== void 0 && typeof B != "string") throw new TypeError("encoding must be a string"); if (typeof B == "string" && !u.isEncoding(B)) throw new TypeError("Unknown encoding: " + B); if (c.length === 1) { const L = c.charCodeAt(0); (B === "utf8" && L < 128 || B === "latin1") && (c = L); } } else typeof c == "number" ? c = c & 255 : typeof c == "boolean" && (c = Number(c)); if (h < 0 || this.length < h || this.length < E) throw new RangeError("Out of range index"); if (E <= h) return this; h = h >>> 0, E = E === void 0 ? this.length : E >>> 0, c || (c = 0); let N; if (typeof c == "number") for (N = h; N < E; ++N) this[N] = c; else { const L = u.isBuffer(c) ? c : u.from(c, B), te = L.length; if (te === 0) throw new TypeError('The value "' + c + '" is invalid for argument "value"'); for (N = 0; N < E - h; ++N) this[N + h] = L[N % te]; } return this; }; const Be = {}; function Ue(v, c, h) { Be[v] = class extends h { constructor() { super(), Object.defineProperty(this, "message", { value: c.apply(this, arguments), writable: !0, configurable: !0 }), this.name = `${this.name} [${v}]`, this.stack, delete this.name; } get code() { return v; } set code(B) { Object.defineProperty(this, "code", { configurable: !0, enumerable: !0, value: B, writable: !0 }); } toString() { return `${this.name} [${v}]: ${this.message}`; } }; } Ue( "ERR_BUFFER_OUT_OF_BOUNDS", function(v) { return v ? `${v} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds"; }, RangeError ), Ue( "ERR_INVALID_ARG_TYPE", function(v, c) { return `The "${v}" argument must be of type number. Received type ${typeof c}`; }, TypeError ), Ue( "ERR_OUT_OF_RANGE", function(v, c, h) { let E = `The value of "${v}" is out of range.`, B = h; return Number.isInteger(h) && Math.abs(h) > 2 ** 32 ? B = Ke(String(h)) : typeof h == "bigint" && (B = String(h), (h > BigInt(2) ** BigInt(32) || h < -(BigInt(2) ** BigInt(32))) && (B = Ke(B)), B += "n"), E += ` It must be ${c}. Received ${B}`, E; }, RangeError ); function Ke(v) { let c = "", h = v.length; const E = v[0] === "-" ? 1 : 0; for (; h >= E + 4; h -= 3) c = `_${v.slice(h - 3, h)}${c}`; return `${v.slice(0, h)}${c}`; } function Ge(v, c, h) { Zt(c, "offset"), (v[c] === void 0 || v[c + h] === void 0) && hr(c, v.length - (h + 1)); } function Me(v, c, h, E, B, N) { if (v > h || v < c) { const L = typeof c == "bigint" ? "n" : ""; let te; throw c === 0 || c === BigInt(0) ? te = `>= 0${L} and < 2${L} ** ${(N + 1) * 8}${L}` : te = `>= -(2${L} ** ${(N + 1) * 8 - 1}${L}) and < 2 ** ${(N + 1) * 8 - 1}${L}`, new Be.ERR_OUT_OF_RANGE("value", te, v); } Ge(E, B, N); } function Zt(v, c) { if (typeof v != "number") throw new Be.ERR_INVALID_ARG_TYPE(c, "number", v); } function hr(v, c, h) { throw Math.floor(v) !== v ? (Zt(v, h), new Be.ERR_OUT_OF_RANGE("offset", "an integer", v)) : c < 0 ? new Be.ERR_BUFFER_OUT_OF_BOUNDS() : new Be.ERR_OUT_OF_RANGE( "offset", `>= 0 and <= ${c}`, v ); } const dn = /[^+/0-9A-Za-z-_]/g; function yn(v) { if (v = v.split("=")[0], v = v.trim().replace(dn, ""), v.length < 2) return ""; for (; v.length % 4 !== 0; ) v = v + "="; return v; } function ea(v, c) { c = c || 1 / 0; let h; const E = v.length; let B = null; const N = []; for (let L = 0; L < E; ++L) { if (h = v.charCodeAt(L), h > 55295 && h < 57344) { if (!B) { if (h > 56319) { (c -= 3) > -1 && N.push(239, 191, 189); continue; } else if (L + 1 === E) { (c -= 3) > -1 && N.push(239, 191, 189); continue; } B = h; continue; } if (h < 56320) { (c -= 3) > -1 && N.push(239, 191, 189), B = h; continue; } h = (B - 55296 << 10 | h - 56320) + 65536; } else B && (c -= 3) > -1 && N.push(239, 191, 189); if (B = null, h < 128) { if ((c -= 1) < 0) break; N.push(h); } else if (h < 2048) { if ((c -= 2) < 0) break; N.push( h >> 6 | 192, h & 63 | 128 ); } else if (h < 65536) { if ((c -= 3) < 0) break; N.push( h >> 12 | 224, h >> 6 & 63 | 128, h & 63 | 128 ); } else if (h < 1114112) { if ((c -= 4) < 0) break; N.push( h >> 18 | 240, h >> 12 & 63 | 128, h >> 6 & 63 | 128, h & 63 | 128 ); } else throw new Error("Invalid code point"); } return N; } function gn(v) { const c = []; for (let h = 0; h < v.length; ++h) c.push(v.charCodeAt(h) & 255); return c; } function vn(v, c) { let h, E, B; const N = []; for (let L = 0; L < v.length && !((c -= 2) < 0); ++L) h = v.charCodeAt(L), E = h >> 8, B = h % 256, N.push(B), N.push(E); return N; } function za(v) { return t.toByteArray(yn(v)); } function Br(v, c, h, E) { let B; for (B = 0; B < E && !(B + h >= c.length || B >= v.length); ++B) c[B + h] = v[B]; return B; } function vt(v, c) { return v instanceof c || v != null && v.constructor != null && v.constructor.name != null && v.constructor.name === c.name; } function ta(v) { return v !== v; } const mn = function() { const v = "0123456789abcdef", c = new Array(256); for (let h = 0; h < 16; ++h) { const E = h * 16; for (let B = 0; B < 16; ++B) c[E + B] = v[h] + v[B]; } return c; }(); function Lt(v) { return typeof BigInt > "u" ? Cn : v; } function Cn() { throw new Error("BigInt not supported"); } })(Ei); const pt = Ei.Buffer; var ba = {}, Ln = ba, Ya = {}; ba.encode = function(e, t, a) { if (typeof t != "string") throw new TypeError('"alphabet" must be a string.'); if (a !== void 0 && typeof a != "number") throw new TypeError('"maxline" must be a number.'); var r = ""; if (!(e instanceof Uint8Array)) r = Un(e, t); else { var i = 0, s = t.length, n = t.charAt(0), o = [0]; for (i = 0; i < e.length; ++i) { for (var l = 0, f = e[i]; l < o.length; ++l) f += o[l] << 8, o[l] = f % s, f = f / s | 0; for (; f > 0; ) o.push(f % s), f = f / s | 0; } for (i = 0; e[i] === 0 && i < e.length - 1; ++i) r += n; for (i = o.length - 1; i >= 0; --i) r += t[o[i]]; } if (a) { var u = new RegExp(".{1," + a + "}", "g"); r = r.match(u).join(`\r `); } return r; }; ba.decode = function(e, t) { if (typeof e != "string") throw new TypeError('"input" must be a string.'); if (typeof t != "string") throw new TypeError('"alphabet" must be a string.'); var a = Ya[t]; if (!a) { a = Ya[t] = []; for (var r = 0; r < t.length; ++r) a[t.charCodeAt(r)] = r; } e = e.replace(/\s/g, ""); for (var i = t.length, s = t.charAt(0), n = [0], r = 0; r < e.length; r++) { var o = a[e.charCodeAt(r)]; if (o === void 0) return; for (var l = 0, f = o; l < n.length; ++l) f += n[l] * i, n[l] = f & 255, f >>= 8; for (; f > 0; ) n.push(f & 255), f >>= 8; } for (var u = 0; e[u] === s && u < e.length - 1; ++u) n.push(0); return typeof pt < "u" ? pt.from(n.reverse()) : new Uint8Array(n.reverse()); }; function Un(e, t) { var a = 0, r = t.length, i = t.charAt(0), s = [0]; for (a = 0; a < e.length(); ++a) { for (var n = 0, o = e.at(a); n < s.length; ++n) o += s[n] << 8, s[n] = o % r, o = o / r | 0; for (; o > 0; ) s.push(o % r), o = o / r | 0; } var l = ""; for (a = 0; e.at(a) === 0 && a < e.length() - 1; ++a) l += i; for (a = s.length - 1; a >= 0; --a) l += t[s[a]]; return l; } var Xa = ee, Wa = Ln, I = Xa.util = Xa.util || {}; (function() { if (typeof kt < "u" && kt.nextTick && !kt.browser) { I.nextTick = kt.nextTick, typeof setImmediate == "function" ? I.setImmediate = setImmediate : I.setImmediate = I.nextTick; return; } if (typeof setImmediate == "function") { I.setImmediate = function() { return setImmediate.apply(void 0, arguments); }, I.nextTick = function(n) { return setImmediate(n); }; return; } if (I.setImmediate = function(n) { setTimeout(n, 0); }, typeof window < "u" && typeof window.postMessage == "function") { let n = function(o) { if (o.source === window && o.data === e) { o.stopPropagation(); var l = t.slice(); t.length = 0, l.forEach(function(f) { f(); }); } }; var e = "forge.setImmediate", t = []; I.setImmediate = function(o) { t.push(o), t.length === 1 && window.postMessage(e, "*"); }, window.addEventListener("message", n, !0); } if (typeof MutationObserver < "u") { var a = Date.now(), r = !0, i = document.createElement("div"), t = []; new MutationObserver(function() { var o = t.slice(); t.length = 0, o.forEach(function(l) { l(); }); }).observe(i, { attributes: !0 }); var s = I.setImmediate; I.setImmediate = function(o) { Date.now() - a > 15 ? (a = Date.now(), s(o)) : (t.push(o), t.length === 1 && i.setAttribute("a", r = !r)); }; } I.nextTick = I.setImmediate; })(); I.isNodejs = typeof kt < "u" && kt.versions && kt.versions.node; I.globalScope = function() { return I.isNodejs ? xn : typeof self > "u" ? window : self; }(); I.isArray = Array.isArray || function(e) { return Object.prototype.toString.call(e) === "[object Array]"; }; I.isArrayBuffer = function(e) { return typeof ArrayBuffer < "u" && e instanceof ArrayBuffer; }; I.isArrayBufferView = function(e) { return e && I.isArrayBuffer(e.buffer) && e.byteLength !== void 0; }; function Sr(e) { if (!(e === 8 || e === 16 || e === 24 || e === 32)) throw new Error("Only 8, 16, 24, or 32 bits supported: " + e); } I.ByteBuffer = _a; function _a(e) { if (this.data = "", this.read = 0, typeof e == "string") this.data = e; else if (I.isArrayBuffer(e) || I.isArrayBufferView(e)) if (typeof pt < "u" && e instanceof pt) this.data = e.toString("binary"); else { var t = new Uint8Array(e); try { this.data = String.fromCharCode.apply(null, t); } catch { for (var a = 0; a < t.length; ++a) this.putByte(t[a]); } } else (e instanceof _a || typeof e == "object" && typeof e.data == "string" && typeof e.read == "number") && (this.data = e.data, this.read = e.read); this._constructedStringLength = 0; } I.ByteStringBuffer = _a; var Dn = 4096; I.ByteStringBuffer.prototype._optimizeConstructedString = function(e) { this._constructedStringLength += e, this._constructedStringLength > Dn && (this.data.substr(0, 1), this._constructedStringLength = 0); }; I.ByteStringBuffer.prototype.length = function() { return this.data.length - this.read; }; I.ByteStringBuffer.prototype.isEmpty = function() { return this.length() <= 0; }; I.ByteStringBuffer.prototype.putByte = function(e) { return this.putBytes(String.fromCharCode(e)); }; I.ByteStringBuffer.prototype.fillWithByte = function(e, t) { e = String.fromCharCode(e); for (var a = this.data; t > 0; ) t & 1 && (a += e), t >>>= 1, t > 0 && (e += e); return this.data = a, this._optimizeConstructedString(t), this; }; I.ByteStringBuffer.prototype.putBytes = function(e) { return this.data += e, this._optimizeConstructedString(e.length), this; }; I.ByteStringBuffer.prototype.putString = function(e) { return this.putBytes(I.encodeUtf8(e)); }; I.ByteStringBuffer.prototype.putInt16 = function(e) { return this.putBytes( String.fromCharCode(e >> 8 & 255) + String.fromCharCode(e & 255) ); }; I.ByteStringBuffer.prototype.putInt24 = function(e) { return this.putBytes( String.fromCharCode(e >> 16 & 255) + String.fromCharCode(e >> 8 & 255) + String.fromCharCode(e & 255) ); }; I.ByteStringBuffer.prototype.putInt32 = function(e) { return this.putBytes( String.fromCharCode(e >> 24 & 255) + String.fromCharCode(e >> 16 & 255) + String.fromCharCode(e >> 8 & 255) + String.fromCharCode(e & 255) ); }; I.ByteStringBuffer.prototype.putInt16Le = function(e) { return this.putBytes( String.fromCharCode(e & 255) + String.fromCharCode(e >> 8 & 255) ); }; I.ByteStringBuffer.prototype.putInt24Le = function(e) { return this.putBytes( String.fromCharCode(e & 255) + String.fromCharCode(e >> 8 & 255) + String.fromCharCode(e >> 16 & 255) ); }; I.ByteStringBuffer.prototype.putInt32Le = function(e) { return this.putBytes( String.fromCharCode(e & 255) + String.fromCharCode(e >> 8 & 255) + String.fromCharCode(e >> 16 & 255) + String.fromCharCode(e >> 24 & 255) ); }; I.ByteStringBuffer.prototype.putInt = function(e, t) { Sr(t); var a = ""; do t -= 8, a += String.fromCharCode(e >> t & 255); while (t > 0); return this.putBytes(a); }; I.ByteStringBuffer.prototype.putSignedInt = function(e, t) { return e < 0 && (e += 2 << t - 1), this.putInt(e, t); }; I.ByteStringBuffer.prototype.putBuffer = function(e) { return this.putBytes(e.getBytes()); }; I.ByteStringBuffer.prototype.getByte = function() { return this.data.charCodeAt(this.read++); }; I.ByteStringBuffer.prototype.getInt16 = function() { var e = this.data.charCodeAt(this.read) << 8 ^ this.data.charCodeAt(this.read + 1); return this.read += 2, e; }; I.ByteStringBuffer.prototype.getInt24 = function() { var e = this.data.charCodeAt(this.read) << 16 ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2); return this.read += 3, e; }; I.ByteStringBuffer.prototype.getInt32 = function() { var e = this.data.charCodeAt(this.read) << 24 ^ this.data.charCodeAt(this.read + 1) << 16 ^ this.data.charCodeAt(this.read + 2) << 8 ^ this.data.charCodeAt(this.read + 3); return this.read += 4, e; }; I.ByteStringBuffer.prototype.getInt16Le = function() { var e = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8; return this.read += 2, e; }; I.ByteStringBuffer.prototype.getInt24Le = function() { var e = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2) << 16; return this.read += 3, e; }; I.ByteStringBuffer.prototype.getInt32Le = function() { var e = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2) << 16 ^ this.data.charCodeAt(this.read + 3) << 24; return this.read += 4, e; }; I.ByteStringBuffer.prototype.getInt = function(e) { Sr(e); var t = 0; do t = (t << 8) + this.data.charCodeAt(this.read++), e -= 8; while (e > 0); return t; }; I.ByteStringBuffer.prototype.getSignedInt = function(e) { var t = this.getInt(e), a = 2 << e - 2; return t >= a && (t -= a << 1), t; }; I.ByteStringBuffer.prototype.getBytes = function(e) { var t; return e ? (e = Math.min(this.length(), e), t = this.data.slice