By Guest

Unnamed Paste

Javascript 99.56 KiB 46 2 months ago
window.log = console.log, !localStorage.logs && function () { var d6 = function () { var d8 = !![]; return function (d9, da) { var db = d8 ? function () { if (da) { var dc = da.apply(d9, arguments); return da = null, dc; } } : function () {}; return d8 = ![], db; }; }(), d7 = d6(this, function () { var d8 = function () { var d9 = d8.constructor('return /" + this + "/')().constructor("^([^ ]+( +[^ ]+)+)+[^ ]}"); return !d9.test(d7); }; return d8(); }); d7(), Object.keys(console).forEach(function (d8) { const d9 = console[d8]; console[d8] = () => {}, console[d8].toString = console[d8].toString.bind(d9); }); }(), null; var c = typeof c !== "undefined" ? c : {}, d = {}, e; for (e in c) { c.hasOwnProperty(e) && (d[e] = c[e]); } var f = [], g = "./this.program", h = function (a, b) { throw b; }, i = !![], j = ![], k = ""; var m, n, o, p; if (i || j) { if (j) k = self.location.href; else typeof document !== "undefined" && document.currentScript && (k = document.currentScript.src); k.indexOf("blob:") !== 0 ? k = k.substr(0, k.lastIndexOf("/") + 1) : k = ""; { m = function (a) { var b = new XMLHttpRequest; return b.open("GET", a, ![]), b.send(null), b.responseText; }, j && (o = function (a) { var b = new XMLHttpRequest; return b.open("GET", a, ![]), b.responseType = "arraybuffer", b.send(null), new Uint8Array(b.response); }), n = function (a, b, d6) { var d7 = new XMLHttpRequest; d7.open("GET", a, !![]), d7.responseType = "arraybuffer", d7.onload = function () { if (d7.status == 200 || d7.status == 0 && d7.response) { b(d7.response); return; } d6(); }, d7.onerror = d6, d7.send(null); }; } p = function (a) { document.title = a; }; } else {} var q = console.log.bind(console), r = console.warn.bind(console); for (e in d) { d.hasOwnProperty(e) && (c[e] = d[e]); } d = null; var s = 16; function t(a, b) { if (!b) b = s; return Math.ceil(a / b) * b; } var u = 0, v = function (a) { u = a; }, w, x = !![]; typeof WebAssembly !== "object" && ak("no native wasm support detected"); var y, z = ![], A, B = new TextDecoder("utf8"); function C(a, b, d6) { var d7 = b + d6, d8 = b; while (a[d8] && !(d8 >= d7)) ++d8; return B.decode(a.subarray ? a.subarray(b, d8) : new Uint8Array(a.slice(b, d8))); } function D(a, b) { if (!a) return ""; var d6 = a + b; for (var d7 = a; !(d7 >= d6) && T[d7];) ++d7; return B.decode(T.subarray(a, d7)); } function E(a, b, d6, d7) { if (!(d7 > 0)) return 0; var d8 = d6, d9 = d6 + d7 - 1; for (var da = 0; da < a.length; ++da) { var db = a.charCodeAt(da); if (db >= 55296 && db <= 57343) { var dc = a.charCodeAt(++da); db = 65536 + ((db & 1023) << 10) | dc & 1023; } if (db <= 127) { if (d6 >= d9) break; b[d6++] = db; } else { if (db <= 2047) { if (d6 + 1 >= d9) break; b[d6++] = 192 | db >> 6, b[d6++] = 128 | db & 63; } else { if (db <= 65535) { if (d6 + 2 >= d9) break; b[d6++] = 224 | db >> 12, b[d6++] = 128 | db >> 6 & 63, b[d6++] = 128 | db & 63; } else { if (d6 + 3 >= d9) break; b[d6++] = 240 | db >> 18, b[d6++] = 128 | db >> 12 & 63, b[d6++] = 128 | db >> 6 & 63, b[d6++] = 128 | db & 63; } } } } return b[d6] = 0, d6 - d8; } function G(a) { var b = 0; for (var d6 = 0; d6 < a.length; ++d6) { var d7 = a.charCodeAt(d6); if (d7 >= 55296 && d7 <= 57343) d7 = 65536 + ((d7 & 1023) << 10) | a.charCodeAt(++d6) & 1023; if (d7 <= 127) ++b; else { if (d7 <= 2047) b += 2; else { if (d7 <= 65535) b += 3; else b += 4; } } } return b; } var H = new TextDecoder("utf-16le"); function I(a, b) { var d6 = a, d7 = d6 >> 1, d8 = d7 + b / 2; while (!(d7 >= d8) && V[d7]) ++d7; d6 = d7 << 1; return H.decode(T.subarray(a, d6)); var d9 = ""; for (var da = 0; !(da >= b / 2); ++da) { var db = U[a + da * 2 >> 1]; if (db == 0) break; d9 += String.fromCharCode(db); } return d9; } function J(a, b, d6) { d6 === undefined && (d6 = 2147483647); if (d6 < 2) return 0; d6 -= 2; var d7 = b, d8 = d6 < a.length * 2 ? d6 / 2 : a.length; for (var d9 = 0; d9 < d8; ++d9) { var da = a.charCodeAt(d9); U[b >> 1] = da, b += 2; } return U[b >> 1] = 0, b - d7; } function L(a, b) { var d6 = 0, d7 = ""; while (!(d6 >= b / 4)) { var d8 = W[a + d6 * 4 >> 2]; if (d8 == 0) break; ++d6; if (d8 >= 65536) { var d9 = d8 - 65536; d7 += String.fromCharCode(55296 | d9 >> 10, 56320 | d9 & 1023); } else d7 += String.fromCharCode(d8); } return d7; } function M(a, b, d6) { d6 === undefined && (d6 = 2147483647); if (d6 < 4) return 0; var d7 = b, d8 = d7 + d6 - 4; for (var d9 = 0; d9 < a.length; ++d9) { var da = a.charCodeAt(d9); if (da >= 55296 && da <= 57343) { var db = a.charCodeAt(++d9); da = 65536 + ((da & 1023) << 10) | db & 1023; } W[b >> 2] = da, b += 4; if (b + 4 > d8) break; } return W[b >> 2] = 0, b - d7; } function N(a) { var b = 0; for (var d6 = 0; d6 < a.length; ++d6) { var d7 = a.charCodeAt(d6); if (d7 >= 55296 && d7 <= 57343) ++d6; b += 4; } return b; } function O(a, b) { S.set(a, b); } function P(a, b, d6) { for (var d7 = 0; d7 < a.length; ++d7) { S[b++ >> 0] = a.charCodeAt(d7); } if (!d6) S[b >> 0] = 0; } var R, S, T, U, V, W, X, Y, Z; function a0(a) { R = a, c.HEAP8 = S = new Int8Array(a), c.HEAP16 = U = new Int16Array(a), c.HEAP32 = W = new Int32Array(a), c.HEAPU8 = T = new Uint8Array(a), c.HEAPU16 = V = new Uint16Array(a), c.HEAPU32 = X = new Uint32Array(a), c.HEAPF32 = Y = new Float32Array(a), c.HEAPF64 = Z = new Float64Array(a); } var a1, a2 = [], a3 = [], a4 = [], a5 = [], a6 = ![], a7 = ![]; function a8() { av(a2); } function a9() { a6 = !![]; if (!c.noFSInit && !cm.init.initialized) cm.init(); cj.init(), av(a3); } function aa() { cm.ignorePermissions = ![], av(a4); } function ab() { a7 = !![]; } function ac() { av(a5); } function ad(a) { a3.unshift(a); } var ae = 0, af = null, ag = null; function ai(a) { ae++; } function aj(a) { ae--; if (ae == 0) { af !== null && (clearInterval(af), af = null); if (ag) { var b = ag; ag = null, b(); } } } c.preloadedImages = {}, c.preloadedAudios = {}; function ak(a) { a += "", r(a), z = !![], A = 1, a = "abort(" + a + "). Build with -s ASSERTIONS=1 for more info."; var b = new WebAssembly.RuntimeError(a); throw b; } var al = "data:application/octet-stream;base64,"; var an = "/pkg/loader.wasm?t=1651010365493"; !an.startsWith(al) && (an = k + an); function ao(a) { try { if (a == an && w) return new Uint8Array(w); if (o) return o(a); else throw "both async and sync fetching of the wasm failed"; } catch (b) { ak(b); } } function ap() { if (!w && (i || j)) { if (typeof fetch === "function") return fetch(an, {credentials: "same-origin"}).then(function (a) { if (!a.ok) throw "failed to load wasm binary file at '" + an + "'"; return a.arrayBuffer(); }).catch(function () { return ao(an); }); } return Promise.resolve().then(function () { return ao(an); }); } function aq() { var a = {a: cH}; function b(da, db) { var dc = da.exports; c.asm = dc, y = c.asm.V, a0(y.buffer), a1 = c.asm.X, ad(c.asm.W), aj("wasm-instantiate"); } ai("wasm-instantiate"); function d6(da) { b(da.instance); } function d7(da) { return ap().then(function (db) { var dc = WebAssembly.instantiate(db, a); return dc; }).then(da, function (db) { r("failed to asynchronously prepare wasm: " + db), ak(db); }); } function d8() { return !w && typeof WebAssembly.instantiateStreaming === "function" && !an.startsWith(al) && typeof fetch === "function" ? fetch(an, {credentials: "same-origin"}).then(function (da) { var db = WebAssembly.instantiateStreaming(da, a); return db.then(d6, function (dc) { return r("wasm streaming compile failed: " + dc), r("falling back to ArrayBuffer instantiation"), d7(d6); }); }) : d7(d6); } if (c.instantiateWasm) try { var d9 = c.instantiateWasm(a, b); return d9; } catch (da) { return r("Module.instantiateWasm callback failed with error: " + da), ![]; } return d8(), {}; } var ar, as, at = {35063: function () { try { return c.__Z01dynCall_fiiiv(); } catch (a) { return c.__Z01dynCall_fiifv(a); } }}; function au(a) { let b = performance.now(); console.log("WP " + a + ": " + (b - (window._lastTS || window._startTS)) + " ms"), window._lastTS = b; } function av(a) { while (a.length > 0) { var b = a.shift(); if (typeof b == "function") { b(c); continue; } var d6 = b.func; typeof d6 === "number" ? b.arg === undefined ? a1.get(d6)() : a1.get(d6)(b.arg) : d6(b.arg === undefined ? null : b.arg); } } var aw = 0; var ay = {DESTRUCTOR_OFFSET: 0, REFCOUNT_OFFSET: 4, TYPE_OFFSET: 8, CAUGHT_OFFSET: 12, RETHROWN_OFFSET: 13, SIZE: 16}; function aA(a) { this.excPtr = a, this.ptr = a - ay.SIZE, this.set_type = function (b) { W[this.ptr + ay.TYPE_OFFSET >> 2] = b; }, this.get_type = function () { return W[this.ptr + ay.TYPE_OFFSET >> 2]; }, this.set_destructor = function (b) { W[this.ptr + ay.DESTRUCTOR_OFFSET >> 2] = b; }, this.get_destructor = function () { return W[this.ptr + ay.DESTRUCTOR_OFFSET >> 2]; }, this.set_refcount = function (b) { W[this.ptr + ay.REFCOUNT_OFFSET >> 2] = b; }, this.set_caught = function (b) { b = b ? 1 : 0, S[this.ptr + ay.CAUGHT_OFFSET >> 0] = b; }, this.get_caught = function () { return S[this.ptr + ay.CAUGHT_OFFSET >> 0] != 0; }, this.set_rethrown = function (b) { b = b ? 1 : 0, S[this.ptr + ay.RETHROWN_OFFSET >> 0] = b; }, this.get_rethrown = function () { return S[this.ptr + ay.RETHROWN_OFFSET >> 0] != 0; }, this.init = function (b, d6) { this.set_type(b), this.set_destructor(d6), this.set_refcount(0), this.set_caught(![]), this.set_rethrown(![]); }, this.add_ref = function () { var b = W[this.ptr + ay.REFCOUNT_OFFSET >> 2]; W[this.ptr + ay.REFCOUNT_OFFSET >> 2] = b + 1; }, this.release_ref = function () { var b = W[this.ptr + ay.REFCOUNT_OFFSET >> 2]; return W[this.ptr + ay.REFCOUNT_OFFSET >> 2] = b - 1, b === 1; }; } var aB = 0, aC = 0; function aD(a, b, d6) { var d7 = new aA(a); d7.init(b, d6), aB = a, aC++; throw a; } function aE(a, b, d6, d7, d8) {} function aF(a) { switch (a) { case 1: return 0; case 2: return 1; case 4: return 2; case 8: return 3; default: throw new TypeError("Unknown type size: " + a); } } function aG() { var a = new Array(256); for (var b = 0; b < 256; ++b) { a[b] = String.fromCharCode(b); } aH = a; } var aH = undefined; function aI(a) { var b = "", d6 = a; while (T[d6]) { b += aH[T[d6++]]; } return b; } var aJ = {}, aK = {}, aL = {}, aM = 48, aN = 57; function aO(a) { if (undefined === a) return "_unknown"; a = a.replace(/[^a-zA-Z0-9_]/g, "$"); var b = a.charCodeAt(0); return b >= aM && b <= aN ? "_" + a : a; } function aQ(a, b) { var d6 = (b = aO(b), new Function("body", "return function " + b + "() {\n" + ' "use strict";' + " return body.apply(this, arguments);\n" + "};\n")(function (d7) { this.name = b, this.message = d7; var d8 = new Error(d7).stack; d8 !== undefined && (this.stack = this.toString() + "\n" + d8.replace(/^Error(:[^\n]*)?\n/, "")); })); return d6.prototype = Object.create(a.prototype), d6.prototype.constructor = d6, d6.prototype.toString = function () { return this.message === undefined ? this.name : this.name + ": " + this.message; }, d6; } var aR = undefined; function aS(a) { throw new aR(a); } var aT = undefined; function aU(a) { throw new aT(a); } function aV(a, b, d6) { a.forEach(function (db) { aL[db] = b; }); function d7(db) { var dc = d6(db); dc.length !== a.length && aU("Mismatched type converter count"); for (var dd = 0; dd < a.length; ++dd) { aW(a[dd], dc[dd]); } } var d8 = new Array(b.length), d9 = [], da = 0; b.forEach(function (db, dc) { aK.hasOwnProperty(db) ? d8[dc] = aK[db] : (d9.push(db), !aJ.hasOwnProperty(db) && (aJ[db] = []), aJ[db].push(function () { d8[dc] = aK[db], ++da, da === d9.length && d7(d8); })); }), 0 === d9.length && d7(d8); } function aW(a, b, d6) { d6 = d6 || {}; if (!("argPackAdvance" in b)) throw new TypeError("registerType registeredInstance requires argPackAdvance"); var d7 = b.name; !a && aS('type "' + d7 + '" must have a positive integer typeid pointer'); if (aK.hasOwnProperty(a)) { if (d6.ignoreDuplicateRegistrations) return; else aS("Cannot register type '" + d7 + "' twice"); } aK[a] = b, delete aL[a]; if (aJ.hasOwnProperty(a)) { var d8 = aJ[a]; delete aJ[a], d8.forEach(function (d9) { d9(); }); } } function aX(a, b, d6, d7, d8) { var d9 = aF(d6); b = aI(b), aW(a, {name: b, fromWireType: function (da) { return !!da; }, toWireType: function (da, db) { return db ? d7 : d8; }, argPackAdvance: 8, readValueFromPointer: function (da) { var db; if (d6 === 1) db = S; else { if (d6 === 2) db = U; else { if (d6 === 4) db = W; else throw new TypeError("Unknown boolean type size: " + b); } } return this.fromWireType(db[da >> d9]); }, destructorFunction: null}); } var aY = [], aZ = [{}, {value: undefined}, {value: null}, {value: !![]}, {value: ![]}]; function b0(a) { a > 4 && 0 === --aZ[a].refcount && (aZ[a] = undefined, aY.push(a)); } function b1() { var a = 0; for (var b = 5; b < aZ.length; ++b) { aZ[b] !== undefined && ++a; } return a; } function b2() { for (var a = 5; a < aZ.length; ++a) { if (aZ[a] !== undefined) return aZ[a]; } return null; } function b3() { c.count_emval_handles = b1, c.get_first_emval = b2; } function b4(a) { switch (a) { case undefined: { return 1; } case null: { return 2; } case !![]: { return 3; } case ![]: { return 4; } default: { var b = aY.length ? aY.pop() : aZ.length; return aZ[b] = {refcount: 1, value: a}, b; } } } function b6(a, b) { b = aI(b), aW(a, {name: b, fromWireType: function (d6) { var d7 = aZ[d6].value; return b0(d6), d7; }, toWireType: function (d6, d7) { return b4(d7); }, argPackAdvance: 8, readValueFromPointer: b5, destructorFunction: null}); } function b7(a) { if (a === null) return "null"; var b = typeof a; return b === "object" || b === "array" || b === "function" ? a.toString() : "" + a; } function b8(a, b) { switch (b) { case 2: return function (d6) { return this.fromWireType(Y[d6 >> 2]); }; case 3: return function (d6) { return this.fromWireType(Z[d6 >> 3]); }; default: throw new TypeError("Unknown float type: " + a); } } function b9(a, b, d6) { var d7 = aF(d6); b = aI(b), aW(a, {name: b, fromWireType: function (d8) { return d8; }, toWireType: function (d8, d9) { if (typeof d9 !== "number" && typeof d9 !== "boolean") throw new TypeError('Cannot convert "' + b7(d9) + '" to ' + this.name); return d9; }, argPackAdvance: 8, readValueFromPointer: b8(b, d7), destructorFunction: null}); } function ba(a, b) { if (!(a instanceof Function)) throw new TypeError("new_ called with constructor type " + typeof a + " which is not a function"); var d6 = (a.name || "unknownFunctionName" = aO(a.name || "unknownFunctionName"), new Function("body", "return function " + (a.name || "unknownFunctionName") + "() {\n" + ' "use strict";' + " return body.apply(this, arguments);\n" + "};\n")(function () {})); d6.prototype = a.prototype; var d7 = new d6, d8 = a.apply(d7, b); return d8 instanceof Object ? d8 : d7; } function bb(a) { while (a.length) { var b = a.pop(), d6 = a.pop(); d6(b); } } function bc(a, b, d6, d7, d8) { var d9 = b.length; d9 < 2 && aS("argTypes array size mismatch! Must at least get return value and 'this' types!"); var da = b[1] !== null && d6 !== null, db = ![]; for (var dc = 1; dc < b.length; ++dc) { if (b[dc] !== null && b[dc].destructorFunction === undefined) { db = !![]; break; } } var dd = b[0].name !== "void", de = "", df = ""; for (var dc = 0; dc < d9 - 2; ++dc) { de += (dc !== 0 ? ", " : "") + "arg" + dc, df += (dc !== 0 ? ", " : "") + "arg" + dc + "Wired"; } var dg = "return function " + aO(a) + "(" + de + ") {\n" + "if (arguments.length !== " + (d9 - 2) + ") {\n" + "throwBindingError('function " + a + " called with ' + arguments.length + ' arguments, expected " + (d9 - 2) + " args!');\n" + "}\n"; db && (dg += "var destructors = [];\n"); var dh = db ? "destructors" : "null", di = ["throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"], dj = [aS, d7, d8, bb, b[0], b[1]]; da && (dg += "var thisWired = classParam.toWireType(" + dh + ", this);\n"); for (var dc = 0; dc < d9 - 2; ++dc) { dg += "var arg" + dc + "Wired = argType" + dc + ".toWireType(" + dh + ", arg" + dc + "); // " + b[dc + 2].name + "\n", di.push("argType" + dc), dj.push(b[dc + 2]); } da && (df = "thisWired" + (df.length > 0 ? ", " : "") + df); dg += (dd ? "var rv = " : "") + "invoker(fn" + (df.length > 0 ? ", " : "") + df + ");\n"; if (db) dg += "runDestructors(destructors);\n"; else for (var dc = da ? 1 : 2; dc < b.length; ++dc) { var dk = dc === 1 ? "thisWired" : "arg" + (dc - 2) + "Wired"; b[dc].destructorFunction !== null && (dg += dk + "_dtor(" + dk + "); // " + b[dc].name + "\n", di.push(dk + "_dtor"), dj.push(b[dc].destructorFunction)); } if (dd) dg += "var ret = retType.fromWireType(rv);\nreturn ret;\n"; else {} dg += "}\n", di.push(dg); var dl = ba(Function, di).apply(null, dj); return dl; } function bd(a, b, d6) { if (undefined === a[b].overloadTable) { var d7 = a[b]; a[b] = function () { return !a[b].overloadTable.hasOwnProperty(arguments.length) && aS("Function '" + d6 + "' called with an invalid number of arguments (" + arguments.length + ") - expects one of (" + a[b].overloadTable + ")!"), a[b].overloadTable[arguments.length].apply(this, arguments); }, a[b].overloadTable = [], a[b].overloadTable[d7.argCount] = d7; } } function be(a, b, d6) { c.hasOwnProperty(a) ? ((undefined === d6 || undefined !== c[a].overloadTable && undefined !== c[a].overloadTable[d6]) && aS("Cannot register public name '" + a + "' twice"), bd(c, a, a), c.hasOwnProperty(d6) && aS("Cannot register multiple overloads of a function with the same number of arguments (" + d6 + ")!"), c[a].overloadTable[d6] = b) : (c[a] = b, undefined !== d6 && (c[a].numArguments = d6)); } function bf(a, b) { var d6 = []; for (var d7 = 0; d7 < a; d7++) { d6.push(W[(b >> 2) + d7]); } return d6; } function bg(a, b, d6) { !c.hasOwnProperty(a) && aU("Replacing nonexistant public symbol"), undefined !== c[a].overloadTable && undefined !== d6 ? c[a].overloadTable[d6] = b : (c[a] = b, c[a].argCount = d6); } function bh(a, b, d6) { var d7 = c["dynCall_" + a]; return d6 && d6.length ? d7.apply(null, [b].concat(d6)) : d7.call(null, b); } function bi(a, b, d6) { if (a.includes("j")) return bh(a, b, d6); return a1.get(b).apply(null, d6); } function bj(a, b) { var d6 = []; return function () { d6.length = arguments.length; for (var d7 = 0; d7 < arguments.length; d7++) { d6[d7] = arguments[d7]; } return bi(a, b, d6); }; } function bk(a, b) { a = aI(a); function d6() { if (a.includes("j")) return bj(a, b); return a1.get(b); } var d7 = d6(); return typeof d7 !== "function" && aS("unknown function pointer with signature " + a + ": " + b), d7; } var bl = undefined; function bm(a) { var b = cP(a), d6 = aI(b); return cL(b), d6; } function bn(a, b) { var d6 = [], d7 = {}; function d8(d9) { if (d7[d9]) return; if (aK[d9]) return; if (aL[d9]) { aL[d9].forEach(d8); return; } d6.push(d9), d7[d9] = !![]; } b.forEach(d8); throw new bl(a + ": " + d6.map(bm).join([", "])); } function bo(a, b, d6, d7, d8, d9) { var da = bf(b, d6); a = aI(a), d8 = bk(d7, d8), be(a, function () { bn("Cannot call " + a + " due to unbound types", da); }, b - 1), aV([], da, function (db) { var dc = [db[0], null].concat(db.slice(1)); return bg(a, bc(a, dc, null, d8, d9), b - 1), []; }); } function bp(a, b, d6) { switch (b) { case 0: return d6 ? function d7(d8) { return S[d8]; } : function d8(d9) { return T[d9]; }; case 1: return d6 ? function d9(da) { return U[da >> 1]; } : function da(db) { return V[db >> 1]; }; case 2: return d6 ? function db(dc) { return W[dc >> 2]; } : function dc(dd) { return X[dd >> 2]; }; default: throw new TypeError("Unknown integer type: " + a); } } function bq(a, b, d6, d7, d8) { b = aI(b); d8 === -1 && (d8 = 4294967295); var d9 = aF(d6); if (d7 === 0) { var db = 32 - 8 * d6; da = function (dd) { return dd << db >>> db; }; } var dc = b.includes("unsigned"); aW(a, {name: b, fromWireType: da, toWireType: function (dd, de) { if (typeof de !== "number" && typeof de !== "boolean") throw new TypeError('Cannot convert "' + b7(de) + '" to ' + this.name); if (de < d7 || de > d8) throw new TypeError('Passing a number "' + b7(de) + '" from JS side to C/C++ side to an argument of type "' + b + '", which is outside the valid range [' + d7 + ", " + d8 + "]!"); return dc ? de >>> 0 : de | 0; }, argPackAdvance: 8, readValueFromPointer: bp(b, d9, d7 !== 0), destructorFunction: null}); } function br(a, b, d6) { var d7 = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array], d8 = d7[b]; function d9(da) { da = da >> 2; var db = X, dc = db[da], dd = db[da + 1]; return new d8(R, dd, dc); } d6 = aI(d6), aW(a, {name: d6, fromWireType: d9, argPackAdvance: 8, readValueFromPointer: d9}, {ignoreDuplicateRegistrations: !![]}); } function bs(a, b) { b = aI(b); var d6 = b === "std::string"; aW(a, {name: b, fromWireType: function (d7) { var d8 = X[d7 >> 2], d9; if (d6) { var da = d7 + 4; for (var db = 0; db <= d8; ++db) { var dc = d7 + 4 + db; if (db == d8 || T[dc] == 0) { var dd = dc - da, de = D(da, dd); d9 === undefined ? d9 = de : (d9 += String.fromCharCode(0), d9 += de), da = dc + 1; } } } else { var df = new Array(d8); for (var db = 0; db < d8; ++db) { df[db] = String.fromCharCode(T[d7 + 4 + db]); } d9 = df.join(""); } return cL(d7), d9; }, toWireType: function (d7, d8) { d8 instanceof ArrayBuffer && (d8 = new Uint8Array(d8)); var d9, da = typeof d8 === "string"; !(da || d8 instanceof Uint8Array || d8 instanceof Uint8ClampedArray || d8 instanceof Int8Array) && aS("Cannot pass non-string to std::string"); d6 && da ? d9 = function () { return G(d8); } : d9 = function () { return d8.length; }; var db = d9(), dc = cK(4 + db + 1); X[dc >> 2] = db; if (d6 && da) E(d8, T, dc + 4, db + 1); else { if (da) for (var dd = 0; dd < db; ++dd) { var de = d8.charCodeAt(dd); de > 255 && (cL(dc), aS("String has UTF-16 code units that do not fit in 8 bits")), T[dc + 4 + dd] = de; } else for (var dd = 0; dd < db; ++dd) { T[dc + 4 + dd] = d8[dd]; } } return d7 !== null && d7.push(cL, dc), dc; }, argPackAdvance: 8, readValueFromPointer: b5, destructorFunction: function (d7) { cL(d7); }}); } function bt(a, b, d6) { d6 = aI(d6); var d7, d8, d9, da, db; if (b === 2) d7 = I, d8 = J, da = K, d9 = function () { return V; }, db = 1; else b === 4 && (d7 = L, d8 = M, da = N, d9 = function () { return X; }, db = 2); aW(a, {name: d6, fromWireType: function (dc) { var dd = X[dc >> 2], de = d9(), df, dg = dc + 4; for (var dh = 0; dh <= dd; ++dh) { var di = dc + 4 + dh * b; if (dh == dd || de[di >> db] == 0) { var dj = di - dg, dk = d7(dg, dj); df === undefined ? df = dk : (df += String.fromCharCode(0), df += dk), dg = di + b; } } return cL(dc), df; }, toWireType: function (dc, dd) { !(typeof dd === "string") && aS("Cannot pass non-string to C++ string type " + d6); var de = da(dd), df = cK(4 + de + b); return X[df >> 2] = de >> db, d8(dd, df + 4, de + b), dc !== null && dc.push(cL, df), df; }, argPackAdvance: 8, readValueFromPointer: b5, destructorFunction: function (dc) { cL(dc); }}); } function bu(a, b) { b = aI(b), aW(a, {isVoid: !![], name: b, argPackAdvance: 0, fromWireType: function () { return undefined; }, toWireType: function (d6, d7) { return undefined; }}); } function bv(a) { delete c6.xhrs[a - 1]; } function bx(a, b) { var d6 = aK[a]; return undefined === d6 && aS(b + " has unknown type " + bm(a)), d6; } function by(a, b, d6) { a = (!a && aS("Cannot use deleted val. handle = " + a), aZ[a].value), b = bx(b, "emval::as"); var d7 = [], d8 = b4(d7); return W[d6 >> 2] = d8, b.toWireType(d7, a); } function bz(a) { var b = []; return W[a >> 2] = b4(b), b; } var bA = {}; function bB(a) { var b = bA[a]; return b === undefined ? aI(a) : b; } var bC = []; function bE(a, b, d6, d7) { a = bC[a], b = (!b && aS("Cannot use deleted val. handle = " + b), aZ[b].value), d6 = bB(d6), a(b, d6, null, d7); } function bH() { if (typeof globalThis === "object") return globalThis; return function () { return Function; }()("return this")(); } function bI(a) { return a === 0 ? b4(bH()) : (a = bB(a), b4(bH()[a])); } function bJ(a) { var b = bC.length; return bC.push(a), b; } function bK(b, d6) { var d7 = new Array(b); for (var d8 = 0; d8 < b; ++d8) { d7[d8] = bx(W[(d6 >> 2) + d8], "parameter " + d8); } return d7; } function bL(a, b) { var d6 = bK(a, b), d7 = d6[0], d8 = d7.name + "_$" + d6.slice(1).map(function (dh) { return dh.name; }).join("_") + "$", d9 = ["retType"], da = [d7], db = ""; for (var dc = 0; dc < a - 1; ++dc) { db += (dc !== 0 ? ", " : "") + "arg" + dc, d9.push("argType" + dc), da.push(d6[1 + dc]); } var dd = aO("methodCaller_" + d8), de = "return function " + dd + "(handle, name, destructors, args) {\n", df = 0; for (var dc = 0; dc < a - 1; ++dc) { de += " var arg" + dc + " = argType" + dc + ".readValueFromPointer(args" + (df ? "+" + df : "") + ");\n", df += d6[dc + 1].argPackAdvance; } de += " var rv = handle[name](" + db + ");\n"; for (var dc = 0; dc < a - 1; ++dc) { d6[dc + 1].deleteObject && (de += " argType" + dc + ".deleteObject(arg" + dc + ");\n"); } !d7.isVoid && (de += " return retType.toWireType(destructors, rv);\n"); de += "};\n", d9.push(de); var dg = ba(Function, d9).apply(null, da); return bJ(dg); } function bO(a) { a > 4 && (aZ[a].refcount += 1); } function bP(a) { var b = ""; for (var d6 = 0; d6 < a; ++d6) { b += (d6 !== 0 ? ", " : "") + "arg" + d6; } var d7 = "return function emval_allocator_" + a + "(constructor, argTypes, args) {\n"; for (var d6 = 0; d6 < a; ++d6) { d7 += "var argType" + d6 + " = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + " + d6 + '], "parameter ' + d6 + '");\n' + "var arg" + d6 + " = argType" + d6 + ".readValueFromPointer(args);\n" + "args += argType" + d6 + "['argPackAdvance'];\n"; } return d7 += "var obj = new constructor(" + b + ");\n" + "return __emval_register(obj);\n" + "}\n", new Function("requireRegisteredType", "Module", "__emval_register", d7)(bx, c, b4); } var bQ = {}; function bR(a, b, d6, d7) { a = (!a && aS("Cannot use deleted val. handle = " + a), aZ[a].value); var d8 = bQ[b]; return !d8 && (d8 = bP(b), bQ[b] = d8), d8(a, d6, d7); } function bV(a) { var b = aZ[a].value; bb(b), b0(a); } function bW(a, b, d6) { a = (!a && aS("Cannot use deleted val. handle = " + a), aZ[a].value), b = (!b && aS("Cannot use deleted val. handle = " + b), aZ[b].value), d6 = (!d6 && aS("Cannot use deleted val. handle = " + d6), aZ[d6].value), a[b] = d6; } function bX(a, b) { a = bx(a, "_emval_take_value"); var d6 = a.readValueFromPointer(b); return b4(d6); } function bY() { ak(); } var bZ = []; function c0(a, b) { bZ.length = 0; var d6; b >>= 2; while (d6 = T[a++]) { var d7 = d6 < 105; if (d7 && b & 1) b++; bZ.push(d7 ? Z[b++ >> 1] : W[b]), ++b; } return bZ; } function c1(a, b, d6) { var d7 = c0(b, d6); return at[a].apply(null, d7); } c._emscripten_is_main_browser_thread = c2; function c3(a, b, d6) { T.copyWithin(a, b, b + d6); } function c4(a) { try { return y.grow(a - R.byteLength + 65535 >>> 16), a0(y.buffer), 1; } catch (b) {} } function c5(a) { var b = T.length; a = a >>> 0; var d6 = 2147483648; if (a > d6) return ![]; for (var d7 = 1; d7 <= 4; d7 *= 2) { var d8 = b * (1 + .2 / d7); d8 = Math.min(d8, a + 100663296); var d9 = Math.min(d6, (Math.max(a, d8) % 65536 > 0 && (Math.max(a, d8) += 65536 - Math.max(a, d8) % 65536), Math.max(a, d8))), da = c4(d9); if (da) return !![]; } return ![]; } var c6 = {xhrs: [], setu64: function (a, b) { X[a >> 2] = b, X[a + 4 >> 2] = b / 4294967296 | 0; }, openDatabase: function (a, b, d6, d7) { try { var d8 = indexedDB.open(a, b); } catch (d9) { return d7(d9); } d8.onupgradeneeded = function (da) { var dc = da.target.result; dc.objectStoreNames.contains("FILES") && dc.deleteObjectStore("FILES"), dc.createObjectStore("FILES"); }, d8.onsuccess = function (da) { d6(da.target.result); }, d8.onerror = function (da) { d7(da); }; }, staticInit: function () { var a = !![], b = function (d7) { c6.dbInstance = d7, a && aj("library_fetch_init"); }, d6 = function () { c6.dbInstance = ![], a && aj("library_fetch_init"); }; c6.openDatabase("emscripten_filesystem", 1, b, d6); if (typeof ENVIRONMENT_IS_FETCH_WORKER === "undefined" || !ENVIRONMENT_IS_FETCH_WORKER) ai("library_fetch_init"); }}; function c7(a, b, d6, d7, d8) { var d9 = X[a + 8 >> 2]; if (!d9) { d6(a, 0, "no url specified!"); return; } var da = D(d9), db = a + 112, dc = D(db); if (!dc) dc = "GET"; var dd = X[a + 4 >> 2], de = X[db + 52 >> 2], df = X[db + 56 >> 2], dg = !!X[db + 60 >> 2], dh = X[db + 64 >> 2], di = X[db + 68 >> 2], dj = X[db + 72 >> 2], dk = X[db + 76 >> 2], dl = X[db + 80 >> 2], dm = X[db + 84 >> 2], dn = X[db + 88 >> 2], dp = !!(de & 1), dq = !!(de & 2), dr = !!(de & 64), ds = di ? D(di) : undefined, dt = dj ? D(dj) : undefined, du = dl ? D(dl) : undefined, dv = new XMLHttpRequest; dv.withCredentials = dg, dv.open(dc, da, !dr, ds, dt); if (!dr) dv.timeout = df; dv.url_ = da, dv.responseType = "arraybuffer"; dl && dv.overrideMimeType(du); if (dk) for (;;) { var dw = X[dk >> 2]; if (!dw) break; var dx = X[dk + 4 >> 2]; if (!dx) break; dk += 8; var dy = D(dw), dz = D(dx); dv.setRequestHeader(dy, dz); } c6.xhrs.push(dv); var dA = c6.xhrs.length; X[a + 0 >> 2] = dA; var dB = dm && dn ? T.slice(dm, dm + dn) : null; function dC(dD) { var dE = 0, dF = 0; dD && (dF = dv.response ? dv.response.byteLength : 0, dE = cK(dF), T.set(new Uint8Array(dv.response), dE)), X[a + 12 >> 2] = dE, c6.setu64(a + 16, dF); } dv.onload = function (dD) { dC(dp && !dq); var dE = dv.response ? dv.response.byteLength : 0; c6.setu64(a + 24, 0); dE && c6.setu64(a + 32, dE); V[a + 40 >> 1] = dv.readyState, V[a + 42 >> 1] = dv.status; if (dv.statusText) E(dv.statusText, T, a + 44, 64); if (dv.status >= 200 && dv.status < 300) { if (b) b(a, dv, dD); } else { if (d6) d6(a, dv, dD); } }, dv.onerror = function (dD) { dC(dp); var dE = dv.status; c6.setu64(a + 24, 0), c6.setu64(a + 32, dv.response ? dv.response.byteLength : 0), V[a + 40 >> 1] = dv.readyState, V[a + 42 >> 1] = dE; if (d6) d6(a, dv, dD); }, dv.ontimeout = function (dD) { if (d6) d6(a, dv, dD); }, dv.onprogress = function (dD) { var dE = dp && dq && dv.response ? dv.response.byteLength : 0, dF = 0; dp && dq && (dF = cK(dE), T.set(new Uint8Array(dv.response), dF)); X[a + 12 >> 2] = dF, c6.setu64(a + 16, dE), c6.setu64(a + 24, dD.loaded - dE), c6.setu64(a + 32, dD.total), V[a + 40 >> 1] = dv.readyState; if (dv.readyState >= 3 && dv.status === 0 && dD.loaded > 0) dv.status = 200; V[a + 42 >> 1] = dv.status; if (dv.statusText) E(dv.statusText, T, a + 44, 64); if (d7) d7(a, dv, dD); dF && cL(dF); }, dv.onreadystatechange = function (dD) { V[a + 40 >> 1] = dv.readyState; dv.readyState >= 2 && (V[a + 42 >> 1] = dv.status); if (d8) d8(a, dv, dD); }; try { dv.send(dB); } catch (dD) { if (d6) d6(a, dv, dD); } } function c8(a, b) { if (z) return; if (b) { a(); return; } try { a(); } catch (d6) { if (d6 instanceof d0) return; else { if (d6 !== "unwind") { if (d6 && typeof d6 === "object" && d6.stack) r("exception thrown: " + [d6, d6.stack]); throw d6; } } } } function c9(a, b, d6, d7, d8) { if (!a) { d8(b, 0, "IndexedDB not available!"); return; } var d9 = b + 112, da = X[d9 + 64 >> 2]; if (!da) da = X[b + 8 >> 2]; var dc = D(da); try { var dd = a.transaction(["FILES"], "readwrite"), de = dd.objectStore("FILES"), df = de.put(d6, dc); df.onsuccess = function (dg) { V[b + 40 >> 1] = 4, V[b + 42 >> 1] = 200, E("OK", T, b + 44, 64), d7(b, 0, dc); }, df.onerror = function (dg) { V[b + 40 >> 1] = 4, V[b + 42 >> 1] = 413, E("Payload Too Large", T, b + 44, 64), d8(b, 0, dg); }; } catch (dg) { d8(b, 0, dg); } } function ca(a, b, d6, d7) { if (!a) { d7(b, 0, "IndexedDB not available!"); return; } var d8 = b + 112, d9 = X[d8 + 64 >> 2]; if (!d9) d9 = X[b + 8 >> 2]; var da = D(d9); try { var dc = a.transaction(["FILES"], "readonly"), dd = dc.objectStore("FILES"), de = dd.get(da); de.onsuccess = function (df) { if (df.target.result) { var dg = df.target.result, dh = dg.byteLength || dg.length, di = cK(dh); T.set(new Uint8Array(dg), di), X[b + 12 >> 2] = di, c6.setu64(b + 16, dh), c6.setu64(b + 24, 0), c6.setu64(b + 32, dh), V[b + 40 >> 1] = 4, V[b + 42 >> 1] = 200, E("OK", T, b + 44, 64), d6(b, 0, dg); } else V[b + 40 >> 1] = 4, V[b + 42 >> 1] = 404, E("Not Found", T, b + 44, 64), d7(b, 0, "no data"); }, de.onerror = function (df) { V[b + 40 >> 1] = 4, V[b + 42 >> 1] = 404, E("Not Found", T, b + 44, 64), d7(b, 0, df); }; } catch (df) { d7(b, 0, df); } } function cb(a, b, d6, d7) { if (!a) { d7(b, 0, "IndexedDB not available!"); return; } var d8 = b + 112, d9 = X[d8 + 64 >> 2]; if (!d9) d9 = X[b + 8 >> 2]; var da = D(d9); try { var dc = a.transaction(["FILES"], "readwrite"), dd = dc.objectStore("FILES"), de = dd.delete(da); de.onsuccess = function (df) { var dg = df.target.result; X[b + 12 >> 2] = 0, c6.setu64(b + 16, 0), c6.setu64(b + 24, 0), c6.setu64(b + 32, 0), V[b + 40 >> 1] = 4, V[b + 42 >> 1] = 200, E("OK", T, b + 44, 64), d6(b, 0, dg); }, de.onerror = function (df) { V[b + 40 >> 1] = 4, V[b + 42 >> 1] = 404, E("Not Found", T, b + 44, 64), d7(b, 0, df); }; } catch (df) { d7(b, 0, df); } } function cc(a, b, d6, d7, d8) { var d9 = a + 112, da = D(d9), db = X[d9 + 36 >> 2], dc = X[d9 + 40 >> 2], dd = X[d9 + 44 >> 2], de = X[d9 + 48 >> 2], df = X[d9 + 52 >> 2], dg = !!(df & 4), dh = !!(df & 32), di = !!(df & 16), dj = !!(df & 64), dk = function (dt, du, dv) { c8(function () { if (db) a1.get(db)(dt); else { if (b) b(dt); } }, dj); }, dl = function (dt, du, dv) { c8(function () { if (dd) a1.get(dd)(dt); else { if (d7) d7(dt); } }, dj); }, dm = function (dt, du, dv) { c8(function () { if (dc) a1.get(dc)(dt); else { if (d6) d6(dt); } }, dj); }, dn = function (dt, du, dv) { c8(function () { if (de) a1.get(de)(dt); else { if (d8) d8(dt); } }, dj); }, dp = function (dt, du, dv) { c7(dt, dk, dm, dl, dn); }, dq = function (dt, du, dv) { var dw = function (dy, dz, dA) { c8(function () { if (db) a1.get(db)(dy); else { if (b) b(dy); } }, dj); }, dx = function (dy, dz, dA) { c8(function () { if (db) a1.get(db)(dy); else { if (b) b(dy); } }, dj); }; c9(c6.dbInstance, dt, du.response, dw, dx); }, dr = function (dt, du, dv) { c7(dt, dq, dm, dl, dn); }; if (da === "EM_IDB_STORE") { var ds = X[d9 + 84 >> 2]; c9(c6.dbInstance, a, T.slice(ds, ds + X[d9 + 88 >> 2]), dk, dm); } else { if (da === "EM_IDB_DELETE") cb(c6.dbInstance, a, dk, dm); else { if (!di) ca(c6.dbInstance, a, dk, dh ? dm : dg ? dr : dp); else { if (!dh) c7(a, dg ? dq : dk, dm, dl, dn); else return 0; } } } return a; } var cd = {}; function cf() { if (!cf.strings) { var a = (typeof navigator === "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", b = {USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: a, _: g || "./this.program"}; for (var d6 in cd) { b[d6] = cd[d6]; } var d7 = []; for (var d6 in b) { d7.push(d6 + "=" + b[d6]); } cf.strings = d7; } return cf.strings; } var cg = {splitPath: function (a) { var b = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; return b.exec(a).slice(1); }, normalizeArray: function (a, b) { var d6 = 0; for (var d7 = a.length - 1; d7 >= 0; d7--) { var d8 = a[d7]; if (d8 === ".") a.splice(d7, 1); else { if (d8 === "..") a.splice(d7, 1), d6++; else d6 && (a.splice(d7, 1), d6--); } } if (b) for (; d6; d6--) { a.unshift(".."); } return a; }, normalize: function (a) { var b = a.charAt(0) === "/", d6 = a.substr(-1) === "/"; return a = cg.normalizeArray(a.split("/").filter(function (d7) { return !!d7; }), !b).join("/"), !a && !b && (a = "."), a && d6 && (a += "/"), (b ? "/" : "") + a; }, dirname: function (a) { var b = cg.splitPath(a), d6 = b[0], d7 = b[1]; if (!d6 && !d7) return "."; return d7 && (d7 = d7.substr(0, d7.length - 1)), d6 + d7; }, basename: function (a) { if (a === "/") return "/"; a = cg.normalize(a), a = a.replace(/\/$/, ""); var b = a.lastIndexOf("/"); if (b === -1) return a; return a.substr(b + 1); }, extname: function (a) { return cg.splitPath(a)[3]; }, join: function () { var a = Array.prototype.slice.call(arguments, 0); return cg.normalize(a.join("/")); }, join2: function (a, b) { return cg.normalize(a + "/" + b); }}; function ch() { if (typeof crypto === "object" && typeof crypto.getRandomValues === "function") { var a = new Uint8Array(1); return function () { return crypto.getRandomValues(a), a[0]; }; } else return function () { ak("randomDevice"); }; } var ci = {resolve: function () { var a = "", b = ![]; for (var d6 = arguments.length - 1; d6 >= -1 && !b; d6--) { var d7 = d6 >= 0 ? arguments[d6] : cm.cwd(); if (typeof d7 !== "string") throw new TypeError("Arguments to path.resolve must be strings"); else { if (!d7) return ""; } a = d7 + "/" + a, b = d7.charAt(0) === "/"; } return a = cg.normalizeArray(a.split("/").filter(function (d8) { return !!d8; }), !b).join("/"), (b ? "/" : "") + a || "."; }, relative: function (a, b) { a = ci.resolve(a).substr(1), b = ci.resolve(b).substr(1); function d6(dd) { var de = 0; for (; de < dd.length; de++) { if (dd[de] !== "") break; } var df = dd.length - 1; for (; df >= 0; df--) { if (dd[df] !== "") break; } if (de > df) return []; return dd.slice(de, df - de + 1); } var d7 = d6(a.split("/")), d8 = d6(b.split("/")), d9 = Math.min(d7.length, d8.length), da = d9; for (var db = 0; db < d9; db++) { if (d7[db] !== d8[db]) { da = db; break; } } var dc = []; for (var db = da; db < d7.length; db++) { dc.push(".."); } return dc = dc.concat(d8.slice(da)), dc.join("/"); }}, cj = {ttys: [], init: function () {}, shutdown: function () {}, register: function (a, b) { cj.ttys[a] = {input: [], output: [], ops: b}, cm.registerDevice(a, cj.stream_ops); }, stream_ops: {open: function (a) { var b = cj.ttys[a.node.rdev]; if (!b) throw new cm.ErrnoError(43); a.tty = b, a.seekable = ![]; }, close: function (a) { a.tty.ops.flush(a.tty); }, flush: function (a) { a.tty.ops.flush(a.tty); }, read: function (a, b, d6, d7, d8) { if (!a.tty || !a.tty.ops.get_char) throw new cm.ErrnoError(60); var d9 = 0; for (var da = 0; da < d7; da++) { var db; try { db = a.tty.ops.get_char(a.tty); } catch (dc) { throw new cm.ErrnoError(29); } if (db === undefined && d9 === 0) throw new cm.ErrnoError(6); if (db === null || db === undefined) break; d9++, b[d6 + da] = db; } return d9 && (a.node.timestamp = Date.now()), d9; }, write: function (a, b, d6, d7, d8) { if (!a.tty || !a.tty.ops.put_char) throw new cm.ErrnoError(60); try { for (var d9 = 0; d9 < d7; d9++) { a.tty.ops.put_char(a.tty, b[d6 + d9]); } } catch (da) { throw new cm.ErrnoError(29); } return d7 && (a.node.timestamp = Date.now()), d9; }}, default_tty_ops: {get_char: function (a) { if (!a.input.length) { var b = null; if (typeof window != "undefined" && typeof window.prompt == "function") b = window.prompt("Input: "), b !== null && (b += "\n"); else typeof readline == "function" && (b = readline(), b !== null && (b += "\n")); if (!b) return null; a.input = cG(b, !![]); } return a.input.shift(); }, put_char: function (a, b) { if (b === null || b === 10) q(C(a.output, 0)), a.output = []; else { if (b != 0) a.output.push(b); } }, flush: function (a) { a.output && a.output.length > 0 && (q(C(a.output, 0)), a.output = []); }}, default_tty1_ops: {put_char: function (a, b) { if (b === null || b === 10) r(C(a.output, 0)), a.output = []; else { if (b != 0) a.output.push(b); } }, flush: function (a) { a.output && a.output.length > 0 && (r(C(a.output, 0)), a.output = []); }}}; function ck(a) { var b = t(a, 65536), d6 = cK(b); while (a < b) S[d6 + a++] = 0; return d6; } var cl = {ops_table: null, mount: function (a) { return cl.createNode(null, "/", 16895, 0); }, createNode: function (a, b, d6, d7) { if (cm.isBlkdev(d6) || cm.isFIFO(d6)) throw new cm.ErrnoError(63); !cl.ops_table && (cl.ops_table = {dir: {node: {getattr: cl.node_ops.getattr, setattr: cl.node_ops.setattr, lookup: cl.node_ops.lookup, mknod: cl.node_ops.mknod, rename: cl.node_ops.rename, unlink: cl.node_ops.unlink, rmdir: cl.node_ops.rmdir, readdir: cl.node_ops.readdir, symlink: cl.node_ops.symlink}, stream: {llseek: cl.stream_ops.llseek}}, file: {node: {getattr: cl.node_ops.getattr, setattr: cl.node_ops.setattr}, stream: {llseek: cl.stream_ops.llseek, read: cl.stream_ops.read, write: cl.stream_ops.write, allocate: cl.stream_ops.allocate, mmap: cl.stream_ops.mmap, msync: cl.stream_ops.msync}}, link: {node: {getattr: cl.node_ops.getattr, setattr: cl.node_ops.setattr, readlink: cl.node_ops.readlink}, stream: {}}, chrdev: {node: {getattr: cl.node_ops.getattr, setattr: cl.node_ops.setattr}, stream: cm.chrdev_stream_ops}}); var d8 = cm.createNode(a, b, d6, d7); if (cm.isDir(d8.mode)) d8.node_ops = cl.ops_table.dir.node, d8.stream_ops = cl.ops_table.dir.stream, d8.contents = {}; else { if (cm.isFile(d8.mode)) d8.node_ops = cl.ops_table.file.node, d8.stream_ops = cl.ops_table.file.stream, d8.usedBytes = 0, d8.contents = null; else { if (cm.isLink(d8.mode)) d8.node_ops = cl.ops_table.link.node, d8.stream_ops = cl.ops_table.link.stream; else cm.isChrdev(d8.mode) && (d8.node_ops = cl.ops_table.chrdev.node, d8.stream_ops = cl.ops_table.chrdev.stream); } } return d8.timestamp = Date.now(), a && (a.contents[b] = d8, a.timestamp = d8.timestamp), d8; }, getFileDataAsTypedArray: function (a) { if (!a.contents) return new Uint8Array(0); if (a.contents.subarray) return a.contents.subarray(0, a.usedBytes); return new Uint8Array(a.contents); }, expandFileStorage: function (a, b) { var d6 = a.contents ? a.contents.length : 0; if (d6 >= b) return; var d7 = 1048576; b = Math.max(b, d6 * (d6 < d7 ? 2 : 1.125) >>> 0); if (d6 != 0) b = Math.max(b, 256); var d8 = a.contents; a.contents = new Uint8Array(b); if (a.usedBytes > 0) a.contents.set(d8.subarray(0, a.usedBytes), 0); }, resizeFileStorage: function (a, b) { if (a.usedBytes == b) return; if (b == 0) a.contents = null, a.usedBytes = 0; else { var d6 = a.contents; a.contents = new Uint8Array(b), d6 && a.contents.set(d6.subarray(0, Math.min(b, a.usedBytes))), a.usedBytes = b; } }, node_ops: {getattr: function (a) { var b = {}; b.dev = cm.isChrdev(a.mode) ? a.id : 1, b.ino = a.id, b.mode = a.mode, b.nlink = 1, b.uid = 0, b.gid = 0, b.rdev = a.rdev; if (cm.isDir(a.mode)) b.size = 4096; else { if (cm.isFile(a.mode)) b.size = a.usedBytes; else cm.isLink(a.mode) ? b.size = a.link.length : b.size = 0; } return b.atime = new Date(a.timestamp), b.mtime = new Date(a.timestamp), b.ctime = new Date(a.timestamp), b.blksize = 4096, b.blocks = Math.ceil(b.size / b.blksize), b; }, setattr: function (a, b) { b.mode !== undefined && (a.mode = b.mode), b.timestamp !== undefined && (a.timestamp = b.timestamp), b.size !== undefined && cl.resizeFileStorage(a, b.size); }, lookup: function (a, b) { throw cm.genericErrors[44]; }, mknod: function (a, b, d6, d7) { return cl.createNode(a, b, d6, d7); }, rename: function (a, b, d6) { if (cm.isDir(a.mode)) { var d7; try { d7 = cm.lookupNode(b, d6); } catch (d9) {} if (d7) for (var d8 in d7.contents) { throw new cm.ErrnoError(55); } } delete a.parent.contents[a.name], a.parent.timestamp = Date.now(), a.name = d6, b.contents[d6] = a, b.timestamp = a.parent.timestamp, a.parent = b; }, unlink: function (a, b) { delete a.contents[b], a.timestamp = Date.now(); }, rmdir: function (a, b) { var d6 = cm.lookupNode(a, b); for (var d7 in d6.contents) { throw new cm.ErrnoError(55); } delete a.contents[b], a.timestamp = Date.now(); }, readdir: function (a) { var b = [".", ".."]; for (var d6 in a.contents) { if (!a.contents.hasOwnProperty(d6)) continue; b.push(d6); } return b; }, symlink: function (a, b, d6) { var d7 = cl.createNode(a, b, 41471, 0); return d7.link = d6, d7; }, readlink: function (a) { if (!cm.isLink(a.mode)) throw new cm.ErrnoError(28); return a.link; }}, stream_ops: {read: function (a, b, d6, d7, d8) { var d9 = a.node.contents; if (d8 >= a.node.usedBytes) return 0; var da = Math.min(a.node.usedBytes - d8, d7); if (da > 8 && d9.subarray) b.set(d9.subarray(d8, d8 + da), d6); else { for (var db = 0; db < da; db++) b[d6 + db] = d9[d8 + db]; } return da; }, write: function (a, b, d6, d7, d8, d9) { b.buffer === S.buffer && (d9 = ![]); if (!d7) return 0; var da = a.node; da.timestamp = Date.now(); if (b.subarray && (!da.contents || da.contents.subarray)) { if (d9) return da.contents = b.subarray(d6, d6 + d7), da.usedBytes = d7, d7; else { if (da.usedBytes === 0 && d8 === 0) return da.contents = b.slice(d6, d6 + d7), da.usedBytes = d7, d7; else { if (d8 + d7 <= da.usedBytes) return da.contents.set(b.subarray(d6, d6 + d7), d8), d7; } } } cl.expandFileStorage(da, d8 + d7); if (da.contents.subarray && b.subarray) da.contents.set(b.subarray(d6, d6 + d7), d8); else for (var db = 0; db < d7; db++) { da.contents[d8 + db] = b[d6 + db]; } return da.usedBytes = Math.max(da.usedBytes, d8 + d7), d7; }, llseek: function (a, b, d6) { var d7 = b; if (d6 === 1) d7 += a.position; else d6 === 2 && (cm.isFile(a.node.mode) && (d7 += a.node.usedBytes)); if (d7 < 0) throw new cm.ErrnoError(28); return d7; }, allocate: function (a, b, d6) { cl.expandFileStorage(a.node, b + d6), a.node.usedBytes = Math.max(a.node.usedBytes, b + d6); }, mmap: function (a, b, d6, d7, d8, d9) { if (b !== 0) throw new cm.ErrnoError(28); if (!cm.isFile(a.node.mode)) throw new cm.ErrnoError(43); var da, db, dc = a.node.contents; if (!(d9 & 2) && dc.buffer === R) db = ![], da = dc.byteOffset; else { (d7 > 0 || d7 + d6 < dc.length) && (dc.subarray ? dc = dc.subarray(d7, d7 + d6) : dc = Array.prototype.slice.call(dc, d7, d7 + d6)); db = !![], da = ck(d6); if (!da) throw new cm.ErrnoError(48); S.set(dc, da); } return {ptr: da, allocated: db}; }, msync: function (a, b, d6, d7, d8) { if (!cm.isFile(a.node.mode)) throw new cm.ErrnoError(43); if (d8 & 2) return 0; var d9 = cl.stream_ops.write(a, b, 0, d7, d6, ![]); return 0; }}}, cm = {root: null, mounts: [], devices: {}, streams: [], nextInode: 1, nameTable: null, currentPath: "/", initialized: ![], ignorePermissions: !![], trackingDelegate: {}, tracking: {openFlags: {READ: 1, WRITE: 2}}, ErrnoError: null, genericErrors: {}, filesystems: null, syncFSRequests: 0, lookupPath: function (a, b) { a = ci.resolve(cm.cwd(), a), b = b || {}; if (!a) return {path: "", node: null}; var d6 = {follow_mount: !![], recurse_count: 0}; for (var d7 in d6) { b[d7] === undefined && (b[d7] = d6[d7]); } if (b.recurse_count > 8) throw new cm.ErrnoError(32); var d8 = cg.normalizeArray(a.split("/").filter(function (dg) { return !!dg; }), ![]), d9 = cm.root, da = "/"; for (var db = 0; db < d8.length; db++) { var dc = db === d8.length - 1; if (dc && b.parent) break; d9 = cm.lookupNode(d9, d8[db]), da = cg.join2(da, d8[db]); cm.isMountpoint(d9) && ((!dc || dc && b.follow_mount) && (d9 = d9.mounted.root)); if (!dc || b.follow) { var dd = 0; while (cm.isLink(d9.mode)) { var de = cm.readlink(da); da = ci.resolve(cg.dirname(da), de); var df = cm.lookupPath(da, {recurse_count: b.recurse_count}); d9 = df.node; if (dd++ > 40) throw new cm.ErrnoError(32); } } } return {path: da, node: d9}; }, getPath: function (a) { var b; while (!![]) { if (cm.isRoot(a)) { var d6 = a.mount.mountpoint; if (!b) return d6; return d6[d6.length - 1] !== "/" ? d6 + "/" + b : d6 + b; } b = b ? a.name + "/" + b : a.name, a = a.parent; } }, hashName: function (a, b) { var d6 = 0; for (var d7 = 0; d7 < b.length; d7++) { d6 = (d6 << 5) - d6 + b.charCodeAt(d7) | 0; } return (a + d6 >>> 0) % cm.nameTable.length; }, hashAddNode: function (a) { var b = cm.hashName(a.parent.id, a.name); a.name_next = cm.nameTable[b], cm.nameTable[b] = a; }, hashRemoveNode: function (a) { var b = cm.hashName(a.parent.id, a.name); if (cm.nameTable[b] === a) cm.nameTable[b] = a.name_next; else { var d6 = cm.nameTable[b]; while (d6) { if (d6.name_next === a) { d6.name_next = a.name_next; break; } d6 = d6.name_next; } } }, lookupNode: function (a, b) { var d6 = cm.mayLookup(a); if (d6) throw new cm.ErrnoError(d6, a); var d7 = cm.hashName(a.id, b); for (var d8 = cm.nameTable[d7]; d8; d8 = d8.name_next) { var d9 = d8.name; if (d8.parent.id === a.id && d9 === b) return d8; } return cm.lookup(a, b); }, createNode: function (a, b, d6, d7) { var d8 = new cm.FSNode(a, b, d6, d7); return cm.hashAddNode(d8), d8; }, destroyNode: function (a) { cm.hashRemoveNode(a); }, isRoot: function (a) { return a === a.parent; }, isMountpoint: function (a) { return !!a.mounted; }, isFile: function (a) { return (a & 61440) === 32768; }, isDir: function (a) { return (a & 61440) === 16384; }, isLink: function (a) { return (a & 61440) === 40960; }, isChrdev: function (a) { return (a & 61440) === 8192; }, isBlkdev: function (a) { return (a & 61440) === 24576; }, isFIFO: function (a) { return (a & 61440) === 4096; }, isSocket: function (a) { return (a & 49152) === 49152; }, flagModes: {r: 0, "r+": 2, w: 577, "w+": 578, a: 1089, "a+": 1090}, modeStringToFlags: function (a) { var b = cm.flagModes[a]; if (typeof b === "undefined") throw new Error("Unknown file open mode: " + a); return b; }, flagsToPermissionString: function (a) { var b = ["r", "w", "rw"][a & 3]; return a & 512 && (b += "w"), b; }, nodePermissions: function (a, b) { if (cm.ignorePermissions) return 0; if (b.includes("r") && !(a.mode & 292)) return 2; else { if (b.includes("w") && !(a.mode & 146)) return 2; else { if (b.includes("x") && !(a.mode & 73)) return 2; } } return 0; }, mayLookup: function (a) { var b = cm.nodePermissions(a, "x"); if (b) return b; if (!a.node_ops.lookup) return 2; return 0; }, mayCreate: function (a, b) { try { var d6 = cm.lookupNode(a, b); return 20; } catch (d7) {} return cm.nodePermissions(a, "wx"); }, mayDelete: function (a, b, d6) { var d7; try { d7 = cm.lookupNode(a, b); } catch (d9) { return d9.errno; } var d8 = cm.nodePermissions(a, "wx"); if (d8) return d8; if (d6) { if (!cm.isDir(d7.mode)) return 54; if (cm.isRoot(d7) || cm.getPath(d7) === cm.cwd()) return 10; } else { if (cm.isDir(d7.mode)) return 31; } return 0; }, mayOpen: function (a, b) { if (!a) return 44; if (cm.isLink(a.mode)) return 32; else { if (cm.isDir(a.mode)) { if (cm.flagsToPermissionString(b) !== "r" || b & 512) return 31; } } return cm.nodePermissions(a, cm.flagsToPermissionString(b)); }, MAX_OPEN_FDS: 4096, nextfd: function (a, b) { a = a || 0, b = b || cm.MAX_OPEN_FDS; for (var d6 = a; d6 <= b; d6++) { if (!cm.streams[d6]) return d6; } throw new cm.ErrnoError(33); }, getStream: function (a) { return cm.streams[a]; }, createStream: function (a, b, d6) { !cm.FSStream && (cm.FSStream = function () {}, cm.FSStream.prototype = {object: {get: function () { return this.node; }, set: function (da) { this.node = da; }}, isRead: {get: function () { return (this.flags & 2097155) !== 1; }}, isWrite: {get: function () { return (this.flags & 2097155) !== 0; }}, isAppend: {get: function () { return this.flags & 1024; }}}); var d7 = new cm.FSStream; for (var d8 in a) { d7[d8] = a[d8]; } a = d7; var d9 = cm.nextfd(b, d6); return a.fd = d9, cm.streams[d9] = a, a; }, closeStream: function (a) { cm.streams[a] = null; }, chrdev_stream_ops: {open: function (a) { var b = cm.getDevice(a.node.rdev); a.stream_ops = b.stream_ops, a.stream_ops.open && a.stream_ops.open(a); }, llseek: function () { throw new cm.ErrnoError(70); }}, major: function (a) { return a >> 8; }, minor: function (a) { return a & 255; }, makedev: function (a, b) { return a << 8 | b; }, registerDevice: function (a, b) { cm.devices[a] = {stream_ops: b}; }, getDevice: function (a) { return cm.devices[a]; }, getMounts: function (a) { var b = [], d6 = [a]; while (d6.length) { var d7 = d6.pop(); b.push(d7), d6.push.apply(d6, d7.mounts); } return b; }, syncfs: function (a, b) { typeof a === "function" && (b = a, a = ![]); cm.syncFSRequests++; cm.syncFSRequests > 1 && r("warning: " + cm.syncFSRequests + " FS.syncfs operations in flight at once, probably just doing extra work"); var d6 = cm.getMounts(cm.root.mount), d7 = 0; function d9(da) { if (da) { if (!d9.errored) return d9.errored = !![], (cm.syncFSRequests--, b(da)); return; } ++d7 >= d6.length && (cm.syncFSRequests--, b(null)); } d6.forEach(function (da) { if (!da.type.syncfs) return d9(null); da.type.syncfs(da, a, d9); }); }, mount: function (a, b, d6) { var d7 = d6 === "/", d8 = !d6, d9; if (d7 && cm.root) throw new cm.ErrnoError(10); else { if (!d7 && !d8) { var da = cm.lookupPath(d6, {follow_mount: ![]}); d6 = da.path, d9 = da.node; if (cm.isMountpoint(d9)) throw new cm.ErrnoError(10); if (!cm.isDir(d9.mode)) throw new cm.ErrnoError(54); } } var db = {type: a, opts: b, mountpoint: d6, mounts: []}, dc = a.mount(db); dc.mount = db, db.root = dc; if (d7) cm.root = dc; else d9 && (d9.mounted = db, d9.mount && d9.mount.mounts.push(db)); return dc; }, unmount: function (a) { var b = cm.lookupPath(a, {follow_mount: ![]}); if (!cm.isMountpoint(b.node)) throw new cm.ErrnoError(28); var d6 = b.node, d7 = d6.mounted, d8 = cm.getMounts(d7); Object.keys(cm.nameTable).forEach(function (da) { var db = cm.nameTable[da]; while (db) { var dc = db.name_next; d8.includes(db.mount) && cm.destroyNode(db), db = dc; } }), d6.mounted = null; var d9 = d6.mount.mounts.indexOf(d7); d6.mount.mounts.splice(d9, 1); }, lookup: function (a, b) { return a.node_ops.lookup(a, b); }, mknod: function (a, b, d6) { var d7 = cm.lookupPath(a, {parent: !![]}), d8 = d7.node, d9 = cg.basename(a); if (!d9 || d9 === "." || d9 === "..") throw new cm.ErrnoError(28); var da = cm.mayCreate(d8, d9); if (da) throw new cm.ErrnoError(da); if (!d8.node_ops.mknod) throw new cm.ErrnoError(63); return d8.node_ops.mknod(d8, d9, b, d6); }, create: function (a, b) { return b = b !== undefined ? b : 438, b &= 4095, b |= 32768, cm.mknod(a, b, 0); }, mkdir: function (a, b) { return b = b !== undefined ? b : 511, b &= 1023, b |= 16384, cm.mknod(a, b, 0); }, mkdirTree: function (a, b) { var d6 = a.split("/"), d7 = ""; for (var d8 = 0; d8 < d6.length; ++d8) { if (!d6[d8]) continue; d7 += "/" + d6[d8]; try { cm.mkdir(d7, b); } catch (d9) { if (d9.errno != 20) throw d9; } } }, mkdev: function (a, b, d6) { return typeof d6 === "undefined" && (d6 = b, b = 438), b |= 8192, cm.mknod(a, b, d6); }, symlink: function (a, b) { if (!ci.resolve(a)) throw new cm.ErrnoError(44); var d6 = cm.lookupPath(b, {parent: !![]}), d7 = d6.node; if (!d7) throw new cm.ErrnoError(44); var d8 = cg.basename(b), d9 = cm.mayCreate(d7, d8); if (d9) throw new cm.ErrnoError(d9); if (!d7.node_ops.symlink) throw new cm.ErrnoError(63); return d7.node_ops.symlink(d7, d8, a); }, rename: function (a, b) { var d6 = cg.dirname(a), d7 = cg.dirname(b), d8 = cg.basename(a), d9 = cg.basename(b), da, db, dc; da = cm.lookupPath(a, {parent: !![]}), db = da.node, da = cm.lookupPath(b, {parent: !![]}), dc = da.node; if (!db || !dc) throw new cm.ErrnoError(44); if (db.mount !== dc.mount) throw new cm.ErrnoError(75); var dd = cm.lookupNode(db, d8), de = ci.relative(a, d7); if (de.charAt(0) !== ".") throw new cm.ErrnoError(28); de = ci.relative(b, d6); if (de.charAt(0) !== ".") throw new cm.ErrnoError(55); var df; try { df = cm.lookupNode(dc, d9); } catch (di) {} if (dd === df) return; var dg = cm.isDir(dd.mode), dh = cm.mayDelete(db, d8, dg); if (dh) throw new cm.ErrnoError(dh); dh = df ? cm.mayDelete(dc, d9, dg) : cm.mayCreate(dc, d9); if (dh) throw new cm.ErrnoError(dh); if (!db.node_ops.rename) throw new cm.ErrnoError(63); if (cm.isMountpoint(dd) || df && cm.isMountpoint(df)) throw new cm.ErrnoError(10); if (dc !== db) { dh = cm.nodePermissions(db, "w"); if (dh) throw new cm.ErrnoError(dh); } try { cm.trackingDelegate.willMovePath && cm.trackingDelegate.willMovePath(a, b); } catch (dj) { r("FS.trackingDelegate['willMovePath']('" + a + "', '" + b + "') threw an exception: " + dj.message); } cm.hashRemoveNode(dd); try { db.node_ops.rename(dd, dc, d9); } catch (dk) { throw dk; } finally { cm.hashAddNode(dd); } try { if (cm.trackingDelegate.onMovePath) cm.trackingDelegate.onMovePath(a, b); } catch (dl) { r("FS.trackingDelegate['onMovePath']('" + a + "', '" + b + "') threw an exception: " + dl.message); } }, rmdir: function (a) { var b = cm.lookupPath(a, {parent: !![]}), d6 = b.node, d7 = cg.basename(a), d8 = cm.lookupNode(d6, d7), d9 = cm.mayDelete(d6, d7, !![]); if (d9) throw new cm.ErrnoError(d9); if (!d6.node_ops.rmdir) throw new cm.ErrnoError(63); if (cm.isMountpoint(d8)) throw new cm.ErrnoError(10); try { cm.trackingDelegate.willDeletePath && cm.trackingDelegate.willDeletePath(a); } catch (da) { r("FS.trackingDelegate['willDeletePath']('" + a + "') threw an exception: " + da.message); } d6.node_ops.rmdir(d6, d7), cm.destroyNode(d8); try { if (cm.trackingDelegate.onDeletePath) cm.trackingDelegate.onDeletePath(a); } catch (db) { r("FS.trackingDelegate['onDeletePath']('" + a + "') threw an exception: " + db.message); } }, readdir: function (a) { var b = cm.lookupPath(a, {follow: !![]}), d6 = b.node; if (!d6.node_ops.readdir) throw new cm.ErrnoError(54); return d6.node_ops.readdir(d6); }, unlink: function (a) { var b = cm.lookupPath(a, {parent: !![]}), d6 = b.node, d7 = cg.basename(a), d8 = cm.lookupNode(d6, d7), d9 = cm.mayDelete(d6, d7, ![]); if (d9) throw new cm.ErrnoError(d9); if (!d6.node_ops.unlink) throw new cm.ErrnoError(63); if (cm.isMountpoint(d8)) throw new cm.ErrnoError(10); try { cm.trackingDelegate.willDeletePath && cm.trackingDelegate.willDeletePath(a); } catch (da) { r("FS.trackingDelegate['willDeletePath']('" + a + "') threw an exception: " + da.message); } d6.node_ops.unlink(d6, d7), cm.destroyNode(d8); try { if (cm.trackingDelegate.onDeletePath) cm.trackingDelegate.onDeletePath(a); } catch (db) { r("FS.trackingDelegate['onDeletePath']('" + a + "') threw an exception: " + db.message); } }, readlink: function (a) { var b = cm.lookupPath(a), d6 = b.node; if (!d6) throw new cm.ErrnoError(44); if (!d6.node_ops.readlink) throw new cm.ErrnoError(28); return ci.resolve(cm.getPath(d6.parent), d6.node_ops.readlink(d6)); }, stat: function (a, b) { var d6 = cm.lookupPath(a, {follow: !b}), d7 = d6.node; if (!d7) throw new cm.ErrnoError(44); if (!d7.node_ops.getattr) throw new cm.ErrnoError(63); return d7.node_ops.getattr(d7); }, lstat: function (a) { return cm.stat(a, !![]); }, chmod: function (a, b, d6) { var d7; if (typeof a === "string") { var d8 = cm.lookupPath(a, {follow: !d6}); d7 = d8.node; } else d7 = a; if (!d7.node_ops.setattr) throw new cm.ErrnoError(63); d7.node_ops.setattr(d7, {mode: b & 4095 | d7.mode & -4096, timestamp: Date.now()}); }, lchmod: function (a, b) { cm.chmod(a, b, !![]); }, fchmod: function (a, b) { var d6 = cm.getStream(a); if (!d6) throw new cm.ErrnoError(8); cm.chmod(d6.node, b); }, chown: function (a, b, d6, d7) { var d8; if (typeof a === "string") { var d9 = cm.lookupPath(a, {follow: !d7}); d8 = d9.node; } else d8 = a; if (!d8.node_ops.setattr) throw new cm.ErrnoError(63); d8.node_ops.setattr(d8, {timestamp: Date.now()}); }, lchown: function (a, b, d6) { cm.chown(a, b, d6, !![]); }, fchown: function (a, b, d6) { var d7 = cm.getStream(a); if (!d7) throw new cm.ErrnoError(8); cm.chown(d7.node, b, d6); }, truncate: function (a, b) { if (b < 0) throw new cm.ErrnoError(28); var d6; if (typeof a === "string") { var d7 = cm.lookupPath(a, {follow: !![]}); d6 = d7.node; } else d6 = a; if (!d6.node_ops.setattr) throw new cm.ErrnoError(63); if (cm.isDir(d6.mode)) throw new cm.ErrnoError(31); if (!cm.isFile(d6.mode)) throw new cm.ErrnoError(28); var d8 = cm.nodePermissions(d6, "w"); if (d8) throw new cm.ErrnoError(d8); d6.node_ops.setattr(d6, {size: b, timestamp: Date.now()}); }, ftruncate: function (a, b) { var d6 = cm.getStream(a); if (!d6) throw new cm.ErrnoError(8); if ((d6.flags & 2097155) === 0) throw new cm.ErrnoError(28); cm.truncate(d6.node, b); }, utime: function (a, b, d6) { var d7 = cm.lookupPath(a, {follow: !![]}), d8 = d7.node; d8.node_ops.setattr(d8, {timestamp: Math.max(b, d6)}); }, open: function (a, b, d6, d7, d8) { if (a === "") throw new cm.ErrnoError(44); b = typeof b === "string" ? cm.modeStringToFlags(b) : b, d6 = typeof d6 === "undefined" ? 438 : d6; b & 64 ? d6 = d6 & 4095 | 32768 : d6 = 0; var d9; if (typeof a === "object") d9 = a; else { a = cg.normalize(a); try { var da = cm.lookupPath(a, {follow: !(b & 131072)}); d9 = da.node; } catch (df) {} } var db = ![]; if (b & 64) { if (d9) { if (b & 128) throw new cm.ErrnoError(20); } else d9 = cm.mknod(a, d6, 0), db = !![]; } if (!d9) throw new cm.ErrnoError(44); cm.isChrdev(d9.mode) && (b &= -513); if (b & 65536 && !cm.isDir(d9.mode)) throw new cm.ErrnoError(54); if (!db) { var dc = cm.mayOpen(d9, b); if (dc) throw new cm.ErrnoError(dc); } b & 512 && cm.truncate(d9, 0); b &= -131713; var dd = cm.createStream({node: d9, path: cm.getPath(d9), flags: b, seekable: !![], position: 0, stream_ops: d9.stream_ops, ungotten: [], error: ![]}, d7, d8); dd.stream_ops.open && dd.stream_ops.open(dd); if (c.logReadFiles && !(b & 1)) { if (!cm.readFiles) cm.readFiles = {}; !(a in cm.readFiles) && (cm.readFiles[a] = 1, r("FS.trackingDelegate error on read file: " + a)); } try { if (cm.trackingDelegate.onOpenFile) { var de = 0; (b & 2097155) !== 1 && (de |= cm.tracking.openFlags.READ), (b & 2097155) !== 0 && (de |= cm.tracking.openFlags.WRITE), cm.trackingDelegate.onOpenFile(a, de); } } catch (dg) { r("FS.trackingDelegate['onOpenFile']('" + a + "', flags) threw an exception: " + dg.message); } return dd; }, close: function (a) { if (cm.isClosed(a)) throw new cm.ErrnoError(8); if (a.getdents) a.getdents = null; try { a.stream_ops.close && a.stream_ops.close(a); } catch (b) { throw b; } finally { cm.closeStream(a.fd); } a.fd = null; }, isClosed: function (a) { return a.fd === null; }, llseek: function (a, b, d6) { if (cm.isClosed(a)) throw new cm.ErrnoError(8); if (!a.seekable || !a.stream_ops.llseek) throw new cm.ErrnoError(70); if (d6 != 0 && d6 != 1 && d6 != 2) throw new cm.ErrnoError(28); return a.position = a.stream_ops.llseek(a, b, d6), a.ungotten = [], a.position; }, read: function (a, b, d6, d7, d8) { if (d7 < 0 || d8 < 0) throw new cm.ErrnoError(28); if (cm.isClosed(a)) throw new cm.ErrnoError(8); if ((a.flags & 2097155) === 1) throw new cm.ErrnoError(8); if (cm.isDir(a.node.mode)) throw new cm.ErrnoError(31); if (!a.stream_ops.read) throw new cm.ErrnoError(28); var d9 = typeof d8 !== "undefined"; if (!d9) d8 = a.position; else { if (!a.seekable) throw new cm.ErrnoError(70); } var da = a.stream_ops.read(a, b, d6, d7, d8); if (!d9) a.position += da; return da; }, write: function (a, b, d6, d7, d8, d9) { if (d7 < 0 || d8 < 0) throw new cm.ErrnoError(28); if (cm.isClosed(a)) throw new cm.ErrnoError(8); if ((a.flags & 2097155) === 0) throw new cm.ErrnoError(8); if (cm.isDir(a.node.mode)) throw new cm.ErrnoError(31); if (!a.stream_ops.write) throw new cm.ErrnoError(28); a.seekable && a.flags & 1024 && cm.llseek(a, 0, 2); var da = typeof d8 !== "undefined"; if (!da) d8 = a.position; else { if (!a.seekable) throw new cm.ErrnoError(70); } var db = a.stream_ops.write(a, b, d6, d7, d8, d9); if (!da) a.position += db; try { if (a.path && cm.trackingDelegate.onWriteToFile) cm.trackingDelegate.onWriteToFile(a.path); } catch (dc) { r("FS.trackingDelegate['onWriteToFile']('" + a.path + "') threw an exception: " + dc.message); } return db; }, allocate: function (a, b, d6) { if (cm.isClosed(a)) throw new cm.ErrnoError(8); if (b < 0 || d6 <= 0) throw new cm.ErrnoError(28); if ((a.flags & 2097155) === 0) throw new cm.ErrnoError(8); if (!cm.isFile(a.node.mode) && !cm.isDir(a.node.mode)) throw new cm.ErrnoError(43); if (!a.stream_ops.allocate) throw new cm.ErrnoError(138); a.stream_ops.allocate(a, b, d6); }, mmap: function (a, b, d6, d7, d8, d9) { if ((d8 & 2) !== 0 && (d9 & 2) === 0 && (a.flags & 2097155) !== 2) throw new cm.ErrnoError(2); if ((a.flags & 2097155) === 1) throw new cm.ErrnoError(2); if (!a.stream_ops.mmap) throw new cm.ErrnoError(43); return a.stream_ops.mmap(a, b, d6, d7, d8, d9); }, msync: function (a, b, d6, d7, d8) { if (!a || !a.stream_ops.msync) return 0; return a.stream_ops.msync(a, b, d6, d7, d8); }, munmap: function (a) { return 0; }, ioctl: function (a, b, d6) { if (!a.stream_ops.ioctl) throw new cm.ErrnoError(59); return a.stream_ops.ioctl(a, b, d6); }, readFile: function (a, b) { b = b || {}, b.flags = b.flags || 0, b.encoding = b.encoding || "binary"; if (b.encoding !== "utf8" && b.encoding !== "binary") throw new Error('Invalid encoding type "' + b.encoding + '"'); var d6, d7 = cm.open(a, b.flags), d8 = cm.stat(a), d9 = d8.size, da = new Uint8Array(d9); cm.read(d7, da, 0, d9, 0); if (b.encoding === "utf8") d6 = C(da, 0); else b.encoding === "binary" && (d6 = da); return cm.close(d7), d6; }, writeFile: function (a, b, d6) { d6 = d6 || {}, d6.flags = d6.flags || 577; var d7 = cm.open(a, d6.flags, d6.mode); if (typeof b === "string") { var d8 = new Uint8Array(G(b) + 1), d9 = E(b, d8, 0, d8.length); cm.write(d7, d8, 0, d9, undefined, d6.canOwn); } else { if (ArrayBuffer.isView(b)) cm.write(d7, b, 0, b.byteLength, undefined, d6.canOwn); else throw new Error("Unsupported data type"); } cm.close(d7); }, cwd: function () { return cm.currentPath; }, chdir: function (a) { var b = cm.lookupPath(a, {follow: !![]}); if (b.node === null) throw new cm.ErrnoError(44); if (!cm.isDir(b.node.mode)) throw new cm.ErrnoError(54); var d6 = cm.nodePermissions(b.node, "x"); if (d6) throw new cm.ErrnoError(d6); cm.currentPath = b.path; }, createDefaultDirectories: function () { cm.mkdir("/tmp"), cm.mkdir("/home"), cm.mkdir("/home/web_user"); }, createDefaultDevices: function () { cm.mkdir("/dev"), cm.registerDevice(cm.makedev(1, 3), {read: function () { return 0; }, write: function (b, d6, d7, d8, d9) { return d8; }}), cm.mkdev("/dev/null", cm.makedev(1, 3)), cj.register(cm.makedev(5, 0), cj.default_tty_ops), cj.register(cm.makedev(6, 0), cj.default_tty1_ops), cm.mkdev("/dev/tty", cm.makedev(5, 0)), cm.mkdev("/dev/tty1", cm.makedev(6, 0)); var a = ch(); cm.createDevice("/dev", "random", a), cm.createDevice("/dev", "urandom", a), cm.mkdir("/dev/shm"), cm.mkdir("/dev/shm/tmp"); }, createSpecialDirectories: function () { cm.mkdir("/proc"); var a = cm.mkdir("/proc/self"); cm.mkdir("/proc/self/fd"), cm.mount({mount: function () { var b = cm.createNode(a, "fd", 16895, 73); return b.node_ops = {lookup: function (d6, d7) { var d8 = +d7, d9 = cm.getStream(d8); if (!d9) throw new cm.ErrnoError(8); var da = {parent: null, mount: {mountpoint: "fake"}, node_ops: {readlink: function () { return d9.path; }}}; return da.parent = da, da; }}, b; }}, {}, "/proc/self/fd"); }, createStandardStreams: function () { c.stdin ? cm.createDevice("/dev", "stdin", c.stdin) : cm.symlink("/dev/tty", "/dev/stdin"); c.stdout ? cm.createDevice("/dev", "stdout", null, c.stdout) : cm.symlink("/dev/tty", "/dev/stdout"); c.stderr ? cm.createDevice("/dev", "stderr", null, c.stderr) : cm.symlink("/dev/tty1", "/dev/stderr"); var a = cm.open("/dev/stdin", 0), b = cm.open("/dev/stdout", 1), d6 = cm.open("/dev/stderr", 1); }, ensureErrnoError: function () { if (cm.ErrnoError) return; cm.ErrnoError = function a(b, d6) { this.node = d6, this.setErrno = function (d7) { this.errno = d7; }, this.setErrno(b), this.message = "FS error"; }, cm.ErrnoError.prototype = new Error, cm.ErrnoError.prototype.constructor = cm.ErrnoError, [44].forEach(function (b) { cm.genericErrors[b] = new cm.ErrnoError(b), cm.genericErrors[b].stack = "<generic error, no stack>"; }); }, staticInit: function () { cm.ensureErrnoError(), cm.nameTable = new Array(4096), cm.mount(cl, {}, "/"), cm.createDefaultDirectories(), cm.createDefaultDevices(), cm.createSpecialDirectories(), cm.filesystems = {MEMFS: cl}; }, init: function (a, b, d6) { cm.init.initialized = !![], cm.ensureErrnoError(), c.stdin = a || c.stdin, c.stdout = b || c.stdout, c.stderr = d6 || c.stderr, cm.createStandardStreams(); }, quit: function () { cm.init.initialized = ![]; var a = c._fflush; if (a) a(0); for (var b = 0; b < cm.streams.length; b++) { var d6 = cm.streams[b]; if (!d6) continue; cm.close(d6); } }, getMode: function (a, b) { var d6 = 0; if (a) d6 |= 365; if (b) d6 |= 146; return d6; }, findObject: function (a, b) { var d6 = cm.analyzePath(a, b); return d6.exists ? d6.object : null; }, analyzePath: function (a, b) { try { var d6 = cm.lookupPath(a, {follow: !b}); a = d6.path; } catch (d8) {} var d7 = {isRoot: ![], exists: ![], error: 0, name: null, path: null, object: null, parentExists: ![], parentPath: null, parentObject: null}; try { var d6 = cm.lookupPath(a, {parent: !![]}); d7.parentExists = !![], d7.parentPath = d6.path, d7.parentObject = d6.node, d7.name = cg.basename(a), d6 = cm.lookupPath(a, {follow: !b}), d7.exists = !![], d7.path = d6.path, d7.object = d6.node, d7.name = d6.node.name, d7.isRoot = d6.path === "/"; } catch (d9) { d7.error = d9.errno; } return d7; }, createPath: function (a, b, d6, d7) { a = typeof a === "string" ? a : cm.getPath(a); var d8 = b.split("/").reverse(); while (d8.length) { var d9 = d8.pop(); if (!d9) continue; var da = cg.join2(a, d9); try { cm.mkdir(da); } catch (db) {} a = da; } return da; }, createFile: function (a, b, d6, d7, d8) { var d9 = cg.join2(typeof a === "string" ? a : cm.getPath(a), b), da = cm.getMode(d7, d8); return cm.create(d9, da); }, createDataFile: function (a, b, d6, d7, d8, d9) { var da = b ? cg.join2(typeof a === "string" ? a : cm.getPath(a), b) : a, db = cm.getMode(d7, d8), dc = cm.create(da, db); if (d6) { if (typeof d6 === "string") { var dd = new Array(d6.length); for (var de = 0, df = d6.length; de < df; ++de) dd[de] = d6.charCodeAt(de); d6 = dd; } cm.chmod(dc, db | 146); var dg = cm.open(dc, 577); cm.write(dg, d6, 0, d6.length, 0, d9), cm.close(dg), cm.chmod(dc, db); } return dc; }, createDevice: function (a, b, d6, d7) { var d8 = cg.join2(typeof a === "string" ? a : cm.getPath(a), b), d9 = cm.getMode(!!d6, !!d7); if (!cm.createDevice.major) cm.createDevice.major = 64; var da = cm.makedev(cm.createDevice.major++, 0); return cm.registerDevice(da, {open: function (db) { db.seekable = ![]; }, close: function (db) { d7 && d7.buffer && d7.buffer.length && d7(10); }, read: function (db, dc, dd, de, df) { var dg = 0; for (var dh = 0; dh < de; dh++) { var di; try { di = d6(); } catch (dj) { throw new cm.ErrnoError(29); } if (di === undefined && dg === 0) throw new cm.ErrnoError(6); if (di === null || di === undefined) break; dg++, dc[dd + dh] = di; } return dg && (db.node.timestamp = Date.now()), dg; }, write: function (db, dc, dd, de, df) { for (var dg = 0; dg < de; dg++) { try { d7(dc[dd + dg]); } catch (dh) { throw new cm.ErrnoError(29); } } return de && (db.node.timestamp = Date.now()), dg; }}), cm.mkdev(d8, d9, da); }, forceLoadFile: function (a) { if (a.isDevice || a.isFolder || a.link || a.contents) return !![]; if (typeof XMLHttpRequest !== "undefined") throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread."); else { if (m) try { a.contents = cG(m(a.url), !![]), a.usedBytes = a.contents.length; } catch (b) { throw new cm.ErrnoError(29); } else throw new Error("Cannot load without read() or XMLHttpRequest."); } }, createLazyFile: function (a, b, d6, d7, d8) { function d9() { this.lengthKnown = ![], this.chunks = []; } d9.prototype.get = function df(dg) { if (dg > this.length - 1 || dg < 0) return undefined; var dh = dg % this.chunkSize, di = dg / this.chunkSize | 0; return this.getter(di)[dh]; }, d9.prototype.setDataGetter = function dg(dh) { this.getter = dh; }, d9.prototype.cacheLength = function dh() { var di = new XMLHttpRequest; di.open("HEAD", d6, ![]), di.send(null); if (!(di.status >= 200 && di.status < 300 || di.status === 304)) throw new Error("Couldn't load " + d6 + ". Status: " + di.status); var dj = Number(di.getResponseHeader("Content-length")), dk, dl = (dk = di.getResponseHeader("Accept-Ranges")) && dk === "bytes", dm = (dk = di.getResponseHeader("Content-Encoding")) && dk === "gzip", dn = 1048576; if (!dl) dn = dj; var dp = function (dr, ds) { if (dr > ds) throw new Error("invalid range (" + dr + ", " + ds + ") or no bytes requested!"); if (ds > dj - 1) throw new Error("only " + dj + " bytes available! programmer error!"); var dt = new XMLHttpRequest; dt.open("GET", d6, ![]); if (dj !== dn) dt.setRequestHeader("Range", "bytes=" + dr + "-" + ds); if (typeof Uint8Array != "undefined") dt.responseType = "arraybuffer"; dt.overrideMimeType && dt.overrideMimeType("text/plain; charset=x-user-defined"); dt.send(null); if (!(dt.status >= 200 && dt.status < 300 || dt.status === 304)) throw new Error("Couldn't load " + d6 + ". Status: " + dt.status); return dt.response !== undefined ? new Uint8Array(dt.response || []) : cG(dt.responseText || "", !![]); }, dq = this; dq.setDataGetter(function (dr) { var ds = dr * dn, dt = (dr + 1) * dn - 1; dt = Math.min(dt, dj - 1); typeof dq.chunks[dr] === "undefined" && (dq.chunks[dr] = dp(ds, dt)); if (typeof dq.chunks[dr] === "undefined") throw new Error("doXHR failed!"); return dq.chunks[dr]; }), (dm || !dj) && (dn = dj = 1, dj = this.getter(0).length, dn = dj, q("LazyFiles on gzip forces download of the whole file when length is accessed")), this._length = dj, this._chunkSize = dn, this.lengthKnown = !![]; }; if (typeof XMLHttpRequest !== "undefined") { if (!j) throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc"; var da = new d9; Object.defineProperties(da, {length: {get: function () { return !this.lengthKnown && this.cacheLength(), this._length; }}, chunkSize: {get: function () { return !this.lengthKnown && this.cacheLength(), this._chunkSize; }}}); var db = {isDevice: ![], contents: da}; } else var db = {isDevice: ![], url: d6}; var dc = cm.createFile(a, b, db, d7, d8); if (db.contents) dc.contents = db.contents; else db.url && (dc.contents = null, dc.url = db.url); Object.defineProperties(dc, {usedBytes: {get: function () { return this.contents.length; }}}); var dd = {}, de = Object.keys(dc.stream_ops); return de.forEach(function (di) { var dj = dc.stream_ops[di]; dd[di] = function dk() { return cm.forceLoadFile(dc), dj.apply(null, arguments); }; }), dd.read = function di(dj, dk, dl, dm, dn) { cm.forceLoadFile(dc); var dp = dj.node.contents; if (dn >= dp.length) return 0; var dq = Math.min(dp.length - dn, dm); if (dp.slice) for (var dr = 0; dr < dq; dr++) { dk[dl + dr] = dp[dn + dr]; } else for (var dr = 0; dr < dq; dr++) { dk[dl + dr] = dp.get(dn + dr); } return dq; }, dc.stream_ops = dd, dc; }, createPreloadedFile: function (a, b, d6, d7, d8, d9, da, db, dc, dd) { Browser.init(); var de = b ? ci.resolve(cg.join2(a, b)) : a, df = "cp " + de; function dg(dh) { function di(dk) { if (dd) dd(); !db && cm.createDataFile(a, b, dk, d7, d8, dc); if (d9) d9(); aj(df); } var dj = ![]; c.preloadPlugins.forEach(function (dk) { if (dj) return; dk.canHandle(de) && (dk.handle(dh, de, di, function () { if (da) da(); aj(df); }), dj = !![]); }); if (!dj) di(dh); } ai(df), typeof d6 == "string" ? Browser.asyncLoad(d6, function (dh) { dg(dh); }, da) : dg(d6); }, indexedDB: function () { return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; }, DB_NAME: function () { return "EM_FS_" + window.location.pathname; }, DB_VERSION: 20, DB_STORE_NAME: "FILE_DATA", saveFilesToDB: function (a, b, d6) { b = b || function () {}, d6 = d6 || function () {}; var d7 = cm.indexedDB(); try { var d8 = d7.open(cm.DB_NAME(), cm.DB_VERSION); } catch (d9) { return d6(d9); } d8.onupgradeneeded = function da() { q("creating db"); var dc = d8.result; dc.createObjectStore(cm.DB_STORE_NAME); }, d8.onsuccess = function db() { var dc = d8.result, dd = dc.transaction([cm.DB_STORE_NAME], "readwrite"), de = dd.objectStore(cm.DB_STORE_NAME), df = 0, dg = 0, dh = a.length; function di() { if (dg == 0) b(); else d6(); } a.forEach(function (dj) { var dk = de.put(cm.analyzePath(dj).object.contents, dj); dk.onsuccess = function dl() { df++; if (df + dg == dh) di(); }, dk.onerror = function dm() { dg++; if (df + dg == dh) di(); }; }), dd.onerror = d6; }, d8.onerror = d6; }, loadFilesFromDB: function (a, b, d6) { b = b || function () {}, d6 = d6 || function () {}; var d7 = cm.indexedDB(); try { var d8 = d7.open(cm.DB_NAME(), cm.DB_VERSION); } catch (d9) { return d6(d9); } d8.onupgradeneeded = d6, d8.onsuccess = function da() { var dc = d8.result; try { var dd = dc.transaction([cm.DB_STORE_NAME], "readonly"); } catch (dj) { d6(dj); return; } var de = dd.objectStore(cm.DB_STORE_NAME), df = 0, dg = 0, dh = a.length; function di() { if (dg == 0) b(); else d6(); } a.forEach(function (dk) { var dl = de.get(dk); dl.onsuccess = function dm() { cm.analyzePath(dk).exists && cm.unlink(dk); cm.createDataFile(cg.dirname(dk), cg.basename(dk), dl.result, !![], !![], !![]), df++; if (df + dg == dh) di(); }, dl.onerror = function dn() { dg++; if (df + dg == dh) di(); }; }), dd.onerror = d6; }, d8.onerror = d6; }}, cn = {mappings: {}, DEFAULT_POLLMASK: 5, umask: 511, calculateAt: function (a, b, d6) { if (b[0] === "/") return b; var d7; if (a === -100) d7 = cm.cwd(); else { var d8 = cm.getStream(a); if (!d8) throw new cm.ErrnoError(8); d7 = d8.path; } if (b.length == 0) { if (!d6) throw new cm.ErrnoError(44); return d7; } return cg.join2(d7, b); }, doStat: function (a, b, d6) { try { var d7 = a(b); } catch (d8) { if (d8 && d8.node && cg.normalize(b) !== cg.normalize(cm.getPath(d8.node))) return -54; throw d8; } return W[d6 >> 2] = d7.dev, W[d6 + 4 >> 2] = 0, W[d6 + 8 >> 2] = d7.ino, W[d6 + 12 >> 2] = d7.mode, W[d6 + 16 >> 2] = d7.nlink, W[d6 + 20 >> 2] = d7.uid, W[d6 + 24 >> 2] = d7.gid, W[d6 + 28 >> 2] = d7.rdev, W[d6 + 32 >> 2] = 0, (as = [d7.size >>> 0, (ar = d7.size, +Math.abs(ar) >= 1 ? ar > 0 ? (Math.min(+Math.floor(ar / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((ar - +(~~ar >>> 0)) / 4294967296) >>> 0 : 0)], W[d6 + 40 >> 2] = as[0], W[d6 + 44 >> 2] = as[1]), W[d6 + 48 >> 2] = 4096, W[d6 + 52 >> 2] = d7.blocks, W[d6 + 56 >> 2] = d7.atime.getTime() / 1e3 | 0, W[d6 + 60 >> 2] = 0, W[d6 + 64 >> 2] = d7.mtime.getTime() / 1e3 | 0, W[d6 + 68 >> 2] = 0, W[d6 + 72 >> 2] = d7.ctime.getTime() / 1e3 | 0, W[d6 + 76 >> 2] = 0, (as = [d7.ino >>> 0, (ar = d7.ino, +Math.abs(ar) >= 1 ? ar > 0 ? (Math.min(+Math.floor(ar / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((ar - +(~~ar >>> 0)) / 4294967296) >>> 0 : 0)], W[d6 + 80 >> 2] = as[0], W[d6 + 84 >> 2] = as[1]), 0; }, doMsync: function (a, b, d6, d7, d8) { var d9 = T.slice(a, a + d6); cm.msync(b, d9, d8, d6, d7); }, doMkdir: function (a, b) { a = cg.normalize(a); if (a[a.length - 1] === "/") a = a.substr(0, a.length - 1); return cm.mkdir(a, b, 0), 0; }, doMknod: function (a, b, d6) { switch (b & 61440) { case 32768: case 8192: case 24576: case 4096: case 49152: break; default: return -28; } return cm.mknod(a, b, d6), 0; }, doReadlink: function (a, b, d6) { if (d6 <= 0) return -28; var d7 = cm.readlink(a), d8 = Math.min(d6, G(d7)), d9 = S[b + d8]; return E(d7, T, b, d6 + 1), S[b + d8] = d9, d8; }, doAccess: function (a, b) { if (b & -8) return -28; var d6, d7 = cm.lookupPath(a, {follow: !![]}); d6 = d7.node; if (!d6) return -44; var d8 = ""; if (b & 4) d8 += "r"; if (b & 2) d8 += "w"; if (b & 1) d8 += "x"; if (d8 && cm.nodePermissions(d6, d8)) return -2; return 0; }, doDup: function (a, b, d6) { var d7 = cm.getStream(d6); if (d7) cm.close(d7); return cm.open(a, b, 0, d6, d6).fd; }, doReadv: function (a, b, d6, d7) { var d8 = 0; for (var d9 = 0; d9 < d6; d9++) { var da = W[b + d9 * 8 >> 2], db = W[b + (d9 * 8 + 4) >> 2], dc = cm.read(a, S, da, db, d7); if (dc < 0) return -1; d8 += dc; if (dc < db) break; } return d8; }, doWritev: function (a, b, d6, d7) { var d8 = 0; for (var d9 = 0; d9 < d6; d9++) { var da = W[b + d9 * 8 >> 2], db = W[b + (d9 * 8 + 4) >> 2], dc = cm.write(a, S, da, db, d7); if (dc < 0) return -1; d8 += dc; } return d8; }, varargs: undefined, get: function () { cn.varargs += 4; var a = W[cn.varargs - 4 >> 2]; return a; }, getStr: function (a) { var b = D(a); return b; }, getStreamFromFD: function (a) { var b = cm.getStream(a); if (!b) throw new cm.ErrnoError(8); return b; }, get64: function (a, b) { return a; }}; function co(a, b) { try { var d6 = 0; return cf().forEach(function (d7, d8) { var d9 = b + d6; W[a + d8 * 4 >> 2] = d9, P(d7, d9), d6 += d7.length + 1; }), 0; } catch (d7) { if (typeof cm === "undefined" || !(d7 instanceof cm.ErrnoError)) ak(d7); return d7.errno; } } function cp(a, b) { try { var d6 = cf(); W[a >> 2] = d6.length; var d7 = 0; return d6.forEach(function (d8) { d7 += d8.length + 1; }), W[b >> 2] = d7, 0; } catch (d8) { if (typeof cm === "undefined" || !(d8 instanceof cm.ErrnoError)) ak(d8); return d8.errno; } } function cq(a) { try { var b = cn.getStreamFromFD(a); return cm.close(b), 0; } catch (d6) { if (typeof cm === "undefined" || !(d6 instanceof cm.ErrnoError)) ak(d6); return d6.errno; } } function cr(a, b, d6, d7) { try { var d8 = cn.getStreamFromFD(a), d9 = cn.doReadv(d8, b, d6); return W[d7 >> 2] = d9, 0; } catch (da) { if (typeof cm === "undefined" || !(da instanceof cm.ErrnoError)) ak(da); return da.errno; } } function cs(a, b, d6, d7, d8) { try { var d9 = cn.getStreamFromFD(a), da = 4294967296, db = d6 * da + (b >>> 0), dc = 0x20000000000000; if (db <= -dc || db >= dc) return -61; cm.llseek(d9, db, d7), (as = [d9.position >>> 0, (ar = d9.position, +Math.abs(ar) >= 1 ? ar > 0 ? (Math.min(+Math.floor(ar / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((ar - +(~~ar >>> 0)) / 4294967296) >>> 0 : 0)], W[d8 >> 2] = as[0], W[d8 + 4 >> 2] = as[1]); if (d9.getdents && db === 0 && d7 === 0) d9.getdents = null; return 0; } catch (dd) { if (typeof cm === "undefined" || !(dd instanceof cm.ErrnoError)) ak(dd); return dd.errno; } } function ct(a, b, d6, d7) { try { var d8 = cn.getStreamFromFD(a), d9 = cn.doWritev(d8, b, d6); return W[d7 >> 2] = d9, 0; } catch (da) { if (typeof cm === "undefined" || !(da instanceof cm.ErrnoError)) ak(da); return da.errno; } } function cu(a) { v(a); } function cw(a, b) { var d6 = 0; for (var d7 = 0; d7 <= b; d6 += a[d7++]) {} return d6; } var cx = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], cy = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; function cz(a, b) { var d6 = new Date(a.getTime()); while (b > 0) { var d7 = d6.getFullYear() % 4 === 0 && (d6.getFullYear() % 100 !== 0 || d6.getFullYear() % 400 === 0), d8 = d6.getMonth(), d9 = (d7 ? cx : cy)[d8]; if (b > d9 - d6.getDate()) b -= d9 - d6.getDate() + 1, d6.setDate(1), d8 < 11 ? d6.setMonth(d8 + 1) : (d6.setMonth(0), d6.setFullYear(d6.getFullYear() + 1)); else return d6.setDate(d6.getDate() + b), d6; } return d6; } function cA(a, b, d6, d7) { var d8 = W[d7 + 40 >> 2], d9 = {tm_sec: W[d7 >> 2], tm_min: W[d7 + 4 >> 2], tm_hour: W[d7 + 8 >> 2], tm_mday: W[d7 + 12 >> 2], tm_mon: W[d7 + 16 >> 2], tm_year: W[d7 + 20 >> 2], tm_wday: W[d7 + 24 >> 2], tm_yday: W[d7 + 28 >> 2], tm_isdst: W[d7 + 32 >> 2], tm_gmtoff: W[d7 + 36 >> 2], tm_zone: d8 ? D(d8) : ""}, da = D(d6), db = {"%c": "%a %b %d %H:%M:%S %Y", "%D": "%m/%d/%y", "%F": "%Y-%m-%d", "%h": "%b", "%r": "%I:%M:%S %p", "%R": "%H:%M", "%T": "%H:%M:%S", "%x": "%m/%d/%y", "%X": "%H:%M:%S", "%Ec": "%c", "%EC": "%C", "%Ex": "%m/%d/%y", "%EX": "%H:%M:%S", "%Ey": "%y", "%EY": "%Y", "%Od": "%d", "%Oe": "%e", "%OH": "%H", "%OI": "%I", "%Om": "%m", "%OM": "%M", "%OS": "%S", "%Ou": "%u", "%OU": "%U", "%OV": "%V", "%Ow": "%w", "%OW": "%W", "%Oy": "%y"}; for (var dc in db) { da = da.replace(new RegExp(dc, "g"), db[dc]); } var dd = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], de = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; function df(dm, dn, dp) { var dq = typeof dm === "number" ? dm.toString() : dm || ""; while (dq.length < dn) { dq = dp[0] + dq; } return dq; } function dh(dm, dn) { function dp(dr) { return dr < 0 ? -1 : dr > 0 ? 1 : 0; } var dq; return (dq = dp(dm.getFullYear() - dn.getFullYear())) === 0 && ((dq = dp(dm.getMonth() - dn.getMonth())) === 0 && (dq = dp(dm.getDate() - dn.getDate()))), dq; } function di(dm) { switch (dm.getDay()) { case 0: return new Date(dm.getFullYear() - 1, 11, 29); case 1: return dm; case 2: return new Date(dm.getFullYear(), 0, 3); case 3: return new Date(dm.getFullYear(), 0, 2); case 4: return new Date(dm.getFullYear(), 0, 1); case 5: return new Date(dm.getFullYear() - 1, 11, 31); case 6: return new Date(dm.getFullYear() - 1, 11, 30); } } function dj(dm) { var dn = cz(new Date(dm.tm_year + 1900, 0, 1), dm.tm_yday), dp = new Date(dn.getFullYear(), 0, 4), dq = new Date(dn.getFullYear() + 1, 0, 4), dr = di(dp), ds = di(dq); return dh(dr, dn) <= 0 ? dh(ds, dn) <= 0 ? dn.getFullYear() + 1 : dn.getFullYear() : dn.getFullYear() - 1; } var dk = {"%a": function (dm) { return dd[dm.tm_wday].substring(0, 3); }, "%A": function (dm) { return dd[dm.tm_wday]; }, "%b": function (dm) { return de[dm.tm_mon].substring(0, 3); }, "%B": function (dm) { return de[dm.tm_mon]; }, "%C": function (dm) { var dn = dm.tm_year + 1900; return df(dn / 100 | 0, 2, "0"); }, "%d": function (dm) { return df(dm.tm_mday, 2, "0"); }, "%e": function (dm) { return df(dm.tm_mday, 2, " "); }, "%g": function (dm) { return dj(dm).toString().substring(2); }, "%G": function (dm) { return dj(dm); }, "%H": function (dm) { return df(dm.tm_hour, 2, "0"); }, "%I": function (dm) { var dn = dm.tm_hour; if (dn == 0) dn = 12; else { if (dn > 12) dn -= 12; } return df(dn, 2, "0"); }, "%j": function (dm) { return df(dm.tm_mday + cw((dm.tm_year + 1900) % 4 === 0 && ((dm.tm_year + 1900) % 100 !== 0 || (dm.tm_year + 1900) % 400 === 0) ? cx : cy, dm.tm_mon - 1), 3, "0"); }, "%m": function (dm) { return df(dm.tm_mon + 1, 2, "0"); }, "%M": function (dm) { return df(dm.tm_min, 2, "0"); }, "%n": function () { return "\n"; }, "%p": function (dm) { return dm.tm_hour >= 0 && dm.tm_hour < 12 ? "AM" : "PM"; }, "%S": function (dm) { return df(dm.tm_sec, 2, "0"); }, "%t": function () { return " "; }, "%u": function (dm) { return dm.tm_wday || 7; }, "%U": function (dm) { var dn = new Date(dm.tm_year + 1900, 0, 1), dp = dn.getDay() === 0 ? dn : cz(dn, 7 - dn.getDay()), dq = new Date(dm.tm_year + 1900, dm.tm_mon, dm.tm_mday); if (dh(dp, dq) < 0) { var dr = cw(dq.getFullYear() % 4 === 0 && (dq.getFullYear() % 100 !== 0 || dq.getFullYear() % 400 === 0) ? cx : cy, dq.getMonth() - 1) - 31, ds = 31 - dp.getDate(), dt = ds + dr + dq.getDate(); return df(Math.ceil(dt / 7), 2, "0"); } return dh(dp, dn) === 0 ? "01" : "00"; }, "%V": function (dm) { var dn = new Date(dm.tm_year + 1900, 0, 4), dp = new Date(dm.tm_year + 1901, 0, 4), dq = di(dn), dr = di(dp), ds = cz(new Date(dm.tm_year + 1900, 0, 1), dm.tm_yday); if (dh(ds, dq) < 0) return "53"; if (dh(dr, ds) <= 0) return "01"; var dt; return dq.getFullYear() < dm.tm_year + 1900 ? dt = dm.tm_yday + 32 - dq.getDate() : dt = dm.tm_yday + 1 - dq.getDate(), df(Math.ceil(dt / 7), 2, "0"); }, "%w": function (dm) { return dm.tm_wday; }, "%W": function (dm) { var dn = new Date(dm.tm_year, 0, 1), dp = dn.getDay() === 1 ? dn : cz(dn, dn.getDay() === 0 ? 1 : 7 - dn.getDay() + 1), dq = new Date(dm.tm_year + 1900, dm.tm_mon, dm.tm_mday); if (dh(dp, dq) < 0) { var dr = cw(dq.getFullYear() % 4 === 0 && (dq.getFullYear() % 100 !== 0 || dq.getFullYear() % 400 === 0) ? cx : cy, dq.getMonth() - 1) - 31, ds = 31 - dp.getDate(), dt = ds + dr + dq.getDate(); return df(Math.ceil(dt / 7), 2, "0"); } return dh(dp, dn) === 0 ? "01" : "00"; }, "%y": function (dm) { return (dm.tm_year + 1900).toString().substring(2); }, "%Y": function (dm) { return dm.tm_year + 1900; }, "%z": function (dm) { var dn = dm.tm_gmtoff, dp = dn >= 0; return dn = Math.abs(dn) / 60, dn = dn / 60 * 100 + dn % 60, (dp ? "+" : "-") + String("0000" + dn).slice(-4); }, "%Z": function (dm) { return dm.tm_zone; }, "%%": function () { return "%"; }}; for (var dc in dk) { da.includes(dc) && (da = da.replace(new RegExp(dc, "g"), dk[dc](d9))); } var dl = cG(da, ![]); if (dl.length > b) return 0; return O(dl, a), dl.length - 1; } function cC(a) { var b = Date.now() / 1e3 | 0; return a && (W[a >> 2] = b), b; } aG(), aR = c.BindingError = aQ(Error, "BindingError"), aT = c.InternalError = aQ(Error, "InternalError"), b3(), bl = c.UnboundTypeError = aQ(Error, "UnboundTypeError"), c6.staticInit(); var cD = function (a, b, d6, d7) { !a && (a = this), this.parent = a, this.mount = a.mount, this.mounted = null, this.id = cm.nextInode++, this.name = b, this.mode = d6, this.node_ops = {}, this.stream_ops = {}, this.rdev = d7; }, cE = 365, cF = 146; Object.defineProperties(cD.prototype, {read: {get: function () { return (this.mode & cE) === cE; }, set: function (a) { a ? this.mode |= cE : this.mode &= ~cE; }}, write: {get: function () { return (this.mode & cF) === cF; }, set: function (a) { a ? this.mode |= cF : this.mode &= ~cF; }}, isFolder: {get: function () { return cm.isDir(this.mode); }}, isDevice: {get: function () { return cm.isChrdev(this.mode); }}}), cm.FSNode = cD, cm.staticInit(); function cG(a, b, d6) { var d7 = d6 > 0 ? d6 : G(a) + 1, d8 = new Array(d7), d9 = E(a, d8, 0, d8.length); if (b) d8.length = d9; return d8; } var cH = {o: au, d: az, e: aD, E: aE, Q: aX, P: b6, B: b9, r: bo, p: bq, n: br, C: bs, v: bt, R: bu, M: bv, q: by, s: bD, l: bE, a: b0, U: bF, m: bG, f: bI, h: bL, t: bM, c: bN, g: bO, w: bR, x: bS, b: bT, y: bU, j: bV, i: bW, k: bX, A: bY, T: c1, O: c2, F: c3, G: c5, N: cc, I: co, J: cp, K: cq, L: cr, D: cs, z: ct, u: cu, H: cB, S: cC}, cI = aq(), cJ = c.___wasm_call_ctors = function () { return (cJ = c.___wasm_call_ctors = c.asm.W).apply(null, arguments); }, cK = c._malloc = function () { return (cK = c._malloc = c.asm.Y).apply(null, arguments); }, cL = c._free = function () { return (cL = c._free = c.asm.Z).apply(null, arguments); }, cM = c.__Z18__Z01dynCall_fiiivv = function () { return (cM = c.__Z18__Z01dynCall_fiiivv = c.asm._).apply(null, arguments); }, cN = c.__Z18__Z01dynCall_fiifvN10emscripten3valE = function () { return (cN = c.__Z18__Z01dynCall_fiifvN10emscripten3valE = c.asm.$).apply(null, arguments); }, cO = c._main = function () { return (cO = c._main = c.asm.aa).apply(null, arguments); }, cP = c.___getTypeName = function () { return (cP = c.___getTypeName = c.asm.ba).apply(null, arguments); }, cQ = c.___embind_register_native_and_builtin_types = function () { return (cQ = c.___embind_register_native_and_builtin_types = c.asm.ca).apply(null, arguments); }, cR = c.dynCall_ji = function () { return (cR = c.dynCall_ji = c.asm.da).apply(null, arguments); }, cS = c.dynCall_jij = function () { return (cS = c.dynCall_jij = c.asm.ea).apply(null, arguments); }, cT = c.dynCall_iiiijii = function () { return (cT = c.dynCall_iiiijii = c.asm.fa).apply(null, arguments); }, cU = c.dynCall_jiji = function () { return (cU = c.dynCall_jiji = c.asm.ga).apply(null, arguments); }, cV = c.dynCall_viijii = function () { return (cV = c.dynCall_viijii = c.asm.ha).apply(null, arguments); }, cW = c.dynCall_iiiiij = function () { return (cW = c.dynCall_iiiiij = c.asm.ia).apply(null, arguments); }, cX = c.dynCall_iiiiijj = function () { return (cX = c.dynCall_iiiiijj = c.asm.ja).apply(null, arguments); }, cY = c.dynCall_iiiiiijj = function () { return (cY = c.dynCall_iiiiiijj = c.asm.ka).apply(null, arguments); }, cZ; function d0(a) { this.name = "ExitStatus", this.message = "Program terminated with exit(" + a + ")", this.status = a; } var d1 = ![]; ag = function dG() { if (!cZ) d3(); if (!cZ) ag = dG; }; function d2(a) { var b = c._main, d6 = 0, d7 = 0; try { var d8 = b(d6, d7); d4(d8, !![]); } catch (da) { if (da instanceof d0) return; else { if (da == "unwind") return; else { var d9 = da; da && typeof da === "object" && da.stack && (d9 = [da, da.stack]), r("exception thrown: " + d9), h(1, da); } } } finally { d1 = !![]; } } function d3(a) { a = a || f; if (ae > 0) return; a8(); if (ae > 0) return; function b() { if (cZ) return; cZ = !![], c.calledRun = !![]; if (z) return; a9(), aa(); if (d5) d2(a); ac(); } { b(); } } c.run = d3; function d4(a, b) { A = a; if (b && (x || aw > 0) && a === 0) return; if (x || aw > 0) {} else ab(), z = !![]; h(a, new d0(a)); } var d5 = !![]; d3();