Benutzer:Amir/common.js: Unterschied zwischen den Versionen
Amir (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Amir (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 1: | Zeile 1: | ||
$(function () { | |||
function | |||
var g; | var g; | ||
g || | g ||= typeof Module != 'undefined' ? Module : {}; | ||
var aa = "object" == typeof window, | var aa = "object" == typeof window, h = "undefined" != typeof WorkerGlobalScope, m = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node && "renderer" != process.type, ba = !aa && !m && !h, n = h && self.name?.startsWith("em-pthread"); | ||
if (m) { | if (m) { | ||
var ca = require("worker_threads"); | var ca = require("worker_threads"); | ||
Zeile 49: | Zeile 8: | ||
n = (h = !ca.$b) && "em-pthread" == ca.workerData; | n = (h = !ca.$b) && "em-pthread" == ca.workerData; | ||
} | } | ||
var da = Object.assign({}, g), | var da = Object.assign({}, g), ea = "./this.program", ha = (a, b) => { | ||
throw b; | |||
}, ia = "undefined" != typeof document ? document.currentScript?.src : void 0; | |||
m ? ia = __filename : h && (ia = self.location.href); | |||
var q = "", ja, ka; | |||
m ? | |||
var q = "", | |||
if (m) { | if (m) { | ||
if ( | if ("undefined" == typeof process || !process.release || "node" !== process.release.name) { | ||
throw Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)"); | |||
throw Error( | |||
} | } | ||
var la = process.versions.node, | var la = process.versions.node, ma = la.split(".").slice(0, 3); | ||
ma = 10000 * ma[0] + 100 * ma[1] + 1 * ma[2].split("-")[0]; | ma = 10000 * ma[0] + 100 * ma[1] + 1 * ma[2].split("-")[0]; | ||
if (160000 > ma) { | if (160000 > ma) { | ||
throw Error( | throw Error("This emscripten-generated code requires node v16.0.0 (detected v" + la + ")"); | ||
} | } | ||
var fs = require("fs"), | var fs = require("fs"), na = require("path"); | ||
q = __dirname + "/"; | q = __dirname + "/"; | ||
ka = | ka = a => { | ||
a = oa(a) ? new URL(a) : na.normalize(a); | a = oa(a) ? new URL(a) : na.normalize(a); | ||
a = fs.readFileSync(a); | a = fs.readFileSync(a); | ||
Zeile 94: | Zeile 30: | ||
return a; | return a; | ||
}; | }; | ||
ja = | ja = a => { | ||
a = oa(a) ? new URL(a) : na.normalize(a); | a = oa(a) ? new URL(a) : na.normalize(a); | ||
return new Promise((b, c) => { | return new Promise((b, c) => { | ||
Zeile 102: | Zeile 38: | ||
}); | }); | ||
}; | }; | ||
!g.thisProgram && | !g.thisProgram && 1 < process.argv.length && (ea = process.argv[1].replace(/\\/g, "/")); | ||
process.argv.slice(2); | process.argv.slice(2); | ||
"undefined" != typeof module && (module.exports = g); | "undefined" != typeof module && (module.exports = g); | ||
Zeile 112: | Zeile 46: | ||
}; | }; | ||
} else if (ba) { | } else if (ba) { | ||
if | if ("object" == typeof process && "function" === typeof require || "object" == typeof window || "undefined" != typeof WorkerGlobalScope) { | ||
throw Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)"); | |||
throw Error( | |||
} | } | ||
} else if (aa || h) { | } else if (aa || h) { | ||
h | h ? q = self.location.href : "undefined" != typeof document && document.currentScript && (q = document.currentScript.src); | ||
q = q.startsWith("blob:") ? "" : q.substr(0, q.replace(/[?#].*/, "").lastIndexOf("/") + 1); | |||
q = q.startsWith("blob:") | |||
if ("object" != typeof window && "undefined" == typeof WorkerGlobalScope) { | if ("object" != typeof window && "undefined" == typeof WorkerGlobalScope) { | ||
throw Error( | throw Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)"); | ||
} | } | ||
m || | m || (h && (ka = a => { | ||
var b = new XMLHttpRequest(); | |||
b.open("GET", a, !1); | |||
b.responseType = "arraybuffer"; | |||
b.send(null); | |||
return new Uint8Array(b.response); | |||
}), ja = a => oa(a) ? new Promise((b, c) => { | |||
var d = new XMLHttpRequest(); | |||
d.open("GET", a, !0); | |||
d.responseType = "arraybuffer"; | |||
d.onload = () => { | |||
200 == d.status || 0 == d.status && d.response ? b(d.response) : c(d.status); | |||
}; | |||
d.onerror = c; | |||
d.send(null); | |||
}) : fetch(a, {credentials:"same-origin"}).then(b => b.ok ? b.arrayBuffer() : Promise.reject(Error(b.status + " : " + b.url)))); | |||
} else { | } else { | ||
throw Error("environment detection error"); | throw Error("environment detection error"); | ||
} | } | ||
var pa = console.log.bind(console), | var pa = console.log.bind(console), qa = console.error.bind(console); | ||
m && (pa = (...a) => fs.writeSync(1, a.join(" ") + "\n"), qa = (...a) => fs.writeSync(2, a.join(" ") + "\n")); | |||
m && | var u = g.print || pa, v = g.printErr || qa; | ||
var u = g.print || pa, | |||
Object.assign(g, da); | Object.assign(g, da); | ||
da = null; | da = null; | ||
Object.getOwnPropertyDescriptor(g, "fetchSettings") && | Object.getOwnPropertyDescriptor(g, "fetchSettings") && w("`Module.fetchSettings` was supplied but `fetchSettings` not included in INCOMING_MODULE_JS_API"); | ||
x("arguments", "arguments_"); | x("arguments", "arguments_"); | ||
g.thisProgram && (ea = g.thisProgram); | g.thisProgram && (ea = g.thisProgram); | ||
x("thisProgram", "thisProgram"); | x("thisProgram", "thisProgram"); | ||
t( | t("undefined" == typeof g.memoryInitializerPrefixURL, "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"); | ||
t("undefined" == typeof g.pthreadMainPrefixURL, "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"); | |||
t("undefined" == typeof g.cdInitializerPrefixURL, "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"); | |||
); | t("undefined" == typeof g.filePackagePrefixURL, "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"); | ||
t( | |||
); | |||
t( | |||
); | |||
t( | |||
); | |||
t("undefined" == typeof g.read, "Module.read option was removed"); | t("undefined" == typeof g.read, "Module.read option was removed"); | ||
t( | t("undefined" == typeof g.readAsync, "Module.readAsync option was removed (modify readAsync in JS)"); | ||
t("undefined" == typeof g.readBinary, "Module.readBinary option was removed (modify readBinary in JS)"); | |||
t("undefined" == typeof g.setWindowTitle, "Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"); | |||
); | t("undefined" == typeof g.TOTAL_MEMORY, "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"); | ||
t( | |||
); | |||
t( | |||
); | |||
t( | |||
); | |||
x("asm", "wasmExports"); | x("asm", "wasmExports"); | ||
x("readAsync", "readAsync"); | x("readAsync", "readAsync"); | ||
x("readBinary", "readBinary"); | x("readBinary", "readBinary"); | ||
x("setWindowTitle", "setWindowTitle"); | x("setWindowTitle", "setWindowTitle"); | ||
t( | t(aa || h || m, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)"); | ||
t(!ba, "shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable."); | |||
); | |||
t( | |||
); | |||
var ra = g.wasmBinary; | var ra = g.wasmBinary; | ||
x("wasmBinary", "wasmBinary"); | x("wasmBinary", "wasmBinary"); | ||
"object" != typeof WebAssembly && v("no native wasm support detected"); | "object" != typeof WebAssembly && v("no native wasm support detected"); | ||
var z, | var z, sa, A = !1, ta; | ||
function t(a, b) { | function t(a, b) { | ||
a || w("Assertion failed" + (b ? ": " + b : "")); | a || w("Assertion failed" + (b ? ": " + b : "")); | ||
Zeile 258: | Zeile 124: | ||
if (m) { | if (m) { | ||
var Ba = ca.parentPort; | var Ba = ca.parentPort; | ||
Ba.on("message", | Ba.on("message", c => onmessage({data:c})); | ||
Object.assign(globalThis, {self:global, postMessage:c => Ba.postMessage(c),}); | |||
Object.assign(globalThis, { | |||
} | } | ||
var Ca = !1; | var Ca = !1; | ||
Zeile 275: | Zeile 134: | ||
g.printErr || (v = a); | g.printErr || (v = a); | ||
Da = a; | Da = a; | ||
self.alert = function (...c) { | self.alert = function(...c) { | ||
postMessage({ | postMessage({s:"alert", text:c.join(" "), nb:I()}); | ||
}; | }; | ||
self.onunhandledrejection = | self.onunhandledrejection = c => { | ||
throw c.reason || c; | throw c.reason || c; | ||
}; | }; | ||
function b(c) { | function b(c) { | ||
try { | try { | ||
var d = c.data, | var d = c.data, e = d.s; | ||
if ("load" === e) { | if ("load" === e) { | ||
za = d.la; | za = d.la; | ||
let f = []; | let f = []; | ||
self.onmessage = | self.onmessage = k => f.push(k); | ||
self.startWorker = () => { | self.startWorker = () => { | ||
postMessage({ | postMessage({s:"loaded"}); | ||
for (let k of f) { | for (let k of f) { | ||
b(k); | b(k); | ||
Zeile 304: | Zeile 156: | ||
for (const k of d.Sa) { | for (const k of d.Sa) { | ||
if (!g[k] || g[k].proxy) { | if (!g[k] || g[k].proxy) { | ||
g[k] = (...l) => { | |||
postMessage({ | postMessage({s:"callHandler", Ra:k, args:l}); | ||
}, "print" == k && (u = g[k]), "printErr" == k && (v = g[k]); | |||
} | |||
} | } | ||
} | } | ||
Zeile 324: | Zeile 170: | ||
Ga(); | Ga(); | ||
Ha(d.o); | Ha(d.o); | ||
Ca || | Ca ||= !0; | ||
try { | try { | ||
Ia(d.kb, d.S); | Ia(d.kb, d.S); | ||
Zeile 333: | Zeile 179: | ||
} | } | ||
} else { | } else { | ||
"setimmediate" !== d.target && | "setimmediate" !== d.target && ("checkMailbox" === e ? Ca && Ma() : e && (v(`worker: received unknown command ${e}`), v(d))); | ||
} | } | ||
} catch (f) { | } catch (f) { | ||
throw | throw v(`worker: onmessage() captured an uncaught exception: ${f}`), f?.stack && v(f.stack), Na(), f; | ||
} | } | ||
} | } | ||
self.onmessage = b; | self.onmessage = b; | ||
} | } | ||
t( | t(!g.STACK_SIZE, "STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"); | ||
t("undefined" != typeof Int32Array && "undefined" !== typeof Float64Array && void 0 != Int32Array.prototype.subarray && void 0 != Int32Array.prototype.set, "JS engine does not provide full typed array support"); | |||
); | |||
t( | |||
); | |||
if (!n) { | if (!n) { | ||
if (g.wasmMemory) { | if (g.wasmMemory) { | ||
Zeile 366: | Zeile 195: | ||
var Oa = g.INITIAL_MEMORY || 2147483648; | var Oa = g.INITIAL_MEMORY || 2147483648; | ||
x("INITIAL_MEMORY", "INITIAL_MEMORY"); | x("INITIAL_MEMORY", "INITIAL_MEMORY"); | ||
t( | t(52428800 <= Oa, "INITIAL_MEMORY should be larger than STACK_SIZE, was " + Oa + "! (STACK_SIZE=52428800)"); | ||
z = new WebAssembly.Memory({initial:Oa / 65536, maximum:Oa / 65536, shared:!0,}); | |||
z = new WebAssembly.Memory({ | |||
} | } | ||
ya(); | ya(); | ||
} | } | ||
var Pa = [], | var Pa = [], Qa = [], Ra = [], Sa = [], Ta = !1; | ||
function Ua() { | function Ua() { | ||
t(!Ta); | t(!Ta); | ||
Zeile 390: | Zeile 206: | ||
if (!n) { | if (!n) { | ||
if (!g.noFSInit && !Va) { | if (!g.noFSInit && !Va) { | ||
t(!Va, "FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"); | |||
t( | |||
Va = !0; | Va = !0; | ||
a ??= g.stdin; | |||
c ??= g.stdout; | |||
b ??= g.stderr; | |||
a ? J("stdin", a) : Wa("/dev/tty", "/dev/stdin"); | a ? J("stdin", a) : Wa("/dev/tty", "/dev/stdin"); | ||
c ? J("stdout", null, c) : Wa("/dev/tty", "/dev/stdout"); | c ? J("stdout", null, c) : Wa("/dev/tty", "/dev/stdout"); | ||
Zeile 413: | Zeile 225: | ||
} | } | ||
} | } | ||
t( | t(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); | ||
t(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); | |||
t(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); | |||
); | t(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); | ||
t( | var K = 0, $a = null, ab = null, bb = {}; | ||
); | |||
t( | |||
); | |||
t( | |||
); | |||
var K = 0, | |||
function cb(a) { | function cb(a) { | ||
K++; | K++; | ||
g.monitorRunDependencies?.(K); | |||
a ? (t(!bb[a]), bb[a] = 1, null === $a && "undefined" != typeof setInterval && ($a = setInterval(() => { | |||
if (A) { | |||
a | clearInterval($a), $a = null; | ||
} else { | |||
var b = !1, c; | |||
for (c in bb) { | |||
b || (b = !0, v("still waiting on run dependencies:")), v(`dependency: ${c}`); | |||
} | |||
b && v("(end of list)"); | |||
} | |||
}, 10000))) : v("warning: run dependency added without ID"); | |||
} | } | ||
function db(a) { | function db(a) { | ||
K--; | K--; | ||
g.monitorRunDependencies?.(K); | |||
a ? (t(bb[a]), delete bb[a]) : v("warning: run dependency removed without ID"); | |||
0 == K && (null !== $a && (clearInterval($a), $a = null), ab && (a = ab, ab = null, a())); | |||
a | |||
0 == K && | |||
} | } | ||
function w(a) { | function w(a) { | ||
g.onAbort?.(a); | |||
a = "Aborted(" + a + ")"; | a = "Aborted(" + a + ")"; | ||
v(a); | v(a); | ||
A = !0; | A = !0; | ||
0 <= a.indexOf("RuntimeError: unreachable") && | 0 <= a.indexOf("RuntimeError: unreachable") && (a += '. "unreachable" may be due to ASYNCIFY_STACK_SIZE not being large enough (try increasing it)'); | ||
throw new WebAssembly.RuntimeError(a); | throw new WebAssembly.RuntimeError(a); | ||
} | } | ||
var eb = | var eb = a => a.startsWith("data:application/octet-stream;base64,"), oa = a => a.startsWith("file://"); | ||
function L(a, b) { | function L(a, b) { | ||
return (...c) => { | return (...c) => { | ||
Zeile 492: | Zeile 265: | ||
var d = M[a]; | var d = M[a]; | ||
t(d, `exported native function \`${a}\` not found`); | t(d, `exported native function \`${a}\` not found`); | ||
t( | t(c.length <= b, `native function \`${a}\` called with ${c.length} args but expects ${b}`); | ||
return d(...c); | return d(...c); | ||
}; | }; | ||
Zeile 510: | Zeile 280: | ||
} | } | ||
function hb(a) { | function hb(a) { | ||
return ra | return ra ? Promise.resolve().then(() => gb(a)) : ja(a).then(b => new Uint8Array(b), () => gb(a)); | ||
} | } | ||
function ib(a, b, c) { | function ib(a, b, c) { | ||
return hb(a) | return hb(a).then(d => WebAssembly.instantiate(d, b)).then(c, d => { | ||
v(`failed to asynchronously prepare wasm: ${d}`); | |||
oa(fb) && v(`warning: Loading from a file URI (${fb}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`); | |||
w(d); | |||
}); | |||
} | } | ||
function jb(a, b) { | function jb(a, b) { | ||
var c = fb; | var c = fb; | ||
ra || | ra || "function" != typeof WebAssembly.instantiateStreaming || eb(c) || oa(c) || m || "function" != typeof fetch ? ib(c, a, b) : fetch(c, {credentials:"same-origin"}).then(d => WebAssembly.instantiateStreaming(d, a).then(b, function(e) { | ||
v(`wasm streaming compile failed: ${e}`); | |||
v("falling back to ArrayBuffer instantiation"); | |||
return ib(c, a, b); | |||
})); | |||
} | } | ||
function kb() { | function kb() { | ||
lb = { | lb = {SDL_Flip:mb, SDL_GetError:nb, SDL_GetTicks:ob, SDL_Init:pb, SDL_LockSurface:qb, SDL_PollEvent:rb, SDL_Quit:sb, SDL_SetVideoMode:tb, SDL_UnlockSurface:ub, __assert_fail:vb, __pthread_create_js:wb, _abort_js:xb, _emscripten_get_now_is_monotonic:yb, _emscripten_init_main_thread_js:zb, _emscripten_notify_mailbox_postmessage:Ab, _emscripten_receive_on_main_thread_js:Bb, _emscripten_thread_cleanup:Cb, _emscripten_thread_mailbox_await:Ha, _emscripten_thread_set_strongref:Db, _tzset_js:Eb, emscripten_check_blocking_allowed:Fb, | ||
emscripten_date_now:Gb, emscripten_exit_with_live_runtime:Hb, emscripten_get_now:Ib, emscripten_num_logical_cores:Jb, emscripten_resize_heap:Kb, emscripten_runtime_keepalive_check:Lb, emscripten_set_main_loop:Mb, emscripten_sleep:Nb, environ_get:Ob, environ_sizes_get:Pb, exit:Qb, fd_close:Rb, fd_read:Sb, fd_seek:Tb, fd_write:Ub, memory:z}; | |||
lb.Ia || (lb.Ia = !0, Vb()); | |||
return {env:lb, wasi_snapshot_preview1:lb,}; | |||
lb.Ia || | |||
return { | |||
} | } | ||
var Wb = new Int16Array(1), | var Wb = new Int16Array(1), Xb = new Int8Array(Wb.buffer); | ||
Wb[0] = 25459; | Wb[0] = 25459; | ||
if (115 !== Xb[0] || 99 !== Xb[1]) { | if (115 !== Xb[0] || 99 !== Xb[1]) { | ||
Zeile 601: | Zeile 309: | ||
} | } | ||
if (g.ENVIRONMENT) { | if (g.ENVIRONMENT) { | ||
throw Error( | throw Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)"); | ||
} | } | ||
function x(a, b) { | function x(a, b) { | ||
Object.getOwnPropertyDescriptor(g, a) || | Object.getOwnPropertyDescriptor(g, a) || Object.defineProperty(g, a, {configurable:!0, get() { | ||
w(`\`Module.${a}\` has been replaced by \`${b}\`` + " (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)"); | |||
}}); | |||
} | } | ||
function Yb(a) { | function Yb(a) { | ||
return | return "FS_createPath" === a || "FS_createDataFile" === a || "FS_createPreloadedFile" === a || "FS_unlink" === a || "addRunDependency" === a || "FS_createLazyFile" === a || "FS_createDevice" === a || "removeRunDependency" === a; | ||
} | } | ||
function Zb(a, b) { | function Zb(a, b) { | ||
"undefined" == typeof globalThis || | "undefined" == typeof globalThis || Object.getOwnPropertyDescriptor(globalThis, a) || Object.defineProperty(globalThis, a, {configurable:!0, get() { | ||
b(); | |||
}}); | |||
} | } | ||
function $b(a, b) { | function $b(a, b) { | ||
Zeile 647: | Zeile 332: | ||
$b("asm", "Please use wasmExports instead"); | $b("asm", "Please use wasmExports instead"); | ||
function ac(a) { | function ac(a) { | ||
n || | n || Object.getOwnPropertyDescriptor(g, a) || Object.defineProperty(g, a, {configurable:!0, get() { | ||
var b = `'${a}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`; | |||
Yb(a) && (b += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"); | |||
w(b); | |||
}}); | |||
} | } | ||
function Da(...a) { | function Da(...a) { | ||
Zeile 664: | Zeile 342: | ||
} | } | ||
class bc { | class bc { | ||
name="ExitStatus"; | |||
constructor(a) { | constructor(a) { | ||
this.message = `Program terminated with exit(${a})`; | this.message = `Program terminated with exit(${a})`; | ||
this.status = a; | this.status = a; | ||
} | } | ||
} | } | ||
var cc = | var cc = a => { | ||
a.terminate(); | |||
a.onmessage = b => { | |||
v(`received "${b.data.s}" command from terminated worker: ${a.la}`); | |||
}; | }; | ||
}, gc = a => { | |||
t(!n, "Internal Error! cleanupThread() can only ever be called from main application thread!"); | |||
t(a, "Internal Error! Null pthread_ptr in cleanupThread!"); | |||
a = dc[a]; | |||
t(a); | |||
var b = a.o; | |||
delete dc[b]; | |||
O.push(a); | |||
ec.splice(ec.indexOf(a), 1); | |||
a.o = 0; | |||
m && a.unref(); | |||
fc(b); | |||
}, jc = a => { | |||
t(!n, "Internal Error! spawnThread() can only ever be called from main application thread!"); | |||
t(a.o, "Internal error, no pthread ptr!"); | |||
0 == O.length && (hc(), ic(O[0])); | |||
var b = O.pop(); | |||
if (!b) { | |||
return 6; | |||
} | |||
t(!b.o, "Internal error!"); | |||
ec.push(b); | |||
dc[a.o] = b; | |||
b.o = a.o; | |||
var c = {s:"run", kb:a.jb, S:a.S, o:a.o,}; | |||
m && b.unref(); | |||
b.postMessage(c, a.Ga); | |||
return 0; | |||
}, Q = 0, Lb = () => kc || 0 < Q, R = (a, b, ...c) => { | |||
for (var d = 2 * c.length, e = lc(), f = mc(8 * d), k = f >> 3, l = 0; l < c.length; l++) { | |||
var r = c[l]; | |||
"bigint" == typeof r ? (H[k + 2 * l] = 1n, H[k + 2 * l + 1] = r) : (H[k + 2 * l] = 0n, xa[k + 2 * l + 1] = r); | |||
} | |||
a = nc(a, 0, d, f, b); | |||
oc(e); | |||
return a; | |||
}; | |||
function pc(a) { | function pc(a) { | ||
if (n) { | if (n) { | ||
Zeile 740: | Zeile 396: | ||
ta = a; | ta = a; | ||
if (!(kc || 0 < Q)) { | if (!(kc || 0 < Q)) { | ||
t(!n, "Internal Error! terminateAllThreads() can only ever be called from main application thread!"); | |||
t( | |||
for (var b of ec) { | for (var b of ec) { | ||
cc(b); | cc(b); | ||
Zeile 754: | Zeile 406: | ||
ec = []; | ec = []; | ||
dc = {}; | dc = {}; | ||
g.onExit?.(a); | |||
A = !0; | A = !0; | ||
} | } | ||
ha(a, new bc(a)); | ha(a, new bc(a)); | ||
} | } | ||
var qc = | var qc = a => { | ||
a instanceof bc || "unwind" == a || ha(1, a); | a instanceof bc || "unwind" == a || ha(1, a); | ||
}; | }; | ||
Zeile 773: | Zeile 423: | ||
} | } | ||
var Qb = (a, b) => { | var Qb = (a, b) => { | ||
ta = a; | |||
sc(); | |||
if (n) { | |||
throw t(!b), rc(a), "unwind"; | |||
} | |||
(kc || 0 < Q) && !b && v(`program exited (with status: ${a}), but keepRuntimeAlive() is set (counter=${Q}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`); | |||
pc(a); | |||
}, tc = a => { | |||
t("number" === typeof a); | |||
return "0x" + (a >>> 0).toString(16).padStart(8, "0"); | |||
}, O = [], ec = [], uc = [], dc = {}, vc = 1; | |||
function wc() { | function wc() { | ||
for (var a = navigator.hardwareConcurrency; a--; ) { | for (var a = navigator.hardwareConcurrency; a--;) { | ||
hc(); | hc(); | ||
} | } | ||
Zeile 804: | Zeile 444: | ||
} | } | ||
function Ga() { | function Ga() { | ||
uc.forEach | uc.forEach(a => a()); | ||
} | } | ||
var ic = | var ic = a => new Promise(b => { | ||
a.onmessage = f => { | |||
f = f.data; | |||
var k = f.s; | |||
if (f.$ && f.$ != I()) { | |||
var l = dc[f.$]; | |||
l ? l.postMessage(f, f.Ga) : v(`Internal error! Worker sent a message "${k}" to target pthread ${f.$}, but that thread no longer exists!`); | |||
} else { | |||
if ("checkMailbox" === k) { | |||
Ma(); | |||
} else if ("spawnThread" === k) { | |||
jc(f); | |||
} else if ("cleanupThread" === k) { | |||
gc(f.mb); | |||
} else if ("loaded" === k) { | |||
a.loaded = !0, m && !a.o && a.unref(), b(a); | |||
} else if ("alert" === k) { | |||
alert(`Thread ${f.nb}: ${f.text}`); | |||
} else if ("setimmediate" === f.target) { | |||
a.postMessage(f); | |||
} else if ("callHandler" === k) { | |||
g[f.Ra](...f.args); | |||
} else { | } else { | ||
k && v(`worker sent an unknown command ${k}`); | |||
} | } | ||
} | } | ||
a.la = vc++; | }; | ||
a.onerror = f => { | |||
var k = "worker sent an error!"; | |||
a.o && (k = `Pthread ${tc(a.o)} sent an error!`); | |||
v(`${k} ${f.filename}:${f.lineno}: ${f.message}`); | |||
throw f; | |||
}; | |||
m && (a.on("message", f => a.onmessage({data:f})), a.on("error", f => a.onerror(f))); | |||
t(z instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!"); | |||
t(sa instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!"); | |||
var c = [], d = ["onExit", "onAbort", "print", "printErr",], e; | |||
for (e of d) { | |||
g.propertyIsEnumerable(e) && c.push(e); | |||
} | |||
a.la = vc++; | |||
a.postMessage({s:"load", Sa:c, sb:z, tb:sa, workerID:a.la,}); | |||
}); | |||
function xc(a) { | function xc(a) { | ||
n ? a() : Promise.all(O.map(ic)).then(a); | n ? a() : Promise.all(O.map(ic)).then(a); | ||
} | } | ||
function hc() { | function hc() { | ||
var a = { | var a = {workerData:"em-pthread", name:"em-pthread-" + vc,}; | ||
var b = ia; | var b = ia; | ||
g.mainScriptUrlOrBlob && | g.mainScriptUrlOrBlob && (b = g.mainScriptUrlOrBlob, "string" != typeof b && (b = URL.createObjectURL(b))); | ||
a = new Worker(b, a); | a = new Worker(b, a); | ||
O.push(a); | O.push(a); | ||
} | } | ||
var Za = | var Za = a => { | ||
for (; 0 < a.length;) { | |||
a.shift()(g); | |||
} | |||
}, Ea = a => { | |||
var b = F[a + 52 >> 2]; | |||
a = b - F[a + 56 >> 2]; | |||
t(0 != b); | |||
t(0 != a); | |||
t(b > a, "stackHigh must be higher then stackLow"); | |||
yc(b, a); | |||
oc(b); | |||
}, Ia = (a, b) => { | |||
kc = Q = 0; | |||
a = zc(a, b); | |||
kc || 0 < Q ? ta = a : Ac(a); | |||
}, kc = g.noExitRuntime || !0, N = a => { | |||
N.ja || (N.ja = {}); | |||
N.ja[a] || (N.ja[a] = 1, m && (a = "warning: " + a), v(a)); | |||
}, Bc = (a, b) => { | |||
for (var c = 0, d = a.length - 1; 0 <= d; d--) { | |||
var e = a[d]; | |||
"." === e ? a.splice(d, 1) : ".." === e ? (a.splice(d, 1), c++) : c && (a.splice(d, 1), c--); | |||
} | |||
if (b) { | |||
for (; c; c--) { | |||
a.unshift(".."); | |||
} | } | ||
} | } | ||
return a; | |||
}, Cc = a => { | |||
var b = "/" === a.charAt(0), c = "/" === a.substr(-1); | |||
(a = Bc(a.split("/").filter(d => !!d), !b).join("/")) || b || (a = "."); | |||
a && c && (a += "/"); | |||
return (b ? "/" : "") + a; | |||
}, Dc = a => { | |||
var b = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1); | |||
a = b[0]; | |||
b = b[1]; | |||
if (!a && !b) { | |||
return "."; | |||
} | |||
b &&= b.substr(0, b.length - 1); | |||
return a + b; | |||
}, Ec = a => { | |||
if ("/" === a) { | |||
return "/"; | |||
} | } | ||
a = Cc(a); | |||
a = a.replace(/\/$/, ""); | |||
var b = a.lastIndexOf("/"); | |||
return -1 === b ? a : a.substr(b + 1); | |||
}, Fc = () => { | |||
if (!(kc || 0 < Q)) { | |||
try { | |||
n ? Ac(ta) : Qb(ta); | |||
} catch (a) { | |||
qc(a); | |||
} | } | ||
} | |||
}, Gc = a => { | |||
if (A) { | |||
} | v("user callback triggered after runtime exited or application aborted. Ignoring."); | ||
} else { | |||
try { | |||
a(), Fc(); | |||
} catch (b) { | |||
qc(b); | |||
} | } | ||
} | |||
} | }, Hc = (a, b) => { | ||
Q += 1; | |||
return setTimeout(() => { | |||
t(0 < Q); | |||
--Q; | |||
Gc(a); | |||
}, b); | |||
}, Ic = g.preloadPlugins || [], Jc = !1, Kc = !1, Lc = []; | |||
function Mc() { | function Mc() { | ||
function a() { | function a() { | ||
Kc = | Kc = document.pointerLockElement === g.canvas || document.mozPointerLockElement === g.canvas || document.webkitPointerLockElement === g.canvas || document.msPointerLockElement === g.canvas; | ||
} | } | ||
if (!Nc) { | if (!Nc) { | ||
Nc = !0; | Nc = !0; | ||
Ic.push({ | Ic.push({canHandle:function(c) { | ||
return !g.noImageDecoding && /\.(jpg|jpeg|png|bmp|webp)$/i.test(c); | |||
}, handle:function(c, d, e, f) { | |||
var k = new Blob([c], {type:Oc(d)}); | |||
k.size !== c.length && (k = new Blob([(new Uint8Array(c)).buffer], {type:Oc(d)})); | |||
var l = URL.createObjectURL(k); | |||
t("string" == typeof l, "createObjectURL must return a url as a string"); | |||
var r = new Image(); | |||
r.onload = () => { | |||
t(r.complete, `Image ${d} could not be decoded`); | |||
var p = document.createElement("canvas"); | |||
p.width = r.width; | |||
p.height = r.height; | |||
p.getContext("2d").drawImage(r, 0, 0); | |||
URL.revokeObjectURL(l); | |||
e?.(c); | |||
}; | |||
r.onerror = () => { | |||
v(`Image ${l} could not be decoded`); | |||
f?.(); | |||
}; | |||
r.src = l; | |||
}}); | |||
Ic.push({canHandle:function(c) { | |||
return !g.noAudioDecoding && c.substr(-4) in {".ogg":1, ".wav":1, ".mp3":1}; | |||
}, handle:function(c, d, e) { | |||
function f() { | |||
k || (k = !0, e?.(c)); | |||
} | } | ||
var k = !1, l = URL.createObjectURL(new Blob([c], {type:Oc(d)})); | |||
t("string" == typeof l, "createObjectURL must return a url as a string"); | |||
var r = new Audio(); | |||
r.addEventListener("canplaythrough", () => f(r), !1); | |||
r.onerror = function() { | |||
if (!k) { | |||
v(`warning: browser could not fully decode audio ${d}, trying slower base64 approach`); | |||
for (var p = "", y = 0, B = 0, E = 0; E < c.length; E++) { | |||
for (y = y << 8 | c[E], B += 8; 6 <= B;) { | |||
var wa = y >> B - 6 & 63; | |||
B -= 6; | |||
p += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[wa]; | |||
} | } | ||
} | } | ||
2 == B ? (p += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(y & 3) << 4], p += "==") : 4 == B && (p += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(y & 15) << 2], p += "="); | |||
r.src = "data:audio/x-" + d.substr(-3) + ";base64," + p; | |||
f(r); | f(r); | ||
} | } | ||
} | }; | ||
}); | r.src = l; | ||
Hc(() => { | |||
f(r); | |||
}, 10000); | |||
}}); | |||
var b = g.canvas; | var b = g.canvas; | ||
b && | b && (b.requestPointerLock = b.requestPointerLock || b.mozRequestPointerLock || b.webkitRequestPointerLock || b.msRequestPointerLock || (() => { | ||
}), b.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock || document.msExitPointerLock || (() => { | |||
}), b.exitPointerLock = b.exitPointerLock.bind(document), document.addEventListener("pointerlockchange", a, !1), document.addEventListener("mozpointerlockchange", a, !1), document.addEventListener("webkitpointerlockchange", a, !1), document.addEventListener("mspointerlockchange", a, !1), g.elementPointerLock && b.addEventListener("click", c => { | |||
!Kc && g.canvas.requestPointerLock && (g.canvas.requestPointerLock(), c.preventDefault()); | |||
}, !1)); | |||
} | } | ||
} | } | ||
function Pc(a, b, c, d) { | function Pc(a, b, c, d) { | ||
if (b && g.ctx && a == g.canvas) { | if (b && g.ctx && a == g.canvas) { | ||
return g.ctx; | return g.ctx; | ||
Zeile 1.143: | Zeile 650: | ||
var e; | var e; | ||
if (b) { | if (b) { | ||
var f = { | var f = {antialias:!1, alpha:!1, ab:1,}; | ||
if (d) { | if (d) { | ||
for (var k in d) { | for (var k in d) { | ||
Zeile 1.162: | Zeile 665: | ||
return null; | return null; | ||
} | } | ||
c && | c && (b || t("undefined" == typeof Tc, "cannot set in module if GLctx is used, but we are a non-GL context that would replace it"), g.ctx = l, b && (Uc = Sc[e], g.ctx = Tc = Uc?.aa), Lc.forEach(r => r()), Mc()); | ||
return l; | return l; | ||
} | } | ||
var Vc = !1, | var Vc = !1, Wc = void 0, Xc = void 0; | ||
function Yc() { | function Yc() { | ||
if (!Jc) { | if (!Jc) { | ||
return !1; | return !1; | ||
} | } | ||
( | (document.exitFullscreen || document.cancelFullScreen || document.mozCancelFullScreen || document.msExitFullscreen || document.webkitCancelFullScreen || (() => { | ||
})).apply(document, []); | |||
return !0; | return !0; | ||
} | } | ||
function Oc(a) { | function Oc(a) { | ||
return { | return {jpg:"image/jpeg", jpeg:"image/jpeg", png:"image/png", bmp:"image/bmp", ogg:"audio/ogg", wav:"audio/wav", mp3:"audio/mpeg"}[a.substr(a.lastIndexOf(".") + 1)]; | ||
} | } | ||
function Zc(a) { | function Zc(a) { | ||
switch (a.type) { | switch(a.type) { | ||
case "DOMMouseScroll": | case "DOMMouseScroll": | ||
var b = a.detail / 3; | var b = a.detail / 3; | ||
Zeile 1.214: | Zeile 690: | ||
case "wheel": | case "wheel": | ||
b = a.deltaY; | b = a.deltaY; | ||
switch (a.deltaMode) { | switch(a.deltaMode) { | ||
case 0: | case 0: | ||
b /= 100; | b /= 100; | ||
Zeile 1.226: | Zeile 702: | ||
default: | default: | ||
throw "unrecognized mouse wheel delta mode: " + a.deltaMode; | throw "unrecognized mouse wheel delta mode: " + a.deltaMode; | ||
} | }break; | ||
default: | default: | ||
throw "unrecognized mouse wheel event: " + a.type; | throw "unrecognized mouse wheel event: " + a.type; | ||
Zeile 1.233: | Zeile 708: | ||
return b; | return b; | ||
} | } | ||
var $c = 0, | var $c = 0, ad = 0, bd = 0, cd = 0, dd = {}, ed = {}; | ||
function fd(a, b) { | function fd(a, b) { | ||
var c = g.canvas.getBoundingClientRect(), | var c = g.canvas.getBoundingClientRect(), d = g.canvas.width, e = g.canvas.height, f = "undefined" != typeof window.scrollX ? window.scrollX : window.pageXOffset, k = "undefined" != typeof window.scrollY ? window.scrollY : window.pageYOffset; | ||
t("undefined" != typeof f && "undefined" != typeof k, "Unable to retrieve scroll position, mouse positions likely broken."); | |||
t( | |||
a -= f + c.left; | a -= f + c.left; | ||
b -= k + c.top; | b -= k + c.top; | ||
a *= d / c.width; | a *= d / c.width; | ||
b *= e / c.height; | b *= e / c.height; | ||
return { | return {x:a, y:b}; | ||
} | } | ||
function gd(a) { | function gd(a) { | ||
if (Kc) { | if (Kc) { | ||
"mousemove" != a.type && "mozMovementX" in a | "mousemove" != a.type && "mozMovementX" in a ? bd = cd = 0 : (bd = a.movementX || a.mozMovementX || a.webkitMovementX || 0, cd = a.movementY || a.mozMovementY || a.webkitMovementY || 0), $c += bd, ad += cd; | ||
} else { | } else { | ||
if ( | if ("touchstart" === a.type || "touchend" === a.type || "touchmove" === a.type) { | ||
var b = a.M; | var b = a.M; | ||
if (void 0 !== b) { | if (void 0 !== b) { | ||
var c = fd(b.pageX, b.pageY); | var c = fd(b.pageX, b.pageY); | ||
if ("touchstart" === a.type) { | if ("touchstart" === a.type) { | ||
ed[b.identifier] = c, dd[b.identifier] = c; | |||
} else if ("touchend" === a.type || "touchmove" === a.type) { | } else if ("touchend" === a.type || "touchmove" === a.type) { | ||
(a = dd[b.identifier]) || (a = c), | (a = dd[b.identifier]) || (a = c), ed[b.identifier] = a, dd[b.identifier] = c; | ||
} | } | ||
} | } | ||
} else { | } else { | ||
const { x: d, y: e } = fd(a.pageX, a.pageY); | const {x:d, y:e} = fd(a.pageX, a.pageY); | ||
bd = d - $c; | bd = d - $c; | ||
cd = e - ad; | cd = e - ad; | ||
Zeile 1.301: | Zeile 744: | ||
function jd() { | function jd() { | ||
var a = g.canvas; | var a = g.canvas; | ||
hd.forEach | hd.forEach(b => b(a.width, a.height)); | ||
} | } | ||
function kd(a, b, c) { | function kd(a, b, c) { | ||
Zeile 1.308: | Zeile 751: | ||
} | } | ||
function ld(a, b, c) { | function ld(a, b, c) { | ||
b && c ? | b && c ? (a.wb = b, a.Ta = c) : (b = a.wb, c = a.Ta); | ||
var d = b, | var d = b, e = c; | ||
g.forcedAspectRatio && 0 < g.forcedAspectRatio && (d / e < g.forcedAspectRatio ? d = Math.round(e * g.forcedAspectRatio) : e = Math.round(d / g.forcedAspectRatio)); | |||
g.forcedAspectRatio && | if ((document.fullscreenElement || document.mozFullScreenElement || document.msFullscreenElement || document.webkitFullscreenElement || document.webkitCurrentFullScreenElement) === a.parentNode && "undefined" != typeof screen) { | ||
if ( | |||
var f = Math.min(screen.width / d, screen.height / e); | var f = Math.min(screen.width / d, screen.height / e); | ||
d = Math.round(d * f); | d = Math.round(d * f); | ||
e = Math.round(e * f); | e = Math.round(e * f); | ||
} | } | ||
Xc | Xc ? (a.width != d && (a.width = d), a.height != e && (a.height = e), "undefined" != typeof a.style && (a.style.removeProperty("width"), a.style.removeProperty("height"))) : (a.width != b && (a.width = b), a.height != c && (a.height = c), "undefined" != typeof a.style && (d != b || e != c ? (a.style.setProperty("width", d + "px", "important"), a.style.setProperty("height", e + "px", "important")) : (a.style.removeProperty("width"), a.style.removeProperty("height")))); | ||
} | } | ||
var Nc; | var Nc; | ||
function ob() { | function ob() { | ||
return n ? R(2, 1) : | return n ? R(2, 1) : Date.now() - S.startTime | 0; | ||
} | } | ||
function qb(a) { | function qb(a) { | ||
Zeile 1.355: | Zeile 774: | ||
return 0; | return 0; | ||
} | } | ||
b.buffer || | b.buffer || (b.buffer = md(b.width * b.height * 4), F[a + 20 >> 2] = b.buffer); | ||
F[a + 20 >> 2] = b.buffer; | |||
F[ | |||
if (a == S.screen && g.qc && b.image) { | if (a == S.screen && g.qc && b.image) { | ||
return 0; | return 0; | ||
} | } | ||
if (S.K.qa) { | if (S.K.qa) { | ||
if | if (b.image || (b.image = b.D.createImageData(b.width, b.height)), !S.K.ga) { | ||
return; | return; | ||
} | } | ||
Zeile 1.378: | Zeile 794: | ||
if (S.K.Na && !S.K.qa) { | if (S.K.Na && !S.K.qa) { | ||
if (b.wa(2097152)) { | if (b.wa(2097152)) { | ||
throw | throw "CopyOnLock is not supported for SDL_LockSurface with SDL_HWPALETTE flag set" + Error().stack; | ||
} | } | ||
ua.set(b.image.data, b.buffer); | ua.set(b.image.data, b.buffer); | ||
Zeile 1.388: | Zeile 801: | ||
} | } | ||
var wd = (a, b) => { | var wd = (a, b) => { | ||
nd = a; | |||
od = b; | |||
if (pd) { | |||
if (qd || (Q += 1, qd = !0), 0 == a) { | |||
T = function() { | |||
setTimeout(rd, Math.max(0, sd + b - (performance.timeOrigin + performance.now())) | 0); | |||
}, td = "timeout"; | |||
} else if (1 == a) { | |||
T = function() { | |||
ud(rd); | |||
}, td = "rAF"; | |||
} else if (2 == a) { | |||
if ("undefined" == typeof vd) { | |||
if ("undefined" == typeof setImmediate) { | |||
var c = []; | |||
addEventListener("message", d => { | |||
if ("setimmediate" === d.data || "setimmediate" === d.data.target) { | |||
d.stopPropagation(), c.shift()(); | |||
} | |||
}, !0); | |||
vd = d => { | |||
c.push(d); | |||
if (h) { | |||
let e; | |||
(e = g).setImmediates ?? (e.setImmediates = []); | |||
g.setImmediates.push(d); | |||
postMessage({target:"setimmediate"}); | |||
} else { | |||
postMessage("setimmediate", "*"); | |||
} | |||
}; | |||
} else { | |||
vd = setImmediate; | |||
} | } | ||
} | } | ||
T = function() { | |||
vd(rd); | |||
}; | |||
td = "immediate"; | |||
} | } | ||
} | } else { | ||
Ib = () => performance.timeOrigin + performance.now(), | v("emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up."); | ||
} | |||
}, Ib = () => performance.timeOrigin + performance.now(), Fd = (a, b, c, d, e) => { | |||
function f() { | |||
return k < xd ? (t(0 < Q), --Q, Fc(), !1) : !0; | |||
} | |||
t(!pd, "emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."); | |||
pd = a; | |||
yd = d; | |||
var k = xd; | |||
qd = !1; | |||
rd = function() { | |||
if (!A) { | |||
if (0 < zd.length) { | |||
var l = zd.shift(); | |||
l.Ub(l.S); | |||
if (Ad) { | |||
var r = Ad, p = 0 == r % 1 ? r - 1 : Math.floor(r); | |||
Ad = l.Kb ? p : (8 * r + (p + 0.5)) / 9; | |||
} | |||
g.setStatus && (l = g.statusMessage || "Please wait...", r = Ad ?? 0, p = Bd.Qb ?? 0, r ? r < p ? g.setStatus("{message} ({expected - remaining}/{expected})") : g.setStatus(l) : g.setStatus("")); | |||
f() && setTimeout(rd, 0); | |||
} else { | |||
if (f()) { | |||
if (Cd = Cd + 1 | 0, 1 == nd && 1 < od && 0 != Cd % od) { | |||
T(); | |||
} else { | |||
0 == nd && (sd = performance.timeOrigin + performance.now()); | |||
"timeout" === td && g.ctx && (N("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"), td = ""); | |||
a: { | |||
if (!A) { | |||
for (l of Dd) { | |||
if (!1 === l()) { | |||
break a; | |||
} | } | ||
} | |||
Gc(a); | |||
for (r of Ed) { | |||
r(); | |||
} | } | ||
} | } | ||
} | } | ||
f() && T(); | |||
} | } | ||
} | } | ||
} | } | ||
} | } | ||
}, | }; | ||
qd = !1, | e || (b && 0 < b ? wd(0, 1000.0 / b) : wd(1, 1), T()); | ||
if (c) { | |||
throw "unwind"; | |||
} | |||
}, qd = !1, T = null, td = "", xd = 0, pd = null, yd = 0, nd = 0, od = 0, Cd = 0, zd = [], Dd = [], Ed = []; | |||
function Gd() { | function Gd() { | ||
T = null; | T = null; | ||
Zeile 1.541: | Zeile 901: | ||
function Hd() { | function Hd() { | ||
xd++; | xd++; | ||
var a = nd, | var a = nd, b = od, c = pd; | ||
pd = null; | pd = null; | ||
Fd(c, 0, !1, yd, !0); | Fd(c, 0, !1, yd, !0); | ||
Zeile 1.558: | Zeile 916: | ||
Id = b + 1000 / 60; | Id = b + 1000 / 60; | ||
} else { | } else { | ||
for (; b + 2 >= Id; ) { | for (; b + 2 >= Id;) { | ||
Id += 1000 / 60; | Id += 1000 / 60; | ||
} | } | ||
Zeile 1.565: | Zeile 923: | ||
} | } | ||
} | } | ||
var Bd = {}, | var Bd = {}, sd, rd, vd, Ad, Jd = a => { | ||
for (var b = 0, c = 0; c < a.length; ++c) { | |||
var d = a.charCodeAt(c); | |||
127 >= d ? b++ : 2047 >= d ? b += 2 : 55296 <= d && 57343 >= d ? (b += 4, ++c) : b += 3; | |||
} | |||
return b; | |||
}, Kd = (a, b, c, d) => { | |||
t("string" === typeof a, `stringToUTF8Array expects a string (got ${typeof a})`); | |||
if (!(0 < d)) { | |||
return 0; | |||
} | |||
var e = c; | |||
d = c + d - 1; | |||
for (var f = 0; f < a.length; ++f) { | |||
var k = a.charCodeAt(f); | |||
if (55296 <= k && 57343 >= k) { | |||
var l = a.charCodeAt(++f); | |||
k = 65536 + ((k & 1023) << 10) | l & 1023; | |||
} | } | ||
if (127 >= k) { | |||
if (c >= d) { | |||
break; | |||
if ( | |||
} | } | ||
if ( | b[c++] = k; | ||
if (c >= d) { | } else { | ||
if (2047 >= k) { | |||
if (c + 1 >= d) { | |||
break; | break; | ||
} | } | ||
b[c++] = k; | b[c++] = 192 | k >> 6; | ||
} else { | } else { | ||
if ( | if (65535 >= k) { | ||
if (c + | if (c + 2 >= d) { | ||
break; | break; | ||
} | } | ||
b[c++] = | b[c++] = 224 | k >> 12; | ||
} else { | } else { | ||
if (c + 3 >= d) { | |||
break; | |||
} | } | ||
b[c++] = 128 | | 1114111 < k && N("Invalid Unicode code point " + tc(k) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."); | ||
b[c++] = 240 | k >> 18; | |||
b[c++] = 128 | k >> 12 & 63; | |||
} | } | ||
b[c++] = 128 | | b[c++] = 128 | k >> 6 & 63; | ||
} | } | ||
b[c++] = 128 | k & 63; | |||
} | } | ||
} | |||
b[c] = 0; | |||
return c - e; | |||
}; | |||
function Ld(a, b) { | function Ld(a, b) { | ||
var c = Array(Jd(a) + 1); | var c = Array(Jd(a) + 1); | ||
Zeile 1.644: | Zeile 982: | ||
} | } | ||
function Md(a) { | function Md(a) { | ||
return { | return {x:D[a >> 2], y:D[a + 4 >> 2], w:D[a + 8 >> 2], m:D[a + 12 >> 2]}; | ||
} | } | ||
function Nd(a, b, c) { | function Nd(a, b, c) { | ||
var d = c & 134217729, | var d = c & 134217729, e = c & 2097152, f = c & 67108864, k = md(60), l = md(44), r = e ? 1 : 4; | ||
e = 0; | e = 0; | ||
d || f || (e = md(a * b * 4)); | d || f || (e = md(a * b * 4)); | ||
D[k >> 2] = c; | D[k >> 2] = c; | ||
F[ | F[k + 4 >> 2] = l; | ||
D[ | D[k + 8 >> 2] = a; | ||
D[ | D[k + 12 >> 2] = b; | ||
D[ | D[k + 16 >> 2] = a * r; | ||
F[ | F[k + 20 >> 2] = e; | ||
D[ | D[k + 36 >> 2] = 0; | ||
D[ | D[k + 40 >> 2] = 0; | ||
D[ | D[k + 44 >> 2] = g.canvas.width; | ||
D[ | D[k + 48 >> 2] = g.canvas.height; | ||
D[ | D[k + 56 >> 2] = 1; | ||
D[l >> 2] = -2042224636; | D[l >> 2] = -2042224636; | ||
D[ | D[l + 4 >> 2] = 0; | ||
C[l + 8] = 8 * r; | C[l + 8] = 8 * r; | ||
C[l + 9] = r; | C[l + 9] = r; | ||
D[ | D[l + 12 >> 2] = 255; | ||
D[ | D[l + 16 >> 2] = 65280; | ||
D[ | D[l + 20 >> 2] = 16711680; | ||
D[ | D[l + 24 >> 2] = 4278190080; | ||
S.R = S.R || f; | S.R = S.R || f; | ||
d = g.canvas; | d = g.canvas; | ||
f = Pc(d, f, !0, { | f = Pc(d, f, !0, {antialias:0 != S.P[13] && 1 < S.P[14], depth:0 < S.P[6], stencil:0 < S.P[7], alpha:0 < S.P[3]}); | ||
S.J[k] = {width:a, height:b, canvas:d, D:f, lb:k, buffer:e, hb:l, alpha:255, flags:c, locked:0, qb:!0, source:"screen", wa:p => c & p}; | |||
S.J[k] = { | |||
return k; | return k; | ||
} | } | ||
function Od() { | function Od() { | ||
var a = S.screen, | var a = S.screen, b = a + 56, c = D[b >> 2]; | ||
1 < c ? D[b >> 2] = c - 1 : (b = S.J[a], !b.qb && b.canvas && S.La.push(b.canvas), b.buffer && Pd(b.buffer), Pd(b.hb), Pd(a), S.J[a] = null, a === S.screen && (S.screen = null)); | |||
1 < c | |||
} | } | ||
function Qd(a) { | function Qd(a) { | ||
var b = a.keyCode; | var b = a.keyCode; | ||
65 <= b && 90 >= b | 65 <= b && 90 >= b ? b += 32 : (b = S.Za[b] || (128 > b ? b : 0), 2 === a.location && 1248 <= b && 1251 >= b && (b += 4)); | ||
return b; | return b; | ||
} | } | ||
Zeile 1.739: | Zeile 1.035: | ||
break; | break; | ||
} | } | ||
if ( | if ("number" != typeof c.timestamp || c.timestamp != d.timestamp || !c.timestamp) { | ||
var e; | var e; | ||
for (e = 0; e < c.buttons.length; e++) { | for (e = 0; e < c.buttons.length; e++) { | ||
var f = Sd(c.buttons[e]); | var f = Sd(c.buttons[e]); | ||
f !== d.buttons[e] && | f !== d.buttons[e] && S.events.push({type:f ? "joystick_button_down" : "joystick_button_up", Xa:b, index:b - 1, button:e}); | ||
} | } | ||
for (e = 0; e < c.axes.length; e++) { | for (e = 0; e < c.axes.length; e++) { | ||
c.axes[e] !== d.axes[e] && | c.axes[e] !== d.axes[e] && S.events.push({type:"joystick_axis_motion", Xa:b, index:b - 1, axis:e, value:c.axes[e]}); | ||
} | } | ||
d = b; | d = b; | ||
Zeile 1.770: | Zeile 1.049: | ||
e[f] = Sd(c.buttons[f]); | e[f] = Sd(c.buttons[f]); | ||
} | } | ||
S.ea[d] = { | S.ea[d] = {buttons:e, axes:c.axes.slice(0), timestamp:c.timestamp, index:c.index, id:c.id}; | ||
} | } | ||
} | } | ||
} | } | ||
if (a) { | if (a) { | ||
for (; 0 < S.events.length; ) { | for (; 0 < S.events.length;) { | ||
a: { | a: { | ||
d = void 0; | d = void 0; | ||
Zeile 1.789: | Zeile 1.062: | ||
Td(b, c, 28), Pd(c); | Td(b, c, 28), Pd(c); | ||
} else { | } else { | ||
switch | switch(S.handleEvent(c), c.type) { | ||
case "keydown": | case "keydown": | ||
case "keyup": | case "keyup": | ||
Zeile 1.798: | Zeile 1.071: | ||
break a; | break a; | ||
} | } | ||
1024 <= f ? | 1024 <= f ? d = f - 1024 : d = S.ib[f] || f; | ||
D[b >> 2] = S.i[c.type]; | D[b >> 2] = S.i[c.type]; | ||
C[b + 8] = e ? 1 : 0; | C[b + 8] = e ? 1 : 0; | ||
C[b + 9] = 0; | C[b + 9] = 0; | ||
D[ | D[b + 12 >> 2] = d; | ||
D[ | D[b + 16 >> 2] = f; | ||
va[ | va[b + 20 >> 1] = S.Aa; | ||
D[ | D[b + 24 >> 2] = c.$a || f; | ||
break; | break; | ||
case "keypress": | case "keypress": | ||
Zeile 1.817: | Zeile 1.090: | ||
case "mouseup": | case "mouseup": | ||
case "mousemove": | case "mousemove": | ||
"mousemove" != c.type | "mousemove" != c.type ? (e = "mousedown" === c.type, D[b >> 2] = S.i[c.type], D[b + 4 >> 2] = 0, D[b + 8 >> 2] = 0, D[b + 12 >> 2] = 0, C[b + 16] = c.button + 1, C[b + 17] = e ? 1 : 0, D[b + 20 >> 2] = $c, D[b + 24 >> 2] = ad) : (D[b >> 2] = S.i[c.type], D[b + 4 >> 2] = 0, D[b + 8 >> 2] = 0, D[b + 12 >> 2] = 0, D[b + 16 >> 2] = S.N, D[b + 20 >> 2] = $c, D[b + 24 >> 2] = ad, D[b + 28 >> 2] = bd, D[b + 32 >> 2] = cd); | ||
break; | break; | ||
case "wheel": | case "wheel": | ||
D[b >> 2] = S.i[c.type]; | D[b >> 2] = S.i[c.type]; | ||
D[ | D[b + 16 >> 2] = c.deltaX; | ||
D[ | D[b + 20 >> 2] = c.deltaY; | ||
break; | break; | ||
case "touchstart": | case "touchstart": | ||
Zeile 1.849: | Zeile 1.104: | ||
break; | break; | ||
} | } | ||
var k = g.canvas.width, | var k = g.canvas.width, l = g.canvas.height; | ||
e = dd[d.identifier].x / k; | e = dd[d.identifier].x / k; | ||
f = dd[d.identifier].y / l; | f = dd[d.identifier].y / l; | ||
Zeile 1.861: | Zeile 1.115: | ||
} | } | ||
D[b >> 2] = S.i[c.type]; | D[b >> 2] = S.i[c.type]; | ||
D[ | D[b + 4 >> 2] = ob(); | ||
H[ | H[b + 8 >> 3] = BigInt(d.U); | ||
H[ | H[b + 16 >> 3] = BigInt(d.identifier); | ||
G[ | G[b + 24 >> 2] = e; | ||
G[ | G[b + 28 >> 2] = f; | ||
G[ | G[b + 32 >> 2] = k; | ||
G[ | G[b + 36 >> 2] = l; | ||
G[ | G[b + 40 >> 2] = void 0 !== d.force ? d.force : "touchend" == c.type ? 0 : 1; | ||
break; | break; | ||
case "unload": | case "unload": | ||
Zeile 1.876: | Zeile 1.129: | ||
case "resize": | case "resize": | ||
D[b >> 2] = S.i[c.type]; | D[b >> 2] = S.i[c.type]; | ||
D[ | D[b + 4 >> 2] = c.w; | ||
D[ | D[b + 8 >> 2] = c.m; | ||
break; | break; | ||
case "joystick_button_up": | case "joystick_button_up": | ||
Zeile 1.893: | Zeile 1.146: | ||
c = c.value; | c = c.value; | ||
c = Math.min(1, Math.max(c, -1)); | c = Math.min(1, Math.max(c, -1)); | ||
D[ | D[b + 8 >> 2] = Math.ceil(32767.5 * (c + 1) - 32768); | ||
break; | break; | ||
case "focus": | case "focus": | ||
D[b >> 2] = S.i[c.type]; | D[b >> 2] = S.i[c.type]; | ||
D[ | D[b + 4 >> 2] = 0; | ||
C[b + 8] = 12; | C[b + 8] = 12; | ||
break; | break; | ||
case "blur": | case "blur": | ||
D[b >> 2] = S.i[c.type]; | D[b >> 2] = S.i[c.type]; | ||
D[ | D[b + 4 >> 2] = 0; | ||
C[b + 8] = 13; | C[b + 8] = 13; | ||
break; | break; | ||
Zeile 1.908: | Zeile 1.161: | ||
d = c.visible ? 1 : 2; | d = c.visible ? 1 : 2; | ||
D[b >> 2] = S.i[c.type]; | D[b >> 2] = S.i[c.type]; | ||
D[ | D[b + 4 >> 2] = 0; | ||
C[b + 8] = d; | C[b + 8] = d; | ||
break; | break; | ||
Zeile 1.928: | Zeile 1.181: | ||
return "object" == typeof a ? a.pressed : 0 < a; | return "object" == typeof a ? a.pressed : 0 < a; | ||
} | } | ||
var S = { | var S = {K:{width:320, height:200, Na:!0, qa:!1, ga:!0,}, version:null, J:{}, La:[], events:[], fonts:[null], Ab:[null], pc:[null], Da:{audio:null, volume:1,}, hc:22050, fc:32784, ic:2, ec:1024, Hb:0, R:!1, P:{0:3, 1:3, 2:2, 3:0, 4:0, 5:1, 6:16, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:1, 16:0, 17:0, 18:0,}, H:null, da:{}, na:!1, xa:!1, Fa:!1, unicode:!1, ob:null, audio:null, startTime:null, va:0, N:0, Aa:0, C:[0, 0, 0], i:{}, Ha:0, ra:null, Pa:null, sa:0, Za:{16:1249, 17:1248, 18:1250, 20:1081, | ||
33:1099, 34:1102, 35:1101, 36:1098, 37:1104, 38:1106, 39:1103, 40:1105, 44:316, 45:1097, 46:127, 91:1251, 93:1125, 96:1122, 97:1113, 98:1114, 99:1115, 100:1116, 101:1117, 102:1118, 103:1119, 104:1120, 105:1121, 106:1109, 107:1111, 109:1110, 110:1123, 111:1108, 112:1082, 113:1083, 114:1084, 115:1085, 116:1086, 117:1087, 118:1088, 119:1089, 120:1090, 121:1091, 122:1092, 123:1093, 124:1128, 125:1129, 126:1130, 127:1131, 128:1132, 129:1133, 130:1134, 131:1135, 132:1136, 133:1137, 134:1138, 135:1139, | |||
144:1107, 160:94, 161:33, 162:34, 163:35, 164:36, 165:37, 166:38, 167:95, 168:40, 169:41, 170:42, 171:43, 172:124, 173:45, 174:123, 175:125, 176:126, 181:127, 182:129, 183:128, 188:44, 190:46, 191:47, 192:96, 219:91, 220:92, 221:93, 222:39, 224:1251,}, ib:{8:42, 9:43, 13:40, 27:41, 32:44, 35:204, 39:53, 44:54, 46:55, 47:56, 48:39, 49:30, 50:31, 51:32, 52:33, 53:34, 54:35, 55:36, 56:37, 57:38, 58:203, 59:51, 61:46, 91:47, 92:49, 93:48, 96:52, 97:4, 98:5, 99:6, 100:7, 101:8, 102:9, 103:10, 104:11, | |||
105:12, 106:13, 107:14, 108:15, 109:16, 110:17, 111:18, 112:19, 113:20, 114:21, 115:22, 116:23, 117:24, 118:25, 119:26, 120:27, 121:28, 122:29, 127:76, 305:224, 308:226, 316:70,}, Ib(a) { | |||
-2042224636 != D[a >> 2] && N("Unsupported pixel format!"); | |||
}, cc(a) { | |||
a = D[a >> 2]; | |||
return "rgb(" + (a & 255) + "," + (a >> 8 & 255) + "," + (a >> 16 & 255) + ")"; | |||
}, dc(a) { | |||
a = D[a >> 2]; | |||
return "rgba(" + (a & 255) + "," + (a >> 8 & 255) + "," + (a >> 16 & 255) + "," + (a >> 24 & 255) / 255 + ")"; | |||
}, uc:a => "rgba(" + (a & 255) + "," + (a >> 8 & 255) + "," + (a >> 16 & 255) + "," + (a >>> 24) / 255 + ")", vc:(a, b, c, d) => "rgba(" + (a & 255) + "," + (b & 255) + "," + (c & 255) + "," + (d & 255) / 255 + ")", wc:(a, b, c, d) => a | b << 8 | c << 16 | d << 24, Bb(a, b, c, d, e) { | |||
a = S.J[a]; | |||
var f = S.J[c], k, l; | |||
b ? k = Md(b) : k = {x:0, y:0, w:a.width, m:a.height}; | |||
d ? l = Md(d) : l = {x:0, y:0, w:a.width, m:a.height}; | |||
if (f.Ma) { | |||
b = e && 0 !== k.w ? k.w / l.w : 1; | |||
var r = e && 0 !== k.m ? k.m / l.m : 1, p = f.Ma, y = Math.max(p.x, l.x), B = Math.max(p.y, l.y); | |||
l = {x:y, y:B, w:Math.max(y, Math.min(p.x + p.w, l.x + l.w)) - y, m:Math.max(B, Math.min(p.y + p.m, l.y + l.m)) - B}; | |||
k.w = l.w * b; | |||
k.m = l.m * r; | |||
d && (b = l, D[d >> 2] = b.x, D[d + 4 >> 2] = b.y, D[d + 8 >> 2] = b.w, D[d + 12 >> 2] = b.m); | |||
} | |||
e ? (d = l.w, e = l.m) : (d = k.w, e = k.m); | |||
if (0 === k.w || 0 === k.m || 0 === d || 0 === e) { | |||
return 0; | |||
} | |||
b = f.D.globalAlpha; | |||
f.D.globalAlpha = a.alpha / 255; | |||
f.D.drawImage(a.canvas, k.x, k.y, k.w, k.m, l.x, l.y, d, e); | |||
f.D.globalAlpha = b; | |||
c != S.screen && (N("WARNING: copying canvas data to memory for compatibility"), qb(c), f.locked--); | |||
return 0; | |||
}, V:{}, Z:null, B(a) { | |||
function b() { | |||
for (var k of Object.values(S.da)) { | |||
S.events.push({type:"keyup", keyCode:k,}); | |||
} | |||
} | |||
switch(a.type) { | |||
case "touchstart": | |||
case "touchmove": | |||
a.preventDefault(); | |||
var c = []; | |||
if ("touchstart" === a.type) { | |||
for (var d = 0; d < a.touches.length; d++) { | |||
var e = a.touches[d]; | |||
1 != S.V[e.identifier] && (S.V[e.identifier] = !0, c.push(e)); | |||
} | |||
} else { | |||
c = a.touches; | |||
} | } | ||
if (d = c[0]) { | |||
"touchstart" == a.type && (S.C[0] = 1); | |||
switch(a.type) { | |||
case "touchstart": | |||
var f = "mousedown"; | |||
break; | |||
case "touchmove": | |||
f = "mousemove"; | |||
} | |||
f = {type:f, button:0, pageX:d.clientX, pageY:d.clientY}; | |||
S.events.push(f); | |||
} | } | ||
for (d = 0; d < c.length; d++) { | |||
e = c[d], S.events.push({type:a.type, M:e}); | |||
} | } | ||
break; | |||
case "touchend": | |||
a.preventDefault(); | |||
for (d = 0; d < a.changedTouches.length; d++) { | |||
e = a.changedTouches[d], !0 === S.V[e.identifier] && delete S.V[e.identifier]; | |||
} | } | ||
f = {type:"mouseup", button:0, pageX:a.changedTouches[0].clientX, pageY:a.changedTouches[0].clientY}; | |||
S.C[0] = 0; | |||
S.events.push(f); | |||
for (d = 0; d < a.changedTouches.length; d++) { | |||
e = a.changedTouches[d], S.events.push({type:"touchend", M:e}); | |||
} | } | ||
break; | |||
case "DOMMouseScroll": | |||
case "mousewheel": | |||
case "wheel": | |||
c = -Zc(a); | |||
c = 0 == c ? 0 : 0 < c ? Math.max(c, 1) : Math.min(c, -1); | |||
f = (0 < c ? 4 : 5) - 1; | |||
S.events.push({type:"mousedown", button:f, pageX:a.pageX, pageY:a.pageY}); | |||
S.events.push({type:"mouseup", button:f, pageX:a.pageX, pageY:a.pageY}); | |||
S.events.push({type:"wheel", deltaX:0, deltaY:c}); | |||
a.preventDefault(); | |||
break; | |||
case "mousemove": | |||
if (1 === S.C[0] && S.events.push({type:"touchmove", M:{identifier:0, U:-1, pageX:a.pageX, pageY:a.pageY}}), Kc && ("mozMovementX" in a && (a.movementX = a.mozMovementX, a.movementY = a.mozMovementY), 0 == a.movementX && 0 == a.movementY)) { | |||
a.preventDefault(); | |||
return; | |||
} | } | ||
case "keydown": | |||
case "keyup": | |||
case "keypress": | |||
" | case "mousedown": | ||
case "mouseup": | |||
"keydown" === a.type && (S.unicode || S.Fa) && "Backspace" != a.key && "Tab" != a.key || a.preventDefault(); | |||
if ("mousedown" == a.type) { | |||
S.C[a.button] = 1, S.events.push({type:"touchstart", M:{identifier:0, U:-1, pageX:a.pageX, pageY:a.pageY}}); | |||
} else if ("mouseup" == a.type) { | |||
if (!S.C[a.button]) { | |||
return; | |||
if ( | |||
S. | |||
} | } | ||
S.events.push({type:"touchend", M:{identifier:0, U:-1, pageX:a.pageX, pageY:a.pageY}}); | |||
S.C[a.button] = 0; | |||
} | } | ||
if ("keydown" === a.type || "mousedown" === a.type) { | |||
S.na = !0; | |||
if ( | } else if ("keyup" === a.type || "mouseup" === a.type) { | ||
S.xa && (g.requestFullscreen(!0, !0), S.xa = !1), S.na = !1; | |||
} | } | ||
"keypress" === a.type && S.Z ? (S.Z.$a = a.charCode, S.Z = null) : "keydown" === a.type && (S.Z = a); | |||
("keypress" !== a.type || S.Fa) && S.events.push(a); | |||
break; | |||
case "mouseout": | |||
for (d = 0; 3 > d; d++) { | |||
S.C[d] && (S.events.push({type:"mouseup", button:d, pageX:a.pageX, pageY:a.pageY}), S.C[d] = 0); | |||
} | } | ||
a.preventDefault(); | |||
break; | |||
case "focus": | |||
S.events.push(a); | |||
a.preventDefault(); | |||
break; | |||
case "blur": | |||
S.events.push(a); | |||
b(); | |||
a.preventDefault(); | |||
break; | |||
case "visibilitychange": | |||
S.events.push({type:"visibilitychange", visible:!document.hidden}); | |||
b(); | |||
a.preventDefault(); | |||
break; | |||
case "unload": | |||
rd && (S.events.push(a), rd()); | |||
return; | |||
case "resize": | |||
S.events.push(a), a.preventDefault && a.preventDefault(); | |||
} | |||
10000 <= S.events.length && (v("SDL event queue full, dropping events"), S.events = S.events.slice(0, 10000)); | |||
if (S.ra) { | |||
for (; Rd(S.sa);) { | |||
dynCall_iii(S.ra, S.Pa, S.sa); | |||
} | |||
} | |||
}, handleEvent(a) { | |||
if (!a.Qa) { | |||
switch(a.Qa = !0, a.type) { | |||
case "touchstart": | |||
case "touchend": | |||
case "touchmove": | |||
gd(a); | |||
break; | |||
case "keydown": | |||
case "keyup": | |||
var b = "keydown" === a.type, c = Qd(a); | |||
if (!c) { | |||
break; | |||
} | } | ||
C[S.H + c] = b; | |||
S.Aa = (C[S.H + 1248] ? 64 : 0) | (C[S.H + 1249] ? 1 : 0) | (C[S.H + 1250] ? 256 : 0) | (C[S.H + 1252] ? 128 : 0) | (C[S.H + 1253] ? 2 : 0) | (C[S.H + 1254] ? 512 : 0); | |||
b ? S.da[c] = a.keyCode : delete S.da[c]; | |||
break; | |||
case "mousedown": | |||
case "mouseup": | |||
"mousedown" == a.type ? S.N |= 1 << a.button : "mouseup" == a.type && (S.N &= ~(1 << a.button)); | |||
case "mousemove": | |||
gd(a); | |||
} | |||
} | |||
}, Pb(a, b) { | |||
var c = a.name; | |||
"'" != c.charAt(0) && '"' != c.charAt(0) && (c = '"' + c + '"'); | |||
a = a.size + "px " + c + ", serif"; | |||
c = S.ob; | |||
t(c, "TTF_Init must have been called"); | |||
c.font = a; | |||
return c.measureText(b).width | 0; | |||
}, yb(a) { | |||
if (!(S.fa && S.fa >= a && 0 != a)) { | |||
S.fa = a; | |||
S.channels = []; | |||
for (var b = 0; b < a; b++) { | |||
S.channels[b] = {audio:null, volume:1.0}; | |||
} | } | ||
} | } | ||
}, rc(a, b) { | |||
if (!a) { | |||
return 0; | |||
} | } | ||
return S. | var c = 128 * a.volume; | ||
} | if (-1 != b && (a.volume = Math.min(Math.max(b, 0), 128) / 128, a.audio)) { | ||
function | try { | ||
a.audio.volume = a.volume, a.audio.ub && (a.audio.ub.gain.value = a.volume); | |||
} catch (d) { | |||
v(`setGetVolume failed to set audio volume: ${d}`); | |||
} | |||
} | |||
return c; | |||
}, sc(a, b, c, d) { | |||
a && a.audio && a.audio.vb && a.audio.vb.setPosition(b, c, d); | |||
}, mc(a) { | |||
if (a) { | |||
if (a.ka) { | |||
try { | |||
a.Lb = (S.T.currentTime - a.startTime) % a.oc.xc.Nb.duration, a.ka.onended = void 0, a.ka.stop(0), a.ka = void 0; | |||
} catch (b) { | |||
v(`pauseWebAudio failed: ${b}`); | |||
} | |||
} | |||
a.paused = !0; | |||
} | |||
}, kc() { | |||
S.T || ("undefined" != typeof AudioContext ? S.T = new AudioContext() : "undefined" != typeof webkitAudioContext && (S.T = new webkitAudioContext())); | |||
}, yc:() => !!S.T, Tb(a, b, c) { | |||
for (var d = S.audio, e = d.channels, f = 0; f < e; ++f) { | |||
var k = c.getChannelData(f); | |||
if (k.length != b) { | |||
throw "Web Audio output buffer length mismatch! Destination size: " + k.length + " samples vs expected " + b + " samples!"; | |||
} | |||
if (32784 == d.format) { | |||
for (var l = 0; l < b; ++l) { | |||
k[l] = va[a + 2 * (l * e + f) >> 1] / 32768; | |||
} | |||
} else if (8 == d.format) { | |||
for (l = 0; l < b; ++l) { | |||
var r = C[a + (l * e + f)]; | |||
k[l] = (0 <= r ? r - 128 : r + 128) / 128; | |||
} | |||
} else if (33056 == d.format) { | |||
for (l = 0; l < b; ++l) { | |||
k[l] = G[a + 4 * (l * e + f) >> 2]; | |||
} | |||
} else { | |||
throw "Invalid SDL audio format " + d.format + "!"; | |||
} | |||
} | |||
}, Mb(a) { | |||
Da("dumping surface " + [a.lb, a.source, a.width, a.height]); | |||
for (var b = a.D.getImageData(0, 0, a.width, a.height).data, c = Math.min(a.width, a.height), d = 0; d < c; d++) { | |||
Da(" diagonal " + d + ":" + [b[d * a.width * 4 + 4 * d], b[d * a.width * 4 + 4 * d + 1], b[d * a.width * 4 + 4 * d + 2], b[d * a.width * 4 + 4 * d + 3]]); | |||
} | |||
}, Ya:1, ea:{}, bc:{}, getGamepads() { | |||
var a = navigator.getGamepads || navigator.ac || navigator.Wb || navigator.F || navigator.webkitGetGamepads; | |||
return void 0 !== a ? a.apply(navigator) : []; | |||
},}, mb = () => { | |||
}, Ud = (a, b, c) => { | |||
t("number" == typeof c, "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"); | |||
Kd(a, ua, b, c); | |||
}; | |||
function nb() { | |||
if (n) { | if (n) { | ||
return R( | return R(4, 1); | ||
} | } | ||
S.startTime = Date.now(); | if (!S.errorMessage) { | ||
S.va = a; | var a = S, b = Jd("unknown SDL-emscripten error") + 1, c = md(b); | ||
g.doNotCaptureKeyboard || | c && Ud("unknown SDL-emscripten error", c, b); | ||
a.errorMessage = c; | |||
} | |||
return S.errorMessage; | |||
} | |||
function pb(a) { | |||
if (n) { | |||
return R(5, 1, a); | |||
window.addEventListener("unload", S.B); | } | ||
S.startTime = Date.now(); | |||
S.va = a; | |||
g.doNotCaptureKeyboard || (a = g.keyboardListeningElement || document, a.addEventListener("keydown", S.B), a.addEventListener("keyup", S.B), a.addEventListener("keypress", S.B), window.addEventListener("focus", S.B), window.addEventListener("blur", S.B), document.addEventListener("visibilitychange", S.B)); | |||
window.addEventListener("unload", S.B); | |||
S.H = Vd(65536, 1); | S.H = Vd(65536, 1); | ||
S.i.keydown = 768; | S.i.keydown = 768; | ||
Zeile 2.679: | Zeile 1.482: | ||
} | } | ||
function Wd() { | function Wd() { | ||
if (n) { | if (n) { | ||
return R(7, 1); | return R(7, 1); | ||
Zeile 2.685: | Zeile 1.487: | ||
for (var a = 0; a < S.fa; ++a) { | for (var a = 0; a < S.fa; ++a) { | ||
var b = S.channels[a]; | var b = S.channels[a]; | ||
b.audio && (b.audio.pause(), | b.audio && (b.audio.pause(), b.audio = void 0); | ||
} | } | ||
S.Da.audio?.pause(); | |||
S.Da.audio = void 0; | S.Da.audio = void 0; | ||
} | } | ||
var sb = () => { | var sb = () => { | ||
Wd(); | |||
u("SDL_Quit called (and ignored)"); | |||
}, Tc, Xd = a => { | |||
var b = a.getExtension("ANGLE_instanced_arrays"); | |||
b && (a.vertexAttribDivisor = (c, d) => b.vertexAttribDivisorANGLE(c, d), a.drawArraysInstanced = (c, d, e, f) => b.drawArraysInstancedANGLE(c, d, e, f), a.drawElementsInstanced = (c, d, e, f, k) => b.drawElementsInstancedANGLE(c, d, e, f, k)); | |||
}, Yd = a => { | |||
var b = a.getExtension("OES_vertex_array_object"); | |||
b && (a.createVertexArray = () => b.createVertexArrayOES(), a.deleteVertexArray = c => b.deleteVertexArrayOES(c), a.bindVertexArray = c => b.bindVertexArrayOES(c), a.isVertexArray = c => b.isVertexArrayOES(c)); | |||
}, Zd = a => { | |||
var b = a.getExtension("WEBGL_draw_buffers"); | |||
b && (a.drawBuffers = (c, d) => b.drawBuffersWEBGL(c, d)); | |||
}, $d = a => { | |||
var b = "ANGLE_instanced_arrays EXT_blend_minmax EXT_disjoint_timer_query EXT_frag_depth EXT_shader_texture_lod EXT_sRGB OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object WEBGL_color_buffer_float WEBGL_depth_texture WEBGL_draw_buffers EXT_clip_control EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend EXT_polygon_offset_clamp EXT_texture_compression_bptc EXT_texture_compression_rgtc EXT_texture_filter_anisotropic KHR_parallel_shader_compile OES_texture_float_linear WEBGL_blend_func_extended WEBGL_compressed_texture_astc WEBGL_compressed_texture_etc WEBGL_compressed_texture_etc1 WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context WEBGL_multi_draw WEBGL_polygon_mode".split(" "); | |||
return (a.getSupportedExtensions() || []).filter(c => b.includes(c)); | |||
}, ae = "undefined" != typeof TextDecoder ? new TextDecoder() : void 0, be = (a, b = 0) => { | |||
for (var c = b + NaN, d = b; a[d] && !(d >= c);) { | |||
++d; | |||
} | |||
if (16 < d - b && a.buffer && ae) { | |||
return ae.decode(a.buffer instanceof ArrayBuffer ? a.subarray(b, d) : a.slice(b, d)); | |||
} | |||
for (c = ""; b < d;) { | |||
var e = a[b++]; | |||
if (e & 128) { | |||
var f = a[b++] & 63; | |||
if (192 == (e & 224)) { | |||
c += String.fromCharCode((e & 31) << 6 | f); | |||
} else { | } else { | ||
c += String.fromCharCode(e); | var k = a[b++] & 63; | ||
224 == (e & 240) ? e = (e & 15) << 12 | f << 6 | k : (240 != (e & 248) && N("Invalid UTF-8 leading byte " + tc(e) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!"), e = (e & 7) << 18 | f << 12 | k << 6 | a[b++] & 63); | |||
65536 > e ? c += String.fromCharCode(e) : (e -= 65536, c += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023)); | |||
} | } | ||
} else { | |||
c += String.fromCharCode(e); | |||
} | } | ||
} | |||
return c; | |||
}, ce = a => { | |||
t("number" == typeof a, `UTF8ToString expects a number (got ${typeof a})`); | |||
return a ? be(ua, a) : ""; | |||
}, Sc = {}, Rc = (a, b) => { | |||
a.F || (a.F = a.getContext, a.getContext = function(d, e) { | |||
e = a.F(d, e); | |||
return "webgl" == d == e instanceof WebGLRenderingContext ? e : null; | |||
}); | |||
var c = a.getContext("webgl", b); | |||
return c ? de(c, b) : 0; | |||
}, de = (a, b) => { | |||
var c = md(8); | |||
F[c + 4 >> 2] = I(); | |||
var d = {handle:c, attributes:b, version:b.ab, aa:a}; | |||
a.canvas && (a.canvas.xb = d); | |||
Sc[c] = d; | |||
("undefined" == typeof b.Oa || b.Oa) && ee(d); | |||
return c; | |||
}, ee = a => { | |||
a ||= Uc; | |||
if (!a.Ua) { | |||
a.Ua = !0; | |||
var b = a.aa; | |||
b.jc = b.getExtension("WEBGL_multi_draw"); | |||
b.Sb = b.getExtension("EXT_polygon_offset_clamp"); | |||
b.Rb = b.getExtension("EXT_clip_control"); | |||
b.zc = b.getExtension("WEBGL_polygon_mode"); | |||
Xd(b); | |||
Yd(b); | |||
Zd(b); | |||
b.Ob = b.getExtension("EXT_disjoint_timer_query"); | |||
$d(b).forEach(c => { | |||
c.includes("lose_context") || c.includes("debug") || b.getExtension(c); | |||
}); | |||
} | |||
}, Qc = {}, Uc; | |||
function tb(a, b, c, d) { | function tb(a, b, c, d) { | ||
if (n) { | if (n) { | ||
return R(8, 1, a, b, c, d); | return R(8, 1, a, b, c, d); | ||
} | } | ||
"touchstart touchend touchmove mousedown mouseup mousemove mousewheel wheel mouseout DOMMouseScroll" | "touchstart touchend touchmove mousedown mouseup mousemove mousewheel wheel mouseout DOMMouseScroll".split(" ").forEach(e => g.canvas.addEventListener(e, S.B, !0)); | ||
c = g.canvas; | c = g.canvas; | ||
0 == a && 0 == b && | 0 == a && 0 == b && (a = c.width, b = c.height); | ||
S.Ja || | S.Ja || (S.Ja = !0, hd.push((e, f) => { | ||
S.Ea || S.B({type:"resize", w:e, m:f}); | |||
})); | |||
S.Ea = !0; | S.Ea = !0; | ||
kd(a, b); | kd(a, b); | ||
Zeile 2.853: | Zeile 1.595: | ||
var c = g.canvas.width; | var c = g.canvas.width; | ||
a = c - 0; | a = c - 0; | ||
var d = g.canvas.height - 0, | var d = g.canvas.height - 0, e = b.buffer; | ||
b.image.pa || (b.image.pa = new Uint32Array(b.image.data.buffer)); | b.image.pa || (b.image.pa = new Uint32Array(b.image.data.buffer)); | ||
for (var f = b.image.pa, k = b.Jb, l = 0; l < d; ++l) { | for (var f = b.image.pa, k = b.Jb, l = 0; l < d; ++l) { | ||
Zeile 2.863: | Zeile 1.604: | ||
} | } | ||
} else if (b.colors) { | } else if (b.colors) { | ||
for ( | for (d = g.canvas.width, e = g.canvas.height, f = b.buffer, c = b.image.data, k = b.colors, l = 0; l < e; l++) { | ||
r = l * d * 4; | r = l * d * 4; | ||
for (p = 0; p < d; p++) { | for (p = 0; p < d; p++) { | ||
Zeile 2.884: | Zeile 1.616: | ||
} | } | ||
} else { | } else { | ||
if | if (c = b.image.data, d = b.buffer, t(0 == d % 4, "Invalid buffer offset: " + d), e = d >> 2, f = 0, k = a == S.screen, "undefined" != typeof CanvasPixelArray && c instanceof CanvasPixelArray) { | ||
for (d = c.length; f < d;) { | |||
a = D[e], c[f] = a & 255, c[f + 1] = a >> 8 & 255, c[f + 2] = a >> 16 & 255, c[f + 3] = k ? 255 : a >> 24 & 255, e++, f += 4; | |||
for (d = c.length; f < d; ) { | |||
} | } | ||
} else { | } else { | ||
if | if (a = new Uint32Array(c.buffer), k && S.K.ga) { | ||
if | if (d = a.length, a.set(D.subarray(e, e + d)), c = new Uint8Array(c.buffer), a = 3, e = a + 4 * d, 0 == d % 8) { | ||
for (; a < e;) { | |||
c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0, c[a] = 255, a = a + 4 | 0; | |||
for (; a < e; ) { | |||
} | } | ||
} else { | } else { | ||
for (; a < e; ) { | for (; a < e;) { | ||
c[a] = 255, a = a + 4 | 0; | |||
} | } | ||
} | } | ||
Zeile 2.943: | Zeile 1.639: | ||
} | } | ||
} | } | ||
var vb = (a, b, c, d) => | var vb = (a, b, c, d) => w(`Assertion failed: ${ce(a)}, at: ` + [b ? ce(b) : "unknown filename", c, d ? ce(d) : "unknown function"]); | ||
function fe(a, b, c, d) { | function fe(a, b, c, d) { | ||
return n ? R(10, 1, a, b, c, d) : wb(a, b, c, d); | return n ? R(10, 1, a, b, c, d) : wb(a, b, c, d); | ||
} | } | ||
var wb = (a, b, c, d) => { | var wb = (a, b, c, d) => { | ||
if ("undefined" == typeof SharedArrayBuffer) { | |||
return Da("pthread_create: environment does not support SharedArrayBuffer, pthreads are not available"), 6; | |||
} | |||
var e = []; | |||
if (n && 0 === e.length) { | |||
return fe(a, b, c, d); | |||
} | |||
a = {jb:c, o:a, S:d, Ga:e,}; | |||
return n ? (a.s = "spawnThread", postMessage(a, e), 0) : jc(a); | |||
}, xb = () => w("native code called abort()"), yb = () => 1, zb = a => { | |||
Fa(a, !h, 1, !aa, 52428800, !1,); | |||
Ga(); | |||
}, Ha = a => { | |||
if ("function" === typeof Atomics.rb) { | |||
var b = Atomics.rb(D, a >> 2, a); | |||
t(b.async); | |||
b.value.then(Ma); | |||
Atomics.store(D, a + 128 >> 2, 1); | |||
} | |||
}, Ma = () => { | |||
var a = I(); | |||
a && (Ha(a), Gc(ge)); | |||
}, Ab = (a, b) => { | |||
a == b ? setTimeout(Ma) : n ? postMessage({$:a, s:"checkMailbox"}) : (b = dc[a]) ? b.postMessage({s:"checkMailbox"}) : v(`Cannot send message to thread with ID ${a}, unknown thread ID!`); | |||
}, he = [], Bb = (a, b, c, d, e) => { | |||
d /= 2; | |||
he.length = d; | |||
c = e >> 3; | |||
for (e = 0; e < d; e++) { | |||
he[e] = H[c + 2 * e] ? H[c + 2 * e + 1] : xa[c + 2 * e + 1]; | |||
} | |||
t(!b); | |||
c = ie[a]; | |||
t(!(a && b)); | |||
t(c.length == d, "Call args mismatch in _emscripten_receive_on_main_thread_js"); | |||
a = c(...he); | |||
t("bigint" != typeof a); | |||
return a; | |||
}, Cb = a => { | |||
n ? postMessage({s:"cleanupThread", mb:a}) : gc(a); | |||
}, Db = a => { | |||
m && dc[a].ref(); | |||
}, Eb = (a, b, c, d) => { | |||
var e = (new Date()).getFullYear(), f = (new Date(e, 0, 1)).getTimezoneOffset(); | |||
e = (new Date(e, 6, 1)).getTimezoneOffset(); | |||
F[a >> 2] = 60 * Math.max(f, e); | |||
D[b >> 2] = Number(f != e); | |||
b = k => { | |||
var l = Math.abs(k); | |||
return `UTC${0 <= k ? "-" : "+"}${String(Math.floor(l / 60)).padStart(2, "0")}${String(l % 60).padStart(2, "0")}`; | |||
}; | |||
a = b(f); | |||
b = b(e); | |||
t(a); | |||
t(b); | |||
t(16 >= Jd(a), `timezone name truncated to fit in TZNAME_MAX (${a})`); | |||
t(16 >= Jd(b), `timezone name truncated to fit in TZNAME_MAX (${b})`); | |||
e < f ? (Ud(a, c, 17), Ud(b, d, 17)) : (Ud(a, d, 17), Ud(b, c, 17)); | |||
}, Fb = () => { | |||
m || h || N("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"); | |||
}, Gb = () => Date.now(), Hb = () => { | |||
Q += 1; | |||
throw "unwind"; | |||
}, Jb = () => m ? require("os").cpus().length : navigator.hardwareConcurrency, Kb = a => { | |||
w(`Cannot enlarge memory arrays to size ${a >>> 0} bytes (OOM). Either (1) compile with -sINITIAL_MEMORY=X with X higher than the current value ${C.length}, (2) compile with -sALLOW_MEMORY_GROWTH which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -sABORTING_MALLOC=0`); | |||
}, Mb = (a, b, c) => { | |||
Fd(() => dynCall_v(a), b, c); | |||
}, Nb = a => je(b => Hc(b, a)); | |||
Nb.Va = !0; | |||
var ke = {}, me = () => { | |||
if (!le) { | |||
var a = {USER:"web_user", LOGNAME:"web_user", PATH:"/", PWD:"/", HOME:"/home/web_user", LANG:("object" == typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _:ea || "./this.program"}, b; | |||
for (b in ke) { | |||
void 0 === ke[b] ? delete a[b] : a[b] = ke[b]; | |||
} | } | ||
var c = []; | |||
for (b in a) { | |||
var | c.push(`${b}=${a[b]}`); | ||
} | } | ||
le = c; | |||
} | |||
return le; | |||
}, le; | |||
} | |||
function Ob(a, b) { | function Ob(a, b) { | ||
if (n) { | if (n) { | ||
Zeile 3.120: | Zeile 1.734: | ||
me().forEach((d, e) => { | me().forEach((d, e) => { | ||
var f = b + c; | var f = b + c; | ||
e = F[ | e = F[a + 4 * e >> 2] = f; | ||
for (f = 0; f < d.length; ++f) { | for (f = 0; f < d.length; ++f) { | ||
t(d.charCodeAt(f) === (d.charCodeAt(f) & 255)), | t(d.charCodeAt(f) === (d.charCodeAt(f) & 255)), C[e++] = d.charCodeAt(f); | ||
} | } | ||
C[e] = 0; | C[e] = 0; | ||
Zeile 3.137: | Zeile 1.750: | ||
F[a >> 2] = c.length; | F[a >> 2] = c.length; | ||
var d = 0; | var d = 0; | ||
c.forEach | c.forEach(e => d += e.length + 1); | ||
F[b >> 2] = d; | F[b >> 2] = d; | ||
return 0; | return 0; | ||
} | } | ||
var ne = () => { | var ne = () => { | ||
if ("object" == typeof crypto && "function" == typeof crypto.getRandomValues) { | |||
return c => (c.set(crypto.getRandomValues(new Uint8Array(c.byteLength))), c); | |||
} | |||
if (m) { | |||
try { | |||
var a = require("crypto"); | |||
); | if (a.randomFillSync) { | ||
return c => a.randomFillSync(c); | |||
} | |||
var b = a.randomBytes; | |||
return c => (c.set(b(c.byteLength)), c); | |||
} catch (c) { | |||
} | } | ||
} | |||
w("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };"); | |||
}, oe = a => (oe = ne())(a), pe = (...a) => { | |||
for (var b = "", c = !1, d = a.length - 1; -1 <= d && !c; d--) { | |||
c = 0 <= d ? a[d] : "/"; | |||
if ("string" != typeof c) { | |||
throw new TypeError("Arguments to path.resolve must be strings"); | |||
} | } | ||
if (!c) { | |||
return ""; | |||
} | } | ||
b = Bc( | b = c + "/" + b; | ||
c = "/" === c.charAt(0); | |||
} | |||
b = Bc(b.split("/").filter(e => !!e), !c).join("/"); | |||
return (c ? "/" : "") + b || "."; | |||
}, qe = [], re = []; | |||
function se(a, b) { | function se(a, b) { | ||
re[a] = { | re[a] = {input:[], output:[], L:b}; | ||
te(a, ue); | te(a, ue); | ||
} | } | ||
var ue = { | var ue = {open(a) { | ||
var b = re[a.node.rdev]; | |||
if (!b) { | |||
throw new U(43); | |||
} | |||
a.tty = b; | |||
a.seekable = !1; | |||
}, close(a) { | |||
a.tty.L.fsync(a.tty); | |||
}, fsync(a) { | |||
a.tty.L.fsync(a.tty); | |||
}, read(a, b, c, d) { | |||
if (!a.tty || !a.tty.L.ua) { | |||
throw new U(60); | |||
} | |||
for (var e = 0, f = 0; f < d; f++) { | |||
try { | |||
var k = a.tty.L.ua(a.tty); | |||
} catch (l) { | |||
throw new U(29); | |||
} | |||
if (void 0 === k && 0 === e) { | |||
throw new U(6); | |||
} | |||
if (null === k || void 0 === k) { | |||
break; | |||
} | |||
e++; | |||
b[c + f] = k; | |||
} | |||
e && (a.node.timestamp = Date.now()); | |||
return e; | |||
}, write(a, b, c, d) { | |||
if (!a.tty || !a.tty.L.ha) { | |||
throw new U(60); | |||
} | |||
try { | |||
for (var e = 0; e < d; e++) { | |||
a.tty.L.ha(a.tty, b[c + e]); | |||
} | |||
} catch (f) { | |||
throw new U(29); | |||
} | |||
d && (a.node.timestamp = Date.now()); | |||
return e; | |||
},}, ve = {ua() { | |||
a: { | |||
if (!qe.length) { | |||
var a = null; | |||
if (m) { | |||
var b = Buffer.alloc(256), c = 0, d = process.stdin.fd; | |||
try { | try { | ||
c = fs.readSync(d, b, 0, 256); | |||
} catch ( | } catch (e) { | ||
if (e.toString().includes("EOF")) { | |||
c = 0; | |||
} else { | |||
throw e; | |||
} | |||
} | } | ||
0 < c && (a = b.slice(0, c).toString("utf-8")); | |||
} else { | |||
"undefined" != typeof window && "function" == typeof window.prompt && (a = window.prompt("Input: "), null !== a && (a += "\n")); | |||
} | } | ||
if (!a) { | |||
a = null; | |||
break a; | |||
} | } | ||
qe = Ld(a, !0); | |||
} | } | ||
a = qe.shift(); | |||
} | |||
return a; | |||
}, ha(a, b) { | |||
null === b || 10 === b ? (u(be(a.output)), a.output = []) : 0 != b && a.output.push(b); | |||
}, fsync(a) { | |||
a.output && 0 < a.output.length && (u(be(a.output)), a.output = []); | |||
}, Xb() { | |||
return {Eb:25856, Gb:5, Db:191, Fb:35387, Cb:[3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]}; | |||
}, Yb() { | |||
return 0; | |||
}, Zb() { | |||
return [24, 80]; | |||
},}, we = {ha(a, b) { | |||
null === b || 10 === b ? (v(be(a.output)), a.output = []) : 0 != b && a.output.push(b); | |||
}, fsync(a) { | |||
a.output && 0 < a.output.length && (v(be(a.output)), a.output = []); | |||
},}; | |||
function xe(a, b) { | function xe(a, b) { | ||
var c = a.h ? a.h.length : 0; | var c = a.h ? a.h.length : 0; | ||
c >= b || | c >= b || (b = Math.max(b, c * (1048576 > c ? 2.0 : 1.125) >>> 0), 0 != c && (b = Math.max(b, 256)), c = a.h, a.h = new Uint8Array(b), 0 < a.l && a.h.set(c.subarray(0, a.l), 0)); | ||
} | } | ||
var V = { | var V = {u:null, A() { | ||
return V.createNode(null, "/", 16895, 0); | |||
}, createNode(a, b, c, d) { | |||
if (24576 === (c & 61440) || 4096 === (c & 61440)) { | |||
throw new U(63); | |||
} | |||
V.u || (V.u = {dir:{node:{G:V.g.G, v:V.g.v, lookup:V.g.lookup, X:V.g.X, rename:V.g.rename, unlink:V.g.unlink, rmdir:V.g.rmdir, readdir:V.g.readdir, symlink:V.g.symlink}, stream:{I:V.j.I}}, file:{node:{G:V.g.G, v:V.g.v}, stream:{I:V.j.I, read:V.j.read, write:V.j.write, ma:V.j.ma, za:V.j.za, Ca:V.j.Ca}}, link:{node:{G:V.g.G, v:V.g.v, readlink:V.g.readlink}, stream:{}}, oa:{node:{G:V.g.G, v:V.g.v}, stream:ye}}); | |||
c = ze(a, b, c, d); | |||
16384 === (c.mode & 61440) ? (c.g = V.u.dir.node, c.j = V.u.dir.stream, c.h = {}) : 32768 === (c.mode & 61440) ? (c.g = V.u.file.node, c.j = V.u.file.stream, c.l = 0, c.h = null) : 40960 === (c.mode & 61440) ? (c.g = V.u.link.node, c.j = V.u.link.stream) : 8192 === (c.mode & 61440) && (c.g = V.u.oa.node, c.j = V.u.oa.stream); | |||
c.timestamp = Date.now(); | |||
a && (a.h[b] = c, a.timestamp = c.timestamp); | |||
return c; | |||
}, Vb(a) { | |||
return a.h ? a.h.subarray ? a.h.subarray(0, a.l) : new Uint8Array(a.h) : new Uint8Array(0); | |||
}, g:{G(a) { | |||
var b = {}; | |||
b.dev = 8192 === (a.mode & 61440) ? a.id : 1; | |||
b.ino = a.id; | |||
b.mode = a.mode; | |||
b.nlink = 1; | |||
b.uid = 0; | |||
b.gid = 0; | |||
b.rdev = a.rdev; | |||
16384 === (a.mode & 61440) ? b.size = 4096 : 32768 === (a.mode & 61440) ? b.size = a.l : 40960 === (a.mode & 61440) ? b.size = a.link.length : b.size = 0; | |||
b.atime = new Date(a.timestamp); | |||
b.mtime = new Date(a.timestamp); | |||
b.ctime = new Date(a.timestamp); | |||
b.Ka = 4096; | |||
b.blocks = Math.ceil(b.size / b.Ka); | |||
return b; | |||
}, v(a, b) { | |||
void 0 !== b.mode && (a.mode = b.mode); | |||
void 0 !== b.timestamp && (a.timestamp = b.timestamp); | |||
if (void 0 !== b.size && (b = b.size, a.l != b)) { | |||
if (0 == b) { | |||
a.h = null, a.l = 0; | |||
} else { | |||
var c = a.h; | |||
a.h = new Uint8Array(b); | |||
c && a.h.set(c.subarray(0, Math.min(b, a.l))); | |||
a.l = b; | |||
} | |||
} | |||
}, lookup() { | |||
throw new U(44); | |||
}, X(a, b, c, d) { | |||
return V.createNode(a, b, c, d); | |||
}, rename(a, b, c) { | |||
if (16384 === (a.mode & 61440)) { | |||
try { | |||
var d = Ae(b, c); | |||
} catch (f) { | |||
} | |||
if (d) { | |||
for (var e in d.h) { | |||
throw new U(55); | |||
} | } | ||
} | } | ||
} | } | ||
delete a.parent.h[a.name]; | |||
a.parent.timestamp = Date.now(); | |||
a.name = c; | |||
b.h[c] = a; | |||
b.timestamp = a.parent.timestamp; | |||
}, unlink(a, b) { | |||
delete a.h[b]; | |||
a.timestamp = Date.now(); | |||
}, rmdir(a, b) { | |||
var c = Ae(a, b), d; | |||
for (d in c.h) { | |||
throw new U(55); | |||
} | |||
delete a.h[b]; | |||
a.timestamp = Date.now(); | |||
}, readdir(a) { | |||
var b = [".", ".."], c; | |||
for (c of Object.keys(a.h)) { | |||
b.push(c); | |||
} | |||
return b; | |||
}, symlink(a, b, c) { | |||
a = V.createNode(a, b, 41471, 0); | |||
a.link = c; | |||
return a; | |||
}, readlink(a) { | |||
if (40960 !== (a.mode & 61440)) { | |||
throw new U(28); | |||
} | |||
return a.link; | |||
},}, j:{read(a, b, c, d, e) { | |||
var f = a.node.h; | |||
if (e >= a.node.l) { | |||
return 0; | |||
} | |||
a = Math.min(a.node.l - e, d); | |||
t(0 <= a); | |||
if (8 < a && f.subarray) { | |||
b.set(f.subarray(e, e + a), c); | |||
} else { | |||
for (d = 0; d < a; d++) { | |||
b[c + d] = f[e + d]; | |||
} | |||
} | |||
return a; | |||
}, write(a, b, c, d, e, f) { | |||
t(!(b instanceof ArrayBuffer)); | |||
if (!d) { | |||
return 0; | |||
} | |||
a = a.node; | |||
a.timestamp = Date.now(); | |||
if (b.subarray && (!a.h || a.h.subarray)) { | |||
if (f) { | |||
return t(0 === e, "canOwn must imply no weird position inside the file"), a.h = b.subarray(c, c + d), a.l = d; | |||
} | } | ||
if (0 === a.l && 0 === e) { | |||
return a.h = b.slice(c, c + d), a.l = d; | |||
} | } | ||
if (e + d <= a.l) { | |||
return | return a.h.set(b.subarray(c, c + d), e), d; | ||
} | } | ||
set | } | ||
xe(a, e + d); | |||
if (a.h.subarray && b.subarray) { | |||
a.h.set(b.subarray(c, c + d), e); | |||
} else { | |||
for (f = 0; f < d; f++) { | |||
a.h[e + f] = b[c + f]; | |||
} | } | ||
} | |||
a.l = Math.max(a.l, e + d); | |||
return d; | |||
}, I(a, b, c) { | |||
1 === c ? b += a.position : 2 === c && 32768 === (a.node.mode & 61440) && (b += a.node.l); | |||
if (0 > b) { | |||
throw new U(28); | |||
} | |||
return b; | |||
}, ma(a, b, c) { | |||
xe(a.node, b + c); | |||
a.node.l = Math.max(a.node.l, b + c); | |||
}, za(a, b, c, d, e) { | |||
if (32768 !== (a.node.mode & 61440)) { | |||
throw new U(43); | |||
} | |||
a = a.node.h; | |||
if (e & 2 || !a || a.buffer !== C.buffer) { | |||
d = !0; | |||
w("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported"); | |||
e = void 0; | |||
if (!e) { | |||
throw new U(48); | |||
} | } | ||
if (a) { | |||
if (0 < c || c + b < a.length) { | |||
a.subarray ? a = a.subarray(c, c + b) : a = Array.prototype.slice.call(a, c, c + b); | |||
} | |||
C.set(a, e); | |||
} | } | ||
} else { | |||
d = !1, e = a.byteOffset; | |||
} | |||
return {nc:e, zb:d}; | |||
}, Ca(a, b, c, d) { | |||
V.j.write(a, b, 0, d, c, !1); | |||
return 0; | |||
},},}, Be = (a, b) => { | |||
var c = 0; | |||
a && (c |= 365); | |||
b && (c |= 146); | |||
return c; | |||
}, Ce = {EPERM:63, ENOENT:44, ESRCH:71, EINTR:27, EIO:29, ENXIO:60, E2BIG:1, ENOEXEC:45, EBADF:8, ECHILD:12, EAGAIN:6, EWOULDBLOCK:6, ENOMEM:48, EACCES:2, EFAULT:21, ENOTBLK:105, EBUSY:10, EEXIST:20, EXDEV:75, ENODEV:43, ENOTDIR:54, EISDIR:31, EINVAL:28, ENFILE:41, EMFILE:33, ENOTTY:59, ETXTBSY:74, EFBIG:22, ENOSPC:51, ESPIPE:70, EROFS:69, EMLINK:34, EPIPE:64, EDOM:18, ERANGE:68, ENOMSG:49, EIDRM:24, ECHRNG:106, EL2NSYNC:156, EL3HLT:107, EL3RST:108, ELNRNG:109, EUNATCH:110, ENOCSI:111, EL2HLT:112, | |||
EDEADLK:16, ENOLCK:46, EBADE:113, EBADR:114, EXFULL:115, ENOANO:104, EBADRQC:103, EBADSLT:102, EDEADLOCK:16, EBFONT:101, ENOSTR:100, ENODATA:116, ETIME:117, ENOSR:118, ENONET:119, ENOPKG:120, EREMOTE:121, ENOLINK:47, EADV:122, ESRMNT:123, ECOMM:124, EPROTO:65, EMULTIHOP:36, EDOTDOT:125, EBADMSG:9, ENOTUNIQ:126, EBADFD:127, EREMCHG:128, ELIBACC:129, ELIBBAD:130, ELIBSCN:131, ELIBMAX:132, ELIBEXEC:133, ENOSYS:52, ENOTEMPTY:55, ENAMETOOLONG:37, ELOOP:32, EOPNOTSUPP:138, EPFNOSUPPORT:139, ECONNRESET:15, | |||
ENOBUFS:42, EAFNOSUPPORT:5, EPROTOTYPE:67, ENOTSOCK:57, ENOPROTOOPT:50, ESHUTDOWN:140, ECONNREFUSED:14, EADDRINUSE:3, ECONNABORTED:13, ENETUNREACH:40, ENETDOWN:38, ETIMEDOUT:73, EHOSTDOWN:142, EHOSTUNREACH:23, EINPROGRESS:26, EALREADY:7, EDESTADDRREQ:17, EMSGSIZE:35, EPROTONOSUPPORT:66, ESOCKTNOSUPPORT:137, EADDRNOTAVAIL:4, ENETRESET:39, EISCONN:30, ENOTCONN:53, ETOOMANYREFS:141, EUSERS:136, EDQUOT:19, ESTALE:72, ENOTSUP:138, ENOMEDIUM:148, EILSEQ:25, EOVERFLOW:61, ECANCELED:11, ENOTRECOVERABLE:56, | |||
EOWNERDEAD:62, ESTRPIPE:135,}, De = null, Ee = {}, Fe = [], Ge = 1, He = null, Va = !1, Ya = !0, U = class extends Error { | |||
name="ErrnoError"; | |||
constructor(a) { | |||
super(Ta ? ce(Ie(a)) : ""); | |||
this.O = a; | |||
for (var b in Ce) { | |||
if (Ce[b] === a) { | |||
this.code = b; | |||
break; | |||
} | |||
} | } | ||
set | } | ||
}, Je = {}, Ke = class { | |||
} | F={}; | ||
} | node=null; | ||
get object() { | |||
return this.node; | |||
} | |||
set object(a) { | |||
this.node = a; | |||
} | |||
get flags() { | |||
return this.F.flags; | |||
} | |||
set flags(a) { | |||
this.F.flags = a; | |||
} | |||
get position() { | |||
return this.F.position; | |||
} | |||
set position(a) { | |||
this.F.position = a; | |||
} | |||
}, Le = class { | |||
g={}; | |||
j={}; | |||
Y=null; | |||
constructor(a, b, c, d) { | |||
a ||= this; | |||
this.parent = a; | |||
this.A = a.A; | |||
this.id = Ge++; | |||
this.name = b; | |||
this.mode = c; | |||
this.rdev = d; | |||
} | |||
get read() { | |||
return 365 === (this.mode & 365); | |||
} | |||
set read(a) { | |||
a ? this.mode |= 365 : this.mode &= -366; | |||
} | |||
get write() { | |||
return 146 === (this.mode & 146); | |||
} | |||
set write(a) { | |||
a ? this.mode |= 146 : this.mode &= -147; | |||
} | |||
}; | |||
function W(a, b = {}) { | function W(a, b = {}) { | ||
a = pe(a); | a = pe(a); | ||
if (!a) { | if (!a) { | ||
return { | return {path:"", node:null}; | ||
} | } | ||
b = Object.assign( | b = Object.assign({ta:!0, ia:0}, b); | ||
if (8 < b.ia) { | if (8 < b.ia) { | ||
throw new U(32); | throw new U(32); | ||
} | } | ||
a = a.split("/").filter | a = a.split("/").filter(k => !!k); | ||
for (var c = De, d = "/", e = 0; e < a.length; e++) { | for (var c = De, d = "/", e = 0; e < a.length; e++) { | ||
var f = e === a.length - 1; | var f = e === a.length - 1; | ||
Zeile 3.824: | Zeile 2.131: | ||
c = Ae(c, a[e]); | c = Ae(c, a[e]); | ||
d = Cc(d + "/" + a[e]); | d = Cc(d + "/" + a[e]); | ||
c.Y && (!f || | c.Y && (!f || f && b.ta) && (c = c.Y.root); | ||
if (!f || b.W) { | if (!f || b.W) { | ||
for (f = 0; 40960 === (c.mode & 61440); ) { | for (f = 0; 40960 === (c.mode & 61440);) { | ||
if | if (c = Me(d), d = pe(Dc(d), c), c = W(d, {ia:b.ia + 1}).node, 40 < f++) { | ||
throw new U(32); | throw new U(32); | ||
} | } | ||
Zeile 3.840: | Zeile 2.140: | ||
} | } | ||
} | } | ||
return { | return {path:d, node:c}; | ||
} | } | ||
function Ne(a, b) { | function Ne(a, b) { | ||
for (var c = 0, d = 0; d < b.length; d++) { | for (var c = 0, d = 0; d < b.length; d++) { | ||
c = | c = (c << 5) - c + b.charCodeAt(d) | 0; | ||
} | } | ||
return | return (a + c >>> 0) % He.length; | ||
} | } | ||
function Ae(a, b) { | function Ae(a, b) { | ||
var c = | var c = 16384 === (a.mode & 61440) ? (c = Oe(a, "x")) ? c : a.g.lookup ? 0 : 2 : 54; | ||
if (c) { | if (c) { | ||
throw new U(c); | throw new U(c); | ||
Zeile 3.876: | Zeile 2.166: | ||
b = Ne(a.parent.id, a.name); | b = Ne(a.parent.id, a.name); | ||
a.cb = He[b]; | a.cb = He[b]; | ||
return | return He[b] = a; | ||
} | } | ||
function Pe(a) { | function Pe(a) { | ||
Zeile 3.888: | Zeile 2.178: | ||
} | } | ||
if (!b.includes("r") || a.mode & 292) { | if (!b.includes("r") || a.mode & 292) { | ||
if | if (b.includes("w") && !(a.mode & 146) || b.includes("x") && !(a.mode & 73)) { | ||
return 2; | return 2; | ||
} | } | ||
Zeile 3.902: | Zeile 2.189: | ||
try { | try { | ||
return Ae(a, b), 20; | return Ae(a, b), 20; | ||
} catch (c) {} | } catch (c) { | ||
} | |||
return Oe(a, "wx"); | return Oe(a, "wx"); | ||
} | } | ||
Zeile 3.912: | Zeile 2.200: | ||
return a; | return a; | ||
} | } | ||
var ye = { | var ye = {open(a) { | ||
a.j = Ee[a.node.rdev].j; | |||
a.j.open?.(a); | |||
}, I() { | |||
throw new U(70); | |||
},}; | |||
}; | |||
function te(a, b) { | function te(a, b) { | ||
Ee[a] = { | Ee[a] = {j:b}; | ||
} | } | ||
function Se(a, b) { | function Se(a, b) { | ||
Zeile 3.933: | Zeile 2.213: | ||
throw a; | throw a; | ||
} | } | ||
var c = "/" === b, | var c = "/" === b, d = !b; | ||
if (c && De) { | if (c && De) { | ||
throw new U(10); | throw new U(10); | ||
} | } | ||
if (!c && !d) { | if (!c && !d) { | ||
var e = W(b, { | var e = W(b, {ta:!1}); | ||
b = e.path; | b = e.path; | ||
e = e.node; | e = e.node; | ||
Zeile 3.951: | Zeile 2.228: | ||
} | } | ||
} | } | ||
b = { | b = {type:a, lc:{}, Ba:b, bb:[]}; | ||
a = a.A(b); | a = a.A(b); | ||
a.A = b; | a.A = b; | ||
b.root = a; | b.root = a; | ||
c ? | c ? De = a : e && (e.Y = b, e.A && e.A.bb.push(b)); | ||
} | } | ||
function Te(a, b, c) { | function Te(a, b, c) { | ||
var d = W(a, { | var d = W(a, {parent:!0}).node; | ||
a = Ec(a); | a = Ec(a); | ||
if (!a || "." === a || ".." === a) { | if (!a || "." === a || ".." === a) { | ||
Zeile 3.983: | Zeile 2.253: | ||
} | } | ||
function Ue(a, b, c) { | function Ue(a, b, c) { | ||
"undefined" == typeof c && | "undefined" == typeof c && (c = b, b = 438); | ||
Te(a, b | 8192, c); | Te(a, b | 8192, c); | ||
} | } | ||
Zeile 3.990: | Zeile 2.260: | ||
throw new U(44); | throw new U(44); | ||
} | } | ||
var c = W(b, { | var c = W(b, {parent:!0}).node; | ||
if (!c) { | if (!c) { | ||
throw new U(44); | throw new U(44); | ||
Zeile 4.022: | Zeile 2.290: | ||
} | } | ||
if ("string" == typeof b) { | if ("string" == typeof b) { | ||
var d = { | var d = {r:0, "r+":2, w:577, "w+":578, a:1089, "a+":1090,}[b]; | ||
if ("undefined" == typeof d) { | if ("undefined" == typeof d) { | ||
throw Error(`Unknown file open mode: ${b}`); | throw Error(`Unknown file open mode: ${b}`); | ||
Zeile 4.035: | Zeile 2.296: | ||
b = d; | b = d; | ||
} | } | ||
c = b & 64 ? | c = b & 64 ? c & 4095 | 32768 : 0; | ||
if ("object" == typeof a) { | if ("object" == typeof a) { | ||
var e = a; | var e = a; | ||
Zeile 4.041: | Zeile 2.302: | ||
a = Cc(a); | a = Cc(a); | ||
try { | try { | ||
e = W(a, { | e = W(a, {W:!(b & 131072)}).node; | ||
} catch (k) { | |||
} | |||
} catch (k) {} | |||
} | } | ||
d = !1; | d = !1; | ||
Zeile 4.053: | Zeile 2.313: | ||
} | } | ||
} else { | } else { | ||
e = Te(a, c, 0), d = !0; | |||
} | } | ||
} | } | ||
Zeile 4.063: | Zeile 2.323: | ||
throw new U(54); | throw new U(54); | ||
} | } | ||
if ( | if (!d && (c = e ? 40960 === (e.mode & 61440) ? 32 : 16384 === (e.mode & 61440) && ("r" !== Pe(b) || b & 512) ? 31 : Oe(e, Pe(b)) : 44)) { | ||
throw new U(c); | throw new U(c); | ||
} | } | ||
if (b & 512 && !d) { | if (b & 512 && !d) { | ||
c = e; | c = e; | ||
c = | c = "string" == typeof c ? W(c, {W:!0}).node : c; | ||
if (!c.g.v) { | if (!c.g.v) { | ||
throw new U(63); | throw new U(63); | ||
Zeile 4.092: | Zeile 2.338: | ||
throw new U(28); | throw new U(28); | ||
} | } | ||
if | if (d = Oe(c, "w")) { | ||
throw new U(d); | throw new U(d); | ||
} | } | ||
c.g.v(c, { | c.g.v(c, {size:0, timestamp:Date.now()}); | ||
} | } | ||
b &= -131713; | b &= -131713; | ||
a: { | a: { | ||
for (c = e; ; ) { | for (c = e;;) { | ||
if (c === c.parent) { | if (c === c.parent) { | ||
c = c.A.Ba; | c = c.A.Ba; | ||
var f = f ? | var f = f ? "/" !== c[c.length - 1] ? `${c}/${f}` : c + f : c; | ||
break a; | break a; | ||
} | } | ||
Zeile 4.112: | Zeile 2.355: | ||
} | } | ||
} | } | ||
e = { | e = {node:e, path:f, flags:b, seekable:!0, position:0, j:e.j, pb:[], error:!1}; | ||
f = -1; | f = -1; | ||
t(-1 <= f); | t(-1 <= f); | ||
Zeile 4.155: | Zeile 2.389: | ||
} | } | ||
function J(a, b, c) { | function J(a, b, c) { | ||
a = Cc("/dev/" + a); | a = Cc("/dev/" + a); | ||
var d = Be(!!b, !!c); | var d = Be(!!b, !!c); | ||
J.ya ?? (J.ya = 64); | |||
var e = | var e = J.ya++ << 8 | 0; | ||
te(e, { | te(e, {open(f) { | ||
f.seekable = !1; | |||
}, close() { | |||
c?.buffer?.length && c(10); | |||
}, read(f, k, l, r) { | |||
for (var p = 0, y = 0; y < r; y++) { | |||
try { | |||
var B = b(); | |||
} catch (E) { | |||
throw new U(29); | |||
} | |||
if (void 0 === B && 0 === p) { | |||
throw new U(6); | |||
} | |||
if (null === B || void 0 === B) { | |||
break; | |||
} | } | ||
p && (f.node.timestamp = Date.now()); | p++; | ||
k[l + y] = B; | |||
} | |||
p && (f.node.timestamp = Date.now()); | |||
return p; | |||
}, write(f, k, l, r) { | |||
for (var p = 0; p < r; p++) { | |||
try { | |||
c(k[l + p]); | |||
} catch (y) { | |||
throw new U(29); | |||
} | } | ||
} | } | ||
}); | r && (f.node.timestamp = Date.now()); | ||
return p; | |||
}}); | |||
Ue(a, d, e); | Ue(a, d, e); | ||
} | } | ||
Zeile 4.241: | Zeile 2.463: | ||
var e = Re(a); | var e = Re(a); | ||
a = b; | a = b; | ||
for (var f, k = | for (var f, k = b = 0; k < c; k++) { | ||
var l = F[a >> 2], | var l = F[a >> 2], r = F[a + 4 >> 2]; | ||
a += 8; | a += 8; | ||
var p = e, | var p = e, y = l, B = r, E = f, wa = C; | ||
t(0 <= y); | t(0 <= y); | ||
if (0 > B || 0 > E) { | if (0 > B || 0 > E) { | ||
Zeile 4.325: | Zeile 2.542: | ||
var e = Re(a); | var e = Re(a); | ||
a = b; | a = b; | ||
for (var f, k = | for (var f, k = b = 0; k < c; k++) { | ||
var l = F[a >> 2], | var l = F[a >> 2], r = F[a + 4 >> 2]; | ||
a += 8; | a += 8; | ||
var p = e, | var p = e, y = l, B = r, E = f, wa = C; | ||
t(0 <= y); | t(0 <= y); | ||
if (0 > B || 0 > E) { | if (0 > B || 0 > E) { | ||
Zeile 4.381: | Zeile 2.593: | ||
} | } | ||
} | } | ||
var Xe = | var Xe = a => { | ||
try { | try { | ||
a(); | a(); | ||
Zeile 4.389: | Zeile 2.601: | ||
}; | }; | ||
function Vb() { | function Vb() { | ||
var a = lb, | var a = lb, b = /^(invoke_.*|__asyncjs__.*)$/; | ||
for (let [c, d] of Object.entries(a)) { | for (let [c, d] of Object.entries(a)) { | ||
if ("function" == typeof d) { | if ("function" == typeof d) { | ||
Zeile 4.402: | Zeile 2.613: | ||
var l = c.startsWith("invoke_") && !0; | var l = c.startsWith("invoke_") && !0; | ||
if (Y !== k && !e && !f && !l) { | if (Y !== k && !e && !f && !l) { | ||
throw Error( | throw Error(`import ${c} was not in ASYNCIFY_IMPORTS, but changed the state`); | ||
} | } | ||
} | } | ||
Zeile 4.412: | Zeile 2.621: | ||
} | } | ||
function $e() { | function $e() { | ||
var a = M, | var a = M, b = {}; | ||
for (let [c, d] of Object.entries(a)) { | for (let [c, d] of Object.entries(a)) { | ||
b[c] = | b[c] = "function" == typeof d ? (...e) => { | ||
af.push(c); | |||
try { | |||
return d(...e); | |||
} finally { | |||
A || (e = af.pop(), t(e === c), Z && 1 === Y && 0 === af.length && (Y = Ye, Q += 1, Xe(bf), "undefined" != typeof Fibers && Fibers.tc())); | |||
} | |||
} : d; | |||
} | } | ||
return b; | return b; | ||
} | } | ||
var Ye = 0, | var Ye = 0, Ze = 3, Y = 0, Z = null, cf = 0, af = [], df = {}, ef = {}, ff = 0, gf = null, hf = []; | ||
function jf() { | function jf() { | ||
var a = md(4108), | var a = md(4108), b = a + 12; | ||
F[a >> 2] = b; | F[a >> 2] = b; | ||
F[ | F[a + 4 >> 2] = b + 4096; | ||
b = af[0]; | b = af[0]; | ||
var c = df[b]; | var c = df[b]; | ||
void 0 === c && | void 0 === c && (c = ff++, df[b] = c, ef[c] = b); | ||
D[ | D[a + 8 >> 2] = c; | ||
return a; | return a; | ||
} | } | ||
function kf() { | function kf() { | ||
var a = M[ef[D[ | var a = M[ef[D[Z + 8 >> 2]]]; | ||
t(0 < Q); | t(0 < Q); | ||
--Q; | --Q; | ||
Zeile 4.470: | Zeile 2.655: | ||
if (!A) { | if (!A) { | ||
if (Y === Ye) { | if (Y === Ye) { | ||
var b = !1, | var b = !1, c = !1; | ||
a((d = 0) => { | a((d = 0) => { | ||
t(!d || "number" == typeof d || "boolean" == typeof d); | t(!d || "number" == typeof d || "boolean" == typeof d); | ||
if (!A && | if (!A && (cf = d, b = !0, c)) { | ||
t( | t(!af.length, "Waking up (starting to rewind) must be done from JS, without compiled code on the stack."); | ||
Y = 2; | Y = 2; | ||
Xe(() => lf(Z)); | Xe(() => lf(Z)); | ||
Zeile 4.486: | Zeile 2.667: | ||
var e = kf(); | var e = kf(); | ||
} catch (l) { | } catch (l) { | ||
e = l, d = !0; | |||
} | } | ||
var f = !1; | var f = !1; | ||
if (!Z) { | if (!Z) { | ||
var k = gf; | var k = gf; | ||
k && | k && (gf = null, (d ? k.reject : k.resolve)(e), f = !0); | ||
} | } | ||
if (d && !f) { | if (d && !f) { | ||
Zeile 4.499: | Zeile 2.680: | ||
}); | }); | ||
c = !0; | c = !0; | ||
b || | b || (Y = 1, Z = jf(), "undefined" != typeof Bd && pd && Gd(), Xe(() => mf(Z))); | ||
} else { | } else { | ||
2 === Y | 2 === Y ? (Y = Ye, Xe(nf), Pd(Z), Z = null, hf.forEach(Gc)) : w(`invalid state: ${Y}`); | ||
} | } | ||
return cf; | return cf; | ||
} | } | ||
} | } | ||
(function () { | (function() { | ||
var a = Da; | var a = Da; | ||
Da = (...b) => { | Da = (...b) => { | ||
Zeile 4.522: | Zeile 2.697: | ||
})(); | })(); | ||
n || wc(); | n || wc(); | ||
g.requestFullscreen = function (a, b) { | g.requestFullscreen = function(a, b) { | ||
function c() { | function c() { | ||
Jc = !1; | Jc = !1; | ||
var f = d.parentNode; | var f = d.parentNode; | ||
(document.fullscreenElement || | (document.fullscreenElement || document.mozFullScreenElement || document.msFullscreenElement || document.webkitFullscreenElement || document.webkitCurrentFullScreenElement) === f ? (d.exitFullscreen = Yc, Wc && d.requestPointerLock(), Jc = !0, Xc ? ("undefined" != typeof S && (D[S.screen >> 2] = F[S.screen >> 2] | 8388608), ld(g.canvas), jd()) : ld(d)) : (f.parentNode.insertBefore(d, f), f.parentNode.removeChild(f), Xc ? ("undefined" != typeof S && (D[S.screen >> 2] = F[S.screen >> 2] & -8388609), | ||
ld(g.canvas), jd()) : ld(d)); | |||
g.onFullScreen?.(Jc); | |||
g.onFullscreen?.(Jc); | |||
} | } | ||
Wc = a; | Wc = a; | ||
Zeile 4.561: | Zeile 2.711: | ||
"undefined" == typeof Xc && (Xc = !1); | "undefined" == typeof Xc && (Xc = !1); | ||
var d = g.canvas; | var d = g.canvas; | ||
Vc || | Vc || (Vc = !0, document.addEventListener("fullscreenchange", c, !1), document.addEventListener("mozfullscreenchange", c, !1), document.addEventListener("webkitfullscreenchange", c, !1), document.addEventListener("MSFullscreenChange", c, !1)); | ||
var e = document.createElement("div"); | var e = document.createElement("div"); | ||
d.parentNode.insertBefore(e, d); | d.parentNode.insertBefore(e, d); | ||
e.appendChild(d); | e.appendChild(d); | ||
e.requestFullscreen = | e.requestFullscreen = e.requestFullscreen || e.mozRequestFullScreen || e.msRequestFullscreen || (e.webkitRequestFullscreen ? () => e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : null) || (e.webkitRequestFullScreen ? () => e.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT) : null); | ||
e.requestFullscreen(); | e.requestFullscreen(); | ||
}; | }; | ||
g.requestFullScreen = function () { | g.requestFullScreen = function() { | ||
w( | w("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)"); | ||
}; | }; | ||
g.setCanvasSize = kd; | g.setCanvasSize = kd; | ||
g.getUserMedia = function (a) { | g.getUserMedia = function(a) { | ||
let b; | let b; | ||
(b = window).getUserMedia || | (b = window).getUserMedia || (b.getUserMedia = navigator.getUserMedia || navigator.mozGetUserMedia); | ||
window.getUserMedia(a); | window.getUserMedia(a); | ||
}; | }; | ||
Zeile 4.605: | Zeile 2.738: | ||
X("/home"); | X("/home"); | ||
X("/home/web_user"); | X("/home/web_user"); | ||
(function () { | (function() { | ||
X("/dev"); | X("/dev"); | ||
te(259, { | te(259, {read:() => 0, write:(d, e, f, k) => k, I:() => 0,}); | ||
Ue("/dev/null", 259); | Ue("/dev/null", 259); | ||
se(1280, ve); | se(1280, ve); | ||
Zeile 4.617: | Zeile 2.746: | ||
Ue("/dev/tty", 1280); | Ue("/dev/tty", 1280); | ||
Ue("/dev/tty1", 1536); | Ue("/dev/tty1", 1536); | ||
var a = new Uint8Array(1024), | var a = new Uint8Array(1024), b = 0, c = () => { | ||
0 === b && (b = oe(a).byteLength); | |||
return a[--b]; | |||
}; | |||
J("random", c); | J("random", c); | ||
J("urandom", c); | J("urandom", c); | ||
Zeile 4.628: | Zeile 2.755: | ||
X("/dev/shm/tmp"); | X("/dev/shm/tmp"); | ||
})(); | })(); | ||
(function () { | (function() { | ||
X("/proc"); | X("/proc"); | ||
var a = X("/proc/self"); | var a = X("/proc/self"); | ||
X("/proc/self/fd"); | X("/proc/self/fd"); | ||
Se( | Se({A() { | ||
var b = ze(a, "fd", 16895, 73); | |||
b.g = {lookup(c, d) { | |||
var e = Re(+d); | |||
c = {parent:null, A:{Ba:"fake"}, g:{readlink:() => e.path},}; | |||
return c.parent = c; | |||
}}; | |||
return b; | |||
}}, "/proc/self/fd"); | |||
})(); | })(); | ||
var ie = [pc, rc, ob, qb, nb, pb, rb, Wd, tb, ub, fe, Ob, Pb, Rb, Sb, Tb, Ub], | var ie = [pc, rc, ob, qb, nb, pb, rb, Wd, tb, ub, fe, Ob, Pb, Rb, Sb, Tb, Ub], lb, M = function() { | ||
function a(d, e) { | |||
M = d.exports; | |||
M = $e(); | |||
uc.push(M._emscripten_tls_init); | |||
Qa.unshift(M.__wasm_call_ctors); | |||
sa = e; | |||
db("wasm-instantiate"); | |||
return M; | |||
} | |||
return | cb("wasm-instantiate"); | ||
var b = g, c = kb(); | |||
if (g.instantiateWasm) { | |||
try { | |||
return g.instantiateWasm(c, a); | |||
} catch (d) { | |||
return v(`Module.instantiateWasm callback failed with error: ${d}`), !1; | |||
} | } | ||
} | |||
if (n) { | |||
return new Promise(d => { | |||
Aa = e => { | |||
var f = new WebAssembly.Instance(e, kb()); | |||
a(f, e); | |||
d(); | |||
}; | |||
} | |||
}); | }); | ||
return {}; | } | ||
fb ??= eb("./get.php?res=dive.wasm") ? "./get.php?res=dive.wasm" : g.locateFile ? g.locateFile("./get.php?res=dive.wasm", q) : q + "./get.php?res=dive.wasm"; | |||
jb(c, function(d) { | |||
t(g === b, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); | |||
b = null; | |||
a(d.instance, d.module); | |||
}); | |||
return {}; | |||
}(); | |||
g._main = L("main", 2); | g._main = L("main", 2); | ||
var I = () => (I = M.pthread_self)(), | var I = () => (I = M.pthread_self)(), of = g.__emscripten_proxy_main = L("_emscripten_proxy_main", 2), Td = L("memcpy", 3), Fa = L("_emscripten_thread_init", 6), Na = L("_emscripten_thread_crashed", 0), pf = L("fflush", 1), md = L("malloc", 1), Pd = L("free", 1), nc = L("_emscripten_run_on_main_thread_js", 5), fc = L("_emscripten_thread_free_data", 1), Ac = L("_emscripten_thread_exit", 1), Ie = L("strerror", 1), ge = L("_emscripten_check_mailbox", 0), Vd = L("calloc", 2), yc = (a, b) => (yc = M.emscripten_stack_set_limits)(a, | ||
b), oc = a => (oc = M._emscripten_stack_restore)(a), mc = a => (mc = M._emscripten_stack_alloc)(a), lc = () => (lc = M.emscripten_stack_get_current)(), zc = g.dynCall_ii = L("dynCall_ii", 2), dynCall_vi = g.dynCall_vi = L("dynCall_vi", 2), dynCall_v = g.dynCall_v = L("dynCall_v", 1), dynCall_vii = g.dynCall_vii = L("dynCall_vii", 3); | |||
g.dynCall_iiii = L("dynCall_iiii", 4); | g.dynCall_iiii = L("dynCall_iiii", 4); | ||
g.dynCall_jiji = L("dynCall_jiji", 4); | g.dynCall_jiji = L("dynCall_jiji", 4); | ||
Zeile 4.733: | Zeile 2.813: | ||
g.dynCall_viijii = L("dynCall_viijii", 6); | g.dynCall_viijii = L("dynCall_viijii", 6); | ||
g.dynCall_viiii = L("dynCall_viiii", 5); | g.dynCall_viiii = L("dynCall_viiii", 5); | ||
var dynCall_iii = | var dynCall_iii = g.dynCall_iii = L("dynCall_iii", 3); | ||
g.dynCall_iiiii = L("dynCall_iiiii", 5); | g.dynCall_iiiii = L("dynCall_iiiii", 5); | ||
g.dynCall_iiiiii = L("dynCall_iiiiii", 6); | g.dynCall_iiiiii = L("dynCall_iiiiii", 6); | ||
Zeile 4.745: | Zeile 2.825: | ||
g.dynCall_viiiiii = L("dynCall_viiiiii", 7); | g.dynCall_viiiiii = L("dynCall_viiiiii", 7); | ||
g.dynCall_viiiii = L("dynCall_viiiii", 6); | g.dynCall_viiiii = L("dynCall_viiiii", 6); | ||
var mf = L("asyncify_start_unwind", 1), | var mf = L("asyncify_start_unwind", 1), bf = L("asyncify_stop_unwind", 0), lf = L("asyncify_start_rewind", 1), nf = L("asyncify_stop_rewind", 0); | ||
"writeI53ToI64 writeI53ToI64Clamped writeI53ToI64Signaling writeI53ToU64Clamped writeI53ToU64Signaling readI53FromI64 readI53FromU64 convertI32PairToI53 convertI32PairToI53Checked convertU32PairToI53 getTempRet0 setTempRet0 growMemory inetPton4 inetNtop4 inetPton6 inetNtop6 readSockaddr writeSockaddr emscriptenLog readEmAsmArgs jstoi_q listenOnce autoResumeAudioContext dynCallLegacy getDynCaller dynCall asmjsMangle HandleAllocator getNativeTypeSize STACK_SIZE STACK_ALIGN POINTER_SIZE ASSERTIONS getCFunc ccall cwrap uleb128Encode generateFuncType convertJsFunctionToWasm getEmptyTableSlot updateTableMap getFunctionAddress addFunction removeFunction reallyNegative unSign strLen reSign formatString intArrayToString AsciiToString UTF16ToString stringToUTF16 lengthBytesUTF16 UTF32ToString stringToUTF32 lengthBytesUTF32 stringToUTF8OnStack writeArrayToMemory registerKeyEventCallback maybeCStringToJsString findEventTarget getBoundingClientRect fillMouseEventData registerMouseEventCallback registerWheelEventCallback registerUiEventCallback registerFocusEventCallback fillDeviceOrientationEventData registerDeviceOrientationEventCallback fillDeviceMotionEventData registerDeviceMotionEventCallback screenOrientation fillOrientationChangeEventData registerOrientationChangeEventCallback fillFullscreenChangeEventData registerFullscreenChangeEventCallback JSEvents_requestFullscreen JSEvents_resizeCanvasForFullscreen registerRestoreOldStyle hideEverythingExceptGivenElement restoreHiddenElements setLetterbox softFullscreenResizeWebGLRenderTarget doRequestFullscreen fillPointerlockChangeEventData registerPointerlockChangeEventCallback registerPointerlockErrorEventCallback requestPointerLock fillVisibilityChangeEventData registerVisibilityChangeEventCallback registerTouchEventCallback fillGamepadEventData registerGamepadEventCallback registerBeforeUnloadEventCallback fillBatteryEventData battery registerBatteryEventCallback setCanvasElementSizeCallingThread setCanvasElementSizeMainThread setCanvasElementSize getCanvasSizeCallingThread getCanvasSizeMainThread getCanvasElementSize jsStackTrace getCallstack convertPCtoSourceLocation checkWasiClock wasiRightsToMuslOFlags wasiOFlagsToMuslOFlags setImmediateWrapped safeRequestAnimationFrame clearImmediateWrapped polyfillSetImmediate registerPostMainLoop registerPreMainLoop getPromise makePromise idsToPromises makePromiseCallback ExceptionInfo findMatchingCatch Browser_asyncPrepareDataCounter isLeapYear ydayFromDate arraySum addDays getSocketFromFD getSocketAddress FS_unlink FS_mkdirTree _setNetworkCallback heapObjectForWebGLType toTypedArrayIndex emscriptenWebGLGet computeUnpackAlignedImageSize colorChannelsInGlTextureFormat emscriptenWebGLGetTexPixelData emscriptenWebGLGetUniform webglGetUniformLocation webglPrepareUniformLocationsBeforeFirstUse webglGetLeftBracePos emscriptenWebGLGetVertexAttrib __glGetActiveAttribOrUniform writeGLArray emscripten_webgl_destroy_context_before_on_calling_thread registerWebGlEventCallback ALLOC_NORMAL ALLOC_STACK allocate writeStringToMemory writeAsciiToMemory setErrNo demangle stackTrace".split(" ").forEach(function(a) { | |||
Zb(a, () => { | |||
var b = `\`${a}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`, c = a; | |||
"writeI53ToI64 writeI53ToI64Clamped writeI53ToI64Signaling writeI53ToU64Clamped writeI53ToU64Signaling readI53FromI64 readI53FromU64 convertI32PairToI53 convertI32PairToI53Checked convertU32PairToI53 getTempRet0 setTempRet0 growMemory inetPton4 inetNtop4 inetPton6 inetNtop6 readSockaddr writeSockaddr emscriptenLog readEmAsmArgs jstoi_q listenOnce autoResumeAudioContext dynCallLegacy getDynCaller dynCall asmjsMangle HandleAllocator getNativeTypeSize STACK_SIZE STACK_ALIGN POINTER_SIZE ASSERTIONS getCFunc ccall cwrap uleb128Encode generateFuncType convertJsFunctionToWasm getEmptyTableSlot updateTableMap getFunctionAddress addFunction removeFunction reallyNegative unSign strLen reSign formatString intArrayToString AsciiToString UTF16ToString stringToUTF16 lengthBytesUTF16 UTF32ToString stringToUTF32 lengthBytesUTF32 stringToUTF8OnStack writeArrayToMemory registerKeyEventCallback maybeCStringToJsString findEventTarget getBoundingClientRect fillMouseEventData registerMouseEventCallback registerWheelEventCallback registerUiEventCallback registerFocusEventCallback fillDeviceOrientationEventData registerDeviceOrientationEventCallback fillDeviceMotionEventData registerDeviceMotionEventCallback screenOrientation fillOrientationChangeEventData registerOrientationChangeEventCallback fillFullscreenChangeEventData registerFullscreenChangeEventCallback JSEvents_requestFullscreen JSEvents_resizeCanvasForFullscreen registerRestoreOldStyle hideEverythingExceptGivenElement restoreHiddenElements setLetterbox softFullscreenResizeWebGLRenderTarget doRequestFullscreen fillPointerlockChangeEventData registerPointerlockChangeEventCallback registerPointerlockErrorEventCallback requestPointerLock fillVisibilityChangeEventData registerVisibilityChangeEventCallback registerTouchEventCallback fillGamepadEventData registerGamepadEventCallback registerBeforeUnloadEventCallback fillBatteryEventData battery registerBatteryEventCallback setCanvasElementSizeCallingThread setCanvasElementSizeMainThread setCanvasElementSize getCanvasSizeCallingThread getCanvasSizeMainThread getCanvasElementSize jsStackTrace getCallstack convertPCtoSourceLocation checkWasiClock wasiRightsToMuslOFlags wasiOFlagsToMuslOFlags setImmediateWrapped safeRequestAnimationFrame clearImmediateWrapped polyfillSetImmediate registerPostMainLoop registerPreMainLoop getPromise makePromise idsToPromises makePromiseCallback ExceptionInfo findMatchingCatch Browser_asyncPrepareDataCounter isLeapYear ydayFromDate arraySum addDays getSocketFromFD getSocketAddress FS_unlink FS_mkdirTree _setNetworkCallback heapObjectForWebGLType toTypedArrayIndex emscriptenWebGLGet computeUnpackAlignedImageSize colorChannelsInGlTextureFormat emscriptenWebGLGetTexPixelData emscriptenWebGLGetUniform webglGetUniformLocation webglPrepareUniformLocationsBeforeFirstUse webglGetLeftBracePos emscriptenWebGLGetVertexAttrib __glGetActiveAttribOrUniform writeGLArray emscripten_webgl_destroy_context_before_on_calling_thread registerWebGlEventCallback ALLOC_NORMAL ALLOC_STACK allocate writeStringToMemory writeAsciiToMemory setErrNo demangle stackTrace" | c.startsWith("_") || (c = "$" + a); | ||
b += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${c}')`; | |||
Yb(a) && (b += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"); | |||
N(b); | |||
}); | }); | ||
"run addOnPreRun addOnInit addOnPreMain addOnExit addOnPostRun addRunDependency removeRunDependency out err callMain abort wasmMemory wasmExports INT53_MAX INT53_MIN bigintToI53Checked stackSave stackRestore stackAlloc ptrToString zeroMemory exitJS getHeapMax abortOnCannotGrowMemory ENV ERRNO_CODES strError DNS Protocols Sockets timers warnOnce readEmAsmArgsArray jstoi_s getExecutableName handleException keepRuntimeAlive runtimeKeepalivePush runtimeKeepalivePop callUserCallback maybeExit asyncLoad alignMemory mmapAlloc wasmTable noExitRuntime sigToWasmTypes freeTableIndexes functionsInTableMap setValue getValue PATH PATH_FS UTF8Decoder UTF8ArrayToString UTF8ToString stringToUTF8Array stringToUTF8 lengthBytesUTF8 intArrayFromString stringToAscii UTF16Decoder stringToNewUTF8 JSEvents specialHTMLTargets findCanvasEventTarget currentFullscreenStrategy restoreOldWindowedStyle UNWIND_CACHE ExitStatus getEnvStrings doReadv doWritev initRandomFill randomFill safeSetTimeout promiseMap uncaughtExceptionCount exceptionLast exceptionCaught Browser getPreloadedImageData__data wget MONTH_DAYS_REGULAR MONTH_DAYS_LEAP MONTH_DAYS_REGULAR_CUMULATIVE MONTH_DAYS_LEAP_CUMULATIVE SYSCALLS preloadPlugins FS_createPreloadedFile FS_modeStringToFlags FS_getMode FS_stdin_getChar_buffer FS_stdin_getChar FS_createPath FS_createDevice FS_readFile FS FS_createDataFile FS_createLazyFile MEMFS TTY PIPEFS SOCKFS tempFixedLengthArray miniTempWebGLFloatBuffers miniTempWebGLIntBuffers webgl_enable_ANGLE_instanced_arrays webgl_enable_OES_vertex_array_object webgl_enable_WEBGL_draw_buffers webgl_enable_WEBGL_multi_draw webgl_enable_EXT_polygon_offset_clamp webgl_enable_EXT_clip_control webgl_enable_WEBGL_polygon_mode GL AL GLUT EGL GLEW IDBStore runAndAbortIfError Asyncify Fibers SDL SDL_gfx allocateUTF8 allocateUTF8OnStack print printErr PThread terminateWorker cleanupThread registerTLSInit spawnThread exitOnMainThread proxyToMainThread proxiedJSCallArgs invokeEntryPoint checkMailbox" | ac(a); | ||
}); | |||
"run addOnPreRun addOnInit addOnPreMain addOnExit addOnPostRun addRunDependency removeRunDependency out err callMain abort wasmMemory wasmExports INT53_MAX INT53_MIN bigintToI53Checked stackSave stackRestore stackAlloc ptrToString zeroMemory exitJS getHeapMax abortOnCannotGrowMemory ENV ERRNO_CODES strError DNS Protocols Sockets timers warnOnce readEmAsmArgsArray jstoi_s getExecutableName handleException keepRuntimeAlive runtimeKeepalivePush runtimeKeepalivePop callUserCallback maybeExit asyncLoad alignMemory mmapAlloc wasmTable noExitRuntime sigToWasmTypes freeTableIndexes functionsInTableMap setValue getValue PATH PATH_FS UTF8Decoder UTF8ArrayToString UTF8ToString stringToUTF8Array stringToUTF8 lengthBytesUTF8 intArrayFromString stringToAscii UTF16Decoder stringToNewUTF8 JSEvents specialHTMLTargets findCanvasEventTarget currentFullscreenStrategy restoreOldWindowedStyle UNWIND_CACHE ExitStatus getEnvStrings doReadv doWritev initRandomFill randomFill safeSetTimeout promiseMap uncaughtExceptionCount exceptionLast exceptionCaught Browser getPreloadedImageData__data wget MONTH_DAYS_REGULAR MONTH_DAYS_LEAP MONTH_DAYS_REGULAR_CUMULATIVE MONTH_DAYS_LEAP_CUMULATIVE SYSCALLS preloadPlugins FS_createPreloadedFile FS_modeStringToFlags FS_getMode FS_stdin_getChar_buffer FS_stdin_getChar FS_createPath FS_createDevice FS_readFile FS FS_createDataFile FS_createLazyFile MEMFS TTY PIPEFS SOCKFS tempFixedLengthArray miniTempWebGLFloatBuffers miniTempWebGLIntBuffers webgl_enable_ANGLE_instanced_arrays webgl_enable_OES_vertex_array_object webgl_enable_WEBGL_draw_buffers webgl_enable_WEBGL_multi_draw webgl_enable_EXT_polygon_offset_clamp webgl_enable_EXT_clip_control webgl_enable_WEBGL_polygon_mode GL AL GLUT EGL GLEW IDBStore runAndAbortIfError Asyncify Fibers SDL SDL_gfx allocateUTF8 allocateUTF8OnStack print printErr PThread terminateWorker cleanupThread registerTLSInit spawnThread exitOnMainThread proxyToMainThread proxiedJSCallArgs invokeEntryPoint checkMailbox".split(" ").forEach(ac); | |||
var qf; | var qf; | ||
ab = function rf() { | ab = function rf() { | ||
Zeile 4.774: | Zeile 2.844: | ||
function sf() { | function sf() { | ||
function a() { | function a() { | ||
if (!qf && | if (!qf && (qf = !0, g.calledRun = !0, !A)) { | ||
Ua(); | Ua(); | ||
n || Za(Ra); | n || Za(Ra); | ||
g.onRuntimeInitialized?.(); | |||
if (tf) { | if (tf) { | ||
t( | t(0 == K, 'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])'); | ||
t(0 == Pa.length, "cannot call main when preRun functions remain to be called"); | |||
t( | |||
Q += 1; | Q += 1; | ||
try { | try { | ||
Zeile 4.800: | Zeile 2.861: | ||
if (!n) { | if (!n) { | ||
if (g.postRun) { | if (g.postRun) { | ||
for ( | for ("function" == typeof g.postRun && (g.postRun = [g.postRun]); g.postRun.length;) { | ||
b = g.postRun.shift(), Sa.unshift(b); | |||
} | } | ||
} | } | ||
Zeile 4.818: | Zeile 2.875: | ||
t(!n); | t(!n); | ||
if (g.preRun) { | if (g.preRun) { | ||
for ( | for ("function" == typeof g.preRun && (g.preRun = [g.preRun]); g.preRun.length;) { | ||
Pa.unshift(g.preRun.shift()); | Pa.unshift(g.preRun.shift()); | ||
} | } | ||
} | } | ||
Za(Pa); | Za(Pa); | ||
0 < K || | 0 < K || (g.setStatus ? (g.setStatus("Running..."), setTimeout(() => { | ||
setTimeout(() => g.setStatus(""), 1); | |||
a(); | |||
}, 1)) : a()); | |||
} | } | ||
} | } | ||
} | } | ||
function sc() { | function sc() { | ||
var a = u, | var a = u, b = v, c = !1; | ||
u = v = () => { | u = v = () => { | ||
c = !0; | c = !0; | ||
}; | }; | ||
try { | try { | ||
pf(0), | pf(0), ["stdout", "stderr"].forEach(d => { | ||
d = "/dev/" + d; | |||
try { | |||
var e = W(d, {W:!0}); | |||
d = e.path; | |||
} catch (k) { | |||
} | |||
var f = {Wa:!1, exists:!1, error:0, name:null, path:null, object:null, eb:!1, gb:null, fb:null}; | |||
try { | |||
e = W(d, {parent:!0}), f.eb = !0, f.gb = e.path, f.fb = e.node, f.name = Ec(d), e = W(d, {W:!0}), f.exists = !0, f.path = e.path, f.object = e.node, f.name = e.node.name, f.Wa = "/" === e.path; | |||
} catch (k) { | |||
f.error = k.O; | |||
} | |||
f && re[f.object.rdev]?.output?.length && (c = !0); | |||
}); | |||
} catch (d) { | |||
} | |||
} catch (d) {} | |||
u = a; | u = a; | ||
v = b; | v = b; | ||
c && | c && N("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc."); | ||
} | } | ||
if (g.preInit) { | if (g.preInit) { | ||
for ( | for ("function" == typeof g.preInit && (g.preInit = [g.preInit]); 0 < g.preInit.length;) { | ||
g.preInit.pop()(); | g.preInit.pop()(); | ||
} | } | ||
Zeile 4.915: | Zeile 2.922: | ||
g.noInitialRun && (tf = !1); | g.noInitialRun && (tf = !1); | ||
sf(); | sf(); | ||
}()); |