var k;k||(k=typeof Module !== 'undefined' ? Module : {});k.hk||(k.hk=0);k.hk++;
k.ENVIRONMENT_IS_PTHREAD||k.$ww||function(a){function b(n,p,q,u){if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)require("fs").readFile(n,function(r,B){r?u(r):q(B.buffer)});else{var w=new XMLHttpRequest;w.open("GET",n,!0);w.responseType="arraybuffer";w.onprogress=function(r){var B=p;r.total&&(B=r.total);if(r.loaded){w.Ki?k.Aj[n].loaded=r.loaded:(w.Ki=!0,k.Aj||(k.Aj={}),k.Aj[n]={loaded:r.loaded,total:B});var y=B=r=0,G;for(G in k.Aj){var L=k.Aj[G];
r+=L.total;B+=L.loaded;y++}r=Math.ceil(r*k.hk/y);k.setStatus&&k.setStatus(`Downloading data... (${B}/${r})`)}else!k.Aj&&k.setStatus&&k.setStatus("Downloading data...")};w.onerror=function(){throw Error("NetworkError for: "+n);};w.onload=function(){if(200==w.status||304==w.status||206==w.status||0==w.status&&w.response)q(w.response);else throw Error(w.statusText+" : "+w.responseURL);};w.send(null)}}function c(n){console.error("package error:",n)}function d(){function n(w,r,B){this.start=w;this.end=
r;this.audio=B}function p(w){if(!w)throw"Loading data file failed."+Error().stack;if(w.constructor.name!==ArrayBuffer.name)throw"bad input to processPackageData"+Error().stack;w=new Uint8Array(w);n.prototype.Qi=w;w=a.files;for(var r=0;r<w.length;++r)n.prototype.Ki[w[r].filename].onload();k.removeRunDependency("datafile_runner.data")}k.FS_createPath("/","assets",!0, !0);n.prototype={Ki:{},open:function(w,r){this.name=r;this.Ki[r]=this;k.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){this.finish(this.Qi.subarray(this.start,
this.end))},finish:function(w){k.FS_createDataFile(this.name,null,w,!0,!0,!0);k.removeRunDependency(`fp ${this.name}`);this.Ki[this.name]=null}};for(var q=a.files,u=0;u<q.length;++u)(new n(q[u].start,q[u].end,q[u].audio||0)).open("GET",q[u].filename);k.addRunDependency("datafile_runner.data");k.Yk||(k.Yk={});k.Yk["runner.data"]={im:!1};h?(p(h),h=null):g=p}"object"===typeof window?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+
"/"):"undefined"===typeof process&&"undefined"!==typeof location&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/");"function"!==typeof k.locateFilePackage||k.locateFile||(k.locateFile=k.locateFilePackage,l("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var e=k.locateFile?k.locateFile("runner.data",""):"runner.data",f=a.remote_package_size,g=null,h=k.getPreloadedPackage?
k.getPreloadedPackage(e,f):null;h||b(e,f,function(n){g?(g(n),g=null):h=n},c);k.calledRun?d():(k.preRun||(k.preRun=[]),k.preRun.push(d))}({"files":[{"filename":"/assets/options.ini","start":0,"end":117,"audio":0}],"remote_package_size":117,"package_uuid":"58b61728-34fa-44a0-b8c8-8c69faaa06e8"});this.doGMLCallback=function(a,b){b=JSON.stringify(b);var c=aa(b)+1,d=m(c);t(b,v,d,c);console.log("AddAsyncMethod="+g_pAddAsyncMethod+", methodToCall="+a+", stringOnWasmHeap="+d+", argsAsJSON="+b);k.dynCall("vii",g_pAddAsyncMethod,[a,d])};
this.triggerAdPrefix=function(a,b,c,d,e){var f=m(80),g=f+16,h=f+32,n=f+48,p=f+64;ba(f+0,a,16);ba(g,b,16);ba(h,c,16);ba(n,d,16);ba(p,e,16);return f};this.ModuleName=function(){return k};this.triggerAdPostfix=function(a){ca(a)};this.triggerPaymentPrefix=function(a){var b=m(16);ba(b,a,16);return b};this.triggerPaymentPostfix=function(a){ca(a)};var da=null,ea=[],fa=null,ia=null,ja=null,ka=null,la=null;function ma(){da&&("visible"===document.visibilityState?da.resume():da.suspend())}var na=void 0,oa=void 0;
this.gx_set_default_unhandled_exception_handler=function(a,b){na=a;oa=b;hasJSExceptionHandler=function(){return!0};doJSExceptionHandler=function(c){na(JSON.parse(c),oa)}};var pa=void 0;this.OGX_startDRMCheck=function(){pa&&k.dynCall("v",pa)};var qa=void 0,ra=void 0,sa=void 0,ta=void 0;this.GM_pause=function(){qa&&k.dynCall("v",qa)};this.GM_unpause=function(){ra&&k.dynCall("v",ra)};this.GM_tick=function(){sa&&k.dynCall("vd",sa,[performance.now()])};
this.GM_is_multiplayer=function(){return ta?k.dynCall("i",ta):0};var ua=void 0,va=void 0;this.GM_get_view_status=function(){var a=void 0;if(ua){var b=k.dynCall("i",ua);a=b?x(v,b):"";a=JSON.parse(a);ca(b)}return a};this.GM_set_view_status=function(a){if(va){a=JSON.stringify(a);var b=aa(a)+1,c=m(b);t(a,v,c,b);console.log("GM_set_view_status="+va+", stringOnWasmHeap="+c+", argsAsJSON="+a);k.dynCall("vi",va,[c])}};var wa=[],xa=!1,ya=!1;
this.activate_clipboard=function(){!xa&&navigator.clipboard&&navigator.permissions&&!ya&&(ya=!0,navigator.permissions.query({name:"clipboard-read",Xl:!0}).then(function(a){if("granted"==a.state||"prompt"==a.state){xa=!0;ya=!1;for(a=0;a<wa.length;++a)navigator.clipboard.writeText(wa[a]);wa=[];navigator.clipboard.readText().then(b=>{""!=b&&wa.push(b)}).catch(()=>{})}}))};
this.clipboard_has_text=function(){if(!xa)return activate_clipboard(),!1;navigator.clipboard.readText().then(a=>{""!=a&&wa.push(a)}).catch(()=>{});return 0<wa.length};this.clipboard_get_text=function(){var a="";xa?0<wa.length&&(a=wa.pop()):activate_clipboard();return a};this.clipboard_set_text=function(a){xa?navigator.clipboard&&navigator.clipboard.writeText(a):(activate_clipboard(),wa.push(a))};var za={},Aa={},Ba="";
this.__gx_cache_file=function(a){if(window.oprt&&window.oprt.gameFiles){var b=window.origin+"/"+a.name,c=new URLSearchParams(window.location.search);const d=c.get("game"),e=c.get("track");c=c.get("release");null!=d&&null!=e&&null!=c&&(b=window.location.origin+"/"+d+"/"+e+"/"+c+"/"+a.name);console.log("__gx_cache_file for "+b);b=new Request(b);let f=a.name+":"+a.md5;window.oprt.gameFiles.fetchAndCache(f,Ba,b).then(g=>{g.arrayBuffer().then(function(){console.log("fetchAndCache complete for file:id "+
f);Aa[a.name]={name:a.name,md5:a.md5,fileId:f,version:Ba}})})}return Promise.resolve()};this.__gx_check_cache=function(a,b){var c=void 0!=Aa[a];b&&console.log("__gx_check_cache for "+a+" cached files "+JSON.stringify(Aa)+" manifest files "+JSON.stringify(za));!c&&void 0!=za[a]&&b&&this.__gx_cache_file(za[a]);return c};
this.__gx_prepare_cache=function(a){Ba=a;return new Promise(function(b,c){if(window.oprt&&window.oprt.gameFiles){let e=manifestFiles().split(";");var d=manifestFilesMD5();window.oprt.gameFiles.keys().then(f=>{console.log("current cache entries are "+JSON.stringify(f));var g={};let h=[];for(var n=0;n<f.length;++n){var p=f[n],q=p.fileId,u="",w=q.indexOf(":");0<=w&&(u=q.substring(w+1),q=q.substring(0,w));w=e.indexOf(q);console.log("considering file "+q+" for deleting, indexOf is "+w+" cached MD5 is "+
u+" manifest md5 is "+(0>w?" not present":d[w]));0>w||d[w]!=u?h.push(window.oprt.gameFiles.delete(p.fileId,p.version)):g[q]={name:q,md5:u,fileId:p.fileId,version:p.version}}console.log("current cache files are "+JSON.stringify(g));Aa=g;f={};for(n=0;n<e.length;++n)f[e[n]]={name:e[n],md5:d[n]};za=f;void 0==Aa["game.unx"]?(console.log("caching game.unx"),this.__gx_cache_file(za["game.unx"]).then(()=>{b({cachedFiles:Aa,allFiles:e})})):b({cachedFiles:Aa,allFiles:e})}).catch(f=>{c(Error("error trying to enumerate cache keys - "+
JSON.stringify(f)))})}else c(Error("unable to cache, API not found"))})};this.__gx_async_wget2=function(a,b,c,d,e,f,g){window.oprt&&window.oprt.gameFiles&&(a=Aa[a],a=window.oprt.gameFiles.match(a.fileId,a.version),a.catch(()=>{k.dynCall("vi",g,[d])}),a.then(h=>h.arrayBuffer()).then(h=>{h=new Uint8Array(h);var n=m(h.length);v.set(h,n);f&&k.dynCall("viiii",f,[4294967295,d,n,h.length]);e&&e(n)}))};var Ca={},Da={};this.g_stackEXTEnv=[];var Ea=void 0;
this.__js_override_script_function=function(a,b){Ca[a]=b;if(Ea){b=aa(a)+1;var c=m(b);t(a,v,c,b);k.dynCall("vpi",Ea,[c,1]);ca(c)}};this.__js_remove_override_script_function=function(a){Ca[a]=void 0;if(Ea){var b=aa(a)+1,c=m(b);t(a,v,c,b);k.dynCall("vpi",Ea,[c,0]);ca(c)}};this.__call_override_script_function=function(a,b,c,d){var e="undefined";void 0!==Ca[a]&&(d=void 0!=d&&""!=d?JSON.parse(d):[],d.unshift(c),d.unshift(b),a=Ca[a].apply(null,d),e=void 0!=a?JSON.stringify(a):"undefined");return e};
var Fa=void 0,Ga=void 0,Ha=void 0,Ia=void 0,Ja=void 0,Ka=void 0;this.__js_call_gml=function(a,b,c,d,e){var f=Array.prototype.slice.call(arguments,5);f=JSON.stringify(f);f=z(f);var g=k.dynCall("pipppp",Ha,[a,c,d,e,f]),h=g?x(v,g):"";h=JSON.parse(h);ca(g);ca(f);return h};this.__js_call_var=function(a,b,c,d){b=(a=k.dynCall("pipp",Ja,[a,c,d]))?x(v,a):"";b=JSON.parse(b);ca(a);return b};
this.__js_call_varSet=function(a,b,c){var d=Array.prototype.slice.call(arguments,3);d=JSON.stringify(d);d=z(d);return k.dynCall("iippp",Ka,[a,c,0,d])};
this.__js_get_gml=function(){if(void 0==Fa&&(Fa={},Ga)){var a=k.dynCall("iipp",Ga,[-1,0,0]),b=k.dynCall("iipp",Ga,[-2,0,0]),c=k.dynCall("iippp",Ia,[-1,0,0,0]),d=m(12),e=d+4,f=d+8;for(let p=0;p<a;p++){k.dynCall("iipp",Ga,[p,d,e]);var g=k.getValue(d,"*"),h=g?x(v,g):"",n=k.getValue(e,"*");Fa[h]=this.__js_call_gml.bind(this,p,h,n);ca(g)}for(a=0;a<b;a++)k.dynCall("iipp",Ga,[a+1E5,d,e]),h=(g=k.getValue(d,"*"))?x(v,g):"",n=k.getValue(e,"*"),Fa[h]=this.__js_call_gml.bind(this,a+1E5,h,n),ca(g);for(a=0;a<c;a++)k.dynCall("iippp",
Ia,[a,d,e,f]),h=(g=k.getValue(d,"*"))?x(v,g):"",b=k.getValue(e,"*"),n=k.getValue(f,"*"),0!=b&&0!=n?Object.defineProperty(Fa,h,{get:this.__js_call_var.bind(this,a,h,b),set:this.__js_call_varSet.bind(this,a,h,n)}):0!=b?Object.defineProperty(Fa,h,{get:this.__js_call_var.bind(this,a,h,b)}):0!=n&&Object.defineProperty(Fa,h,{set:this.__js_call_varSet.bind(this,a,h,n)}),ca(g);ca(d)}return Fa};
GXMFS={lj:{},Si:function(a){return C.Si.apply(null,arguments)},zk:(a,b,c)=>{GXMFS.ik(a,(d,e)=>{if(d)return c(d);GXMFS.jk(a,(f,g)=>{if(f)return c(f);GXMFS.sk(b?g:e,b?e:g,c)})})},Hl:()=>{GXMFS.lj={}},tl:(a,b)=>{var c=GXMFS.lj[a];c||(c=window.oprt.gameStorage.open(a),GXMFS.lj[a]=c);return b(null,c)},ik:(a,b)=>{function c(h){return"."!==h&&".."!==h}function d(h){return n=>La(h+"/"+n)}var e={};for(a=Ma(a.oj).filter(c).map(d(a.oj));a.length;){var f=a.pop();try{var g=Na(f)}catch(h){return b(h)}D(g.mode)&&
a.push.apply(a,Ma(f).filter(c).map(d(f)));e[f]={timestamp:g.mtime}}return b(null,{type:"local",entries:e})},jk:(a,b)=>{GXMFS.tl(a.oj,(c,d)=>{if(c)return b(c);d.list().then(e=>{b(null,{type:"remote",storage:d,entries:e})}).catch(b)})},lk:(a,b)=>{try{var c=Oa(a).node;var d=Na(a)}catch(e){return b(e)}return D(d.mode)?b(null,{timestamp:d.mtime,mode:d.mode}):32768===(d.mode&61440)?(c.Mi=Pa(c),b(null,{timestamp:d.mtime,mode:d.mode,contents:c.Mi})):b(Error("node type not supported"))},xk:(a,b,c)=>{try{if(D(b.mode))Qa(a,
b.mode);else if(32768===(b.mode&61440))Ra(a,b.contents);else return c(Error("node type not supported"));Sa(a,b.mode);Ta(a,b.timestamp,b.timestamp)}catch(d){return c(d)}c(null)},uk:(a,b)=>{try{var c=Na(a);D(c.mode)?Ua(a):32768===(c.mode&61440)&&Va(a)}catch(d){return b(d)}b(null)},mk:(a,b,c)=>{a.get(b).then(d=>{c(null,d)}).catch(c)},yk:(a,b,c,d)=>{a.put(c,b).then(()=>{d(null)}).catch(d)},vk:(a,b,c)=>{a.delete(b).then(()=>{c(null)}).catch(c)},sk:(a,b,c)=>{function d(p){e--;if(p&&!h)return h=!0,console.error("Reconcile failed"),
c(p);if(0===e&&!h)return console.info("Reconcile finished successfully"),c(null)}console.info("Starting reconcile");var e=0,f=[];Object.keys(a.entries).forEach(function(p){var q=a.entries[p],u=b.entries[p];u&&q.timestamp.getTime()==u.timestamp.getTime()||(f.push(p),e++)});console.debug(`${f.length} entries to create/update on the ${"local"===b.type?"local filesystem":"remote filesystem"}`);var g=[];Object.keys(b.entries).forEach(function(p){a.entries[p]||(g.push(p),e++)});console.debug(`${g.length} entries to remove from the ${"local"===
b.type?"local filesystem":"remote filesystem"}`);if(0==e)return c(null);var h=!1,n="remote"===a.type?a.storage:b.storage;f.sort().forEach(p=>{"local"===b.type?GXMFS.mk(n,p,(q,u)=>{if(q)return d(q);GXMFS.xk(p,u,d)}):GXMFS.lk(p,(q,u)=>{if(q)return d(q);GXMFS.yk(n,p,u,d)})});g.sort().reverse().forEach(p=>{"local"===b.type?GXMFS.uk(p,d):GXMFS.vk(n,p,d)})}};
var Wa=Object.assign({},k),Xa=[],Ya="./this.program",Za=(a,b)=>{throw b;},$a="object"==typeof window,ab="function"==typeof importScripts,bb="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,cb="",db,eb,fb;
if(bb){var fs=require("fs"),gb=require("path");cb=ab?gb.dirname(cb)+"/":__dirname+"/";db=(a,b)=>{a=hb(a)?new URL(a):gb.normalize(a);return fs.readFileSync(a,b?void 0:"utf8")};fb=a=>{a=db(a,!0);a.buffer||(a=new Uint8Array(a));return a};eb=(a,b,c,d=!0)=>{a=hb(a)?new URL(a):gb.normalize(a);fs.readFile(a,d?void 0:"utf8",(e,f)=>{e?c(e):b(d?f.buffer:f)})};!k.thisProgram&&1<process.argv.length&&(Ya=process.argv[1].replace(/\\/g,"/"));Xa=process.argv.slice(2);"undefined"!=typeof module&&(module.exports=k);
process.on("uncaughtException",a=>{if(!("unwind"===a||a instanceof ib||a.context instanceof ib))throw a;});Za=(a,b)=>{process.exitCode=a;throw b;};k.inspect=()=>"[Emscripten Module object]"}else if($a||ab)ab?cb=self.location.href:"undefined"!=typeof document&&document.currentScript&&(cb=document.currentScript.src),cb=0!==cb.indexOf("blob:")?cb.substr(0,cb.replace(/[?#].*/,"").lastIndexOf("/")+1):"",db=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},ab&&(fb=a=>{var b=
new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),eb=(a,b,c)=>{var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=()=>{200==d.status||0==d.status&&d.response?b(d.response):c()};d.onerror=c;d.send(null)};var jb=k.print||console.log.bind(console),l=k.printErr||console.error.bind(console);Object.assign(k,Wa);Wa=null;k.arguments&&(Xa=k.arguments);k.thisProgram&&(Ya=k.thisProgram);k.quit&&(Za=k.quit);var kb;
k.wasmBinary&&(kb=k.wasmBinary);"object"!=typeof WebAssembly&&lb("no native wasm support detected");var mb,nb=!1,ob,E,v,pb,qb,F,H,I,rb;function sb(){var a=mb.buffer;k.HEAP8=E=new Int8Array(a);k.HEAP16=pb=new Int16Array(a);k.HEAPU8=v=new Uint8Array(a);k.HEAPU16=qb=new Uint16Array(a);k.HEAP32=F=new Int32Array(a);k.HEAPU32=H=new Uint32Array(a);k.HEAPF32=I=new Float32Array(a);k.HEAPF64=rb=new Float64Array(a)}var tb=[],ub=[],vb=[],wb=[],xb=[],yb=!1;function zb(){var a=k.preRun.shift();tb.unshift(a)}
var Ab=0,Bb=null,Cb=null;function Db(){Ab++;k.monitorRunDependencies&&k.monitorRunDependencies(Ab)}function Eb(){Ab--;k.monitorRunDependencies&&k.monitorRunDependencies(Ab);if(0==Ab&&(null!==Bb&&(clearInterval(Bb),Bb=null),Cb)){var a=Cb;Cb=null;a()}}function lb(a){if(k.onAbort)k.onAbort(a);a="Aborted("+a+")";l(a);nb=!0;ob=1;a+=". Build with -sASSERTIONS for more info.";yb&&Fb();throw new WebAssembly.RuntimeError(a);}
var Gb=a=>a.startsWith("data:application/octet-stream;base64,"),hb=a=>a.startsWith("file://"),Hb;Hb="runner.wasm";if(!Gb(Hb)){var Ib=Hb;Hb=k.locateFile?k.locateFile(Ib,cb):cb+Ib}function Jb(a){if(a==Hb&&kb)return new Uint8Array(kb);if(fb)return fb(a);throw"both async and sync fetching of the wasm failed";}
function Kb(a){if(!kb&&($a||ab)){if("function"==typeof fetch&&!hb(a))return fetch(a,{credentials:"same-origin"}).then(b=>{if(!b.ok)throw"failed to load wasm binary file at '"+a+"'";return b.arrayBuffer()}).catch(()=>Jb(a));if(eb)return new Promise((b,c)=>{eb(a,d=>b(new Uint8Array(d)),c)})}return Promise.resolve().then(()=>Jb(a))}function Lb(a,b,c){return Kb(a).then(d=>WebAssembly.instantiate(d,b)).then(d=>d).then(c,d=>{l(`failed to asynchronously prepare wasm: ${d}`);lb(d)})}
function Mb(a,b){var c=Hb;kb||"function"!=typeof WebAssembly.instantiateStreaming||Gb(c)||hb(c)||bb||"function"!=typeof fetch?Lb(c,a,b):fetch(c,{credentials:"same-origin"}).then(d=>WebAssembly.instantiateStreaming(d,a).then(b,function(e){l(`wasm streaming compile failed: ${e}`);l("falling back to ArrayBuffer instantiation");return Lb(c,a,b)}))}
var J,K,Vb={1546200:(a,b,c,d)=>{a=__call_override_script_function(a?x(v,a):"",b,c,d?x(v,d):"");return z(a)},1546322:()=>hasJSExceptionHandler(),1546387:a=>{doJSExceptionHandler(a?x(v,a):"")},1546431:a=>{window.parent.postMessage(a?x(v,a):"","*")},1546485:()=>document.querySelector("canvas").getBoundingClientRect().left,1546605:()=>document.querySelector("canvas").getBoundingClientRect().top,1546724:()=>{var a=document.querySelector("canvas").getBoundingClientRect();return a.right-a.left},1546857:()=>
{var a=document.querySelector("canvas").getBoundingClientRect();return a.bottom-a.top},1546990:(a,b,c,d,e,f)=>{gxc_request_room(a?x(v,a):"",b?x(v,b):"",c,d,e?x(v,e):"",f?x(v,f):"")},1547092:(a,b,c,d)=>{gxc_join_room(a?x(v,a):"",b?x(v,b):"",c?x(v,c):"",d?x(v,d):"")},1547183:()=>{var a=document.getElementById("stats-button");a&&(a.style.visibility="visible");if(a=document.getElementById("log-state-button"))a.style.visibility="visible"},1547432:()=>{var a=document.getElementById("stats-button");a&&(a.style.visibility=
"visible");if(a=document.getElementById("log-state-button"))a.style.visibility="visible"},1547681:(a,b)=>{var c=document.getElementById("multiplayer-stats-container");if(c&&"visible"==c.style.visibility){if(c=document.getElementById("multiplayer-stats"))c.innerHTML=a?x(v,a):"";void 0!=report_stats&&report_stats(b)}},1548005:a=>{"function"==typeof showRollbackMessage&&showRollbackMessage(a?x(v,a):"")},1548098:()=>{var a=document.getElementById("stats-button");a&&(a.style.visibility="hidden");if(a=
document.getElementById("share-button"))a.style.visibility="hidden";if(a=document.getElementById("log-state-button"))a.style.visibility="hidden"},1548460:(a,b)=>{gxc_set_player_status(a,b?x(v,b):"")},1548511:a=>{gxc_report_status(a?x(v,a):"")},1548552:(a,b,c)=>{gxc_get_player_info(a?x(v,a):"",b?x(v,b):"",c?x(v,c):"")},1548631:(a,b)=>{gxc_set_room_info(a,b)},1548662:(a,b,c)=>{gxc_get_player_info(a?x(v,a):"",b?x(v,b):"",c?x(v,c):"")},1548741:(a,b,c)=>{gxc_receive_chat_message(a?x(v,a):"",b,c)},1548797:(a,
b)=>webtransport_set_relay(a?x(v,a):"",b),1548854:a=>{webtransport_destroy(a)},1548884:(a,b,c)=>{webtransport_send(a,b,c)},1548919:(a,b,c)=>webtransport_receive(a,b,c),1548964:a=>{"function"==typeof wallpaper_init_config_controls&&wallpaper_init_config_controls(JSON.parse(a?x(v,a):""))},1549091:a=>{"function"==typeof wallpaper_init_subscriptions&&wallpaper_init_subscriptions(JSON.parse(a?x(v,a):""))},1549214:a=>{alert(a?x(v,a):"")},1549244:a=>{alert(a?x(v,a):"")},1549273:()=>clipboard_has_text(),
1549321:()=>{var a=clipboard_get_text(),b=aa(a)+1,c=m(b);t(a,v,c,b+1);return c},1549497:a=>{clipboard_set_text(a?x(v,a):"")},1549540:()=>{var a=-1;window.matchMedia("(orientation:portrait)").matches?a=1:window.matchMedia("(orientation:landscape)").matches&&(a=0);return a},1549718:a=>{a=window.open(a?x(v,a):"","_blank");null!=a&&a.focus()},1549803:()=>z(navigator.userAgent.toString()),1549878:()=>z(window.location.href),1549928:()=>z(window.location.host),1549978:()=>z(window.location.protocol),1550032:()=>
z(window.location.pathname),1550086:()=>{var a=new URLSearchParams(window.location.search),b={};for(const [c,d]of a.entries())b[c]=d;return z(JSON.stringify(b))},1550261:()=>{var a=document.querySelector("canvas");null!=a.Ki&&(a.Ki.pause(),a.Ki.removeAttribute("src"),a.Ki.load(),console.log("Closing video player"),a.Ki.remove(),a.Ki=null)},1550579:(a,b,c)=>{var d=document.querySelector("canvas");if(null!=d.Mj)return b=d.Mj.getImageData(0,0,b,c),b=new Uint8Array(b.data.buffer),E.set(b,a),1;console.log("Not rendering video as context is null");
return 0},1550916:()=>{var a=document.querySelector("canvas");return null!=a.Ki?a.Ki.videoWidth:0},1551063:()=>{var a=document.querySelector("canvas");return null!=a.Ki?a.Ki.videoHeight:0},1551211:()=>{var a=document.querySelector("canvas");return null==a.Ki||a.Ki.ended?-1:0},1551366:a=>{var b=document.querySelector("canvas");null!=b.Ki&&(b.Ki.volume=a)},1551499:a=>{function b(){function h(){const q=document.querySelector("canvas").Ki;null!=q&&(q.muted=!1)}console.log("Adding unmute listener");var n=
"mousedown",p="mouseup";"ontouchstart"in window&&(n="touchstart",p="touchend");if(window.PointerEvent||window.navigator.pointerEnabled||window.navigator.msPointerEnabled)n="pointerdown",p="pointerup";document.body.addEventListener(n,h,{once:!0});document.body.addEventListener(p,h,{once:!0});console.log("Done unmute listener")}const c=()=>{var h=document.querySelector("canvas");null!==h.Ki&&(null==h.$i?(h.$i=document.createElement("canvas"),h.$i.style.cssText="position:fixed; top:1px; left:1px; width:1px; height:1px",
h.$i.width=h.Ki.videoWidth,h.$i.height=h.Ki.videoHeight,document.body.appendChild(h.$i),h.Mj=h.$i.getContext("2d",{alpha:!1,Yl:!1,powerPreference:"low-power",desynchronized:!0,preserveDrawingBuffer:!0})):(h.Ki.videoWidth!=h.$i.width&&(h.$i.width=h.Ki.videoWidth),h.$i.height!=h.Ki.videoHeight&&(h.$i.height=h.Ki.videoHeight)),null!=h.Ki&&null!=h.Mj?h.Mj.drawImage(h.Ki,0,0):console.log("player or context is null not drawing video"),null!=h.Ki?null!=h.Ki.src?h.Ki.requestVideoFrameCallback(c):console.log("stopping video player callback check"):
console.log("Not requesting callback as videoplayer is null"))};var d=document.querySelector("canvas");null==d.Ki?d.Ki=document.createElement("video"):(d.Ki.remove(),d.Ki=document.createElement("video"),d.Ki.pause());a=a?x(v,a):"";var e=void 0;try{e=JSON.parse(a)}catch{}console.log("using srcpath:"+a);void 0!==e?"mediaDevices"in navigator&&"getUserMedia"in navigator.mediaDevices?(console.log("getUserMedia supported"),navigator.mediaDevices.getUserMedia(e).then(h=>{console.log("getUserMedia completed");
d.Ki.srcObject=h;d.Ki.requestVideoFrameCallback(c)}).catch(h=>{console.error("Error accessing the camera: ",h)})):console.log("no getUserMedia support in this browser"):(console.log("Failed to parse json, presuming it's a path:"+a),d.Ki.muted=!1,a=a.toLowerCase(),a=a.replace(/ /g,"_"),console.log("Converted path to:"+a),d.Ki.src=a,d.Ki.requestVideoFrameCallback(c),d.Ki.load());const f={Rl:k.cwrap("video_playback_ended","","")},g={Sl:k.cwrap("video_playback_started","","")};console.log("About to add ended callback");
d.Ki.addEventListener("ended",function(){f.Rl()});console.log("About to add playing callback");d.Ki.addEventListener("playing",function(){console.log("Video playing event called");g.Sl()},!0);a=d.Ki.play();void 0!==a&&a.then(()=>{}).catch(()=>{console.log("video_open failed. User must interact with the page before video with audio can be played. Attempting to play the video muted");d.Ki.muted=!0;d.Ki.play();b()})},1556063:()=>{var a=document.querySelector("canvas");null!=a.Ki&&a.Ki.pause()},1556194:()=>
{var a=document.querySelector("canvas");null!=a.Ki&&a.Ki.play()},1556324:a=>{var b=document.querySelector("canvas");null!=b.Ki&&(b.Ki.loop=.5<a?!0:!1)},1556517:a=>{var b=document.querySelector("canvas");null!=b.Ki&&(b.Ki.currentTime=a)},1556657:()=>{var a=document.querySelector("canvas");return null==a.Ki||isNaN(a.Ki.duration)?0:a.Ki.duration},1556852:()=>{var a=document.querySelector("canvas");return null!=a.Ki?a.Ki.currentTime:0},1557004:()=>{var a=document.querySelector("canvas");return null!=
a.Ki?a.Ki.ended?0:a.Ki.paused?3:a.Ki.readyState<a.Ki.HAVE_CURRENT_DATA?1:2:0},1557524:()=>{var a=document.querySelector("canvas");return null!=a.Ki?a.Ki.loop:0},1557669:()=>{var a=document.querySelector("canvas");return null!=a.Ki?a.Ki.volume:0},1557816:(a,b,c,d)=>{var e=document.querySelector("canvas");if(MediaRecorder.isTypeSupported("video/webm;codecs=vp9")){console.log("CheckMediaRecorder::vp9 supported");var f={mimeType:"video/webm; codecs=vp9"}}else MediaRecorder.isTypeSupported("video/webm;codecs=vp8")?
(f={mimeType:"video/webm; codecs=vp8"},console.log("CheckMediaRecorder::vp8 supported")):console.log("CheckMediaRecorder::No vp8 or vp9 support");e.Ek=e.captureStream(c);e.Ek.getVideoTracks().find(g=>g.enabled);null==e.gj&&(e.gj=document.createElement("canvas"),e.gj.style.cssText="position:fixed; top:1px; left:1px; width:1px; height:1px",e.gj.width=a,e.gj.height=b,document.body.appendChild(e.gj),console.log("Game Canvas width:"+e.width+" height:"+e.height),e.bl=e.gj.getContext("2d",{alpha:!1,desynchronized:!0,
antialias:!0,powerPreference:"low-power",preserveDrawingBuffer:!0}),e.rj=document.createElement("video"),e.rj.autoplay=!0,e.rj.Vl=!0,e.rj.muted=!0,e.rj.style.cssText="position:fixed;top:1px;left:1px;width:1px;height:1px",document.body.appendChild(e.rj),e.rj.srcObject=e.Ek,a=e.gj.captureStream(c),0<d&&(d=da.createMediaStreamDestination().stream.getAudioTracks().find(g=>g.enabled),a.addTrack(d)),f=new MediaRecorder(a,f),e.jj=[],f.ondataavailable=function(g){e.jj.push(g.data)},e.Qi=f);null==e.bk&&(e.bk=
setInterval(()=>e.bl.drawImage(e.rj,0,0,e.width,e.height,0,0,e.gj.width,e.gj.height),1E3/c));e.Qi&&"recording"!=e.Qi.state&&e.Qi.start()},1560312:a=>{var b=document.querySelector("canvas");if(b.Qi&&("recording"==b.Qi.state||"paused"==b.Qi.state)){var c=a?x(v,a):"";b.Qi.onstop=function(){var d=new Blob(b.jj,{type:"video/webm"});b.jj=[];clearInterval(b.bk);b.bk=null;const e={qk:k.cwrap("post_video_upload_callback","",["string"])};if(c.startsWith("http"))fetch(c,{method:"PUT",body:d}).then(()=>{e.qk("upload completed")}).catch(g=>
{e.qk("Error uploading: "+g)});else if(""!=c){d=URL.createObjectURL(d);var f=document.createElement("a");document.body.appendChild(f);f.style="display: none";f.href=d;f.download=c;f.click();window.URL.revokeObjectURL(d);e.qk("filesaved")}};b.Qi.stop();console.log("saving chunks to movie")}},1561456:()=>{var a=document.querySelector("canvas");a.Qi&&"recording"==a.Qi.state&&a.Qi.pause()},1561626:()=>{var a=document.querySelector("canvas");a.Qi&&"paused"==a.Qi.state&&a.Qi.resume()},1561794:(a,b,c,d,
e,f)=>{triggerAd(a?x(v,a):"",b,c,d,e,f)},1561847:(a,b)=>{triggerPayment(a?x(v,a):"",b)},1561889:()=>{Nb(!0,function(){Ob("GXC_FSSyncCompleted","void")})},1561964:()=>{var a=640;"number"==typeof window.innerWidth?a=window.innerWidth*window.devicePixelRatio:document.documentElement&&document.documentElement.clientWidth?a=document.documentElement.clientWidth:document.body&&document.body.clientWidth&&(a=document.body.clientWidth);return a},1562296:()=>{var a=void 0;"number"==typeof window.innerHeight?
a=window.innerHeight*window.devicePixelRatio:document.documentElement&&document.documentElement.clientHeight?a=document.documentElement.clientHeight:document.body&&document.body.clientHeight&&(a=document.body.clientHeight);if(void 0===a)return 480;var b=document.querySelector(".output-button");null!=b&&(a-=b.offsetHeight+16);return a},1562790:(a,b,c,d)=>{var e=-1;if(void 0!=window.oprt){var f=window.oprt.unlockOrientation,g=window.oprt.lockPortraitOrientation,h=window.oprt.lockLandscapeOrientation;
a=(a?1:0)|(b?2:0)|(c?4:0);a|=d?8:0;15!=(a&15)&&0!=a||void 0==f||"function"!=typeof f||(f(),console.log("unlocking all orientations"));0!=(a&5)&&void 0!=h&&"function"==typeof h?(h(),console.log("Locking to Landscape"),e=0):0!=(a&10)&&void 0!=g&&"function"==typeof g&&(g(),console.log("Locking to Portrait"),e=0)}return e},1563778:()=>z(navigator.language),1563826:()=>z(navigator.language),1563874:()=>z(window.location.hostname),1563943:a=>{a?void 0!=window.oprt&&void 0!=window.oprt.enterFullscreen?(console.log("enterFullscreen"),
window.oprt.enterFullscreen()):(console.log("canvas requesting enterFullscreen"),a=document.querySelector("canvas"),void 0!=a.requestFullscreen?a.requestFullscreen({navigationUI:"hide"}):void 0!=a.webkitRequestFullscreen?a.webkitRequestFullscreen():a.mozRequestFullScreen&&a.mozRequestFullScreen()):void 0!=window.oprt&&void 0!=window.oprt.exitFullscreen?(console.log("exitFullscreen"),window.oprt.exitFullscreen()):(console.log("exitFullscreen via document"),void 0!=document.exitFullscreen?document.exitFullscreen():
void 0!=document.webkitExitFullscreen?document.webkitExitFullscreen():void 0!=document.mozCancelFullScreen&&document.mozCancelFullScreen())},1564901:()=>screen.width,1564926:()=>screen.height,1564952:(a,b)=>{this.onGameSetWindowSize&&onGameSetWindowSize(a,b)},1565021:a=>{document.title=a?x(v,a):""},1565060:(a,b)=>{this.onGameSetWindowSize&&onGameSetWindowSize(a,b)},1565129:a=>{document.querySelector("canvas").style.cursor=a?x(v,a):""},1565228:a=>{a=a?x(v,a):"";Da[a]=eval(a)},1565293:function(a,b,
c,d){var e="undefined";a=a?x(v,a):"";void 0!==Da[a]&&(globalThis.g_stackEXTEnv.push({self:c,other:d}),b=b?x(v,b):"",b=void 0!=b&&""!=b?JSON.parse(b):[],a=Da[a].apply(null,b),e=void 0!=a?JSON.stringify(a):"undefined",globalThis.g_stackEXTEnv.pop());return z(e)},1565768:()=>{var a=document.getElementById("canvas").getContext("webgl"),b=a.getExtension("WEBGL_compressed_texture_astc");null==b&&console.log("Failed to get WEBGL_compressed_texture_astc extension.");b=a.getExtension("WEBGL_compressed_texture_s3tc");
null==b&&console.log("Failed to get WEBGL_compressed_texture_s3tc extension.");b=a.getExtension("WEBGL_compressed_texture_s3tc_srgb");null==b&&console.log("Failed to get WEBGL_compressed_texture_s3tc_srgb extension.")},1566361:()=>screen.width,1566386:()=>screen.height,1566412:()=>screen.width,1566437:()=>screen.height,1566463:()=>{var a=document.getElementById("canvas");const b=a.style.visibility;a.style.visibility="hidden";a.offsetHeight;a.style.visibility=b},1566701:(a,b)=>{g_pWadLoadCallback&&
g_pWadLoadCallback(a,b)},1566761:()=>{var a=manifestFiles(),b=aa(a)+1,c=m(b);t(a,v,c,b);return c},1566917:a=>__gx_check_cache(a?x(v,a):"",!0)?1:0,1566979:(a,b,c,d,e,f,g,h)=>{__gx_async_wget2(a?x(v,a):"",b?x(v,b):"",c?x(v,c):"",d,e,f,g,h)},1567076:()=>{(function(){function a(){try{console.log("Requesting permission"),DeviceMotionEvent&&"function"===typeof DeviceMotionEvent.requestPermission?DeviceMotionEvent.requestPermission().then(e=>{({Vj:k.cwrap("on_request_permission_callback","",["string","string"])}).Vj(e,
"DeviceMotion")}):b.Vj("Permission unknown","DeviceMotion")}catch(e){b.Vj("Permission unknown","DeviceMotion")}}const b={Vj:k.cwrap("on_request_permission_callback","",["string","string"])};var c="mousedown",d="mouseup";"ontouchstart"in window&&(c="touchstart",d="touchend");if(window.PointerEvent||window.navigator.pointerEnabled||window.navigator.msPointerEnabled)c="pointerdown",d="pointerup";document.body.addEventListener(c,a,{once:!0});document.body.addEventListener(d,a,{once:!0})})()},1568332:a=>
{setAddAsyncMethod(a)},1568359:(a,b,c,d)=>{__gx_prepare_cache(c?x(v,c):"").then(e=>{console.log("Prepare cache completed"+JSON.stringify(e));k.dynCall("vi",a,[b])}).catch(e=>{console.log("Prepare cache error "+e);k.dynCall("vi",a,[d])})},1568639:()=>{window.onerror=function(a){if(a.includes("ResizeObserver"))return!1;alert("Error occured: "+a);return!0};window.addEventListener("deviceorientation",function(a){({Fl:k.cwrap("on_orientation_update_callback","",["float","float","float"])}).Fl(a.alpha,
a.beta,a.gamma)},!0);window.addEventListener("message",a=>{const b={Wk:k.cwrap("on_post_message_callback","",["string","string"])};"string"===typeof a.data||a.data instanceof String?b.Wk(a.data,a.origin):b.Wk(JSON.stringify(a.data),a.origin)});window.parent.postMessage("gm_post_message_listener_setup_complete","*")},1569534:a=>__gx_check_cache(a?x(v,a):"",!1)?1:0,1569595:(a,b)=>{g_pWadLoadCallback&&g_pWadLoadCallback(a,b)},1569655:a=>{window.location.replace(a?x(v,a):"")},1569702:()=>{this.onFirstFrameRendered&&
onFirstFrameRendered()},1569765:(a,b)=>{this.chrome&&this.chrome.runtime&&chrome.runtime.sendMessage(a?x(v,a):"",{command:b?x(v,b):""})},1569902:(a,b,c,d,e)=>{function f(h){if(h.hash){var n=0;(new Uint8Array(h.hash)).every(p=>{n=n+p&255;return!0});g.cl(n,b)}}const g={cl:k.cwrap("YYSum","",["number","number"])};this.chrome&&this.chrome.runtime&&(e=v.subarray(e,e+20),a=a?x(v,a):"",chrome.runtime.sendMessage(c?x(v,c):"",{command:d?x(v,d):"",randomString:a,hash:e},f))},1570462:()=>window.matchMedia("(any-hover: none)").matches||
window.matchMedia("(any-hover: hover) and (pointer: coarse)").matches||"undefined"!=typeof window.oprt,1570635:(a,b,c,d,e,f,g)=>{qa=a;ra=b;ua=c;va=d;sa=e;ta=f;pa=g},1570798:(a,b,c,d,e,f)=>{Ea=a;Ga=b;Ha=c;Ia=d;Ja=e;Ka=f},1570953:(a,b)=>{a=prompt(a?x(v,a):"",b?x(v,b):"");b=aa(a)+1;var c=m(b);t(a,v,c,b+1);return c},1571149:a=>confirm(a?x(v,a):"")?1:0,1571196:(a,b)=>{a=prompt(a?x(v,a):"",b?x(v,b):"");b=1;a?b+=aa(a):a="";var c=m(b);t(a,v,c,b+1);return c},1571427:a=>confirm(a?x(v,a):"")?1:0,1571474:a=>
{alert(a?x(v,a):"")},1571504:()=>{Pb("/_savedata");window.oprt&&window.oprt.gameStorage?Qb(GXMFS,"/_savedata"):Qb(M,"/_savedata");Nb(!0,function(){Ob("FSSyncCompleted","void")})},1571726:()=>{Nb(!1,function(){})},1571764:()=>{Nb(!1,function(){})},1571801:()=>{Nb(!1,function(){})},1571839:()=>{da=new AudioContext;document.addEventListener("visibilitychange",ma)},1571961:()=>{da.close().then(function(){da=null;document.removeEventListener("visibilitychange",ma)})},1572120:()=>{function a(){da.resume().then(function(){document.body.removeEventListener(b,
a);document.body.removeEventListener(c,a)})}let b="mousedown",c="mouseup";"ontouchstart"in window&&(b="touchstart",c="touchend");if(window.PointerEvent||window.navigator.pointerEnabled||window.navigator.msPointerEnabled)b="pointerdown",c="pointerup";document.body.addEventListener(b,a);document.body.addEventListener(c,a)},1572824:()=>{da.suspend()},1572857:()=>null!=da,1572897:()=>{if(null==da)return 4;switch(da.state){case "suspended":return 0;case "running":return 1;case "closed":return 2;case "interrupted":return 3}},
1573091:()=>null==da?0:da.currentTime,1573169:()=>null==da?0:da.sampleRate,1573246:()=>null==da?0:da.destination.channelCount,1573335:(a,b,c,d,e,f)=>{e=da.createBuffer(b,d,e);for(let g=0;g<b;++g){const h=e.getChannelData(g);for(let n=0;n<d;++n)h[n]=Rb(a+c*(g+n*b),"float")}a=da.createBufferSource();a.buffer=e;a.connect(da.destination);a.start(f);return f+e.duration},1573981:a=>{navigator.mediaDevices&&navigator.mediaDevices.getUserMedia&&navigator.mediaDevices.getUserMedia({audio:!0}).then(b=>{const c=
d=>{d=d.getAudioTracks();if(0<d.length)return d[0].getSettings().channelCount};ia=b;ja=new AudioContext({sampleRate:a});ja.audioWorklet.addModule("audio-worklet.js").then(()=>{ka=new AudioWorkletNode(ja,"audio-worklet");ka.port.onmessage=e=>{ea.push(e.data)};fa=new MediaStreamAudioSourceNode(ja,{mediaStream:b});const d=c(b);1<d?(la=new ChannelMergerNode(ja,{numberOfInputs:d}),fa.connect(la),la.connect(ka)):fa.connect(ka);ja.resume()}).catch(d=>{console.error(d);ia&&ia.getTracks().forEach(e=>{e.stop()});
la=fa=ka=ia=ja=null})}).catch(b=>{console.error(b)})},1575758:()=>{ea=[];ia.getTracks().forEach(a=>{a.stop()});ka.port.postMessage(!0);fa.disconnect();fa=null;null!=la&&(la.disconnect(),la=null);ka.disconnect();ka=null;ja.close().then(()=>{ja=null}).catch(a=>{console.error(a)})},1576350:(a,b,c)=>{b/=c;for(let d=0;d<b;++d){const e=ea.shift();for(let f=0;f<c;++f)Sb(a+2*(d*c+f),e[f],"i16")}},1576694:a=>ea.length*a,1576780:()=>null!=fa&&null!=ka?1:0,1576893:()=>"undefined"!==typeof AudioContext||"undefined"!==
typeof webkitAudioContext?!0:!1,1577040:()=>"undefined"!==typeof navigator.mediaDevices&&"undefined"!==typeof navigator.mediaDevices.getUserMedia||"undefined"!==typeof navigator.webkitGetUserMedia?!0:!1,1577274:a=>{"undefined"===typeof k.SDL2&&(k.SDL2={});var b=k.SDL2;a?b.capture={}:b.audio={};b.Ri||("undefined"!==typeof AudioContext?b.Ri=new AudioContext:"undefined"!==typeof webkitAudioContext&&(b.Ri=new webkitAudioContext),b.Ri&&Tb(b.Ri));return void 0===b.Ri?-1:0},1577767:()=>k.SDL2.Ri.sampleRate,
1577835:(a,b,c,d)=>{function e(){}function f(h){void 0!==g.capture.Jj&&(clearTimeout(g.capture.Jj),g.capture.Jj=void 0);g.capture.Tj=g.Ri.createMediaStreamSource(h);g.capture.Ui=g.Ri.createScriptProcessor(b,a,1);g.capture.Ui.onaudioprocess=function(n){void 0!==g&&void 0!==g.capture&&(n.outputBuffer.getChannelData(0).fill(0),g.capture.ek=n.inputBuffer,Ub("vi",c,[d]))};g.capture.Tj.connect(g.capture.Ui);g.capture.Ui.connect(g.Ri.destination);g.capture.stream=h}var g=k.SDL2;g.capture.Xj=g.Ri.createBuffer(a,
b,g.Ri.sampleRate);g.capture.Xj.getChannelData(0).fill(0);g.capture.Jj=setTimeout(function(){g.capture.ek=g.capture.Xj;Ub("vi",c,[d])},b/g.Ri.sampleRate*1E3);void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(f).catch(e):void 0!==navigator.webkitGetUserMedia&&navigator.webkitGetUserMedia({audio:!0,video:!1},f,e)},1579487:(a,b,c,d)=>{var e=k.SDL2;e.audio.Ui=e.Ri.createScriptProcessor(b,0,a);e.audio.Ui.onaudioprocess=
function(f){void 0!==e&&void 0!==e.audio&&(e.audio.Lk=f.outputBuffer,Ub("vi",c,[d]))};e.audio.Ui.connect(e.Ri.destination)},1579897:(a,b)=>{for(var c=k.SDL2,d=c.capture.ek.numberOfChannels,e=0;e<d;++e){var f=c.capture.ek.getChannelData(e);if(f.length!=b)throw"Web Audio capture buffer length mismatch! Destination size: "+f.length+" samples vs expected "+b+" samples!";if(1==d)for(var g=0;g<b;++g)Sb(a+4*g,f[g],"float");else for(g=0;g<b;++g)Sb(a+4*(g*d+e),f[g],"float")}},1580502:(a,b)=>{for(var c=k.SDL2,
d=c.audio.Lk.numberOfChannels,e=0;e<d;++e){var f=c.audio.Lk.getChannelData(e);if(f.length!=b)throw"Web Audio output buffer length mismatch! Destination size: "+f.length+" samples vs expected "+b+" samples!";for(var g=0;g<b;++g)f[g]=I[a+(g*d+e<<2)>>2]}},1580982:a=>{var b=k.SDL2;if(a){void 0!==b.capture.Jj&&clearTimeout(b.capture.Jj);if(void 0!==b.capture.stream){a=b.capture.stream.getAudioTracks();for(var c=0;c<a.length;c++)b.capture.stream.removeTrack(a[c]);b.capture.stream=void 0}void 0!==b.capture.Ui&&
(b.capture.Ui.onaudioprocess=function(){},b.capture.Ui.disconnect(),b.capture.Ui=void 0);void 0!==b.capture.Tj&&(b.capture.Tj.disconnect(),b.capture.Tj=void 0);void 0!==b.capture.Xj&&(b.capture.Xj=void 0);b.capture=void 0}else void 0!=b.audio.Ui&&(b.audio.Ui.disconnect(),b.audio.Ui=void 0),b.audio=void 0;void 0!==b.Ri&&void 0===b.audio&&void 0===b.capture&&(b.Ri.close(),b.Ri=void 0)},1582154:(a,b,c)=>{k.SDL2||(k.SDL2={});var d=k.SDL2;d.gl!==k.canvas&&(d.bj=k.createContext(k.canvas,!1,!0),d.gl=k.canvas);
if(d.w!==a||d.h!==b||d.vl!==d.bj)d.image=d.bj.createImageData(a,b),d.w=a,d.h=b,d.vl=d.bj;a=d.image.data;b=c>>2;var e=0;if("undefined"!==typeof CanvasPixelArray&&a instanceof CanvasPixelArray)for(c=a.length;e<c;){var f=F[b];a[e]=f&255;a[e+1]=f>>8&255;a[e+2]=f>>16&255;a[e+3]=255;b++;e+=4}else if(d.jl!==a&&(d.il=new Int32Array(a.buffer),d.kl=new Uint8Array(a.buffer),d.jl=a),a=d.il,c=a.length,a.set(F.subarray(b,b+c)),a=d.kl,b=3,e=b+4*c,0==c%8)for(;b<e;)a[b]=255,b=b+4|0,a[b]=255,b=b+4|0,a[b]=255,b=b+4|
0,a[b]=255,b=b+4|0,a[b]=255,b=b+4|0,a[b]=255,b=b+4|0,a[b]=255,b=b+4|0,a[b]=255,b=b+4|0;else for(;b<e;)a[b]=255,b=b+4|0;d.bj.putImageData(d.image,0,0)},1583623:(a,b,c,d,e)=>{var f=document.createElement("canvas");f.width=a;f.height=b;var g=f.getContext("2d");a=g.createImageData(a,b);b=a.data;e>>=2;var h=0,n;if("undefined"!==typeof CanvasPixelArray&&b instanceof CanvasPixelArray)for(n=b.length;h<n;){var p=F[e];b[h]=p&255;b[h+1]=p>>8&255;b[h+2]=p>>16&255;b[h+3]=p>>24&255;e++;h+=4}else b=new Int32Array(b.buffer),
n=b.length,b.set(F.subarray(e,e+n));g.putImageData(a,0,0);c=0===c&&0===d?"url("+f.toDataURL()+"), auto":"url("+f.toDataURL()+") "+c+" "+d+", auto";d=m(c.length+1);t(c,v,d,c.length+1);return d},1584612:a=>{k.canvas&&(k.canvas.style.cursor=a?x(v,a):"")},1584695:()=>{k.canvas&&(k.canvas.style.cursor="none")},1584764:()=>window.innerWidth,1584794:()=>window.innerHeight};function ib(a){this.name="ExitStatus";this.message=`Program terminated with exit(${a})`;this.status=a}
var Wb=(a,b,c)=>{a.addEventListener(b,c,{once:!0})},Tb=a=>{var b;b||(b=[document,document.getElementById("canvas")]);["keydown","mousedown","touchstart"].forEach(c=>{b.forEach(d=>{d&&Wb(d,c,()=>{"suspended"===a.state&&a.resume()})})})},Xb=a=>{for(;0<a.length;)a.shift()(k)},Yb=[],Zb,N=a=>{var b=Yb[a];b||(a>=Yb.length&&(Yb.length=a+1),Yb[a]=b=Zb.get(a));return b},Ub=(a,b,c)=>{a.includes("j")?(a=k["dynCall_"+a],b=c&&c.length?a.apply(null,[b].concat(c)):a.call(null,b)):b=N(b).apply(null,c);return b};
function Rb(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return E[a>>0];case "i8":return E[a>>0];case "i16":return pb[a>>1];case "i32":return F[a>>2];case "i64":lb("to do getValue(i64) use WASM_BIGINT");case "float":return I[a>>2];case "double":return rb[a>>3];case "*":return H[a>>2];default:lb(`invalid type for getValue: ${b}`)}}var $b=k.noExitRuntime||!0;
function Sb(a,b,c="i8"){c.endsWith("*")&&(c="*");switch(c){case "i1":E[a>>0]=b;break;case "i8":E[a>>0]=b;break;case "i16":pb[a>>1]=b;break;case "i32":F[a>>2]=b;break;case "i64":lb("to do setValue(i64) use WASM_BIGINT");case "float":I[a>>2]=b;break;case "double":rb[a>>3]=b;break;case "*":H[a>>2]=b;break;default:lb(`invalid type for setValue: ${c}`)}}
var bc=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},La=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=bc(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},cc=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b},dc=a=>
{if("/"===a)return"/";a=La(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)},ec=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return c=>crypto.getRandomValues(c);if(bb)try{var a=require("crypto");if(a.randomFillSync)return c=>a.randomFillSync(c);var b=a.randomBytes;return c=>(c.set(b(c.byteLength)),c)}catch(c){}lb("initRandomDevice")},fc=a=>(fc=ec())(a);
function gc(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:hc;if("string"!=typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=bc(a.split("/").filter(d=>!!d),!b).join("/");return(b?"/":"")+a||"."}
var ic=(a,b)=>{function c(g){for(var h=0;h<g.length&&""===g[h];h++);for(var n=g.length-1;0<=n&&""===g[n];n--);return h>n?[]:g.slice(h,n-h+1)}a=gc(a).substr(1);b=gc(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("/")},jc="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,x=(a,b,c)=>{var d=b+c;for(c=b;a[c]&&!(c>=d);)++c;if(16<c-b&&
a.buffer&&jc)return jc.decode(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;e=224==(e&240)?(e&15)<<12|f<<6|g:(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},kc=[],aa=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},
t=(a,b,c,d)=>{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 h=a.charCodeAt(++f);g=65536+((g&1023)<<10)|h&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;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};
function lc(a,b){var c=Array(aa(a)+1);a=t(a,c,0,c.length);b&&(c.length=a);return c}var mc=[];function nc(a,b){mc[a]={input:[],output:[],ij:b};oc(a,pc)}
var pc={open(a){var b=mc[a.node.rdev];if(!b)throw new R(43);a.tty=b;a.seekable=!1},close(a){a.tty.ij.fsync(a.tty)},fsync(a){a.tty.ij.fsync(a.tty)},read(a,b,c,d){if(!a.tty||!a.tty.ij.Ok)throw new R(60);for(var e=0,f=0;f<d;f++){try{var g=a.tty.ij.Ok(a.tty)}catch(h){throw new R(29);}if(void 0===g&&0===e)throw new R(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.tty||!a.tty.ij.rk)throw new R(60);try{for(var e=0;e<d;e++)a.tty.ij.rk(a.tty,b[c+
e])}catch(f){throw new R(29);}d&&(a.node.timestamp=Date.now());return e}},qc={Ok(){a:{if(!kc.length){var a=null;if(bb){var b=Buffer.alloc(256),c=0,d=process.stdin.fd;try{c=fs.readSync(d,b)}catch(e){if(e.toString().includes("EOF"))c=0;else throw e;}0<c?a=b.slice(0,c).toString("utf-8"):a=null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(a=window.prompt("Input: "),null!==a&&(a+="\n")):"function"==typeof readline&&(a=readline(),null!==a&&(a+="\n"));if(!a){a=null;break a}kc=lc(a,!0)}a=
kc.shift()}return a},rk(a,b){null===b||10===b?(jb(x(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},fsync(a){a.output&&0<a.output.length&&(jb(x(a.output,0)),a.output=[])},yl(){return{bm:25856,dm:5,am:191,cm:35387,$l:[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]}},zl(){return 0},Al(){return[24,80]}},rc={rk(a,b){null===b||10===b?(l(x(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},fsync(a){a.output&&0<a.output.length&&(l(x(a.output,0)),a.output=[])}};
function Pa(a){return a.Mi?a.Mi.subarray?a.Mi.subarray(0,a.Oi):new Uint8Array(a.Mi):new Uint8Array(0)}function sc(a,b){var c=a.Mi?a.Mi.length:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.Mi,a.Mi=new Uint8Array(b),0<a.Oi&&a.Mi.set(c.subarray(0,a.Oi),0))}
var C={ej:null,Si(){return C.createNode(null,"/",16895,0)},createNode(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new R(63);C.ej||(C.ej={dir:{node:{dj:C.Li.dj,Vi:C.Li.Vi,lookup:C.Li.lookup,Uj:C.Li.Uj,rename:C.Li.rename,unlink:C.Li.unlink,rmdir:C.Li.rmdir,readdir:C.Li.readdir,symlink:C.Li.symlink},stream:{vj:C.Ni.vj}},file:{node:{dj:C.Li.dj,Vi:C.Li.Vi},stream:{vj:C.Ni.vj,read:C.Ni.read,write:C.Ni.write,Nj:C.Ni.Nj,nk:C.Ni.nk,Uk:C.Ni.Uk}},link:{node:{dj:C.Li.dj,Vi:C.Li.Vi,readlink:C.Li.readlink},
stream:{}},Kk:{node:{dj:C.Li.dj,Vi:C.Li.Vi},stream:tc}});c=uc(a,b,c,d);D(c.mode)?(c.Li=C.ej.dir.node,c.Ni=C.ej.dir.stream,c.Mi={}):32768===(c.mode&61440)?(c.Li=C.ej.file.node,c.Ni=C.ej.file.stream,c.Oi=0,c.Mi=null):40960===(c.mode&61440)?(c.Li=C.ej.link.node,c.Ni=C.ej.link.stream):8192===(c.mode&61440)&&(c.Li=C.ej.Kk.node,c.Ni=C.ej.Kk.stream);c.timestamp=Date.now();a&&(a.Mi[b]=c,a.timestamp=c.timestamp);return c},Li:{dj(a){var b={};b.dev=8192===(a.mode&61440)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=
1;b.uid=0;b.gid=0;b.rdev=a.rdev;D(a.mode)?b.size=4096:32768===(a.mode&61440)?b.size=a.Oi:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.atime=new Date(a.timestamp);b.mtime=new Date(a.timestamp);b.ctime=new Date(a.timestamp);b.fl=4096;b.blocks=Math.ceil(b.size/b.fl);return b},Vi(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.Oi!=b))if(0==b)a.Mi=null,a.Oi=0;else{var c=a.Mi;a.Mi=new Uint8Array(b);c&&a.Mi.set(c.subarray(0,
Math.min(b,a.Oi)));a.Oi=b}},lookup(){throw vc[44];},Uj(a,b,c,d){return C.createNode(a,b,c,d)},rename(a,b,c){if(D(a.mode)){try{var d=wc(b,c)}catch(f){}if(d)for(var e in d.Mi)throw new R(55);}delete a.parent.Mi[a.name];a.parent.timestamp=Date.now();a.name=c;b.Mi[c]=a;b.timestamp=a.parent.timestamp;a.parent=b},unlink(a,b){delete a.Mi[b];a.timestamp=Date.now()},rmdir(a,b){var c=wc(a,b),d;for(d in c.Mi)throw new R(55);delete a.Mi[b];a.timestamp=Date.now()},readdir(a){var b=[".",".."],c;for(c in a.Mi)a.Mi.hasOwnProperty(c)&&
b.push(c);return b},symlink(a,b,c){a=C.createNode(a,b,41471,0);a.link=c;return a},readlink(a){if(40960!==(a.mode&61440))throw new R(28);return a.link}},Ni:{read(a,b,c,d,e){var f=a.node.Mi;if(e>=a.node.Oi)return 0;a=Math.min(a.node.Oi-e,d);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){b.buffer===E.buffer&&(f=!1);if(!d)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.Mi||a.Mi.subarray)){if(f)return a.Mi=b.subarray(c,c+d),a.Oi=
d;if(0===a.Oi&&0===e)return a.Mi=b.slice(c,c+d),a.Oi=d;if(e+d<=a.Oi)return a.Mi.set(b.subarray(c,c+d),e),d}sc(a,e+d);if(a.Mi.subarray&&b.subarray)a.Mi.set(b.subarray(c,c+d),e);else for(f=0;f<d;f++)a.Mi[e+f]=b[c+f];a.Oi=Math.max(a.Oi,e+d);return d},vj(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.Oi);if(0>b)throw new R(28);return b},Nj(a,b,c){sc(a.node,b+c);a.node.Oi=Math.max(a.node.Oi,b+c)},nk(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new R(43);a=a.node.Mi;if(e&2||
a.buffer!==E.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;lb();b=void 0;if(!b)throw new R(48);E.set(a,b)}else c=!1,b=a.byteOffset;return{Ij:b,yj:c}},Uk(a,b,c,d){C.Ni.write(a,b,0,d,c,!1);return 0}}},xc=(a,b,c)=>{var d=`al ${a}`;eb(a,e=>{e||lb(`Loading data file "${a}" failed (no arrayBuffer).`);b(new Uint8Array(e));d&&Eb(d)},()=>{if(c)c();else throw`Loading data file "${a}" failed.`;});d&&Db(d)},yc=k.preloadPlugins||[],Bc=(a,b,c,d)=>{"undefined"!=
typeof zc&&Ac();var e=!1;yc.forEach(f=>{!e&&f.canHandle(b)&&(f.handle(a,b,c,d),e=!0)});return e},Dc=(a,b,c,d,e,f,g,h,n,p)=>{function q(r){function B(y){p&&p();h||Cc(a,b,y,d,e,n);f&&f();Eb(w)}Bc(r,u,B,()=>{g&&g();Eb(w)})||B(r)}var u=b?gc(La(a+"/"+b)):a,w=`cp ${u}`;Db(w);"string"==typeof c?xc(c,r=>q(r),g):q(c)},Ec=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},M={lj:{},indexedDB:()=>{if("undefined"!=typeof indexedDB)return indexedDB;var a=null;"object"==typeof window&&(a=window.indexedDB||window.mozIndexedDB||
window.webkitIndexedDB||window.msIndexedDB);a||lb("IDBFS used, but indexedDB not supported");return a},al:21,qj:"FILE_DATA",Si:function(a){return C.Si.apply(null,arguments)},zk:(a,b,c)=>{M.ik(a,(d,e)=>{if(d)return c(d);M.jk(a,(f,g)=>{if(f)return c(f);M.sk(b?g:e,b?e:g,c)})})},Hl:()=>{Object.values(M.lj).forEach(a=>a.close());M.lj={}},sl:(a,b)=>{var c=M.lj[a];if(c)return b(null,c);try{var d=M.indexedDB().open(a,M.al)}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(M.qj)?g=e.objectStore(M.qj):g=f.createObjectStore(M.qj);g.indexNames.contains("timestamp")||g.createIndex("timestamp","timestamp",{unique:!1})};d.onsuccess=()=>{c=d.result;M.lj[a]=c;b(null,c)};d.onerror=e=>{b(e.target.error);e.preventDefault()}},ik:(a,b)=>{function c(h){return"."!==h&&".."!==h}function d(h){return n=>La(h+"/"+n)}var e={};for(a=Ma(a.oj).filter(c).map(d(a.oj));a.length;){var f=a.pop();try{var g=Na(f)}catch(h){return b(h)}D(g.mode)&&
a.push.apply(a,Ma(f).filter(c).map(d(f)));e[f]={timestamp:g.mtime}}return b(null,{type:"local",entries:e})},jk:(a,b)=>{var c={};M.sl(a.oj,(d,e)=>{if(d)return b(d);try{var f=e.transaction([M.qj],"readonly");f.onerror=g=>{b(g.target.error);g.preventDefault()};f.objectStore(M.qj).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)}})},lk:(a,b)=>{try{var c=Oa(a).node;
var d=Na(a)}catch(e){return b(e)}return D(d.mode)?b(null,{timestamp:d.mtime,mode:d.mode}):32768===(d.mode&61440)?(c.Mi=Pa(c),b(null,{timestamp:d.mtime,mode:d.mode,contents:c.Mi})):b(Error("node type not supported"))},xk:(a,b,c)=>{try{if(D(b.mode))Qa(a,b.mode);else if(32768===(b.mode&61440))Ra(a,b.contents);else return c(Error("node type not supported"));Sa(a,b.mode);Ta(a,b.timestamp,b.timestamp)}catch(d){return c(d)}c(null)},uk:(a,b)=>{try{var c=Na(a);D(c.mode)?Ua(a):32768===(c.mode&61440)&&Va(a)}catch(d){return b(d)}b(null)},
mk:(a,b,c)=>{a=a.get(b);a.onsuccess=d=>{c(null,d.target.result)};a.onerror=d=>{c(d.target.error);d.preventDefault()}},yk:(a,b,c,d)=>{try{var e=a.put(c,b)}catch(f){d(f);return}e.onsuccess=()=>{d(null)};e.onerror=f=>{d(f.target.error);f.preventDefault()}},vk:(a,b,c)=>{a=a.delete(b);a.onsuccess=()=>{c(null)};a.onerror=d=>{c(d.target.error);d.preventDefault()}},sk:(a,b,c)=>{function d(q){if(q&&!h)return h=!0,c(q)}var e=0,f=[];Object.keys(a.entries).forEach(function(q){var u=a.entries[q],w=b.entries[q];
w&&u.timestamp.getTime()==w.timestamp.getTime()||(f.push(q),e++)});var g=[];Object.keys(b.entries).forEach(function(q){a.entries[q]||(g.push(q),e++)});if(!e)return c(null);var h=!1,n=("remote"===a.type?a.db:b.db).transaction([M.qj],"readwrite"),p=n.objectStore(M.qj);n.onerror=q=>{d(this.error);q.preventDefault()};n.oncomplete=()=>{h||c(null)};f.sort().forEach(q=>{"local"===b.type?M.mk(p,q,(u,w)=>{if(u)return d(u);M.xk(q,w,d)}):M.lk(q,(u,w)=>{if(u)return d(u);M.yk(p,q,w,d)})});g.sort().reverse().forEach(q=>
{"local"===b.type?M.uk(q,d):M.vk(p,q,d)})}},Fc=null,Gc={},Hc=[],Ic=1,Jc=null,hc="/",Kc=!0,R=null,vc={},Lc=0;
function Oa(a,b={}){a=gc(a);if(!a)return{path:"",node:null};b=Object.assign({Mk:!0,tk:0},b);if(8<b.tk)throw new R(32);a=a.split("/").filter(g=>!!g);for(var c=Fc,d="/",e=0;e<a.length;e++){var f=e===a.length-1;if(f&&b.parent)break;c=wc(c,a[e]);d=La(d+"/"+a[e]);c.nj&&(!f||f&&b.Mk)&&(c=c.nj.root);if(!f||b.tj)for(f=0;40960===(c.mode&61440);)if(c=Mc(d),d=gc(cc(d),c),c=Oa(d,{tk:b.tk+1}).node,40<f++)throw new R(32);}return{path:d,node:c}}
function Nc(a){for(var b;;){if(a===a.parent)return a=a.Si.oj,b?"/"!==a[a.length-1]?`${a}/${b}`:a+b:a;b=b?`${a.name}/${b}`:a.name;a=a.parent}}function Oc(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%Jc.length}function Pc(a){var b=Oc(a.parent.id,a.name);a.Bj=Jc[b];Jc[b]=a}function Qc(a){var b=Oc(a.parent.id,a.name);if(Jc[b]===a)Jc[b]=a.Bj;else for(b=Jc[b];b;){if(b.Bj===a){b.Bj=a.Bj;break}b=b.Bj}}
function wc(a,b){var c;if(c=(c=Rc(a,"x"))?c:a.Li.lookup?0:2)throw new R(c,a);for(c=Jc[Oc(a.id,b)];c;c=c.Bj){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.Li.lookup(a,b)}function uc(a,b,c,d){a=new Sc(a,b,c,d);Pc(a);return a}function D(a){return 16384===(a&61440)}function Tc(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b}
function Rc(a,b){if(Kc)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 Uc(a,b){try{return wc(a,b),20}catch(c){}return Rc(a,"wx")}function Vc(a,b,c){try{var d=wc(a,b)}catch(e){return e.Pi}if(a=Rc(a,"wx"))return a;if(c){if(!D(d.mode))return 54;if(d===d.parent||Nc(d)===hc)return 10}else if(D(d.mode))return 31;return 0}function Xc(){for(var a=0;4096>=a;a++)if(!Hc[a])return a;throw new R(33);}
function Yc(a){a=Hc[a];if(!a)throw new R(8);return a}function Zc(a,b=-1){$c||($c=function(){this.Ki={}},$c.prototype={},Object.defineProperties($c.prototype,{object:{get(){return this.node},set(c){this.node=c}},flags:{get(){return this.Ki.flags},set(c){this.Ki.flags=c}},position:{get(){return this.Ki.position},set(c){this.Ki.position=c}}}));a=Object.assign(new $c,a);-1==b&&(b=Xc());a.fd=b;return Hc[b]=a}var tc={open(a){a.Ni=Gc[a.node.rdev].Ni;a.Ni.open&&a.Ni.open(a)},vj(){throw new R(70);}};
function oc(a,b){Gc[a]={Ni:b}}function ad(){for(var a=[],b=[Fc.Si];b.length;){var c=b.pop();a.push(c);b.push.apply(b,c.Tk)}return a}function Nb(a,b){function c(g){Lc--;return b(g)}function d(g){if(g){if(!d.nl)return d.nl=!0,c(g)}else++f>=e.length&&c(null)}"function"==typeof a&&(b=a,a=!1);Lc++;1<Lc&&l(`warning: ${Lc} FS.syncfs operations in flight at once, probably just doing extra work`);var e=ad(),f=0;e.forEach(g=>{if(!g.type.zk)return d(null);g.type.zk(g,a,d)})}
function Qb(a,b){var c="/"===b,d=!b;if(c&&Fc)throw new R(10);if(!c&&!d){var e=Oa(b,{Mk:!1});b=e.path;e=e.node;if(e.nj)throw new R(10);if(!D(e.mode))throw new R(54);}b={type:a,om:{},oj:b,Tk:[]};a=a.Si(b);a.Si=b;b.root=a;c?Fc=a:e&&(e.nj=b,e.Si&&e.Si.Tk.push(b))}function bd(a,b,c){var d=Oa(a,{parent:!0}).node;a=dc(a);if(!a||"."===a||".."===a)throw new R(28);var e=Uc(d,a);if(e)throw new R(e);if(!d.Li.Uj)throw new R(63);return d.Li.Uj(d,a,b,c)}
function Pb(a,b){return bd(a,(void 0!==b?b:511)&1023|16384,0)}function Qa(a,b){a=a.split("/");for(var c="",d=0;d<a.length;++d)if(a[d]){c+="/"+a[d];try{Pb(c,b)}catch(e){if(20!=e.Pi)throw e;}}}function cd(a,b,c){"undefined"==typeof c&&(c=b,b=438);return bd(a,b|8192,c)}function dd(a,b){if(!gc(a))throw new R(44);var c=Oa(b,{parent:!0}).node;if(!c)throw new R(44);b=dc(b);var d=Uc(c,b);if(d)throw new R(d);if(!c.Li.symlink)throw new R(63);c.Li.symlink(c,b,a)}
function Ua(a){var b=Oa(a,{parent:!0}).node;a=dc(a);var c=wc(b,a),d=Vc(b,a,!0);if(d)throw new R(d);if(!b.Li.rmdir)throw new R(63);if(c.nj)throw new R(10);b.Li.rmdir(b,a);Qc(c)}function Ma(a){a=Oa(a,{tj:!0}).node;if(!a.Li.readdir)throw new R(54);return a.Li.readdir(a)}function Va(a){var b=Oa(a,{parent:!0}).node;if(!b)throw new R(44);a=dc(a);var c=wc(b,a),d=Vc(b,a,!1);if(d)throw new R(d);if(!b.Li.unlink)throw new R(63);if(c.nj)throw new R(10);b.Li.unlink(b,a);Qc(c)}
function Mc(a){a=Oa(a).node;if(!a)throw new R(44);if(!a.Li.readlink)throw new R(28);return gc(Nc(a.parent),a.Li.readlink(a))}function Na(a,b){a=Oa(a,{tj:!b}).node;if(!a)throw new R(44);if(!a.Li.dj)throw new R(63);return a.Li.dj(a)}function ed(a){return Na(a,!0)}function Sa(a,b){a="string"==typeof a?Oa(a,{tj:!0}).node:a;if(!a.Li.Vi)throw new R(63);a.Li.Vi(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})}function Ta(a,b,c){a=Oa(a,{tj:!0}).node;a.Li.Vi(a,{timestamp:Math.max(b,c)})}
function fd(a,b,c){if(""===a)throw new R(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=La(a);try{e=Oa(a,{tj:!(b&131072)}).node}catch(f){}}d=!1;if(b&64)if(e){if(b&128)throw new R(20);}else e=bd(a,c,0),d=!0;if(!e)throw new R(44);8192===(e.mode&61440)&&(b&=-513);if(b&65536&&!D(e.mode))throw new R(54);if(!d&&
(c=e?40960===(e.mode&61440)?32:D(e.mode)&&("r"!==Tc(b)||b&512)?31:Rc(e,Tc(b)):44))throw new R(c);if(b&512&&!d){c=e;c="string"==typeof c?Oa(c,{tj:!0}).node:c;if(!c.Li.Vi)throw new R(63);if(D(c.mode))throw new R(31);if(32768!==(c.mode&61440))throw new R(28);if(d=Rc(c,"w"))throw new R(d);c.Li.Vi(c,{size:0,timestamp:Date.now()})}b&=-131713;e=Zc({node:e,path:Nc(e),flags:b,seekable:!0,position:0,Ni:e.Ni,Pl:[],error:!1});e.Ni.open&&e.Ni.open(e);!k.logReadFiles||b&1||(gd||(gd={}),a in gd||(gd[a]=1));return e}
function hd(a){if(null===a.fd)throw new R(8);a.uj&&(a.uj=null);try{a.Ni.close&&a.Ni.close(a)}catch(b){throw b;}finally{Hc[a.fd]=null}a.fd=null}function jd(a,b,c){if(null===a.fd)throw new R(8);if(!a.seekable||!a.Ni.vj)throw new R(70);if(0!=c&&1!=c&&2!=c)throw new R(28);a.position=a.Ni.vj(a,b,c);a.Pl=[];return a.position}
function kd(a,b,c,d,e,f){if(0>d||0>e)throw new R(28);if(null===a.fd)throw new R(8);if(0===(a.flags&2097155))throw new R(8);if(D(a.node.mode))throw new R(31);if(!a.Ni.write)throw new R(28);a.seekable&&a.flags&1024&&jd(a,0,2);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new R(70);b=a.Ni.write(a,b,c,d,e,f);g||(a.position+=b);return b}
function Ra(a,b){var c={Ik:!0};c.flags=c.flags||577;a=fd(a,c.flags,c.mode);if("string"==typeof b){var d=new Uint8Array(aa(b)+1);b=t(b,d,0,d.length);kd(a,d,0,b,void 0,c.Ik)}else if(ArrayBuffer.isView(b))kd(a,b,0,b.byteLength,void 0,c.Ik);else throw Error("Unsupported data type");hd(a)}
function ld(){R||(R=function(a,b){this.name="ErrnoError";this.node=b;this.Jl=function(c){this.Pi=c};this.Jl(a);this.message="FS error"},R.prototype=Error(),R.prototype.constructor=R,[44].forEach(a=>{vc[a]=new R(a);vc[a].stack="<generic error, no stack>"}))}var md;function nd(a,b){a="string"==typeof a?a:Nc(a);for(b=b.split("/").reverse();b.length;){var c=b.pop();if(c){var d=La(a+"/"+c);try{Pb(d)}catch(e){}a=d}}return d}
function od(a,b,c,d){a=La(("string"==typeof a?a:Nc(a))+"/"+b);c=Ec(c,d);return bd(a,(void 0!==c?c:438)&4095|32768,0)}function Cc(a,b,c,d,e,f){var g=b;a&&(a="string"==typeof a?a:Nc(a),g=b?La(a+"/"+b):a);a=Ec(d,e);g=bd(g,(void 0!==a?a:438)&4095|32768,0);if(c){if("string"==typeof c){b=Array(c.length);d=0;for(e=c.length;d<e;++d)b[d]=c.charCodeAt(d);c=b}Sa(g,a|146);b=fd(g,577);kd(b,c,0,c.length,0,f);hd(b);Sa(g,a)}return g}
function pd(a,b,c,d){a=La(("string"==typeof a?a:Nc(a))+"/"+b);b=Ec(!!c,!!d);pd.Rk||(pd.Rk=64);var e=pd.Rk++<<8|0;oc(e,{open(f){f.seekable=!1},close(){d&&d.buffer&&d.buffer.length&&d(10)},read(f,g,h,n){for(var p=0,q=0;q<n;q++){try{var u=c()}catch(w){throw new R(29);}if(void 0===u&&0===p)throw new R(6);if(null===u||void 0===u)break;p++;g[h+q]=u}p&&(f.node.timestamp=Date.now());return p},write(f,g,h,n){for(var p=0;p<n;p++)try{d(g[h+p])}catch(q){throw new R(29);}n&&(f.node.timestamp=Date.now());return p}});
return cd(a,b,e)}function qd(a){if(!(a.Bl||a.Cl||a.link||a.Mi)){if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(db)try{a.Mi=lc(db(a.url),!0),a.Oi=a.Mi.length}catch(b){throw new R(29);}else throw Error("Cannot load without read() or XMLHttpRequest.");}}
function rd(a,b,c,d,e){function f(){this.kk=!1;this.jj=[]}f.prototype.get=function(q){if(!(q>this.length-1||0>q)){var u=q%this.chunkSize;return this.Pk(q/this.chunkSize|0)[u]}};f.prototype.Ki=function(q){this.Pk=q};f.prototype.Hk=function(){var q=new XMLHttpRequest;q.open("HEAD",c,!1);q.send(null);if(!(200<=q.status&&300>q.status||304===q.status))throw Error("Couldn't load "+c+". Status: "+q.status);var u=Number(q.getResponseHeader("Content-length")),w,r=(w=q.getResponseHeader("Accept-Ranges"))&&
"bytes"===w;q=(w=q.getResponseHeader("Content-Encoding"))&&"gzip"===w;var B=1048576;r||(B=u);var y=this;y.Ki(G=>{var L=G*B,O=(G+1)*B-1;O=Math.min(O,u-1);if("undefined"==typeof y.jj[G]){var A=y.jj;if(L>O)throw Error("invalid range ("+L+", "+O+") or no bytes requested!");if(O>u-1)throw Error("only "+u+" bytes available! programmer error!");var P=new XMLHttpRequest;P.open("GET",c,!1);u!==B&&P.setRequestHeader("Range","bytes="+L+"-"+O);P.responseType="arraybuffer";P.overrideMimeType&&P.overrideMimeType("text/plain; charset=x-user-defined");
P.send(null);if(!(200<=P.status&&300>P.status||304===P.status))throw Error("Couldn't load "+c+". Status: "+P.status);L=void 0!==P.response?new Uint8Array(P.response||[]):lc(P.responseText||"",!0);A[G]=L}if("undefined"==typeof y.jj[G])throw Error("doXHR failed!");return y.jj[G]});if(q||!u)B=u=1,B=u=this.Pk(0).length,jb("LazyFiles on gzip forces download of the whole file when length is accessed");this.el=u;this.dl=B;this.kk=!0};if("undefined"!=typeof XMLHttpRequest){if(!ab)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
var g=new f;Object.defineProperties(g,{length:{get:function(){this.kk||this.Hk();return this.el}},chunkSize:{get:function(){this.kk||this.Hk();return this.dl}}});var h=void 0}else h=c,g=void 0;var n=od(a,b,d,e);g?n.Mi=g:h&&(n.Mi=null,n.url=h);Object.defineProperties(n,{Oi:{get:function(){return this.Mi.length}}});var p={};Object.keys(n.Ni).forEach(q=>{var u=n.Ni[q];p[q]=function(){qd(n);return u.apply(null,arguments)}});p.read=(q,u,w,r,B)=>{qd(n);q=q.node.Mi;if(B>=q.length)u=0;else{r=Math.min(q.length-
B,r);if(q.slice)for(var y=0;y<r;y++)u[w+y]=q[B+y];else for(y=0;y<r;y++)u[w+y]=q.get(B+y);u=r}return u};p.nk=()=>{qd(n);lb();throw new R(48);};n.Ni=p;return n}var sd={},$c,gd,td=(a,b)=>a?x(v,a,b):"";function ud(a,b,c){if("/"===b.charAt(0))return b;a=-100===a?hc:Yc(a).path;if(0==b.length){if(!c)throw new R(44);return a}return La(a+"/"+b)}
function vd(a,b,c){try{var d=a(b)}catch(f){if(f&&f.node&&La(b)!==La(Nc(f.node)))return-54;throw f;}F[c>>2]=d.dev;F[c+4>>2]=d.mode;H[c+8>>2]=d.nlink;F[c+12>>2]=d.uid;F[c+16>>2]=d.gid;F[c+20>>2]=d.rdev;K=[d.size>>>0,(J=d.size,1<=+Math.abs(J)?0<J?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];F[c+24>>2]=K[0];F[c+28>>2]=K[1];F[c+32>>2]=4096;F[c+36>>2]=d.blocks;a=d.atime.getTime();b=d.mtime.getTime();var e=d.ctime.getTime();K=[Math.floor(a/1E3)>>>0,(J=Math.floor(a/1E3),1<=
+Math.abs(J)?0<J?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];F[c+40>>2]=K[0];F[c+44>>2]=K[1];H[c+48>>2]=a%1E3*1E3;K=[Math.floor(b/1E3)>>>0,(J=Math.floor(b/1E3),1<=+Math.abs(J)?0<J?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];F[c+56>>2]=K[0];F[c+60>>2]=K[1];H[c+64>>2]=b%1E3*1E3;K=[Math.floor(e/1E3)>>>0,(J=Math.floor(e/1E3),1<=+Math.abs(J)?0<J?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];F[c+72>>2]=K[0];
F[c+76>>2]=K[1];H[c+80>>2]=e%1E3*1E3;K=[d.ino>>>0,(J=d.ino,1<=+Math.abs(J)?0<J?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];F[c+88>>2]=K[0];F[c+92>>2]=K[1];return 0}var wd=void 0;function xd(){var a=F[+wd>>2];wd+=4;return a}
var yd=a=>0===a%4&&(0!==a%100||0===a%400),zd=[0,31,60,91,121,152,182,213,244,274,305,335],Ad=[0,31,59,90,120,151,181,212,243,273,304,334],z=a=>{var b=aa(a)+1,c=m(b);c&&t(a,v,c,b);return c},Kd=(a,b)=>{Bd=a;Cd=b;if(Dd)if(Ed||(Ed=!0),0==a)Fd=function(){var d=Math.max(0,Gd+b-Hd())|0;setTimeout(Id,d)};else if(1==a)Fd=function(){Jd(Id)};else if(2==a){if("undefined"==typeof setImmediate){var c=[];addEventListener("message",d=>{if("setimmediate"===d.data||"setimmediate"===d.data.target)d.stopPropagation(),
c.shift()()},!0);setImmediate=function(d){c.push(d);ab?(void 0===k.setImmediates&&(k.setImmediates=[]),k.setImmediates.push(d),postMessage({target:"setimmediate"})):postMessage("setimmediate","*")}}Fd=function(){setImmediate(Id)}}},Hd;Hd=()=>performance.now();
var Rd=a=>{!Dd||lb("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.");Dd=a;var b=Ld;Ed=!1;Id=function(){if(!nb)if(0<Md.length){var c=Md.shift();c.jm(c.Zl);if(Nd){var d=Nd,e=0==d%1?d-1:Math.floor(d);Nd=c.fm?e:(8*d+(e+.5))/9}k.setStatus&&(c=k.statusMessage||"Please wait...",d=Nd,e=Od.hm,d?d<e?k.setStatus(c+" ("+(e-d)+"/"+e+")"):k.setStatus(c):k.setStatus(""));b<
Ld||setTimeout(Id,0)}else if(!(b<Ld))if(Pd=Pd+1|0,1==Bd&&1<Cd&&0!=Pd%Cd)Fd();else{0==Bd&&(Gd=Hd());if(S)for(c=S.Dj,S.Dj=S.Kj,S.Kj=c,c=S.pj,S.pj=S.Zj,S.Zj=c,c=0;21>=c;++c)S.pj[c]=0;nb||k.preMainLoop&&!1===k.preMainLoop()||(Qd(a),k.postMainLoop&&k.postMainLoop());b<Ld||("object"==typeof SDL&&SDL.audio&&SDL.audio.Gl&&SDL.audio.Gl(),Fd())}}},Sd=a=>{a instanceof ib||"unwind"==a||Za(1,a)},Td=a=>{ob=a;if(!$b){if(k.onExit)k.onExit(a);nb=!0}Za(a,new ib(a))},Ud=a=>{ob=a;Td(a)},Qd=a=>{if(!nb)try{if(a(),!$b)try{ob=
a=ob,Td(a)}catch(b){Sd(b)}}catch(b){Sd(b)}},Vd=a=>{setTimeout(()=>{Qd(a)},1E4)},Ed=!1,Fd=null,Ld=0,Dd=null,Bd=0,Cd=0,Pd=0,Md=[],Od={},Gd,Id,Nd,Wd=!1,Xd=!1,Yd=[];
function Ac(){function a(){Xd=document.pointerLockElement===k.canvas||document.mozPointerLockElement===k.canvas||document.webkitPointerLockElement===k.canvas||document.msPointerLockElement===k.canvas}if(!Zd){Zd=!0;yc.push({canHandle:function(c){return!k.nm&&/\.(jpg|jpeg|png|bmp)$/i.test(c)},handle:function(c,d,e,f){var g=new Blob([c],{type:$d(d)});g.size!==c.length&&(g=new Blob([(new Uint8Array(c)).buffer],{type:$d(d)}));var h=URL.createObjectURL(g),n=new Image;n.onload=()=>{n.complete||lb(`Image ${d} could not be decoded`);
var p=document.createElement("canvas");p.width=n.width;p.height=n.height;p.getContext("2d").drawImage(n,0,0);URL.revokeObjectURL(h);e&&e(c)};n.onerror=()=>{l(`Image ${h} could not be decoded`);f&&f()};n.src=h}});yc.push({canHandle:function(c){return!k.mm&&c.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(c,d,e){function f(){g||(g=!0,e&&e(c))}var g=!1,h=URL.createObjectURL(new Blob([c],{type:$d(d)})),n=new Audio;n.addEventListener("canplaythrough",()=>f(n),!1);n.onerror=function(){if(!g){l(`warning: browser could not fully decode audio ${d}, trying slower base64 approach`);
for(var p="",q=0,u=0,w=0;w<c.length;w++)for(q=q<<8|c[w],u+=8;6<=u;){var r=q>>u-6&63;u-=6;p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[r]}2==u?(p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(q&3)<<4],p+="=="):4==u&&(p+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(q&15)<<2],p+="=");n.src="data:audio/x-"+d.substr(-3)+";base64,"+p;f(n)}};n.src=h;Vd(()=>{f(n)})}});var b=k.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),k.elementPointerLock&&b.addEventListener("click",
c=>{!Xd&&k.canvas.requestPointerLock&&(k.canvas.requestPointerLock(),c.preventDefault())},!1))}}
function ae(a,b,c,d){if(b&&k.bj&&a==k.canvas)return k.bj;var e;if(b){var f={antialias:!1,alpha:!1,Pj:"undefined"!=typeof WebGL2RenderingContext?2:1};if(d)for(var g in d)f[g]=d[g];if("undefined"!=typeof be&&(e=ce(a,f)))var h=de[e].Zi}else h=a.getContext("2d");if(!h)return null;c&&(b||"undefined"==typeof T||lb("cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),k.bj=h,b&&ee(e),k.Ql=b,Yd.forEach(n=>n()),Ac());return h}var fe=!1,ge=void 0,he=void 0;
function ie(a,b){function c(){Wd=!1;var f=d.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===f?(d.exitFullscreen=je,ge&&d.requestPointerLock(),Wd=!0,he?("undefined"!=typeof SDL&&(F[SDL.screen>>2]=H[SDL.screen>>2]|8388608),ke(k.canvas),le()):ke(d)):(f.parentNode.insertBefore(d,f),f.parentNode.removeChild(f),he?("undefined"!=typeof SDL&&(F[SDL.screen>>2]=H[SDL.screen>>2]&
-8388609),ke(k.canvas),le()):ke(d));if(k.onFullScreen)k.onFullScreen(Wd);if(k.onFullscreen)k.onFullscreen(Wd)}ge=a;he=b;"undefined"==typeof ge&&(ge=!0);"undefined"==typeof he&&(he=!1);var d=k.canvas;fe||(fe=!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()}
function je(){if(!Wd)return!1;(document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]);return!0}var me=0;function Jd(a){if("function"==typeof requestAnimationFrame)requestAnimationFrame(a);else{var b=Date.now();if(0===me)me=b+1E3/60;else for(;b+2>=me;)me+=1E3/60;setTimeout(a,Math.max(me-b,0))}}
function $d(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 ne=[];function le(){var a=k.canvas;ne.forEach(b=>b(a.width,a.height))}
function ke(a,b,c){b&&c?(a.Tl=b,a.ul=c):(b=a.Tl,c=a.ul);var d=b,e=c;k.forcedAspectRatio&&0<k.forcedAspectRatio&&(d/e<k.forcedAspectRatio?d=Math.round(e*k.forcedAspectRatio):e=Math.round(d/k.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)}he?(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 zc={},Zd,V=12288,oe=!1,pe=0,qe=0,re=0,se={alpha:!1,depth:!1,stencil:!1,antialias:!1},te={},ue,ve=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))},we=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))},xe=a=>{var b=a.getExtension("WEBGL_draw_buffers");b&&(a.drawBuffers=(c,d)=>b.drawBuffersWEBGL(c,d))},ye=a=>{a.gm=a.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")},ze=a=>{a.lm=a.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")},Ae=1,Be=[],Ce={},W=[],De=[],Ee=[],Fe=[],Ge=[],He=[],de=[],Ie=[],Je=[],Ke=[],Le=[],Me=[1,1,2,2,4,4,4,2,3,4,8],Ne={},Oe={},Pe=4;
function X(a){Qe||(Qe=a)}var Re=a=>{for(var b=Ae++,c=a.length;c<b;c++)a[c]=null;return b};
function Se(a){Te=!1;for(var b=0;b<S.Sk;++b){var c=S.kj[b];if(c.Gj&&c.enabled){Te=!0;var d=c.Yj;d=0<d?a*d:c.size*Me[c.type-5120]*a;var e=32-Math.clz32(0===d?0:d-1);var f=S.Dj[e],g=S.pj[e];S.pj[e]=S.pj[e]+1&63;var h=f[g];h?e=h:(h=T.getParameter(34964),f[g]=T.createBuffer(),T.bindBuffer(34962,f[g]),T.bufferData(34962,1<<e,35048),T.bindBuffer(34962,h),e=f[g]);T.bindBuffer(34962,e);T.bufferSubData(34962,0,v.subarray(c.Ij,c.Ij+d));c.Dk.call(T,b,c.size,c.type,c.pk,c.Yj,0)}}}
var ce=(a,b)=>{a.ck||(a.ck=a.getContext,a.getContext=function(d,e){e=a.ck(d,e);return"webgl"==d==e instanceof WebGLRenderingContext?e:null});var c=1<b.Pj?a.getContext("webgl2",b):a.getContext("webgl",b);return c?Ue(c,b):0},Ue=(a,b)=>{var c=Re(de),d={handle:c,attributes:b,version:b.Pj,Zi:a};a.canvas&&(a.canvas.Ej=d);de[c]=d;("undefined"==typeof b.gk||b.gk)&&Ve(d);d.Sk=d.Zi.getParameter(34921);d.kj=[];for(a=0;a<d.Sk;a++)d.kj[a]={enabled:!1,Gj:!1,size:0,type:0,pk:0,Yj:0,Ij:0,Dk:null};d.pj=[];d.Zj=[];
d.pj.length=d.Zj.length=22;d.Dj=[];d.Kj=[];d.Dj.length=d.Kj.length=22;d.Cj=[];d.Cj.length=22;for(a=0;21>=a;++a){d.Cj[a]=null;d.pj[a]=d.Zj[a]=0;d.Dj[a]=[];d.Kj[a]=[];b=d.Dj[a];var e=d.Kj[a];b.length=e.length=64;for(var f=0;64>f;++f)b[f]=e[f]=null}return c},ee=a=>{S=de[a];k.bj=T=S&&S.Zi;return!(a&&!T)},Ve=a=>{a||(a=S);if(!a.wl){a.wl=!0;var b=a.Zi;ve(b);we(b);xe(b);ye(b);ze(b);2<=a.version&&(b.aj=b.getExtension("EXT_disjoint_timer_query_webgl2"));if(2>a.version||!b.aj)b.aj=b.getExtension("EXT_disjoint_timer_query");
b.El=b.getExtension("WEBGL_multi_draw");(b.getSupportedExtensions()||[]).forEach(c=>{c.includes("lose_context")||c.includes("debug")||b.getExtension(c)})}},be={},Qe,S,Te,We=[],Xe=(a,b)=>{We.length=0;for(var c;c=v[a++];){var d=105!=c;d&=112!=c;b+=d&&b%8?4:0;We.push(112==c?H[b>>2]:105==c?F[b>>2]:rb[b>>3]);b+=d?8:4}return We},Ye=(a,b,c)=>{b=Xe(b,c);return Vb[a].apply(null,b)},Ze={},$e=0;function af(){var a=$e;$e++;return a}var df=a=>{var b=bf();a=a();cf(b);return a},ef=0;
function ff(){for(var a=gf.length-1;0<=a;--a)hf(a);gf=[];jf=[]}var jf=[];function kf(a,b,c){function d(g,h){if(g.length!=h.length)return!1;for(var n in g)if(g[n]!=h[n])return!1;return!0}for(var e in jf){var f=jf[e];if(f.Ak==a&&d(f.Gk,c))return}jf.push({Ak:a,Xk:b,Gk:c});jf.sort((g,h)=>g.Xk<h.Xk)}function lf(a){for(var b=0;b<jf.length;++b)jf[b].Ak==a&&(jf.splice(b,1),--b)}function mf(){return navigator.userActivation?navigator.userActivation.isActive:ef&&nf.Fj}
function of(){if(mf())for(var a=0;a<jf.length;++a){var b=jf[a];jf.splice(a,1);--a;b.Ak.apply(null,b.Gk)}}var gf=[];function hf(a){var b=gf[a];b.target.removeEventListener(b.Ti,b.ol,b.Wi);gf.splice(a,1)}function pf(a){function b(d){++ef;nf=a;of();a.Yi(d);of();--ef}if(!a.target)return-4;if(a.Xi)a.ol=b,a.target.addEventListener(a.Ti,b,a.Wi),gf.push(a),qf||(wb.push(ff),qf=!0);else for(var c=0;c<gf.length;++c)gf[c].target==a.target&&gf[c].Ti==a.Ti&&hf(c--);return 0}
function rf(a){return a?a==window?"#window":a==screen?"#screen":a&&a.nodeName?a.nodeName:"":""}function sf(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}
var tf={},qf,nf,uf,vf,wf,xf,yf,zf,Af,Bf,Cf,Df,Ef,Ff,Gf={},Hf=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],If=a=>{a=2<a?a?x(v,a):"":a;return Hf[a]||("undefined"!=typeof document?document.querySelector(a):void 0)},Jf=(a,b,c)=>{a=If(a);if(!a)return-4;F[b>>2]=a.width;F[c>>2]=a.height},Lf=a=>{var b=aa(a)+1,c=Kf(b);t(a,v,c,b);return c},Mf=a=>df(()=>{var b=Kf(8),c=b+4,d=Lf(a.id);Jf(d,b,c);return[F[b>>2],F[c>>2]]}),Nf=(a,b,c)=>{a=If(a);if(!a)return-4;a.width=b;a.height=
c;return 0},Of=(a,b,c)=>{a.em?df(()=>{var d=Lf(a.id);Nf(d,b,c)}):(a.width=b,a.height=c)},Pf=a=>{function b(){document.fullscreenElement||document.webkitFullscreenElement||(document.removeEventListener("fullscreenchange",b),document.removeEventListener("webkitfullscreenchange",b),Of(a,d,e),a.style.width=f,a.style.height=g,a.style.backgroundColor=h,n||(document.body.style.backgroundColor="white"),document.body.style.backgroundColor=n,a.style.paddingLeft=p,a.style.paddingRight=q,a.style.paddingTop=u,
a.style.paddingBottom=w,a.style.marginLeft=r,a.style.marginRight=B,a.style.marginTop=y,a.style.marginBottom=G,document.body.style.margin=L,document.documentElement.style.overflow=O,document.body.scroll=A,a.style.mj=P,a.Ej&&a.Ej.Zi.viewport(0,0,d,e),Gf.Oj&&N(Gf.Oj)(37,0,Gf.Jk))}var c=Mf(a),d=c[0],e=c[1],f=a.style.width,g=a.style.height,h=a.style.backgroundColor,n=document.body.style.backgroundColor,p=a.style.paddingLeft,q=a.style.paddingRight,u=a.style.paddingTop,w=a.style.paddingBottom,r=a.style.marginLeft,
B=a.style.marginRight,y=a.style.marginTop,G=a.style.marginBottom,L=document.body.style.margin,O=document.documentElement.style.overflow,A=document.body.scroll,P=a.style.mj;document.addEventListener("fullscreenchange",b);document.addEventListener("webkitfullscreenchange",b)},Qf=(a,b,c)=>{a.style.paddingLeft=a.style.paddingRight=c+"px";a.style.paddingTop=a.style.paddingBottom=b+"px"},Rf=a=>0>Hf.indexOf(a)?a.getBoundingClientRect():{left:0,top:0},Sf=(a,b)=>{if(0!=b.wk||0!=b.dk){Pf(a);var c=b.Kl?innerWidth:
screen.width,d=b.Kl?innerHeight:screen.height,e=Rf(a),f=e.width;e=e.height;var g=Mf(a),h=g[0];g=g[1];3==b.wk?(Qf(a,(d-e)/2,(c-f)/2),c=f,d=e):2==b.wk&&(c*g<h*d?(f=g*c/h,Qf(a,(d-f)/2,0),d=f):(f=h*d/g,Qf(a,0,(c-f)/2),c=f));a.style.backgroundColor||(a.style.backgroundColor="black");document.body.style.backgroundColor||(document.body.style.backgroundColor="black");a.style.width=c+"px";a.style.height=d+"px";1==b.ql&&(a.style.mj="optimizeSpeed",a.style.mj="-moz-crisp-edges",a.style.mj="-o-crisp-edges",a.style.mj=
"-webkit-optimize-contrast",a.style.mj="optimize-contrast",a.style.mj="crisp-edges",a.style.mj="pixelated");f=2==b.dk?devicePixelRatio:1;0!=b.dk&&(c=c*f|0,d=d*f|0,Of(a,c,d),a.Ej&&a.Ej.Zi.viewport(0,0,c,d))}if(a.requestFullscreen)a.requestFullscreen();else if(a.webkitRequestFullscreen)a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else return sf()?-3:-1;Gf=b;b.Oj&&N(b.Oj)(37,0,b.Jk);return 0},Tf=a=>{if(a.requestPointerLock)a.requestPointerLock();else return document.body.requestPointerLock?
-3:-1;return 0},Uf=(a,b)=>{rb[a>>3]=b.timestamp;for(var c=0;c<b.axes.length;++c)rb[a+8*c+16>>3]=b.axes[c];for(c=0;c<b.buttons.length;++c)rb[a+8*c+528>>3]="object"==typeof b.buttons[c]?b.buttons[c].value:b.buttons[c];for(c=0;c<b.buttons.length;++c)F[a+4*c+1040>>2]="object"==typeof b.buttons[c]?b.buttons[c].pressed:1==b.buttons[c];F[a+1296>>2]=b.connected;F[a+1300>>2]=b.index;F[a+8>>2]=b.axes.length;F[a+12>>2]=b.buttons.length;t(b.id,v,a+1304,64);t(b.mapping,v,a+1368,64)};
function Vf(a){T.activeTexture(a)}var Wf=(a,b)=>{T.attachShader(W[a],Ge[b])},Xf=(a,b)=>{34962==a?T.zj=b:34963==a&&(T.Hj=b);35051==a?T.fk=b:35052==a&&(T.cj=b);T.bindBuffer(a,Be[b])},Yf=(a,b)=>{T.bindFramebuffer(a,De[b])},Zf=(a,b)=>{T.bindRenderbuffer(a,Ee[b])},$f=(a,b)=>{T.bindTexture(a,Fe[b])},ag=a=>{T.bindVertexArray(He[a]);a=T.getParameter(34965);T.Hj=a?a.name|0:0};function bg(a,b){T.blendEquationSeparate(a,b)}function cg(a,b){T.blendFunc(a,b)}function dg(a,b,c,d){T.blendFuncSeparate(a,b,c,d)}
var eg=(a,b,c,d)=>{2<=S.version?c&&b?T.bufferData(a,v,d,c,b):T.bufferData(a,b,d):T.bufferData(a,c?v.subarray(c,c+b):b,d)};function fg(a){return T.checkFramebufferStatus(a)}function gg(a){T.clear(a)}function hg(a,b,c,d){T.clearColor(a,b,c,d)}function ig(a){T.clearDepth(a)}function jg(a){T.clearStencil(a)}
var kg=(a,b,c,d)=>{T.colorMask(!!a,!!b,!!c,!!d)},lg=a=>{T.compileShader(Ge[a])},mg=(a,b,c,d,e,f,g,h)=>{2<=S.version?T.cj||!g?T.compressedTexImage2D(a,b,c,d,e,f,g,h):T.compressedTexImage2D(a,b,c,d,e,f,v,h,g):T.compressedTexImage2D(a,b,c,d,e,f,h?v.subarray(h,h+g):null)},ng=()=>{var a=Re(W),b=T.createProgram();b.name=a;b.Sj=b.Qj=b.Rj=0;b.Ck=1;W[a]=b;return a},og=a=>{var b=Re(Ge);Ge[b]=T.createShader(a);return b},pg=(a,b)=>{for(var c=0;c<a;c++){var d=F[b+4*c>>2],e=Be[d];e&&(T.deleteBuffer(e),e.name=0,
Be[d]=null,d==T.zj&&(T.zj=0),d==T.Hj&&(T.Hj=0),d==T.fk&&(T.fk=0),d==T.cj&&(T.cj=0))}},qg=(a,b)=>{for(var c=0;c<a;++c){var d=F[b+4*c>>2],e=De[d];e&&(T.deleteFramebuffer(e),e.name=0,De[d]=null)}},rg=a=>{if(a){var b=W[a];b?(T.deleteProgram(b),b.name=0,W[a]=null):X(1281)}},sg=(a,b)=>{for(var c=0;c<a;c++){var d=F[b+4*c>>2],e=Ee[d];e&&(T.deleteRenderbuffer(e),e.name=0,Ee[d]=null)}},tg=a=>{if(a){var b=Ge[a];b?(T.deleteShader(b),Ge[a]=null):X(1281)}},ug=(a,b)=>{for(var c=0;c<a;c++){var d=F[b+4*c>>2],e=Fe[d];
e&&(T.deleteTexture(e),e.name=0,Fe[d]=null)}},vg=(a,b)=>{for(var c=0;c<a;c++){var d=F[b+4*c>>2];T.deleteVertexArray(He[d]);He[d]=null}};function wg(a){T.depthFunc(a)}var xg=a=>{T.depthMask(!!a)};function yg(a,b){T.depthRange(a,b)}function zg(a){T.disable(a)}
var Ag=a=>{S.kj[a].enabled=!1;T.disableVertexAttribArray(a)},Bg=(a,b,c)=>{Se(b+c);T.drawArrays(a,b,c);Te&&T.bindBuffer(34962,Be[T.zj])},Cg=(a,b,c,d)=>{T.drawArraysInstanced(a,b,c,d)},Dg=[],Eg=(a,b)=>{for(var c=Dg[a],d=0;d<a;d++)c[d]=F[b+4*d>>2];T.drawBuffers(c)},Fg=(a,b,c,d)=>{if(!T.Hj){var e=1*Me[c-5120]*b;var f=32-Math.clz32(0===e?0:e-1);var g=S.Cj[f];g?f=g:(g=T.getParameter(34965),S.Cj[f]=T.createBuffer(),T.bindBuffer(34963,S.Cj[f]),T.bufferData(34963,1<<f,35048),T.bindBuffer(34963,g),f=S.Cj[f]);
T.bindBuffer(34963,f);T.bufferSubData(34963,0,v.subarray(d,d+e));d=0}Se(b);T.drawElements(a,b,c,d);Te&&T.bindBuffer(34962,Be[T.zj]);T.Hj||T.bindBuffer(34963,null)},Gg=(a,b,c,d,e)=>{T.drawElementsInstanced(a,b,c,d,e)};function Hg(a){T.enable(a)}var Ig=a=>{S.kj[a].enabled=!0;T.enableVertexAttribArray(a)};function Jg(){T.flush()}
var Kg=a=>{switch(a){case 34962:a=34964;break;case 34963:a=34965;break;case 35051:a=35053;break;case 35052:a=35055;break;case 35982:a=35983;break;case 36662:a=36662;break;case 36663:a=36663;break;case 35345:a=35368}return(a=T.getParameter(a))?a.name|0:0},Lg=a=>{switch(a){case 34962:case 34963:case 36662:case 36663:case 35051:case 35052:case 35882:case 35982:case 35345:return!0;default:return!1}},Mg=(a,b,c,d)=>{T.framebufferRenderbuffer(a,b,c,Ee[d])},Ng=(a,b,c,d,e)=>{T.framebufferTexture2D(a,b,c,Fe[d],
e)};function Og(a){T.frontFace(a)}var Pg=(a,b,c,d)=>{for(var e=0;e<a;e++){var f=T[c](),g=f&&Re(d);f?(f.name=g,d[g]=f):X(1282);F[b+4*e>>2]=g}},Qg=(a,b)=>{Pg(a,b,"createBuffer",Be)},Rg=(a,b)=>{Pg(a,b,"createFramebuffer",De)},Sg=(a,b)=>{Pg(a,b,"createRenderbuffer",Ee)},Tg=(a,b)=>{Pg(a,b,"createTexture",Fe)};function Ug(a,b){Pg(a,b,"createVertexArray",He)}
var Vg=(a,b,c,d,e,f,g,h)=>{b=W[b];if(a=T[a](b,c))d=h&&t(a.name,v,h,d),e&&(F[e>>2]=d),f&&(F[f>>2]=a.size),g&&(F[g>>2]=a.type)},Wg=(a,b,c,d,e,f,g)=>{Vg("getActiveUniform",a,b,c,d,e,f,g)},Xg=(a,b)=>T.getAttribLocation(W[a],b?x(v,b):""),Yg=(a,b)=>{H[a>>2]=b;H[a+4>>2]=(b-H[a>>2])/4294967296},Zg=(a,b,c)=>{if(b){var d=void 0;switch(a){case 36346:d=1;break;case 36344:0!=c&&1!=c&&X(1280);return;case 34814:case 36345:d=0;break;case 34466:var e=T.getParameter(34467);d=e?e.length:0;break;case 33309:if(2>S.version){X(1282);
return}d=2*(T.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(2>S.version){X(1280);return}d=33307==a?3:0}if(void 0===d)switch(e=T.getParameter(a),typeof e){case "number":d=e;break;case "boolean":d=e?1:0;break;case "string":X(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:X(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:F[b+4*a>>2]=e[a];break;case 2:I[b+4*a>>2]=e[a];break;case 4:E[b+a>>0]=e[a]?1:0}return}try{d=e.name|0}catch(f){X(1280);l("GL_INVALID_ENUM in glGet"+c+"v: Unknown object returned from WebGL getParameter("+a+")! (error: "+f+")");return}}break;default:X(1280);l("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:Yg(b,d);break;case 0:F[b>>2]=d;break;case 2:I[b>>2]=d;break;case 4:E[b>>0]=d?1:0}}else X(1281)},$g=()=>{var a=T.getError()||Qe;Qe=0;return a},ah=(a,b)=>{Zg(a,b,2)},bh=(a,b,c,d)=>{if(c){b=T.getIndexedParameter(a,b);switch(typeof b){case "boolean":a=b?1:0;break;case "number":a=b;break;case "object":if(null===b)switch(a){case 35983:case 35368:a=0;break;default:X(1280);return}else if(b instanceof WebGLBuffer)a=b.name|0;else{X(1280);
return}break;default:X(1280);return}switch(d){case 1:Yg(c,a);break;case 0:F[c>>2]=a;break;case 2:I[c>>2]=a;break;case 4:E[c>>0]=a?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+d;}}else X(1281)},ch=(a,b)=>{Zg(a,b,0)},dh=(a,b,c,d)=>{a=T.getProgramInfoLog(W[a]);null===a&&(a="(unknown error)");b=0<b&&d?t(a,v,d,b):0;c&&(F[c>>2]=b)},eh=(a,b,c)=>{if(c)if(a>=Ae)X(1281);else if(a=W[a],35716==b)a=T.getProgramInfoLog(a),null===a&&(a="(unknown error)"),F[c>>2]=a.length+1;else if(35719==
b){if(!a.Sj)for(b=0;b<T.getProgramParameter(a,35718);++b)a.Sj=Math.max(a.Sj,T.getActiveUniform(a,b).name.length+1);F[c>>2]=a.Sj}else if(35722==b){if(!a.Qj)for(b=0;b<T.getProgramParameter(a,35721);++b)a.Qj=Math.max(a.Qj,T.getActiveAttrib(a,b).name.length+1);F[c>>2]=a.Qj}else if(35381==b){if(!a.Rj)for(b=0;b<T.getProgramParameter(a,35382);++b)a.Rj=Math.max(a.Rj,T.getActiveUniformBlockName(a,b).length+1);F[c>>2]=a.Rj}else F[c>>2]=T.getProgramParameter(a,b);else X(1281)},fh=(a,b,c)=>{if(c){a=Ie[a];b=2>
S.version?T.aj.getQueryObjectEXT(a,b):T.getQueryParameter(a,b);var d;"boolean"==typeof b?d=b?1:0:d=b;Yg(c,d)}else X(1281)},gh=(a,b,c)=>{if(c){a=T.aj.getQueryObjectEXT(Ie[a],b);var d;"boolean"==typeof a?d=a?1:0:d=a;F[c>>2]=d}else X(1281)},hh=(a,b,c,d)=>{a=T.getShaderInfoLog(Ge[a]);null===a&&(a="(unknown error)");b=0<b&&d?t(a,v,d,b):0;c&&(F[c>>2]=b)},ih=(a,b,c)=>{c?35716==b?(a=T.getShaderInfoLog(Ge[a]),null===a&&(a="(unknown error)"),F[c>>2]=a?a.length+1:0):35720==b?(a=T.getShaderSource(Ge[a]),F[c>>
2]=a?a.length+1:0):F[c>>2]=T.getShaderParameter(Ge[a],b):X(1281)},jh=a=>{var b=Ne[a];if(!b){switch(a){case 7939:b=T.getSupportedExtensions()||[];b=b.concat(b.map(d=>"GL_"+d));b=z(b.join(" "));break;case 7936:case 7937:case 37445:case 37446:(b=T.getParameter(a))||X(1280);b=b&&z(b);break;case 7938:b=T.getParameter(7938);b=2<=S.version?"OpenGL ES 3.0 ("+b+")":"OpenGL ES 2.0 ("+b+")";b=z(b);break;case 35724:b=T.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=z(b);break;default:X(1280)}Ne[a]=b}return b},kh=a=>"]"==a.slice(-1)&&a.lastIndexOf("["),lh=a=>{var b=a.Lj,c=a.$k,d;if(!b)for(a.Lj=b={},a.Zk={},d=0;d<T.getProgramParameter(a,35718);++d){var e=T.getActiveUniform(a,d);var f=e.name;e=e.size;var g=kh(f);g=0<g?f.slice(0,g):f;var h=a.Ck;a.Ck+=e;c[g]=[e,h];for(f=0;f<e;++f)b[h]=f,a.Zk[h++]=g}},mh=(a,b)=>{b=b?x(v,b):"";if(a=W[a]){lh(a);var c=a.Lj,d=0,e=b,f=kh(b);0<f&&(d=parseInt(b.slice(f+
1))>>>0,e=b.slice(0,f));if((e=a.$k[e])&&d<e[0]&&(d+=e[1],c[d]=c[d]||T.getUniformLocation(a,b)))return d}else X(1281);return-1},Y=a=>{var b=T.hl;if(b){var c=b.Lj[a];"number"==typeof c&&(b.Lj[a]=c=T.getUniformLocation(b,b.Zk[a]+(0<c?"["+c+"]":"")));return c}X(1282)},nh=(a,b,c,d)=>{if(c)if(a=W[a],lh(a),a=T.getUniform(a,Y(b)),"number"==typeof a||"boolean"==typeof a)switch(d){case 0:F[c>>2]=a;break;case 2:I[c>>2]=a}else for(b=0;b<a.length;b++)switch(d){case 0:F[c+4*b>>2]=a[b];break;case 2:I[c+4*b>>2]=
a[b]}else X(1281)},oh=(a,b,c,d)=>{if(c)if(S.kj[a].enabled&&l("glGetVertexAttrib*v on client-side array: not supported, bad data returned"),a=T.getVertexAttrib(a,b),34975==b)F[c>>2]=a&&a.name;else if("number"==typeof a||"boolean"==typeof a)switch(d){case 0:F[c>>2]=a;break;case 2:I[c>>2]=a;break;case 5:F[c>>2]=Math.fround(a)}else for(b=0;b<a.length;b++)switch(d){case 0:F[c+4*b>>2]=a[b];break;case 2:I[c+4*b>>2]=a[b];break;case 5:F[c+4*b>>2]=Math.fround(a[b])}else X(1281)},ph=(a,b,c)=>{oh(a,b,c,0)},qh=
a=>(a=He[a])?T.isVertexArray(a):0,rh=a=>{a=W[a];T.linkProgram(a);a.Lj=0;a.$k={}},sh=(a,b)=>{3317==a&&(Pe=b);T.pixelStorei(a,b)},th=a=>{a-=5120;return 0==a?E:1==a?v:2==a?pb:4==a?F:6==a?I:5==a||28922==a||28520==a||30779==a||30782==a?H:qb},uh=(a,b,c,d,e)=>{a=th(a);var f=31-Math.clz32(a.BYTES_PER_ELEMENT),g=Pe;return a.subarray(e>>f,e+d*(c*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[b-6402]||1)*(1<<f)+g-1&-g)>>f)},vh=(a,b,c,d,e,f,g)=>{if(2<=S.version)if(T.fk)T.readPixels(a,b,c,d,e,
f,g);else{var h=th(f);T.readPixels(a,b,c,d,e,f,h,g>>31-Math.clz32(h.BYTES_PER_ELEMENT))}else(g=uh(f,e,c,d,g))?T.readPixels(a,b,c,d,e,f,g):X(1280)};function wh(a,b,c,d){T.renderbufferStorage(a,b,c,d)}function xh(a,b,c,d){T.scissor(a,b,c,d)}var yh=(a,b,c,d)=>{for(var e="",f=0;f<b;++f){var g=d?F[d+4*f>>2]:-1;e+=td(F[c+4*f>>2],0>g?void 0:g)}T.shaderSource(Ge[a],e)};function zh(a,b,c){T.stencilFunc(a,b,c)}function Ah(a){T.stencilMask(a)}function Bh(a,b,c){T.stencilOp(a,b,c)}
var Ch=(a,b,c,d,e,f,g,h,n)=>{if(2<=S.version)if(T.cj)T.texImage2D(a,b,c,d,e,f,g,h,n);else if(n){var p=th(h);T.texImage2D(a,b,c,d,e,f,g,h,p,n>>31-Math.clz32(p.BYTES_PER_ELEMENT))}else T.texImage2D(a,b,c,d,e,f,g,h,null);else T.texImage2D(a,b,c,d,e,f,g,h,n?uh(h,g,d,e,n):null)};function Dh(a,b,c){T.texParameterf(a,b,c)}
var Eh=(a,b,c,d,e,f,g,h,n)=>{if(2<=S.version)if(T.cj)T.texSubImage2D(a,b,c,d,e,f,g,h,n);else if(n){var p=th(h);T.texSubImage2D(a,b,c,d,e,f,g,h,p,n>>31-Math.clz32(p.BYTES_PER_ELEMENT))}else T.texSubImage2D(a,b,c,d,e,f,g,h,null);else p=null,n&&(p=uh(h,g,e,f,n)),T.texSubImage2D(a,b,c,d,e,f,g,h,p)},Fh=(a,b)=>{T.uniform1f(Y(a),b)},Gh=[],Hh=(a,b,c)=>{if(2<=S.version)b&&T.uniform1fv(Y(a),I,c>>2,b);else{if(288>=b)for(var d=Gh[b-1],e=0;e<b;++e)d[e]=I[c+4*e>>2];else d=I.subarray(c>>2,c+4*b>>2);T.uniform1fv(Y(a),
d)}},Ih=(a,b)=>{T.uniform1i(Y(a),b)},Jh=[],Kh=(a,b,c)=>{if(2<=S.version)b&&T.uniform1iv(Y(a),F,c>>2,b);else{if(288>=b)for(var d=Jh[b-1],e=0;e<b;++e)d[e]=F[c+4*e>>2];else d=F.subarray(c>>2,c+4*b>>2);T.uniform1iv(Y(a),d)}},Lh=(a,b,c)=>{if(2<=S.version)b&&T.uniform2fv(Y(a),I,c>>2,2*b);else{if(144>=b)for(var d=Gh[2*b-1],e=0;e<2*b;e+=2)d[e]=I[c+4*e>>2],d[e+1]=I[c+(4*e+4)>>2];else d=I.subarray(c>>2,c+8*b>>2);T.uniform2fv(Y(a),d)}},Mh=(a,b,c)=>{if(2<=S.version)b&&T.uniform2iv(Y(a),F,c>>2,2*b);else{if(144>=
b)for(var d=Jh[2*b-1],e=0;e<2*b;e+=2)d[e]=F[c+4*e>>2],d[e+1]=F[c+(4*e+4)>>2];else d=F.subarray(c>>2,c+8*b>>2);T.uniform2iv(Y(a),d)}},Nh=(a,b,c)=>{if(2<=S.version)b&&T.uniform3fv(Y(a),I,c>>2,3*b);else{if(96>=b)for(var d=Gh[3*b-1],e=0;e<3*b;e+=3)d[e]=I[c+4*e>>2],d[e+1]=I[c+(4*e+4)>>2],d[e+2]=I[c+(4*e+8)>>2];else d=I.subarray(c>>2,c+12*b>>2);T.uniform3fv(Y(a),d)}},Oh=(a,b,c)=>{if(2<=S.version)b&&T.uniform3iv(Y(a),F,c>>2,3*b);else{if(96>=b)for(var d=Jh[3*b-1],e=0;e<3*b;e+=3)d[e]=F[c+4*e>>2],d[e+1]=F[c+
(4*e+4)>>2],d[e+2]=F[c+(4*e+8)>>2];else d=F.subarray(c>>2,c+12*b>>2);T.uniform3iv(Y(a),d)}},Ph=(a,b,c)=>{if(2<=S.version)b&&T.uniform4fv(Y(a),I,c>>2,4*b);else{if(72>=b){var d=Gh[4*b-1],e=I;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=I.subarray(c>>2,c+16*b>>2);T.uniform4fv(Y(a),d)}},Qh=(a,b,c)=>{if(2<=S.version)b&&T.uniform4iv(Y(a),F,c>>2,4*b);else{if(72>=b)for(var d=Jh[4*b-1],e=0;e<4*b;e+=4)d[e]=F[c+4*e>>2],d[e+1]=F[c+(4*e+4)>>2],d[e+2]=F[c+
(4*e+8)>>2],d[e+3]=F[c+(4*e+12)>>2];else d=F.subarray(c>>2,c+16*b>>2);T.uniform4iv(Y(a),d)}},Rh=(a,b,c,d)=>{if(2<=S.version)b&&T.uniformMatrix2fv(Y(a),!!c,I,d>>2,4*b);else{if(72>=b)for(var e=Gh[4*b-1],f=0;f<4*b;f+=4)e[f]=I[d+4*f>>2],e[f+1]=I[d+(4*f+4)>>2],e[f+2]=I[d+(4*f+8)>>2],e[f+3]=I[d+(4*f+12)>>2];else e=I.subarray(d>>2,d+16*b>>2);T.uniformMatrix2fv(Y(a),!!c,e)}},Sh=(a,b,c,d)=>{if(2<=S.version)b&&T.uniformMatrix3fv(Y(a),!!c,I,d>>2,9*b);else{if(32>=b)for(var e=Gh[9*b-1],f=0;f<9*b;f+=9)e[f]=I[d+
4*f>>2],e[f+1]=I[d+(4*f+4)>>2],e[f+2]=I[d+(4*f+8)>>2],e[f+3]=I[d+(4*f+12)>>2],e[f+4]=I[d+(4*f+16)>>2],e[f+5]=I[d+(4*f+20)>>2],e[f+6]=I[d+(4*f+24)>>2],e[f+7]=I[d+(4*f+28)>>2],e[f+8]=I[d+(4*f+32)>>2];else e=I.subarray(d>>2,d+36*b>>2);T.uniformMatrix3fv(Y(a),!!c,e)}},Th=(a,b,c,d)=>{if(2<=S.version)b&&T.uniformMatrix4fv(Y(a),!!c,I,d>>2,16*b);else{if(18>=b){var e=Gh[16*b-1],f=I;d>>=2;for(var g=0;g<16*b;g+=16){var h=d+g;e[g]=f[h];e[g+1]=f[h+1];e[g+2]=f[h+2];e[g+3]=f[h+3];e[g+4]=f[h+4];e[g+5]=f[h+5];e[g+
6]=f[h+6];e[g+7]=f[h+7];e[g+8]=f[h+8];e[g+9]=f[h+9];e[g+10]=f[h+10];e[g+11]=f[h+11];e[g+12]=f[h+12];e[g+13]=f[h+13];e[g+14]=f[h+14];e[g+15]=f[h+15]}}else e=I.subarray(d>>2,d+64*b>>2);T.uniformMatrix4fv(Y(a),!!c,e)}},Uh=a=>{a=W[a];T.useProgram(a);T.hl=a},Vh=(a,b)=>{T.vertexAttribDivisor(a,b)},Wh=(a,b,c,d,e,f)=>{var g=S.kj[a];T.zj?(g.Gj=!1,T.vertexAttribPointer(a,b,c,!!d,e,f)):(g.size=b,g.type=c,g.pk=d,g.Yj=e,g.Ij=f,g.Gj=!0,g.Dk=function(h,n,p,q,u,w){this.vertexAttribPointer(h,n,p,q,u,w)})};
function Xh(a,b,c,d){T.viewport(a,b,c,d)}
var Yh=(a,b)=>{if(!sf())return-1;a=If(a);return a?a.requestFullscreen||a.webkitRequestFullscreen?mf()?Sf(a,b):b.ll?(kf(Sf,1,[a,b]),1):-2:-3:-4},Zh=(a,b)=>{var c={target:If(2),Ti:"beforeunload",Xi:b,Yi:(d=event)=>{var e=N(b)(28,0,a);e&&(e=e?x(v,e):"");if(e)return d.preventDefault(),d.returnValue=e},Wi:!0};return pf(c)},$h=(a,b,c,d,e,f)=>{vf||(vf=m(256));a={target:If(a),Ti:f,Xi:d,Yi:(g=event)=>{var h=g.target.id?g.target.id:"",n=vf;t(rf(g.target),v,n+0,128);t(h,v,n+128,128);N(d)(e,n,b)&&g.preventDefault()},
Wi:c};return pf(a)},ai=(a,b,c,d,e)=>{xf||(xf=m(280));return pf({target:a,Ti:e,Xi:d,Yi:(f=event)=>{var g=xf,h=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement,n=!!h;F[g>>2]=n;F[g+4>>2]=sf();var p=n?h:wf,q=p&&p.id?p.id:"";t(rf(p),v,g+8,128);t(q,v,g+136,128);F[g+264>>2]=p?p.clientWidth:0;F[g+268>>2]=p?p.clientHeight:0;F[g+272>>2]=screen.width;F[g+276>>2]=screen.height;n&&(wf=h);N(d)(19,g,b)&&f.preventDefault()},Wi:c})},bi=(a,b,
c,d,e)=>{yf||(yf=m(1432));b={target:If(2),Fj:!0,Ti:e,Xi:c,Yi:(f=event)=>{var g=yf;Uf(g,f.gamepad);N(c)(d,g,a)&&f.preventDefault()},Wi:b};return pf(b)},ci=(a,b,c,d,e,f)=>{zf||(zf=m(176));a={target:If(a),Fj:!0,Ti:f,Xi:d,Yi:g=>{var h=zf;rb[h>>3]=g.timeStamp;var n=h>>2;F[n+2]=g.location;F[n+3]=g.ctrlKey;F[n+4]=g.shiftKey;F[n+5]=g.altKey;F[n+6]=g.metaKey;F[n+7]=g.repeat;F[n+8]=g.charCode;F[n+9]=g.keyCode;F[n+10]=g.which;t(g.key||"",v,h+44,32);t(g.code||"",v,h+76,32);t(g.char||"",v,h+108,32);t(g.locale||
"",v,h+140,32);N(d)(e,h,b)&&g.preventDefault()},Wi:c};return pf(a)},di=(a,b,c)=>{rb[a>>3]=b.timeStamp;a>>=2;F[a+2]=b.screenX;F[a+3]=b.screenY;F[a+4]=b.clientX;F[a+5]=b.clientY;F[a+6]=b.ctrlKey;F[a+7]=b.shiftKey;F[a+8]=b.altKey;F[a+9]=b.metaKey;pb[2*a+20]=b.button;pb[2*a+21]=b.buttons;F[a+11]=b.movementX;F[a+12]=b.movementY;c=Rf(c);F[a+13]=b.clientX-c.left;F[a+14]=b.clientY-c.top},ei=(a,b,c,d,e,f)=>{Af||(Af=m(72));a=If(a);return pf({target:a,Fj:"mousemove"!=f&&"mouseenter"!=f&&"mouseleave"!=f,Ti:f,
Xi:d,Yi:(g=event)=>{di(Af,g,a);N(d)(e,Af,b)&&g.preventDefault()},Wi:c})},fi=(a,b,c,d,e)=>{Bf||(Bf=m(260));return pf({target:a,Ti:e,Xi:d,Yi:(f=event)=>{var g=Bf,h=document.pointerLockElement||document.Ki||document.$i||document.Qi;F[g>>2]=!!h;var n=h&&h.id?h.id:"";t(rf(h),v,g+4,128);t(n,v,g+132,128);N(d)(20,g,b)&&f.preventDefault()},Wi:c})},gi=(a,b,c,d)=>{Cf||(Cf=m(36));a=If(a);return pf({target:a,Ti:"resize",Xi:d,Yi:(e=event)=>{if(e.target==a){var f=document.body;if(f){var g=Cf;F[g>>2]=e.detail;F[g+
4>>2]=f.clientWidth;F[g+8>>2]=f.clientHeight;F[g+12>>2]=innerWidth;F[g+16>>2]=innerHeight;F[g+20>>2]=outerWidth;F[g+24>>2]=outerHeight;F[g+28>>2]=pageXOffset;F[g+32>>2]=pageYOffset;N(d)(10,g,b)&&e.preventDefault()}}},Wi:c})},hi=(a,b,c,d,e,f)=>{Df||(Df=m(1696));a=If(a);return pf({target:a,Fj:"touchstart"==f||"touchend"==f,Ti:f,Xi:d,Yi:g=>{for(var h,n={},p=g.touches,q=0;q<p.length;++q)h=p[q],h.Qk=h.Vk=0,n[h.identifier]=h;for(q=0;q<g.changedTouches.length;++q)h=g.changedTouches[q],h.Qk=1,n[h.identifier]=
h;for(q=0;q<g.targetTouches.length;++q)n[g.targetTouches[q].identifier].Vk=1;p=Df;rb[p>>3]=g.timeStamp;var u=p>>2;F[u+3]=g.ctrlKey;F[u+4]=g.shiftKey;F[u+5]=g.altKey;F[u+6]=g.metaKey;u+=7;var w=Rf(a),r=0;for(q in n)if(h=n[q],F[u]=h.identifier,F[u+1]=h.screenX,F[u+2]=h.screenY,F[u+3]=h.clientX,F[u+4]=h.clientY,F[u+5]=h.pageX,F[u+6]=h.pageY,F[u+7]=h.Qk,F[u+8]=h.Vk,F[u+9]=h.clientX-w.left,F[u+10]=h.clientY-w.top,u+=13,31<++r)break;F[p+8>>2]=r;N(d)(e,p,b)&&g.preventDefault()},Wi:c})},ii=(a,b,c)=>{var d=
Hf[1];Ef||(Ef=m(8));return pf({target:d,Ti:"visibilitychange",Xi:c,Yi:(e=event)=>{var f=Ef,g=["hidden","visible","prerender","unloaded"].indexOf(document.visibilityState);F[f>>2]=document.hidden;F[f+4>>2]=g;N(c)(21,f,a)&&e.preventDefault()},Wi:b})},ji=(a,b,c,d,e,f)=>{a={target:If(a),Ti:f,Xi:d,Yi:(g=event)=>{N(d)(e,0,b)&&g.preventDefault()},Wi:c};pf(a)},ki=(a,b,c,d)=>{Ff||(Ff=m(104));return pf({target:a,Fj:!0,Ti:"wheel",Xi:d,Yi:(e=event)=>{var f=Ff;di(f,e,a);rb[f+72>>3]=e.deltaX;rb[f+80>>3]=e.deltaY;
rb[f+88>>3]=e.deltaZ;F[f+96>>2]=e.deltaMode;N(d)(9,f,b)&&e.preventDefault()},Wi:c})};function li(){this.yj=[void 0];this.Nk=[]}var mi,ni;
function oi(a,b,c,d,e){function f(){var U=0,ha=0;A.response&&L&&0===H[a+12>>2]&&(ha=A.response.byteLength);0<ha&&(U=m(ha),v.set(new Uint8Array(A.response),U));H[a+12>>2]=U;Yg(a+16,ha);Yg(a+24,0);(U=A.response?A.response.byteLength:0)&&Yg(a+32,U);qb[a+40>>1]=A.readyState;qb[a+42>>1]=A.status;A.statusText&&t(A.statusText,v,a+44,64)}var g=H[a+8>>2];if(g){var h=g?x(v,g):"",n=a+112,p=td(n+0);p||(p="GET");var q=H[n+56>>2],u=H[n+68>>2],w=H[n+72>>2];g=H[n+76>>2];var r=H[n+80>>2],B=H[n+84>>2],y=H[n+88>>2],
G=H[n+52>>2],L=!!(G&1),O=!!(G&2);G=!!(G&64);u=u?u?x(v,u):"":void 0;w=w?w?x(v,w):"":void 0;var A=new XMLHttpRequest;A.withCredentials=!!v[n+60>>0];A.open(p,h,!G,u,w);G||(A.timeout=q);A.Qi=h;A.responseType="arraybuffer";r&&(h=r?x(v,r):"",A.overrideMimeType(h));if(g)for(;;){n=H[g>>2];if(!n)break;h=H[g+4>>2];if(!h)break;g+=8;n=n?x(v,n):"";h=h?x(v,h):"";A.setRequestHeader(n,h)}var P=mi.Nj(A);H[a>>2]=P;g=B&&y?v.slice(B,B+y):null;A.onload=U=>{mi.has(P)&&(f(),200<=A.status&&300>A.status?b&&b(a,A,U):c&&c(a,
A,U))};A.onerror=U=>{mi.has(P)&&(f(),c&&c(a,A,U))};A.ontimeout=U=>{mi.has(P)&&c&&c(a,A,U)};A.onprogress=U=>{if(mi.has(P)){var ha=L&&O&&A.response?A.response.byteLength:0,Q=0;0<ha&&L&&O&&(Q=m(ha),v.set(new Uint8Array(A.response),Q));H[a+12>>2]=Q;Yg(a+16,ha);Yg(a+24,U.loaded-ha);Yg(a+32,U.total);qb[a+40>>1]=A.readyState;3<=A.readyState&&0===A.status&&0<U.loaded&&(A.status=200);qb[a+42>>1]=A.status;A.statusText&&t(A.statusText,v,a+44,64);d&&d(a,A,U);Q&&ca(Q)}};A.onreadystatechange=U=>{mi.has(P)&&(qb[a+
40>>1]=A.readyState,2<=A.readyState&&(qb[a+42>>1]=A.status),e&&e(a,A,U))};try{A.send(g)}catch(U){c&&c(a,A,U)}}else c(a,0,"no url specified!")}
function pi(a,b,c,d){var e=ni;if(e){var f=H[a+112+64>>2];f||(f=H[a+8>>2]);var g=f?x(v,f):"";try{var h=e.transaction(["FILES"],"readwrite").objectStore("FILES").put(b,g);h.onsuccess=()=>{qb[a+40>>1]=4;qb[a+42>>1]=200;t("OK",v,a+44,64);c(a,0,g)};h.onerror=n=>{qb[a+40>>1]=4;qb[a+42>>1]=413;t("Payload Too Large",v,a+44,64);d(a,0,n)}}catch(n){d(a,0,n)}}else d(a,0,"IndexedDB not available!")}
function qi(a,b,c){var d=ni;if(d){var e=H[a+112+64>>2];e||(e=H[a+8>>2]);e=e?x(v,e):"";try{var f=d.transaction(["FILES"],"readonly").objectStore("FILES").get(e);f.onsuccess=g=>{if(g.target.result){g=g.target.result;var h=g.byteLength||g.length,n=m(h);v.set(new Uint8Array(g),n);H[a+12>>2]=n;Yg(a+16,h);Yg(a+24,0);Yg(a+32,h);qb[a+40>>1]=4;qb[a+42>>1]=200;t("OK",v,a+44,64);b(a,0,g)}else qb[a+40>>1]=4,qb[a+42>>1]=404,t("Not Found",v,a+44,64),c(a,0,"no data")};f.onerror=g=>{qb[a+40>>1]=4;qb[a+42>>1]=404;
t("Not Found",v,a+44,64);c(a,0,g)}}catch(g){c(a,0,g)}}else c(a,0,"IndexedDB not available!")}
function ri(a,b,c){var d=ni;if(d){var e=H[a+112+64>>2];e||(e=H[a+8>>2]);e=e?x(v,e):"";try{var f=d.transaction(["FILES"],"readwrite").objectStore("FILES").delete(e);f.onsuccess=g=>{g=g.target.result;H[a+12>>2]=0;Yg(a+16,0);Yg(a+24,0);Yg(a+32,0);qb[a+40>>1]=4;qb[a+42>>1]=200;t("OK",v,a+44,64);b(a,0,g)};f.onerror=g=>{qb[a+40>>1]=4;qb[a+42>>1]=404;t("Not Found",v,a+44,64);c(a,0,g)}}catch(g){c(a,0,g)}}else c(a,0,"IndexedDB not available!")}
var si=["default","low-power","high-performance"],ti=[null],ui=null,vi={},xi=()=>{if(!wi){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",_:Ya||"./this.program"},b;for(b in vi)void 0===vi[b]?delete a[b]:a[b]=vi[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);wi=c}return wi},wi,yi=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},Ai=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]=zi(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]]},Bi=1,Ci={};
function Di(a){var b=yi(a);if(null!==b)return a;b=Ai(a);if(null!==b)return a;Ci[a]?b=Ci[a]:(b=Bi++,65535>b||lb("exceeded max address mappings of 65535"),b="172.29."+(b&255)+"."+(b&65280),Ci[a]=b);return b}
var Ei=a=>(a&255)+"."+(a>>8&255)+"."+(a>>16&255)+"."+(a>>24&255),Fi=[31,29,31,30,31,30,31,31,30,31,30,31],Gi=[31,28,31,30,31,30,31,31,30,31,30,31],Hi=(a,b,c,d)=>{function e(r,B,y){for(r="number"==typeof r?r.toString():r||"";r.length<B;)r=y[0]+r;return r}function f(r,B){return e(r,B,"0")}function g(r,B){function y(L){return 0>L?-1:0<L?1:0}var G;0===(G=y(r.getFullYear()-B.getFullYear()))&&0===(G=y(r.getMonth()-B.getMonth()))&&(G=y(r.getDate()-B.getDate()));return G}function h(r){switch(r.getDay()){case 0:return new Date(r.getFullYear()-
1,11,29);case 1:return r;case 2:return new Date(r.getFullYear(),0,3);case 3:return new Date(r.getFullYear(),0,2);case 4:return new Date(r.getFullYear(),0,1);case 5:return new Date(r.getFullYear()-1,11,31);case 6:return new Date(r.getFullYear()-1,11,30)}}function n(r){var B=r.wj;for(r=new Date((new Date(r.xj+1900,0,1)).getTime());0<B;){var y=r.getMonth(),G=(yd(r.getFullYear())?Fi:Gi)[y];if(B>G-r.getDate())B-=G-r.getDate()+1,r.setDate(1),11>y?r.setMonth(y+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+
1));else{r.setDate(r.getDate()+B);break}}y=new Date(r.getFullYear()+1,0,4);B=h(new Date(r.getFullYear(),0,4));y=h(y);return 0>=g(B,r)?0>=g(y,r)?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var p=H[d+40>>2];d={Nl:F[d>>2],Ml:F[d+4>>2],$j:F[d+8>>2],Bk:F[d+12>>2],ak:F[d+16>>2],xj:F[d+20>>2],fj:F[d+24>>2],wj:F[d+28>>2],rm:F[d+32>>2],Ll:F[d+36>>2],Ol:p?p?x(v,p):"":""};c=c?x(v,c):"";p={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S",
"%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var q in p)c=c.replace(new RegExp(q,"g"),p[q]);var u="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),w="January February March April May June July August September October November December".split(" ");p={"%a":r=>u[r.fj].substring(0,
3),"%A":r=>u[r.fj],"%b":r=>w[r.ak].substring(0,3),"%B":r=>w[r.ak],"%C":r=>f((r.xj+1900)/100|0,2),"%d":r=>f(r.Bk,2),"%e":r=>e(r.Bk,2," "),"%g":r=>n(r).toString().substring(2),"%G":r=>n(r),"%H":r=>f(r.$j,2),"%I":r=>{r=r.$j;0==r?r=12:12<r&&(r-=12);return f(r,2)},"%j":r=>{for(var B=0,y=0;y<=r.ak-1;B+=(yd(r.xj+1900)?Fi:Gi)[y++]);return f(r.Bk+B,3)},"%m":r=>f(r.ak+1,2),"%M":r=>f(r.Ml,2),"%n":()=>"\n","%p":r=>0<=r.$j&&12>r.$j?"AM":"PM","%S":r=>f(r.Nl,2),"%t":()=>"\t","%u":r=>r.fj||7,"%U":r=>f(Math.floor((r.wj+
7-r.fj)/7),2),"%V":r=>{var B=Math.floor((r.wj+7-(r.fj+6)%7)/7);2>=(r.fj+371-r.wj-2)%7&&B++;if(B)53==B&&(y=(r.fj+371-r.wj)%7,4==y||3==y&&yd(r.xj)||(B=1));else{B=52;var y=(r.fj+7-r.wj-1)%7;(4==y||5==y&&yd(r.xj%400-1))&&B++}return f(B,2)},"%w":r=>r.fj,"%W":r=>f(Math.floor((r.wj+7-(r.fj+6)%7)/7),2),"%y":r=>(r.xj+1900).toString().substring(2),"%Y":r=>r.xj+1900,"%z":r=>{r=r.Ll;var B=0<=r;r=Math.abs(r)/60;return(B?"+":"-")+String("0000"+(r/60*100+r%60)).slice(-4)},"%Z":r=>r.Ol,"%%":()=>"%"};c=c.replace(/%%/g,
"\x00\x00");for(q in p)c.includes(q)&&(c=c.replace(new RegExp(q,"g"),p[q](d)));c=c.replace(/\0\0/g,"%");q=lc(c,!1);if(q.length>b)return 0;E.set(q,a);return q.length-1},Ob=(a,b,c,d)=>{var e={string:p=>{var q=0;null!==p&&void 0!==p&&0!==p&&(q=Lf(p));return q},array:p=>{var q=Kf(p.length);E.set(p,q);return q}};a=k["_"+a];var f=[],g=0;if(d)for(var h=0;h<d.length;h++){var n=e[c[h]];n?(0===g&&(g=bf()),f[h]=n(d[h])):f[h]=d[h]}c=a.apply(null,f);return c=function(p){0!==g&&cf(g);return"string"===b?p?x(v,p):
"":"boolean"===b?!!p:p}(c)};function Sc(a,b,c,d){a||(a=this);this.parent=a;this.Si=a.Si;this.nj=null;this.id=Ic++;this.name=b;this.mode=c;this.Li={};this.Ni={};this.rdev=d}Object.defineProperties(Sc.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}},Cl:{get:function(){return D(this.mode)}},Bl:{get:function(){return 8192===(this.mode&61440)}}});
ld();Jc=Array(4096);Qb(C,"/");Pb("/tmp");Pb("/home");Pb("/home/web_user");(function(){Pb("/dev");oc(259,{read:()=>0,write:(d,e,f,g)=>g});cd("/dev/null",259);nc(1280,qc);nc(1536,rc);cd("/dev/tty",1280);cd("/dev/tty1",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(b=fc(a).byteLength);return a[--b]};pd("/dev","random",c);pd("/dev","urandom",c);Pb("/dev/shm");Pb("/dev/shm/tmp")})();
(function(){Pb("/proc");var a=Pb("/proc/self");Pb("/proc/self/fd");Qb({Si(){var b=uc(a,"fd",16895,73);b.Li={lookup(c,d){var e=Yc(+d);c={parent:null,Si:{oj:"fake"},Li:{readlink:()=>e.path}};return c.parent=c}};return b}},"/proc/self/fd")})();k.FS_createPath=nd;k.FS_createDataFile=Cc;k.FS_createPreloadedFile=Dc;k.FS_unlink=Va;k.FS_createLazyFile=rd;k.FS_createDevice=pd;k.requestFullscreen=(a,b)=>ie(a,b);k.requestAnimationFrame=a=>Jd(a);k.setCanvasSize=(a,b,c)=>{ke(k.canvas,a,b);c||le()};
k.pauseMainLoop=()=>{Fd=null;Ld++};k.resumeMainLoop=()=>{Ld++;var a=Bd,b=Cd,c=Dd;Dd=null;Rd(c);Kd(a,b);Fd()};k.getUserMedia=()=>{window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia);window.getUserMedia(void 0)};k.createContext=(a,b,c,d)=>ae(a,b,c,d);for(var T,Ii=0;32>Ii;++Ii)Dg.push(Array(Ii));var Ji=new Float32Array(288);for(Ii=0;288>Ii;++Ii)Gh[Ii]=Ji.subarray(0,Ii+1);var Li=new Int32Array(288);for(Ii=0;288>Ii;++Ii)Jh[Ii]=Li.subarray(0,Ii+1);mi=new li;Db("library_fetch_init");
(function(a,b){try{var c=indexedDB.open("emscripten_filesystem",1)}catch(d){b(d);return}c.onupgradeneeded=d=>{d=d.target.result;d.objectStoreNames.contains("FILES")&&d.deleteObjectStore("FILES");d.createObjectStore("FILES")};c.onsuccess=d=>a(d.target.result);c.onerror=d=>b(d)})(a=>{ni=a;Eb("library_fetch_init")},()=>{ni=!1;Eb("library_fetch_init")});
Object.assign(li.prototype,{get(a){return this.yj[a]},has(a){return void 0!==this.yj[a]},Nj(a){var b=this.Nk.pop()||this.yj.length;this.yj[b]=a;return b},rl(a){this.yj[a]=void 0;this.Nk.push(a)}});
var Qi={Tb:function(a){try{a=a?x(v,a):"";var b=Oa(a,{tj:!0});if(null===b.node)throw new R(44);if(!D(b.node.mode))throw new R(54);var c=Rc(b.node,"x");if(c)throw new R(c);hc=b.path;return 0}catch(d){if("undefined"==typeof sd||"ErrnoError"!==d.name)throw d;return-d.Pi}},Ia:function(a,b,c){wd=c;try{var d=Yc(a);switch(b){case 0:var e=xd();if(0>e)return-28;for(;Hc[e];)e++;return Zc(d,e).fd;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=xd(),d.flags|=e,0;case 5:return e=xd(),pb[e+0>>1]=2,
0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return F[Mi()>>2]=28,-1;default:return-28}}catch(f){if("undefined"==typeof sd||"ErrnoError"!==f.name)throw f;return-f.Pi}},Kb:function(a,b,c){try{var d=Yc(a);d.uj||(d.uj=Ma(d.path));a=0;for(var e=jd(d,0,1),f=Math.floor(e/280);f<d.uj.length&&a+280<=c;){var g=d.uj[f];if("."===g){var h=d.node.id;var n=4}else if(".."===g)h=Oa(d.path,{parent:!0}).node.id,n=4;else{var p=wc(d.node,g);h=p.id;n=8192===(p.mode&61440)?2:D(p.mode)?4:40960===(p.mode&61440)?
10:8}K=[h>>>0,(J=h,1<=+Math.abs(J)?0<J?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];F[b+a>>2]=K[0];F[b+a+4>>2]=K[1];K=[280*(f+1)>>>0,(J=280*(f+1),1<=+Math.abs(J)?0<J?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];F[b+a+8>>2]=K[0];F[b+a+12>>2]=K[1];pb[b+a+16>>1]=280;E[b+a+18>>0]=n;t(g,v,b+a+19,256);a+=280;f+=1}jd(d,280*f,0);return a}catch(q){if("undefined"==typeof sd||"ErrnoError"!==q.name)throw q;return-q.Pi}},Ub:function(a,b,c){wd=c;
try{var d=Yc(a);switch(b){case 21509:return d.tty?0:-59;case 21505:if(!d.tty)return-59;if(d.tty.ij.yl){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=xd();F[e>>2]=25856;F[e+4>>2]=5;F[e+8>>2]=191;F[e+12>>2]=35387;for(var f=0;32>f;f++)E[e+f+17>>0]=b[f]||0}return 0;case 21510:case 21511:case 21512:return d.tty?0:-59;case 21506:case 21507:case 21508:if(!d.tty)return-59;if(d.tty.ij.zl)for(e=xd(),b=[],f=0;32>f;f++)b.push(E[e+f+17>>0]);return 0;case 21519:if(!d.tty)return-59;
e=xd();return F[e>>2]=0;case 21520:return d.tty?-28:-59;case 21531:e=xd();if(!d.Ni.xl)throw new R(59);return d.Ni.xl(d,b,e);case 21523:if(!d.tty)return-59;d.tty.ij.Al&&(f=[24,80],e=xd(),pb[e>>1]=f[0],pb[e+2>>1]=f[1]);return 0;case 21524:return d.tty?0:-59;case 21515:return d.tty?0:-59;default:return-28}}catch(g){if("undefined"==typeof sd||"ErrnoError"!==g.name)throw g;return-g.Pi}},Ob:function(a,b){try{return a=a?x(v,a):"",vd(ed,a,b)}catch(c){if("undefined"==typeof sd||"ErrnoError"!==c.name)throw c;
return-c.Pi}},Lb:function(a,b,c){try{return b=b?x(v,b):"",b=ud(a,b),b=La(b),"/"===b[b.length-1]&&(b=b.substr(0,b.length-1)),Pb(b,c),0}catch(d){if("undefined"==typeof sd||"ErrnoError"!==d.name)throw d;return-d.Pi}},Pb:function(a,b,c,d){try{b=b?x(v,b):"";var e=d&256;b=ud(a,b,d&4096);return vd(e?ed:Na,b,c)}catch(f){if("undefined"==typeof sd||"ErrnoError"!==f.name)throw f;return-f.Pi}},Fa:function(a,b,c,d){wd=d;try{b=b?x(v,b):"";b=ud(a,b);var e=d?xd():0;return fd(b,c,e).fd}catch(f){if("undefined"==typeof sd||
"ErrnoError"!==f.name)throw f;return-f.Pi}},Jb:function(a,b,c,d){try{b=b?x(v,b):"";b=ud(a,b);if(0>=d)return-28;var e=Mc(b),f=Math.min(d,aa(e)),g=E[c+f];t(e,v,c,d+1);E[c+f]=g;return f}catch(h){if("undefined"==typeof sd||"ErrnoError"!==h.name)throw h;return-h.Pi}},Gb:function(a,b,c,d){try{b=b?x(v,b):"";d=d?x(v,d):"";b=ud(a,b);d=ud(c,d);a=b;var e=cc(a),f=cc(d),g=dc(a),h=dc(d);var n=Oa(a,{parent:!0});var p=n.node;n=Oa(d,{parent:!0});var q=n.node;if(!p||!q)throw new R(44);if(p.Si!==q.Si)throw new R(75);
var u=wc(p,g),w=ic(a,f);if("."!==w.charAt(0))throw new R(28);w=ic(d,e);if("."!==w.charAt(0))throw new R(55);try{var r=wc(q,h)}catch(G){}if(u!==r){var B=D(u.mode),y=Vc(p,g,B);if(y)throw new R(y);if(y=r?Vc(q,h,B):Uc(q,h))throw new R(y);if(!p.Li.rename)throw new R(63);if(u.nj||r&&r.nj)throw new R(10);if(q!==p&&(y=Rc(p,"w")))throw new R(y);Qc(u);try{p.Li.rename(u,q,h)}catch(G){throw G;}finally{Pc(u)}}return 0}catch(G){if("undefined"==typeof sd||"ErrnoError"!==G.name)throw G;return-G.Pi}},Hb:function(a){try{return a=
a?x(v,a):"",Ua(a),0}catch(b){if("undefined"==typeof sd||"ErrnoError"!==b.name)throw b;return-b.Pi}},Qb:function(a,b){try{return a=a?x(v,a):"",vd(Na,a,b)}catch(c){if("undefined"==typeof sd||"ErrnoError"!==c.name)throw c;return-c.Pi}},Ib:function(a,b,c){try{return b=b?x(v,b):"",b=ud(a,b),0===c?Va(b):512===c?Ua(b):lb("Invalid flags passed to unlinkat"),0}catch(d){if("undefined"==typeof sd||"ErrnoError"!==d.name)throw d;return-d.Pi}},dh:function(a){if(mi.has(a)){var b=mi.get(a);mi.rl(a);0<b.readyState&&
4>b.readyState&&b.abort()}},bh:function(a,b,c){a=mi.get(a).getAllResponseHeaders();var d=aa(a)+1;t(a,v,b,c);return Math.min(d,c)},ch:function(a){return aa(mi.get(a).getAllResponseHeaders())+1},Rb:()=>!0,yb:function(a,b,c){a=new Date(1E3*(b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN));F[c>>2]=a.getUTCSeconds();F[c+4>>2]=a.getUTCMinutes();F[c+8>>2]=a.getUTCHours();F[c+12>>2]=a.getUTCDate();F[c+16>>2]=a.getUTCMonth();F[c+20>>2]=a.getUTCFullYear()-1900;F[c+24>>2]=a.getUTCDay();F[c+28>>2]=(a.getTime()-
Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0},zb:function(a,b,c){a=new Date(1E3*(b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN));F[c>>2]=a.getSeconds();F[c+4>>2]=a.getMinutes();F[c+8>>2]=a.getHours();F[c+12>>2]=a.getDate();F[c+16>>2]=a.getMonth();F[c+20>>2]=a.getFullYear()-1900;F[c+24>>2]=a.getDay();F[c+28>>2]=(yd(a.getFullYear())?zd:Ad)[a.getMonth()]+a.getDate()-1|0;F[c+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),
0,1)).getTimezoneOffset();F[c+32>>2]=(b!=d&&a.getTimezoneOffset()==Math.min(d,b))|0},Ab:function(a){var b=new Date(F[a+20>>2]+1900,F[a+16>>2],F[a+12>>2],F[a+8>>2],F[a+4>>2],F[a>>2],0),c=F[a+32>>2],d=b.getTimezoneOffset(),e=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),f=(new Date(b.getFullYear(),0,1)).getTimezoneOffset(),g=Math.min(f,e);0>c?F[a+32>>2]=Number(e!=f&&g==d):0<c!=(g==d)&&(e=Math.max(f,e),b.setTime(b.getTime()+6E4*((0<c?g:e)-d)));F[a+24>>2]=b.getDay();F[a+28>>2]=(yd(b.getFullYear())?
zd:Ad)[b.getMonth()]+b.getDate()-1|0;F[a>>2]=b.getSeconds();F[a+4>>2]=b.getMinutes();F[a+8>>2]=b.getHours();F[a+12>>2]=b.getDate();F[a+16>>2]=b.getMonth();F[a+20>>2]=b.getYear();a=b.getTime()/1E3;return Ni((J=a,1<=+Math.abs(J)?0<J?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)),a>>>0},Bb:function(a){var b=new Date(Date.UTC(F[a+20>>2]+1900,F[a+16>>2],F[a+12>>2],F[a+8>>2],F[a+4>>2],F[a>>2],0));F[a+24>>2]=b.getUTCDay();F[a+28>>2]=(b.getTime()-Date.UTC(b.getUTCFullYear(),
0,1,0,0,0,0))/864E5|0;a=b.getTime()/1E3;return Ni((J=a,1<=+Math.abs(J)?0<J?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)),a>>>0},Fb:(a,b,c)=>{function d(n){return(n=n.toTimeString().match(/\(([A-Za-z ]+)\)$/))?n[1]:"GMT"}var e=(new Date).getFullYear(),f=new Date(e,0,1),g=new Date(e,6,1);e=f.getTimezoneOffset();var h=g.getTimezoneOffset();H[a>>2]=60*Math.max(e,h);F[b>>2]=Number(e!=h);a=d(f);b=d(g);a=z(a);b=z(b);h<e?(H[c>>2]=a,H[c+4>>2]=b):(H[c>>2]=b,H[c+4>>2]=a)},j:()=>
{lb("")},wh:a=>{if(12448==a)return V=12288,1;V=12300;return 0},zh:(a,b,c,d,e)=>{if(62E3!=a)V=12296,c=0;else{if(b)for(;;){a=F[b>>2];if(12321==a)se.alpha=0<F[b+4>>2];else if(12325==a)se.depth=0<F[b+4>>2];else if(12326==a)se.stencil=0<F[b+4>>2];else if(12337==a)a=F[b+4>>2],se.antialias=0<a;else if(12338==a)a=F[b+4>>2],se.antialias=1==a;else if(12544==a)se.km=12547!=F[b+4>>2];else if(12344==a)break;b+=8}c&&d||e?(e&&(F[e>>2]=1),c&&0<d&&(H[c>>2]=62002),V=12288,c=1):(V=12300,c=0)}return c},mh:(a,b,c,d)=>
{if(62E3!=a)return V=12296,0;for(a=1;;){b=F[d>>2];if(12440==b)a=F[d+4>>2];else if(12344==b)break;else return V=12292,0;d+=8}if(2>a||3<a)return V=12293,0;se.Pj=a-1;se.Dl=0;ue=ce(k.canvas,se);if(0!=ue)return V=12288,ee(ue),k.Ql=!0,Yd.forEach(function(e){e()}),ee(null),62004;V=12297;return 0},oh:(a,b)=>{if(62E3!=a)return V=12296,0;if(62002!=b)return V=12293,0;V=12288;return 62006},nh:(a,b)=>{if(62E3!=a)return V=12296,0;if(62004!=b)return V=12294,0;a=ue;S===de[a]&&(S=null);if("object"==typeof tf)for(var c=
de[a].Zi.canvas,d=0;d<gf.length;++d)gf[d].target!=c||hf(d--);de[a]&&de[a].Zi.canvas&&(de[a].Zi.canvas.Ej=void 0);de[a]=null;V=12288;pe==b&&(pe=0);return 1},qh:(a,b)=>{if(62E3!=a)return V=12296,0;if(62006!=b)return V=12301,1;qe==b&&(qe=0);re==b&&(re=0);V=12288;return 1},Ah:(a,b,c,d)=>{if(62E3!=a)return V=12296,0;if(62002!=b)return V=12293,0;if(!d)return V=12300,0;V=12288;switch(c){case 12320:return F[d>>2]=se.alpha?32:24,1;case 12321:return F[d>>2]=se.alpha?8:0,1;case 12322:return F[d>>2]=8,1;case 12323:return F[d>>
2]=8,1;case 12324:return F[d>>2]=8,1;case 12325:return F[d>>2]=se.depth?24:0,1;case 12326:return F[d>>2]=se.stencil?8:0,1;case 12327:return F[d>>2]=12344,1;case 12328:return F[d>>2]=62002,1;case 12329:return F[d>>2]=0,1;case 12330:return F[d>>2]=4096,1;case 12331:return F[d>>2]=16777216,1;case 12332:return F[d>>2]=4096,1;case 12333:return F[d>>2]=0,1;case 12334:return F[d>>2]=0,1;case 12335:return F[d>>2]=12344,1;case 12337:return F[d>>2]=se.antialias?4:0,1;case 12338:return F[d>>2]=se.antialias?
1:0,1;case 12339:return F[d>>2]=4,1;case 12340:return F[d>>2]=12344,1;case 12341:case 12342:case 12343:return F[d>>2]=-1,1;case 12345:case 12346:return F[d>>2]=0,1;case 12347:return F[d>>2]=0,1;case 12348:return F[d>>2]=1;case 12349:case 12350:return F[d>>2]=0,1;case 12351:return F[d>>2]=12430,1;case 12352:return F[d>>2]=4,1;case 12354:return F[d>>2]=0,1;default:return V=12292,0}},Va:()=>{V=12288;return 62E3},lh:()=>V,xh:(a,b,c)=>{if(62E3!=a)return V=12296,0;b&&(F[b>>2]=1);c&&(F[c>>2]=4);oe=!0;V=
12288;return 1},rh:(a,b,c,d)=>{if(62E3!=a)return V=12296,0;if(0!=d&&62004!=d)return V=12294,0;if(0!=c&&62006!=c||0!=b&&62006!=b)return V=12301,0;ee(d?ue:null);pe=d;re=b;qe=c;V=12288;return 1},kh:(a,b)=>{if(62E3!=a)return V=12296,0;V=12288;if(te[b])return te[b];switch(b){case 12371:a=z("Emscripten");break;case 12372:a=z("1.4 Emscripten EGL");break;case 12373:a=z("");break;case 12429:a=z("OpenGL_ES");break;default:return V=12300,0}return te[b]=a},sh:()=>{if(oe)if(k.bj)if(k.bj.isContextLost())V=12302;
else return V=12288,1;else V=12290;else V=12289;return 0},th:(a,b)=>{if(62E3!=a)return V=12296,0;0==b?Kd(0,0):Kd(1,b);V=12288;return 1},yh:a=>{if(62E3!=a)return V=12296,0;re=qe=pe=0;oe=!1;V=12288;return 1},vh:()=>{V=12288;return 1},uh:()=>{V=12288;return 1},u:(a,b,c)=>Ye(a,b,c),a:(a,b,c)=>Ye(a,b,c),e:(a,b,c)=>{b=Xe(b,c);return Vb[a].apply(null,b)},k:(a,b,c)=>Ye(a,b,c),Nh:(a,b,c,d,e,f,g,h)=>{function n(){g&&df(()=>{var w=0;q.statusText&&(w=Lf(q.statusText));N(g)(u,d,q.status,w)})}var p=a?x(v,a):"";
a=b?x(v,b):"";c=c?x(v,c):"";var q=new XMLHttpRequest;q.open(a,p,!0);q.responseType="arraybuffer";var u=af();q.onload=function(){if(200<=q.status&&300>q.status||0===q.status&&"http"!=p.substr(0,4).toLowerCase()){var w=new Uint8Array(q.response),r=m(w.length);v.set(w,r);f&&N(f)(u,d,r,w.length);e&&ca(r)}else n();delete Ze[u]};q.onerror=function(){n();delete Ze[u]};q.onprogress=function(w){h&&N(h)(u,d,w.loaded,w.lengthComputable||void 0===w.lengthComputable?w.total:0)};q.onabort=function(){delete Ze[u]};
"POST"==a?(q.setRequestHeader("Content-type","application/x-www-form-urlencoded"),q.send(c)):q.send(null);Ze[u]=q;return u},Fh:a=>{clearInterval(a)},ba:()=>Date.now(),gh:()=>{if(!sf())return-1;lf(Sf);var a=Hf[1];if(a.exitFullscreen)a.fullscreenElement&&a.exitFullscreen();else if(a.webkitExitFullscreen)a.webkitFullscreenElement&&a.webkitExitFullscreen();else return-1;return 0},Pa:()=>{lf(Tf);if(document.exitPointerLock)document.exitPointerLock();else return-1;return 0},Rh:Jf,y:()=>"number"==typeof devicePixelRatio&&
devicePixelRatio||1,p:(a,b,c)=>{a=If(a);if(!a)return-4;a=Rf(a);rb[b>>3]=a.width;rb[c>>3]=a.height;return 0},Ya:(a,b)=>{if(0>a||a>=uf.length)return-5;if(!uf[a])return-7;Uf(b,uf[a]);return 0},aa:Hd,Bh:()=>uf.length,jh:(a,b)=>{F[a>>2]=screen.width;F[b>>2]=screen.height},Jg:Vf,Ig:Wf,Nd:(a,b)=>{T.beginQuery(a,Ie[b])},Zg:(a,b)=>{T.aj.beginQueryEXT(a,Ie[b])},qd:function(a){T.beginTransformFeedback(a)},Hg:(a,b,c)=>{T.bindAttribLocation(W[a],b,c?x(v,c):"")},Gg:Xf,nd:(a,b,c)=>{T.bindBufferBase(a,b,Be[c])},
od:(a,b,c,d,e)=>{T.bindBufferRange(a,b,Be[c],d,e)},Fg:Yf,Eg:Zf,vc:(a,b)=>{T.bindSampler(a,Je[b])},Dg:$f,nc:(a,b)=>{T.bindTransformFeedback(a,Ke[b])},vd:ag,Rg:ag,Cg:function(a,b,c,d){T.blendColor(a,b,c,d)},Bg:function(a){T.blendEquation(a)},Ag:bg,zg:cg,yg:dg,Ad:function(a,b,c,d,e,f,g,h,n,p){T.blitFramebuffer(a,b,c,d,e,f,g,h,n,p)},xg:eg,wg:(a,b,c,d)=>{2<=S.version?c&&T.bufferSubData(a,b,v,d,c):T.bufferSubData(a,b,v.subarray(d,d+c))},vg:fg,ug:gg,Sc:function(a,b,c,d){T.clearBufferfi(a,b,c,d)},Tc:(a,b,
c)=>{T.clearBufferfv(a,b,I,c>>2)},Vc:(a,b,c)=>{T.clearBufferiv(a,b,F,c>>2)},Uc:(a,b,c)=>{T.clearBufferuiv(a,b,H,c>>2)},tg:hg,sg:ig,rg:jg,Ec:(a,b,c,d)=>T.clientWaitSync(Le[a],b,(c>>>0)+4294967296*d),qg:kg,pg:lg,og:mg,Sd:(a,b,c,d,e,f,g,h,n)=>{T.cj?T.compressedTexImage3D(a,b,c,d,e,f,g,h,n):T.compressedTexImage3D(a,b,c,d,e,f,g,v,n,h)},ng:(a,b,c,d,e,f,g,h,n)=>{2<=S.version?T.cj||!h?T.compressedTexSubImage2D(a,b,c,d,e,f,g,h,n):T.compressedTexSubImage2D(a,b,c,d,e,f,g,v,n,h):T.compressedTexSubImage2D(a,b,
c,d,e,f,g,n?v.subarray(n,n+h):null)},Rd:(a,b,c,d,e,f,g,h,n,p,q)=>{T.cj?T.compressedTexSubImage3D(a,b,c,d,e,f,g,h,n,p,q):T.compressedTexSubImage3D(a,b,c,d,e,f,g,h,n,v,q,p)},Qc:function(a,b,c,d,e){T.copyBufferSubData(a,b,c,d,e)},mg:function(a,b,c,d,e,f,g,h){T.copyTexImage2D(a,b,c,d,e,f,g,h)},lg:function(a,b,c,d,e,f,g,h){T.copyTexSubImage2D(a,b,c,d,e,f,g,h)},Td:function(a,b,c,d,e,f,g,h,n){T.copyTexSubImage3D(a,b,c,d,e,f,g,h,n)},kg:ng,jg:og,ig:function(a){T.cullFace(a)},hg:pg,gg:qg,fg:rg,Pd:(a,b)=>{for(var c=
0;c<a;c++){var d=F[b+4*c>>2],e=Ie[d];e&&(T.deleteQuery(e),Ie[d]=null)}},$g:(a,b)=>{for(var c=0;c<a;c++){var d=F[b+4*c>>2],e=Ie[d];e&&(T.aj.deleteQueryEXT(e),Ie[d]=null)}},eg:sg,xc:(a,b)=>{for(var c=0;c<a;c++){var d=F[b+4*c>>2],e=Je[d];e&&(T.deleteSampler(e),e.name=0,Je[d]=null)}},dg:tg,Fc:a=>{if(a){var b=Le[a];b?(T.deleteSync(b),b.name=0,Le[a]=null):X(1281)}},cg:ug,mc:(a,b)=>{for(var c=0;c<a;c++){var d=F[b+4*c>>2],e=Ke[d];e&&(T.deleteTransformFeedback(e),e.name=0,Ke[d]=null)}},ud:vg,Qg:vg,bg:wg,ag:xg,
$f:yg,_f:(a,b)=>{T.detachShader(W[a],Ge[b])},Zf:zg,Yf:Ag,Xf:Bg,Jc:Cg,Mg:Cg,Xb:Cg,_d:Cg,Yb:Cg,Hd:Eg,Yd:Eg,Ng:Eg,Wf:Fg,Ic:Gg,Lg:Gg,Vb:Gg,Wb:Gg,Zd:Gg,Wd:(a,b,c,d,e,f)=>{Fg(a,d,e,f)},Vf:Hg,Uf:Ig,Md:function(a){T.endQuery(a)},Yg:a=>{T.aj.endQueryEXT(a)},pd:function(){T.endTransformFeedback()},Hc:(a,b)=>(a=T.fenceSync(a,b))?(b=Re(Le),a.name=b,Le[b]=a,b):0,Tf:function(){T.finish()},Sf:Jg,wd:(a,b,c)=>{if(Lg(a)){var d=Ce[Kg(a)];d?d.Fk&16?0>b||0>c||b+c>d.length?(X(1281),l("invalid range in glFlushMappedBufferRange")):
T.bufferSubData(a,d.offset,v.subarray(d.hj+b,d.hj+b+c)):(X(1282),l("buffer was not mapped with GL_MAP_FLUSH_EXPLICIT_BIT in glFlushMappedBufferRange")):(X(1282),l("buffer was never mapped in glFlushMappedBufferRange"))}else X(1280),l("GL_INVALID_ENUM in glFlushMappedBufferRange")},Rf:Mg,Qf:Ng,yd:(a,b,c,d,e)=>{T.framebufferTextureLayer(a,b,Fe[c],d,e)},Pf:Og,Of:Qg,Mf:Rg,Qd:(a,b)=>{Pg(a,b,"createQuery",Ie)},ah:(a,b)=>{for(var c=0;c<a;c++){var d=T.aj.createQueryEXT();if(!d){for(X(1282);c<a;)F[b+4*c++>>
2]=0;break}var e=Re(Ie);d.name=e;Ie[e]=d;F[b+4*c>>2]=e}},Lf:Sg,yc:(a,b)=>{Pg(a,b,"createSampler",Je)},Kf:Tg,lc:(a,b)=>{Pg(a,b,"createTransformFeedback",Ke)},td:Ug,Pg:Ug,Nf:function(a){T.generateMipmap(a)},Jf:(a,b,c,d,e,f,g)=>{Vg("getActiveAttrib",a,b,c,d,e,f,g)},If:Wg,Lc:(a,b,c,d,e)=>{a=W[a];if(a=T.getActiveUniformBlockName(a,b))e&&0<c?(c=t(a,v,e,c),d&&(F[d>>2]=c)):d&&(F[d>>2]=0)},Mc:(a,b,c,d)=>{if(d)if(a=W[a],35393==c)F[d>>2]=T.getActiveUniformBlockName(a,b).length+1;else{if(a=T.getActiveUniformBlockParameter(a,
b,c),null!==a)if(35395==c)for(c=0;c<a.length;c++)F[d+4*c>>2]=a[c];else F[d>>2]=a}else X(1281)},Oc:(a,b,c,d,e)=>{if(e)if(0<b&&0==c)X(1281);else{a=W[a];for(var f=[],g=0;g<b;g++)f.push(F[c+4*g>>2]);if(a=T.getActiveUniforms(a,f,d))for(b=a.length,g=0;g<b;g++)F[e+4*g>>2]=a[g]}else X(1281)},Hf:(a,b,c,d)=>{a=T.getAttachedShaders(W[a]);var e=a.length;e>b&&(e=b);F[c>>2]=e;for(b=0;b<e;++b)F[d+4*b>>2]=Ge.indexOf(a[b])},Gf:Xg,Ff:(a,b)=>{Zg(a,b,4)},zc:(a,b,c)=>{c?Yg(c,T.getBufferParameter(a,b)):X(1281)},Ef:(a,
b,c)=>{c?F[c>>2]=T.getBufferParameter(a,b):X(1281)},Id:(a,b,c)=>{if(35005==b){b=0;if(a=Ce[Kg(a)])b=a.hj;F[c>>2]=b}else X(1280),l("GL_INVALID_ENUM in glGetBufferPointerv")},Df:$g,Cf:ah,cd:(a,b)=>T.getFragDataLocation(W[a],b?x(v,b):""),Bf:(a,b,c,d)=>{a=T.getFramebufferAttachmentParameter(a,b,c);if(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)a=a.name|0;F[d>>2]=a},Ac:(a,b,c)=>bh(a,b,c,1),Cc:(a,b)=>{Zg(a,b,1)},rd:(a,b,c)=>bh(a,b,c,0),Af:ch,ac:(a,b,c,d,e)=>{if(0>d)X(1281);else if(e){if(a=
T.getInternalformatParameter(a,b,c),null!==a)for(b=0;b<a.length&&b<d;++b)F[e+4*b>>2]=a[b]}else X(1281)},hc:()=>{X(1282)},yf:dh,zf:eh,Tg:fh,Vg:gh,Sg:fh,Kd:(a,b,c)=>{if(c){a=T.getQueryParameter(Ie[a],b);var d;"boolean"==typeof a?d=a?1:0:d=a;F[c>>2]=d}else X(1281)},Ug:gh,Ld:(a,b,c)=>{c?F[c>>2]=T.getQuery(a,b):X(1281)},Wg:(a,b,c)=>{c?F[c>>2]=T.aj.getQueryEXT(a,b):X(1281)},xf:(a,b,c)=>{c?F[c>>2]=T.getRenderbufferParameter(a,b):X(1281)},pc:(a,b,c)=>{c?I[c>>2]=T.getSamplerParameter(Je[a],b):X(1281)},qc:(a,
b,c)=>{c?F[c>>2]=T.getSamplerParameter(Je[a],b):X(1281)},vf:hh,uf:(a,b,c,d)=>{a=T.getShaderPrecisionFormat(a,b);F[c>>2]=a.rangeMin;F[c+4>>2]=a.rangeMax;F[d>>2]=a.precision},tf:(a,b,c,d)=>{if(a=T.getShaderSource(Ge[a]))b=0<b&&d?t(a,v,d,b):0,c&&(F[c>>2]=b)},wf:ih,sf:jh,Rc:(a,b)=>{if(2>S.version)return X(1282),0;var c=Oe[a];if(c)return 0>b||b>=c.length?(X(1281),0):c[b];switch(a){case 7939:return c=T.getSupportedExtensions()||[],c=c.concat(c.map(function(d){return"GL_"+d})),c=c.map(function(d){return z(d)}),
c=Oe[a]=c,0>b||b>=c.length?(X(1281),0):c[b];default:return X(1280),0}},Bc:(a,b,c,d,e)=>{0>c?X(1281):e?(a=T.getSyncParameter(Le[a],b),null!==a&&(F[e>>2]=a,d&&(F[d>>2]=1))):X(1281)},rf:(a,b,c)=>{c?I[c>>2]=T.getTexParameter(a,b):X(1281)},qf:(a,b,c)=>{c?F[c>>2]=T.getTexParameter(a,b):X(1281)},ld:(a,b,c,d,e,f,g)=>{a=W[a];if(a=T.getTransformFeedbackVarying(a,b))g&&0<c?(c=t(a.name,v,g,c),d&&(F[d>>2]=c)):d&&(F[d>>2]=0),e&&(F[e>>2]=a.size),f&&(F[f>>2]=a.type)},Nc:(a,b)=>T.getUniformBlockIndex(W[a],b?x(v,b):
""),Pc:(a,b,c,d)=>{if(d)if(0<b&&(0==c||0==d))X(1281);else{a=W[a];for(var e=[],f=0;f<b;f++)e.push(td(F[c+4*f>>2]));if(a=T.getUniformIndices(a,e))for(b=a.length,f=0;f<b;f++)F[d+4*f>>2]=a[f]}else X(1281)},nf:mh,pf:(a,b,c)=>{nh(a,b,c,2)},of:(a,b,c)=>{nh(a,b,c,0)},dd:(a,b,c)=>nh(a,b,c,0),jd:ph,id:ph,kf:(a,b,c)=>{c?(S.kj[a].enabled&&l("glGetVertexAttribPointer on client-side array: not supported, bad data returned"),F[c>>2]=T.getVertexAttribOffset(a,b)):X(1281)},mf:(a,b,c)=>{oh(a,b,c,2)},lf:(a,b,c)=>{oh(a,
b,c,5)},jf:function(a,b){T.hint(a,b)},ec:(a,b,c)=>{for(var d=Dg[b],e=0;e<b;e++)d[e]=F[c+4*e>>2];T.invalidateFramebuffer(a,d)},dc:(a,b,c,d,e,f,g)=>{for(var h=Dg[b],n=0;n<b;n++)h[n]=F[c+4*n>>2];T.invalidateSubFramebuffer(a,h,d,e,f,g)},hf:a=>(a=Be[a])?T.isBuffer(a):0,gf:function(a){return T.isEnabled(a)},ff:a=>(a=De[a])?T.isFramebuffer(a):0,ef:a=>(a=W[a])?T.isProgram(a):0,Od:a=>(a=Ie[a])?T.isQuery(a):0,_g:a=>(a=Ie[a])?T.aj.isQueryEXT(a):0,df:a=>(a=Ee[a])?T.isRenderbuffer(a):0,wc:a=>(a=Je[a])?T.isSampler(a):
0,cf:a=>(a=Ge[a])?T.isShader(a):0,Gc:a=>T.isSync(Le[a]),bf:a=>(a=Fe[a])?T.isTexture(a):0,kc:a=>T.isTransformFeedback(Ke[a]),sd:qh,Og:qh,af:function(a){T.lineWidth(a)},$e:rh,xd:(a,b,c,d)=>{if(0!=(d&33))return l("glMapBufferRange access does not support MAP_READ or MAP_UNSYNCHRONIZED"),0;if(0==(d&2))return l("glMapBufferRange access must include MAP_WRITE"),0;if(0==(d&12))return l("glMapBufferRange access must include INVALIDATE_BUFFER or INVALIDATE_RANGE"),0;if(!Lg(a))return X(1280),l("GL_INVALID_ENUM in glMapBufferRange"),
0;var e=m(c);a=Kg(a);if(!e)return 0;Ce[a]||(Ce[a]={});a=Ce[a];a.offset=b;a.length=c;a.hj=e;a.Fk=d;return e},jc:function(){T.pauseTransformFeedback()},Ze:sh,Ye:function(a,b){T.polygonOffset(a,b)},gc:()=>{X(1280)},fc:()=>{X(1280)},Xg:(a,b)=>{T.aj.queryCounterEXT(Ie[a],b)},Xd:function(a){T.readBuffer(a)},Xe:vh,We:()=>{},Ve:wh,zd:function(a,b,c,d,e){T.renderbufferStorageMultisample(a,b,c,d,e)},ic:function(){T.resumeTransformFeedback()},Ue:(a,b)=>{T.sampleCoverage(a,!!b)},sc:(a,b,c)=>{T.samplerParameterf(Je[a],
b,c)},rc:(a,b,c)=>{T.samplerParameterf(Je[a],b,I[c>>2])},uc:(a,b,c)=>{T.samplerParameteri(Je[a],b,c)},tc:(a,b,c)=>{T.samplerParameteri(Je[a],b,F[c>>2])},Te:xh,Se:()=>{X(1280)},Re:yh,Qe:zh,Pe:function(a,b,c,d){T.stencilFuncSeparate(a,b,c,d)},Oe:Ah,Ne:function(a,b){T.stencilMaskSeparate(a,b)},Me:Bh,Le:function(a,b,c,d){T.stencilOpSeparate(a,b,c,d)},Ke:Ch,Vd:(a,b,c,d,e,f,g,h,n,p)=>{if(T.cj)T.texImage3D(a,b,c,d,e,f,g,h,n,p);else if(p){var q=th(n);T.texImage3D(a,b,c,d,e,f,g,h,n,q,p>>31-Math.clz32(q.BYTES_PER_ELEMENT))}else T.texImage3D(a,
b,c,d,e,f,g,h,n,null)},Je:Dh,Ie:(a,b,c)=>{T.texParameterf(a,b,I[c>>2])},He:function(a,b,c){T.texParameteri(a,b,c)},Ge:(a,b,c)=>{T.texParameteri(a,b,F[c>>2])},cc:function(a,b,c,d,e){T.texStorage2D(a,b,c,d,e)},bc:function(a,b,c,d,e,f){T.texStorage3D(a,b,c,d,e,f)},Fe:Eh,Ud:(a,b,c,d,e,f,g,h,n,p,q)=>{if(T.cj)T.texSubImage3D(a,b,c,d,e,f,g,h,n,p,q);else if(q){var u=th(p);T.texSubImage3D(a,b,c,d,e,f,g,h,n,p,u,q>>31-Math.clz32(u.BYTES_PER_ELEMENT))}else T.texSubImage3D(a,b,c,d,e,f,g,h,n,p,null)},md:(a,b,c,
d)=>{a=W[a];for(var e=[],f=0;f<b;f++)e.push(td(F[c+4*f>>2]));T.transformFeedbackVaryings(a,e,d)},Ee:Fh,De:Hh,Ce:Ih,Be:Kh,bd:(a,b)=>{T.uniform1ui(Y(a),b)},Zc:(a,b,c)=>{b&&T.uniform1uiv(Y(a),H,c>>2,b)},Ae:(a,b,c)=>{T.uniform2f(Y(a),b,c)},ze:Lh,ye:(a,b,c)=>{T.uniform2i(Y(a),b,c)},xe:Mh,ad:(a,b,c)=>{T.uniform2ui(Y(a),b,c)},Yc:(a,b,c)=>{b&&T.uniform2uiv(Y(a),H,c>>2,2*b)},we:(a,b,c,d)=>{T.uniform3f(Y(a),b,c,d)},ve:Nh,ue:(a,b,c,d)=>{T.uniform3i(Y(a),b,c,d)},te:Oh,$c:(a,b,c,d)=>{T.uniform3ui(Y(a),b,c,d)},
Xc:(a,b,c)=>{b&&T.uniform3uiv(Y(a),H,c>>2,3*b)},se:(a,b,c,d,e)=>{T.uniform4f(Y(a),b,c,d,e)},re:Ph,qe:(a,b,c,d,e)=>{T.uniform4i(Y(a),b,c,d,e)},pe:Qh,_c:(a,b,c,d,e)=>{T.uniform4ui(Y(a),b,c,d,e)},Wc:(a,b,c)=>{b&&T.uniform4uiv(Y(a),H,c>>2,4*b)},Kc:(a,b,c)=>{a=W[a];T.uniformBlockBinding(a,b,c)},oe:Rh,Gd:(a,b,c,d)=>{b&&T.uniformMatrix2x3fv(Y(a),!!c,I,d>>2,6*b)},Ed:(a,b,c,d)=>{b&&T.uniformMatrix2x4fv(Y(a),!!c,I,d>>2,8*b)},ne:Sh,Fd:(a,b,c,d)=>{b&&T.uniformMatrix3x2fv(Y(a),!!c,I,d>>2,6*b)},Cd:(a,b,c,d)=>{b&&
T.uniformMatrix3x4fv(Y(a),!!c,I,d>>2,12*b)},me:Th,Dd:(a,b,c,d)=>{b&&T.uniformMatrix4x2fv(Y(a),!!c,I,d>>2,8*b)},Bd:(a,b,c,d)=>{b&&T.uniformMatrix4x3fv(Y(a),!!c,I,d>>2,12*b)},Jd:a=>{if(!Lg(a))return X(1280),l("GL_INVALID_ENUM in glUnmapBuffer"),0;var b=Ce[Kg(a)];if(!b||!b.hj)return X(1282),l("buffer was never mapped in glUnmapBuffer"),0;b.Fk&16||(2<=S.version?T.bufferSubData(a,b.offset,v,b.hj,b.length):T.bufferSubData(a,b.offset,v.subarray(b.hj,b.hj+b.length)));ca(b.hj);b.hj=0;return 1},le:Uh,ke:a=>
{T.validateProgram(W[a])},je:function(a,b){T.vertexAttrib1f(a,b)},ie:(a,b)=>{T.vertexAttrib1f(a,I[b>>2])},he:function(a,b,c){T.vertexAttrib2f(a,b,c)},ge:(a,b)=>{T.vertexAttrib2f(a,I[b>>2],I[b+4>>2])},fe:function(a,b,c,d){T.vertexAttrib3f(a,b,c,d)},ee:(a,b)=>{T.vertexAttrib3f(a,I[b>>2],I[b+4>>2],I[b+8>>2])},de:function(a,b,c,d,e){T.vertexAttrib4f(a,b,c,d,e)},ce:(a,b)=>{T.vertexAttrib4f(a,I[b>>2],I[b+4>>2],I[b+8>>2],I[b+12>>2])},oc:Vh,Kg:Vh,Zb:Vh,$d:Vh,_b:Vh,hd:function(a,b,c,d,e){T.vertexAttribI4i(a,
b,c,d,e)},fd:(a,b)=>{T.vertexAttribI4i(a,F[b>>2],F[b+4>>2],F[b+8>>2],F[b+12>>2])},gd:function(a,b,c,d,e){T.vertexAttribI4ui(a,b,c,d,e)},ed:(a,b)=>{T.vertexAttribI4ui(a,H[b>>2],H[b+4>>2],H[b+8>>2],H[b+12>>2])},kd:(a,b,c,d,e)=>{var f=S.kj[a];T.zj?(f.Gj=!1,T.vertexAttribIPointer(a,b,c,d,e)):(f.size=b,f.type=c,f.pk=!1,f.Yj=d,f.Ij=e,f.Gj=!0,f.Dk=function(g,h,n,p,q,u){this.vertexAttribIPointer(g,h,n,q,u)})},be:Wh,ae:Xh,Dc:(a,b,c,d)=>{T.waitSync(Le[a],b,(c>>>0)+4294967296*d)},oa:()=>0,fh:()=>!ab,Sb:(a,b,
c)=>v.copyWithin(a,b,b+c),Eh:(a,b)=>{function c(d){N(a)(d,b)&&requestAnimationFrame(c)}return requestAnimationFrame(c)},hh:(a,b,c)=>Yh(a,{wk:F[c>>2],dk:F[c+4>>2],ql:F[c+8>>2],ll:b,Oj:F[c+12>>2],Jk:F[c+16>>2]}),ka:(a,b)=>{a=If(a);return a?a.requestPointerLock?mf()?Tf(a):b?(kf(Tf,2,[a]),1):-2:-1:-4},Eb:a=>{var b=v.length;a>>>=0;if(2147483648<a)return!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);a:{e=(e.min.call(e,2147483648,d+(65536-d%65536)%65536)-
mb.buffer.byteLength+65535)/65536;try{mb.grow(e);sb();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},Za:()=>(uf=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():null)?0:-1,Qa:(a,b,c)=>"undefined"==typeof onbeforeunload?-1:1!==c?-5:Zh(a,b),M:(a,b,c,d)=>$h(a,b,c,d,12,"blur"),t:Nf,la:(a,b,c)=>{a=If(a);if(!a)return-4;a.style.width=b+"px";a.style.height=c+"px";return 0},N:(a,b,c,d)=>$h(a,b,c,d,13,"focus"),na:(a,b,c,d)=>{if(!sf())return-1;
a=If(a);if(!a)return-4;ai(a,b,c,d,"webkitfullscreenchange");return ai(a,b,c,d,"fullscreenchange")},Xa:(a,b,c)=>navigator.getGamepads||navigator.webkitGetGamepads?bi(a,b,c,26,"gamepadconnected"):-1,Wa:(a,b,c)=>navigator.getGamepads||navigator.webkitGetGamepads?bi(a,b,c,27,"gamepaddisconnected"):-1,Dh:(a,b,c)=>setInterval(()=>{Qd(()=>N(a)(c))},b),U:(a,b,c,d)=>ci(a,b,c,d,2,"keydown"),ma:(a,b,c,d)=>ci(a,b,c,d,1,"keypress"),T:(a,b,c,d)=>ci(a,b,c,d,3,"keyup"),S:(a,b,c,d)=>ei(a,b,c,d,5,"mousedown"),Ua:(a,
b,c,d)=>ei(a,b,c,d,33,"mouseenter"),Ta:(a,b,c,d)=>ei(a,b,c,d,34,"mouseleave"),Q:(a,b,c,d)=>ei(a,b,c,d,8,"mousemove"),Gh:(a,b,c,d)=>ei(a,b,c,d,35,"mouseover"),R:(a,b,c,d)=>ei(a,b,c,d,6,"mouseup"),O:(a,b,c,d)=>{if(!document||!document.body||!(document.body.requestPointerLock||document.body.ck||document.body.Wl||document.body.Ul))return-1;a=If(a);if(!a)return-4;fi(a,b,c,d,"mozpointerlockchange");fi(a,b,c,d,"webkitpointerlockchange");fi(a,b,c,d,"mspointerlockchange");return fi(a,b,c,d,"pointerlockchange")},
Sa:(a,b,c,d)=>gi(a,b,c,d),I:(a,b,c,d)=>hi(a,b,c,d,25,"touchcancel"),K:(a,b,c,d)=>hi(a,b,c,d,23,"touchend"),J:(a,b,c,d)=>hi(a,b,c,d,24,"touchmove"),L:(a,b,c,d)=>hi(a,b,c,d,22,"touchstart"),Ra:(a,b,c)=>Hf[1]?ii(a,b,c):-4,Lh:(a,b,c,d)=>{ji(a,b,c,d,31,"webglcontextlost");return 0},Jh:(a,b,c,d)=>{ji(a,b,c,d,32,"webglcontextrestored");return 0},P:(a,b,c,d)=>(a=If(a))?"undefined"!=typeof a.onwheel?ki(a,b,c,d):-1:-4,ih:a=>document.title=a?x(v,a):"",o:()=>{throw"Please compile your program with async support in order to use asynchronous operations like emscripten_sleep";
},eh:function(a,b,c,d,e){function f(Q){w?Q():Qd(Q)}var g=a+112,h=H[g+36>>2],n=H[g+40>>2],p=H[g+44>>2],q=H[g+48>>2],u=H[g+52>>2],w=!!(u&64),r=Q=>{f(()=>{h?N(h)(Q):b&&b(Q)})},B=Q=>{f(()=>{p?N(p)(Q):d&&d(Q)})},y=Q=>{f(()=>{n?N(n)(Q):c&&c(Q)})},G=Q=>{f(()=>{q?N(q)(Q):e&&e(Q)})},L=Q=>{oi(Q,r,y,B,G)},O=(Q,Wc)=>{pi(Q,Wc.response,ac=>{f(()=>{h?N(h)(ac):b&&b(ac)})},ac=>{f(()=>{h?N(h)(ac):b&&b(ac)})})},A=Q=>{oi(Q,O,y,B,G)},P=td(g+0),U=!!(u&16),ha=!!(u&4);u=!!(u&32);if("EM_IDB_STORE"===P)L=H[g+84>>2],pi(a,v.slice(L,
L+H[g+88>>2]),r,y);else if("EM_IDB_DELETE"===P)ri(a,r,y);else if(U){if(u)return 0;oi(a,ha?O:r,y,B,G)}else qi(a,r,u?y:ha?A:L);return a},Qh:(a,b)=>{b>>=2;b={alpha:!!F[b],depth:!!F[b+1],stencil:!!F[b+2],antialias:!!F[b+3],premultipliedAlpha:!!F[b+4],preserveDrawingBuffer:!!F[b+5],powerPreference:si[F[b+6]],failIfMajorPerformanceCaveat:!!F[b+7],Pj:F[b+8],Dl:F[b+9],gk:F[b+10],pl:F[b+11],pm:F[b+12],qm:F[b+13]};a=If(a);return!a||b.pl?0:ce(a,b)},Ph:(a,b)=>{a=de[a];b=b?x(v,b):"";b.startsWith("GL_")&&(b=b.substr(3));
"ANGLE_instanced_arrays"==b&&ve(T);"OES_vertex_array_object"==b&&we(T);"WEBGL_draw_buffers"==b&&xe(T);"WEBGL_draw_instanced_base_vertex_base_instance"==b&&ye(T);"WEBGL_multi_draw_instanced_base_vertex_base_instance"==b&&ze(T);"WEBGL_multi_draw"==b&&(T.El=T.getExtension("WEBGL_multi_draw"));return!!a.Zi.getExtension(b)},Hh:(a,b)=>{if(!b)return-5;a=de[a];if(!a)return-3;var c=a.Zi;if(!c)return-3;c=c.getContextAttributes();F[b>>2]=c.alpha;F[b+4>>2]=c.depth;F[b+8>>2]=c.stencil;F[b+12>>2]=c.antialias;F[b+
16>>2]=c.premultipliedAlpha;F[b+20>>2]=c.preserveDrawingBuffer;F[b+24>>2]=c.powerPreference&&si.indexOf(c.powerPreference);F[b+28>>2]=c.failIfMajorPerformanceCaveat;F[b+32>>2]=a.version;F[b+36>>2]=0;F[b+40>>2]=a.attributes.gk;return 0},Ih:()=>S?S.handle:0,Mh:a=>{a>>=2;for(var b=0;14>b;++b)F[a+b]=0;F[a]=F[a+1]=F[a+3]=F[a+4]=F[a+8]=F[a+10]=1},Oh:a=>ee(a)?0:-5,pa:a=>{var b=ti[a];if(!b)return-3;b.onopen=b.onerror=b.onclose=b.onmessage=null;delete ti[a];return 0},Ch:()=>"undefined"!=typeof WebSocket,Ba:a=>
{if("undefined"==typeof WebSocket)return-1;if(!a)return-5;var b=a>>2;a=td(F[b]);a=(b=F[b+1])?new WebSocket(a,(b?x(v,b):"").split(",")):new WebSocket(a);a.binaryType="arraybuffer";b=ti.length;ti[b]=a;return b},_a:(a,b,c)=>{a=ti[a];if(!a)return-3;a.send(v.subarray(b,b+c));return 0},Kh:(a,b)=>{a=ti[a];if(!a)return-3;b=b?x(v,b):"";a.send(b);return 0},qa:(a,b,c)=>{ui||(ui=m(1024));var d=ti[a];if(!d)return-3;d.onclose=function(e){H[ui>>2]=a;H[ui+4>>2]=e.wasClean;H[ui+8>>2]=e.code;t(e.reason,v,ui+10,512);
N(c)(0,ui,b)};return 0},ta:(a,b,c)=>{ui||(ui=m(1024));var d=ti[a];if(!d)return-3;d.onerror=function(){H[ui>>2]=a;N(c)(0,ui,b)};return 0},ya:(a,b,c)=>{ui||(ui=m(1024));var d=ti[a];if(!d)return-3;d.onmessage=function(e){H[ui>>2]=a;if("string"==typeof e.data){var f=z(e.data),g=aa(e.data)+1;H[ui+12>>2]=1}else g=e.data.byteLength,f=m(g),E.set(new Uint8Array(e.data),f),H[ui+12>>2]=0;H[ui+4>>2]=f;H[ui+8>>2]=g;N(c)(0,ui,b);ca(f)};return 0},Aa:(a,b,c)=>{ui||(ui=m(1024));var d=ti[a];if(!d)return-3;d.onopen=
function(){H[ui>>2]=a;N(c)(0,ui,b)};return 0},Mb:(a,b)=>{var c=0;xi().forEach((d,e)=>{var f=b+c;e=H[a+4*e>>2]=f;for(f=0;f<d.length;++f)E[e++>>0]=d.charCodeAt(f);E[e>>0]=0;c+=d.length+1});return 0},Nb:(a,b)=>{var c=xi();H[a>>2]=c.length;var d=0;c.forEach(e=>d+=e.length+1);H[b>>2]=d;return 0},b:Ud,F:function(a){try{var b=Yc(a);hd(b);return 0}catch(c){if("undefined"==typeof sd||"ErrnoError"!==c.name)throw c;return c.Pi}},Ha:function(a,b,c,d){try{a:{var e=Yc(a);a=b;for(var f,g=b=0;g<c;g++){var h=H[a>>
2],n=H[a+4>>2];a+=8;var p=e,q=h,u=n,w=f,r=E;if(0>u||0>w)throw new R(28);if(null===p.fd)throw new R(8);if(1===(p.flags&2097155))throw new R(8);if(D(p.node.mode))throw new R(31);if(!p.Ni.read)throw new R(28);var B="undefined"!=typeof w;if(!B)w=p.position;else if(!p.seekable)throw new R(70);var y=p.Ni.read(p,r,q,u,w);B||(p.position+=y);var G=y;if(0>G){var L=-1;break a}b+=G;if(G<n)break;"undefined"!==typeof f&&(f+=G)}L=b}H[d>>2]=L;return 0}catch(O){if("undefined"==typeof sd||"ErrnoError"!==O.name)throw O;
return O.Pi}},Cb:function(a,b,c,d,e){b=c+2097152>>>0<4194305-!!b?(b>>>0)+4294967296*c:NaN;try{if(isNaN(b))return 61;var f=Yc(a);jd(f,b,d);K=[f.position>>>0,(J=f.position,1<=+Math.abs(J)?0<J?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];F[e>>2]=K[0];F[e+4>>2]=K[1];f.uj&&0===b&&0===d&&(f.uj=null);return 0}catch(g){if("undefined"==typeof sd||"ErrnoError"!==g.name)throw g;return g.Pi}},Ga:function(a,b,c,d){try{a:{var e=Yc(a);a=b;for(var f,g=b=0;g<c;g++){var h=H[a>>2],n=
H[a+4>>2];a+=8;var p=kd(e,E,h,n,f);if(0>p){var q=-1;break a}b+=p;"undefined"!==typeof f&&(f+=p)}q=b}H[d>>2]=q;return 0}catch(u){if("undefined"==typeof sd||"ErrnoError"!==u.name)throw u;return u.Pi}},ph:(a,b,c,d)=>{function e(u,w,r,B,y,G){var L=10===u?28:16;if(10===u)a:{var O="";var A,P=0,U=0,ha=0,Q=0;y=[y[0]&65535,y[0]>>16,y[1]&65535,y[1]>>16,y[2]&65535,y[2]>>16,y[3]&65535,y[3]>>16];var Wc=!0;for(A=0;5>A;A++)if(0!==y[A]){Wc=!1;break}if(Wc){A=Ei(y[6]|y[7]<<16);if(-1===y[5]){O="::ffff:"+A;break a}if(0===
y[5]){"0.0.0.0"===A&&(A="");"0.0.0.1"===A&&(A="1");O="::"+A;break a}}for(A=0;8>A;A++)0===y[A]&&(1<A-U&&(Q=0),U=A,Q++),Q>P&&(P=Q,ha=A-P+1);for(A=0;8>A;A++)1<P&&0===y[A]&&A>=ha&&A<ha+P?A===ha&&(O+=":",0===ha&&(O+=":")):(O+=Number(Oi(y[A]&65535)).toString(16),O+=7>A?":":"")}else O=Ei(y);y=O;L=m(L);a:{O=y;switch(u){case 2:O=yi(O);v.fill(0,L,L+16);pb[L>>1]=u;F[L+4>>2]=O;pb[L+2>>1]=zi(G);break;case 10:O=Ai(O);v.fill(0,L,L+28);F[L>>2]=u;F[L+8>>2]=O[0];F[L+12>>2]=O[1];F[L+16>>2]=O[2];F[L+20>>2]=O[3];pb[L+
2>>1]=zi(G);break;default:G=5;break a}G=0}!G||lb();G=m(32);F[G+4>>2]=u;F[G+8>>2]=w;F[G+12>>2]=r;H[G+24>>2]=B;H[G+20>>2]=L;F[G+16>>2]=10===u?28:16;F[G+28>>2]=0;return G}var f=0,g=0,h=0,n=0,p=0,q=0;c&&(h=F[c>>2],n=F[c+4>>2],p=F[c+8>>2],q=F[c+12>>2]);p&&!q&&(q=2===p?17:6);!p&&q&&(p=17===q?2:1);0===q&&(q=6);0===p&&(p=1);if(!a&&!b)return-2;if(h&-1088||0!==c&&F[c>>2]&2&&!a)return-1;if(h&32)return-2;if(0!==p&&1!==p&&2!==p)return-7;if(0!==n&&2!==n&&10!==n)return-6;if(b&&(b=b?x(v,b):"",g=parseInt(b,10),isNaN(g)))return h&
1024?-2:-8;if(!a)return 0===n&&(n=2),0===(h&1)&&(2===n?f=Pi(2130706433):f=[0,0,0,1]),a=e(n,p,q,null,f,g),H[d>>2]=a,0;a=a?x(v,a):"";f=yi(a);if(null!==f)if(0===n||2===n)n=2;else if(10===n&&h&8)f=[0,0,Pi(65535),f],n=10;else return-2;else if(f=Ai(a),null!==f)if(0===n||10===n)n=10;else return-2;if(null!=f)return a=e(n,p,q,a,f,g),H[d>>2]=a,0;if(h&4)return-2;a=Di(a);f=yi(a);0===n?n=2:10===n&&(f=[0,0,Pi(65535),f]);a=e(n,p,q,null,f,g);H[d>>2]=a;return 0},ga:Vf,ra:Wf,C:Xf,qb:Yf,z:Zf,c:$f,Ca:bg,Da:cg,D:dg,tb:eg,
pb:fg,E:gg,ca:hg,Ja:ig,$b:jg,$:kg,mb:lg,X:mg,jb:ng,ob:og,vb:pg,ea:qg,ua:rg,A:sg,w:tg,ia:ug,Ma:wg,Ea:xg,_e:yg,m:zg,sb:Ag,rb:Bg,n:Hg,r:Ig,G:Jg,va:Mg,s:Ng,xb:Og,ub:Qg,Ka:Rg,xa:Sg,g:Tg,V:Wg,v:Xg,Na:$g,Oa:ah,ja:ch,hb:dh,W:eh,lb:hh,sa:ih,l:jh,d:mh,ib:rh,La:sh,fa:vh,wa:wh,x:xh,nb:yh,Z:zh,wb:Ah,_:Bh,h:Ch,f:Dh,da:Eh,Y:Fh,gb:Hh,B:Ih,db:Kh,fb:Lh,cb:Mh,eb:Nh,bb:Oh,q:Ph,ab:Qh,$a:Rh,Sh,za:Th,kb:Uh,i:Wh,H:Xh,ha:Hi,Db:(a,b,c,d)=>Hi(a,b,c,d)},Z=function(){function a(c){Z=c.exports;mb=Z.Th;sb();Zb=Z.Wh;ub.unshift(Z.Uh);
Eb("wasm-instantiate");return Z}var b={a:Qi};Db("wasm-instantiate");if(k.instantiateWasm)try{return k.instantiateWasm(b,a)}catch(c){return l(`Module.instantiateWasm callback failed with error: ${c}`),!1}Mb(b,function(c){a(c.instance)});return{}}(),ba=k._memcpy=(a,b,c)=>(ba=k._memcpy=Z.Vh)(a,b,c),m=a=>(m=Z.Xh)(a),ca=a=>(ca=Z.Yh)(a),Mi=()=>(Mi=Z.Zh)(),zi=a=>(zi=Z._h)(a);k._chat_callback=(a,b)=>(k._chat_callback=Z.$h)(a,b);k._join_game_callback=a=>(k._join_game_callback=Z.ai)(a);
k._api_error_callback=(a,b)=>(k._api_error_callback=Z.bi)(a,b);k._create_game_callback=(a,b,c)=>(k._create_game_callback=Z.ci)(a,b,c);k._player_info_callback=(a,b,c,d,e,f)=>(k._player_info_callback=Z.di)(a,b,c,d,e,f);k._log_next_game_state=()=>(k._log_next_game_state=Z.ei)();k._start_game=()=>(k._start_game=Z.fi)();var Pi=a=>(Pi=Z.gi)(a),Oi=a=>(Oi=Z.hi)(a);k._wallpaper_update_config=a=>(k._wallpaper_update_config=Z.ii)(a);k._wallpaper_reset_config=()=>(k._wallpaper_reset_config=Z.ji)();
k._wallpaper_update_subscription_data=a=>(k._wallpaper_update_subscription_data=Z.ki)(a);k._video_playback_started=()=>(k._video_playback_started=Z.li)();k._video_playback_ended=()=>(k._video_playback_ended=Z.mi)();k._post_video_upload_callback=a=>(k._post_video_upload_callback=Z.ni)(a);k._GXC_FSSyncCompleted=()=>(k._GXC_FSSyncCompleted=Z.oi)();k._on_post_message_callback=(a,b)=>(k._on_post_message_callback=Z.pi)(a,b);
k._on_orientation_update_callback=(a,b,c)=>(k._on_orientation_update_callback=Z.qi)(a,b,c);k._on_request_permission_callback=(a,b)=>(k._on_request_permission_callback=Z.ri)(a,b);k._YYSum=(a,b)=>(k._YYSum=Z.si)(a,b);var Ri=k._main=(a,b)=>(Ri=k._main=Z.ti)(a,b);k._FSSyncCompleted=()=>(k._FSSyncCompleted=Z.ui)();var Fb=()=>(Fb=Z.vi)(),Ni=a=>(Ni=Z.wi)(a),bf=()=>(bf=Z.xi)(),cf=a=>(cf=Z.yi)(a),Kf=a=>(Kf=Z.zi)(a);k.dynCall_viij=(a,b,c,d,e)=>(k.dynCall_viij=Z.Ai)(a,b,c,d,e);
k.dynCall_vij=(a,b,c,d)=>(k.dynCall_vij=Z.Bi)(a,b,c,d);k.dynCall_iiiiiij=(a,b,c,d,e,f,g,h)=>(k.dynCall_iiiiiij=Z.Ci)(a,b,c,d,e,f,g,h);k.dynCall_iiji=(a,b,c,d,e)=>(k.dynCall_iiji=Z.Di)(a,b,c,d,e);k.dynCall_jiji=(a,b,c,d,e)=>(k.dynCall_jiji=Z.Ei)(a,b,c,d,e);k.dynCall_ji=(a,b)=>(k.dynCall_ji=Z.Fi)(a,b);k.dynCall_viijii=(a,b,c,d,e,f,g)=>(k.dynCall_viijii=Z.Gi)(a,b,c,d,e,f,g);k.dynCall_iiiiij=(a,b,c,d,e,f,g)=>(k.dynCall_iiiiij=Z.Hi)(a,b,c,d,e,f,g);
k.dynCall_iiiiijj=(a,b,c,d,e,f,g,h,n)=>(k.dynCall_iiiiijj=Z.Ii)(a,b,c,d,e,f,g,h,n);k.dynCall_iiiiiijj=(a,b,c,d,e,f,g,h,n,p)=>(k.dynCall_iiiiiijj=Z.Ji)(a,b,c,d,e,f,g,h,n,p);k.addRunDependency=Db;k.removeRunDependency=Eb;k.FS_createPath=nd;k.FS_createLazyFile=rd;k.FS_createDevice=pd;k.dynCall=Ub;k.cwrap=(a,b,c,d)=>{var e=!c||c.every(f=>"number"===f||"boolean"===f);return"string"!==b&&e&&!d?k["_"+a]:function(){return Ob(a,b,c,arguments)}};k.getValue=Rb;k.FS_createPreloadedFile=Dc;
k.FS_createDataFile=Cc;k.FS_unlink=Va;var Si;Cb=function Ti(){Si||Ui();Si||(Cb=Ti)};function Vi(a=[]){var b=Ri;a.unshift(Ya);var c=a.length,d=Kf(4*(c+1)),e=d;a.forEach(g=>{H[e>>2]=Lf(g);e+=4});H[e>>2]=0;try{var f=b(c,d);Ud(f,!0)}catch(g){Sd(g)}}
function Ui(){var a=Xa;function b(){if(!Si&&(Si=!0,k.calledRun=!0,!nb)){yb=!0;k.noFSInit||md||(md=!0,ld(),k.stdin=k.stdin,k.stdout=k.stdout,k.stderr=k.stderr,k.stdin?pd("/dev","stdin",k.stdin):dd("/dev/tty","/dev/stdin"),k.stdout?pd("/dev","stdout",null,k.stdout):dd("/dev/tty","/dev/stdout"),k.stderr?pd("/dev","stderr",null,k.stderr):dd("/dev/tty1","/dev/stderr"),fd("/dev/stdin",0),fd("/dev/stdout",1),fd("/dev/stderr",1));Kc=!1;Xb(ub);Xb(vb);if(k.onRuntimeInitialized)k.onRuntimeInitialized();Wi&&
Vi(a);if(k.postRun)for("function"==typeof k.postRun&&(k.postRun=[k.postRun]);k.postRun.length;){var c=k.postRun.shift();xb.unshift(c)}Xb(xb)}}if(!(0<Ab)){if(k.preRun)for("function"==typeof k.preRun&&(k.preRun=[k.preRun]);k.preRun.length;)zb();Xb(tb);0<Ab||(k.setStatus?(k.setStatus("Running..."),setTimeout(function(){setTimeout(function(){k.setStatus("")},1);b()},1)):b())}}if(k.preInit)for("function"==typeof k.preInit&&(k.preInit=[k.preInit]);0<k.preInit.length;)k.preInit.pop()();var Wi=!0;
k.noInitialRun&&(Wi=!1);Ui();
(function(){if("undefined"!=typeof window&&!window.Ki){webtransport_async_read=async d=>{try{let g=d.transport.datagrams.readable.getReader();for(var e=!1;!e;){var f;({value:f,done:e}=await g.read());d.Wj.push(f)}console.log("Closing WebTransport connection")}catch(g){console.error("Could not open channel to read datagrams, "+g)}};webtransport_async_connect=async(d,e)=>{try{await d.transport.ready;console.log("Connected successfully to relay.");try{d.sj=d.transport.datagrams.writable.getWriter()}catch(f){console.error("Could not open channel to send datagrams, "+f)}}catch(f){console.error("Connection failed to "+
e+", "+f)}d.transport.closed.then(()=>{d.sj=null;console.log("Connection to "+e+" closed gracefully")}).catch(()=>{d.sj=null;console.error("Connection to "+e+" closed abruptly")});webtransport_async_read(d)};class c{constructor(){this.sj=this.transport=null;this.Wj=[];this.url=""}destroy(){null!=this.transport&&this.transport&&(this.transport.close(),this.transport=null);this.sj=null}async connect(d,e){try{d.transport=new WebTransport(e)}catch(f){console.error("Failed to initialise WebTransport, "+
f)}await webtransport_async_connect(d,e)}async send(d,e){null==this.transport&&await this.connect(this,this.url);for(var f=10;!this.sj&&f;)await new Promise(n=>setTimeout(n,100)),f--;if(this.sj){d=k.HEAPU8.subarray(d,d+e);f=new ArrayBuffer(e);for(var g=new Uint8Array(f),h=0;h<e;h++)g[h]=d[h];this.sj.write(f)}else console.log("DatagramWriter is not initialized. Couldn't send message.")}Il(d,e){if(0==this.Wj.length)return-1;var f=this.Wj[0];this.Wj.shift();var g=f.length;if(g>e)return-1;d=k.HEAPU8.subarray(d,
d+g);for(e=0;e<g;e++)d[e]=f[e];return g}}var a=[],b=0;webtransport_set_relay=(d,e)=>{const f=b++;a[f]=new c;a[f].url=d+":"+e;return f};webtransport_send=(d,e,f)=>{a[d].send(e,f)};webtransport_receive=(d,e,f)=>a[d].Il(e,f);webtransport_destroy=d=>{a[d].destroy();a[d]=null}}})();
"undefined"!=typeof window&&(api_error_callback=k.cwrap("api_error_callback",null,["number","string"]),create_game_callback=k.cwrap("create_game_callback",null,["string","string","string"]),join_game_callback=k.cwrap("join_game_callback",null,["string"]),chat_callback=k.cwrap("chat_callback",null,["string","number"]),player_info_callback=k.cwrap("player_info_callback",null,"number string string string bool string".split(" ")),log_next_game_state=k.cwrap("log_next_game_state",null,[]),start_game=k.cwrap("start_game",
null,[]),init_request_parameters=a=>{var b={method:"POST",credentials:"include",headers:{}};b.headers["Content-Type"]="application/json;charset=UTF-8";b.headers["Access-Control-Allow-Credentials"]="true";b.body=JSON.stringify(a);return b},gxc_room_size=4,gxc_local_player=0,gxc_player_info=[],gxc_set_room_info=(a,b)=>{gxc_room_size=a;gxc_local_player=b},set_local_share_url=a=>{window.shareUrl=a;if(a=document.getElementById("share-button"))a.style.visibility="visible"},post_share_url=a=>{if(window.parent){var b=
{type:"share_url"};b.shareUrl=a;window.parent.postMessage(b,"*")}},gxc_request_room=(a,b,c,d,e,f)=>{var g=location.host.startsWith("localhost")||location.host.startsWith("test.vectorwars.gmx.dev");g&&(e="debug");console.log("Requesting "+c+"-player game with game-id "+e);var h={};h.region=b;h.roomSize=c;h.lateJoin=!!d;b=init_request_parameters(h);fetch("https://"+a+"/gg/games/"+e+"/rooms"+(f.length?"?trackId="+f:""),b).then(n=>{n.ok?n.json().then(p=>{var q=p.data.shareUrl,u=p.data.roomUrl;p=p.data.joinRoomUrl;
g?(q=location.protocol+"//"+location.host+location.pathname+"?game=debug&roomUrl="+u,set_local_share_url(q)):post_share_url(q);create_game_callback(p,q,u)}):n.json().then(p=>{if(window.parent){var q={type:"api_error"};q.error=p.errors[0].code;window.parent.postMessage(q,"*")}api_error_callback(n.status,p.errors[0].code)})})},gxc_join_room=(a,b,c,d)=>{console.log("Joining game '"+b+"' with track-id '"+c+"' on environment '"+a+"' using url "+d);var e={};"debug"!=b&&(e.gameId=b,e.trackId=c);e.roomUrl=
d;b=init_request_parameters(e);fetch("https://"+a+"/gg/rooms",b).then(f=>{f.ok?f.json().then(g=>{join_game_callback(g.data.roomUrl)}):f.json().then(g=>{if(window.parent){var h={type:"api_error"};h.error=g.errors[0].code;window.parent.postMessage(h,"*")}api_error_callback(f.status,g.errors[0].code)})});location.host.startsWith("localhost")||location.host.startsWith("test.vectorwars.gmx.dev")?set_local_share_url(window.location.href):post_share_url(window.location.href)},gxc_get_player_info=(a,b,c)=>
{console.log("Requesting player info.");var d={method:"GET",credentials:"include",headers:{}};d.headers["Content-Type"]="application/json;charset=UTF-8";d.headers["Access-Control-Allow-Credentials"]="true";let e="https://"+b+"/images/AvatarPlaceholder.png";fetch("https://"+a+"/gg/v2/rooms?roomUrl="+c,d).then(f=>{f.ok?f.json().then(g=>{gxc_player_info=g.data.players;gxc_player_info.forEach(h=>{null!==h.playerId&&(null===h.user.userId?(h.user.userId="",h.user.guest=!0):h.user.guest=!1,null===h.user.username&&
(h.user.username="unknown"),null===h.user.avatarUrl&&(h.user.avatarUrl=e))});window.parent&&(g={type:"players"},g.roomSize=gxc_room_size,g.local=gxc_local_player,g.players=gxc_player_info,window.parent.postMessage(g,"*"));gxc_player_info.forEach(h=>{null!==h.playerId&&player_info_callback(h.playerId,h.user.username,h.user.avatarUrl,h.status,h.user.guest,h.user.userId)})}):(404==f.status&&[0,1,2,3].forEach(g=>player_info_callback(g,"unknown",e,"JOINED",!0,"")),f.json().then(g=>console.log(g)))})},
gxc_set_player_status=(a,b)=>{gxc_player_info.forEach(d=>{d.playerId===a&&(d.status=b)});if(window.parent){var c={type:"players"};c.roomSize=gxc_room_size;c.local=gxc_local_player;c.players=gxc_player_info;window.parent.postMessage(c,"*")}},window.addEventListener("message",a=>{if(a&&a.data&&"parent_send_chat_message"==a.data.type){var b=a.data.ml;if(null===b||void 0===b)b=-1;chat_callback(a.data.content||"",b)}}),gxc_receive_chat_message=(a,b,c)=>{window.parent.postMessage({type:"receive_chat_message",
content:a,src:b,ml:c},"*")},gxc_report_status=a=>{window.parent.postMessage({type:"report_status",status:a},"*")});"undefined"!=typeof window&&(wallpaper_update_config=k.cwrap("wallpaper_update_config",null,["string"]),wallpaper_reset_config=k.cwrap("wallpaper_reset_config",null,["string"]),wallpaper_update_subscription_data=k.cwrap("wallpaper_update_subscription_data",null,["string"]));
