-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
400 lines (394 loc) · 169 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
var Redot = (() => {
var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
return (
function(moduleArg = {}) {
var moduleRtn;
function m(){aa.buffer!=ba.buffer&&da();return ba}function n(){aa.buffer!=ba.buffer&&da();return ea}function fa(){aa.buffer!=ba.buffer&&da();return ha}function ia(){aa.buffer!=ba.buffer&&da();return ja}function p(){aa.buffer!=ba.buffer&&da();return ka}function r(){aa.buffer!=ba.buffer&&da();return la}function t(){aa.buffer!=ba.buffer&&da();return ma}function na(){aa.buffer!=ba.buffer&&da();return oa}var v=moduleArg,pa,qa,ra=new Promise((a,b)=>{pa=a;qa=b});
"__emscripten_thread_crashed ___indirect_function_table __Z14godot_web_mainiPPc __emwebxr_on_input_event __emwebxr_on_simple_event _main onRuntimeInitialized".split(" ").forEach(a=>{Object.getOwnPropertyDescriptor(ra,a)||Object.defineProperty(ra,a,{get:()=>sa("You are getting "+a+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>sa("You are setting "+a+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})});
var ta="object"==typeof window,ua="function"==typeof importScripts,va="object"==typeof process&&"object"==typeof process.Lc&&"string"==typeof process.Lc.node,wa=!ta&&!va&&!ua;if(v.ENVIRONMENT)throw Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var w=ua&&"em-pthread"==self.name;w&&(x(!globalThis.h,"module should only be loaded once on each pthread worker"),globalThis.h=!0);
var xa=Object.assign({},v),ya=[],za="./this.program",Aa=(a,b)=>{throw b;},Ba="",Ca,Da;
if(wa){if("object"==typeof process&&"function"===typeof require||"object"==typeof window||"function"==typeof importScripts)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?)");}else if(ta||ua){ua?Ba=self.location.href:"undefined"!=typeof document&&document.currentScript&&(Ba=document.currentScript.src);_scriptName&&(Ba=_scriptName);Ba.startsWith("blob:")?
Ba="":Ba=Ba.substr(0,Ba.replace(/[?#].*/,"").lastIndexOf("/")+1);if("object"!=typeof window&&"function"!=typeof importScripts)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?)");ua&&(Da=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});Ca=a=>{x(!Ea(a),"readAsync does not work with file:// URLs");
return fetch(a,{credentials:"same-origin"}).then(b=>b.ok?b.arrayBuffer():Promise.reject(Error(b.status+" : "+b.url)))}}else throw Error("environment detection error");var Fa=v.print||console.log.bind(console),A=v.printErr||console.error.bind(console);Object.assign(v,xa);xa=null;Object.getOwnPropertyDescriptor(v,"fetchSettings")&&sa("`Module.fetchSettings` was supplied but `fetchSettings` not included in INCOMING_MODULE_JS_API");v.arguments&&(ya=v.arguments);Ga("arguments","arguments_");
v.thisProgram&&(za=v.thisProgram);Ga("thisProgram","thisProgram");v.quit&&(Aa=v.quit);Ga("quit","quit_");x("undefined"==typeof v.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");x("undefined"==typeof v.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");x("undefined"==typeof v.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");
x("undefined"==typeof v.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead");x("undefined"==typeof v.read,"Module.read option was removed");x("undefined"==typeof v.readAsync,"Module.readAsync option was removed (modify readAsync in JS)");x("undefined"==typeof v.readBinary,"Module.readBinary option was removed (modify readBinary in JS)");x("undefined"==typeof v.setWindowTitle,"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)");
x("undefined"==typeof v.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");Ga("asm","wasmExports");Ga("readAsync","readAsync");Ga("readBinary","readBinary");Ga("setWindowTitle","setWindowTitle");x(ta||ua||va,"Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");x(!va,"node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable.");x(!wa,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");
if(w){var Ha,Ia=!1;function a(...c){console.error(c.join(" "))}v.printErr||(A=a);self.alert=function(...c){postMessage({tb:"alert",text:c.join(" "),Ad:Ja()})};v.instantiateWasm=(c,d)=>new Promise(e=>{Ha=f=>{f=new WebAssembly.Instance(f,Ka());d(f);e()}});self.onunhandledrejection=c=>{throw c.reason||c;};function b(c){try{var d=c.data,e=d.cmd;if("load"===e){let f=[];self.onmessage=g=>f.push(g);self.startWorker=()=>{postMessage({cmd:"loaded"});for(let g of f)b(g);self.onmessage=b};for(const g of d.handlers)if(!v[g]||
v[g].proxy)v[g]=(...k)=>{postMessage({tb:"callHandler",md:g,Qc:k})},"print"==g&&(Fa=v[g]),"printErr"==g&&(A=v[g]);aa=d.wasmMemory;da();Ha(d.wasmModule)}else if("run"===e){La(d.pthread_ptr,0,0,1,0,0);Ma(d.pthread_ptr);x(d.pthread_ptr);Na();Oa();Ia||=!0;try{Pa(d.start_routine,d.arg)}catch(f){if("unwind"!=f)throw f;}}else"cancel"===e?Ja()&&Qa(-1):"setimmediate"!==d.target&&("checkMailbox"===e?Ia&&Ra():e&&(A(`worker: received unknown command ${e}`),A(d)))}catch(f){throw A(`worker: onmessage() captured an uncaught exception: ${f}`),
f?.stack&&A(f.stack),Sa(),f;}}self.onmessage=b}var Ta;v.wasmBinary&&(Ta=v.wasmBinary);Ga("wasmBinary","wasmBinary");"object"!=typeof WebAssembly&&A("no native wasm support detected");var aa,Wa,Xa=!1,Ya;function x(a,b){a||sa("Assertion failed"+(b?": "+b:""))}var ba,ea,ha,ja,ka,la,ma,Za,oa;
function da(){var a=aa.buffer;v.HEAP8=ba=new Int8Array(a);v.HEAP16=ha=new Int16Array(a);v.HEAPU8=ea=new Uint8Array(a);v.HEAPU16=ja=new Uint16Array(a);v.HEAP32=ka=new Int32Array(a);v.HEAPU32=la=new Uint32Array(a);v.HEAPF32=ma=new Float32Array(a);v.HEAPF64=oa=new Float64Array(a);v.HEAP64=Za=new BigInt64Array(a);v.HEAPU64=new BigUint64Array(a)}x(!v.STACK_SIZE,"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time");
x("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");
if(!w){if(v.wasmMemory)aa=v.wasmMemory;else{var $a=v.INITIAL_MEMORY||33554432;Ga("INITIAL_MEMORY","INITIAL_MEMORY");x(5242880<=$a,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+$a+"! (STACK_SIZE=5242880)");aa=new WebAssembly.Memory({initial:$a/65536,maximum:32768,shared:!0});if(!(aa.buffer instanceof SharedArrayBuffer))throw A("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),
va&&A("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"),Error("bad memory");}da()}function ab(){var a=bb();x(0==(a&3));0==a&&(a+=4);r()[a>>2]=34821223;r()[a+4>>2]=2310721022;r()[0]=1668509029}
function cb(){if(!Xa){var a=bb();0==a&&(a+=4);var b=r()[a>>2],c=r()[a+4>>2];34821223==b&&2310721022==c||sa(`Stack overflow! Stack cookie has been overwritten at ${db(a)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${db(c)} ${db(b)}`);1668509029!=r()[0]&&sa("Runtime error: The application has corrupted its heap memory area (address zero)!")}}var eb=new Int16Array(1),fb=new Int8Array(eb.buffer);eb[0]=25459;
if(115!==fb[0]||99!==fb[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";var gb=[],hb=[],ib=[],jb=[],kb=[],lb=!1,mb=!1;
function nb(){x(!lb);lb=!0;if(!w){cb();if(!v.noFSInit&&!ob){x(!ob,"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)");ob=!0;v.stdin=v.stdin;v.stdout=v.stdout;v.stderr=v.stderr;v.stdin?pb("stdin",v.stdin):qb("/dev/tty","/dev/stdin");v.stdout?pb("stdout",null,v.stdout):qb("/dev/tty","/dev/stdout");v.stderr?pb("stderr",null,v.stderr):qb("/dev/tty1","/dev/stderr");var a=rb("/dev/stdin",
0),b=rb("/dev/stdout",1),c=rb("/dev/stderr",1);x(0===a.u,`invalid handle for stdin (${a.u})`);x(1===b.u,`invalid handle for stdout (${b.u})`);x(2===c.u,`invalid handle for stderr (${c.u})`)}sb=!1;tb.root=ub(tb,null);vb(hb)}}x(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");x(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");
x(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");x(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var wb=0,xb=null,yb=null,Ab={};
function Bb(a){wb++;v.monitorRunDependencies?.(wb);a?(x(!Ab[a]),Ab[a]=1,null===xb&&"undefined"!=typeof setInterval&&(xb=setInterval(()=>{if(Xa)clearInterval(xb),xb=null;else{var b=!1,c;for(c in Ab)b||(b=!0,A("still waiting on run dependencies:")),A(`dependency: ${c}`);b&&A("(end of list)")}},1E4))):A("warning: run dependency added without ID")}
function Cb(a){wb--;v.monitorRunDependencies?.(wb);a?(x(Ab[a]),delete Ab[a]):A("warning: run dependency removed without ID");0==wb&&(null!==xb&&(clearInterval(xb),xb=null),yb&&(a=yb,yb=null,a()))}function sa(a){v.onAbort?.(a);a="Aborted("+a+")";A(a);Xa=!0;Ya=1;a=new WebAssembly.RuntimeError(a);qa(a);throw a;}var Db=a=>a.startsWith("data:application/octet-stream;base64,"),Ea=a=>a.startsWith("file://");
function Eb(a,b){return(...c)=>{x(lb,`native function \`${a}\` called before runtime initialization`);x(!mb,`native function \`${a}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`);var d=Fb[a];x(d,`exported native function \`${a}\` not found`);x(c.length<=b,`native function \`${a}\` called with ${c.length} args but expects ${b}`);return d(...c)}}var Gb;
function Hb(a){if(a==Gb&&Ta)return new Uint8Array(Ta);if(Da)return Da(a);throw"both async and sync fetching of the wasm failed";}function Ib(a){return Ta?Promise.resolve().then(()=>Hb(a)):Ca(a).then(b=>new Uint8Array(b),()=>Hb(a))}
function Jb(a,b,c){return Ib(a).then(d=>WebAssembly.instantiate(d,b)).then(c,d=>{A(`failed to asynchronously prepare wasm: ${d}`);Ea(Gb)&&A(`warning: Loading from a file URI (${Gb}) 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`);sa(d)})}
function Kb(a,b){var c=Gb;return Ta||"function"!=typeof WebAssembly.instantiateStreaming||Db(c)||"function"!=typeof fetch?Jb(c,a,b):fetch(c,{credentials:"same-origin"}).then(d=>WebAssembly.instantiateStreaming(d,a).then(b,function(e){A(`wasm streaming compile failed: ${e}`);A("falling back to ArrayBuffer instantiation");return Jb(c,a,b)}))}
function Ka(){Lb={__assert_fail:Mb,__call_sighandler:Nb,__pthread_create_js:Ob,__syscall__newselect:Pb,__syscall_accept4:Qb,__syscall_bind:Rb,__syscall_chdir:Sb,__syscall_chmod:Tb,__syscall_connect:Ub,__syscall_faccessat:Vb,__syscall_fchmod:Wb,__syscall_fcntl64:Xb,__syscall_fstat64:Yb,__syscall_ftruncate64:Zb,__syscall_getcwd:ac,__syscall_getdents64:bc,__syscall_getsockname:cc,__syscall_getsockopt:dc,__syscall_ioctl:ec,__syscall_listen:fc,__syscall_lstat64:gc,__syscall_mkdirat:hc,__syscall_mknodat:ic,
__syscall_newfstatat:jc,__syscall_openat:kc,__syscall_poll:lc,__syscall_readlinkat:mc,__syscall_recvfrom:nc,__syscall_renameat:oc,__syscall_rmdir:pc,__syscall_sendto:qc,__syscall_socket:rc,__syscall_stat64:sc,__syscall_statfs64:tc,__syscall_symlink:uc,__syscall_unlinkat:vc,_abort_js:wc,_emscripten_get_now_is_monotonic:xc,_emscripten_init_main_thread_js:yc,_emscripten_notify_mailbox_postmessage:zc,_emscripten_proxied_gl_context_activated_from_main_browser_thread:Ac,_emscripten_receive_on_main_thread_js:Bc,
_emscripten_runtime_keepalive_clear:Cc,_emscripten_thread_cleanup:Dc,_emscripten_thread_mailbox_await:Ma,_emscripten_thread_set_strongref:Ec,_gmtime_js:Fc,_localtime_js:Gc,_tzset_js:Hc,emscripten_cancel_main_loop:Ic,emscripten_check_blocking_allowed:Jc,emscripten_date_now:Kc,emscripten_err:Lc,emscripten_exit_with_live_runtime:Mc,emscripten_force_exit:Nc,emscripten_get_heap_max:Oc,emscripten_get_now:Pc,emscripten_glActiveTexture:Qc,emscripten_glAttachShader:Rc,emscripten_glBeginTransformFeedback:Sc,
emscripten_glBindBuffer:Tc,emscripten_glBindBufferBase:Uc,emscripten_glBindBufferRange:Vc,emscripten_glBindFramebuffer:Wc,emscripten_glBindRenderbuffer:Xc,emscripten_glBindTexture:Yc,emscripten_glBindVertexArray:Zc,emscripten_glBlendColor:$c,emscripten_glBlendEquation:ad,emscripten_glBlendFunc:bd,emscripten_glBlendFuncSeparate:cd,emscripten_glBlitFramebuffer:dd,emscripten_glBufferData:ed,emscripten_glBufferSubData:fd,emscripten_glCheckFramebufferStatus:gd,emscripten_glClear:hd,emscripten_glClearBufferfv:jd,
emscripten_glClearColor:kd,emscripten_glClearDepthf:ld,emscripten_glColorMask:md,emscripten_glCompileShader:nd,emscripten_glCompressedTexImage2D:od,emscripten_glCompressedTexImage3D:pd,emscripten_glCompressedTexSubImage3D:qd,emscripten_glCopyBufferSubData:rd,emscripten_glCreateProgram:sd,emscripten_glCreateShader:td,emscripten_glCullFace:ud,emscripten_glDeleteBuffers:vd,emscripten_glDeleteFramebuffers:wd,emscripten_glDeleteProgram:xd,emscripten_glDeleteQueries:yd,emscripten_glDeleteRenderbuffers:zd,
emscripten_glDeleteShader:Ad,emscripten_glDeleteSync:Bd,emscripten_glDeleteTextures:Cd,emscripten_glDeleteVertexArrays:Dd,emscripten_glDepthFunc:Ed,emscripten_glDepthMask:Fd,emscripten_glDisable:Gd,emscripten_glDisableVertexAttribArray:Hd,emscripten_glDrawArrays:Id,emscripten_glDrawArraysInstanced:Jd,emscripten_glDrawBuffers:Kd,emscripten_glDrawElements:Ld,emscripten_glDrawElementsInstanced:Md,emscripten_glEnable:Nd,emscripten_glEnableVertexAttribArray:Od,emscripten_glEndTransformFeedback:Pd,emscripten_glFenceSync:Qd,
emscripten_glFinish:Rd,emscripten_glFramebufferRenderbuffer:Sd,emscripten_glFramebufferTexture2D:Td,emscripten_glFramebufferTextureLayer:Ud,emscripten_glFrontFace:Vd,emscripten_glGenBuffers:Wd,emscripten_glGenFramebuffers:Xd,emscripten_glGenQueries:Yd,emscripten_glGenRenderbuffers:$d,emscripten_glGenTextures:ae,emscripten_glGenVertexArrays:be,emscripten_glGenerateMipmap:ce,emscripten_glGetFloatv:de,emscripten_glGetInteger64v:ee,emscripten_glGetIntegerv:fe,emscripten_glGetProgramInfoLog:ge,emscripten_glGetProgramiv:he,
emscripten_glGetShaderInfoLog:ie,emscripten_glGetShaderiv:je,emscripten_glGetString:ke,emscripten_glGetSynciv:le,emscripten_glGetUniformBlockIndex:me,emscripten_glGetUniformLocation:ne,emscripten_glLinkProgram:oe,emscripten_glPixelStorei:pe,emscripten_glReadBuffer:qe,emscripten_glReadPixels:re,emscripten_glRenderbufferStorage:se,emscripten_glRenderbufferStorageMultisample:te,emscripten_glScissor:ue,emscripten_glShaderSource:ve,emscripten_glTexImage2D:we,emscripten_glTexImage3D:xe,emscripten_glTexParameterf:ye,
emscripten_glTexParameteri:ze,emscripten_glTexStorage2D:Ae,emscripten_glTexSubImage3D:Be,emscripten_glTransformFeedbackVaryings:Ce,emscripten_glUniform1f:De,emscripten_glUniform1i:Ee,emscripten_glUniform1iv:Fe,emscripten_glUniform1ui:Ge,emscripten_glUniform1uiv:He,emscripten_glUniform2f:Ie,emscripten_glUniform2fv:Je,emscripten_glUniform2iv:Ke,emscripten_glUniform3fv:Le,emscripten_glUniform4f:Me,emscripten_glUniform4fv:Ne,emscripten_glUniformBlockBinding:Oe,emscripten_glUniformMatrix3fv:Pe,emscripten_glUniformMatrix4fv:Qe,
emscripten_glUseProgram:Re,emscripten_glVertexAttrib4f:Se,emscripten_glVertexAttribDivisor:Te,emscripten_glVertexAttribI4ui:Ue,emscripten_glVertexAttribIPointer:Ve,emscripten_glVertexAttribPointer:We,emscripten_glViewport:Xe,emscripten_num_logical_cores:Ye,emscripten_resize_heap:Ze,emscripten_set_canvas_element_size:$e,emscripten_set_main_loop:af,emscripten_supports_offscreencanvas:bf,emscripten_webgl_destroy_context:cf,emscripten_webgl_do_commit_frame:df,emscripten_webgl_do_create_context:ef,emscripten_webgl_enable_extension:ff,
emscripten_webgl_get_supported_extensions:gf,emscripten_webgl_make_context_current_calling_thread:hf,environ_get:jf,environ_sizes_get:kf,exit:lf,fd_close:mf,fd_fdstat_get:nf,fd_read:of,fd_seek:pf,fd_write:qf,getaddrinfo:rf,getnameinfo:sf,godot_audio_get_sample_playback_position:tf,godot_audio_has_worklet:uf,godot_audio_init:vf,godot_audio_input_start:wf,godot_audio_input_stop:xf,godot_audio_is_available:yf,godot_audio_resume:zf,godot_audio_sample_bus_add:Af,godot_audio_sample_bus_move:Bf,godot_audio_sample_bus_remove:Cf,
godot_audio_sample_bus_set_count:Df,godot_audio_sample_bus_set_mute:Ef,godot_audio_sample_bus_set_send:Ff,godot_audio_sample_bus_set_solo:Gf,godot_audio_sample_bus_set_volume_db:Hf,godot_audio_sample_is_active:If,godot_audio_sample_register_stream:Jf,godot_audio_sample_set_finished_callback:Kf,godot_audio_sample_set_pause:Lf,godot_audio_sample_set_volumes_linear:Mf,godot_audio_sample_start:Nf,godot_audio_sample_stop:Of,godot_audio_sample_stream_is_registered:Pf,godot_audio_sample_unregister_stream:Qf,
godot_audio_sample_update_pitch_scale:Rf,godot_audio_worklet_create:Sf,godot_audio_worklet_start:Tf,godot_audio_worklet_state_add:Uf,godot_audio_worklet_state_get:Vf,godot_audio_worklet_state_wait:Wf,godot_js_config_canvas_id_get:Xf,godot_js_config_locale_get:Yf,godot_js_display_alert:Zf,godot_js_display_canvas_focus:$f,godot_js_display_canvas_is_focused:ag,godot_js_display_clipboard_get:bg,godot_js_display_clipboard_set:cg,godot_js_display_cursor_is_hidden:dg,godot_js_display_cursor_is_locked:eg,
godot_js_display_cursor_lock_set:fg,godot_js_display_cursor_set_custom_shape:gg,godot_js_display_cursor_set_shape:hg,godot_js_display_cursor_set_visible:ig,godot_js_display_desired_size_set:jg,godot_js_display_fullscreen_cb:kg,godot_js_display_fullscreen_exit:lg,godot_js_display_fullscreen_request:mg,godot_js_display_has_webgl:ng,godot_js_display_is_swap_ok_cancel:og,godot_js_display_notification_cb:pg,godot_js_display_pixel_ratio_get:qg,godot_js_display_screen_dpi_get:rg,godot_js_display_screen_size_get:sg,
godot_js_display_setup_canvas:tg,godot_js_display_size_update:ug,godot_js_display_touchscreen_is_available:vg,godot_js_display_tts_available:wg,godot_js_display_vk_available:xg,godot_js_display_vk_cb:yg,godot_js_display_vk_hide:zg,godot_js_display_vk_show:Ag,godot_js_display_window_blur_cb:Bg,godot_js_display_window_icon_set:Cg,godot_js_display_window_size_get:Dg,godot_js_display_window_title_set:Eg,godot_js_eval:Fg,godot_js_fetch_create:Gg,godot_js_fetch_free:Hg,godot_js_fetch_http_status_get:Ig,
godot_js_fetch_is_chunked:Jg,godot_js_fetch_read_chunk:Kg,godot_js_fetch_read_headers:Lg,godot_js_fetch_state_get:Mg,godot_js_input_drop_files_cb:Ng,godot_js_input_gamepad_cb:Og,godot_js_input_gamepad_sample:Pg,godot_js_input_gamepad_sample_count:Qg,godot_js_input_gamepad_sample_get:Rg,godot_js_input_key_cb:Sg,godot_js_input_mouse_button_cb:Tg,godot_js_input_mouse_move_cb:Ug,godot_js_input_mouse_wheel_cb:Vg,godot_js_input_paste_cb:Wg,godot_js_input_touch_cb:Xg,godot_js_input_vibrate_handheld:Yg,godot_js_is_ime_focused:Zg,
godot_js_os_download_buffer:$g,godot_js_os_execute:ah,godot_js_os_finish_async:bh,godot_js_os_fs_is_persistent:ch,godot_js_os_fs_sync:dh,godot_js_os_has_feature:eh,godot_js_os_hw_concurrency_get:fh,godot_js_os_request_quit_cb:gh,godot_js_os_shell_open:hh,godot_js_pwa_cb:ih,godot_js_pwa_update:jh,godot_js_rtc_datachannel_close:kh,godot_js_rtc_datachannel_connect:lh,godot_js_rtc_datachannel_destroy:mh,godot_js_rtc_datachannel_get_buffered_amount:nh,godot_js_rtc_datachannel_id_get:oh,godot_js_rtc_datachannel_is_negotiated:ph,
godot_js_rtc_datachannel_is_ordered:qh,godot_js_rtc_datachannel_label_get:rh,godot_js_rtc_datachannel_max_packet_lifetime_get:sh,godot_js_rtc_datachannel_max_retransmits_get:th,godot_js_rtc_datachannel_protocol_get:uh,godot_js_rtc_datachannel_ready_state_get:vh,godot_js_rtc_datachannel_send:wh,godot_js_rtc_pc_close:xh,godot_js_rtc_pc_create:yh,godot_js_rtc_pc_datachannel_create:zh,godot_js_rtc_pc_destroy:Ah,godot_js_rtc_pc_ice_candidate_add:Bh,godot_js_rtc_pc_local_description_set:Ch,godot_js_rtc_pc_offer_create:Dh,
godot_js_rtc_pc_remote_description_set:Eh,godot_js_set_ime_active:Fh,godot_js_set_ime_cb:Gh,godot_js_set_ime_position:Hh,godot_js_tts_get_voices:Ih,godot_js_tts_is_paused:Jh,godot_js_tts_is_speaking:Kh,godot_js_tts_pause:Lh,godot_js_tts_resume:Mh,godot_js_tts_speak:Nh,godot_js_tts_stop:Oh,godot_js_websocket_buffered_amount:Ph,godot_js_websocket_close:Qh,godot_js_websocket_create:Rh,godot_js_websocket_destroy:Sh,godot_js_websocket_send:Th,godot_js_wrapper_create_cb:Uh,godot_js_wrapper_create_object:Vh,
godot_js_wrapper_interface_get:Wh,godot_js_wrapper_object_call:Xh,godot_js_wrapper_object_get:Yh,godot_js_wrapper_object_getvar:Zh,godot_js_wrapper_object_is_buffer:$h,godot_js_wrapper_object_set:ai,godot_js_wrapper_object_set_cb_ret:bi,godot_js_wrapper_object_setvar:ci,godot_js_wrapper_object_transfer_buffer:di,godot_js_wrapper_object_unref:ei,godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR:fi,godot_webgl2_glFramebufferTextureMultiviewOVR:gi,godot_webgl2_glGetBufferSubData:hi,godot_webxr_get_bounds_geometry:ii,
godot_webxr_get_color_texture:ji,godot_webxr_get_depth_texture:ki,godot_webxr_get_frame_rate:li,godot_webxr_get_projection_for_view:mi,godot_webxr_get_render_target_size:ni,godot_webxr_get_supported_frame_rates:oi,godot_webxr_get_transform_for_view:pi,godot_webxr_get_velocity_texture:qi,godot_webxr_get_view_count:ri,godot_webxr_get_visibility_state:si,godot_webxr_initialize:ti,godot_webxr_is_session_supported:ui,godot_webxr_is_supported:vi,godot_webxr_uninitialize:wi,godot_webxr_update_input_source:xi,
godot_webxr_update_target_frame_rate:yi,memory:aa,proc_exit:zi};return{env:Lb,wasi_snapshot_preview1:Lb}}function Ga(a,b){Object.getOwnPropertyDescriptor(v,a)||Object.defineProperty(v,a,{configurable:!0,get(){sa(`\`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 Ai(a){return"FS_createPath"===a||"FS_createDataFile"===a||"FS_createPreloadedFile"===a||"FS_unlink"===a||"addRunDependency"===a||"FS_createLazyFile"===a||"FS_createDevice"===a||"removeRunDependency"===a}function Bi(a,b){"undefined"!=typeof globalThis&&Object.defineProperty(globalThis,a,{configurable:!0,get(){Ci(`\`${a}\` is not longer defined by emscripten. ${b}`)}})}Bi("buffer","Please use HEAP8.buffer or wasmMemory.buffer");Bi("asm","Please use wasmExports instead");
function Di(a){w||Object.getOwnPropertyDescriptor(v,a)||Object.defineProperty(v,a,{configurable:!0,get(){var b=`'${a}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;Ai(a)&&(b+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you");sa(b)}})}function Ei(a){this.name="ExitStatus";this.message=`Program terminated with exit(${a})`;this.status=a}
var Fi=a=>{a.terminate();a.onmessage=b=>{A(`received "${b.data.cmd}" command from terminated worker: ${a.Mb}`)}},Ki=a=>{x(!w,"Internal Error! cleanupThread() can only ever be called from main application thread!");x(a,"Internal Error! Null pthread_ptr in cleanupThread!");a=Gi[a];x(a);var b=a.L;delete Gi[b];Hi.push(a);Ii.splice(Ii.indexOf(a),1);a.L=0;Ji(b)},Ni=a=>{x(!w,"Internal Error! spawnThread() can only ever be called from main application thread!");x(a.L,"Internal error, no pthread ptr!");0==
Hi.length&&(A("Tried to spawn a new thread, but the thread pool is exhausted.\nThis might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.\nIf you want to increase the pool size, use setting `-sPTHREAD_POOL_SIZE=...`.\nIf you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting `-sPTHREAD_POOL_SIZE_STRICT=2`."),Li(),Mi(Hi[0]));var b=Hi.pop();if(!b)return 6;x(!b.L,"Internal error!");Ii.push(b);Gi[a.L]=
b;b.L=a.L;b.postMessage({cmd:"run",start_routine:a.Fc,arg:a.qb,pthread_ptr:a.L},a.Jc);return 0},Oi=0,C=(a,b,...c)=>{for(var d=2*c.length,e=Pi(),f=Qi(8*d),g=f>>3,k=0;k<c.length;k++){var l=c[k];"bigint"==typeof l?(Za[g+2*k]=1n,Za[g+2*k+1]=l):(Za[g+2*k]=0n,na()[g+2*k+1]=l)}a=Ri(a,0,d,f,b);Si(e);return a};function zi(a){if(w)return C(0,1,a);Ya=a;Ti||0<Oi||(Ui(),v.onExit?.(a),Xa=!0);Aa(a,new Ei(a))}
var Vi=a=>{if(a instanceof Ei||"unwind"==a)return Ya;cb();a instanceof WebAssembly.RuntimeError&&0>=Pi()&&A("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 5242880)");Aa(1,a)};function Wi(a){if(w)return C(1,0,a);lf(a)}
var lf=(a,b)=>{Ya=a;if(w)throw x(!b),Wi(a),"unwind";if(!(Ti||0<Oi||(x(!mb),cb(),w))){Xi();vb(jb);ob=!1;Yi(0);for(var c=0;c<Zi.length;c++){var d=Zi[c];d&&$i(d)}D.yc();Ui();mb=!0}(Ti||0<Oi)&&!b&&(b=`program exited (with status: ${a}), but keepRuntimeAlive() is set (counter=${Oi}) 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)`,qa(b),A(b));zi(a)},db=a=>{x("number"===
typeof a);return"0x"+(a>>>0).toString(16).padStart(8,"0")},Hi=[],Ii=[],aj=[],Gi={},bj=1;function cj(){for(var a=8;a--;)Li();gb.unshift(()=>{Bb("loading-workers");dj(()=>Cb("loading-workers"))})}var Ui=()=>{x(!w,"Internal Error! terminateAllThreads() can only ever be called from main application thread!");for(var a of Ii)Fi(a);for(a of Hi)Fi(a);Hi=[];Ii=[];Gi=[]};function Oa(){aj.forEach(a=>a())}
var Mi=a=>new Promise(b=>{a.onmessage=f=>{f=f.data;var g=f.cmd;if(f.targetThread&&f.targetThread!=Ja()){var k=Gi[f.targetThread];k?k.postMessage(f,f.transferList):A(`Internal error! Worker sent a message "${g}" to target pthread ${f.targetThread}, but that thread no longer exists!`)}else if("checkMailbox"===g)Ra();else if("spawnThread"===g)Ni(f);else if("cleanupThread"===g)Ki(f.thread);else if("killThread"===g)f=f.thread,x(!w,"Internal Error! killThread() can only ever be called from main application thread!"),
x(f,"Internal Error! Null pthread_ptr in killThread!"),g=Gi[f],delete Gi[f],Fi(g),Ji(f),Ii.splice(Ii.indexOf(g),1),g.L=0;else if("cancelThread"===g)f=f.thread,x(!w,"Internal Error! cancelThread() can only ever be called from main application thread!"),x(f,"Internal Error! Null pthread_ptr in cancelThread!"),Gi[f].postMessage({cmd:"cancel"});else if("loaded"===g)a.loaded=!0,b(a);else if("alert"===g)alert(`Thread ${f.threadId}: ${f.text}`);else if("setimmediate"===f.target)a.postMessage(f);else if("callHandler"===
g)v[f.handler](...f.args);else g&&A(`worker sent an unknown command ${g}`)};a.onerror=f=>{var g="worker sent an error!";a.L&&(g=`Pthread ${db(a.L)} sent an error!`);A(`${g} ${f.filename}:${f.lineno}: ${f.message}`);throw f;};x(aa instanceof WebAssembly.Memory,"WebAssembly memory should have been loaded by now!");x(Wa instanceof WebAssembly.Module,"WebAssembly Module should have been loaded by now!");var c=[],d=["onExit","onAbort","print","printErr"],e;for(e of d)v.propertyIsEnumerable(e)&&c.push(e);
a.Mb=bj++;a.postMessage({cmd:"load",handlers:c,wasmMemory:aa,wasmModule:Wa,workerID:a.Mb})});function dj(a){w?a():Promise.all(Hi.map(Mi)).then(a)}function Li(){var a=_scriptName;v.mainScriptUrlOrBlob&&(a=v.mainScriptUrlOrBlob,"string"!=typeof a&&(a=URL.createObjectURL(a)));a=new Worker(a,{name:"em-pthread"});Hi.push(a)}var vb=a=>{for(;0<a.length;)a.shift()(v)},Na=()=>{var a=Ja(),b=r()[a+52>>2];a=r()[a+56>>2];a=b-a;x(0!=b);x(0!=a);x(b>a,"stackHigh must be higher then stackLow");ej(b,a);Si(b);ab()};
function fj(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return m()[a];case "i8":return m()[a];case "i16":return fa()[a>>1];case "i32":return p()[a>>2];case "i64":return Za[a>>3];case "float":return t()[a>>2];case "double":return na()[a>>3];case "*":return r()[a>>2];default:sa(`invalid type for getValue: ${b}`)}}var gj,Pa=(a,b)=>{Oi=0;a=gj.get(a)(b);cb();Ti||0<Oi?Ya=a:Qa(a)},Ti=v.noExitRuntime||!1;
function E(a,b,c="i8"){c.endsWith("*")&&(c="*");switch(c){case "i1":m()[a]=b;break;case "i8":m()[a]=b;break;case "i16":fa()[a>>1]=b;break;case "i32":p()[a>>2]=b;break;case "i64":Za[a>>3]=BigInt(b);break;case "float":t()[a>>2]=b;break;case "double":na()[a>>3]=b;break;case "*":r()[a>>2]=b;break;default:sa(`invalid type for setValue: ${c}`)}}
var Ci=a=>{Ci.ib||(Ci.ib={});Ci.ib[a]||(Ci.ib[a]=1,A(a))},hj="undefined"!=typeof TextDecoder?new TextDecoder:void 0,ij=(a,b,c)=>{var d=b+c;for(c=b;a[c]&&!(c>=d);)++c;if(16<c-b&&a.buffer&&hj)return hj.decode(a.buffer instanceof SharedArrayBuffer?a.slice(b,c):a.subarray(b,c));for(d="";b<c;){var e=a[b++];if(e&128){var f=a[b++]&63;if(192==(e&224))d+=String.fromCharCode((e&31)<<6|f);else{var g=a[b++]&63;224==(e&240)?e=(e&15)<<12|f<<6|g:(240!=(e&248)&&Ci("Invalid UTF-8 leading byte "+db(e)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),
e=(e&7)<<18|f<<12|g<<6|a[b++]&63);65536>e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|e>>10,56320|e&1023))}}else d+=String.fromCharCode(e)}return d},F=(a,b)=>{x("number"==typeof a,`UTF8ToString expects a number (got ${typeof a})`);return a?ij(n(),a,b):""},Mb=(a,b,c,d)=>{sa(`Assertion failed: ${F(a)}, at: `+[b?F(b):"unknown filename",c,d?F(d):"unknown function"])},Nb=(a,b)=>gj.get(a)(b);function jj(a,b,c,d){return w?C(2,1,a,b,c,d):Ob(a,b,c,d)}
var Ob=(a,b,c,d)=>{if("undefined"==typeof SharedArrayBuffer)return A("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var e=[];if(w&&0===e.length)return jj(a,b,c,d);a={Fc:c,L:a,qb:d,Jc:e};return w?(a.tb="spawnThread",postMessage(a,e),0):Ni(a)},kj=(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},lj=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);
(a=kj(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},mj=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},nj=a=>{if("/"===a)return"/";a=lj(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)},oj=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return a=>(a.set(crypto.getRandomValues(new Uint8Array(a.byteLength))),
a);sa("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 } };")},pj=a=>(pj=oj())(a),rj=(...a)=>{for(var b="",c=!1,d=a.length-1;-1<=d&&!c;d--){c=0<=d?a[d]:qj;if("string"!=typeof c)throw new TypeError("Arguments to path.resolve must be strings");if(!c)return"";b=c+"/"+b;c="/"===
c.charAt(0)}b=kj(b.split("/").filter(e=>!!e),!c).join("/");return(c?"/":"")+b||"."},sj=(a,b)=>{function c(g){for(var k=0;k<g.length&&""===g[k];k++);for(var l=g.length-1;0<=l&&""===g[l];l--);return k>l?[]:g.slice(k,l-k+1)}a=rj(a).substr(1);b=rj(b).substr(1);a=c(a.split("/"));b=c(b.split("/"));for(var d=Math.min(a.length,b.length),e=d,f=0;f<d;f++)if(a[f]!==b[f]){e=f;break}d=[];for(f=e;f<a.length;f++)d.push("..");d=d.concat(b.slice(e));return d.join("/")},tj=[],uj=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},vj=(a,b,c,d)=>{x("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 g=a.charCodeAt(f);if(55296<=g&&57343>=g){var k=a.charCodeAt(++f);g=65536+((g&1023)<<10)|k&1023}if(127>=g){if(c>=d)break;b[c++]=g}else{if(2047>=g){if(c+1>=d)break;b[c++]=192|g>>6}else{if(65535>=g){if(c+2>=d)break;b[c++]=224|g>>12}else{if(c+3>=d)break;1114111<
g&&Ci("Invalid Unicode code point "+db(g)+" 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|g>>18;b[c++]=128|g>>12&63}b[c++]=128|g>>6&63}b[c++]=128|g&63}}b[c]=0;return c-e},wj=[];function xj(a,b){wj[a]={input:[],F:[],W:b};yj(a,zj)}
var zj={open(a){var b=wj[a.node.Ca];if(!b)throw new G(43);a.o=b;a.seekable=!1},close(a){a.o.W.Ka(a.o)},Ka(a){a.o.W.Ka(a.o)},read(a,b,c,d){if(!a.o||!a.o.W.yb)throw new G(60);for(var e=0,f=0;f<d;f++){try{var g=a.o.W.yb(a.o)}catch(k){throw new G(29);}if(void 0===g&&0===e)throw new G(6);if(null===g||void 0===g)break;e++;b[c+f]=g}e&&(a.node.timestamp=Date.now());return e},write(a,b,c,d){if(!a.o||!a.o.W.cb)throw new G(60);try{for(var e=0;e<d;e++)a.o.W.cb(a.o,b[c+e])}catch(f){throw new G(29);}d&&(a.node.timestamp=
Date.now());return e}},Aj={yb(){a:{if(!tj.length){var a=null;"undefined"!=typeof window&&"function"==typeof window.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){var b=null;break a}b=Array(uj(a)+1);a=vj(a,b,0,b.length);b.length=a;tj=b}b=tj.shift()}return b},cb(a,b){null===b||10===b?(Fa(ij(a.F,0)),a.F=[]):0!=b&&a.F.push(b)},Ka(a){a.F&&0<a.F.length&&(Fa(ij(a.F,0)),a.F=[])},nc(){return{Uc:25856,Wc:5,Tc:191,Vc:35387,Sc:[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]}},oc(){return 0},pc(){return[24,80]}},Bj={cb(a,b){null===b||10===b?(A(ij(a.F,0)),a.F=[]):0!=b&&a.F.push(b)},Ka(a){a.F&&0<a.F.length&&(A(ij(a.F,0)),a.F=[])}};function Cj(a,b){var c=a.m?a.m.length:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.m,a.m=new Uint8Array(b),0<a.B&&a.m.set(c.subarray(0,a.B),0))}
var H={O:null,s(){return H.createNode(null,"/",16895,0)},createNode(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new G(63);H.O||(H.O={dir:{node:{M:H.g.M,G:H.g.G,Aa:H.g.Aa,ka:H.g.ka,oa:H.g.oa,va:H.g.va,pa:H.g.pa,Sa:H.g.Sa,ta:H.g.ta},stream:{ea:H.j.ea}},file:{node:{M:H.g.M,G:H.g.G},stream:{ea:H.j.ea,read:H.j.read,write:H.j.write,pb:H.j.pb,Cb:H.j.Cb,Db:H.j.Db}},link:{node:{M:H.g.M,G:H.g.G,Ea:H.g.Ea},stream:{}},sb:{node:{M:H.g.M,G:H.g.G},stream:Dj}});c=Ej(a,b,c,d);Fj(c.mode)?(c.g=H.O.dir.node,
c.j=H.O.dir.stream,c.m={}):32768===(c.mode&61440)?(c.g=H.O.file.node,c.j=H.O.file.stream,c.B=0,c.m=null):40960===(c.mode&61440)?(c.g=H.O.link.node,c.j=H.O.link.stream):8192===(c.mode&61440)&&(c.g=H.O.sb.node,c.j=H.O.sb.stream);c.timestamp=Date.now();a&&(a.m[b]=c,a.timestamp=c.timestamp);return c},g:{M(a){var b={};b.Zb=8192===(a.mode&61440)?a.id:1;b.mc=a.id;b.mode=a.mode;b.uc=1;b.uid=0;b.ic=0;b.Ca=a.Ca;Fj(a.mode)?b.size=4096:32768===(a.mode&61440)?b.size=a.B:40960===(a.mode&61440)?b.size=a.link.length:
b.size=0;b.Ob=new Date(a.timestamp);b.Qa=new Date(a.timestamp);b.Xb=new Date(a.timestamp);b.Sb=4096;b.Tb=Math.ceil(b.size/b.Sb);return b},G(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.B!=b))if(0==b)a.m=null,a.B=0;else{var c=a.m;a.m=new Uint8Array(b);c&&a.m.set(c.subarray(0,Math.min(b,a.B)));a.B=b}},Aa(){throw Gj[44];},ka(a,b,c,d){return H.createNode(a,b,c,d)},oa(a,b,c){if(Fj(a.mode)){try{var d=Hj(b,c)}catch(f){}if(d)for(var e in d.m)throw new G(55);
}delete a.parent.m[a.name];a.parent.timestamp=Date.now();a.name=c;b.m[c]=a;b.timestamp=a.parent.timestamp},va(a,b){delete a.m[b];a.timestamp=Date.now()},pa(a,b){var c=Hj(a,b),d;for(d in c.m)throw new G(55);delete a.m[b];a.timestamp=Date.now()},Sa(a){var b=[".",".."],c;for(c of Object.keys(a.m))b.push(c);return b},ta(a,b,c){a=H.createNode(a,b,41471,0);a.link=c;return a},Ea(a){if(40960!==(a.mode&61440))throw new G(28);return a.link}},j:{read(a,b,c,d,e){var f=a.node.m;if(e>=a.node.B)return 0;a=Math.min(a.node.B-
e,d);x(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){x(!(b instanceof ArrayBuffer));b.buffer===m().buffer&&(f=!1);if(!d)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.m||a.m.subarray)){if(f)return x(0===e,"canOwn must imply no weird position inside the file"),a.m=b.subarray(c,c+d),a.B=d;if(0===a.B&&0===e)return a.m=b.slice(c,c+d),a.B=d;if(e+d<=a.B)return a.m.set(b.subarray(c,c+d),e),d}Cj(a,e+d);if(a.m.subarray&&b.subarray)a.m.set(b.subarray(c,
c+d),e);else for(f=0;f<d;f++)a.m[e+f]=b[c+f];a.B=Math.max(a.B,e+d);return d},ea(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.B);if(0>b)throw new G(28);return b},pb(a,b,c){Cj(a.node,b+c);a.node.B=Math.max(a.node.B,b+c)},Cb(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new G(43);a=a.node.m;if(e&2||a.buffer!==m().buffer){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=!0;sa("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported");
b=void 0;if(!b)throw new G(48);m().set(a,b)}else c=!1,b=a.byteOffset;return{td:b,Pc:c}},Db(a,b,c,d){H.j.write(a,b,0,d,c,!1);return 0}}},Ij=v.preloadPlugins||[],Jj=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},D={aa:{},indexedDB:()=>{if("undefined"!=typeof indexedDB)return indexedDB;var a=null;"object"==typeof window&&(a=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB);x(a,"IDBFS used, but indexedDB not supported");return a},Nb:21,$:"FILE_DATA",ma:a=>{function b(){"again"===
a.ca?c():a.ca=0}function c(){a.ca="idb";D.jb(a,!1,b)}a.ca?"idb"===a.ca&&(a.ca="again"):a.ca=setTimeout(c,0)},s:a=>{var b=H.s(a);if(a?.wc?.Rc){b.ca=0;var c=b.g;b.g=Object.assign({},b.g);b.g.ka=(d,e,f,g)=>{var k=c.ka(d,e,f,g);k.g=b.g;k.kc=b.s;k.ab=k.j;k.j=Object.assign({},k.j);k.j.write=(l,q,u,z,B,L)=>{l.node.Ab=!0;return k.ab.write(l,q,u,z,B,L)};k.j.close=l=>{var q=l.node;q.Ab&&(D.ma(q.kc),q.Ab=!1);if(q.ab.close)return q.ab.close(l)};return k};b.g.sc=(...d)=>(D.ma(b.s),c.sc(...d));b.g.pa=(...d)=>(D.ma(b.s),
c.pa(...d));b.g.ta=(...d)=>(D.ma(b.s),c.ta(...d));b.g.va=(...d)=>(D.ma(b.s),c.va(...d));b.g.oa=(...d)=>(D.ma(b.s),c.oa(...d))}return b},jb:(a,b,c)=>{D.dc(a,(d,e)=>{if(d)return c(d);D.ec(a,(f,g)=>{if(f)return c(f);D.Ac(b?g:e,b?e:g,c)})})},yc:()=>{Object.values(D.aa).forEach(a=>a.close());D.aa={}},cc:(a,b)=>{var c=D.aa[a];if(c)return b(null,c);try{var d=D.indexedDB().open(a,D.Nb)}catch(e){return b(e)}if(!d)return b("Unable to connect to IndexedDB");d.onupgradeneeded=e=>{var f=e.target.result;e=e.target.transaction;
var g;f.objectStoreNames.contains(D.$)?g=e.objectStore(D.$):g=f.createObjectStore(D.$);g.indexNames.contains("timestamp")||g.createIndex("timestamp","timestamp",{unique:!1})};d.onsuccess=()=>{c=d.result;D.aa[a]=c;b(null,c)};d.onerror=e=>{b(e.target.error);e.preventDefault()}},dc:(a,b)=>{function c(k){return"."!==k&&".."!==k}function d(k){return l=>lj(k+"/"+l)}var e={};for(a=Kj(a.Ba).filter(c).map(d(a.Ba));a.length;){var f=a.pop();try{var g=Lj(f)}catch(k){return b(k)}Fj(g.mode)&&a.push(...Kj(f).filter(c).map(d(f)));
e[f]={timestamp:g.Qa}}return b(null,{type:"local",entries:e})},ec:(a,b)=>{var c={};D.cc(a.Ba,(d,e)=>{if(d)return b(d);try{var f=e.transaction([D.$],"readonly");f.onerror=g=>{b(g.target.error);g.preventDefault()};f.objectStore(D.$).index("timestamp").openKeyCursor().onsuccess=g=>{g=g.target.result;if(!g)return b(null,{type:"remote",db:e,entries:c});c[g.primaryKey]={timestamp:g.key};g.continue()}}catch(g){return b(g)}})},qc:(a,b)=>{try{var c=Mj(a).node;var d=Lj(a)}catch(f){return b(f)}if(Fj(d.mode))return b(null,
{timestamp:d.Qa,mode:d.mode});if(32768===(d.mode&61440)){a=c;var e=c;e=e.m?e.m.subarray?e.m.subarray(0,e.B):new Uint8Array(e.m):new Uint8Array(0);a.m=e;return b(null,{timestamp:d.Qa,mode:d.mode,contents:c.m})}return b(Error("node type not supported"))},Gc:(a,b,c)=>{try{if(Fj(b.mode))Nj(a,b.mode);else if(32768===(b.mode&61440))Oj(a,b.contents,{rb:!0});else return c(Error("node type not supported"));Pj(a,b.mode);var d=b.timestamp,e=b.timestamp,f=Mj(a,{Z:!0}).node;f.g.G(f,{timestamp:Math.max(d,e)})}catch(g){return c(g)}c(null)},
Cc:(a,b)=>{try{var c=Lj(a);Fj(c.mode)?Qj(a):32768===(c.mode&61440)&&Rj(a)}catch(d){return b(d)}b(null)},rc:(a,b,c)=>{a=a.get(b);a.onsuccess=d=>c(null,d.target.result);a.onerror=d=>{c(d.target.error);d.preventDefault()}},Hc:(a,b,c,d)=>{try{var e=a.put(c,b)}catch(f){d(f);return}e.onsuccess=()=>d();e.onerror=f=>{d(f.target.error);f.preventDefault()}},Dc:(a,b,c)=>{a=a.delete(b);a.onsuccess=()=>c();a.onerror=d=>{c(d.target.error);d.preventDefault()}},Ac:(a,b,c)=>{function d(u){if(u&&!k)return k=!0,c(u)}
var e=0,f=[];Object.keys(a.entries).forEach(function(u){var z=a.entries[u],B=b.entries[u];B&&z.timestamp.getTime()==B.timestamp.getTime()||(f.push(u),e++)});var g=[];Object.keys(b.entries).forEach(function(u){a.entries[u]||(g.push(u),e++)});if(!e)return c(null);var k=!1,l=("remote"===a.type?a.db:b.db).transaction([D.$],"readwrite"),q=l.objectStore(D.$);l.onerror=l.onabort=u=>{d(u.target.error);u.preventDefault()};l.oncomplete=()=>{k||c(null)};f.sort().forEach(u=>{"local"===b.type?D.rc(q,u,(z,B)=>
{if(z)return d(z);D.Gc(u,B,d)}):D.qc(u,(z,B)=>{if(z)return d(z);D.Hc(q,u,B,d)})});g.sort().reverse().forEach(u=>{"local"===b.type?D.Cc(u,d):D.Dc(q,u,d)})}},Sj={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},Tj=null,Uj={},Zi=[],Vj=1,Wj=null,qj="/",sb=!0,G=class extends Error{constructor(a){super(lb?F(Xj(a)):"");this.name="ErrnoError";this.i=a;for(var b in Sj)if(Sj[b]===a){this.code=b;break}}},Gj={},Yj=0,Zj=class{constructor(){this.h={};this.node=null}get flags(){return this.h.flags}set flags(a){this.h.flags=a}get position(){return this.h.position}set position(a){this.h.position=a}},ak=class{constructor(a,b,c,d){a||=this;this.parent=a;this.s=a.s;this.K=null;
this.id=Vj++;this.name=b;this.mode=c;this.g={};this.j={};this.Ca=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 Mj(a,b={}){a=rj(a);if(!a)return{path:"",node:null};b=Object.assign({Za:!0,fb:0},b);if(8<b.fb)throw new G(32);a=a.split("/").filter(g=>!!g);for(var c=Tj,d="/",e=0;e<a.length;e++){var f=e===a.length-1;if(f&&b.parent)break;c=Hj(c,a[e]);d=lj(d+"/"+a[e]);c.K&&(!f||f&&b.Za)&&(c=c.K.root);if(!f||b.Z)for(f=0;40960===(c.mode&61440);)if(c=bk(d),d=rj(mj(d),c),c=Mj(d,{fb:b.fb+1}).node,40<f++)throw new G(32);}return{path:d,node:c}}
function ck(a){for(var b;;){if(a===a.parent)return a=a.s.Ba,b?"/"!==a[a.length-1]?`${a}/${b}`:a+b:a;b=b?`${a.name}/${b}`:a.name;a=a.parent}}function dk(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%Wj.length}function ek(a){var b=dk(a.parent.id,a.name);a.fa=Wj[b];Wj[b]=a}function fk(a){var b=dk(a.parent.id,a.name);if(Wj[b]===a)Wj[b]=a.fa;else for(b=Wj[b];b;){if(b.fa===a){b.fa=a.fa;break}b=b.fa}}
function Hj(a,b){var c=Fj(a.mode)?(c=gk(a,"x"))?c:a.g.Aa?0:2:54;if(c)throw new G(c);for(c=Wj[dk(a.id,b)];c;c=c.fa){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.g.Aa(a,b)}function Ej(a,b,c,d){x("object"==typeof a);a=new ak(a,b,c,d);ek(a);return a}function Fj(a){return 16384===(a&61440)}function hk(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b}
function gk(a,b){if(sb)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0}function ik(a,b){try{return Hj(a,b),20}catch(c){}return gk(a,"wx")}function jk(a,b,c){try{var d=Hj(a,b)}catch(e){return e.i}if(a=gk(a,"wx"))return a;if(c){if(!Fj(d.mode))return 54;if(d===d.parent||ck(d)===qj)return 10}else if(Fj(d.mode))return 31;return 0}function kk(a){a=Zi[a];if(!a)throw new G(8);return a}
function lk(a,b=-1){x(-1<=b);a=Object.assign(new Zj,a);if(-1==b)a:{for(b=0;4096>=b;b++)if(!Zi[b])break a;throw new G(33);}a.u=b;return Zi[b]=a}function mk(a,b=-1){a=lk(a,b);a.j?.dd?.(a);return a}var Dj={open(a){a.j=Uj[a.node.Ca].j;a.j.open?.(a)},ea(){throw new G(70);}};function yj(a,b){Uj[a]={j:b}}function nk(a){var b=[];for(a=[a];a.length;){var c=a.pop();b.push(c);a.push(...c.Pa)}return b}
function ok(a,b){function c(g){x(0<Yj);Yj--;return b(g)}function d(g){if(g){if(!d.ac)return d.ac=!0,c(g)}else++f>=e.length&&c(null)}"function"==typeof a&&(b=a,a=!1);Yj++;1<Yj&&A(`warning: ${Yj} FS.syncfs operations in flight at once, probably just doing extra work`);var e=nk(Tj.s),f=0;e.forEach(g=>{if(!g.type.jb)return d(null);g.type.jb(g,a,d)})}
function ub(a,b){if("string"==typeof a)throw a;var c="/"===b,d=!b;if(c&&Tj)throw new G(10);if(!c&&!d){var e=Mj(b,{Za:!1});b=e.path;e=e.node;if(e.K)throw new G(10);if(!Fj(e.mode))throw new G(54);}b={type:a,wc:{},Ba:b,Pa:[]};a=a.s(b);a.s=b;b.root=a;c?Tj=a:e&&(e.K=b,e.s&&e.s.Pa.push(b));return a}
function pk(a){a=Mj(a,{Za:!1});if(!a.node.K)throw new G(28);a=a.node;var b=a.K,c=nk(b);Object.keys(Wj).forEach(d=>{for(d=Wj[d];d;){var e=d.fa;c.includes(d.s)&&fk(d);d=e}});a.K=null;b=a.s.Pa.indexOf(b);x(-1!==b);a.s.Pa.splice(b,1)}function qk(a,b,c){var d=Mj(a,{parent:!0}).node;a=nj(a);if(!a||"."===a||".."===a)throw new G(28);var e=ik(d,a);if(e)throw new G(e);if(!d.g.ka)throw new G(63);return d.g.ka(d,a,b,c)}function rk(a,b){return qk(a,(void 0!==b?b:511)&1023|16384,0)}
function Nj(a,b){a=a.split("/");for(var c="",d=0;d<a.length;++d)if(a[d]){c+="/"+a[d];try{rk(c,b)}catch(e){if(20!=e.i)throw e;}}}function sk(a,b,c){"undefined"==typeof c&&(c=b,b=438);qk(a,b|8192,c)}function qb(a,b){if(!rj(a))throw new G(44);var c=Mj(b,{parent:!0}).node;if(!c)throw new G(44);b=nj(b);var d=ik(c,b);if(d)throw new G(d);if(!c.g.ta)throw new G(63);c.g.ta(c,b,a)}
function Qj(a){var b=Mj(a,{parent:!0}).node;a=nj(a);var c=Hj(b,a),d=jk(b,a,!0);if(d)throw new G(d);if(!b.g.pa)throw new G(63);if(c.K)throw new G(10);b.g.pa(b,a);fk(c)}function Kj(a){a=Mj(a,{Z:!0}).node;if(!a.g.Sa)throw new G(54);return a.g.Sa(a)}function Rj(a){var b=Mj(a,{parent:!0}).node;if(!b)throw new G(44);a=nj(a);var c=Hj(b,a),d=jk(b,a,!1);if(d)throw new G(d);if(!b.g.va)throw new G(63);if(c.K)throw new G(10);b.g.va(b,a);fk(c)}
function bk(a){a=Mj(a).node;if(!a)throw new G(44);if(!a.g.Ea)throw new G(28);return rj(ck(a.parent),a.g.Ea(a))}function Lj(a,b){a=Mj(a,{Z:!b}).node;if(!a)throw new G(44);if(!a.g.M)throw new G(63);return a.g.M(a)}function tk(a){return Lj(a,!0)}function Pj(a,b){a="string"==typeof a?Mj(a,{Z:!0}).node:a;if(!a.g.G)throw new G(63);a.g.G(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})}
function uk(a,b){if(0>b)throw new G(28);a="string"==typeof a?Mj(a,{Z:!0}).node:a;if(!a.g.G)throw new G(63);if(Fj(a.mode))throw new G(31);if(32768!==(a.mode&61440))throw new G(28);var c=gk(a,"w");if(c)throw new G(c);a.g.G(a,{size:b,timestamp:Date.now()})}
function rb(a,b,c){if(""===a)throw new G(44);if("string"==typeof b){var d={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if("undefined"==typeof d)throw Error(`Unknown file open mode: ${b}`);b=d}c=b&64?("undefined"==typeof c?438:c)&4095|32768:0;if("object"==typeof a)var e=a;else{a=lj(a);try{e=Mj(a,{Z:!(b&131072)}).node}catch(f){}}d=!1;if(b&64)if(e){if(b&128)throw new G(20);}else e=qk(a,c,0),d=!0;if(!e)throw new G(44);8192===(e.mode&61440)&&(b&=-513);if(b&65536&&!Fj(e.mode))throw new G(54);if(!d&&
(c=e?40960===(e.mode&61440)?32:Fj(e.mode)&&("r"!==hk(b)||b&512)?31:gk(e,hk(b)):44))throw new G(c);b&512&&!d&&uk(e,0);b&=-131713;e=lk({node:e,path:ck(e),flags:b,seekable:!0,position:0,j:e.j,Kc:[],error:!1});e.j.open&&e.j.open(e);!v.logReadFiles||b&1||(vk||={},a in vk||(vk[a]=1));return e}function $i(a){if(null===a.u)throw new G(8);a.ba&&(a.ba=null);try{a.j.close&&a.j.close(a)}catch(b){throw b;}finally{Zi[a.u]=null}a.u=null}
function wk(a,b,c){if(null===a.u)throw new G(8);if(!a.seekable||!a.j.ea)throw new G(70);if(0!=c&&1!=c&&2!=c)throw new G(28);a.position=a.j.ea(a,b,c);a.Kc=[];return a.position}
function xk(a,b,c,d,e,f){x(0<=c);if(0>d||0>e)throw new G(28);if(null===a.u)throw new G(8);if(0===(a.flags&2097155))throw new G(8);if(Fj(a.node.mode))throw new G(31);if(!a.j.write)throw new G(28);a.seekable&&a.flags&1024&&wk(a,0,2);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new G(70);b=a.j.write(a,b,c,d,e,f);g||(a.position+=b);return b}
function Oj(a,b,c={}){c.flags=c.flags||577;a=rb(a,c.flags,c.mode);if("string"==typeof b){var d=new Uint8Array(uj(b)+1);b=vj(b,d,0,d.length);xk(a,d,0,b,void 0,c.rb)}else if(ArrayBuffer.isView(b))xk(a,b,0,b.byteLength,void 0,c.rb);else throw Error("Unsupported data type");$i(a)}var ob;
function pb(a,b,c){a=lj("/dev/"+a);var d=Jj(!!b,!!c);yk||=64;var e=yk++<<8|0;yj(e,{open(f){f.seekable=!1},close(){c?.buffer?.length&&c(10)},read(f,g,k,l){for(var q=0,u=0;u<l;u++){try{var z=b()}catch(B){throw new G(29);}if(void 0===z&&0===q)throw new G(6);if(null===z||void 0===z)break;q++;g[k+u]=z}q&&(f.node.timestamp=Date.now());return q},write(f,g,k,l){for(var q=0;q<l;q++)try{c(g[k+q])}catch(u){throw new G(29);}l&&(f.node.timestamp=Date.now());return q}});sk(a,d,e)}var yk,I={},vk,zk=5;
function Ak(a,b,c){if("/"===b.charAt(0))return b;a=-100===a?qj:kk(a).path;if(0==b.length){if(!c)throw new G(44);return a}return lj(a+"/"+b)}
function Bk(a,b,c){a=a(b);p()[c>>2]=a.Zb;p()[c+4>>2]=a.mode;r()[c+8>>2]=a.uc;p()[c+12>>2]=a.uid;p()[c+16>>2]=a.ic;p()[c+20>>2]=a.Ca;Za[c+24>>3]=BigInt(a.size);p()[c+32>>2]=4096;p()[c+36>>2]=a.Tb;b=a.Ob.getTime();var d=a.Qa.getTime(),e=a.Xb.getTime();Za[c+40>>3]=BigInt(Math.floor(b/1E3));r()[c+48>>2]=b%1E3*1E3;Za[c+56>>3]=BigInt(Math.floor(d/1E3));r()[c+64>>2]=d%1E3*1E3;Za[c+72>>3]=BigInt(Math.floor(e/1E3));r()[c+80>>2]=e%1E3*1E3;Za[c+88>>3]=BigInt(a.mc);return 0}var Ck=void 0;
function Pb(a,b,c,d,e){if(w)return C(3,1,a,b,c,d,e);try{x(64>=a,"nfds must be less than or equal to 64");for(var f=0,g=b?p()[b>>2]:0,k=b?p()[b+4>>2]:0,l=c?p()[c>>2]:0,q=c?p()[c+4>>2]:0,u=d?p()[d>>2]:0,z=d?p()[d+4>>2]:0,B=0,L=0,U=0,y=0,S=0,V=0,X=(b?p()[b>>2]:0)|(c?p()[c>>2]:0)|(d?p()[d>>2]:0),zb=(b?p()[b+4>>2]:0)|(c?p()[c+4>>2]:0)|(d?p()[d+4>>2]:0),Y=0;Y<a;Y++){var ca=1<<Y%32;if(32>Y?X&ca:zb&ca){var Ua=kk(Y),Va=zk;if(Ua.j.la){var $b=-1;if(e){var Ao=b?p()[e>>2]:0,Bo=b?p()[e+4>>2]:0;$b=1E3*(Ao+Bo/1E6)}Va=
Ua.j.la(Ua,$b)}Va&1&&(32>Y?g&ca:k&ca)&&(32>Y?B|=ca:L|=ca,f++);Va&4&&(32>Y?l&ca:q&ca)&&(32>Y?U|=ca:y|=ca,f++);Va&2&&(32>Y?u&ca:z&ca)&&(32>Y?S|=ca:V|=ca,f++)}}b&&(p()[b>>2]=B,p()[b+4>>2]=L);c&&(p()[c>>2]=U,p()[c+4>>2]=y);d&&(p()[d>>2]=S,p()[d+4>>2]=V);return f}catch(Zd){if("undefined"==typeof I||"ErrnoError"!==Zd.name)throw Zd;return-Zd.i}}
function Dk(a,b){if(1===a.type&&a.R)throw new G(53);var c=a.na.shift();if(!c){if(1===a.type){a=a.P[a.T+":"+a.U];if(!a)throw new G(53);if(a.l.readyState===a.l.CLOSING||a.l.readyState===a.l.CLOSED)return null}throw new G(6);}var d=c.data.byteLength||c.data.length,e=c.data.byteOffset||0,f=c.data.buffer||c.data;b=Math.min(b,d);var g={buffer:new Uint8Array(f,e,b),A:c.A,port:c.port};1===a.type&&b<d&&(c.data=new Uint8Array(f,e+b,d-b),a.na.unshift(c));return g}
function Ek(a,b,c,d,e,f){if(2===a.type){if(void 0===e||void 0===f)e=a.T,f=a.U;if(void 0===e||void 0===f)throw new G(17);}else e=a.T,f=a.U;var g=a.P[e+":"+f];if(1===a.type){if(!g||g.l.readyState===g.l.CLOSING||g.l.readyState===g.l.CLOSED)throw new G(53);if(g.l.readyState===g.l.CONNECTING)throw new G(6);}ArrayBuffer.isView(b)&&(c+=b.byteOffset,b=b.buffer);var k;b instanceof SharedArrayBuffer?k=(new Uint8Array(new Uint8Array(b.slice(c,c+d)))).buffer:k=b.slice(c,c+d);if(2===a.type&&(!g||g.l.readyState!==
g.l.OPEN))return g&&g.l.readyState!==g.l.CLOSING&&g.l.readyState!==g.l.CLOSED||(g=Fk(a,e,f)),g.Ja.push(k),d;try{return g.l.send(k),d}catch(l){throw new G(28);}}
function Gk(a,b){function c(){v.websocket.ia("open",a.stream.u);try{for(var f=b.Ja.shift();f;)b.l.send(f),f=b.Ja.shift()}catch(g){b.l.close()}}function d(f){if("string"==typeof f)f=(new TextEncoder).encode(f);else{x(void 0!==f.byteLength);if(0==f.byteLength)return;f=new Uint8Array(f)}var g=e;e=!1;g&&10===f.length&&255===f[0]&&255===f[1]&&255===f[2]&&255===f[3]&&112===f[4]&&111===f[5]&&114===f[6]&&116===f[7]?(f=f[8]<<8|f[9],delete a.P[b.A+":"+b.port],b.port=f,a.P[b.A+":"+b.port]=b):(a.na.push({A:b.A,
port:b.port,data:f}),v.websocket.ia("message",a.stream.u))}var e=!0;va?(b.l.bb("open",c),b.l.bb("message",function(f,g){g&&d((new Uint8Array(f)).buffer)}),b.l.bb("close",function(){v.websocket.ia("close",a.stream.u)}),b.l.bb("error",function(){a.error=14;v.websocket.ia("error",[a.stream.u,a.error,"ECONNREFUSED: Connection refused"])})):(b.l.onopen=c,b.l.onclose=function(){v.websocket.ia("close",a.stream.u)},b.l.onmessage=function(f){d(f.data)},b.l.onerror=function(){a.error=14;v.websocket.ia("error",
[a.stream.u,a.error,"ECONNREFUSED: Connection refused"])})}
function Fk(a,b,c){if("object"==typeof b){var d=b;c=b=null}if(d)if(d.ob)b=d.ob.wd,c=d.ob.xd;else{c=/ws[s]?:\/\/([^:]+):(\d+)/.exec(d.url);if(!c)throw Error("WebSocket URL must be in the format ws(s)://address:port");b=c[1];c=parseInt(c[2],10)}else try{var e=v.websocket&&"object"===typeof v.websocket,f="ws://";e&&"string"===typeof v.websocket.url&&(f=v.websocket.url);if("ws://"===f||"wss://"===f){var g=b.split("/");f=f+g[0]+":"+c+"/"+g.slice(1).join("/")}g="binary";e&&"string"===typeof v.websocket.subprotocol&&
(g=v.websocket.subprotocol);var k=void 0;"null"!==g&&(k=g=g.replace(/^ +| +$/g,"").split(/ *, */));e&&null===v.websocket.subprotocol&&(k=void 0);d=new WebSocket(f,k);d.binaryType="arraybuffer"}catch(l){throw new G(23);}b={A:b,port:c,l:d,Ja:[]};a.P[b.A+":"+b.port]=b;Gk(a,b);2===a.type&&"undefined"!=typeof a.sa&&b.Ja.push(new Uint8Array([255,255,255,255,112,111,114,116,(a.sa&65280)>>8,a.sa&255]));return b}
var tb={s(){v.websocket=v.websocket&&"object"===typeof v.websocket?v.websocket:{};v.websocket.Va={};v.websocket.on=function(a,b){"function"===typeof b&&(this.Va[a]=b);return this};v.websocket.ia=function(a,b){"function"===typeof this.Va[a]&&this.Va[a].call(this,b)};return Ej(null,"/",16895,0)},j:{la(a){a=a.node.qa;return a.ra.la(a)},La(a,b,c){a=a.node.qa;return a.ra.La(a,b,c)},read(a,b,c,d){a=Dk(a.node.qa,d);if(!a)return 0;b.set(a.buffer,c);return a.buffer.length},write(a,b,c,d){return Ek(a.node.qa,
b,c,d)},close(a){a=a.node.qa;a.ra.close(a)}},Ra(){tb.Ra.current||(tb.Ra.current=0);return"socket["+tb.Ra.current++ +"]"},Nc:{la(a){if(1===a.type&&a.R)return a.pending.length?65:0;var b=0,c=1===a.type?a.P[a.T+":"+a.U]:null;if(a.na.length||!c||c&&c.l.readyState===c.l.CLOSING||c&&c.l.readyState===c.l.CLOSED)b|=65;if(!c||c&&c.l.readyState===c.l.OPEN)b|=4;if(c&&c.l.readyState===c.l.CLOSING||c&&c.l.readyState===c.l.CLOSED)b|=16;return b},La(a,b,c){switch(b){case 21531:return b=0,a.na.length&&(b=a.na[0].data.length),
p()[c>>2]=b,0;default:return 28}},close(a){if(a.R){try{a.R.close()}catch(e){}a.R=null}for(var b=Object.keys(a.P),c=0;c<b.length;c++){var d=a.P[b[c]];try{d.l.close()}catch(e){}delete a.P[d.A+":"+d.port]}return 0},bind(a,b,c){if("undefined"!=typeof a.hb||"undefined"!=typeof a.sa)throw new G(28);a.hb=b;a.sa=c;if(2===a.type){a.R&&(a.R.close(),a.R=null);try{if(!va)throw new G(138);}catch(d){if("ErrnoError"!==d.name)throw d;if(138!==d.i)throw d;}}},connect(a,b,c){if(a.R)throw new G(138);if("undefined"!=
typeof a.T&&"undefined"!=typeof a.U){var d=a.P[a.T+":"+a.U];if(d){if(d.l.readyState===d.l.CONNECTING)throw new G(7);throw new G(30);}}b=Fk(a,b,c);a.T=b.A;a.U=b.port;throw new G(26);},accept(a){if(!a.R||!a.pending.length)throw new G(28);var b=a.pending.shift();b.stream.flags=a.stream.flags;return b},ld(a,b){if(b){if(void 0===a.T||void 0===a.U)throw new G(53);b=a.T;a=a.U}else b=a.hb||0,a=a.sa||0;return{A:b,port:a}}}},Hk=a=>{a=(a=Zi[a])&&49152===(a.node.mode&49152)?a.node.qa:null;if(!a)throw new G(8);
return a},Ik=a=>{a=a.split(".");for(var b=0;4>b;b++){var c=Number(a[b]);if(isNaN(c))return null;a[b]=c}return(a[0]|a[1]<<8|a[2]<<16|a[3]<<24)>>>0},Kk=a=>{var b,c,d=[];if(!/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i.test(a))return null;if("::"===a)return[0,0,0,0,0,0,0,0];a=a.startsWith("::")?a.replace("::","Z:"):a.replace("::",":Z:");0<a.indexOf(".")?(a=a.replace(RegExp("[.]","g"),
":"),a=a.split(":"),a[a.length-4]=parseInt(a[a.length-4])+256*parseInt(a[a.length-3]),a[a.length-3]=parseInt(a[a.length-2])+256*parseInt(a[a.length-1]),a=a.slice(0,a.length-2)):a=a.split(":");for(b=c=0;b<a.length;b++)if("string"==typeof a[b])if("Z"===a[b]){for(c=0;c<8-a.length+1;c++)d[b+c]=0;--c}else d[b+c]=Jk(parseInt(a[b],16));else d[b+c]=a[b];return[d[1]<<16|d[0],d[3]<<16|d[2],d[5]<<16|d[4],d[7]<<16|d[6]]},Lk=(a,b,c,d,e)=>{switch(b){case 2:c=Ik(c);n().fill(0,a,a+16);e&&(p()[e>>2]=16);fa()[a>>1]=
b;p()[a+4>>2]=c;fa()[a+2>>1]=Jk(d);break;case 10:c=Kk(c);n().fill(0,a,a+28);e&&(p()[e>>2]=28);p()[a>>2]=b;p()[a+8>>2]=c[0];p()[a+12>>2]=c[1];p()[a+16>>2]=c[2];p()[a+20>>2]=c[3];fa()[a+2>>1]=Jk(d);break;default:return 5}return 0},Mk=1,Nk={},Ok={};function Pk(a){var b=Ik(a);if(null!==b)return a;b=Kk(a);if(null!==b)return a;Nk[a]?b=Nk[a]:(b=Mk++,x(65535>b,"exceeded max address mappings of 65535"),b="172.29."+(b&255)+"."+(b&65280),Ok[b]=a,Nk[a]=b);return b}
function Qb(a,b,c,d,e,f){if(w)return C(4,1,a,b,c,d,e,f);try{var g=Hk(a),k=g.ra.accept(g);if(b){var l=Lk(b,k.family,Pk(k.T),k.U,c);x(!l)}return k.stream.u}catch(q){if("undefined"==typeof I||"ErrnoError"!==q.name)throw q;return-q.i}}
var Qk=a=>(a&255)+"."+(a>>8&255)+"."+(a>>16&255)+"."+(a>>24&255),Sk=a=>{var b="",c,d=0,e=0,f=0,g=0;a=[a[0]&65535,a[0]>>16,a[1]&65535,a[1]>>16,a[2]&65535,a[2]>>16,a[3]&65535,a[3]>>16];var k=!0;for(c=0;5>c;c++)if(0!==a[c]){k=!1;break}if(k){c=Qk(a[6]|a[7]<<16);if(-1===a[5])return"::ffff:"+c;if(0===a[5])return"0.0.0.0"===c&&(c=""),"0.0.0.1"===c&&(c="1"),"::"+c}for(c=0;8>c;c++)0===a[c]&&(1<c-e&&(g=0),e=c,g++),g>d&&(d=g,f=c-d+1);for(c=0;8>c;c++)1<d&&0===a[c]&&c>=f&&c<f+d?c===f&&(b+=":",0===f&&(b+=":")):
(b+=Number(Rk(a[c]&65535)).toString(16),b+=7>c?":":"");return b},Tk=(a,b)=>{var c=fa()[a>>1],d=Rk(ia()[a+2>>1]);switch(c){case 2:if(16!==b)return{i:28};a=p()[a+4>>2];a=Qk(a);break;case 10:if(28!==b)return{i:28};a=[p()[a+8>>2],p()[a+12>>2],p()[a+16>>2],p()[a+20>>2]];a=Sk(a);break;default:return{i:5}}return{family:c,A:a,port:d}},Uk=(a,b,c)=>{if(c&&0===a)return null;a=Tk(a,b);if(a.i)throw new G(a.i);b=a.A;a.A=(Ok[b]?Ok[b]:null)||a.A;return a};
function Rb(a,b,c,d,e,f){if(w)return C(5,1,a,b,c,d,e,f);try{var g=Hk(a),k=Uk(b,c);g.ra.bind(g,k.A,k.port);return 0}catch(l){if("undefined"==typeof I||"ErrnoError"!==l.name)throw l;return-l.i}}function Sb(a){if(w)return C(6,1,a);try{a=F(a);var b=Mj(a,{Z:!0});if(null===b.node)throw new G(44);if(!Fj(b.node.mode))throw new G(54);var c=gk(b.node,"x");if(c)throw new G(c);qj=b.path;return 0}catch(d){if("undefined"==typeof I||"ErrnoError"!==d.name)throw d;return-d.i}}
function Tb(a,b){if(w)return C(7,1,a,b);try{return a=F(a),Pj(a,b),0}catch(c){if("undefined"==typeof I||"ErrnoError"!==c.name)throw c;return-c.i}}function Ub(a,b,c,d,e,f){if(w)return C(8,1,a,b,c,d,e,f);try{var g=Hk(a),k=Uk(b,c);g.ra.connect(g,k.A,k.port);return 0}catch(l){if("undefined"==typeof I||"ErrnoError"!==l.name)throw l;return-l.i}}
function Vb(a,b,c,d){if(w)return C(9,1,a,b,c,d);try{b=F(b);x(0===d);b=Ak(a,b);if(c&-8)return-28;var e=Mj(b,{Z:!0}).node;if(!e)return-44;a="";c&4&&(a+="r");c&2&&(a+="w");c&1&&(a+="x");return a&&gk(e,a)?-2:0}catch(f){if("undefined"==typeof I||"ErrnoError"!==f.name)throw f;return-f.i}}function Wb(a,b){if(w)return C(10,1,a,b);try{var c=kk(a);Pj(c.node,b);return 0}catch(d){if("undefined"==typeof I||"ErrnoError"!==d.name)throw d;return-d.i}}function Vk(){x(void 0!=Ck);var a=p()[+Ck>>2];Ck+=4;return a}
function Xb(a,b,c){if(w)return C(11,1,a,b,c);Ck=c;try{var d=kk(a);switch(b){case 0:var e=Vk();if(0>e)break;for(;Zi[e];)e++;return mk(d,e).u;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=Vk(),d.flags|=e,0;case 12:return e=Vk(),fa()[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(f){if("undefined"==typeof I||"ErrnoError"!==f.name)throw f;return-f.i}}
function Yb(a,b){if(w)return C(12,1,a,b);try{var c=kk(a);return Bk(Lj,c.path,b)}catch(d){if("undefined"==typeof I||"ErrnoError"!==d.name)throw d;return-d.i}}function Zb(a,b){if(w)return C(13,1,a,b);b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;var c=kk(a);if(0===(c.flags&2097155))throw new G(28);uk(c.node,b);return 0}catch(d){if("undefined"==typeof I||"ErrnoError"!==d.name)throw d;return-d.i}}
var Wk=(a,b,c)=>{x("number"==typeof c,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return vj(a,n(),b,c)};function ac(a,b){if(w)return C(14,1,a,b);try{if(0===b)return-28;var c=qj,d=uj(c)+1;if(b<d)return-68;Wk(c,a,b);return d}catch(e){if("undefined"==typeof I||"ErrnoError"!==e.name)throw e;return-e.i}}
function bc(a,b,c){if(w)return C(15,1,a,b,c);try{var d=kk(a);d.ba||(d.ba=Kj(d.path));a=0;for(var e=wk(d,0,1),f=Math.floor(e/280);f<d.ba.length&&a+280<=c;){var g=d.ba[f];if("."===g){var k=d.node.id;var l=4}else if(".."===g)k=Mj(d.path,{parent:!0}).node.id,l=4;else{var q=Hj(d.node,g);k=q.id;l=8192===(q.mode&61440)?2:Fj(q.mode)?4:40960===(q.mode&61440)?10:8}x(k);Za[b+a>>3]=BigInt(k);Za[b+a+8>>3]=BigInt(280*(f+1));fa()[b+a+16>>1]=280;m()[b+a+18]=l;Wk(g,b+a+19,256);a+=280;f+=1}wk(d,280*f,0);return a}catch(u){if("undefined"==
typeof I||"ErrnoError"!==u.name)throw u;return-u.i}}function cc(a,b,c,d,e,f){if(w)return C(16,1,a,b,c,d,e,f);try{var g=Hk(a),k=Lk(b,g.family,Pk(g.hb||"0.0.0.0"),g.sa,c);x(!k);return 0}catch(l){if("undefined"==typeof I||"ErrnoError"!==l.name)throw l;return-l.i}}function dc(a,b,c,d,e,f){if(w)return C(17,1,a,b,c,d,e,f);try{var g=Hk(a);return 1===b&&4===c?(p()[d>>2]=g.error,p()[e>>2]=4,g.error=null,0):-50}catch(k){if("undefined"==typeof I||"ErrnoError"!==k.name)throw k;return-k.i}}
function ec(a,b,c){if(w)return C(18,1,a,b,c);Ck=c;try{var d=kk(a);switch(b){case 21509:return d.o?0:-59;case 21505:if(!d.o)return-59;if(d.o.W.nc){b=[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];var e=Vk();p()[e>>2]=25856;p()[e+4>>2]=5;p()[e+8>>2]=191;p()[e+12>>2]=35387;for(var f=0;32>f;f++)m()[e+f+17]=b[f]||0}return 0;case 21510:case 21511:case 21512:return d.o?0:-59;case 21506:case 21507:case 21508:if(!d.o)return-59;if(d.o.W.oc)for(e=Vk(),p(),p(),p(),p(),b=[],f=0;32>
f;f++)b.push(m()[e+f+17]);return 0;case 21519:if(!d.o)return-59;e=Vk();return p()[e>>2]=0;case 21520:return d.o?-28:-59;case 21531:e=Vk();if(!d.j.La)throw new G(59);return d.j.La(d,b,e);case 21523:if(!d.o)return-59;d.o.W.pc&&(f=[24,80],e=Vk(),fa()[e>>1]=f[0],fa()[e+2>>1]=f[1]);return 0;case 21524:return d.o?0:-59;case 21515:return d.o?0:-59;default:return-28}}catch(g){if("undefined"==typeof I||"ErrnoError"!==g.name)throw g;return-g.i}}
function fc(a,b){if(w)return C(19,1,a,b);try{Hk(a);if(!va)throw new G(138);return 0}catch(c){if("undefined"==typeof I||"ErrnoError"!==c.name)throw c;return-c.i}}function gc(a,b){if(w)return C(20,1,a,b);try{return a=F(a),Bk(tk,a,b)}catch(c){if("undefined"==typeof I||"ErrnoError"!==c.name)throw c;return-c.i}}
function hc(a,b,c){if(w)return C(21,1,a,b,c);try{return b=F(b),b=Ak(a,b),b=lj(b),"/"===b[b.length-1]&&(b=b.substr(0,b.length-1)),rk(b,c),0}catch(d){if("undefined"==typeof I||"ErrnoError"!==d.name)throw d;return-d.i}}function ic(a,b,c,d){if(w)return C(22,1,a,b,c,d);try{b=F(b);b=Ak(a,b);switch(c&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}qk(b,c,d);return 0}catch(e){if("undefined"==typeof I||"ErrnoError"!==e.name)throw e;return-e.i}}
function jc(a,b,c,d){if(w)return C(23,1,a,b,c,d);try{b=F(b);var e=d&256,f=d&4096;d&=-6401;x(!d,`unknown flags in __syscall_newfstatat: ${d}`);b=Ak(a,b,f);return Bk(e?tk:Lj,b,c)}catch(g){if("undefined"==typeof I||"ErrnoError"!==g.name)throw g;return-g.i}}function kc(a,b,c,d){if(w)return C(24,1,a,b,c,d);Ck=d;try{b=F(b);b=Ak(a,b);var e=d?Vk():0;return rb(b,c,e).u}catch(f){if("undefined"==typeof I||"ErrnoError"!==f.name)throw f;return-f.i}}
function lc(a,b,c){if(w)return C(25,1,a,b,c);try{for(var d=c=0;d<b;d++){var e=a+8*d,f=p()[e>>2],g=fa()[e+4>>1],k=32,l=Zi[f];l&&(k=zk,l.j.la&&(k=l.j.la(l,-1)));(k&=g|24)&&c++;fa()[e+6>>1]=k}return c}catch(q){if("undefined"==typeof I||"ErrnoError"!==q.name)throw q;return-q.i}}
function mc(a,b,c,d){if(w)return C(26,1,a,b,c,d);try{b=F(b);b=Ak(a,b);if(0>=d)return-28;var e=bk(b),f=Math.min(d,uj(e)),g=m()[c+f];Wk(e,c,d+1);m()[c+f]=g;return f}catch(k){if("undefined"==typeof I||"ErrnoError"!==k.name)throw k;return-k.i}}
function nc(a,b,c,d,e,f){if(w)return C(27,1,a,b,c,d,e,f);try{var g=Hk(a),k=Dk(g,c);if(!k)return 0;if(e){var l=Lk(e,g.family,Pk(k.A),k.port,f);x(!l)}n().set(k.buffer,b);return k.buffer.byteLength}catch(q){if("undefined"==typeof I||"ErrnoError"!==q.name)throw q;return-q.i}}
function oc(a,b,c,d){if(w)return C(28,1,a,b,c,d);try{b=F(b);d=F(d);b=Ak(a,b);d=Ak(c,d);a=b;var e=mj(a),f=mj(d),g=nj(a),k=nj(d);var l=Mj(a,{parent:!0});var q=l.node;l=Mj(d,{parent:!0});var u=l.node;if(!q||!u)throw new G(44);if(q.s!==u.s)throw new G(75);var z=Hj(q,g),B=sj(a,f);if("."!==B.charAt(0))throw new G(28);B=sj(d,e);if("."!==B.charAt(0))throw new G(55);try{var L=Hj(u,k)}catch(S){}if(z!==L){var U=Fj(z.mode),y=jk(q,g,U);if(y)throw new G(y);if(y=L?jk(u,k,U):ik(u,k))throw new G(y);if(!q.g.oa)throw new G(63);
if(z.K||L&&L.K)throw new G(10);if(u!==q&&(y=gk(q,"w")))throw new G(y);fk(z);try{q.g.oa(z,u,k),z.parent=u}catch(S){throw S;}finally{ek(z)}}return 0}catch(S){if("undefined"==typeof I||"ErrnoError"!==S.name)throw S;return-S.i}}function pc(a){if(w)return C(29,1,a);try{return a=F(a),Qj(a),0}catch(b){if("undefined"==typeof I||"ErrnoError"!==b.name)throw b;return-b.i}}
function qc(a,b,c,d,e,f){if(w)return C(30,1,a,b,c,d,e,f);try{var g=Hk(a),k=Uk(e,f,!0);return k?Ek(g,m(),b,c,k.A,k.port):xk(g.stream,m(),b,c)}catch(l){if("undefined"==typeof I||"ErrnoError"!==l.name)throw l;return-l.i}}
function rc(a,b,c){if(w)return C(31,1,a,b,c);try{b&=-526337;if(1==b&&c&&6!=c)throw new G(66);var d={family:a,type:b,protocol:c,R:null,error:null,P:{},pending:[],na:[],ra:tb.Nc},e=tb.Ra(),f=Ej(tb.root,e,49152,0);f.qa=d;var g=lk({path:e,node:f,flags:2,seekable:!1,j:tb.j});d.stream=g;x(64>d.stream.u);return d.stream.u}catch(k){if("undefined"==typeof I||"ErrnoError"!==k.name)throw k;return-k.i}}
function sc(a,b){if(w)return C(32,1,a,b);try{return a=F(a),Bk(Lj,a,b)}catch(c){if("undefined"==typeof I||"ErrnoError"!==c.name)throw c;return-c.i}}function tc(a,b,c){if(w)return C(33,1,a,b,c);try{return F(a),x(64===b),p()[c+4>>2]=4096,p()[c+40>>2]=4096,p()[c+8>>2]=1E6,p()[c+12>>2]=5E5,p()[c+16>>2]=5E5,p()[c+20>>2]=Vj,p()[c+24>>2]=1E6,p()[c+28>>2]=42,p()[c+44>>2]=2,p()[c+36>>2]=255,0}catch(d){if("undefined"==typeof I||"ErrnoError"!==d.name)throw d;return-d.i}}
function uc(a,b){if(w)return C(34,1,a,b);try{return a=F(a),b=F(b),qb(a,b),0}catch(c){if("undefined"==typeof I||"ErrnoError"!==c.name)throw c;return-c.i}}function vc(a,b,c){if(w)return C(35,1,a,b,c);try{return b=F(b),b=Ak(a,b),0===c?Rj(b):512===c?Qj(b):sa("Invalid flags passed to unlinkat"),0}catch(d){if("undefined"==typeof I||"ErrnoError"!==d.name)throw d;return-d.i}}
var wc=()=>{sa("native code called abort()")},xc=()=>1,yc=a=>{La(a,!ua,1,!ta,2097152,!1);Oa()},Xk=()=>{if(!(mb||Ti||0<Oi))try{w?Qa(Ya):lf(Ya)}catch(a){Vi(a)}},Yk=a=>{if(mb||Xa)A("user callback triggered after runtime exited or application aborted. Ignoring.");else try{a(),Xk()}catch(b){Vi(b)}},Ma=a=>{if("function"===typeof Atomics.Mc){var b=Atomics.Mc(p(),a>>2,a);x(b.async);b.value.then(Ra);a+=128;Atomics.store(p(),a>>2,1)}},Ra=()=>{var a=Ja();a&&(Ma(a),Yk(Zk))},zc=(a,b)=>{a==b?setTimeout(Ra):w?
postMessage({targetThread:a,cmd:"checkMailbox"}):(b=Gi[a])?b.postMessage({cmd:"checkMailbox"}):A(`Cannot send message to thread with ID ${a}, unknown thread ID!`)},$k=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,g)=>b.drawElementsInstancedANGLE(c,d,e,f,g))},al=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))},bl=a=>{var b=a.getExtension("WEBGL_draw_buffers");b&&(a.drawBuffers=(c,d)=>b.drawBuffersWEBGL(c,d))},cl=a=>{a.cd=a.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")},dl=a=>{a.nd=a.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")},el=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_color_buffer_float EXT_conservative_depth EXT_disjoint_timer_query_webgl2 EXT_texture_norm16 NV_shader_noperspective_interpolation WEBGL_clip_cull_distance EXT_color_buffer_half_float EXT_depth_clamp EXT_float_blend 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".split(" ");
return(a.getSupportedExtensions()||[]).filter(c=>b.includes(c))},fl=1,gl=[],hl=[],il=[],jl=[],kl=[],ll=[],ml=[],nl={},ol=[],pl=[],ql={},rl=4,sl=0,tl=a=>{for(var b=fl++,c=a.length;c<b;c++)a[c]=null;return b},vl=(a,b,c,d)=>{for(var e=0;e<a;e++){var f=J[c](),g=f&&tl(d);f?(f.name=g,d[g]=f):ul||=1282;p()[b+4*e>>2]=g}},zl=(a,b)=>{b.Ta&&(b.preserveDrawingBuffer=!0);var c=1<b.$a?a.getContext("webgl2",b):a.getContext("webgl",b);if(c){a=wl(8);r()[a+4>>2]=Ja();var d={handle:a,attributes:b,version:b.$a,C:c};
c.canvas&&(c.canvas.ha=d);nl[a]=d;("undefined"==typeof b.wb||b.wb)&&xl(d);if(b.Ta){b=d.C;c=b.createFramebuffer();b.bindFramebuffer(36160,c);d.Ya=c;d.ub=!1;b.getContextAttributes().antialias&&(d.ub=!0);d.ya=b.createTexture();d.Ha=b.createRenderbuffer();yl(d);b.bindTexture(3553,d.ya);b.texParameteri(3553,10241,9728);b.texParameteri(3553,10240,9728);b.texParameteri(3553,10242,33071);b.texParameteri(3553,10243,33071);b.texImage2D(3553,0,6408,b.canvas.width,b.canvas.height,0,6408,5121,null);b.framebufferTexture2D(36160,
36064,3553,d.ya,0);b.bindTexture(3553,null);b.bindRenderbuffer(36161,d.Ha);b.renderbufferStorage(36161,33189,b.canvas.width,b.canvas.height);b.framebufferRenderbuffer(36160,36096,36161,d.Ha);b.bindRenderbuffer(36161,null);c=b.createBuffer();b.bindBuffer(34962,c);b.bufferData(34962,new Float32Array([-1,-1,-1,1,1,-1,1,1]),35044);b.bindBuffer(34962,null);d.Rb=c;c=b.createShader(35633);b.shaderSource(c,"attribute vec2 pos;varying lowp vec2 tex;void main() { tex = pos * 0.5 + vec2(0.5,0.5); gl_Position = vec4(pos, 0.0, 1.0); }");
b.compileShader(c);var e=b.createShader(35632);b.shaderSource(e,"varying lowp vec2 tex;uniform sampler2D sampler;void main() { gl_FragColor = texture2D(sampler, tex); }");b.compileShader(e);var f=b.createProgram();b.attachShader(f,c);b.attachShader(f,e);b.linkProgram(f);d.Qb=f;d.H=b.getAttribLocation(f,"pos");b.useProgram(f);b.uniform1i(b.getUniformLocation(f,"sampler"),0);b.useProgram(null);d.Ia=void 0;b.createVertexArray&&(d.Ia=b.createVertexArray(),b.bindVertexArray(d.Ia),b.enableVertexAttribArray(d.H),
b.bindVertexArray(null))}}else a=0;return a},yl=a=>{var b=a.C;if(a.ya){var c=b.getParameter(32873);b.bindTexture(3553,a.ya);b.texImage2D(3553,0,6408,b.drawingBufferWidth,b.drawingBufferHeight,0,6408,5121,null);b.bindTexture(3553,c)}a.Ha&&(c=b.getParameter(36007),b.bindRenderbuffer(36161,a.Ha),b.renderbufferStorage(36161,33189,b.drawingBufferWidth,b.drawingBufferHeight),b.bindRenderbuffer(36161,c))},Al=()=>{var a=K,b=a.C,c=b.getParameter(3089);c&&b.disable(3089);var d=b.getParameter(36006);if(b.blitFramebuffer&&
!a.ub)b.bindFramebuffer(36008,a.Ya),b.bindFramebuffer(36009,null),b.blitFramebuffer(0,0,b.canvas.width,b.canvas.height,0,0,b.canvas.width,b.canvas.height,16384,9728);else{b.bindFramebuffer(36160,null);var e=b.getParameter(35725);b.useProgram(a.Qb);var f=b.getParameter(34964);b.bindBuffer(34962,a.Rb);var g=b.getParameter(34016);b.activeTexture(33984);var k=b.getParameter(32873);b.bindTexture(3553,a.ya);var l=b.getParameter(3042);l&&b.disable(3042);var q=b.getParameter(2884);q&&b.disable(2884);var u=
b.getParameter(2929);u&&b.disable(2929);var z=b.getParameter(2960);z&&b.disable(2960);function X(){b.vertexAttribPointer(a.H,2,5126,!1,0,0);b.drawArrays(5,0,4)}if(a.Ia){var B=b.getParameter(34229);b.bindVertexArray(a.Ia);X();b.bindVertexArray(B)}else{B={buffer:b.getVertexAttrib(a.H,34975),size:b.getVertexAttrib(a.H,34339),Ic:b.getVertexAttrib(a.H,34340),type:b.getVertexAttrib(a.H,34341),vc:b.getVertexAttrib(a.H,34922),sd:b.getVertexAttribOffset(a.H,34373)};for(var L=b.getParameter(34921),U=[],y=0;y<
L;++y){var S=b.getVertexAttrib(y,34338),V=y==a.H;S&&!V&&b.disableVertexAttribArray(y);!S&&V&&b.enableVertexAttribArray(y);U[y]=S}X();for(y=0;y<L;++y)S=U[y],V=y==a.H,S&&!V&&b.enableVertexAttribArray(y),!S&&V&&b.disableVertexAttribArray(y);b.bindBuffer(34962,B.buffer);b.vertexAttribPointer(a.H,B.size,B.type,B.vc,B.Ic,B.offset)}z&&b.enable(2960);u&&b.enable(2929);q&&b.enable(2884);l&&b.enable(3042);b.bindTexture(3553,k);b.activeTexture(g);b.bindBuffer(34962,f);b.useProgram(e)}b.bindFramebuffer(36160,
d);c&&b.enable(3089)},Bl=a=>{K=nl[a];v.xa=J=K?.C;return!(a&&!J)},xl=a=>{a||=K;if(!a.lc){a.lc=!0;var b=a.C;$k(b);al(b);bl(b);cl(b);dl(b);2<=a.version&&(b.vb=b.getExtension("EXT_disjoint_timer_query_webgl2"));if(2>a.version||!b.vb)b.vb=b.getExtension("EXT_disjoint_timer_query");b.tc=b.getExtension("WEBGL_multi_draw");el(b).forEach(c=>{c.includes("lose_context")||c.includes("debug")||b.getExtension(c)})}},Cl={},ul,K,Ac=a=>{J=v.xa=K=a},Dl=[],Bc=(a,b,c,d,e)=>{d/=2;Dl.length=d;c=e>>3;for(e=0;e<d;e++)Dl[e]=
Za[c+2*e]?Za[c+2*e+1]:na()[c+2*e+1];x(!b);c=El[a];x(!(a&&b));x(c.length==d,"Call args mismatch in _emscripten_receive_on_main_thread_js");a=c(...Dl);x("bigint"!=typeof a);return a};function Cc(){if(w)return C(36,1);Ti=!1;Oi=0}var Dc=a=>{w?postMessage({cmd:"cleanupThread",thread:a}):Ki(a)},Ec=()=>{};
function Fc(a,b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);p()[b>>2]=a.getUTCSeconds();p()[b+4>>2]=a.getUTCMinutes();p()[b+8>>2]=a.getUTCHours();p()[b+12>>2]=a.getUTCDate();p()[b+16>>2]=a.getUTCMonth();p()[b+20>>2]=a.getUTCFullYear()-1900;p()[b+24>>2]=a.getUTCDay();a=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;p()[b+28>>2]=a}var Fl=[0,31,60,91,121,152,182,213,244,274,305,335],Gl=[0,31,59,90,120,151,181,212,243,273,304,334];
function Gc(a,b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);p()[b>>2]=a.getSeconds();p()[b+4>>2]=a.getMinutes();p()[b+8>>2]=a.getHours();p()[b+12>>2]=a.getDate();p()[b+16>>2]=a.getMonth();p()[b+20>>2]=a.getFullYear()-1900;p()[b+24>>2]=a.getDay();var c=a.getFullYear();c=(0!==c%4||0===c%100&&0!==c%400?Gl:Fl)[a.getMonth()]+a.getDate()-1|0;p()[b+28>>2]=c;p()[b+36>>2]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),
0,1)).getTimezoneOffset();a=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0;p()[b+32>>2]=a}
var Hc=(a,b,c,d)=>{var e=(new Date).getFullYear(),f=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();var g=Math.max(f,e);r()[a>>2]=60*g;p()[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);x(a);x(b);x(16>=uj(a),`timezone name truncated to fit in TZNAME_MAX (${a})`);x(16>=uj(b),`timezone name truncated to fit in TZNAME_MAX (${b})`);e<f?(Wk(a,c,17),Wk(b,d,17)):(Wk(a,
d,17),Wk(b,c,17))},Rl=(a,b)=>{Hl=a;Il=b;if(Jl)if(Kl||(Oi+=1,Kl=!0),0==a)Ll=function(){var d=Math.max(0,Ml+b-Pc())|0;setTimeout(Nl,d)},Ol="timeout";else if(1==a)Ll=function(){Pl(Nl)},Ol="rAF";else{if(2==a){if("undefined"==typeof Ql)if("undefined"==typeof setImmediate){var c=[];addEventListener("message",d=>{if("setimmediate"===d.data||"setimmediate"===d.data.target)d.stopPropagation(),c.shift()()},!0);Ql=function(d){c.push(d);ua?(v.setImmediates??(v.setImmediates=[]),v.setImmediates.push(d),postMessage({target:"setimmediate"})):
postMessage("setimmediate","*")}}else Ql=setImmediate;Ll=function(){Ql(Nl)};Ol="immediate"}}else A("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.")},Pc;Pc=()=>performance.timeOrigin+performance.now();
var Yl=(a,b,c,d,e)=>{function f(){return g<Sl?(x(0<Oi),--Oi,Xk(),!1):!0}x(!Jl,"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.");Jl=a;Tl=d;var g=Sl;Kl=!1;Nl=function(){if(!Xa)if(0<Ul.length){var k=Ul.shift();k.hd(k.qb);if(Vl){var l=Vl,q=0==l%1?l-1:Math.floor(l);Vl=k.bd?q:(8*l+(q+.5))/9}v.setStatus&&(k=v.statusMessage||"Please wait...",l=Vl,q=Wl.gd,l?l<q?v.setStatus("{message} ({expected - remaining}/{expected})"):
v.setStatus(k):v.setStatus(""));f()&&setTimeout(Nl,0)}else f()&&(Xl=Xl+1|0,1==Hl&&1<Il&&0!=Xl%Il?Ll():(0==Hl&&(Ml=Pc()),"timeout"===Ol&&v.xa&&(Ci("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!"),Ol=""),Xa||v.preMainLoop&&!1===v.preMainLoop()||(Yk(a),v.postMainLoop?.()),cb(),f()&&("object"==typeof SDL&&SDL.audio?.ud?.(),
Ll())))};e||(b&&0<b?Rl(0,1E3/b):Rl(1,1),Ll());if(c)throw"unwind";},Zl=a=>{Oi+=1;setTimeout(()=>{x(0<Oi);--Oi;Yk(a)},1E4)},Kl=!1,Ll=null,Ol="",Sl=0,Jl=null,Tl=0,Hl=0,Il=0,Xl=0,Ul=[];function $l(){Ll=null;Sl++}function am(){Sl++;var a=Hl,b=Il,c=Jl;Jl=null;Yl(c,0,!1,Tl,!0);Rl(a,b);Ll()}var Wl={},Ml,Nl,Vl,bm=!1,cm=!1,dm=[];
function em(){function a(){cm=document.pointerLockElement===v.canvas||document.mozPointerLockElement===v.canvas||document.webkitPointerLockElement===v.canvas||document.msPointerLockElement===v.canvas}if(!fm){fm=!0;Ij.push({canHandle:function(c){return!v.rd&&/\.(jpg|jpeg|png|bmp)$/i.test(c)},handle:function(c,d,e,f){var g=new Blob([c],{type:gm(d)});g.size!==c.length&&(g=new Blob([(new Uint8Array(c)).buffer],{type:gm(d)}));var k=URL.createObjectURL(g);x("string"==typeof k,"createObjectURL must return a url as a string");
var l=new Image;l.onload=()=>{x(l.complete,`Image ${d} could not be decoded`);var q=document.createElement("canvas");q.width=l.width;q.height=l.height;q.getContext("2d").drawImage(l,0,0);URL.revokeObjectURL(k);e?.(c)};l.onerror=()=>{A(`Image ${k} could not be decoded`);f?.()};l.src=k}});Ij.push({canHandle:function(c){return!v.qd&&c.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(c,d,e){function f(){g||(g=!0,e?.(c))}var g=!1,k=URL.createObjectURL(new Blob([c],{type:gm(d)}));x("string"==typeof k,
"createObjectURL must return a url as a string");var l=new Audio;l.addEventListener("canplaythrough",()=>f(l),!1);l.onerror=function(){if(!g){A(`warning: browser could not fully decode audio ${d}, trying slower base64 approach`);for(var q="",u=0,z=0,B=0;B<c.length;B++)for(u=u<<8|c[B],z+=8;6<=z;){var L=u>>z-6&63;z-=6;q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[L]}2==z?(q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(u&3)<<4],q+="=="):4==z&&(q+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(u&
15)<<2],q+="=");l.src="data:audio/x-"+d.substr(-3)+";base64,"+q;f(l)}};l.src=k;Zl(()=>{f(l)})}});var b=v.canvas;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),v.elementPointerLock&&b.addEventListener("click",c=>{!cm&&v.canvas.requestPointerLock&&(v.canvas.requestPointerLock(),c.preventDefault())},!1))}}var hm=!1,im=void 0,jm=void 0;
function km(){if(!bm)return!1;(document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]);return!0}var lm=0;function Pl(a){if("function"==typeof requestAnimationFrame)requestAnimationFrame(a);else{var b=Date.now();if(0===lm)lm=b+1E3/60;else for(;b+2>=lm;)lm+=1E3/60;setTimeout(a,Math.max(lm-b,0))}}
function gm(a){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)]}var mm=[];function nm(){var a=v.canvas;mm.forEach(b=>b(a.width,a.height))}
function om(a,b,c){b&&c?(a.Oc=b,a.jc=c):(b=a.Oc,c=a.jc);var d=b,e=c;v.forcedAspectRatio&&0<v.forcedAspectRatio&&(d/e<v.forcedAspectRatio?d=Math.round(e*v.forcedAspectRatio):e=Math.round(d/v.forcedAspectRatio));if((document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===a.parentNode&&"undefined"!=typeof screen){var f=Math.min(screen.width/d,screen.height/e);d=Math.round(d*f);e=Math.round(e*
f)}jm?(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 Ql,fm,Ic=()=>{$l();Jl=null},Jc=()=>{ua||Ci("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")},Kc=()=>Date.now(),Lc=a=>A(F(a)),Mc=()=>{Oi+=1;throw"unwind";};function Nc(a){if(w)return C(37,1,a);Cc();lf(a)}
var Oc=()=>2147483648,Qc=a=>J.activeTexture(a),Rc=(a,b)=>{J.attachShader(hl[a],ll[b])},Sc=a=>J.beginTransformFeedback(a),Tc=(a,b)=>{35051==a?J.Xa=b:35052==a&&(J.Y=b);J.bindBuffer(a,gl[b])},Uc=(a,b,c)=>{J.bindBufferBase(a,b,gl[c])},Vc=(a,b,c,d,e)=>{J.bindBufferRange(a,b,gl[c],d,e)},Wc=(a,b)=>{J.bindFramebuffer(a,b?il[b]:K.Ya)},Xc=(a,b)=>{J.bindRenderbuffer(a,jl[b])},Yc=(a,b)=>{J.bindTexture(a,kl[b])},Zc=a=>{J.bindVertexArray(ml[a])},$c=(a,b,c,d)=>J.blendColor(a,b,c,d),ad=a=>J.blendEquation(a),bd=(a,
b)=>J.blendFunc(a,b),cd=(a,b,c,d)=>J.blendFuncSeparate(a,b,c,d),dd=(a,b,c,d,e,f,g,k,l,q)=>J.blitFramebuffer(a,b,c,d,e,f,g,k,l,q),ed=(a,b,c,d)=>{2<=K.version?c&&b?J.bufferData(a,n(),d,c,b):J.bufferData(a,b,d):J.bufferData(a,c?n().subarray(c,c+b):b,d)},fd=(a,b,c,d)=>{2<=K.version?c&&J.bufferSubData(a,b,n(),d,c):J.bufferSubData(a,b,n().subarray(d,d+c))},gd=a=>J.checkFramebufferStatus(a),hd=a=>J.clear(a),jd=(a,b,c)=>{J.clearBufferfv(a,b,t(),c>>2)},kd=(a,b,c,d)=>J.clearColor(a,b,c,d),ld=a=>J.clearDepth(a),
md=(a,b,c,d)=>{J.colorMask(!!a,!!b,!!c,!!d)},nd=a=>{J.compileShader(ll[a])},od=(a,b,c,d,e,f,g,k)=>{2<=K.version?J.Y||!g?J.compressedTexImage2D(a,b,c,d,e,f,g,k):J.compressedTexImage2D(a,b,c,d,e,f,n(),k,g):J.compressedTexImage2D(a,b,c,d,e,f,k?n().subarray(k,k+g):null)},pd=(a,b,c,d,e,f,g,k,l)=>{J.Y?J.compressedTexImage3D(a,b,c,d,e,f,g,k,l):J.compressedTexImage3D(a,b,c,d,e,f,g,n(),l,k)},qd=(a,b,c,d,e,f,g,k,l,q,u)=>{J.Y?J.compressedTexSubImage3D(a,b,c,d,e,f,g,k,l,q,u):J.compressedTexSubImage3D(a,b,c,d,
e,f,g,k,l,n(),u,q)},rd=(a,b,c,d,e)=>J.copyBufferSubData(a,b,c,d,e),sd=()=>{var a=tl(hl),b=J.createProgram();b.name=a;b.Oa=b.Ma=b.Na=0;b.kb=1;hl[a]=b;return a},td=a=>{var b=tl(ll);ll[b]=J.createShader(a);return b},ud=a=>J.cullFace(a),vd=(a,b)=>{for(var c=0;c<a;c++){var d=p()[b+4*c>>2],e=gl[d];e&&(J.deleteBuffer(e),e.name=0,gl[d]=null,d==J.Xa&&(J.Xa=0),d==J.Y&&(J.Y=0))}},wd=(a,b)=>{for(var c=0;c<a;++c){var d=p()[b+4*c>>2],e=il[d];e&&(J.deleteFramebuffer(e),e.name=0,il[d]=null)}},xd=a=>{if(a){var b=
hl[a];b?(J.deleteProgram(b),b.name=0,hl[a]=null):ul||=1281}},yd=(a,b)=>{for(var c=0;c<a;c++){var d=p()[b+4*c>>2],e=ol[d];e&&(J.deleteQuery(e),ol[d]=null)}},zd=(a,b)=>{for(var c=0;c<a;c++){var d=p()[b+4*c>>2],e=jl[d];e&&(J.deleteRenderbuffer(e),e.name=0,jl[d]=null)}},Ad=a=>{if(a){var b=ll[a];b?(J.deleteShader(b),ll[a]=null):ul||=1281}},Bd=a=>{if(a){var b=pl[a];b?(J.deleteSync(b),b.name=0,pl[a]=null):ul||=1281}},Cd=(a,b)=>{for(var c=0;c<a;c++){var d=p()[b+4*c>>2],e=kl[d];e&&(J.deleteTexture(e),e.name=
0,kl[d]=null)}},Dd=(a,b)=>{for(var c=0;c<a;c++){var d=p()[b+4*c>>2];J.deleteVertexArray(ml[d]);ml[d]=null}},Ed=a=>J.depthFunc(a),Fd=a=>{J.depthMask(!!a)},Gd=a=>J.disable(a),Hd=a=>{J.disableVertexAttribArray(a)},Id=(a,b,c)=>{J.drawArrays(a,b,c)},Jd=(a,b,c,d)=>{J.drawArraysInstanced(a,b,c,d)},pm=[],Kd=(a,b)=>{for(var c=pm[a],d=0;d<a;d++)c[d]=p()[b+4*d>>2];J.drawBuffers(c)},Ld=(a,b,c,d)=>{J.drawElements(a,b,c,d)},Md=(a,b,c,d,e)=>{J.drawElementsInstanced(a,b,c,d,e)},Nd=a=>J.enable(a),Od=a=>{J.enableVertexAttribArray(a)},
Pd=()=>J.endTransformFeedback(),Qd=(a,b)=>(a=J.fenceSync(a,b))?(b=tl(pl),a.name=b,pl[b]=a,b):0,Rd=()=>J.finish(),Sd=(a,b,c,d)=>{J.framebufferRenderbuffer(a,b,c,jl[d])},Td=(a,b,c,d,e)=>{J.framebufferTexture2D(a,b,c,kl[d],e)},Ud=(a,b,c,d,e)=>{J.framebufferTextureLayer(a,b,kl[c],d,e)},Vd=a=>J.frontFace(a),Wd=(a,b)=>{vl(a,b,"createBuffer",gl)},Xd=(a,b)=>{vl(a,b,"createFramebuffer",il)},Yd=(a,b)=>{vl(a,b,"createQuery",ol)},$d=(a,b)=>{vl(a,b,"createRenderbuffer",jl)},ae=(a,b)=>{vl(a,b,"createTexture",kl)},
be=(a,b)=>{vl(a,b,"createVertexArray",ml)},ce=a=>J.generateMipmap(a);function qm(){var a=el(J);return a=a.concat(a.map(b=>"GL_"+b))}
var rm=(a,b,c)=>{if(b){var d=void 0;switch(a){case 36346:d=1;break;case 36344:0!=c&&1!=c&&(ul||=1280);return;case 34814:case 36345:d=0;break;case 34466:var e=J.getParameter(34467);d=e?e.length:0;break;case 33309:if(2>K.version){ul||=1282;return}d=qm().length;break;case 33307:case 33308:if(2>K.version){ul||=1280;return}d=33307==a?3:0}if(void 0===d)switch(e=J.getParameter(a),typeof e){case "number":d=e;break;case "boolean":d=e?1:0;break;case "string":ul||=1280;return;case "object":if(null===e)switch(a){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:d=
0;break;default:ul||=1280;return}else{if(e instanceof Float32Array||e instanceof Uint32Array||e instanceof Int32Array||e instanceof Array){for(a=0;a<e.length;++a)switch(c){case 0:p()[b+4*a>>2]=e[a];break;case 2:t()[b+4*a>>2]=e[a];break;case 4:m()[b+a]=e[a]?1:0}return}try{d=e.name|0}catch(f){ul||=1280;A(`GL_INVALID_ENUM in glGet${c}v: Unknown object returned from WebGL getParameter(${a})! (error: ${f})`);return}}break;default:ul||=1280;A(`GL_INVALID_ENUM in glGet${c}v: Native code calling glGet${c}v(${a}) and it returns ${e} of type ${typeof e}!`);
return}switch(c){case 1:c=d;r()[b>>2]=c;a=r()[b>>2];r()[b+4>>2]=(c-a)/4294967296;a=0<=c?r()[b>>2]+4294967296*r()[b+4>>2]:r()[b>>2]+4294967296*p()[b+4>>2];b>>=2;a!=c&&Ci(`writeI53ToI64() out of range: serialized JS Number ${c} to Wasm heap as bytes lo=${db(r()[b])}, hi=${db(r()[b+1])}, which deserializes back to ${a} instead!`);break;case 0:p()[b>>2]=d;break;case 2:t()[b>>2]=d;break;case 4:m()[b]=d?1:0}}else ul||=1281},de=(a,b)=>rm(a,b,2),ee=(a,b)=>{rm(a,b,1)},fe=(a,b)=>rm(a,b,0),ge=(a,b,c,d)=>{a=
J.getProgramInfoLog(hl[a]);null===a&&(a="(unknown error)");b=0<b&&d?Wk(a,d,b):0;c&&(p()[c>>2]=b)},he=(a,b,c)=>{if(c)if(a>=fl)ul||=1281;else if(a=hl[a],35716==b)a=J.getProgramInfoLog(a),null===a&&(a="(unknown error)"),p()[c>>2]=a.length+1;else if(35719==b){if(!a.Oa)for(b=0;b<J.getProgramParameter(a,35718);++b)a.Oa=Math.max(a.Oa,J.getActiveUniform(a,b).name.length+1);p()[c>>2]=a.Oa}else if(35722==b){if(!a.Ma)for(b=0;b<J.getProgramParameter(a,35721);++b)a.Ma=Math.max(a.Ma,J.getActiveAttrib(a,b).name.length+
1);p()[c>>2]=a.Ma}else if(35381==b){if(!a.Na)for(b=0;b<J.getProgramParameter(a,35382);++b)a.Na=Math.max(a.Na,J.getActiveUniformBlockName(a,b).length+1);p()[c>>2]=a.Na}else p()[c>>2]=J.getProgramParameter(a,b);else ul||=1281},ie=(a,b,c,d)=>{a=J.getShaderInfoLog(ll[a]);null===a&&(a="(unknown error)");b=0<b&&d?Wk(a,d,b):0;c&&(p()[c>>2]=b)},je=(a,b,c)=>{c?35716==b?(a=J.getShaderInfoLog(ll[a]),null===a&&(a="(unknown error)"),a=a?a.length+1:0,p()[c>>2]=a):35720==b?(a=(a=J.getShaderSource(ll[a]))?a.length+
1:0,p()[c>>2]=a):p()[c>>2]=J.getShaderParameter(ll[a],b):ul||=1281},sm=a=>{var b=uj(a)+1,c=wl(b);c&&Wk(a,c,b);return c},ke=a=>{var b=ql[a];if(!b){switch(a){case 7939:b=sm(qm().join(" "));break;case 7936:case 7937:case 37445:case 37446:(b=J.getParameter(a))||(ul||=1280);b=b?sm(b):0;break;case 7938:b=J.getParameter(7938);b=2<=K.version?`OpenGL ES 3.0 (${b})`:`OpenGL ES 2.0 (${b})`;b=sm(b);break;case 35724:b=J.getParameter(35724);var c=b.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==c&&
(3==c[1].length&&(c[1]+="0"),b=`OpenGL ES GLSL ES ${c[1]} (${b})`);b=sm(b);break;default:ul||=1280}ql[a]=b}return b},le=(a,b,c,d,e)=>{0>c?ul||=1281:e?(a=J.getSyncParameter(pl[a],b),null!==a&&(p()[e>>2]=a,d&&(p()[d>>2]=1))):ul||=1281},me=(a,b)=>J.getUniformBlockIndex(hl[a],F(b)),tm=a=>"]"==a.slice(-1)&&a.lastIndexOf("["),ne=(a,b)=>{b=F(b);if(a=hl[a]){var c=a,d=c.Fa,e=c.Kb,f;if(!d)for(c.Fa=d={},c.Jb={},f=0;f<J.getProgramParameter(c,35718);++f){var g=J.getActiveUniform(c,f);var k=g.name;g=g.size;var l=
tm(k);l=0<l?k.slice(0,l):k;var q=c.kb;c.kb+=g;e[l]=[g,q];for(k=0;k<g;++k)d[q]=k,c.Jb[q++]=l}c=a.Fa;d=0;e=b;f=tm(b);0<f&&(d=parseInt(b.slice(f+1))>>>0,e=b.slice(0,f));if((e=a.Kb[e])&&d<e[0]&&(d+=e[1],c[d]=c[d]||J.getUniformLocation(a,b)))return d}else ul||=1281;return-1},oe=a=>{a=hl[a];J.linkProgram(a);a.Fa=0;a.Kb={}},pe=(a,b)=>{3317==a?rl=b:3314==a&&(sl=b);J.pixelStorei(a,b)},qe=a=>J.readBuffer(a),um=a=>{a-=5120;return 0==a?m():1==a?n():2==a?fa():4==a?p():6==a?t():5==a||28922==a||28520==a||30779==
a||30782==a?r():ia()},vm=(a,b,c,d,e)=>{a=um(a);b=d*((sl||c)*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[b-6402]||1)*a.BYTES_PER_ELEMENT+rl-1&-rl);return a.subarray(e>>>31-Math.clz32(a.BYTES_PER_ELEMENT),e+b>>>31-Math.clz32(a.BYTES_PER_ELEMENT))},re=(a,b,c,d,e,f,g)=>{if(2<=K.version)if(J.Xa)J.readPixels(a,b,c,d,e,f,g);else{var k=um(f);g>>>=31-Math.clz32(k.BYTES_PER_ELEMENT);J.readPixels(a,b,c,d,e,f,k,g)}else(k=vm(f,e,c,d,g))?J.readPixels(a,b,c,d,e,f,k):ul||=1280},se=(a,b,c,d)=>J.renderbufferStorage(a,
b,c,d),te=(a,b,c,d,e)=>J.renderbufferStorageMultisample(a,b,c,d,e),ue=(a,b,c,d)=>J.scissor(a,b,c,d),ve=(a,b,c,d)=>{for(var e="",f=0;f<b;++f){var g=d?r()[d+4*f>>2]:void 0;e+=F(r()[c+4*f>>2],g)}J.shaderSource(ll[a],e)},we=(a,b,c,d,e,f,g,k,l)=>{if(2<=K.version){if(J.Y){J.texImage2D(a,b,c,d,e,f,g,k,l);return}if(l){var q=um(k);l>>>=31-Math.clz32(q.BYTES_PER_ELEMENT);J.texImage2D(a,b,c,d,e,f,g,k,q,l);return}}q=l?vm(k,g,d,e,l):null;J.texImage2D(a,b,c,d,e,f,g,k,q)},xe=(a,b,c,d,e,f,g,k,l,q)=>{if(J.Y)J.texImage3D(a,
b,c,d,e,f,g,k,l,q);else if(q){var u=um(l);J.texImage3D(a,b,c,d,e,f,g,k,l,u,q>>>31-Math.clz32(u.BYTES_PER_ELEMENT))}else J.texImage3D(a,b,c,d,e,f,g,k,l,null)},ye=(a,b,c)=>J.texParameterf(a,b,c),ze=(a,b,c)=>J.texParameteri(a,b,c),Ae=(a,b,c,d,e)=>J.texStorage2D(a,b,c,d,e),Be=(a,b,c,d,e,f,g,k,l,q,u)=>{if(J.Y)J.texSubImage3D(a,b,c,d,e,f,g,k,l,q,u);else if(u){var z=um(q);J.texSubImage3D(a,b,c,d,e,f,g,k,l,q,z,u>>>31-Math.clz32(z.BYTES_PER_ELEMENT))}else J.texSubImage3D(a,b,c,d,e,f,g,k,l,q,null)},Ce=(a,b,
c,d)=>{a=hl[a];for(var e=[],f=0;f<b;f++)e.push(F(p()[c+4*f>>2]));J.transformFeedbackVaryings(a,e,d)},wm=a=>{var b=J.Yb;if(b){var c=b.Fa[a];"number"==typeof c&&(b.Fa[a]=c=J.getUniformLocation(b,b.Jb[a]+(0<c?`[${c}]`:"")));return c}ul||=1282},De=(a,b)=>{J.uniform1f(wm(a),b)},Ee=(a,b)=>{J.uniform1i(wm(a),b)},xm=[],Fe=(a,b,c)=>{if(2<=K.version)b&&J.uniform1iv(wm(a),p(),c>>2,b);else{if(288>=b)for(var d=xm[b],e=0;e<b;++e)d[e]=p()[c+4*e>>2];else d=p().subarray(c>>2,c+4*b>>2);J.uniform1iv(wm(a),d)}},Ge=(a,
b)=>{J.uniform1ui(wm(a),b)},He=(a,b,c)=>{b&&J.uniform1uiv(wm(a),r(),c>>2,b)},Ie=(a,b,c)=>{J.uniform2f(wm(a),b,c)},ym=[],Je=(a,b,c)=>{if(2<=K.version)b&&J.uniform2fv(wm(a),t(),c>>2,2*b);else{if(144>=b)for(var d=ym[2*b],e=0;e<2*b;e+=2)d[e]=t()[c+4*e>>2],d[e+1]=t()[c+(4*e+4)>>2];else d=t().subarray(c>>2,c+8*b>>2);J.uniform2fv(wm(a),d)}},Ke=(a,b,c)=>{if(2<=K.version)b&&J.uniform2iv(wm(a),p(),c>>2,2*b);else{if(144>=b)for(var d=xm[2*b],e=0;e<2*b;e+=2)d[e]=p()[c+4*e>>2],d[e+1]=p()[c+(4*e+4)>>2];else d=p().subarray(c>>
2,c+8*b>>2);J.uniform2iv(wm(a),d)}},Le=(a,b,c)=>{if(2<=K.version)b&&J.uniform3fv(wm(a),t(),c>>2,3*b);else{if(96>=b)for(var d=ym[3*b],e=0;e<3*b;e+=3)d[e]=t()[c+4*e>>2],d[e+1]=t()[c+(4*e+4)>>2],d[e+2]=t()[c+(4*e+8)>>2];else d=t().subarray(c>>2,c+12*b>>2);J.uniform3fv(wm(a),d)}},Me=(a,b,c,d,e)=>{J.uniform4f(wm(a),b,c,d,e)},Ne=(a,b,c)=>{if(2<=K.version)b&&J.uniform4fv(wm(a),t(),c>>2,4*b);else{if(72>=b){var d=ym[4*b],e=t();c>>=2;for(var f=0;f<4*b;f+=4){var g=c+f;d[f]=e[g];d[f+1]=e[g+1];d[f+2]=e[g+2];d[f+
3]=e[g+3]}}else d=t().subarray(c>>2,c+16*b>>2);J.uniform4fv(wm(a),d)}},Oe=(a,b,c)=>{a=hl[a];J.uniformBlockBinding(a,b,c)},Pe=(a,b,c,d)=>{if(2<=K.version)b&&J.uniformMatrix3fv(wm(a),!!c,t(),d>>2,9*b);else{if(32>=b)for(var e=ym[9*b],f=0;f<9*b;f+=9)e[f]=t()[d+4*f>>2],e[f+1]=t()[d+(4*f+4)>>2],e[f+2]=t()[d+(4*f+8)>>2],e[f+3]=t()[d+(4*f+12)>>2],e[f+4]=t()[d+(4*f+16)>>2],e[f+5]=t()[d+(4*f+20)>>2],e[f+6]=t()[d+(4*f+24)>>2],e[f+7]=t()[d+(4*f+28)>>2],e[f+8]=t()[d+(4*f+32)>>2];else e=t().subarray(d>>2,d+36*
b>>2);J.uniformMatrix3fv(wm(a),!!c,e)}},Qe=(a,b,c,d)=>{if(2<=K.version)b&&J.uniformMatrix4fv(wm(a),!!c,t(),d>>2,16*b);else{if(18>=b){var e=ym[16*b],f=t();d>>=2;for(var g=0;g<16*b;g+=16){var k=d+g;e[g]=f[k];e[g+1]=f[k+1];e[g+2]=f[k+2];e[g+3]=f[k+3];e[g+4]=f[k+4];e[g+5]=f[k+5];e[g+6]=f[k+6];e[g+7]=f[k+7];e[g+8]=f[k+8];e[g+9]=f[k+9];e[g+10]=f[k+10];e[g+11]=f[k+11];e[g+12]=f[k+12];e[g+13]=f[k+13];e[g+14]=f[k+14];e[g+15]=f[k+15]}}else e=t().subarray(d>>2,d+64*b>>2);J.uniformMatrix4fv(wm(a),!!c,e)}},Re=
a=>{a=hl[a];J.useProgram(a);J.Yb=a},Se=(a,b,c,d,e)=>J.vertexAttrib4f(a,b,c,d,e),Te=(a,b)=>{J.vertexAttribDivisor(a,b)},Ue=(a,b,c,d,e)=>J.vertexAttribI4ui(a,b,c,d,e),Ve=(a,b,c,d,e)=>{J.vertexAttribIPointer(a,b,c,d,e)},We=(a,b,c,d,e,f)=>{J.vertexAttribPointer(a,b,c,!!d,e,f)},Xe=(a,b,c,d)=>J.viewport(a,b,c,d),Ye=()=>navigator.hardwareConcurrency,Ze=a=>{var b=n().length;a>>>=0;if(a<=b)return!1;if(2147483648<a)return A(`Cannot enlarge memory, requested ${a} bytes, but the limit is ${2147483648} bytes!`),
!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);var e=Math;d=Math.max(a,d);e=e.min.call(e,2147483648,d+(65536-d%65536)%65536);a:{d=e;var f=aa.buffer,g=(d-f.byteLength+65535)/65536;try{aa.grow(g);da();var k=1;break a}catch(l){A(`growMemory: Attempted to grow heap from ${f.byteLength} bytes to ${d} bytes, but got error: ${l}`)}k=void 0}if(k)return!0}A(`Failed to grow the heap from ${b} bytes to ${e} bytes, not enough memory!`);return!1},zm=[],Am={},Bm=[0,"undefined"!=typeof document?
document:0,"undefined"!=typeof window?window:0],Cm=a=>{a=2<a?F(a):a;return Bm[a]||("undefined"!=typeof document?document.querySelector(a):void 0)},Dm=(a,b,c)=>{a=Cm(a);if(!a||a.ad)return-4;var d=!1;a.ha?.C&&(d=a.ha.C.getParameter(2978),d=0===d[0]&&0===d[1]&&d[2]===a.width&&d[3]===a.height);a.width=b;a.height=c;d&&a.ha.C.viewport(0,0,b,c);a.ha&&yl(a.ha);return 0};function Em(a,b,c){return w?C(38,1,a,b,c):Dm(a,b,c)}
var $e=(a,b,c)=>Cm(a)?Dm(a,b,c):Em(a,b,c),af=(a,b,c)=>{a=gj.get(a);Yl(a,b,c)},bf=()=>0;function cf(a){if(w)return C(39,1,a);K==a&&(K=0);K===nl[a]&&(K=null);if("object"==typeof Am)for(var b=nl[a].C.canvas,c=0;c<zm.length;++c)if(zm[c].target==b){var d=c--,e=zm[d];e.target.removeEventListener(e.fd,e.ed,e.Bd);zm.splice(d,1)}nl[a]&&nl[a].C.canvas&&(nl[a].C.canvas.ha=void 0);M(nl[a].handle);nl[a]=null}var df=()=>K&&K.C?K.Ya?(Al(),0):K.attributes.xb?0:-3:-3;
function Fm(a,b){return w?C(40,1,a,b):ef(a,b)}
var Gm=["default","low-power","high-performance"],ef=(a,b)=>{x(b);var c=b>>2,d=p()[c+2];c={alpha:!!m()[b+0],depth:!!m()[b+1],stencil:!!m()[b+2],antialias:!!m()[b+3],premultipliedAlpha:!!m()[b+4],preserveDrawingBuffer:!!m()[b+5],powerPreference:Gm[d],failIfMajorPerformanceCaveat:!!m()[b+12],$a:p()[c+4],od:p()[c+5],wb:m()[b+24],xb:m()[b+25],Hb:p()[c+7],Ta:m()[b+32]};d=Cm(a);if(w&&(2===c.Hb||!d&&1===c.Hb))return m()[b+32]=1,m()[b+5]=1,Fm(a,b);if(!d)return 0;c.xb&&!c.Ta&&(c.Ta=!0);return zl(d,c)};
function ff(a,b){if(w)return C(41,1,a,b);a=nl[a];b=F(b);b.startsWith("GL_")&&(b=b.substr(3));"ANGLE_instanced_arrays"==b&&$k(J);"OES_vertex_array_object"==b&&al(J);"WEBGL_draw_buffers"==b&&bl(J);"WEBGL_draw_instanced_base_vertex_base_instance"==b&&cl(J);"WEBGL_multi_draw_instanced_base_vertex_base_instance"==b&&dl(J);"WEBGL_multi_draw"==b&&(J.tc=J.getExtension("WEBGL_multi_draw"));return!!a.C.getExtension(b)}function gf(){return w?C(42,1):sm(J.getSupportedExtensions().join(" "))}
var hf=a=>Bl(a)?0:-5,Hm={},Jm=()=>{if(!Im){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",_:za||"./this.program"},b;for(b in Hm)void 0===Hm[b]?delete a[b]:a[b]=Hm[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Im=c}return Im},Im;
function jf(a,b){if(w)return C(43,1,a,b);var c=0;Jm().forEach((d,e)=>{var f=b+c;e=r()[a+4*e>>2]=f;for(f=0;f<d.length;++f)x(d.charCodeAt(f)===(d.charCodeAt(f)&255)),m()[e++]=d.charCodeAt(f);m()[e]=0;c+=d.length+1});return 0}function kf(a,b){if(w)return C(44,1,a,b);var c=Jm();r()[a>>2]=c.length;var d=0;c.forEach(e=>d+=e.length+1);r()[b>>2]=d;return 0}function mf(a){if(w)return C(45,1,a);try{var b=kk(a);$i(b);return 0}catch(c){if("undefined"==typeof I||"ErrnoError"!==c.name)throw c;return c.i}}
function nf(a,b){if(w)return C(46,1,a,b);try{var c=kk(a),d=c.o?2:Fj(c.mode)?3:40960===(c.mode&61440)?7:4;m()[b]=d;fa()[b+2>>1]=0;Za[b+8>>3]=BigInt(0);Za[b+16>>3]=BigInt(0);return 0}catch(e){if("undefined"==typeof I||"ErrnoError"!==e.name)throw e;return e.i}}
function of(a,b,c,d){if(w)return C(47,1,a,b,c,d);try{a:{var e=kk(a);a=b;for(var f,g=b=0;g<c;g++){var k=r()[a>>2],l=r()[a+4>>2];a+=8;var q=e,u=m(),z=k,B=l,L=f;x(0<=z);if(0>B||0>L)throw new G(28);if(null===q.u)throw new G(8);if(1===(q.flags&2097155))throw new G(8);if(Fj(q.node.mode))throw new G(31);if(!q.j.read)throw new G(28);var U="undefined"!=typeof L;if(!U)L=q.position;else if(!q.seekable)throw new G(70);var y=q.j.read(q,u,z,B,L);U||(q.position+=y);var S=y;if(0>S){var V=-1;break a}b+=S;if(S<l)break;
"undefined"!=typeof f&&(f+=S)}V=b}r()[d>>2]=V;return 0}catch(X){if("undefined"==typeof I||"ErrnoError"!==X.name)throw X;return X.i}}function pf(a,b,c,d){if(w)return C(48,1,a,b,c,d);b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;var e=kk(a);wk(e,b,c);Za[d>>3]=BigInt(e.position);e.ba&&0===b&&0===c&&(e.ba=null);return 0}catch(f){if("undefined"==typeof I||"ErrnoError"!==f.name)throw f;return f.i}}
function qf(a,b,c,d){if(w)return C(49,1,a,b,c,d);try{a:{var e=kk(a);a=b;for(var f,g=b=0;g<c;g++){var k=r()[a>>2],l=r()[a+4>>2];a+=8;var q=xk(e,m(),k,l,f);if(0>q){var u=-1;break a}b+=q;"undefined"!=typeof f&&(f+=q)}u=b}r()[d>>2]=u;return 0}catch(z){if("undefined"==typeof I||"ErrnoError"!==z.name)throw z;return z.i}}
function rf(a,b,c,d){function e(z,B,L,U,y,S){var V=10===z?28:16;y=10===z?Sk(y):Qk(y);V=wl(V);y=Lk(V,z,y,S);x(!y);y=wl(32);p()[y+4>>2]=z;p()[y+8>>2]=B;p()[y+12>>2]=L;r()[y+24>>2]=U;r()[y+20>>2]=V;10===z?p()[y+16>>2]=28:p()[y+16>>2]=16;p()[y+28>>2]=0;return y}if(w)return C(50,1,a,b,c,d);var f=0,g=0,k=0,l=0,q=0,u=0;c&&(k=p()[c>>2],l=p()[c+4>>2],q=p()[c+8>>2],u=p()[c+12>>2]);q&&!u&&(u=2===q?17:6);!q&&u&&(q=17===u?2:1);0===u&&(u=6);0===q&&(q=1);if(!a&&!b)return-2;if(k&-1088||0!==c&&p()[c>>2]&2&&!a)return-1;
if(k&32)return-2;if(0!==q&&1!==q&&2!==q)return-7;if(0!==l&&2!==l&&10!==l)return-6;if(b&&(b=F(b),g=parseInt(b,10),isNaN(g)))return k&1024?-2:-8;if(!a)return 0===l&&(l=2),0===(k&1)&&(2===l?f=Km(2130706433):f=[0,0,0,1]),a=e(l,q,u,null,f,g),r()[d>>2]=a,0;a=F(a);f=Ik(a);if(null!==f)if(0===l||2===l)l=2;else if(10===l&&k&8)f=[0,0,Km(65535),f],l=10;else return-2;else if(f=Kk(a),null!==f)if(0===l||10===l)l=10;else return-2;if(null!=f)return a=e(l,q,u,a,f,g),r()[d>>2]=a,0;if(k&4)return-2;a=Pk(a);f=Ik(a);0===
l?l=2:10===l&&(f=[0,0,Km(65535),f]);a=e(l,q,u,null,f,g);r()[d>>2]=a;return 0}var sf=(a,b,c,d,e,f,g)=>{b=Tk(a,b);if(b.i)return-6;a=b.port;var k=b.A;b=!1;if(c&&d){var l;if(g&1||!(l=Ok[k]?Ok[k]:null)){if(g&8)return-2}else k=l;c=Wk(k,c,d);c+1>=d&&(b=!0)}e&&f&&(c=Wk(""+a,e,f),c+1>=f&&(b=!0));return b?-12:0};function N(a){return gj.get(a)}function O(){A.apply(null,Array.from(arguments))}function Lm(){Fa.apply(null,Array.from(arguments))}function Mm(a,b){E(a,b,"*")}
function Nm(a,b,c){const d=a.BYTES_PER_ELEMENT;return a.subarray(b/d,b/d+c)}function Om(a,b,c){const d=a.BYTES_PER_ELEMENT;return a.slice(b/d,b/d+c)}function Pm(a,b){const c=[];Nm(p(),a,b).forEach(function(d){c.push(F(d))});return c}function P(a){const b=uj(a)+1,c=wl(b);Wk(a,c,b);return c}function Qm(a){const b=a.length,c=wl(4*b);for(let d=0;d<b;d++)p()[(c>>2)+d]=P(a[d]);return c}function Rm(a,b){for(let c=0;c<b;c++)M(p()[(a>>2)+c]);M(a)}
var Q=null,Sm="en",Tm=2,Um=!1,Vm=!1,Wm=null,Xm=null,Ym=!1,Zm=!1,$m=[];function an(){$m.forEach(function(a){try{pk(a)}catch(b){Lm("Already unmounted",b)}Ym&&D.aa[a]&&(D.aa[a].close(),delete D.aa[a])});$m=[];Zm=Ym=!1}function bn(){if(Zm)return O("Already syncing!"),Promise.resolve();Zm=!0;return new Promise(function(a){ok(!1,function(b){b&&O(`Failed to save IDB file system: ${b.message}`);Zm=!1;a(b)})})}
function cn(a,b){const c=a.lastIndexOf("/");let d="/";0<c&&(d=a.slice(0,c));try{Lj(d)}catch(e){44!==e.i&&O(e),Nj(d)}Oj(a,new Uint8Array(b))}function dn(){}var en=[],fn=null;function gn(a){fn.then(function(){const b=[];en.forEach(function(c){b.push(new Promise(c))});return Promise.all(b)}).then(function(){return bn()}).then(function(){setTimeout(function(){a()},0)})}var hn=null;function jn(a){if(!hn.has(a))throw new ReferenceError(`Could not find sample "${a}"`);return hn.get(a)}
function kn(a){if(null==a.h)throw Error("couldn't duplicate a null audioBuffer");const b=Array(a.h.numberOfChannels);for(var c=0;c<a.h.numberOfChannels;c++){const d=new Float32Array(a.h.getChannelData(c));b[c]=d}a=R.createBuffer(a.numberOfChannels,a.h.length,a.h.sampleRate);for(c=0;c<b.length;c++)a.copyToChannel(b[c],c,0);return a}
var ln=class{static create(a,b={}){b=new ln(a,b);hn.set(a.id,b);return b}static delete(a){hn.delete(a)}constructor(a,b={}){this.id=a.id;this.h=null;this.numberOfChannels=b.numberOfChannels??2;this.sampleRate=b.sampleRate??44100;this.ja=b.ja??"disabled";this.Bb=b.Bb??0;this.loopEnd=b.loopEnd??0;this.h=a.Pb}clear(){this.h=null;ln.delete(this.id)}};
function mn(a,b){if(8!==b.length)throw Error(`Volume length isn't "${8}", is ${b.length} instead`);a.I.gain.value=b[0]??0;a.N.gain.value=b[1]??0;a.V.gain.value=b[7]??0;a.X.gain.value=b[8]??0;a.D.gain.value=b[3]??0;a.J.gain.value=b[4]??0}
var nn=class{static create(a){return new nn(a)}constructor(a){this.ua=a;this.v=R.createChannelSplitter(6);this.I=R.createGain();this.N=R.createGain();this.V=R.createGain();this.X=R.createGain();this.D=R.createGain();this.J=R.createGain();this.h=R.createChannelMerger(6);this.v.connect(this.I,0).connect(this.h,0,0);this.v.connect(this.N,1).connect(this.h,0,1);this.v.connect(this.V,2).connect(this.h,0,2);this.v.connect(this.X,3).connect(this.h,0,3);this.v.connect(this.D,4).connect(this.h,0,4);this.v.connect(this.J,
0).connect(this.h,0,5);this.h.connect(this.ua.za())}za(){return this.v}clear(){this.ua=null;this.v.disconnect();this.v=null;this.I.disconnect();this.I=null;this.N.disconnect();this.N=null;this.V.disconnect();this.V=null;this.X.disconnect();this.X=null;this.D.disconnect();this.D=null;this.J.disconnect();this.J=null;this.h.disconnect();this.h=null}},on=null;function pn(a){a=on.get(a)??null;null!=a&&a.clear()}
function qn(a,b=!0){b?(a.J=!0,a.N=(R.currentTime-a.lb)/a.V,a.h.stop()):(rn(a),a.J=!1,a.N=0)}function sn(a){null!=a.D&&a.h.removeEventListener("ended",a.D);a.D=()=>{if(!a.J)switch(jn(a.ga).ja){case "disabled":var b=a.id;a.clear();null!=tn&&(b=P(b),tn(b),M(b));break;case "forward":case "backward":a.J=!1,a.N=0,a.lb=R.currentTime,rn(a)}};a.h.addEventListener("ended",a.D)}function un(a,b){if(!a.I.has(b)){const c=nn.create(b);a.I.set(b,c);a.h.connect(c.za())}return a.I.get(b)}
function vn(a,b){try{a.v=wn(a),a.h.connect(a.v),b&&a.start()}catch(c){if("InvalidStateError"!==c?.name)throw c;const d=v.locateFile("godot.audio.position.worklet.js");R.audioWorklet.addModule(d).then(()=>{a.nb||(a.v=wn(a),a.h.connect(a.v),b&&a.start())}).catch(e=>{O("Failed to create PositionWorklet.",e)})}}
function rn(a){null!=a.h&&a.h.disconnect();a.h=R.createBufferSource();a.h.buffer=kn(jn(a.ga));for(var b of a.I.values())a.connect(b.za());sn(a);b=a.J?a.N:0;vn(a);a.h.start(a.startTime,a.offset+b);a.X=!0}function xn(a,b,c){for(let d=0;d<b.length;d++)mn(un(a,b[d]),c.slice(8*d,8*d+8))}function wn(a){const b=new AudioWorkletNode(R,"godot-position-reporting-processor");b.port.onmessage=c=>{switch(c.data.type){case "position":a.mb=parseInt(c.data.data,10)/jn(a.ga).sampleRate+a.offset}};return b}
var yn=class{static create(a,b={}){b=new yn(a,b);on.set(a.id,b);return b}static delete(a){on.delete(a)}constructor(a,b={}){this.id=a.id;this.ga=a.ga;this.offset=b.offset??0;this.mb=b.offset;this.startTime=b.startTime??0;this.nb=this.X=this.J=!1;this.N=0;this.V=44100;this.ja=b.ja??jn(this.ga).ja??"disabled";this.ua=b.xc??1;this.lb=0;this.I=new Map;this.h=R.createBufferSource();this.v=this.D=null;this.V=b.playbackRate??44100;this.h.playbackRate.value=this.V*this.ua;this.h.buffer=kn(jn(this.ga));sn(this);
a=zn(a.Ub);mn(un(this,a),b.volume);vn(this,b.start)}start(){this.X||(this.lb=R.currentTime,this.h.start(this.startTime,this.offset),this.X=!0)}connect(a){return this.h.connect(a)}clear(){this.nb=!0;this.J=!1;this.N=0;null!=this.h&&(this.h.removeEventListener("ended",this.D),this.D=null,this.X&&this.h.stop(),this.h.disconnect(),this.h=null);for(const a of this.I.values())a.clear();this.I.clear();this.v&&(this.v.disconnect(),this.v=this.v.port.onmessage=null);yn.delete(this.id)}},An=null,Bn=null;
function zn(a){if(0>a||a>=An.length)throw new ReferenceError(`invalid bus index "${a}"`);return An[a]}function Cn(a){return 0>a||a>=An.length?null:An[a]}function Dn(a,b){const c=Cn(a);if(null!=c){var d=An.filter((e,f)=>f!==a);d.splice(b-1,0,c);An=d}}function En(a,b){if(null==b){if(0==An.indexOf(a)){a.h.connect(R.destination);return}throw Error(`Cannot send to "${b}" without the bus being at index 0 (current index: ${An.indexOf(a)})`);}a.connect(b)}
function Fn(a){a.D=!1;Bn=null;a.wa.gain.value=1;const b=An.filter(c=>c!==a);for(let c=0;c<b.length;c++)b[c].wa.gain.value=1}function Gn(a){a.D=!0;Bn=a;a.wa.gain.value=1;const b=An.filter(c=>c!==a);for(let c=0;c<b.length;c++)b[c].wa.gain.value=0}
var Hn=class{static create(){const a=new Hn,b=0===An.length;An.push(a);b?En(a,null):En(a,zn(0));return a}constructor(){this.D=!1;this.v=R.createGain();this.wa=R.createGain();this.h=R.createGain();this.v.connect(this.wa).connect(this.h)}za(){return this.v}connect(a){if(null==a)throw Error("cannot connect to null bus");this.h.disconnect();this.h.connect(a.za());return a}clear(){An=An.filter(a=>a!==this)}},tn=null,R=null,In=null,Jn=null,Kn=0;
function Ln(a,b,c){hn=new Map;on=new Map;An=[];Bn=null;const d={};a&&(d.sampleRate=a);const e=new (window.AudioContext||window.webkitAudioContext)(d);R=e;e.onstatechange=function(){let f=0;switch(e.state){case "suspended":f=0;break;case "running":f=1;break;case "closed":f=2}b(f)};e.onstatechange();Kn=setInterval(function(){let f=0;e.baseLatency&&(f+=R.baseLatency);e.outputLatency&&(f+=R.outputLatency);c(f)},1E3);en.push(Mn);return e.destination.channelCount}
function Nn(a){function b(c){try{In=R.createMediaStreamSource(c),a(In)}catch(d){O("Failed creating input.",d)}}if(In)return 0;if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia({audio:!0}).then(b,function(c){O("Error getting user media.",c)});else{navigator.getUserMedia||(navigator.getUserMedia=navigator.webkitGetUserMedia||navigator.h);if(!navigator.getUserMedia)return O("getUserMedia not available."),1;navigator.getUserMedia({audio:!0},b,function(c){Lm(c)})}return 0}
function Mn(a){const b=R;R=null;if(b){Kn&&(clearInterval(Kn),Kn=0);In&&(In.disconnect(),In=null);var c=Promise.resolve();Jn&&(c=Jn.close());c.then(function(){return b.close()}).then(function(){b.onstatechange=null;a()}).catch(function(d){b.onstatechange=null;O("Error closing AudioContext",d);a()})}else a()}function On(a,b,c){a=on.get(a)??null;null!=a&&(b=b.map(d=>zn(d)),xn(a,b,c))}function tf(a){if(w)return C(51,1,a);a=F(a);a=on.get(a)??null;return null==a?0:a.mb}
function uf(){return w?C(52,1):R&&R.audioWorklet?1:0}function vf(a,b,c,d){if(w)return C(53,1,a,b,c,d);b=N(c);d=N(d);c=fj(a,"i32");d=Ln(c,b,d);E(a,R.sampleRate,"i32");return d}function wf(){return w?C(54,1):Nn(function(a){a.connect(Jn.fc())})}function xf(){if(w)return C(55,1);if(In){const a=In.mediaStream.getTracks();for(let b=0;b<a.length;b++)a[b].stop();In.disconnect();In=null}}function yf(){return w?C(56,1):window.AudioContext||window.webkitAudioContext?1:0}
function zf(){if(w)return C(57,1);R&&"running"!==R.state&&R.resume()}function Af(a){if(w)return C(58,1,a);const b=Hn.create();a!==An.indexOf(b)&&Dn(An.indexOf(b),a)}function Bf(a,b){if(w)return C(59,1,a,b);Dn(a,b)}function Cf(a){if(w)return C(60,1,a);a=Cn(a);null!=a&&a.clear()}function Df(a){if(w)return C(61,1,a);var b=An;if(a!==b.length)if(a<b.length){const c=b.slice(a);for(let d=0;d<c.length;d++)c[d].clear();An=b.slice(0,a)}else for(b=An.length;b<a;b++)Hn.create()}
function Ef(a,b){if(w)return C(62,1,a,b);a=Cn(a);null!=a&&(a.h.gain.value=b?0:1)}function Ff(a,b){if(w)return C(63,1,a,b);a=Cn(a);null!=a&&(b=Cn(b),null==b&&(b=zn(0)),En(a,b))}function Gf(a,b){if(w)return C(64,1,a,b);a=Cn(a);null!=a&&(b=!!b,a.D!==b&&(b?(null!=Bn&&Bn!==a&&Fn(Bn),Gn(a)):Fn(a)))}function Hf(a,b){if(w)return C(65,1,a,b);a=Cn(a);null!=a&&(b=Math.exp(.11512925464970228*b),isFinite(b)&&(a.v.gain.value=b))}function If(a){if(w)return C(66,1,a);a=F(a);return Number(on.has(a))}
function Jf(a,b,c,d,e,f){if(w)return C(67,1,a,b,c,d,e,f);a=F(a);d=F(d);const g=R.sampleRate,k=Nm(t(),b,c);b=Nm(t(),b+4*c,c);c=R.createBuffer(2,c,g);c.copyToChannel(new Float32Array(k),0,0);c.copyToChannel(new Float32Array(b),1,0);ln.create({id:a,Pb:c},{Bb:e,loopEnd:f,ja:d,numberOfChannels:2,sampleRate:g})}function Kf(a){if(w)return C(68,1,a);tn=N(a)}function Lf(a,b){if(w)return C(69,1,a,b);a=F(a);b=!!b;a=on.get(a)??null;null!=a&&qn(a,b)}
function Mf(a,b,c,d,e){if(w)return C(70,1,a,b,c,d,e);a=F(a);b=Nm(p(),b,c);d=Nm(t(),d,e);On(a,Array.from(b),d)}function Nf(a,b,c,d,e,f){if(w)return C(71,1,a,b,c,d,e,f);a=F(a);b=F(b);f=Nm(t(),f,8);d={offset:d,volume:f,playbackRate:1,xc:e,start:!0};pn(a);yn.create({Ub:c,id:a,ga:b},d)}function Of(a){if(w)return C(72,1,a);a=F(a);pn(a)}function Pf(a){if(w)return C(73,1,a);a=F(a);return Number(null!=(hn.get(a)??null))}function Qf(a){if(w)return C(74,1,a);a=F(a);a=hn.get(a)??null;null!=a&&a.clear()}
function Rf(a,b){if(w)return C(75,1,a,b);a=F(a);a=on.get(a)??null;null!=a&&(a.ua=b,a.h.playbackRate.value=a.V*a.ua)}
var Pn={promise:null,S:null,gb:null,create:function(a){const b=v.locateFile("godot.audio.worklet.js");Pn.promise=R.audioWorklet.addModule(b).then(function(){Pn.S=new AudioWorkletNode(R,"godot-processor",{outputChannelCount:[a]});return Promise.resolve()});Jn=Pn},start:function(a,b,c){Pn.promise.then(function(){const d=Pn.S;d.connect(R.destination);d.port.postMessage({cmd:"start",data:[c,a,b]});d.port.onmessage=function(e){O(e.data)}})},zd:function(a,b,c,d,e,f){Pn.gb=new function(){let g=0,k=0,l=0;
const q=new Float32Array(b);this.zc=function(u){const z=Nm(t(),d,e),B=k;let L=u.length,U=0;k+L>=e&&(U=e-k,z.set(u.subarray(0,U),k),L-=U,k=0);L&&z.set(u.subarray(U,L),k);f(B,u.length);k+=L};this.Wb=function(u){var z=Pn.S.port;l+=u;if(0!==l){u=Nm(t(),a,b);var B=u.length,L=l;c(g,l);if(g+l>=B){const U=B-g;q.set(u.subarray(g,B));l-=U;g=0}0<l&&q.set(u.subarray(g,g+l),L-l);z.postMessage({cmd:"chunk",data:q.subarray(0,L)});g+=l;l=0}}};Pn.promise.then(function(){const g=Pn.S,k=Om(t(),a,b);g.connect(R.destination);
g.port.postMessage({cmd:"start_nothreads",data:[k,e]});g.port.onmessage=function(l){Pn.S&&("read"===l.data.cmd?Pn.gb.Wb(l.data.data):"input"===l.data.cmd?(l=l.data.data,l.length>e?O("Input chunk is too big"):Pn.gb.zc(l)):O(l.data))}})},fc:function(){return Pn.S},close:function(){return new Promise(function(a){null!==Pn.promise&&Pn.promise.then(function(){Pn.S.port.postMessage({cmd:"stop",data:null});Pn.S.disconnect();Pn.S.port.onmessage=null;Pn.S=null;Pn.promise=null;a()}).catch(function(b){O(b)})})}};
function Sf(a){if(w)return C(76,1,a);try{Pn.create(a)}catch(b){return O("Error starting AudioDriverWorklet",b),1}return 0}function Tf(a,b,c,d,e){if(w)return C(77,1,a,b,c,d,e);c=Nm(t(),c,d);a=Nm(t(),a,b);e=Nm(p(),e,4);Pn.start(a,c,e)}function Uf(a,b,c){return Atomics.add(p(),(a>>2)+b,c)}function Vf(a,b){return Atomics.load(p(),(a>>2)+b)}function Wf(a,b,c,d){Atomics.wait(p(),(a>>2)+b,c,d);return Atomics.load(p(),(a>>2)+b)}function Xf(a,b){if(w)return C(78,1,a,b);vj(`#${Q.id}`,m(),a,b)}
function Yf(a,b){if(w)return C(79,1,a,b);vj(Sm,m(),a,b)}var Qn="default",Rn=!0,Sn={};function Tn(a){let b=Qn=a;a in Sn&&(a=Sn[a],b=`url("${a.url}") ${a.x} ${a.y}, default`);Rn&&(Q.style.cursor=b)}function Un(){Q.style.cursor="";Qn="default";Rn=!0;Object.keys(Sn).forEach(function(a){URL.revokeObjectURL(Sn[a]);delete Sn[a]})}var Vn=[];function Wn(a,b,c,d){return-1!==Vn.findIndex(function(e){return e.target===a&&e.event===b&&e.method===c&&e.capture===d})}
function T(a,b,c,d){Wn(a,b,c,d)||(Vn.push(new function(e,f,g,k){this.target=e;this.event=f;this.method=g;this.capture=k}(a,b,c,d)),a.addEventListener(b,c,d))}function Xn(){Vn.forEach(function(a){a.target.removeEventListener(a.event,a.method,a.capture)});Vn.length=0}var Yn=[0,0],Zn=!0;function $n(){const a=document.fullscreenElement||document.v||document.webkitFullscreenElement||document.msFullscreenElement;return a?a===Q:document.h||document.mozFullScreen||document.D}
function ao(){if(!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled))return 1;const a=Q;try{const b=(a.requestFullscreen||a.msRequestFullscreen||a.mozRequestFullScreen||a.pd||a.webkitRequestFullscreen).call(a);b&&b.catch(function(){})}catch(b){return 1}return 0}function bo(){if(!$n())return 0;try{const a=document.exitFullscreen();a&&a.catch(function(){})}catch(a){return 1}return 0}function co(){var a=eo();(a=nl[a])&&yl(a)}
function fo(){var a=$n();const b=2===Tm,c=Q;let d=Yn[0],e=Yn[1];if(0===Tm)return c.width!==d||c.height!==e?(Yn=[c.width,c.height],co(),1):0;var f=Zn?window.devicePixelRatio||1:1;if(a||b)d=window.innerWidth*f,e=window.innerHeight*f;a=`${d/f}px`;f=`${e/f}px`;return c.style.width!==a||c.style.height!==f||c.width!==d||c.height!==e?(c.width=d,c.height=e,c.style.width=a,c.style.height=f,co(),1):0}var go=null,ho=null;
function io(a){function b(c){const d=document.createElement(c);d.style.display="none";d.style.position="absolute";d.style.zIndex="-1";d.style.background="transparent";d.style.padding="0px";d.style.margin="0px";d.style.overflow="hidden";d.style.width="0px";d.style.height="0px";d.style.border="0px";d.style.outline="none";d.Ib=!0;d.disabled=!0;T(d,"input",function(){const e=P(d.value);a(e,d.selectionEnd);M(e)},!1);T(d,"blur",function(){d.style.display="none";d.Ib=!0;d.disabled=!0},!1);Q.insertAdjacentElement("beforebegin",
d);return d}go=b("input");ho=b("textarea");jo()}function ko(){go&&ho&&[go,ho].forEach(function(a){a.blur();a.style.display="none";a.value=""})}function jo(){function a(c){c.style.left=`${b.left}px`;c.style.top=`${b.top}px`;c.style.width=`${b.width}px`;c.style.height=`${b.height}px`}if(go&&ho){var b=Q.getBoundingClientRect();a(go);a(ho)}}var lo="";function Zf(a){if(w)return C(80,1,a);window.alert(F(a))}function $f(){if(w)return C(81,1);Q.focus()}
function ag(){return w?C(82,1):document.activeElement===Q}function bg(a){if(w)return C(83,1,a);const b=N(a);try{navigator.clipboard.readText().then(function(c){c=P(c);b(c);M(c)}).catch(function(){})}catch(c){}}function cg(a){if(w)return C(84,1,a);a=F(a);if(!navigator.clipboard||!navigator.clipboard.writeText)return 1;navigator.clipboard.writeText(a).catch(function(b){O("Setting OS clipboard is only possible from an input callback for the Web platform. Exception:",b)});return 0}
function dg(){return w?C(85,1):!Rn}function eg(){return w?C(86,1):document.pointerLockElement===Q?1:0}function fg(a){if(w)return C(87,1,a);a?(a=Q,a.requestPointerLock&&a.requestPointerLock()):document.exitPointerLock&&document.exitPointerLock()}function gg(a,b,c,d,e){if(w)return C(88,1,a,b,c,d,e);a=F(a);const f=Sn[a];0<c?(b=new Blob([Om(n(),b,c)],{type:"image/png"}),b=URL.createObjectURL(b),Sn[a]={url:b,x:d,y:e}):delete Sn[a];a===Qn&&Tn(Qn);f&&URL.revokeObjectURL(f.url)}
function hg(a){if(w)return C(89,1,a);Tn(F(a))}function ig(a){if(w)return C(90,1,a);a=0!==a;a!==Rn&&((Rn=a)?Tn(Qn):Q.style.cursor="none")}function jg(a,b){if(w)return C(91,1,a,b);Yn=[a,b];fo()}function kg(a){function b(e){e.target===c&&d($n())}if(w)return C(92,1,a);const c=Q,d=N(a);T(document,"fullscreenchange",b,!1);T(document,"mozfullscreenchange",b,!1);T(document,"webkitfullscreenchange",b,!1)}function lg(){return w?C(93,1):bo()}function mg(){return w?C(94,1):ao()}
function ng(a){if(w)return C(95,1,a);if(1!==a&&2!==a)return!1;try{return!!document.createElement("canvas").getContext(2===a?"webgl2":"webgl")}catch(b){}return!1}function og(){return w?C(96,1):-1!==["Windows","Win64","Win32","WinCE"].indexOf(navigator.platform||"")?1:0}function pg(a,b,c,d,e){if(w)return C(97,1,a,b,c,d,e);const f=Q,g=N(a),k=[b,c,d,e];["mouseover","mouseleave","focus","blur"].forEach(function(l,q){T(f,l,function(){g(k[q])},!0)})}
function qg(){return w?C(98,1):Zn?window.devicePixelRatio||1:1}function rg(){if(w)var a=C(99,1);else a=Math.round(96*window.devicePixelRatio),a=96<=a?a:96;return a}function sg(a,b){if(w)return C(100,1,a,b);const c=Zn?window.devicePixelRatio||1:1;E(a,window.screen.width*c,"i32");E(b,window.screen.height*c,"i32")}
function tg(a,b,c,d){if(w)return C(101,1,a,b,c,d);const e=Q;T(e,"contextmenu",function(f){f.preventDefault()},!1);T(e,"webglcontextlost",function(f){alert("WebGL context lost, please reload the page");f.preventDefault()},!1);Zn=!!d;switch(Tm){case 0:Yn=[e.width,e.height];break;case 1:Yn=[a,b];break;default:e.style.position="absolute",e.style.top=0,e.style.left=0}fo();c&&ao()}function ug(){if(w)return C(102,1);const a=fo();a&&jo();return a}function vg(){return w?C(103,1):"ontouchstart"in window}
function wg(){return w?C(104,1):"speechSynthesis"in window}function xg(){return w?C(105,1):Um&&"ontouchstart"in window}function yg(a){if(w)return C(106,1,a);a=N(a);Um&&"ontouchstart"in window&&io(a)}function zg(){if(w)return C(107,1);ko()}
function Ag(a,b,c,d){if(w)return C(108,1,a,b,c,d);a=F(a);c=0<c?c:0;d=0<d?d:c;if(go&&ho){""===go.style.display&&""===ho.style.display||ko();jo();var e=go;switch(b){case 0:e.type="text";e.da="";break;case 1:e=ho;break;case 2:e.type="text";e.da="numeric";break;case 3:e.type="text";e.da="decimal";break;case 4:e.type="tel";e.da="";break;case 5:e.type="email";e.da="";break;case 6:e.type="password";e.da="";break;case 7:e.type="url";e.da="";break;default:e.type="text",e.da=""}e.Ib=!1;e.disabled=!1;e.value=
a;e.style.display="block";e.focus();e.setSelectionRange(c,d)}}function Bg(a){if(w)return C(109,1,a);const b=N(a);T(window,"blur",function(){b()},!1)}function Cg(a,b){if(w)return C(110,1,a,b);let c=document.getElementById("-gd-engine-icon");const d=lo;a?(null===c&&(c=document.createElement("link"),c.rel="icon",c.id="-gd-engine-icon",document.head.appendChild(c)),a=new Blob([Om(n(),a,b)],{type:"image/png"}),lo=URL.createObjectURL(a),c.href=lo):(c&&c.remove(),lo=null);d&&URL.revokeObjectURL(d)}
function Dg(a,b){if(w)return C(111,1,a,b);E(a,Q.width,"i32");E(b,Q.height,"i32")}function Eg(a){if(w)return C(112,1,a);document.title=F(a)}
function Fg(a,b,c,d,e,f){b=F(a);a=null;try{a=(0,eval)(b)}catch(g){O(g)}switch(typeof a){case "boolean":return E(c,a,"i32"),1;case "number":return E(c,a,"double"),3;case "string":return Mm(c,P(a)),4;case "object":if(null!==a&&(!ArrayBuffer.isView(a)||a instanceof Uint8Array?a instanceof ArrayBuffer&&(a=new Uint8Array(a)):a=new Uint8Array(a.buffer),a instanceof Uint8Array))return c=N(f)(d,e,a.length),n().set(a,c),29}return 0}var mo=0,W={};function no(a){const b=++mo;W[b]=a;return b}
function oo(a){delete W[a]}function po(a,b){if(a=W[a])b.value&&a.Wa.push(b.value),a.eb=!1,a.done=b.done}function qo(a,b){if(a=W[a]){var c=!1;b.headers.forEach(function(d,e){d=d.toLowerCase().trim();"transfer-encoding"===e.toLowerCase().trim()&&"chunked"===d&&(c=!0)});a.status=b.status;a.response=b;a.Da=b.body.getReader();a.Vb=c}}function ro(a,b){O(b);if(a=W[a])a.error=b}
function so(a,b,c,d){const e={request:null,response:null,Da:null,error:null,done:!1,eb:!1,status:0,Wa:[]},f=no(e);e.request=fetch(b,{method:a,headers:c,body:d});e.request.then(qo.bind(null,f)).catch(ro.bind(null,f));return f}function to(a){const b=W[a];b&&(oo(a),b.request&&b.request.then(function(c){c.abort()}).catch(function(){}))}
function Gg(a,b,c,d,e,f){if(w)return C(113,1,a,b,c,d,e,f);a=F(a);b=F(b);c=Pm(c,d);e=f?Om(m(),e,f):null;return so(a,b,c.map(function(g){const k=g.indexOf(":");return 0>=k?[]:[g.slice(0,k).trim(),g.slice(k+1).trim()]}).filter(function(g){return 2===g.length}),e)}function Hg(a){if(w)return C(114,1,a);to(a)}function Ig(a){return w?C(115,1,a):(a=W[a])&&a.response?a.status:0}function Jg(a){return w?C(116,1,a):(a=W[a])&&a.response?a.Vb?1:0:-1}
function Kg(a,b,c){if(w)return C(117,1,a,b,c);const d=W[a];if(!d||!d.response)return 0;let e=c;const f=d.Wa;for(;e&&f.length;){const l=d.Wa[0];if(l.length>e){var g=m(),k=l.slice(0,e);g.set(k,b/k.BYTES_PER_ELEMENT);f[0]=l.slice(e);e=0}else m().set(l,b/l.BYTES_PER_ELEMENT),e-=l.length,f.pop()}f.length||(b=W[a])&&b.Da&&!b.eb&&(b.done?b.Da=null:(b.eb=!0,b.Da.read().then(po.bind(null,a)).catch(ro.bind(null,a))));return c-e}
function Lg(a,b,c){if(w)return C(118,1,a,b,c);a=W[a];if(!a||!a.response)return 1;b=N(b);const d=[];a.response.headers.forEach(function(e,f){d.push(`${f}:${e}`)});a=Qm(d);b(d.length,a,c);Rm(a,d.length);return 0}function Mg(a){if(w)return C(119,1,a);a=W[a];return!a||a.error?-1:a.response?a.Da?1:a.done?2:-1:0}var uo=[];function vo(){try{const a=navigator.getGamepads();return a?a:[]}catch(a){return[]}}
function wo(a){function b(d){if(d.mapping)var e=d.mapping;else{var f=navigator.userAgent;e="Unknown";0<=f.indexOf("Android")?e="Android":0<=f.indexOf("Linux")?e="Linux":0<=f.indexOf("iPhone")?e="iOS":0<=f.indexOf("Macintosh")?e="MacOSX":0<=f.indexOf("Windows")&&(e="Windows");var g=d.id,k=/vendor: ([0-9a-f]{4}) product: ([0-9a-f]{4})/i,l=/^([0-9a-f]+)-([0-9a-f]+)-/i,q=f="";k.test(g)?(g=k.exec(g),f=g[1].padStart(4,"0"),q=g[2].padStart(4,"0")):l.test(g)&&(g=l.exec(g),f=g[1].padStart(4,"0"),q=g[2].padStart(4,
"0"));e=f&&q?e+f+q:`${e}Unknown`}f=e;e=P(d.id);f=P(f);a(d.index,1,e,f);M(e);M(f)}uo=[];const c=vo();for(let d=0;d<c.length;d++)c[d]&&b(c[d]);T(window,"gamepadconnected",function(d){d.gamepad&&b(d.gamepad)},!1);T(window,"gamepaddisconnected",function(d){d.gamepad&&a(d.gamepad.index,0)},!1)}var xo=[],yo=[];function zo(a){a.isDirectory?Co(a):a.isFile?Do(a):O("Unrecognized entry...",a)}
function Co(a){xo.push(new Promise(function(b){a.createReader().readEntries(function(c){for(let d=0;d<c.length;d++)zo(c[d]);b()})}))}function Do(a){xo.push(new Promise(function(b,c){a.file(function(d){const e=new FileReader;e.onload=function(){const f={path:d.vd||d.webkitRelativePath,name:d.name,type:d.type,size:d.size,data:e.result};f.path||(f.path=f.name);yo.push(f);b()};e.onerror=function(){Lm("Error reading file");c()};e.readAsArrayBuffer(d)},function(){Lm("Error!");c()})}))}
function Eo(a,b){0===xo.length?a():xo.pop().then(function(){setTimeout(function(){Eo(a,b)},0)})}
function Fo(a,b){a.preventDefault();if(a.dataTransfer.items)for(let c=0;c<a.dataTransfer.items.length;c++){const d=a.dataTransfer.items[c];let e=null;"getAsEntry"in d?e=d.kd():"webkitGetAsEntry"in d&&(e=d.webkitGetAsEntry());e&&zo(e)}else O("File upload not supported");(new Promise(Eo)).then(function(){const c=`/tmp/drop-${parseInt(1073741824*Math.random(),10)}/`,d=[],e=[];rk(c.slice(0,-1));yo.forEach(f=>{const g=f.path;cn(c+g,f.data);f=g.indexOf("/");if(-1===f)d.push(c+g);else{const k=g.substr(0,
f);f=k.indexOf("/");0>f&&-1===d.indexOf(c+k)&&d.push(c+k)}e.push(c+g)});xo=[];yo=[];b(d);Vm?en.push(function(f){Go(e,c);f()}):Go(e,c)})}function Go(a,b){const c=[b.substr(0,b.length-1)];a.forEach(function(d){Rj(d);d=d.replace(b,"");let e=d.lastIndexOf("/");for(;0<e;)d=d.substr(0,e),-1===c.indexOf(b+d)&&c.push(b+d),e=d.lastIndexOf("/")});c.sort(function(d,e){d=(d.match(/\//g)||[]).length;e=(e.match(/\//g)||[]).length;return d>e?-1:d<e?1:0}).forEach(function(d){Qj(d)})}
function Ho(a){return function(b){Fo(b,a)}}var Io=null,Jo=!1;function Ko(a){function b(){Jo=!0;Io.focus()}Io&&(a?(Io.style.display="block",setInterval(b,100)):(Io.style.display="none",Q.focus(),Jo=!1))}
function Lo(a,b,c,d){function e(k,l){const q=l.shiftKey+0+(l.altKey+0<<1)+(l.ctrlKey+0<<2)+(l.metaKey+0<<3);vj(l.code,m(),c,32);vj(l.key,m(),d,32);b(k,l.repeat,q);l.preventDefault()}function f(k){Io&&("compositionstart"===k.type?(a(0,null),Io.innerHTML=""):"compositionupdate"===k.type?(k=P(k.data),a(1,k),M(k)):"compositionend"===k.type&&(k=P(k.data),a(2,k),M(k),Io.innerHTML=""))}const g=document.createElement("div");g.className="ime";g.style.background="none";g.style.opacity=0;g.style.position="fixed";
g.style.textAlign="left";g.style.fontSize="1px";g.style.left="0px";g.style.top="0px";g.style.width="100%";g.style.height="40px";g.style.pointerEvents="none";g.style.display="none";g.contentEditable="true";T(g,"compositionstart",f,!1);T(g,"compositionupdate",f,!1);T(g,"compositionend",f,!1);T(g,"keydown",e.bind(null,1),!1);T(g,"keyup",e.bind(null,0),!1);g.onblur=function(){this.style.display="none";Q.focus();Jo=!1};Q.parentElement.appendChild(g);Io=g}
function Mo(a){return a.shiftKey+0+(a.altKey+0<<1)+(a.ctrlKey+0<<2)+(a.metaKey+0<<3)}function No(a,b){const c=Q;return[c.width/b.width*(a.clientX-b.x),c.height/b.height*(a.clientY-b.y)]}function Ng(a){if(w)return C(120,1,a);const b=N(a);a=Q;T(a,"dragover",function(c){c.preventDefault()},!1);T(a,"drop",Ho(function(c){var d=c||[];d.length&&(c=d.length,d=Qm(d),b(d,c),Rm(d,c))}))}function Og(a){if(w)return C(121,1,a);a=N(a);wo(a)}
function Pg(){if(w)return C(122,1);const a=vo(),b=[];for(let d=0;d<a.length;d++){const e=a[d];if(!e){b.push(null);continue}const f={Ec:"standard"===e.mapping,buttons:[],axes:[],connected:e.connected};for(var c=0;c<e.buttons.length;c++)f.buttons.push(e.buttons[c].value);for(c=0;c<e.axes.length;c++)f.axes.push(e.axes[c]);b.push(f)}uo=b;return 0}function Qg(){return w?C(123,1):uo.length}
function Rg(a,b,c,d,e,f){if(w)return C(124,1,a,b,c,d,e,f);var g=uo;a=a<g.length?g[a]:null;if(!a||!a.connected)return 1;g=a.buttons;const k=16>g.length?g.length:16;for(let l=0;l<k;l++)E(b+(l<<2),g[l],"float");E(c,k,"i32");b=a.axes;c=10>b.length?b.length:10;for(g=0;g<c;g++)E(d+(g<<2),b[g],"float");E(e,c,"i32");E(f,a.Ec?1:0,"i32");return 0}
function Sg(a,b,c){function d(f,g){const k=Mo(g);vj(g.code,m(),b,32);vj(g.key,m(),c,32);e(f,g.repeat,k);g.preventDefault()}if(w)return C(125,1,a,b,c);const e=N(a);T(Q,"keydown",d.bind(null,1),!1);T(Q,"keyup",d.bind(null,0),!1)}function Tg(a){function b(e,f){var g=d.getBoundingClientRect();g=No(f,g);const k=Mo(f);e&&Q.focus();c(e,f.button,g[0],g[1],k)&&f.preventDefault()}if(w)return C(126,1,a);const c=N(a),d=Q;T(d,"mousedown",b.bind(null,1),!1);T(window,"mouseup",b.bind(null,0),!1)}
function Ug(a){if(w)return C(127,1,a);const b=N(a),c=Q;T(window,"mousemove",function(d){const e=c.getBoundingClientRect(),f=No(d,e);b(f[0],f[1],c.width/e.width*d.movementX,c.height/e.height*d.movementY,Mo(d))},!1)}function Vg(a){if(w)return C(128,1,a);const b=N(a);T(Q,"wheel",function(c){b(c.deltaX||0,c.deltaY||0)&&c.preventDefault()},!1)}function Wg(a){if(w)return C(129,1,a);const b=N(a);T(window,"paste",function(c){c=c.clipboardData.getData("text");c=P(c);b(c);M(c)},!1)}
function Xg(a,b,c){function d(g,k){0===g&&Q.focus();const l=f.getBoundingClientRect(),q=k.changedTouches;for(let u=0;u<q.length;u++){const z=q[u],B=No(z,l);E(c+16*u,B[0],"double");E(c+8*(2*u+1),B[1],"double");E(b+4*u,z.identifier,"i32")}e(g,q.length);k.cancelable&&k.preventDefault()}if(w)return C(130,1,a,b,c);const e=N(a),f=Q;T(f,"touchstart",d.bind(null,0),!1);T(f,"touchend",d.bind(null,1),!1);T(f,"touchcancel",d.bind(null,1),!1);T(f,"touchmove",d.bind(null,2),!1)}
function Yg(a){if(w)return C(131,1,a);"function"!==typeof navigator.vibrate?Lm("This browser does not support vibration."):navigator.vibrate(a)}function Zg(){return w?C(132,1):Jo}function $g(a,b,c,d){if(w)return C(133,1,a,b,c,d);a=Om(m(),a,b);c=F(c);d=F(d);d=window.URL.createObjectURL(new Blob([a],{type:d}));a=document.createElement("a");a.href=d;a.download=c;a.style.display="none";document.body.appendChild(a);a.click();a.remove();window.URL.revokeObjectURL(d)}
function ah(a){if(w)return C(134,1,a);a=F(a);a=JSON.parse(a);return Wm?(Wm(a),0):1}function bh(a){if(w)return C(135,1,a);a=N(a);gn(a)}function ch(){return w?C(136,1):Ym?1:0}function dh(a){if(w)return C(137,1,a);const b=N(a);fn=bn();fn.then(function(){b()})}
function eh(a){if(w)return C(138,1,a);a=F(a);const b=navigator.userAgent;return"web_macos"===a?-1!==b.indexOf("Mac")?1:0:"web_windows"===a?-1!==b.indexOf("Windows")?1:0:"web_android"===a?-1!==b.indexOf("Android")?1:0:"web_ios"===a?-1!==b.indexOf("iPhone")||-1!==b.indexOf("iPad")||-1!==b.indexOf("iPod")?1:0:"web_linuxbsd"===a?-1!==b.indexOf("CrOS")||-1!==b.indexOf("BSD")||-1!==b.indexOf("Linux")||-1!==b.indexOf("X11")?1:0:0}
function fh(){if(w)return C(139,1);const a=navigator.hardwareConcurrency||1;return 2>a?a:2}function gh(a){if(w)return C(140,1,a);dn=N(a)}function hh(a){if(w)return C(141,1,a);window.open(F(a),"_blank")}var Oo=!1;function Po(a,b){b&&b.active&&(b.waiting&&(Oo=!0,a()),T(b,"updatefound",function(){const c=b.installing;T(c,"statechange",function(){"installed"===c.state&&(Oo=!0,a())})}))}
function ih(a){if(w)return C(142,1,a);"serviceWorker"in navigator&&(a=N(a),navigator.serviceWorker.getRegistration().then(Po.bind(null,a)))}function jh(){return w?C(143,1):"serviceWorker"in navigator&&Oo?(navigator.serviceWorker.getRegistration().then(function(a){a&&a.waiting&&a.waiting.postMessage("update")}),0):1}
function Qo(a,b,c,d,e){if(a=W[a])a.binaryType="arraybuffer",a.onopen=function(){b()},a.onclose=function(){e()},a.onerror=function(){d()},a.onmessage=function(f){let g=0;if(f.data instanceof ArrayBuffer)f=new Uint8Array(f.data);else{if(f.data instanceof Blob){O("Blob type not supported");return}if("string"===typeof f.data){g=1;var k=new TextEncoder("utf-8");f=new Uint8Array(k.encode(f.data))}else{O("Unknown message type");return}}k=f.length*f.BYTES_PER_ELEMENT;const l=wl(k);n().set(f,l);c(l,k,g);M(l)}}
function Ro(a){if(a=W[a])a.onopen=null,a.onmessage=null,a.onerror=null,a.onclose=null,a.close()}function So(a,b,c){return(a=W[a])&&void 0!==a[b]?a[b]:c}function kh(a){if(w)return C(144,1,a);W[a]&&Ro(a)}function lh(a,b,c,d,e,f){if(w)return C(145,1,a,b,c,d,e,f);c=N(c).bind(null,b);d=N(d).bind(null,b);e=N(e).bind(null,b);b=N(f).bind(null,b);Qo(a,c,d,e,b)}function mh(a){if(w)return C(146,1,a);Ro(a);oo(a)}function nh(a){return w?C(147,1,a):So(a,"bufferedAmount",0)}
function oh(a){return w?C(148,1,a):So(a,"id",65535)}function ph(a){return w?C(149,1,a):So(a,"negotiated",65535)}function qh(a){return w?C(150,1,a):So(a,"ordered",!0)}function rh(a){return w?C(151,1,a):(a=W[a])&&a.label?P(a.label):0}function sh(a){return w?C(152,1,a):(a=W[a])?void 0!==a.maxPacketLifeTime?a.maxPacketLifeTime:void 0!==a.maxRetransmitTime?a.maxRetransmitTime:65535:65535}function th(a){return w?C(153,1,a):So(a,"maxRetransmits",65535)}
function uh(a){return(a=W[a])&&a.protocol?P(a.protocol):0}function vh(a){if(w)return C(154,1,a);a=W[a];if(!a)return 3;switch(a.readyState){case "connecting":return 0;case "open":return 1;case "closing":return 2;default:return 3}}function wh(a,b,c,d){if(w)return C(155,1,a,b,c,d);a=W[a];if(!a)return 1;const e=new Uint8Array(c);for(let f=0;f<c;f++)e[f]=fj(b+f,"i8");d?a.send(e.buffer):(b=(new TextDecoder("utf-8")).decode(e),a.send(b));return 0}
var To={Fb:0,$c:1,connected:2,$b:3,bc:4,closed:5},Uo={Fb:0,Yc:1,connected:2,Zc:2,$b:3,bc:4,closed:5},Vo={Fb:0,jd:1,complete:2},Wo={yd:0,"have-local-offer":1,"have-remote-offer":2,"have-local-pranswer":3,"have-remote-pranswer":4,closed:5};
function Xo(a,b,c,d,e,f){let g=null;try{g=new RTCPeerConnection(a)}catch(l){return O(l),0}const k=no(g);"connectionState"in g&&void 0!==g.connectionState?g.onconnectionstatechange=function(){W[k]&&b(To[g.connectionState]||0)}:g.oniceconnectionstatechange=function(){W[k]&&b(Uo[g.iceConnectionState]||0)};g.onicegatheringstatechange=function(){W[k]&&d(Vo[g.iceGatheringState]||0)};g.onsignalingstatechange=function(){W[k]&&c(Wo[g.signalingState]||0)};g.onicecandidate=function(l){if(W[k]&&(l=l.candidate)&&
l.candidate){var q=P(l.candidate),u=P(l.sdpMid);e(u,l.sdpMLineIndex,q);M(q);M(u)}};g.ondatachannel=function(l){W[k]&&(l=no(l.channel),f(l))};return k}function Yo(a,b,c){W[a]&&(a=P(c.type),c=P(c.sdp),b(a,c),M(a),M(c))}function xh(a){if(w)return C(156,1,a);(a=W[a])&&a.close()}function yh(a,b,c,d,e,f,g){function k(l){return N(l).bind(null,b)}return w?C(157,1,a,b,c,d,e,f,g):Xo(JSON.parse(F(a)),k(c),k(e),k(d),k(f),k(g))}
function zh(a,b,c){if(w)return C(158,1,a,b,c);try{const d=W[a];if(!d)return 0;const e=F(b),f=JSON.parse(F(c)),g=d.createDataChannel(e,f);return no(g)}catch(d){return O(d),0}}function Ah(a){if(w)return C(159,1,a);const b=W[a];b&&(b.onconnectionstatechange=null,b.oniceconnectionstatechange=null,b.onicegatheringstatechange=null,b.onsignalingstatechange=null,b.onicecandidate=null,b.ondatachannel=null,oo(a))}
function Bh(a,b,c,d){if(w)return C(160,1,a,b,c,d);if(a=W[a])b=F(b),d=F(d),a.addIceCandidate(new RTCIceCandidate({candidate:d,sdpMid:b,sdpMlineIndex:c}))}function Ch(a,b,c,d,e){if(w)return C(161,1,a,b,c,d,e);const f=W[a];if(f){b=F(b);c=F(c);var g=N(e).bind(null,d);f.setLocalDescription({sdp:c,type:b}).catch(function(k){W[a]&&(O(k),g())})}}
function Dh(a,b,c,d){if(w)return C(162,1,a,b,c,d);const e=W[a];if(e){var f=N(c).bind(null,b),g=N(d).bind(null,b);e.createOffer().then(function(k){Yo(a,f,k)}).catch(function(k){W[a]&&(O(k),g())})}}
function Eh(a,b,c,d,e,f){if(w)return C(163,1,a,b,c,d,e,f);const g=W[a];if(g){var k=F(b);b=F(c);var l=N(f).bind(null,d),q=N(e).bind(null,d);g.setRemoteDescription({sdp:b,type:k}).then(function(){return"offer"!==k?Promise.resolve():g.createAnswer().then(function(u){Yo(a,q,u)})}).catch(function(u){W[a]&&(O(u),l())})}}function Fh(a){if(w)return C(164,1,a);Ko(a)}function Gh(a,b,c,d){if(w)return C(165,1,a,b,c,d);a=N(a);b=N(b);Lo(a,b,c,d)}
function Hh(a,b){if(w)return C(166,1,a,b);if(Io){const c=Q,d=c.getBoundingClientRect();b=b/(c.height/d.height)+d.y;Io.style.left=`${a/(c.width/d.width)+d.x}px`;Io.style.top=`${b}px`}}function Ih(a){if(w)return C(167,1,a);a=N(a);try{const b=[],c=window.speechSynthesis.getVoices();for(let e=0;e<c.length;e++)b.push(`${c[e].lang};${c[e].name}`);const d=Qm(b);a(b.length,d);Rm(d,b.length)}catch(b){}}function Jh(){return w?C(168,1):window.speechSynthesis.paused}
function Kh(){return w?C(169,1):window.speechSynthesis.h}function Lh(){if(w)return C(170,1);window.speechSynthesis.pause()}function Mh(){if(w)return C(171,1);window.speechSynthesis.resume()}
function Nh(a,b,c,d,e,f,g){if(w)return C(172,1,a,b,c,d,e,f,g);g=N(g);a=new SpeechSynthesisUtterance(F(a));a.rate=e;a.pitch=d;a.volume=c/100;a.addEventListener("end",function(k){k.currentTarget.Ga(1,k.currentTarget.id,0)});a.addEventListener("start",function(k){k.currentTarget.Ga(0,k.currentTarget.id,0)});a.addEventListener("error",function(k){k.currentTarget.Ga(2,k.currentTarget.id,0)});a.addEventListener("boundary",function(k){k.currentTarget.Ga(3,k.currentTarget.id,k.Xc)});a.id=f;a.Ga=g;b=F(b);
c=window.speechSynthesis.getVoices();for(d=0;d<c.length;d++)if(c[d].name===b){a.voice=c[d];break}window.speechSynthesis.resume();window.speechSynthesis.speak(a)}function Oh(){if(w)return C(173,1);window.speechSynthesis.cancel();window.speechSynthesis.resume()}function Zo(a,b){if(a=W[a])a=P(a.protocol),b(a),M(a)}
function $o(a,b,c){if(W[a]){a=0;if(c.data instanceof ArrayBuffer)c=new Uint8Array(c.data);else{if(c.data instanceof Blob){O("Blob type not supported");return}if("string"===typeof c.data){a=1;var d=new TextEncoder("utf-8");c=new Uint8Array(d.encode(c.data))}else{O("Unknown message type");return}}d=c.length*c.BYTES_PER_ELEMENT;var e=wl(d);n().set(c,e);b(e,d,a);M(e)}}function ap(a,b){W[a]&&b()}function bp(a,b,c){W[a]&&(a=P(c.reason),b(c.code,a,c.wasClean?1:0),M(a))}
function Ph(a){w?a=C(174,1,a):a=(a=W[a])?a.bufferedAmount:0;return a}function Qh(a,b,c){if(w)return C(175,1,a,b,c);c=F(c);(a=W[a])&&a.readyState<a.CLOSING&&a.close(b,c)}
function Rh(a,b,c,d,e,f,g){if(w)return C(176,1,a,b,c,d,e,f,g);d=N(d).bind(null,a);e=N(e).bind(null,a);f=N(f).bind(null,a);a=N(g).bind(null,a);b=F(b);c=F(c);g=null;try{g=c?new WebSocket(b,c.split(",")):new WebSocket(b)}catch(k){return 0}g.binaryType="arraybuffer";c=g;b=no(c);c.onopen=Zo.bind(null,b,d);c.onmessage=$o.bind(null,b,e);c.onerror=ap.bind(null,b,f);c.onclose=bp.bind(null,b,a);return b}
function Sh(a){if(w)return C(177,1,a);const b=W[a];if(b){const c=W[a];c&&c.readyState<c.CLOSING&&c.close(3001,"destroyed");oo(a);b.onopen=null;b.onmessage=null;b.onerror=null;b.onclose=null}}function Th(a,b,c,d){if(w)return C(178,1,a,b,c,d);const e=new Uint8Array(c);let f;for(f=0;f<c;f++)e[f]=fj(b+f,"i8");b=e.buffer;d||(b=(new TextDecoder("utf-8")).decode(e));(a=W[a])&&a.readyState===a.OPEN?(a.send(b),a=0):a=1;return a}var cp=null,dp=null;
function ep(a){const b=no(this);cp.set(a,b);let c=1;this.Bc=function(){c++};this.Lb=function(){c--;0===c&&(oo(b),cp.delete(a))};this.hc=function(){return a};this.zb=function(){return b}}function fp(a){const b=cp.get(a);if(void 0===b)return(new ep(a)).zb();W[b].Bc();return b}function gp(a){a=W[a];if(void 0!==a)return a.hc()}
function hp(a,b){switch(a){case 0:return null;case 1:return!!fj(b,"i64");case 2:return a=fj(b,"i64"),a>=Number.MIN_SAFE_INTEGER&&a<=Number.MAX_SAFE_INTEGER?Number(a):a;case 3:return Number(fj(b,"double"));case 4:return F(fj(b,"*"));case 24:return gp(fj(b,"i64"))}}
function ip(a,b){if(void 0===a||null===a)return 0;const c=typeof a;if("boolean"===c)return E(b,a,"i64"),1;if("number"===c){if(Number.isInteger(a))return E(b,a,"i64"),2;E(b,a,"double");return 3}if("bigint"===c)return E(b,a,"i64"),2;if("string"===c)return a=P(a),E(b,a,"*"),4;a=fp(a);E(b,a,"i64");return 24}function jp(a){return a instanceof ArrayBuffer||ArrayBuffer.isView(a)}
function Uh(a,b){if(w)return C(179,1,a,b);const c=N(b);let d=0;return d=fp(function(){if(gp(d)){dp=null;var e=Array.from(arguments),f=new ep(e);c(a,f.zb(),e.length);f.Lb();e=dp;dp=null;return e}})}
function Vh(a,b,c,d,e,f,g){if(w)return C(180,1,a,b,c,d,e,f,g);a=F(a);if("undefined"===typeof window[a])return-1;d=N(d);g=N(g);const k=Array(c);for(let l=0;l<c;l++){const q=d(b,l,e,f),u=fj(f,"*");k[l]=hp(q,e);u&&g(f,q)}try{const l=new window[a](...k);return ip(l,e)}catch(l){return O(`Error calling constructor ${a} with args:`,k,"error:",l),-1}}function Wh(a){if(w)return C(181,1,a);a=F(a);return"undefined"!==typeof window[a]?fp(window[a]):0}
function Xh(a,b,c,d,e,f,g,k){if(w)return C(182,1,a,b,c,d,e,f,g,k);a=gp(a);if(void 0===a)return-1;b=F(b);e=N(e);k=N(k);const l=Array(d);for(let q=0;q<d;q++){const u=e(c,q,f,g),z=fj(g,"*");l[q]=hp(u,f);z&&k(g,u)}try{const q=a[b](...l);return ip(q,f)}catch(q){return O(`Error calling method ${b} on:`,a,"error:",q),-1}}
function Yh(a,b,c){if(w)return C(183,1,a,b,c);a=gp(a);if(void 0===a)return 0;if(c){c=F(c);try{return ip(a[c],b)}catch(d){return O(`Error getting variable ${c} on object`,a),0}}return ip(a,b)}function Zh(a,b,c){if(w)return C(184,1,a,b,c);a=gp(a);if(void 0===a)return-1;b=hp(b,c);if(void 0===b||null===b)return-1;try{return ip(a[b],c)}catch(d){return O(`Error getting variable ${b} on object`,a,d),-1}}function $h(a){return w?C(185,1,a):jp(gp(a))?1:0}
function ai(a,b,c,d){if(w)return C(186,1,a,b,c,d);a=gp(a);if(void 0!==a){b=F(b);try{a[b]=hp(c,d)}catch(e){O(`Error setting variable ${b} on object`,a)}}}function bi(a,b){if(w)return C(187,1,a,b);dp=hp(a,b)}function ci(a,b,c,d,e){if(w)return C(188,1,a,b,c,d,e);a=gp(a);if(void 0===a)return-1;b=hp(b,c);try{return a[b]=hp(d,e),0}catch(f){return O(`Error setting variable ${b} on object`,a),-1}}
function di(a,b,c,d){if(w)return C(189,1,a,b,c,d);a=gp(a);jp(a)&&(!ArrayBuffer.isView(a)||a instanceof Uint8Array?a instanceof ArrayBuffer&&(a=new Uint8Array(a)):a=new Uint8Array(a.buffer),b=N(d)(b,c,a.length),n().set(a,b))}function ei(a){if(w)return C(190,1,a);a=W[a];void 0!==a&&a.Lb()}
function fi(a,b,c,d,e,f,g){if(w)return C(191,1,a,b,c,d,e,f,g);const k=K;if("undefined"===typeof k.Gb){const l=k.C.getExtension("OCULUS_multiview");if(!l){O("Trying to call glFramebufferTextureMultisampleMultiviewOVR() without the OCULUS_multiview extension");return}k.Gb=l}k.Gb.framebufferTextureMultisampleMultiviewOVR(a,b,kl[c],d,e,f,g)}
function gi(a,b,c,d,e,f){if(w)return C(192,1,a,b,c,d,e,f);const g=K;if("undefined"===typeof g.Eb){const k=g.C.getExtension("OVR_multiview2");if(!k){O("Trying to call glFramebufferTextureMultiviewOVR() without the OVR_multiview2 extension");return}g.Eb=k}g.Eb.framebufferTextureMultiviewOVR(a,b,kl[c],d,e,f)}function hi(a,b,c,d){if(w)return C(193,1,a,b,c,d);var e=eo();(e=nl[e])&&e.C.getBufferSubData(a,b,n(),d,c)}
var kp=null,Z=null,lp=null,mp=null,np=null,op=null,pp=null,qp=1,rp=[,,,,,,,,,,,,,,,],sp=[,,,,],tp=null,up=null,vp=a=>{Z&&np?Z.requestAnimationFrame(function(b,c){op=c;pp=c.getViewerPose(np);a(b);pp=op=null}):up(a)},wp=()=>{$l();Oi+=1;window.setTimeout(function(){x(0<Oi);--Oi;am()},0)},xp=()=>{const a=pp?pp.views.length:1;var b=mp;if(b&&qp===a)return b;if(!Z||!lp)return null;b=kp;b=lp.createProjectionLayer({textureType:1<a?"texture-array":"texture",colorFormat:b.RGBA8,depthFormat:b.DEPTH_COMPONENT24});
Z.updateRenderState({layers:[b]});mp=b;qp=a;return b},yp=()=>{if(!pp)return null;const a=xp();return null===a?null:lp.getViewSubImage(a,pp.views[0])},zp=a=>{if(void 0!==a.name)return a.name;const b=tl(kl);a.name=b;kl[b]=a;return b},Ap=a=>{let b=-1;if("tracked-pointer"===a.targetRayMode&&"left"===a.handedness)b=0;else if("tracked-pointer"===a.targetRayMode&&"right"===a.handedness)b=1;else for(var c=2;16>c;c++)if(!rp[c]){b=c;break}if(0<=b&&(rp[b]=a,a.name=b,"screen"===a.targetRayMode)){c=-1;for(let d=
0;5>d;d++)if(!sp[d]){c=d;break}0<=c&&(sp[c]=a,a.Ua=c)}return b},Bp=a=>{if(void 0!==a.name){const b=a.name;0<=b&&16>b&&(rp[b]=null);void 0!==a.Ua&&(a=a.Ua,0<=a&&5>a&&(sp[a]=null));return b}return-1};function ii(a){if(w)return C(194,1,a);if(!np||!np.boundsGeometry)return 0;const b=np.boundsGeometry.length;if(0===b)return 0;const c=wl(12*b);for(let d=0;d<b;d++){const e=np.boundsGeometry[d];E(c+12*d,e.x,"float");E(c+4*(3*d+1),e.y,"float");E(c+4*(3*d+2),e.z,"float")}E(a,c,"i32");return b}
function ji(){if(w)return C(195,1);const a=yp();return null===a?0:zp(a.colorTexture)}function ki(){if(w)return C(196,1);const a=yp();return null!==a&&a.depthStencilTexture?zp(a.depthStencilTexture):0}function li(){return w?C(197,1):Z&&void 0!==Z.frameRate?Z.frameRate:0}function mi(a,b){if(w)return C(198,1,a,b);if(!Z||!pp)return!1;a=pp.views[a].projectionMatrix;for(let c=0;16>c;c++)E(b+4*c,a[c],"float");return!0}
function ni(a){if(w)return C(199,1,a);const b=yp();if(null===b)return!1;E(a+0,b.viewport.width,"i32");E(a+4,b.viewport.height,"i32");return!0}function oi(a){if(w)return C(200,1,a);if(!Z||void 0===Z.supportedFrameRates)return 0;const b=Z.supportedFrameRates.length;if(0===b)return 0;const c=wl(4*b);for(let d=0;d<b;d++)E(c+4*d,Z.supportedFrameRates[d],"float");E(a,c,"i32");return b}
function pi(a,b){if(w)return C(201,1,a,b);if(!Z||!pp)return!1;var c=pp.views;a=0<=a?c[a].transform.matrix:pp.transform.matrix;for(c=0;16>c;c++)E(b+4*c,a[c],"float");return!0}function qi(){if(w)return C(202,1);const a=yp();return null!==a&&a.motionVectorTexture?zp(a.motionVectorTexture):0}function ri(){if(w)return C(203,1);if(!Z||!pp)return 1;const a=pp.views.length;return 0<a?a:1}function si(){return w?C(204,1):Z&&Z.visibilityState?P(Z.visibilityState):0}
function ti(a,b,c,d,e,f,g,k,l){if(w)return C(205,1,a,b,c,d,e,f,g,k,l);null===up&&(up=Pl);Pl=vp;a=F(a);b=F(b).split(",").map(y=>y.trim()).filter(y=>""!==y);c=F(c).split(",").map(y=>y.trim()).filter(y=>""!==y);const q=F(d).split(",").map(y=>y.trim()),u=N(e),z=N(f),B=N(g),L=N(k),U=N(l);d={};0<b.length&&(d.requiredFeatures=b);0<c.length&&(d.optionalFeatures=c);navigator.xr.requestSession(a,d).then(function(y){Z=y;y.addEventListener("end",function(){z()});y.addEventListener("inputsourceschange",function(X){X.added.forEach(Ap);
X.removed.forEach(Bp)});["selectstart","selectend","squeezestart","squeezeend"].forEach((X,zb)=>{y.addEventListener(X,function(Y){op=Y.frame;Y=Y.inputSource;L(zb,void 0!==Y?Y.name:-1);op=null})});y.addEventListener("visibilitychange",function(){const X=P("visibility_state_changed");U(X);M(X)});tp=U;const S=eo(),V=nl[S].C;kp=V;V.makeXRCompatible().then(function(){function X(Y,ca){np=Y;Y.onreset=function(){const Ua=P("reference_space_reset");U(Ua);M(Ua)};wp();window.setTimeout(function(){const Ua=P(ca);
var Va="enabledFeatures"in y?Array.from(y.enabledFeatures):[];Va=P(Va.join(","));const $b=P("environmentBlendMode"in y?y.environmentBlendMode:"");u(Ua,Va,$b);M(Ua);M(Va);M($b)},0)}function zb(){const Y=q.shift();y.requestReferenceSpace(Y).then(ca=>{X(ca,Y)}).catch(()=>{if(0===q.length){const ca=P("Unable to get any of the requested reference space types");B(ca);M(ca)}else zb()})}lp=new XRWebGLBinding(y,V);xp();zb()}).catch(function(X){X=P(`Unable to make WebGL context compatible with WebXR: ${X}`);
B(X);M(X)})}).catch(function(y){y=P(`Unable to start session: ${y}`);B(y);M(y)})}function ui(a,b){if(w)return C(206,1,a,b);const c=F(a),d=N(b);navigator.xr?navigator.xr.isSessionSupported(c).then(function(e){const f=P(c);d(f,e?1:0);M(f)}):(a=P(c),d(a,0),M(a))}function vi(){return w?C(207,1):!!navigator.xr}function wi(){if(w)return C(208,1);Z&&Z.end().catch(()=>{});pp=op=np=mp=lp=Z=null;qp=1;rp=Array(16);sp=Array(5);tp=null;null===up&&(up=Pl);Pl=up;wp()}
function xi(a,b,c,d,e,f,g,k,l,q,u,z,B,L){if(w)return C(209,1,a,b,c,d,e,f,g,k,l,q,u,z,B,L);if(!Z||!op)return 0;if(0>a||a>=rp.length||!rp[a])return!1;a=rp[a];const U=op,y=np;var S=U.getPose(a.targetRaySpace,y);if(!S)return!1;S=S.transform.matrix;for(let V=0;16>V;V++)E(b+4*V,S[V],"float");b=0;switch(a.targetRayMode){case "gaze":b=1;break;case "tracked-pointer":b=2;break;case "screen":b=3}E(c,b,"i32");E(d,void 0!==a.Ua?a.Ua:-1,"i32");c=!1;if(a.gripSpace&&(d=U.getPose(a.gripSpace,y))){c=d.transform.matrix;
for(d=0;16>d;d++)E(f+4*d,c[d],"float");c=!0}E(e,c?1:0,"i32");e=!1;c=f=0;if(a.gamepad){"xr-standard"===a.gamepad.mapping&&(e=!0);f=Math.min(a.gamepad.buttons.length,10);for(c=0;c<f;c++)E(l+4*c,a.gamepad.buttons[c].value,"float");c=Math.min(a.gamepad.axes.length,10);for(l=0;l<c;l++)E(u+4*l,a.gamepad.axes[l],"float")}E(g,e?1:0,"i32");E(k,f,"i32");E(q,c,"i32");g=!1;a.hand&&0!==B&&0!==L&&(k=new Float32Array(400),q=new Float32Array(25),U.fillPoses(a.hand.values(),y,k)&&U.fillJointRadii(a.hand.values(),
q)&&(t().set(k,B/k.BYTES_PER_ELEMENT),t().set(q,L/q.BYTES_PER_ELEMENT),g=!0));E(z,g?1:0,"i32");return!0}function yi(a){if(w)return C(210,1,a);Z&&void 0!==Z.updateTargetFrameRate&&Z.updateTargetFrameRate(a).then(()=>{const b=P("display_refresh_rate_changed");tp(b);M(b)})}
var Cp=a=>{var b=uj(a)+1,c=Qi(b);Wk(a,c,b);return c},Dp=a=>{var b=v["_"+a];x(b,"Cannot call unknown function "+a+", make sure it is exported");return b},Ep=(a,b,c,d)=>{var e={string:q=>{var u=0;null!==q&&void 0!==q&&0!==q&&(u=Cp(q));return u},array:q=>{var u=Qi(q.length);x(0<=q.length,"writeArrayToMemory array must have a length (should be an array or typed array)");m().set(q,u);return u}};a=Dp(a);var f=[],g=0;x("array"!==b,'Return type should not be "array".');if(d)for(var k=0;k<d.length;k++){var l=
e[c[k]];l?(0===g&&(g=Pi()),f[k]=l(d[k])):f[k]=d[k]}c=a(...f);return c=function(q){0!==g&&Si(g);return"string"===b?F(q):"boolean"===b?!!q:q}(c)};w?Ti=!1:cj();[44].forEach(a=>{Gj[a]=new G(a);Gj[a].stack="<generic error, no stack>"});Wj=Array(4096);ub(H,"/");rk("/tmp");rk("/home");rk("/home/web_user");
(function(){rk("/dev");yj(259,{read:()=>0,write:(d,e,f,g)=>g});sk("/dev/null",259);xj(1280,Aj);xj(1536,Bj);sk("/dev/tty",1280);sk("/dev/tty1",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(b=pj(a).byteLength);return a[--b]};pb("random",c);pb("urandom",c);rk("/dev/shm");rk("/dev/shm/tmp")})();
(function(){rk("/proc");var a=rk("/proc/self");rk("/proc/self/fd");ub({s(){var b=Ej(a,"fd",16895,73);b.g={Aa(c,d){var e=kk(+d);c={parent:null,s:{Ba:"fake"},g:{Ea:()=>e.path}};return c.parent=c}};return b}},"/proc/self/fd")})();var J;
v.requestFullscreen=function(a,b){function c(){bm=!1;var f=d.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===f?(d.exitFullscreen=km,im&&d.requestPointerLock(),bm=!0,jm?("undefined"!=typeof SDL&&(f=r()[SDL.screen>>2],f|=8388608,p()[SDL.screen>>2]=f),om(v.canvas),nm()):om(d)):(f.parentNode.insertBefore(d,f),f.parentNode.removeChild(f),jm?("undefined"!=typeof SDL&&(f=r()[SDL.screen>>
2],f&=-8388609,p()[SDL.screen>>2]=f),om(v.canvas),nm()):om(d));v.onFullScreen?.(bm);v.onFullscreen?.(bm)}im=a;jm=b;"undefined"==typeof im&&(im=!0);"undefined"==typeof jm&&(jm=!1);var d=v.canvas;hm||(hm=!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");d.parentNode.insertBefore(e,d);e.appendChild(d);
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()};v.requestFullScreen=function(){sa("Module.requestFullScreen has been replaced by Module.requestFullscreen (without a capital S)")};v.requestAnimationFrame=Pl;
v.setCanvasSize=function(a,b,c){om(v.canvas,a,b);c||nm()};v.pauseMainLoop=$l;v.resumeMainLoop=am;v.getUserMedia=function(a){let b;(b=window).getUserMedia||(b.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia);window.getUserMedia(a)};
v.createContext=function(a,b,c,d){if(b&&v.xa&&a==v.canvas)return v.xa;var e;if(b){var f={antialias:!1,alpha:!1,$a:"undefined"!=typeof WebGL2RenderingContext?2:1};if(d)for(var g in d)f[g]=d[g];if("undefined"!=typeof Cl&&(e=zl(a,f)))var k=nl[e].C}else k=a.getContext("2d");if(!k)return null;c&&(b||x("undefined"==typeof J,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),v.xa=k,b&&Bl(e),v.Cd=b,dm.forEach(l=>l()),em());return k};for(var Fp=0;32>Fp;++Fp)pm.push(Array(Fp));
var Gp=new Int32Array(288);for(Fp=0;288>=Fp;++Fp)xm[Fp]=Gp.subarray(0,Fp);var Hp=new Float32Array(288);for(Fp=0;288>=Fp;++Fp)ym[Fp]=Hp.subarray(0,Fp);v.request_quit=function(){dn()};v.onExit=function(a){const b=Xm;an();Q=null;Sm="en";Tm=2;Vm=Um=!1;Xm=Wm=null;b&&b(a)};fn=Promise.resolve();v.initConfig=function(a){Tm=a.canvasResizePolicy;Q=a.canvas;Sm=a.locale||Sm;Um=a.virtualKeyboard;Vm=!!a.persistentDrops;Wm=a.onExecute;Xm=a.onExit;a.focusCanvas&&Q.focus()};
v.initFS=function(a){Ym=!1;if(!Array.isArray(a))return Promise.reject(Error("Persistent paths must be an array"));if(!a.length)return Promise.resolve();$m=a.slice();$m.forEach(function(b){try{Lj(b)}catch(c){44!==c.i&&O(c),Nj(b)}ub(D,b)});return new Promise(function(b){ok(!0,function(c){c?($m=[],Ym=!1,Lm(`IndexedDB not available: ${c.message}`)):Ym=!0;b(c)})})};v.copyToFS=cn;en.push(function(a){Un();a()});en.push(function(a){Xn();a()});
en.push(function(a){go&&(go.remove(),go=null);ho&&(ho.remove(),ho=null);a()});en.push(function(a){Io&&(Io.remove(),Io=null);a()});cp=new Map;
var El=[zi,Wi,jj,Pb,Qb,Rb,Sb,Tb,Ub,Vb,Wb,Xb,Yb,Zb,ac,bc,cc,dc,ec,fc,gc,hc,ic,jc,kc,lc,mc,nc,oc,pc,qc,rc,sc,tc,uc,vc,Cc,Nc,Em,cf,Fm,ff,gf,jf,kf,mf,nf,of,pf,qf,rf,tf,uf,vf,wf,xf,yf,zf,Af,Bf,Cf,Df,Ef,Ff,Gf,Hf,If,Jf,Kf,Lf,Mf,Nf,Of,Pf,Qf,Rf,Sf,Tf,Xf,Yf,Zf,$f,ag,bg,cg,dg,eg,fg,gg,hg,ig,jg,kg,lg,mg,ng,og,pg,qg,rg,sg,tg,ug,vg,wg,xg,yg,zg,Ag,Bg,Cg,Dg,Eg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng,Og,Pg,Qg,Rg,Sg,Tg,Ug,Vg,Wg,Xg,Yg,Zg,$g,ah,bh,ch,dh,eh,fh,gh,hh,ih,jh,kh,lh,mh,nh,oh,ph,qh,rh,sh,th,vh,wh,xh,yh,zh,Ah,Bh,Ch,Dh,Eh,Fh,
Gh,Hh,Ih,Jh,Kh,Lh,Mh,Nh,Oh,Ph,Qh,Rh,Sh,Th,Uh,Vh,Wh,Xh,Yh,Zh,$h,ai,bi,ci,di,ei,fi,gi,hi,ii,ji,ki,li,mi,ni,oi,pi,qi,ri,si,ti,ui,vi,wi,xi,yi],Lb,Fb=function(){function a(d,e){Fb=d.exports;aj.push(Fb._emscripten_tls_init);gj=Fb.__indirect_function_table;x(gj,"table not found in wasm exports");hb.unshift(Fb.__wasm_call_ctors);Wa=e;Cb("wasm-instantiate");return Fb}var b=Ka();Bb("wasm-instantiate");var c=v;if(v.instantiateWasm)try{return v.instantiateWasm(b,a)}catch(d){A(`Module.instantiateWasm callback failed with error: ${d}`),
qa(d)}Gb||=Db("redot.web.template_release.wasm32.wasm")?"redot.web.template_release.wasm32.wasm":v.locateFile?v.locateFile("redot.web.template_release.wasm32.wasm",Ba):Ba+"redot.web.template_release.wasm32.wasm";Kb(b,function(d){x(v===c,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");c=null;a(d.instance,d.module)}).catch(qa);return{}}(),M=Eb("free",1);v.__Z14godot_web_mainiPPc=Eb("_Z14godot_web_mainiPPc",2);
var Ip=v._main=Eb("__main_argc_argv",2),wl=Eb("malloc",1),Yi=Eb("fflush",1),Km=Eb("htonl",1),Jk=Eb("htons",1),Rk=Eb("ntohs",1);v.__emwebxr_on_input_event=Eb("_emwebxr_on_input_event",2);v.__emwebxr_on_simple_event=Eb("_emwebxr_on_simple_event",1);
var Xj=Eb("strerror",1),Ja=()=>(Ja=Fb.pthread_self)(),eo=Eb("emscripten_webgl_get_current_context",0),Xi=Eb("__funcs_on_exit",0),La=Eb("_emscripten_thread_init",6),Sa=v.__emscripten_thread_crashed=Eb("_emscripten_thread_crashed",0),bb=()=>(bb=Fb.emscripten_stack_get_end)(),Ri=Eb("_emscripten_run_on_main_thread_js",5),Ji=Eb("_emscripten_thread_free_data",1),Qa=Eb("_emscripten_thread_exit",1),Zk=Eb("_emscripten_check_mailbox",0),Jp=()=>(Jp=Fb.emscripten_stack_init)(),ej=(a,b)=>(ej=Fb.emscripten_stack_set_limits)(a,
b),Si=a=>(Si=Fb._emscripten_stack_restore)(a),Qi=a=>(Qi=Fb._emscripten_stack_alloc)(a),Pi=()=>(Pi=Fb.emscripten_stack_get_current)();v.callMain=Kp;v.cwrap=(a,b,c)=>(...d)=>Ep(a,b,c,d);
"writeI53ToI64Clamped writeI53ToI64Signaling writeI53ToU64Clamped writeI53ToU64Signaling convertI32PairToI53 convertI32PairToI53Checked convertU32PairToI53 getTempRet0 setTempRet0 arraySum addDays emscriptenLog readEmAsmArgs listenOnce autoResumeAudioContext getDynCaller dynCall setWasmTableEntry asmjsMangle HandleAllocator getNativeTypeSize STACK_SIZE STACK_ALIGN POINTER_SIZE ASSERTIONS uleb128Encode sigToWasmTypes generateFuncType convertJsFunctionToWasm getEmptyTableSlot updateTableMap getFunctionAddress addFunction removeFunction reallyNegative unSign strLen reSign formatString intArrayToString AsciiToString UTF16ToString stringToUTF16 lengthBytesUTF16 UTF32ToString stringToUTF32 lengthBytesUTF32 registerKeyEventCallback 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 setCanvasElementSize getCanvasSizeCallingThread getCanvasSizeMainThread getCanvasElementSize jsStackTrace getCallstack convertPCtoSourceLocation checkWasiClock wasiRightsToMuslOFlags wasiOFlagsToMuslOFlags createDyncallWrapper setImmediateWrapped clearImmediateWrapped polyfillSetImmediate getPromise makePromise idsToPromises makePromiseCallback Browser_asyncPrepareDataCounter FS_unlink FS_mkdirTree _setNetworkCallback emscriptenWebGLGetUniform emscriptenWebGLGetVertexAttrib __glGetActiveAttribOrUniform writeGLArray emscripten_webgl_destroy_context_before_on_calling_thread registerWebGlEventCallback runAndAbortIfError emscriptenWebGLGetIndexed ALLOC_NORMAL ALLOC_STACK allocate writeStringToMemory writeAsciiToMemory setErrNo demangle stackTrace".split(" ").forEach(function(a){"undefined"==typeof globalThis||
Object.getOwnPropertyDescriptor(globalThis,a)||Object.defineProperty(globalThis,a,{configurable:!0,get(){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;c.startsWith("_")||(c="$"+a);b+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${c}')`;Ai(a)&&(b+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you");Ci(b)}});Di(a)});"run addOnPreRun addOnInit addOnPreMain addOnExit addOnPostRun addRunDependency removeRunDependency out err abort wasmMemory wasmExports GROWABLE_HEAP_I8 GROWABLE_HEAP_U8 GROWABLE_HEAP_I16 GROWABLE_HEAP_U16 GROWABLE_HEAP_I32 GROWABLE_HEAP_U32 GROWABLE_HEAP_F32 GROWABLE_HEAP_F64 writeStackCookie checkStackCookie writeI53ToI64 readI53FromI64 readI53FromU64 INT53_MAX INT53_MIN bigintToI53Checked stackSave stackRestore stackAlloc ptrToString zeroMemory exitJS getHeapMax growMemory ENV MONTH_DAYS_REGULAR MONTH_DAYS_LEAP MONTH_DAYS_REGULAR_CUMULATIVE MONTH_DAYS_LEAP_CUMULATIVE isLeapYear ydayFromDate ERRNO_CODES strError inetPton4 inetNtop4 inetPton6 inetNtop6 readSockaddr writeSockaddr DNS Protocols Sockets initRandomFill randomFill timers warnOnce readEmAsmArgsArray jstoi_q jstoi_s getExecutableName getWasmTableEntry handleException keepRuntimeAlive runtimeKeepalivePush runtimeKeepalivePop callUserCallback maybeExit asyncLoad alignMemory mmapAlloc wasmTable noExitRuntime getCFunc ccall freeTableIndexes functionsInTableMap setValue getValue PATH PATH_FS UTF8Decoder UTF8ArrayToString UTF8ToString stringToUTF8Array stringToUTF8 lengthBytesUTF8 intArrayFromString stringToAscii UTF16Decoder stringToNewUTF8 stringToUTF8OnStack writeArrayToMemory JSEvents specialHTMLTargets maybeCStringToJsString findEventTarget findCanvasEventTarget currentFullscreenStrategy restoreOldWindowedStyle setCanvasElementSizeCallingThread setCanvasElementSizeMainThread UNWIND_CACHE ExitStatus getEnvStrings doReadv doWritev safeSetTimeout promiseMap Browser setMainLoop getPreloadedImageData__data wget SYSCALLS getSocketFromFD getSocketAddress 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 heapObjectForWebGLType toTypedArrayIndex webgl_enable_ANGLE_instanced_arrays webgl_enable_OES_vertex_array_object webgl_enable_WEBGL_draw_buffers webgl_enable_WEBGL_multi_draw GL emscriptenWebGLGet computeUnpackAlignedImageSize colorChannelsInGlTextureFormat emscriptenWebGLGetTexPixelData webglGetUniformLocation webglPrepareUniformLocationsBeforeFirstUse webglGetLeftBracePos AL GLUT EGL GLEW IDBStore SDL SDL_gfx webgl_enable_WEBGL_draw_instanced_base_vertex_base_instance webgl_enable_WEBGL_multi_draw_instanced_base_vertex_base_instance allocateUTF8 allocateUTF8OnStack print printErr PThread terminateWorker killThread cleanupThread registerTLSInit cancelThread spawnThread exitOnMainThread proxyToMainThread proxiedJSCallArgs invokeEntryPoint checkMailbox GodotWebXR GodotWebSocket GodotRTCDataChannel GodotRTCPeerConnection GodotAudio GodotAudioWorklet GodotAudioScript GodotDisplayVK GodotDisplayCursor GodotDisplayScreen GodotDisplay GodotFetch IDHandler GodotConfig GodotFS GodotOS GodotEventListeners GodotPWA GodotRuntime GodotIME GodotInputGamepads GodotInputDragDrop GodotInput GodotWebGL2 GodotJSWrapper IDBFS".split(" ").forEach(Di);
var Lp;yb=function Mp(){Lp||Np();Lp||(yb=Mp)};function Kp(a=[]){x(0==wb,'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])');x(0==gb.length,"cannot call main when preRun functions remain to be called");a.unshift(za);var b=a.length,c=Qi(4*(b+1)),d=c;a.forEach(f=>{r()[d>>2]=Cp(f);d+=4});r()[d>>2]=0;try{var e=Ip(b,c);lf(e,!0);return e}catch(f){return Vi(f)}}
function Np(){var a=ya;function b(){if(!Lp&&(Lp=!0,v.calledRun=!0,!Xa&&(nb(),cb(),w||vb(ib),pa(v),v.onRuntimeInitialized?.(),Op&&Kp(a),cb(),!w))){if(v.postRun)for("function"==typeof v.postRun&&(v.postRun=[v.postRun]);v.postRun.length;){var c=v.postRun.shift();kb.unshift(c)}vb(kb)}}if(!(0<wb))if(w||(x(!w),Jp(),ab()),w)pa(v),nb(),startWorker(v);else{x(!w);if(v.preRun)for("function"==typeof v.preRun&&(v.preRun=[v.preRun]);v.preRun.length;)gb.unshift(v.preRun.shift());vb(gb);0<wb||(v.setStatus?(v.setStatus("Running..."),
setTimeout(function(){setTimeout(function(){v.setStatus("")},1);b()},1)):b(),cb())}}if(v.preInit)for("function"==typeof v.preInit&&(v.preInit=[v.preInit]);0<v.preInit.length;)v.preInit.pop()();var Op=!1;v.noInitialRun&&(Op=!1);Np();moduleRtn=ra;for(const a of Object.keys(v))a in moduleArg||Object.defineProperty(moduleArg,a,{configurable:!0,get(){sa(`Access to module property ('${a}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`)}});
return moduleRtn;
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = Redot;
else if (typeof define === 'function' && define['amd'])
define([], () => Redot);
var isPthread = globalThis.self?.name === 'em-pthread';
// When running as a pthread, construct a new instance on startup
isPthread && Redot();
function t(c=1){try{return!!document.createElement("canvas").getContext(["webgl","webgl2"][c-1])}catch(e){}return!1}function u(){return"fetch"in window&&"Response"in window&&"body"in window.Response.prototype}function v(){return!0===window.isSecureContext}function w(){return!0===window.crossOriginIsolated}function x(){return"SharedArrayBuffer"in window}function y(){return"AudioContext"in window&&"audioWorklet"in AudioContext.prototype}
function z(c={}){({threads:c=!0}=c);const e=[];t(2)||e.push("WebGL2 - Check web browser configuration and hardware support");u()||e.push("Fetch - Check web browser version");v()||e.push("Secure Context - Check web server configuration (use HTTPS)");c&&(w()||e.push("Cross-Origin Isolation - Check that the web server configuration sends the correct headers."),x()||e.push("SharedArrayBuffer - Check that the web server configuration sends the correct headers."));return e};function A(){function c(){let a=0,d=0,l=!0,m=!0;Object.keys(n).forEach(function(f){f=n[f];f.done||(m=!1);l&&0!==f.total?d+=f.total:(l=!1,d=0);a+=f.loaded});if(a!==p||d!==g)p=a,g=d,"function"===typeof h&&h(a,d);m||requestAnimationFrame(c)}function e(a,d){function l(f,q){return f.read().then(function(r){if(d.done)return Promise.resolve();r.value&&(q.enqueue(r.value),d.loaded+=r.value.length);if(!r.done)return l(f,q);d.done=!0;return Promise.resolve()})}const m=a.body.getReader();return new Response(new ReadableStream({start:function(f){l(m,
f).then(function(){f.close()})}}),{headers:a.headers})}function k(a,d,l,m){d[a]={total:l||0,loaded:0,done:!1};return fetch(a).then(function(f){if(!f.ok)return Promise.reject(Error(`Failed loading file '${a}'`));f=e(f,d[a]);return m?Promise.resolve(f):f.arrayBuffer()})}function b(a,d=1){return a().catch(function(l){return 1>=d?Promise.reject(l):new Promise(function(m,f){setTimeout(function(){b(a,d-1).then(m).catch(f)},1E3)})})}const n={};var p=0,g=0;let h=null;this.S=c;this.T=function(a){h=a};this.s=
function(a,d,l=!1){return b(k.bind(null,a,n,d,l),4)};this.i=[];this.B=function(a,d,l){let m=null;if("string"===typeof a){const f=this;return this.s(a,l).then(function(q){f.i.push({path:d||a,buffer:q});return Promise.resolve()})}a instanceof ArrayBuffer?m=new Uint8Array(a):ArrayBuffer.isView(a)&&(m=new Uint8Array(a.buffer));return m?(this.i.push({path:d,buffer:a}),Promise.resolve()):Promise.reject(Error("Invalid object for preloading"))}};function B(c){function e(k){this.update(k)}e.prototype={M:!0,canvas:null,m:"",D:null,locale:null,u:2,j:[],A:!0,v:!1,serviceWorker:"",L:["/userfs"],K:!1,l:[],o:[],F:null,G:null,J:null,H:function(){console.log.apply(console,Array.from(arguments))},I:function(k){console.error.apply(console,Array.from(arguments))}};e.prototype.update=function(k){function b(p,g){return"undefined"===typeof n[p]?g:n[p]}const n=k||{};this.M=b("unloadAfterInit",this.M);this.I=b("onPrintError",this.I);this.H=b("onPrint",this.H);
this.J=b("onProgress",this.J);this.canvas=b("canvas",this.canvas);this.m=b("executable",this.m);this.D=b("mainPack",this.D);this.locale=b("locale",this.locale);this.u=b("canvasResizePolicy",this.u);this.L=b("persistentPaths",this.L);this.K=b("persistentDrops",this.K);this.v=b("experimentalVK",this.v);this.A=b("focusCanvas",this.A);this.serviceWorker=b("serviceWorker",this.serviceWorker);this.l=b("gdextensionLibs",this.l);this.o=b("fileSizes",this.o);this.j=b("args",this.j);this.F=b("onExecute",this.F);
this.G=b("onExit",this.G)};e.prototype.R=function(k,b){let n=b;const p=this.l;return{print:this.H,printErr:this.I,thisProgram:this.m,noExitRuntime:!1,dynamicLibraries:[`${k}.side.wasm`].concat(this.l),instantiateWasm:function(g,h){function a(d){h(d.instance,d.module)}"undefined"!==typeof WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(Promise.resolve(n),g).then(a):n.arrayBuffer().then(function(d){WebAssembly.instantiate(d,g).then(a)});n=null;return{}},locateFile:function(g){if(g.startsWith("godot.")||
g.startsWith("redot.")){if(g.endsWith(".worker.js"))return`${k}.worker.js`;if(g.endsWith(".audio.worklet.js"))return`${k}.audio.worklet.js`;if(g.endsWith(".audio.position.worklet.js"))return`${k}.audio.position.worklet.js`;if(g.endsWith(".js"))return`${k}.js`;if(!(g in p)){if(g.endsWith(".side.wasm"))return`${k}.side.wasm`;if(g.endsWith(".wasm"))return`${k}.wasm`}}return g}}};e.prototype.P=function(k){if(!(this.canvas instanceof HTMLCanvasElement)){var b=document.getElementsByTagName("canvas");b.length&&
b[0]instanceof HTMLCanvasElement&&(this.canvas=b[0]);if(!this.canvas)throw Error("No canvas found in page");}0>this.canvas.tabIndex&&(this.canvas.tabIndex=0);b=this.locale;b||(b=navigator.languages?navigator.languages[0]:navigator.language,b=b.split(".")[0]);b=b.replace("-","_");const n=this.G;return{canvas:this.canvas,canvasResizePolicy:this.u,locale:b,persistentDrops:this.K,virtualKeyboard:this.v,focusCanvas:this.A,onExecute:this.F,onExit:function(p){k();"function"===typeof n&&n(p)}}};return new e(c)}
;const C=function(){function c(g){this.g=new B(g);this.h=null}function e(g){c.prototype={C:function(h){if(p)return p;if(null==b){if(!h)return p=Promise.reject(Error("A base path must be provided when calling `init` and the engine is not loaded."));c.load(h,this.g.o[`${h}.wasm`])}const a=this;k.T(this.g.J);return p=function(d){return new Promise(function(l){d.then(function(m){m=new Response(m.clone().body,{headers:[["content-type","application/wasm"]]});Redot(a.g.R(n,m)).then(function(f){f.initFS(a.g.L).then(function(){a.h=
f;a.g.M&&c.i();l()})})})})}(b)},O:function(h,a){return k.B(h,a,this.g.o[h])},start:function(h){this.g.update(h);const a=this;return a.C().then(function(){if(!a.h)return Promise.reject(Error("The engine must be initialized before it can be started"));let d={};try{d=a.g.P(function(){a.h=null})}catch(l){return Promise.reject(l)}a.h.initConfig(d);return 0<a.g.l.length&&!a.h.loadDynamicLibrary?Promise.reject(Error('GDExtension libraries are not supported by this engine version. Enable "Extensions Support" for your export preset and/or build your custom template with "dlink_enabled=yes".')):
new Promise(function(l){for(const m of k.i)a.h.copyToFS(m.path,m.buffer);k.i.length=0;a.h.callMain(a.g.j);p=null;a.N();l()})})},B:function(h){this.g.update(h);h=this.g.m;const a=this.g.D||`${h}.pck`;this.g.j=["--main-pack",a].concat(this.g.j);const d=this;return Promise.all([this.C(h),this.O(a,a)]).then(function(){return d.start.apply(d)})},i:function(h,a){if(null==this.h)throw Error("Engine must be inited before copying files");this.h.copyToFS(h,a)},s:function(){this.h&&this.h.request_quit()},N:function(){return this.g.serviceWorker&&
"serviceWorker"in navigator?navigator.serviceWorker.register(this.g.serviceWorker):Promise.resolve()}};c.prototype.init=c.prototype.C;c.prototype.preloadFile=c.prototype.O;c.prototype.start=c.prototype.start;c.prototype.startGame=c.prototype.B;c.prototype.copyToFS=c.prototype.i;c.prototype.requestQuit=c.prototype.s;c.prototype.installServiceWorker=c.prototype.N;c.prototype.load=c.load;c.prototype.unload=c.i;return new c(g)}const k=new A;let b=null,n="",p=null;c.load=function(g,h){null==b&&(n=g,b=
k.s(`${n}.wasm`,h,!0),requestAnimationFrame(k.S));return b};c.i=function(){b=null};e.load=c.load;e.unload=c.i;e.isWebGLAvailable=t;e.isFetchAvailable=u;e.isSecureContext=v;e.isCrossOriginIsolated=w;e.isSharedArrayBufferAvailable=x;e.isAudioWorkletAvailable=y;e.getMissingFeatures=z;return e}();"undefined"!==typeof window&&(window.Engine=C);