diff --git a/docs/cart/colorbars.null0 b/docs/cart/colorbars.null0 new file mode 100644 index 0000000..16d94f3 Binary files /dev/null and b/docs/cart/colorbars.null0 differ diff --git a/docs/cart/draw.null0 b/docs/cart/draw.null0 new file mode 100644 index 0000000..2be046b Binary files /dev/null and b/docs/cart/draw.null0 differ diff --git a/docs/cart/filesystem.null0 b/docs/cart/filesystem.null0 new file mode 100644 index 0000000..cf6cbfc Binary files /dev/null and b/docs/cart/filesystem.null0 differ diff --git a/docs/cart/flappybird.null0 b/docs/cart/flappybird.null0 new file mode 100644 index 0000000..4079784 Binary files /dev/null and b/docs/cart/flappybird.null0 differ diff --git a/docs/cart/hello.null0 b/docs/cart/hello.null0 new file mode 100644 index 0000000..ca73539 Binary files /dev/null and b/docs/cart/hello.null0 differ diff --git a/docs/cart/input.null0 b/docs/cart/input.null0 new file mode 100644 index 0000000..546e61a Binary files /dev/null and b/docs/cart/input.null0 differ diff --git a/docs/cart/justlog.null0 b/docs/cart/justlog.null0 new file mode 100644 index 0000000..412cd49 Binary files /dev/null and b/docs/cart/justlog.null0 differ diff --git a/docs/cart/sound.null0 b/docs/cart/sound.null0 new file mode 100644 index 0000000..d9d0db2 Binary files /dev/null and b/docs/cart/sound.null0 differ diff --git a/docs/cart/tracker.null0 b/docs/cart/tracker.null0 new file mode 100644 index 0000000..d5e7a51 Binary files /dev/null and b/docs/cart/tracker.null0 differ diff --git a/docs/index.html b/docs/index.html new file mode 100755 index 0000000..be52239 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,39 @@ + + + Null0 + + + + + + + +

Here are some example carts:

+ + + + + + + + + + diff --git a/web/null0.js b/docs/null0.js similarity index 95% rename from web/null0.js rename to docs/null0.js index 09953ab..aa56776 100755 --- a/web/null0.js +++ b/docs/null0.js @@ -1,4 +1,4 @@ -import loadCart from '@null0/wasm' +import loadCart from './wasm/null0.mjs' import wireCartToHost from './null0_wasm.js' export const Buttons = { @@ -16,6 +16,7 @@ export const Buttons = { RIGHT: 2 } +// get just the null0 wasm-host (emscripten) export async function getHost (cartUrl, canvas = document.body.appendChild(document.createElement('canvas'))) { const cartname = cartUrl.split('/').pop().split('.')[0] @@ -27,9 +28,24 @@ export async function getHost (cartUrl, canvas = document.body.appendChild(docum // for some reason it strips off .null0 arguments: [`/${cartname}`] }) + + // read a file from inside the cart + host.readCartFile = (filename) => { + const filenamePtr = host._malloc(filename.length + 1) + host.stringToUTF8(filename, filenamePtr, filename.length + 1) + const bytesHostPtr = host._malloc(4) + const retPtr = host._null0_file_read(filenamePtr, bytesHostPtr) + const r = host.HEAPU8.slice(retPtr, retPtr + host.HEAPU32[bytesHostPtr / 4]) + host._free(bytesHostPtr) + host._free(filenamePtr) + host._free(retPtr) + return r + } + return host } +// setup a cart with engine export async function setupCart (url, canvas = document.body.appendChild(document.createElement('canvas'))) { const host = await getHost(url, canvas) const out = { host } @@ -85,20 +101,7 @@ export async function setupCart (url, canvas = document.body.appendChild(documen } } - // read a file from loaded cart - function getCartFile(filename) { - const filenamePtr = host._malloc(filename.length + 1) - host.stringToUTF8(filename, filenamePtr, filename.length + 1) - const bytesHostPtr = host._malloc(4) - const retPtr = host._null0_file_read(filenamePtr, bytesHostPtr) - const r = host.HEAPU8.slice(retPtr, retPtr + host.HEAPU32[bytesHostPtr / 4]) - host._free(bytesHostPtr) - host._free(filenamePtr) - host._free(retPtr) - return r - } - - const wasmBytes = getCartFile('main.wasm') + const wasmBytes = host.readCartFile('main.wasm') const cartMod = await WebAssembly.compile(wasmBytes) const { exports } = await WebAssembly.instantiate(cartMod, imports) diff --git a/web/null0_wasm.js b/docs/null0_wasm.js similarity index 100% rename from web/null0_wasm.js rename to docs/null0_wasm.js diff --git a/docs/null0_wc.js b/docs/null0_wc.js new file mode 100644 index 0000000..a9b0efd --- /dev/null +++ b/docs/null0_wc.js @@ -0,0 +1,24 @@ +// this will setup the web-component + +import setupCart from './null0.js' + +export default class Null0WebComponent extends HTMLElement { + constructor() { + super() + this.shadow = this.attachShadow({ mode: 'open' }) + this.canvas = document.createElement('canvas') + this.shadow.appendChild(this.canvas) + + if (!this.attributes?.src?.value) { + throw new Error('src attribute is required, and should point to your cart URL.') + } + setupCart(this.attributes.src.value, this.canvas).then(({host, cart}) => { + this.host = host + this.cart = cart + }) + } +} + +document.addEventListener('DOMContentLoaded', () => { + window.customElements.define('null0-cart', Null0WebComponent) +}) \ No newline at end of file diff --git a/docs/wasm/null0.mjs b/docs/wasm/null0.mjs new file mode 100644 index 0000000..bbf3dda --- /dev/null +++ b/docs/wasm/null0.mjs @@ -0,0 +1,15 @@ + +var Module = (() => { + var _scriptDir = import.meta.url; + + return ( +async function(moduleArg = {}) { + +var Module=moduleArg;var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary;if(ENVIRONMENT_IS_NODE){const{createRequire:createRequire}=await import("module");var require=createRequire(import.meta.url);var fs=require("fs");var nodePath=require("path");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/"}else{scriptDirectory=require("url").fileURLToPath(new URL("./",import.meta.url))}read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror,binary=true)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?undefined:"utf8",(err,data)=>{if(err)onerror(err);else onload(binary?data.buffer:data)})};if(!Module["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.startsWith("blob:")){scriptDirectory=""}else{scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;Module["monitorRunDependencies"]?.(runDependencies)}function removeRunDependency(id){runDependencies--;Module["monitorRunDependencies"]?.(runDependencies);if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";var isDataURI=filename=>filename.startsWith(dataURIPrefix);var isFileURI=filename=>filename.startsWith("file://");var wasmBinaryFile;if(Module["locateFile"]){wasmBinaryFile="null0.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}}else{wasmBinaryFile=new URL("null0.wasm",import.meta.url).href}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(binaryFile)){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{if(!response["ok"]){throw`failed to load wasm binary file at '${binaryFile}'`}return response["arrayBuffer"]()}).catch(()=>getBinarySync(binaryFile))}else if(readAsync){return new Promise((resolve,reject)=>{readAsync(binaryFile,response=>resolve(new Uint8Array(response)),reject)})}}return Promise.resolve().then(()=>getBinarySync(binaryFile))}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(binary=>WebAssembly.instantiate(binary,imports)).then(receiver,reason=>{err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)})}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback)})})}return instantiateArrayBuffer(binaryFile,imports,callback)}function createWasm(){var info={"a":wasmImports};function receiveInstance(instance,module){wasmExports=instance.exports;wasmMemory=wasmExports["Y"];updateMemoryViews();wasmTable=wasmExports["lc"];addOnInit(wasmExports["Z"]);removeRunDependency("wasm-instantiate");return wasmExports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);readyPromiseReject(e)}}instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult).catch(readyPromiseReject);return{}}var tempDouble;var tempI64;function emscripten_clipboard__register(clipboard,text,text_size){function emscripten_clipboard__change_event(e){const newText=e.clipboardData.getData("text/plain");let i;for(i=0;i{if(error.name==="NotAllowedError"){setTimeout(function(){pntr_play_sound(sound,loop)},500)}})}}function pntr_stop_sound(sound){const audio=Module.pntr_sounds[sound-1];if(audio){audio.pause();audio.currentTime=0}}function pntr_unload_sound(sound){const audio=Module.pntr_sounds[sound-1];if(audio){audio.pause();audio.currentTime=0;URL.revokeObjectURL(audio.src)}}function pntr_app_platform_set_size(app,width,height){Module.canvas.width=width;Module.canvas.height=height;Module.ctx=Module.canvas.getContext("2d");Module.screen=Module.ctx.getImageData(0,0,width,height);specialHTMLTargets["!canvas"]=Module.canvas;return true}function pntr_app_platform_get_width(app){return Module.canvas.width}function pntr_app_platform_get_height(app){return Module.canvas.height}function pntr_app_platform_render_js(data,dataSize,width,height){Module.screen.data.set(HEAPU8.subarray(data,data+dataSize));Module.ctx.putImageData(Module.screen,0,0)}function pntr_app_emscripten_init_filedropped(app){const stringToNewUTF8Local=s=>{const buff_ptr=Module._pntr_app_emscripten_load_memory(s.length+1);Module.HEAPU8.set((new TextEncoder).encode(s+"\0"),buff_ptr);return buff_ptr};Module.canvas.addEventListener("dragover",e=>e.preventDefault());Module.canvas.addEventListener("drop",e=>{e.preventDefault();for(const file of e.dataTransfer.files){const reader=new FileReader;reader.addEventListener("load",e=>{const bytes=new Uint8Array(event.target.result);const data_ptr=Module._pntr_app_emscripten_load_memory(bytes.byteLength);Module.HEAPU8.set(bytes,data_ptr);Module._pntr_app_emscripten_file_dropped(app,stringToNewUTF8Local(file.name),data_ptr,bytes.byteLength);Module._pntr_app_emscripten_unload_memory(data_ptr)});reader.readAsArrayBuffer(file)}})}function pntr_app_emscripten_get_time(){return performance.now()}function ExitStatus(status){this.name="ExitStatus";this.message=`Program terminated with exit(${status})`;this.status=status}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var noExitRuntime=Module["noExitRuntime"]||true;var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:path=>{if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},join:(...paths)=>PATH.normalize(paths.join("/")),join2:(l,r)=>PATH.normalize(l+"/"+r)};var initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto["getRandomValues"]=="function"){return view=>crypto.getRandomValues(view)}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");var randomFillSync=crypto_module["randomFillSync"];if(randomFillSync){return view=>crypto_module["randomFillSync"](view)}var randomBytes=crypto_module["randomBytes"];return view=>(view.set(randomBytes(view.byteLength)),view)}catch(e){}}abort("initRandomDevice")};var randomFill=view=>(randomFill=initRandomFill())(view);var PATH_FS={resolve:(...args)=>{var resolvedPath="",resolvedAbsolute=false;for(var i=args.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?args[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx>10,56320|ch&1023)}}return str};var FS_stdin_getChar_buffer=[];var lengthBytesUTF8=str=>{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx};function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;try{bytesRead=fs.readSync(fd,buf)}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}FS_stdin_getChar_buffer=intArrayFromString(result,true)}return FS_stdin_getChar_buffer.shift()};var TTY={ttys:[],init(){},shutdown(){},register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)},stream_ops:{open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43)}stream.tty=tty;stream.seekable=false},close(stream){stream.tty.ops.fsync(stream.tty)},fsync(stream){stream.tty.ops.fsync(stream.tty)},read(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60)}var bytesRead=0;for(var i=0;i0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}},ioctl_tcgets(tty){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[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]}},ioctl_tcsets(tty,optional_actions,data){return 0},ioctl_tiocgwinsz(tty){return[24,80]}},default_tty1_ops:{put_char(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},fsync(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};var mmapAlloc=size=>{abort()};var MEMFS={ops_table:null,mount(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}MEMFS.ops_table||={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}};var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp}return node},getFileDataAsTypedArray(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)},expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup(parent,name){throw FS.genericErrors[44]},mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir(node){var entries=[".",".."];for(var key of Object.keys(node.contents)){entries.push(key)}return entries},symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length{var dep=!noRunDep?getUniqueRunDependency(`al ${url}`):"";readAsync(url,arrayBuffer=>{onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)},event=>{if(onerror){onerror()}else{throw`Loading data file "${url}" failed.`}});if(dep)addRunDependency(dep)};var FS_createDataFile=(parent,name,fileData,canRead,canWrite,canOwn)=>{FS.createDataFile(parent,name,fileData,canRead,canWrite,canOwn)};var preloadPlugins=Module["preloadPlugins"]||[];var FS_handledByPreloadPlugin=(byteArray,fullname,finish,onerror)=>{if(typeof Browser!="undefined")Browser.init();var handled=false;preloadPlugins.forEach(plugin=>{if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,onerror);handled=true}});return handled};var FS_createPreloadedFile=(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)=>{var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency(`cp ${fullname}`);function processData(byteArray){function finish(byteArray){preFinish?.();if(!dontCreateFile){FS_createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}onload?.();removeRunDependency(dep)}if(FS_handledByPreloadPlugin(byteArray,fullname,finish,()=>{onerror?.();removeRunDependency(dep)})){return}finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,processData,onerror)}else{processData(url)}};var FS_modeStringToFlags=str=>{var flagModes={"r":0,"r+":2,"w":512|64|1,"w+":512|64|2,"a":1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error(`Unknown file open mode: ${str}`)}return flags};var FS_getMode=(canRead,canWrite)=>{var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:class{constructor(errno){this.name="ErrnoError";this.errno=errno}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(val){this.node=val}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(val){this.shared.flags=val}get position(){return this.shared.position}set position(val){this.shared.position=val}},FSNode:class{constructor(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev;this.readMode=292|73;this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(val){val?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(val){val?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(path,opts={}){path=PATH_FS.resolve(path);if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};opts=Object.assign(defaults,opts);if(opts.recurse_count>8){throw new FS.ErrnoError(32)}var parts=path.split("/").filter(p=>!!p);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?`${mount}/${path}`:mount+path}path=path?`${node.name}/${path}`:node.name;node=node.parent}},hashName(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode(node){FS.hashRemoveNode(node)},isRoot(node){return node===node.parent},isMountpoint(node){return!!node.mounted},isFile(mode){return(mode&61440)===32768},isDir(mode){return(mode&61440)===16384},isLink(mode){return(mode&61440)===40960},isChrdev(mode){return(mode&61440)===8192},isBlkdev(mode){return(mode&61440)===24576},isFIFO(mode){return(mode&61440)===4096},isSocket(mode){return(mode&49152)===49152},flagsToPermissionString(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup(dir){if(!FS.isDir(dir.mode))return 54;var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStreamChecked(fd){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8)}return stream},getStream:fd=>FS.streams[fd],createStream(stream,fd=-1){stream=Object.assign(new FS.FSStream,stream);if(fd==-1){fd=FS.nextfd()}stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream(fd){FS.streams[fd]=null},dupStream(origStream,fd=-1){var stream=FS.createStream(origStream,fd);stream.stream_ops?.dup?.(stream);return stream},chrdev_stream_ops:{open(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;stream.stream_ops.open?.(stream)},llseek(){throw new FS.ErrnoError(70)}},major:dev=>dev>>8,minor:dev=>dev&255,makedev:(ma,mi)=>ma<<8|mi,registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:dev=>FS.devices[dev],getMounts(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push(...m.mounts)}return mounts},syncfs(populate,callback){if(typeof populate=="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`)}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(mount=>{if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(hash=>{var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup(parent,name){return parent.node_ops.lookup(parent,name)},mknod(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree(path,mode){var dirs=path.split("/");var d="";for(var i=0;iFS.currentPath,chdir(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44)}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54)}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode)}FS.currentPath=lookup.path},createDefaultDirectories(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(stream,buffer,offset,length,pos)=>length});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=()=>{if(randomLeft===0){randomLeft=randomFill(randomBuffer).byteLength}return randomBuffer[--randomLeft]};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount(){var node=FS.createNode(proc_self,"fd",16384|511,73);node.node_ops={lookup(parent,name){var fd=+name;var stream=FS.getStreamChecked(fd);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>stream.path}};ret.parent=ret;return ret}};return node}},{},"/proc/self/fd")},createStandardStreams(){if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1)},staticInit(){[44].forEach(code=>{FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack=""});FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS}},init(input,output,error){FS.init.initialized=true;Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()},quit(){FS.init.initialized=false;for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]}setDataGetter(getter){this.getter=getter}cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(from,to)=>{if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}return intArrayFromString(xhr.responseText||"",true)};var lazyArray=this;lazyArray.setDataGetter(chunkNum=>{var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]=="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true}get length(){if(!this.lengthKnown){this.cacheLength()}return this._length}get chunkSize(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(key=>{var fn=node.stream_ops[key];stream_ops[key]=(...args)=>{FS.forceLoadFile(node);return fn(...args)}});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i{FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position)};stream_ops.mmap=(stream,length,position,prot,flags)=>{FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48)}writeChunks(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true}};node.stream_ops=stream_ops;return node}};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path}var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44)}return dir}return PATH.join2(dir,path)},doStat(func,path,buf){var stat=func(path);HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=stat.mode;HEAPU32[buf+8>>2]=stat.nlink;HEAP32[buf+12>>2]=stat.uid;HEAP32[buf+16>>2]=stat.gid;HEAP32[buf+20>>2]=stat.rdev;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+24>>2]=tempI64[0],HEAP32[buf+28>>2]=tempI64[1];HEAP32[buf+32>>2]=4096;HEAP32[buf+36>>2]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();tempI64=[Math.floor(atime/1e3)>>>0,(tempDouble=Math.floor(atime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAPU32[buf+48>>2]=atime%1e3*1e3;tempI64=[Math.floor(mtime/1e3)>>>0,(tempDouble=Math.floor(mtime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+56>>2]=tempI64[0],HEAP32[buf+60>>2]=tempI64[1];HEAPU32[buf+64>>2]=mtime%1e3*1e3;tempI64=[Math.floor(ctime/1e3)>>>0,(tempDouble=Math.floor(ctime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+72>>2]=tempI64[0],HEAP32[buf+76>>2]=tempI64[1];HEAPU32[buf+80>>2]=ctime%1e3*1e3;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+88>>2]=tempI64[0],HEAP32[buf+92>>2]=tempI64[1];return 0},doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43)}if(flags&2){return 0}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},varargs:undefined,get(){var ret=HEAP32[+SYSCALLS.varargs>>2];SYSCALLS.varargs+=4;return ret},getp(){return SYSCALLS.get()},getStr(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD(fd){var stream=FS.getStreamChecked(fd);return stream}};function ___syscall_faccessat(dirfd,path,amode,flags){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(amode&~7){return-28}var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}while(FS.streams[arg]){arg++}var newStream;newStream=FS.dupStream(stream,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.getp();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0}return-28}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_fstat64(fd,buf){try{var stream=SYSCALLS.getStreamFromFD(fd);return SYSCALLS.doStat(FS.stat,stream.path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);function ___syscall_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);stream.getdents||=FS.readdir(stream.path);var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_lstat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.lstat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_mkdirat(dirfd,path,mode){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_newfstatat(dirfd,path,buf,flags){try{path=SYSCALLS.getStr(path);var nofollow=flags&256;var allowEmpty=flags&4096;flags=flags&~6400;path=SYSCALLS.calculateAt(dirfd,path,allowEmpty);return SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_openat(dirfd,path,flags,varargs){SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?SYSCALLS.get():0;return FS.open(path,flags,mode).fd}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_readlinkat(dirfd,path,buf,bufsize){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_rmdir(path){try{path=SYSCALLS.getStr(path);FS.rmdir(path);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}function ___syscall_unlinkat(dirfd,path,flags){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(flags===0){FS.unlink(path)}else if(flags===512){FS.rmdir(path)}else{abort("Invalid flags passed to unlinkat")}return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno}}var nowIsMonotonic=1;var __emscripten_get_now_is_monotonic=()=>nowIsMonotonic;var isLeapYear=year=>year%4===0&&(year%100!==0||year%400===0);var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];var ydayFromDate=date=>{var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday};var convertI32PairToI53Checked=(lo,hi)=>hi+2097152>>>0<4194305-!!lo?(lo>>>0)+hi*4294967296:NaN;var __mktime_js=function(tmPtr){var ret=(()=>{var date=new Date(HEAP32[tmPtr+20>>2]+1900,HEAP32[tmPtr+16>>2],HEAP32[tmPtr+12>>2],HEAP32[tmPtr+8>>2],HEAP32[tmPtr+4>>2],HEAP32[tmPtr>>2],0);var dst=HEAP32[tmPtr+32>>2];var guessedOffset=date.getTimezoneOffset();var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dstOffset=Math.min(winterOffset,summerOffset);if(dst<0){HEAP32[tmPtr+32>>2]=Number(summerOffset!=winterOffset&&dstOffset==guessedOffset)}else if(dst>0!=(dstOffset==guessedOffset)){var nonDstOffset=Math.max(winterOffset,summerOffset);var trueOffset=dst>0?dstOffset:nonDstOffset;date.setTime(date.getTime()+(trueOffset-guessedOffset)*6e4)}HEAP32[tmPtr+24>>2]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getYear();var timeMs=date.getTime();if(isNaN(timeMs)){return-1}return timeMs/1e3})();return setTempRet0((tempDouble=ret,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)),ret>>>0};var __tzset_js=(timezone,daylight,std_name,dst_name)=>{var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU32[timezone>>2]=stdTimezoneOffset*60;HEAP32[daylight>>2]=Number(winterOffset!=summerOffset);function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);if(summerOffset{Browser.mainLoop.timingMode=mode;Browser.mainLoop.timingValue=value;if(!Browser.mainLoop.func){return 1}if(!Browser.mainLoop.running){Browser.mainLoop.running=true}if(mode==0){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setTimeout(){var timeUntilNextTick=Math.max(0,Browser.mainLoop.tickStartTime+value-_emscripten_get_now())|0;setTimeout(Browser.mainLoop.runner,timeUntilNextTick)};Browser.mainLoop.method="timeout"}else if(mode==1){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_rAF(){Browser.requestAnimationFrame(Browser.mainLoop.runner)};Browser.mainLoop.method="rAF"}else if(mode==2){if(typeof Browser.setImmediate=="undefined"){if(typeof setImmediate=="undefined"){var setImmediates=[];var emscriptenMainLoopMessageId="setimmediate";var Browser_setImmediate_messageHandler=event=>{if(event.data===emscriptenMainLoopMessageId||event.data.target===emscriptenMainLoopMessageId){event.stopPropagation();setImmediates.shift()()}};addEventListener("message",Browser_setImmediate_messageHandler,true);Browser.setImmediate=function Browser_emulated_setImmediate(func){setImmediates.push(func);if(ENVIRONMENT_IS_WORKER){if(Module["setImmediates"]===undefined)Module["setImmediates"]=[];Module["setImmediates"].push(func);postMessage({target:emscriptenMainLoopMessageId})}else postMessage(emscriptenMainLoopMessageId,"*")}}else{Browser.setImmediate=setImmediate}}Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setImmediate(){Browser.setImmediate(Browser.mainLoop.runner)};Browser.mainLoop.method="immediate"}return 0};var _emscripten_get_now;_emscripten_get_now=()=>performance.now();var setMainLoop=(browserIterationFunc,fps,simulateInfiniteLoop,arg,noSetTiming)=>{Browser.mainLoop.func=browserIterationFunc;Browser.mainLoop.arg=arg;var thisMainLoopId=Browser.mainLoop.currentlyRunningMainloop;function checkIsRunning(){if(thisMainLoopId0){var start=Date.now();var blocker=Browser.mainLoop.queue.shift();blocker.func(blocker.arg);if(Browser.mainLoop.remainingBlockers){var remaining=Browser.mainLoop.remainingBlockers;var next=remaining%1==0?remaining-1:Math.floor(remaining);if(blocker.counted){Browser.mainLoop.remainingBlockers=next}else{next=next+.5;Browser.mainLoop.remainingBlockers=(8*remaining+next)/9}}Browser.mainLoop.updateStatus();if(!checkIsRunning())return;setTimeout(Browser.mainLoop.runner,0);return}if(!checkIsRunning())return;Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0;if(Browser.mainLoop.timingMode==1&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else if(Browser.mainLoop.timingMode==0){Browser.mainLoop.tickStartTime=_emscripten_get_now()}Browser.mainLoop.runIter(browserIterationFunc);if(!checkIsRunning())return;if(typeof SDL=="object")SDL.audio?.queueNewAudioData?.();Browser.mainLoop.scheduler()};if(!noSetTiming){if(fps&&fps>0){_emscripten_set_main_loop_timing(0,1e3/fps)}else{_emscripten_set_main_loop_timing(1,1)}Browser.mainLoop.scheduler()}if(simulateInfiniteLoop){throw"unwind"}};var handleException=e=>{if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS}quit_(1,e)};var runtimeKeepaliveCounter=0;var keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0;var _proc_exit=code=>{EXITSTATUS=code;if(!keepRuntimeAlive()){Module["onExit"]?.(code);ABORT=true}quit_(code,new ExitStatus(code))};var exitJS=(status,implicit)=>{EXITSTATUS=status;_proc_exit(status)};var _exit=exitJS;var maybeExit=()=>{if(!keepRuntimeAlive()){try{_exit(EXITSTATUS)}catch(e){handleException(e)}}};var callUserCallback=func=>{if(ABORT){return}try{func();maybeExit()}catch(e){handleException(e)}};var safeSetTimeout=(func,timeout)=>setTimeout(()=>{callUserCallback(func)},timeout);var warnOnce=text=>{warnOnce.shown||={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;if(ENVIRONMENT_IS_NODE)text="warning: "+text;err(text)}};var Browser={mainLoop:{running:false,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){Browser.mainLoop.scheduler=null;Browser.mainLoop.currentlyRunningMainloop++},resume(){Browser.mainLoop.currentlyRunningMainloop++;var timingMode=Browser.mainLoop.timingMode;var timingValue=Browser.mainLoop.timingValue;var func=Browser.mainLoop.func;Browser.mainLoop.func=null;setMainLoop(func,0,false,Browser.mainLoop.arg,true);_emscripten_set_main_loop_timing(timingMode,timingValue);Browser.mainLoop.scheduler()},updateStatus(){if(Module["setStatus"]){var message=Module["statusMessage"]||"Please wait...";var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining{var canvas=document.createElement("canvas");canvas.width=img.width;canvas.height=img.height;var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0);preloadedImages[name]=canvas;URL.revokeObjectURL(url);onload?.(byteArray)};img.onerror=event=>{err(`Image ${url} could not be decoded`);onerror?.()};img.src=url};preloadPlugins.push(imagePlugin);var audioPlugin={};audioPlugin["canHandle"]=function audioPlugin_canHandle(name){return!Module.noAudioDecoding&&name.substr(-4)in{".ogg":1,".wav":1,".mp3":1}};audioPlugin["handle"]=function audioPlugin_handle(byteArray,name,onload,onerror){var done=false;function finish(audio){if(done)return;done=true;preloadedAudios[name]=audio;onload?.(byteArray)}var b=new Blob([byteArray],{type:Browser.getMimetype(name)});var url=URL.createObjectURL(b);var audio=new Audio;audio.addEventListener("canplaythrough",()=>finish(audio),false);audio.onerror=function audio_onerror(event){if(done)return;err(`warning: browser could not fully decode audio ${name}, trying slower base64 approach`);function encode64(data){var BASE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var PAD="=";var ret="";var leftchar=0;var leftbits=0;for(var i=0;i=6){var curr=leftchar>>leftbits-6&63;leftbits-=6;ret+=BASE[curr]}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD}else if(leftbits==4){ret+=BASE[(leftchar&15)<<2];ret+=PAD}return ret}audio.src="data:audio/x-"+name.substr(-3)+";base64,"+encode64(byteArray);finish(audio)};audio.src=url;safeSetTimeout(()=>{finish(audio)},1e4)};preloadPlugins.push(audioPlugin);function pointerLockChange(){Browser.pointerLock=document["pointerLockElement"]===Module["canvas"]||document["mozPointerLockElement"]===Module["canvas"]||document["webkitPointerLockElement"]===Module["canvas"]||document["msPointerLockElement"]===Module["canvas"]}var canvas=Module["canvas"];if(canvas){canvas.requestPointerLock=canvas["requestPointerLock"]||canvas["mozRequestPointerLock"]||canvas["webkitRequestPointerLock"]||canvas["msRequestPointerLock"]||(()=>{});canvas.exitPointerLock=document["exitPointerLock"]||document["mozExitPointerLock"]||document["webkitExitPointerLock"]||document["msExitPointerLock"]||(()=>{});canvas.exitPointerLock=canvas.exitPointerLock.bind(document);document.addEventListener("pointerlockchange",pointerLockChange,false);document.addEventListener("mozpointerlockchange",pointerLockChange,false);document.addEventListener("webkitpointerlockchange",pointerLockChange,false);document.addEventListener("mspointerlockchange",pointerLockChange,false);if(Module["elementPointerLock"]){canvas.addEventListener("click",ev=>{if(!Browser.pointerLock&&Module["canvas"].requestPointerLock){Module["canvas"].requestPointerLock();ev.preventDefault()}},false)}}},createContext(canvas,useWebGL,setInModule,webGLContextAttributes){if(useWebGL&&Module.ctx&&canvas==Module.canvas)return Module.ctx;var ctx;var contextHandle;if(useWebGL){var contextAttributes={antialias:false,alpha:false,majorVersion:1};if(webGLContextAttributes){for(var attribute in webGLContextAttributes){contextAttributes[attribute]=webGLContextAttributes[attribute]}}if(typeof GL!="undefined"){contextHandle=GL.createContext(canvas,contextAttributes);if(contextHandle){ctx=GL.getContext(contextHandle).GLctx}}}else{ctx=canvas.getContext("2d")}if(!ctx)return null;if(setInModule){Module.ctx=ctx;if(useWebGL)GL.makeContextCurrent(contextHandle);Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach(callback=>callback());Browser.init()}return ctx},destroyContext(canvas,useWebGL,setInModule){},fullscreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullscreen(lockPointer,resizeCanvas){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;if(typeof Browser.lockPointer=="undefined")Browser.lockPointer=true;if(typeof Browser.resizeCanvas=="undefined")Browser.resizeCanvas=false;var canvas=Module["canvas"];function fullscreenChange(){Browser.isFullscreen=false;var canvasContainer=canvas.parentNode;if((document["fullscreenElement"]||document["mozFullScreenElement"]||document["msFullscreenElement"]||document["webkitFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvasContainer){canvas.exitFullscreen=Browser.exitFullscreen;if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullscreen=true;if(Browser.resizeCanvas){Browser.setFullscreenCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}else{canvasContainer.parentNode.insertBefore(canvas,canvasContainer);canvasContainer.parentNode.removeChild(canvasContainer);if(Browser.resizeCanvas){Browser.setWindowedCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}Module["onFullScreen"]?.(Browser.isFullscreen);Module["onFullscreen"]?.(Browser.isFullscreen)}if(!Browser.fullscreenHandlersInstalled){Browser.fullscreenHandlersInstalled=true;document.addEventListener("fullscreenchange",fullscreenChange,false);document.addEventListener("mozfullscreenchange",fullscreenChange,false);document.addEventListener("webkitfullscreenchange",fullscreenChange,false);document.addEventListener("MSFullscreenChange",fullscreenChange,false)}var canvasContainer=document.createElement("div");canvas.parentNode.insertBefore(canvasContainer,canvas);canvasContainer.appendChild(canvas);canvasContainer.requestFullscreen=canvasContainer["requestFullscreen"]||canvasContainer["mozRequestFullScreen"]||canvasContainer["msRequestFullscreen"]||(canvasContainer["webkitRequestFullscreen"]?()=>canvasContainer["webkitRequestFullscreen"](Element["ALLOW_KEYBOARD_INPUT"]):null)||(canvasContainer["webkitRequestFullScreen"]?()=>canvasContainer["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"]):null);canvasContainer.requestFullscreen()},exitFullscreen(){if(!Browser.isFullscreen){return false}var CFS=document["exitFullscreen"]||document["cancelFullScreen"]||document["mozCancelFullScreen"]||document["msExitFullscreen"]||document["webkitCancelFullScreen"]||(()=>{});CFS.apply(document,[]);return true},nextRAF:0,fakeRequestAnimationFrame(func){var now=Date.now();if(Browser.nextRAF===0){Browser.nextRAF=now+1e3/60}else{while(now+2>=Browser.nextRAF){Browser.nextRAF+=1e3/60}}var delay=Math.max(Browser.nextRAF-now,0);setTimeout(func,delay)},requestAnimationFrame(func){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(func);return}var RAF=Browser.fakeRequestAnimationFrame;RAF(func)},safeSetTimeout(func,timeout){return safeSetTimeout(func,timeout)},safeRequestAnimationFrame(func){return Browser.requestAnimationFrame(()=>{callUserCallback(func)})},getMimetype(name){return{"jpg":"image/jpeg","jpeg":"image/jpeg","png":"image/png","bmp":"image/bmp","ogg":"audio/ogg","wav":"audio/wav","mp3":"audio/mpeg"}[name.substr(name.lastIndexOf(".")+1)]},getUserMedia(func){window.getUserMedia||=navigator["getUserMedia"]||navigator["mozGetUserMedia"];window.getUserMedia(func)},getMovementX(event){return event["movementX"]||event["mozMovementX"]||event["webkitMovementX"]||0},getMovementY(event){return event["movementY"]||event["mozMovementY"]||event["webkitMovementY"]||0},getMouseWheelDelta(event){var delta=0;switch(event.type){case"DOMMouseScroll":delta=event.detail/3;break;case"mousewheel":delta=event.wheelDelta/120;break;case"wheel":delta=event.deltaY;switch(event.deltaMode){case 0:delta/=100;break;case 1:delta/=3;break;case 2:delta*=80;break;default:throw"unrecognized mouse wheel delta mode: "+event.deltaMode}break;default:throw"unrecognized mouse wheel event: "+event.type}return delta},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseCoords(pageX,pageY){var rect=Module["canvas"].getBoundingClientRect();var cw=Module["canvas"].width;var ch=Module["canvas"].height;var scrollX=typeof window.scrollX!="undefined"?window.scrollX:window.pageXOffset;var scrollY=typeof window.scrollY!="undefined"?window.scrollY:window.pageYOffset;var adjustedX=pageX-(scrollX+rect.left);var adjustedY=pageY-(scrollY+rect.top);adjustedX=adjustedX*(cw/rect.width);adjustedY=adjustedY*(ch/rect.height);return{x:adjustedX,y:adjustedY}},setMouseCoords(pageX,pageY){const{x:x,y:y}=Browser.calculateMouseCoords(pageX,pageY);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y},calculateMouseEvent(event){if(Browser.pointerLock){if(event.type!="mousemove"&&"mozMovementX"in event){Browser.mouseMovementX=Browser.mouseMovementY=0}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event)}if(typeof SDL!="undefined"){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY}else{Browser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY}}else{if(event.type==="touchstart"||event.type==="touchend"||event.type==="touchmove"){var touch=event.touch;if(touch===undefined){return}var coords=Browser.calculateMouseCoords(touch.pageX,touch.pageY);if(event.type==="touchstart"){Browser.lastTouches[touch.identifier]=coords;Browser.touches[touch.identifier]=coords}else if(event.type==="touchend"||event.type==="touchmove"){var last=Browser.touches[touch.identifier];last||=coords;Browser.lastTouches[touch.identifier]=last;Browser.touches[touch.identifier]=coords}return}Browser.setMouseCoords(event.pageX,event.pageY)}},resizeListeners:[],updateResizeListeners(){var canvas=Module["canvas"];Browser.resizeListeners.forEach(listener=>listener(canvas.width,canvas.height))},setCanvasSize(width,height,noUpdates){var canvas=Module["canvas"];Browser.updateCanvasDimensions(canvas,width,height);if(!noUpdates)Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags|8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()},setWindowedCanvasSize(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags&~8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module["canvas"]);Browser.updateResizeListeners()},updateCanvasDimensions(canvas,wNative,hNative){if(wNative&&hNative){canvas.widthNative=wNative;canvas.heightNative=hNative}else{wNative=canvas.widthNative;hNative=canvas.heightNative}var w=wNative;var h=hNative;if(Module["forcedAspectRatio"]&&Module["forcedAspectRatio"]>0){if(w/h{Browser.mainLoop.pause();Browser.mainLoop.func=null};var _emscripten_console_error=str=>{console.error(UTF8ToString(str))};var _emscripten_date_now=()=>Date.now();var JSEvents={removeAllEventListeners(){while(JSEvents.eventHandlers.length){JSEvents._removeHandler(JSEvents.eventHandlers.length-1)}JSEvents.deferredCalls=[]},inEventHandler:0,deferredCalls:[],deferCall(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort((x,y)=>x.precedence{for(var i=0;i{HEAPF64[eventStruct>>3]=e.timestamp;for(var i=0;i>3]=e.axes[i]}for(var i=0;i>3]=e.buttons[i].value}else{HEAPF64[eventStruct+i*8+528>>3]=e.buttons[i]}}for(var i=0;i>2]=e.buttons[i].pressed}else{HEAP32[eventStruct+i*4+1040>>2]=e.buttons[i]==1}}HEAP32[eventStruct+1296>>2]=e.connected;HEAP32[eventStruct+1300>>2]=e.index;HEAP32[eventStruct+8>>2]=e.axes.length;HEAP32[eventStruct+12>>2]=e.buttons.length;stringToUTF8(e.id,eventStruct+1304,64);stringToUTF8(e.mapping,eventStruct+1368,64)};var _emscripten_get_gamepad_status=(index,gamepadState)=>{if(index<0||index>=JSEvents.lastGamepadState.length)return-5;if(!JSEvents.lastGamepadState[index])return-7;fillGamepadEventData(gamepadState,JSEvents.lastGamepadState[index]);return 0};var _emscripten_get_num_gamepads=()=>JSEvents.lastGamepadState.length;var _emscripten_memcpy_js=(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num);var _emscripten_random=()=>Math.random();var abortOnCannotGrowMemory=requestedSize=>{abort("OOM")};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;abortOnCannotGrowMemory(requestedSize)};var _emscripten_sample_gamepad_data=()=>{try{if(navigator.getGamepads)return(JSEvents.lastGamepadState=navigator.getGamepads())?0:-1}catch(e){navigator.getGamepads=null}return-1};var maybeCStringToJsString=cString=>cString>2?UTF8ToString(cString):cString;var specialHTMLTargets=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];var findEventTarget=target=>{target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!="undefined"?document.querySelector(target):undefined);return domElement};var wasmTableMirror=[];var wasmTable;var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func};var registerKeyEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.keyEvent)JSEvents.keyEvent=_malloc(176);var keyEventHandlerFunc=e=>{var keyEventData=JSEvents.keyEvent;HEAPF64[keyEventData>>3]=e.timeStamp;var idx=keyEventData>>2;HEAP32[idx+2]=e.location;HEAP32[idx+3]=e.ctrlKey;HEAP32[idx+4]=e.shiftKey;HEAP32[idx+5]=e.altKey;HEAP32[idx+6]=e.metaKey;HEAP32[idx+7]=e.repeat;HEAP32[idx+8]=e.charCode;HEAP32[idx+9]=e.keyCode;HEAP32[idx+10]=e.which;stringToUTF8(e.key||"",keyEventData+44,32);stringToUTF8(e.code||"",keyEventData+76,32);stringToUTF8(e.char||"",keyEventData+108,32);stringToUTF8(e.locale||"",keyEventData+140,32);if(getWasmTableEntry(callbackfunc)(eventTypeId,keyEventData,userData))e.preventDefault()};var eventHandler={target:findEventTarget(target),eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:keyEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_keydown_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerKeyEventCallback(target,userData,useCapture,callbackfunc,2,"keydown",targetThread);var _emscripten_set_keyup_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerKeyEventCallback(target,userData,useCapture,callbackfunc,3,"keyup",targetThread);var _emscripten_set_main_loop_arg=(func,arg,fps,simulateInfiniteLoop)=>{var browserIterationFunc=()=>getWasmTableEntry(func)(arg);setMainLoop(browserIterationFunc,fps,simulateInfiniteLoop,arg)};var getBoundingClientRect=e=>specialHTMLTargets.indexOf(e)<0?e.getBoundingClientRect():{"left":0,"top":0};var fillMouseEventData=(eventStruct,e,target)=>{HEAPF64[eventStruct>>3]=e.timeStamp;var idx=eventStruct>>2;HEAP32[idx+2]=e.screenX;HEAP32[idx+3]=e.screenY;HEAP32[idx+4]=e.clientX;HEAP32[idx+5]=e.clientY;HEAP32[idx+6]=e.ctrlKey;HEAP32[idx+7]=e.shiftKey;HEAP32[idx+8]=e.altKey;HEAP32[idx+9]=e.metaKey;HEAP16[idx*2+20]=e.button;HEAP16[idx*2+21]=e.buttons;HEAP32[idx+11]=e["movementX"];HEAP32[idx+12]=e["movementY"];var rect=getBoundingClientRect(target);HEAP32[idx+13]=e.clientX-(rect.left|0);HEAP32[idx+14]=e.clientY-(rect.top|0)};var registerMouseEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.mouseEvent)JSEvents.mouseEvent=_malloc(72);target=findEventTarget(target);var mouseEventHandlerFunc=(e=event)=>{fillMouseEventData(JSEvents.mouseEvent,e,target);if(getWasmTableEntry(callbackfunc)(eventTypeId,JSEvents.mouseEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:eventTypeString!="mousemove"&&eventTypeString!="mouseenter"&&eventTypeString!="mouseleave",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:mouseEventHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_mousedown_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,5,"mousedown",targetThread);var _emscripten_set_mousemove_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,8,"mousemove",targetThread);var _emscripten_set_mouseup_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>registerMouseEventCallback(target,userData,useCapture,callbackfunc,6,"mouseup",targetThread);var registerWheelEventCallback=(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString,targetThread)=>{if(!JSEvents.wheelEvent)JSEvents.wheelEvent=_malloc(104);var wheelHandlerFunc=(e=event)=>{var wheelEvent=JSEvents.wheelEvent;fillMouseEventData(wheelEvent,e,target);HEAPF64[wheelEvent+72>>3]=e["deltaX"];HEAPF64[wheelEvent+80>>3]=e["deltaY"];HEAPF64[wheelEvent+88>>3]=e["deltaZ"];HEAP32[wheelEvent+96>>2]=e["deltaMode"];if(getWasmTableEntry(callbackfunc)(eventTypeId,wheelEvent,userData))e.preventDefault()};var eventHandler={target:target,allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:wheelHandlerFunc,useCapture:useCapture};return JSEvents.registerOrRemoveHandler(eventHandler)};var _emscripten_set_wheel_callback_on_thread=(target,userData,useCapture,callbackfunc,targetThread)=>{target=findEventTarget(target);if(!target)return-4;if(typeof target.onwheel!="undefined"){return registerWheelEventCallback(target,userData,useCapture,callbackfunc,9,"wheel",targetThread)}else{return-1}};var _emscripten_set_window_title=title=>document.title=UTF8ToString(title);var ENV={};var getExecutableName=()=>thisProgram||"./this.program";var getEnvStrings=()=>{if(!getEnvStrings.strings){var lang=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`)}getEnvStrings.strings=strings}return getEnvStrings.strings};var stringToAscii=(str,buffer)=>{for(var i=0;i{var bufSize=0;getEnvStrings().forEach((string,i)=>{var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>2]=ptr;stringToAscii(string,ptr);bufSize+=string.length+1});return 0};var _environ_sizes_get=(penviron_count,penviron_buf_size)=>{var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(string=>bufSize+=string.length+1);HEAPU32[penviron_buf_size>>2]=bufSize;return 0};function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doReadv=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){var offset=convertI32PairToI53Checked(offset_low,offset_high);try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}function _fd_sync(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);if(stream.stream_ops?.fsync){return stream.stream_ops.fsync(stream)}return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var doWritev=(stream,iov,iovcnt,offset)=>{var ret=0;for(var i=0;i>2];var len=HEAPU32[iov+4>>2];iov+=8;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(typeof offset!=="undefined"){offset+=curr}}return ret};function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doWritev(stream,iov,iovcnt);HEAPU32[pnum>>2]=num;return 0}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno}}var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};FS.createPreloadedFile=FS_createPreloadedFile;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_unlink"]=FS.unlink;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["requestFullscreen"]=Browser.requestFullscreen;Module["requestAnimationFrame"]=Browser.requestAnimationFrame;Module["setCanvasSize"]=Browser.setCanvasSize;Module["pauseMainLoop"]=Browser.mainLoop.pause;Module["resumeMainLoop"]=Browser.mainLoop.resume;Module["getUserMedia"]=Browser.getUserMedia;Module["createContext"]=Browser.createContext;var preloadedImages={};var preloadedAudios={};var wasmImports={H:___syscall_faccessat,C:___syscall_fcntl64,z:___syscall_fstat64,q:___syscall_getdents64,w:___syscall_lstat64,r:___syscall_mkdirat,x:___syscall_newfstatat,B:___syscall_openat,p:___syscall_readlinkat,n:___syscall_rmdir,y:___syscall_stat64,o:___syscall_unlinkat,E:__emscripten_get_now_is_monotonic,j:__mktime_js,m:__tzset_js,N:_emscripten_cancel_main_loop,X:emscripten_clipboard__register,W:_emscripten_console_error,F:_emscripten_date_now,t:_emscripten_get_gamepad_status,D:_emscripten_get_num_gamepads,G:_emscripten_memcpy_js,O:_emscripten_random,l:_emscripten_resize_heap,M:_emscripten_sample_gamepad_data,V:_emscripten_set_keydown_callback_on_thread,U:_emscripten_set_keyup_callback_on_thread,L:_emscripten_set_main_loop_arg,T:_emscripten_set_mousedown_callback_on_thread,R:_emscripten_set_mousemove_callback_on_thread,S:_emscripten_set_mouseup_callback_on_thread,Q:_emscripten_set_wheel_callback_on_thread,e:_emscripten_set_window_title,s:_environ_get,u:_environ_sizes_get,b:_fd_close,A:_fd_read,k:_fd_seek,v:_fd_sync,a:_fd_write,d:pntr_app_emscripten_get_time,P:pntr_app_emscripten_init_filedropped,g:pntr_app_platform_get_height,h:pntr_app_platform_get_width,i:pntr_app_platform_render_js,f:pntr_app_platform_set_size,c:pntr_load_sound_from_memory,K:pntr_play_sound,J:pntr_stop_sound,I:pntr_unload_sound};var wasmExports=createWasm();var ___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports["Z"])();var _malloc=Module["_malloc"]=a0=>(_malloc=Module["_malloc"]=wasmExports["_"])(a0);var _free=Module["_free"]=a0=>(_free=Module["_free"]=wasmExports["$"])(a0);var _null0_file_read=Module["_null0_file_read"]=(a0,a1)=>(_null0_file_read=Module["_null0_file_read"]=wasmExports["aa"])(a0,a1);var _null0_file_write=Module["_null0_file_write"]=(a0,a1,a2)=>(_null0_file_write=Module["_null0_file_write"]=wasmExports["ba"])(a0,a1,a2);var _pntr_app_emscripten_file_dropped=Module["_pntr_app_emscripten_file_dropped"]=(a0,a1,a2,a3)=>(_pntr_app_emscripten_file_dropped=Module["_pntr_app_emscripten_file_dropped"]=wasmExports["ca"])(a0,a1,a2,a3);var _pntr_app_emscripten_load_memory=Module["_pntr_app_emscripten_load_memory"]=a0=>(_pntr_app_emscripten_load_memory=Module["_pntr_app_emscripten_load_memory"]=wasmExports["da"])(a0);var _pntr_app_emscripten_unload_memory=Module["_pntr_app_emscripten_unload_memory"]=a0=>(_pntr_app_emscripten_unload_memory=Module["_pntr_app_emscripten_unload_memory"]=wasmExports["ea"])(a0);var _main=Module["_main"]=(a0,a1)=>(_main=Module["_main"]=wasmExports["fa"])(a0,a1);var _null0_color_tint=Module["_null0_color_tint"]=(a0,a1,a2)=>(_null0_color_tint=Module["_null0_color_tint"]=wasmExports["ga"])(a0,a1,a2);var _null0_color_fade=Module["_null0_color_fade"]=(a0,a1,a2)=>(_null0_color_fade=Module["_null0_color_fade"]=wasmExports["ha"])(a0,a1,a2);var _null0_color_brightness=Module["_null0_color_brightness"]=(a0,a1,a2)=>(_null0_color_brightness=Module["_null0_color_brightness"]=wasmExports["ia"])(a0,a1,a2);var _null0_color_invert=Module["_null0_color_invert"]=(a0,a1)=>(_null0_color_invert=Module["_null0_color_invert"]=wasmExports["ja"])(a0,a1);var _null0_color_alpha_blend=Module["_null0_color_alpha_blend"]=(a0,a1,a2)=>(_null0_color_alpha_blend=Module["_null0_color_alpha_blend"]=wasmExports["ka"])(a0,a1,a2);var _null0_color_contrast=Module["_null0_color_contrast"]=(a0,a1,a2)=>(_null0_color_contrast=Module["_null0_color_contrast"]=wasmExports["la"])(a0,a1,a2);var _null0_color_bilinear_interpolate=Module["_null0_color_bilinear_interpolate"]=(a0,a1,a2,a3,a4,a5,a6)=>(_null0_color_bilinear_interpolate=Module["_null0_color_bilinear_interpolate"]=wasmExports["ma"])(a0,a1,a2,a3,a4,a5,a6);var _null0_file_info=Module["_null0_file_info"]=(a0,a1)=>(_null0_file_info=Module["_null0_file_info"]=wasmExports["na"])(a0,a1);var _null0_file_append=Module["_null0_file_append"]=(a0,a1,a2)=>(_null0_file_append=Module["_null0_file_append"]=wasmExports["oa"])(a0,a1,a2);var _null0_file_list=Module["_null0_file_list"]=a0=>(_null0_file_list=Module["_null0_file_list"]=wasmExports["pa"])(a0);var _null0_get_write_dir=Module["_null0_get_write_dir"]=()=>(_null0_get_write_dir=Module["_null0_get_write_dir"]=wasmExports["qa"])();var _null0_trace=Module["_null0_trace"]=(a0,a1)=>(_null0_trace=Module["_null0_trace"]=wasmExports["ra"])(a0,a1);var _null0_current_time=Module["_null0_current_time"]=()=>(_null0_current_time=Module["_null0_current_time"]=wasmExports["sa"])();var _null0_delta_time=Module["_null0_delta_time"]=()=>(_null0_delta_time=Module["_null0_delta_time"]=wasmExports["ta"])();var _null0_random_int=Module["_null0_random_int"]=(a0,a1)=>(_null0_random_int=Module["_null0_random_int"]=wasmExports["ua"])(a0,a1);var _null0_new_image=Module["_null0_new_image"]=(a0,a1,a2)=>(_null0_new_image=Module["_null0_new_image"]=wasmExports["va"])(a0,a1,a2);var _null0_image_copy=Module["_null0_image_copy"]=a0=>(_null0_image_copy=Module["_null0_image_copy"]=wasmExports["wa"])(a0);var _null0_image_subimage=Module["_null0_image_subimage"]=(a0,a1,a2,a3,a4)=>(_null0_image_subimage=Module["_null0_image_subimage"]=wasmExports["xa"])(a0,a1,a2,a3,a4);var _null0_clear=Module["_null0_clear"]=a0=>(_null0_clear=Module["_null0_clear"]=wasmExports["ya"])(a0);var _null0_draw_point=Module["_null0_draw_point"]=(a0,a1,a2)=>(_null0_draw_point=Module["_null0_draw_point"]=wasmExports["za"])(a0,a1,a2);var _null0_draw_line=Module["_null0_draw_line"]=(a0,a1,a2,a3,a4)=>(_null0_draw_line=Module["_null0_draw_line"]=wasmExports["Aa"])(a0,a1,a2,a3,a4);var _null0_draw_rectangle=Module["_null0_draw_rectangle"]=(a0,a1,a2,a3,a4)=>(_null0_draw_rectangle=Module["_null0_draw_rectangle"]=wasmExports["Ba"])(a0,a1,a2,a3,a4);var _null0_draw_triangle=Module["_null0_draw_triangle"]=(a0,a1,a2,a3,a4,a5,a6)=>(_null0_draw_triangle=Module["_null0_draw_triangle"]=wasmExports["Ca"])(a0,a1,a2,a3,a4,a5,a6);var _null0_draw_ellipse=Module["_null0_draw_ellipse"]=(a0,a1,a2,a3,a4)=>(_null0_draw_ellipse=Module["_null0_draw_ellipse"]=wasmExports["Da"])(a0,a1,a2,a3,a4);var _null0_draw_circle=Module["_null0_draw_circle"]=(a0,a1,a2,a3)=>(_null0_draw_circle=Module["_null0_draw_circle"]=wasmExports["Ea"])(a0,a1,a2,a3);var _null0_draw_polygon=Module["_null0_draw_polygon"]=(a0,a1,a2)=>(_null0_draw_polygon=Module["_null0_draw_polygon"]=wasmExports["Fa"])(a0,a1,a2);var _null0_draw_polyline=Module["_null0_draw_polyline"]=(a0,a1,a2)=>(_null0_draw_polyline=Module["_null0_draw_polyline"]=wasmExports["Ga"])(a0,a1,a2);var _null0_draw_arc=Module["_null0_draw_arc"]=(a0,a1,a2,a3,a4,a5,a6)=>(_null0_draw_arc=Module["_null0_draw_arc"]=wasmExports["Ha"])(a0,a1,a2,a3,a4,a5,a6);var _null0_draw_rectangle_rounded=Module["_null0_draw_rectangle_rounded"]=(a0,a1,a2,a3,a4,a5)=>(_null0_draw_rectangle_rounded=Module["_null0_draw_rectangle_rounded"]=wasmExports["Ia"])(a0,a1,a2,a3,a4,a5);var _null0_draw_image=Module["_null0_draw_image"]=(a0,a1,a2)=>(_null0_draw_image=Module["_null0_draw_image"]=wasmExports["Ja"])(a0,a1,a2);var _null0_draw_image_tint=Module["_null0_draw_image_tint"]=(a0,a1,a2,a3)=>(_null0_draw_image_tint=Module["_null0_draw_image_tint"]=wasmExports["Ka"])(a0,a1,a2,a3);var _null0_draw_image_rotated=Module["_null0_draw_image_rotated"]=(a0,a1,a2,a3,a4,a5,a6)=>(_null0_draw_image_rotated=Module["_null0_draw_image_rotated"]=wasmExports["La"])(a0,a1,a2,a3,a4,a5,a6);var _null0_draw_image_flipped=Module["_null0_draw_image_flipped"]=(a0,a1,a2,a3,a4,a5)=>(_null0_draw_image_flipped=Module["_null0_draw_image_flipped"]=wasmExports["Ma"])(a0,a1,a2,a3,a4,a5);var _null0_draw_image_scaled=Module["_null0_draw_image_scaled"]=(a0,a1,a2,a3,a4,a5,a6,a7)=>(_null0_draw_image_scaled=Module["_null0_draw_image_scaled"]=wasmExports["Na"])(a0,a1,a2,a3,a4,a5,a6,a7);var _null0_draw_text=Module["_null0_draw_text"]=(a0,a1,a2,a3,a4)=>(_null0_draw_text=Module["_null0_draw_text"]=wasmExports["Oa"])(a0,a1,a2,a3,a4);var _null0_save_image=Module["_null0_save_image"]=(a0,a1)=>(_null0_save_image=Module["_null0_save_image"]=wasmExports["Pa"])(a0,a1);var _null0_load_image=Module["_null0_load_image"]=a0=>(_null0_load_image=Module["_null0_load_image"]=wasmExports["Qa"])(a0);var _null0_image_resize=Module["_null0_image_resize"]=(a0,a1,a2,a3,a4,a5)=>(_null0_image_resize=Module["_null0_image_resize"]=wasmExports["Ra"])(a0,a1,a2,a3,a4,a5);var _null0_image_scale=Module["_null0_image_scale"]=(a0,a1,a2,a3)=>(_null0_image_scale=Module["_null0_image_scale"]=wasmExports["Sa"])(a0,a1,a2,a3);var _null0_image_color_replace=Module["_null0_image_color_replace"]=(a0,a1,a2)=>(_null0_image_color_replace=Module["_null0_image_color_replace"]=wasmExports["Ta"])(a0,a1,a2);var _null0_image_color_tint=Module["_null0_image_color_tint"]=(a0,a1)=>(_null0_image_color_tint=Module["_null0_image_color_tint"]=wasmExports["Ua"])(a0,a1);var _null0_image_color_fade=Module["_null0_image_color_fade"]=(a0,a1)=>(_null0_image_color_fade=Module["_null0_image_color_fade"]=wasmExports["Va"])(a0,a1);var _null0_font_copy=Module["_null0_font_copy"]=a0=>(_null0_font_copy=Module["_null0_font_copy"]=wasmExports["Wa"])(a0);var _null0_font_scale=Module["_null0_font_scale"]=(a0,a1,a2,a3)=>(_null0_font_scale=Module["_null0_font_scale"]=wasmExports["Xa"])(a0,a1,a2,a3);var _null0_load_font_bmf=Module["_null0_load_font_bmf"]=(a0,a1)=>(_null0_load_font_bmf=Module["_null0_load_font_bmf"]=wasmExports["Ya"])(a0,a1);var _null0_load_font_bmf_from_image=Module["_null0_load_font_bmf_from_image"]=(a0,a1)=>(_null0_load_font_bmf_from_image=Module["_null0_load_font_bmf_from_image"]=wasmExports["Za"])(a0,a1);var _null0_measure_text=Module["_null0_measure_text"]=(a0,a1,a2)=>(_null0_measure_text=Module["_null0_measure_text"]=wasmExports["_a"])(a0,a1,a2);var _null0_measure_image=Module["_null0_measure_image"]=(a0,a1)=>(_null0_measure_image=Module["_null0_measure_image"]=wasmExports["$a"])(a0,a1);var _null0_load_font_tty=Module["_null0_load_font_tty"]=(a0,a1,a2,a3)=>(_null0_load_font_tty=Module["_null0_load_font_tty"]=wasmExports["ab"])(a0,a1,a2,a3);var _null0_load_font_tty_from_image=Module["_null0_load_font_tty_from_image"]=(a0,a1,a2,a3)=>(_null0_load_font_tty_from_image=Module["_null0_load_font_tty_from_image"]=wasmExports["bb"])(a0,a1,a2,a3);var _null0_load_font_ttf=Module["_null0_load_font_ttf"]=(a0,a1)=>(_null0_load_font_ttf=Module["_null0_load_font_ttf"]=wasmExports["cb"])(a0,a1);var _null0_image_color_invert=Module["_null0_image_color_invert"]=a0=>(_null0_image_color_invert=Module["_null0_image_color_invert"]=wasmExports["db"])(a0);var _null0_image_alpha_border=Module["_null0_image_alpha_border"]=(a0,a1,a2)=>(_null0_image_alpha_border=Module["_null0_image_alpha_border"]=wasmExports["eb"])(a0,a1,a2);var _null0_image_crop=Module["_null0_image_crop"]=(a0,a1,a2,a3,a4)=>(_null0_image_crop=Module["_null0_image_crop"]=wasmExports["fb"])(a0,a1,a2,a3,a4);var _null0_image_alpha_crop=Module["_null0_image_alpha_crop"]=(a0,a1)=>(_null0_image_alpha_crop=Module["_null0_image_alpha_crop"]=wasmExports["gb"])(a0,a1);var _null0_image_color_brightness=Module["_null0_image_color_brightness"]=(a0,a1)=>(_null0_image_color_brightness=Module["_null0_image_color_brightness"]=wasmExports["hb"])(a0,a1);var _null0_image_flip=Module["_null0_image_flip"]=(a0,a1,a2)=>(_null0_image_flip=Module["_null0_image_flip"]=wasmExports["ib"])(a0,a1,a2);var _null0_image_color_contrast=Module["_null0_image_color_contrast"]=(a0,a1)=>(_null0_image_color_contrast=Module["_null0_image_color_contrast"]=wasmExports["jb"])(a0,a1);var _null0_image_alpha_mask=Module["_null0_image_alpha_mask"]=(a0,a1,a2,a3)=>(_null0_image_alpha_mask=Module["_null0_image_alpha_mask"]=wasmExports["kb"])(a0,a1,a2,a3);var _null0_image_rotate=Module["_null0_image_rotate"]=(a0,a1,a2)=>(_null0_image_rotate=Module["_null0_image_rotate"]=wasmExports["lb"])(a0,a1,a2);var _null0_image_gradient=Module["_null0_image_gradient"]=(a0,a1,a2,a3,a4,a5)=>(_null0_image_gradient=Module["_null0_image_gradient"]=wasmExports["mb"])(a0,a1,a2,a3,a4,a5);var _null0_unload_image=Module["_null0_unload_image"]=a0=>(_null0_unload_image=Module["_null0_unload_image"]=wasmExports["nb"])(a0);var _null0_unload_font=Module["_null0_unload_font"]=a0=>(_null0_unload_font=Module["_null0_unload_font"]=wasmExports["ob"])(a0);var _null0_clear_on_image=Module["_null0_clear_on_image"]=(a0,a1)=>(_null0_clear_on_image=Module["_null0_clear_on_image"]=wasmExports["pb"])(a0,a1);var _null0_draw_point_on_image=Module["_null0_draw_point_on_image"]=(a0,a1,a2,a3)=>(_null0_draw_point_on_image=Module["_null0_draw_point_on_image"]=wasmExports["qb"])(a0,a1,a2,a3);var _null0_draw_line_on_image=Module["_null0_draw_line_on_image"]=(a0,a1,a2,a3,a4,a5)=>(_null0_draw_line_on_image=Module["_null0_draw_line_on_image"]=wasmExports["rb"])(a0,a1,a2,a3,a4,a5);var _null0_draw_rectangle_on_image=Module["_null0_draw_rectangle_on_image"]=(a0,a1,a2,a3,a4,a5)=>(_null0_draw_rectangle_on_image=Module["_null0_draw_rectangle_on_image"]=wasmExports["sb"])(a0,a1,a2,a3,a4,a5);var _null0_draw_triangle_on_image=Module["_null0_draw_triangle_on_image"]=(a0,a1,a2,a3,a4,a5,a6,a7)=>(_null0_draw_triangle_on_image=Module["_null0_draw_triangle_on_image"]=wasmExports["tb"])(a0,a1,a2,a3,a4,a5,a6,a7);var _null0_draw_ellipse_on_image=Module["_null0_draw_ellipse_on_image"]=(a0,a1,a2,a3,a4,a5)=>(_null0_draw_ellipse_on_image=Module["_null0_draw_ellipse_on_image"]=wasmExports["ub"])(a0,a1,a2,a3,a4,a5);var _null0_draw_circle_on_image=Module["_null0_draw_circle_on_image"]=(a0,a1,a2,a3,a4)=>(_null0_draw_circle_on_image=Module["_null0_draw_circle_on_image"]=wasmExports["vb"])(a0,a1,a2,a3,a4);var _null0_draw_polygon_on_image=Module["_null0_draw_polygon_on_image"]=(a0,a1,a2,a3)=>(_null0_draw_polygon_on_image=Module["_null0_draw_polygon_on_image"]=wasmExports["wb"])(a0,a1,a2,a3);var _null0_draw_polyline_on_image=Module["_null0_draw_polyline_on_image"]=(a0,a1,a2,a3)=>(_null0_draw_polyline_on_image=Module["_null0_draw_polyline_on_image"]=wasmExports["xb"])(a0,a1,a2,a3);var _null0_draw_rectangle_rounded_on_image=Module["_null0_draw_rectangle_rounded_on_image"]=(a0,a1,a2,a3,a4,a5,a6)=>(_null0_draw_rectangle_rounded_on_image=Module["_null0_draw_rectangle_rounded_on_image"]=wasmExports["yb"])(a0,a1,a2,a3,a4,a5,a6);var _null0_draw_image_on_image=Module["_null0_draw_image_on_image"]=(a0,a1,a2,a3)=>(_null0_draw_image_on_image=Module["_null0_draw_image_on_image"]=wasmExports["zb"])(a0,a1,a2,a3);var _null0_draw_image_tint_on_image=Module["_null0_draw_image_tint_on_image"]=(a0,a1,a2,a3,a4)=>(_null0_draw_image_tint_on_image=Module["_null0_draw_image_tint_on_image"]=wasmExports["Ab"])(a0,a1,a2,a3,a4);var _null0_draw_image_rotated_on_image=Module["_null0_draw_image_rotated_on_image"]=(a0,a1,a2,a3,a4,a5,a6,a7)=>(_null0_draw_image_rotated_on_image=Module["_null0_draw_image_rotated_on_image"]=wasmExports["Bb"])(a0,a1,a2,a3,a4,a5,a6,a7);var _null0_draw_image_flipped_on_image=Module["_null0_draw_image_flipped_on_image"]=(a0,a1,a2,a3,a4,a5,a6)=>(_null0_draw_image_flipped_on_image=Module["_null0_draw_image_flipped_on_image"]=wasmExports["Cb"])(a0,a1,a2,a3,a4,a5,a6);var _null0_draw_image_scaled_on_image=Module["_null0_draw_image_scaled_on_image"]=(a0,a1,a2,a3,a4,a5,a6,a7,a8)=>(_null0_draw_image_scaled_on_image=Module["_null0_draw_image_scaled_on_image"]=wasmExports["Db"])(a0,a1,a2,a3,a4,a5,a6,a7,a8);var _null0_draw_text_on_image=Module["_null0_draw_text_on_image"]=(a0,a1,a2,a3,a4,a5)=>(_null0_draw_text_on_image=Module["_null0_draw_text_on_image"]=wasmExports["Eb"])(a0,a1,a2,a3,a4,a5);var _null0_draw_rectangle_outline=Module["_null0_draw_rectangle_outline"]=(a0,a1,a2,a3,a4)=>(_null0_draw_rectangle_outline=Module["_null0_draw_rectangle_outline"]=wasmExports["Fb"])(a0,a1,a2,a3,a4);var _null0_draw_triangle_outline=Module["_null0_draw_triangle_outline"]=(a0,a1,a2,a3,a4,a5,a6)=>(_null0_draw_triangle_outline=Module["_null0_draw_triangle_outline"]=wasmExports["Gb"])(a0,a1,a2,a3,a4,a5,a6);var _null0_draw_ellipse_outline=Module["_null0_draw_ellipse_outline"]=(a0,a1,a2,a3,a4)=>(_null0_draw_ellipse_outline=Module["_null0_draw_ellipse_outline"]=wasmExports["Hb"])(a0,a1,a2,a3,a4);var _null0_draw_circle_outline=Module["_null0_draw_circle_outline"]=(a0,a1,a2,a3)=>(_null0_draw_circle_outline=Module["_null0_draw_circle_outline"]=wasmExports["Ib"])(a0,a1,a2,a3);var _null0_draw_polygon_outline=Module["_null0_draw_polygon_outline"]=(a0,a1,a2)=>(_null0_draw_polygon_outline=Module["_null0_draw_polygon_outline"]=wasmExports["Jb"])(a0,a1,a2);var _null0_draw_arc_outline=Module["_null0_draw_arc_outline"]=(a0,a1,a2,a3,a4,a5,a6)=>(_null0_draw_arc_outline=Module["_null0_draw_arc_outline"]=wasmExports["Kb"])(a0,a1,a2,a3,a4,a5,a6);var _null0_draw_rectangle_rounded_outline=Module["_null0_draw_rectangle_rounded_outline"]=(a0,a1,a2,a3,a4,a5)=>(_null0_draw_rectangle_rounded_outline=Module["_null0_draw_rectangle_rounded_outline"]=wasmExports["Lb"])(a0,a1,a2,a3,a4,a5);var _null0_draw_rectangle_outline_on_image=Module["_null0_draw_rectangle_outline_on_image"]=(a0,a1,a2,a3,a4,a5)=>(_null0_draw_rectangle_outline_on_image=Module["_null0_draw_rectangle_outline_on_image"]=wasmExports["Mb"])(a0,a1,a2,a3,a4,a5);var _null0_draw_triangle_outline_on_image=Module["_null0_draw_triangle_outline_on_image"]=(a0,a1,a2,a3,a4,a5,a6,a7)=>(_null0_draw_triangle_outline_on_image=Module["_null0_draw_triangle_outline_on_image"]=wasmExports["Nb"])(a0,a1,a2,a3,a4,a5,a6,a7);var _null0_draw_ellipse_outline_on_image=Module["_null0_draw_ellipse_outline_on_image"]=(a0,a1,a2,a3,a4,a5)=>(_null0_draw_ellipse_outline_on_image=Module["_null0_draw_ellipse_outline_on_image"]=wasmExports["Ob"])(a0,a1,a2,a3,a4,a5);var _null0_draw_circle_outline_on_image=Module["_null0_draw_circle_outline_on_image"]=(a0,a1,a2,a3,a4)=>(_null0_draw_circle_outline_on_image=Module["_null0_draw_circle_outline_on_image"]=wasmExports["Pb"])(a0,a1,a2,a3,a4);var _null0_draw_polygon_outline_on_image=Module["_null0_draw_polygon_outline_on_image"]=(a0,a1,a2,a3)=>(_null0_draw_polygon_outline_on_image=Module["_null0_draw_polygon_outline_on_image"]=wasmExports["Qb"])(a0,a1,a2,a3);var _null0_draw_rectangle_rounded_outline_on_image=Module["_null0_draw_rectangle_rounded_outline_on_image"]=(a0,a1,a2,a3,a4,a5,a6)=>(_null0_draw_rectangle_rounded_outline_on_image=Module["_null0_draw_rectangle_rounded_outline_on_image"]=wasmExports["Rb"])(a0,a1,a2,a3,a4,a5,a6);var _null0_key_pressed=Module["_null0_key_pressed"]=a0=>(_null0_key_pressed=Module["_null0_key_pressed"]=wasmExports["Sb"])(a0);var _null0_key_down=Module["_null0_key_down"]=a0=>(_null0_key_down=Module["_null0_key_down"]=wasmExports["Tb"])(a0);var _null0_key_released=Module["_null0_key_released"]=a0=>(_null0_key_released=Module["_null0_key_released"]=wasmExports["Ub"])(a0);var _null0_key_up=Module["_null0_key_up"]=a0=>(_null0_key_up=Module["_null0_key_up"]=wasmExports["Vb"])(a0);var _null0_gamepad_button_pressed=Module["_null0_gamepad_button_pressed"]=(a0,a1)=>(_null0_gamepad_button_pressed=Module["_null0_gamepad_button_pressed"]=wasmExports["Wb"])(a0,a1);var _null0_gamepad_button_down=Module["_null0_gamepad_button_down"]=(a0,a1)=>(_null0_gamepad_button_down=Module["_null0_gamepad_button_down"]=wasmExports["Xb"])(a0,a1);var _null0_gamepad_button_released=Module["_null0_gamepad_button_released"]=(a0,a1)=>(_null0_gamepad_button_released=Module["_null0_gamepad_button_released"]=wasmExports["Yb"])(a0,a1);var _null0_mouse_position=Module["_null0_mouse_position"]=a0=>(_null0_mouse_position=Module["_null0_mouse_position"]=wasmExports["Zb"])(a0);var _null0_mouse_button_pressed=Module["_null0_mouse_button_pressed"]=a0=>(_null0_mouse_button_pressed=Module["_null0_mouse_button_pressed"]=wasmExports["_b"])(a0);var _null0_mouse_button_down=Module["_null0_mouse_button_down"]=a0=>(_null0_mouse_button_down=Module["_null0_mouse_button_down"]=wasmExports["$b"])(a0);var _null0_mouse_button_released=Module["_null0_mouse_button_released"]=a0=>(_null0_mouse_button_released=Module["_null0_mouse_button_released"]=wasmExports["ac"])(a0);var _null0_mouse_button_up=Module["_null0_mouse_button_up"]=a0=>(_null0_mouse_button_up=Module["_null0_mouse_button_up"]=wasmExports["bc"])(a0);var _null0_load_sound=Module["_null0_load_sound"]=a0=>(_null0_load_sound=Module["_null0_load_sound"]=wasmExports["cc"])(a0);var _null0_play_sound=Module["_null0_play_sound"]=(a0,a1)=>(_null0_play_sound=Module["_null0_play_sound"]=wasmExports["dc"])(a0,a1);var _null0_stop_sound=Module["_null0_stop_sound"]=a0=>(_null0_stop_sound=Module["_null0_stop_sound"]=wasmExports["ec"])(a0);var _null0_new_sfx=Module["_null0_new_sfx"]=a0=>(_null0_new_sfx=Module["_null0_new_sfx"]=wasmExports["fc"])(a0);var _null0_preset_sfx=Module["_null0_preset_sfx"]=(a0,a1)=>(_null0_preset_sfx=Module["_null0_preset_sfx"]=wasmExports["gc"])(a0,a1);var _null0_randomize_sfx=Module["_null0_randomize_sfx"]=(a0,a1)=>(_null0_randomize_sfx=Module["_null0_randomize_sfx"]=wasmExports["hc"])(a0,a1);var _null0_mutate_sfx=Module["_null0_mutate_sfx"]=(a0,a1,a2)=>(_null0_mutate_sfx=Module["_null0_mutate_sfx"]=wasmExports["ic"])(a0,a1,a2);var _null0_load_sfx=Module["_null0_load_sfx"]=(a0,a1)=>(_null0_load_sfx=Module["_null0_load_sfx"]=wasmExports["jc"])(a0,a1);var _null0_unload_sound=Module["_null0_unload_sound"]=a0=>(_null0_unload_sound=Module["_null0_unload_sound"]=wasmExports["kc"])(a0);var setTempRet0=a0=>(setTempRet0=wasmExports["mc"])(a0);var stackAlloc=a0=>(stackAlloc=wasmExports["nc"])(a0);var ___start_em_js=Module["___start_em_js"]=32316;var ___stop_em_js=Module["___stop_em_js"]=35440;Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["stringToUTF8"]=stringToUTF8;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS"]=FS;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_unlink"]=FS.unlink;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args=[]){var entryFunction=_main;args.unshift(thisProgram);var argc=args.length;var argv=stackAlloc((argc+1)*4);var argv_ptr=argv;args.forEach(arg=>{HEAPU32[argv_ptr>>2]=stringToUTF8OnStack(arg);argv_ptr+=4});HEAPU32[argv_ptr>>2]=0;try{var ret=entryFunction(argc,argv);exitJS(ret,true);return ret}catch(e){return handleException(e)}}function run(args=arguments_){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;run(); + + + return moduleArg.ready +} +); +})(); +export default Module; \ No newline at end of file diff --git a/docs/wasm/null0.wasm b/docs/wasm/null0.wasm new file mode 100755 index 0000000..1fbdf81 Binary files /dev/null and b/docs/wasm/null0.wasm differ diff --git a/package.json b/package.json index 03ab722..0aefe45 100755 --- a/package.json +++ b/package.json @@ -9,10 +9,10 @@ "gen:wamr": "node tools/gen_wamr.js", "gen:funcs": "node tools/gen_funcs.js", "gen:web": "node tools/gen_web.js", - "start": "npm run build:web && npm run build:carts && live-server --mount=/wasm:./wbuild/host --mount=/cart:./build/cart/c web", + "start": "npm run build:web && npm run build:carts && live-server docs", "build:carts": "cmake -GNinja -B build -DHOST=0 -DTESTS=0 -DCARTS=1 && cmake --build build", "build:host": "cmake -GNinja -B build -DHOST=1 -DTESTS=0 -DCARTS=0 && cmake --build build", - "build:web": "emcmake cmake -DHOST=1 -DTESTS=0 -DCARTS=0 -GNinja -B wbuild && cmake --build wbuild" + "build:web": "emcmake cmake -DHOST=1 -DTESTS=0 -DCARTS=0 -GNinja -B wbuild && cmake --build wbuild && mkdir -p docs/wasm docs/cart && cp wbuild/host/null0.* docs/wasm && cp build/cart/c/*.null0 docs/cart" }, "keywords": [], "author": "David Konsumer ", diff --git a/tools/gen_web.js b/tools/gen_web.js index a7f65be..dc09ada 100644 --- a/tools/gen_web.js +++ b/tools/gen_web.js @@ -83,4 +83,4 @@ for (const cat of Object.values(api)) { out.push(funcs.map(f => ` ${f}`).join(',\n')) out.push(` }\n}`) -await writeFile('web/null0_wasm.js', out.join('\n')) +await writeFile('docs/null0_wasm.js', out.join('\n')) diff --git a/web/index.html b/web/index.html deleted file mode 100755 index d5b3c2c..0000000 --- a/web/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - Null0 - - - - - - - - - - - - - - - - - -