diff --git a/index.html b/index.html index a0405cb0..7ef246a6 100644 --- a/index.html +++ b/index.html @@ -164,6 +164,10 @@

Tyler's Game Hub



Snake

+ +

+ +

Space Company

Space Invaders diff --git a/snowrider3d/Build/SnowRider3D-gd-1.data.unityweb b/snowrider3d/Build/SnowRider3D-gd-1.data.unityweb new file mode 100644 index 00000000..10da9dcf Binary files /dev/null and b/snowrider3d/Build/SnowRider3D-gd-1.data.unityweb differ diff --git a/snowrider3d/Build/SnowRider3D-gd-1.json b/snowrider3d/Build/SnowRider3D-gd-1.json new file mode 100644 index 00000000..97866d86 --- /dev/null +++ b/snowrider3d/Build/SnowRider3D-gd-1.json @@ -0,0 +1,12 @@ +{ +"companyName": "Snow Rider", +"productName": "Snow Rider 3D", +"dataUrl": "SnowRider3D-gd-1.data.unityweb", +"wasmCodeUrl": "SnowRider3D-gd-1.wasm.code.unityweb", +"wasmFrameworkUrl": "SnowRider3D-gd-1.wasm.framework.unityweb.js", +"TOTAL_MEMORY": 268435456, +"graphicsAPI": ["WebGL 2.0", "WebGL 1.0"], +"webglContextAttributes": {"preserveDrawingBuffer": false}, +"splashScreenStyle": "Dark", +"backgroundColor": "#231F20" +} \ No newline at end of file diff --git a/snowrider3d/Build/SnowRider3D-gd-1.wasm.code.unityweb b/snowrider3d/Build/SnowRider3D-gd-1.wasm.code.unityweb new file mode 100644 index 00000000..c7a84ec5 Binary files /dev/null and b/snowrider3d/Build/SnowRider3D-gd-1.wasm.code.unityweb differ diff --git a/snowrider3d/Build/SnowRider3D-gd-1.wasm.framework.unityweb b/snowrider3d/Build/SnowRider3D-gd-1.wasm.framework.unityweb new file mode 100644 index 00000000..317b9fb0 Binary files /dev/null and b/snowrider3d/Build/SnowRider3D-gd-1.wasm.framework.unityweb differ diff --git a/snowrider3d/Build/SnowRider3D-gd-1.wasm.framework.unityweb.js b/snowrider3d/Build/SnowRider3D-gd-1.wasm.framework.unityweb.js new file mode 100644 index 00000000..2457d337 --- /dev/null +++ b/snowrider3d/Build/SnowRider3D-gd-1.wasm.framework.unityweb.js @@ -0,0 +1,7 @@ +(function(Module) { +var Module=typeof Module!=="undefined"?Module:{};Module["preRun"].push((function(){var unityFileSystemInit=Module["unityFileSystemInit"]||(function(){if(!Module.indexedDB){console.log("IndexedDB is not available. Data will not persist in cache and PlayerPrefs will not be saved.")}FS.mkdir("/idbfs");FS.mount(IDBFS,{},"/idbfs");Module.addRunDependency("JS_FileSystem_Mount");FS.syncfs(true,(function(err){Module.removeRunDependency("JS_FileSystem_Mount")}))});unityFileSystemInit()}));Module["SetFullscreen"]=(function(fullscreen){if(typeof runtimeInitialized==="undefined"||!runtimeInitialized){console.log("Runtime not initialized yet.")}else if(typeof JSEvents==="undefined"){console.log("Player not loaded yet.")}else{var tmp=JSEvents.canPerformEventHandlerRequests;JSEvents.canPerformEventHandlerRequests=(function(){return 1});Module.ccall("SetFullscreen",null,["number"],[fullscreen]);JSEvents.canPerformEventHandlerRequests=tmp}});Module["demangle"]=demangle||(function(symbol){return symbol});var MediaDevices=[];Module["preRun"].push((function(){var enumerateMediaDevices=(function(){var getMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;if(!getMedia)return;function addDevice(label){label=label?label:"device #"+MediaDevices.length;var device={deviceName:label,refCount:0,video:null};MediaDevices.push(device)}if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices){if(typeof MediaStreamTrack=="undefined"||typeof MediaStreamTrack.getSources=="undefined"){console.log("Media Devices cannot be enumerated on this browser.");return}function gotSources(sourceInfos){for(var i=0;i!==sourceInfos.length;++i){var sourceInfo=sourceInfos[i];if(sourceInfo.kind==="video")addDevice(sourceInfo.label)}}MediaStreamTrack.getSources(gotSources)}navigator.mediaDevices.enumerateDevices().then((function(devices){devices.forEach((function(device){if(device.kind=="videoinput")addDevice(device.label)}))})).catch((function(err){console.log(err.name+": "+error.message)}))});enumerateMediaDevices()}));function SendMessage(gameObject,func,param){if(param===undefined)Module.ccall("SendMessage",null,["string","string"],[gameObject,func]);else if(typeof param==="string")Module.ccall("SendMessageString",null,["string","string","string"],[gameObject,func,param]);else if(typeof param==="number")Module.ccall("SendMessageFloat",null,["string","string","number"],[gameObject,func,param]);else throw""+param+" is does not have a type which is supported by SendMessage."}Module["SendMessage"]=SendMessage;var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=(function(status,toThrow){throw toThrow});Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("Module['ENVIRONMENT'] value is not valid. must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER}if(ENVIRONMENT_IS_NODE){var nodeFS;var nodePath;Module["read"]=function shell_read(filename,binary){var ret;if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);ret=nodeFS["readFileSync"](filename);return binary?ret:ret.toString()};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));process["on"]("unhandledRejection",(function(reason,p){process["exit"](1)}));Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){Module["read"]=function shell_read(f){return read(f)}}Module["readBinary"]=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof quit==="function"){Module["quit"]=(function(status,toThrow){quit(status)})}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){Module["readBinary"]=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)};Module["setWindowTitle"]=(function(title){document.title=title})}Module["print"]=typeof console!=="undefined"?console.log.bind(console):typeof print!=="undefined"?print:null;Module["printErr"]=typeof printErr!=="undefined"?printErr:typeof console!=="undefined"&&console.warn.bind(console)||Module["print"];Module.print=Module["print"];Module.printErr=Module["printErr"];for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var STACK_ALIGN=16;function staticAlloc(size){assert(!staticSealed);var ret=STATICTOP;STATICTOP=STATICTOP+size+15&-16;return ret}function dynamicAlloc(size){assert(DYNAMICTOP_PTR);var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;if(end>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){HEAP32[DYNAMICTOP_PTR>>2]=ret;return 0}}return ret}function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;var ret=size=Math.ceil(size/factor)*factor;return ret}function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return 4}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else{return 0}}}}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;Module.printErr(text)}}var jsCallStartIndex=1;var functionPointers=new Array(0);function addFunction(func,sig){var base=0;for(var i=base;i>>0)+ +(high>>>0)*4294967296:+(low>>>0)+ +(high|0)*4294967296}function dynCall(sig,ptr,args){if(args&&args.length){return Module["dynCall_"+sig].apply(null,[ptr].concat(args))}else{return Module["dynCall_"+sig].call(null,ptr)}}var GLOBAL_BASE=1024;var ABORT=0;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}var JSfuncs={"stackSave":(function(){stackSave()}),"stackRestore":(function(){stackRestore()}),"arrayToC":(function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};function ccall(ident,returnType,argTypes,args,opts){var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}var ALLOC_NORMAL=0;var ALLOC_STACK=1;var ALLOC_STATIC=2;var ALLOC_NONE=4;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[typeof _malloc==="function"?_malloc:staticAlloc,stackAlloc,staticAlloc,dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var stop;ptr=ret;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return UTF8ToString(ptr)}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[endPtr])++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}}function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8Array(str,HEAP8,ret,size);return ret}function allocateUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8Array(str,HEAP8,ret,size);return ret}function demangle(func){return func}function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(regex,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}var PAGE_SIZE=16384;var WASM_PAGE_SIZE=65536;var ASMJS_PAGE_SIZE=16777216;var MIN_TOTAL_MEMORY=16777216;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBuffer(buf){Module["buffer"]=buffer=buf}function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed;var STACK_BASE,STACKTOP,STACK_MAX;var DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0;staticSealed=false;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}if(!Module["reallocBuffer"])Module["reallocBuffer"]=(function(size){var ret;try{if(ArrayBuffer.transfer){ret=ArrayBuffer.transfer(buffer,size)}else{var oldHEAP8=HEAP8;ret=new ArrayBuffer(size);var temp=new Int8Array(ret);temp.set(oldHEAP8)}}catch(e){return false}var success=_emscripten_replace_memory(ret);if(!success)return false;return ret});function enlargeMemory(){var PAGE_MULTIPLE=Module["usingWasm"]?WASM_PAGE_SIZE:ASMJS_PAGE_SIZE;var LIMIT=2147483648-PAGE_MULTIPLE;if(HEAP32[DYNAMICTOP_PTR>>2]>LIMIT){return false}var OLD_TOTAL_MEMORY=TOTAL_MEMORY;TOTAL_MEMORY=Math.max(TOTAL_MEMORY,MIN_TOTAL_MEMORY);while(TOTAL_MEMORY>2]){if(TOTAL_MEMORY<=536870912){TOTAL_MEMORY=alignUp(2*TOTAL_MEMORY,PAGE_MULTIPLE)}else{TOTAL_MEMORY=Math.min(alignUp((3*TOTAL_MEMORY+2147483648)/4,PAGE_MULTIPLE),LIMIT)}}var replacement=Module["reallocBuffer"](TOTAL_MEMORY);if(!replacement||replacement.byteLength!=TOTAL_MEMORY){TOTAL_MEMORY=OLD_TOTAL_MEMORY;return false}updateGlobalBuffer(replacement);updateGlobalBufferViews();return true}var byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get);byteLength(new ArrayBuffer(4))}catch(e){byteLength=(function(buffer){return buffer.byteLength})}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||268435456;if(TOTAL_MEMORY0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=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 ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}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 addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function unSign(value,bits,ignore){if(value>=0){return value}return bits<=32?2*Math.abs(1<=half&&(bits<=32||value>half)){value=-2*half+value}return value}var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_round=Math.round;var Math_min=Math.min;var Math_max=Math.max;var Math_clz32=Math.clz32;var Math_trunc=Math.trunc;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}function integrateWasmJS(){var wasmTextFile="build.wast";var wasmBinaryFile="build.wasm";var asmjsCodeFile="build.temp.asm.js";if(typeof Module["locateFile"]==="function"){if(!isDataURI(wasmTextFile)){wasmTextFile=Module["locateFile"](wasmTextFile)}if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=Module["locateFile"](wasmBinaryFile)}if(!isDataURI(asmjsCodeFile)){asmjsCodeFile=Module["locateFile"](asmjsCodeFile)}}var wasmPageSize=64*1024;var info={"global":null,"env":null,"asm2wasm":{"f64-rem":(function(x,y){return x%y}),"debugger":(function(){debugger})},"parent":Module};var exports=null;function mergeMemory(newBuffer){var oldBuffer=Module["buffer"];if(newBuffer.byteLength>2)+length*i;var buffer=sound.buffer;var copyToChannel=buffer["copyToChannel"]||(function(source,channelNumber,startInChannel){var clipped=source.subarray(0,Math.min(source.length,this.length-(startInChannel|0)));this.getChannelData(channelNumber|0).set(clipped,startInChannel|0)});copyToChannel.apply(buffer,[HEAPF32.subarray(offs,offs+length),i,0])}var instance=WEBAudio.audioInstances.push(sound)-1;return instance}function _JS_Sound_Play(bufferInstance,channelInstance,offset,delay){_JS_Sound_Stop(channelInstance,0);if(WEBAudio.audioWebEnabled==0)return;var sound=WEBAudio.audioInstances[bufferInstance];var channel=WEBAudio.audioInstances[channelInstance];if(sound.buffer){try{channel.playBuffer(WEBAudio.audioContext.currentTime+delay,sound.buffer,offset)}catch(e){console.error("playBuffer error. Exception: "+e)}}else console.log("Trying to play sound which is not loaded.")}function _JS_Sound_ReleaseInstance(instance){WEBAudio.audioInstances[instance]=null}function _JS_Sound_ResumeIfNeeded(){if(WEBAudio.audioWebEnabled==0)return;if(WEBAudio.audioContext.state==="suspended")WEBAudio.audioContext.resume()}function _JS_Sound_Set3D(channelInstance,threeD){var channel=WEBAudio.audioInstances[channelInstance];if(channel.threeD!=threeD){channel.threeD=threeD;channel.setupPanning()}}function _JS_Sound_SetListenerOrientation(x,y,z,xUp,yUp,zUp){if(WEBAudio.audioWebEnabled==0)return;if(WEBAudio.audioContext.listener.forwardX){WEBAudio.audioContext.listener.forwardX.setValueAtTime(-x,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.forwardY.setValueAtTime(-y,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.forwardZ.setValueAtTime(-z,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.upX.setValueAtTime(xUp,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.upY.setValueAtTime(yUp,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.upZ.setValueAtTime(zUp,WEBAudio.audioContext.currentTime)}else{WEBAudio.audioContext.listener.setOrientation(-x,-y,-z,xUp,yUp,zUp)}}function _JS_Sound_SetListenerPosition(x,y,z){if(WEBAudio.audioWebEnabled==0)return;if(WEBAudio.audioContext.listener.positionX){WEBAudio.audioContext.listener.positionX.setValueAtTime(x,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.positionY.setValueAtTime(y,WEBAudio.audioContext.currentTime);WEBAudio.audioContext.listener.positionZ.setValueAtTime(z,WEBAudio.audioContext.currentTime)}else{WEBAudio.audioContext.listener.setPosition(x,y,z)}}function _JS_Sound_SetLoop(channelInstance,loop){if(WEBAudio.audioWebEnabled==0)return;WEBAudio.audioInstances[channelInstance].source.loop=loop}function _JS_Sound_SetLoopPoints(channelInstance,loopStart,loopEnd){if(WEBAudio.audioWebEnabled==0)return;var channel=WEBAudio.audioInstances[channelInstance];channel.source.loopStart=loopStart;channel.source.loopEnd=loopEnd}function _JS_Sound_SetPitch(channelInstance,v){if(WEBAudio.audioWebEnabled==0)return;WEBAudio.audioInstances[channelInstance].source.playbackRate.setValueAtTime(v,WEBAudio.audioContext.currentTime)}function _JS_Sound_SetPosition(channelInstance,x,y,z){if(WEBAudio.audioWebEnabled==0)return;WEBAudio.audioInstances[channelInstance].panner.setPosition(x,y,z)}function _JS_Sound_SetVolume(channelInstance,v){if(WEBAudio.audioWebEnabled==0)return;WEBAudio.audioInstances[channelInstance].gain.gain.setValueAtTime(v,WEBAudio.audioContext.currentTime)}function _JS_Sound_Stop(channelInstance,delay){if(WEBAudio.audioWebEnabled==0)return;var channel=WEBAudio.audioInstances[channelInstance];if(channel.source.buffer){try{channel.source.stop(WEBAudio.audioContext.currentTime+delay)}catch(e){channel.source.disconnect()}if(delay==0){channel.source.onended=(function(){});channel.setup()}}}function _JS_SystemInfo_GetBrowserName(buffer,bufferSize){var browser=UnityLoader.SystemInfo.browser;if(buffer)stringToUTF8(browser,buffer,bufferSize);return lengthBytesUTF8(browser)}function _JS_SystemInfo_GetBrowserVersionString(buffer,bufferSize){var browserVer=UnityLoader.SystemInfo.browserVersion;if(buffer)stringToUTF8(browserVer,buffer,bufferSize);return lengthBytesUTF8(browserVer)}function _JS_SystemInfo_GetCurrentCanvasHeight(){return Module["canvas"].clientHeight}function _JS_SystemInfo_GetCurrentCanvasWidth(){return Module["canvas"].clientWidth}function _JS_SystemInfo_GetDocumentURL(buffer,bufferSize){if(buffer)stringToUTF8("https://gamedistribution.com/",buffer,bufferSize);return lengthBytesUTF8("https://gamedistribution.com/")}function _JS_SystemInfo_GetGPUInfo(buffer,bufferSize){var gpuinfo=UnityLoader.SystemInfo.gpu;if(buffer)stringToUTF8(gpuinfo,buffer,bufferSize);return lengthBytesUTF8(gpuinfo)}function _JS_SystemInfo_GetHeight(){return UnityLoader.SystemInfo.height}function _JS_SystemInfo_GetLanguage(buffer,bufferSize){var language=UnityLoader.SystemInfo.language;if(buffer)stringToUTF8(language,buffer,bufferSize);return lengthBytesUTF8(language)}function _JS_SystemInfo_GetMemory(){return TOTAL_MEMORY/(1024*1024)}function _JS_SystemInfo_GetOS(buffer,bufferSize){var browser=UnityLoader.SystemInfo.os+" "+UnityLoader.SystemInfo.osVersion;if(buffer)stringToUTF8(browser,buffer,bufferSize);return lengthBytesUTF8(browser)}function _JS_SystemInfo_GetStreamingAssetsURL(buffer,bufferSize){var streamingAssetsUrl=Module.streamingAssetsUrl();if(buffer)stringToUTF8(streamingAssetsUrl,buffer,bufferSize);return lengthBytesUTF8(streamingAssetsUrl)}function _JS_SystemInfo_GetWidth(){return UnityLoader.SystemInfo.width}function _JS_SystemInfo_HasCursorLock(){return UnityLoader.SystemInfo.hasCursorLock}function _JS_SystemInfo_HasFullscreen(){return UnityLoader.SystemInfo.hasFullscreen}function _JS_SystemInfo_HasWebGL(){return UnityLoader.SystemInfo.hasWebGL}function _JS_WebGL_InitContextAttributes(attributes){HEAP32[attributes>>2]=1;HEAP32[attributes+4>>2]=1;HEAP32[attributes+8>>2]=1;HEAP32[attributes+12>>2]=0;HEAP32[attributes+16>>2]=Module.webglContextAttributes.premultipliedAlpha;HEAP32[attributes+20>>2]=Module.webglContextAttributes.preserveDrawingBuffer;HEAP32[attributes+24>>2]=0;HEAP32[attributes+28>>2]=0;HEAP32[attributes+32>>2]=1;HEAP32[attributes+36>>2]=0;HEAP32[attributes+40>>2]=1;HEAP32[attributes+44>>2]=0;return 0}var wr={requestInstances:{},nextRequestId:1};function _JS_WebRequest_Abort(request){wr.requestInstances[request].abort()}function _JS_WebRequest_Create(url,method){var http=new XMLHttpRequest;var _url=Pointer_stringify(url);var _method=Pointer_stringify(method);http.open("GET","json/null.json?"+_url,true);http.responseType="arraybuffer";wr.requestInstances[wr.nextRequestId]=http;return wr.nextRequestId++}function _JS_WebRequest_GetResponseHeaders(request,buffer,bufferSize){var headers=wr.requestInstances[request].getAllResponseHeaders();if(buffer)stringToUTF8(headers,buffer,bufferSize);return lengthBytesUTF8(headers)}function _JS_WebRequest_Release(request){var http=wr.requestInstances[request];http.onload=null;http.onerror=null;http.ontimeout=null;http.onabort=null;delete http;wr.requestInstances[request]=null}function _JS_WebRequest_Send(request,ptr,length){var http=wr.requestInstances[request];try{if(length>0)http.send(HEAPU8.subarray(ptr,ptr+length));else http.send()}catch(e){console.error(e.name+": "+e.message)}}function _JS_WebRequest_SetProgressHandler(request,arg,onprogress){var http=wr.requestInstances[request];http.onprogress=function http_onprogress(e){if(onprogress){if(e.lengthComputable)dynCall("viii",onprogress,[arg,e.loaded,e.total])}}}function _JS_WebRequest_SetRequestHeader(request,header,value){var _header=Pointer_stringify(header);var _value=Pointer_stringify(value);wr.requestInstances[request].setRequestHeader(_header,_value)}function _JS_WebRequest_SetResponseHandler(request,arg,onresponse){var http=wr.requestInstances[request];http.onload=function http_onload(e){if(onresponse){var kWebRequestOK=0;var byteArray=new Uint8Array(http.response);if(byteArray.length!=0){var buffer=_malloc(byteArray.length);HEAPU8.set(byteArray,buffer);dynCall("viiiiii",onresponse,[arg,http.status,buffer,byteArray.length,0,kWebRequestOK])}else{dynCall("viiiiii",onresponse,[arg,http.status,0,0,0,kWebRequestOK])}}};function HandleError(err,code){if(onresponse){var len=lengthBytesUTF8(err)+1;var buffer=_malloc(len);stringToUTF8(err,buffer,len);dynCall("viiiiii",onresponse,[arg,http.status,0,0,buffer,code]);_free(buffer)}}http.onerror=function http_onerror(e){var kWebErrorUnknown=2;HandleError("Unknown error.",kWebErrorUnknown)};http.ontimeout=function http_onerror(e){var kWebErrorTimeout=14;HandleError("Connection timed out.",kWebErrorTimeout)};http.onabort=function http_onerror(e){var kWebErrorAborted=17;HandleError("Aborted.",kWebErrorAborted)}}function _JS_WebRequest_SetTimeout(request,timeout){wr.requestInstances[request].timeout=timeout}function _SDK_Init(gameKey){gameKey=Pointer_stringify(gameKey);window["GD_OPTIONS"]={debug:false,gameId:gameKey,onEvent:(function(event){switch(event.name){case"SDK_GAME_START":SendMessage("GameDistribution","ResumeGameCallback");break;case"SDK_GAME_PAUSE":SendMessage("GameDistribution","PauseGameCallback");break;case"SDK_ERROR":break}})};((function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="js/main.min.js?//html5.api.gamedistribution.com/main.min.js";fjs.parentNode.insertBefore(js,fjs)}))(document,"script","gamedistribution-jssdk")}function _SDK_PreloadAd(){if(typeof gdsdk!=="undefined"&&typeof gdsdk.preloadAd!=="undefined"){gdsdk.preloadAd(gdsdk.AdType.Rewarded).then((function(response){SendMessage("GameDistribution","PreloadRewardedVideoCallback",1)})).catch((function(error){SendMessage("GameDistribution","PreloadRewardedVideoCallback",0)}))}}function _SDK_ShowAd(adType){if(typeof gdsdk!=="undefined"&&typeof gdsdk.showAd!=="undefined"){adType=Pointer_stringify(adType)||gdsdk.AdType.Interstitial;gdsdk.showAd(adType).then((function(response){if(adType===gdsdk.AdType.Rewarded){SendMessage("GameDistribution","RewardedVideoSuccessCallback")}})).catch((function(error){if(adType===gdsdk.AdType.Rewarded){SendMessage("GameDistribution","RewardedVideoFailureCallback")}}))}}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}var PATH={splitPath:(function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)}),normalizeArray:(function(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:(function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path}),dirname:(function(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:(function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)}),extname:(function(path){return PATH.splitPath(path)[3]}),join:(function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))}),join2:(function(l,r){return PATH.normalize(l+"/"+r)}),resolve:(function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[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.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((function(p){return!!p})),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."}),relative:(function(from,to){from=PATH.resolve(from).substr(1);to=PATH.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;i0){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}tty.input=intArrayFromString(result,true)}return tty.input.shift()}),put_char:(function(tty,val){if(val===null||val===10){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}})},default_tty1_ops:{put_char:(function(tty,val){if(val===null||val===10){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}})}};var MEMFS={ops_table:null,mount:(function(mount){return MEMFS.createNode(null,"/",16384|511,0)}),createNode:(function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(!MEMFS.ops_table){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}return node}),getFileDataAsRegularArray:(function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;inode.contents.length){node.contents=MEMFS.getFileDataAsRegularArray(node);node.usedBytes=node.contents.length}if(!node.contents||node.contents.subarray){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return}if(!node.contents&&newCapacity>0)node.contents=[];while(node.contents.lengthnewSize)node.contents.length=newSize;else while(node.contents.length=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+lengthe2.timestamp){create.push(key);total++}}));var remove=[];Object.keys(dst.entries).forEach((function(key){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}}));if(!total){return callback(null)}var completed=0;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=total){return callback(null)}}transaction.onerror=(function(e){done(this.error);e.preventDefault()});create.sort().forEach((function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)}))}else{IDBFS.loadLocalEntry(path,(function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)}))}}));remove.sort().reverse().forEach((function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}}))})};var NODEFS={isWindows:false,staticInit:(function(){NODEFS.isWindows=!!process.platform.match(/^win/);var flags=process["binding"]("constants");if(flags["fs"]){flags=flags["fs"]}NODEFS.flagsForNodeMap={"1024":flags["O_APPEND"],"64":flags["O_CREAT"],"128":flags["O_EXCL"],"0":flags["O_RDONLY"],"2":flags["O_RDWR"],"4096":flags["O_SYNC"],"512":flags["O_TRUNC"],"1":flags["O_WRONLY"]}}),bufferFrom:(function(arrayBuffer){return Buffer.alloc?Buffer.from(arrayBuffer):new Buffer(arrayBuffer)}),mount:(function(mount){assert(ENVIRONMENT_IS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)}),createNode:(function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node}),getMode:(function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&292)>>2}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return stat.mode}),realPath:(function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)}),flagsForNode:(function(flags){flags&=~2097152;flags&=~2048;flags&=~32768;flags&=~524288;var newFlags=0;for(var k in NODEFS.flagsForNodeMap){if(flags&k){newFlags|=NODEFS.flagsForNodeMap[k];flags^=k}}if(!flags){return newFlags}else{throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}}),node_ops:{getattr:(function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}}),setattr:(function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),lookup:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)}),mknod:(function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node}),rename:(function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),unlink:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),rmdir:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readdir:(function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),symlink:(function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readlink:(function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}})},stream_ops:{open:(function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsForNode(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),close:(function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),read:(function(stream,buffer,offset,length,position){if(length===0)return 0;try{return fs.readSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),write:(function(stream,buffer,offset,length,position){try{return fs.writeSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:(function(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size}),write:(function(stream,buffer,offset,length,position){throw new FS.ErrnoError(ERRNO_CODES.EIO)}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};STATICTOP+=16;STATICTOP+=16;STATICTOP+=16;var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:(function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)}),lookupPath:(function(path,opts){path=PATH.resolve(FS.cwd(),path);opts=opts||{};if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key]}}if(opts.recurse_count>8){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}var parts=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}}}return{path:current_path,node:current}}),getPath:(function(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:(function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length}),hashAddNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node}),hashRemoveNode:(function(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:(function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}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:(function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=(function(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});FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:(function(){return(this.mode&readMode)===readMode}),set:(function(val){val?this.mode|=readMode:this.mode&=~readMode})},write:{get:(function(){return(this.mode&writeMode)===writeMode}),set:(function(val){val?this.mode|=writeMode:this.mode&=~writeMode})},isFolder:{get:(function(){return FS.isDir(this.mode)})},isDevice:{get:(function(){return FS.isChrdev(this.mode)})}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node}),destroyNode:(function(node){FS.hashRemoveNode(node)}),isRoot:(function(node){return node===node.parent}),isMountpoint:(function(node){return!!node.mounted}),isFile:(function(mode){return(mode&61440)===32768}),isDir:(function(mode){return(mode&61440)===16384}),isLink:(function(mode){return(mode&61440)===40960}),isChrdev:(function(mode){return(mode&61440)===8192}),isBlkdev:(function(mode){return(mode&61440)===24576}),isFIFO:(function(mode){return(mode&61440)===4096}),isSocket:(function(mode){return(mode&49152)===49152}),flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:(function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags}),flagsToPermissionString:(function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms}),nodePermissions:(function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return ERRNO_CODES.EACCES}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return ERRNO_CODES.EACCES}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return ERRNO_CODES.EACCES}return 0}),mayLookup:(function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return ERRNO_CODES.EACCES;return 0}),mayCreate:(function(dir,name){try{var node=FS.lookupNode(dir,name);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(dir,"wx")}),mayDelete:(function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return ERRNO_CODES.ENOTDIR}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return ERRNO_CODES.EBUSY}}else{if(FS.isDir(node.mode)){return ERRNO_CODES.EISDIR}}return 0}),mayOpen:(function(node,flags){if(!node){return ERRNO_CODES.ENOENT}if(FS.isLink(node.mode)){return ERRNO_CODES.ELOOP}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return ERRNO_CODES.EISDIR}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))}),MAX_OPEN_FDS:4096,nextfd:(function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(ERRNO_CODES.EMFILE)}),getStream:(function(fd){return FS.streams[fd]}),createStream:(function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=(function(){});FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:(function(){return this.node}),set:(function(val){this.node=val})},isRead:{get:(function(){return(this.flags&2097155)!==1})},isWrite:{get:(function(){return(this.flags&2097155)!==0})},isAppend:{get:(function(){return this.flags&1024})}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream}),closeStream:(function(fd){FS.streams[fd]=null}),chrdev_stream_ops:{open:(function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}}),llseek:(function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)})},major:(function(dev){return dev>>8}),minor:(function(dev){return dev&255}),makedev:(function(ma,mi){return ma<<8|mi}),registerDevice:(function(dev,ops){FS.devices[dev]={stream_ops:ops}}),getDevice:(function(dev){return FS.devices[dev]}),getMounts:(function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts}),syncfs:(function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("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(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach((function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)}))}),mount:(function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}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(ERRNO_CODES.EBUSY)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}}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:(function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach((function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}}));node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1)}),lookup:(function(parent,name){return parent.node_ops.lookup(parent,name)}),mknod:(function(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(ERRNO_CODES.EINVAL)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.mknod(parent,name,mode,dev)}),create:(function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)}),mkdir:(function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)}),mkdirTree:(function(path,mode){var dirs=path.split("/");var d="";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]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_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=(function(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);if(typeof Uint8Array!="undefined")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||[])}else{return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(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;console.log("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};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;Object.defineProperties(lazyArray,{length:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._length})},chunkSize:{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize})}});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((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return fn.apply(null,arguments)}}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i0){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}}console.log('main loop blocker "'+blocker.name+'" took '+(Date.now()-start)+" ms");Browser.mainLoop.updateStatus();if(thisMainLoopId1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else if(Browser.mainLoop.timingMode==0){Browser.mainLoop.tickStartTime=_emscripten_get_now()}if(Browser.mainLoop.method==="timeout"&&Module.ctx){Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!");Browser.mainLoop.method=""}Browser.mainLoop.runIter(browserIterationFunc);if(thisMainLoopId0)_emscripten_set_main_loop_timing(0,1e3/fps);else _emscripten_set_main_loop_timing(1,1);Browser.mainLoop.scheduler()}if(simulateInfiniteLoop){throw"SimulateInfiniteLoop"}}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:(function(){Browser.mainLoop.scheduler=null;Browser.mainLoop.currentlyRunningMainloop++}),resume:(function(){Browser.mainLoop.currentlyRunningMainloop++;var timingMode=Browser.mainLoop.timingMode;var timingValue=Browser.mainLoop.timingValue;var func=Browser.mainLoop.func;Browser.mainLoop.func=null;_emscripten_set_main_loop(func,0,false,Browser.mainLoop.arg,true);_emscripten_set_main_loop_timing(timingMode,timingValue);Browser.mainLoop.scheduler()}),updateStatus:(function(){if(Module["setStatus"]){var message=Module["statusMessage"]||"Please wait...";var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining=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;Browser.safeSetTimeout((function(){finish(audio)}),1e4)}else{return fail()}};Module["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"]||(function(){});canvas.exitPointerLock=document["exitPointerLock"]||document["mozExitPointerLock"]||document["webkitExitPointerLock"]||document["msExitPointerLock"]||(function(){});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",(function(ev){if(!Browser.pointerLock&&Module["canvas"].requestPointerLock){Module["canvas"].requestPointerLock();ev.preventDefault()}}),false)}}}),createContext:(function(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};if(webGLContextAttributes){for(var attribute in webGLContextAttributes){contextAttributes[attribute]=webGLContextAttributes[attribute]}}contextHandle=GL.createContext(canvas,contextAttributes);if(contextHandle){ctx=GL.getContext(contextHandle).GLctx}}else{ctx=canvas.getContext("2d")}if(!ctx)return null;if(setInModule){if(!useWebGL)assert(typeof GLctx==="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it");Module.ctx=ctx;if(useWebGL)GL.makeContextCurrent(contextHandle);Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach((function(callback){callback()}));Browser.init()}return ctx}),destroyContext:(function(canvas,useWebGL,setInModule){}),fullscreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullscreen:(function(lockPointer,resizeCanvas,vrDevice){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;Browser.vrDevice=vrDevice;if(typeof Browser.lockPointer==="undefined")Browser.lockPointer=true;if(typeof Browser.resizeCanvas==="undefined")Browser.resizeCanvas=false;if(typeof Browser.vrDevice==="undefined")Browser.vrDevice=null;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=document["exitFullscreen"]||document["cancelFullScreen"]||document["mozCancelFullScreen"]||document["msExitFullscreen"]||document["webkitCancelFullScreen"]||(function(){});canvas.exitFullscreen=canvas.exitFullscreen.bind(document);if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullscreen=true;if(Browser.resizeCanvas)Browser.setFullscreenCanvasSize()}else{canvasContainer.parentNode.insertBefore(canvas,canvasContainer);canvasContainer.parentNode.removeChild(canvasContainer);if(Browser.resizeCanvas)Browser.setWindowedCanvasSize()}if(Module["onFullScreen"])Module["onFullScreen"](Browser.isFullscreen);if(Module["onFullscreen"])Module["onFullscreen"](Browser.isFullscreen);Browser.updateCanvasDimensions(canvas)}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"]?(function(){canvasContainer["webkitRequestFullscreen"](Element["ALLOW_KEYBOARD_INPUT"])}):null)||(canvasContainer["webkitRequestFullScreen"]?(function(){canvasContainer["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"])}):null);if(vrDevice){canvasContainer.requestFullscreen({vrDisplay:vrDevice})}else{canvasContainer.requestFullscreen()}}),requestFullScreen:(function(lockPointer,resizeCanvas,vrDevice){Module.printErr("Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead.");Browser.requestFullScreen=(function(lockPointer,resizeCanvas,vrDevice){return Browser.requestFullscreen(lockPointer,resizeCanvas,vrDevice)});return Browser.requestFullscreen(lockPointer,resizeCanvas,vrDevice)}),nextRAF:0,fakeRequestAnimationFrame:(function(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:function requestAnimationFrame(func){if(typeof window==="undefined"){Browser.fakeRequestAnimationFrame(func)}else{if(!window.requestAnimationFrame){window.requestAnimationFrame=window["requestAnimationFrame"]||window["mozRequestAnimationFrame"]||window["webkitRequestAnimationFrame"]||window["msRequestAnimationFrame"]||window["oRequestAnimationFrame"]||Browser.fakeRequestAnimationFrame}window.requestAnimationFrame(func)}},safeCallback:(function(func){return(function(){if(!ABORT)return func.apply(null,arguments)})}),allowAsyncCallbacks:true,queuedAsyncCallbacks:[],pauseAsyncCallbacks:(function(){Browser.allowAsyncCallbacks=false}),resumeAsyncCallbacks:(function(){Browser.allowAsyncCallbacks=true;if(Browser.queuedAsyncCallbacks.length>0){var callbacks=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[];callbacks.forEach((function(func){func()}))}}),safeRequestAnimationFrame:(function(func){return Browser.requestAnimationFrame((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}}))}),safeSetTimeout:(function(func,timeout){Module["noExitRuntime"]=true;return setTimeout((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}}),timeout)}),safeSetInterval:(function(func,timeout){Module["noExitRuntime"]=true;return setInterval((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}}),timeout)}),getMimetype:(function(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:(function(func){if(!window.getUserMedia){window.getUserMedia=navigator["getUserMedia"]||navigator["mozGetUserMedia"]}window.getUserMedia(func)}),getMovementX:(function(event){return event["movementX"]||event["mozMovementX"]||event["webkitMovementX"]||0}),getMovementY:(function(event){return event["movementY"]||event["mozMovementY"]||event["webkitMovementY"]||0}),getMouseWheelDelta:(function(event){var delta=0;switch(event.type){case"DOMMouseScroll":delta=event.detail;break;case"mousewheel":delta=event.wheelDelta;break;case"wheel":delta=event["deltaY"];break;default:throw"unrecognized mouse wheel event: "+event.type}return delta}),mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:(function(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{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;if(event.type==="touchstart"||event.type==="touchend"||event.type==="touchmove"){var touch=event.touch;if(touch===undefined){return}var adjustedX=touch.pageX-(scrollX+rect.left);var adjustedY=touch.pageY-(scrollY+rect.top);adjustedX=adjustedX*(cw/rect.width);adjustedY=adjustedY*(ch/rect.height);var coords={x:adjustedX,y:adjustedY};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];if(!last)last=coords;Browser.lastTouches[touch.identifier]=last;Browser.touches[touch.identifier]=coords}return}var x=event.pageX-(scrollX+rect.left);var y=event.pageY-(scrollY+rect.top);x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y}}),asyncLoad:(function(url,onload,onerror,noRunDep){var dep=!noRunDep?getUniqueRunDependency("al "+url):"";Module["readAsync"](url,(function(arrayBuffer){assert(arrayBuffer,'Loading data file "'+url+'" failed (no arrayBuffer).');onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)}),(function(event){if(onerror){onerror()}else{throw'Loading data file "'+url+'" failed.'}}));if(dep)addRunDependency(dep)}),resizeListeners:[],updateResizeListeners:(function(){var canvas=Module["canvas"];Browser.resizeListeners.forEach((function(listener){listener(canvas.width,canvas.height)}))}),setCanvasSize:(function(width,height,noUpdates){var canvas=Module["canvas"];Browser.updateCanvasDimensions(canvas,width,height);if(!noUpdates)Browser.updateResizeListeners()}),windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:(function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags|8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateResizeListeners()}),setWindowedCanvasSize:(function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen>>2];flags=flags&~8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateResizeListeners()}),updateCanvasDimensions:(function(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>2]=poolPtr;HEAP32[_environ>>2]=envPtr}else{envPtr=HEAP32[_environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in env){if(typeof env[key]==="string"){var line=key+"="+env[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}var ENV={};function _getenv(name){if(name===0)return 0;name=Pointer_stringify(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocateUTF8(ENV[name]);return _getenv.ret}function _putenv(string){if(string===0){___setErrNo(ERRNO_CODES.EINVAL);return-1}string=Pointer_stringify(string);var splitPoint=string.indexOf("=");if(string===""||string.indexOf("=")===-1){___setErrNo(ERRNO_CODES.EINVAL);return-1}var name=string.slice(0,splitPoint);var value=string.slice(splitPoint+1);if(!(name in ENV)||ENV[name]!==value){ENV[name]=value;___buildEnvironment(ENV)}return 0}function _SDL_RWFromConstMem(mem,size){var id=SDL.rwops.length;SDL.rwops.push({bytes:mem,count:size});return id}function _TTF_FontHeight(font){var fontData=SDL.fonts[font];return fontData.size}function _TTF_SizeText(font,text,w,h){var fontData=SDL.fonts[font];if(w){HEAP32[w>>2]=SDL.estimateTextWidth(fontData,Pointer_stringify(text))}if(h){HEAP32[h>>2]=fontData.size}return 0}function _TTF_RenderText_Solid(font,text,color){text=Pointer_stringify(text)||" ";var fontData=SDL.fonts[font];var w=SDL.estimateTextWidth(fontData,text);var h=fontData.size;color=SDL.loadColorToCSSRGB(color);var fontString=SDL.makeFontString(h,fontData.name);var surf=SDL.makeSurface(w,h,0,false,"text:"+text);var surfData=SDL.surfaces[surf];surfData.ctx.save();surfData.ctx.fillStyle=color;surfData.ctx.font=fontString;surfData.ctx.textBaseline="bottom";surfData.ctx.fillText(text,0,h|0);surfData.ctx.restore();return surf}function _Mix_HaltMusic(){var audio=SDL.music.audio;if(audio){audio.src=audio.src;audio.currentPosition=0;audio.pause()}SDL.music.audio=null;if(SDL.hookMusicFinished){Module["dynCall_v"](SDL.hookMusicFinished)}return 0}function _Mix_PlayMusic(id,loops){if(SDL.music.audio){if(!SDL.music.audio.paused)Module.printErr("Music is already playing. "+SDL.music.source);SDL.music.audio.pause()}var info=SDL.audios[id];var audio;if(info.webAudio){audio={};audio.resource=info;audio.paused=false;audio.currentPosition=0;audio.play=(function(){SDL.playWebAudio(this)});audio.pause=(function(){SDL.pauseWebAudio(this)})}else if(info.audio){audio=info.audio}audio["onended"]=(function(){if(SDL.music.audio==this)_Mix_HaltMusic()});audio.loop=loops!=0;audio.volume=SDL.music.volume;SDL.music.audio=audio;audio.play();return 0}function _Mix_FreeChunk(id){SDL.audios[id]=null}function _Mix_LoadWAV_RW(rwopsID,freesrc){var rwops=SDL.rwops[rwopsID];if(rwops===undefined)return 0;var filename="";var audio;var webAudio;var bytes;if(rwops.filename!==undefined){filename=PATH.resolve(rwops.filename);var raw=Module["preloadedAudios"][filename];if(!raw){if(raw===null)Module.printErr("Trying to reuse preloaded audio, but freePreloadedMediaOnUse is set!");if(!Module.noAudioDecoding)warnOnce("Cannot find preloaded audio "+filename);try{bytes=FS.readFile(filename)}catch(e){Module.printErr("Couldn't find file for: "+filename);return 0}}if(Module["freePreloadedMediaOnUse"]){Module["preloadedAudios"][filename]=null}audio=raw}else if(rwops.bytes!==undefined){if(SDL.webAudioAvailable())bytes=HEAPU8.buffer.slice(rwops.bytes,rwops.bytes+rwops.count);else bytes=HEAPU8.subarray(rwops.bytes,rwops.bytes+rwops.count)}else{return 0}var arrayBuffer=bytes?bytes.buffer||bytes:bytes;var canPlayWithWebAudio=Module["SDL_canPlayWithWebAudio"]===undefined||Module["SDL_canPlayWithWebAudio"](filename,arrayBuffer);if(bytes!==undefined&&SDL.webAudioAvailable()&&canPlayWithWebAudio){audio=undefined;webAudio={};webAudio.onDecodeComplete=[];function onDecodeComplete(data){webAudio.decodedBuffer=data;webAudio.onDecodeComplete.forEach((function(e){e()}));webAudio.onDecodeComplete=undefined}SDL.audioContext["decodeAudioData"](arrayBuffer,onDecodeComplete)}else if(audio===undefined&&bytes){var blob=new Blob([bytes],{type:rwops.mimetype});var url=URL.createObjectURL(blob);audio=new Audio;audio.src=url;audio.mozAudioChannelType="content"}var id=SDL.audios.length;SDL.audios.push({source:filename,audio:audio,webAudio:webAudio});return id}function _Mix_PlayChannel(channel,id,loops){var info=SDL.audios[id];if(!info)return-1;if(!info.audio&&!info.webAudio)return-1;if(channel==-1){for(var i=SDL.channelMinimumNumber;i1)return 0;if(!surfData.buffer){surfData.buffer=_malloc(surfData.width*surfData.height*4);HEAP32[surf+20>>2]=surfData.buffer}HEAP32[surf+20>>2]=surfData.buffer;if(surf==SDL.screen&&Module.screenIsReadOnly&&surfData.image)return 0;if(SDL.defaults.discardOnLock){if(!surfData.image){surfData.image=surfData.ctx.createImageData(surfData.width,surfData.height)}if(!SDL.defaults.opaqueFrontBuffer)return}else{surfData.image=surfData.ctx.getImageData(0,0,surfData.width,surfData.height)}if(surf==SDL.screen&&SDL.defaults.opaqueFrontBuffer){var data=surfData.image.data;var num=data.length;for(var i=0;i0&&SDL.rwops[SDL.rwops.length-1]===null){SDL.rwops.pop()}}function _IMG_Load_RW(rwopsID,freeSrc){try{var cleanup=(function(){if(rwops&&freeSrc)_SDL_FreeRW(rwopsID)});var rwops=SDL.rwops[rwopsID];if(rwops===undefined){return 0}var filename=rwops.filename;if(filename===undefined){warnOnce("Only file names that have been preloaded are supported for IMG_Load_RW. Consider using STB_IMAGE=1 if you want synchronous image decoding (see settings.js), or package files with --use-preload-plugins");return 0}if(!raw){filename=PATH.resolve(filename);var raw=Module["preloadedImages"][filename];if(!raw){if(raw===null)Module.printErr("Trying to reuse preloaded image, but freePreloadedMediaOnUse is set!");warnOnce("Cannot find preloaded image "+filename);warnOnce("Cannot find preloaded image "+filename+". Consider using STB_IMAGE=1 if you want synchronous image decoding (see settings.js), or package files with --use-preload-plugins");return 0}else if(Module["freePreloadedMediaOnUse"]){Module["preloadedImages"][filename]=null}}var surf=SDL.makeSurface(raw.width,raw.height,0,false,"load:"+filename);var surfData=SDL.surfaces[surf];surfData.ctx.globalCompositeOperation="copy";if(!raw.rawData){surfData.ctx.drawImage(raw,0,0,raw.width,raw.height,0,0,raw.width,raw.height)}else{var imageData=surfData.ctx.getImageData(0,0,surfData.width,surfData.height);if(raw.bpp==4){imageData.data.set(HEAPU8.subarray(raw.data,raw.data+raw.size))}else if(raw.bpp==3){var pixels=raw.size/3;var data=imageData.data;var sourcePtr=raw.data;var destPtr=0;for(var i=0;i>0];data[destPtr++]=HEAPU8[sourcePtr++>>0];data[destPtr++]=HEAPU8[sourcePtr++>>0];data[destPtr++]=255}}else if(raw.bpp==2){var pixels=raw.size;var data=imageData.data;var sourcePtr=raw.data;var destPtr=0;for(var i=0;i>0];var alpha=HEAPU8[sourcePtr++>>0];data[destPtr++]=gray;data[destPtr++]=gray;data[destPtr++]=gray;data[destPtr++]=alpha}}else if(raw.bpp==1){var pixels=raw.size;var data=imageData.data;var sourcePtr=raw.data;var destPtr=0;for(var i=0;i>0];data[destPtr++]=value;data[destPtr++]=value;data[destPtr++]=value;data[destPtr++]=255}}else{Module.printErr("cannot handle bpp "+raw.bpp);return 0}surfData.ctx.putImageData(imageData,0,0)}surfData.ctx.globalCompositeOperation="source-over";_SDL_LockSurface(surf);surfData.locked--;if(SDL.GL){surfData.canvas=surfData.ctx=null}return surf}finally{cleanup()}}function _SDL_RWFromFile(_name,mode){var id=SDL.rwops.length;var name=Pointer_stringify(_name);SDL.rwops.push({filename:name,mimetype:Browser.getMimetype(name)});return id}function _IMG_Load(filename){var rwops=_SDL_RWFromFile(filename);var result=_IMG_Load_RW(rwops,1);return result}function _SDL_UpperBlitScaled(src,srcrect,dst,dstrect){return SDL.blitSurface(src,srcrect,dst,dstrect,true)}function _SDL_UpperBlit(src,srcrect,dst,dstrect){return SDL.blitSurface(src,srcrect,dst,dstrect,false)}function _SDL_GetTicks(){return Date.now()-SDL.startTime|0}var SDL={defaults:{width:320,height:200,copyOnLock:true,discardOnLock:false,opaqueFrontBuffer:true},version:null,surfaces:{},canvasPool:[],events:[],fonts:[null],audios:[null],rwops:[null],music:{audio:null,volume:1},mixerFrequency:22050,mixerFormat:32784,mixerNumChannels:2,mixerChunkSize:1024,channelMinimumNumber:0,GL:false,glAttributes:{0:3,1:3,2:2,3:0,4:0,5:1,6:16,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:1,16:0,17:0,18:0},keyboardState:null,keyboardMap:{},canRequestFullscreen:false,isRequestingFullscreen:false,textInput:false,startTime:null,initFlags:0,buttonState:0,modState:0,DOMButtons:[0,0,0],DOMEventToSDLEvent:{},TOUCH_DEFAULT_ID:0,eventHandler:null,eventHandlerContext:null,eventHandlerTemp:0,keyCodes:{16:1249,17:1248,18:1250,20:1081,33:1099,34:1102,35:1101,36:1098,37:1104,38:1106,39:1103,40:1105,44:316,45:1097,46:127,91:1251,93:1125,96:1122,97:1113,98:1114,99:1115,100:1116,101:1117,102:1118,103:1119,104:1120,105:1121,106:1109,107:1111,109:1110,110:1123,111:1108,112:1082,113:1083,114:1084,115:1085,116:1086,117:1087,118:1088,119:1089,120:1090,121:1091,122:1092,123:1093,124:1128,125:1129,126:1130,127:1131,128:1132,129:1133,130:1134,131:1135,132:1136,133:1137,134:1138,135:1139,144:1107,160:94,161:33,162:34,163:35,164:36,165:37,166:38,167:95,168:40,169:41,170:42,171:43,172:124,173:45,174:123,175:125,176:126,181:127,182:129,183:128,188:44,190:46,191:47,192:96,219:91,220:92,221:93,222:39,224:1251},scanCodes:{8:42,9:43,13:40,27:41,32:44,35:204,39:53,44:54,46:55,47:56,48:39,49:30,50:31,51:32,52:33,53:34,54:35,55:36,56:37,57:38,58:203,59:51,61:46,91:47,92:49,93:48,96:52,97:4,98:5,99:6,100:7,101:8,102:9,103:10,104:11,105:12,106:13,107:14,108:15,109:16,110:17,111:18,112:19,113:20,114:21,115:22,116:23,117:24,118:25,119:26,120:27,121:28,122:29,127:76,305:224,308:226,316:70},loadRect:(function(rect){return{x:HEAP32[rect+0>>2],y:HEAP32[rect+4>>2],w:HEAP32[rect+8>>2],h:HEAP32[rect+12>>2]}}),updateRect:(function(rect,r){HEAP32[rect>>2]=r.x;HEAP32[rect+4>>2]=r.y;HEAP32[rect+8>>2]=r.w;HEAP32[rect+12>>2]=r.h}),intersectionOfRects:(function(first,second){var leftX=Math.max(first.x,second.x);var leftY=Math.max(first.y,second.y);var rightX=Math.min(first.x+first.w,second.x+second.w);var rightY=Math.min(first.y+first.h,second.y+second.h);return{x:leftX,y:leftY,w:Math.max(leftX,rightX)-leftX,h:Math.max(leftY,rightY)-leftY}}),checkPixelFormat:(function(fmt){}),loadColorToCSSRGB:(function(color){var rgba=HEAP32[color>>2];return"rgb("+(rgba&255)+","+(rgba>>8&255)+","+(rgba>>16&255)+")"}),loadColorToCSSRGBA:(function(color){var rgba=HEAP32[color>>2];return"rgba("+(rgba&255)+","+(rgba>>8&255)+","+(rgba>>16&255)+","+(rgba>>24&255)/255+")"}),translateColorToCSSRGBA:(function(rgba){return"rgba("+(rgba&255)+","+(rgba>>8&255)+","+(rgba>>16&255)+","+(rgba>>>24)/255+")"}),translateRGBAToCSSRGBA:(function(r,g,b,a){return"rgba("+(r&255)+","+(g&255)+","+(b&255)+","+(a&255)/255+")"}),translateRGBAToColor:(function(r,g,b,a){return r|g<<8|b<<16|a<<24}),makeSurface:(function(width,height,flags,usePageCanvas,source,rmask,gmask,bmask,amask){flags=flags||0;var is_SDL_HWSURFACE=flags&1;var is_SDL_HWPALETTE=flags&2097152;var is_SDL_OPENGL=flags&67108864;var surf=_malloc(60);var pixelFormat=_malloc(44);var bpp=is_SDL_HWPALETTE?1:4;var buffer=0;if(!is_SDL_HWSURFACE&&!is_SDL_OPENGL){buffer=_malloc(width*height*4)}HEAP32[surf>>2]=flags;HEAP32[surf+4>>2]=pixelFormat;HEAP32[surf+8>>2]=width;HEAP32[surf+12>>2]=height;HEAP32[surf+16>>2]=width*bpp;HEAP32[surf+20>>2]=buffer;HEAP32[surf+36>>2]=0;HEAP32[surf+40>>2]=0;HEAP32[surf+44>>2]=Module["canvas"].width;HEAP32[surf+48>>2]=Module["canvas"].height;HEAP32[surf+56>>2]=1;HEAP32[pixelFormat>>2]=-2042224636;HEAP32[pixelFormat+4>>2]=0;HEAP8[pixelFormat+8>>0]=bpp*8;HEAP8[pixelFormat+9>>0]=bpp;HEAP32[pixelFormat+12>>2]=rmask||255;HEAP32[pixelFormat+16>>2]=gmask||65280;HEAP32[pixelFormat+20>>2]=bmask||16711680;HEAP32[pixelFormat+24>>2]=amask||4278190080;SDL.GL=SDL.GL||is_SDL_OPENGL;var canvas;if(!usePageCanvas){if(SDL.canvasPool.length>0){canvas=SDL.canvasPool.pop()}else{canvas=document.createElement("canvas")}canvas.width=width;canvas.height=height}else{canvas=Module["canvas"]}var webGLContextAttributes={antialias:SDL.glAttributes[13]!=0&&SDL.glAttributes[14]>1,depth:SDL.glAttributes[6]>0,stencil:SDL.glAttributes[7]>0,alpha:SDL.glAttributes[3]>0};var ctx=Browser.createContext(canvas,is_SDL_OPENGL,usePageCanvas,webGLContextAttributes);SDL.surfaces[surf]={width:width,height:height,canvas:canvas,ctx:ctx,surf:surf,buffer:buffer,pixelFormat:pixelFormat,alpha:255,flags:flags,locked:0,usePageCanvas:usePageCanvas,source:source,isFlagSet:(function(flag){return flags&flag})};return surf}),copyIndexedColorData:(function(surfData,rX,rY,rW,rH){if(!surfData.colors){return}var fullWidth=Module["canvas"].width;var fullHeight=Module["canvas"].height;var startX=rX||0;var startY=rY||0;var endX=(rW||fullWidth-startX)+startX;var endY=(rH||fullHeight-startY)+startY;var buffer=surfData.buffer;if(!surfData.image.data32){surfData.image.data32=new Uint32Array(surfData.image.data.buffer)}var data32=surfData.image.data32;var colors32=surfData.colors32;for(var y=startY;y>0]]}}}),freeSurface:(function(surf){var refcountPointer=surf+56;var refcount=HEAP32[refcountPointer>>2];if(refcount>1){HEAP32[refcountPointer>>2]=refcount-1;return}var info=SDL.surfaces[surf];if(!info.usePageCanvas&&info.canvas)SDL.canvasPool.push(info.canvas);if(info.buffer)_free(info.buffer);_free(info.pixelFormat);_free(surf);SDL.surfaces[surf]=null;if(surf===SDL.screen){SDL.screen=null}}),blitSurface__deps:["SDL_LockSurface"],blitSurface:(function(src,srcrect,dst,dstrect,scale){var srcData=SDL.surfaces[src];var dstData=SDL.surfaces[dst];var sr,dr;if(srcrect){sr=SDL.loadRect(srcrect)}else{sr={x:0,y:0,w:srcData.width,h:srcData.height}}if(dstrect){dr=SDL.loadRect(dstrect)}else{dr={x:0,y:0,w:srcData.width,h:srcData.height}}if(dstData.clipRect){var widthScale=!scale||sr.w===0?1:sr.w/dr.w;var heightScale=!scale||sr.h===0?1:sr.h/dr.h;dr=SDL.intersectionOfRects(dstData.clipRect,dr);sr.w=dr.w*widthScale;sr.h=dr.h*heightScale;if(dstrect){SDL.updateRect(dstrect,dr)}}var blitw,blith;if(scale){blitw=dr.w;blith=dr.h}else{blitw=sr.w;blith=sr.h}if(sr.w===0||sr.h===0||blitw===0||blith===0){return 0}var oldAlpha=dstData.ctx.globalAlpha;dstData.ctx.globalAlpha=srcData.alpha/255;dstData.ctx.drawImage(srcData.canvas,sr.x,sr.y,sr.w,sr.h,dr.x,dr.y,blitw,blith);dstData.ctx.globalAlpha=oldAlpha;if(dst!=SDL.screen){warnOnce("WARNING: copying canvas data to memory for compatibility");_SDL_LockSurface(dst);dstData.locked--}return 0}),downFingers:{},savedKeydown:null,receiveEvent:(function(event){function unpressAllPressedKeys(){for(var code in SDL.keyboardMap){SDL.events.push({type:"keyup",keyCode:SDL.keyboardMap[code]})}}switch(event.type){case"touchstart":case"touchmove":{event.preventDefault();var touches=[];if(event.type==="touchstart"){for(var i=0;i0?Math.max(delta,1):Math.min(delta,-1);var button=delta>0?3:4;SDL.events.push({type:"mousedown",button:button,pageX:event.pageX,pageY:event.pageY});SDL.events.push({type:"mouseup",button:button,pageX:event.pageX,pageY:event.pageY});SDL.events.push({type:"wheel",deltaX:0,deltaY:delta});event.preventDefault();break;case"mousemove":if(SDL.DOMButtons[0]===1){SDL.events.push({type:"touchmove",touch:{identifier:0,deviceID:-1,pageX:event.pageX,pageY:event.pageY}})}if(Browser.pointerLock){if("mozMovementX"in event){event["movementX"]=event["mozMovementX"];event["movementY"]=event["mozMovementY"]}if(event["movementX"]==0&&event["movementY"]==0){event.preventDefault();return}};case"keydown":case"keyup":case"keypress":case"mousedown":case"mouseup":if(event.type!=="keydown"||!SDL.unicode&&!SDL.textInput||event.keyCode===8||event.keyCode===9){event.preventDefault()}if(event.type=="mousedown"){SDL.DOMButtons[event.button]=1;SDL.events.push({type:"touchstart",touch:{identifier:0,deviceID:-1,pageX:event.pageX,pageY:event.pageY}})}else if(event.type=="mouseup"){if(!SDL.DOMButtons[event.button]){return}SDL.events.push({type:"touchend",touch:{identifier:0,deviceID:-1,pageX:event.pageX,pageY:event.pageY}});SDL.DOMButtons[event.button]=0}if(event.type==="keydown"||event.type==="mousedown"){SDL.canRequestFullscreen=true}else if(event.type==="keyup"||event.type==="mouseup"){if(SDL.isRequestingFullscreen){Module["requestFullscreen"](true,true);SDL.isRequestingFullscreen=false}SDL.canRequestFullscreen=false}if(event.type==="keypress"&&SDL.savedKeydown){SDL.savedKeydown.keypressCharCode=event.charCode;SDL.savedKeydown=null}else if(event.type==="keydown"){SDL.savedKeydown=event}if(event.type!=="keypress"||SDL.textInput){SDL.events.push(event)}break;case"mouseout":for(var i=0;i<3;i++){if(SDL.DOMButtons[i]){SDL.events.push({type:"mouseup",button:i,pageX:event.pageX,pageY:event.pageY});SDL.DOMButtons[i]=0}}event.preventDefault();break;case"focus":SDL.events.push(event);event.preventDefault();break;case"blur":SDL.events.push(event);unpressAllPressedKeys();event.preventDefault();break;case"visibilitychange":SDL.events.push({type:"visibilitychange",visible:!document.hidden});unpressAllPressedKeys();event.preventDefault();break;case"unload":if(Browser.mainLoop.runner){SDL.events.push(event);Browser.mainLoop.runner()}return;case"resize":SDL.events.push(event);if(event.preventDefault){event.preventDefault()}break}if(SDL.events.length>=1e4){Module.printErr("SDL event queue full, dropping events");SDL.events=SDL.events.slice(0,1e4)}SDL.flushEventsToHandler();return}),lookupKeyCodeForEvent:(function(event){var code=event.keyCode;if(code>=65&&code<=90){code+=32}else{code=SDL.keyCodes[event.keyCode]||event.keyCode;if(event.location===KeyboardEvent.DOM_KEY_LOCATION_RIGHT&&code>=(224|1<<10)&&code<=(227|1<<10)){code+=4}}return code}),handleEvent:(function(event){if(event.handled)return;event.handled=true;switch(event.type){case"touchstart":case"touchend":case"touchmove":{Browser.calculateMouseEvent(event);break};case"keydown":case"keyup":{var down=event.type==="keydown";var code=SDL.lookupKeyCodeForEvent(event);HEAP8[SDL.keyboardState+code>>0]=down;SDL.modState=(HEAP8[SDL.keyboardState+1248>>0]?64:0)|(HEAP8[SDL.keyboardState+1249>>0]?1:0)|(HEAP8[SDL.keyboardState+1250>>0]?256:0)|(HEAP8[SDL.keyboardState+1252>>0]?128:0)|(HEAP8[SDL.keyboardState+1253>>0]?2:0)|(HEAP8[SDL.keyboardState+1254>>0]?512:0);if(down){SDL.keyboardMap[code]=event.keyCode}else{delete SDL.keyboardMap[code]}break};case"mousedown":case"mouseup":if(event.type=="mousedown"){SDL.buttonState|=1<0){if(SDL.makeCEvent(SDL.events.shift(),ptr)!==false)return 1}return 0}else{return SDL.events.length>0}}),makeCEvent:(function(event,ptr){if(typeof event==="number"){_memcpy(ptr,event,28);_free(event);return}SDL.handleEvent(event);switch(event.type){case"keydown":case"keyup":{var down=event.type==="keydown";var key=SDL.lookupKeyCodeForEvent(event);var scan;if(key>=1024){scan=key-1024}else{scan=SDL.scanCodes[key]||key}HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP8[ptr+8>>0]=down?1:0;HEAP8[ptr+9>>0]=0;HEAP32[ptr+12>>2]=scan;HEAP32[ptr+16>>2]=key;HEAP16[ptr+20>>1]=SDL.modState;HEAP32[ptr+24>>2]=event.keypressCharCode||key;break};case"keypress":{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];var cStr=intArrayFromString(String.fromCharCode(event.charCode));for(var i=0;i>0]=cStr[i]}break};case"mousedown":case"mouseup":case"mousemove":{if(event.type!="mousemove"){var down=event.type==="mousedown";HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=0;HEAP32[ptr+8>>2]=0;HEAP32[ptr+12>>2]=0;HEAP8[ptr+16>>0]=event.button+1;HEAP8[ptr+17>>0]=down?1:0;HEAP32[ptr+20>>2]=Browser.mouseX;HEAP32[ptr+24>>2]=Browser.mouseY}else{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=0;HEAP32[ptr+8>>2]=0;HEAP32[ptr+12>>2]=0;HEAP32[ptr+16>>2]=SDL.buttonState;HEAP32[ptr+20>>2]=Browser.mouseX;HEAP32[ptr+24>>2]=Browser.mouseY;HEAP32[ptr+28>>2]=Browser.mouseMovementX;HEAP32[ptr+32>>2]=Browser.mouseMovementY}break};case"wheel":{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+16>>2]=event.deltaX;HEAP32[ptr+20>>2]=event.deltaY;break};case"touchstart":case"touchend":case"touchmove":{var touch=event.touch;if(!Browser.touches[touch.identifier])break;var w=Module["canvas"].width;var h=Module["canvas"].height;var x=Browser.touches[touch.identifier].x/w;var y=Browser.touches[touch.identifier].y/h;var lx=Browser.lastTouches[touch.identifier].x/w;var ly=Browser.lastTouches[touch.identifier].y/h;var dx=x-lx;var dy=y-ly;if(touch["deviceID"]===undefined)touch.deviceID=SDL.TOUCH_DEFAULT_ID;if(dx===0&&dy===0&&event.type==="touchmove")return false;HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=_SDL_GetTicks();tempI64=[touch.deviceID>>>0,(tempDouble=touch.deviceID,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr+8>>2]=tempI64[0],HEAP32[ptr+12>>2]=tempI64[1];tempI64=[touch.identifier>>>0,(tempDouble=touch.identifier,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr+16>>2]=tempI64[0],HEAP32[ptr+20>>2]=tempI64[1];HEAPF32[ptr+24>>2]=x;HEAPF32[ptr+28>>2]=y;HEAPF32[ptr+32>>2]=dx;HEAPF32[ptr+36>>2]=dy;if(touch.force!==undefined){HEAPF32[ptr+40>>2]=touch.force}else{HEAPF32[ptr+40>>2]=event.type=="touchend"?0:1}break};case"unload":{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];break};case"resize":{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=event.w;HEAP32[ptr+8>>2]=event.h;break};case"joystick_button_up":case"joystick_button_down":{var state=event.type==="joystick_button_up"?0:1;HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP8[ptr+4>>0]=event.index;HEAP8[ptr+5>>0]=event.button;HEAP8[ptr+6>>0]=state;break};case"joystick_axis_motion":{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP8[ptr+4>>0]=event.index;HEAP8[ptr+5>>0]=event.axis;HEAP32[ptr+8>>2]=SDL.joystickAxisValueConversion(event.value);break};case"focus":{var SDL_WINDOWEVENT_FOCUS_GAINED=12;HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=0;HEAP8[ptr+8>>0]=SDL_WINDOWEVENT_FOCUS_GAINED;break};case"blur":{var SDL_WINDOWEVENT_FOCUS_LOST=13;HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=0;HEAP8[ptr+8>>0]=SDL_WINDOWEVENT_FOCUS_LOST;break};case"visibilitychange":{var SDL_WINDOWEVENT_SHOWN=1;var SDL_WINDOWEVENT_HIDDEN=2;var visibilityEventID=event.visible?SDL_WINDOWEVENT_SHOWN:SDL_WINDOWEVENT_HIDDEN;HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=0;HEAP8[ptr+8>>0]=visibilityEventID;break};default:throw"Unhandled SDL event: "+event.type}}),makeFontString:(function(height,fontName){if(fontName.charAt(0)!="'"&&fontName.charAt(0)!='"'){fontName='"'+fontName+'"'}return height+"px "+fontName+", serif"}),estimateTextWidth:(function(fontData,text){var h=fontData.size;var fontString=SDL.makeFontString(h,fontData.name);var tempCtx=SDL.ttfContext;tempCtx.save();tempCtx.font=fontString;var ret=tempCtx.measureText(text).width|0;tempCtx.restore();return ret}),allocateChannels:(function(num){if(SDL.numChannels&&SDL.numChannels>=num&&num!=0)return;SDL.numChannels=num;SDL.channels=[];for(var i=0;i>1]/32768}}else if(SDL.audio.format==8){for(var j=0;j>0];channelData[j]=(v>=0?v-128:v+128)/128}}else if(SDL.audio.format==33056){for(var j=0;j>2]}}else{throw"Invalid SDL audio format "+SDL.audio.format+"!"}}}),debugSurface:(function(surfData){console.log("dumping surface "+[surfData.surf,surfData.source,surfData.width,surfData.height]);var image=surfData.ctx.getImageData(0,0,surfData.width,surfData.height);var data=image.data;var num=Math.min(surfData.width,surfData.height);for(var i=0;i0}}),queryJoysticks:(function(){for(var joystick in SDL.lastJoystickState){var state=SDL.getGamepad(joystick-1);var prevState=SDL.lastJoystickState[joystick];if(typeof state==="undefined")return;if(typeof state.timestamp!=="number"||state.timestamp!==prevState.timestamp){var i;for(i=0;ideviceIndex&&deviceIndex>=0){return gamepads[deviceIndex]}return null})};function _SDL_GL_SwapBuffers(){if(Browser.doSwapBuffers)Browser.doSwapBuffers()}function ___cxa_allocate_exception(size){return _malloc(size)}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:(function(adjusted){if(!adjusted||EXCEPTIONS.infos[adjusted])return adjusted;for(var key in EXCEPTIONS.infos){var ptr=+key;var info=EXCEPTIONS.infos[ptr];if(info.adjusted===adjusted){return ptr}}return adjusted}),addRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount++}),decRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];assert(info.refcount>0);info.refcount--;if(info.refcount===0&&!info.rethrown){if(info.destructor){Module["dynCall_vi"](info.destructor,ptr)}delete EXCEPTIONS.infos[ptr];___cxa_free_exception(ptr)}}),clearRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount=0})};function ___cxa_begin_catch(ptr){var info=EXCEPTIONS.infos[ptr];if(info&&!info.caught){info.caught=true;__ZSt18uncaught_exceptionv.uncaught_exception--}if(info)info.rethrown=false;EXCEPTIONS.caught.push(ptr);EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(ptr));return ptr}function ___cxa_free_exception(ptr){try{return _free(ptr)}catch(e){}}function ___cxa_end_catch(){Module["setThrew"](0);var ptr=EXCEPTIONS.caught.pop();if(ptr){EXCEPTIONS.decRef(EXCEPTIONS.deAdjust(ptr));EXCEPTIONS.last=0}}function ___cxa_find_matching_catch_2(){return ___cxa_find_matching_catch.apply(null,arguments)}function ___cxa_find_matching_catch_3(){return ___cxa_find_matching_catch.apply(null,arguments)}function ___cxa_find_matching_catch_4(){return ___cxa_find_matching_catch.apply(null,arguments)}function ___cxa_pure_virtual(){ABORT=true;throw"Pure virtual function called!"}function ___cxa_rethrow(){var ptr=EXCEPTIONS.caught.pop();ptr=EXCEPTIONS.deAdjust(ptr);if(!EXCEPTIONS.infos[ptr].rethrown){EXCEPTIONS.caught.push(ptr);EXCEPTIONS.infos[ptr].rethrown=true}EXCEPTIONS.last=ptr;throw ptr}function ___resumeException(ptr){if(!EXCEPTIONS.last){EXCEPTIONS.last=ptr}throw ptr}function ___cxa_find_matching_catch(){var thrown=EXCEPTIONS.last;if(!thrown){return(setTempRet0(0),0)|0}var info=EXCEPTIONS.infos[thrown];var throwntype=info.type;if(!throwntype){return(setTempRet0(0),thrown)|0}var typeArray=Array.prototype.slice.call(arguments);var pointer=Module["___cxa_is_pointer_type"](throwntype);if(!___cxa_find_matching_catch.buffer)___cxa_find_matching_catch.buffer=_malloc(4);HEAP32[___cxa_find_matching_catch.buffer>>2]=thrown;thrown=___cxa_find_matching_catch.buffer;for(var i=0;i>2];info.adjusted=thrown;return(setTempRet0(typeArray[i]),thrown)|0}}thrown=HEAP32[thrown>>2];return(setTempRet0(throwntype),thrown)|0}function ___cxa_throw(ptr,type,destructor){EXCEPTIONS.infos[ptr]={ptr:ptr,adjusted:ptr,type:type,destructor:destructor,refcount:0,caught:false,rethrown:false};EXCEPTIONS.last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exception=1}else{__ZSt18uncaught_exceptionv.uncaught_exception++}throw ptr}function ___gxx_personality_v0(){}function ___lock(){}function ___map_file(pathname,size){___setErrNo(ERRNO_CODES.EPERM);return-1}var SYSCALLS={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:(function(dirfd,path){if(path[0]!=="/"){var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=FS.getStream(dirfd);if(!dirstream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);dir=dirstream.path}path=PATH.join2(dir,path)}return path}),doStat:(function(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-ERRNO_CODES.ENOTDIR}throw e}HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;HEAP32[buf+36>>2]=stat.size;HEAP32[buf+40>>2]=4096;HEAP32[buf+44>>2]=stat.blocks;HEAP32[buf+48>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+52>>2]=0;HEAP32[buf+56>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ino;return 0}),doMsync:(function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)}),doMkdir:(function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}),doMknod:(function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-ERRNO_CODES.EINVAL}FS.mknod(path,mode,dev);return 0}),doReadlink:(function(path,buf,bufsize){if(bufsize<=0)return-ERRNO_CODES.EINVAL;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}),doAccess:(function(path,amode){if(amode&~7){return-ERRNO_CODES.EINVAL}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-ERRNO_CODES.EACCES}return 0}),doDup:(function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd}),doReadv:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret}),varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),getStreamFromFD:(function(){var stream=FS.getStream(SYSCALLS.get());if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return stream}),getSocketFromFD:(function(){var socket=SOCKFS.getSocket(SYSCALLS.get());if(!socket)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return socket}),getSocketAddress:(function(allowNull){var addrp=SYSCALLS.get(),addrlen=SYSCALLS.get();if(allowNull&&addrp===0)return null;var info=__read_sockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall10(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.unlink(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var SOCKFS={mount:(function(mount){Module["websocket"]=Module["websocket"]&&"object"===typeof Module["websocket"]?Module["websocket"]:{};Module["websocket"]._callbacks={};Module["websocket"]["on"]=(function(event,callback){if("function"===typeof callback){this._callbacks[event]=callback}return this});Module["websocket"].emit=(function(event,param){if("function"===typeof this._callbacks[event]){this._callbacks[event].call(this,param)}});return FS.createNode(null,"/",16384|511,0)}),createSocket:(function(family,type,protocol){var streaming=type==1;if(protocol){assert(streaming==(protocol==6))}var sock={family:family,type:type,protocol:protocol,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops};var name=SOCKFS.nextname();var node=FS.createNode(SOCKFS.root,name,49152,0);node.sock=sock;var stream=FS.createStream({path:name,node:node,flags:FS.modeStringToFlags("r+"),seekable:false,stream_ops:SOCKFS.stream_ops});sock.stream=stream;return sock}),getSocket:(function(fd){var stream=FS.getStream(fd);if(!stream||!FS.isSocket(stream.node.mode)){return null}return stream.node.sock}),stream_ops:{poll:(function(stream){var sock=stream.node.sock;return sock.sock_ops.poll(sock)}),ioctl:(function(stream,request,varargs){var sock=stream.node.sock;return sock.sock_ops.ioctl(sock,request,varargs)}),read:(function(stream,buffer,offset,length,position){var sock=stream.node.sock;var msg=sock.sock_ops.recvmsg(sock,length);if(!msg){return 0}buffer.set(msg.buffer,offset);return msg.buffer.length}),write:(function(stream,buffer,offset,length,position){var sock=stream.node.sock;return sock.sock_ops.sendmsg(sock,buffer,offset,length)}),close:(function(stream){var sock=stream.node.sock;sock.sock_ops.close(sock)})},nextname:(function(){if(!SOCKFS.nextname.current){SOCKFS.nextname.current=0}return"socket["+SOCKFS.nextname.current++ +"]"}),websocket_sock_ops:{createPeer:(function(sock,addr,port){var ws;if(typeof addr==="object"){ws=addr;addr=null;port=null}if(ws){if(ws._socket){addr=ws._socket.remoteAddress;port=ws._socket.remotePort}else{var result=/ws[s]?:\/\/([^:]+):(\d+)/.exec(ws.url);if(!result){throw new Error("WebSocket URL must be in the format ws(s)://address:port")}addr=result[1];port=parseInt(result[2],10)}}else{try{var runtimeConfig=Module["websocket"]&&"object"===typeof Module["websocket"];var url="ws:#".replace("#","//");if(runtimeConfig){if("string"===typeof Module["websocket"]["url"]){url=Module["websocket"]["url"]}}if(url==="ws://"||url==="wss://"){var parts=addr.split("/");url=url+parts[0]+":"+port+"/"+parts.slice(1).join("/")}var subProtocols="binary";if(runtimeConfig){if("string"===typeof Module["websocket"]["subprotocol"]){subProtocols=Module["websocket"]["subprotocol"]}}subProtocols=subProtocols.replace(/^ +| +$/g,"").split(/ *, */);var opts=ENVIRONMENT_IS_NODE?{"protocol":subProtocols.toString()}:subProtocols;if(runtimeConfig&&null===Module["websocket"]["subprotocol"]){subProtocols="null";opts=undefined}var WebSocketConstructor;if(ENVIRONMENT_IS_NODE){WebSocketConstructor=require("ws")}else if(ENVIRONMENT_IS_WEB){WebSocketConstructor=window["WebSocket"]}else{WebSocketConstructor=WebSocket}ws=new WebSocketConstructor(url,opts);ws.binaryType="arraybuffer"}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EHOSTUNREACH)}}var peer={addr:addr,port:port,socket:ws,dgram_send_queue:[]};SOCKFS.websocket_sock_ops.addPeer(sock,peer);SOCKFS.websocket_sock_ops.handlePeerEvents(sock,peer);if(sock.type===2&&typeof sock.sport!=="undefined"){peer.dgram_send_queue.push(new Uint8Array([255,255,255,255,"p".charCodeAt(0),"o".charCodeAt(0),"r".charCodeAt(0),"t".charCodeAt(0),(sock.sport&65280)>>8,sock.sport&255]))}return peer}),getPeer:(function(sock,addr,port){return sock.peers[addr+":"+port]}),addPeer:(function(sock,peer){sock.peers[peer.addr+":"+peer.port]=peer}),removePeer:(function(sock,peer){delete sock.peers[peer.addr+":"+peer.port]}),handlePeerEvents:(function(sock,peer){var first=true;var handleOpen=(function(){Module["websocket"].emit("open",sock.stream.fd);try{var queued=peer.dgram_send_queue.shift();while(queued){peer.socket.send(queued);queued=peer.dgram_send_queue.shift()}}catch(e){peer.socket.close()}});function handleMessage(data){assert(typeof data!=="string"&&data.byteLength!==undefined);if(data.byteLength==0){return}data=new Uint8Array(data);var wasfirst=first;first=false;if(wasfirst&&data.length===10&&data[0]===255&&data[1]===255&&data[2]===255&&data[3]===255&&data[4]==="p".charCodeAt(0)&&data[5]==="o".charCodeAt(0)&&data[6]==="r".charCodeAt(0)&&data[7]==="t".charCodeAt(0)){var newport=data[8]<<8|data[9];SOCKFS.websocket_sock_ops.removePeer(sock,peer);peer.port=newport;SOCKFS.websocket_sock_ops.addPeer(sock,peer);return}sock.recv_queue.push({addr:peer.addr,port:peer.port,data:data});Module["websocket"].emit("message",sock.stream.fd)}if(ENVIRONMENT_IS_NODE){peer.socket.on("open",handleOpen);peer.socket.on("message",(function(data,flags){if(!flags.binary){return}handleMessage((new Uint8Array(data)).buffer)}));peer.socket.on("close",(function(){Module["websocket"].emit("close",sock.stream.fd)}));peer.socket.on("error",(function(error){sock.error=ERRNO_CODES.ECONNREFUSED;Module["websocket"].emit("error",[sock.stream.fd,sock.error,"ECONNREFUSED: Connection refused"])}))}else{peer.socket.onopen=handleOpen;peer.socket.onclose=(function(){Module["websocket"].emit("close",sock.stream.fd)});peer.socket.onmessage=function peer_socket_onmessage(event){handleMessage(event.data)};peer.socket.onerror=(function(error){sock.error=ERRNO_CODES.ECONNREFUSED;Module["websocket"].emit("error",[sock.stream.fd,sock.error,"ECONNREFUSED: Connection refused"])})}}),poll:(function(sock){if(sock.type===1&&sock.server){return sock.pending.length?64|1:0}var mask=0;var dest=sock.type===1?SOCKFS.websocket_sock_ops.getPeer(sock,sock.daddr,sock.dport):null;if(sock.recv_queue.length||!dest||dest&&dest.socket.readyState===dest.socket.CLOSING||dest&&dest.socket.readyState===dest.socket.CLOSED){mask|=64|1}if(!dest||dest&&dest.socket.readyState===dest.socket.OPEN){mask|=4}if(dest&&dest.socket.readyState===dest.socket.CLOSING||dest&&dest.socket.readyState===dest.socket.CLOSED){mask|=16}return mask}),ioctl:(function(sock,request,arg){switch(request){case 21531:var bytes=0;if(sock.recv_queue.length){bytes=sock.recv_queue[0].data.length}HEAP32[arg>>2]=bytes;return 0;default:return ERRNO_CODES.EINVAL}}),close:(function(sock){if(sock.server){try{sock.server.close()}catch(e){}sock.server=null}var peers=Object.keys(sock.peers);for(var i=0;i>>0}function __inet_pton6_raw(str){var words;var w,offset,z;var valid6regx=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i;var parts=[];if(!valid6regx.test(str)){return null}if(str==="::"){return[0,0,0,0,0,0,0,0]}if(str.indexOf("::")===0){str=str.replace("::","Z:")}else{str=str.replace("::",":Z:")}if(str.indexOf(".")>0){str=str.replace(new RegExp("[.]","g"),":");words=str.split(":");words[words.length-4]=parseInt(words[words.length-4])+parseInt(words[words.length-3])*256;words[words.length-3]=parseInt(words[words.length-2])+parseInt(words[words.length-1])*256;words=words.slice(0,words.length-2)}else{words=str.split(":")}offset=0;z=0;for(w=0;w>8&255)+"."+(addr>>16&255)+"."+(addr>>24&255)}function __inet_ntop6_raw(ints){var str="";var word=0;var longest=0;var lastzero=0;var zstart=0;var len=0;var i=0;var parts=[ints[0]&65535,ints[0]>>16,ints[1]&65535,ints[1]>>16,ints[2]&65535,ints[2]>>16,ints[3]&65535,ints[3]>>16];var hasipv4=true;var v4part="";for(i=0;i<5;i++){if(parts[i]!==0){hasipv4=false;break}}if(hasipv4){v4part=__inet_ntop4_raw(parts[6]|parts[7]<<16);if(parts[5]===-1){str="::ffff:";str+=v4part;return str}if(parts[5]===0){str="::";if(v4part==="0.0.0.0")v4part="";if(v4part==="0.0.0.1")v4part="1";str+=v4part;return str}}for(word=0;word<8;word++){if(parts[word]===0){if(word-lastzero>1){len=0}lastzero=word;len++}if(len>longest){longest=len;zstart=word-longest+1}}for(word=0;word<8;word++){if(longest>1){if(parts[word]===0&&word>=zstart&&word>1];var port=_ntohs(HEAP16[sa+2>>1]);var addr;switch(family){case 2:if(salen!==16){return{errno:ERRNO_CODES.EINVAL}}addr=HEAP32[sa+4>>2];addr=__inet_ntop4_raw(addr);break;case 10:if(salen!==28){return{errno:ERRNO_CODES.EINVAL}}addr=[HEAP32[sa+8>>2],HEAP32[sa+12>>2],HEAP32[sa+16>>2],HEAP32[sa+20>>2]];addr=__inet_ntop6_raw(addr);break;default:return{errno:ERRNO_CODES.EAFNOSUPPORT}}return{family:family,addr:addr,port:port}}function __write_sockaddr(sa,family,addr,port){switch(family){case 2:addr=__inet_pton4_raw(addr);HEAP16[sa>>1]=family;HEAP32[sa+4>>2]=addr;HEAP16[sa+2>>1]=_htons(port);break;case 10:addr=__inet_pton6_raw(addr);HEAP32[sa>>2]=family;HEAP32[sa+8>>2]=addr[0];HEAP32[sa+12>>2]=addr[1];HEAP32[sa+16>>2]=addr[2];HEAP32[sa+20>>2]=addr[3];HEAP16[sa+2>>1]=_htons(port);HEAP32[sa+4>>2]=0;HEAP32[sa+24>>2]=0;break;default:return{errno:ERRNO_CODES.EAFNOSUPPORT}}return{}}function ___syscall102(which,varargs){SYSCALLS.varargs=varargs;try{var call=SYSCALLS.get(),socketvararg=SYSCALLS.get();SYSCALLS.varargs=socketvararg;switch(call){case 1:{var domain=SYSCALLS.get(),type=SYSCALLS.get(),protocol=SYSCALLS.get();var sock=SOCKFS.createSocket(domain,type,protocol);assert(sock.stream.fd<64);return sock.stream.fd};case 2:{var sock=SYSCALLS.getSocketFromFD(),info=SYSCALLS.getSocketAddress();sock.sock_ops.bind(sock,info.addr,info.port);return 0};case 3:{var sock=SYSCALLS.getSocketFromFD(),info=SYSCALLS.getSocketAddress();sock.sock_ops.connect(sock,info.addr,info.port);return 0};case 4:{var sock=SYSCALLS.getSocketFromFD(),backlog=SYSCALLS.get();sock.sock_ops.listen(sock,backlog);return 0};case 5:{var sock=SYSCALLS.getSocketFromFD(),addr=SYSCALLS.get(),addrlen=SYSCALLS.get();var newsock=sock.sock_ops.accept(sock);if(addr){var res=__write_sockaddr(addr,newsock.family,DNS.lookup_name(newsock.daddr),newsock.dport);assert(!res.errno)}return newsock.stream.fd};case 6:{var sock=SYSCALLS.getSocketFromFD(),addr=SYSCALLS.get(),addrlen=SYSCALLS.get();var res=__write_sockaddr(addr,sock.family,DNS.lookup_name(sock.saddr||"0.0.0.0"),sock.sport);assert(!res.errno);return 0};case 7:{var sock=SYSCALLS.getSocketFromFD(),addr=SYSCALLS.get(),addrlen=SYSCALLS.get();if(!sock.daddr){return-ERRNO_CODES.ENOTCONN}var res=__write_sockaddr(addr,sock.family,DNS.lookup_name(sock.daddr),sock.dport);assert(!res.errno);return 0};case 11:{var sock=SYSCALLS.getSocketFromFD(),message=SYSCALLS.get(),length=SYSCALLS.get(),flags=SYSCALLS.get(),dest=SYSCALLS.getSocketAddress(true);if(!dest){return FS.write(sock.stream,HEAP8,message,length)}else{return sock.sock_ops.sendmsg(sock,HEAP8,message,length,dest.addr,dest.port)}};case 12:{var sock=SYSCALLS.getSocketFromFD(),buf=SYSCALLS.get(),len=SYSCALLS.get(),flags=SYSCALLS.get(),addr=SYSCALLS.get(),addrlen=SYSCALLS.get();var msg=sock.sock_ops.recvmsg(sock,len);if(!msg)return 0;if(addr){var res=__write_sockaddr(addr,sock.family,DNS.lookup_name(msg.addr),msg.port);assert(!res.errno)}HEAPU8.set(msg.buffer,buf);return msg.buffer.byteLength};case 14:{return-ERRNO_CODES.ENOPROTOOPT};case 15:{var sock=SYSCALLS.getSocketFromFD(),level=SYSCALLS.get(),optname=SYSCALLS.get(),optval=SYSCALLS.get(),optlen=SYSCALLS.get();if(level===1){if(optname===4){HEAP32[optval>>2]=sock.error;HEAP32[optlen>>2]=4;sock.error=null;return 0}}return-ERRNO_CODES.ENOPROTOOPT};case 16:{var sock=SYSCALLS.getSocketFromFD(),message=SYSCALLS.get(),flags=SYSCALLS.get();var iov=HEAP32[message+8>>2];var num=HEAP32[message+12>>2];var addr,port;var name=HEAP32[message>>2];var namelen=HEAP32[message+4>>2];if(name){var info=__read_sockaddr(name,namelen);if(info.errno)return-info.errno;port=info.port;addr=DNS.lookup_addr(info.addr)||info.addr}var total=0;for(var i=0;i>2]}var view=new Uint8Array(total);var offset=0;for(var i=0;i>2];var iovlen=HEAP32[iov+(8*i+4)>>2];for(var j=0;j>0]}}return sock.sock_ops.sendmsg(sock,view,0,total,addr,port)};case 17:{var sock=SYSCALLS.getSocketFromFD(),message=SYSCALLS.get(),flags=SYSCALLS.get();var iov=HEAP32[message+8>>2];var num=HEAP32[message+12>>2];var total=0;for(var i=0;i>2]}var msg=sock.sock_ops.recvmsg(sock,total);if(!msg)return 0;var name=HEAP32[message>>2];if(name){var res=__write_sockaddr(name,sock.family,DNS.lookup_name(msg.addr),msg.port);assert(!res.errno)}var bytesRead=0;var bytesRemaining=msg.buffer.byteLength;for(var i=0;bytesRemaining>0&&i>2];var iovlen=HEAP32[iov+(8*i+4)>>2];if(!iovlen){continue}var length=Math.min(iovlen,bytesRemaining);var buf=msg.buffer.subarray(bytesRead,bytesRead+length);HEAPU8.set(buf,iovbase+bytesRead);bytesRead+=length;bytesRemaining-=length}return bytesRead};default:abort("unsupported socketcall syscall "+call)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall122(which,varargs){SYSCALLS.varargs=varargs;try{var buf=SYSCALLS.get();if(!buf)return-ERRNO_CODES.EFAULT;var layout={"sysname":0,"nodename":65,"domainname":325,"machine":260,"version":195,"release":130,"__size__":390};function copyString(element,value){var offset=layout[element];writeAsciiToMemory(value,buf+offset)}copyString("sysname","Emscripten");copyString("nodename","emscripten");copyString("release","1.0");copyString("version","#1");copyString("machine","x86-JS");return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall142(which,varargs){SYSCALLS.varargs=varargs;try{var nfds=SYSCALLS.get(),readfds=SYSCALLS.get(),writefds=SYSCALLS.get(),exceptfds=SYSCALLS.get(),timeout=SYSCALLS.get();assert(nfds<=64,"nfds must be less than or equal to 64");assert(!exceptfds,"exceptfds not supported");var total=0;var srcReadLow=readfds?HEAP32[readfds>>2]:0,srcReadHigh=readfds?HEAP32[readfds+4>>2]:0;var srcWriteLow=writefds?HEAP32[writefds>>2]:0,srcWriteHigh=writefds?HEAP32[writefds+4>>2]:0;var srcExceptLow=exceptfds?HEAP32[exceptfds>>2]:0,srcExceptHigh=exceptfds?HEAP32[exceptfds+4>>2]:0;var dstReadLow=0,dstReadHigh=0;var dstWriteLow=0,dstWriteHigh=0;var dstExceptLow=0,dstExceptHigh=0;var allLow=(readfds?HEAP32[readfds>>2]:0)|(writefds?HEAP32[writefds>>2]:0)|(exceptfds?HEAP32[exceptfds>>2]:0);var allHigh=(readfds?HEAP32[readfds+4>>2]:0)|(writefds?HEAP32[writefds+4>>2]:0)|(exceptfds?HEAP32[exceptfds+4>>2]:0);function check(fd,low,high,val){return fd<32?low&val:high&val}for(var fd=0;fd>2]=dstReadLow;HEAP32[readfds+4>>2]=dstReadHigh}if(writefds){HEAP32[writefds>>2]=dstWriteLow;HEAP32[writefds+4>>2]=dstWriteHigh}if(exceptfds){HEAP32[exceptfds>>2]=dstExceptLow;HEAP32[exceptfds+4>>2]=dstExceptHigh}return total}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doWritev(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall15(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),mode=SYSCALLS.get();FS.chmod(path,mode);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall183(which,varargs){SYSCALLS.varargs=varargs;try{var buf=SYSCALLS.get(),size=SYSCALLS.get();if(size===0)return-ERRNO_CODES.EINVAL;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd);if(size0&&pos+268<=count){var id;var type;var name=stream.getdents.pop();if(name[0]==="."){id=1;type=4}else{var child=FS.lookupNode(stream.node,name);id=child.id;type=FS.isChrdev(child.mode)?2:FS.isDir(child.mode)?4:FS.isLink(child.mode)?10:8}HEAP32[dirp+pos>>2]=id;HEAP32[dirp+pos+4>>2]=stream.position;HEAP16[dirp+pos+8>>1]=268;HEAP8[dirp+pos+10>>0]=type;stringToUTF8(name,dirp+pos+11,256);pos+=268}return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-ERRNO_CODES.EINVAL}var newStream;newStream=FS.open(stream.path,stream.flags,0,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:case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0};case 13:case 14:case 13:case 14:return 0;case 16:case 8:return-ERRNO_CODES.EINVAL;case 9:___setErrNo(ERRNO_CODES.EINVAL);return-1;default:{return-ERRNO_CODES.EINVAL}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall268(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),size=SYSCALLS.get(),buf=SYSCALLS.get();assert(size===64);HEAP32[buf+4>>2]=4096;HEAP32[buf+40>>2]=4096;HEAP32[buf+8>>2]=1e6;HEAP32[buf+12>>2]=5e5;HEAP32[buf+16>>2]=5e5;HEAP32[buf+20>>2]=FS.nextInode;HEAP32[buf+24>>2]=1e6;HEAP32[buf+28>>2]=42;HEAP32[buf+44>>2]=2;HEAP32[buf+36>>2]=255;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.read(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall33(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),amode=SYSCALLS.get();return SYSCALLS.doAccess(path,amode)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall38(which,varargs){SYSCALLS.varargs=varargs;try{var old_path=SYSCALLS.getStr(),new_path=SYSCALLS.getStr();FS.rename(old_path,new_path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall39(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),mode=SYSCALLS.get();return SYSCALLS.doMkdir(path,mode)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall4(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.write(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall40(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr();FS.rmdir(path);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall41(which,varargs){SYSCALLS.varargs=varargs;try{var old=SYSCALLS.getStreamFromFD();return FS.open(old.path,old.flags,0).fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount:(function(mount){return FS.createNode(null,"/",16384|511,0)}),createPipe:(function(){var pipe={buckets:[]};pipe.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var rName=PIPEFS.nextname();var wName=PIPEFS.nextname();var rNode=FS.createNode(PIPEFS.root,rName,4096,0);var wNode=FS.createNode(PIPEFS.root,wName,4096,0);rNode.pipe=pipe;wNode.pipe=pipe;var readableStream=FS.createStream({path:rName,node:rNode,flags:FS.modeStringToFlags("r"),seekable:false,stream_ops:PIPEFS.stream_ops});rNode.stream=readableStream;var writableStream=FS.createStream({path:wName,node:wNode,flags:FS.modeStringToFlags("w"),seekable:false,stream_ops:PIPEFS.stream_ops});wNode.stream=writableStream;return{readable_fd:readableStream.fd,writable_fd:writableStream.fd}}),stream_ops:{poll:(function(stream){var pipe=stream.node.pipe;if((stream.flags&2097155)===1){return 256|4}else{if(pipe.buckets.length>0){for(var i=0;i0){return 64|1}}}}return 0}),ioctl:(function(stream,request,varargs){return ERRNO_CODES.EINVAL}),read:(function(stream,buffer,offset,length,position){var pipe=stream.node.pipe;var currentLength=0;for(var i=0;i=dataLen){currBucket.buffer.set(data,currBucket.offset);currBucket.offset+=dataLen;return dataLen}else if(freeBytesInCurrBuffer>0){currBucket.buffer.set(data.subarray(0,freeBytesInCurrBuffer),currBucket.offset);currBucket.offset+=freeBytesInCurrBuffer;data=data.subarray(freeBytesInCurrBuffer,data.byteLength)}var numBuckets=data.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0;var remElements=data.byteLength%PIPEFS.BUCKET_BUFFER_SIZE;for(var i=0;i0){var newBucket={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:data.byteLength,roffset:0};pipe.buckets.push(newBucket);newBucket.buffer.set(data)}return dataLen}),close:(function(stream){var pipe=stream.node.pipe;pipe.buckets=null})},nextname:(function(){if(!PIPEFS.nextname.current){PIPEFS.nextname.current=0}return"pipe["+PIPEFS.nextname.current++ +"]"})};function ___syscall42(which,varargs){SYSCALLS.varargs=varargs;try{var fdPtr=SYSCALLS.get();if(fdPtr==0){throw new FS.ErrnoError(ERRNO_CODES.EFAULT)}var res=PIPEFS.createPipe();HEAP32[fdPtr>>2]=res.readable_fd;HEAP32[fdPtr+4>>2]=res.writable_fd;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21509:case 21505:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21519:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0};case 21520:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return-ERRNO_CODES.EINVAL};case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)};case 21523:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21524:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall77(which,varargs){SYSCALLS.varargs=varargs;try{var who=SYSCALLS.get(),usage=SYSCALLS.get();_memset(usage,0,136);HEAP32[usage>>2]=1;HEAP32[usage+4>>2]=2;HEAP32[usage+8>>2]=3;HEAP32[usage+12>>2]=4;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall85(which,varargs){SYSCALLS.varargs=varargs;try{var path=SYSCALLS.getStr(),buf=SYSCALLS.get(),bufsize=SYSCALLS.get();return SYSCALLS.doReadlink(path,buf,bufsize)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall91(which,varargs){SYSCALLS.varargs=varargs;try{var addr=SYSCALLS.get(),len=SYSCALLS.get();var info=SYSCALLS.mappings[addr];if(!info)return 0;if(len===info.len){var stream=FS.getStream(info.fd);SYSCALLS.doMsync(addr,stream,len,info.flags);FS.munmap(stream);SYSCALLS.mappings[addr]=null;if(info.allocated){_free(info.malloc)}}return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function _abort(){Module["abort"]()}function _atexit(func,arg){__ATEXIT__.unshift({func:func,arg:arg})}function _clock(){if(_clock.start===undefined)_clock.start=Date.now();return(Date.now()-_clock.start)*(1e6/1e3)|0}function _emscripten_get_now_res(){if(ENVIRONMENT_IS_NODE){return 1}else if(typeof dateNow!=="undefined"||(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]){return 1e3}else{return 1e3*1e3}}function _emscripten_get_now_is_monotonic(){return ENVIRONMENT_IS_NODE||typeof dateNow!=="undefined"||(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]}function _clock_getres(clk_id,res){var nsec;if(clk_id===0){nsec=1e3*1e3}else if(clk_id===1&&_emscripten_get_now_is_monotonic()){nsec=_emscripten_get_now_res()}else{___setErrNo(ERRNO_CODES.EINVAL);return-1}HEAP32[res>>2]=nsec/1e9|0;HEAP32[res+4>>2]=nsec;return 0}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if(clk_id===1&&_emscripten_get_now_is_monotonic()){now=_emscripten_get_now()}else{___setErrNo(ERRNO_CODES.EINVAL);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}function _difftime(time1,time0){return time1-time0}var DLFCN={error:null,errorMsg:null,loadedLibs:{},loadedLibNames:{}};function _dlclose(handle){if(!DLFCN.loadedLibs[handle]){DLFCN.errorMsg="Tried to dlclose() unopened handle: "+handle;return 1}else{var lib_record=DLFCN.loadedLibs[handle];if(--lib_record.refcount==0){if(lib_record.module.cleanups){lib_record.module.cleanups.forEach((function(cleanup){cleanup()}))}delete DLFCN.loadedLibNames[lib_record.name];delete DLFCN.loadedLibs[handle]}return 0}}function _dlopen(filename,flag){abort("To use dlopen, you need to use Emscripten's linking support, see https://github.com/kripken/emscripten/wiki/Linking");var searchpaths=[];if(filename===0){filename="__self__"}else{var strfilename=Pointer_stringify(filename);var isValidFile=(function(filename){var target=FS.findObject(filename);return target&&!target.isFolder&&!target.isDevice});if(isValidFile(strfilename)){filename=strfilename}else{if(ENV["LD_LIBRARY_PATH"]){searchpaths=ENV["LD_LIBRARY_PATH"].split(":")}for(var ident in searchpaths){var searchfile=PATH.join2(searchpaths[ident],strfilename);if(isValidFile(searchfile)){filename=searchfile;break}}}}if(DLFCN.loadedLibNames[filename]){var handle=DLFCN.loadedLibNames[filename];DLFCN.loadedLibs[handle].refcount++;return handle}if(filename==="__self__"){var handle=-1;var lib_module=Module}else{var target=FS.findObject(filename);if(!target||target.isFolder||target.isDevice){DLFCN.errorMsg="Could not find dynamic lib: "+filename;return 0}FS.forceLoadFile(target);var lib_module;try{var lib_data=FS.readFile(filename,{encoding:"binary"});if(!(lib_data instanceof Uint8Array))lib_data=new Uint8Array(lib_data);lib_module=loadWebAssemblyModule(lib_data)}catch(e){DLFCN.errorMsg="Could not evaluate dynamic lib: "+filename+"\n"+e;return 0}var handle=1;for(var key in DLFCN.loadedLibs){if(DLFCN.loadedLibs.hasOwnProperty(key))handle++}if(flag&256){for(var ident in lib_module){if(lib_module.hasOwnProperty(ident)){if(ident[0]=="_"){Module[ident]=lib_module[ident]}}}}}DLFCN.loadedLibs[handle]={refcount:1,name:filename,module:lib_module};DLFCN.loadedLibNames[filename]=handle;return handle}function _dlsym(handle,symbol){symbol=Pointer_stringify(symbol);if(!DLFCN.loadedLibs[handle]){DLFCN.errorMsg="Tried to dlsym() from an unopened handle: "+handle;return 0}else{var lib=DLFCN.loadedLibs[handle];symbol="_"+symbol;if(!lib.module.hasOwnProperty(symbol)){DLFCN.errorMsg='Tried to lookup unknown symbol "'+symbol+'" in dynamic lib: '+lib.name;return 0}else{var result=lib.module[symbol];if(typeof result==="function"){return addFunction(result)}return result}}}function _emscripten_cancel_main_loop(){Browser.mainLoop.pause();Browser.mainLoop.func=null}var JSEvents={keyEvent:0,mouseEvent:0,wheelEvent:0,uiEvent:0,focusEvent:0,deviceOrientationEvent:0,deviceMotionEvent:0,fullscreenChangeEvent:0,pointerlockChangeEvent:0,visibilityChangeEvent:0,touchEvent:0,lastGamepadState:null,lastGamepadStateFrame:null,numGamepadsConnected:0,previousFullscreenElement:null,previousScreenX:null,previousScreenY:null,removeEventListenersRegistered:false,staticInit:(function(){if(typeof window!=="undefined"){window.addEventListener("gamepadconnected",(function(){++JSEvents.numGamepadsConnected}));window.addEventListener("gamepaddisconnected",(function(){--JSEvents.numGamepadsConnected}));var firstState=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():null;if(firstState){JSEvents.numGamepadsConnected=firstState.length}}}),registerRemoveEventListeners:(function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push((function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}}));JSEvents.removeEventListenersRegistered=true}}),findEventTarget:(function(target){if(target){if(typeof target=="number"){target=Pointer_stringify(target)}if(target=="#window")return window;else if(target=="#document")return document;else if(target=="#screen")return window.screen;else if(target=="#canvas")return Module["canvas"];if(typeof target=="string")return document.getElementById(target);else return target}else{return window}}),deferredCalls:[],deferCall:(function(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((function(x,y){return x.precedence0}),removeAllHandlersOnTarget:(function(target,eventTypeString){for(var i=0;i>2]=e.location;HEAP32[JSEvents.keyEvent+68>>2]=e.ctrlKey;HEAP32[JSEvents.keyEvent+72>>2]=e.shiftKey;HEAP32[JSEvents.keyEvent+76>>2]=e.altKey;HEAP32[JSEvents.keyEvent+80>>2]=e.metaKey;HEAP32[JSEvents.keyEvent+84>>2]=e.repeat;stringToUTF8(e.locale?e.locale:"",JSEvents.keyEvent+88,32);stringToUTF8(e.char?e.char:"",JSEvents.keyEvent+120,32);HEAP32[JSEvents.keyEvent+152>>2]=e.charCode;HEAP32[JSEvents.keyEvent+156>>2]=e.keyCode;HEAP32[JSEvents.keyEvent+160>>2]=e.which;var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.keyEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:JSEvents.isInternetExplorer()?false:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),getBoundingClientRectOrZeros:(function(target){return target.getBoundingClientRect?target.getBoundingClientRect():{left:0,top:0}}),fillMouseEventData:(function(eventStruct,e,target){HEAPF64[eventStruct>>3]=JSEvents.tick();HEAP32[eventStruct+8>>2]=e.screenX;HEAP32[eventStruct+12>>2]=e.screenY;HEAP32[eventStruct+16>>2]=e.clientX;HEAP32[eventStruct+20>>2]=e.clientY;HEAP32[eventStruct+24>>2]=e.ctrlKey;HEAP32[eventStruct+28>>2]=e.shiftKey;HEAP32[eventStruct+32>>2]=e.altKey;HEAP32[eventStruct+36>>2]=e.metaKey;HEAP16[eventStruct+40>>1]=e.button;HEAP16[eventStruct+42>>1]=e.buttons;HEAP32[eventStruct+44>>2]=e["movementX"]||e["mozMovementX"]||e["webkitMovementX"]||e.screenX-JSEvents.previousScreenX;HEAP32[eventStruct+48>>2]=e["movementY"]||e["mozMovementY"]||e["webkitMovementY"]||e.screenY-JSEvents.previousScreenY;if(Module["canvas"]){var rect=Module["canvas"].getBoundingClientRect();HEAP32[eventStruct+60>>2]=e.clientX-rect.left;HEAP32[eventStruct+64>>2]=e.clientY-rect.top}else{HEAP32[eventStruct+60>>2]=0;HEAP32[eventStruct+64>>2]=0}if(target){var rect=JSEvents.getBoundingClientRectOrZeros(target);HEAP32[eventStruct+52>>2]=e.clientX-rect.left;HEAP32[eventStruct+56>>2]=e.clientY-rect.top}else{HEAP32[eventStruct+52>>2]=0;HEAP32[eventStruct+56>>2]=0}if(e.type!=="wheel"&&e.type!=="mousewheel"){JSEvents.previousScreenX=e.screenX;JSEvents.previousScreenY=e.screenY}}),registerMouseEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.mouseEvent){JSEvents.mouseEvent=_malloc(72)}target=JSEvents.findEventTarget(target);var handlerFunc=(function(event){var e=event||window.event;JSEvents.fillMouseEventData(JSEvents.mouseEvent,e,target);var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.mouseEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:target,allowsDeferredCalls:eventTypeString!="mousemove"&&eventTypeString!="mouseenter"&&eventTypeString!="mouseleave",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};if(JSEvents.isInternetExplorer()&&eventTypeString=="mousedown")eventHandler.allowsDeferredCalls=false;JSEvents.registerOrRemoveHandler(eventHandler)}),registerWheelEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.wheelEvent){JSEvents.wheelEvent=_malloc(104)}target=JSEvents.findEventTarget(target);var wheelHandlerFunc=(function(event){var e=event||window.event;JSEvents.fillMouseEventData(JSEvents.wheelEvent,e,target);HEAPF64[JSEvents.wheelEvent+72>>3]=e["deltaX"];HEAPF64[JSEvents.wheelEvent+80>>3]=e["deltaY"];HEAPF64[JSEvents.wheelEvent+88>>3]=e["deltaZ"];HEAP32[JSEvents.wheelEvent+96>>2]=e["deltaMode"];var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.wheelEvent,userData);if(shouldCancel){e.preventDefault()}});var mouseWheelHandlerFunc=(function(event){var e=event||window.event;JSEvents.fillMouseEventData(JSEvents.wheelEvent,e,target);HEAPF64[JSEvents.wheelEvent+72>>3]=e["wheelDeltaX"]||0;HEAPF64[JSEvents.wheelEvent+80>>3]=-(e["wheelDeltaY"]?e["wheelDeltaY"]:e["wheelDelta"]);HEAPF64[JSEvents.wheelEvent+88>>3]=0;HEAP32[JSEvents.wheelEvent+96>>2]=0;var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.wheelEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:target,allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:eventTypeString=="wheel"?wheelHandlerFunc:mouseWheelHandlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),pageScrollPos:(function(){if(window.pageXOffset>0||window.pageYOffset>0){return[window.pageXOffset,window.pageYOffset]}if(typeof document.documentElement.scrollLeft!=="undefined"||typeof document.documentElement.scrollTop!=="undefined"){return[document.documentElement.scrollLeft,document.documentElement.scrollTop]}return[document.body.scrollLeft|0,document.body.scrollTop|0]}),registerUiEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.uiEvent){JSEvents.uiEvent=_malloc(36)}if(eventTypeString=="scroll"&&!target){target=document}else{target=JSEvents.findEventTarget(target)}var handlerFunc=(function(event){var e=event||window.event;if(e.target!=target){return}var scrollPos=JSEvents.pageScrollPos();HEAP32[JSEvents.uiEvent>>2]=e.detail;HEAP32[JSEvents.uiEvent+4>>2]=document.body.clientWidth;HEAP32[JSEvents.uiEvent+8>>2]=document.body.clientHeight;HEAP32[JSEvents.uiEvent+12>>2]=window.innerWidth;HEAP32[JSEvents.uiEvent+16>>2]=window.innerHeight;HEAP32[JSEvents.uiEvent+20>>2]=window.outerWidth;HEAP32[JSEvents.uiEvent+24>>2]=window.outerHeight;HEAP32[JSEvents.uiEvent+28>>2]=scrollPos[0];HEAP32[JSEvents.uiEvent+32>>2]=scrollPos[1];var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.uiEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),getNodeNameForTarget:(function(target){if(!target)return"";if(target==window)return"#window";if(target==window.screen)return"#screen";return target&&target.nodeName?target.nodeName:""}),registerFocusEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.focusEvent){JSEvents.focusEvent=_malloc(256)}var handlerFunc=(function(event){var e=event||window.event;var nodeName=JSEvents.getNodeNameForTarget(e.target);var id=e.target.id?e.target.id:"";stringToUTF8(nodeName,JSEvents.focusEvent+0,128);stringToUTF8(id,JSEvents.focusEvent+128,128);var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.focusEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),tick:(function(){if(window["performance"]&&window["performance"]["now"])return window["performance"]["now"]();else return Date.now()}),registerDeviceOrientationEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.deviceOrientationEvent){JSEvents.deviceOrientationEvent=_malloc(40)}var handlerFunc=(function(event){var e=event||window.event;HEAPF64[JSEvents.deviceOrientationEvent>>3]=JSEvents.tick();HEAPF64[JSEvents.deviceOrientationEvent+8>>3]=e.alpha;HEAPF64[JSEvents.deviceOrientationEvent+16>>3]=e.beta;HEAPF64[JSEvents.deviceOrientationEvent+24>>3]=e.gamma;HEAP32[JSEvents.deviceOrientationEvent+32>>2]=e.absolute;var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.deviceOrientationEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),registerDeviceMotionEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.deviceMotionEvent){JSEvents.deviceMotionEvent=_malloc(80)}var handlerFunc=(function(event){var e=event||window.event;HEAPF64[JSEvents.deviceMotionEvent>>3]=JSEvents.tick();HEAPF64[JSEvents.deviceMotionEvent+8>>3]=e.acceleration.x;HEAPF64[JSEvents.deviceMotionEvent+16>>3]=e.acceleration.y;HEAPF64[JSEvents.deviceMotionEvent+24>>3]=e.acceleration.z;HEAPF64[JSEvents.deviceMotionEvent+32>>3]=e.accelerationIncludingGravity.x;HEAPF64[JSEvents.deviceMotionEvent+40>>3]=e.accelerationIncludingGravity.y;HEAPF64[JSEvents.deviceMotionEvent+48>>3]=e.accelerationIncludingGravity.z;HEAPF64[JSEvents.deviceMotionEvent+56>>3]=e.rotationRate.alpha;HEAPF64[JSEvents.deviceMotionEvent+64>>3]=e.rotationRate.beta;HEAPF64[JSEvents.deviceMotionEvent+72>>3]=e.rotationRate.gamma;var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.deviceMotionEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),screenOrientation:(function(){if(!window.screen)return undefined;return window.screen.orientation||window.screen.mozOrientation||window.screen.webkitOrientation||window.screen.msOrientation}),fillOrientationChangeEventData:(function(eventStruct,e){var orientations=["portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];var orientations2=["portrait","portrait","landscape","landscape"];var orientationString=JSEvents.screenOrientation();var orientation=orientations.indexOf(orientationString);if(orientation==-1){orientation=orientations2.indexOf(orientationString)}HEAP32[eventStruct>>2]=1<>2]=window.orientation}),registerOrientationChangeEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.orientationChangeEvent){JSEvents.orientationChangeEvent=_malloc(8)}if(!target){target=window.screen}else{target=JSEvents.findEventTarget(target)}var handlerFunc=(function(event){var e=event||window.event;JSEvents.fillOrientationChangeEventData(JSEvents.orientationChangeEvent,e);var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.orientationChangeEvent,userData);if(shouldCancel){e.preventDefault()}});if(eventTypeString=="orientationchange"&&window.screen.mozOrientation!==undefined){eventTypeString="mozorientationchange"}var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),fullscreenEnabled:(function(){return document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled}),fillFullscreenChangeEventData:(function(eventStruct,e){var fullscreenElement=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;var isFullscreen=!!fullscreenElement;HEAP32[eventStruct>>2]=isFullscreen;HEAP32[eventStruct+4>>2]=JSEvents.fullscreenEnabled();var reportedElement=isFullscreen?fullscreenElement:JSEvents.previousFullscreenElement;var nodeName=JSEvents.getNodeNameForTarget(reportedElement);var id=reportedElement&&reportedElement.id?reportedElement.id:"";stringToUTF8(nodeName,eventStruct+8,128);stringToUTF8(id,eventStruct+136,128);HEAP32[eventStruct+264>>2]=reportedElement?reportedElement.clientWidth:0;HEAP32[eventStruct+268>>2]=reportedElement?reportedElement.clientHeight:0;HEAP32[eventStruct+272>>2]=screen.width;HEAP32[eventStruct+276>>2]=screen.height;if(isFullscreen){JSEvents.previousFullscreenElement=fullscreenElement}}),registerFullscreenChangeEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.fullscreenChangeEvent){JSEvents.fullscreenChangeEvent=_malloc(280)}if(!target){target=document}else{target=JSEvents.findEventTarget(target)}var handlerFunc=(function(event){var e=event||window.event;JSEvents.fillFullscreenChangeEventData(JSEvents.fullscreenChangeEvent,e);var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.fullscreenChangeEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),resizeCanvasForFullscreen:(function(target,strategy){var restoreOldStyle=__registerRestoreOldStyle(target);var cssWidth=strategy.softFullscreen?window.innerWidth:screen.width;var cssHeight=strategy.softFullscreen?window.innerHeight:screen.height;var rect=target.getBoundingClientRect();var windowedCssWidth=rect.right-rect.left;var windowedCssHeight=rect.bottom-rect.top;var windowedRttWidth=target.width;var windowedRttHeight=target.height;if(strategy.scaleMode==3){__setLetterbox(target,(cssHeight-windowedCssHeight)/2,(cssWidth-windowedCssWidth)/2);cssWidth=windowedCssWidth;cssHeight=windowedCssHeight}else if(strategy.scaleMode==2){if(cssWidth*windowedRttHeight>2]=isPointerlocked;var nodeName=JSEvents.getNodeNameForTarget(pointerLockElement);var id=pointerLockElement&&pointerLockElement.id?pointerLockElement.id:"";stringToUTF8(nodeName,eventStruct+4,128);stringToUTF8(id,eventStruct+132,128)}),registerPointerlockChangeEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.pointerlockChangeEvent){JSEvents.pointerlockChangeEvent=_malloc(260)}if(!target){target=document}else{target=JSEvents.findEventTarget(target)}var handlerFunc=(function(event){var e=event||window.event;JSEvents.fillPointerlockChangeEventData(JSEvents.pointerlockChangeEvent,e);var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.pointerlockChangeEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),registerPointerlockErrorEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!target){target=document}else{target=JSEvents.findEventTarget(target)}var handlerFunc=(function(event){var e=event||window.event;var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,0,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),requestPointerLock:(function(target){if(target.requestPointerLock){target.requestPointerLock()}else if(target.mozRequestPointerLock){target.mozRequestPointerLock()}else if(target.webkitRequestPointerLock){target.webkitRequestPointerLock()}else if(target.msRequestPointerLock){target.msRequestPointerLock()}else{if(document.body.requestPointerLock||document.body.mozRequestPointerLock||document.body.webkitRequestPointerLock||document.body.msRequestPointerLock){return-3}else{return-1}}return 0}),fillVisibilityChangeEventData:(function(eventStruct,e){var visibilityStates=["hidden","visible","prerender","unloaded"];var visibilityState=visibilityStates.indexOf(document.visibilityState);HEAP32[eventStruct>>2]=document.hidden;HEAP32[eventStruct+4>>2]=visibilityState}),registerVisibilityChangeEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.visibilityChangeEvent){JSEvents.visibilityChangeEvent=_malloc(8)}if(!target){target=document}else{target=JSEvents.findEventTarget(target)}var handlerFunc=(function(event){var e=event||window.event;JSEvents.fillVisibilityChangeEventData(JSEvents.visibilityChangeEvent,e);var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.visibilityChangeEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:target,allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),registerTouchEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.touchEvent){JSEvents.touchEvent=_malloc(1684)}target=JSEvents.findEventTarget(target);var handlerFunc=(function(event){var e=event||window.event;var touches={};for(var i=0;i>2]=e.ctrlKey;HEAP32[ptr+8>>2]=e.shiftKey;HEAP32[ptr+12>>2]=e.altKey;HEAP32[ptr+16>>2]=e.metaKey;ptr+=20;var canvasRect=Module["canvas"]?Module["canvas"].getBoundingClientRect():undefined;var targetRect=JSEvents.getBoundingClientRectOrZeros(target);var numTouches=0;for(var i in touches){var t=touches[i];HEAP32[ptr>>2]=t.identifier;HEAP32[ptr+4>>2]=t.screenX;HEAP32[ptr+8>>2]=t.screenY;HEAP32[ptr+12>>2]=t.clientX;HEAP32[ptr+16>>2]=t.clientY;HEAP32[ptr+20>>2]=t.pageX;HEAP32[ptr+24>>2]=t.pageY;HEAP32[ptr+28>>2]=t.changed;HEAP32[ptr+32>>2]=t.onTarget;if(canvasRect){HEAP32[ptr+44>>2]=t.clientX-canvasRect.left;HEAP32[ptr+48>>2]=t.clientY-canvasRect.top}else{HEAP32[ptr+44>>2]=0;HEAP32[ptr+48>>2]=0}HEAP32[ptr+36>>2]=t.clientX-targetRect.left;HEAP32[ptr+40>>2]=t.clientY-targetRect.top;ptr+=52;if(++numTouches>=32){break}}HEAP32[JSEvents.touchEvent>>2]=numTouches;var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.touchEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:target,allowsDeferredCalls:eventTypeString=="touchstart"||eventTypeString=="touchend",eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),fillGamepadEventData:(function(eventStruct,e){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)}),registerGamepadEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.gamepadEvent){JSEvents.gamepadEvent=_malloc(1432)}var handlerFunc=(function(event){var e=event||window.event;JSEvents.fillGamepadEventData(JSEvents.gamepadEvent,e.gamepad);var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.gamepadEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:true,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),registerBeforeUnloadEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){var handlerFunc=(function(event){var e=event||window.event;var confirmationMessage=Module["dynCall_iiii"](callbackfunc,eventTypeId,0,userData);if(confirmationMessage){confirmationMessage=Pointer_stringify(confirmationMessage)}if(confirmationMessage){e.preventDefault();e.returnValue=confirmationMessage;return confirmationMessage}});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),battery:(function(){return navigator.battery||navigator.mozBattery||navigator.webkitBattery}),fillBatteryEventData:(function(eventStruct,e){HEAPF64[eventStruct>>3]=e.chargingTime;HEAPF64[eventStruct+8>>3]=e.dischargingTime;HEAPF64[eventStruct+16>>3]=e.level;HEAP32[eventStruct+24>>2]=e.charging}),registerBatteryEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!JSEvents.batteryEvent){JSEvents.batteryEvent=_malloc(32)}var handlerFunc=(function(event){var e=event||window.event;JSEvents.fillBatteryEventData(JSEvents.batteryEvent,JSEvents.battery());var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,JSEvents.batteryEvent,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)}),registerWebGlEventCallback:(function(target,userData,useCapture,callbackfunc,eventTypeId,eventTypeString){if(!target){target=Module["canvas"]}var handlerFunc=(function(event){var e=event||window.event;var shouldCancel=Module["dynCall_iiii"](callbackfunc,eventTypeId,0,userData);if(shouldCancel){e.preventDefault()}});var eventHandler={target:JSEvents.findEventTarget(target),allowsDeferredCalls:false,eventTypeString:eventTypeString,callbackfunc:callbackfunc,handlerFunc:handlerFunc,useCapture:useCapture};JSEvents.registerOrRemoveHandler(eventHandler)})};var __currentFullscreenStrategy={};function _emscripten_exit_fullscreen(){if(typeof JSEvents.fullscreenEnabled()==="undefined")return-1;JSEvents.removeDeferredCalls(JSEvents.requestFullscreen);if(document.exitFullscreen){document.exitFullscreen()}else if(document.msExitFullscreen){document.msExitFullscreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.webkitExitFullscreen){document.webkitExitFullscreen()}else{return-1}if(__currentFullscreenStrategy.canvasResizedCallback){Module["dynCall_iiii"](__currentFullscreenStrategy.canvasResizedCallback,37,0,__currentFullscreenStrategy.canvasResizedCallbackUserData)}return 0}function _emscripten_exit_pointerlock(){JSEvents.removeDeferredCalls(JSEvents.requestPointerLock);if(document.exitPointerLock){document.exitPointerLock()}else if(document.msExitPointerLock){document.msExitPointerLock()}else if(document.mozExitPointerLock){document.mozExitPointerLock()}else if(document.webkitExitPointerLock){document.webkitExitPointerLock()}else{return-1}return 0}function _emscripten_get_fullscreen_status(fullscreenStatus){if(typeof JSEvents.fullscreenEnabled()==="undefined")return-1;JSEvents.fillFullscreenChangeEventData(fullscreenStatus);return 0}function __emscripten_sample_gamepad_data(){if(!JSEvents.numGamepadsConnected)return;if(Browser.mainLoop.currentFrameNumber!==JSEvents.lastGamepadStateFrame||!Browser.mainLoop.currentFrameNumber){JSEvents.lastGamepadState=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads:null;JSEvents.lastGamepadStateFrame=Browser.mainLoop.currentFrameNumber}}function _emscripten_get_gamepad_status(index,gamepadState){__emscripten_sample_gamepad_data();if(!JSEvents.lastGamepadState)return-1;if(index<0||index>=JSEvents.lastGamepadState.length)return-5;if(!JSEvents.lastGamepadState[index])return-7;JSEvents.fillGamepadEventData(gamepadState,JSEvents.lastGamepadState[index]);return 0}function _emscripten_get_main_loop_timing(mode,value){if(mode)HEAP32[mode>>2]=Browser.mainLoop.timingMode;if(value)HEAP32[value>>2]=Browser.mainLoop.timingValue}function _emscripten_get_num_gamepads(){if(!JSEvents.numGamepadsConnected)return 0;__emscripten_sample_gamepad_data();if(!JSEvents.lastGamepadState)return-1;return JSEvents.lastGamepadState.length}function _emscripten_has_threading_support(){return 0}function _emscripten_is_webgl_context_lost(target){if(!Module["ctx"])return true;return Module["ctx"].isContextLost()}function __reallyNegative(x){return x<0||x===0&&1/x===-Infinity}function __formatString(format,varargs){assert((varargs&3)===0);var textIndex=format;var argIndex=varargs;function prepVararg(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}function getNextArg(type){var ret;argIndex=prepVararg(argIndex,type);if(type==="double"){ret=HEAPF64[argIndex>>3];argIndex+=8}else if(type=="i64"){ret=[HEAP32[argIndex>>2],HEAP32[argIndex+4>>2]];argIndex+=8}else{assert((argIndex&3)===0);type="i32";ret=HEAP32[argIndex>>2];argIndex+=4}return ret}var ret=[];var curr,next,currArg;while(1){var startTextIndex=textIndex;curr=HEAP8[textIndex>>0];if(curr===0)break;next=HEAP8[textIndex+1>>0];if(curr==37){var flagAlwaysSigned=false;var flagLeftAlign=false;var flagAlternative=false;var flagZeroPad=false;var flagPadSign=false;flagsLoop:while(1){switch(next){case 43:flagAlwaysSigned=true;break;case 45:flagLeftAlign=true;break;case 35:flagAlternative=true;break;case 48:if(flagZeroPad){break flagsLoop}else{flagZeroPad=true;break};case 32:flagPadSign=true;break;default:break flagsLoop}textIndex++;next=HEAP8[textIndex+1>>0]}var width=0;if(next==42){width=getNextArg("i32");textIndex++;next=HEAP8[textIndex+1>>0]}else{while(next>=48&&next<=57){width=width*10+(next-48);textIndex++;next=HEAP8[textIndex+1>>0]}}var precisionSet=false,precision=-1;if(next==46){precision=0;precisionSet=true;textIndex++;next=HEAP8[textIndex+1>>0];if(next==42){precision=getNextArg("i32");textIndex++}else{while(1){var precisionChr=HEAP8[textIndex+1>>0];if(precisionChr<48||precisionChr>57)break;precision=precision*10+(precisionChr-48);textIndex++}}next=HEAP8[textIndex+1>>0]}if(precision<0){precision=6;precisionSet=false}var argSize;switch(String.fromCharCode(next)){case"h":var nextNext=HEAP8[textIndex+2>>0];if(nextNext==104){textIndex++;argSize=1}else{argSize=2}break;case"l":var nextNext=HEAP8[textIndex+2>>0];if(nextNext==108){textIndex++;argSize=8}else{argSize=4}break;case"L":case"q":case"j":argSize=8;break;case"z":case"t":case"I":argSize=4;break;default:argSize=null}if(argSize)textIndex++;next=HEAP8[textIndex+1>>0];switch(String.fromCharCode(next)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":{var signed=next==100||next==105;argSize=argSize||4;currArg=getNextArg("i"+argSize*8);var origArg=currArg;var argText;if(argSize==8){currArg=makeBigInt(currArg[0],currArg[1],next==117)}if(argSize<=4){var limit=Math.pow(256,argSize)-1;currArg=(signed?reSign:unSign)(currArg&limit,argSize*8)}var currAbsArg=Math.abs(currArg);var prefix="";if(next==100||next==105){if(argSize==8&&typeof i64Math==="object")argText=i64Math.stringify(origArg[0],origArg[1],null);else argText=reSign(currArg,8*argSize,1).toString(10)}else if(next==117){if(argSize==8&&typeof i64Math==="object")argText=i64Math.stringify(origArg[0],origArg[1],true);else argText=unSign(currArg,8*argSize,1).toString(10);currArg=Math.abs(currArg)}else if(next==111){argText=(flagAlternative?"0":"")+currAbsArg.toString(8)}else if(next==120||next==88){prefix=flagAlternative&&currArg!=0?"0x":"";if(argSize==8&&typeof i64Math==="object"){if(origArg[1]){argText=(origArg[1]>>>0).toString(16);var lower=(origArg[0]>>>0).toString(16);while(lower.length<8)lower="0"+lower;argText+=lower}else{argText=(origArg[0]>>>0).toString(16)}}else if(currArg<0){currArg=-currArg;argText=(currAbsArg-1).toString(16);var buffer=[];for(var i=0;i=0){if(flagAlwaysSigned){prefix="+"+prefix}else if(flagPadSign){prefix=" "+prefix}}if(argText.charAt(0)=="-"){prefix="-"+prefix;argText=argText.substr(1)}while(prefix.length+argText.lengthexponent&&exponent>=-4){next=(next==103?"f":"F").charCodeAt(0);precision-=exponent+1}else{next=(next==103?"e":"E").charCodeAt(0);precision--}effectivePrecision=Math.min(precision,20)}if(next==101||next==69){argText=currArg.toExponential(effectivePrecision);if(/[eE][-+]\d$/.test(argText)){argText=argText.slice(0,-1)+"0"+argText.slice(-1)}}else if(next==102||next==70){argText=currArg.toFixed(effectivePrecision);if(currArg===0&&__reallyNegative(currArg)){argText="-"+argText}}var parts=argText.split("e");if(isGeneral&&!flagAlternative){while(parts[0].length>1&&parts[0].indexOf(".")!=-1&&(parts[0].slice(-1)=="0"||parts[0].slice(-1)==".")){parts[0]=parts[0].slice(0,-1)}}else{if(flagAlternative&&argText.indexOf(".")==-1)parts[0]+=".";while(precision>effectivePrecision++)parts[0]+="0"}argText=parts[0]+(parts.length>1?"e"+parts[1]:"");if(next==69)argText=argText.toUpperCase();if(currArg>=0){if(flagAlwaysSigned){argText="+"+argText}else if(flagPadSign){argText=" "+argText}}}while(argText.length>0])}}else{ret=ret.concat(intArrayFromString("(null)".substr(0,argLength),true))}if(flagLeftAlign){while(argLength0){ret.push(32)}if(!flagLeftAlign)ret.push(getNextArg("i8"));break};case"n":{var ptr=getNextArg("i32*");HEAP32[ptr>>2]=ret.length;break};case"%":{ret.push(curr);break};default:{for(var i=startTextIndex;i>0])}}}textIndex+=2}else{ret.push(curr);textIndex+=1}}return ret}function __emscripten_traverse_stack(args){if(!args||!args.callee||!args.callee.name){return[null,"",""]}var funstr=args.callee.toString();var funcname=args.callee.name;var str="(";var first=true;for(var i in args){var a=args[i];if(!first){str+=", "}first=false;if(typeof a==="number"||typeof a==="string"){str+=a}else{str+="("+typeof a+")"}}str+=")";var caller=args.callee.caller;args=caller?caller.arguments:[];if(first)str="";return[args,funcname,str]}function _emscripten_get_callstack_js(flags){var callstack=jsStackTrace();var iThisFunc=callstack.lastIndexOf("_emscripten_log");var iThisFunc2=callstack.lastIndexOf("_emscripten_get_callstack");var iNextLine=callstack.indexOf("\n",Math.max(iThisFunc,iThisFunc2))+1;callstack=callstack.slice(iNextLine);if(flags&8&&typeof emscripten_source_map==="undefined"){warnOnce('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.');flags^=8;flags|=16}var stack_args=null;if(flags&128){stack_args=__emscripten_traverse_stack(arguments);while(stack_args[1].indexOf("_emscripten_")>=0)stack_args=__emscripten_traverse_stack(stack_args[0])}var lines=callstack.split("\n");callstack="";var newFirefoxRe=new RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)");var firefoxRe=new RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?");var chromeRe=new RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)");for(var l in lines){var line=lines[l];var jsSymbolName="";var file="";var lineno=0;var column=0;var parts=chromeRe.exec(line);if(parts&&parts.length==5){jsSymbolName=parts[1];file=parts[2];lineno=parts[3];column=parts[4]}else{parts=newFirefoxRe.exec(line);if(!parts)parts=firefoxRe.exec(line);if(parts&&parts.length>=4){jsSymbolName=parts[1];file=parts[2];lineno=parts[3];column=parts[4]|0}else{callstack+=line+"\n";continue}}var cSymbolName=flags&32?demangle(jsSymbolName):jsSymbolName;if(!cSymbolName){cSymbolName=jsSymbolName}var haveSourceMap=false;if(flags&8){var orig=emscripten_source_map.originalPositionFor({line:lineno,column:column});haveSourceMap=orig&&orig.source;if(haveSourceMap){if(flags&64){orig.source=orig.source.substring(orig.source.replace(/\\/g,"/").lastIndexOf("/")+1)}callstack+=" at "+cSymbolName+" ("+orig.source+":"+orig.line+":"+orig.column+")\n"}}if(flags&16||!haveSourceMap){if(flags&64){file=file.substring(file.replace(/\\/g,"/").lastIndexOf("/")+1)}callstack+=(haveSourceMap?" = "+jsSymbolName:" at "+cSymbolName)+" ("+file+":"+lineno+":"+column+")\n"}if(flags&128&&stack_args[0]){if(stack_args[1]==jsSymbolName&&stack_args[2].length>0){callstack=callstack.replace(/\s+$/,"");callstack+=" with values: "+stack_args[1]+stack_args[2]+"\n"}stack_args=__emscripten_traverse_stack(stack_args[0])}}callstack=callstack.replace(/\s+$/,"");return callstack}function _emscripten_log_js(flags,str){if(flags&24){str=str.replace(/\s+$/,"");str+=(str.length>0?"\n":"")+_emscripten_get_callstack_js(flags)}if(flags&1){if(flags&4){console.error(str)}else if(flags&2){console.warn(str)}else{console.log(str)}}else if(flags&6){Module.printErr(str)}else{Module.print(str)}}function _emscripten_log(flags,varargs){var format=HEAP32[varargs>>2];varargs+=4;var str="";if(format){var result=__formatString(format,varargs);for(var i=0;i>2];if(len<0){frag=Pointer_stringify(HEAP32[string+i*4>>2])}else{frag=Pointer_stringify(HEAP32[string+i*4>>2],len)}}else{frag=Pointer_stringify(HEAP32[string+i*4>>2])}source+=frag}return source}),createContext:(function(canvas,webGLContextAttributes){if(typeof webGLContextAttributes["majorVersion"]==="undefined"&&typeof webGLContextAttributes["minorVersion"]==="undefined"){if(typeof WebGL2RenderingContext!=="undefined")webGLContextAttributes["majorVersion"]=2;else webGLContextAttributes["majorVersion"]=1;webGLContextAttributes["minorVersion"]=0}var ctx;var errorInfo="?";function onContextCreationError(event){errorInfo=event.statusMessage||errorInfo}try{canvas.addEventListener("webglcontextcreationerror",onContextCreationError,false);try{if(webGLContextAttributes["majorVersion"]==1&&webGLContextAttributes["minorVersion"]==0){ctx=canvas.getContext("webgl",webGLContextAttributes)||canvas.getContext("experimental-webgl",webGLContextAttributes)}else if(webGLContextAttributes["majorVersion"]==2&&webGLContextAttributes["minorVersion"]==0){ctx=canvas.getContext("webgl2",webGLContextAttributes)}else{throw"Unsupported WebGL context version "+majorVersion+"."+minorVersion+"!"}}finally{canvas.removeEventListener("webglcontextcreationerror",onContextCreationError,false)}if(!ctx)throw":("}catch(e){Module.print("Could not create canvas: "+[errorInfo,e,JSON.stringify(webGLContextAttributes)]);return 0}if(!ctx)return 0;var context=GL.registerContext(ctx,webGLContextAttributes);return context}),registerContext:(function(ctx,webGLContextAttributes){var handle=GL.getNewId(GL.contexts);var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes["majorVersion"],GLctx:ctx};function getChromeVersion(){var raw=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);return raw?parseInt(raw[2],10):false}context.supportsWebGL2EntryPoints=context.version>=2&&(getChromeVersion()===false||getChromeVersion()>=58);if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes["enableExtensionsByDefault"]==="undefined"||webGLContextAttributes["enableExtensionsByDefault"]){GL.initExtensions(context)}return handle}),makeContextCurrent:(function(contextHandle){var context=GL.contexts[contextHandle];if(!context)return false;GLctx=Module.ctx=context.GLctx;GL.currentContext=context;return true}),getContext:(function(contextHandle){return GL.contexts[contextHandle]}),deleteContext:(function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;GL.contexts[contextHandle]=null}),initExtensions:(function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;context.maxVertexAttribs=GLctx.getParameter(GLctx.MAX_VERTEX_ATTRIBS);if(context.version<2){var instancedArraysExt=GLctx.getExtension("ANGLE_instanced_arrays");if(instancedArraysExt){GLctx["vertexAttribDivisor"]=(function(index,divisor){instancedArraysExt["vertexAttribDivisorANGLE"](index,divisor)});GLctx["drawArraysInstanced"]=(function(mode,first,count,primcount){instancedArraysExt["drawArraysInstancedANGLE"](mode,first,count,primcount)});GLctx["drawElementsInstanced"]=(function(mode,count,type,indices,primcount){instancedArraysExt["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)})}var vaoExt=GLctx.getExtension("OES_vertex_array_object");if(vaoExt){GLctx["createVertexArray"]=(function(){return vaoExt["createVertexArrayOES"]()});GLctx["deleteVertexArray"]=(function(vao){vaoExt["deleteVertexArrayOES"](vao)});GLctx["bindVertexArray"]=(function(vao){vaoExt["bindVertexArrayOES"](vao)});GLctx["isVertexArray"]=(function(vao){return vaoExt["isVertexArrayOES"](vao)})}var drawBuffersExt=GLctx.getExtension("WEBGL_draw_buffers");if(drawBuffersExt){GLctx["drawBuffers"]=(function(n,bufs){drawBuffersExt["drawBuffersWEBGL"](n,bufs)})}}GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query");var automaticallyEnabledExtensions=["OES_texture_float","OES_texture_half_float","OES_standard_derivatives","OES_vertex_array_object","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","OES_element_index_uint","EXT_texture_filter_anisotropic","ANGLE_instanced_arrays","OES_texture_float_linear","OES_texture_half_float_linear","WEBGL_compressed_texture_atc","WEBKIT_WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_pvrtc","EXT_color_buffer_half_float","WEBGL_color_buffer_float","EXT_frag_depth","EXT_sRGB","WEBGL_draw_buffers","WEBGL_shared_resources","EXT_shader_texture_lod","EXT_color_buffer_float"];var exts=GLctx.getSupportedExtensions();if(exts&&exts.length>0){GLctx.getSupportedExtensions().forEach((function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}}))}}),populateUniformTable:(function(program){var p=GL.programs[program];GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var ptable=GL.programInfos[program];var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,GLctx.ACTIVE_UNIFORMS);for(var i=0;i>2];contextAttributes["depth"]=!!HEAP32[attributes+4>>2];contextAttributes["stencil"]=!!HEAP32[attributes+8>>2];contextAttributes["antialias"]=!!HEAP32[attributes+12>>2];contextAttributes["premultipliedAlpha"]=!!HEAP32[attributes+16>>2];contextAttributes["preserveDrawingBuffer"]=!!HEAP32[attributes+20>>2];contextAttributes["preferLowPowerToHighPerformance"]=!!HEAP32[attributes+24>>2];contextAttributes["failIfMajorPerformanceCaveat"]=!!HEAP32[attributes+28>>2];contextAttributes["majorVersion"]=HEAP32[attributes+32>>2];contextAttributes["minorVersion"]=HEAP32[attributes+36>>2];contextAttributes["explicitSwapControl"]=HEAP32[attributes+44>>2];target=Pointer_stringify(target);var canvas;if((!target||target==="#canvas")&&Module["canvas"]){canvas=Module["canvas"].id?GL.offscreenCanvases[Module["canvas"].id]||JSEvents.findEventTarget(Module["canvas"].id):Module["canvas"]}else{canvas=GL.offscreenCanvases[target]||JSEvents.findEventTarget(target)}if(!canvas){return 0}if(contextAttributes["explicitSwapControl"]){console.error("emscripten_webgl_create_context failed: explicitSwapControl is not supported, please rebuild with -s OFFSCREENCANVAS_SUPPORT=1 to enable targeting the experimental OffscreenCanvas specification!");return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_destroy_context(contextHandle){GL.deleteContext(contextHandle)}function _emscripten_webgl_enable_extension(contextHandle,extension){var context=GL.getContext(contextHandle);var extString=Pointer_stringify(extension);if(extString.indexOf("GL_")==0)extString=extString.substr(3);var ext=context.GLctx.getExtension(extString);return ext?1:0}function _emscripten_webgl_get_current_context(){return GL.currentContext?GL.currentContext.handle:0}function _emscripten_webgl_make_context_current(contextHandle){var success=GL.makeContextCurrent(contextHandle);return success?0:-5}function __exit(status){Module["exit"](status)}function _exit(status){__exit(status)}function _flock(fd,operation){return 0}function _gethostbyname(name){name=Pointer_stringify(name);var ret=_malloc(20);var nameBuf=_malloc(name.length+1);stringToUTF8(name,nameBuf,name.length+1);HEAP32[ret>>2]=nameBuf;var aliasesBuf=_malloc(4);HEAP32[aliasesBuf>>2]=0;HEAP32[ret+4>>2]=aliasesBuf;var afinet=2;HEAP32[ret+8>>2]=afinet;HEAP32[ret+12>>2]=4;var addrListBuf=_malloc(12);HEAP32[addrListBuf>>2]=addrListBuf+8;HEAP32[addrListBuf+4>>2]=0;HEAP32[addrListBuf+8>>2]=__inet_pton4_raw(DNS.lookup_name(name));HEAP32[ret+16>>2]=addrListBuf;return ret}function _gethostbyaddr(addr,addrlen,type){if(type!==2){___setErrNo(ERRNO_CODES.EAFNOSUPPORT);return null}addr=HEAP32[addr>>2];var host=__inet_ntop4_raw(addr);var lookup=DNS.lookup_addr(host);if(lookup){host=lookup}var hostp=allocate(intArrayFromString(host),"i8",ALLOC_STACK);return _gethostbyname(hostp)}function _getpwuid(uid){return 0}function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}function _glActiveTexture(x0){GLctx["activeTexture"](x0)}function _glAttachShader(program,shader){GLctx.attachShader(GL.programs[program],GL.shaders[shader])}function _glBeginQuery(target,id){GLctx["beginQuery"](target,id?GL.queries[id]:null)}function _glBeginTransformFeedback(x0){GLctx["beginTransformFeedback"](x0)}function _glBindAttribLocation(program,index,name){name=Pointer_stringify(name);GLctx.bindAttribLocation(GL.programs[program],index,name)}function _glBindBuffer(target,buffer){var bufferObj=buffer?GL.buffers[buffer]:null;if(target==35051){GLctx.currentPixelPackBufferBinding=buffer}else if(target==35052){GLctx.currentPixelUnpackBufferBinding=buffer}GLctx.bindBuffer(target,bufferObj)}function _glBindBufferBase(target,index,buffer){var bufferObj=buffer?GL.buffers[buffer]:null;GLctx["bindBufferBase"](target,index,bufferObj)}function _glBindFramebuffer(target,framebuffer){GLctx.bindFramebuffer(target,framebuffer?GL.framebuffers[framebuffer]:null)}function _glBindRenderbuffer(target,renderbuffer){GLctx.bindRenderbuffer(target,renderbuffer?GL.renderbuffers[renderbuffer]:null)}function _glBindSampler(unit,sampler){GLctx["bindSampler"](unit,sampler?GL.samplers[sampler]:null)}function _glBindTexture(target,texture){GLctx.bindTexture(target,texture?GL.textures[texture]:null)}function _glBindTransformFeedback(target,id){var transformFeedback=id?GL.transformFeedbacks[id]:null;if(id&&!transformFeedback){GL.recordError(1282);return}GLctx["bindTransformFeedback"](target,transformFeedback)}function _glBindVertexArray(vao){GLctx["bindVertexArray"](GL.vaos[vao])}function _glBlendEquation(x0){GLctx["blendEquation"](x0)}function _glBlendEquationSeparate(x0,x1){GLctx["blendEquationSeparate"](x0,x1)}function _glBlendFuncSeparate(x0,x1,x2,x3){GLctx["blendFuncSeparate"](x0,x1,x2,x3)}function _glBlitFramebuffer(x0,x1,x2,x3,x4,x5,x6,x7,x8,x9){GLctx["blitFramebuffer"](x0,x1,x2,x3,x4,x5,x6,x7,x8,x9)}function _glBufferData(target,size,data,usage){if(!data){GLctx.bufferData(target,size,usage)}else{if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.bufferData(target,HEAPU8,usage,data,size);return}GLctx.bufferData(target,HEAPU8.subarray(data,data+size),usage)}}function _glBufferSubData(target,offset,size,data){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.bufferSubData(target,offset,HEAPU8,data,size);return}GLctx.bufferSubData(target,offset,HEAPU8.subarray(data,data+size))}function _glCheckFramebufferStatus(x0){return GLctx["checkFramebufferStatus"](x0)}function _glClear(x0){GLctx["clear"](x0)}function _glClearColor(x0,x1,x2,x3){GLctx["clearColor"](x0,x1,x2,x3)}function _glClearDepthf(x0){GLctx["clearDepth"](x0)}function _glClearStencil(x0){GLctx["clearStencil"](x0)}function _glClientWaitSync(sync,flags,timeoutLo,timeoutHi){timeoutLo=timeoutLo>>>0;timeoutHi=timeoutHi>>>0;var timeout=timeoutLo==4294967295&&timeoutHi==4294967295?-1:makeBigInt(timeoutLo,timeoutHi,true);return GLctx.clientWaitSync(GL.syncs[sync],flags,timeout)}function _glColorMask(red,green,blue,alpha){GLctx.colorMask(!!red,!!green,!!blue,!!alpha)}function _glCompileShader(shader){GLctx.compileShader(GL.shaders[shader])}function _glCompressedTexImage2D(target,level,internalFormat,width,height,border,imageSize,data){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx["compressedTexImage2D"](target,level,internalFormat,width,height,border,HEAPU8,data,imageSize);return}GLctx["compressedTexImage2D"](target,level,internalFormat,width,height,border,data?HEAPU8.subarray(data,data+imageSize):null)}function _glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imageSize,data){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx["compressedTexSubImage2D"](target,level,xoffset,yoffset,width,height,format,HEAPU8,data,imageSize);return}GLctx["compressedTexSubImage2D"](target,level,xoffset,yoffset,width,height,format,data?HEAPU8.subarray(data,data+imageSize):null)}function _glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imageSize,data){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx["compressedTexSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,HEAPU8,data,imageSize)}else{GLctx["compressedTexSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,data?HEAPU8.subarray(data,data+imageSize):null)}}function _glCopyBufferSubData(x0,x1,x2,x3,x4){GLctx["copyBufferSubData"](x0,x1,x2,x3,x4)}function _glCopyTexImage2D(x0,x1,x2,x3,x4,x5,x6,x7){GLctx["copyTexImage2D"](x0,x1,x2,x3,x4,x5,x6,x7)}function _glCopyTexSubImage2D(x0,x1,x2,x3,x4,x5,x6,x7){GLctx["copyTexSubImage2D"](x0,x1,x2,x3,x4,x5,x6,x7)}function _glCreateProgram(){var id=GL.getNewId(GL.programs);var program=GLctx.createProgram();program.name=id;GL.programs[id]=program;return id}function _glCreateShader(shaderType){var id=GL.getNewId(GL.shaders);GL.shaders[id]=GLctx.createShader(shaderType);return id}function _glCullFace(x0){GLctx["cullFace"](x0)}function _glDeleteBuffers(n,buffers){for(var i=0;i>2];var buffer=GL.buffers[id];if(!buffer)continue;GLctx.deleteBuffer(buffer);buffer.name=0;GL.buffers[id]=null;if(id==GL.currArrayBuffer)GL.currArrayBuffer=0;if(id==GL.currElementArrayBuffer)GL.currElementArrayBuffer=0}}function _glDeleteFramebuffers(n,framebuffers){for(var i=0;i>2];var framebuffer=GL.framebuffers[id];if(!framebuffer)continue;GLctx.deleteFramebuffer(framebuffer);framebuffer.name=0;GL.framebuffers[id]=null}}function _glDeleteProgram(id){if(!id)return;var program=GL.programs[id];if(!program){GL.recordError(1281);return}GLctx.deleteProgram(program);program.name=0;GL.programs[id]=null;GL.programInfos[id]=null}function _glDeleteQueries(n,ids){for(var i=0;i>2];var query=GL.queries[id];if(!query)continue;GLctx["deleteQuery"](query);GL.queries[id]=null}}function _glDeleteRenderbuffers(n,renderbuffers){for(var i=0;i>2];var renderbuffer=GL.renderbuffers[id];if(!renderbuffer)continue;GLctx.deleteRenderbuffer(renderbuffer);renderbuffer.name=0;GL.renderbuffers[id]=null}}function _glDeleteSamplers(n,samplers){for(var i=0;i>2];var sampler=GL.samplers[id];if(!sampler)continue;GLctx["deleteSampler"](sampler);sampler.name=0;GL.samplers[id]=null}}function _glDeleteShader(id){if(!id)return;var shader=GL.shaders[id];if(!shader){GL.recordError(1281);return}GLctx.deleteShader(shader);GL.shaders[id]=null}function _glDeleteSync(id){if(!id)return;var sync=GL.syncs[id];if(!sync){GL.recordError(1281);return}GLctx.deleteSync(sync);sync.name=0;GL.syncs[id]=null}function _glDeleteTextures(n,textures){for(var i=0;i>2];var texture=GL.textures[id];if(!texture)continue;GLctx.deleteTexture(texture);texture.name=0;GL.textures[id]=null}}function _glDeleteTransformFeedbacks(n,ids){for(var i=0;i>2];var transformFeedback=GL.transformFeedbacks[id];if(!transformFeedback)continue;GLctx["deleteTransformFeedback"](transformFeedback);transformFeedback.name=0;GL.transformFeedbacks[id]=null}}function _glDeleteVertexArrays(n,vaos){for(var i=0;i>2];GLctx["deleteVertexArray"](GL.vaos[id]);GL.vaos[id]=null}}function _glDepthFunc(x0){GLctx["depthFunc"](x0)}function _glDepthMask(flag){GLctx.depthMask(!!flag)}function _glDetachShader(program,shader){GLctx.detachShader(GL.programs[program],GL.shaders[shader])}function _glDisable(x0){GLctx["disable"](x0)}function _glDisableVertexAttribArray(index){GLctx.disableVertexAttribArray(index)}function _glDrawArrays(mode,first,count){GLctx.drawArrays(mode,first,count)}function _glDrawArraysInstanced(mode,first,count,primcount){GLctx["drawArraysInstanced"](mode,first,count,primcount)}function _glDrawBuffers(n,bufs){var bufArray=GL.tempFixedLengthArray[n];for(var i=0;i>2]}GLctx["drawBuffers"](bufArray)}function _glDrawElements(mode,count,type,indices){GLctx.drawElements(mode,count,type,indices)}function _glDrawElementsInstanced(mode,count,type,indices,primcount){GLctx["drawElementsInstanced"](mode,count,type,indices,primcount)}function _glEnable(x0){GLctx["enable"](x0)}function _glEnableVertexAttribArray(index){GLctx.enableVertexAttribArray(index)}function _glEndQuery(x0){GLctx["endQuery"](x0)}function _glEndTransformFeedback(){GLctx["endTransformFeedback"]()}function _glFenceSync(condition,flags){var sync=GLctx.fenceSync(condition,flags);if(sync){var id=GL.getNewId(GL.syncs);sync.name=id;GL.syncs[id]=sync;return id}else{return 0}}function _glFinish(){GLctx["finish"]()}function _glFlush(){GLctx["flush"]()}function emscriptenWebGLGetBufferBinding(target){switch(target){case 34962:target=34964;break;case 34963:target=34965;break;case 35051:target=35053;break;case 35052:target=35055;break;case 35982:target=35983;break;case 36662:target=36662;break;case 36663:target=36663;break;case 35345:target=35368;break}var buffer=GLctx.getParameter(target);if(buffer)return buffer.name|0;else return 0}function emscriptenWebGLValidateMapBufferTarget(target){switch(target){case 34962:case 34963:case 36662:case 36663:case 35051:case 35052:case 35882:case 35982:case 35345:return true;default:return false}}function _glFlushMappedBufferRange(target,offset,length){if(!emscriptenWebGLValidateMapBufferTarget(target)){GL.recordError(1280);Module.printErr("GL_INVALID_ENUM in glFlushMappedBufferRange");return}var mapping=GL.mappedBuffers[emscriptenWebGLGetBufferBinding(target)];if(!mapping){GL.recordError(1282);Module.printError("buffer was never mapped in glFlushMappedBufferRange");return}if(!(mapping.access&16)){GL.recordError(1282);Module.printError("buffer was not mapped with GL_MAP_FLUSH_EXPLICIT_BIT in glFlushMappedBufferRange");return}if(offset<0||length<0||offset+length>mapping.length){GL.recordError(1281);Module.printError("invalid range in glFlushMappedBufferRange");return}GLctx.bufferSubData(target,mapping.offset,HEAPU8.subarray(mapping.mem+offset,mapping.mem+offset+length))}function _glFramebufferRenderbuffer(target,attachment,renderbuffertarget,renderbuffer){GLctx.framebufferRenderbuffer(target,attachment,renderbuffertarget,GL.renderbuffers[renderbuffer])}function _glFramebufferTexture2D(target,attachment,textarget,texture,level){GLctx.framebufferTexture2D(target,attachment,textarget,GL.textures[texture],level)}function _glFramebufferTextureLayer(target,attachment,texture,level,layer){GLctx.framebufferTextureLayer(target,attachment,GL.textures[texture],level,layer)}function _glFrontFace(x0){GLctx["frontFace"](x0)}function _glGenBuffers(n,buffers){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.buffers);buffer.name=id;GL.buffers[id]=buffer;HEAP32[buffers+i*4>>2]=id}}function _glGenFramebuffers(n,ids){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.framebuffers);framebuffer.name=id;GL.framebuffers[id]=framebuffer;HEAP32[ids+i*4>>2]=id}}function _glGenQueries(n,ids){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.queries);query.name=id;GL.queries[id]=query;HEAP32[ids+i*4>>2]=id}}function _glGenRenderbuffers(n,renderbuffers){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.renderbuffers);renderbuffer.name=id;GL.renderbuffers[id]=renderbuffer;HEAP32[renderbuffers+i*4>>2]=id}}function _glGenSamplers(n,samplers){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.samplers);sampler.name=id;GL.samplers[id]=sampler;HEAP32[samplers+i*4>>2]=id}}function _glGenTextures(n,textures){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.textures);texture.name=id;GL.textures[id]=texture;HEAP32[textures+i*4>>2]=id}}function _glGenTransformFeedbacks(n,ids){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.transformFeedbacks);transformFeedback.name=id;GL.transformFeedbacks[id]=transformFeedback;HEAP32[ids+i*4>>2]=id}}function _glGenVertexArrays(n,arrays){for(var i=0;i>2]=0;return}var id=GL.getNewId(GL.vaos);vao.name=id;GL.vaos[id]=vao;HEAP32[arrays+i*4>>2]=id}}function _glGenerateMipmap(x0){GLctx["generateMipmap"](x0)}function _glGetActiveAttrib(program,index,bufSize,length,size,type,name){program=GL.programs[program];var info=GLctx.getActiveAttrib(program,index);if(!info)return;if(bufSize>0&&name){var numBytesWrittenExclNull=stringToUTF8(info.name,name,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}if(size)HEAP32[size>>2]=info.size;if(type)HEAP32[type>>2]=info.type}function _glGetActiveUniform(program,index,bufSize,length,size,type,name){program=GL.programs[program];var info=GLctx.getActiveUniform(program,index);if(!info)return;if(bufSize>0&&name){var numBytesWrittenExclNull=stringToUTF8(info.name,name,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}if(size)HEAP32[size>>2]=info.size;if(type)HEAP32[type>>2]=info.type}function _glGetActiveUniformBlockName(program,uniformBlockIndex,bufSize,length,uniformBlockName){program=GL.programs[program];var result=GLctx["getActiveUniformBlockName"](program,uniformBlockIndex);if(!result)return;if(uniformBlockName&&bufSize>0){var numBytesWrittenExclNull=stringToUTF8(result,uniformBlockName,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}}function _glGetActiveUniformBlockiv(program,uniformBlockIndex,pname,params){if(!params){GL.recordError(1281);return}program=GL.programs[program];switch(pname){case 35393:var name=GLctx["getActiveUniformBlockName"](program,uniformBlockIndex);HEAP32[params>>2]=name.length+1;return;default:var result=GLctx["getActiveUniformBlockParameter"](program,uniformBlockIndex,pname);if(!result)return;if(typeof result=="number"){HEAP32[params>>2]=result}else{for(var i=0;i>2]=result[i]}}}}function _glGetActiveUniformsiv(program,uniformCount,uniformIndices,pname,params){if(!params){GL.recordError(1281);return}if(uniformCount>0&&uniformIndices==0){GL.recordError(1281);return}program=GL.programs[program];var ids=[];for(var i=0;i>2])}var result=GLctx["getActiveUniforms"](program,ids,pname);if(!result)return;var len=result.length;for(var i=0;i>2]=result[i]}}function _glGetAttribLocation(program,name){program=GL.programs[program];name=Pointer_stringify(name);return GLctx.getAttribLocation(program,name)}function _glGetError(){if(GL.lastError){var error=GL.lastError;GL.lastError=0;return error}else{return GLctx.getError()}}function _glGetFramebufferAttachmentParameteriv(target,attachment,pname,params){var result=GLctx.getFramebufferAttachmentParameter(target,attachment,pname);if(result instanceof WebGLRenderbuffer||result instanceof WebGLTexture){result=result.name|0}HEAP32[params>>2]=result}function emscriptenWebGLGetIndexed(target,index,data,type){if(!data){GL.recordError(1281);return}var result=GLctx["getIndexedParameter"](target,index);var ret;switch(typeof result){case"boolean":ret=result?1:0;break;case"number":ret=result;break;case"object":if(result===null){switch(target){case 35983:case 35368:ret=0;break;default:{GL.recordError(1280);return}}}else if(result instanceof WebGLBuffer){ret=result.name|0}else{GL.recordError(1280);return}break;default:GL.recordError(1280);return}switch(type){case"Integer64":tempI64=[ret>>>0,(tempDouble=ret,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[data>>2]=tempI64[0],HEAP32[data+4>>2]=tempI64[1];break;case"Integer":HEAP32[data>>2]=ret;break;case"Float":HEAPF32[data>>2]=ret;break;case"Boolean":HEAP8[data>>0]=ret?1:0;break;default:throw"internal emscriptenWebGLGetIndexed() error, bad type: "+type}}function _glGetIntegeri_v(target,index,data){emscriptenWebGLGetIndexed(target,index,data,"Integer")}function emscriptenWebGLGet(name_,p,type){if(!p){GL.recordError(1281);return}var ret=undefined;switch(name_){case 36346:ret=1;break;case 36344:if(type!=="Integer"&&type!=="Integer64"){GL.recordError(1280)}return;case 34814:case 36345:ret=0;break;case 34466:var formats=GLctx.getParameter(34467);ret=formats.length;break;case 33309:if(GLctx.canvas.GLctxObject.version<2){GL.recordError(1282);return}var exts=GLctx.getSupportedExtensions();ret=2*exts.length;break;case 33307:case 33308:if(GLctx.canvas.GLctxObject.version<2){GL.recordError(1280);return}ret=name_==33307?3:0;break}if(ret===undefined){var result=GLctx.getParameter(name_);switch(typeof result){case"number":ret=result;break;case"boolean":ret=result?1:0;break;case"string":GL.recordError(1280);return;case"object":if(result===null){switch(name_){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 35097:case 36389:case 34068:{ret=0;break};default:{GL.recordError(1280);return}}}else if(result instanceof Float32Array||result instanceof Uint32Array||result instanceof Int32Array||result instanceof Array){for(var i=0;i>2]=result[i];break;case"Float":HEAPF32[p+i*4>>2]=result[i];break;case"Boolean":HEAP8[p+i>>0]=result[i]?1:0;break;default:throw"internal glGet error, bad type: "+type}}return}else if(result instanceof WebGLBuffer||result instanceof WebGLProgram||result instanceof WebGLFramebuffer||result instanceof WebGLRenderbuffer||result instanceof WebGLQuery||result instanceof WebGLSampler||result instanceof WebGLSync||result instanceof WebGLTransformFeedback||result instanceof WebGLVertexArrayObject||result instanceof WebGLTexture){ret=result.name|0}else{GL.recordError(1280);return}break;default:GL.recordError(1280);return}}switch(type){case"Integer64":tempI64=[ret>>>0,(tempDouble=ret,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[p>>2]=tempI64[0],HEAP32[p+4>>2]=tempI64[1];break;case"Integer":HEAP32[p>>2]=ret;break;case"Float":HEAPF32[p>>2]=ret;break;case"Boolean":HEAP8[p>>0]=ret?1:0;break;default:throw"internal glGet error, bad type: "+type}}function _glGetIntegerv(name_,p){emscriptenWebGLGet(name_,p,"Integer")}function _glGetProgramBinary(program,bufSize,length,binaryFormat,binary){GL.recordError(1282)}function _glGetProgramInfoLog(program,maxLength,length,infoLog){var log=GLctx.getProgramInfoLog(GL.programs[program]);if(log===null)log="(unknown error)";if(maxLength>0&&infoLog){var numBytesWrittenExclNull=stringToUTF8(log,infoLog,maxLength);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}}function _glGetProgramiv(program,pname,p){if(!p){GL.recordError(1281);return}if(program>=GL.counter){GL.recordError(1281);return}var ptable=GL.programInfos[program];if(!ptable){GL.recordError(1282);return}if(pname==35716){var log=GLctx.getProgramInfoLog(GL.programs[program]);if(log===null)log="(unknown error)";HEAP32[p>>2]=log.length+1}else if(pname==35719){HEAP32[p>>2]=ptable.maxUniformLength}else if(pname==35722){if(ptable.maxAttributeLength==-1){program=GL.programs[program];var numAttribs=GLctx.getProgramParameter(program,GLctx.ACTIVE_ATTRIBUTES);ptable.maxAttributeLength=0;for(var i=0;i>2]=ptable.maxAttributeLength}else if(pname==35381){if(ptable.maxUniformBlockNameLength==-1){program=GL.programs[program];var numBlocks=GLctx.getProgramParameter(program,GLctx.ACTIVE_UNIFORM_BLOCKS);ptable.maxUniformBlockNameLength=0;for(var i=0;i>2]=ptable.maxUniformBlockNameLength}else{HEAP32[p>>2]=GLctx.getProgramParameter(GL.programs[program],pname)}}function _glGetRenderbufferParameteriv(target,pname,params){if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getRenderbufferParameter(target,pname)}function _glGetShaderInfoLog(shader,maxLength,length,infoLog){var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";if(maxLength>0&&infoLog){var numBytesWrittenExclNull=stringToUTF8(log,infoLog,maxLength);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}}function _glGetShaderPrecisionFormat(shaderType,precisionType,range,precision){var result=GLctx.getShaderPrecisionFormat(shaderType,precisionType);HEAP32[range>>2]=result.rangeMin;HEAP32[range+4>>2]=result.rangeMax;HEAP32[precision>>2]=result.precision}function _glGetShaderSource(shader,bufSize,length,source){var result=GLctx.getShaderSource(GL.shaders[shader]);if(!result)return;if(bufSize>0&&source){var numBytesWrittenExclNull=stringToUTF8(result,source,bufSize);if(length)HEAP32[length>>2]=numBytesWrittenExclNull}else{if(length)HEAP32[length>>2]=0}}function _glGetShaderiv(shader,pname,p){if(!p){GL.recordError(1281);return}if(pname==35716){var log=GLctx.getShaderInfoLog(GL.shaders[shader]);if(log===null)log="(unknown error)";HEAP32[p>>2]=log.length+1}else if(pname==35720){var source=GLctx.getShaderSource(GL.shaders[shader]);var sourceLength=source===null||source.length==0?0:source.length+1;HEAP32[p>>2]=sourceLength}else{HEAP32[p>>2]=GLctx.getShaderParameter(GL.shaders[shader],pname)}}function _glGetString(name_){if(GL.stringCache[name_])return GL.stringCache[name_];var ret;switch(name_){case 7936:case 7937:case 37445:case 37446:ret=allocate(intArrayFromString(GLctx.getParameter(name_)),"i8",ALLOC_NORMAL);break;case 7938:var glVersion=GLctx.getParameter(GLctx.VERSION);if(GLctx.canvas.GLctxObject.version>=2)glVersion="OpenGL ES 3.0 ("+glVersion+")";else{glVersion="OpenGL ES 2.0 ("+glVersion+")"}ret=allocate(intArrayFromString(glVersion),"i8",ALLOC_NORMAL);break;case 7939:var exts=GLctx.getSupportedExtensions();var gl_exts=[];for(var i=0;i=stringiCache.length){GL.recordError(1281);return 0}return stringiCache[index]}switch(name){case 7939:var exts=GLctx.getSupportedExtensions();var gl_exts=[];for(var i=0;i=stringiCache.length){GL.recordError(1281);return 0}return stringiCache[index];default:GL.recordError(1280);return 0}}function _glGetTexParameteriv(target,pname,params){if(!params){GL.recordError(1281);return}HEAP32[params>>2]=GLctx.getTexParameter(target,pname)}function _glGetUniformBlockIndex(program,uniformBlockName){program=GL.programs[program];uniformBlockName=Pointer_stringify(uniformBlockName);return GLctx["getUniformBlockIndex"](program,uniformBlockName)}function _glGetUniformIndices(program,uniformCount,uniformNames,uniformIndices){if(!uniformIndices){GL.recordError(1281);return}if(uniformCount>0&&(uniformNames==0||uniformIndices==0)){GL.recordError(1281);return}program=GL.programs[program];var names=[];for(var i=0;i>2]));var result=GLctx["getUniformIndices"](program,names);if(!result)return;var len=result.length;for(var i=0;i>2]=result[i]}}function _glGetUniformLocation(program,name){name=Pointer_stringify(name);var arrayOffset=0;if(name.indexOf("]",name.length-1)!==-1){var ls=name.lastIndexOf("[");var arrayIndex=name.slice(ls+1,-1);if(arrayIndex.length>0){arrayOffset=parseInt(arrayIndex);if(arrayOffset<0){return-1}}name=name.slice(0,ls)}var ptable=GL.programInfos[program];if(!ptable){return-1}var utable=ptable.uniforms;var uniformInfo=utable[name];if(uniformInfo&&arrayOffset>2]=data;break;case"Float":HEAPF32[params>>2]=data;break;default:throw"internal emscriptenWebGLGetUniform() error, bad type: "+type}}else{for(var i=0;i>2]=data[i];break;case"Float":HEAPF32[params+i*4>>2]=data[i];break;default:throw"internal emscriptenWebGLGetUniform() error, bad type: "+type}}}}function _glGetUniformiv(program,location,params){emscriptenWebGLGetUniform(program,location,params,"Integer")}function emscriptenWebGLGetVertexAttrib(index,pname,params,type){if(!params){GL.recordError(1281);return}var data=GLctx.getVertexAttrib(index,pname);if(pname==34975){HEAP32[params>>2]=data["name"]}else if(typeof data=="number"||typeof data=="boolean"){switch(type){case"Integer":HEAP32[params>>2]=data;break;case"Float":HEAPF32[params>>2]=data;break;case"FloatToInteger":HEAP32[params>>2]=Math.fround(data);break;default:throw"internal emscriptenWebGLGetVertexAttrib() error, bad type: "+type}}else{for(var i=0;i>2]=data[i];break;case"Float":HEAPF32[params+i*4>>2]=data[i];break;case"FloatToInteger":HEAP32[params+i*4>>2]=Math.fround(data[i]);break;default:throw"internal emscriptenWebGLGetVertexAttrib() error, bad type: "+type}}}}function _glGetVertexAttribiv(index,pname,params){emscriptenWebGLGetVertexAttrib(index,pname,params,"FloatToInteger")}function _glInvalidateFramebuffer(target,numAttachments,attachments){var list=GL.tempFixedLengthArray[numAttachments];for(var i=0;i>2]}GLctx["invalidateFramebuffer"](target,list)}function _glIsEnabled(x0){return GLctx["isEnabled"](x0)}function _glIsVertexArray(array){var vao=GL.vaos[array];if(!vao)return 0;return GLctx["isVertexArray"](vao)}function _glLinkProgram(program){GLctx.linkProgram(GL.programs[program]);GL.programInfos[program]=null;GL.populateUniformTable(program)}function _glMapBufferRange(target,offset,length,access){if(access!=26&&access!=10){Module.printErr("glMapBufferRange is only supported when access is MAP_WRITE|INVALIDATE_BUFFER");return 0}if(!emscriptenWebGLValidateMapBufferTarget(target)){GL.recordError(1280);Module.printErr("GL_INVALID_ENUM in glMapBufferRange");return 0}var mem=_malloc(length);if(!mem)return 0;GL.mappedBuffers[emscriptenWebGLGetBufferBinding(target)]={offset:offset,length:length,mem:mem,access:access};return mem}function _glPixelStorei(pname,param){if(pname==3333){GL.packAlignment=param}else if(pname==3317){GL.unpackAlignment=param}GLctx.pixelStorei(pname,param)}function _glPolygonOffset(x0,x1){GLctx["polygonOffset"](x0,x1)}function _glProgramBinary(program,binaryFormat,binary,length){GL.recordError(1280)}function _glProgramParameteri(program,pname,value){GL.recordError(1280)}function _glReadBuffer(x0){GLctx["readBuffer"](x0)}function emscriptenWebGLComputeImageSize(width,height,sizePerPixel,alignment){function roundedToNextMultipleOf(x,y){return Math.floor((x+y-1)/y)*y}var plainRowSize=width*sizePerPixel;var alignedRowSize=roundedToNextMultipleOf(plainRowSize,alignment);return height<=0?0:(height-1)*alignedRowSize+plainRowSize}function emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,internalFormat){var sizePerPixel;var numChannels;switch(format){case 6406:case 6409:case 6402:case 6403:case 36244:numChannels=1;break;case 6410:case 33319:case 33320:numChannels=2;break;case 6407:case 35904:case 36248:numChannels=3;break;case 6408:case 35906:case 36249:numChannels=4;break;default:GL.recordError(1280);return null}switch(type){case 5121:case 5120:sizePerPixel=numChannels*1;break;case 5123:case 36193:case 5131:case 5122:sizePerPixel=numChannels*2;break;case 5125:case 5126:case 5124:sizePerPixel=numChannels*4;break;case 34042:case 35902:case 33640:case 35899:case 34042:sizePerPixel=4;break;case 33635:case 32819:case 32820:sizePerPixel=2;break;default:GL.recordError(1280);return null}var bytes=emscriptenWebGLComputeImageSize(width,height,sizePerPixel,GL.unpackAlignment);switch(type){case 5120:return HEAP8.subarray(pixels,pixels+bytes);case 5121:return HEAPU8.subarray(pixels,pixels+bytes);case 5122:return HEAP16.subarray(pixels>>1,pixels+bytes>>1);case 5124:return HEAP32.subarray(pixels>>2,pixels+bytes>>2);case 5126:return HEAPF32.subarray(pixels>>2,pixels+bytes>>2);case 5125:case 34042:case 35902:case 33640:case 35899:case 34042:return HEAPU32.subarray(pixels>>2,pixels+bytes>>2);case 5123:case 33635:case 32819:case 32820:case 36193:case 5131:return HEAPU16.subarray(pixels>>1,pixels+bytes>>1);default:GL.recordError(1280);return null}}function emscriptenWebGLGetHeapForType(type){switch(type){case 5120:return HEAP8;case 5121:return HEAPU8;case 5122:return HEAP16;case 5123:case 33635:case 32819:case 32820:case 36193:case 5131:return HEAPU16;case 5124:return HEAP32;case 5125:case 34042:case 35902:case 33640:case 35899:case 34042:return HEAPU32;case 5126:return HEAPF32;default:return null}}function emscriptenWebGLGetShiftForType(type){switch(type){case 5120:case 5121:return 0;case 5122:case 5123:case 33635:case 32819:case 32820:case 36193:case 5131:return 1;case 5124:case 5126:case 5125:case 34042:case 35902:case 33640:case 35899:case 34042:return 2;default:return 0}}function _glReadPixels(x,y,width,height,format,type,pixels){if(GL.currentContext.supportsWebGL2EntryPoints){if(GLctx.currentPixelPackBufferBinding){GLctx.readPixels(x,y,width,height,format,type,pixels)}else{GLctx.readPixels(x,y,width,height,format,type,emscriptenWebGLGetHeapForType(type),pixels>>emscriptenWebGLGetShiftForType(type))}return}var pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,format);if(!pixelData){GL.recordError(1280);return}GLctx.readPixels(x,y,width,height,format,type,pixelData)}function _glRenderbufferStorage(x0,x1,x2,x3){GLctx["renderbufferStorage"](x0,x1,x2,x3)}function _glRenderbufferStorageMultisample(x0,x1,x2,x3,x4){GLctx["renderbufferStorageMultisample"](x0,x1,x2,x3,x4)}function _glSamplerParameteri(sampler,pname,param){GLctx["samplerParameteri"](sampler?GL.samplers[sampler]:null,pname,param)}function _glScissor(x0,x1,x2,x3){GLctx["scissor"](x0,x1,x2,x3)}function _glShaderSource(shader,count,string,length){var source=GL.getSource(shader,count,string,length);GLctx.shaderSource(GL.shaders[shader],source)}function _glStencilFuncSeparate(x0,x1,x2,x3){GLctx["stencilFuncSeparate"](x0,x1,x2,x3)}function _glStencilMask(x0){GLctx["stencilMask"](x0)}function _glStencilOpSeparate(x0,x1,x2,x3){GLctx["stencilOpSeparate"](x0,x1,x2,x3)}function _glTexImage2D(target,level,internalFormat,width,height,border,format,type,pixels){if(GL.currentContext.supportsWebGL2EntryPoints){if(GLctx.currentPixelUnpackBufferBinding){GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,pixels)}else if(pixels!=0){GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,emscriptenWebGLGetHeapForType(type),pixels>>emscriptenWebGLGetShiftForType(type))}else{GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,null)}return}var pixelData=null;if(pixels)pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,internalFormat);GLctx.texImage2D(target,level,internalFormat,width,height,border,format,type,pixelData)}function _glTexImage3D(target,level,internalFormat,width,height,depth,border,format,type,pixels){if(GLctx.currentPixelUnpackBufferBinding){GLctx["texImage3D"](target,level,internalFormat,width,height,depth,border,format,type,pixels)}else if(pixels!=0){GLctx["texImage3D"](target,level,internalFormat,width,height,depth,border,format,type,emscriptenWebGLGetHeapForType(type),pixels>>emscriptenWebGLGetShiftForType(type))}else{GLctx["texImage3D"](target,level,internalFormat,width,height,depth,border,format,type,null)}}function _glTexParameterf(x0,x1,x2){GLctx["texParameterf"](x0,x1,x2)}function _glTexParameteri(x0,x1,x2){GLctx["texParameteri"](x0,x1,x2)}function _glTexParameteriv(target,pname,params){var param=HEAP32[params>>2];GLctx.texParameteri(target,pname,param)}function _glTexStorage2D(x0,x1,x2,x3,x4){GLctx["texStorage2D"](x0,x1,x2,x3,x4)}function _glTexStorage3D(x0,x1,x2,x3,x4,x5){GLctx["texStorage3D"](x0,x1,x2,x3,x4,x5)}function _glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels){if(GL.currentContext.supportsWebGL2EntryPoints){if(GLctx.currentPixelUnpackBufferBinding){GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels)}else if(pixels!=0){GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,emscriptenWebGLGetHeapForType(type),pixels>>emscriptenWebGLGetShiftForType(type))}else{GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,null)}return}var pixelData=null;if(pixels)pixelData=emscriptenWebGLGetTexPixelData(type,format,width,height,pixels,0);GLctx.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixelData)}function _glTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,pixels){if(GLctx.currentPixelUnpackBufferBinding){GLctx["texSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,pixels)}else if(pixels!=0){GLctx["texSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,emscriptenWebGLGetHeapForType(type),pixels>>emscriptenWebGLGetShiftForType(type))}else{GLctx["texSubImage3D"](target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,null)}}function _glTransformFeedbackVaryings(program,count,varyings,bufferMode){program=GL.programs[program];var vars=[];for(var i=0;i>2]));GLctx["transformFeedbackVaryings"](program,vars,bufferMode)}function _glUniform1fv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform1fv(GL.uniforms[location],HEAPF32,value>>2,count);return}var view;if(count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[count-1];for(var i=0;i>2]}}else{view=HEAPF32.subarray(value>>2,value+count*4>>2)}GLctx.uniform1fv(GL.uniforms[location],view)}function _glUniform1i(location,v0){GLctx.uniform1i(GL.uniforms[location],v0)}function _glUniform1iv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform1iv(GL.uniforms[location],HEAP32,value>>2,count);return}GLctx.uniform1iv(GL.uniforms[location],HEAP32.subarray(value>>2,value+count*4>>2))}function _glUniform1uiv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform1uiv(GL.uniforms[location],HEAPU32,value>>2,count)}else{GLctx.uniform1uiv(GL.uniforms[location],HEAPU32.subarray(value>>2,value+count*4>>2))}}function _glUniform2fv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform2fv(GL.uniforms[location],HEAPF32,value>>2,count*2);return}var view;if(2*count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[2*count-1];for(var i=0;i<2*count;i+=2){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2]}}else{view=HEAPF32.subarray(value>>2,value+count*8>>2)}GLctx.uniform2fv(GL.uniforms[location],view)}function _glUniform2iv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform2iv(GL.uniforms[location],HEAP32,value>>2,count*2);return}GLctx.uniform2iv(GL.uniforms[location],HEAP32.subarray(value>>2,value+count*8>>2))}function _glUniform2uiv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform2uiv(GL.uniforms[location],HEAPU32,value>>2,count*2)}else{GLctx.uniform2uiv(GL.uniforms[location],HEAPU32.subarray(value>>2,value+count*8>>2))}}function _glUniform3fv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform3fv(GL.uniforms[location],HEAPF32,value>>2,count*3);return}var view;if(3*count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[3*count-1];for(var i=0;i<3*count;i+=3){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2]}}else{view=HEAPF32.subarray(value>>2,value+count*12>>2)}GLctx.uniform3fv(GL.uniforms[location],view)}function _glUniform3iv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform3iv(GL.uniforms[location],HEAP32,value>>2,count*3);return}GLctx.uniform3iv(GL.uniforms[location],HEAP32.subarray(value>>2,value+count*12>>2))}function _glUniform3uiv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform3uiv(GL.uniforms[location],HEAPU32,value>>2,count*3)}else{GLctx.uniform3uiv(GL.uniforms[location],HEAPU32.subarray(value>>2,value+count*12>>2))}}function _glUniform4fv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform4fv(GL.uniforms[location],HEAPF32,value>>2,count*4);return}var view;if(4*count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[4*count-1];for(var i=0;i<4*count;i+=4){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2]}}else{view=HEAPF32.subarray(value>>2,value+count*16>>2)}GLctx.uniform4fv(GL.uniforms[location],view)}function _glUniform4iv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform4iv(GL.uniforms[location],HEAP32,value>>2,count*4);return}GLctx.uniform4iv(GL.uniforms[location],HEAP32.subarray(value>>2,value+count*16>>2))}function _glUniform4uiv(location,count,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniform4uiv(GL.uniforms[location],HEAPU32,value>>2,count*4)}else{GLctx.uniform4uiv(GL.uniforms[location],HEAPU32.subarray(value>>2,value+count*16>>2))}}function _glUniformBlockBinding(program,uniformBlockIndex,uniformBlockBinding){program=GL.programs[program];GLctx["uniformBlockBinding"](program,uniformBlockIndex,uniformBlockBinding)}function _glUniformMatrix3fv(location,count,transpose,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniformMatrix3fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*9);return}var view;if(9*count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[9*count-1];for(var i=0;i<9*count;i+=9){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2];view[i+4]=HEAPF32[value+(4*i+16)>>2];view[i+5]=HEAPF32[value+(4*i+20)>>2];view[i+6]=HEAPF32[value+(4*i+24)>>2];view[i+7]=HEAPF32[value+(4*i+28)>>2];view[i+8]=HEAPF32[value+(4*i+32)>>2]}}else{view=HEAPF32.subarray(value>>2,value+count*36>>2)}GLctx.uniformMatrix3fv(GL.uniforms[location],!!transpose,view)}function _glUniformMatrix4fv(location,count,transpose,value){if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.uniformMatrix4fv(GL.uniforms[location],!!transpose,HEAPF32,value>>2,count*16);return}var view;if(16*count<=GL.MINI_TEMP_BUFFER_SIZE){view=GL.miniTempBufferViews[16*count-1];for(var i=0;i<16*count;i+=16){view[i]=HEAPF32[value+4*i>>2];view[i+1]=HEAPF32[value+(4*i+4)>>2];view[i+2]=HEAPF32[value+(4*i+8)>>2];view[i+3]=HEAPF32[value+(4*i+12)>>2];view[i+4]=HEAPF32[value+(4*i+16)>>2];view[i+5]=HEAPF32[value+(4*i+20)>>2];view[i+6]=HEAPF32[value+(4*i+24)>>2];view[i+7]=HEAPF32[value+(4*i+28)>>2];view[i+8]=HEAPF32[value+(4*i+32)>>2];view[i+9]=HEAPF32[value+(4*i+36)>>2];view[i+10]=HEAPF32[value+(4*i+40)>>2];view[i+11]=HEAPF32[value+(4*i+44)>>2];view[i+12]=HEAPF32[value+(4*i+48)>>2];view[i+13]=HEAPF32[value+(4*i+52)>>2];view[i+14]=HEAPF32[value+(4*i+56)>>2];view[i+15]=HEAPF32[value+(4*i+60)>>2]}}else{view=HEAPF32.subarray(value>>2,value+count*64>>2)}GLctx.uniformMatrix4fv(GL.uniforms[location],!!transpose,view)}function _glUnmapBuffer(target){if(!emscriptenWebGLValidateMapBufferTarget(target)){GL.recordError(1280);Module.printErr("GL_INVALID_ENUM in glUnmapBuffer");return 0}var buffer=emscriptenWebGLGetBufferBinding(target);var mapping=GL.mappedBuffers[buffer];if(!mapping){GL.recordError(1282);Module.printError("buffer was never mapped in glUnmapBuffer");return 0}GL.mappedBuffers[buffer]=null;if(!(mapping.access&16))if(GL.currentContext.supportsWebGL2EntryPoints){GLctx.bufferSubData(target,mapping.offset,HEAPU8,mapping.mem,mapping.length)}else{GLctx.bufferSubData(target,mapping.offset,HEAPU8.subarray(mapping.mem,mapping.mem+mapping.length))}_free(mapping.mem);return 1}function _glUseProgram(program){GLctx.useProgram(program?GL.programs[program]:null)}function _glValidateProgram(program){GLctx.validateProgram(GL.programs[program])}function _glVertexAttrib4f(x0,x1,x2,x3,x4){GLctx["vertexAttrib4f"](x0,x1,x2,x3,x4)}function _glVertexAttrib4fv(index,v){GLctx.vertexAttrib4f(index,HEAPF32[v>>2],HEAPF32[v+4>>2],HEAPF32[v+8>>2],HEAPF32[v+12>>2])}function _glVertexAttribIPointer(index,size,type,stride,ptr){var cb=GL.currentContext.clientBuffers[index];if(!GL.currArrayBuffer){cb.size=size;cb.type=type;cb.normalized=false;cb.stride=stride;cb.ptr=ptr;cb.clientside=true;return}cb.clientside=false;GLctx.vertexAttribIPointer(index,size,type,stride,ptr)}function _glVertexAttribPointer(index,size,type,normalized,stride,ptr){GLctx.vertexAttribPointer(index,size,type,!!normalized,stride,ptr)}function _glViewport(x0,x1,x2,x3){GLctx["viewport"](x0,x1,x2,x3)}var ___tm_current=STATICTOP;STATICTOP+=48;var ___tm_timezone=allocate(intArrayFromString("GMT"),"i8",ALLOC_STATIC);function _gmtime_r(time,tmPtr){var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getUTCSeconds();HEAP32[tmPtr+4>>2]=date.getUTCMinutes();HEAP32[tmPtr+8>>2]=date.getUTCHours();HEAP32[tmPtr+12>>2]=date.getUTCDate();HEAP32[tmPtr+16>>2]=date.getUTCMonth();HEAP32[tmPtr+20>>2]=date.getUTCFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getUTCDay();HEAP32[tmPtr+36>>2]=0;HEAP32[tmPtr+32>>2]=0;var start=Date.UTC(date.getUTCFullYear(),0,1,0,0,0,0);var yday=(date.getTime()-start)/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+40>>2]=___tm_timezone;return tmPtr}function _gmtime(time){return _gmtime_r(time,___tm_current)}function _inet_addr(ptr){var addr=__inet_pton4_raw(Pointer_stringify(ptr));if(addr===null){return-1}return addr}var _llvm_ceil_f32=Math_ceil;var _llvm_ceil_f64=Math_ceil;var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC);function _llvm_cttz_i32(x){x=x|0;var ret=0;ret=HEAP8[cttz_i8+(x&255)>>0]|0;if((ret|0)<8)return ret|0;ret=HEAP8[cttz_i8+(x>>8&255)>>0]|0;if((ret|0)<8)return ret+8|0;ret=HEAP8[cttz_i8+(x>>16&255)>>0]|0;if((ret|0)<8)return ret+16|0;return(HEAP8[cttz_i8+(x>>>24)>>0]|0)+24|0}function _llvm_eh_typeid_for(type){return type}function _llvm_exp2_f32(x){return Math.pow(2,x)}var _llvm_fabs_f32=Math_abs;var _llvm_fabs_f64=Math_abs;var _llvm_floor_f32=Math_floor;var _llvm_floor_f64=Math_floor;var _llvm_pow_f32=Math_pow;var _llvm_pow_f64=Math_pow;function _llvm_trap(){abort("trap!")}var _tzname=STATICTOP;STATICTOP+=16;var _daylight=STATICTOP;STATICTOP+=16;var _timezone=STATICTOP;STATICTOP+=16;function _tzset(){if(_tzset.called)return;_tzset.called=true;HEAP32[_timezone>>2]=(new Date).getTimezoneOffset()*60;var winter=new Date(2e3,0,1);var summer=new Date(2e3,6,1);HEAP32[_daylight>>2]=Number(winter.getTimezoneOffset()!=summer.getTimezoneOffset());function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=allocate(intArrayFromString(winterName),"i8",ALLOC_NORMAL);var summerNamePtr=allocate(intArrayFromString(summerName),"i8",ALLOC_NORMAL);if(summer.getTimezoneOffset()>2]=winterNamePtr;HEAP32[_tzname+4>>2]=summerNamePtr}else{HEAP32[_tzname>>2]=summerNamePtr;HEAP32[_tzname+4>>2]=winterNamePtr}}function _localtime_r(time,tmPtr){_tzset();var date=new Date(HEAP32[time>>2]*1e3);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.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var start=new Date(date.getFullYear(),0,1);var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var summerOffset=(new Date(2e3,6,1)).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>2]=dst;var zonePtr=HEAP32[_tzname+(dst?4:0)>>2];HEAP32[tmPtr+40>>2]=zonePtr;return tmPtr}function _localtime(time){return _localtime_r(time,___tm_current)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}function _mktime(tmPtr){_tzset();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(2e3,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=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;return date.getTime()/1e3|0}function _openWindow(link){var url=Pointer_stringify(link);document.onmouseup=(function(){window.open(url);document.onmouseup=null})}function _pthread_attr_destroy(attr){return 0}function _pthread_attr_init(attr){return 0}function _pthread_cond_destroy(){return 0}function _pthread_cond_init(){return 0}function _pthread_cond_signal(){return 0}function _pthread_cond_timedwait(){return 0}function _pthread_cond_wait(){return 0}function _pthread_create(){return 11}function _pthread_detach(){}var PTHREAD_SPECIFIC={};function _pthread_getspecific(key){return PTHREAD_SPECIFIC[key]||0}var PTHREAD_SPECIFIC_NEXT_KEY=1;function _pthread_key_create(key,destructor){if(key==0){return ERRNO_CODES.EINVAL}HEAP32[key>>2]=PTHREAD_SPECIFIC_NEXT_KEY;PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0;PTHREAD_SPECIFIC_NEXT_KEY++;return 0}function _pthread_key_delete(key){if(key in PTHREAD_SPECIFIC){delete PTHREAD_SPECIFIC[key];return 0}return ERRNO_CODES.EINVAL}function _pthread_mutex_destroy(){}function _pthread_mutex_init(){}function _pthread_mutexattr_destroy(){}function _pthread_mutexattr_init(){}function _pthread_mutexattr_setprotocol(){}function _pthread_mutexattr_settype(){}function _pthread_once(ptr,func){if(!_pthread_once.seen)_pthread_once.seen={};if(ptr in _pthread_once.seen)return;Module["dynCall_v"](func);_pthread_once.seen[ptr]=1}function _pthread_rwlock_init(){return 0}function _pthread_rwlock_rdlock(){return 0}function _pthread_rwlock_unlock(){return 0}function _pthread_rwlock_wrlock(){return 0}function _pthread_setspecific(key,value){if(!(key in PTHREAD_SPECIFIC)){return ERRNO_CODES.EINVAL}PTHREAD_SPECIFIC[key]=value;return 0}function _sched_yield(){return 0}function _setenv(envname,envval,overwrite){if(envname===0){___setErrNo(ERRNO_CODES.EINVAL);return-1}var name=Pointer_stringify(envname);var val=Pointer_stringify(envval);if(name===""||name.indexOf("=")!==-1){___setErrNo(ERRNO_CODES.EINVAL);return-1}if(ENV.hasOwnProperty(name)&&!overwrite)return 0;ENV[name]=val;___buildEnvironment(ENV);return 0}function _sigaction(signum,act,oldact){return 0}function _sigemptyset(set){HEAP32[set>>2]=0;return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]);return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?Pointer_stringify(tm_zone):""};var pattern=Pointer_stringify(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":(function(date){return WEEKDAYS[date.tm_wday].substring(0,3)}),"%A":(function(date){return WEEKDAYS[date.tm_wday]}),"%b":(function(date){return MONTHS[date.tm_mon].substring(0,3)}),"%B":(function(date){return MONTHS[date.tm_mon]}),"%C":(function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)}),"%d":(function(date){return leadingNulls(date.tm_mday,2)}),"%e":(function(date){return leadingSomething(date.tm_mday,2," ")}),"%g":(function(date){return getWeekBasedYear(date).toString().substring(2)}),"%G":(function(date){return getWeekBasedYear(date)}),"%H":(function(date){return leadingNulls(date.tm_hour,2)}),"%I":(function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)}),"%j":(function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)}),"%m":(function(date){return leadingNulls(date.tm_mon+1,2)}),"%M":(function(date){return leadingNulls(date.tm_min,2)}),"%n":(function(){return"\n"}),"%p":(function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}}),"%S":(function(date){return leadingNulls(date.tm_sec,2)}),"%t":(function(){return"\t"}),"%u":(function(date){var day=new Date(date.tm_year+1900,date.tm_mon+1,date.tm_mday,0,0,0,0);return day.getDay()||7}),"%U":(function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"}),"%V":(function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)}),"%Z":(function(date){return date.tm_zone}),"%%":(function(){return"%"})};for(var rule in EXPANSION_RULES_2){if(pattern.indexOf(rule)>=0){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _sysconf(name){switch(name){case 30:return PAGE_SIZE;case 85:var maxHeapSize=2*1024*1024*1024-65536;return maxHeapSize/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(ERRNO_CODES.EINVAL);return-1}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}function _unsetenv(name){if(name===0){___setErrNo(ERRNO_CODES.EINVAL);return-1}name=Pointer_stringify(name);if(name===""||name.indexOf("=")!==-1){___setErrNo(ERRNO_CODES.EINVAL);return-1}if(ENV.hasOwnProperty(name)){delete ENV[name];___buildEnvironment(ENV)}return 0}function _utime(path,times){var time;if(times){var offset=4;time=HEAP32[times+offset>>2];time*=1e3}else{time=Date.now()}path=Pointer_stringify(path);try{FS.utime(path,time,time);return 0}catch(e){FS.handleFSError(e);return-1}}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init()}));__ATMAIN__.push((function(){FS.ignorePermissions=false}));__ATEXIT__.push((function(){FS.quit()}));Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;__ATINIT__.unshift((function(){TTY.init()}));__ATEXIT__.push((function(){TTY.shutdown()}));if(ENVIRONMENT_IS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}Module["requestFullScreen"]=function Module_requestFullScreen(lockPointer,resizeCanvas,vrDevice){Module.printErr("Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead.");Module["requestFullScreen"]=Module["requestFullscreen"];Browser.requestFullScreen(lockPointer,resizeCanvas,vrDevice)};Module["requestFullscreen"]=function Module_requestFullscreen(lockPointer,resizeCanvas,vrDevice){Browser.requestFullscreen(lockPointer,resizeCanvas,vrDevice)};Module["requestAnimationFrame"]=function Module_requestAnimationFrame(func){Browser.requestAnimationFrame(func)};Module["setCanvasSize"]=function Module_setCanvasSize(width,height,noUpdates){Browser.setCanvasSize(width,height,noUpdates)};Module["pauseMainLoop"]=function Module_pauseMainLoop(){Browser.mainLoop.pause()};Module["resumeMainLoop"]=function Module_resumeMainLoop(){Browser.mainLoop.resume()};Module["getUserMedia"]=function Module_getUserMedia(){Browser.getUserMedia()};Module["createContext"]=function Module_createContext(canvas,useWebGL,setInModule,webGLContextAttributes){return Browser.createContext(canvas,useWebGL,setInModule,webGLContextAttributes)};if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function _emscripten_get_now_actual(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else if(typeof self==="object"&&self["performance"]&&typeof self["performance"]["now"]==="function"){_emscripten_get_now=(function(){return self["performance"]["now"]()})}else if(typeof performance==="object"&&typeof performance["now"]==="function"){_emscripten_get_now=(function(){return performance["now"]()})}else{_emscripten_get_now=Date.now}___buildEnvironment(ENV);__ATINIT__.push((function(){SOCKFS.root=FS.mount(SOCKFS,{},null)}));__ATINIT__.push((function(){PIPEFS.root=FS.mount(PIPEFS,{},null)}));JSEvents.staticInit();var GLctx;GL.init();DYNAMICTOP_PTR=staticAlloc(4);STACK_BASE=STACKTOP=alignMemory(STATICTOP);STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=alignMemory(STACK_MAX);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;staticSealed=true;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}Module["wasmTableSize"]=117042;Module["wasmMaxTableSize"]=117042;function invoke_dddi(index,a1,a2,a3){try{return Module["dynCall_dddi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ddi(index,a1,a2){try{return Module["dynCall_ddi"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_dfi(index,a1,a2){try{return Module["dynCall_dfi"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_di(index,a1){try{return Module["dynCall_di"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_didddi(index,a1,a2,a3,a4,a5){try{return Module["dynCall_didddi"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_diddi(index,a1,a2,a3,a4){try{return Module["dynCall_diddi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_didi(index,a1,a2,a3){try{return Module["dynCall_didi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_dii(index,a1,a2){try{return Module["dynCall_dii"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_diii(index,a1,a2,a3){try{return Module["dynCall_diii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_diiii(index,a1,a2,a3,a4){try{return Module["dynCall_diiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_diiji(index,a1,a2,a3,a4,a5){try{return Module["dynCall_diiji"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_diji(index,a1,a2,a3,a4){try{return Module["dynCall_diji"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_dji(index,a1,a2,a3){try{return Module["dynCall_dji"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_f(index){try{return Module["dynCall_f"](index)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fdddi(index,a1,a2,a3,a4){try{return Module["dynCall_fdddi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fdfii(index,a1,a2,a3,a4){try{return Module["dynCall_fdfii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fdi(index,a1,a2){try{return Module["dynCall_fdi"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fdii(index,a1,a2,a3){try{return Module["dynCall_fdii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fdiii(index,a1,a2,a3,a4){try{return Module["dynCall_fdiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ff(index,a1){try{return Module["dynCall_ff"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fff(index,a1,a2){try{return Module["dynCall_fff"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ffffi(index,a1,a2,a3,a4){try{return Module["dynCall_ffffi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ffffiiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_ffffiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fffi(index,a1,a2,a3){try{return Module["dynCall_fffi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fffifffi(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_fffifffi"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ffi(index,a1,a2){try{return Module["dynCall_ffi"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fi(index,a1){try{return Module["dynCall_fi"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fidi(index,a1,a2,a3){try{return Module["dynCall_fidi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fif(index,a1,a2){try{return Module["dynCall_fif"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiff(index,a1,a2,a3){try{return Module["dynCall_fiff"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiffffii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_fiffffii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiffffiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{return Module["dynCall_fiffffiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiffffiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){try{return Module["dynCall_fiffffiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fifffi(index,a1,a2,a3,a4,a5){try{return Module["dynCall_fifffi"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fifffiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_fifffiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiffi(index,a1,a2,a3,a4){try{return Module["dynCall_fiffi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fifi(index,a1,a2,a3){try{return Module["dynCall_fifi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fifii(index,a1,a2,a3,a4){try{return Module["dynCall_fifii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fii(index,a1,a2){try{return Module["dynCall_fii"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiif(index,a1,a2,a3){try{return Module["dynCall_fiif"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiifi(index,a1,a2,a3,a4){try{return Module["dynCall_fiifi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiifii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_fiifii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiii(index,a1,a2,a3){try{return Module["dynCall_fiii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiiii(index,a1,a2,a3,a4){try{return Module["dynCall_fiiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiiiiiifiifif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){try{return Module["dynCall_fiiiiiifiifif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fiiiiiifiiiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){try{return Module["dynCall_fiiiiiifiiiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_fji(index,a1,a2,a3){try{return Module["dynCall_fji"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_i(index){try{return Module["dynCall_i"](index)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iddi(index,a1,a2,a3){try{return Module["dynCall_iddi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_idi(index,a1,a2){try{return Module["dynCall_idi"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_idii(index,a1,a2,a3){try{return Module["dynCall_idii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_idiii(index,a1,a2,a3,a4){try{return Module["dynCall_idiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_idiiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_idiiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_idiiiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_idiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ifffi(index,a1,a2,a3,a4){try{return Module["dynCall_ifffi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iffi(index,a1,a2,a3){try{return Module["dynCall_iffi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ifi(index,a1,a2){try{return Module["dynCall_ifi"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ifiii(index,a1,a2,a3,a4){try{return Module["dynCall_ifiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ifiiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_ifiiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ii(index,a1){try{return Module["dynCall_ii"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiddi(index,a1,a2,a3,a4){try{return Module["dynCall_iiddi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiddiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiddiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iidi(index,a1,a2,a3){try{return Module["dynCall_iidi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iidii(index,a1,a2,a3,a4){try{return Module["dynCall_iidii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iidiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_iidiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iif(index,a1,a2){try{return Module["dynCall_iif"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iifff(index,a1,a2,a3,a4){try{return Module["dynCall_iifff"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiffffi(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiffffi"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iifffi(index,a1,a2,a3,a4,a5){try{return Module["dynCall_iifffi"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiffi(index,a1,a2,a3,a4){try{return Module["dynCall_iiffi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiffiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiffiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iifi(index,a1,a2,a3){try{return Module["dynCall_iifi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iifii(index,a1,a2,a3,a4){try{return Module["dynCall_iifii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iifiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_iifiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iii(index,a1,a2){try{return Module["dynCall_iii"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiid(index,a1,a2,a3){try{return Module["dynCall_iiid"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiidi(index,a1,a2,a3,a4){try{return Module["dynCall_iiidi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiidii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_iiidii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiidiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiidiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiif(index,a1,a2,a3){try{return Module["dynCall_iiif"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiifi(index,a1,a2,a3,a4){try{return Module["dynCall_iiifi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiifii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_iiifii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiifiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiifiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiifiiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_iiifiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiii(index,a1,a2,a3){try{return Module["dynCall_iiii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiidii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiiidii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifffffi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{return Module["dynCall_iiiifffffi"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifi(index,a1,a2,a3,a4,a5){try{return Module["dynCall_iiiifi"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiiifii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_iiiifiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Module["dynCall_iiiifiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiifiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{return Module["dynCall_iiiifiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){try{return Module["dynCall_iiiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiifiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Module["dynCall_iiiiifiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiifiiiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{return Module["dynCall_iiiiifiiiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiifiiiiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){try{return Module["dynCall_iiiiifiiiiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_iiiiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiifffiiifiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){try{return Module["dynCall_iiiiiifffiiifiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiffiiiiiiiiiffffiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23){try{return Module["dynCall_iiiiiiffiiiiiiiiiffffiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiffiiiiiiiiiffffiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24){try{return Module["dynCall_iiiiiiffiiiiiiiiiffffiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiffiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22){try{return Module["dynCall_iiiiiiffiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiifiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{return Module["dynCall_iiiiiifiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiifiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{return Module["dynCall_iiiiiifiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiifiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{return Module["dynCall_iiiiiiifiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_iiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Module["dynCall_iiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{return Module["dynCall_iiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{return Module["dynCall_iiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){try{return Module["dynCall_iiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){try{return Module["dynCall_iiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){try{return Module["dynCall_iiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14){try{return Module["dynCall_iiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){try{return Module["dynCall_iiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16){try{return Module["dynCall_iiiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17){try{return Module["dynCall_iiiiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18){try{return Module["dynCall_iiiiiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19){try{return Module["dynCall_iiiiiiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20){try{return Module["dynCall_iiiiiiiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiij(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiiiij"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiji(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_iiiiiji"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiijjiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){try{return Module["dynCall_iiiiijjiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiij(index,a1,a2,a3,a4,a5){try{return Module["dynCall_iiiij"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiji(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiiiji"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiijii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_iiiijii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiijiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Module["dynCall_iiiijiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiijijii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{return Module["dynCall_iiiijijii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiijjii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{return Module["dynCall_iiiijjii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiijjiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){try{return Module["dynCall_iiiijjiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiij(index,a1,a2,a3,a4){try{return Module["dynCall_iiij"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiji(index,a1,a2,a3,a4,a5){try{return Module["dynCall_iiiji"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiijii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiijii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiijiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_iiijiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiijji(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_iiijji"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiijjii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Module["dynCall_iiijjii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiijjiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{return Module["dynCall_iiijjiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iij(index,a1,a2,a3){try{return Module["dynCall_iij"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiji(index,a1,a2,a3,a4){try{return Module["dynCall_iiji"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_iijii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iijiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijji(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iijji"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijjii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_iijjii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijjiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Module["dynCall_iijjiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iijjji(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Module["dynCall_iijjji"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ij(index,a1,a2){try{return Module["dynCall_ij"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iji(index,a1,a2,a3){try{return Module["dynCall_iji"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ijii(index,a1,a2,a3,a4){try{return Module["dynCall_ijii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ijiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_ijiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ijiiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_ijiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ijiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_ijiiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ijiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Module["dynCall_ijiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ijj(index,a1,a2,a3,a4){try{return Module["dynCall_ijj"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ijji(index,a1,a2,a3,a4,a5){try{return Module["dynCall_ijji"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_j(index){try{return Module["dynCall_j"](index)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jdi(index,a1,a2){try{return Module["dynCall_jdi"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jdii(index,a1,a2,a3){try{return Module["dynCall_jdii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jfi(index,a1,a2){try{return Module["dynCall_jfi"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ji(index,a1){try{return Module["dynCall_ji"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jidi(index,a1,a2,a3){try{return Module["dynCall_jidi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jidii(index,a1,a2,a3,a4){try{return Module["dynCall_jidii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jifi(index,a1,a2,a3){try{return Module["dynCall_jifi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jii(index,a1,a2){try{return Module["dynCall_jii"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiii(index,a1,a2,a3){try{return Module["dynCall_jiii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiii(index,a1,a2,a3,a4){try{return Module["dynCall_jiiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_jiiiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiiiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_jiiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_jiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{return Module["dynCall_jiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{return Module["dynCall_jiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiiji(index,a1,a2,a3,a4,a5){try{return Module["dynCall_jiiji"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jiji(index,a1,a2,a3,a4){try{return Module["dynCall_jiji"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jijii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_jijii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jijiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_jijiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jijj(index,a1,a2,a3,a4,a5){try{return Module["dynCall_jijj"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jijji(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_jijji"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jji(index,a1,a2,a3){try{return Module["dynCall_jji"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jjii(index,a1,a2,a3,a4){try{return Module["dynCall_jjii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jjji(index,a1,a2,a3,a4,a5){try{return Module["dynCall_jjji"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_jjjji(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_jjjji"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_v(index){try{Module["dynCall_v"](index)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vd(index,a1){try{Module["dynCall_vd"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vdiiiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vdiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vf(index,a1){try{Module["dynCall_vf"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vff(index,a1,a2){try{Module["dynCall_vff"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vffff(index,a1,a2,a3,a4){try{Module["dynCall_vffff"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vffffi(index,a1,a2,a3,a4,a5){try{Module["dynCall_vffffi"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vffffii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vffffii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vfi(index,a1,a2){try{Module["dynCall_vfi"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vfii(index,a1,a2,a3){try{Module["dynCall_vfii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vi(index,a1){try{Module["dynCall_vi"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vid(index,a1,a2){try{Module["dynCall_vid"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vidd(index,a1,a2,a3){try{Module["dynCall_vidd"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vidi(index,a1,a2,a3){try{Module["dynCall_vidi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vif(index,a1,a2){try{Module["dynCall_vif"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viff(index,a1,a2,a3){try{Module["dynCall_viff"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifff(index,a1,a2,a3,a4){try{Module["dynCall_vifff"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffff(index,a1,a2,a3,a4,a5){try{Module["dynCall_viffff"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffffi(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viffffi"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffffii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_viffffii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffffiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dynCall_viffffiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifffi(index,a1,a2,a3,a4,a5){try{Module["dynCall_vifffi"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifffii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vifffii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffi(index,a1,a2,a3,a4){try{Module["dynCall_viffi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffii(index,a1,a2,a3,a4,a5){try{Module["dynCall_viffii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viffiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viffiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifi(index,a1,a2,a3){try{Module["dynCall_vifi"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vififfi(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vififfi"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vififfii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_vififfii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifii(index,a1,a2,a3,a4){try{Module["dynCall_vifii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vifiiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vifiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vii(index,a1,a2){try{Module["dynCall_vii"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viidi(index,a1,a2,a3,a4){try{Module["dynCall_viidi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viidii(index,a1,a2,a3,a4,a5){try{Module["dynCall_viidii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viif(index,a1,a2,a3){try{Module["dynCall_viif"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiff(index,a1,a2,a3,a4){try{Module["dynCall_viiff"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viifff(index,a1,a2,a3,a4,a5){try{Module["dynCall_viifff"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiffffiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){try{Module["dynCall_viiffffiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiffi(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiffi"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiffii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viiffii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viifi(index,a1,a2,a3,a4){try{Module["dynCall_viifi"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viifii(index,a1,a2,a3,a4,a5){try{Module["dynCall_viifii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viifiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viifiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viifiiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_viifiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viii(index,a1,a2,a3){try{Module["dynCall_viii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiif(index,a1,a2,a3,a4){try{Module["dynCall_viiif"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiffi(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viiiffi"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiffii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_viiiffii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiifi(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiifi"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiifii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viiifii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiifiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_viiifiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiifiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module["dynCall_viiifiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiii(index,a1,a2,a3,a4){try{Module["dynCall_viiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiif(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiiif"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiifii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_viiiifii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiifiiiiif(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){try{Module["dynCall_viiiifiiiiif"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiif(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viiiiif"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiffi(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dynCall_viiiiiffi"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiffii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module["dynCall_viiiiiffii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiif(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_viiiiiif"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_viiiiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dynCall_viiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module["dynCall_viiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Module["dynCall_viiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){try{Module["dynCall_viiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiifii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14){try{Module["dynCall_viiiiiiiiiiifii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){try{Module["dynCall_viiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){try{Module["dynCall_viiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14){try{Module["dynCall_viiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){try{Module["dynCall_viiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16){try{Module["dynCall_viiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17){try{Module["dynCall_viiiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18){try{Module["dynCall_viiiiiiiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiji(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){try{Module["dynCall_viiiiiiiiiji"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiji(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Module["dynCall_viiiiiiiji"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiijii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){try{Module["dynCall_viiiiiiijii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiijii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module["dynCall_viiiiijii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiji(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_viiiiji"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiijii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dynCall_viiiijii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiijiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Module["dynCall_viiiijiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiijjiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){try{Module["dynCall_viiiijjiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiji(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viiiji"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiijji(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dynCall_viiijji"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiijjii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module["dynCall_viiijjii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiijjiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Module["dynCall_viiijjiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viij(index,a1,a2,a3,a4){try{Module["dynCall_viij"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiji(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiji"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viijii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_viijiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dynCall_viijiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijiijiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){try{Module["dynCall_viijiijiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijijii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module["dynCall_viijijii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijijiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Module["dynCall_viijijiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijji(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_viijji"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijjii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dynCall_viijjii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijjiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module["dynCall_viijjiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viijjji(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module["dynCall_viijjji"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vij(index,a1,a2,a3){try{Module["dynCall_vij"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viji(index,a1,a2,a3,a4){try{Module["dynCall_viji"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijii(index,a1,a2,a3,a4,a5){try{Module["dynCall_vijii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vijiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijiji(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_vijiji"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijijji(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module["dynCall_vijijji"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijji(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vijji"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijjii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_vijjii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vijjji(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dynCall_vijjji"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vjiii(index,a1,a2,a3,a4,a5){try{Module["dynCall_vjiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vjiiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_vjiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vjiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_vjiiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vjiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module["dynCall_vjiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vjiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Module["dynCall_vjiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vjji(index,a1,a2,a3,a4,a5){try{Module["dynCall_vjji"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}Module.asmGlobalArg={};Module.asmLibraryArg={"abort":abort,"assert":assert,"enlargeMemory":enlargeMemory,"getTotalMemory":getTotalMemory,"abortOnCannotGrowMemory":abortOnCannotGrowMemory,"invoke_dddi":invoke_dddi,"invoke_ddi":invoke_ddi,"invoke_dfi":invoke_dfi,"invoke_di":invoke_di,"invoke_didddi":invoke_didddi,"invoke_diddi":invoke_diddi,"invoke_didi":invoke_didi,"invoke_dii":invoke_dii,"invoke_diii":invoke_diii,"invoke_diiii":invoke_diiii,"invoke_diiji":invoke_diiji,"invoke_diji":invoke_diji,"invoke_dji":invoke_dji,"invoke_f":invoke_f,"invoke_fdddi":invoke_fdddi,"invoke_fdfii":invoke_fdfii,"invoke_fdi":invoke_fdi,"invoke_fdii":invoke_fdii,"invoke_fdiii":invoke_fdiii,"invoke_ff":invoke_ff,"invoke_fff":invoke_fff,"invoke_ffffi":invoke_ffffi,"invoke_ffffiiii":invoke_ffffiiii,"invoke_fffi":invoke_fffi,"invoke_fffifffi":invoke_fffifffi,"invoke_ffi":invoke_ffi,"invoke_fi":invoke_fi,"invoke_fidi":invoke_fidi,"invoke_fif":invoke_fif,"invoke_fiff":invoke_fiff,"invoke_fiffffii":invoke_fiffffii,"invoke_fiffffiiiii":invoke_fiffffiiiii,"invoke_fiffffiiiiii":invoke_fiffffiiiiii,"invoke_fifffi":invoke_fifffi,"invoke_fifffiii":invoke_fifffiii,"invoke_fiffi":invoke_fiffi,"invoke_fifi":invoke_fifi,"invoke_fifii":invoke_fifii,"invoke_fii":invoke_fii,"invoke_fiif":invoke_fiif,"invoke_fiifi":invoke_fiifi,"invoke_fiifii":invoke_fiifii,"invoke_fiii":invoke_fiii,"invoke_fiiii":invoke_fiiii,"invoke_fiiiiiifiifif":invoke_fiiiiiifiifif,"invoke_fiiiiiifiiiif":invoke_fiiiiiifiiiif,"invoke_fji":invoke_fji,"invoke_i":invoke_i,"invoke_iddi":invoke_iddi,"invoke_idi":invoke_idi,"invoke_idii":invoke_idii,"invoke_idiii":invoke_idiii,"invoke_idiiii":invoke_idiiii,"invoke_idiiiii":invoke_idiiiii,"invoke_ifffi":invoke_ifffi,"invoke_iffi":invoke_iffi,"invoke_ifi":invoke_ifi,"invoke_ifiii":invoke_ifiii,"invoke_ifiiii":invoke_ifiiii,"invoke_ii":invoke_ii,"invoke_iiddi":invoke_iiddi,"invoke_iiddiii":invoke_iiddiii,"invoke_iidi":invoke_iidi,"invoke_iidii":invoke_iidii,"invoke_iidiii":invoke_iidiii,"invoke_iif":invoke_iif,"invoke_iifff":invoke_iifff,"invoke_iiffffi":invoke_iiffffi,"invoke_iifffi":invoke_iifffi,"invoke_iiffi":invoke_iiffi,"invoke_iiffiii":invoke_iiffiii,"invoke_iifi":invoke_iifi,"invoke_iifii":invoke_iifii,"invoke_iifiii":invoke_iifiii,"invoke_iii":invoke_iii,"invoke_iiid":invoke_iiid,"invoke_iiidi":invoke_iiidi,"invoke_iiidii":invoke_iiidii,"invoke_iiidiii":invoke_iiidiii,"invoke_iiif":invoke_iiif,"invoke_iiifi":invoke_iiifi,"invoke_iiifii":invoke_iiifii,"invoke_iiifiii":invoke_iiifiii,"invoke_iiifiiii":invoke_iiifiiii,"invoke_iiii":invoke_iiii,"invoke_iiiidii":invoke_iiiidii,"invoke_iiiifffffi":invoke_iiiifffffi,"invoke_iiiifi":invoke_iiiifi,"invoke_iiiifii":invoke_iiiifii,"invoke_iiiifiii":invoke_iiiifiii,"invoke_iiiifiiii":invoke_iiiifiiii,"invoke_iiiifiiiii":invoke_iiiifiiiii,"invoke_iiiii":invoke_iiiii,"invoke_iiiiifiii":invoke_iiiiifiii,"invoke_iiiiifiiiif":invoke_iiiiifiiiif,"invoke_iiiiifiiiiif":invoke_iiiiifiiiiif,"invoke_iiiiii":invoke_iiiiii,"invoke_iiiiiifffiiifiii":invoke_iiiiiifffiiifiii,"invoke_iiiiiiffiiiiiiiiiffffiii":invoke_iiiiiiffiiiiiiiiiffffiii,"invoke_iiiiiiffiiiiiiiiiffffiiii":invoke_iiiiiiffiiiiiiiiiffffiiii,"invoke_iiiiiiffiiiiiiiiiiiiiii":invoke_iiiiiiffiiiiiiiiiiiiiii,"invoke_iiiiiifiif":invoke_iiiiiifiif,"invoke_iiiiiifiii":invoke_iiiiiifiii,"invoke_iiiiiii":invoke_iiiiiii,"invoke_iiiiiiifiif":invoke_iiiiiiifiif,"invoke_iiiiiiii":invoke_iiiiiiii,"invoke_iiiiiiiii":invoke_iiiiiiiii,"invoke_iiiiiiiiii":invoke_iiiiiiiiii,"invoke_iiiiiiiiiii":invoke_iiiiiiiiiii,"invoke_iiiiiiiiiiii":invoke_iiiiiiiiiiii,"invoke_iiiiiiiiiiiii":invoke_iiiiiiiiiiiii,"invoke_iiiiiiiiiiiiii":invoke_iiiiiiiiiiiiii,"invoke_iiiiiiiiiiiiiii":invoke_iiiiiiiiiiiiiii,"invoke_iiiiiiiiiiiiiiii":invoke_iiiiiiiiiiiiiiii,"invoke_iiiiiiiiiiiiiiiii":invoke_iiiiiiiiiiiiiiiii,"invoke_iiiiiiiiiiiiiiiiii":invoke_iiiiiiiiiiiiiiiiii,"invoke_iiiiiiiiiiiiiiiiiii":invoke_iiiiiiiiiiiiiiiiiii,"invoke_iiiiiiiiiiiiiiiiiiii":invoke_iiiiiiiiiiiiiiiiiiii,"invoke_iiiiiiiiiiiiiiiiiiiii":invoke_iiiiiiiiiiiiiiiiiiiii,"invoke_iiiiij":invoke_iiiiij,"invoke_iiiiiji":invoke_iiiiiji,"invoke_iiiiijjiiiii":invoke_iiiiijjiiiii,"invoke_iiiij":invoke_iiiij,"invoke_iiiiji":invoke_iiiiji,"invoke_iiiijii":invoke_iiiijii,"invoke_iiiijiii":invoke_iiiijiii,"invoke_iiiijijii":invoke_iiiijijii,"invoke_iiiijjii":invoke_iiiijjii,"invoke_iiiijjiiii":invoke_iiiijjiiii,"invoke_iiij":invoke_iiij,"invoke_iiiji":invoke_iiiji,"invoke_iiijii":invoke_iiijii,"invoke_iiijiii":invoke_iiijiii,"invoke_iiijji":invoke_iiijji,"invoke_iiijjii":invoke_iiijjii,"invoke_iiijjiiii":invoke_iiijjiiii,"invoke_iij":invoke_iij,"invoke_iiji":invoke_iiji,"invoke_iijii":invoke_iijii,"invoke_iijiii":invoke_iijiii,"invoke_iijji":invoke_iijji,"invoke_iijjii":invoke_iijjii,"invoke_iijjiii":invoke_iijjiii,"invoke_iijjji":invoke_iijjji,"invoke_ij":invoke_ij,"invoke_iji":invoke_iji,"invoke_ijii":invoke_ijii,"invoke_ijiii":invoke_ijiii,"invoke_ijiiii":invoke_ijiiii,"invoke_ijiiiii":invoke_ijiiiii,"invoke_ijiiiiii":invoke_ijiiiiii,"invoke_ijj":invoke_ijj,"invoke_ijji":invoke_ijji,"invoke_j":invoke_j,"invoke_jdi":invoke_jdi,"invoke_jdii":invoke_jdii,"invoke_jfi":invoke_jfi,"invoke_ji":invoke_ji,"invoke_jidi":invoke_jidi,"invoke_jidii":invoke_jidii,"invoke_jifi":invoke_jifi,"invoke_jii":invoke_jii,"invoke_jiii":invoke_jiii,"invoke_jiiii":invoke_jiiii,"invoke_jiiiii":invoke_jiiiii,"invoke_jiiiiii":invoke_jiiiiii,"invoke_jiiiiiii":invoke_jiiiiiii,"invoke_jiiiiiiiii":invoke_jiiiiiiiii,"invoke_jiiiiiiiiii":invoke_jiiiiiiiiii,"invoke_jiiji":invoke_jiiji,"invoke_jiji":invoke_jiji,"invoke_jijii":invoke_jijii,"invoke_jijiii":invoke_jijiii,"invoke_jijj":invoke_jijj,"invoke_jijji":invoke_jijji,"invoke_jji":invoke_jji,"invoke_jjii":invoke_jjii,"invoke_jjji":invoke_jjji,"invoke_jjjji":invoke_jjjji,"invoke_v":invoke_v,"invoke_vd":invoke_vd,"invoke_vdiiiii":invoke_vdiiiii,"invoke_vf":invoke_vf,"invoke_vff":invoke_vff,"invoke_vffff":invoke_vffff,"invoke_vffffi":invoke_vffffi,"invoke_vffffii":invoke_vffffii,"invoke_vfi":invoke_vfi,"invoke_vfii":invoke_vfii,"invoke_vi":invoke_vi,"invoke_vid":invoke_vid,"invoke_vidd":invoke_vidd,"invoke_vidi":invoke_vidi,"invoke_vif":invoke_vif,"invoke_viff":invoke_viff,"invoke_vifff":invoke_vifff,"invoke_viffff":invoke_viffff,"invoke_viffffi":invoke_viffffi,"invoke_viffffii":invoke_viffffii,"invoke_viffffiii":invoke_viffffiii,"invoke_vifffi":invoke_vifffi,"invoke_vifffii":invoke_vifffii,"invoke_viffi":invoke_viffi,"invoke_viffii":invoke_viffii,"invoke_viffiii":invoke_viffiii,"invoke_vifi":invoke_vifi,"invoke_vififfi":invoke_vififfi,"invoke_vififfii":invoke_vififfii,"invoke_vifii":invoke_vifii,"invoke_vifiiii":invoke_vifiiii,"invoke_vii":invoke_vii,"invoke_viidi":invoke_viidi,"invoke_viidii":invoke_viidii,"invoke_viif":invoke_viif,"invoke_viiff":invoke_viiff,"invoke_viifff":invoke_viifff,"invoke_viiffffiiiii":invoke_viiffffiiiii,"invoke_viiffi":invoke_viiffi,"invoke_viiffii":invoke_viiffii,"invoke_viifi":invoke_viifi,"invoke_viifii":invoke_viifii,"invoke_viifiii":invoke_viifiii,"invoke_viifiiii":invoke_viifiiii,"invoke_viii":invoke_viii,"invoke_viiif":invoke_viiif,"invoke_viiiffi":invoke_viiiffi,"invoke_viiiffii":invoke_viiiffii,"invoke_viiifi":invoke_viiifi,"invoke_viiifii":invoke_viiifii,"invoke_viiifiii":invoke_viiifiii,"invoke_viiifiiiii":invoke_viiifiiiii,"invoke_viiii":invoke_viiii,"invoke_viiiif":invoke_viiiif,"invoke_viiiifii":invoke_viiiifii,"invoke_viiiifiiiiif":invoke_viiiifiiiiif,"invoke_viiiii":invoke_viiiii,"invoke_viiiiif":invoke_viiiiif,"invoke_viiiiiffi":invoke_viiiiiffi,"invoke_viiiiiffii":invoke_viiiiiffii,"invoke_viiiiii":invoke_viiiiii,"invoke_viiiiiif":invoke_viiiiiif,"invoke_viiiiiii":invoke_viiiiiii,"invoke_viiiiiiii":invoke_viiiiiiii,"invoke_viiiiiiiii":invoke_viiiiiiiii,"invoke_viiiiiiiiii":invoke_viiiiiiiiii,"invoke_viiiiiiiiiii":invoke_viiiiiiiiiii,"invoke_viiiiiiiiiiifii":invoke_viiiiiiiiiiifii,"invoke_viiiiiiiiiiii":invoke_viiiiiiiiiiii,"invoke_viiiiiiiiiiiii":invoke_viiiiiiiiiiiii,"invoke_viiiiiiiiiiiiii":invoke_viiiiiiiiiiiiii,"invoke_viiiiiiiiiiiiiii":invoke_viiiiiiiiiiiiiii,"invoke_viiiiiiiiiiiiiiii":invoke_viiiiiiiiiiiiiiii,"invoke_viiiiiiiiiiiiiiiii":invoke_viiiiiiiiiiiiiiiii,"invoke_viiiiiiiiiiiiiiiiii":invoke_viiiiiiiiiiiiiiiiii,"invoke_viiiiiiiiiji":invoke_viiiiiiiiiji,"invoke_viiiiiiiji":invoke_viiiiiiiji,"invoke_viiiiiiijii":invoke_viiiiiiijii,"invoke_viiiiijii":invoke_viiiiijii,"invoke_viiiiji":invoke_viiiiji,"invoke_viiiijii":invoke_viiiijii,"invoke_viiiijiiii":invoke_viiiijiiii,"invoke_viiiijjiii":invoke_viiiijjiii,"invoke_viiiji":invoke_viiiji,"invoke_viiijji":invoke_viiijji,"invoke_viiijjii":invoke_viiijjii,"invoke_viiijjiii":invoke_viiijjiii,"invoke_viij":invoke_viij,"invoke_viiji":invoke_viiji,"invoke_viijii":invoke_viijii,"invoke_viijiii":invoke_viijiii,"invoke_viijiiii":invoke_viijiiii,"invoke_viijiijiii":invoke_viijiijiii,"invoke_viijijii":invoke_viijijii,"invoke_viijijiii":invoke_viijijiii,"invoke_viijji":invoke_viijji,"invoke_viijjii":invoke_viijjii,"invoke_viijjiii":invoke_viijjiii,"invoke_viijjji":invoke_viijjji,"invoke_vij":invoke_vij,"invoke_viji":invoke_viji,"invoke_vijii":invoke_vijii,"invoke_vijiii":invoke_vijiii,"invoke_vijiji":invoke_vijiji,"invoke_vijijji":invoke_vijijji,"invoke_vijji":invoke_vijji,"invoke_vijjii":invoke_vijjii,"invoke_vijjji":invoke_vijjji,"invoke_vjiii":invoke_vjiii,"invoke_vjiiii":invoke_vjiiii,"invoke_vjiiiii":invoke_vjiiiii,"invoke_vjiiiiiii":invoke_vjiiiiiii,"invoke_vjiiiiiiii":invoke_vjiiiiiiii,"invoke_vjji":invoke_vjji,"_GetRefererDomain":_GetRefererDomain,"_IMG_Load":_IMG_Load,"_IMG_Load_RW":_IMG_Load_RW,"_JS_Cursor_SetImage":_JS_Cursor_SetImage,"_JS_Cursor_SetShow":_JS_Cursor_SetShow,"_JS_Eval_ClearInterval":_JS_Eval_ClearInterval,"_JS_Eval_SetInterval":_JS_Eval_SetInterval,"_JS_FileSystem_SetSyncInterval":_JS_FileSystem_SetSyncInterval,"_JS_FileSystem_Sync":_JS_FileSystem_Sync,"_JS_Log_StackTrace":_JS_Log_StackTrace,"_JS_Sound_Create_Channel":_JS_Sound_Create_Channel,"_JS_Sound_GetLength":_JS_Sound_GetLength,"_JS_Sound_GetLoadState":_JS_Sound_GetLoadState,"_JS_Sound_Init":_JS_Sound_Init,"_JS_Sound_Load":_JS_Sound_Load,"_JS_Sound_Load_PCM":_JS_Sound_Load_PCM,"_JS_Sound_Play":_JS_Sound_Play,"_JS_Sound_ReleaseInstance":_JS_Sound_ReleaseInstance,"_JS_Sound_ResumeIfNeeded":_JS_Sound_ResumeIfNeeded,"_JS_Sound_Set3D":_JS_Sound_Set3D,"_JS_Sound_SetListenerOrientation":_JS_Sound_SetListenerOrientation,"_JS_Sound_SetListenerPosition":_JS_Sound_SetListenerPosition,"_JS_Sound_SetLoop":_JS_Sound_SetLoop,"_JS_Sound_SetLoopPoints":_JS_Sound_SetLoopPoints,"_JS_Sound_SetPitch":_JS_Sound_SetPitch,"_JS_Sound_SetPosition":_JS_Sound_SetPosition,"_JS_Sound_SetVolume":_JS_Sound_SetVolume,"_JS_Sound_Stop":_JS_Sound_Stop,"_JS_SystemInfo_GetBrowserName":_JS_SystemInfo_GetBrowserName,"_JS_SystemInfo_GetBrowserVersionString":_JS_SystemInfo_GetBrowserVersionString,"_JS_SystemInfo_GetCurrentCanvasHeight":_JS_SystemInfo_GetCurrentCanvasHeight,"_JS_SystemInfo_GetCurrentCanvasWidth":_JS_SystemInfo_GetCurrentCanvasWidth,"_JS_SystemInfo_GetDocumentURL":_JS_SystemInfo_GetDocumentURL,"_JS_SystemInfo_GetGPUInfo":_JS_SystemInfo_GetGPUInfo,"_JS_SystemInfo_GetHeight":_JS_SystemInfo_GetHeight,"_JS_SystemInfo_GetLanguage":_JS_SystemInfo_GetLanguage,"_JS_SystemInfo_GetMemory":_JS_SystemInfo_GetMemory,"_JS_SystemInfo_GetOS":_JS_SystemInfo_GetOS,"_JS_SystemInfo_GetStreamingAssetsURL":_JS_SystemInfo_GetStreamingAssetsURL,"_JS_SystemInfo_GetWidth":_JS_SystemInfo_GetWidth,"_JS_SystemInfo_HasCursorLock":_JS_SystemInfo_HasCursorLock,"_JS_SystemInfo_HasFullscreen":_JS_SystemInfo_HasFullscreen,"_JS_SystemInfo_HasWebGL":_JS_SystemInfo_HasWebGL,"_JS_WebGL_InitContextAttributes":_JS_WebGL_InitContextAttributes,"_JS_WebRequest_Abort":_JS_WebRequest_Abort,"_JS_WebRequest_Create":_JS_WebRequest_Create,"_JS_WebRequest_GetResponseHeaders":_JS_WebRequest_GetResponseHeaders,"_JS_WebRequest_Release":_JS_WebRequest_Release,"_JS_WebRequest_Send":_JS_WebRequest_Send,"_JS_WebRequest_SetProgressHandler":_JS_WebRequest_SetProgressHandler,"_JS_WebRequest_SetRequestHeader":_JS_WebRequest_SetRequestHeader,"_JS_WebRequest_SetResponseHandler":_JS_WebRequest_SetResponseHandler,"_JS_WebRequest_SetTimeout":_JS_WebRequest_SetTimeout,"_Mix_FreeChunk":_Mix_FreeChunk,"_Mix_HaltMusic":_Mix_HaltMusic,"_Mix_LoadWAV_RW":_Mix_LoadWAV_RW,"_Mix_PlayChannel":_Mix_PlayChannel,"_Mix_PlayMusic":_Mix_PlayMusic,"_SDK_Init":_SDK_Init,"_SDK_PreloadAd":_SDK_PreloadAd,"_SDK_ShowAd":_SDK_ShowAd,"_SDL_CloseAudio":_SDL_CloseAudio,"_SDL_FreeRW":_SDL_FreeRW,"_SDL_GL_SwapBuffers":_SDL_GL_SwapBuffers,"_SDL_GetTicks":_SDL_GetTicks,"_SDL_LockSurface":_SDL_LockSurface,"_SDL_PauseAudio":_SDL_PauseAudio,"_SDL_RWFromConstMem":_SDL_RWFromConstMem,"_SDL_RWFromFile":_SDL_RWFromFile,"_SDL_UpperBlit":_SDL_UpperBlit,"_SDL_UpperBlitScaled":_SDL_UpperBlitScaled,"_TTF_FontHeight":_TTF_FontHeight,"_TTF_RenderText_Solid":_TTF_RenderText_Solid,"_TTF_SizeText":_TTF_SizeText,"__ZSt18uncaught_exceptionv":__ZSt18uncaught_exceptionv,"___buildEnvironment":___buildEnvironment,"___cxa_allocate_exception":___cxa_allocate_exception,"___cxa_begin_catch":___cxa_begin_catch,"___cxa_end_catch":___cxa_end_catch,"___cxa_find_matching_catch":___cxa_find_matching_catch,"___cxa_find_matching_catch_2":___cxa_find_matching_catch_2,"___cxa_find_matching_catch_3":___cxa_find_matching_catch_3,"___cxa_find_matching_catch_4":___cxa_find_matching_catch_4,"___cxa_free_exception":___cxa_free_exception,"___cxa_pure_virtual":___cxa_pure_virtual,"___cxa_rethrow":___cxa_rethrow,"___cxa_throw":___cxa_throw,"___gxx_personality_v0":___gxx_personality_v0,"___lock":___lock,"___map_file":___map_file,"___resumeException":___resumeException,"___setErrNo":___setErrNo,"___syscall10":___syscall10,"___syscall102":___syscall102,"___syscall122":___syscall122,"___syscall140":___syscall140,"___syscall142":___syscall142,"___syscall145":___syscall145,"___syscall146":___syscall146,"___syscall15":___syscall15,"___syscall183":___syscall183,"___syscall192":___syscall192,"___syscall193":___syscall193,"___syscall194":___syscall194,"___syscall195":___syscall195,"___syscall196":___syscall196,"___syscall197":___syscall197,"___syscall199":___syscall199,"___syscall202":___syscall202,"___syscall220":___syscall220,"___syscall221":___syscall221,"___syscall268":___syscall268,"___syscall3":___syscall3,"___syscall33":___syscall33,"___syscall38":___syscall38,"___syscall39":___syscall39,"___syscall4":___syscall4,"___syscall40":___syscall40,"___syscall41":___syscall41,"___syscall42":___syscall42,"___syscall5":___syscall5,"___syscall54":___syscall54,"___syscall6":___syscall6,"___syscall77":___syscall77,"___syscall85":___syscall85,"___syscall91":___syscall91,"___unlock":___unlock,"__addDays":__addDays,"__arraySum":__arraySum,"__emscripten_sample_gamepad_data":__emscripten_sample_gamepad_data,"__emscripten_traverse_stack":__emscripten_traverse_stack,"__exit":__exit,"__formatString":__formatString,"__inet_ntop4_raw":__inet_ntop4_raw,"__inet_ntop6_raw":__inet_ntop6_raw,"__inet_pton4_raw":__inet_pton4_raw,"__inet_pton6_raw":__inet_pton6_raw,"__isLeapYear":__isLeapYear,"__read_sockaddr":__read_sockaddr,"__reallyNegative":__reallyNegative,"__setLetterbox":__setLetterbox,"__write_sockaddr":__write_sockaddr,"_abort":_abort,"_atexit":_atexit,"_clock":_clock,"_clock_getres":_clock_getres,"_clock_gettime":_clock_gettime,"_difftime":_difftime,"_dlclose":_dlclose,"_dlopen":_dlopen,"_dlsym":_dlsym,"_emscripten_cancel_main_loop":_emscripten_cancel_main_loop,"_emscripten_do_request_fullscreen":_emscripten_do_request_fullscreen,"_emscripten_exit_fullscreen":_emscripten_exit_fullscreen,"_emscripten_exit_pointerlock":_emscripten_exit_pointerlock,"_emscripten_get_callstack_js":_emscripten_get_callstack_js,"_emscripten_get_fullscreen_status":_emscripten_get_fullscreen_status,"_emscripten_get_gamepad_status":_emscripten_get_gamepad_status,"_emscripten_get_main_loop_timing":_emscripten_get_main_loop_timing,"_emscripten_get_now":_emscripten_get_now,"_emscripten_get_now_is_monotonic":_emscripten_get_now_is_monotonic,"_emscripten_get_now_res":_emscripten_get_now_res,"_emscripten_get_num_gamepads":_emscripten_get_num_gamepads,"_emscripten_has_threading_support":_emscripten_has_threading_support,"_emscripten_is_webgl_context_lost":_emscripten_is_webgl_context_lost,"_emscripten_log":_emscripten_log,"_emscripten_log_js":_emscripten_log_js,"_emscripten_longjmp":_emscripten_longjmp,"_emscripten_memcpy_big":_emscripten_memcpy_big,"_emscripten_num_logical_cores":_emscripten_num_logical_cores,"_emscripten_request_fullscreen":_emscripten_request_fullscreen,"_emscripten_request_pointerlock":_emscripten_request_pointerlock,"_emscripten_set_blur_callback":_emscripten_set_blur_callback,"_emscripten_set_canvas_size":_emscripten_set_canvas_size,"_emscripten_set_devicemotion_callback":_emscripten_set_devicemotion_callback,"_emscripten_set_deviceorientation_callback":_emscripten_set_deviceorientation_callback,"_emscripten_set_focus_callback":_emscripten_set_focus_callback,"_emscripten_set_fullscreenchange_callback":_emscripten_set_fullscreenchange_callback,"_emscripten_set_keydown_callback":_emscripten_set_keydown_callback,"_emscripten_set_keypress_callback":_emscripten_set_keypress_callback,"_emscripten_set_keyup_callback":_emscripten_set_keyup_callback,"_emscripten_set_main_loop":_emscripten_set_main_loop,"_emscripten_set_main_loop_timing":_emscripten_set_main_loop_timing,"_emscripten_set_mousedown_callback":_emscripten_set_mousedown_callback,"_emscripten_set_mousemove_callback":_emscripten_set_mousemove_callback,"_emscripten_set_mouseup_callback":_emscripten_set_mouseup_callback,"_emscripten_set_touchcancel_callback":_emscripten_set_touchcancel_callback,"_emscripten_set_touchend_callback":_emscripten_set_touchend_callback,"_emscripten_set_touchmove_callback":_emscripten_set_touchmove_callback,"_emscripten_set_touchstart_callback":_emscripten_set_touchstart_callback,"_emscripten_set_wheel_callback":_emscripten_set_wheel_callback,"_emscripten_webgl_create_context":_emscripten_webgl_create_context,"_emscripten_webgl_destroy_context":_emscripten_webgl_destroy_context,"_emscripten_webgl_enable_extension":_emscripten_webgl_enable_extension,"_emscripten_webgl_get_current_context":_emscripten_webgl_get_current_context,"_emscripten_webgl_make_context_current":_emscripten_webgl_make_context_current,"_exit":_exit,"_flock":_flock,"_getenv":_getenv,"_gethostbyaddr":_gethostbyaddr,"_gethostbyname":_gethostbyname,"_getpwuid":_getpwuid,"_gettimeofday":_gettimeofday,"_glActiveTexture":_glActiveTexture,"_glAttachShader":_glAttachShader,"_glBeginQuery":_glBeginQuery,"_glBeginTransformFeedback":_glBeginTransformFeedback,"_glBindAttribLocation":_glBindAttribLocation,"_glBindBuffer":_glBindBuffer,"_glBindBufferBase":_glBindBufferBase,"_glBindFramebuffer":_glBindFramebuffer,"_glBindRenderbuffer":_glBindRenderbuffer,"_glBindSampler":_glBindSampler,"_glBindTexture":_glBindTexture,"_glBindTransformFeedback":_glBindTransformFeedback,"_glBindVertexArray":_glBindVertexArray,"_glBlendEquation":_glBlendEquation,"_glBlendEquationSeparate":_glBlendEquationSeparate,"_glBlendFuncSeparate":_glBlendFuncSeparate,"_glBlitFramebuffer":_glBlitFramebuffer,"_glBufferData":_glBufferData,"_glBufferSubData":_glBufferSubData,"_glCheckFramebufferStatus":_glCheckFramebufferStatus,"_glClear":_glClear,"_glClearColor":_glClearColor,"_glClearDepthf":_glClearDepthf,"_glClearStencil":_glClearStencil,"_glClientWaitSync":_glClientWaitSync,"_glColorMask":_glColorMask,"_glCompileShader":_glCompileShader,"_glCompressedTexImage2D":_glCompressedTexImage2D,"_glCompressedTexSubImage2D":_glCompressedTexSubImage2D,"_glCompressedTexSubImage3D":_glCompressedTexSubImage3D,"_glCopyBufferSubData":_glCopyBufferSubData,"_glCopyTexImage2D":_glCopyTexImage2D,"_glCopyTexSubImage2D":_glCopyTexSubImage2D,"_glCreateProgram":_glCreateProgram,"_glCreateShader":_glCreateShader,"_glCullFace":_glCullFace,"_glDeleteBuffers":_glDeleteBuffers,"_glDeleteFramebuffers":_glDeleteFramebuffers,"_glDeleteProgram":_glDeleteProgram,"_glDeleteQueries":_glDeleteQueries,"_glDeleteRenderbuffers":_glDeleteRenderbuffers,"_glDeleteSamplers":_glDeleteSamplers,"_glDeleteShader":_glDeleteShader,"_glDeleteSync":_glDeleteSync,"_glDeleteTextures":_glDeleteTextures,"_glDeleteTransformFeedbacks":_glDeleteTransformFeedbacks,"_glDeleteVertexArrays":_glDeleteVertexArrays,"_glDepthFunc":_glDepthFunc,"_glDepthMask":_glDepthMask,"_glDetachShader":_glDetachShader,"_glDisable":_glDisable,"_glDisableVertexAttribArray":_glDisableVertexAttribArray,"_glDrawArrays":_glDrawArrays,"_glDrawArraysInstanced":_glDrawArraysInstanced,"_glDrawBuffers":_glDrawBuffers,"_glDrawElements":_glDrawElements,"_glDrawElementsInstanced":_glDrawElementsInstanced,"_glEnable":_glEnable,"_glEnableVertexAttribArray":_glEnableVertexAttribArray,"_glEndQuery":_glEndQuery,"_glEndTransformFeedback":_glEndTransformFeedback,"_glFenceSync":_glFenceSync,"_glFinish":_glFinish,"_glFlush":_glFlush,"_glFlushMappedBufferRange":_glFlushMappedBufferRange,"_glFramebufferRenderbuffer":_glFramebufferRenderbuffer,"_glFramebufferTexture2D":_glFramebufferTexture2D,"_glFramebufferTextureLayer":_glFramebufferTextureLayer,"_glFrontFace":_glFrontFace,"_glGenBuffers":_glGenBuffers,"_glGenFramebuffers":_glGenFramebuffers,"_glGenQueries":_glGenQueries,"_glGenRenderbuffers":_glGenRenderbuffers,"_glGenSamplers":_glGenSamplers,"_glGenTextures":_glGenTextures,"_glGenTransformFeedbacks":_glGenTransformFeedbacks,"_glGenVertexArrays":_glGenVertexArrays,"_glGenerateMipmap":_glGenerateMipmap,"_glGetActiveAttrib":_glGetActiveAttrib,"_glGetActiveUniform":_glGetActiveUniform,"_glGetActiveUniformBlockName":_glGetActiveUniformBlockName,"_glGetActiveUniformBlockiv":_glGetActiveUniformBlockiv,"_glGetActiveUniformsiv":_glGetActiveUniformsiv,"_glGetAttribLocation":_glGetAttribLocation,"_glGetError":_glGetError,"_glGetFramebufferAttachmentParameteriv":_glGetFramebufferAttachmentParameteriv,"_glGetIntegeri_v":_glGetIntegeri_v,"_glGetIntegerv":_glGetIntegerv,"_glGetProgramBinary":_glGetProgramBinary,"_glGetProgramInfoLog":_glGetProgramInfoLog,"_glGetProgramiv":_glGetProgramiv,"_glGetRenderbufferParameteriv":_glGetRenderbufferParameteriv,"_glGetShaderInfoLog":_glGetShaderInfoLog,"_glGetShaderPrecisionFormat":_glGetShaderPrecisionFormat,"_glGetShaderSource":_glGetShaderSource,"_glGetShaderiv":_glGetShaderiv,"_glGetString":_glGetString,"_glGetStringi":_glGetStringi,"_glGetTexParameteriv":_glGetTexParameteriv,"_glGetUniformBlockIndex":_glGetUniformBlockIndex,"_glGetUniformIndices":_glGetUniformIndices,"_glGetUniformLocation":_glGetUniformLocation,"_glGetUniformiv":_glGetUniformiv,"_glGetVertexAttribiv":_glGetVertexAttribiv,"_glInvalidateFramebuffer":_glInvalidateFramebuffer,"_glIsEnabled":_glIsEnabled,"_glIsVertexArray":_glIsVertexArray,"_glLinkProgram":_glLinkProgram,"_glMapBufferRange":_glMapBufferRange,"_glPixelStorei":_glPixelStorei,"_glPolygonOffset":_glPolygonOffset,"_glProgramBinary":_glProgramBinary,"_glProgramParameteri":_glProgramParameteri,"_glReadBuffer":_glReadBuffer,"_glReadPixels":_glReadPixels,"_glRenderbufferStorage":_glRenderbufferStorage,"_glRenderbufferStorageMultisample":_glRenderbufferStorageMultisample,"_glSamplerParameteri":_glSamplerParameteri,"_glScissor":_glScissor,"_glShaderSource":_glShaderSource,"_glStencilFuncSeparate":_glStencilFuncSeparate,"_glStencilMask":_glStencilMask,"_glStencilOpSeparate":_glStencilOpSeparate,"_glTexImage2D":_glTexImage2D,"_glTexImage3D":_glTexImage3D,"_glTexParameterf":_glTexParameterf,"_glTexParameteri":_glTexParameteri,"_glTexParameteriv":_glTexParameteriv,"_glTexStorage2D":_glTexStorage2D,"_glTexStorage3D":_glTexStorage3D,"_glTexSubImage2D":_glTexSubImage2D,"_glTexSubImage3D":_glTexSubImage3D,"_glTransformFeedbackVaryings":_glTransformFeedbackVaryings,"_glUniform1fv":_glUniform1fv,"_glUniform1i":_glUniform1i,"_glUniform1iv":_glUniform1iv,"_glUniform1uiv":_glUniform1uiv,"_glUniform2fv":_glUniform2fv,"_glUniform2iv":_glUniform2iv,"_glUniform2uiv":_glUniform2uiv,"_glUniform3fv":_glUniform3fv,"_glUniform3iv":_glUniform3iv,"_glUniform3uiv":_glUniform3uiv,"_glUniform4fv":_glUniform4fv,"_glUniform4iv":_glUniform4iv,"_glUniform4uiv":_glUniform4uiv,"_glUniformBlockBinding":_glUniformBlockBinding,"_glUniformMatrix3fv":_glUniformMatrix3fv,"_glUniformMatrix4fv":_glUniformMatrix4fv,"_glUnmapBuffer":_glUnmapBuffer,"_glUseProgram":_glUseProgram,"_glValidateProgram":_glValidateProgram,"_glVertexAttrib4f":_glVertexAttrib4f,"_glVertexAttrib4fv":_glVertexAttrib4fv,"_glVertexAttribIPointer":_glVertexAttribIPointer,"_glVertexAttribPointer":_glVertexAttribPointer,"_glViewport":_glViewport,"_gmtime":_gmtime,"_gmtime_r":_gmtime_r,"_inet_addr":_inet_addr,"_llvm_ceil_f32":_llvm_ceil_f32,"_llvm_ceil_f64":_llvm_ceil_f64,"_llvm_cttz_i32":_llvm_cttz_i32,"_llvm_eh_typeid_for":_llvm_eh_typeid_for,"_llvm_exp2_f32":_llvm_exp2_f32,"_llvm_fabs_f32":_llvm_fabs_f32,"_llvm_fabs_f64":_llvm_fabs_f64,"_llvm_floor_f32":_llvm_floor_f32,"_llvm_floor_f64":_llvm_floor_f64,"_llvm_pow_f32":_llvm_pow_f32,"_llvm_pow_f64":_llvm_pow_f64,"_llvm_trap":_llvm_trap,"_localtime":_localtime,"_localtime_r":_localtime_r,"_longjmp":_longjmp,"_mktime":_mktime,"_openWindow":_openWindow,"_pthread_attr_destroy":_pthread_attr_destroy,"_pthread_attr_init":_pthread_attr_init,"_pthread_cond_destroy":_pthread_cond_destroy,"_pthread_cond_init":_pthread_cond_init,"_pthread_cond_signal":_pthread_cond_signal,"_pthread_cond_timedwait":_pthread_cond_timedwait,"_pthread_cond_wait":_pthread_cond_wait,"_pthread_create":_pthread_create,"_pthread_detach":_pthread_detach,"_pthread_getspecific":_pthread_getspecific,"_pthread_key_create":_pthread_key_create,"_pthread_key_delete":_pthread_key_delete,"_pthread_mutex_destroy":_pthread_mutex_destroy,"_pthread_mutex_init":_pthread_mutex_init,"_pthread_mutexattr_destroy":_pthread_mutexattr_destroy,"_pthread_mutexattr_init":_pthread_mutexattr_init,"_pthread_mutexattr_setprotocol":_pthread_mutexattr_setprotocol,"_pthread_mutexattr_settype":_pthread_mutexattr_settype,"_pthread_once":_pthread_once,"_pthread_rwlock_init":_pthread_rwlock_init,"_pthread_rwlock_rdlock":_pthread_rwlock_rdlock,"_pthread_rwlock_unlock":_pthread_rwlock_unlock,"_pthread_rwlock_wrlock":_pthread_rwlock_wrlock,"_pthread_setspecific":_pthread_setspecific,"_putenv":_putenv,"_sched_yield":_sched_yield,"_setenv":_setenv,"_sigaction":_sigaction,"_sigemptyset":_sigemptyset,"_strftime":_strftime,"_sysconf":_sysconf,"_time":_time,"_tzset":_tzset,"_unsetenv":_unsetenv,"_utime":_utime,"emscriptenWebGLComputeImageSize":emscriptenWebGLComputeImageSize,"emscriptenWebGLGet":emscriptenWebGLGet,"emscriptenWebGLGetBufferBinding":emscriptenWebGLGetBufferBinding,"emscriptenWebGLGetHeapForType":emscriptenWebGLGetHeapForType,"emscriptenWebGLGetIndexed":emscriptenWebGLGetIndexed,"emscriptenWebGLGetShiftForType":emscriptenWebGLGetShiftForType,"emscriptenWebGLGetTexPixelData":emscriptenWebGLGetTexPixelData,"emscriptenWebGLGetUniform":emscriptenWebGLGetUniform,"emscriptenWebGLGetVertexAttrib":emscriptenWebGLGetVertexAttrib,"emscriptenWebGLValidateMapBufferTarget":emscriptenWebGLValidateMapBufferTarget,"DYNAMICTOP_PTR":DYNAMICTOP_PTR,"tempDoublePtr":tempDoublePtr,"ABORT":ABORT,"STACKTOP":STACKTOP,"STACK_MAX":STACK_MAX,"cttz_i8":cttz_i8,"_environ":_environ};var asm=Module["asm"](Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module["asm"]=asm;var _SendMessage=Module["_SendMessage"]=(function(){return Module["asm"]["_SendMessage"].apply(null,arguments)});var _SendMessageFloat=Module["_SendMessageFloat"]=(function(){return Module["asm"]["_SendMessageFloat"].apply(null,arguments)});var _SendMessageString=Module["_SendMessageString"]=(function(){return Module["asm"]["_SendMessageString"].apply(null,arguments)});var _SetFullscreen=Module["_SetFullscreen"]=(function(){return Module["asm"]["_SetFullscreen"].apply(null,arguments)});var __GLOBAL__sub_I_AIScriptingClasses_cpp=Module["__GLOBAL__sub_I_AIScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AIScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_ARScriptingClasses_cpp=Module["__GLOBAL__sub_I_ARScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_ARScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AccessibilityScriptingClasses_cpp=Module["__GLOBAL__sub_I_AccessibilityScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AccessibilityScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AnimationClip_cpp=Module["__GLOBAL__sub_I_AnimationClip_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AnimationClip_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AnimationScriptingClasses_cpp=Module["__GLOBAL__sub_I_AnimationScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AnimationScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AppDomain_cpp=Module["__GLOBAL__sub_I_AppDomain_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AppDomain_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_ArrayMetadata_cpp=Module["__GLOBAL__sub_I_ArrayMetadata_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_ArrayMetadata_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Assembly_cpp=Module["__GLOBAL__sub_I_Assembly_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Assembly_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Assembly_cpp_141163=Module["__GLOBAL__sub_I_Assembly_cpp_141163"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Assembly_cpp_141163"].apply(null,arguments)});var __GLOBAL__sub_I_AssetBundleFileSystem_cpp=Module["__GLOBAL__sub_I_AssetBundleFileSystem_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AssetBundleFileSystem_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AssetBundleScriptingClasses_cpp=Module["__GLOBAL__sub_I_AssetBundleScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AssetBundleScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_AudioScriptingClasses_cpp=Module["__GLOBAL__sub_I_AudioScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_AudioScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Avatar_cpp=Module["__GLOBAL__sub_I_Avatar_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Avatar_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_BoehmGC_cpp=Module["__GLOBAL__sub_I_BoehmGC_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_BoehmGC_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_COMEntryPoints_cpp=Module["__GLOBAL__sub_I_COMEntryPoints_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_COMEntryPoints_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Class_cpp=Module["__GLOBAL__sub_I_Class_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Class_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_ClothScriptingClasses_cpp=Module["__GLOBAL__sub_I_ClothScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_ClothScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Console_cpp=Module["__GLOBAL__sub_I_Console_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Console_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_ConstraintManager_cpp=Module["__GLOBAL__sub_I_ConstraintManager_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_ConstraintManager_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_DirectorScriptingClasses_cpp=Module["__GLOBAL__sub_I_DirectorScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_DirectorScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Environment_cpp=Module["__GLOBAL__sub_I_Environment_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Environment_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Error_cpp=Module["__GLOBAL__sub_I_Error_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Error_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_External_ProphecySDK_BlitOperations_1_cpp=Module["__GLOBAL__sub_I_External_ProphecySDK_BlitOperations_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_External_ProphecySDK_BlitOperations_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_External_Yoga_Yoga_0_cpp=Module["__GLOBAL__sub_I_External_Yoga_Yoga_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_External_Yoga_Yoga_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_File_cpp=Module["__GLOBAL__sub_I_File_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_File_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_GCHandle_cpp=Module["__GLOBAL__sub_I_GCHandle_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_GCHandle_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_GarbageCollector_cpp=Module["__GLOBAL__sub_I_GarbageCollector_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_GarbageCollector_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_GenericMetadata_cpp=Module["__GLOBAL__sub_I_GenericMetadata_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_GenericMetadata_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_GenericMethod_cpp=Module["__GLOBAL__sub_I_GenericMethod_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_GenericMethod_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_GridScriptingClasses_cpp=Module["__GLOBAL__sub_I_GridScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_GridScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_IMGUIScriptingClasses_cpp=Module["__GLOBAL__sub_I_IMGUIScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_IMGUIScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Il2CppCodeRegistration_cpp=Module["__GLOBAL__sub_I_Il2CppCodeRegistration_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Il2CppCodeRegistration_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Image_cpp=Module["__GLOBAL__sub_I_Image_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Image_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_InputScriptingClasses_cpp=Module["__GLOBAL__sub_I_InputScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_InputScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Interlocked_cpp=Module["__GLOBAL__sub_I_Interlocked_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Interlocked_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_LibraryLoader_cpp=Module["__GLOBAL__sub_I_LibraryLoader_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_LibraryLoader_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_LogAssert_cpp=Module["__GLOBAL__sub_I_LogAssert_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_LogAssert_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_MemoryMapImpl_cpp=Module["__GLOBAL__sub_I_MemoryMapImpl_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_MemoryMapImpl_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_MemoryMappedFile_cpp=Module["__GLOBAL__sub_I_MemoryMappedFile_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_MemoryMappedFile_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_MetadataCache_cpp=Module["__GLOBAL__sub_I_MetadataCache_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_MetadataCache_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_AssetBundle_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_AssetBundle_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_AssetBundle_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Audio_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_Audio_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Audio_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Audio_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_Audio_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Audio_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Audio_Public_3_cpp=Module["__GLOBAL__sub_I_Modules_Audio_Public_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Audio_Public_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Grid_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_Grid_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Grid_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_IMGUI_0_cpp=Module["__GLOBAL__sub_I_Modules_IMGUI_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_IMGUI_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_IMGUI_1_cpp=Module["__GLOBAL__sub_I_Modules_IMGUI_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_IMGUI_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Physics2D_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_Physics2D_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Physics2D_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Physics2D_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_Physics2D_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Physics2D_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Profiler_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_Profiler_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Profiler_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Profiler_Runtime_0_cpp=Module["__GLOBAL__sub_I_Modules_Profiler_Runtime_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Profiler_Runtime_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Terrain_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_Terrain_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Terrain_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Terrain_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_Terrain_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Terrain_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Terrain_Public_2_cpp=Module["__GLOBAL__sub_I_Modules_Terrain_Public_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Terrain_Public_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Terrain_VR_0_cpp=Module["__GLOBAL__sub_I_Modules_Terrain_VR_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Terrain_VR_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_TextCore_Native_FontEngine_0_cpp=Module["__GLOBAL__sub_I_Modules_TextCore_Native_FontEngine_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_TextCore_Native_FontEngine_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_TextRendering_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_TextRendering_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_TextRendering_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Tilemap_0_cpp=Module["__GLOBAL__sub_I_Modules_Tilemap_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Tilemap_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Tilemap_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_Tilemap_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Tilemap_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_UnityAnalytics_Dispatcher_0_cpp=Module["__GLOBAL__sub_I_Modules_UnityAnalytics_Dispatcher_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_UnityAnalytics_Dispatcher_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_UnityWebRequest_Public_0_cpp=Module["__GLOBAL__sub_I_Modules_UnityWebRequest_Public_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_UnityWebRequest_Public_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_VFX_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_VFX_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_VFX_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_VFX_Public_2_cpp=Module["__GLOBAL__sub_I_Modules_VFX_Public_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_VFX_Public_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_Video_Public_Base_0_cpp=Module["__GLOBAL__sub_I_Modules_Video_Public_Base_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_Video_Public_Base_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Modules_XR_Subsystems_Input_Public_1_cpp=Module["__GLOBAL__sub_I_Modules_XR_Subsystems_Input_Public_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Modules_XR_Subsystems_Input_Public_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_NativeDelegateMethodCache_cpp=Module["__GLOBAL__sub_I_NativeDelegateMethodCache_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_NativeDelegateMethodCache_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_ParticleSystemRenderer_cpp=Module["__GLOBAL__sub_I_ParticleSystemRenderer_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_ParticleSystemRenderer_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_ParticleSystemScriptingClasses_cpp=Module["__GLOBAL__sub_I_ParticleSystemScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_ParticleSystemScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Path_cpp=Module["__GLOBAL__sub_I_Path_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Path_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_PhysX_Source_LowLevelCloth_src_0_cpp=Module["__GLOBAL__sub_I_PhysX_Source_LowLevelCloth_src_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_PhysX_Source_LowLevelCloth_src_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Physics2DScriptingClasses_cpp=Module["__GLOBAL__sub_I_Physics2DScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Physics2DScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_PhysicsScriptingClasses_cpp=Module["__GLOBAL__sub_I_PhysicsScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_PhysicsScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_PlatformDependent_WebGL_Source_0_cpp=Module["__GLOBAL__sub_I_PlatformDependent_WebGL_Source_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_PlatformDependent_WebGL_Source_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_RCW_cpp=Module["__GLOBAL__sub_I_RCW_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_RCW_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Reflection_cpp=Module["__GLOBAL__sub_I_Reflection_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Reflection_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_2D_Sorting_0_cpp=Module["__GLOBAL__sub_I_Runtime_2D_Sorting_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_2D_Sorting_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_2D_SpriteAtlas_0_cpp=Module["__GLOBAL__sub_I_Runtime_2D_SpriteAtlas_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_2D_SpriteAtlas_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Allocator_1_cpp=Module["__GLOBAL__sub_I_Runtime_Allocator_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Allocator_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Animation_1_cpp=Module["__GLOBAL__sub_I_Runtime_Animation_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Animation_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Animation_3_cpp=Module["__GLOBAL__sub_I_Runtime_Animation_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Animation_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Animation_6_cpp=Module["__GLOBAL__sub_I_Runtime_Animation_6_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Animation_6_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Application_0_cpp=Module["__GLOBAL__sub_I_Runtime_Application_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Application_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_BaseClasses_0_cpp=Module["__GLOBAL__sub_I_Runtime_BaseClasses_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_BaseClasses_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_BaseClasses_1_cpp=Module["__GLOBAL__sub_I_Runtime_BaseClasses_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_BaseClasses_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_BaseClasses_2_cpp=Module["__GLOBAL__sub_I_Runtime_BaseClasses_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_BaseClasses_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_BaseClasses_3_cpp=Module["__GLOBAL__sub_I_Runtime_BaseClasses_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_BaseClasses_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Burst_0_cpp=Module["__GLOBAL__sub_I_Runtime_Burst_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Burst_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_0_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_1_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_2_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_3_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_4_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_4_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_4_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_5_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_5_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_5_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_6_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_6_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_6_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_7_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_7_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_7_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_Culling_0_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_Culling_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_Culling_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_RenderLayers_0_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_RenderLayers_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_RenderLayers_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_RenderLoops_0_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_RenderLoops_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_RenderLoops_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Camera_RenderLoops_2_cpp=Module["__GLOBAL__sub_I_Runtime_Camera_RenderLoops_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Camera_RenderLoops_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Cloth_0_cpp=Module["__GLOBAL__sub_I_Runtime_Cloth_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Cloth_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Containers_0_cpp=Module["__GLOBAL__sub_I_Runtime_Containers_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Containers_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Core_Callbacks_0_cpp=Module["__GLOBAL__sub_I_Runtime_Core_Callbacks_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Core_Callbacks_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Director_Core_1_cpp=Module["__GLOBAL__sub_I_Runtime_Director_Core_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Director_Core_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Dynamics_0_cpp=Module["__GLOBAL__sub_I_Runtime_Dynamics_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Dynamics_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Dynamics_1_cpp=Module["__GLOBAL__sub_I_Runtime_Dynamics_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Dynamics_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_File_0_cpp=Module["__GLOBAL__sub_I_Runtime_File_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_File_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Geometry_2_cpp=Module["__GLOBAL__sub_I_Runtime_Geometry_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Geometry_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_GfxDevice_0_cpp=Module["__GLOBAL__sub_I_Runtime_GfxDevice_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_GfxDevice_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_GfxDevice_1_cpp=Module["__GLOBAL__sub_I_Runtime_GfxDevice_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_GfxDevice_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_GfxDevice_2_cpp=Module["__GLOBAL__sub_I_Runtime_GfxDevice_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_GfxDevice_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_GfxDevice_3_cpp=Module["__GLOBAL__sub_I_Runtime_GfxDevice_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_GfxDevice_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_0_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_10_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_10_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_10_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_11_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_11_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_11_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_1_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_5_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_5_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_5_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_6_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_6_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_6_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_7_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_7_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_7_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_8_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_8_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_8_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_9_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_9_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_9_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_Billboard_0_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_Billboard_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_Billboard_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_LOD_0_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_LOD_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_LOD_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_Mesh_0_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_Mesh_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_Mesh_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_Mesh_2_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_Mesh_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_Mesh_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_Mesh_4_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_Mesh_4_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_Mesh_4_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_Mesh_5_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_Mesh_5_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_Mesh_5_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Graphics_ScriptableRenderLoop_0_cpp=Module["__GLOBAL__sub_I_Runtime_Graphics_ScriptableRenderLoop_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Graphics_ScriptableRenderLoop_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Input_0_cpp=Module["__GLOBAL__sub_I_Runtime_Input_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Input_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Interfaces_0_cpp=Module["__GLOBAL__sub_I_Runtime_Interfaces_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Interfaces_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Interfaces_1_cpp=Module["__GLOBAL__sub_I_Runtime_Interfaces_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Interfaces_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Interfaces_2_cpp=Module["__GLOBAL__sub_I_Runtime_Interfaces_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Interfaces_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Jobs_0_cpp=Module["__GLOBAL__sub_I_Runtime_Jobs_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Jobs_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Jobs_ScriptBindings_0_cpp=Module["__GLOBAL__sub_I_Runtime_Jobs_ScriptBindings_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Jobs_ScriptBindings_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Math_2_cpp=Module["__GLOBAL__sub_I_Runtime_Math_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Math_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Math_Random_0_cpp=Module["__GLOBAL__sub_I_Runtime_Math_Random_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Math_Random_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Misc_0_cpp=Module["__GLOBAL__sub_I_Runtime_Misc_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Misc_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Misc_2_cpp=Module["__GLOBAL__sub_I_Runtime_Misc_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Misc_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Misc_4_cpp=Module["__GLOBAL__sub_I_Runtime_Misc_4_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Misc_4_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Misc_5_cpp=Module["__GLOBAL__sub_I_Runtime_Misc_5_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Misc_5_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Modules_0_cpp=Module["__GLOBAL__sub_I_Runtime_Modules_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Modules_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_0_cpp=Module["__GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_1_cpp=Module["__GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Mono_SerializationBackend_DirectMemoryAccess_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_ParticleSystem_Modules_3_cpp=Module["__GLOBAL__sub_I_Runtime_ParticleSystem_Modules_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_ParticleSystem_Modules_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_PluginInterface_0_cpp=Module["__GLOBAL__sub_I_Runtime_PluginInterface_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_PluginInterface_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_PreloadManager_0_cpp=Module["__GLOBAL__sub_I_Runtime_PreloadManager_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_PreloadManager_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_SceneManager_0_cpp=Module["__GLOBAL__sub_I_Runtime_SceneManager_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_SceneManager_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_ScriptingBackend_Il2Cpp_0_cpp=Module["__GLOBAL__sub_I_Runtime_ScriptingBackend_Il2Cpp_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_ScriptingBackend_Il2Cpp_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Scripting_0_cpp=Module["__GLOBAL__sub_I_Runtime_Scripting_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Scripting_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Scripting_3_cpp=Module["__GLOBAL__sub_I_Runtime_Scripting_3_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Scripting_3_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_0_cpp=Module["__GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_1_cpp=Module["__GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Serialize_TransferFunctions_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Shaders_0_cpp=Module["__GLOBAL__sub_I_Runtime_Shaders_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Shaders_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Shaders_1_cpp=Module["__GLOBAL__sub_I_Runtime_Shaders_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Shaders_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Shaders_ShaderImpl_0_cpp=Module["__GLOBAL__sub_I_Runtime_Shaders_ShaderImpl_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Shaders_ShaderImpl_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Shaders_ShaderImpl_1_cpp=Module["__GLOBAL__sub_I_Runtime_Shaders_ShaderImpl_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Shaders_ShaderImpl_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Transform_0_cpp=Module["__GLOBAL__sub_I_Runtime_Transform_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Transform_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Transform_1_cpp=Module["__GLOBAL__sub_I_Runtime_Transform_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Transform_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_UI_0_cpp=Module["__GLOBAL__sub_I_Runtime_UI_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_UI_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_UI_1_cpp=Module["__GLOBAL__sub_I_Runtime_UI_1_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_UI_1_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_UI_2_cpp=Module["__GLOBAL__sub_I_Runtime_UI_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_UI_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Utilities_2_cpp=Module["__GLOBAL__sub_I_Runtime_Utilities_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Utilities_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Utilities_5_cpp=Module["__GLOBAL__sub_I_Runtime_Utilities_5_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Utilities_5_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Utilities_6_cpp=Module["__GLOBAL__sub_I_Runtime_Utilities_6_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Utilities_6_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Utilities_7_cpp=Module["__GLOBAL__sub_I_Runtime_Utilities_7_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Utilities_7_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Utilities_9_cpp=Module["__GLOBAL__sub_I_Runtime_Utilities_9_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Utilities_9_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_VR_2_cpp=Module["__GLOBAL__sub_I_Runtime_VR_2_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_VR_2_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_VR_PluginInterface_0_cpp=Module["__GLOBAL__sub_I_Runtime_VR_PluginInterface_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_VR_PluginInterface_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_Video_0_cpp=Module["__GLOBAL__sub_I_Runtime_Video_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_Video_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_VirtualFileSystem_0_cpp=Module["__GLOBAL__sub_I_Runtime_VirtualFileSystem_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_VirtualFileSystem_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_cpp=Module["__GLOBAL__sub_I_Runtime_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Runtime_cpp_141788=Module["__GLOBAL__sub_I_Runtime_cpp_141788"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Runtime_cpp_141788"].apply(null,arguments)});var __GLOBAL__sub_I_Shader_cpp=Module["__GLOBAL__sub_I_Shader_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Shader_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Shadows_cpp=Module["__GLOBAL__sub_I_Shadows_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Shadows_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_ShapeModule_cpp=Module["__GLOBAL__sub_I_ShapeModule_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_ShapeModule_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Socket_cpp=Module["__GLOBAL__sub_I_Socket_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Socket_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_SparseTextureGLES_cpp=Module["__GLOBAL__sub_I_SparseTextureGLES_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_SparseTextureGLES_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_SpriteRendererJobs_cpp=Module["__GLOBAL__sub_I_SpriteRendererJobs_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_SpriteRendererJobs_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_StackTrace_cpp=Module["__GLOBAL__sub_I_StackTrace_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_StackTrace_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_String_cpp=Module["__GLOBAL__sub_I_String_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_String_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_SwCollision_cpp=Module["__GLOBAL__sub_I_SwCollision_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_SwCollision_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_SwFactory_cpp=Module["__GLOBAL__sub_I_SwFactory_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_SwFactory_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_SwInterCollision_cpp=Module["__GLOBAL__sub_I_SwInterCollision_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_SwInterCollision_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_SwSelfCollision_cpp=Module["__GLOBAL__sub_I_SwSelfCollision_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_SwSelfCollision_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_SwSolverKernel_cpp=Module["__GLOBAL__sub_I_SwSolverKernel_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_SwSolverKernel_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_TerrainScriptingClasses_cpp=Module["__GLOBAL__sub_I_TerrainScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_TerrainScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_TextCoreScriptingClasses_cpp=Module["__GLOBAL__sub_I_TextCoreScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_TextCoreScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_TextRenderingScriptingClasses_cpp=Module["__GLOBAL__sub_I_TextRenderingScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_TextRenderingScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_ThreadImpl_cpp=Module["__GLOBAL__sub_I_ThreadImpl_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_ThreadImpl_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Thread_cpp=Module["__GLOBAL__sub_I_Thread_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Thread_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Thread_cpp_140329=Module["__GLOBAL__sub_I_Thread_cpp_140329"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Thread_cpp_140329"].apply(null,arguments)});var __GLOBAL__sub_I_TilemapScriptingClasses_cpp=Module["__GLOBAL__sub_I_TilemapScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_TilemapScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_TransformFeedbackSkinning_cpp=Module["__GLOBAL__sub_I_TransformFeedbackSkinning_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_TransformFeedbackSkinning_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Transform_cpp=Module["__GLOBAL__sub_I_Transform_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Transform_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UIElementsScriptingClasses_cpp=Module["__GLOBAL__sub_I_UIElementsScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UIElementsScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UIScriptingClasses_cpp=Module["__GLOBAL__sub_I_UIScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UIScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UnityAdsSettings_cpp=Module["__GLOBAL__sub_I_UnityAdsSettings_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UnityAdsSettings_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UnityAnalyticsScriptingClasses_cpp=Module["__GLOBAL__sub_I_UnityAnalyticsScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UnityAnalyticsScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UnityWebRequestScriptingClasses_cpp=Module["__GLOBAL__sub_I_UnityWebRequestScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UnityWebRequestScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_UnsafeUtility_bindings_cpp=Module["__GLOBAL__sub_I_UnsafeUtility_bindings_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_UnsafeUtility_bindings_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_VFXScriptingClasses_cpp=Module["__GLOBAL__sub_I_VFXScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_VFXScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_VRScriptingClasses_cpp=Module["__GLOBAL__sub_I_VRScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_VRScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_VideoScriptingClasses_cpp=Module["__GLOBAL__sub_I_VideoScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_VideoScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_Wind_cpp=Module["__GLOBAL__sub_I_Wind_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Wind_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_XRScriptingClasses_cpp=Module["__GLOBAL__sub_I_XRScriptingClasses_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_XRScriptingClasses_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_artifacts_WebGL_codegenerator_0_cpp=Module["__GLOBAL__sub_I_artifacts_WebGL_codegenerator_0_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_artifacts_WebGL_codegenerator_0_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_threadpool_ms_cpp=Module["__GLOBAL__sub_I_threadpool_ms_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_threadpool_ms_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_threadpool_ms_io_cpp=Module["__GLOBAL__sub_I_threadpool_ms_io_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_threadpool_ms_io_cpp"].apply(null,arguments)});var __GLOBAL__sub_I_umbra_cpp=Module["__GLOBAL__sub_I_umbra_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_umbra_cpp"].apply(null,arguments)});var ___cxa_can_catch=Module["___cxa_can_catch"]=(function(){return Module["asm"]["___cxa_can_catch"].apply(null,arguments)});var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=(function(){return Module["asm"]["___cxa_is_pointer_type"].apply(null,arguments)});var ___cxx_global_var_init=Module["___cxx_global_var_init"]=(function(){return Module["asm"]["___cxx_global_var_init"].apply(null,arguments)});var ___cxx_global_var_init_106=Module["___cxx_global_var_init_106"]=(function(){return Module["asm"]["___cxx_global_var_init_106"].apply(null,arguments)});var ___cxx_global_var_init_128=Module["___cxx_global_var_init_128"]=(function(){return Module["asm"]["___cxx_global_var_init_128"].apply(null,arguments)});var ___cxx_global_var_init_16=Module["___cxx_global_var_init_16"]=(function(){return Module["asm"]["___cxx_global_var_init_16"].apply(null,arguments)});var ___cxx_global_var_init_19=Module["___cxx_global_var_init_19"]=(function(){return Module["asm"]["___cxx_global_var_init_19"].apply(null,arguments)});var ___cxx_global_var_init_2=Module["___cxx_global_var_init_2"]=(function(){return Module["asm"]["___cxx_global_var_init_2"].apply(null,arguments)});var ___cxx_global_var_init_22=Module["___cxx_global_var_init_22"]=(function(){return Module["asm"]["___cxx_global_var_init_22"].apply(null,arguments)});var ___cxx_global_var_init_3077=Module["___cxx_global_var_init_3077"]=(function(){return Module["asm"]["___cxx_global_var_init_3077"].apply(null,arguments)});var ___cxx_global_var_init_42=Module["___cxx_global_var_init_42"]=(function(){return Module["asm"]["___cxx_global_var_init_42"].apply(null,arguments)});var ___errno_location=Module["___errno_location"]=(function(){return Module["asm"]["___errno_location"].apply(null,arguments)});var _emscripten_replace_memory=Module["_emscripten_replace_memory"]=(function(){return Module["asm"]["_emscripten_replace_memory"].apply(null,arguments)});var _free=Module["_free"]=(function(){return Module["asm"]["_free"].apply(null,arguments)});var _htonl=Module["_htonl"]=(function(){return Module["asm"]["_htonl"].apply(null,arguments)});var _htons=Module["_htons"]=(function(){return Module["asm"]["_htons"].apply(null,arguments)});var _llvm_bswap_i16=Module["_llvm_bswap_i16"]=(function(){return Module["asm"]["_llvm_bswap_i16"].apply(null,arguments)});var _llvm_bswap_i32=Module["_llvm_bswap_i32"]=(function(){return Module["asm"]["_llvm_bswap_i32"].apply(null,arguments)});var _llvm_ctlz_i64=Module["_llvm_ctlz_i64"]=(function(){return Module["asm"]["_llvm_ctlz_i64"].apply(null,arguments)});var _main=Module["_main"]=(function(){return Module["asm"]["_main"].apply(null,arguments)});var _malloc=Module["_malloc"]=(function(){return Module["asm"]["_malloc"].apply(null,arguments)});var _memalign=Module["_memalign"]=(function(){return Module["asm"]["_memalign"].apply(null,arguments)});var _memcpy=Module["_memcpy"]=(function(){return Module["asm"]["_memcpy"].apply(null,arguments)});var _memmove=Module["_memmove"]=(function(){return Module["asm"]["_memmove"].apply(null,arguments)});var _memset=Module["_memset"]=(function(){return Module["asm"]["_memset"].apply(null,arguments)});var _ntohs=Module["_ntohs"]=(function(){return Module["asm"]["_ntohs"].apply(null,arguments)});var _pthread_cond_broadcast=Module["_pthread_cond_broadcast"]=(function(){return Module["asm"]["_pthread_cond_broadcast"].apply(null,arguments)});var _pthread_mutex_lock=Module["_pthread_mutex_lock"]=(function(){return Module["asm"]["_pthread_mutex_lock"].apply(null,arguments)});var _pthread_mutex_unlock=Module["_pthread_mutex_unlock"]=(function(){return Module["asm"]["_pthread_mutex_unlock"].apply(null,arguments)});var _realloc=Module["_realloc"]=(function(){return Module["asm"]["_realloc"].apply(null,arguments)});var _roundf=Module["_roundf"]=(function(){return Module["asm"]["_roundf"].apply(null,arguments)});var _saveSetjmp=Module["_saveSetjmp"]=(function(){return Module["asm"]["_saveSetjmp"].apply(null,arguments)});var _sbrk=Module["_sbrk"]=(function(){return Module["asm"]["_sbrk"].apply(null,arguments)});var _strlen=Module["_strlen"]=(function(){return Module["asm"]["_strlen"].apply(null,arguments)});var _testSetjmp=Module["_testSetjmp"]=(function(){return Module["asm"]["_testSetjmp"].apply(null,arguments)});var establishStackSpace=Module["establishStackSpace"]=(function(){return Module["asm"]["establishStackSpace"].apply(null,arguments)});var getTempRet0=Module["getTempRet0"]=(function(){return Module["asm"]["getTempRet0"].apply(null,arguments)});var runPostSets=Module["runPostSets"]=(function(){return Module["asm"]["runPostSets"].apply(null,arguments)});var setTempRet0=Module["setTempRet0"]=(function(){return Module["asm"]["setTempRet0"].apply(null,arguments)});var setThrew=Module["setThrew"]=(function(){return Module["asm"]["setThrew"].apply(null,arguments)});var stackAlloc=Module["stackAlloc"]=(function(){return Module["asm"]["stackAlloc"].apply(null,arguments)});var stackRestore=Module["stackRestore"]=(function(){return Module["asm"]["stackRestore"].apply(null,arguments)});var stackSave=Module["stackSave"]=(function(){return Module["asm"]["stackSave"].apply(null,arguments)});var dynCall_dddi=Module["dynCall_dddi"]=(function(){return Module["asm"]["dynCall_dddi"].apply(null,arguments)});var dynCall_ddi=Module["dynCall_ddi"]=(function(){return Module["asm"]["dynCall_ddi"].apply(null,arguments)});var dynCall_dfi=Module["dynCall_dfi"]=(function(){return Module["asm"]["dynCall_dfi"].apply(null,arguments)});var dynCall_di=Module["dynCall_di"]=(function(){return Module["asm"]["dynCall_di"].apply(null,arguments)});var dynCall_didddi=Module["dynCall_didddi"]=(function(){return Module["asm"]["dynCall_didddi"].apply(null,arguments)});var dynCall_diddi=Module["dynCall_diddi"]=(function(){return Module["asm"]["dynCall_diddi"].apply(null,arguments)});var dynCall_didi=Module["dynCall_didi"]=(function(){return Module["asm"]["dynCall_didi"].apply(null,arguments)});var dynCall_dii=Module["dynCall_dii"]=(function(){return Module["asm"]["dynCall_dii"].apply(null,arguments)});var dynCall_diii=Module["dynCall_diii"]=(function(){return Module["asm"]["dynCall_diii"].apply(null,arguments)});var dynCall_diiii=Module["dynCall_diiii"]=(function(){return Module["asm"]["dynCall_diiii"].apply(null,arguments)});var dynCall_diiji=Module["dynCall_diiji"]=(function(){return Module["asm"]["dynCall_diiji"].apply(null,arguments)});var dynCall_diji=Module["dynCall_diji"]=(function(){return Module["asm"]["dynCall_diji"].apply(null,arguments)});var dynCall_dji=Module["dynCall_dji"]=(function(){return Module["asm"]["dynCall_dji"].apply(null,arguments)});var dynCall_f=Module["dynCall_f"]=(function(){return Module["asm"]["dynCall_f"].apply(null,arguments)});var dynCall_fdddi=Module["dynCall_fdddi"]=(function(){return Module["asm"]["dynCall_fdddi"].apply(null,arguments)});var dynCall_fdfii=Module["dynCall_fdfii"]=(function(){return Module["asm"]["dynCall_fdfii"].apply(null,arguments)});var dynCall_fdi=Module["dynCall_fdi"]=(function(){return Module["asm"]["dynCall_fdi"].apply(null,arguments)});var dynCall_fdii=Module["dynCall_fdii"]=(function(){return Module["asm"]["dynCall_fdii"].apply(null,arguments)});var dynCall_fdiii=Module["dynCall_fdiii"]=(function(){return Module["asm"]["dynCall_fdiii"].apply(null,arguments)});var dynCall_ff=Module["dynCall_ff"]=(function(){return Module["asm"]["dynCall_ff"].apply(null,arguments)});var dynCall_fff=Module["dynCall_fff"]=(function(){return Module["asm"]["dynCall_fff"].apply(null,arguments)});var dynCall_ffffi=Module["dynCall_ffffi"]=(function(){return Module["asm"]["dynCall_ffffi"].apply(null,arguments)});var dynCall_ffffiiii=Module["dynCall_ffffiiii"]=(function(){return Module["asm"]["dynCall_ffffiiii"].apply(null,arguments)});var dynCall_fffi=Module["dynCall_fffi"]=(function(){return Module["asm"]["dynCall_fffi"].apply(null,arguments)});var dynCall_fffifffi=Module["dynCall_fffifffi"]=(function(){return Module["asm"]["dynCall_fffifffi"].apply(null,arguments)});var dynCall_ffi=Module["dynCall_ffi"]=(function(){return Module["asm"]["dynCall_ffi"].apply(null,arguments)});var dynCall_fi=Module["dynCall_fi"]=(function(){return Module["asm"]["dynCall_fi"].apply(null,arguments)});var dynCall_fidi=Module["dynCall_fidi"]=(function(){return Module["asm"]["dynCall_fidi"].apply(null,arguments)});var dynCall_fif=Module["dynCall_fif"]=(function(){return Module["asm"]["dynCall_fif"].apply(null,arguments)});var dynCall_fiff=Module["dynCall_fiff"]=(function(){return Module["asm"]["dynCall_fiff"].apply(null,arguments)});var dynCall_fiffffii=Module["dynCall_fiffffii"]=(function(){return Module["asm"]["dynCall_fiffffii"].apply(null,arguments)});var dynCall_fiffffiiiii=Module["dynCall_fiffffiiiii"]=(function(){return Module["asm"]["dynCall_fiffffiiiii"].apply(null,arguments)});var dynCall_fiffffiiiiii=Module["dynCall_fiffffiiiiii"]=(function(){return Module["asm"]["dynCall_fiffffiiiiii"].apply(null,arguments)});var dynCall_fifffi=Module["dynCall_fifffi"]=(function(){return Module["asm"]["dynCall_fifffi"].apply(null,arguments)});var dynCall_fifffiii=Module["dynCall_fifffiii"]=(function(){return Module["asm"]["dynCall_fifffiii"].apply(null,arguments)});var dynCall_fiffi=Module["dynCall_fiffi"]=(function(){return Module["asm"]["dynCall_fiffi"].apply(null,arguments)});var dynCall_fifi=Module["dynCall_fifi"]=(function(){return Module["asm"]["dynCall_fifi"].apply(null,arguments)});var dynCall_fifii=Module["dynCall_fifii"]=(function(){return Module["asm"]["dynCall_fifii"].apply(null,arguments)});var dynCall_fii=Module["dynCall_fii"]=(function(){return Module["asm"]["dynCall_fii"].apply(null,arguments)});var dynCall_fiif=Module["dynCall_fiif"]=(function(){return Module["asm"]["dynCall_fiif"].apply(null,arguments)});var dynCall_fiifi=Module["dynCall_fiifi"]=(function(){return Module["asm"]["dynCall_fiifi"].apply(null,arguments)});var dynCall_fiifii=Module["dynCall_fiifii"]=(function(){return Module["asm"]["dynCall_fiifii"].apply(null,arguments)});var dynCall_fiii=Module["dynCall_fiii"]=(function(){return Module["asm"]["dynCall_fiii"].apply(null,arguments)});var dynCall_fiiii=Module["dynCall_fiiii"]=(function(){return Module["asm"]["dynCall_fiiii"].apply(null,arguments)});var dynCall_fiiiiiifiifif=Module["dynCall_fiiiiiifiifif"]=(function(){return Module["asm"]["dynCall_fiiiiiifiifif"].apply(null,arguments)});var dynCall_fiiiiiifiiiif=Module["dynCall_fiiiiiifiiiif"]=(function(){return Module["asm"]["dynCall_fiiiiiifiiiif"].apply(null,arguments)});var dynCall_fji=Module["dynCall_fji"]=(function(){return Module["asm"]["dynCall_fji"].apply(null,arguments)});var dynCall_i=Module["dynCall_i"]=(function(){return Module["asm"]["dynCall_i"].apply(null,arguments)});var dynCall_iddi=Module["dynCall_iddi"]=(function(){return Module["asm"]["dynCall_iddi"].apply(null,arguments)});var dynCall_idi=Module["dynCall_idi"]=(function(){return Module["asm"]["dynCall_idi"].apply(null,arguments)});var dynCall_idii=Module["dynCall_idii"]=(function(){return Module["asm"]["dynCall_idii"].apply(null,arguments)});var dynCall_idiii=Module["dynCall_idiii"]=(function(){return Module["asm"]["dynCall_idiii"].apply(null,arguments)});var dynCall_idiiii=Module["dynCall_idiiii"]=(function(){return Module["asm"]["dynCall_idiiii"].apply(null,arguments)});var dynCall_idiiiii=Module["dynCall_idiiiii"]=(function(){return Module["asm"]["dynCall_idiiiii"].apply(null,arguments)});var dynCall_ifffi=Module["dynCall_ifffi"]=(function(){return Module["asm"]["dynCall_ifffi"].apply(null,arguments)});var dynCall_iffi=Module["dynCall_iffi"]=(function(){return Module["asm"]["dynCall_iffi"].apply(null,arguments)});var dynCall_ifi=Module["dynCall_ifi"]=(function(){return Module["asm"]["dynCall_ifi"].apply(null,arguments)});var dynCall_ifiii=Module["dynCall_ifiii"]=(function(){return Module["asm"]["dynCall_ifiii"].apply(null,arguments)});var dynCall_ifiiii=Module["dynCall_ifiiii"]=(function(){return Module["asm"]["dynCall_ifiiii"].apply(null,arguments)});var dynCall_ii=Module["dynCall_ii"]=(function(){return Module["asm"]["dynCall_ii"].apply(null,arguments)});var dynCall_iiddi=Module["dynCall_iiddi"]=(function(){return Module["asm"]["dynCall_iiddi"].apply(null,arguments)});var dynCall_iiddiii=Module["dynCall_iiddiii"]=(function(){return Module["asm"]["dynCall_iiddiii"].apply(null,arguments)});var dynCall_iidi=Module["dynCall_iidi"]=(function(){return Module["asm"]["dynCall_iidi"].apply(null,arguments)});var dynCall_iidii=Module["dynCall_iidii"]=(function(){return Module["asm"]["dynCall_iidii"].apply(null,arguments)});var dynCall_iidiii=Module["dynCall_iidiii"]=(function(){return Module["asm"]["dynCall_iidiii"].apply(null,arguments)});var dynCall_iif=Module["dynCall_iif"]=(function(){return Module["asm"]["dynCall_iif"].apply(null,arguments)});var dynCall_iifff=Module["dynCall_iifff"]=(function(){return Module["asm"]["dynCall_iifff"].apply(null,arguments)});var dynCall_iiffffi=Module["dynCall_iiffffi"]=(function(){return Module["asm"]["dynCall_iiffffi"].apply(null,arguments)});var dynCall_iifffi=Module["dynCall_iifffi"]=(function(){return Module["asm"]["dynCall_iifffi"].apply(null,arguments)});var dynCall_iiffi=Module["dynCall_iiffi"]=(function(){return Module["asm"]["dynCall_iiffi"].apply(null,arguments)});var dynCall_iiffiii=Module["dynCall_iiffiii"]=(function(){return Module["asm"]["dynCall_iiffiii"].apply(null,arguments)});var dynCall_iifi=Module["dynCall_iifi"]=(function(){return Module["asm"]["dynCall_iifi"].apply(null,arguments)});var dynCall_iifii=Module["dynCall_iifii"]=(function(){return Module["asm"]["dynCall_iifii"].apply(null,arguments)});var dynCall_iifiii=Module["dynCall_iifiii"]=(function(){return Module["asm"]["dynCall_iifiii"].apply(null,arguments)});var dynCall_iii=Module["dynCall_iii"]=(function(){return Module["asm"]["dynCall_iii"].apply(null,arguments)});var dynCall_iiid=Module["dynCall_iiid"]=(function(){return Module["asm"]["dynCall_iiid"].apply(null,arguments)});var dynCall_iiidi=Module["dynCall_iiidi"]=(function(){return Module["asm"]["dynCall_iiidi"].apply(null,arguments)});var dynCall_iiidii=Module["dynCall_iiidii"]=(function(){return Module["asm"]["dynCall_iiidii"].apply(null,arguments)});var dynCall_iiidiii=Module["dynCall_iiidiii"]=(function(){return Module["asm"]["dynCall_iiidiii"].apply(null,arguments)});var dynCall_iiif=Module["dynCall_iiif"]=(function(){return Module["asm"]["dynCall_iiif"].apply(null,arguments)});var dynCall_iiifi=Module["dynCall_iiifi"]=(function(){return Module["asm"]["dynCall_iiifi"].apply(null,arguments)});var dynCall_iiifii=Module["dynCall_iiifii"]=(function(){return Module["asm"]["dynCall_iiifii"].apply(null,arguments)});var dynCall_iiifiii=Module["dynCall_iiifiii"]=(function(){return Module["asm"]["dynCall_iiifiii"].apply(null,arguments)});var dynCall_iiifiiii=Module["dynCall_iiifiiii"]=(function(){return Module["asm"]["dynCall_iiifiiii"].apply(null,arguments)});var dynCall_iiii=Module["dynCall_iiii"]=(function(){return Module["asm"]["dynCall_iiii"].apply(null,arguments)});var dynCall_iiiidii=Module["dynCall_iiiidii"]=(function(){return Module["asm"]["dynCall_iiiidii"].apply(null,arguments)});var dynCall_iiiifffffi=Module["dynCall_iiiifffffi"]=(function(){return Module["asm"]["dynCall_iiiifffffi"].apply(null,arguments)});var dynCall_iiiifi=Module["dynCall_iiiifi"]=(function(){return Module["asm"]["dynCall_iiiifi"].apply(null,arguments)});var dynCall_iiiifii=Module["dynCall_iiiifii"]=(function(){return Module["asm"]["dynCall_iiiifii"].apply(null,arguments)});var dynCall_iiiifiii=Module["dynCall_iiiifiii"]=(function(){return Module["asm"]["dynCall_iiiifiii"].apply(null,arguments)});var dynCall_iiiifiiii=Module["dynCall_iiiifiiii"]=(function(){return Module["asm"]["dynCall_iiiifiiii"].apply(null,arguments)});var dynCall_iiiifiiiii=Module["dynCall_iiiifiiiii"]=(function(){return Module["asm"]["dynCall_iiiifiiiii"].apply(null,arguments)});var dynCall_iiiii=Module["dynCall_iiiii"]=(function(){return Module["asm"]["dynCall_iiiii"].apply(null,arguments)});var dynCall_iiiiifiii=Module["dynCall_iiiiifiii"]=(function(){return Module["asm"]["dynCall_iiiiifiii"].apply(null,arguments)});var dynCall_iiiiifiiiif=Module["dynCall_iiiiifiiiif"]=(function(){return Module["asm"]["dynCall_iiiiifiiiif"].apply(null,arguments)});var dynCall_iiiiifiiiiif=Module["dynCall_iiiiifiiiiif"]=(function(){return Module["asm"]["dynCall_iiiiifiiiiif"].apply(null,arguments)});var dynCall_iiiiii=Module["dynCall_iiiiii"]=(function(){return Module["asm"]["dynCall_iiiiii"].apply(null,arguments)});var dynCall_iiiiiifffiiifiii=Module["dynCall_iiiiiifffiiifiii"]=(function(){return Module["asm"]["dynCall_iiiiiifffiiifiii"].apply(null,arguments)});var dynCall_iiiiiiffiiiiiiiiiffffiii=Module["dynCall_iiiiiiffiiiiiiiiiffffiii"]=(function(){return Module["asm"]["dynCall_iiiiiiffiiiiiiiiiffffiii"].apply(null,arguments)});var dynCall_iiiiiiffiiiiiiiiiffffiiii=Module["dynCall_iiiiiiffiiiiiiiiiffffiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiffiiiiiiiiiffffiiii"].apply(null,arguments)});var dynCall_iiiiiiffiiiiiiiiiiiiiii=Module["dynCall_iiiiiiffiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiffiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiifiif=Module["dynCall_iiiiiifiif"]=(function(){return Module["asm"]["dynCall_iiiiiifiif"].apply(null,arguments)});var dynCall_iiiiiifiii=Module["dynCall_iiiiiifiii"]=(function(){return Module["asm"]["dynCall_iiiiiifiii"].apply(null,arguments)});var dynCall_iiiiiii=Module["dynCall_iiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiii"].apply(null,arguments)});var dynCall_iiiiiiifiif=Module["dynCall_iiiiiiifiif"]=(function(){return Module["asm"]["dynCall_iiiiiiifiif"].apply(null,arguments)});var dynCall_iiiiiiii=Module["dynCall_iiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiii=Module["dynCall_iiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiii=Module["dynCall_iiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiii=Module["dynCall_iiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiii=Module["dynCall_iiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiiii=Module["dynCall_iiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiiiii=Module["dynCall_iiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiiiiii=Module["dynCall_iiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiiiiiii=Module["dynCall_iiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiiiiiiii=Module["dynCall_iiiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiiiiiiiii=Module["dynCall_iiiiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiiiiiiiiii=Module["dynCall_iiiiiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiiiiiiiiiii=Module["dynCall_iiiiiiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiiiiiiiiiiiiiiiiii=Module["dynCall_iiiiiiiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiij=Module["dynCall_iiiiij"]=(function(){return Module["asm"]["dynCall_iiiiij"].apply(null,arguments)});var dynCall_iiiiiji=Module["dynCall_iiiiiji"]=(function(){return Module["asm"]["dynCall_iiiiiji"].apply(null,arguments)});var dynCall_iiiiijjiiiii=Module["dynCall_iiiiijjiiiii"]=(function(){return Module["asm"]["dynCall_iiiiijjiiiii"].apply(null,arguments)});var dynCall_iiiij=Module["dynCall_iiiij"]=(function(){return Module["asm"]["dynCall_iiiij"].apply(null,arguments)});var dynCall_iiiiji=Module["dynCall_iiiiji"]=(function(){return Module["asm"]["dynCall_iiiiji"].apply(null,arguments)});var dynCall_iiiijii=Module["dynCall_iiiijii"]=(function(){return Module["asm"]["dynCall_iiiijii"].apply(null,arguments)});var dynCall_iiiijiii=Module["dynCall_iiiijiii"]=(function(){return Module["asm"]["dynCall_iiiijiii"].apply(null,arguments)});var dynCall_iiiijijii=Module["dynCall_iiiijijii"]=(function(){return Module["asm"]["dynCall_iiiijijii"].apply(null,arguments)});var dynCall_iiiijjii=Module["dynCall_iiiijjii"]=(function(){return Module["asm"]["dynCall_iiiijjii"].apply(null,arguments)});var dynCall_iiiijjiiii=Module["dynCall_iiiijjiiii"]=(function(){return Module["asm"]["dynCall_iiiijjiiii"].apply(null,arguments)});var dynCall_iiij=Module["dynCall_iiij"]=(function(){return Module["asm"]["dynCall_iiij"].apply(null,arguments)});var dynCall_iiiji=Module["dynCall_iiiji"]=(function(){return Module["asm"]["dynCall_iiiji"].apply(null,arguments)});var dynCall_iiijii=Module["dynCall_iiijii"]=(function(){return Module["asm"]["dynCall_iiijii"].apply(null,arguments)});var dynCall_iiijiii=Module["dynCall_iiijiii"]=(function(){return Module["asm"]["dynCall_iiijiii"].apply(null,arguments)});var dynCall_iiijji=Module["dynCall_iiijji"]=(function(){return Module["asm"]["dynCall_iiijji"].apply(null,arguments)});var dynCall_iiijjii=Module["dynCall_iiijjii"]=(function(){return Module["asm"]["dynCall_iiijjii"].apply(null,arguments)});var dynCall_iiijjiiii=Module["dynCall_iiijjiiii"]=(function(){return Module["asm"]["dynCall_iiijjiiii"].apply(null,arguments)});var dynCall_iij=Module["dynCall_iij"]=(function(){return Module["asm"]["dynCall_iij"].apply(null,arguments)});var dynCall_iiji=Module["dynCall_iiji"]=(function(){return Module["asm"]["dynCall_iiji"].apply(null,arguments)});var dynCall_iijii=Module["dynCall_iijii"]=(function(){return Module["asm"]["dynCall_iijii"].apply(null,arguments)});var dynCall_iijiii=Module["dynCall_iijiii"]=(function(){return Module["asm"]["dynCall_iijiii"].apply(null,arguments)});var dynCall_iijji=Module["dynCall_iijji"]=(function(){return Module["asm"]["dynCall_iijji"].apply(null,arguments)});var dynCall_iijjii=Module["dynCall_iijjii"]=(function(){return Module["asm"]["dynCall_iijjii"].apply(null,arguments)});var dynCall_iijjiii=Module["dynCall_iijjiii"]=(function(){return Module["asm"]["dynCall_iijjiii"].apply(null,arguments)});var dynCall_iijjji=Module["dynCall_iijjji"]=(function(){return Module["asm"]["dynCall_iijjji"].apply(null,arguments)});var dynCall_ij=Module["dynCall_ij"]=(function(){return Module["asm"]["dynCall_ij"].apply(null,arguments)});var dynCall_iji=Module["dynCall_iji"]=(function(){return Module["asm"]["dynCall_iji"].apply(null,arguments)});var dynCall_ijii=Module["dynCall_ijii"]=(function(){return Module["asm"]["dynCall_ijii"].apply(null,arguments)});var dynCall_ijiii=Module["dynCall_ijiii"]=(function(){return Module["asm"]["dynCall_ijiii"].apply(null,arguments)});var dynCall_ijiiii=Module["dynCall_ijiiii"]=(function(){return Module["asm"]["dynCall_ijiiii"].apply(null,arguments)});var dynCall_ijiiiii=Module["dynCall_ijiiiii"]=(function(){return Module["asm"]["dynCall_ijiiiii"].apply(null,arguments)});var dynCall_ijiiiiii=Module["dynCall_ijiiiiii"]=(function(){return Module["asm"]["dynCall_ijiiiiii"].apply(null,arguments)});var dynCall_ijj=Module["dynCall_ijj"]=(function(){return Module["asm"]["dynCall_ijj"].apply(null,arguments)});var dynCall_ijji=Module["dynCall_ijji"]=(function(){return Module["asm"]["dynCall_ijji"].apply(null,arguments)});var dynCall_j=Module["dynCall_j"]=(function(){return Module["asm"]["dynCall_j"].apply(null,arguments)});var dynCall_jdi=Module["dynCall_jdi"]=(function(){return Module["asm"]["dynCall_jdi"].apply(null,arguments)});var dynCall_jdii=Module["dynCall_jdii"]=(function(){return Module["asm"]["dynCall_jdii"].apply(null,arguments)});var dynCall_jfi=Module["dynCall_jfi"]=(function(){return Module["asm"]["dynCall_jfi"].apply(null,arguments)});var dynCall_ji=Module["dynCall_ji"]=(function(){return Module["asm"]["dynCall_ji"].apply(null,arguments)});var dynCall_jidi=Module["dynCall_jidi"]=(function(){return Module["asm"]["dynCall_jidi"].apply(null,arguments)});var dynCall_jidii=Module["dynCall_jidii"]=(function(){return Module["asm"]["dynCall_jidii"].apply(null,arguments)});var dynCall_jifi=Module["dynCall_jifi"]=(function(){return Module["asm"]["dynCall_jifi"].apply(null,arguments)});var dynCall_jii=Module["dynCall_jii"]=(function(){return Module["asm"]["dynCall_jii"].apply(null,arguments)});var dynCall_jiii=Module["dynCall_jiii"]=(function(){return Module["asm"]["dynCall_jiii"].apply(null,arguments)});var dynCall_jiiii=Module["dynCall_jiiii"]=(function(){return Module["asm"]["dynCall_jiiii"].apply(null,arguments)});var dynCall_jiiiii=Module["dynCall_jiiiii"]=(function(){return Module["asm"]["dynCall_jiiiii"].apply(null,arguments)});var dynCall_jiiiiii=Module["dynCall_jiiiiii"]=(function(){return Module["asm"]["dynCall_jiiiiii"].apply(null,arguments)});var dynCall_jiiiiiii=Module["dynCall_jiiiiiii"]=(function(){return Module["asm"]["dynCall_jiiiiiii"].apply(null,arguments)});var dynCall_jiiiiiiiii=Module["dynCall_jiiiiiiiii"]=(function(){return Module["asm"]["dynCall_jiiiiiiiii"].apply(null,arguments)});var dynCall_jiiiiiiiiii=Module["dynCall_jiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_jiiiiiiiiii"].apply(null,arguments)});var dynCall_jiiji=Module["dynCall_jiiji"]=(function(){return Module["asm"]["dynCall_jiiji"].apply(null,arguments)});var dynCall_jiji=Module["dynCall_jiji"]=(function(){return Module["asm"]["dynCall_jiji"].apply(null,arguments)});var dynCall_jijii=Module["dynCall_jijii"]=(function(){return Module["asm"]["dynCall_jijii"].apply(null,arguments)});var dynCall_jijiii=Module["dynCall_jijiii"]=(function(){return Module["asm"]["dynCall_jijiii"].apply(null,arguments)});var dynCall_jijj=Module["dynCall_jijj"]=(function(){return Module["asm"]["dynCall_jijj"].apply(null,arguments)});var dynCall_jijji=Module["dynCall_jijji"]=(function(){return Module["asm"]["dynCall_jijji"].apply(null,arguments)});var dynCall_jji=Module["dynCall_jji"]=(function(){return Module["asm"]["dynCall_jji"].apply(null,arguments)});var dynCall_jjii=Module["dynCall_jjii"]=(function(){return Module["asm"]["dynCall_jjii"].apply(null,arguments)});var dynCall_jjji=Module["dynCall_jjji"]=(function(){return Module["asm"]["dynCall_jjji"].apply(null,arguments)});var dynCall_jjjji=Module["dynCall_jjjji"]=(function(){return Module["asm"]["dynCall_jjjji"].apply(null,arguments)});var dynCall_v=Module["dynCall_v"]=(function(){return Module["asm"]["dynCall_v"].apply(null,arguments)});var dynCall_vd=Module["dynCall_vd"]=(function(){return Module["asm"]["dynCall_vd"].apply(null,arguments)});var dynCall_vdiiiii=Module["dynCall_vdiiiii"]=(function(){return Module["asm"]["dynCall_vdiiiii"].apply(null,arguments)});var dynCall_vf=Module["dynCall_vf"]=(function(){return Module["asm"]["dynCall_vf"].apply(null,arguments)});var dynCall_vff=Module["dynCall_vff"]=(function(){return Module["asm"]["dynCall_vff"].apply(null,arguments)});var dynCall_vffff=Module["dynCall_vffff"]=(function(){return Module["asm"]["dynCall_vffff"].apply(null,arguments)});var dynCall_vffffi=Module["dynCall_vffffi"]=(function(){return Module["asm"]["dynCall_vffffi"].apply(null,arguments)});var dynCall_vffffii=Module["dynCall_vffffii"]=(function(){return Module["asm"]["dynCall_vffffii"].apply(null,arguments)});var dynCall_vfi=Module["dynCall_vfi"]=(function(){return Module["asm"]["dynCall_vfi"].apply(null,arguments)});var dynCall_vfii=Module["dynCall_vfii"]=(function(){return Module["asm"]["dynCall_vfii"].apply(null,arguments)});var dynCall_vi=Module["dynCall_vi"]=(function(){return Module["asm"]["dynCall_vi"].apply(null,arguments)});var dynCall_vid=Module["dynCall_vid"]=(function(){return Module["asm"]["dynCall_vid"].apply(null,arguments)});var dynCall_vidd=Module["dynCall_vidd"]=(function(){return Module["asm"]["dynCall_vidd"].apply(null,arguments)});var dynCall_vidi=Module["dynCall_vidi"]=(function(){return Module["asm"]["dynCall_vidi"].apply(null,arguments)});var dynCall_vif=Module["dynCall_vif"]=(function(){return Module["asm"]["dynCall_vif"].apply(null,arguments)});var dynCall_viff=Module["dynCall_viff"]=(function(){return Module["asm"]["dynCall_viff"].apply(null,arguments)});var dynCall_vifff=Module["dynCall_vifff"]=(function(){return Module["asm"]["dynCall_vifff"].apply(null,arguments)});var dynCall_viffff=Module["dynCall_viffff"]=(function(){return Module["asm"]["dynCall_viffff"].apply(null,arguments)});var dynCall_viffffi=Module["dynCall_viffffi"]=(function(){return Module["asm"]["dynCall_viffffi"].apply(null,arguments)});var dynCall_viffffii=Module["dynCall_viffffii"]=(function(){return Module["asm"]["dynCall_viffffii"].apply(null,arguments)});var dynCall_viffffiii=Module["dynCall_viffffiii"]=(function(){return Module["asm"]["dynCall_viffffiii"].apply(null,arguments)});var dynCall_vifffi=Module["dynCall_vifffi"]=(function(){return Module["asm"]["dynCall_vifffi"].apply(null,arguments)});var dynCall_vifffii=Module["dynCall_vifffii"]=(function(){return Module["asm"]["dynCall_vifffii"].apply(null,arguments)});var dynCall_viffi=Module["dynCall_viffi"]=(function(){return Module["asm"]["dynCall_viffi"].apply(null,arguments)});var dynCall_viffii=Module["dynCall_viffii"]=(function(){return Module["asm"]["dynCall_viffii"].apply(null,arguments)});var dynCall_viffiii=Module["dynCall_viffiii"]=(function(){return Module["asm"]["dynCall_viffiii"].apply(null,arguments)});var dynCall_vifi=Module["dynCall_vifi"]=(function(){return Module["asm"]["dynCall_vifi"].apply(null,arguments)});var dynCall_vififfi=Module["dynCall_vififfi"]=(function(){return Module["asm"]["dynCall_vififfi"].apply(null,arguments)});var dynCall_vififfii=Module["dynCall_vififfii"]=(function(){return Module["asm"]["dynCall_vififfii"].apply(null,arguments)});var dynCall_vifii=Module["dynCall_vifii"]=(function(){return Module["asm"]["dynCall_vifii"].apply(null,arguments)});var dynCall_vifiiii=Module["dynCall_vifiiii"]=(function(){return Module["asm"]["dynCall_vifiiii"].apply(null,arguments)});var dynCall_vii=Module["dynCall_vii"]=(function(){return Module["asm"]["dynCall_vii"].apply(null,arguments)});var dynCall_viidi=Module["dynCall_viidi"]=(function(){return Module["asm"]["dynCall_viidi"].apply(null,arguments)});var dynCall_viidii=Module["dynCall_viidii"]=(function(){return Module["asm"]["dynCall_viidii"].apply(null,arguments)});var dynCall_viif=Module["dynCall_viif"]=(function(){return Module["asm"]["dynCall_viif"].apply(null,arguments)});var dynCall_viiff=Module["dynCall_viiff"]=(function(){return Module["asm"]["dynCall_viiff"].apply(null,arguments)});var dynCall_viifff=Module["dynCall_viifff"]=(function(){return Module["asm"]["dynCall_viifff"].apply(null,arguments)});var dynCall_viiffffiiiii=Module["dynCall_viiffffiiiii"]=(function(){return Module["asm"]["dynCall_viiffffiiiii"].apply(null,arguments)});var dynCall_viiffi=Module["dynCall_viiffi"]=(function(){return Module["asm"]["dynCall_viiffi"].apply(null,arguments)});var dynCall_viiffii=Module["dynCall_viiffii"]=(function(){return Module["asm"]["dynCall_viiffii"].apply(null,arguments)});var dynCall_viifi=Module["dynCall_viifi"]=(function(){return Module["asm"]["dynCall_viifi"].apply(null,arguments)});var dynCall_viifii=Module["dynCall_viifii"]=(function(){return Module["asm"]["dynCall_viifii"].apply(null,arguments)});var dynCall_viifiii=Module["dynCall_viifiii"]=(function(){return Module["asm"]["dynCall_viifiii"].apply(null,arguments)});var dynCall_viifiiii=Module["dynCall_viifiiii"]=(function(){return Module["asm"]["dynCall_viifiiii"].apply(null,arguments)});var dynCall_viii=Module["dynCall_viii"]=(function(){return Module["asm"]["dynCall_viii"].apply(null,arguments)});var dynCall_viiif=Module["dynCall_viiif"]=(function(){return Module["asm"]["dynCall_viiif"].apply(null,arguments)});var dynCall_viiiffi=Module["dynCall_viiiffi"]=(function(){return Module["asm"]["dynCall_viiiffi"].apply(null,arguments)});var dynCall_viiiffii=Module["dynCall_viiiffii"]=(function(){return Module["asm"]["dynCall_viiiffii"].apply(null,arguments)});var dynCall_viiifi=Module["dynCall_viiifi"]=(function(){return Module["asm"]["dynCall_viiifi"].apply(null,arguments)});var dynCall_viiifii=Module["dynCall_viiifii"]=(function(){return Module["asm"]["dynCall_viiifii"].apply(null,arguments)});var dynCall_viiifiii=Module["dynCall_viiifiii"]=(function(){return Module["asm"]["dynCall_viiifiii"].apply(null,arguments)});var dynCall_viiifiiiii=Module["dynCall_viiifiiiii"]=(function(){return Module["asm"]["dynCall_viiifiiiii"].apply(null,arguments)});var dynCall_viiii=Module["dynCall_viiii"]=(function(){return Module["asm"]["dynCall_viiii"].apply(null,arguments)});var dynCall_viiiif=Module["dynCall_viiiif"]=(function(){return Module["asm"]["dynCall_viiiif"].apply(null,arguments)});var dynCall_viiiifii=Module["dynCall_viiiifii"]=(function(){return Module["asm"]["dynCall_viiiifii"].apply(null,arguments)});var dynCall_viiiifiiiiif=Module["dynCall_viiiifiiiiif"]=(function(){return Module["asm"]["dynCall_viiiifiiiiif"].apply(null,arguments)});var dynCall_viiiii=Module["dynCall_viiiii"]=(function(){return Module["asm"]["dynCall_viiiii"].apply(null,arguments)});var dynCall_viiiiif=Module["dynCall_viiiiif"]=(function(){return Module["asm"]["dynCall_viiiiif"].apply(null,arguments)});var dynCall_viiiiiffi=Module["dynCall_viiiiiffi"]=(function(){return Module["asm"]["dynCall_viiiiiffi"].apply(null,arguments)});var dynCall_viiiiiffii=Module["dynCall_viiiiiffii"]=(function(){return Module["asm"]["dynCall_viiiiiffii"].apply(null,arguments)});var dynCall_viiiiii=Module["dynCall_viiiiii"]=(function(){return Module["asm"]["dynCall_viiiiii"].apply(null,arguments)});var dynCall_viiiiiif=Module["dynCall_viiiiiif"]=(function(){return Module["asm"]["dynCall_viiiiiif"].apply(null,arguments)});var dynCall_viiiiiii=Module["dynCall_viiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiii"].apply(null,arguments)});var dynCall_viiiiiiii=Module["dynCall_viiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiii=Module["dynCall_viiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiii=Module["dynCall_viiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiii=Module["dynCall_viiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiifii=Module["dynCall_viiiiiiiiiiifii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiifii"].apply(null,arguments)});var dynCall_viiiiiiiiiiii=Module["dynCall_viiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiji=Module["dynCall_viiiiiiiiiji"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiji"].apply(null,arguments)});var dynCall_viiiiiiiji=Module["dynCall_viiiiiiiji"]=(function(){return Module["asm"]["dynCall_viiiiiiiji"].apply(null,arguments)});var dynCall_viiiiiiijii=Module["dynCall_viiiiiiijii"]=(function(){return Module["asm"]["dynCall_viiiiiiijii"].apply(null,arguments)});var dynCall_viiiiijii=Module["dynCall_viiiiijii"]=(function(){return Module["asm"]["dynCall_viiiiijii"].apply(null,arguments)});var dynCall_viiiiji=Module["dynCall_viiiiji"]=(function(){return Module["asm"]["dynCall_viiiiji"].apply(null,arguments)});var dynCall_viiiijii=Module["dynCall_viiiijii"]=(function(){return Module["asm"]["dynCall_viiiijii"].apply(null,arguments)});var dynCall_viiiijiiii=Module["dynCall_viiiijiiii"]=(function(){return Module["asm"]["dynCall_viiiijiiii"].apply(null,arguments)});var dynCall_viiiijjiii=Module["dynCall_viiiijjiii"]=(function(){return Module["asm"]["dynCall_viiiijjiii"].apply(null,arguments)});var dynCall_viiiji=Module["dynCall_viiiji"]=(function(){return Module["asm"]["dynCall_viiiji"].apply(null,arguments)});var dynCall_viiijji=Module["dynCall_viiijji"]=(function(){return Module["asm"]["dynCall_viiijji"].apply(null,arguments)});var dynCall_viiijjii=Module["dynCall_viiijjii"]=(function(){return Module["asm"]["dynCall_viiijjii"].apply(null,arguments)});var dynCall_viiijjiii=Module["dynCall_viiijjiii"]=(function(){return Module["asm"]["dynCall_viiijjiii"].apply(null,arguments)});var dynCall_viij=Module["dynCall_viij"]=(function(){return Module["asm"]["dynCall_viij"].apply(null,arguments)});var dynCall_viiji=Module["dynCall_viiji"]=(function(){return Module["asm"]["dynCall_viiji"].apply(null,arguments)});var dynCall_viijii=Module["dynCall_viijii"]=(function(){return Module["asm"]["dynCall_viijii"].apply(null,arguments)});var dynCall_viijiii=Module["dynCall_viijiii"]=(function(){return Module["asm"]["dynCall_viijiii"].apply(null,arguments)});var dynCall_viijiiii=Module["dynCall_viijiiii"]=(function(){return Module["asm"]["dynCall_viijiiii"].apply(null,arguments)});var dynCall_viijiijiii=Module["dynCall_viijiijiii"]=(function(){return Module["asm"]["dynCall_viijiijiii"].apply(null,arguments)});var dynCall_viijijii=Module["dynCall_viijijii"]=(function(){return Module["asm"]["dynCall_viijijii"].apply(null,arguments)});var dynCall_viijijiii=Module["dynCall_viijijiii"]=(function(){return Module["asm"]["dynCall_viijijiii"].apply(null,arguments)});var dynCall_viijji=Module["dynCall_viijji"]=(function(){return Module["asm"]["dynCall_viijji"].apply(null,arguments)});var dynCall_viijjii=Module["dynCall_viijjii"]=(function(){return Module["asm"]["dynCall_viijjii"].apply(null,arguments)});var dynCall_viijjiii=Module["dynCall_viijjiii"]=(function(){return Module["asm"]["dynCall_viijjiii"].apply(null,arguments)});var dynCall_viijjji=Module["dynCall_viijjji"]=(function(){return Module["asm"]["dynCall_viijjji"].apply(null,arguments)});var dynCall_vij=Module["dynCall_vij"]=(function(){return Module["asm"]["dynCall_vij"].apply(null,arguments)});var dynCall_viji=Module["dynCall_viji"]=(function(){return Module["asm"]["dynCall_viji"].apply(null,arguments)});var dynCall_vijii=Module["dynCall_vijii"]=(function(){return Module["asm"]["dynCall_vijii"].apply(null,arguments)});var dynCall_vijiii=Module["dynCall_vijiii"]=(function(){return Module["asm"]["dynCall_vijiii"].apply(null,arguments)});var dynCall_vijiji=Module["dynCall_vijiji"]=(function(){return Module["asm"]["dynCall_vijiji"].apply(null,arguments)});var dynCall_vijijji=Module["dynCall_vijijji"]=(function(){return Module["asm"]["dynCall_vijijji"].apply(null,arguments)});var dynCall_vijji=Module["dynCall_vijji"]=(function(){return Module["asm"]["dynCall_vijji"].apply(null,arguments)});var dynCall_vijjii=Module["dynCall_vijjii"]=(function(){return Module["asm"]["dynCall_vijjii"].apply(null,arguments)});var dynCall_vijjji=Module["dynCall_vijjji"]=(function(){return Module["asm"]["dynCall_vijjji"].apply(null,arguments)});var dynCall_vjiii=Module["dynCall_vjiii"]=(function(){return Module["asm"]["dynCall_vjiii"].apply(null,arguments)});var dynCall_vjiiii=Module["dynCall_vjiiii"]=(function(){return Module["asm"]["dynCall_vjiiii"].apply(null,arguments)});var dynCall_vjiiiii=Module["dynCall_vjiiiii"]=(function(){return Module["asm"]["dynCall_vjiiiii"].apply(null,arguments)});var dynCall_vjiiiiiii=Module["dynCall_vjiiiiiii"]=(function(){return Module["asm"]["dynCall_vjiiiiiii"].apply(null,arguments)});var dynCall_vjiiiiiiii=Module["dynCall_vjiiiiiiii"]=(function(){return Module["asm"]["dynCall_vjiiiiiiii"].apply(null,arguments)});var dynCall_vjji=Module["dynCall_vjji"]=(function(){return Module["asm"]["dynCall_vjji"].apply(null,arguments)});Module["asm"]=asm;Module["ccall"]=ccall;Module["cwrap"]=cwrap;Module["stackTrace"]=stackTrace;Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;var calledMain=false;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};Module["callMain"]=function callMain(args){args=args||[];ensureInitRuntime();var argc=args.length+1;var argv=stackAlloc((argc+1)*4);HEAP32[argv>>2]=allocateUTF8OnStack(Module["thisProgram"]);for(var i=1;i>2)+i]=allocateUTF8OnStack(args[i-1])}HEAP32[(argv>>2)+argc]=0;try{var ret=Module["_main"](argc,argv,0);exit(ret,true)}catch(e){if(e instanceof ExitStatus){return}else if(e=="SimulateInfiniteLoop"){Module["noExitRuntime"]=true;return}else{var toLog=e;if(e&&typeof e==="object"&&e.stack){toLog=[e,e.stack]}Module.printErr("exception thrown: "+toLog);Module["quit"](1,e)}}finally{calledMain=true}};function run(args){args=args||Module["arguments"];if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(Module["_main"]&&shouldRunNow)Module["callMain"](args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("")}),1);doRun()}),1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]&&status===0){return}if(Module["noExitRuntime"]){}else{ABORT=true;EXITSTATUS=status;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status)}if(ENVIRONMENT_IS_NODE){process["exit"](status)}Module["quit"](status,new ExitStatus(status))}Module["exit"]=exit;function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info."}Module["abort"]=abort;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}Module["noExitRuntime"]=true;run() + + + + +}); \ No newline at end of file diff --git a/snowrider3d/Build/UnityLoader.js b/snowrider3d/Build/UnityLoader.js new file mode 100644 index 00000000..f1c0640f --- /dev/null +++ b/snowrider3d/Build/UnityLoader.js @@ -0,0 +1,4 @@ +var UnityLoader=UnityLoader||{Compression:{identity:{require:function(){return{}},decompress:function(e){return e}},gzip:{require:function(e){var t={"inflate.js":function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0===(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var r=i.inflateInit2(this.strm,t.windowBits);if(r!==l.Z_OK)throw new Error(u[r]);this.header=new f,i.inflateGetHeader(this.strm,this.header)}function o(e,t){var r=new n(t);if(r.push(e,!0),r.err)throw r.msg||u[r.err];return r.result}function a(e,t){return t=t||{},t.raw=!0,o(e,t)}var i=e("./zlib/inflate"),s=e("./utils/common"),d=e("./utils/strings"),l=e("./zlib/constants"),u=e("./zlib/messages"),c=e("./zlib/zstream"),f=e("./zlib/gzheader"),h=Object.prototype.toString;n.prototype.push=function(e,t){var r,n,o,a,u,c,f=this.strm,p=this.options.chunkSize,w=this.options.dictionary,m=!1;if(this.ended)return!1;n=t===~~t?t:t===!0?l.Z_FINISH:l.Z_NO_FLUSH,"string"==typeof e?f.input=d.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new s.Buf8(p),f.next_out=0,f.avail_out=p),r=i.inflate(f,l.Z_NO_FLUSH),r===l.Z_NEED_DICT&&w&&(c="string"==typeof w?d.string2buf(w):"[object ArrayBuffer]"===h.call(w)?new Uint8Array(w):w,r=i.inflateSetDictionary(this.strm,c)),r===l.Z_BUF_ERROR&&m===!0&&(r=l.Z_OK,m=!1),r!==l.Z_STREAM_END&&r!==l.Z_OK)return this.onEnd(r),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&r!==l.Z_STREAM_END&&(0!==f.avail_in||n!==l.Z_FINISH&&n!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(o=d.utf8border(f.output,f.next_out),a=f.next_out-o,u=d.buf2string(f.output,o),f.next_out=a,f.avail_out=p-a,a&&s.arraySet(f.output,f.output,o,a,0),this.onData(u)):this.onData(s.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(m=!0)}while((f.avail_in>0||0===f.avail_out)&&r!==l.Z_STREAM_END);return r===l.Z_STREAM_END&&(n=l.Z_FINISH),n===l.Z_FINISH?(r=i.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===l.Z_OK):n!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),f.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===l.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=n,r.inflate=o,r.inflateRaw=a,r.ungzip=o},"utils/common.js":function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,r,n,o){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+n),o);for(var a=0;a=252?6:d>=248?5:d>=240?4:d>=224?3:d>=192?2:1;s[254]=s[254]=1,r.string2buf=function(e){var t,r,n,a,i,s=e.length,d=0;for(a=0;a>>6,t[i++]=128|63&r):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|63&r):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|63&r);return t},r.buf2binstring=function(e){return n(e,e.length)},r.binstring2buf=function(e){for(var t=new o.Buf8(e.length),r=0,n=t.length;r4)l[o++]=65533,r+=i-1;else{for(a&=2===i?31:3===i?15:7;i>1&&r1?l[o++]=65533:a<65536?l[o++]=a:(a-=65536,l[o++]=55296|a>>10&1023,l[o++]=56320|1023&a)}return n(l,o)},r.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&128===(192&e[r]);)r--;return r<0?t:0===r?t:r+s[e[r]]>t?r:t}},"zlib/inflate.js":function(e,t,r){"use strict";function n(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function o(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new y.Buf16(320),this.work=new y.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=P,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new y.Buf32(we),t.distcode=t.distdyn=new y.Buf32(me),t.sane=1,t.back=-1,O):R}function i(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,a(e)):R}function s(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?R:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,i(e))):R}function d(e,t){var r,n;return e?(n=new o,e.state=n,n.window=null,r=s(e,t),r!==O&&(e.state=null),r):R}function l(e){return d(e,ye)}function u(e){if(ge){var t;for(m=new y.Buf32(512),b=new y.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(U(E,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;U(k,e.lens,0,32,b,0,e.work,{bits:5}),ge=!1}e.lencode=m,e.lenbits=9,e.distcode=b,e.distbits=5}function c(e,t,r,n){var o,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(y.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(o=a.wsize-a.wnext,o>n&&(o=n),y.arraySet(a.window,t,r-n,o,a.wnext),n-=o,n?(y.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=v(r.check,Le,2,0),f=0,h=0,r.mode=D;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&f)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=fe;break}if((15&f)!==S){e.msg="unknown compression method",r.mode=fe;break}if(f>>>=4,h-=4,Ue=(15&f)+8,0===r.wbits)r.wbits=Ue;else if(Ue>r.wbits){e.msg="invalid window size",r.mode=fe;break}r.dmax=1<>8&1),512&r.flags&&(Le[0]=255&f,Le[1]=f>>>8&255,r.check=v(r.check,Le,2,0)),f=0,h=0,r.mode=T;case T:for(;h<32;){if(0===d)break e;d--,f+=o[i++]<>>8&255,Le[2]=f>>>16&255,Le[3]=f>>>24&255,r.check=v(r.check,Le,4,0)),f=0,h=0,r.mode=F;case F:for(;h<16;){if(0===d)break e;d--,f+=o[i++]<>8),512&r.flags&&(Le[0]=255&f,Le[1]=f>>>8&255,r.check=v(r.check,Le,2,0)),f=0,h=0,r.mode=q;case q:if(1024&r.flags){for(;h<16;){if(0===d)break e;d--,f+=o[i++]<>>8&255,r.check=v(r.check,Le,2,0)),f=0,h=0}else r.head&&(r.head.extra=null);r.mode=V;case V:if(1024&r.flags&&(m=r.length,m>d&&(m=d),m&&(r.head&&(Ue=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),y.arraySet(r.head.extra,o,i,m,Ue)),512&r.flags&&(r.check=v(r.check,o,m,i)),d-=m,i+=m,r.length-=m),r.length))break e;r.length=0,r.mode=z;case z:if(2048&r.flags){if(0===d)break e;m=0;do Ue=o[i+m++],r.head&&Ue&&r.length<65536&&(r.head.name+=String.fromCharCode(Ue));while(Ue&&m>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=j;break;case G:for(;h<32;){if(0===d)break e;d--,f+=o[i++]<>>=7&h,h-=7&h,r.mode=le;break}for(;h<3;){if(0===d)break e;d--,f+=o[i++]<>>=1,h-=1,3&f){case 0:r.mode=K;break;case 1:if(u(r),r.mode=re,t===W){f>>>=2,h-=2;break e}break;case 2:r.mode=$;break;case 3:e.msg="invalid block type",r.mode=fe}f>>>=2,h-=2;break;case K:for(f>>>=7&h,h-=7&h;h<32;){if(0===d)break e;d--,f+=o[i++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=fe;break}if(r.length=65535&f,f=0,h=0,r.mode=Q,t===W)break e;case Q:r.mode=_;case _:if(m=r.length){if(m>d&&(m=d),m>l&&(m=l),0===m)break e;y.arraySet(a,o,i,m,s),d-=m,i+=m,l-=m,s+=m,r.length-=m;break}r.mode=j;break;case $:for(;h<14;){if(0===d)break e;d--,f+=o[i++]<>>=5,h-=5,r.ndist=(31&f)+1,f>>>=5,h-=5,r.ncode=(15&f)+4,f>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=fe;break}r.have=0,r.mode=ee;case ee:for(;r.have>>=3,h-=3}for(;r.have<19;)r.lens[We[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},xe=U(x,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,xe){e.msg="invalid code lengths set",r.mode=fe;break}r.have=0,r.mode=te;case te:for(;r.have>>24,be=Be>>>16&255,ye=65535&Be,!(me<=h);){if(0===d)break e;d--,f+=o[i++]<>>=me,h-=me,r.lens[r.have++]=ye;else{if(16===ye){for(ke=me+2;h>>=me,h-=me,0===r.have){e.msg="invalid bit length repeat",r.mode=fe;break}Ue=r.lens[r.have-1],m=3+(3&f),f>>>=2,h-=2}else if(17===ye){for(ke=me+3;h>>=me,h-=me,Ue=0,m=3+(7&f),f>>>=3,h-=3}else{for(ke=me+7;h>>=me,h-=me,Ue=0,m=11+(127&f),f>>>=7,h-=7}if(r.have+m>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=fe;break}for(;m--;)r.lens[r.have++]=Ue}}if(r.mode===fe)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=fe;break}if(r.lenbits=9,Ee={bits:r.lenbits},xe=U(E,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,xe){e.msg="invalid literal/lengths set",r.mode=fe;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},xe=U(k,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,xe){e.msg="invalid distances set",r.mode=fe;break}if(r.mode=re,t===W)break e;case re:r.mode=ne;case ne:if(d>=6&&l>=258){e.next_out=s,e.avail_out=l,e.next_in=i,e.avail_in=d,r.hold=f,r.bits=h,A(e,w),s=e.next_out,a=e.output,l=e.avail_out,i=e.next_in,o=e.input,d=e.avail_in,f=r.hold,h=r.bits,r.mode===j&&(r.back=-1);break}for(r.back=0;Be=r.lencode[f&(1<>>24,be=Be>>>16&255,ye=65535&Be,!(me<=h);){if(0===d)break e;d--,f+=o[i++]<>ge)],me=Be>>>24,be=Be>>>16&255,ye=65535&Be,!(ge+me<=h);){if(0===d)break e;d--,f+=o[i++]<>>=ge,h-=ge,r.back+=ge}if(f>>>=me,h-=me,r.back+=me,r.length=ye,0===be){r.mode=de;break}if(32&be){r.back=-1,r.mode=j;break}if(64&be){e.msg="invalid literal/length code",r.mode=fe;break}r.extra=15&be,r.mode=oe;case oe:if(r.extra){for(ke=r.extra;h>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ae;case ae:for(;Be=r.distcode[f&(1<>>24,be=Be>>>16&255,ye=65535&Be,!(me<=h);){if(0===d)break e;d--,f+=o[i++]<>ge)],me=Be>>>24,be=Be>>>16&255,ye=65535&Be,!(ge+me<=h);){if(0===d)break e;d--,f+=o[i++]<>>=ge,h-=ge,r.back+=ge}if(f>>>=me,h-=me,r.back+=me,64&be){e.msg="invalid distance code",r.mode=fe;break}r.offset=ye,r.extra=15&be,r.mode=ie;case ie:if(r.extra){for(ke=r.extra;h>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=fe;break}r.mode=se;case se:if(0===l)break e;if(m=w-l,r.offset>m){if(m=r.offset-m,m>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=fe;break}m>r.wnext?(m-=r.wnext,b=r.wsize-m):b=r.wnext-m,m>r.length&&(m=r.length),we=r.window}else we=a,b=s-r.offset,m=r.length;m>l&&(m=l),l-=m,r.length-=m;do a[s++]=we[b++];while(--m);0===r.length&&(r.mode=ne);break;case de:if(0===l)break e;a[s++]=r.length,l--,r.mode=ne;break;case le:if(r.wrap){for(;h<32;){if(0===d)break e;d--,f|=o[i++]<>>16&65535|0,i=0;0!==r;){i=r>2e3?2e3:r,r-=i;do o=o+t[n++]|0,a=a+o|0;while(--i);o%=65521,a%=65521}return o|a<<16|0}t.exports=n},"zlib/crc32.js":function(e,t,r){"use strict";function n(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}function o(e,t,r,n){var o=a,i=n+r;e^=-1;for(var s=n;s>>8^o[255&(e^t[s])];return e^-1}var a=n();t.exports=o},"zlib/inffast.js":function(e,t,r){"use strict";var n=30,o=12;t.exports=function(e,t){var r,a,i,s,d,l,u,c,f,h,p,w,m,b,y,g,v,A,U,x,E,k,B,L,W;r=e.state,a=e.next_in,L=e.input,i=a+(e.avail_in-5),s=e.next_out,W=e.output,d=s-(t-e.avail_out),l=s+(e.avail_out-257),u=r.dmax,c=r.wsize,f=r.whave,h=r.wnext,p=r.window,w=r.hold,m=r.bits,b=r.lencode,y=r.distcode,g=(1<>>24,w>>>=U,m-=U,U=A>>>16&255,0===U)W[s++]=65535&A;else{if(!(16&U)){if(0===(64&U)){A=b[(65535&A)+(w&(1<>>=U,m-=U),m<15&&(w+=L[a++]<>>24,w>>>=U,m-=U,U=A>>>16&255,!(16&U)){if(0===(64&U)){A=y[(65535&A)+(w&(1<u){e.msg="invalid distance too far back",r.mode=n;break e}if(w>>>=U,m-=U,U=s-d,E>U){if(U=E-U,U>f&&r.sane){e.msg="invalid distance too far back",r.mode=n;break e}if(k=0,B=p,0===h){if(k+=c-U,U2;)W[s++]=B[k++],W[s++]=B[k++],W[s++]=B[k++],x-=3;x&&(W[s++]=B[k++],x>1&&(W[s++]=B[k++]))}else{k=s-E;do W[s++]=W[k++],W[s++]=W[k++],W[s++]=W[k++],x-=3;while(x>2);x&&(W[s++]=W[k++],x>1&&(W[s++]=W[k++]))}break}}break}}while(a>3,a-=x,m-=x<<3,w&=(1<=1&&0===q[R];R--);if(C>R&&(C=R),0===R)return w[m++]=20971520,w[m++]=20971520,y.bits=1,0;for(N=1;N0&&(e===s||1!==R))return-1;for(V[1]=0,O=1;Oa||e===l&&P>i)return 1;for(;;){k=O-I,b[M]E?(B=z[Z+b[M]],L=T[F+b[M]]):(B=96,L=0),g=1<>I)+v]=k<<24|B<<16|L|0;while(0!==v);for(g=1<>=1;if(0!==g?(D&=g-1,D+=g):D=0,M++,0===--q[O]){if(O===R)break;O=t[r+b[M]]}if(O>C&&(D&U)!==A){for(0===I&&(I=C),x+=N,H=O-I,S=1<a||e===l&&P>i)return 1;A=D&U,w[A]=C<<24|H<<16|x-m|0}}return 0!==D&&(w[x+D]=O-I<<24|64<<16|0),y.bits=C,0}}};for(var r in t)t[r].folder=r.substring(0,r.lastIndexOf("/")+1);var n=function(e){var r=[];return e=e.split("/").every(function(e){return".."==e?r.pop():"."==e||""==e||r.push(e)})?r.join("/"):null,e?t[e]||t[e+".js"]||t[e+"/index.js"]:null},o=function(e,t){return e?n(e.folder+"node_modules/"+t)||o(e.parent,t):null},a=function(e,t){var r=t.match(/^\//)?null:e?t.match(/^\.\.?\//)?n(e.folder+t):o(e,t):n(t);if(!r)throw"module not found: "+t;return r.exports||(r.parent=e,r(a.bind(null,r),r,r.exports={})),r.exports};return a(null,e)},decompress:function(e){this.exports||(this.exports=this.require("inflate.js"));try{return this.exports.inflate(e)}catch(e){}},hasUnityMarker:function(e){var t=10,r="UnityWeb Compressed Content (gzip)";if(t>e.length||31!=e[0]||139!=e[1])return!1;var n=e[3];if(4&n){if(t+2>e.length)return!1;if(t+=2+e[t]+(e[t+1]<<8),t>e.length)return!1}if(8&n){for(;te.length)return!1;t++}return 16&n&&String.fromCharCode.apply(null,e.subarray(t,t+r.length+1))==r+"\0"}},brotli:{require:function(e){var t={"decompress.js":function(e,t,r){t.exports=e("./dec/decode").BrotliDecompressBuffer},"dec/bit_reader.js":function(e,t,r){function n(e){this.buf_=new Uint8Array(a),this.input_=e,this.reset()}const o=4096,a=8224,i=8191,s=new Uint32Array([0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215]);n.READ_SIZE=o,n.IBUF_MASK=i,n.prototype.reset=function(){this.buf_ptr_=0,this.val_=0,this.pos_=0,this.bit_pos_=0,this.bit_end_pos_=0,this.eos_=0,this.readMoreInput();for(var e=0;e<4;e++)this.val_|=this.buf_[this.pos_]<<8*e,++this.pos_;return this.bit_end_pos_>0},n.prototype.readMoreInput=function(){if(!(this.bit_end_pos_>256))if(this.eos_){if(this.bit_pos_>this.bit_end_pos_)throw new Error("Unexpected end of input "+this.bit_pos_+" "+this.bit_end_pos_)}else{var e=this.buf_ptr_,t=this.input_.read(this.buf_,e,o);if(t<0)throw new Error("Unexpected end of input");if(t=8;)this.val_>>>=8,this.val_|=this.buf_[this.pos_&i]<<24,++this.pos_,this.bit_pos_=this.bit_pos_-8>>>0,this.bit_end_pos_=this.bit_end_pos_-8>>>0},n.prototype.readBits=function(e){32-this.bit_pos_>>this.bit_pos_&s[e];return this.bit_pos_+=e,t},t.exports=n},"dec/context.js":function(e,t,r){r.lookup=new Uint8Array([0,0,0,0,0,0,0,0,0,4,4,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,12,16,12,12,20,12,16,24,28,12,12,32,12,36,12,44,44,44,44,44,44,44,44,44,44,32,32,24,40,28,12,12,48,52,52,52,48,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,24,12,28,12,12,12,56,60,60,60,56,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,24,12,28,12,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,56,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,37,37,37,37,38,38,38,38,39,39,39,39,40,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43,44,44,44,44,45,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,57,57,57,57,58,58,58,58,59,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),r.lookupOffsets=new Uint16Array([1024,1536,1280,1536,0,256,768,512])},"dec/decode.js":function(e,t,r){function n(e){var t;return 0===e.readBits(1)?16:(t=e.readBits(3),t>0?17+t:(t=e.readBits(3),t>0?8+t:17))}function o(e){if(e.readBits(1)){var t=e.readBits(3);return 0===t?1:e.readBits(t)+(1<1&&0===i)throw new Error("Invalid size byte");o.meta_block_length|=i<<8*n}}else for(n=0;n4&&0===s)throw new Error("Invalid size nibble");o.meta_block_length|=s<<4*n}return++o.meta_block_length,o.input_end||o.is_metadata||(o.is_uncompressed=e.readBits(1)),o}function s(e,t,r){var n;return r.fillBitWindow(),t+=r.val_>>>r.bit_pos_&T,n=e[t].bits-D,n>0&&(r.bit_pos_+=D,t+=e[t].value,t+=r.val_>>>r.bit_pos_&(1<0;){var c,f=0;if(n.readMoreInput(),n.fillBitWindow(),f+=n.val_>>>n.bit_pos_&31,n.bit_pos_+=l[f].bits,c=255&l[f].value,c>c);else{var h,p,w=c-14,m=0;if(c===R&&(m=a),s!==m&&(i=0,s=m),h=i,i>0&&(i-=2,i<<=w),i+=n.readBits(w)+3,p=i-h,o+p>t)throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");for(var b=0;b0;++s){var b,y=V[s],g=0;n.fillBitWindow(),g+=n.val_>>>n.bit_pos_&15, +n.bit_pos_+=m[g].bits,b=m[g].value,h[y]=b,0!==b&&(p-=32>>b,++w)}if(1!==w&&0!==p)throw new Error("[ReadHuffmanCode] invalid num_codes or space");d(h,e,i,n)}if(a=L(t,r,D,i,e),0===a)throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");return a}function u(e,t,r){var n,o;return n=s(e,t,r),o=O.kBlockLengthPrefixCode[n].nbits,O.kBlockLengthPrefixCode[n].offset+r.readBits(o)}function c(e,t,r){var n;return e>>5]),this.htrees=new Uint32Array(t)}function w(e,t){var r,n,a,i={num_htrees:null,context_map:null},d=0;t.readMoreInput();var u=i.num_htrees=o(t)+1,c=i.context_map=new Uint8Array(e);if(u<=1)return i;for(r=t.readBits(1),r&&(d=t.readBits(4)+1),n=[],a=0;a=e)throw new Error("[DecodeContextMap] i >= context_map_size");c[a]=0,++a}else c[a]=f-d,++a}return t.readBits(1)&&h(c,e),i}function m(e,t,r,n,o,a,i){var d,l=2*r,u=r,c=s(t,r*F,i);d=0===c?o[l+(1&a[u])]:1===c?o[l+(a[u]-1&1)]+1:c-2,d>=e&&(d-=e),n[r]=d,o[l+(1&a[u])]=d,++a[u]}function b(e,t,r,n,o,a){var i,s=o+1,d=r&o,l=a.pos_&E.IBUF_MASK;if(t<8||a.bit_pos_+(t<<3)0;)a.readMoreInput(),n[d++]=a.readBits(8),d===s&&(e.write(n,s),d=0);else{if(a.bit_end_pos_<32)throw new Error("[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32");for(;a.bit_pos_<32;)n[d]=a.val_>>>a.bit_pos_,a.bit_pos_+=8,++d,--t;if(i=a.bit_end_pos_-a.bit_pos_>>3,l+i>E.IBUF_MASK){for(var u=E.IBUF_MASK+1-l,c=0;c=s){e.write(n,s),d-=s;for(var c=0;c=s;){if(i=s-d,a.input_.read(n,d,i)t.buffer.length){var ve=new Uint8Array(x+re);ve.set(t.buffer),t.buffer=ve}if(L=ge.input_end,J=ge.is_uncompressed,ge.is_metadata)for(y(U);re>0;--re)U.readMoreInput(),U.readBits(8);else if(0!==re)if(J)U.bit_pos_=U.bit_pos_+7&-8,b(t,re,x,h,f,U),x+=re;else{for(r=0;r<3;++r)ae[r]=o(U)+1,ae[r]>=2&&(l(ae[r]+2,v,r*F,U),l(I,A,r*F,U),ne[r]=u(A,r*F,U),se[r]=1);for(U.readMoreInput(),j=U.readBits(2),X=z+(U.readBits(4)<0;){var xe,Ee,ke,Be,Le,We,Oe,Me,Ne,Re,Ce;for(U.readMoreInput(),0===ne[1]&&(m(ae[1],v,1,oe,ie,se,U),ne[1]=u(A,F,U),te=Z[1].htrees[oe[1]]),--ne[1],xe=s(Z[1].codes,te,U),Ee=xe>>6,Ee>=2?(Ee-=2,Oe=-1):Oe=0,ke=O.kInsertRangeLut[Ee]+(xe>>3&7),Be=O.kCopyRangeLut[Ee]+(7&xe),Le=O.kInsertLengthPrefixCode[ke].offset+U.readBits(O.kInsertLengthPrefixCode[ke].nbits),We=O.kCopyLengthPrefixCode[Be].offset+U.readBits(O.kCopyLengthPrefixCode[Be].nbits),q=h[x-1&f],V=h[x-2&f],Re=0;Re4?3:We-2),me=ue[we+Ne],Oe=s(Z[2].codes,Z[2].htrees[me],U),Oe>=X){var He,Ie,Se;Oe-=X,Ie=Oe&K,Oe>>=j,He=(Oe>>1)+1,Se=(2+(1&Oe)<R){if(!(We>=k.minDictionaryWordLength&&We<=k.maxDictionaryWordLength))throw new Error("Invalid backward reference. pos: "+x+" distance: "+Me+" len: "+We+" bytes left: "+re);var Se=k.offsetsByLength[We],Pe=Me-R-1,De=k.sizeBitsByLength[We],Te=(1<>De;if(Se+=Fe*We,!(qe=g){t.write(h,d);for(var ze=0;ze0&&(D[3&T]=Me,++T),We>re)throw new Error("Invalid backward reference. pos: "+x+" distance: "+Me+" len: "+We+" bytes left: "+re);for(Re=0;Re>=1;return(e&r-1)+r}function a(e,t,r,o,a){do o-=r,e[t+o]=new n(a.bits,a.value);while(o>0)}function i(e,t,r){for(var n=1<0;--U[c])u=new n(255&c,65535&v[f++]),a(e,t+h,p,y,u),h=o(h,c);for(m=g-1,w=-1,c=r+1,p=2;c<=s;++c,p<<=1)for(;U[c]>0;--U[c])(h&m)!==w&&(t+=y,b=i(U,c,r),y=1<>r),p,y,u),h=o(h,c);return g}},"dec/prefix.js":function(e,t,r){function n(e,t){this.offset=e,this.nbits=t}r.kBlockLengthPrefixCode=[new n(1,2),new n(5,2),new n(9,2),new n(13,2),new n(17,3),new n(25,3),new n(33,3),new n(41,3),new n(49,4),new n(65,4),new n(81,4),new n(97,4),new n(113,5),new n(145,5),new n(177,5),new n(209,5),new n(241,6),new n(305,6),new n(369,7),new n(497,8),new n(753,9),new n(1265,10),new n(2289,11),new n(4337,12),new n(8433,13),new n(16625,24)],r.kInsertLengthPrefixCode=[new n(0,0),new n(1,0),new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,1),new n(8,1),new n(10,2),new n(14,2),new n(18,3),new n(26,3),new n(34,4),new n(50,4),new n(66,5),new n(98,5),new n(130,6),new n(194,7),new n(322,8),new n(578,9),new n(1090,10),new n(2114,12),new n(6210,14),new n(22594,24)],r.kCopyLengthPrefixCode=[new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,0),new n(7,0),new n(8,0),new n(9,0),new n(10,1),new n(12,1),new n(14,2),new n(18,2),new n(22,3),new n(30,3),new n(38,4),new n(54,4),new n(70,5),new n(102,5),new n(134,6),new n(198,7),new n(326,8),new n(582,9),new n(1094,10),new n(2118,24)],r.kInsertRangeLut=[0,0,8,8,0,16,8,16,16],r.kCopyRangeLut=[0,8,0,8,16,0,16,8,16]},"dec/streams.js":function(e,t,r){function n(e){this.buffer=e,this.pos=0}function o(e){this.buffer=e,this.pos=0}n.prototype.read=function(e,t,r){this.pos+r>this.buffer.length&&(r=this.buffer.length-this.pos);for(var n=0;nthis.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(e.subarray(0,t),this.pos),this.pos+=t,t},r.BrotliOutput=o},"dec/transform.js":function(e,t,r){function n(e,t,r){this.prefix=new Uint8Array(e.length),this.transform=t,this.suffix=new Uint8Array(r.length);for(var n=0;n=97&&e[t]<=122&&(e[t]^=32),1):e[t]<224?(e[t+1]^=32,2):(e[t+2]^=5,3)}var a=e("./dictionary");const i=0,s=1,d=2,l=3,u=4,c=5,f=6,h=7,p=8,w=9,m=10,b=11,y=12,g=13,v=14,A=15,U=16,x=17,E=18,k=20;var B=[new n("",i,""),new n("",i," "),new n(" ",i," "),new n("",y,""),new n("",m," "),new n("",i," the "),new n(" ",i,""),new n("s ",i," "),new n("",i," of "),new n("",m,""),new n("",i," and "),new n("",g,""),new n("",s,""),new n(", ",i," "),new n("",i,", "),new n(" ",m," "),new n("",i," in "),new n("",i," to "),new n("e ",i," "),new n("",i,'"'),new n("",i,"."),new n("",i,'">'),new n("",i,"\n"),new n("",l,""),new n("",i,"]"),new n("",i," for "),new n("",v,""),new n("",d,""),new n("",i," a "),new n("",i," that "),new n(" ",m,""),new n("",i,". "),new n(".",i,""),new n(" ",i,", "),new n("",A,""),new n("",i," with "),new n("",i,"'"),new n("",i," from "),new n("",i," by "),new n("",U,""),new n("",x,""),new n(" the ",i,""),new n("",u,""),new n("",i,". The "),new n("",b,""),new n("",i," on "),new n("",i," as "),new n("",i," is "),new n("",h,""),new n("",s,"ing "),new n("",i,"\n\t"),new n("",i,":"),new n(" ",i,". "),new n("",i,"ed "),new n("",k,""),new n("",E,""),new n("",f,""),new n("",i,"("),new n("",m,", "),new n("",p,""),new n("",i," at "),new n("",i,"ly "),new n(" the ",i," of "),new n("",c,""),new n("",w,""),new n(" ",m,", "),new n("",m,'"'),new n(".",i,"("),new n("",b," "),new n("",m,'">'),new n("",i,'="'),new n(" ",i,"."),new n(".com/",i,""),new n(" the ",i," of the "),new n("",m,"'"),new n("",i,". This "),new n("",i,","),new n(".",i," "),new n("",m,"("),new n("",m,"."),new n("",i," not "),new n(" ",i,'="'),new n("",i,"er "),new n(" ",b," "),new n("",i,"al "),new n(" ",b,""),new n("",i,"='"),new n("",b,'"'),new n("",m,". "),new n(" ",i,"("),new n("",i,"ful "),new n(" ",m,". "),new n("",i,"ive "),new n("",i,"less "),new n("",b,"'"),new n("",i,"est "),new n(" ",m,"."),new n("",b,'">'),new n(" ",i,"='"),new n("",m,","),new n("",i,"ize "),new n("",b,"."),new n("\xc2\xa0",i,""),new n(" ",i,","),new n("",m,'="'),new n("",b,'="'),new n("",i,"ous "),new n("",b,", "),new n("",m,"='"),new n(" ",m,","),new n(" ",b,'="'),new n(" ",b,", "),new n("",b,","),new n("",b,"("),new n("",b,". "),new n(" ",b,"."),new n("",b,"='"),new n(" ",b,". "),new n(" ",m,'="'),new n(" ",b,"='"),new n(" ",m,"='")];r.kTransforms=B,r.kNumTransforms=B.length,r.transformDictionaryWord=function(e,t,r,n,i){var s,d=B[i].prefix,l=B[i].suffix,u=B[i].transform,c=un&&(c=n);for(var p=0;p0;){var g=o(e,s);s+=g,n-=g}for(var v=0;v0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function o(e){return 3*e.length/4-n(e)}function a(e){var t,r,o,a,i,s,d=e.length;i=n(e),s=new c(3*d/4-i),o=i>0?d-4:d;var l=0;for(t=0,r=0;t>16&255,s[l++]=a>>8&255,s[l++]=255&a;return 2===i?(a=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,s[l++]=255&a):1===i&&(a=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,s[l++]=a>>8&255,s[l++]=255&a),s}function i(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function s(e,t,r){for(var n,o=[],a=t;au?u:d+i));return 1===n?(t=e[r-1],o+=l[t>>2],o+=l[t<<4&63],o+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],o+=l[t>>10],o+=l[t>>4&63],o+=l[t<<2&63],o+="="),a.push(o),a.join("")}r.byteLength=o,r.toByteArray=a,r.fromByteArray=d;for(var l=[],u=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=f.length;h>3);if(commentOffset=r+1+2+1+2+(o<<3)+7>>3,17==n||commentOffset>e.length)return!1;for(var a=n+(6+(o<<4)+(t.length-1<<6)<>>=8)if(e[i]!=(255&a))return!1;return String.fromCharCode.apply(null,e.subarray(commentOffset,commentOffset+t.length))==t}},decompress:function(e,t){var r=this.gzip.hasUnityMarker(e)?this.gzip:this.brotli.hasUnityMarker(e)?this.brotli:this.identity;if(this.serverSetupWarningEnabled&&r!=this.identity&&(console.log("You can reduce your startup time if you configure your web server to host .unityweb files using "+(r==this.gzip?"gzip":"brotli")+" compression."),this.serverSetupWarningEnabled=!1),"function"!=typeof t)return r.decompress(e);if(!r.worker){var n=URL.createObjectURL(new Blob(["this.require = ",r.require.toString(),"; this.decompress = ",r.decompress.toString(),"; this.onmessage = ",function(e){var t={id:e.data.id,decompressed:this.decompress(e.data.compressed)};postMessage(t,t.decompressed?[t.decompressed.buffer]:[])}.toString(),"; postMessage({ ready: true });"],{type:"text/javascript"}));r.worker=new Worker(n),r.worker.onmessage=function(e){return e.data.ready?void URL.revokeObjectURL(n):(this.callbacks[e.data.id](e.data.decompressed),void delete this.callbacks[e.data.id])},r.worker.callbacks={},r.worker.nextCallbackId=0}var o=r.worker.nextCallbackId++;r.worker.callbacks[o]=t,r.worker.postMessage({id:o,compressed:e},[e.buffer])},serverSetupWarningEnabled:!0},Cryptography:{crc32:function(e){var t=UnityLoader.Cryptography.crc32.module;if(!t){var r=new ArrayBuffer(16777216),n=function(e,t,r){"use asm";var n=new e.Uint8Array(r);var o=new e.Uint32Array(r);function a(e,t){e=e|0;t=t|0;var r=0;for(r=o[1024>>2]|0;t;e=e+1|0,t=t-1|0)r=o[(r&255^n[e])<<2>>2]^r>>>8^4278190080;o[1024>>2]=r}return{process:a}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},null,r);t=UnityLoader.Cryptography.crc32.module={buffer:r,HEAPU8:new Uint8Array(r),HEAPU32:new Uint32Array(r),process:n.process,crc32:1024,data:1028};for(var o=0;o<256;o++){for(var a=255^o,i=0;i<8;i++)a=a>>>1^(1&a?3988292384:0);t.HEAPU32[o]=a}}t.HEAPU32[t.crc32>>2]=0;for(var s=0;s>2];return new Uint8Array([l>>24,l>>16,l>>8,l])},md5:function(e){var t=UnityLoader.Cryptography.md5.module;if(!t){var r=new ArrayBuffer(16777216),n=function(e,t,r){"use asm";var n=new e.Uint32Array(r);function o(e,t){e=e|0;t=t|0;var r=0,o=0,a=0,i=0,s=0,d=0,l=0,u=0,c=0,f=0,h=0,p=0;r=n[128]|0,o=n[129]|0,a=n[130]|0,i=n[131]|0;for(;t;e=e+64|0,t=t-1|0){s=r;d=o;l=a;u=i;for(f=0;(f|0)<512;f=f+8|0){p=n[f>>2]|0;r=r+(n[f+4>>2]|0)+(n[e+(p>>>14)>>2]|0)+((f|0)<128?i^o&(a^i):(f|0)<256?a^i&(o^a):(f|0)<384?o^a^i:a^(o|~i))|0;h=(r<<(p&31)|r>>>32-(p&31))+o|0;r=i;i=a;a=o;o=h}r=r+s|0;o=o+d|0;a=a+l|0;i=i+u|0}n[128]=r;n[129]=o;n[130]=a;n[131]=i}return{process:o}}({Uint32Array:Uint32Array},null,r);t=UnityLoader.Cryptography.md5.module={buffer:r,HEAPU8:new Uint8Array(r),HEAPU32:new Uint32Array(r),process:n.process,md5:512,data:576},t.HEAPU32.set(new Uint32Array([7,3614090360,65548,3905402710,131089,606105819,196630,3250441966,262151,4118548399,327692,1200080426,393233,2821735955,458774,4249261313,524295,1770035416,589836,2336552879,655377,4294925233,720918,2304563134,786439,1804603682,851980,4254626195,917521,2792965006,983062,1236535329,65541,4129170786,393225,3225465664,720910,643717713,20,3921069994,327685,3593408605,655369,38016083,983054,3634488961,262164,3889429448,589829,568446438,917513,3275163606,196622,4107603335,524308,1163531501,851973,2850285829,131081,4243563512,458766,1735328473,786452,2368359562,327684,4294588738,524299,2272392833,720912,1839030562,917527,4259657740,65540,2763975236,262155,1272893353,458768,4139469664,655383,3200236656,851972,681279174,11,3936430074,196624,3572445317,393239,76029189,589828,3654602809,786443,3873151461,983056,530742520,131095,3299628645,6,4096336452,458762,1126891415,917519,2878612391,327701,4237533241,786438,1700485571,196618,2399980690,655375,4293915773,65557,2240044497,524294,1873313359,983050,4264355552,393231,2734768916,851989,1309151649,262150,4149444226,720906,3174756917,131087,718787259,589845,3951481745]))}t.HEAPU32.set(new Uint32Array([1732584193,4023233417,2562383102,271733878]),t.md5>>2);for(var o=0;o>6),e.length-o<64){if(a=e.length-o,t.HEAPU8.set(e.subarray(e.length-a,e.length),t.data),o+=a,t.HEAPU8[t.data+a++]=128,a>56){for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;t.process(t.data,1),a=0}for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;for(var s=e.length,d=0,i=56;i<64;i++,d=(224&s)>>5,s/=256)t.HEAPU8[t.data+i]=((31&s)<<3)+d;t.process(t.data,1)}}return new Uint8Array(t.HEAPU8.subarray(t.md5,t.md5+16))},sha1:function(e){var t=UnityLoader.Cryptography.sha1.module;if(!t){var r=new ArrayBuffer(16777216),n=function(e,t,r){"use asm";var n=new e.Uint32Array(r);function o(e,t){e=e|0;t=t|0;var r=0,o=0,a=0,i=0,s=0,d=0,l=0,u=0,c=0,f=0,h=0,p=0;r=n[80]|0,o=n[81]|0,a=n[82]|0,i=n[83]|0,s=n[84]|0;for(;t;e=e+64|0,t=t-1|0){d=r;l=o;u=a;c=i;f=s;for(p=0;(p|0)<320;p=p+4|0,s=i,i=a,a=o<<30|o>>>2,o=r,r=h){if((p|0)<64){h=n[e+p>>2]|0;h=h<<24&4278190080|h<<8&16711680|h>>>8&65280|h>>>24&255}else{h=n[p-12>>2]^n[p-32>>2]^n[p-56>>2]^n[p-64>>2];h=h<<1|h>>>31}n[p>>2]=h;h=h+((r<<5|r>>>27)+s)+((p|0)<80?(o&a|~o&i|0)+1518500249|0:(p|0)<160?(o^a^i)+1859775393|0:(p|0)<240?(o&a|o&i|a&i)+2400959708|0:(o^a^i)+3395469782|0)|0}r=r+d|0;o=o+l|0;a=a+u|0;i=i+c|0;s=s+f|0}n[80]=r;n[81]=o;n[82]=a;n[83]=i;n[84]=s}return{process:o}}({Uint32Array:Uint32Array},null,r);t=UnityLoader.Cryptography.sha1.module={buffer:r,HEAPU8:new Uint8Array(r),HEAPU32:new Uint32Array(r),process:n.process,sha1:320,data:384}}t.HEAPU32.set(new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),t.sha1>>2);for(var o=0;o>6),e.length-o<64){if(a=e.length-o,t.HEAPU8.set(e.subarray(e.length-a,e.length),t.data),o+=a,t.HEAPU8[t.data+a++]=128,a>56){for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;t.process(t.data,1),a=0}for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;for(var s=e.length,d=0,i=63;i>=56;i--,d=(224&s)>>5,s/=256)t.HEAPU8[t.data+i]=((31&s)<<3)+d;t.process(t.data,1)}}for(var l=new Uint8Array(20),i=0;i\\[(\\d+)\\]\\+\\d+\\))()":"((\\s*)wasm-function\\[(\\d+)\\])@(blob:.*)",blobParseRegExp:new RegExp("^(blob:.*)(:\\d+:\\d+)$"),getModule:function(e){var t=e.message.match(new RegExp(this.stackTraceFormat,"g"));for(var r in t){var n=t[r].match(new RegExp("^"+this.stackTraceFormat+"$")),o=n[7].match(this.blobParseRegExp);if(o&&UnityLoader.Blobs[o[1]]&&UnityLoader.Blobs[o[1]].Module)return UnityLoader.Blobs[o[1]].Module}},demangle:function(e,t){var r=e.message;return t?(r=r.replace(new RegExp(this.stackTraceFormat,"g"),function(e){var r=e.match(new RegExp("^"+this.stackTraceFormat+"$")),n=r[7].match(this.blobParseRegExp),o=t.demangleSymbol?t.demangleSymbol(r[4]):r[4],a=n&&UnityLoader.Blobs[n[1]]&&UnityLoader.Blobs[n[1]].url?UnityLoader.Blobs[n[1]].url:"blob";return r[1]+o+(r[2]!=o?" ["+r[2]+"]":"")+" ("+(n?a.substr(a.lastIndexOf("/")+1)+n[2]:r[7])+")"}.bind(this)),t.useWasm&&(r=r.replace(new RegExp(this.stackTraceFormatWasm,"g"),function(e){var r=e.match(new RegExp("^"+this.stackTraceFormatWasm+"$")),n=t.demangleSymbol?t.demangleSymbol(r[3]):r[3],o=r[4].match(this.blobParseRegExp),a=o&&UnityLoader.Blobs[o[1]]&&UnityLoader.Blobs[o[1]].url?UnityLoader.Blobs[o[1]].url:"blob";return(n==r[3]?r[1]:r[2]+n+" [wasm:"+r[3]+"]")+(r[4]?" ("+(o?a.substr(a.lastIndexOf("/")+1)+o[2]:r[4])+")":"")}.bind(this))),r):r},handler:function(e,t){var r=t?this.demangle(e,t):e.message;if(!(t&&t.errorhandler&&t.errorhandler(r,e.filename,e.lineno)||(console.log("Invoking error handler due to\n"+r),"function"==typeof dump&&dump("Invoking error handler due to\n"+r),r.indexOf("UnknownError")!=-1||r.indexOf("Program terminated with exit(0)")!=-1||this.didShowErrorMessage))){var r="An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:\n"+r;r.indexOf("DISABLE_EXCEPTION_CATCHING")!=-1?r="An exception has occurred, but exception handling has been disabled in this build. If you are the developer of this content, enable exceptions in your project WebGL player settings to be able to catch the exception or see the stack trace.":r.indexOf("Cannot enlarge memory arrays")!=-1?r="Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.":r.indexOf("Invalid array buffer length")==-1&&r.indexOf("Invalid typed array length")==-1&&r.indexOf("out of memory")==-1&&r.indexOf("could not allocate memory")==-1||(r="The browser could not allocate enough memory for the WebGL content. If you are the developer of this content, try allocating less memory to your WebGL build in the WebGL player settings."),alert(r),this.didShowErrorMessage=!0}},popup:function(e,t,r){r=r||[{text:"OK"}];var n=document.createElement("div");n.style.cssText="position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); text-align: center; border: 1px solid black; padding: 5px; background: #E8E8E8";var o=document.createElement("span");o.textContent=t,n.appendChild(o),n.appendChild(document.createElement("br"));for(var a=0;a=10.1)?1:0}(),hasThreads:"undefined"!=typeof SharedArrayBuffer,hasWasm:"object"==typeof WebAssembly&&"function"==typeof WebAssembly.validate&&"function"==typeof WebAssembly.compile}}(),compatibilityCheck:function(e,t,r){t()},Blobs:{},loadCode:function(e,t,r){var n=[].slice.call(UnityLoader.Cryptography.md5(e)).map(function(e){return("0"+e.toString(16)).substr(-2)}).join(""),o=document.createElement("script"),a=URL.createObjectURL(new Blob(['UnityLoader["'+n+'"]=',e],{type:"text/javascript"}));UnityLoader.Blobs[a]=r,o.src=a,o.onload=function(){URL.revokeObjectURL(a),t(n),delete o.onload},document.body.appendChild(o)},setupIndexedDBJob:function(e,t){function r(n){r.called||(r.called=!0,e.indexedDB=n,t.complete())}try{var n=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,o=n.open("/idbfs-test");o.onerror=function(e){e.preventDefault(),r()},o.onsuccess=function(){o.result.close(),r(n)}}catch(e){r()}},processWasmCodeJob:function(e,t){e.wasmBinary=UnityLoader.Job.result(e,"downloadWasmCode"),t.complete()},processWasmFrameworkJob:function(e,t){var r=UnityLoader.Job.result(e,"downloadWasmFramework");UnityLoader.loadCode(r,function(n){var o=new Blob([r],{type:"application/javascript"});e.mainScriptUrlOrBlob=o,UnityLoader[n](e),t.complete()},{Module:e,url:e.wasmFrameworkUrl})},processAsmCodeJob:function(e,t){var r=UnityLoader.Job.result(e,"downloadAsmCode");UnityLoader.loadCode(Math.fround?r:UnityLoader.Utils.optimizeMathFround(r),function(r){e.asm=UnityLoader[r],t.complete()},{Module:e,url:e.asmCodeUrl})},processAsmFrameworkJob:function(e,t){var r=UnityLoader.Job.result(e,"downloadAsmFramework");UnityLoader.loadCode(r,function(n){var o=new Blob([r],{type:"application/javascript"});e.mainScriptUrlOrBlob=o,UnityLoader[n](e),t.complete()},{Module:e,url:e.asmFrameworkUrl})},processMemoryInitializerJob:function(e,t){e.memoryInitializerRequest.status=200,e.memoryInitializerRequest.response=UnityLoader.Job.result(e,"downloadMemoryInitializer"),e.memoryInitializerRequest.callback&&e.memoryInitializerRequest.callback(),t.complete()},processDataJob:function(e,t){var r=UnityLoader.Job.result(e,"downloadData"),n=new DataView(r.buffer,r.byteOffset,r.byteLength),o=0,a="UnityWebData1.0\0";if(!String.fromCharCode.apply(null,r.subarray(o,o+a.length))==a)throw"unknown data format";o+=a.length;var i=n.getUint32(o,!0);for(o+=4;o0;c=f,f=u.indexOf("/",c)+1)e.FS_createPath(u.substring(0,c),u.substring(c,f-1),!0,!0);e.FS_createDataFile(u,null,r.subarray(s,s+d),!0,!0,!0)}e.removeRunDependency("processDataJob"),t.complete()},downloadJob:function(e,t){var r=t.parameters.objParameters?new UnityLoader.UnityCache.XMLHttpRequest(t.parameters.objParameters):new XMLHttpRequest;r.open("GET",t.parameters.url),r.responseType="arraybuffer",r.onload=function(){UnityLoader.Compression.decompress(new Uint8Array(r.response),function(e){t.complete(e)})},t.parameters.onprogress&&r.addEventListener("progress",t.parameters.onprogress),t.parameters.onload&&r.addEventListener("load",t.parameters.onload),r.send()},scheduleBuildDownloadJob:function(e,t,r){UnityLoader.Progress.update(e,t),UnityLoader.Job.schedule(e,t,[],UnityLoader.downloadJob,{url:e.resolveBuildUrl(e[r]),onprogress:function(r){UnityLoader.Progress.update(e,t,r)},onload:function(r){UnityLoader.Progress.update(e,t,r)},objParameters:e.companyName&&e.productName&&e.cacheControl&&(e.cacheControl[r]||e.cacheControl.default)?{companyName:e.companyName,productName:e.productName,cacheControl:e.cacheControl[r]||e.cacheControl.default}:null})},loadModule:function(e){if(e.useWasm=e.wasmCodeUrl&&UnityLoader.SystemInfo.hasWasm,e.useWasm)UnityLoader.scheduleBuildDownloadJob(e,"downloadWasmCode","wasmCodeUrl"),UnityLoader.Job.schedule(e,"processWasmCode",["downloadWasmCode"],UnityLoader.processWasmCodeJob),e.wasmMemoryUrl&&(UnityLoader.scheduleBuildDownloadJob(e,"downloadMemoryInitializer","wasmMemoryUrl"),UnityLoader.Job.schedule(e,"processMemoryInitializer",["downloadMemoryInitializer"],UnityLoader.processMemoryInitializerJob),e.memoryInitializerRequest={addEventListener:function(t,r){e.memoryInitializerRequest.callback=r}}),UnityLoader.scheduleBuildDownloadJob(e,"downloadWasmFramework","wasmFrameworkUrl"),UnityLoader.Job.schedule(e,"processWasmFramework",["downloadWasmFramework","processWasmCode","setupIndexedDB"],UnityLoader.processWasmFrameworkJob);else{if(!e.asmCodeUrl)throw"WebAssembly support is not detected in this browser.";UnityLoader.scheduleBuildDownloadJob(e,"downloadAsmCode","asmCodeUrl"),UnityLoader.Job.schedule(e,"processAsmCode",["downloadAsmCode"],UnityLoader.processAsmCodeJob),UnityLoader.scheduleBuildDownloadJob(e,"downloadMemoryInitializer","asmMemoryUrl"),UnityLoader.Job.schedule(e,"processMemoryInitializer",["downloadMemoryInitializer"],UnityLoader.processMemoryInitializerJob),e.memoryInitializerRequest={addEventListener:function(t,r){e.memoryInitializerRequest.callback=r}},e.asmLibraryUrl&&(e.dynamicLibraries=[e.asmLibraryUrl].map(e.resolveBuildUrl)),UnityLoader.scheduleBuildDownloadJob(e,"downloadAsmFramework","asmFrameworkUrl"),UnityLoader.Job.schedule(e,"processAsmFramework",["downloadAsmFramework","processAsmCode","setupIndexedDB"],UnityLoader.processAsmFrameworkJob)}UnityLoader.scheduleBuildDownloadJob(e,"downloadData","dataUrl"),UnityLoader.Job.schedule(e,"setupIndexedDB",[],UnityLoader.setupIndexedDBJob),e.preRun.push(function(){e.addRunDependency("processDataJob"),UnityLoader.Job.schedule(e,"processData",["downloadData"],UnityLoader.processDataJob)})},instantiate:function(e,t,r){function n(e,r){if("string"==typeof e&&!(e=document.getElementById(e)))return!1;e.innerHTML="",e.style.border=e.style.margin=e.style.padding=0,"static"==getComputedStyle(e).getPropertyValue("position")&&(e.style.position="relative"),e.style.width=r.width||e.style.width,e.style.height=r.height||e.style.height,r.container=e;var n=r.Module;return n.canvas=document.createElement("canvas"),n.canvas.style.width="100%",n.canvas.style.height="100%",n.canvas.addEventListener("contextmenu",function(e){e.preventDefault()}),n.canvas.addEventListener("dragstart",function(e){e.preventDefault()}),n.canvas.id="#canvas",e.appendChild(n.canvas),r.compatibilityCheck(r,function(){var t=new XMLHttpRequest;t.open("GET",r.url,!0),t.responseType="text",t.onerror=function(){n.print("Could not download "+r.url),0==document.URL.indexOf("file:")&&alert("It seems your browser does not support running Unity WebGL content from file:// urls. Please upload it to an http server, or try a different browser.")},t.onload=function(){var o=JSON.parse(t.responseText);for(var a in o)"undefined"==typeof n[a]&&(n[a]=o[a]);for(var i=!1,s=0;s=1?i=!0:n.print("Warning: Unsupported graphics API "+d)}return i?(e.style.background=n.backgroundUrl?"center/cover url('"+n.resolveBuildUrl(n.backgroundUrl)+"')":n.backgroundColor?" "+n.backgroundColor:"",r.onProgress(r,0),void UnityLoader.loadModule(n)):void r.popup("Your browser does not support any of the required graphics API for this content: "+n.graphicsAPI,[{text:"OK"}])},t.send()},function(){n.printErr("Instantiation of the '"+t+"' terminated due to the failed compatibility check.")}),!0}function o(e){return o.link=o.link||document.createElement("a"),o.link.href=e,o.link.href}var a={url:t,onProgress:UnityLoader.Progress.handler,compatibilityCheck:UnityLoader.compatibilityCheck,Module:{graphicsAPI:["WebGL 2.0","WebGL 1.0"],onAbort:function(e){throw void 0!==e?(this.print(e),this.printErr(e),e=JSON.stringify(e)):e="","abort("+e+") at "+this.stackTrace()},preRun:[],postRun:[],print:function(e){console.log(e)},printErr:function(e){console.error(e)},Jobs:{},buildDownloadProgress:{},resolveBuildUrl:function(e){return e.match(/(http|https|ftp|file):\/\//)?e:t.substring(0,t.lastIndexOf("/")+1)+e},streamingAssetsUrl:function(){return o(this.resolveBuildUrl("../StreamingAssets"))},pthreadMainPrefixURL:"Build/"},SetFullscreen:function(){if(a.Module.SetFullscreen)return a.Module.SetFullscreen.apply(a.Module,arguments)},SendMessage:function(){if(a.Module.SendMessage)return a.Module.SendMessage.apply(a.Module,arguments)}};a.Module.gameInstance=a,a.popup=function(e,t){return UnityLoader.Error.popup(a,e,t)},a.Module.postRun.push(function(){a.onProgress(a,1)});for(var i in r)if("Module"==i)for(var s in r[i])a.Module[s]=r[i][s];else a[i]=r[i];return n(e,a)||document.addEventListener("DOMContentLoaded",function(){n(e,a)}),a},Utils:{assert:function(e,t){e||abort("Assertion failed: "+t)},optimizeMathFround:function(e,t){console.log("optimizing out Math.fround calls");for(var r={LOOKING_FOR_MODULE:0,SCANNING_MODULE_VARIABLES:1,SCANNING_MODULE_FUNCTIONS:2},n=["EMSCRIPTEN_START_ASM","EMSCRIPTEN_START_FUNCS","EMSCRIPTEN_END_FUNCS"],o="var",a="global.Math.fround;",i=0,s=t?r.LOOKING_FOR_MODULE:r.SCANNING_MODULE_VARIABLES,d=0,l=0;s<=r.SCANNING_MODULE_FUNCTIONS&&i'; + + if(progress>= 0.9 && progress<1) + { + gameInstance.textProgress.innerHTML = '100% - Running, Wait..'; + gameInstance.progress.style.display = 'none'; + } + else + { + gameInstance.textProgress.innerHTML = 'Loading - ' + Math.floor(progress * 100) + '%'; + } + + /* + if (progress == 1) { + gameInstance.textProgress.innerHTML = 'Running, Please Wait.. '; + gameInstance.progress.style.display = 'none'; + } + */ + + if (progress == 'complete') { + SendMessage = gameInstance.SendMessage; + gameInstance.logo.style.display = 'none'; + gameInstance.progress.style.display = 'none'; + gameInstance.textProgress.style.display = 'none'; + } +} + +window.Game = (function() { + var Game = function() { + this.registerEvents(); + }; + + Game.prototype.registerEvents = function() { + var _this = this; + + window.addEventListener("keydown", function(e) { + // space and arrow keys + if ([8, 37, 38, 39, 40].indexOf(e.keyCode) > -1) { + e.preventDefault(); + } + }, false); + + document.onmousedown = function() { + window.focus(); + }; + + document.addEventListener('DOMContentLoaded', function() { + _this.resize(); + }, false); + + window.addEventListener('resize', function() { + setTimeout(function() { + _this.resize(); + }, 1000); + }, false); + }; + + Game.prototype.getQueryVariable = function(variable) { + var query = window.location.search.substring(1); + var vars = query.split("&"); + for (var i = 0; i < vars.length; i++) { + var pair = vars[i].split("="); + if (pair[0] == variable) { + return pair[1]; + } + } + return (false); + } + + var enableratioTolerant = true; + Game.prototype.resize = function() { + + var ratioTolerant = this.getQueryVariable('ratio_tolerant'); + + if (!enableratioTolerant || this.fullscreen()) { + return; + } + + document.getElementsByTagName('body')[0].style.overflow = 'hidden'; + var gameContainer = document.getElementById('gameContainer'); + var canvas = document.getElementById('#canvas'); + + var gameSizeRatio = gameContainer.offsetWidth / gameContainer.offsetHeight; + var maxHeight = this.maxHeight(); + var maxWidth = window.innerWidth; + var windowSizeRatio = maxWidth / maxHeight; + var newStyle = { + width: gameContainer.offsetWidth, + height: gameContainer.offsetHeight + }; + + if (ratioTolerant == 'true') { + newStyle = { width: maxWidth, height: maxHeight }; + } else if (ratioTolerant == 'false') { + if (gameSizeRatio > windowSizeRatio) { + newStyle = { width: maxWidth, height: maxWidth / gameSizeRatio }; + } else { + newStyle = { width: maxHeight * gameSizeRatio, height: maxHeight }; + } + } + + if(enableratioTolerant) + { + newStyle = { width: maxWidth, height: maxHeight }; + } + + this.updateStyle(gameContainer, newStyle); + + // canvas does not exists on page load + if (canvas) { + this.updateStyle(canvas, newStyle); + } + }; + + Game.prototype.maxHeight = function() { + return window.innerHeight; + }; + + Game.prototype.updateStyle = function(element, size) { + element.setAttribute('width', size.width); + element.setAttribute('height', size.height); + element.style.width = size.width + 'px'; + element.style.height = size.height + 'px'; + }; + + Game.prototype.fullscreen = function() { + return document.fullscreenElement || + document.webkitFullscreenElement || + document.mozFullScreenElement || + document.msFullscreenElement; + }; + + return Game; +})(); + +new Game(); \ No newline at end of file diff --git a/snowrider3d/TemplateData/favicon.ico b/snowrider3d/TemplateData/favicon.ico new file mode 100644 index 00000000..dd6bf7e9 Binary files /dev/null and b/snowrider3d/TemplateData/favicon.ico differ diff --git a/snowrider3d/TemplateData/gears.gif b/snowrider3d/TemplateData/gears.gif new file mode 100644 index 00000000..c440845e Binary files /dev/null and b/snowrider3d/TemplateData/gears.gif differ diff --git a/snowrider3d/TemplateData/logo.png b/snowrider3d/TemplateData/logo.png new file mode 100644 index 00000000..cce74503 Binary files /dev/null and b/snowrider3d/TemplateData/logo.png differ diff --git a/snowrider3d/TemplateData/style.css b/snowrider3d/TemplateData/style.css new file mode 100644 index 00000000..acac86da --- /dev/null +++ b/snowrider3d/TemplateData/style.css @@ -0,0 +1,132 @@ +body { + margin: 0px; + padding: 0px; + overflow: hidden; +} +.webgl-content * { + border: 0; + margin: 0; + padding: 0; +} + +#gameContainer canvas { + display: block; + background: #222; + /*background: url('tunnelRush.jpg') no-repeat center;*/ + /*background-color: black;*/ +} + +.webgl-content { + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + /*disable selection in games which select content when dragging mouse*/ + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + + .webgl-content .logo, + .progress, + .text { + position: absolute; + left: 50%; + top: 40%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + } + + .webgl-content .logo { + background: url('logo.png') no-repeat center / contain; + width: 500px; + height: 155px; + } + + .webgl-content .progress { + height: 26px; + width: 211px; + margin-top: 120px; + } + + .webgl-content .progress .empty { + background: url('progressEmpty.Light.png') no-repeat right / cover; + float: right; + width: 100%; + height: 100%; + display: inline-block; + } + + .webgl-content .progress .full { + background: url('progressFull.Light.png') no-repeat left / cover; + float: left; + width: 0%; + height: 100%; + display: inline-block; + } + + .webgl-content .text { + margin-top: 170px; + /*color: blueviolet;*/ + color: white; + font-family: 'Times New Roman', Times, serif, Haettenschweiler, 'Arial Narrow Bold', sans-serif, Helvetica, Verdana, sans-serif; + font-weight: 700; + font-size: 25px; + width: 500px; + text-align: center; + } + + .webgl-content .spinner { + vertical-align: middle; + height: 100px; + } + + .webgl-content .logo.Dark { + //background-image: url('logo.png'); + } + + .webgl-content .progress.Dark .empty { + background: white; + } + + .webgl-content .progress.Dark .full { + background: royalblue; + } + + .webgl-content .footer { + margin-top: 5px; + height: 38px; + line-height: 38px; + font-family: Helvetica, Verdana, Arial, sans-serif; + font-size: 18px; + background: #fff; + } + + .webgl-content .footer .webgl-logo, + .title, + .fullscreen { + height: 100%; + display: inline-block; + background: transparent center no-repeat; + } + + .webgl-content .footer .webgl-logo { + background-image: url('webgl-logo.png'); + width: 204px; + float: left; + } + + .webgl-content .footer .title { + margin-right: 10px; + float: right; + } + + .webgl-content .footer .fullscreen { + background-image: url('fullscreen.png'); + width: 38px; + float: right; + } diff --git a/snowrider3d/favicon.ico b/snowrider3d/favicon.ico new file mode 100644 index 00000000..ccbe3d11 Binary files /dev/null and b/snowrider3d/favicon.ico differ diff --git a/snowrider3d/index.html b/snowrider3d/index.html new file mode 100644 index 00000000..e62e5d78 --- /dev/null +++ b/snowrider3d/index.html @@ -0,0 +1,25 @@ + + + + + + + Snow Rider 3D + + + + + + + + + + +
+
+
+ + + diff --git a/snowrider3d/js/main.min.js b/snowrider3d/js/main.min.js new file mode 100644 index 00000000..62a3330b --- /dev/null +++ b/snowrider3d/js/main.min.js @@ -0,0 +1,10980 @@ +/* +* Project: @gamedistribution.com/html5-sdk +* Description: GameDistribution.com HTML5 SDK +* Development By: GameDistribution.com +* Copyright(c): 2021 +* Version: 1.15.7 (01-09-2021 11:07) +*/ +!function r(i, o, a) { + function s(t, e) { + if (!o[t]) { + if (!i[t]) { + var n = "function" == typeof require && require; + if (!e && n) + return n(t, !0); + if (c) + return c(t, !0); + throw (n = new Error("Cannot find module '" + t + "'")).code = "MODULE_NOT_FOUND", + n + } + n = o[t] = { + exports: {} + }, + i[t][0].call(n.exports, function(e) { + return s(i[t][1][e] || e) + }, n, n.exports, r, i, o, a) + } + return o[t].exports + } + for (var c = "function" == typeof require && require, e = 0; e < a.length; e++) + s(a[e]); + return s +}({ + 1: [function(e, t, n) { + !function(pf, gf) { + !function() { + !function() { + "use strict"; + function p(e, t) { + if (e !== t) + throw new TypeError("Cannot instantiate an arrow function") + } + function t(e) { + return (t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { + return typeof e + } + : function(e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e + } + )(e) + } + var je = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== pf ? pf : "undefined" != typeof self ? self : {} + , e = function(e) { + return e && e.Math == Math && e + } + , n = e("object" == typeof globalThis && globalThis) || e("object" == typeof window && window) || e("object" == typeof self && self) || e("object" == typeof je && je) || function() { + return this + }() || Function("return this")() + , r = {} + , i = function(e) { + try { + return !!e() + } catch (e) { + return !0 + } + } + , o = !i(function() { + return 7 != Object.defineProperty({}, 1, { + get: function() { + return 7 + } + })[1] + }) + , a = {} + , s = {}.propertyIsEnumerable + , c = Object.getOwnPropertyDescriptor + , u = c && !s.call({ + 1: 2 + }, 1); + a.f = u ? function(e) { + e = c(this, e); + return !!e && e.enumerable + } + : s; + function d(e, t) { + return { + enumerable: !(1 & e), + configurable: !(2 & e), + writable: !(4 & e), + value: t + } + } + function l(e) { + if (null == e) + throw TypeError("Can't call method on " + e); + return e + } + function h(e) { + return _(w(e)) + } + function f(e) { + return "object" == typeof e ? null !== e : "function" == typeof e + } + var g = {}.toString + , m = function(e) { + return g.call(e).slice(8, -1) + } + , v = m + , y = "".split + , b = i(function() { + return !Object("z").propertyIsEnumerable(0) + }) ? function(e) { + return "String" == v(e) ? y.call(e, "") : Object(e) + } + : Object + , _ = b + , w = l + , A = n + , E = function(e, t) { + return arguments.length < 2 ? "function" == typeof (n = A[e]) ? n : void 0 : A[e] && A[e][t]; + var n + } + , k = E("navigator", "userAgent") || "" + , x = k + , S = n.process + , D = n.Deno + , T = S && S.versions || D && D.version + , R = T && T.v8; + R ? yn = (mn = R.split("."))[0] < 4 ? 1 : mn[0] + mn[1] : x && (!(mn = x.match(/Edge\/(\d+)/)) || 74 <= mn[1]) && (mn = x.match(/Chrome\/(\d+)/)) && (yn = mn[1]); + var O = yn && +yn + , C = O + , I = i + , P = !!Object.getOwnPropertySymbols && !I(function() { + var e = Symbol(); + return !String(e) || !(Object(e)instanceof Symbol) || !Symbol.sham && C && C < 41 + }) + , L = P && !Symbol.sham && "symbol" == typeof Symbol.iterator + , j = E + , B = L ? function(e) { + return "symbol" == typeof e + } + : function(e) { + var t = j("Symbol"); + return "function" == typeof t && Object(e)instanceof t + } + , M = f + , U = { + exports: {} + } + , N = n + , G = function(t, n) { + try { + Object.defineProperty(N, t, { + value: n, + configurable: !0, + writable: !0 + }) + } catch (e) { + N[t] = n + } + return n + } + , F = G + , q = "__core-js_shared__" + , z = n[q] || F(q, {}) + , V = z; + (U.exports = function(e, t) { + return V[e] || (V[e] = void 0 !== t ? t : {}) + } + )("versions", []).push({ + version: "3.16.1", + mode: "global", + copyright: "© 2021 Denis Pushkarev (zloirock.ru)" + }); + var K = l + , H = function(e) { + return Object(K(e)) + } + , W = H + , $ = {}.hasOwnProperty + , Y = Object.hasOwn || function(e, t) { + return $.call(W(e), t) + } + , Q = 0 + , J = Math.random() + , Z = function(e) { + return "Symbol(" + String(void 0 === e ? "" : e) + ")_" + (++Q + J).toString(36) + } + , X = n + , ee = U.exports + , te = Y + , ne = Z + , re = P + , ie = L + , oe = ee("wks") + , ae = X.Symbol + , se = ie ? ae : ae && ae.withoutSetter || ne + , ce = function(e) { + return te(oe, e) && (re || "string" == typeof oe[e]) || (re && te(ae, e) ? oe[e] = ae[e] : oe[e] = se("Symbol." + e)), + oe[e] + } + , ue = f + , de = B + , le = function(e, t) { + var n, r; + if ("string" === t && "function" == typeof (n = e.toString) && !M(r = n.call(e))) + return r; + if ("function" == typeof (n = e.valueOf) && !M(r = n.call(e))) + return r; + if ("string" !== t && "function" == typeof (n = e.toString) && !M(r = n.call(e))) + return r; + throw TypeError("Can't convert object to primitive value") + } + , he = ce("toPrimitive") + , fe = B + , pe = function(e) { + e = function(e, t) { + if (!ue(e) || de(e)) + return e; + var n = e[he]; + if (void 0 === n) + return le(e, t = void 0 === t ? "number" : t); + if (t = n.call(e, t = void 0 === t ? "default" : t), + !ue(t) || de(t)) + return t; + throw TypeError("Can't convert object to primitive value") + }(e, "string"); + return fe(e) ? e : String(e) + } + , ge = f + , me = n.document + , ve = ge(me) && ge(me.createElement) + , ye = function(e) { + return ve ? me.createElement(e) : {} + } + , be = ye + , _e = !o && !i(function() { + return 7 != Object.defineProperty(be("div"), "a", { + get: function() { + return 7 + } + }).a + }) + , we = a + , Ae = d + , Ee = h + , ke = pe + , xe = Y + , Se = _e + , De = Object.getOwnPropertyDescriptor; + r.f = o ? De : function(e, t) { + if (e = Ee(e), + t = ke(t), + Se) + try { + return De(e, t) + } catch (e) {} + if (xe(e, t)) + return Ae(!we.f.call(e, t), e[t]) + } + ; + function Te(e) { + if (!Oe(e)) + throw TypeError(String(e) + " is not an object"); + return e + } + var Re = {} + , Oe = f + , Ce = _e + , Ie = Te + , Pe = pe + , Le = Object.defineProperty; + Re.f = o ? Le : function(e, t, n) { + if (Ie(e), + t = Pe(t), + Ie(n), + Ce) + try { + return Le(e, t, n) + } catch (e) {} + if ("get"in n || "set"in n) + throw TypeError("Accessors not supported"); + return "value"in n && (e[t] = n.value), + e + } + ; + var Be = Re + , Me = d + , Ue = o ? function(e, t, n) { + return Be.f(e, t, Me(1, n)) + } + : function(e, t, n) { + return e[t] = n, + e + } + , Ne = { + exports: {} + } + , Ge = z + , Fe = Function.toString; + "function" != typeof Ge.inspectSource && (Ge.inspectSource = function(e) { + return Fe.call(e) + } + ); + var qe, ze, Ve, Ke, He, We, $e, Ye, Qe = Ge.inspectSource, Je = Qe, Ze = n.WeakMap, Xe = "function" == typeof Ze && /native code/.test(Je(Ze)), et = U.exports, tt = Z, nt = et("keys"), rt = function(e) { + return nt[e] || (nt[e] = tt(e)) + }, it = {}, ot = f, at = Ue, st = Y, ct = z, ut = rt, dt = it, lt = "Object already initialized", ht = n.WeakMap; + $e = Xe || ct.state ? (qe = ct.state || (ct.state = new ht), + ze = qe.get, + Ve = qe.has, + Ke = qe.set, + He = function(e, t) { + if (Ve.call(qe, e)) + throw new TypeError(lt); + return t.facade = e, + Ke.call(qe, e, t), + t + } + , + We = function(e) { + return ze.call(qe, e) || {} + } + , + function(e) { + return Ve.call(qe, e) + } + ) : (dt[Ye = ut("state")] = !0, + He = function(e, t) { + if (st(e, Ye)) + throw new TypeError(lt); + return t.facade = e, + at(e, Ye, t), + t + } + , + We = function(e) { + return st(e, Ye) ? e[Ye] : {} + } + , + function(e) { + return st(e, Ye) + } + ); + var ft = { + set: He, + get: We, + has: $e, + enforce: function(e) { + return $e(e) ? We(e) : He(e, {}) + }, + getterFor: function(n) { + return function(e) { + var t; + if (!ot(e) || (t = We(e)).type !== n) + throw TypeError("Incompatible receiver, " + n + " required"); + return t + } + } + } + , pt = n + , gt = Ue + , mt = Y + , vt = G + , yt = Qe + , bt = ft.get + , _t = ft.enforce + , wt = String(String).split("String"); + (Ne.exports = function(e, t, n, r) { + var i = !!r && !!r.unsafe + , o = !!r && !!r.enumerable + , a = !!r && !!r.noTargetGet; + "function" == typeof n && ("string" != typeof t || mt(n, "name") || gt(n, "name", t), + (r = _t(n)).source || (r.source = wt.join("string" == typeof t ? t : ""))), + e !== pt ? (i ? !a && e[t] && (o = !0) : delete e[t], + o ? e[t] = n : gt(e, t, n)) : o ? e[t] = n : vt(t, n) + } + )(Function.prototype, "toString", function() { + return "function" == typeof this && bt(this).source || yt(this) + }); + function At(e) { + return 0 < e ? Tt(Dt(e), 9007199254740991) : 0 + } + var Et = {} + , kt = Math.ceil + , xt = Math.floor + , St = function(e) { + return isNaN(e = +e) ? 0 : (0 < e ? xt : kt)(e) + } + , Dt = St + , Tt = Math.min + , Rt = St + , Ot = Math.max + , Ct = Math.min + , It = function(e, t) { + e = Rt(e); + return e < 0 ? Ot(e + t, 0) : Ct(e, t) + } + , Pt = h + , Lt = At + , jt = It + , Bt = function(s) { + return function(e, t, n) { + var r, i = Pt(e), o = Lt(i.length), a = jt(n, o); + if (s && t != t) { + for (; a < o; ) + if ((r = i[a++]) != r) + return !0 + } else + for (; a < o; a++) + if ((s || a in i) && i[a] === t) + return s || a || 0; + return !s && -1 + } + } + , Mt = { + includes: Bt(!0), + indexOf: Bt(!1) + } + , Ut = Y + , Nt = h + , Gt = Mt.indexOf + , Ft = it + , qt = function(e, t) { + var n, r = Nt(e), i = 0, o = []; + for (n in r) + !Ut(Ft, n) && Ut(r, n) && o.push(n); + for (; t.length > i; ) + Ut(r, n = t[i++]) && (~Gt(o, n) || o.push(n)); + return o + } + , e = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"] + , zt = qt + , Vt = e.concat("length", "prototype"); + Et.f = Object.getOwnPropertyNames || function(e) { + return zt(e, Vt) + } + ; + u = {}; + u.f = Object.getOwnPropertySymbols; + var Kt = Et + , Ht = u + , Wt = Te + , s = E("Reflect", "ownKeys") || function(e) { + var t = Kt.f(Wt(e)) + , n = Ht.f; + return n ? t.concat(n(e)) : t + } + , $t = Y + , Yt = s + , Qt = r + , Jt = Re + , S = function(e, t) { + for (var n = Yt(t), r = Jt.f, i = Qt.f, o = 0; o < n.length; o++) { + var a = n[o]; + $t(e, a) || r(e, a, i(t, a)) + } + } + , Zt = i + , Xt = /#|\.prototype\./ + , D = function(e, t) { + e = tn[en(e)]; + return e == rn || e != nn && ("function" == typeof t ? Zt(t) : !!t) + } + , en = D.normalize = function(e) { + return String(e).replace(Xt, ".").toLowerCase() + } + , tn = D.data = {} + , nn = D.NATIVE = "N" + , rn = D.POLYFILL = "P" + , T = D + , on = n + , an = r.f + , sn = Ue + , cn = Ne.exports + , un = G + , dn = S + , ln = T + , R = function(e, t) { + var n, r, i, o, a = e.target, s = e.global, c = e.stat; + if (n = s ? on : c ? on[a] || un(a, {}) : (on[a] || {}).prototype) + for (r in t) { + if (i = t[r], + o = e.noTargetGet ? (o = an(n, r)) && o.value : n[r], + !ln(s ? r : a + (c ? "." : "#") + r, e.forced) && void 0 !== o) { + if (typeof i == typeof o) + continue; + dn(i, o) + } + (e.sham || o && o.sham) && sn(i, "sham", !0), + cn(n, r, i, e) + } + } + , hn = qt + , fn = e + , x = Object.keys || function(e) { + return hn(e, fn) + } + , pn = H + , gn = x; + R({ + target: "Object", + stat: !0, + forced: i(function() { + gn(1) + }) + }, { + keys: function(e) { + return gn(pn(e)) + } + }); + var mn = function(e) { + if ("function" != typeof e) + throw TypeError(String(e) + " is not a function"); + return e + } + , vn = mn + , yn = function(r, i, e) { + if (vn(r), + void 0 === i) + return r; + switch (e) { + case 0: + return function() { + return r.call(i) + } + ; + case 1: + return function(e) { + return r.call(i, e) + } + ; + case 2: + return function(e, t) { + return r.call(i, e, t) + } + ; + case 3: + return function(e, t, n) { + return r.call(i, e, t, n) + } + } + return function() { + return r.apply(i, arguments) + } + } + , bn = m + , I = Array.isArray || function(e) { + return "Array" == bn(e) + } + , _n = f + , wn = I + , An = ce("species") + , F = function(e, t) { + return new (void 0 === (n = wn(e = e) && ("function" == typeof (n = e.constructor) && (n === Array || wn(n.prototype)) || _n(n) && null === (n = n[An])) ? void 0 : n) ? Array : n)(0 === t ? 0 : t); + var n + } + , En = yn + , kn = b + , xn = H + , Sn = At + , Dn = F + , Tn = [].push + , q = function(h) { + var f = 1 == h + , p = 2 == h + , g = 3 == h + , m = 4 == h + , v = 6 == h + , y = 7 == h + , b = 5 == h || v; + return function(e, t, n, r) { + for (var i, o, a = xn(e), s = kn(a), c = En(t, n, 3), u = Sn(s.length), d = 0, r = r || Dn, l = f ? r(e, u) : p || y ? r(e, 0) : void 0; d < u; d++) + if ((b || d in s) && (o = c(i = s[d], d, a), + h)) + if (f) + l[d] = o; + else if (o) + switch (h) { + case 3: + return !0; + case 5: + return i; + case 6: + return d; + case 2: + Tn.call(l, i) + } + else + switch (h) { + case 4: + return !1; + case 7: + Tn.call(l, i) + } + return v ? -1 : g || m ? m : l + } + } + , L = { + forEach: q(0), + map: q(1), + filter: q(2), + some: q(3), + every: q(4), + find: q(5), + findIndex: q(6), + filterReject: q(7) + } + , Rn = i + , On = O + , Cn = ce("species") + , ee = function(t) { + return 51 <= On || !Rn(function() { + var e = []; + return (e.constructor = {})[Cn] = function() { + return { + foo: 1 + } + } + , + 1 !== e[t](Boolean).foo + }) + } + , In = L.filter; + R({ + target: "Array", + proto: !0, + forced: !ee("filter") + }, { + filter: function(e) { + return In(this, e, 1 < arguments.length ? arguments[1] : void 0) + } + }); + var X = R + , ie = i + , Pn = h + , Ln = r.f + , ne = o + , ge = ie(function() { + Ln(1) + }); + X({ + target: "Object", + stat: !0, + forced: !ne || ge, + sham: !ne + }, { + getOwnPropertyDescriptor: function(e, t) { + return Ln(Pn(e), t) + } + }); + var jn = pe + , Bn = Re + , Mn = d + , _e = function(e, t, n) { + t = jn(t); + t in e ? Bn.f(e, t, Mn(0, n)) : e[t] = n + } + , Un = s + , Nn = h + , Gn = r + , Fn = _e; + function qn(e, t, n) { + return t in e ? Object.defineProperty(e, t, { + value: n, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[t] = n, + e + } + function zn(e, t, n, r, i, o, a) { + try { + var s = e[o](a) + , c = s.value + } catch (e) { + return n(e), + 0 + } + s.done ? t(c) : Promise.resolve(c).then(r, i) + } + function Vn(s) { + return function() { + var e = this + , a = arguments; + return new Promise(function(t, n) { + var r = s.apply(e, a); + function i(e) { + zn(r, t, n, i, o, "next", e) + } + function o(e) { + zn(r, t, n, i, o, "throw", e) + } + i(void 0) + } + ) + } + } + function Kn(e, t) { + if (!(e instanceof t)) + throw new TypeError("Cannot call a class as a function") + } + function Hn(e, t) { + for (var n = 0; n < t.length; n++) { + var r = t[n]; + r.enumerable = r.enumerable || !1, + r.configurable = !0, + "value"in r && (r.writable = !0), + Object.defineProperty(e, r.key, r) + } + } + function Wn(e, t, n) { + return t && Hn(e.prototype, t), + n && Hn(e, n), + e + } + R({ + target: "Object", + stat: !0, + sham: !o + }, { + getOwnPropertyDescriptors: function(e) { + for (var t, n, r = Nn(e), i = Gn.f, o = Un(r), a = {}, s = 0; o.length > s; ) + void 0 !== (n = i(r, t = o[s++])) && Fn(a, t, n); + return a + } + }); + var $n = { + exports: {} + }; + !function() { + var t = function(a) { + var c, e = Object.prototype, u = e.hasOwnProperty, t = "function" == typeof Symbol ? Symbol : {}, r = t.iterator || "@@iterator", n = t.asyncIterator || "@@asyncIterator", i = t.toStringTag || "@@toStringTag"; + function o(e, t, n) { + return Object.defineProperty(e, t, { + value: n, + enumerable: !0, + configurable: !0, + writable: !0 + }), + e[t] + } + try { + o({}, "") + } catch (a) { + o = function(e, t, n) { + return e[t] = n + } + } + function s(e, t, n, r) { + var i, o, a, s, t = t && t.prototype instanceof m ? t : m, t = Object.create(t.prototype), r = new x(r || []); + return t._invoke = (i = e, + o = n, + a = r, + s = l, + function(e, t) { + if (s === f) + throw new Error("Generator is already running"); + if (s === p) { + if ("throw" === e) + throw t; + return D() + } + for (a.method = e, + a.arg = t; ; ) { + var n = a.delegate; + if (n) { + var r = function e(t, n) { + var r = t.iterator[n.method]; + if (r === c) { + if (n.delegate = null, + "throw" === n.method) { + if (t.iterator.return && (n.method = "return", + n.arg = c, + e(t, n), + "throw" === n.method)) + return g; + n.method = "throw", + n.arg = new TypeError("The iterator does not provide a 'throw' method") + } + return g + } + var r = d(r, t.iterator, n.arg); + if ("throw" === r.type) + return n.method = "throw", + n.arg = r.arg, + n.delegate = null, + g; + r = r.arg; + return r ? r.done ? (n[t.resultName] = r.value, + n.next = t.nextLoc, + "return" !== n.method && (n.method = "next", + n.arg = c), + n.delegate = null, + g) : r : (n.method = "throw", + n.arg = new TypeError("iterator result is not an object"), + n.delegate = null, + g) + }(n, a); + if (r) { + if (r === g) + continue; + return r + } + } + if ("next" === a.method) + a.sent = a._sent = a.arg; + else if ("throw" === a.method) { + if (s === l) + throw s = p, + a.arg; + a.dispatchException(a.arg) + } else + "return" === a.method && a.abrupt("return", a.arg); + s = f; + r = d(i, o, a); + if ("normal" === r.type) { + if (s = a.done ? p : h, + r.arg === g) + continue; + return { + value: r.arg, + done: a.done + } + } + "throw" === r.type && (s = p, + a.method = "throw", + a.arg = r.arg) + } + } + ), + t + } + function d(e, t, n) { + try { + return { + type: "normal", + arg: e.call(t, n) + } + } catch (e) { + return { + type: "throw", + arg: e + } + } + } + a.wrap = s; + var l = "suspendedStart" + , h = "suspendedYield" + , f = "executing" + , p = "completed" + , g = {}; + function m() {} + function v() {} + function y() {} + var b = {}; + o(b, r, function() { + return this + }); + t = Object.getPrototypeOf, + t = t && t(t(S([]))); + t && t !== e && u.call(t, r) && (b = t); + var _ = y.prototype = m.prototype = Object.create(b); + function w(e) { + ["next", "throw", "return"].forEach(function(t) { + o(e, t, function(e) { + return this._invoke(t, e) + }) + }) + } + function A(a, s) { + var t; + this._invoke = function(n, r) { + function e() { + return new s(function(e, t) { + !function t(e, n, r, i) { + e = d(a[e], a, n); + if ("throw" !== e.type) { + var o = e.arg; + return (n = o.value) && "object" == typeof n && u.call(n, "__await") ? s.resolve(n.__await).then(function(e) { + t("next", e, r, i) + }, function(e) { + t("throw", e, r, i) + }) : s.resolve(n).then(function(e) { + o.value = e, + r(o) + }, function(e) { + return t("throw", e, r, i) + }) + } + i(e.arg) + }(n, r, e, t) + } + ) + } + return t = t ? t.then(e, e) : e() + } + } + function E(e) { + var t = { + tryLoc: e[0] + }; + 1 in e && (t.catchLoc = e[1]), + 2 in e && (t.finallyLoc = e[2], + t.afterLoc = e[3]), + this.tryEntries.push(t) + } + function k(e) { + var t = e.completion || {}; + t.type = "normal", + delete t.arg, + e.completion = t + } + function x(e) { + this.tryEntries = [{ + tryLoc: "root" + }], + e.forEach(E, this), + this.reset(!0) + } + function S(t) { + if (t) { + var e = t[r]; + if (e) + return e.call(t); + if ("function" == typeof t.next) + return t; + if (!isNaN(t.length)) { + var n = -1 + , e = function e() { + for (; ++n < t.length; ) + if (u.call(t, n)) + return e.value = t[n], + e.done = !1, + e; + return e.value = c, + e.done = !0, + e + }; + return e.next = e + } + } + return { + next: D + } + } + function D() { + return { + value: c, + done: !0 + } + } + return o(_, "constructor", v.prototype = y), + o(y, "constructor", v), + v.displayName = o(y, i, "GeneratorFunction"), + a.isGeneratorFunction = function(e) { + e = "function" == typeof e && e.constructor; + return !!e && (e === v || "GeneratorFunction" === (e.displayName || e.name)) + } + , + a.mark = function(e) { + return Object.setPrototypeOf ? Object.setPrototypeOf(e, y) : (e.__proto__ = y, + o(e, i, "GeneratorFunction")), + e.prototype = Object.create(_), + e + } + , + a.awrap = function(e) { + return { + __await: e + } + } + , + w(A.prototype), + o(A.prototype, n, function() { + return this + }), + a.AsyncIterator = A, + a.async = function(e, t, n, r, i) { + void 0 === i && (i = Promise); + var o = new A(s(e, t, n, r),i); + return a.isGeneratorFunction(t) ? o : o.next().then(function(e) { + return e.done ? e.value : o.next() + }) + } + , + w(_), + o(_, i, "Generator"), + o(_, r, function() { + return this + }), + o(_, "toString", function() { + return "[object Generator]" + }), + a.keys = function(n) { + var e, r = []; + for (e in n) + r.push(e); + return r.reverse(), + function e() { + for (; r.length; ) { + var t = r.pop(); + if (t in n) + return e.value = t, + e.done = !1, + e + } + return e.done = !0, + e + } + } + , + a.values = S, + x.prototype = { + constructor: x, + reset: function(e) { + if (this.prev = 0, + this.next = 0, + this.sent = this._sent = c, + this.done = !1, + this.delegate = null, + this.method = "next", + this.arg = c, + this.tryEntries.forEach(k), + !e) + for (var t in this) + "t" === t.charAt(0) && u.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = c) + }, + stop: function() { + this.done = !0; + var e = this.tryEntries[0].completion; + if ("throw" === e.type) + throw e.arg; + return this.rval + }, + dispatchException: function(n) { + if (this.done) + throw n; + var r = this; + function e(e, t) { + return o.type = "throw", + o.arg = n, + r.next = e, + t && (r.method = "next", + r.arg = c), + !!t + } + for (var t = this.tryEntries.length - 1; 0 <= t; --t) { + var i = this.tryEntries[t] + , o = i.completion; + if ("root" === i.tryLoc) + return e("end"); + if (i.tryLoc <= this.prev) { + var a = u.call(i, "catchLoc") + , s = u.call(i, "finallyLoc"); + if (a && s) { + if (this.prev < i.catchLoc) + return e(i.catchLoc, !0); + if (this.prev < i.finallyLoc) + return e(i.finallyLoc) + } else if (a) { + if (this.prev < i.catchLoc) + return e(i.catchLoc, !0) + } else { + if (!s) + throw new Error("try statement without catch or finally"); + if (this.prev < i.finallyLoc) + return e(i.finallyLoc) + } + } + } + }, + abrupt: function(e, t) { + for (var n = this.tryEntries.length - 1; 0 <= n; --n) { + var r = this.tryEntries[n]; + if (r.tryLoc <= this.prev && u.call(r, "finallyLoc") && this.prev < r.finallyLoc) { + var i = r; + break + } + } + var o = (i = i && ("break" === e || "continue" === e) && i.tryLoc <= t && t <= i.finallyLoc ? null : i) ? i.completion : {}; + return o.type = e, + o.arg = t, + i ? (this.method = "next", + this.next = i.finallyLoc, + g) : this.complete(o) + }, + complete: function(e, t) { + if ("throw" === e.type) + throw e.arg; + return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, + this.method = "return", + this.next = "end") : "normal" === e.type && t && (this.next = t), + g + }, + finish: function(e) { + for (var t = this.tryEntries.length - 1; 0 <= t; --t) { + var n = this.tryEntries[t]; + if (n.finallyLoc === e) + return this.complete(n.completion, n.afterLoc), + k(n), + g + } + }, + catch: function(e) { + for (var t = this.tryEntries.length - 1; 0 <= t; --t) { + var n = this.tryEntries[t]; + if (n.tryLoc === e) { + var r, i = n.completion; + return "throw" === i.type && (r = i.arg, + k(n)), + r + } + } + throw new Error("illegal catch attempt") + }, + delegateYield: function(e, t, n) { + return this.delegate = { + iterator: S(e), + resultName: t, + nextLoc: n + }, + "next" === this.method && (this.arg = c), + g + } + }, + a + }($n.exports); + try { + regeneratorRuntime = t + } catch (e) { + "object" == typeof globalThis ? globalThis.regeneratorRuntime = t : Function("r", "regeneratorRuntime = r")(t) + } + }(); + var Yn = $n.exports + , Ge = {}; + Ge[ce("toStringTag")] = "z"; + var Je = "[object z]" === String(Ge) + , Ze = Je + , Qn = m + , Jn = ce("toStringTag") + , Zn = "Arguments" == Qn(function() { + return arguments + }()) + , et = Ze ? Qn : function(e) { + var t; + return void 0 === e ? "Undefined" : null === e ? "Null" : "string" == typeof (e = function(e, t) { + try { + return e[t] + } catch (e) {} + }(t = Object(e), Jn)) ? e : Zn ? Qn(t) : "Object" == (e = Qn(t)) && "function" == typeof t.callee ? "Arguments" : e + } + , Xn = et + , z = Ne.exports; + Je || z(Object.prototype, "toString", Je ? {}.toString : function() { + return "[object " + Xn(this) + "]" + } + , { + unsafe: !0 + }); + function er(e, t) { + this.stopped = e, + this.result = t + } + var Xe = n.Promise + , tr = Ne.exports + , nr = f + , rr = Te + , ct = Object.setPrototypeOf || ("__proto__"in {} ? function() { + var n, r = !1, e = {}; + try { + (n = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set).call(e, []), + r = e instanceof Array + } catch (n) {} + return function(e, t) { + return rr(e), + function(e) { + if (!nr(e) && null !== e) + throw TypeError("Can't set " + String(e) + " as a prototype") + }(t), + r ? n.call(e, t) : e.__proto__ = t, + e + } + }() : void 0) + , ir = Re.f + , or = Y + , ar = ce("toStringTag") + , ht = function(e, t, n) { + e && !or(e = n ? e : e.prototype, ar) && ir(e, ar, { + configurable: !0, + value: t + }) + } + , sr = E + , cr = Re + , ur = o + , dr = ce("species") + , dt = function(e) { + var t = sr(e) + , e = cr.f; + ur && t && !t[dr] && e(t, dr, { + configurable: !0, + get: function() { + return this + } + }) + } + , ut = {} + , lr = ut + , hr = ce("iterator") + , fr = Array.prototype + , Bt = function(e) { + return void 0 !== e && (lr.Array === e || fr[hr] === e) + } + , pr = et + , gr = ut + , mr = ce("iterator") + , D = function(e) { + if (null != e) + return e[mr] || e["@@iterator"] || gr[pr(e)] + } + , vr = Te + , G = function(e) { + var t = e.return; + if (void 0 !== t) + return vr(t.call(e)).value + } + , yr = Te + , br = Bt + , _r = At + , wr = yn + , Ar = D + , Er = G + , kr = ce("iterator") + , xr = !1; + try { + var Sr = 0 + , Dr = { + next: function() { + return { + done: !!Sr++ + } + }, + return: function() { + xr = !0 + } + }; + Dr[kr] = function() { + return this + } + , + Array.from(Dr, function() { + throw 2 + }) + } catch (p) {} + var Tr, Rr, qt = function(e, t) { + if (!t && !xr) + return !1; + var n = !1; + try { + var r = {}; + r[kr] = function() { + return { + next: function() { + return { + done: n = !0 + } + } + } + } + , + e(r) + } catch (e) {} + return n + }, Or = Te, Cr = mn, Ir = ce("species"), b = function(e, t) { + var n, e = Or(e).constructor; + return void 0 === e || null == (n = Or(e)[Ir]) ? t : Cr(n) + }, q = E("document", "documentElement"), ie = /(?:iphone|ipod|ipad).*applewebkit/i.test(k), X = "process" == m(n.process), Pr = n, ge = i, ne = yn, Lr = q, jr = ye, s = ie, Ge = X, Ze = Pr.setImmediate, z = Pr.clearImmediate, Br = Pr.process, Je = Pr.MessageChannel, Mr = Pr.Dispatch, Ur = 0, Nr = {}; + try { + Tr = Pr.location + } catch (p) {} + function Gr(e) { + return function() { + Fr(e) + } + } + var Fr = function(e) { + var t; + Nr.hasOwnProperty(e) && (t = Nr[e], + delete Nr[e], + t()) + } + , et = function(e) { + Fr(e.data) + } + , Dr = function(e) { + Pr.postMessage(String(e), Tr.protocol + "//" + Tr.host) + }; + Ze && z || (Ze = function(e) { + for (var t = [], n = arguments.length, r = 1; r < n; ) + t.push(arguments[r++]); + return Nr[++Ur] = function() { + ("function" == typeof e ? e : Function(e)).apply(void 0, t) + } + , + Rr(Ur), + Ur + } + , + z = function(e) { + delete Nr[e] + } + , + Ge ? Rr = function(e) { + Br.nextTick(Gr(e)) + } + : Mr && Mr.now ? Rr = function(e) { + Mr.now(Gr(e)) + } + : Je && !s ? (Zr = (Qr = new Je).port2, + Qr.port1.onmessage = et, + Rr = ne(Zr.postMessage, Zr, 1)) : Pr.addEventListener && "function" == typeof postMessage && !Pr.importScripts && Tr && "file:" !== Tr.protocol && !ge(Dr) ? (Rr = Dr, + Pr.addEventListener("message", et, !1)) : Rr = "onreadystatechange"in jr("script") ? function(e) { + Lr.appendChild(jr("script")).onreadystatechange = function() { + Lr.removeChild(this), + Fr(e) + } + } + : function(e) { + setTimeout(Gr(e), 0) + } + ); + var qr, zr, Vr, Kr, Hr, Wr, $r, Yr, s = { + set: Ze, + clear: z + }, Je = n, Qr = /iphone|ipod|ipad/i.test(k) && void 0 !== Je.Pebble, ne = /web0s(?!.*chrome)/i.test(k), Jr = n, Zr = r.f, Xr = s.set, ge = ie, Dr = Qr, et = ne, ei = X, Ze = Jr.MutationObserver || Jr.WebKitMutationObserver, z = Jr.document, ti = Jr.process, Je = Jr.Promise, k = Zr(Jr, "queueMicrotask"), ie = k && k.value; + ie || (qr = function() { + var e, t; + for (ei && (e = ti.domain) && e.exit(); zr; ) { + t = zr.fn, + zr = zr.next; + try { + t() + } catch (e) { + throw zr ? Kr() : Vr = void 0, + e + } + } + Vr = void 0, + e && e.enter() + } + , + Kr = ge || ei || et || !Ze || !z ? !Dr && Je && Je.resolve ? (($r = Je.resolve(void 0)).constructor = Je, + Yr = $r.then, + function() { + Yr.call($r, qr) + } + ) : ei ? function() { + ti.nextTick(qr) + } + : function() { + Xr.call(Jr, qr) + } + : (Hr = !0, + Wr = z.createTextNode(""), + new Ze(qr).observe(Wr, { + characterData: !0 + }), + function() { + Wr.data = Hr = !Hr + } + )); + function ni(e) { + var n, r; + this.promise = new e(function(e, t) { + if (void 0 !== n || void 0 !== r) + throw TypeError("Bad Promise constructor"); + n = e, + r = t + } + ), + this.resolve = ri(n), + this.reject = ri(r) + } + var Qr = ie || function(e) { + e = { + fn: e, + next: void 0 + }; + Vr && (Vr.next = e), + zr || (zr = e, + Kr()), + Vr = e + } + , ne = {} + , ri = mn; + ne.f = function(e) { + return new ni(e) + } + ; + function ii(e, t, n) { + function r(e) { + return o && Er(o), + new er(!0,e) + } + function i(e) { + return h ? (yr(e), + p ? g(e[0], e[1], r) : g(e[0], e[1])) : p ? g(e, r) : g(e) + } + var o, a, s, c, u, d, l = n && n.that, h = !(!n || !n.AS_ENTRIES), f = !(!n || !n.IS_ITERATOR), p = !(!n || !n.INTERRUPTED), g = wr(t, l, 1 + h + p); + if (f) + o = e; + else { + if ("function" != typeof (f = Ar(e))) + throw TypeError("Target is not iterable"); + if (br(f)) { + for (a = 0, + s = _r(e.length); a < s; a++) + if ((c = i(e[a])) && c instanceof er) + return c; + return new er(!1) + } + o = f.call(e) + } + for (u = o.next; !(d = u.call(o)).done; ) { + try { + c = i(d.value) + } catch (e) { + throw Er(o), + e + } + if ("object" == typeof c && c && c instanceof er) + return c + } + return new er(!1) + } + var oi, ai, si, ci, ui = Te, di = f, li = ne, Zr = function(e, t) { + if (ui(e), + di(t) && t.constructor === e) + return t; + e = li.f(e); + return (0, + e.resolve)(t), + e.promise + }, hi = n, k = "object" == typeof window, ge = R, fi = n, et = E, Dr = Xe, Je = Ne.exports, z = ct, Ze = ht, ie = dt, pi = f, gi = mn, mi = Qe, Qe = qt, vi = b, yi = s.set, bi = Qr, _i = Zr, s = ne, wi = function(e) { + try { + return { + error: !1, + value: e() + } + } catch (e) { + return { + error: !0, + value: e + } + } + }, Qr = ft, ne = T, Ai = k, Ei = X, ki = O, xi = ce("species"), Si = "Promise", Di = Qr.get, Ti = Qr.set, Ri = Qr.getterFor(Si), X = Dr && Dr.prototype, Oi = Dr, Qr = X, Ci = fi.TypeError, Ii = fi.document, Pi = fi.process, Li = s.f, ji = Li, Bi = !!(Ii && Ii.createEvent && fi.dispatchEvent), Mi = "function" == typeof PromiseRejectionEvent, Ui = "unhandledrejection", Ni = !1, ne = ne(Si, function() { + var e = mi(Oi) + , t = e !== String(Oi); + if (!t && 66 === ki) + return !0; + if (51 <= ki && /native code/.test(e)) + return !1; + var n = new Oi(function(e) { + e(1) + } + ) + , e = function(e) { + e(function() {}, function() {}) + }; + return (n.constructor = {})[xi] = e, + !(Ni = n.then(function() {})instanceof e) || !t && Ai && !Mi + }), Qe = ne || !Qe(function(e) { + Oi.all(e).catch(function() {}) + }), Gi = function(e) { + var t; + return !(!pi(e) || "function" != typeof (t = e.then)) && t + }, Fi = function(h, f) { + var p; + h.notified || (h.notified = !0, + p = h.reactions, + bi(function() { + for (var r, e = h.value, t = 1 == h.state, n = 0; p.length > n; ) { + var i, o, a, s = p[n++], c = t ? s.ok : s.fail, u = s.resolve, d = s.reject, l = s.domain; + try { + c ? (t || (2 === h.rejection && function(t) { + yi.call(fi, function() { + var e = t.facade; + Ei ? Pi.emit("rejectionHandled", e) : qi("rejectionhandled", e, t.value) + }) + }(h), + h.rejection = 1), + !0 === c ? i = e : (l && l.enter(), + i = c(e), + l && (l.exit(), + a = !0)), + i === s.promise ? d(Ci("Promise-chain cycle")) : (o = Gi(i)) ? o.call(i, u, d) : u(i)) : d(e) + } catch (e) { + l && !a && l.exit(), + d(e) + } + } + h.reactions = [], + h.notified = !1, + f && !h.rejection && (r = h, + yi.call(fi, function() { + var e, t = r.facade, n = r.value; + if (zi(r) && (e = wi(function() { + Ei ? Pi.emit("unhandledRejection", n, t) : qi(Ui, t, n) + }), + r.rejection = Ei || zi(r) ? 2 : 1, + e.error)) + throw e.value + })) + })) + }, qi = function(e, t, n) { + var r, i; + Bi ? ((r = Ii.createEvent("Event")).promise = t, + r.reason = n, + r.initEvent(e, !1, !0), + fi.dispatchEvent(r)) : r = { + promise: t, + reason: n + }, + !Mi && (i = fi["on" + e]) ? i(r) : e === Ui && function(e, t) { + var n = hi.console; + n && n.error && (1 === arguments.length ? n.error(e) : n.error(e, t)) + }("Unhandled promise rejection", n) + }, zi = function(e) { + return 1 !== e.rejection && !e.parent + }, Vi = function(t, n, r) { + return function(e) { + t(n, e, r) + } + }, Ki = function(e, t, n) { + e.done || (e.done = !0, + (e = n ? n : e).value = t, + e.state = 2, + Fi(e, !0)) + }, Hi = function(n, e, t) { + if (!n.done) { + n.done = !0, + t && (n = t); + try { + if (n.facade === e) + throw Ci("Promise can't be resolved itself"); + var r = Gi(e); + r ? bi(function() { + var t = { + done: !1 + }; + try { + r.call(e, Vi(Hi, t, n), Vi(Ki, t, n)) + } catch (e) { + Ki(t, e, n) + } + }) : (n.value = e, + n.state = 1, + Fi(n, !1)) + } catch (e) { + Ki({ + done: !1 + }, e, n) + } + } + }; + if (ne && (Qr = (Oi = function(e) { + (function(e, t, n) { + if (!(e instanceof t)) + throw TypeError("Incorrect " + (n ? n + " " : "") + "invocation") + } + )(this, Oi, Si), + gi(e), + oi.call(this); + var t = Di(this); + try { + e(Vi(Hi, t), Vi(Ki, t)) + } catch (e) { + Ki(t, e) + } + } + ).prototype, + (oi = function(e) { + Ti(this, { + type: Si, + done: !1, + notified: !1, + parent: !1, + reactions: [], + rejection: !1, + state: 0, + value: void 0 + }) + } + ).prototype = function(e, t, n) { + for (var r in t) + tr(e, r, t[r], n); + return e + }(Qr, { + then: function(e, t) { + var n = Ri(this) + , r = Li(vi(this, Oi)); + return r.ok = "function" != typeof e || e, + r.fail = "function" == typeof t && t, + r.domain = Ei ? Pi.domain : void 0, + n.parent = !0, + n.reactions.push(r), + 0 != n.state && Fi(n, !1), + r.promise + }, + catch: function(e) { + return this.then(void 0, e) + } + }), + ai = function() { + var e = new oi + , t = Di(e); + this.promise = e, + this.resolve = Vi(Hi, t), + this.reject = Vi(Ki, t) + } + , + s.f = Li = function(e) { + return e === Oi || e === si ? new ai : ji(e) + } + , + "function" == typeof Dr && X !== Object.prototype)) { + ci = X.then, + Ni || (Je(X, "then", function(e, t) { + var n = this; + return new Oi(function(e, t) { + ci.call(n, e, t) + } + ).then(e, t) + }, { + unsafe: !0 + }), + Je(X, "catch", Qr.catch, { + unsafe: !0 + })); + try { + delete X.constructor + } catch (p) {} + z && z(X, Qr) + } + ge({ + global: !0, + wrap: !0, + forced: ne + }, { + Promise: Oi + }), + Ze(Oi, Si, !1), + ie(Si), + si = et(Si), + ge({ + target: Si, + stat: !0, + forced: ne + }, { + reject: function(e) { + var t = Li(this); + return t.reject.call(void 0, e), + t.promise + } + }), + ge({ + target: Si, + stat: !0, + forced: ne + }, { + resolve: function(e) { + return _i(this, e) + } + }), + ge({ + target: Si, + stat: !0, + forced: Qe + }, { + all: function(e) { + var s = this + , t = Li(s) + , c = t.resolve + , u = t.reject + , n = wi(function() { + var r = gi(s.resolve) + , i = [] + , o = 0 + , a = 1; + ii(e, function(e) { + var t = o++ + , n = !1; + i.push(void 0), + a++, + r.call(s, e).then(function(e) { + n || (n = !0, + i[t] = e, + --a || c(i)) + }, u) + }), + --a || c(i) + }); + return n.error && u(n.value), + t.promise + }, + race: function(e) { + var n = this + , r = Li(n) + , i = r.reject + , t = wi(function() { + var t = gi(n.resolve); + ii(e, function(e) { + t.call(n, e).then(r.resolve, i) + }) + }); + return t.error && i(t.value), + r.promise + } + }); + var Je = R + , Wi = Xe + , z = i + , $i = E + , Yi = b + , Qi = Zr + , X = Ne.exports; + Je({ + target: "Promise", + proto: !0, + real: !0, + forced: !!Wi && z(function() { + Wi.prototype.finally.call({ + then: function() {} + }, function() {}) + }) + }, { + finally: function(t) { + var n = Yi(this, $i("Promise")) + , e = "function" == typeof t; + return this.then(e ? function(e) { + return Qi(n, t()).then(function() { + return e + }) + } + : t, e ? function(e) { + return Qi(n, t()).then(function() { + throw e + }) + } + : t) + } + }), + "function" == typeof Wi && (bo = $i("Promise").prototype.finally, + Wi.prototype.finally !== bo && X(Wi.prototype, "finally", bo, { + unsafe: !0 + })); + function Ji(e, t) { + return RegExp(e, t) + } + var Zi = B + , Qr = function(e) { + if (Zi(e)) + throw TypeError("Cannot convert a Symbol value to a string"); + return String(e) + } + , Xi = Te + , Ze = function() { + var e = Xi(this) + , t = ""; + return e.global && (t += "g"), + e.ignoreCase && (t += "i"), + e.multiline && (t += "m"), + e.dotAll && (t += "s"), + e.unicode && (t += "u"), + e.sticky && (t += "y"), + t + } + , ie = {} + , et = i; + ie.UNSUPPORTED_Y = et(function() { + var e = Ji("a", "y"); + return e.lastIndex = 2, + null != e.exec("abcd") + }), + ie.BROKEN_CARET = et(function() { + var e = Ji("^r", "gy"); + return e.lastIndex = 2, + null != e.exec("str") + }); + function eo() {} + function to(e) { + e.write(fo("")), + e.close(); + var t = e.parentWindow.Object; + return e = null, + t + } + var no, ro = Re, io = Te, oo = x, ne = o ? Object.defineProperties : function(e, t) { + io(e); + for (var n, r = oo(t), i = r.length, o = 0; o < i; ) + ro.f(e, n = r[o++], t[n]); + return e + } + , ao = Te, so = ne, co = e, ge = it, uo = q, lo = ye, ho = rt("IE_PROTO"), fo = function(e) { + return " + + + +
+ + + + + + + + \ No newline at end of file diff --git a/soccerrandom/media/bellsoc.webm b/soccerrandom/media/bellsoc.webm new file mode 100644 index 00000000..b34c70d5 Binary files /dev/null and b/soccerrandom/media/bellsoc.webm differ diff --git a/soccerrandom/media/bup.webm b/soccerrandom/media/bup.webm new file mode 100644 index 00000000..ffb6b2d5 Binary files /dev/null and b/soccerrandom/media/bup.webm differ diff --git a/soccerrandom/media/buttonx.webm b/soccerrandom/media/buttonx.webm new file mode 100644 index 00000000..7b08f377 Binary files /dev/null and b/soccerrandom/media/buttonx.webm differ diff --git a/soccerrandom/media/file.webm b/soccerrandom/media/file.webm new file mode 100644 index 00000000..ae6a1983 Binary files /dev/null and b/soccerrandom/media/file.webm differ diff --git a/soccerrandom/media/goasoc.webm b/soccerrandom/media/goasoc.webm new file mode 100644 index 00000000..260ed294 Binary files /dev/null and b/soccerrandom/media/goasoc.webm differ diff --git a/soccerrandom/media/intro-button.webm b/soccerrandom/media/intro-button.webm new file mode 100644 index 00000000..cb19fa83 Binary files /dev/null and b/soccerrandom/media/intro-button.webm differ diff --git a/soccerrandom/media/intro-sound.webm b/soccerrandom/media/intro-sound.webm new file mode 100644 index 00000000..deab50cb Binary files /dev/null and b/soccerrandom/media/intro-sound.webm differ diff --git a/soccerrandom/media/jump.webm b/soccerrandom/media/jump.webm new file mode 100644 index 00000000..4df5fee5 Binary files /dev/null and b/soccerrandom/media/jump.webm differ diff --git a/soccerrandom/media/menu.webm b/soccerrandom/media/menu.webm new file mode 100644 index 00000000..9a23c142 Binary files /dev/null and b/soccerrandom/media/menu.webm differ diff --git a/soccerrandom/media/music.webm b/soccerrandom/media/music.webm new file mode 100644 index 00000000..045fcba7 Binary files /dev/null and b/soccerrandom/media/music.webm differ diff --git a/soccerrandom/media/press.webm b/soccerrandom/media/press.webm new file mode 100644 index 00000000..c15c9e30 Binary files /dev/null and b/soccerrandom/media/press.webm differ diff --git a/soccerrandom/media/refsoc.webm b/soccerrandom/media/refsoc.webm new file mode 100644 index 00000000..db1a9e10 Binary files /dev/null and b/soccerrandom/media/refsoc.webm differ diff --git a/soccerrandom/media/start.webm b/soccerrandom/media/start.webm new file mode 100644 index 00000000..e45b653c Binary files /dev/null and b/soccerrandom/media/start.webm differ diff --git a/soccerrandom/media/win.webm b/soccerrandom/media/win.webm new file mode 100644 index 00000000..a7bcf22a Binary files /dev/null and b/soccerrandom/media/win.webm differ diff --git a/soccerrandom/media/wrong.webm b/soccerrandom/media/wrong.webm new file mode 100644 index 00000000..b7c81bbd Binary files /dev/null and b/soccerrandom/media/wrong.webm differ diff --git a/soccerrandom/scripts/c3runtime.js b/soccerrandom/scripts/c3runtime.js new file mode 100644 index 00000000..9eadac27 --- /dev/null +++ b/soccerrandom/scripts/c3runtime.js @@ -0,0 +1,2 @@ +// Generated by Construct 3, the game and app creator :: https://www.construct.net +'use strict';(function(n,e){if('object'==typeof exports&&'object'==typeof module)module.exports=e();else if('function'==typeof define&&define.amd)define([],e);else{var t=e();for(var r in t)('object'==typeof exports?exports:n)[r]=t[r]}})(this,function(){var g=Math.acos,a=Math.round,_=Math.min,r=Math.floor,p=Math.ceil,G=Math.sqrt,t=Math.pow,C=Math.cos,B=Math.sin,w=Math.max,F=Math.abs,h=Math.PI;return function(n){function i(t){if(e[t])return e[t].exports;var a=e[t]={i:t,l:!1,exports:{}};return n[t].call(a.exports,a,a.exports,i),a.l=!0,a.exports}var e={};return i.m=n,i.c=e,i.d=function(t,e,a){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:a})},i.n=function(t){var e=t&&t.__esModule?function(){return t['default']}:function(){return t};return i.d(e,'a',e),e},i.o=function(a,e){return Object.prototype.hasOwnProperty.call(a,e)},i.p='',i(i.s=4)}([function(n,i){'use strict';Object.defineProperty(i,'__esModule',{value:!0}),i.setMatrixArrayType=function(a){i.ARRAY_TYPE=t=a},i.toRadian=function(t){return t*r},i.equals=function(a,e){return F(a-e)<=s*w(1,F(a),F(e))};var s=i.EPSILON=1e-6,t=i.ARRAY_TYPE='undefined'==typeof Float32Array?Array:Float32Array,e=i.RANDOM=Math.random,r=h/180},function(n,e,i){'use strict';function a(_,e,t){var a=e[0],r=e[1],g=e[2],l=e[3],s=e[4],n=e[5],d=e[6],u=e[7],i=e[8],c=t[0],m=t[1],h=t[2],f=t[3],p=t[4],S=t[5],y=t[6],G=t[7],I=t[8];return _[0]=c*a+m*l+h*d,_[1]=c*r+m*s+h*u,_[2]=c*g+m*n+h*i,_[3]=f*a+p*l+S*d,_[4]=f*r+p*s+S*u,_[5]=f*g+p*n+S*i,_[6]=y*a+G*l+I*d,_[7]=y*r+G*s+I*u,_[8]=y*g+G*n+I*i,_}function r(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n}Object.defineProperty(e,'__esModule',{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new _.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat4=function(a,e){return a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=e[4],a[4]=e[5],a[5]=e[6],a[6]=e[8],a[7]=e[9],a[8]=e[10],a},e.clone=function(a){var e=new _.ARRAY_TYPE(9);return e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],e[4]=a[4],e[5]=a[5],e[6]=a[6],e[7]=a[7],e[8]=a[8],e},e.copy=function(a,e){return a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=e[3],a[4]=e[4],a[5]=e[5],a[6]=e[6],a[7]=e[7],a[8]=e[8],a},e.fromValues=function(i,e,t,a,r,c,l,s,n){var d=new _.ARRAY_TYPE(9);return d[0]=i,d[1]=e,d[2]=t,d[3]=a,d[4]=r,d[5]=c,d[6]=l,d[7]=s,d[8]=n,d},e.set=function(i,e,t,a,r,_,l,s,n,d){return i[0]=e,i[1]=t,i[2]=a,i[3]=r,i[4]=_,i[5]=l,i[6]=s,i[7]=n,i[8]=d,i},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(n,e){if(n===e){var t=e[1],a=e[2],r=e[5];n[1]=e[3],n[2]=e[6],n[3]=t,n[5]=e[7],n[6]=a,n[7]=r}else n[0]=e[0],n[1]=e[3],n[2]=e[6],n[3]=e[1],n[4]=e[4],n[5]=e[7],n[6]=e[2],n[7]=e[5],n[8]=e[8];return n},e.invert=function(_,e){var t=e[0],a=e[1],r=e[2],g=e[3],l=e[4],s=e[5],n=e[6],d=e[7],u=e[8],i=u*l-s*d,c=-u*g+s*n,p=d*g-l*n,m=t*i+a*c+r*p;return m?(m=1/m,_[0]=i*m,_[1]=(-u*a+r*d)*m,_[2]=(s*a-r*l)*m,_[3]=c*m,_[4]=(u*t-r*n)*m,_[5]=(-s*t+r*g)*m,_[6]=p*m,_[7]=(-d*t+a*n)*m,_[8]=(l*t-a*g)*m,_):null},e.adjoint=function(_,e){var t=e[0],a=e[1],r=e[2],c=e[3],l=e[4],s=e[5],n=e[6],d=e[7],u=e[8];return _[0]=l*u-s*d,_[1]=r*d-a*u,_[2]=a*s-r*l,_[3]=s*n-c*u,_[4]=t*u-r*n,_[5]=r*c-t*s,_[6]=c*d-l*n,_[7]=a*n-t*d,_[8]=t*l-a*c,_},e.determinant=function(i){var e=i[0],t=i[1],a=i[2],r=i[3],_=i[4],l=i[5],s=i[6],n=i[7],d=i[8];return e*(d*_-l*n)+t*(-d*r+l*s)+a*(n*r-_*s)},e.multiply=a,e.translate=function(_,e,t){var a=e[0],r=e[1],g=e[2],l=e[3],s=e[4],n=e[5],d=e[6],u=e[7],i=e[8],c=t[0],p=t[1];return _[0]=a,_[1]=r,_[2]=g,_[3]=l,_[4]=s,_[5]=n,_[6]=c*a+p*l+d,_[7]=c*r+p*s+u,_[8]=c*g+p*n+i,_},e.rotate=function(_,e,t){var a=e[0],r=e[1],d=e[2],l=e[3],n=e[4],i=e[5],u=e[6],c=e[7],g=e[8],p=B(t),m=C(t);return _[0]=m*a+p*l,_[1]=m*r+p*n,_[2]=m*d+p*i,_[3]=m*l-p*a,_[4]=m*n-p*r,_[5]=m*i-p*d,_[6]=u,_[7]=c,_[8]=g,_},e.scale=function(n,e,t){var a=t[0],r=t[1];return n[0]=a*e[0],n[1]=a*e[1],n[2]=a*e[2],n[3]=r*e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n},e.fromTranslation=function(a,e){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=e[0],a[7]=e[1],a[8]=1,a},e.fromRotation=function(n,e){var t=B(e),a=C(e);return n[0]=a,n[1]=t,n[2]=0,n[3]=-t,n[4]=a,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n},e.fromScaling=function(a,e){return a[0]=e[0],a[1]=0,a[2]=0,a[3]=0,a[4]=e[1],a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},e.fromMat2d=function(a,e){return a[0]=e[0],a[1]=e[1],a[2]=0,a[3]=e[2],a[4]=e[3],a[5]=0,a[6]=e[4],a[7]=e[5],a[8]=1,a},e.fromQuat=function(_,e){var t=e[0],a=e[1],r=e[2],g=e[3],l=t+t,s=a+a,n=r+r,d=t*l,u=a*l,i=a*s,c=r*l,m=r*s,h=r*n,f=g*l,p=g*s,S=g*n;return _[0]=1-i-h,_[3]=u-S,_[6]=c+p,_[1]=u+S,_[4]=1-d-h,_[7]=m-f,_[2]=c-p,_[5]=m+f,_[8]=1-d-i,_},e.normalFromMat4=function(h,e){var t=e[0],a=e[1],r=e[2],G=e[3],l=e[4],s=e[5],n=e[6],d=e[7],u=e[8],i=e[9],c=e[10],m=e[11],f=e[12],T=e[13],p=e[14],b=e[15],y=t*s-a*l,C=t*n-r*l,x=t*d-G*l,P=a*n-r*s,R=a*d-G*s,S=r*d-G*n,_=u*T-i*f,A=u*p-c*f,I=u*b-m*f,D=i*p-c*T,B=i*b-m*T,g=c*b-m*p,w=y*g-C*B+x*D+P*I-R*A+S*_;return w?(w=1/w,h[0]=(s*g-n*B+d*D)*w,h[1]=(n*I-l*g-d*A)*w,h[2]=(l*B-s*I+d*_)*w,h[3]=(r*B-a*g-G*D)*w,h[4]=(t*g-r*I+G*A)*w,h[5]=(a*I-t*B-G*_)*w,h[6]=(T*S-p*R+b*P)*w,h[7]=(p*x-f*S-b*C)*w,h[8]=(f*R-T*x+b*y)*w,h):null},e.projection=function(n,e,t){return n[0]=2/e,n[1]=0,n[2]=0,n[3]=0,n[4]=-2/t,n[5]=0,n[6]=-1,n[7]=1,n[8]=1,n},e.str=function(t){return'mat3('+t[0]+', '+t[1]+', '+t[2]+', '+t[3]+', '+t[4]+', '+t[5]+', '+t[6]+', '+t[7]+', '+t[8]+')'},e.frob=function(a){return G(t(a[0],2)+t(a[1],2)+t(a[2],2)+t(a[3],2)+t(a[4],2)+t(a[5],2)+t(a[6],2)+t(a[7],2)+t(a[8],2))},e.add=function(n,e,t){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},e.subtract=r,e.multiplyScalar=function(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},e.multiplyScalarAndAdd=function(n,e,t,a){return n[0]=e[0]+t[0]*a,n[1]=e[1]+t[1]*a,n[2]=e[2]+t[2]*a,n[3]=e[3]+t[3]*a,n[4]=e[4]+t[4]*a,n[5]=e[5]+t[5]*a,n[6]=e[6]+t[6]*a,n[7]=e[7]+t[7]*a,n[8]=e[8]+t[8]*a,n},e.exactEquals=function(a,e){return a[0]===e[0]&&a[1]===e[1]&&a[2]===e[2]&&a[3]===e[3]&&a[4]===e[4]&&a[5]===e[5]&&a[6]===e[6]&&a[7]===e[7]&&a[8]===e[8]},e.equals=function(i,e){var t=i[0],a=i[1],r=i[2],c=i[3],l=i[4],s=i[5],n=i[6],d=i[7],u=i[8],g=e[0],m=e[1],p=e[2],h=e[3],f=e[4],y=e[5],G=e[6],I=e[7],T=e[8];return F(t-g)<=_.EPSILON*w(1,F(t),F(g))&&F(a-m)<=_.EPSILON*w(1,F(a),F(m))&&F(r-p)<=_.EPSILON*w(1,F(r),F(p))&&F(c-h)<=_.EPSILON*w(1,F(c),F(h))&&F(l-f)<=_.EPSILON*w(1,F(l),F(f))&&F(s-y)<=_.EPSILON*w(1,F(s),F(y))&&F(n-G)<=_.EPSILON*w(1,F(n),F(G))&&F(d-I)<=_.EPSILON*w(1,F(d),F(I))&&F(u-T)<=_.EPSILON*w(1,F(u),F(T))};var s=i(0),_=function(n){if(n&&n.__esModule)return n;var e={};if(null!=n)for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}(s),l=e.mul=a,d=e.sub=r},function(e,t,n){'use strict';function i(){var t=new I.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t}function s(n){var e=n[0],t=n[1],a=n[2];return G(e*e+t*t+a*a)}function d(n,e,t){var a=new I.ARRAY_TYPE(3);return a[0]=n,a[1]=e,a[2]=t,a}function l(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n}function u(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}function c(n,e,t){return n[0]=e[0]/t[0],n[1]=e[1]/t[1],n[2]=e[2]/t[2],n}function m(n,e){var t=e[0]-n[0],a=e[1]-n[1],r=e[2]-n[2];return G(t*t+a*a+r*r)}function f(n,e){var t=e[0]-n[0],a=e[1]-n[1],r=e[2]-n[2];return t*t+a*a+r*r}function y(n){var e=n[0],t=n[1],a=n[2];return e*e+t*t+a*a}function S(n,e){var t=e[0],a=e[1],r=e[2],i=t*t+a*a+r*r;return 0r?h:g(r)},t.str=function(t){return'vec3('+t[0]+', '+t[1]+', '+t[2]+')'},t.exactEquals=function(a,e){return a[0]===e[0]&&a[1]===e[1]&&a[2]===e[2]},t.equals=function(i,e){var t=i[0],a=i[1],r=i[2],_=e[0],l=e[1],s=e[2];return F(t-_)<=I.EPSILON*w(1,F(t),F(_))&&F(a-l)<=I.EPSILON*w(1,F(a),F(l))&&F(r-s)<=I.EPSILON*w(1,F(r),F(s))};var R=n(0),I=function(n){if(n&&n.__esModule)return n;var e={};if(null!=n)for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}(R),A=t.sub=l,D=t.mul=u,E=t.div=c,k=t.dist=m,v=t.sqrDist=f,L=t.len=s,T=t.sqrLen=y,b=t.forEach=function(){var r=i();return function(e,t,l,c,s,n){var d,g;for(t||(t=3),l||(l=0),g=c?_(c*t+l,e.length):e.length,d=l;de[5]&e[0]>e[10]?(a=2*G(1+e[0]-e[5]-e[10]),n[3]=(e[6]-e[9])/a,n[0]=.25*a,n[1]=(e[1]+e[4])/a,n[2]=(e[8]+e[2])/a):e[5]>e[10]?(a=2*G(1+e[5]-e[0]-e[10]),n[3]=(e[8]-e[2])/a,n[0]=(e[1]+e[4])/a,n[1]=.25*a,n[2]=(e[6]+e[9])/a):(a=2*G(1+e[10]-e[0]-e[5]),n[3]=(e[1]-e[4])/a,n[0]=(e[8]+e[2])/a,n[1]=(e[6]+e[9])/a,n[2]=.25*a),n},e.fromRotationTranslationScale=function(_,e,t,a){var r=e[0],g=e[1],l=e[2],s=e[3],n=r+r,d=g+g,u=l+l,i=r*n,c=r*d,m=r*u,h=g*d,f=g*u,p=l*u,G=s*n,y=s*d,I=s*u,T=a[0],b=a[1],C=a[2];return _[0]=(1-(h+p))*T,_[1]=(c+I)*T,_[2]=(m-y)*T,_[3]=0,_[4]=(c-I)*b,_[5]=(1-(i+p))*b,_[6]=(f+G)*b,_[7]=0,_[8]=(m+y)*C,_[9]=(f-G)*C,_[10]=(1-(i+h))*C,_[11]=0,_[12]=t[0],_[13]=t[1],_[14]=t[2],_[15]=1,_},e.fromRotationTranslationScaleOrigin=function(g,e,t,a,r){var l=e[0],h=e[1],s=e[2],n=e[3],d=l+l,u=h+h,i=s+s,c=l*d,m=l*u,f=l*i,G=h*u,p=h*i,T=s*i,y=n*d,b=n*u,C=n*i,v=a[0],x=a[1],S=a[2],_=r[0],P=r[1],I=r[2];return g[0]=(1-(G+T))*v,g[1]=(m+C)*v,g[2]=(f-b)*v,g[3]=0,g[4]=(m-C)*x,g[5]=(1-(c+T))*x,g[6]=(p+y)*x,g[7]=0,g[8]=(f+b)*S,g[9]=(p-y)*S,g[10]=(1-(c+G))*S,g[11]=0,g[12]=t[0]+_-(g[0]*_+g[4]*P+g[8]*I),g[13]=t[1]+P-(g[1]*_+g[5]*P+g[9]*I),g[14]=t[2]+I-(g[2]*_+g[6]*P+g[10]*I),g[15]=1,g},e.fromQuat=function(_,e){var t=e[0],a=e[1],r=e[2],g=e[3],l=t+t,s=a+a,n=r+r,d=t*l,u=a*l,i=a*s,c=r*l,m=r*s,h=r*n,f=g*l,p=g*s,S=g*n;return _[0]=1-i-h,_[1]=u+S,_[2]=c-p,_[3]=0,_[4]=u-S,_[5]=1-d-h,_[6]=m+f,_[7]=0,_[8]=c+p,_[9]=m-f,_[10]=1-d-i,_[11]=0,_[12]=0,_[13]=0,_[14]=0,_[15]=1,_},e.frustum=function(i,e,t,a,r,_,l){var s=1/(t-e),n=1/(r-a),d=1/(_-l);return i[0]=2*_*s,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=2*_*n,i[6]=0,i[7]=0,i[8]=(t+e)*s,i[9]=(r+a)*n,i[10]=(l+_)*d,i[11]=-1,i[12]=0,i[13]=0,i[14]=2*(l*_)*d,i[15]=0,i},e.perspective=function(i,e,t,a,r){var l=1/_(e/2),s=1/(a-r);return i[0]=l/t,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=l,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=(r+a)*s,i[11]=-1,i[12]=0,i[13]=0,i[14]=2*r*a*s,i[15]=0,i},e.perspectiveFromFieldOfView=function(l,e,t,a){var r=_(e.upDegrees*h/180),c=_(e.downDegrees*h/180),s=_(e.leftDegrees*h/180),n=_(e.rightDegrees*h/180),d=2/(s+n),u=2/(r+c);return l[0]=d,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=u,l[6]=0,l[7]=0,l[8]=-(.5*((s-n)*d)),l[9]=.5*((r-c)*u),l[10]=a/(t-a),l[11]=-1,l[12]=0,l[13]=0,l[14]=a*t/(t-a),l[15]=0,l},e.ortho=function(i,e,t,a,r,_,l){var s=1/(e-t),n=1/(a-r),d=1/(_-l);return i[0]=-2*s,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*n,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*d,i[11]=0,i[12]=(e+t)*s,i[13]=(r+a)*n,i[14]=(l+_)*d,i[15]=1,i},e.lookAt=function(n,e,t,a){var r=e[0],g=e[1],m=e[2],h=a[0],y=a[1],T=a[2],S=t[0],_=t[1],b=t[2],I,C,v,x,P,R,A,D,B,w;return F(r-S)I&&(I=-I,d=-d,u=-u,h=-h,S=-S),1e-6<1-I?(G=g(I),T=B(G),b=B((1-a)*G)/T,C=B(a*G)/T):(b=1-a,C=a),e[0]=b*l+C*d,e[1]=b*t+C*u,e[2]=b*s+C*h,e[3]=b*n+C*S,e}function s(n,e){var t=e[0]+e[4]+e[8],a;if(0e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var _=(i+1)%3,l=(i+2)%3;a=G(e[3*i+i]-e[3*_+_]-e[3*l+l]+1),n[i]=.5*a,a=.5/a,n[3]=(e[3*_+l]-e[3*l+_])*a,n[_]=(e[3*_+i]+e[3*i+_])*a,n[l]=(e[3*l+i]+e[3*i+l])*a}return n}Object.defineProperty(t,'__esModule',{value:!0}),t.setAxes=t.sqlerp=t.rotationTo=t.equals=t.exactEquals=t.normalize=t.sqrLen=t.squaredLength=t.len=t.length=t.lerp=t.dot=t.scale=t.mul=t.add=t.set=t.copy=t.fromValues=t.clone=void 0,t.create=d,t.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},t.setAxisAngle=u,t.getAxisAngle=function(e,t){var a=2*g(t[3]),n=B(a/2);return 0==n?(e[0]=1,e[1]=0,e[2]=0):(e[0]=t[0]/n,e[1]=t[1]/n,e[2]=t[2]/n),a},t.multiply=r,t.rotateX=function(_,e,t){t*=.5;var d=e[0],r=e[1],u=e[2],l=e[3],s=B(t),n=C(t);return _[0]=d*n+l*s,_[1]=r*n+u*s,_[2]=u*n-r*s,_[3]=l*n-d*s,_},t.rotateY=function(_,e,t){t*=.5;var d=e[0],r=e[1],u=e[2],l=e[3],s=B(t),n=C(t);return _[0]=d*n-u*s,_[1]=r*n+l*s,_[2]=u*n+d*s,_[3]=l*n-r*s,_},t.rotateZ=function(_,e,t){t*=.5;var d=e[0],r=e[1],u=e[2],l=e[3],s=B(t),n=C(t);return _[0]=d*n+r*s,_[1]=r*n-d*s,_[2]=u*n+l*s,_[3]=l*n-u*s,_},t.calculateW=function(n,e){var t=e[0],a=e[1],r=e[2];return n[0]=t,n[1]=a,n[2]=r,n[3]=G(F(1-t*t-a*a-r*r)),n},t.slerp=i,t.invert=function(i,e){var t=e[0],a=e[1],r=e[2],_=e[3],l=t*t+a*a+r*r+_*_,s=l?1/l:0;return i[0]=-t*s,i[1]=-a*s,i[2]=-r*s,i[3]=_*s,i},t.conjugate=function(a,e){return a[0]=-e[0],a[1]=-e[1],a[2]=-e[2],a[3]=e[3],a},t.fromMat3=s,t.fromEuler=function(_,e,d,u){var c=.5*h/180;e*=c,d*=c,u*=c;var g=B(e),l=C(e),s=B(d),n=C(d),i=B(u),p=C(u);return _[0]=g*n*p-l*s*i,_[1]=l*s*p+g*n*i,_[2]=l*n*i-g*s*p,_[3]=l*n*p+g*s*i,_},t.str=function(t){return'quat('+t[0]+', '+t[1]+', '+t[2]+', '+t[3]+')'};var l=a(0),c=n(l),p=a(1),m=n(p),f=a(2),y=n(f),P=a(3),R=n(P),S=t.clone=R.clone,_=t.fromValues=R.fromValues,A=t.copy=R.copy,I=t.set=R.set,E=t.add=R.add,L=t.mul=r,O=t.scale=R.scale,M=t.dot=R.dot,v=t.lerp=R.lerp,N=t.length=R.length,T=t.len=N,b=t.squaredLength=R.squaredLength,x=t.sqrLen=b,D=t.normalize=R.normalize,k=t.exactEquals=R.exactEquals,w=t.equals=R.equals,W=t.rotationTo=function(){var i=y.create(),e=y.fromValues(1,0,0),t=y.fromValues(0,1,0);return function(r,s,l){var a=y.dot(s,l);return-.999999>a?(y.cross(i,e,s),1e-6>y.len(i)&&y.cross(i,t,s),y.normalize(i,i),u(r,i,Math.PI),r):.999999=d&&0<=i&&1>=i}function S(e,t,a){return(t[0]-e[0])*(a[1]-e[1])-(a[0]-e[0])*(t[1]-e[1])}function G(e,t,a){return 0S(e,t,a)}function f(e,t,a){return 0>=S(e,t,a)}function g(e,t,a,n){var r=Math.sqrt;if(!n)return 0===S(e,t,a);var s=tmpPoint1,_=tmpPoint2;s[0]=t[0]-e[0],s[1]=t[1]-e[1],_[0]=a[0]-t[0],_[1]=a[1]-t[1];var d=s[0]*_[0]+s[1]*_[1],i=r(s[0]*s[0]+s[1]*s[1]),u=r(_[0]*_[0]+_[1]*_[1]),c=Math.acos(d/(i*u));return ct?t%a+a:t%a]}function l(e){e.length=0}function a(t,a,n,r){for(var i=n;iI.length)return l;if(S++,S>g)return console.warn('quickDecomp: max level ('+g+') reached.'),l;for(var K=0;KU&&(U+=n.length),V=b,Ur[a][0])&&(a=i);return!G(P(t,a-1),P(t,a),P(t,a+1))&&(n(t),!0)}}}{let e=!1,t=!1,n='dev';self.C3=class{constructor(){throw TypeError('static class can\'t be instantiated')}static SetReady(){e=!0}static IsReady(){return e}static SetAppStarted(){t=!0}static HasAppStarted(){return t}static SetBuildMode(e){n=e}static GetBuildMode(){return n}static IsReleaseBuild(){return'final'===n}},C3.isDebug=!1,C3.isDebugDefend=!1,C3.hardwareConcurrency=navigator.hardwareConcurrency||2}'use strict',C3.QueryParser=class{constructor(e){this._queryString=e,this._parameters=new Map,this._Parse()}_Parse(){let e=this._queryString;(e.startsWith('?')||e.startsWith('#'))&&(e=e.substr(1));const t=e.split('&');for(const e of t)this._ParseParameter(e)}_ParseParameter(e){if(e){if(!e.includes('='))return void this._parameters.set(e,null);const t=e.indexOf('='),a=decodeURIComponent(e.substring(0,t)),n=decodeURIComponent(e.substring(t+1));this._parameters.set(a,n)}}LogAll(){for(const e of this._parameters)console.log('[QueryParser] Parameter \''+e[0]+'\' = '+(null===e[1]?'null':'\''+e[1]+'\''))}Has(e){return this._parameters.has(e)}Get(e){const t=this._parameters.get(e);return'undefined'==typeof t?null:t}ClearHash(){history.replaceState('',document.title,location.pathname+location.search)}Reparse(e){this._queryString=e,this._parameters.clear(),this._Parse()}},C3.QueryString=new C3.QueryParser(location.search),C3.LocationHashString=new C3.QueryParser(location.hash),'dev'!==C3.QueryString.Get('mode')&&C3.SetBuildMode('final'),'use strict';{function t(e,t,a){if(!0===t)a(),n.set(e,!0);else if(t&&t.length)a(t[0]),n.set(e,!0);else;}const r=navigator.userAgent;let a={linux:/linux|openbsd|freebsd|netbsd/i.test(r),chromeOS:/CrOS/.test(r),windowsTizen:/trident|iemobile|msie|tizen/i.test(r),genericMS:/trident|iemobile|msie|edge\//i.test(r),opera:/OPR\//.test(r),blackberry:/bb10/i.test(r),edge:/edge\//i.test(r),trident:/trident/i.test(r),webkit:/webkit/i.test(r),safari:/safari\//i.test(r),chrome:/chrome\//i.test(r),chromium:/chromium\//i.test(r),crosswalk:/crosswalk|xwalk/i.test(r),nwjs:/nwjs/i.test(r),amazonwebapp:/amazonwebappplatform/i.test(r),webview:/wv\)/.test(r),android:/android/i.test(r),nokia:/nokiabrowser\/[0-9.]+/i.test(r)},s={windows:/windows\s+nt\s+\d+\.\d+/i.exec(r),OSX:/mac\s+os\s+x\s+[0-9_]+/i.exec(r),android:/android\s+[0-9.]+/i.exec(r),opera:/OPR\/[0-9.]+/.exec(r),tizen:/tizen\s+[0-9.]+/i.exec(r),iphone:/iphone\s+os\s+[0-9_]+/i.exec(r),ipad:/ipad[^)]*os\s+[0-9_]+/i.exec(r),winPhone:/windows\s+phone\s+[0-9.]+/i.exec(r),winPhoneOS:/windows\s+phone\s+os\s+[0-9.]+/i.exec(r),chrome:/chrome\/[0-9.]+/i.exec(r),chromium:/chromium\/[0-9.]+/i.exec(r),nwjs:/nwjs\/[0-9.]+/i.exec(r),firefox:/firefox\/[0-9.]+/i.exec(r),ie:/msie\s+[0-9.]+/i.exec(r),edge:/edge\/[0-9.]+/i.exec(r),edgeChromium:/edg\/[0-9.]+/i.exec(r),silk:/silk\/[0-9.]+/i.exec(r)},_='(unknown)',e='(unknown)',d='(unknown)',u='(unknown)',g='(unknown)',i='(unknown)',h='(unknown)',c='browser',l=!1,m=!1,n=new Map;t('isWindows',s.windows,t=>{_='Windows';const a=t.split(' ')[2];a&&('5.0'===a?e='2000':'5.1'===a?e='XP':'5.2'===a?e='XP':'6.0'===a?e='Vista':'6.1'===a?e='7':'6.2'===a?e='8':'6.3'===a?e='8.1':'10.0'===a?e='10':void 0)}),t('isOSX',s.OSX,t=>{_='Mac OS X';const a=t.split(' ')[3];a&&(e=a.replace('_','.'))}),t('isLinux',a.linux,()=>{_='Linux'}),t('isChromeOS',a.chromeOS,()=>{_='Chrome OS'}),t('isAndroid',!a.windowsTizen&&s.android,t=>{_='Android';const a=t.split(' ')[1];a&&(e=a)}),t('isTizen',s.tizen,t=>{_='Tizen';const a=t.split(' ')[1];a&&(e=a)}),t('isIPhone',!a.windowsTizen&&s.iphone,t=>{_='iOS';const a=t.split(' ')[2];a&&(e=a.replace('_','.'))}),t('isIPad',!a.windowsTizen&&s.ipad,t=>{_='iOS';const a=t.split(' ')[3];a&&(e=a.replace('_','.'))}),t('isWindowsPhone',s.winPhone,t=>{_='Windows Phone';const a=t.split(' ')[2];a&&(e=a)}),t('isWindowsPhoneOS',s.winPhoneOS,t=>{_='Windows Phone';const a=t.split(' ')[3];a&&(e=a)}),t('isBlackberry',a.blackberry,()=>{_='Blackberry',e='10',u='stock',h='webkit'}),t('isChrome',!a.edge&&!a.opera&&s.chrome,e=>{u='Chrome',h='Chromium';const t=e.split('/')[1];t&&(g=t)}),t('isOpera',s.opera,e=>{u='Opera',h='Chromium';const t=e.split('/')[1];t&&(g=t)}),t('isChromium',s.chromium,e=>{u='Chromium',h='Chromium';const t=e.split('/')[1];t&&(g=t)}),t('isFirefox',s.firefox,e=>{u='Firefox',h='Gecko';const t=e.split('/')[1];t&&(g=t)}),t('isInternetExplorer',s.ie,e=>{u='Internet Explorer',h='Trident';const t=e.split(' ')[1];t&&(g=t)}),t('isTrident','Internet Explorer'!=u&&a.trident,()=>{h='Trident';const e=/rv:[0-9.]+/i.exec(r);if(e&&e.length){u='Internet Explorer';const t=e[0].split(':')[1];t&&(g=t)}}),t('isEdge',s.edge,e=>{u='Edge',h='Edge';const t=e.split('/')[1];t&&(g=t)}),t('isEdgeChromium',s.edgeChromium,e=>{u='Edge',h='Chromium';const t=e.split('/')[1];t&&(g=t)}),t('isSafari',a.safari&&!a.nokia&&!a.chrome&&!a.chromium&&!a.genericIE&&!a.blackberry,()=>{u='Safari',h='WebKit';const e=/version\/[0-9.]+/i.exec(r),t=/crios\/[0-9.]+/i.exec(r),n=/fxios\/[0-9.]+/i.exec(r);if(e&&e.length){const t=e[0].split('/')[1];t&&(g=t)}if(t&&t.length){u='Chrome for iOS';const e=t[0].split('/')[1];e&&(g=e)}if(n&&n.length){u='Firefox for iOS';const e=n[0].split('/')[1];e&&(g=e)}}),t('isSilk',s.silk,e=>{u='Silk';const t=e.split('/')[1];t&&(g=t)}),t('isCrosswalk',a.crosswalk,()=>c='crosswalk'),t('isCordova',self.device&&(self.device.cordova||self.device.phonegap),()=>c='cordova'),t('isNWJS',s.nwjs,e=>{c='nwjs',u='NW.js',h='Chromium';const t=e.split('/')[1];t&&(g=t)}),t('isAmazonWebApp',a.amazonwebapp,()=>c='webapp'),t('isHomeScreenWebApp','nwjs'!=c&&'undefined'!=typeof window&&(window.matchMedia&&window.matchMedia('(display-mode: standalone)').matches||navigator.standalone),()=>c='webapp'),t('isFalseSafari','Safari'==u&&('Android'==_||'Tizen'==_||'Blackberry'==_),()=>u='stock'),t('isAndroidWebview','Chrome'==u&&'browser'==c&&a.webview,()=>c='webview'),t('isFirefoxOS','Firefox'==u&&'(unknown)'==_,()=>_='Firefox OS'),t('isAndroidFallback','(unknown)'==_&&!a.windowsTizen&&a.android,()=>_='Android'),t('isTridentFallback','(unknown)'==_&&a.trident,()=>h='Trident'),t('isWebkitFallback','(unknown)'==_&&a.webkit,()=>h='WebKit'),t('is64Bit',(e=>e.test(r)||e.test(navigator.platform)||'x64'===navigator.cpuClass)(/x86_64|x86-64|win64|x64;|x64\)|x64_|amd64|wow64|ia64|arm64|arch64|sparc64|ppc64|irix64/i),()=>d='64-bit'),t('is32Bit',(e=>e.test(r)||e.test(navigator.platform)||'x86'===navigator.cpuClass)(/x86;|x86\)|i86|i386|i486|i586|i686|armv1|armv2|armv3|armv4|armv5|armv6|armv7/i),()=>d='32-bit'),t('is64BitFallback','(unknown)'==d&&'Mac OS X'==_&&10.7<=parseFloat(e),()=>d='64-bit'),t('is32BitFallback','(unknown)'==d&&'Windows'==_||'Android'==_&&5>parseFloat(e),()=>d='32-bit'),t('is32BitBrowser','32-bit'==d||/wow64/i.test(r),()=>i='32-bit'),t('is64BitBrowser',/win64/i.test(r),()=>i='64-bit'),t('isDesktop',(()=>'Windows'==_||'Mac OS X'==_||'Linux'==_||'Chrome OS'==_||'nwjs'==c)(),()=>l=!0),'Edge'==h&&'undefined'!=typeof Windows&&'undefined'!=typeof Windows.System&&(c='windows-store'),m='nwjs'==c||'windows-store'==c;const f='Mac OS X'==_&&navigator.maxTouchPoints&&2{e.onsuccess=()=>t(e.result),e.onerror=()=>a(e.error)})}function r(e){return new Promise((t,a)=>{e.oncomplete=()=>t(),e.onerror=()=>a(e.error),e.onabort=()=>a(e.error)})}function a(e,t){return _(e,t)}function s(e,t){return _(e,t,!0)}async function _(t,n,r=!1,a=!0){const i=await e(t);try{const e=i.transaction([h],r?'readwrite':'readonly');return n(e)}catch(e){if(a&&'InvalidStateError'===e.name)return g.delete(t),_(t,n,r,!1);throw e}}function e(e){u(e);let t=g.get(e);return t instanceof Promise||(t=d(e),g.set(e,t),t.catch(()=>g.delete(e))),t}async function d(e){u(e);const a=indexedDB.open(e,i);return a.addEventListener('upgradeneeded',t=>{try{const e=t.target.result;e.createObjectStore(h)}catch(t){console.error(`Failed to create objectstore for database ${e}`,t)}}),t(a)}function u(e){if('string'!=typeof e)throw new TypeError('expected string')}function p(e,t){const n=e.objectStore(h).openCursor();return new Promise(r=>{const a=[];n.onsuccess=n=>{const i=n.target.result;i?('entries'===t?a.push([i.key,i.value]):'keys'===t?a.push(i.key):'values'===t?a.push(i.value):void 0,i.continue()):r(a)}})}const i=2,h='keyvaluepairs',g=new Map,l='function'==typeof IDBObjectStore.prototype.getAll,m='function'==typeof IDBObjectStore.prototype.getAllKeys;self.KVStorageContainer=class{constructor(e){u(e),this.name=e}async ready(){await e(this.name)}set(a,n){return u(a),s(this.name,async e=>{const i=e.objectStore('keyvaluepairs').put(n,a),s=t(i),l=r(e);await Promise.all([l,s])})}get(n){return u(n),a(this.name,async a=>{const s=a.objectStore('keyvaluepairs').get(n),e=t(s),l=r(a),[_,d]=await Promise.all([l,e]);return d})}delete(a){return u(a),s(this.name,async n=>{const i=n.objectStore('keyvaluepairs').delete(a),e=t(i),s=r(n);await Promise.all([s,e])})}clear(){return s(this.name,async a=>{const n=a.objectStore('keyvaluepairs').clear(),i=t(n),e=r(a);await Promise.all([e,i])})}keys(){return a(this.name,async a=>{let n;if(m){const e=a.objectStore('keyvaluepairs').getAllKeys();n=t(e)}else n=p(a,'keys');const i=r(a),[e,s]=await Promise.all([i,n]);return s})}values(){return a(this.name,async a=>{let n;if(l){const e=a.objectStore('keyvaluepairs').getAll();n=t(e)}else n=p(a,'values');const i=r(a),[e,s]=await Promise.all([i,n]);return s})}entries(){return a(this.name,async t=>{const a=p(t,'entries'),n=r(t),[i,e]=await Promise.all([n,a]);return e})}}}{function t(e){throw new Error(`"${e}" is not implemented`)}function n(e){if('function'==typeof e)throw new Error(`localforage callback API is not implemented; please use the promise API instead`)}function r(e){return'object'==typeof e?new Promise(t=>{const{port1:a,port2:n}=new MessageChannel;n.onmessage=e=>t(e.data),a.postMessage(e)}):Promise.resolve(e)}const i=[/no available storage method found/i,/an attempt was made to break through the security policy of the user agent/i,/the user denied permission to access the database/i,/a mutation operation was attempted on a database that did not allow mutations/i,/idbfactory\.open\(\) called in an invalid security context/i],s=new WeakMap;let e=!1;'undefined'==typeof indexedDB&&(e=!0,console.warn('Unable to use local storage because indexedDB is not defined'));class l{constructor(e){this._inst=e,s.set(this,new Map)}_MaybeSwitchToMemoryFallback(t){if(!e)for(const a of i)if(a.test(t.message)){console.error('Unable to use local storage, reverting to in-memory store: ',t,t.message),e=!0;break}}async _getItemFallback(e){const t=s.get(this).get(e),a=await r(t);return'undefined'==typeof a?null:a}async _setItemFallback(e,t){t=await r(t),s.get(this).set(e,t)}_removeItemFallback(e){s.get(this).delete(e)}_clearFallback(){s.get(this).clear()}_keysFallback(){return Array.from(s.get(this).keys())}IsUsingFallback(){return e}async getItem(t,a){if(n(a),e)return await this._getItemFallback(t);let r;try{r=await this._inst.get(t)}catch(a){return this._MaybeSwitchToMemoryFallback(a),e?await this._getItemFallback(t):(console.error(`Error reading '${t}' from storage, returning null: `,a),null)}return'undefined'==typeof r?null:r}async setItem(t,a,r){if(n(r),'undefined'==typeof a&&(a=null),e)return void(await this._setItemFallback(t,a));try{await this._inst.set(t,a)}catch(n){if(this._MaybeSwitchToMemoryFallback(n),e)await this._setItemFallback(t,a);else throw n}}async removeItem(t,a){if(n(a),e)return void this._removeItemFallback(t);try{await this._inst.delete(t)}catch(a){this._MaybeSwitchToMemoryFallback(a),e?this._removeItemFallback(t):console.error(`Error removing '${t}' from storage: `,a)}}async clear(t){if(n(t),e)return void this._clearFallback();try{await this._inst.clear()}catch(t){this._MaybeSwitchToMemoryFallback(t),e?this._clearFallback():console.error(`Error clearing storage: `,t)}}async keys(t){if(n(t),e)return this._keysFallback();let a=[];try{a=await this._inst.keys()}catch(t){if(this._MaybeSwitchToMemoryFallback(t),e)return this._keysFallback();console.error(`Error getting storage keys: `,t)}return a}ready(t){return n(t),e?Promise.resolve(!0):this._inst.ready()}createInstance(e){if('object'!=typeof e)throw new TypeError('invalid options object');const t=e.name;if('string'!=typeof t)throw new TypeError('invalid store name');const a=new KVStorageContainer(t);return new l(a)}length(){t('localforage.length()')}key(){t('localforage.key()')}iterate(){t('localforage.iterate()')}setDriver(){t('localforage.setDriver()')}config(){t('localforage.config()')}defineDriver(){t('localforage.defineDriver()')}driver(){t('localforage.driver()')}supports(){t('localforage.supports()')}dropInstance(){t('localforage.dropInstance()')}disableMemoryMode(){e=!1}}self.localforage=new l(new KVStorageContainer('localforage'))}{if(C3.Supports={},C3.Supports.WebAnimations=(()=>{try{if('Safari'===C3.Platform.Browser)return!1;if('undefined'==typeof document)return!1;const e=document.createElement('div');if('undefined'==typeof e.animate)return!1;const t=e.animate([{opacity:'0'},{opacity:'1'}],1e3);return'undefined'!=typeof t.reverse}catch(e){return!1}})(),C3.Supports.DialogElement='undefined'!=typeof HTMLDialogElement,C3.Supports.RequestIdleCallback=!!self.requestIdleCallback,C3.Supports.ImageBitmap=!!self.createImageBitmap,C3.Supports.ImageBitmapOptions=!1,C3.Supports.ImageBitmap)try{self.createImageBitmap(new ImageData(32,32),{premultiplyAlpha:'none'}).then(()=>{C3.Supports.ImageBitmapOptions=!0}).catch(()=>{C3.Supports.ImageBitmapOptions=!1})}catch(e){C3.Supports.ImageBitmapOptions=!1}C3.Supports.ClipboardReadText=!!(navigator.clipboard&&navigator.clipboard.readText&&'Firefox'!==C3.Platform.Browser),C3.Supports.Proxies='undefined'!=typeof Proxy,C3.Supports.DownloadAttribute=(()=>{if('undefined'==typeof document)return!1;const e=document.createElement('a');return'undefined'!=typeof e.download})(),C3.Supports.CanvasToBlob=(()=>'undefined'!=typeof HTMLCanvasElement&&HTMLCanvasElement.prototype.toBlob)(),C3.Supports.CSSElement='undefined'!=typeof CSS&&CSS.supports('background','element(#test)'),C3.Supports.Fetch='function'==typeof fetch,C3.Supports.PersistentStorage=!!(self.isSecureContext&&'Opera'!==C3.Platform.Browser&&navigator.storage&&navigator.storage.persist),C3.Supports.StorageQuotaEstimate=!!(self.isSecureContext&&navigator.storage&&navigator.storage.estimate),C3.Supports.Fullscreen=(()=>{if('undefined'==typeof document)return!1;if('iOS'===C3.Platform.OS)return!1;const e=document.documentElement;return!!(e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen)})();const t=[{name:'A',value:12},{name:'B',value:13},{name:'C',value:13},{name:'D',value:13},{name:'E',value:13},{name:'F',value:13},{name:'G',value:14},{name:'H',value:12},{name:'I',value:12},{name:'J',value:13},{name:'K',value:14}],n=Math.ceil(496/t.length),r=(n+'').length,i=[];for(const s of t)for(let e=0;e<=n;e++)i.push({name:s.name+(e+'').padStart(r,'0'),value:s.value});i.sort((e,t)=>t.value-e.value);const a=i.reduce((e,t)=>{const a=t.name.slice(0,1),n=e.slice(-1);return n===a?e:e+a},'');C3.Supports.ArraySortProbablyStable='GKBCDEFJAHI'===a}{if(!String.prototype.trimStart){const e=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*/;String.prototype.trimStart=function(){return this.replace(e,'')}}if(!String.prototype.trimEnd){const e=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*$/;String.prototype.trimEnd=function(){return this.replace(e,'')}}if(Array.prototype.values||(Array.prototype.values=function*(){for(const e of this)yield e}),!Array.prototype.flat){function e(t,a){return t.reduce((t,n)=>0navigator.webkitTemporaryStorage.queryUsageAndQuota((t,a)=>e({usage:t,quota:a}),t))}),'undefined'==typeof HTMLCollection||HTMLCollection.prototype[Symbol.iterator]||(HTMLCollection.prototype[Symbol.iterator]=function(){let e=0;return{next:()=>e>=this.length?{done:!0}:{value:this.item(e++),done:!1}}}),'undefined'==typeof NodeList||NodeList.prototype[Symbol.iterator]||(NodeList.prototype[Symbol.iterator]=function(){let e=0;return{next:()=>e>=this.length?{done:!0}:{value:this.item(e++),done:!1}}}),'undefined'==typeof DOMTokenList||DOMTokenList.prototype[Symbol.iterator]||(DOMTokenList.prototype[Symbol.iterator]=function(){let e=0;return{next:()=>e>=this.length?{done:!0}:{value:this.item(e++),done:!1}}}),('undefined'==typeof FileList||FileList.prototype[Symbol.iterator]||(FileList.prototype[Symbol.iterator]=function(){let e=0;return{next:()=>e>=this.length?{done:!0}:{value:this.item(e++),done:!1}}}),'undefined'==typeof TextEncoder&&(self.TextEncoder=class{constructor(){Object.defineProperty(this,'encoding',{value:'utf-8',writable:!1})}encode(t){for(var a=t.length,n=-1,r=new Uint8Array(3*a),i=0,s=0,l=0;l!==a;){if(i=t.charCodeAt(l),l+=1,55296<=i&&56319>=i){if(l===a){r[n+=1]=239,r[n+=1]=191,r[n+=1]=189;break}if(s=t.charCodeAt(l),!(56320<=s&&57343>=s)){r[n+=1]=239,r[n+=1]=191,r[n+=1]=189;continue}else if(i=1024*(i-55296)+s-56320+65536,l+=1,65535>>18,r[n+=1]=128|63&i>>>12,r[n+=1]=128|63&i>>>6,r[n+=1]=128|63&i;continue}}127>=i?r[n+=1]=0|i:2047>=i?(r[n+=1]=192|i>>>6,r[n+=1]=128|63&i):(r[n+=1]=224|i>>>12,r[n+=1]=128|63&i>>>6,r[n+=1]=128|63&i)}return new Uint8Array(r.buffer.slice(0,n+1))}toString(){return'[object TextEncoder]'}},TextEncoder[Symbol.toStringTag]='TextEncoder'),'undefined'==typeof TextDecoder)){function t(e){const t=e[Symbol.iterator]();return{next:()=>t.next(),[Symbol.iterator](){return this}}}function e(e){const t=e.next();if(t.done)throw new Error('unexpected end of input');if(0!=(128^192&t.value))throw new Error('invalid byte');return 63&t.value}const n=new Map;n.set('utf-8',(a,n)=>{let r;if(a.buffer)r=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);else if(r instanceof ArrayBuffer)r=new Uint8Array(a);else throw new Error('Invalid parameter');const i=t(r),s=[];try{for(const t of i){let a;if(127>t)a=127&t;else if(223>t)a=(31&t)<<6|e(i);else if(239>t)a=(15&t)<<12|e(i)<<6|e(i);else if(247>t)a=(7&t)<<18|e(i)<<12|e(i)<<6|e(i);else throw new Error('Invalid character');s.push(String.fromCodePoint(a))}}catch(e){if(n)throw e;s.push('\uFFFD')}return s.join('')}),n.set('utf8',n.get('utf-8')),n.set('utf-16le',()=>{throw new Error('utf-16le decoder not implemented')}),self.TextDecoder=class{constructor(e='utf-8',t={}){const a=n.get(e);if(!a)throw new Error(`TextDecoder polyfill does not support "${e}"`);Object.defineProperty(this,'fatal',{value:!0===t.fatal,writable:!1}),Object.defineProperty(this,'_decoder',{value:a,writable:!1}),Object.defineProperty(this,'encoding',{value:e,writable:!1})}decode(e){return this._decoder(e,this.fatal)}toString(){return'[object TextDecoder]'}},TextDecoder[Symbol.toStringTag]='TextDecoder'}'undefined'==typeof self.isSecureContext&&(self.isSecureContext='https:'===location.protocol),'undefined'==typeof self.globalThis&&(self.globalThis=self)}{function e(e){let t=C3.GetCallStack();console.error('Assertion failure: '+e+'\n\nStack trace:\n'+t)}self.assert=function(t,a){t||e(a)}}{C3.IsNumber=function(e){return'number'==typeof e},C3.IsFiniteNumber=function(e){return C3.IsNumber(e)&&isFinite(e)},C3.RequireNumber=function(e){if(!C3.IsNumber(e))throw new TypeError('expected number')},C3.RequireOptionalNumber=function(e){C3.IsNullOrUndefined(e)},C3.RequireNumberInRange=function(e,t,a){if(!C3.IsNumber(e)||isNaN(e)||t>e||aC3.getName(e))),a=[...t].join(',');console.warn(`An object derived from DefendedBase was not protected with debugDefend(). This will disable some checks. See the coding guidelines! Possible affected class names: ${a}`),u.clear(),e.clear()}}function s(e){let t=new Set;for(let a in e)t.add(a);return t}function _(t,a){let n=s(a),r=d.get(t);if(r){let e=[];for(let t of r.values())n.has(t)?n.delete(t):e.push(t);C3.appendArray(e,[...n]),e.length&&console.warn(`[Defence] '${C3.getName(t)}' constructor creates inconsistent properties: ${e.join(', ')}`)}else d.set(t,n)}C3.GetCallStack=function(){return new Error().stack},C3.Debugger=function(){debugger},C3.cast=function(e,t){return e&&e instanceof t?e:null},C3.getName=function(e){return'undefined'==typeof e?'undefined':null===e?'null':'boolean'==typeof e?'':C3.IsNumber(e)?'':C3.IsString(e)?'':C3.IsArray(e)?'':'symbol'==typeof e?'<'+e.toString()+'>':C3.IsFunction(e)?e.name&&'Function'!==e.name?e.name:'':'object'==typeof e?e.constructor&&e.constructor.name&&'Object'!==e.constructor.name?e.constructor.name:'':''},C3.getType=function(e){return null===e?'null':Array.isArray(e)?'array':typeof e},C3.range=function*(e,t){if(!isFinite(Math.abs(e-t)))throw new Error('Invalid parameters');if(e>t)for(let a=e-1;a>=t;a--)yield a;else for(let a=e;a1/e}const a=2*Math.PI,n=Math.PI/180,r=180/Math.PI;C3.wrap=function(e,t,n){var r=Math.floor;if(e=r(e),t=r(t),n=r(n),en?n:e},C3.clampAngle=function(e){return e%=a,0>e&&(e+=a),e},C3.toRadians=function(e){return e*n},C3.toDegrees=function(e){return e*r},C3.distanceTo=function(e,t,a,n){return Math.hypot(a-e,n-t)},C3.distanceSquared=function(t,a,n,r){const i=n-t,e=r-a;return i*i+e*e},C3.angleTo=function(e,t,a,n){return Math.atan2(n-t,a-e)},C3.angleDiff=function(t,a){var n=Math.cos,r=Math.sin;if(t===a)return 0;let s=r(t),e=n(t),l=r(a),_=n(a),d=s*l+e*_;return 1<=d?0:-1>=d?Math.PI:Math.acos(d)},C3.angleRotate=function(t,a,n){var r=Math.cos,s=Math.sin;let e=s(t),l=r(t),_=s(a),d=r(a);return Math.acos(e*_+l*d)>n?0=e*s-i*l},C3.angleLerp=function(e,t,a){let n=C3.angleDiff(e,t);return C3.angleClockwise(t,e)?C3.clampAngle(e+n*a):C3.clampAngle(e-n*a)},C3.lerp=function(e,t,a){return e+a*(t-e)},C3.unlerp=function(e,t,a){return e===t?0:(a-e)/(t-e)},C3.relerp=function(t,e,a,n,r){return C3.lerp(n,r,C3.unlerp(t,e,a))},C3.qarp=function(e,t,a,n){return C3.lerp(C3.lerp(e,t,n),C3.lerp(t,a,n),n)},C3.cubic=function(t,e,a,n,r){return C3.lerp(C3.qarp(t,e,a,r),C3.qarp(e,a,n,r),r)},C3.cosp=function(e,t,a){return(e+t+(e-t)*Math.cos(a*Math.PI))/2},C3.isPOT=function(e){return 0t;t<<=1)e|=e>>t;return e+1},C3.roundToNearestFraction=function(e,t){return Math.round(e*t)/t},C3.floorToNearestFraction=function(e,t){return Math.floor(e*t)/t},C3.round6dp=function(e){return Math.round(1e6*e)/1e6},C3.toFixed=function(e,t){let a=e.toFixed(t),n=a.length-1;for(;0<=n&&'0'===a.charAt(n);--n);return 0<=n&&'.'===a.charAt(n)&&--n,0>n?a:a.substr(0,n+1)},C3.PackRGB=function(e,t,a){return C3.clamp(e,0,255)|C3.clamp(t,0,255)<<8|C3.clamp(a,0,255)<<16};const i=1024;C3.PackRGBAEx=function(e,t,n,r){var s=Math.floor;return e=C3.clamp(s(1024*e),-8192,8191),t=C3.clamp(s(1024*t),-8192,8191),n=C3.clamp(s(1024*n),-8192,8191),r=C3.clamp(s(1023*r),0,1023),0>e&&(e+=16384),0>t&&(t+=16384),0>n&&(n+=16384),-(16384*(16384*e)*i+16384*t*i+n*i+r)},C3.PackRGBEx=function(e,t,a){return C3.PackRGBAEx(e,t,a,1)},C3.GetRValue=function(e){if(0<=e)return(255&e)/255;else{let t=Math.floor(-e/274877906944);return 8191>8)/255;else{let t=Math.floor(-e%274877906944/16777216);return 8191>16)/255;else{let t=Math.floor(-e%16777216/i);return 8191r(n-i))return a.slice(0);if(i=t/a[1]*a[0],1>r(n-i))return[a[1],a[0]]}let s=C3.greatestCommonDivisor(t,n);return[t/s,n/s]},C3.segmentsIntersect=function(_,a,d,c,e,f,g,h){var i=Math.abs;let S=0,G=0,I=0,T=0,b=0,C=0,P=0,R=0;if(_b)return!1;if(aP)return!1;let A=e-_+g-d,s=f-a+h-c,t=d-_,u=c-a,v=g-e,D=h-f,x=i(u*v-D*t);return!(i(v*s-D*A)>x)&&i(t*s-u*A)<=x},C3.segmentsIntersectPreCalc=function(_,a,d,c,e,f,g,h,i,S,G,l){var m=Math.abs;let n=0,I=0,T=0,b=0;if(in)return!1;if(ST)return!1;let C=i-_+G-d,s=S-a+l-c,t=d-_,u=c-a,v=G-i,P=l-S,x=m(u*v-P*t);return!(m(v*s-P*C)>x)&&m(t*s-u*C)<=x},C3.segmentIntersectsQuad=function(t,a,r,s,_){let e=0,d=0,u=0,c=0;t0!==e.size).filter(e=>t(e)).map(async e=>{try{return await C3.CloneFile(e)}catch(e){return null}}),n=await Promise.all(a);return n.filter(e=>e)},C3.IsFileAnImage=function(e){return-1!==e.type.search(/image\/.*/)},C3.IsFileAnSVG=function(e){return'image/svg+xml'===e.type},C3.GetFileExtension=function(e){let t=e.lastIndexOf('.');return 1>t?'':e.substr(t)},C3.GetFileNamePart=function(e){let t=e.lastIndexOf('.');return 1>t?e:e.substr(0,t)},C3.NormalizeFileSeparator=function(e){return e.replace(/\\/g,'/')},C3.ParseFilePath=function(t){t=C3.NormalizeFileSeparator(t);let n=/^\w\:\//.exec(t);n?(n=n[0],t=t.slice(3),'/'!==t[0]&&(t='/'+t)):n='',t=t.replace(/\/{2,}/g,'/'),1{self.setTimeout(a,e,t)})},C3.swallowException=function(e){try{e()}catch(e){C3.isDebug&&console.warn('Swallowed exception: ',e)}},C3.noop=function(){},C3.equalsNoCase=function(e,t){return'string'==typeof e&&'string'==typeof t&&e.length===t.length&&(e===t||e.toLowerCase()===t.toLowerCase())},C3.stableSort=function(t,e){if(C3.Supports.ArraySortProbablyStable)return void t.sort(e);const a=t.map((e,t)=>[e,t]);a.sort((t,n)=>{const a=e(t[0],n[0]);return 0===a?t[1]-n[1]:a});for(let n=0,r=t.length;nn&&C3.extendArray(e,t,a)},C3.shallowAssignArray=function(e,t){C3.clearArray(e),C3.appendArray(e,t)},C3.appendArray=function(e,t){if(1e4>t.length)e.push(...t);else for(let a=0,n=t.length;at||t>=e.length)){let a=e.length-1;for(let n=t;na:5==t&&e>=a},C3.hasAnyOwnProperty=function(e){for(let t in e)if(e.hasOwnProperty(t))return!0;return!1},C3.PromiseAllWithProgress=function(t,a){return t.length?new Promise((n,r)=>{const s=[];let e=0,i=!1;for(let l=0,_=t.length;l<_;++l)s.push(void 0),t[l].then(r=>{i||(s[l]=r,++e,e===t.length?n(s):a(e,t.length))}).catch(e=>{i=!0,r(e)})}):Promise.resolve([])};let n=[];C3.AddLibraryMemoryCallback=function(e){n.push(e)},C3.GetEstimatedLibraryMemoryUsage=function(){let e=0;for(let t of n){let a=t();e+=a}return Math.floor(e)};const r=new MessageChannel;r.port2.onmessage=function(t){const a=t.data,n=e.get(a);e.delete(a),n&&n(t.timeStamp)};let i=1;const e=new Map;C3.RequestUnlimitedAnimationFrame=function(t){const a=i++;return e.set(a,t),r.port1.postMessage(a),a},C3.CancelUnlimitedAnimationFrame=function(t){e.delete(t)},C3.PostTask=C3.RequestUnlimitedAnimationFrame,C3.WaitForNextTask=function(){return new Promise(e=>C3.PostTask(e))}}'use strict',C3.IsAbsoluteURL=function(e){return /^(?:[a-z]+:)?\/\//.test(e)||'data:'===e.substr(0,5)||'blob:'===e.substr(0,5)},C3.IsRelativeURL=function(e){return!C3.IsAbsoluteURL(e)},C3.ThrowIfNotOk=function(e){if(!e.ok)throw new Error(`fetch '${e.url}' response returned ${e.status} ${e.statusText}`)},C3.FetchOk=function(e,t){return fetch(e,t).then(e=>(C3.ThrowIfNotOk(e),e))},C3.FetchText=function(e){return C3.FetchOk(e).then(e=>e.text())},C3.FetchJson=function(e){return C3.FetchOk(e).then(e=>e.json())},C3.FetchBlob=function(e){return C3.FetchOk(e).then(e=>e.blob())},C3.FetchArrayBuffer=function(e){return C3.FetchOk(e).then(e=>e.arrayBuffer())},C3.FetchImage=function(e){return new Promise((t,n)=>{const a=new Image;a.onload=()=>t(a),a.onerror=e=>n(e),a.src=e})},C3.BlobToArrayBuffer=function(e){return new Promise((t,a)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>a(n.error),n.readAsArrayBuffer(e)})},C3.BlobToString=function(e){return new Promise((t,a)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>a(n.error),n.readAsText(e)})},C3.BlobToJson=function(e){return C3.BlobToString(e).then(e=>JSON.parse(e))},C3.BlobToImage=async function(e,t){let n=URL.createObjectURL(e);try{const e=await C3.FetchImage(n);return URL.revokeObjectURL(n),n='',t&&'function'==typeof e.decode&&(await e.decode()),e}finally{n&&URL.revokeObjectURL(n)}},C3.CreateCanvas=function(e,t){if('undefined'!=typeof document&&'function'==typeof document.createElement){const a=document.createElement('canvas');return a.width=e,a.height=t,a}return new OffscreenCanvas(e,t)},C3.CanvasToBlob=function(e,t,a){return'number'!=typeof a&&(a=1),t=t||'image/png',a=C3.clamp(a,0,1),e.toBlob?new Promise(n=>e.toBlob(n,t,a)):e.convertToBlob?e.convertToBlob({type:t,quality:a}):C3.Asyncify(()=>C3.CanvasToBlobSync(e,t,a))},C3.CanvasToBlobSync=function(e,t,a){return'number'!=typeof a&&(a=1),t=t||'image/png',a=C3.clamp(a,0,1),C3.DataURIToBinaryBlob(e.toDataURL(t,a))},C3.DataURIToBinaryBlob=function(e){const t=C3.ParseDataURI(e);return C3.BinaryStringToBlob(t.data,t.mime_type)},C3.ParseDataURI=function(t){if('data:'!==t.substr(0,5))throw new URIError('expected data: uri');let a=t.indexOf(',');if(0>a)throw new URIError('expected comma in data: uri');let n=t.substring(5,a),r=t.substring(a+1),e=n.split(';'),s=e[0]||'',l=e[1],_=e[2],i;return i='base64'===l||'base64'===_?atob(r):decodeURIComponent(r),{mime_type:s,data:i}},C3.BinaryStringToBlob=function(t,a){let n=t.length,e=n>>2,r=new Uint8Array(n),i=new Uint32Array(r.buffer,0,e),s,l;for(s=0,l=0;sC3.DrawableToBlob(e,n,r));if(C3.Supports.ImageBitmap)return createImageBitmap(t).then(e=>C3.DrawableToBlob(e,n,r));else{const a=C3.CreateCanvas(t.width,t.height),i=a.getContext('2d');return i.putImageData(t,0,0),C3.CanvasToBlob(a,n,r)}},C3.CopySet=function(e,t){e.clear();for(const a of t)e.add(a)},C3.MapToObject=function(e){const t=Object.create(null);for(const[a,n]of e.entries())t[a]=n;return t},C3.ObjectToMap=function(e,t){t.clear();for(const[a,n]of Object.entries(e))t.set(a,n)},C3.ToSuperJSON=function t(a){if('object'==typeof a&&null!==a){if(a instanceof Set)return{_c3type_:'set',data:[...a].map(e=>t(e))};if(a instanceof Map)return{_c3type_:'map',data:[...a].map(e=>[e[0],t(e[1])])};else{const n=Object.create(null);for(const[r,i]of Object.entries(a))n[r]=t(i);return n}}return a},C3.FromSuperJSON=function t(a){if('object'==typeof a&null!==a){if('set'===a._c3type_)return new Set(a.data.map(e=>t(e)));if('map'===a._c3type_)return new Map(a.data.map(e=>[e[0],t(e[1])]));else{const n=Object.create(null);for(const[r,i]of Object.entries(a))n[r]=t(i);return n}}return a},C3.CSSToCamelCase=function(e){let t='',a=!1;for(const n of e)'-'===n?a=!0:a?(t+=n.toUpperCase(),a=!1):t+=n;return t},C3.IsIterator=function(e){return'object'==typeof e&&'function'==typeof e.next},'use strict';{function t(e){return 0===e.length?'00':1===e.length?'0'+e:e}function a(e,t,a){return 0>a&&(a+=1),1n.length)return!1;const r=parseInt(n[0].trim(),10)/255,i=parseInt(n[1].trim(),10)/255,s=parseInt(n[2].trim(),10)/255;return isFinite(r)&&this.setR(r),isFinite(i)&&this.setG(i),isFinite(s)&&this.setB(s),this.setA(1),!0}parseCommaSeparatedPercentageRgb(t){if('string'!=typeof t)return!1;t=t.replace(/^rgb\(|\)|%/,'');const n=t.split(',');if(3>n.length)return!1;const r=parseInt(n[0].trim(),10)/100,i=parseInt(n[1].trim(),10)/100,s=parseInt(n[2].trim(),10)/100;return isFinite(r)&&this.setR(r),isFinite(i)&&this.setG(i),isFinite(s)&&this.setB(s),this.setA(1),!0}parseCommaSeparatedRgba(t){if('string'!=typeof t)return!1;t=t.replace(/^rgba\(|\)|%/,'');const n=t.split(',');if(4>n.length)return!1;const r=parseInt(n[0].trim(),10)/255,i=parseInt(n[1].trim(),10)/255,s=parseInt(n[2].trim(),10)/255,e=parseFloat(n[3].trim());return isFinite(r)&&this.setR(r),isFinite(i)&&this.setG(i),isFinite(s)&&this.setB(s),isFinite(e)&&this.setA(e),!0}parseCommaSeparatedPercentageRgba(t){if('string'!=typeof t)return!1;t=t.replace(/^rgba\(|\)|%/,'');const n=t.split(',');if(4>n.length)return!1;const r=parseInt(n[0].trim(),10)/100,i=parseInt(n[1].trim(),10)/100,s=parseInt(n[2].trim(),10)/100,e=parseFloat(n[3].trim());return isFinite(r)&&this.setR(r),isFinite(i)&&this.setG(i),isFinite(s)&&this.setB(s),isFinite(e)&&this.setA(e),!0}parseString(e){if('string'!=typeof e)return!1;if(e=e.replace(/\s+/,''),e.includes(',')){if(e.startsWith('rgb('))return e.includes('%')?this.parseCommaSeparatedPercentageRgb(e):this.parseCommaSeparatedRgb(e);if(e.startsWith('rgba('))return e.includes('%')?this.parseCommaSeparatedPercentageRgba(e):this.parseCommaSeparatedRgba(e);if(e.startsWith('hsl(')||e.startsWith('hsla('))return this.parseHSLString(e);else{const t=e.split(',');return e.includes('%')?3===t.length?this.parseCommaSeparatedPercentageRgb(e):4===t.length&&this.parseCommaSeparatedPercentageRgba(e):3===t.length?this.parseCommaSeparatedRgb(e):4===t.length&&this.parseCommaSeparatedRgba(e)}}else return this.parseHexString(e)}toJSON(){return[this._r,this._g,this._b,this._a]}setFromHSLA(t,n,r,s){let l,_,u;if(t%=360,n=C3.clamp(n,0,100),r=C3.clamp(r,0,100),s=C3.clamp(s,0,1),t/=360,n/=100,r/=100,0===n)l=_=u=r;else{const e=.5>r?r*(1+n):r+n-r*n,i=2*r-e;l=a(i,e,t+1/3),_=a(i,e,t),u=a(i,e,t-1/3)}return this.setR(l),this.setG(_),this.setB(u),this.setA(s),this}parseHSLString(t){const a=t.replace(/ |hsl|hsla|\(|\)|;/gi,''),i=n.exec(a),e=r.exec(a);return i&&4===i.length?(this.setFromHSLA(+i[1],+i[2],+i[3],1),!0):!!(e&&5===e.length)&&(this.setFromHSLA(+i[1],+i[2],+i[3],+i[4]),!0)}toHSLAString(){const t=this._r,n=this._g,r=this._b,e=this._a,i=C3.Color.GetHue(t,n,r),a=C3.Color.GetSaturation(t,n,r),s=C3.Color.GetLuminosity(t,n,r);return`hsla(${i}, ${a}%, ${s}%, ${e})`}toHSLAArray(){const e=this._r,t=this._g,a=this._b;return[C3.Color.GetHue(e,t,a),C3.Color.GetSaturation(e,t,a),C3.Color.GetLuminosity(e,t,a),this._a]}setFromJSON(e){!Array.isArray(e)||3>e.length||(this._r=e[0],this._g=e[1],this._b=e[2],this._a=4<=e.length?e[3]:1)}set r(e){this.setR(e)}get r(){return this.getR()}set g(e){this.setG(e)}get g(){return this.getG()}set b(e){this.setB(e)}get b(){return this.getB()}set a(e){this.setA(e)}get a(){return this.getA()}setAtIndex(e,t){switch(e){case 0:this.setR(t);break;case 1:this.setG(t);break;case 2:this.setB(t);break;case 3:this.setA(t);break;default:throw new RangeError('invalid color index');}}getAtIndex(e){switch(e){case 0:return this.getR();case 1:return this.getG();case 2:return this.getB();case 3:return this.getA();default:throw new RangeError('invalid color index');}}static Diff(t,a){var n=Math.min,r=Math.max;const i=new C3.Color;return i.setR(r(t._r,a._r)-n(t._r,a._r)),i.setG(r(t._g,a._g)-n(t._g,a._g)),i.setB(r(t._b,a._b)-n(t._b,a._b)),i.setA(r(t._a,a._a)-n(t._a,a._a)),i}static GetHue(t,a,n){const r=Math.max(t,a,n),i=Math.min(t,a,n);if(r===i)return 0;let e=0;return r===t?e=(a-n)/(r-i)+(an&&(this._right=+n),this._bottom>r&&(this._bottom=+r)}clampFlipped(t,a,n,r){this._lefta&&(this._top=+a),this._right>n&&(this._right=+n),this._bottomthis._right&&this.swapLeftRight(),this._top>this._bottom&&this.swapTopBottom()}intersectsRect(e){return!(e._rightthis._right||e._top>this._bottom)}intersectsRectOffset(e,t,a){return!(e._right+tthis._right||e._top+a>this._bottom)}containsPoint(e,t){return e>=this._left&&e<=this._right&&t>=this._top&&t<=this._bottom}containsRect(e){return e._left>=this._left&&e._top>=this._top&&e._right<=this._right&&e._bottom<=this._bottom}expandToContain(e){e._leftthis._right&&(this._right=+e._right),e._bottom>this._bottom&&(this._bottom=+e._bottom)}lerpInto(e){this._left=C3.lerp(e._left,e._right,this._left),this._top=C3.lerp(e._top,e._bottom,this._top),this._right=C3.lerp(e._left,e._right,this._right),this._bottom=C3.lerp(e._top,e._bottom,this._bottom)}},'use strict';{function t(t,r,a,i){ti?r:i):(n=ta?r:a):ai?t:i):(n=ra?t:a)}let n=0,e=0;C3.Quad=class{constructor(t,a,n,r,i,e,s,l){this._tlx=NaN,this._tly=NaN,this._trx=NaN,this._try=NaN,this._brx=NaN,this._bry=NaN,this._blx=NaN,this._bly=NaN,this._tlx=0,this._tly=0,this._trx=0,this._try=0,this._brx=0,this._bry=0,this._blx=0,this._bly=0,t instanceof C3.Quad?this.copy(t):this.set(t||0,a||0,n||0,r||0,i||0,e||0,s||0,l||0)}set(t,a,n,r,i,e,s,l){this._tlx=+t,this._tly=+a,this._trx=+n,this._try=+r,this._brx=+i,this._bry=+e,this._blx=+s,this._bly=+l}setRect(e,t,a,n){this.set(e,t,a,t,a,n,e,n)}copy(e){this._tlx=e._tlx,this._tly=e._tly,this._trx=e._trx,this._try=e._try,this._brx=e._brx,this._bry=e._bry,this._blx=e._blx,this._bly=e._bly}equals(e){return this._tlx===e._tlx&&this._tly===e._tly&&this._trx===e._trx&&this._try===e._try&&this._brx===e._brx&&this._bry===e._bry&&this._blx===e._blx&&this._bly===e._bly}setTlx(e){this._tlx=+e}getTlx(){return this._tlx}setTly(e){this._tly=+e}getTly(){return this._tly}setTrx(e){this._trx=+e}getTrx(){return this._trx}setTry(e){this._try=+e}getTry(){return this._try}setBrx(e){this._brx=+e}getBrx(){return this._brx}setBry(e){this._bry=+e}getBry(){return this._bry}setBlx(e){this._blx=+e}getBlx(){return this._blx}setBly(e){this._bly=+e}getBly(){return this._bly}toDOMQuad(){return new DOMQuad(new DOMPoint(this._tlx,this._tly),new DOMPoint(this._trx,this._try),new DOMPoint(this._brx,this._bry),new DOMPoint(this._blx,this._bly))}toArray(){return[this._tlx,this._tly,this._trx,this._try,this._brx,this._bry,this._blx,this._bly]}toTypedArray(){return new Float64Array(this.toArray())}writeToTypedArray(e,t){e[t++]=this._tlx,e[t++]=this._tly,e[t++]=this._trx,e[t++]=this._try,e[t++]=this._brx,e[t++]=this._bry,e[t++]=this._blx,e[t]=this._bly}writeToTypedArray3D(e,t,a){e[t++]=this._tlx,e[t++]=this._tly,e[t++]=a,e[t++]=this._trx,e[t++]=this._try,e[t++]=a,e[t++]=this._brx,e[t++]=this._bry,e[t++]=a,e[t++]=this._blx,e[t++]=this._bly,e[t]=a}offset(e,t){this._tlx+=+e,this._tly+=+t,this._trx+=+e,this._try+=+t,this._brx+=+e,this._bry+=+t,this._blx+=+e,this._bly+=+t}round(){var e=Math.round;this._tlx=e(this._tlx),this._tly=e(this._tly),this._trx=e(this._trx),this._try=e(this._try),this._brx=e(this._brx),this._bry=e(this._bry),this._blx=e(this._blx),this._bly=e(this._bly)}floor(){var e=Math.floor;this._tlx=e(this._tlx),this._tly=e(this._tly),this._trx=e(this._trx),this._try=e(this._try),this._brx=e(this._brx),this._bry=e(this._bry),this._blx=e(this._blx),this._bly=e(this._bly)}ceil(){var e=Math.ceil;this._tlx=e(this._tlx),this._tly=e(this._tly),this._trx=e(this._trx),this._try=e(this._try),this._brx=e(this._brx),this._bry=e(this._bry),this._blx=e(this._blx),this._bly=e(this._bly)}setFromRect(e){this._tlx=e._left,this._tly=e._top,this._trx=e._right,this._try=e._top,this._brx=e._right,this._bry=e._bottom,this._blx=e._left,this._bly=e._bottom}setFromRotatedRect(e,t){0===t?this.setFromRect(e):this.setFromRotatedRectPrecalc(e,Math.sin(t),Math.cos(t))}setFromRotatedRectPrecalc(t,a,n){const r=t._left*a,s=t._top*a,e=t._right*a,l=t._bottom*a,_=t._left*n,d=t._top*n,i=t._right*n,u=t._bottom*n;this._tlx=_-s,this._tly=d+r,this._trx=i-s,this._try=d+e,this._brx=i-l,this._bry=u+e,this._blx=_-l,this._bly=u+r}getBoundingBox(a){t(this._tlx,this._trx,this._brx,this._blx),a._left=n,a._right=e,t(this._tly,this._try,this._bry,this._bly),a._top=n,a._bottom=e}containsPoint(t,a){let r=this._trx-this._tlx,s=this._try-this._tly;const _=this._brx-this._tlx,e=this._bry-this._tly,u=t-this._tlx,g=a-this._tly;let h=r*r+s*s,f=r*_+s*e,y=r*u+s*g;const S=_*_+e*e,l=_*u+e*g;let m=1/(h*S-f*f),G=(S*y-f*l)*m,I=(h*l-f*y)*m;return!!(0<=G&&0G+I)||(r=this._blx-this._tlx,s=this._bly-this._tly,h=r*r+s*s,f=r*_+s*e,y=r*u+s*g,m=1/(h*S-f*f),G=(S*y-f*l)*m,I=(h*l-f*y)*m,0<=G&&0G+I)}midX(){return(this._tlx+this._trx+this._brx+this._blx)/4}midY(){return(this._tly+this._try+this._bry+this._bly)/4}intersectsSegment(e,t,a,n){return!!(this.containsPoint(e,t)||this.containsPoint(a,n))||C3.segmentIntersectsQuad(e,t,a,n,this)}intersectsQuad(t){let a=t.midX(),n=t.midY();if(this.containsPoint(a,n))return!0;if(a=this.midX(),n=this.midY(),t.containsPoint(a,n))return!0;const r=this._tlx,s=this._tly,e=this._trx,l=this._try,_=this._brx,d=this._bry,i=this._blx,u=this._bly;return C3.segmentIntersectsQuad(r,s,e,l,t)||C3.segmentIntersectsQuad(e,l,_,d,t)||C3.segmentIntersectsQuad(_,d,i,u,t)||C3.segmentIntersectsQuad(i,u,r,s,t)}mirror(){this._swap(0,2),this._swap(1,3),this._swap(6,4),this._swap(7,5)}flip(){this._swap(0,6),this._swap(1,7),this._swap(2,4),this._swap(3,5)}diag(){this._swap(2,6),this._swap(3,7)}_swap(e,t){const a=this._getAtIndex(e);this._setAtIndex(e,this._getAtIndex(t)),this._setAtIndex(t,a)}_getAtIndex(e){switch(e){case 0:return this._tlx;case 1:return this._tly;case 2:return this._trx;case 3:return this._try;case 4:return this._brx;case 5:return this._bry;case 6:return this._blx;case 7:return this._bly;default:throw new RangeError('invalid quad point index');}}_setAtIndex(e,t){switch(t=+t,e){case 0:this._tlx=t;break;case 1:this._tly=t;break;case 2:this._trx=t;break;case 3:this._try=t;break;case 4:this._brx=t;break;case 5:this._bry=t;break;case 6:this._blx=t;break;case 7:this._bly=t;break;default:throw new RangeError('invalid quad point index');}}}}{const e=[0,0,1,0,1,1,0,1],t=C3.New(C3.Quad);C3.CollisionPoly=class extends C3.DefendedBase{constructor(t,a=!0){super(),t||(t=e),this._ptsArr=Float64Array.from(t),this._bbox=new C3.Rect,this._isBboxChanged=!0,this._enabled=a}Release(){}pointsArr(){return this._ptsArr}pointCount(){return this._ptsArr.length/2}setPoints(e){this._ptsArr.length===e.length?this._ptsArr.set(e):this._ptsArr=Float64Array.from(e),this._isBboxChanged=!0}copy(e){this.setPoints(e._ptsArr)}setBboxChanged(){this._isBboxChanged=!0}_updateBbox(){if(!this._isBboxChanged)return;const t=this._ptsArr;let a=t[0],n=t[1],r=a,i=n;for(let e=0,s=t.length;er&&(r=s),li&&(i=l)}this._bbox.set(a,n,r,i),this._isBboxChanged=!1}setFromRect(e,t,a){let n=this._ptsArr;8!==n.length&&(n=new Float64Array(8),this._ptsArr=n),n[0]=e.getLeft()-t,n[1]=e.getTop()-a,n[2]=e.getRight()-t,n[3]=e.getTop()-a,n[4]=e.getRight()-t,n[5]=e.getBottom()-a,n[6]=e.getLeft()-t,n[7]=e.getBottom()-a,this._bbox.copy(e),(0!==t||0!==a)&&this._bbox.offset(-t,-a),this._isBboxChanged=!1}setFromQuad(e,a,n){t.copy(e),t.offset(a,n),this.setPoints(t.toArray()),this._isBboxChanged=!0}transform(t,n,r){let i=0,s=1;0!==r&&(i=Math.sin(r),s=Math.cos(r)),this.transformPrecalc(t,n,i,s)}transformPrecalc(t,a,n,r){const s=this._ptsArr;for(let e=0,i=s.length;e!e.includes(t))}static IsNamePredefined(e){return this._CreateEaseMap(),[...d.keys()].includes(e)}static GetEase(t){this._CreateEaseMap();const a=n.get(t);return a?e.get(a):e.get(t)}static GetEaseFromIndex(e){this._CreateEaseMap();const t=this.GetEaseNames();return t[e]}static GetIndexForEase(e){this._CreateEaseMap();const t=this.GetEaseNames();return t.indexOf(e)}static _CreateEaseMap(){0!==e.size||(this._AddPredifinedEase('default',()=>{}),this._AddPredifinedEase('noease',this.NoEase),this._AddPredifinedEase('easeinsine',this.EaseInSine),this._AddPredifinedEase('easeoutsine',this.EaseOutSine),this._AddPredifinedEase('easeinoutsine',this.EaseInOutSine),this._AddPredifinedEase('easeinelastic',this.EaseInElastic),this._AddPredifinedEase('easeoutelastic',this.EaseOutElastic),this._AddPredifinedEase('easeinoutelastic',this.EaseInOutElastic),this._AddPredifinedEase('easeinback',this.EaseInBack),this._AddPredifinedEase('easeoutback',this.EaseOutBack),this._AddPredifinedEase('easeinoutback',this.EaseInOutBack),this._AddPredifinedEase('easeinbounce',this.EaseInBounce),this._AddPredifinedEase('easeoutbounce',this.EaseOutBounce),this._AddPredifinedEase('easeinoutbounce',this.EaseInOutBounce),this._AddPredifinedEase('easeincubic',this.EaseInCubic),this._AddPredifinedEase('easeoutcubic',this.EaseOutCubic),this._AddPredifinedEase('easeinoutcubic',this.EaseInOutCubic),this._AddPredifinedEase('easeinquad',this.EaseInQuad),this._AddPredifinedEase('easeoutquad',this.EaseOutQuad),this._AddPredifinedEase('easeinoutquad',this.EaseInOutQuad),this._AddPredifinedEase('easeinquart',this.EaseInQuart),this._AddPredifinedEase('easeoutquart',this.EaseOutQuart),this._AddPredifinedEase('easeinoutquart',this.EaseInOutQuart),this._AddPredifinedEase('easeinquint',this.EaseInQuint),this._AddPredifinedEase('easeoutquint',this.EaseOutQuint),this._AddPredifinedEase('easeinoutquint',this.EaseInOutQuint),this._AddPredifinedEase('easeincirc',this.EaseInCirc),this._AddPredifinedEase('easeoutcirc',this.EaseOutCirc),this._AddPredifinedEase('easeinoutcirc',this.EaseInOutCirc),this._AddPredifinedEase('easeinexpo',this.EaseInExpo),this._AddPredifinedEase('easeoutexpo',this.EaseOutExpo),this._AddPredifinedEase('easeinoutexpo',this.EaseInOutExpo),this._AddPrivateCustomEase('cubicbezier',this.EaseCubicBezier),this._AddPrivateCustomEase('spline',this.EaseSpline))}static _AddPredifinedEase(e,t){u._AddEase(e,t,'predefined')}static _AddPrivateCustomEase(e,t){u._AddEase(e,t,'private')}static AddCustomEase(e,t){this._CreateEaseMap(),u._AddEase(e,t,'custom')}static RemoveCustomEase(t){this.IsNamePredefined(t)||[...g.keys()].includes(t)||(l.delete(t),e.delete(t))}static _AddEase(t,a,n){switch(e.set(t,a),n){case'predefined':d.set(t,a);break;case'custom':l.set(t,a);break;case'private':g.set(t,a);break;default:throw new Error('unexpected ease mode');}}static NoEase(t,a,e,n){return e*t/n+a}static EaseInQuad(t,n,e,r){return e*(t/=r)*t+n}static EaseOutQuad(t,n,e,r){return-e*(t/=r)*(t-2)+n}static EaseInOutQuad(t,n,e,r){return 1>(t/=r/2)?e/2*t*t+n:-e/2*(--t*(t-2)-1)+n}static EaseInCubic(t,n,e,r){return e*(t/=r)*t*t+n}static EaseOutCubic(t,n,e,r){return e*((t=t/r-1)*t*t+1)+n}static EaseInOutCubic(t,n,e,r){return 1>(t/=r/2)?e/2*t*t*t+n:e/2*((t-=2)*t*t+2)+n}static EaseInQuart(t,n,e,r){return e*(t/=r)*t*t*t+n}static EaseOutQuart(t,n,e,r){return-e*((t=t/r-1)*t*t*t-1)+n}static EaseInOutQuart(t,n,e,r){return 1>(t/=r/2)?e/2*t*t*t*t+n:-e/2*((t-=2)*t*t*t-2)+n}static EaseInQuint(t,n,e,r){return e*(t/=r)*t*t*t*t+n}static EaseOutQuint(t,n,e,r){return e*((t=t/r-1)*t*t*t*t+1)+n}static EaseInOutQuint(t,n,e,r){return 1>(t/=r/2)?e/2*t*t*t*t*t+n:e/2*((t-=2)*t*t*t*t+2)+n}static EaseInSine(t,a,e,n){return-e*i(t/n*(S/2))+e+a}static EaseOutSine(t,a,e,n){return e*h(t/n*(S/2))+a}static EaseInOutSine(t,a,e,n){return-e/2*(i(S*t/n)-1)+a}static EaseInExpo(t,a,e,n){return 0===t?a:e*f(2,10*(t/n-1))+a}static EaseOutExpo(t,a,e,n){return t===n?a+e:e*(-f(2,-10*t/n)+1)+a}static EaseInOutExpo(t,n,e,r){return 0===t?n:t===r?n+e:1>(t/=r/2)?e/2*f(2,10*(t-1))+n:e/2*(-f(2,-10*--t)+2)+n}static EaseInCirc(t,n,e,r){return-e*(y(1-(t/=r)*t)-1)+n}static EaseOutCirc(t,n,e,r){return e*y(1-(t=t/r-1)*t)+n}static EaseInOutCirc(t,n,e,r){return 1>(t/=r/2)?-e/2*(y(1-t*t)-1)+n:e/2*(y(1-(t-=2)*t)+1)+n}static EaseInElastic(e,a,n,r){let i=1.70158,s=0,u=n;return 0===e?a:1===(e/=r)?a+n:(s||(s=.3*r),u<_(n)?(u=n,i=s/4):i=s/(2*S)*t(n/u),-(u*f(2,10*(e-=1))*h((e*r-i)*(2*S)/s))+a)}static EaseOutElastic(e,a,n,r){let i=1.70158,s=0,u=n;return 0===e?a:1===(e/=r)?a+n:(s||(s=.3*r),u<_(n)?(u=n,i=s/4):i=s/(2*S)*t(n/u),u*f(2,-10*e)*h((e*r-i)*(2*S)/s)+n+a)}static EaseInOutElastic(e,a,n,r){let i=1.70158,s=0,u=n;return 0===e?a:2==(e/=r/2)?a+n:(s||(s=r*(.3*1.5)),u<_(n)?(u=n,i=s/4):i=s/(2*S)*t(n/u),1>e?-.5*(u*f(2,10*(e-=1))*h((e*r-i)*(2*S)/s))+a:.5*(u*f(2,-10*(e-=1))*h((e*r-i)*(2*S)/s))+n+a)}static EaseInBack(t,n,e,r,i){return void 0===i&&(i=1.70158),e*(t/=r)*t*((i+1)*t-i)+n}static EaseOutBack(t,n,e,r,i){return void 0===i&&(i=1.70158),e*((t=t/r-1)*t*((i+1)*t+i)+1)+n}static EaseInOutBack(t,n,e,r,i){return void 0===i&&(i=1.70158),1>(t/=r/2)?e/2*(t*t*(((i*=1.525)+1)*t-i))+n:e/2*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)+n}static EaseInBounce(t,a,e,n){return e-u.EaseOutBounce(n-t,0,e,n)+a}static EaseOutBounce(t,n,e,r){return(t/=r)<1/2.75?e*(7.5625*t*t)+n:t<2/2.75?e*(7.5625*(t-=1.5/2.75)*t+.75)+n:t<2.5/2.75?e*(7.5625*(t-=2.25/2.75)*t+.9375)+n:e*(7.5625*(t-=2.625/2.75)*t+.984375)+n}static EaseInOutBounce(t,a,e,n){return tn-3*a+3*t-e,r=(e,t,a)=>3*a-6*t+3*e,a=(e,t)=>3*(t-e),T=(t,n,e,a)=>((n*t+e)*t+a)*t,c=(t,n,e,a)=>3*n*t*t+2*e*t+a,s=(s,d,e,g,h,i)=>{if(1==s)return 1;let f=0,y=1,S=i[y],b=i[10];for(;10!=y&&S<=s;)y++,S=i[y],f+=G;y--,S=i[y];const n=(s-S)/(i[y+1]-S);let C=f+n*G;const x=I(d,e,g,h),t=r(d,e,g,h),u=a(d,e,g,h),v=c(C,x,t,u);if(0===v)return C;if(.02<=v){for(let e=0;4>e;++e){const e=T(C,x,t,u)-s,a=c(C,x,t,u);C-=e/a}return C}else{let n=f,e=f+G,r=0,l,a;do{C=n+(e-n)/2;let d=T(C,x,t,u)-s;0++r}while(l&&a);return C}}}(),'use strict';{function e(e){if(!C3.IsString(e));}C3.ProbabilityTable=class{constructor(){this._items=[],this._totalWeight=0}Release(){this.Clear(),this._items=null}Clear(){C3.clear2DArray(this._items),this._totalWeight=0}GetTotalWeight(){return this._totalWeight}Sample(e=Math.random()*this.GetTotalWeight()){let t=0;for(const[a,n]of this._items)if(t+=a,er(e)));for(let a=0,n=this._listeners.length,r;ar(e)));return Promise.all(t).then(()=>!e.defaultPrevented)}_FireAndWait_AsyncOptional(e){const t=[];this._IncreaseFireDepth();for(let a=0,n=this._captureListeners.length;a!e.defaultPrevented):!e.defaultPrevented}async _FireAndWaitAsync(e){return await this._FireAndWait_AsyncOptional(e)}async _FireAndWaitAsyncSequential(e){this._IncreaseFireDepth();for(let t=0,a=this._captureListeners.length;t(u.push({func:n,resolve:i,reject:e,stack:r}),l?void a(u.pop()):void(-1===c&&t(16))))},C3.Asyncify.SetHighThroughputMode=function(e){if(e)++i;else if(--i,0>i)throw new Error('already turned off high throughput mode')}}{function t(){a=-1}function n(){s=-1,l=-1;let t=Date.now();for(let n of e)if(n._CheckTimeout(t)){let e=n._GetDeadline();(-1===l||et+r&&(self.clearTimeout(s),l=this._deadline,s=self.setTimeout(n,this._timeout+100))}_CheckTimeout(e){return!(e>=this._deadline)||(this._callback()?(this._deadline=e+this._timeout,!0):(this._isActive=!1,!1))}_GetDeadline(){return this._deadline}Cancel(){this._isActive&&(e.delete(this),this._isActive=!1,0===e.size&&-1!==s&&(self.clearTimeout(s),s=-1,l=-1))}Release(){this.Cancel(),this._callback=null}}}'use strict',C3.Disposable=class e{constructor(e){this._disposed=!1,this._disposeAction=e}Dispose(){this._disposed||(this._disposed=!0,this._disposeAction&&(this._disposeAction(),this._disposeAction=null))}IsDisposed(){return this._disposed}Release(){this.Dispose()}static Release(t){return new e(()=>t.Release())}static From(t,a,n,r,i){if('undefined'==typeof r||null===r)r=!1;else if('boolean'!=typeof r&&'object'!=typeof r)throw new TypeError('invalid event listener options');if(i&&(n=n.bind(i)),a.includes(' ')){a=a.split(' ');const i=new C3.CompositeDisposable;for(let e of a)t.addEventListener(e,n,r),i.Add(C3.New(C3.Disposable,()=>t.removeEventListener(e,n,r)));return i}return t.addEventListener(a,n,r),C3.New(C3.Disposable,()=>t.removeEventListener(a,n,r))}},C3.StubDisposable=class extends C3.Disposable{SetAction(e){this._disposeAction=e}},C3.CompositeDisposable=class extends C3.Disposable{constructor(...e){super(),this._disposables=new Set;for(let t of e)this.Add(t)}Add(...e){if(this._disposed)throw new Error('already disposed');for(let t of e)this._disposables.add(t)}Remove(e){if(this._disposed)throw new Error('already disposed');this._disposables.delete(e)}RemoveAll(){if(this._disposed)throw new Error('already disposed');if(this._disposables){for(let e of this._disposables)e.Dispose();this._disposables.clear()}}IsDisposed(){return this._disposed}Dispose(){if(this._disposed)throw new Error('already disposed');this._disposed=!0;for(let e of this._disposables)e.Dispose();this._disposables.clear(),this._disposables=null}Release(){this.Dispose()}},'use strict',C3.KahanSum=class extends C3.DefendedBase{constructor(){super(),this._c=0,this._y=0,this._t=0,this._sum=0}Add(e){e=+e,this._y=e-this._c,this._t=this._sum+this._y,this._c=this._t-this._sum-this._y,this._sum=this._t}Subtract(e){this._sum-=+e}Get(){return this._sum}Reset(){this._c=0,this._y=0,this._t=0,this._sum=0}Set(e){this._c=0,this._y=0,this._t=0,this._sum=+e}Release(){}},'use strict';{const t={};t.RBnode=function(e){this.tree=e,this.right=this.tree.sentinel,this.left=this.tree.sentinel,this.parent=null,this.color=!1,this.key=null},t.RedBlackSet=function(e){this.size=0,this.sentinel=new t.RBnode(this),this.sentinel.color=!1,this.root=this.sentinel,this.root.parent=this.sentinel,this.compare=e||this.default_compare},t.RedBlackSet.prototype.default_compare=function(e,t){return ethis.compare(n.key,i.key)?i.left:i.right;n.parent=r,r==this.sentinel?this.root=n:0>this.compare(n.key,r.key)?r.left=n:r.right=n,n.left=this.sentinel,n.right=this.sentinel,n.color=!0,this.insertFixup(n),this.size++}else{var s=this.get_(a);s.key=a}},t.RedBlackSet.prototype.insertFixup=function(e){for(;e!=this.sentinel&&e!=this.root&&!0==e.parent.color;)if(e.parent==e.parent.parent.left){var t=e.parent.parent.right;!0==t.color?(e.parent.color=!1,t.color=!1,e.parent.parent.color=!0,e=e.parent.parent):(e==e.parent.right&&(e=e.parent,this.leftRotate(e)),e.parent.color=!1,e.parent.parent.color=!0,e.parent.parent!=this.sentinel&&this.rightRotate(e.parent.parent))}else{var t=e.parent.parent.left;!0==t.color?(e.parent.color=!1,t.color=!1,e.parent.parent.color=!0,e=e.parent.parent):(e==e.parent.left&&(e=e.parent,this.rightRotate(e)),e.parent.color=!1,e.parent.parent.color=!0,e.parent.parent!=this.sentinel&&this.leftRotate(e.parent.parent))}this.root.color=!1},t.RedBlackSet.prototype.delete_=function(e){var t,a;t=e.left==this.sentinel||e.right==this.sentinel?e:this.successor_(e),a=t.left==this.sentinel?t.right:t.left,a.parent=t.parent,t.parent==this.sentinel?this.root=a:t==t.parent.left?t.parent.left=a:t.parent.right=a,t!=e&&(e.key=t.key),!1==t.color&&this.deleteFixup(a),this.size--},t.RedBlackSet.prototype.deleteFixup=function(e){for(;e!=this.root&&!1==e.color;)if(e==e.parent.left){var t=e.parent.right;!0==t.color&&(t.color=!1,e.parent.color=!0,this.leftRotate(e.parent),t=e.parent.right),!1==t.left.color&&!1==t.right.color?(t.color=!0,e=e.parent):(!1==t.right.color&&(t.left.color=!1,t.color=!0,this.rightRotate(t),t=e.parent.right),t.color=e.parent.color,e.parent.color=!1,t.right.color=!1,this.leftRotate(e.parent),e=this.root)}else{var t=e.parent.left;!0==t.color&&(t.color=!1,e.parent.color=!0,this.rightRotate(e.parent),t=e.parent.left),!1==t.right.color&&!1==t.left.color?(t.color=!0,e=e.parent):(!1==t.left.color&&(t.right.color=!1,t.color=!0,this.leftRotate(t),t=e.parent.left),t.color=e.parent.color,e.parent.color=!1,t.left.color=!1,this.rightRotate(e.parent),e=this.root)}e.color=!1},t.RedBlackSet.prototype.remove=function(e){var t=this.get_(e);if(t!=this.sentinel){var a=t.key;return this.delete_(t),a}return null},t.RedBlackSet.prototype.removeSwapped=function(e,t){this.remove(t)},t.RedBlackSet.prototype.min=function(e){for(;e.left!=this.sentinel;)e=e.left;return e},t.RedBlackSet.prototype.max=function(e){for(;e.right!=this.sentinel;)e=e.right;return e},t.RedBlackSet.prototype.successor_=function(e){if(e.right!=this.sentinel)return this.min(e.right);for(var t=e.parent;t!=this.sentinel&&e==t.right;)e=t,t=t.parent;return t},t.RedBlackSet.prototype.predeccessor_=function(e){if(e.left!=this.sentinel)return this.max(e.left);for(var t=e.parent;t!=this.sentinel&&e==t.left;)e=t,t=t.parent;return t},t.RedBlackSet.prototype.successor=function(e){if(0this.compare(e,t.key)?t.left:t.right;return t},t.RedBlackSet.prototype.contains=function(e){return null!=this.get_(e).key},t.RedBlackSet.prototype.getValues=function(){var e=[];return this.forEach(function(t){e.push(t)}),e},t.RedBlackSet.prototype.insertAll=function(a){if('array'==t.typeOf(a))for(var n=0;nn)return!1;var r=0;if(this.isEmpty())return!0;for(var i=this.min(this.root);i!=this.sentinel;i=this.successor_(i))t.contains.call(a,a,i.key)&&r++;return r==this.getCount()},t.RedBlackSet.prototype.intersection=function(e){var a=new t.RedBlackSet(this.compare);if(this.isEmpty())return a;for(var n=this.min(this.root);n!=this.sentinel;n=this.successor_(n))e.contains.call(e,n.key,n.key,this)&&a.insert(n.key);return a},C3.RedBlackSet=class extends C3.DefendedBase{constructor(e){super(),this._rbSet=new t.RedBlackSet(e),this._enableQueue=!1,this._queueInsert=new Set}Add(e){this._enableQueue?!this._rbSet.contains(e)&&this._queueInsert.add(e):this._rbSet.insert(e)}Remove(e){this._rbSet.remove(e),this._enableQueue&&this._queueInsert.delete(e)}Has(e){return this._rbSet.contains(e)||this._enableQueue&&this._queueInsert.has(e)}Clear(){this._rbSet.clear(),this._queueInsert.clear()}toArray(){if(this._enableQueue)throw new Error('cannot be used in queueing mode');return this._rbSet.getValues()}GetSize(){return this._rbSet.getCount()+this._queueInsert.size}IsEmpty(){return this._rbSet.isEmpty()&&0===this._queueInsert.size}Front(){if(this.IsEmpty())throw new Error('empty set');if(this._enableQueue)throw new Error('cannot be used in queueing mode');const e=this._rbSet,t=e.min(e.root);return t.key}Shift(){if(this.IsEmpty())throw new Error('empty set');if(this._enableQueue)throw new Error('cannot be used in queueing mode');const e=this.Front();return this.Remove(e),e}SetQueueingEnabled(e){if((e=!!e,this._enableQueue!==e)&&(this._enableQueue=e,!e)){for(const e of this._queueInsert)this._rbSet.insert(e);this._queueInsert.clear()}}ForEach(e){this._rbSet.forEach(e)}*values(){if(!this.IsEmpty()){const e=this._rbSet;for(let t=e.min(e.root);t!=e.sentinel;t=e.successor_(t))yield t.key}}[Symbol.iterator](){return this.values()}}}'use strict',C3.PromiseThrottle=class{constructor(e=C3.hardwareConcurrency){this._maxParallel=e,this._queue=[],this._activeCount=0}Add(e){return new Promise((t,a)=>{this._queue.push({func:e,resolve:t,reject:a}),this._MaybeStartNext()})}_FindInQueue(e){for(let t=0,a=this._queue.length;t=this._maxParallel)return;this._activeCount++;const e=this._queue.shift();e.func().then(t=>{e.resolve(t),this._activeCount--,this._MaybeStartNext()}).catch(t=>{e.reject(t),this._activeCount--,this._MaybeStartNext()})}static async Batch(t,n){const r=[];let i=!1;const s=async()=>{for(let e;e=n.pop();){if(i)return;try{r.push((await e()))}catch(e){throw i=!0,e}}},e=[];for(;t--;)e.push(s());return await Promise.all(e),r}},'use strict',C3.RateLimiter=class{constructor(e,t,a){this._callback=e,this._interval=t,this._intervalOnBattery=a||2*t,this._timerId=-1,this._lastCallTime=-Infinity,this._timerCallFunc=()=>this._OnTimer(),this._ignoreReset=!1,this._canRunImmediate=!1,this._callbackArguments=null}SetCanRunImmediate(e){this._canRunImmediate=!!e}_GetInterval(){return'undefined'!=typeof C3.Battery&&C3.Battery.IsOnBatteryPower()?this._intervalOnBattery:this._interval}Call(...e){if(-1===this._timerId){this._callbackArguments=e;let t=C3.FastGetDateNow(),a=t-this._lastCallTime,n=this._GetInterval();a>=n&&this._canRunImmediate?(this._lastCallTime=t,this._RunCallback()):this._timerId=self.setTimeout(this._timerCallFunc,Math.max(n-a,4))}}_RunCallback(){this._ignoreReset=!0;const e=this._callbackArguments;this._callbackArguments=null,e?this._callback(...e):this._callback(),this._ignoreReset=!1}Reset(){this._ignoreReset||(this._CancelTimer(),this._callbackArguments=null,this._lastCallTime=C3.FastGetDateNow())}_OnTimer(){this._timerId=-1,this._lastCallTime=C3.FastGetDateNow(),this._RunCallback()}_CancelTimer(){-1!==this._timerId&&(self.clearTimeout(this._timerId),this._timerId=-1)}Release(){this._CancelTimer(),this._callback=null,this._callbackArguments=null,this._timerCallFunc=null}},'use strict',C3.SVGRasterManager=class{constructor(){this._images=new Map,this._allowNpotSurfaces=!1,this._getBaseSizeCallback=null,this._rasterAtSizeCallback=null,this._releaseResultCallback=null,this._redrawCallback=null}SetNpotSurfaceAllowed(e){this._allowNpotSurfaces=!!e}IsNpotSurfaceAllowed(){return this._allowNpotSurfaces}SetGetBaseSizeCallback(e){this._getBaseSizeCallback=e}GetBaseSize(e){if(!this._getBaseSizeCallback)throw new Error('no get base size callback set');return this._getBaseSizeCallback(e)}SetRasterAtSizeCallback(e){this._rasterAtSizeCallback=e}RasterAtSize(t,a,n,r,i,e){if(!this._rasterAtSizeCallback)throw new Error('no raster at size callback set');return this._rasterAtSizeCallback(t,a,n,r,i,e)}SetReleaseResultCallback(e){this._releaseResultCallback=e}ReleaseResult(e){if(!this._releaseResultCallback)throw new Error('no release result callback set');this._releaseResultCallback(e)}SetRedrawCallback(e){this._redrawCallback=e}Redraw(){if(!this._redrawCallback)throw new Error('no redraw callback set');this._redrawCallback()}AddImage(e){let t=this._images.get(e);return t||(t=C3.New(C3.SVGRasterImage,this,e),this._images.set(e,t)),t.IncReference(),t}_RemoveImage(e){this._images.delete(e.GetDataSource())}},'use strict';{const t=2048;C3.SVGRasterImage=class{constructor(e,t){this._manager=e,this._dataSource=t,this._refCount=0,this._baseWidth=0,this._baseHeight=0,this._getBaseSizePromise=this._manager.GetBaseSize(t).then(e=>{this._baseWidth=e[0],this._baseHeight=e[1],this._manager.Redraw()}).catch(e=>{console.error('[SVG] Error loading SVG: ',e),this._hadError=!0,this._manager.Redraw()}),this._rasterSurfaceWidth=0,this._rasterSurfaceHeight=0,this._rasterImageWidth=0,this._rasterImageHeight=0,this._isRasterizing=!1,this._rasterizedResult=null,this._forceRaster=!1,this._hadError=!1}Release(){if(0>=this._refCount)throw new Error('already released');this._refCount--,0===this._refCount&&this._Release()}_Release(){this._rasterizedResult&&(this._manager.ReleaseResult(this._rasterizedResult),this._rasterizedResult=null),this._manager._RemoveImage(this),this._manager=null}GetDataSource(){return this._dataSource}IncReference(){this._refCount++}HasReferences(){return 0t){const n=t/u;r*=n,s*=n,l=a(e(l*n),t),_=a(e(_*n),t)}if(re?(r=_*e,s=_):(r=l,s=l/e)}if(this._manager.IsNpotSurfaceAllowed()&&(l=e(r),_=e(s)),!(l<=this._rasterSurfaceWidth&&_<=this._rasterSurfaceHeight&&!this._forceRaster)){this._isRasterizing=!0,this._rasterSurfaceWidth=l,this._rasterSurfaceHeight=_;const e=await this._manager.RasterAtSize(this._dataSource,n,this._rasterSurfaceWidth,this._rasterSurfaceHeight,r,s);this._rasterizedResult&&this._manager.ReleaseResult(this._rasterizedResult),this._rasterizedResult=e,this._rasterImageWidth=r,this._rasterImageHeight=s,this._isRasterizing=!1,this._forceRaster=!1,this._manager.Redraw()}}WhenBaseSizeReady(){return this._getBaseSizePromise}GetBaseWidth(){return this._baseWidth}GetBaseHeight(){return this._baseHeight}GetRasterWidth(){return this._rasterImageWidth}GetRasterHeight(){return this._rasterImageHeight}HadError(){return this._hadError}}}{function t(e){return l.get(e)}C3.UTF8_BOM='\uFEFF';const n=new Set([...'0123456789']);C3.IsNumericChar=function(e){return n.has(e)};const r=new Set([...' \t\n\r\xA0\x85\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2028\u2029\u202F\u205F\u3000']);C3.IsWhitespaceChar=function(e){return r.has(e)},C3.FilterWhitespace=function(e){return[...e].filter(e=>!C3.IsWhitespaceChar(e)).join('')},C3.IsStringAllWhitespace=function(e){for(const t of e)if(!C3.IsWhitespaceChar(t))return!1;return!0},C3.IsUnprintableChar=function(e){return 1===e.length&&32>e.charCodeAt(0)},C3.FilterUnprintableChars=function(e){return[...e].filter(e=>!C3.IsUnprintableChar(e)).join('')};const s=new Set([...'0123456789.+-e']);C3.IsStringNumber=function(e){if(e=e.trim(),!e.length)return!1;let t=e.charAt(0);if('-'!==t&&!n.has(t))return!1;for(let t of e)if(!s.has(t))return!1;return!0},C3.RemoveTrailingDigits=function(e){let t=e.length;for(;0','>'],['"','"'],['\'',''']]),e=/[&<>"']/g;C3.EscapeHTML=function(a){return a.replace(e,t)},C3.EscapeJS=function(e){let t=C3.ReplaceAll(e,'\\','\\\\');return t=C3.ReplaceAll(t,'"','\\"'),t=C3.ReplaceAll(t,'\t','\\t'),t=C3.ReplaceAll(t,'\r',''),C3.ReplaceAll(t,'\n','\\n')},C3.EscapeXML=function(e){let t=C3.ReplaceAll(e,'&','&');return t=C3.ReplaceAll(t,'<','<'),t=C3.ReplaceAll(t,'>','>'),C3.ReplaceAll(t,'"','"')};const _=/[-[\]{}()*+?.,\\^$|#\s]/g;C3.EscapeRegex=function(e){return e.replace(_,'\\$&')},C3.FindAll=function(t,n,r=!1){if(!n)return[];r||(t=t.toLowerCase(),n=n.toLowerCase());const i=n.length;let s=0,l=0,_=[];for(;-1<(l=t.indexOf(n,s));)_.push(l),s=l+i;return _},C3.ReplaceAll=function(e,t,a){return e.replace(new RegExp(C3.EscapeRegex(t),'g'),()=>a)},C3.ReplaceAllCaseInsensitive=function(e,t,a){return e.replace(new RegExp(C3.EscapeRegex(t),'gi'),()=>a)},C3.SetElementContent=function(e,t){'string'==typeof t?e.textContent=t:t.isPlainText()?e.textContent=t.toString():(e.innerHTML=t.toHTML(),t instanceof C3.BBString&&t.attachLinkHandlers(e))},C3.StringLikeEquals=function(e,t){return e instanceof C3.HtmlString||e instanceof C3.BBString?e.equals(t):t instanceof C3.HtmlString||t instanceof C3.BBString?t.equals(e):e===t},C3.StringSubstitute=function(t,...a){let n=t;for(let r=0,i=a.length;rn?1:ae){let t=e/u;return t=10>t?a(10*t)/10:a(t),langSub(n+'kilobytes',t)}if(1073741824>e){let t=e/1048576;return t=10>t?a(10*t)/10:a(t),langSub(n+'megabytes',t)}if(1099511627776>e){let t=e/1073741824;return t=10>t?a(10*t)/10:a(t),langSub(n+'gigabytes',t)}else{let t=e/1099511627776;return t=10>t?a(10*t)/10:a(t),langSub(n+'terabytes',t)}};const g={approximate:!1,days:!0,hours:!0,minutes:!0,seconds:!0};C3.FormatTime=function(t,n){var r=Math.floor;n=Object.assign({},g,n),C3.Lang.PushContext('common.time');const i=[];if(n.days){const e=r(t/86400);0t?'-':'';t=Math.abs(t);let i=t.toString(),s=n-i.length;for(let e=0;ee.toUpperCase())},C3.CompareVersionStrings=function(e,t){let n=e.split('.').map(e=>e.trim()),r=t.split('.').map(e=>e.trim());C3.resizeArray(n,4,'0'),C3.resizeArray(r,4,'0'),n=n.map(e=>parseInt(e,10)),r=r.map(e=>parseInt(e,10));for(let i=0;4>i;++i){const e=n[i]-r[i];if(0!=e)return 0>e?-1:1}return 0},C3.CreateGUID=function(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,e=>{const t=Math.floor(16*Math.random()),a='x'===e?t:8|3&t;return a.toString(16)})},C3.StringHammingDistance=function(t,n){if(t.length!==n.length)throw new Error('strings must be same length');let a=0;for(let r=0,i=t.length;rn.length&&(s=t,t=n,n=s),m=Array(t.length+1),l=0;l<=t.length;l++)m[l]=l;for(l=1;l<=n.length;l++){for(u=l,_=1;_<=t.length;_++)p=n[l-1]===t[_-1]?m[_-1]:r(m[_-1]+1,r(u+1,m[_]+1)),m[_-1]=u,u=p;m[t.length]=u}return m[t.length]}}{function t(t,r,s){const l=n.get(s);if(!l)return'class'===s?r?'':``:t;if('string'!=typeof l){if(Array.isArray(l)){let e=l[0],t=l[1];return r?'':`<${e} class="${t}">`}}else if('a'===l&&!r){const e=parseInt(s.substring(1),10)-1;if(0>e||e>=i.length)throw new Error('invalid bbcode link substitution');const t=i[e];if('string'==typeof t)return``;if('function'==typeof t)return``;throw new TypeError('invalid bbcode link action')}else return'<'+r+l+'>'}const n=new Map([['b','strong'],['i','em'],['s','s'],['u','u'],['sub','sub'],['sup','sup'],['small','small'],['mark','mark'],['a1','a'],['a2','a'],['a3','a'],['a4','a'],['a5','a'],['a6','a'],['a7','a'],['a8','a'],['a9','a'],['bad',['span','bbCodeBad']],['good',['span','bbCodeGood']],['info',['span','bbCodeInfo']],['h1',['span','bbCodeH1']],['h2',['span','bbCodeH2']],['h3',['span','bbCodeH3']],['h4',['span','bbCodeH4']],['item',['span','bbCodeItem']]]),a=/\[(\/?)([a-zA-Z0-9]+)\]/g,r=/\[(\/?)(.*?)\]/g;let i=null,e=0;const s=/\n/g;C3.BBString=class{constructor(e,t){if(this._bbstr=t&&t.noEscape?e:C3.EscapeHTML(e),this._htmlstr='',this._convertLineBreaks=!1,this._linkActions=[],t&&(this._convertLineBreaks=!!t.convertLineBreaks,t.links)){if(9')),this._htmlstr=n}return this._htmlstr}attachLinkHandlers(e){if(this._linkActions.length)for(let t=0,a=this._linkActions.length;tr)return;if(1===t.length){const e=t[0],i=e.text,l=e.styles;if(100>=i.length&&!i.includes('\n')){let{width:e,height:t}=n(i,l);if(e+=s,e<=r)return void this._AddLine([{text:i,styles:l,width:e,height:t}],e,t)}}let e;if('word'===i)e=this._TokeniseWords(t);else{e=[];for(const n of t)C3.appendArray(e,[...n.text].map(e=>[{text:e,styles:n.styles}]))}this._WrapText(e,n,r,s)}_TokeniseWords(t){const n=[];let r=[],i=!1;for(const s of t){const t=s.text,l=s.styles;for(const s of t)if('\n'===s)0({text:e.text,styles:e.styles,width:e.width,height:e.height}))}_AddWordToLine(e,t){const a=e.length?e[e.length-1]:null;let n=0;a&&t[0].styles===a.styles&&(a.text+=t[0].text,a.width=-1,a.height=-1,n=1);for(let a=t.length;n=r))s=t,l=d,_=i;else if(0=this._width||0>=this._height)throw new Error('invalid texture data size');if(d.isSvg){const e=C3.CreateCanvas(this._width,this._height),t=e.getContext('2d');t.drawImage(n,0,0,this._width,this._height),n=e}const u=C3.isPOT(this._width)&&C3.isPOT(this._height),i=this._renderer.GetMaxTextureSize();if(this._width>i||this._height>i)throw new Error('texture data exceeds maximum texture size');const c=this._renderer.GetContext(),g=this._renderer.GetWebGLVersionNumber();this._texture=c.createTexture(),c.bindTexture(c.TEXTURE_2D,this._texture),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d.premultiplyAlpha);const l=t(this._pixelFormat,c);if(!this._renderer.SupportsNPOTTextures()&&!u&&this._isTiled){if(null===n)throw new Error('cannot pass null data when creating a NPOT tiled texture without NPOT support');if(n instanceof ArrayBuffer&&(n=new ImageData(new Uint8ClampedArray(n),this._width,this._height)),n instanceof ImageData){const e=C3.CreateCanvas(this._width,this._height),t=e.getContext('2d');t.putImageData(n,0,0),n=e}const e=C3.CreateCanvas(C3.nextHighestPowerOfTwo(this._width),C3.nextHighestPowerOfTwo(this._height)),t=e.getContext('2d');t.imageSmoothingEnabled='nearest'!==this._sampling,t.drawImage(n,0,0,this._width,this._height,0,0,e.width,e.height),c.texImage2D(c.TEXTURE_2D,0,l.internalformat,l.format,l.type,e)}else if(2<=g){let e;e=this._isMipMapped?Math.floor(Math.log2(Math.max(this._width,this._height))+1):1,c.texStorage2D(c.TEXTURE_2D,e,l.sizedinternalformat,this._width,this._height),n instanceof ArrayBuffer?c.texSubImage2D(c.TEXTURE_2D,0,0,0,this._width,this._height,l.format,l.type,new Uint8Array(n)):null!==n&&c.texSubImage2D(c.TEXTURE_2D,0,0,0,l.format,l.type,n)}else n instanceof ArrayBuffer?c.texImage2D(c.TEXTURE_2D,0,l.internalformat,this._width,this._height,0,l.format,l.type,new Uint8Array(n)):null===n?c.texImage2D(c.TEXTURE_2D,0,l.internalformat,this._width,this._height,0,l.format,l.type,null):c.texImage2D(c.TEXTURE_2D,0,l.internalformat,l.format,l.type,n);null!==n&&this._SetTextureParameters(c),c.bindTexture(c.TEXTURE_2D,null),this._renderer._ResetLastTexture(),this._refCount=1,e.add(this)}_CreateDynamic(d,u,c){var g=Math.floor;if(c=Object.assign({},_,c),this._texture)throw new Error('already created texture');if(this._isTiled=!!c.isTiled,this._tileType=c.tileType,this._sampling=c.sampling,this._pixelFormat=c.pixelFormat,this._isMipMapped=!!c.mipMap,this._mipMapQuality=c.mipMapQuality,!r.has(this._sampling))throw new Error('invalid sampling');if(!a.has(this._pixelFormat))throw new Error('invalid pixel format');if(!s.has(this._mipMapQuality))throw new Error('invalid mipmap quality');this._isStatic=!1,this._width=g(d),this._height=g(u);const h=C3.isPOT(this._width)&&C3.isPOT(this._height),f=this._renderer.GetMaxTextureSize();if(0>=this._width||0>=this._height)throw new Error('invalid texture size');if(this._width>f||this._height>f)throw new Error('texture exceeds maximum texture size');if(!this._renderer.SupportsNPOTTextures()&&this._isTiled&&!h)throw new Error('non-power-of-two tiled textures not supported');const l=this._renderer.GetContext(),m=this._renderer.GetWebGLVersionNumber();this._texture=l.createTexture(),l.bindTexture(l.TEXTURE_2D,this._texture),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c.premultiplyAlpha);const n=t(this._pixelFormat,l),y=2<=m?n.sizedinternalformat:n.internalformat;l.texImage2D(l.TEXTURE_2D,0,y,this._width,this._height,0,n.format,n.type,null),this._SetTextureParameters(l),l.bindTexture(l.TEXTURE_2D,null),this._renderer._ResetLastTexture(),this._refCount=1,e.add(this)}_GetMipMapHint(e){if('default'===this._mipMapQuality)return this._isStatic?e.NICEST:e.FASTEST;if('low'===this._mipMapQuality)return e.FASTEST;if('high'===this._mipMapQuality)return e.NICEST;throw new Error('invalid mipmap quality')}_SetTextureParameters(e){const t=C3.isPOT(this._width)&&C3.isPOT(this._height);if(!this._isTiled)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);else if('repeat-x'===this._tileType)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);else if('repeat-y'===this._tileType)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT);else if('repeat'===this._tileType)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT);else throw new Error('invalid tile type');if('nearest'===this._sampling)e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),this._isMipMapped=!1;else if(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),(t||this._renderer.SupportsNPOTTextures())&&this._isMipMapped){e.hint(e.GENERATE_MIPMAP_HINT,this._GetMipMapHint(e)),e.generateMipmap(e.TEXTURE_2D);const t='trilinear'===this._sampling&&!this._renderer.HasMajorPerformanceCaveat();e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.LINEAR_MIPMAP_NEAREST)}else e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),this._isMipMapped=!1}_Update(r,a){if(('undefined'==typeof HTMLImageElement||!(r instanceof HTMLImageElement))&&('undefined'==typeof HTMLVideoElement||!(r instanceof HTMLVideoElement))&&('undefined'==typeof HTMLCanvasElement||!(r instanceof HTMLCanvasElement))&&('undefined'==typeof ImageBitmap||!(r instanceof ImageBitmap))&&('undefined'==typeof OffscreenCanvas||!(r instanceof OffscreenCanvas))&&!(r instanceof ImageData))throw new Error('invalid texture source');if(!this._texture||0>=this._refCount)throw new Error('texture not created');if(this._isStatic)throw new Error('cannot update static texture');a=Object.assign({},n,a);const s=r.width||r.videoWidth,l=r.height||r.videoHeight,e=this._renderer.GetWebGLVersionNumber(),_=this._renderer.GetContext();_.bindTexture(_.TEXTURE_2D,this._texture),_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);const d=t(this._pixelFormat,_),i=2<=e?d.sizedinternalformat:d.internalformat;try{if(this._width===s&&this._height===l){const e=C3.isPOT(this._width)&&C3.isPOT(this._height);_.texSubImage2D(_.TEXTURE_2D,0,0,0,d.format,d.type,r),(e||this._renderer.SupportsNPOTTextures())&&this._isMipMapped&&(_.hint(_.GENERATE_MIPMAP_HINT,this._GetMipMapHint(_)),_.generateMipmap(_.TEXTURE_2D))}else{this._width=s,this._height=l;const e=C3.isPOT(this._width)&&C3.isPOT(this._height);if(!this._renderer.SupportsNPOTTextures()&&this._isTiled&&!e)throw new Error('non-power-of-two tiled textures not supported');_.texImage2D(_.TEXTURE_2D,0,i,d.format,d.type,r),(e||this._renderer.SupportsNPOTTextures())&&this._isMipMapped&&(_.hint(_.GENERATE_MIPMAP_HINT,this._GetMipMapHint(_)),_.generateMipmap(_.TEXTURE_2D))}}catch(e){console.error('Error updating WebGL texture: ',e)}_.bindTexture(_.TEXTURE_2D,null),this._renderer._ResetLastTexture()}_Delete(){if(0=this._refCount)throw new Error('no more references');this._refCount--}GetReferenceCount(){return this._refCount}GetWidth(){return this._width}GetHeight(){return this._height}IsStatic(){return this._isStatic}GetEstimatedMemoryUsage(){let e=this._width*this._height;switch(this._pixelFormat){case'rgba8':e*=4;break;case'rgb8':e*=3;break;case'rgba4':case'rgb5_a1':case'rgb565':e*=2;}return this._isMipMapped&&(e+=Math.floor(e/3)),e}static OnContextLost(){e.clear()}static allTextures(){return e.values()}}}{const t=new Set(['nearest','bilinear','trilinear']),n={sampling:'trilinear',alpha:!0,readback:!0,isDefaultSize:!0,multisampling:0},r=new Set;C3.Gfx.WebGLRenderTarget=class{constructor(e){this._renderer=e,this._frameBuffer=null,this._texture=null,this._renderBuffer=null,this._width=0,this._height=0,this._isDefaultSize=!0,this._sampling='trilinear',this._alpha=!0,this._readback=!0,this._multisampling=0}_Create(a,i,e){e=Object.assign({},n,e);const s=this._renderer.GetWebGLVersionNumber();if(this._texture||this._renderBuffer)throw new Error('already created render target');if(this._sampling=e.sampling,this._alpha=!!e.alpha,this._readback=!!e.readback,this._isDefaultSize=!!e.isDefaultSize,this._multisampling=e.multisampling,!t.has(this._sampling))throw new Error('invalid sampling');if(0s||this._readback))throw new Error('invalid use of multisampling');if(2>s&&(this._readback=!0),this._width=a,this._height=i,0>=this._width||0>=this._height)throw new Error('invalid render target size');const l=this._renderer.GetContext();if(this._frameBuffer=l.createFramebuffer(),l.bindFramebuffer(l.FRAMEBUFFER,this._frameBuffer),this._readback){this._texture=this._renderer.CreateDynamicTexture(this._width,this._height,{sampling:this._sampling,pixelFormat:this._alpha?'rgba8':'rgb8',mipMap:!1});const e=this._texture._GetTexture();l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,e,0)}else{this._renderBuffer=l.createRenderbuffer(),l.bindRenderbuffer(l.RENDERBUFFER,this._renderBuffer);const e=this._alpha?l.RGBA8:l.RGB8;if(0e&&(this._multisampling=e)}else this._multisampling=0}0===this._multisampling?l.renderbufferStorage(l.RENDERBUFFER,e,this._width,this._height):l.renderbufferStorageMultisample(l.RENDERBUFFER,this._multisampling,e,this._width,this._height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.RENDERBUFFER,this._renderBuffer),l.bindRenderbuffer(l.RENDERBUFFER,null)}l.bindFramebuffer(l.FRAMEBUFFER,null),r.add(this)}_Resize(e,t){if(this._width!==e||this._height!==t){this._width=e,this._height=t;const a=this._renderer.GetContext();a.bindFramebuffer(a.FRAMEBUFFER,this._frameBuffer),this._texture?this._texture._Update(new ImageData(this._width,this._height)):(a.bindRenderbuffer(a.RENDERBUFFER,this._renderBuffer),a.renderbufferStorage(a.RENDERBUFFER,this._alpha?a.RGBA8:a.RGB8,this._width,this._height),a.bindRenderbuffer(a.RENDERBUFFER,null)),a.bindFramebuffer(a.FRAMEBUFFER,null)}}_Delete(){if(!this._texture&&!this._renderBuffer)throw new Error('already deleted render target');r.delete(this);const e=this._renderer.GetContext();e.bindFramebuffer(e.FRAMEBUFFER,this._frameBuffer),this._texture?(e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0),this._renderer.DeleteTexture(this._texture),this._texture=null):this._renderBuffer&&(e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,null),e.deleteRenderbuffer(this._renderBuffer),this._renderBuffer=null),e.bindFramebuffer(e.FRAMEBUFFER,null),2<=this._renderer.GetWebGLVersionNumber()&&(e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null)),e.deleteFramebuffer(this._frameBuffer),this._renderer.GetBatchState().currentFramebuffer=null,this._frameBuffer=null}_GetFramebuffer(){return this._frameBuffer}GetWebGLRenderer(){return this._renderer}GetTexture(){return this._texture}IsLinearSampling(){return'nearest'!==this._sampling}HasAlpha(){return this._alpha}IsReadback(){return this._readback}GetWidth(){return this._width}GetHeight(){return this._height}IsDefaultSize(){return this._isDefaultSize}GetMultisampling(){return this._multisampling}GetOptions(){const e={sampling:this._sampling,alpha:this._alpha,readback:this._readback};return this._isDefaultSize||(e.width=this._width,e.height=this._height),e}IsCompatibleWithOptions(e){return e=Object.assign({},n,e),'nearest'!==e.sampling===this.IsLinearSampling()&&!!e.alpha===this.HasAlpha()&&!(2<=this._renderer.GetWebGLVersionNumber()&&!!e.readback!==this.IsReadback())&&('number'==typeof e.width||'number'==typeof e.height?!this.IsDefaultSize()&&this.GetWidth()===e.width&&this.GetHeight()===e.height:this.IsDefaultSize())}_GetWebGLTexture(){return this._texture?this._texture._GetTexture():null}GetEstimatedMemoryUsage(){return this._texture?this._texture.GetEstimatedMemoryUsage():this._width*this._height*(this._alpha?4:3)}static async DebugReadPixelsToBlob(e,t){const a=await e.ReadBackRenderTargetToImageData(t,!0);return await C3.ImageDataToBlob(a)}static OnContextLost(){r.clear()}static allRenderTargets(){return r.values()}static ResizeAll(e,t){for(const a of r)a.IsDefaultSize()&&a._Resize(e,t)}}}{const e=new Set(['aPos','aTex','aPoints','matP','matMV','samplerFront','samplerBack','destStart','destEnd','srcStart','srcEnd','srcOriginStart','srcOriginEnd','pixelSize','seconds','layerScale','layerAngle','layoutStart','layoutEnd','color','color2_','pointTexStart','pointTexEnd','zElevation','tileSize','tileSpacing','outlineThickness']);C3.Gfx.WebGLShaderProgram=class{static async Compile(t,a,n,r){const s=t.GetContext(),e=s.createShader(s.FRAGMENT_SHADER);s.shaderSource(e,a),s.compileShader(e);const l=s.createShader(s.VERTEX_SHADER);s.shaderSource(l,n),s.compileShader(l);const _=s.createProgram();s.attachShader(_,e),s.attachShader(_,l),s.bindAttribLocation(_,0,'aPos'),s.bindAttribLocation(_,1,'aTex'),s.bindAttribLocation(_,2,'aPoints'),s.linkProgram(_);const d=t._GetParallelShaderCompileExtension();if(d?await t._WaitForObjectReady(()=>s.getProgramParameter(_,d.COMPLETION_STATUS_KHR)):await C3.Wait(5),!s.getShaderParameter(e,s.COMPILE_STATUS)){const t=s.getShaderInfoLog(e);throw s.deleteShader(e),s.deleteShader(l),s.deleteProgram(_),new Error('Error compiling fragment shader: '+t)}if(!s.getShaderParameter(l,s.COMPILE_STATUS)){const t=s.getShaderInfoLog(l);throw s.deleteShader(e),s.deleteShader(l),s.deleteProgram(_),new Error('Error compiling vertex shader: '+t)}if(!s.getProgramParameter(_,s.LINK_STATUS)){const t=s.getProgramInfoLog(_);throw s.deleteShader(e),s.deleteShader(l),s.deleteProgram(_),new Error('Error linking shader program: '+t)}const i=C3.FilterUnprintableChars(s.getProgramInfoLog(_)||'').trim();return i&&!C3.IsStringAllWhitespace(i)&&console.info(`[WebGL] Shader program '${r}' compilation log: `,i),s.deleteShader(e),s.deleteShader(l),_}static async Create(t,a,n,r){const i=await C3.Gfx.WebGLShaderProgram.Compile(t,a.src,n,r);return new C3.Gfx.WebGLShaderProgram(t,i,a,r)}constructor(t,a,n,r){const s=t.GetContext(),e=t.GetBatchState();t.EndBatch(),s.useProgram(a),this._gl=s,this._renderer=t,this._name=r,this._shaderProgram=a,this._isDeviceTransform=''===r;const l=s.getAttribLocation(a,'aPos'),_=s.getAttribLocation(a,'aTex'),d=s.getAttribLocation(a,'aPoints');-1!==l&&(s.bindBuffer(s.ARRAY_BUFFER,t._vertexBuffer),s.vertexAttribPointer(l,t.GetNumVertexComponents(),s.FLOAT,!1,0,0),s.enableVertexAttribArray(l)),-1!==_&&(s.bindBuffer(s.ARRAY_BUFFER,t._texcoordBuffer),s.vertexAttribPointer(_,2,s.FLOAT,!1,0,0),s.enableVertexAttribArray(_)),-1!==d&&(s.bindBuffer(s.ARRAY_BUFFER,t._pointBuffer),s.vertexAttribPointer(d,4,s.FLOAT,!1,0,0),s.enableVertexAttribArray(d)),s.bindBuffer(s.ARRAY_BUFFER,null),this._uMatP=new C3.Gfx.WebGLShaderUniform(this,'matP','mat4'),this._uMatMV=new C3.Gfx.WebGLShaderUniform(this,'matMV','mat4'),this._uColor=new C3.Gfx.WebGLShaderUniform(this,'color','vec4'),this._uSamplerFront=new C3.Gfx.WebGLShaderUniform(this,'samplerFront','sampler'),this._uPointTexStart=new C3.Gfx.WebGLShaderUniform(this,'pointTexStart','vec2'),this._uPointTexEnd=new C3.Gfx.WebGLShaderUniform(this,'pointTexEnd','vec2'),this._uZElevation=new C3.Gfx.WebGLShaderUniform(this,'zElevation','float'),this._uTileSize=new C3.Gfx.WebGLShaderUniform(this,'tileSize','vec2'),this._uTileSpacing=new C3.Gfx.WebGLShaderUniform(this,'tileSpacing','vec2'),this._uColor2=new C3.Gfx.WebGLShaderUniform(this,'color2_','vec4'),this._uOutlineThickness=new C3.Gfx.WebGLShaderUniform(this,'outlineThickness','float'),this._uSamplerBack=new C3.Gfx.WebGLShaderUniform(this,'samplerBack','sampler'),this._uDestStart=new C3.Gfx.WebGLShaderUniform(this,'destStart','vec2'),this._uDestEnd=new C3.Gfx.WebGLShaderUniform(this,'destEnd','vec2'),this._uSrcStart=new C3.Gfx.WebGLShaderUniform(this,'srcStart','vec2'),this._uSrcEnd=new C3.Gfx.WebGLShaderUniform(this,'srcEnd','vec2'),this._uSrcOriginStart=new C3.Gfx.WebGLShaderUniform(this,'srcOriginStart','vec2'),this._uSrcOriginEnd=new C3.Gfx.WebGLShaderUniform(this,'srcOriginEnd','vec2'),this._uPixelSize=new C3.Gfx.WebGLShaderUniform(this,'pixelSize','vec2'),this._uSeconds=new C3.Gfx.WebGLShaderUniform(this,'seconds','float'),this._uLayerScale=new C3.Gfx.WebGLShaderUniform(this,'layerScale','float'),this._uLayerAngle=new C3.Gfx.WebGLShaderUniform(this,'layerAngle','float'),this._uLayoutStart=new C3.Gfx.WebGLShaderUniform(this,'layoutStart','vec2'),this._uLayoutEnd=new C3.Gfx.WebGLShaderUniform(this,'layoutEnd','vec2'),this._hasAnyOptionalUniforms=!!(this._uPixelSize.IsUsed()||this._uSeconds.IsUsed()||this._uSamplerBack.IsUsed()||this._uDestStart.IsUsed()||this._uDestEnd.IsUsed()||this._uSrcStart.IsUsed()||this._uSrcEnd.IsUsed()||this._uSrcOriginStart.IsUsed()||this._uSrcOriginEnd.IsUsed()||this._uLayerScale.IsUsed()||this._uLayerAngle.IsUsed()||this._uLayoutStart.IsUsed()||this._uLayoutEnd.IsUsed()),this._extendBoxHorizontal=n.extendBoxHorizontal||0,this._extendBoxVertical=n.extendBoxVertical||0,this._crossSampling=!!n.crossSampling,this._mustPreDraw=!!n.mustPreDraw,this._preservesOpaqueness=!!n.preservesOpaqueness,this._animated=!!n.animated;const i=n.parameters||[];this._uCustomParameters=[],this._usesDest=this._uDestStart.IsUsed()||this._uDestEnd.IsUsed(),this._usesAnySrcRectOrPixelSize=this._uPixelSize.IsUsed()||this._uSrcStart.IsUsed()||this._uSrcEnd.IsUsed()||this._uSrcOriginStart.IsUsed()||this._uSrcOriginEnd.IsUsed(),this._needsPostDrawOrExtendBox=this._crossSampling||this._usesDest||0!==this._extendBoxHorizontal||0!==this._extendBoxVertical,this._hasCurrentMatP=!1,this._hasCurrentMatMV=!1,this._uColor.Init4f(1,1,1,1),this._uColor2.Init4f(1,1,1,1),this._uSamplerFront.Init1i(0),this._uSamplerBack.Init1i(1),this._uPointTexStart.Init2f(0,0),this._uPointTexEnd.Init2f(1,1),this._uZElevation.Init1f(0),this._uTileSize.Init2f(0,0),this._uTileSpacing.Init2f(0,0),this._uDestStart.Init2f(0,0),this._uDestEnd.Init2f(1,1),this._uSrcStart.Init2f(0,0),this._uSrcEnd.Init2f(0,0),this._uSrcOriginStart.Init2f(0,0),this._uSrcOriginEnd.Init2f(0,0),this._uPixelSize.Init2f(0,0),this._uLayerScale.Init1f(1),this._uLayerAngle.Init1f(0),this._uSeconds.Init1f(0),this._uLayoutStart.Init2f(0,0),this._uLayoutEnd.Init2f(0,0),this._uOutlineThickness.Init1f(1);for(const s of i){const e=s[0],t=s[2],a=new C3.Gfx.WebGLShaderUniform(this,e,t);'color'===t?a.Init3f(0,0,0):a.Init1f(0),this._uCustomParameters.push(a)}this._isDeviceTransform?this._UpdateDeviceTransformUniforms(e.currentMatP):(this.UpdateMatP(e.currentMatP,!0),this.UpdateMatMV(e.currentMV,!0));const u=e.currentShader;s.useProgram(u?u._shaderProgram:null)}Release(){this._gl.deleteProgram(this._shaderProgram),this._shaderProgram=null,this._renderer._RemoveShaderProgram(this),this._gl=null,this._renderer=null}GetName(){return this._name}GetWebGLContext(){return this._gl}GetShaderProgram(){return this._shaderProgram}UsesDest(){return this._usesDest}UsesCrossSampling(){return this._crossSampling}MustPreDraw(){return this._mustPreDraw}PreservesOpaqueness(){return this._preservesOpaqueness}ExtendsBox(){return 0!==this._extendBoxHorizontal||0!==this._extendBoxVertical}GetBoxExtendHorizontal(){return this._extendBoxHorizontal}GetBoxExtendVertical(){return this._extendBoxVertical}UsesAnySrcRectOrPixelSize(){return this._usesAnySrcRectOrPixelSize}NeedsPostDrawOrExtendsBox(){return this._needsPostDrawOrExtendBox}GetParameterCount(){return this._uCustomParameters.length}GetParameterType(e){return this._uCustomParameters[e].GetType()}AreCustomParametersAlreadySetInBatch(e){for(let t=0,a=e.length;t{const t=e.font.GetName();for(const a of d)(a.IsBBCodeEnabled()||C3.equalsNoCase(a.GetFontName(),t))&&a._SetTextChanged()}),C3.Gfx.WebGLText=class{constructor(e,t){t=Object.assign({},n,t),this._renderer=e,this._fontName='Arial',this._fontSize=16,this._lineHeight=0,this._isBold=!1,this._isItalic=!1,this._colorStr='black',this._isBBcodeEnabled=!1,this.onloadfont=null,this._alreadyLoadedFonts=new Set,this._horizontalAlign='left',this._verticalAlign='top',this._text='',this._bbString=null,this._wrappedText=C3.New(C3.WordWrap),this._wrapMode='word',this._textChanged=!1,this._isUpdating=!1,this._isAsync=!0,this._drawMaxCharCount=-1,this._drawCharCount=0,this._cssWidth=0,this._cssHeight=0,this._width=0,this._height=0,this._zoom=1,this._changed=!1,this._textCanvas=null,this._textContext=null,this._measureContext=null,this._lastCanvasWidth=-1,this._lastCanvasHeight=-1,this._lastTextCanvasFont='',this._lastMeasureCanvasFont='',this._lastTextCanvasFillStyle='',this._lastTextCanvasOpacity=1,this._lastTextCanvasLineWidth=1,this._measureTextCallback=(e,t)=>this._MeasureText(e,t),this._texture=null,this._textureWidth=0,this._textureHeight=0,this._rcTex=new C3.Rect,this._scaleFactor=1,this._needToRecreateTexture=!1,this._textureTimeout=new C3.IdleTimeout(()=>{this.ReleaseTexture(),this._SetTextCanvasSize(8,8)},t.timeout),this.ontextureupdate=null,this._wasReleased=!1,d.add(this)}Release(){this.onloadfont=null,this._alreadyLoadedFonts.clear(),this._bbString=null,this._textCanvas=null,this._textContext=null,this._measureContext=null,this._measureTextCallback=null,this._textureTimeout.Release(),this.ontextureupdate=null,this.ReleaseTexture(),this._wrappedText.Clear(),this._wrappedText=null,this._renderer=null,this._wasReleased=!0,d.delete(this)}_SetChanged(){this._changed=!0}_SetTextChanged(){this._SetChanged(),this._wrappedText.Clear(),this._textChanged=!0}SetIsAsync(e){this._isAsync=!!e}IsAsync(){return this._isAsync}SetBBCodeEnabled(e){e=!!e,this._isBBcodeEnabled===e||(this._isBBcodeEnabled=e,this._textContext&&(this._textContext.textBaseline=this._isBBcodeEnabled?'alphabetic':'top'),this._SetTextChanged())}IsBBCodeEnabled(){return this._isBBcodeEnabled}SetFontName(e){e||(e='serif'),this._fontName===e||(this._fontName=e,this._SetTextChanged())}GetFontName(){return this._fontName}SetFontSize(e){.1>e&&(e=.1),this._fontSize===e||(this._fontSize=e,this._SetTextChanged())}SetLineHeight(e){this._lineHeight===e||(this._lineHeight=e,this._SetChanged())}SetBold(e){e=!!e,this._isBold===e||(this._isBold=e,this._SetTextChanged())}SetItalic(e){e=!!e,this._isItalic===e||(this._isItalic=e,this._SetTextChanged())}SetDrawMaxCharacterCount(e){e=Math.floor(e),this._drawMaxCharCount===e||(this._drawMaxCharCount=e,this._SetChanged())}GetDrawMaxCharacterCount(){return this._drawMaxCharCount}_GetStyleTag(e,t){for(let a=e.length-1;0<=a;--a){const n=e[a];if(n.tag===t)return n}return null}_HasStyleTag(e,t){return!!this._GetStyleTag(e,t)}_GetFontString(t,a){let n='';(this._isBold||this._HasStyleTag(a,'b'))&&(n+='bold'),(this._isItalic||this._HasStyleTag(a,'i'))&&(n+=' italic');const r=this._GetStyleTag(a,'size'),i=r?parseFloat(r.param):this._fontSize;n+=t?' '+i+'pt':' '+i*this._scaleFactor*this._zoom*self.devicePixelRatio+'pt';let e=this._fontName;const s=this._GetStyleTag(a,'font');return s&&s.param&&(e=s.param,this.onloadfont&&!this._alreadyLoadedFonts.has(e)&&(this.onloadfont(e),this._alreadyLoadedFonts.add(e))),e&&(n+=' "'+e+'"'),n}SetColor(e){e instanceof C3.Color&&(e=e.getCssRgb()),this._colorStr===e||(this._colorStr=e,this._SetChanged())}SetColorRgb(e,t,a){r.setRgb(e,t,a),this.SetColor(r)}SetHorizontalAlignment(t){if(!e.has(t))throw new Error('invalid horizontal alignment');this._horizontalAlign===t||(this._horizontalAlign=t,this._SetChanged())}SetVerticalAlignment(e){if(!s.has(e))throw new Error('invalid vertical alignment');this._verticalAlign===e||(this._verticalAlign=e,this._SetChanged())}SetWordWrapMode(e){if(!l.has(e))throw new Error('invalid word wrap mode');this._wrapMode===e||(this._wrapMode=e,this._SetTextChanged())}SetText(e){this._text===e||(this._text=e,this._SetTextChanged())}SetSize(t,a,n){var r=Math.min;if('undefined'==typeof n&&(n=1),0>=t||0>=t)return;if(this._cssWidth===t&&this._cssHeight===a&&this._zoom===n)return;1===this._zoom!=(1===n)&&(this._needToRecreateTexture=!0);const s=this._cssWidth,e=this._zoom;this._cssWidth=t,this._cssHeight=a,this._zoom=n;const l=self.devicePixelRatio;this._width=this._cssWidth*this._zoom*l,this._height=this._cssHeight*this._zoom*l;const _=Math.max(this._width,this._height),d=r(this._renderer.GetMaxTextureSize(),2048);let i=1;_>d&&(i=d/_,this._width=r(this._width*i,d),this._height=r(this._height*i,d)),this._scaleFactor=i,0=this._width||0>=this._height||(this._changed=!1,this._isUpdating=!0,this._isAsync?C3.Asyncify(()=>this._DoUpdate()):this._DoUpdate())}_DoUpdate(){var e=Math.ceil;this._wasReleased||(this._SetTextCanvasSize(e(this._width),e(this._height)),this._MaybeWrapText(),this._DrawTextToCanvas(),this._UpdateTexture(),this._textureTimeout.Reset(),this._isUpdating=!1)}_SetTextCanvasSize(e,t){this._textCanvas||(this._textCanvas=C3.CreateCanvas(16,16));let a=!1;(this._lastCanvasWidth!==e||this._lastCanvasHeight!==t)&&(this._lastCanvasWidth=e,this._lastCanvasHeight=t,this._textCanvas.width=e,this._textCanvas.height=t,a=!0),this._textContext||(this._textContext=this._textCanvas.getContext('2d'),a=!0),a?(this._textContext.textBaseline=this._isBBcodeEnabled?'alphabetic':'top',this._textContext.font=this._lastTextCanvasFont,this._textContext.fillStyle=this._lastTextCanvasFillStyle,this._textContext.strokeStyle=this._lastTextCanvasFillStyle,this._textContext.globalAlpha=this._lastTextCanvasOpacity,this._textContext.lineWidth=this._lastTextCanvasLineWidth):this._textContext.clearRect(0,0,e,t)}_MaybeCreateMeasureContext(){this._measureContext||(this._measureContext=C3.CreateCanvas(16,16).getContext('2d'))}_SetMeasureFontString(e){this._lastMeasureCanvasFont===e||(this._lastMeasureCanvasFont=e,this._measureContext.font=e)}_MaybeWrapText(){this._textChanged&&(this._MaybeCreateMeasureContext(),this._isBBcodeEnabled&&(!this._bbString||this._bbString.toString()!==this._text)&&(this._bbString=new C3.BBString(this._text,{noEscape:!0})),this._wrappedText.WordWrap(this._isBBcodeEnabled?this._bbString.toFragmentList():this._text,this._measureTextCallback,this._cssWidth,this._wrapMode,0),this._textChanged=!1)}_MeasureText(n,a){this._SetMeasureFontString(this._GetFontString(!0,a));const r=this._GetStyleTag(a,'size'),i=r?parseFloat(r.param):this._fontSize;return{width:this._measureContext.measureText(n).width,height:t(i)}}_SetDrawFontString(e){this._lastTextCanvasFont===e||(this._lastTextCanvasFont=e,this._textContext.font=e)}_SetDrawCanvasColor(e){this._lastTextCanvasFillStyle===e||(this._lastTextCanvasFillStyle=e,this._textContext.fillStyle=e,this._textContext.strokeStyle=e)}_SetDrawCanvasOpacity(e){this._lastTextCanvasOpacity===e||(this._lastTextCanvasOpacity=e,this._textContext.globalAlpha=e)}_SetDrawCanvasLineWith(e){this._lastTextCanvasLineWidth===e||(this._lastTextCanvasLineWidth=e,this._textContext.lineWidth=e)}_DrawTextToCanvas(){this._drawCharCount=0;const t=this._scaleFactor*this._zoom*self.devicePixelRatio,n=(4+this._lineHeight)*t;let r=0;const i=this._wrappedText.GetLines(),s=i.reduce((e,r)=>e+r.height*t+n,0)-this._lineHeight*t;'center'===this._verticalAlign?r=Math.max(this._height/2-s/2,0):'bottom'===this._verticalAlign&&(r=this._height-s-2);for(let a=0,e=i.length;athis._height-4*t)break;}else if(0=this._height-s)break;0<=l&&this._DrawTextLine(e,r,t),this._isBBcodeEnabled||(r+=s),r+=n}}_DrawTextLine(t,a,n){let r=0;'center'===this._horizontalAlign?r=(this._width-t.width*n)/2:'right'===this._horizontalAlign&&(r=this._width-t.width*n);for(const i of t.fragments)this._DrawTextFragment(i,r,a,n,t.height),r+=i.width*n}_DrawTextFragment(t,y,S,G,s){const f=this._textContext,h=s/16;let i=t.width*G;const I=t.height*G,T=t.height/16,l=(4+this._lineHeight)*G,m=t.styles;let n=t.text;if(-1!==this._drawMaxCharCount){if(this._drawCharCount>=this._drawMaxCharCount)return;this._drawCharCount+n.length>this._drawMaxCharCount&&(n=n.substr(0,this._drawMaxCharCount-this._drawCharCount),i=this._MeasureText(n,m).width*G),this._drawCharCount+=n.length}const b=this._GetStyleTag(m,'background'),p=this._HasStyleTag(m,'u'),C=this._HasStyleTag(m,'s');if((!C3.IsStringAllWhitespace(n)||b||p||C)&&!this._HasStyleTag(m,'hide')){const e=this._GetStyleTag(m,'offsetx');y+=e?parseFloat(e.param)*G:0;const r=this._GetStyleTag(m,'offsety');S+=r?parseFloat(r.param)*G:0,b&&(this._SetDrawCanvasColor(b.param),f.fillRect(y,S-I,i,I+l));const d=this._GetStyleTag(m,'color');this._SetDrawCanvasColor(d?d.param:this._colorStr);const s=this._GetStyleTag(m,'opacity');this._SetDrawCanvasOpacity(s?parseFloat(s.param)/100:1);const t=this._HasStyleTag(m,'stroke');if(t&&this._SetDrawCanvasLineWith(T*this._scaleFactor*this._zoom),p&&a(f,t,y,S+G*h,i,G*h),C&&a(f,t,y,S-I/4,i,G*T),this._SetDrawFontString(this._GetFontString(!1,m)),_(f,t,n,y,S,i),!t){this._SetDrawCanvasLineWith(T*this._scaleFactor*this._zoom);const e=this._GetStyleTag(m,'outline');e&&(this._SetDrawCanvasColor(e.param),_(f,!0,n,y,S,i))}}}_UpdateTexture(){var e=Math.ceil;this._renderer.IsContextLost()||(this._textureWidth=e(this._width),this._textureHeight=e(this._height),this._rcTex.set(0,0,this._width/this._textureWidth,this._height/this._textureHeight),this._needToRecreateTexture&&(this.ReleaseTexture(),this._needToRecreateTexture=!1),!this._texture&&(this._texture=this._renderer.CreateDynamicTexture(this._textureWidth,this._textureHeight,{mipMap:1===this._zoom,mipMapQuality:'high'})),this._renderer.UpdateTexture(this._textCanvas,this._texture),this.ontextureupdate&&this.ontextureupdate())}GetTexRect(){return this._rcTex}ReleaseTexture(){this._texture&&(!this._renderer.IsContextLost()&&this._renderer.DeleteTexture(this._texture),this._texture=null)}static OnContextLost(){for(const e of d)e.ReleaseTexture()}static GetAll(){return d.values()}}}{class e{constructor(e){this._gl=e.GetContext(),this._version=e.GetWebGLVersionNumber(),this._timerExt=e._GetDisjointTimerQueryExtension(),this._query=null,this._isActive=!1,this._hasResult=!1,this._result=0,this._query=1===this._version?this._timerExt.createQueryEXT():this._gl.createQuery()}Release(){this._DeleteQueryObject(),this._gl=null,this._timerExt=null,this._hasResult=!1}_DeleteQueryObject(){this._query&&(1===this._version?this._timerExt.deleteQueryEXT(this._query):this._gl.deleteQuery(this._query),this._query=null)}BeginTimeElapsed(){if(this._isActive)throw new Error('query already active');1===this._version?this._timerExt.beginQueryEXT(this._timerExt.TIME_ELAPSED_EXT,this._query):this._gl.beginQuery(this._timerExt.TIME_ELAPSED_EXT,this._query),this._isActive=!0}EndTimeElapsed(){if(!this._isActive)throw new Error('query not active');1===this._version?this._timerExt.endQueryEXT(this._timerExt.TIME_ELAPSED_EXT):this._gl.endQuery(this._timerExt.TIME_ELAPSED_EXT),this._isActive=!1}CheckForResult(){if(!this._query||this._hasResult||this._isActive)return;let e=!1;e=1===this._version?this._timerExt.getQueryObjectEXT(this._query,this._timerExt.QUERY_RESULT_AVAILABLE_EXT):this._gl.getQueryParameter(this._query,this._gl.QUERY_RESULT_AVAILABLE);const t=this._gl.getParameter(this._timerExt.GPU_DISJOINT_EXT);e&&!t&&(this._result=1===this._version?this._timerExt.getQueryObjectEXT(this._query,this._timerExt.QUERY_RESULT_EXT):this._gl.getQueryParameter(this._query,this._gl.QUERY_RESULT),this._result/=1e9,this._hasResult=!0),(e||t)&&this._DeleteQueryObject()}HasResult(){return this._hasResult}GetResult(){if(!this._hasResult)throw new Error('no result available');return this._result}}C3.Gfx.WebGLTimeElapsedQuery=class{constructor(e){this._renderer=e,this._frameNumber=e.GetFrameNumber(),this._isActive=!1,this._parentQuery=null,this._isNested=!1,this._realQuery=null,this._queries=[]}Release(){for(const t of this._queries)t instanceof e&&t.Release();C3.clearArray(this._queries),this._parentQuery=null,this._realQuery=null,this._renderer=null}BeginTimeElapsed(){if(this._isActive)throw new Error('query already active');const e=this._renderer._GetTimeQueryStack();0e.HasResult())}GetResult(){return this._queries.reduce((e,t)=>e+t.GetResult(),0)}GetFrameNumber(){return this._frameNumber}}}'use strict',C3.Gfx.WebGLQueryResultBuffer=class{constructor(e,t=1e3){this._renderer=e,this._maxQueries=t,this._buffer=[],this._renderer._AddQueryResultBuffer(this)}Release(){this.Clear(),this._renderer._RemoveQueryResultBuffer(this),this._renderer=null}Clear(){for(const e of this._buffer)e.Release();C3.clearArray(this._buffer)}AddTimeElapsedQuery(){const e=new C3.Gfx.WebGLTimeElapsedQuery(this._renderer);if(this._buffer.push(e),this._buffer.length>this._maxQueries){const e=this._buffer.shift();e.Release()}return e}CheckForResults(e){for(const t of this._buffer){if(t.GetFrameNumber()>=e)return;if(t.IsNested())return;t.CheckForResult()}}GetFrameRangeResultSum(e,t){if(t<=e)return NaN;let a=0;for(const n of this._buffer){if(n.GetFrameNumber()>=t)break;if(!(n.GetFrameNumber()'],[_.GetTextureFillFragmentShaderSource(),l,''],[_.GetPointFragmentShaderSource(),_.GetPointVertexShaderSource(),''],[_.GetColorFillFragmentShaderSource(),l,''],[_.GetLinearGradientFillFragmentShaderSource(),l,''],[_.GetHardEllipseFillFragmentShaderSource(),l,''],[_.GetHardEllipseOutlineFragmentShaderSource(),l,''],[_.GetSmoothEllipseFillFragmentShaderSource(),l,''],[_.GetSmoothEllipseOutlineFragmentShaderSource(),l,''],[_.GetSmoothLineFillFragmentShaderSource(),l,''],[_.GetTilemapFragmentShaderSource(),_.GetDefaultVertexShaderSource(this._is3d,!0),'']],s=await Promise.all(g.map(t=>this.CreateShaderProgram({src:t[0]},t[1],t[2])));this._spTextureFill=s[0],this._spDeviceTransformTextureFill=s[1],this._spPoints=s[2],this._spColorFill=s[3],this._spLinearGradientFill=s[4],this._spHardEllipseFill=s[5],this._spHardEllipseOutline=s[6],this._spSmoothEllipseFill=s[7],this._spSmoothEllipseOutline=s[8],this._spSmoothLineFill=s[9],this._spTilemapFill=s[10],this._currentStateGroup=null,this.SetTextureFillMode()}FillIndexBufferData(){const a=this._indexData;for(let e=0,t=0;12e3>e;)a[e++]=t,a[e++]=t+1,a[e++]=t+2,a[e++]=t,a[e++]=t+2,a[e++]=t+3,t+=4}Is3D(){return this._is3d}GetNumVertexComponents(){return this._is3d?3:2}SetBaseZ(t){this._baseZ=t}GetBaseZ(){return this._baseZ}SetCurrentZ(t){this._currentZ=t,this._currentStateGroup=null}GetCurrentZ(){return this._currentZ}async CreateShaderProgram(n,e,t){const r=await C3.Gfx.WebGLShaderProgram.Create(this,n,e,t);return this._shaderPrograms.push(r),this._shaderProgramsByName.set(r.GetName(),r),r}GetShaderProgramByName(t){return this._shaderProgramsByName.get(t)||null}GetTextureFillShaderProgram(){return this._spTextureFill}ResetLastProgram(){this._lastProgram=null}_RemoveShaderProgram(a){const e=this._shaderPrograms.indexOf(a);-1!==e&&this._shaderPrograms.splice(e,1),this._shaderProgramsByName.delete(a.GetName())}Project(s,e,t,r,a){const i=this._matMV,n=this._matP;for(let i=0,n=S.length;i=this._lastVertexPtr&&(this.EndBatch(),a=0),1===this._topOfBatch)this._batch[this._batchPtr-1]._indexCount+=6;else{const e=this.PushBatch();e.InitQuad(this._is3d?a:3*(a/2),6),this._topOfBatch=1}}_WriteQuadToVertexBuffer(t){t.writeToTypedArray3D(this._vertexData,this._vertexPtr,this._baseZ+this._currentZ),this._vertexPtr+=12}Quad(t){this._ExtendQuadBatch(),this._WriteQuadToVertexBuffer(t),y.writeToTypedArray(this._texcoordData,this._texPtr),this._texPtr+=8}Quad2(n,e,t,r,a,i,_,l){this._ExtendQuadBatch();const c=this._vertexData;let s=this._vertexPtr;const g=this._baseZ+this._currentZ;this._is3d?(c[s++]=n,c[s++]=e,c[s++]=g,c[s++]=t,c[s++]=r,c[s++]=g,c[s++]=a,c[s++]=i,c[s++]=g,c[s++]=_,c[s++]=l,c[s++]=g):(c[s++]=n,c[s++]=e,c[s++]=t,c[s++]=r,c[s++]=a,c[s++]=i,c[s++]=_,c[s++]=l),this._vertexPtr=s,y.writeToTypedArray(this._texcoordData,this._texPtr),this._texPtr+=8}Quad3(a,e){this._ExtendQuadBatch(),this._WriteQuadToVertexBuffer(a),e.writeAsQuadToTypedArray(this._texcoordData,this._texPtr),this._texPtr+=8}Quad4(a,e){this._ExtendQuadBatch(),this._WriteQuadToVertexBuffer(a),e.writeToTypedArray(this._texcoordData,this._texPtr),this._texPtr+=8}FullscreenQuad(s,c){var t=Math.max,r=Math.min;if(mat4.copy(l,this._lastMV),vec3.copy(n,this._cam),vec3.copy(i,this._look),this._cam[0]=0,this._cam[1]=0,this._cam[2]=100*self.devicePixelRatio,this._look[0]=0,this._look[1]=0,this._look[2]=0,this.ResetModelView(),this.UpdateModelView(),this._isScissorViewport){const a=this._viewportScissorWidth/2,e=this._viewportScissorHeight/2;d.set(-a,e,-a+this._viewportScissorWidth,e-this._viewportScissorHeight),G.setFromRect(d),d.set(0,0,this._viewportScissorWidth/this._width,this._viewportScissorHeight/this._height),this.Quad3(G,d)}else if('crop'===s&&this._currentRenderTarget&&c){const a=this._width/2,e=this._height/2,i=c.GetWidth(),n=c.GetHeight(),_=this._currentRenderTarget.GetWidth(),l=this._currentRenderTarget.GetHeight(),g=r(_,i),s=r(l,n),u=t(n-l,0),p=t(l-n,0);d.set(-a,e-p,-a+g,e-s-p),G.setFromRect(d),d.set(0,u,g,s+u),d.divide(i,n),this.Quad3(G,d)}else{let[n,e]=this.GetRenderTargetSize(this._currentRenderTarget);const t=n/2,r=e/2;this.Rect2(-t,r,t,-r)}mat4.copy(this._matMV,l),vec3.copy(this._cam,n),vec3.copy(this._look,i),this.UpdateModelView()}ConvexPoly(d){const e=d.length/2;if(3>e)throw new Error('need at least 3 points');const u=e-2,c=d[0],a=d[1];for(let e=0;e=this._lineWidthStack.length)throw new Error('cannot pop last line width - check push/pop pairs');this._lineWidthStack.pop(),this._lineWidth=this._lineWidthStack[this._lineWidthStack.length-1]}SetLineCapButt(){this._lineCap=0,this._lineCapStack[this._lineCapStack.length-1]=0}SetLineCapSquare(){this._lineCap=1,this._lineCapStack[this._lineCapStack.length-1]=0}SetLineCapZag(){this._lineCap=2,this._lineCapStack[this._lineCapStack.length-1]=0}PushLineCap(t){if('butt'===t)this.PushLineCapButt();else if('square'===t)this.PushLineCapSquare();else if('zag'===t)this.PushLineCapZag();else throw new Error('invalid line cap')}PushLineCapButt(){if(100<=this._lineCapStack.length)throw new Error('pushed too many line caps - check push/pop pairs');this._lineCapStack.push(0),this._lineCap=0}PushLineCapSquare(){if(100<=this._lineCapStack.length)throw new Error('pushed too many line caps - check push/pop pairs');this._lineCapStack.push(1),this._lineCap=1}PushLineCapZag(){if(100<=this._lineCapStack.length)throw new Error('pushed too many line caps - check push/pop pairs');this._lineCapStack.push(2),this._lineCap=2}PopLineCap(){if(1>=this._lineCapStack.length)throw new Error('cannot pop last line cap - check push/pop pairs');this._lineCapStack.pop(),this._lineCap=this._lineCapStack[this._lineCapStack.length-1]}SetLineOffset(t){this._lineOffset=t,this._lineOffsetStack[this._lineOffsetStack.length-1]=t}GetLineOffset(){return this._lineOffset}PushLineOffset(t){if(100<=this._lineOffsetStack.length)throw new Error('pushed too many line offsets - check push/pop pairs');this._lineOffsetStack.push(t),this._lineOffset=t}PopLineOffset(){if(1>=this._lineOffsetStack.length)throw new Error('cannot pop last line offset - check push/pop pairs');this._lineOffsetStack.pop(),this._lineOffset=this._lineOffsetStack[this._lineOffsetStack.length-1]}SetPointTextureCoords(a){if(!this._lastPointTexCoords.equals(a)){this._lastPointTexCoords.copy(a);const e=this.PushBatch();e.InitSetPointTexCoords(a),this._topOfBatch=0}}Point(s,e,t,r){7996<=this._pointPtr&&this.EndBatch();let a=this._pointPtr;const l=this._baseZ+this._currentZ;if(2===this._topOfBatch&&this._lastPointZ===l)this._batch[this._batchPtr-1]._indexCount++;else{const t=this.PushBatch();t.InitPoints(a,l),this._topOfBatch=2,this._lastPointZ=l}const n=this._pointData;n[a++]=s,n[a++]=e,n[a++]=t,n[a++]=r,this._pointPtr=a}SetProgram(a){if(this._lastProgram!==a){const e=this.PushBatch();e.InitSetProgram(a),this._lastProgram=a,this._topOfBatch=0,this._currentStateGroup=null}}SetTextureFillMode(){this.SetProgram(this._spTextureFill)}SetDeviceTransformTextureFillMode(){this.SetProgram(this._spDeviceTransformTextureFill)}SetColorFillMode(){this.SetProgram(this._spColorFill)}SetLinearGradientFillMode(){this.SetProgram(this._spLinearGradientFill)}SetGradientColor(a){const e=this.PushBatch();e.InitSetGradientColor(a),this._topOfBatch=0}SetHardEllipseFillMode(){this.SetProgram(this._spHardEllipseFill)}SetHardEllipseOutlineMode(){this.SetProgram(this._spHardEllipseOutline)}SetSmoothEllipseFillMode(){this.SetProgram(this._spSmoothEllipseFill)}SetSmoothEllipseOutlineMode(){this.SetProgram(this._spSmoothEllipseOutline)}SetEllipseParams(n,e,t=1){const r=this.PushBatch();r.InitSetEllipseParams(n,e,t),this._topOfBatch=0}SetSmoothLineFillMode(){this.SetProgram(this._spSmoothLineFill)}SetTilemapFillMode(){this.SetProgram(this._spTilemapFill)}SetTilemapInfo(s,e,t,r,a,i,n){if(this._lastProgram!==this._spTilemapFill)throw new Error('must set tilemap fill mode first');const _=this.PushBatch();_.InitSetTilemapInfo(s,e,t,r,a,i,n),this._topOfBatch=0}SetProgramParameters(g,e,t,r,a,i,n,_,l,m,d){const h=this._lastProgram,u=h._hasAnyOptionalUniforms,s=!!d.length;if(u&&!h.AreOptionalUniformsAlreadySetInBatch(e,t,r,a,i,n,_,l,m)||s&&!h.AreCustomParametersAlreadySetInBatch(d)){const c=this.PushBatch();if(c.InitSetProgramParameters(),u){h.SetOptionalUniformsInBatch(e,t,r,a,i,n,_,l,m);const d=c._mat4param;d[0]=i,d[1]=n,e.writeToTypedArray(d,2),d[6]=_,d[7]=l,t.writeToTypedArray(d,12);const s=c._colorParam;a.writeToTypedArray(s,0);const u=s[1];s[1]=s[3],s[3]=u,r.writeToTypedArray(c._srcOriginRect,0),c._startIndex=m,c._texParam=h._uSamplerBack.IsUsed()?g?g.GetTexture():null:null}s&&(h.SetCustomParametersInBatch(d),C3.shallowAssignArray(c._shaderParams,d)),this._topOfBatch=0}}ClearRgba(n,e,t,r){const i=this.PushBatch();i.InitClearSurface2(n,e,t,r),this._topOfBatch=0}Clear(a){const e=this.PushBatch();e.InitClearSurface(a),this._topOfBatch=0}ClearRect(n,e,t,r){this.ClearRect4(n,e,t,r,0,0,0,0)}ClearRect2(t){this.ClearRect4(t.getLeft(),t.getTop(),t.width(),t.height(),0,0,0,0)}ClearRect3(a,e){this.ClearRect4(a.getLeft(),a.getTop(),a.width(),a.height(),e.getR(),e.getG(),e.getB(),e.getA())}ClearRect4(s,e,t,i,n,_,r,l){if(!(0>t||0>i)){const d=this.PushBatch();d.InitClearRect(s,e,t,i,n,_,r,l),this._topOfBatch=0}}Start(){}Finish(){this.EndBatch(),this._gl.flush(),this._frameNumber++}CheckForQueryResults(){for(const t of this._allQueryResultBuffers)t.CheckForResults(this._frameNumber)}IsContextLost(){return!this._gl||this._gl.isContextLost()||this._isInitialisingAfterContextRestored}OnContextLost(){C3.Gfx.WebGLRendererTexture.OnContextLost(),C3.Gfx.WebGLRenderTarget.OnContextLost(),C3.Gfx.WebGLText.OnContextLost();for(const t of this._allQueryResultBuffers)t.Clear();this._extensions=[],this._timerExt=null,this._parallelShaderCompileExt=null,this._unmaskedVendor='(unavailable)',this._unmaskedRenderer='(unavailable)',this._lastProgram=null,this._spTextureFill=null,this._spDeviceTransformTextureFill=null,this._spColorFill=null,this._spLinearGradientFill=null,this._spHardEllipseFill=null,this._spHardEllipseOutline=null,this._spSmoothEllipseFill=null,this._spSmoothEllipseOutline=null,this._spSmoothLineFill=null,this._spPoints=null,this._spTilemapFill=null;for(const t of this._stateGroups.values())t.OnContextLost();for(const t of this._shaderPrograms)t.Release();C3.clearArray(this._shaderPrograms),this._shaderProgramsByName.clear()}async OnContextRestored(){this._isInitialisingAfterContextRestored=!0,await this.InitState(),this._isInitialisingAfterContextRestored=!1;for(const t of this._stateGroups.values())t.OnContextRestored(this);this.SetSize(this._width,this._height,!0)}CreateStaticTexture(a,e){if(this.IsContextLost())throw new Error('context lost');this.EndBatch();const t=C3.New(C3.Gfx.WebGLRendererTexture,this);return t._CreateStatic(a,e),t}CreateStaticTextureAsync(a,n){return this.IsContextLost()?Promise.reject('context lost'):(n=Object.assign({},n),C3.Supports.ImageBitmapOptions&&(this.SupportsNPOTTextures()||!n.isTiled)?(n.premultiplyAlpha=!1,createImageBitmap(a,{premultiplyAlpha:'premultiply'}).then(t=>C3.Asyncify(()=>this.CreateStaticTexture(t,n)))):C3.Supports.ImageBitmap?createImageBitmap(a).then(t=>C3.Asyncify(()=>this.CreateStaticTexture(t,n))):a instanceof Blob?C3.BlobToImage(a,!0).then(t=>this.CreateStaticTextureAsync(t,n)):'undefined'!=typeof HTMLImageElement&&a instanceof HTMLImageElement&&'function'==typeof a.decode?a.decode().then(()=>C3.Asyncify(()=>this.CreateStaticTexture(a,n))):C3.Asyncify(()=>this.CreateStaticTexture(a,n)))}CreateDynamicTexture(n,e,t){this.EndBatch();const r=C3.New(C3.Gfx.WebGLRendererTexture,this);return r._CreateDynamic(n,e,t),r}UpdateTexture(a,e,t){this.EndBatch(),e._Update(a,t)}DeleteTexture(t){t&&(t.SubtractReference(),0=e||0>=s)throw new Error('invalid size');this.EndBatch();const _=C3.New(C3.Gfx.WebGLRenderTarget,this);return _._Create(e,s,Object.assign({isDefaultSize:l},n)),this._currentRenderTarget=null,this._batchState.currentFramebuffer=null,_}SetRenderTarget(s){if(s===this._currentRenderTarget)return;let e,l,d,u;s?(s.IsDefaultSize()&&s._Resize(this._width,this._height),d=s.GetWidth(),u=s.GetHeight(),e=d,l=u):(d=this._width,u=this._height,e=this.GetScissoredViewportWidth(),l=this.GetScissoredViewportHeight());const c=this._lastBackbufferWidth!==d||this._lastBackbufferHeight!==u;c&&this._UpdateViewportRenderer(e,l,d,u);const n=this.PushBatch();n.InitSetRenderTarget(s,c,this._matP),this._currentRenderTarget=s,this._topOfBatch=0}GetRenderTarget(){return this._currentRenderTarget}GetRenderTargetSize(t){return t?[t.GetWidth(),t.GetHeight()]:[this._width,this._height]}CopyRenderTarget(a,e='stretch'){if(2>this._version||this._currentRenderTarget&&0this._version)){const e=this.PushBatch();e.InitInvalidateFramebuffer(a._GetFramebuffer()),this._topOfBatch=0}}DeleteRenderTarget(a){this.SetRenderTarget(null),this.EndBatch();const e=a.GetTexture();e===this._lastTexture0&&(this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._lastTexture0=null),e===this._lastTexture1&&(this._gl.activeTexture(this._gl.TEXTURE1),this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._gl.activeTexture(this._gl.TEXTURE0),this._lastTexture1=null),a._Delete()}async ReadBackRenderTargetToImageData(s,e){this.EndBatch();const t=this._currentRenderTarget;let d,u,c;s?(d=s.GetWidth(),u=s.GetHeight(),c=s._GetFramebuffer()):(d=this.GetWidth(),u=this.GetHeight(),c=null);const g=this._gl;g.bindFramebuffer(g.FRAMEBUFFER,c);const _=()=>{g.bindFramebuffer(g.FRAMEBUFFER,null),this._currentRenderTarget=null,this._batchState.currentFramebuffer=null,this.SetRenderTarget(t)};let l;if(!e&&2<=this.GetWebGLVersionNumber()){g.bindFramebuffer(g.READ_FRAMEBUFFER,c);const a=g.createBuffer(),e=4*(d*u),t=g.PIXEL_PACK_BUFFER;g.bindBuffer(t,a),g.bufferData(t,e,g.STREAM_READ),g.readPixels(0,0,d,u,g.RGBA,g.UNSIGNED_BYTE,0),g.bindFramebuffer(g.READ_FRAMEBUFFER,null),g.bindBuffer(t,null),_();const n=g.fenceSync(g.SYNC_GPU_COMMANDS_COMPLETE,0);await this._WaitForObjectReady(()=>g.getSyncParameter(n,g.SYNC_STATUS)===g.SIGNALED),g.deleteSync(n),l=new ImageData(d,u),g.bindBuffer(t,a),g.getBufferSubData(t,0,new Uint8Array(l.data.buffer),0,e),g.bindBuffer(t,null),g.deleteBuffer(a)}else l=new ImageData(d,u),g.readPixels(0,0,d,u,g.RGBA,g.UNSIGNED_BYTE,new Uint8Array(l.data.buffer)),_();return l}StartQuery(a){if(this.SupportsGPUProfiling()){const e=this.PushBatch();e.InitStartQuery(a),this._topOfBatch=0}}EndQuery(a){if(this.SupportsGPUProfiling()){const e=this.PushBatch();e.InitEndQuery(a),this._topOfBatch=0}}_WaitForObjectReady(a){const e=new Promise(e=>s.add({resolve:e,checkFunc:a}));return-1===t&&(t=self.requestAnimationFrame(m)),e}IsDesynchronized(){return!!this._attribs.desynchronized}GetEstimatedBackBufferMemoryUsage(){return this._width*this._height*(this._attribs.alpha?4:3)}GetEstimatedRenderBufferMemoryUsage(){let t=0;for(const e of C3.Gfx.WebGLRenderTarget.allRenderTargets())e.GetTexture()||(t+=e.GetEstimatedMemoryUsage());return t}GetEstimatedTextureMemoryUsage(){let t=0;for(const e of C3.Gfx.WebGLRendererTexture.allTextures())t+=e.GetEstimatedMemoryUsage();return t}GetEstimatedTotalMemoryUsage(){return this.GetEstimatedBackBufferMemoryUsage()+this.GetEstimatedRenderBufferMemoryUsage()+this.GetEstimatedTextureMemoryUsage()}GetWebGLVersionString(){return this._versionString}GetWebGLVersionNumber(){return this._version}SupportsNPOTTextures(){return 2<=this.GetWebGLVersionNumber()}GetMaxTextureSize(){return this._maxTextureSize}GetMinPointSize(){return this._minPointSize}GetMaxPointSize(){return this._maxPointSize}SupportsHighP(){return 0!==this._highpPrecision}GetHighPPrecision(){return this._highpPrecision}GetUnmaskedVendor(){return this._unmaskedVendor}GetUnmaskedRenderer(){return this._unmaskedRenderer}GetExtensions(){return this._extensions}HasMajorPerformanceCaveat(){return this._hasMajorPerformanceCaveat}SupportsGPUProfiling(){return!!this._timerExt}_GetDisjointTimerQueryExtension(){return this._timerExt}_GetParallelShaderCompileExtension(){return this._parallelShaderCompileExt}_AddQueryResultBuffer(t){this._allQueryResultBuffers.add(t)}_RemoveQueryResultBuffer(t){this._allQueryResultBuffers.delete(t)}_GetTimeQueryStack(){return this._timeQueryStack}GetFrameNumber(){return this._frameNumber}IncrementFrameNumber(){this._frameNumber++}GetContext(){return this._gl}GetNamedBlend(n){const e=this._gl;let t=e.ONE,i=e.ONE_MINUS_SRC_ALPHA;switch(n){case'normal':t=e.ONE,i=e.ONE_MINUS_SRC_ALPHA;break;case'additive':t=e.ONE,i=e.ONE;break;case'copy':t=e.ONE,i=e.ZERO;break;case'destination-over':t=e.ONE_MINUS_DST_ALPHA,i=e.ONE;break;case'source-in':t=e.DST_ALPHA,i=e.ZERO;break;case'destination-in':t=e.ZERO,i=e.SRC_ALPHA;break;case'source-out':t=e.ONE_MINUS_DST_ALPHA,i=e.ZERO;break;case'destination-out':t=e.ZERO,i=e.ONE_MINUS_SRC_ALPHA;break;case'source-atop':t=e.DST_ALPHA,i=e.ONE_MINUS_SRC_ALPHA;break;case'destination-atop':t=e.ONE_MINUS_DST_ALPHA,i=e.SRC_ALPHA;break;default:throw new Error('invalid blend name');}return{srcBlend:t,destBlend:i}}_InitBlendModeTable(t){this._blendModeTable=[[t.ONE,t.ONE_MINUS_SRC_ALPHA],[t.ONE,t.ONE],[t.ONE,t.ONE_MINUS_SRC_ALPHA],[t.ONE,t.ZERO],[t.ONE_MINUS_DST_ALPHA,t.ONE],[t.DST_ALPHA,t.ZERO],[t.ZERO,t.SRC_ALPHA],[t.ONE_MINUS_DST_ALPHA,t.ZERO],[t.ZERO,t.ONE_MINUS_SRC_ALPHA],[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA]]}_GetBlendByIndex(a){const e=this._blendModeTable;if(0>a||a>=e.length)throw new RangeError('invalid blend index');return e[a]}GetSrcBlendByIndex(t){return this._GetBlendByIndex(t)[0]}GetDestBlendByIndex(t){return this._GetBlendByIndex(t)[1]}CreateWebGLText(){return C3.New(C3.Gfx.WebGLText,this)}}}{function e(e){if(!e)return'';const t=e.split('.');if(2>t.length)return'';const a=t[t.length-1].toLowerCase();return r.get(a)||''}function t(e){return new Promise((t,a)=>{const n=document.createElement('script');n.onload=t,n.onerror=a,n.async=!1,n.src=e,document.head.appendChild(n)})}const n=new Set(['local','remote']),r=new Map([['mp4','video/mp4'],['webm','video/webm'],['m4a','audio/mp4'],['mp3','audio/mpeg'],['js','application/javascript'],['wasm','application/wasm'],['svg','image/svg+xml']]);C3.AssetManager=class extends C3.DefendedBase{constructor(e,t){if(super(),!n.has(t.defaultLoadPolicy))throw new Error('invalid load policy');if(this._runtime=e,this._localUrlBlobs=new Map,this._localBlobUrlCache=new Map,this._isCordova=!!t.isCordova,this._isiOSCordova=!!t.isiOSCordova,this._supportedAudioFormats=t.supportedAudioFormats||{},this._audioFiles=new Map,this._preloadSounds=!1,this._mediaSubfolder='',this._fontsSubfolder='',this._iconsSubfolder='',this._defaultLoadPolicy=t.defaultLoadPolicy,this._allAssets=[],this._assetsByUrl=new Map,this._webFonts=[],this._loadPromises=[],this._hasFinishedInitialLoad=!1,this._totalAssetSizeToLoad=0,this._assetSizeLoaded=0,this._lastLoadProgress=0,this._hasHadErrorLoading=!1,this._loadingRateLimiter=C3.New(C3.RateLimiter,()=>this._FireLoadingProgressEvent(),50),this._promiseThrottle=new C3.PromiseThrottle(Math.max(C3.hardwareConcurrency,8)),t.localUrlBlobs)for(const[e,a]of Object.entries(t.localUrlBlobs))this._localUrlBlobs.set(e.toLowerCase(),a);this._iAssetManager=new IAssetManager(this)}Release(){this._localUrlBlobs.clear();for(const e of this._localBlobUrlCache.values())URL.revokeObjectURL(e);this._localBlobUrlCache.clear();for(const e of this._allAssets)e.Release();C3.clearArray(this._allAssets),this._assetsByUrl.clear(),C3.clearArray(this._loadPromises),this._runtime=null}GetRuntime(){return this._runtime}_SetMediaSubfolder(e){this._mediaSubfolder=e}GetMediaSubfolder(){return this._mediaSubfolder}_SetFontsSubfolder(e){this._fontsSubfolder=e}GetFontsSubfolder(){return this._fontsSubfolder}_SetIconsSubfolder(e){this._iconsSubfolder=e}GetIconsSubfolder(){return this._iconsSubfolder}_HasLocalUrlBlob(e){return this._localUrlBlobs.has(e.toLowerCase())}_GetLocalUrlBlob(e){return this._localUrlBlobs.get(e.toLowerCase())||null}GetLocalUrlAsBlobUrl(e){const t=this._GetLocalUrlBlob(e);if(!t)return e;let a=this._localBlobUrlCache.get(t);return a||(a=URL.createObjectURL(t),this._localBlobUrlCache.set(t,a)),a}FetchBlob(e,t){t=t||this._defaultLoadPolicy;const a=this._GetLocalUrlBlob(e);if(a)return Promise.resolve(a);if(C3.IsRelativeURL(e)){const a=e.toLowerCase();return this._isCordova?this.CordovaFetchLocalFileAsBlob(a):'local'===t?this._promiseThrottle.Add(()=>C3.FetchBlob(a)):C3.FetchBlob(a)}return C3.FetchBlob(e)}FetchArrayBuffer(e){const t=this._GetLocalUrlBlob(e);if(t)return C3.BlobToArrayBuffer(t);if(C3.IsRelativeURL(e)){const t=e.toLowerCase();return this._isCordova?this.CordovaFetchLocalFileAsArrayBuffer(t):'local'===this._defaultLoadPolicy?this._promiseThrottle.Add(()=>C3.FetchArrayBuffer(t)):C3.FetchArrayBuffer(t)}return C3.FetchArrayBuffer(e)}FetchText(e){const t=this._GetLocalUrlBlob(e);if(t)return C3.BlobToString(t);if(C3.IsRelativeURL(e)){const t=e.toLowerCase();return this._isCordova?this.CordovaFetchLocalFileAsText(t):'local'===this._defaultLoadPolicy?this._promiseThrottle.Add(()=>C3.FetchText(t)):C3.FetchText(t)}return C3.FetchText(e)}async FetchJson(e){const t=await this.FetchText(e);return JSON.parse(t)}_CordovaFetchLocalFileAs(e,t){return this._runtime.PostComponentMessageToDOMAsync('runtime','cordova-fetch-local-file',{filename:e,as:t})}CordovaFetchLocalFileAsText(e){return this._CordovaFetchLocalFileAs(e,'text')}async CordovaFetchLocalFileAsBlob(t){const a=await this._CordovaFetchLocalFileAs(t,'buffer'),n=e(t);return new Blob([a],{type:n})}async CordovaFetchLocalFileAsBlobURL(e){e=e.toLowerCase();let t=this._localBlobUrlCache.get(e);if(t)return t;const n=await this.CordovaFetchLocalFileAsBlob(e);return t=URL.createObjectURL(n),this._localBlobUrlCache.set(e,t),t}CordovaFetchLocalFileAsArrayBuffer(e){return this._CordovaFetchLocalFileAs(e,'buffer')}GetMediaFileUrl(e){return this._HasLocalUrlBlob(e)?this.GetLocalUrlAsBlobUrl(e):this._mediaSubfolder+e.toLowerCase()}GetProjectFileUrl(e,t=''){if(C3.IsAbsoluteURL(e)){if(t)throw new Error('cannot specify subfolder with remote URL');return Promise.resolve(e)}return this._HasLocalUrlBlob(e)?Promise.resolve(this.GetLocalUrlAsBlobUrl(e)):this._isCordova?this.CordovaFetchLocalFileAsBlobURL(t+e):Promise.resolve(t+e.toLowerCase())}LoadProjectFileUrl(e){return this.GetProjectFileUrl(e)}LoadImage(e){if(e.loadPolicy&&!n.has(e.loadPolicy))throw new Error('invalid load policy');let t=this._assetsByUrl.get(e.url);return t?t:(t=C3.New(C3.ImageAsset,this,{url:e.url,size:e.size||0,loadPolicy:e.loadPolicy||this._defaultLoadPolicy}),this._allAssets.push(t),this._assetsByUrl.set(t.GetURL(),t),this._hasFinishedInitialLoad||(this._totalAssetSizeToLoad+=t.GetSize(),this._loadPromises.push(t.Load().then(()=>this._AddLoadedSize(t.GetSize())))),t)}async WaitForAllToLoad(){try{await Promise.all(this._loadPromises),this._lastLoadProgress=1}catch(e){console.error('Error loading: ',e),this._hasHadErrorLoading=!0,this._FireLoadingProgressEvent()}}SetInitialLoadFinished(){this._hasFinishedInitialLoad=!0}HasHadErrorLoading(){return this._hasHadErrorLoading}_AddLoadedSize(e){this._assetSizeLoaded+=e,this._loadingRateLimiter.Call()}_FireLoadingProgressEvent(){const e=C3.New(C3.Event,'loadingprogress');this._lastLoadProgress=C3.clamp(this._assetSizeLoaded/this._totalAssetSizeToLoad,0,1),e.progress=this._lastLoadProgress,this._runtime.Dispatcher().dispatchEvent(e)}GetLoadProgress(){return this._lastLoadProgress}_SetWebFonts(e){C3.shallowAssignArray(this._webFonts,e),this._webFonts.length&&this._loadPromises.push(this._LoadWebFonts())}_LoadWebFonts(){if('undefined'==typeof FontFace)return Promise.resolve();const e=[];for(const[t,a,n]of this._webFonts)this._totalAssetSizeToLoad+=n,e.push(this._LoadWebFont(t,a).then(()=>this._AddLoadedSize(n)));return Promise.all(e)}async _LoadWebFont(e,t){try{const a=await this.GetProjectFileUrl(t,this._fontsSubfolder),n=new FontFace(e,`url('${a}')`);this._runtime.IsInWorker()?self.fonts.add(n):document.fonts.add(n),await n.load()}catch(t){console.warn(`[C3 runtime] Failed to load web font '${e}': `,t)}}IsAudioFormatSupported(e){return!!this._supportedAudioFormats[e]}_SetAudioFiles(t,e){this._preloadSounds=!!e;for(const[n,a,r]of t)this._audioFiles.set(n,{fileName:n,formats:a.map(e=>({type:e[0],fileExtension:e[1],fullName:n+e[1],fileSize:e[2]})),isMusic:r})}GetPreferredAudioFile(e){const t=this._audioFiles.get(e.toLowerCase());if(!t)return null;let a=null;for(const n of t.formats)if(a||'audio/webm; codecs=opus'!==n.type||(a=n),this.IsAudioFormatSupported(n.type))return n;return a}GetProjectAudioFileUrl(e){const t=this.GetPreferredAudioFile(e);return t?{url:this.GetMediaFileUrl(t.fullName),type:t.type}:null}GetAudioToPreload(){if(this._preloadSounds){const e=[];for(const t of this._audioFiles.values()){if(t.isMusic)continue;const a=this.GetPreferredAudioFile(t.fileName);a&&e.push({originalUrl:t.fileName,url:this.GetMediaFileUrl(a.fullName),type:a.type,fileSize:a.fileSize})}return e}return[]}GetIAssetManager(){return this._iAssetManager}async LoadScripts(...e){const a=await Promise.all(e.map(e=>this.GetProjectFileUrl(e)));this._runtime.IsInWorker()?importScripts(...a):await Promise.all(a.map(e=>t(e)))}async CompileWebAssembly(e){if(WebAssembly.compileStreaming){const t=await this.GetProjectFileUrl(e);return await WebAssembly.compileStreaming(fetch(t))}else{const t=await C3.FetchArrayBuffer(e);return await WebAssembly.compile(t)}}async LoadStyleSheet(e){const t=await this.GetProjectFileUrl(e);return await this._runtime.PostComponentMessageToDOMAsync('runtime','add-stylesheet',{url:t})}}}'use strict',C3.Asset=class extends C3.DefendedBase{constructor(e,t){super(),this._assetManager=e,this._runtime=e.GetRuntime(),this._url=t.url,this._size=t.size,this._loadPolicy=t.loadPolicy,this._blob=null,this._isLoaded=!1,this._loadPromise=null}Release(){this._loadPromise=null,this._assetManager=null,this._runtime=null,this._blob=null}GetURL(){return this._url}GetSize(){return this._size}Load(){return'local'===this._loadPolicy||this._blob?(this._isLoaded=!0,Promise.resolve()):this._loadPromise?this._loadPromise:(this._loadPromise=this._assetManager.FetchBlob(this._url,this._loadPolicy).then(e=>{this._isLoaded=!0,this._loadPromise=null,this._blob=e}).catch(e=>console.error('Error loading resource: ',e)),this._loadPromise)}IsLoaded(){return this._isLoaded}GetBlob(){return this._blob?Promise.resolve(this._blob):this._assetManager.FetchBlob(this._url,this._loadPolicy)}},'use strict';{const e=new C3.PromiseThrottle,t=new Set;C3.ImageAsset=class extends C3.Asset{constructor(e,a){super(e,a),this._texturePromise=null,this._webglTexture=null,this._refCount=0,this._imageWidth=-1,this._imageHeight=-1,t.add(this)}Release(){if(this.ReleaseTexture(),0!==this._refCount)throw new Error('released image asset which still has texture references');this._texturePromise=null,t.delete(this),super.Release()}static OnWebGLContextLost(){for(const e of t)e._texturePromise=null,e._webglTexture=null,e._refCount=0}LoadStaticTexture(t,a){return(this._refCount++,this._webglTexture)?Promise.resolve(this._webglTexture):this._texturePromise?this._texturePromise:(this._texturePromise=this.GetBlob().then(n=>e.Add(()=>t.CreateStaticTextureAsync(n,a).then(e=>(this._texturePromise=null,0===this._refCount)?(t.DeleteTexture(e),null):(this._webglTexture=e,this._imageWidth=e.GetWidth(),this._imageHeight=e.GetHeight(),this._webglTexture)))).catch(e=>{throw console.error('Failed to load texture: ',e),e}),this._texturePromise)}ReleaseTexture(){if(0>=this._refCount)throw new Error('texture released too many times');if(this._refCount--,0===this._refCount&&this._webglTexture){const e=this._webglTexture.GetRenderer();e.DeleteTexture(this._webglTexture),this._webglTexture=null}}GetTexture(){return this._webglTexture}GetWidth(){return this._imageWidth}GetHeight(){return this._imageHeight}async LoadToDrawable(){const e=await this.GetBlob();return C3.Supports.ImageBitmapOptions?await createImageBitmap(e,{premultiplyAlpha:'none'}):C3.Supports.ImageBitmap?await createImageBitmap(e):await C3.BlobToImage(e)}}}{function e(e,t){return e.GetWorldInfo()._GetLastCachedZIndex()-t.GetWorldInfo()._GetLastCachedZIndex()}C3.RenderCell=class extends C3.DefendedBase{constructor(e,t,a){super(),this._grid=e,this._x=t,this._y=a,this._instances=[],this._isSorted=!0,this._pendingRemoval=new Set,this._isAnyPendingRemoval=!1}Release(){C3.clearArray(this._instances),this._pendingRemoval.clear(),this._grid=null}Reset(){C3.clearArray(this._instances),this._isSorted=!0,this._pendingRemoval.clear(),this._isAnyPendingRemoval=!1}SetChanged(){this._isSorted=!1}IsEmpty(){return!this._instances.length||!(this._instances.length>this._pendingRemoval.size)&&(this._FlushPending(),!0)}Insert(e){return this._pendingRemoval.has(e)?(this._pendingRemoval.delete(e),void(0===this._pendingRemoval.size&&(this._isAnyPendingRemoval=!1))):void(this._instances.push(e),this._isSorted=1===this._instances.length)}Remove(e){this._pendingRemoval.add(e),this._isAnyPendingRemoval=!0,50<=this._pendingRemoval.size&&this._FlushPending()}_FlushPending(){return this._isAnyPendingRemoval?this._instances.length===this._pendingRemoval.size?void this.Reset():void(C3.arrayRemoveAllInSet(this._instances,this._pendingRemoval),this._pendingRemoval.clear(),this._isAnyPendingRemoval=!1):void 0}_EnsureSorted(){this._isSorted||(this._instances.sort(e),this._isSorted=!0)}Dump(e){this._FlushPending(),this._EnsureSorted(),this._instances.length&&e.push(this._instances)}}}'use strict',C3.RenderGrid=class extends C3.DefendedBase{constructor(e,t){super(),this._cellWidth=e,this._cellHeight=t,this._cells=C3.New(C3.PairMap)}Release(){this._cells.Release(),this._cells=null}GetCell(e,t,a){let n=this._cells.Get(e,t);return n?n:a?(n=C3.New(C3.RenderCell,this,e,t),this._cells.Set(e,t,n),n):null}XToCell(e){return Math.floor(e/this._cellWidth)}YToCell(e){return Math.floor(e/this._cellHeight)}Update(t,a,n){if(a)for(let r=a.getLeft(),i=a.getRight();r<=i;++r)for(let i=a.getTop(),e=a.getBottom();i<=e;++i){if(n&&n.containsPoint(r,i))continue;const e=this.GetCell(r,i,!1);e&&(e.Remove(t),e.IsEmpty()&&this._cells.Delete(r,i))}if(n)for(let r=n.getLeft(),i=n.getRight();r<=i;++r)for(let i=n.getTop(),e=n.getBottom();i<=e;++i)a&&a.containsPoint(r,i)||this.GetCell(r,i,!0).Insert(t)}QueryRange(t,e){let n=this.XToCell(t.getLeft());for(const r=this.YToCell(t.getTop()),a=this.XToCell(t.getRight()),i=this.YToCell(t.getBottom());n<=a;++n)for(let t=r;t<=i;++t){const a=this.GetCell(n,t,!1);a&&a.Dump(e)}}MarkRangeChanged(t){let n=t.getLeft();for(const r=t.getTop(),a=t.getRight(),i=t.getBottom();n<=a;++n)for(let e=r;e<=i;++e){const t=this.GetCell(n,e,!1);t&&t.SetChanged()}}},'use strict';{function t(e,t){return e.GetWorldInfo()._GetLastCachedZIndex()-t.GetWorldInfo()._GetLastCachedZIndex()}function a(e,t){return e.GetWorldInfo().GetZElevation()-t.GetWorldInfo().GetZElevation()}const n=new C3.Rect,r=new C3.Quad,i=[],s=new C3.Rect,l=new C3.Rect,_=vec3.fromValues(0,1,0);C3.Layer=class extends C3.DefendedBase{constructor(e,t,a){super(),this._layout=e,this._runtime=e.GetRuntime(),this._name=a[0],this._index=t,this._sid=a[2],this._isVisible=!!a[3],this._backgroundColor=C3.New(C3.Color),this._backgroundColor.setFromJSON(a[4].map(e=>e/255)),this._isTransparent=!!a[5],this._parallaxX=a[6],this._parallaxY=a[7],this._color=C3.New(C3.Color,1,1,1,a[8]),this._premultipliedColor=C3.New(C3.Color),this._isForceOwnTexture=a[9],this._useRenderCells=a[10],this._scaleRate=a[11],this._blendMode=a[12],this._srcBlend=0,this._destBlend=0,this._curRenderTarget=null,this._scale=1,this._zElevation=a[16],this._angle=0,this._isAngleEnabled=!0,this._viewport=C3.New(C3.Rect),this._viewportZ0=C3.New(C3.Rect),this._startupInitialInstances=[],this._initialInstances=[],this._createdGlobalUids=[],this._instances=[],this._zIndicesUpToDate=!1,this._anyInstanceZElevated=!1,this._effectList=C3.New(C3.EffectList,this,a[15]),this._renderGrid=null,this._lastRenderList=[],this._isRenderListUpToDate=!1,this._lastRenderCells=C3.New(C3.Rect,0,0,-1,-1),this._curRenderCells=C3.New(C3.Rect,0,0,-1,-1),this._iLayer=new ILayer(this),this._UpdatePremultipliedColor(),this._useRenderCells&&(this._renderGrid=C3.New(C3.RenderGrid,this._runtime.GetOriginalViewportWidth(),this._runtime.GetOriginalViewportHeight()));for(const n of a[14]){const e=this._runtime.GetObjectClassByIndex(n[1]);this._layout._AddInitialObjectClass(e),e.GetDefaultInstanceData()||(e.SetDefaultInstanceData(n),e._SetDefaultLayerIndex(this._index)),this._initialInstances.push(n)}C3.shallowAssignArray(this._startupInitialInstances,this._initialInstances)}static Create(e,t,a){return C3.New(C3.Layer,e,t,a)}Release(){this._layout=null,this._runtime=null}CreateInitialInstances(e){const t=this._layout.IsFirstVisit();let a=0;const n=this._initialInstances;for(let r=0,i=n.length;ra||(t&&this._useRenderCells&&e.GetWorldInfo()._RemoveFromRenderCells(),this._instances.splice(a,1),this.SetZIndicesChanged(),this._MaybeResetAnyInstanceZElevatedFlag())}_SetAnyInstanceZElevated(){this._anyInstanceZElevated=!0}_MaybeResetAnyInstanceZElevatedFlag(){0===this._instances.length&&(this._anyInstanceZElevated=!1)}_SortInstancesByLastCachedZIndex(e){if(e){const e=new Set;for(const t of this._instances){const a=t.GetWorldInfo()._GetLastCachedZIndex();0<=a&&e.add(a)}let t=-1;for(const a of this._instances){const n=a.GetWorldInfo();if(!(0<=n._GetLastCachedZIndex())){for(++t;e.has(t);)++t;n._SetZIndex(t)}}}this._instances.sort(t)}_Start(){this.SetBlendMode(this.GetBlendMode(),!0)}_End(){for(const e of this._instances)e.GetObjectClass().IsGlobal()||this._runtime.DestroyInstance(e);this._runtime.FlushPendingInstances(),C3.clearArray(this._instances),this._anyInstanceZElevated=!1,this.SetZIndicesChanged()}RecreateInitialObjects(t,a){const n=this._runtime.GetEventSheetManager(),r=this._runtime.GetAllObjectClasses(),s=t.IsFamily();for(const e of this._initialInstances){const l=e[0],_=l[0],d=l[1];if(!a.containsPoint(_,d))continue;const i=r[e[1]];if(i!==t)if(!s)continue;else if(!t.FamilyHasMember(i))continue;const u=this._runtime.CreateInstanceFromData(e,this,!1);if(n.BlockFlushingInstances(!0),u._TriggerOnCreated(),u.IsInContainer())for(const e of u.siblings())e._TriggerOnCreated();n.BlockFlushingInstances(!1)}}GetInstanceCount(){return this._instances.length}GetLayout(){return this._layout}GetName(){return this._name}GetIndex(){return this._index}GetSID(){return this._sid}GetRuntime(){return this._runtime}GetDevicePixelRatio(){return this._runtime.GetDevicePixelRatio()}GetEffectList(){return this._effectList}UsesRenderCells(){return this._useRenderCells}GetRenderGrid(){return this._renderGrid}SetRenderListStale(){this._isRenderListUpToDate=!1}IsVisible(){return this._isVisible}SetVisible(e){e=!!e,this._isVisible===e||(this._isVisible=e,this._runtime.UpdateRender())}GetViewport(){return this._viewport}GetViewportForZ(t,a){const n=this._viewportZ0;if(0===t)a.copy(n);else{const r=this.Get2DScaleFactorToZ(t),i=n.midX(),e=n.midY(),s=.5*n.width()/r,l=.5*n.height()/r;a.set(i-s,e-l,i+s,e+l)}}GetOpacity(){return this._color.getA()}SetOpacity(e){e=C3.clamp(e,0,1),this._color.getA()===e||(this._color.setA(e),this._UpdatePremultipliedColor(),this._runtime.UpdateRender())}_UpdatePremultipliedColor(){this._premultipliedColor.copy(this._color),this._premultipliedColor.premultiply()}GetPremultipliedColor(){return this._premultipliedColor}HasDefaultColor(){return this._color.equalsRgba(1,1,1,1)}GetScaleRate(){return this._scaleRate}SetScaleRate(e){this._scaleRate===e||(this._scaleRate=e,this._runtime.UpdateRender())}GetParallaxX(){return this._parallaxX}GetParallaxY(){return this._parallaxY}SetParallax(e,t){if((this._parallaxX!==e||this._parallaxY!==t)&&(this._parallaxX=e,this._parallaxY=t,this._runtime.UpdateRender(),1!==this._parallaxX||1!==this._parallaxY))for(const e of this._instances)e.GetObjectClass()._SetAnyInstanceParallaxed(!0)}SetParallaxX(e){this.SetParallax(e,this.GetParallaxY())}SetParallaxY(e){this.SetParallax(this.GetParallaxX(),e)}SetZElevation(e){this._zElevation=+e}GetZElevation(){return this._zElevation}SetAngle(e){this._angle=C3.clampAngle(e)}GetAngle(){return this._isAngleEnabled?C3.clampAngle(this._layout.GetAngle()+this._angle):0}GetOwnAngle(){return this._angle}HasInstances(){return 0Number.EPSILON){this._UpdateZIndices();const e=this._useRenderCells&&0===this.GetZElevation()&&!this._anyInstanceZElevated;e?this._DrawInstances_RenderCells(t):this._DrawInstances(t,this._instances)}t.SetBaseZ(0),t.SetCurrentZ(0),t.SetCameraXYZ(0,0,100),t.SetLookXYZ(0,0,0),i&&this._DrawLayerOwnTextureToRenderTarget(t,e,a,n),s&&t.EndQuery(s),this._curRenderTarget=null}_DrawInstances(t,a){const n=this._viewport,r=this._curRenderTarget;let i=null;for(let e=0,s=a.length;ethis._width-t&&(e=this._width-t),ethis._height-t&&(e=this._height-t),ee||(this._width=e)}GetHeight(){return this._height}SetHeight(e){!isFinite(e)||1>e||(this._height=e)}GetEventSheet(){return this._eventSheet}GetLayers(){return this._layers}GetLayerCount(){return this._layers.length}GetLayer(e){return'number'==typeof e?this.GetLayerByIndex(e):this.GetLayerByName(e.toString())}GetLayerByIndex(e){return e=C3.clamp(Math.floor(e),0,this._layers.length-1),this._layers[e]}GetLayerByName(e){return this._layersByName.get(e.toLowerCase())||null}GetLayerBySID(e){return this._layersBySid.get(e)||null}HasOpaqueBottomLayer(){for(const e of this._layers)if(e.ShouldDraw())return e._IsOpaque();return!1}IsFirstVisit(){return this._isFirstVisit}_GetInitialObjectClasses(){return[...this._initialObjectClasses]}_AddInitialObjectClass(e){if(e.IsInContainer())for(const t of e.GetContainer().GetObjectTypes())this._initialObjectClasses.add(t);else this._initialObjectClasses.add(e)}_GetTextureLoadedObjectTypes(){return[...this._textureLoadedTypes]}_Load(e,t){if(e===this||!t)return Promise.resolve();e&&(C3.CopySet(this._textureLoadedTypes,e._textureLoadedTypes),e._textureLoadedTypes.clear());const a=[];for(const n of this._initialObjectClasses)this._textureLoadedTypes.has(n)||(a.push(n.LoadTextures(t)),this._textureLoadedTypes.add(n));return Promise.all(a)}async MaybeLoadTexturesFor(e){if(e.IsFamily())throw new Error('cannot load textures for family');const t=this._runtime.GetWebGLRenderer();!t||t.IsContextLost()||this._textureLoadedTypes.has(e)||(this._textureLoadedTypes.add(e),await e.LoadTextures(t),e.OnDynamicTextureLoadComplete(),this._runtime.UpdateRender())}MaybeUnloadTexturesFor(e){if(e.IsFamily()||0e.PreloadTexturesWithInstances(this._runtime.GetWebGLRenderer()))),e&&(t.Dispatcher().dispatchEvent(new C3.Event('beforefirstlayoutstart')),t.DispatchUserScriptEvent(new C3.Event('beforeprojectstart'))),this.DispatchUserScriptEvent(new C3.Event('beforelayoutstart')),t.IsLoadingState()||(await t.TriggerAsync(C3.Plugins.System.Cnds.OnLayoutStart,null,null)),this.DispatchUserScriptEvent(new C3.Event('afterlayoutstart')),e&&(t.Dispatcher().dispatchEvent(new C3.Event('afterfirstlayoutstart')),t.DispatchUserScriptEvent(new C3.Event('afterprojectstart'))),n._RunQueuedTriggers(a),this._isFirstVisit=!1}_MoveGlobalObjectsToThisLayout(e){for(const t of this._runtime.GetAllObjectClasses())if(!t.IsFamily()&&t.IsWorldType())for(const n of t.GetInstances()){const t=n.GetWorldInfo(),a=t.GetLayer(),r=C3.clamp(a.GetIndex(),0,this._layers.length-1),i=this._layers[r];t._SetLayer(i),i._MaybeAddInstance(n)}if(!e)for(const e of this._layers)e._SortInstancesByLastCachedZIndex(!1)}_CreateInitialInstances(){for(const e of this._layers)e.CreateInitialInstances(this._createdInstances),e.UpdateViewport(),e._Start()}_CreatePersistedInstances(){let t=!1;for(const[e,a]of Object.entries(this._persistData)){const n=this._runtime.GetObjectClassBySID(parseInt(e,10));if(n&&!n.IsFamily()&&n.HasPersistBehavior()){for(const r of a){let a=null;if(n.IsWorldType()&&(a=this.GetLayerBySID(r.w.l),!a))continue;const i=this._runtime.CreateInstanceFromData(n,a,!1,0,0,!0);i.LoadFromJson(r),t=!0,this._createdInstances.push(i)}C3.clearArray(a)}}for(const e of this._layers)e._SortInstancesByLastCachedZIndex(!0),e.SetZIndicesChanged();t&&(this._runtime.FlushPendingInstances(),this._runtime._RefreshUidMap())}_CreateAndLinkContainerInstances(t){for(const a of t){if(!a.IsInContainer())continue;const n=a.GetWorldInfo(),r=a.GetIID();for(const i of a.GetObjectClass().GetContainer().objectTypes()){if(i===a.GetObjectClass())continue;const e=i.GetInstances();if(e.length>r)a._AddSibling(e[r]);else{let e;e=n?this._runtime.CreateInstanceFromData(i,n.GetLayer(),!0,n.GetX(),n.GetY(),!0):this._runtime.CreateInstanceFromData(i,null,!0,0,0,!0),this._runtime.FlushPendingInstances(),i._UpdateIIDs(),a._AddSibling(e),t.push(e)}}}}_CreateInitialNonWorldInstances(){for(const e of this._initialNonWorld){const t=this._runtime.GetObjectClassByIndex(e[1]);t.IsInContainer()||this._runtime.CreateInstanceFromData(e,null,!0)}}_CreateGlobalNonWorlds(){const t=[],a=this._initialNonWorld;let n=0;for(let r=0,i=a.length;r=this._isEndingLayout)throw new Error('already unset');this._isEndingLayout--}}IsEndingLayout(){return 0/g;C3.TimelineManager=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e,this._timelineDataManager=C3.New(C3.TimelineDataManager),this._pluginInstance=null,this._timelines=[],this._timelinesByName=new Map,this._objectClassToTimelineMap=new Map,this._timelinesCreatedByTemplate=new Map,this._scheduledTimelines=[],this._playingTimelines=[],this._hasRuntimeListeners=!1,this._changingLayout=!1,this._isTickingTimelines=!1,this._tickFunc=()=>this._OnTick(),this._tick2Func=()=>this._OnTick2(),this._beforeLayoutChange=()=>this._OnBeforeChangeLayout(),this._layoutChange=()=>this._OnAfterChangeLayout(),this._instanceDestroy=e=>this._OnInstanceDestroy(e.instance)}Release(){this.RemoveRuntimeListeners(),this._tickFunc=null,this._tick2Func=null,this._beforeLayoutChange=null,this._layoutChange=null,this._instanceDestroy=null;for(const e of this._timelines)e.Stop(),e.Release();C3.clearArray(this._timelines),this._timelines=null,this._timelineDataManager.Release(),this._timelineDataManager=null,C3.clearArray(this._scheduledTimelines),this._scheduledTimelines=null,C3.clearArray(this._playingTimelines),this._playingTimelines=null,this._timelinesByName.clear(),this._timelinesByName=null,this._objectClassToTimelineMap.clear(),this._objectClassToTimelineMap=null,this._timelinesCreatedByTemplate.clear(),this._timelinesCreatedByTemplate=null,this._runtime=null}AddRuntimeListeners(){const e=this._runtime.Dispatcher();e.addEventListener('pretick',this._tickFunc),e.addEventListener('tick2',this._tick2Func),e.addEventListener('beforelayoutchange',this._beforeLayoutChange),e.addEventListener('layoutchange',this._layoutChange),e.addEventListener('instancedestroy',this._instanceDestroy)}RemoveRuntimeListeners(){const e=this._runtime.Dispatcher();e.removeEventListener('pretick',this._tickFunc),e.removeEventListener('tick2',this._tick2Func),e.removeEventListener('beforelayoutchange',this._beforeLayoutChange),e.removeEventListener('layoutchange',this._layoutChange),e.removeEventListener('instancedestroy',this._instanceDestroy)}Create(e){this._timelineDataManager.Add(e);const t=C3.TimelineState.CreateInitial(e,this);this.Add(t),this.SetTimelineObjectClassesToMap(t),this._timelinesCreatedByTemplate.set(t.GetName(),0)}CreateFromTemplate(t){const a=this.GetTimelineDataManager(),n=t.GetTemplateName(),r=a.Get(n),i=C3.TimelineState.CreateFromTemplate(`${n}:${this._timelinesCreatedByTemplate.get(n)}`,r,this);return this._IncreaseTemplateTimelinesCount(n),this.Add(i),i}_IncreaseTemplateTimelinesCount(e){this._timelinesCreatedByTemplate.set(e,this._timelinesCreatedByTemplate.get(e)+1)}_SetCreatedTemplateTimelinesCount(){for(const e of this._timelines){if(e.IsTemplate())continue;const t=e.GetTemplateName();this._IncreaseTemplateTimelinesCount(t)}}_ClearCreatedTemplateTimelinesCount(){for(const e of this._timelinesCreatedByTemplate.keys())this._timelinesCreatedByTemplate.set(e,0)}Add(e){this._timelines.push(e),this._timelinesByName.set(e.GetName().toLowerCase(),e)}Remove(e){e.IsTemplate()||(this._RemoveFromArray(this._timelines,e),this._RemoveFromArray(this._scheduledTimelines,e),this._RemoveFromArray(this._playingTimelines,e),this._timelinesByName.delete(e.GetName().toLowerCase()),this.RemoveTimelineFromObjectClassMap(e),e.Release())}_RemoveFromArray(e,t){const a=e.indexOf(t);-1!==a&&e.splice(a,1)}Trigger(e){this._runtime.Trigger(e,this._pluginInstance,null)}GetRuntime(){return this._runtime}GetTimelineDataManager(){return this._timelineDataManager}SetPluginInstance(e){this._pluginInstance=e}GetPluginInstance(){return this._pluginInstance}*GetTimelines(){for(const e of this._timelines)yield e}SetTimelineObjectClassToMap(e,t){this._objectClassToTimelineMap.has(e)||this._objectClassToTimelineMap.set(e,new Set),this._objectClassToTimelineMap.get(e).add(t)}SetTimelineObjectClassesToMap(e){for(const t of e.GetObjectClasses())this.SetTimelineObjectClassToMap(t,e)}RemoveTimelineFromObjectClassMap(e){for(const[t,a]of this._objectClassToTimelineMap.entries())a.has(e)&&(a.delete(e),0===a.size&&this._objectClassToTimelineMap.delete(t))}GetTimelinesForObjectClass(e){return this._objectClassToTimelineMap.has(e)?this._objectClassToTimelineMap.get(e):void 0}GetTimelineOfTemplateForInstances(e,t){if(t)for(const n of this._timelines){const a=t.every(e=>n.HasTrackInstance(e.instance,e.trackId));if(a&&n.GetName().includes(e.GetName()))return n}}GetTimelineByName(e){return this._timelinesByName.get(e.toLowerCase())||null}GetScheduledOrPlayingTimelineByName(e){for(const t of this._scheduledTimelines)if(t.GetName()===e)return t;for(const t of this._playingTimelines)if(t.GetName()===e)return t;return null}*GetTimelinesByName(t){if(e.test(t)){e.lastIndex=0;let n;const r=new Set;do if(n=e.exec(t),n){const e=n[1].split(',');for(const t of e)r.add(t)}while(n);for(const e of r.values()){const t=this.GetTimelineByName(e);t&&(yield t)}r.clear()}else{const e=this.GetTimelineByName(t);e&&(yield e)}}*GetTimelinesByTags(e){for(const t of this._timelines)t.HasTags(e)&&(yield t)}AddScheduledTimeline(e){this._scheduledTimelines.includes(e)||this._scheduledTimelines.push(e),this._MaybeEnableRuntimeListeners()}RemovePlayingTimeline(e){this._RemoveFromArray(this._playingTimelines,e),this._MaybeDisableRuntimeListeners()}ScheduleTimeline(e){e.SetPlaying(!1),e.SetScheduled(!0),e.SetMarkedForRemoval(!1),this._scheduledTimelines.includes(e)||this._scheduledTimelines.push(e),this._MaybeEnableRuntimeListeners()}DeScheduleTimeline(e){e.SetPlaying(!1),e.SetScheduled(!1),e.ResolvePlayPromise(),this._RemoveFromArray(this._scheduledTimelines,e),this._MaybeDisableRuntimeListeners()}CompleteTimeline(e){e.SetPlaying(!1),e.SetScheduled(!1),e.SetMarkedForRemoval(!0)}CompleteTimelineAndResolve(e){this.CompleteTimeline(e),e.ResolvePlayPromise()}_OnTick(){if(!this._hasRuntimeListeners)return;if(this._changingLayout)return;let t=!1;for(this._isTickingTimelines=!0;this._scheduledTimelines.length;){const e=this._scheduledTimelines.pop();e.SetInitialState(),this._playingTimelines.push(e)}const n=this._runtime.GetDt(),r=this._runtime.GetTimeScale();for(const a of this._playingTimelines){if(a.IsMarkedForRemoval())continue;const i=a.Tick(n,r);!t&&i&&(t=!0)}this._isTickingTimelines=!1,t&&this.GetRuntime().UpdateRender()}_OnTick2(){if(this._hasRuntimeListeners){for(const e of this._playingTimelines)e.IsMarkedForRemoval()&&(this._MaybeExecuteTimelineFinishTriggers(e),this._RemoveFromArray(this._playingTimelines,e));this._MaybeDisableRuntimeListeners()}}_MaybeExecuteTimelineFinishTriggers(e){e.IsReleased()||!e.HasValidTracks()||e.IsComplete()&&e.InitialStateSet()&&e.FinishTriggers()}_MaybeEnableRuntimeListeners(){this._hasRuntimeListeners||(this._hasRuntimeListeners=!0)}_MaybeDisableRuntimeListeners(){this._playingTimelines.length||this._scheduledTimelines.length||this._isTickingTimelines||(this._hasRuntimeListeners=!1)}_OnBeforeChangeLayout(){for(this._changingLayout=!0;this._scheduledTimelines.length;)this.DeScheduleTimeline(this._scheduledTimelines.pop());for(;this._playingTimelines.length;){const e=this._playingTimelines.pop();e.IsReleased()||(this.CompleteTimeline(e),e.Reset(!1))}this._MaybeDisableRuntimeListeners();for(const e of this._timelines)e.CleanCaches()}_OnAfterChangeLayout(){this._changingLayout=!1}_OnInstanceDestroy(e){const t=e.GetObjectClass(),n=this.GetTimelinesForObjectClass(t);if(n)for(const e of n)e.IsTemplate()||e.HasValidTracks()||(this._MaybeExecuteTimelineFinishTriggers(e),this.Remove(e))}_SaveToJson(){return{timelinesJson:this._SaveTimelinesToJson(),scheduledTimelinesJson:this._SaveScheduledTimelinesToJson(),playingTimelinesJson:this._SavePlayingTimelinesToJson(),hasRuntimeListeners:this._hasRuntimeListeners,changingLayout:this._changingLayout,isTickingTimelines:this._isTickingTimelines}}_LoadFromJson(e){e&&(this._ClearCreatedTemplateTimelinesCount(),this._LoadTimelinesFromJson(e.timelinesJson),this._LoadScheduledTimelinesFromJson(e.scheduledTimelinesJson),this._LoadPlayingTimelinesFromJson(e.playingTimelinesJson),this._hasRuntimeListeners=!e.hasRuntimeListeners,this._changingLayout=!!e.changingLayout,this._isTickingTimelines=!!e.isTickingTimelines,this._SetCreatedTemplateTimelinesCount(),this._MaybeEnableRuntimeListeners(),this._MaybeDisableRuntimeListeners())}_SaveTimelinesToJson(){return this._timelines.map(e=>e._SaveToJson())}_LoadTimelinesFromJson(e){for(const t of e){let e=this.GetTimelineByName(t.name);if(e)e._LoadFromJson(t);else{const a=this._GetTemplateNameFromJson(t);if(!a)continue;const n=this.GetTimelineByName(a);e=this.CreateFromTemplate(n),e._LoadFromJson(t)}e.HasTracks()||this.Remove(e)}}_GetTemplateNameFromJson(e){const t=e.name,a=t.split(':');return a&&2===a.length?a[0]:null}_SaveScheduledTimelinesToJson(){return this._SaveTimelines(this._scheduledTimelines)}_LoadScheduledTimelinesFromJson(e){this._LoadTimelines(e,this._scheduledTimelines)}_SavePlayingTimelinesToJson(){return this._SaveTimelines(this._playingTimelines)}_LoadPlayingTimelinesFromJson(e){this._LoadTimelines(e,this._playingTimelines)}_IsTimelineInJson(e,t){for(const a of t)if(a===e.GetName())return!0;return!1}_SaveTimelines(e){return e.map(e=>e.GetName())}_LoadTimelines(e,t){const n=e=>t=>t.GetName()===e;for(const a of t)this._IsTimelineInJson(a,e)||this._RemoveFromArray(t,a);for(const r of e){const i=this.GetTimelineByName(r);if(i){const a=t.find(n(r));a||t.push(i)}}}}}{const e=0;C3.TimelineState=class extends C3.DefendedBase{constructor(t,a,n){super(),this._runtime=n.GetRuntime(),this._timelineManager=n,this._timelineDataItem=a,this._name=t,this._tracks=[];for(const e of this._timelineDataItem.GetTrackData().trackDataItems())this._tracks.push(C3.TrackState.Create(this,e));this._playPromise=null,this._playResolve=null,this._playheadTime=C3.New(C3.KahanSum),this._playheadTime.Set(0),this._playbackRate=1,this._pingPongState=e,this._currentRepeatCount=1,this._isPlaying=!1,this._isScheduled=!1,this._initialStateSet=!1,this._complete=!0,this._released=!1,this._markedForRemoval=!1,this._completedTick=-1,this._implicitPause=!1,this._isTemplate=!1,this._finishedTriggers=!1,this._tags=[''],this._stringTags='',this._tagsChanged=!1}static CreateInitial(t,a){const n=a.GetTimelineDataManager(),r=n.GetNameId(),i=n.Get(t[r]),e=C3.New(C3.TimelineState,t[r],i,a);return e.SetIsTemplate(!0),e}static CreateFromTemplate(e,t,a){return C3.New(C3.TimelineState,e,t,a)}static get WORLD_INSTANCE_BOX_CHANGE(){return 1}static get LAYOUT_RENDER_CHANGE(){return C3.nextHighestPowerOfTwo(1)}Release(){if(!this.IsReleased()){this._timelineManager.DeScheduleTimeline(this),this._timelineManager.CompleteTimelineAndResolve(this);for(const e of this._tracks)e.Release();C3.clearArray(this._tracks),this._tracks=null,this._playheadTime.Release(),this._playheadTime=null,this._runtime=null,this._timelineManager=null,this._timelineDataItem=null,this._released=!0,this._playPromise=null,this._playResolve=null}}GetTimelineManager(){return this._timelineManager}GetRuntime(){return this._runtime}GetTracks(){return this._tracks}HasTracks(){return!!this._tracks.length}GetTrackById(e){for(const t of this._tracks)if(C3.equalsNoCase(t.GetId(),e))return t;return null}SetName(e){this._name=e}GetName(){return this._name}GetTimelineDataItem(){return this._timelineDataItem}GetTemplateName(){return this._timelineDataItem.GetName()}GetTotalTime(){return this._timelineDataItem.GetTotalTime()}SetTotalTime(e){this._timelineDataItem.SetTotalTime(e)}GetStep(){return this._timelineDataItem.GetStep()}SetStep(e){this._timelineDataItem.SetStep(e)}GetInterpolationMode(){return this._timelineDataItem.GetInterpolationMode()}SetInterpolationMode(e){this._timelineDataItem.SetInterpolationMode(e)}GetResultMode(){return this._timelineDataItem.GetResultMode()}SetResultMode(e){this._timelineDataItem.GetResultMode(e)}SetEase(e){for(const t of this.GetTracks())t.SetEase(e)}GetLoop(){return this._timelineDataItem.GetLoop()}GetPingPong(){return this._timelineDataItem.GetPingPong()}GetRepeatCount(){return this._timelineDataItem.GetRepeatCount()}SetPlaybackRate(e){return this._playbackRate=e}GetPlaybackRate(){return this._playbackRate}IsForwardPlayBack(){return!this.IsPlaying()||0{this._playResolve=e}),this._playPromise)}ResolvePlayPromise(){this._playPromise&&(this._playResolve(),this._playPromise=null,this._playResolve=null)}SetTags(e){this._tags=C3.TimelineState._GetTagArray(e),this._tagsChanged=!0}GetTags(){return this._tags}GetStringTags(){return this._tagsChanged&&(this._stringTags=this._tags.join(' ')),this._tagsChanged=!1,this._stringTags}HasTags(e){if(!this._tags)return!1;if(!this._tags.length)return!1;const t=C3.TimelineState._GetTagArray(e);return!!t&&!!t.length&&t.every(C3.TimelineState._HasTag,this)}OnStarted(){C3.Plugins.Timeline.Cnds.SetTriggerTimeline(this),this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineStarted),this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineStartedByName),this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineStartedByTags),this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnAnyTimelineStarted),C3.Plugins.Timeline.Cnds.SetTriggerTimeline(null)}OnCompleted(){this._completedTick=this._runtime.GetTickCount()}FinishTriggers(){this._finishedTriggers||(this._finishedTriggers=!0,C3.Plugins.Timeline.Cnds.SetTriggerTimeline(this),this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineFinished),this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineFinishedByName),this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimelineFinishedByTags),this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnAnyTimelineFinished),C3.Plugins.Timeline.Cnds.SetTriggerTimeline(null))}SetPlaying(e){this._isPlaying=e}IsCompletedTick(){return this._completedTick===this._runtime.GetTickCount()}IsPlaying(){return!!this.IsCompletedTick()||this._isPlaying}SetScheduled(e){this._isScheduled=e}IsScheduled(){return this._isScheduled}SetComplete(e){this._complete=e;const t=this.GetTime();(0>=t||t>=this.GetTotalTime())&&(this._complete=!0)}IsComplete(){return this._complete}IsReleased(){return this._released}SetMarkedForRemoval(e){this._markedForRemoval=e}IsMarkedForRemoval(){return this._markedForRemoval}SetImplicitPause(e){this._implicitPause=e}IsImplicitPause(){return this._implicitPause}SetIsTemplate(e){this._isTemplate=!!e}IsTemplate(){return this._isTemplate}InitialStateSet(){return this._initialStateSet}GetTime(){return this._playheadTime.Get()}SetTime(e){this._SetTime(e),this.SetComplete(!1),this.IsComplete()||this.SetImplicitPause(!0),(this.IsPlaying()||this.IsScheduled()||!this._initialStateSet)&&(this.IsPlaying()||this.IsScheduled()||this._initialStateSet?this.IsPlaying()?this.Stop():this.IsScheduled()&&(this._timelineManager.DeScheduleTimeline(this),this.SetInitialStateFromSetTime()):this.SetInitialStateFromSetTime());let t=!1;for(const n of this._tracks){n.SetResumeState();const e=n.Interpolate(this._playheadTime.Get(),!1,!0);!t&&e&&(t=!0)}t&&this.GetRuntime().UpdateRender(),this._OnSetTime()}_SetTime(e){0>e?this._playheadTime.Set(0):e>=this.GetTotalTime()?this._playheadTime.Set(this.GetTotalTime()):this._playheadTime.Set(e)}_OnSetTime(){C3.Plugins.Timeline&&this.constructor===C3.TimelineState&&(C3.Plugins.Timeline.Cnds.SetTriggerTimeline(this),this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimeSet),this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimeSetByName),this._timelineManager.Trigger(C3.Plugins.Timeline.Cnds.OnTimeSetByTags),C3.Plugins.Timeline.Cnds.SetTriggerTimeline(null))}Resume(){if(!this.IsReleased()){if(this.IsForwardPlayBack()){if(this._playheadTime.Get()>=this.GetTotalTime())return;}else if(0>=this._playheadTime.Get())return;this.Play(!0)}}Play(e=!1){return!this.IsReleased()&&!this.IsScheduled()&&(this.IsPlaying()&&this.IsCompletedTick()?this._SchedulePlayingTimeline():!this.IsPlaying()&&!!(this.IsComplete()||e||this.IsImplicitPause())&&this._ScheduleStoppedTimeline())}_SchedulePlayingTimeline(){return this.SetImplicitPause(!1),this._timelineManager.RemovePlayingTimeline(this),this._timelineManager.ScheduleTimeline(this),this.GetPlayPromise(),!0}_ScheduleStoppedTimeline(){return this.SetImplicitPause(!1),this._timelineManager.ScheduleTimeline(this),this.GetPlayPromise(),!0}Stop(e=!1){this.IsReleased()||(this.SetComplete(e),this._timelineManager.CompleteTimeline(this),this.IsComplete()&&this.ResolvePlayPromise())}Reset(e=!0){if(this.IsReleased())return;if(!this.IsPlaying()&&this.IsScheduled())return this._timelineManager.DeScheduleTimeline(this);if(this.IsComplete())return;this.Stop(!0),this.IsForwardPlayBack()?this._SetTime(0):this._SetTime(this.GetTotalTime());let t=!1;for(const n of this._tracks){const e=n.Interpolate(this._playheadTime.Get());!t&&e&&(t=!0)}e&&this._OnSetTime(),t&&e&&this.GetRuntime().UpdateRender()}SetInitialStateFromSetTime(){this.SetInitialState(!0)}SetInitialState(t){if(!this.IsMarkedForRemoval())if(t){this._initialStateSet=!0;for(const e of this._tracks)e.SetInitialState()}else if(this.SetPlaying(!0),this.SetScheduled(!1),this.OnStarted(),this.IsComplete()){this._completedTick=-1,this._pingPongState=e,this._currentRepeatCount=1,this._complete=!1,this._finishedTriggers=!1,this._initialStateSet=!0,this.IsForwardPlayBack()?this._SetTime(0):this._SetTime(this.GetTotalTime());for(const e of this._tracks)e.SetInitialState()}else for(const e of this._tracks)e.SetResumeState()}Tick(e,t){this._playheadTime.Add(e*t*this._playbackRate);let a;if(this.GetLoop()||this.GetPingPong()?this.GetLoop()&&!this.GetPingPong()?a=this._LoopCompleteCheck():!this.GetLoop()&&this.GetPingPong()?a=this._PingPongCompleteCheck():this.GetLoop()&&this.GetPingPong()&&(a=this._LoopPingPongCompleteCheck()):a=this._SimpleCompleteCheck(),a){for(const e of this._tracks)e.SetEndState();return this.Stop(!0),this.OnCompleted(),!0}else{let e=!1;for(const t of this._tracks){const a=t.Interpolate(this._playheadTime.Get(),!0);!e&&a&&(e=!0)}return e}}_SimpleCompleteCheck(){if(this.IsForwardPlayBack()){if(this._playheadTime.Get()>=this.GetTotalTime())if(this._currentRepeatCount=this._playheadTime.Get())if(this._currentRepeatCount=this.GetTotalTime()&&this._SetTime(0):0>=this._playheadTime.Get()&&this._SetTime(this.GetTotalTime()),!1}_PingPongCompleteCheck(){if(this.IsForwardPlayBack()){if(this._playheadTime.Get()>=this.GetTotalTime())if(this._SetTime(this.GetTotalTime()),this.SetPlaybackRate(-1*this.GetPlaybackRate()),1!==this._pingPongState)this._pingPongState===e&&(this._pingPongState=1);else if(this._currentRepeatCount=this._playheadTime.Get())if(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate()),1!==this._pingPongState)this._pingPongState===e&&(this._pingPongState=1);else if(this._currentRepeatCount=this.GetTotalTime()&&(this._SetTime(this.GetTotalTime()),this.SetPlaybackRate(-1*this.GetPlaybackRate())):0>=this._playheadTime.Get()&&(this._SetTime(0),this.SetPlaybackRate(-1*this.GetPlaybackRate())),!1}AddTrack(){const e=this._timelineDataItem.GetTrackData().AddEmptyTrackDataItem(),t=C3.TrackState.Create(this,e);return this._tracks.push(t),t}CleanCaches(){for(const e of this._tracks)e.CleanCaches()}ClearTrackInstances(){for(const e of this._tracks)e.ClearInstance()}SetTrackInstance(e,t){if(t)for(const a of this._tracks)if(e){if(a.GetId()!==e)continue;a.SetInstance(t),this._timelineManager.SetTimelineObjectClassToMap(t.GetObjectClass(),this);break}else{if(a.HasInstance())continue;a.SetInstance(t),this._timelineManager.SetTimelineObjectClassToMap(t.GetObjectClass(),this);break}}HasTrackInstance(e,t){for(const a of this._tracks)if(t){if(t===a.GetId()&&e===a.GetInstance())return!0;}else if(e===a.GetInstance())return!0;return!1}HasValidTracks(){return this._tracks.some(e=>e.CanInstanceBeValid())}GetPropertyTrack(e){for(const t of this.GetTracks())for(const a of t.GetPropertyTracks())if(a.GetPropertyName()===e)return a}GetKeyframeWithTags(e){let t=e?e.split(' '):[];const a=new Set(t.map(e=>e.toLowerCase().trim()));t=[...a.values()];for(const n of this.GetTracks())for(const e of n.GetKeyframeDataItems()){const a=t.every(t=>e.HasTag(t));if(a)return e}}GetObjectClasses(){const e=[];for(const t of this.GetTracks())e.push(t.GetObjectClass());return e.filter(e=>e)}_SaveToJson(){return{tracksJson:this._SaveTracksToJson(),name:this._name,playheadTime:this._playheadTime.Get(),playbackRate:this._playbackRate,pingPongState:this._pingPongState,currentRepeatCount:this._currentRepeatCount,isPlaying:this._isPlaying,isScheduled:this._isScheduled,initialStateSet:this._initialStateSet,finishedTriggers:this._finishedTriggers,complete:this._complete,released:this._released,markedForRemoval:this._markedForRemoval,completedTick:this._completedTick,implicitPause:this._implicitPause,isTemplate:this._isTemplate,tags:this._tags.join(' '),stringTags:this._stringTags,tagsChanged:this._tagsChanged}}_LoadFromJson(e){e&&(this._LoadTracksFromJson(e.tracksJson),this._name=e.name,this._playheadTime.Set(e.playheadTime),this._playbackRate=e.playbackRate,this._pingPongState=e.pingPongState,this._currentRepeatCount=e.currentRepeatCount,this._isPlaying=!!e.isPlaying,this._isScheduled=!!e.isScheduled,this._initialStateSet=!!e.initialStateSet,this._finishedTriggers=!!e.hasOwnProperty('finishedTriggers')&&!!e.finishedTriggers,this._complete=!!e.complete,this._released=!!e.released,this._markedForRemoval=!!e.markedForRemoval,this._completedTick=e.completedTick,this._implicitPause=!!e.implicitPause,this._isTemplate=!!e.isTemplate,this._tags=e.tags.split(' '),this._stringTags=e.stringTags,this._tagsChanged=!!e.tagsChanged)}_SaveTracksToJson(){return this._tracks.map(e=>e._SaveToJson())}_LoadTracksFromJson(e){e.forEach((e,t)=>{const a=this._tracks[t];a._LoadFromJson(e)}),this._tracks.filter(e=>e.CanInstanceBeValid())}static _HasTag(e){const t=this.GetTags();return''===e?1===t.length&&''===t[0]:t.includes(e)}static _GetTagArray(e){return C3.IsArray(e)?e.slice(0):C3.IsString(e)?e.split(' '):void 0}}}'use strict',C3.TrackState=class extends C3.DefendedBase{constructor(e,t){super(),this._timeline=e,this._trackDataItem=t,this._trackData=t.GetTrackData(),this._instanceUid=NaN,this._objectClassIndex=NaN,this._instance=null,this._worldInfo=null,this._lastKeyframeDataItem=null,this._keyframeDataItems=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemArray(),this._propertyTracks=[];for(const a of this._trackDataItem.GetPropertyTrackData().propertyTrackDataItems())this._propertyTracks.push(C3.PropertyTrackState.Create(this,a))}static Create(e,t){return C3.New(C3.TrackState,e,t)}Release(){this._keyframeDataItems=null;for(const e of this._propertyTracks)e.Release();C3.clearArray(this._propertyTracks),this._propertyTracks=null,this._timeline=null,this._instance=null,this._worldInfo=null,this._trackDataItem=null,this._lastKeyframeDataItem=null}CleanCaches(){for(const e of this._propertyTracks)e.CleanCaches();this._instance=null,this._worldInfo=null}GetTimeline(){return this._timeline}GetRuntime(){return this._timeline.GetRuntime()}GetKeyframeDataItems(){return this._keyframeDataItems?this._keyframeDataItems:(this._keyframeDataItems=this._trackDataItem.GetKeyframeData().GetKeyframeDataItemArray(),this._keyframeDataItems)}GetPropertyTracks(){return this._propertyTracks}GetPropertyTrack(e){for(const t of this._propertyTracks)if(t.GetPropertyName()===e)return t}MaybeGetInstance(){this._instance||this.GetInstance()}IsInstanceValid(){return!!this._instance&&!this._instance.IsDestroyed()}CanInstanceBeValid(){const e=this.GetInstanceUID(),t=this.GetRuntime().GetInstanceByUID(e);return!!t&&!t.IsDestroyed()}GetObjectClass(){const e=this.GetObjectClassIndex();return-1===e?void 0:this.GetRuntime().GetObjectClassByIndex(e)}ClearInstance(){this._instance=null,this._instanceUid=-1,this._worldInfo=null,this._objectClassIndex=-1}HasInstance(){return!!this._instance}GetInstance(){if(this._instance&&this.IsInstanceValid())return this._instance;const e=this.GetInstanceUID();return this._instance=this.GetRuntime().GetInstanceByUID(e),this._instance}SetInstance(e){if(this._instance!==e){this.CleanCaches(),this._instance=e,this._objectClassIndex=e.GetObjectClass().GetIndex(),this._instanceUid=e.GetUID(),this._worldInfo=e.GetWorldInfo();for(const t of this.propertyTrackItems()){const e=t.propertyTrack,n=t.sourceAdapter,a=e.GetSourceAdapterId();switch(a){case'instance-variable':{const a=n.GetEditorIndex(),r=inst.GetObjectClass(),i=r.GetInstanceVariableIndexByName(t.name),e=r.GetInstanceVariableName(i),s=r.GetInstanceVariableType(i);e===t.name&&s===t.type&&n.UpdateInstanceVariableIndex(i);break}case'behavior':{const r=t.behaviorType,s=this.GetObjectClass(),l=inst.GetObjectClass(),e=n.GetBehaviorType(l);if(r&&e){const t=r.GetName(),a=s.GetBehaviorIndexByName(t),_=l.GetBehaviorIndexByName(t),d=n.GetEditorIndex();n.UpdateBehaviorTypeSid(e.GetSID())}break}}}}}*propertyTrackItems(){for(const e of this._propertyTracks){const t=e.GetSourceAdapter(),n=this.GetObjectClass(),r={propertyTrack:e,sourceAdapter:t};switch(e.GetSourceAdapterId()){case'world-instance':{r.property=e.GetPropertyName();break}case'instance-variable':{const e=t.GetEditorIndex();r.name=n.GetInstanceVariableName(e),r.type=n.GetInstanceVariableType(e);break}case'effect':{const i=n.GetEffectList(),a=t.GetEffectType(i);r.effectType=a;break}case'behavior':{const e=t.GetBehaviorType(n);r.behaviorType=e;break}case'plugin':{r.plugin=n.GetPlugin();break}}yield r}}GetWorldInfo(){if(this._worldInfo&&this.IsInstanceValid())return this._worldInfo;const e=this.GetInstance();return e&&(this._worldInfo=e.GetWorldInfo()),this._worldInfo}GetTrackDataItem(){return this._trackDataItem}GetInstanceUID(){return this._instanceUid?this._instanceUid:this._trackDataItem.GetInstanceUID()}SetInstanceUID(e){this._trackDataItem.SetInstanceUID(e)}GetInterpolationMode(){return this._trackDataItem.GetInterpolationMode()}SetInterpolationMode(e){this._trackDataItem.SetInterpolationMode(e)}GetResultMode(){return this._trackDataItem.GetResultMode()}GetId(){return this._trackDataItem.GetId()}SetResultMode(e){this._trackDataItem.SetResultMode(e)}SetEase(e){for(const t of this.GetKeyframeDataItems())t.SetEase(e);for(const t of this.GetPropertyTracks())t.SetEase(e)}GetEnable(){return this._trackDataItem.GetEnable()}SetEnable(e){this._trackDataItem.SetEnable(e)}GetObjectClassIndex(){return isNaN(this._objectClassIndex)?this._trackDataItem.GetObjectClassIndex():this._objectClassIndex}SetObjectClassIndex(e){this._trackDataItem.SetObjectClassIndex(e)}SetInitialState(){if(this.MaybeGetInstance(),!!this.IsInstanceValid()){for(const e of this._propertyTracks)e.SetInitialState();const e=this.GetTimeline(),t=e.IsForwardPlayBack(),a=e.GetTotalTime(),n=t?0:a;this._lastKeyframeDataItem=this._trackData.GetKeyFrameDataItemAtTime(n,this._trackDataItem),this.Interpolate(n)}}SetResumeState(){if(this.MaybeGetInstance(),!!this.IsInstanceValid()){const e=this._timeline.IsForwardPlayBack(),t=this._timeline.GetTime();this._timeline.IsForwardPlayBack()?this._lastKeyframeDataItem=this._trackData.GetFirstKeyFrameDataItemLowerOrEqualThan(t,this._trackDataItem):(this._lastKeyframeDataItem=this._trackData.GetFirstKeyFrameDataItemHigherOrEqualThan(t,this._trackDataItem),!this._lastKeyframeDataItem&&(this._lastKeyframeDataItem=this._trackData.GetLastKeyframeDataItem(this._trackDataItem)));for(const e of this._propertyTracks)e.SetResumeState()}}SetEndState(){if(!this.GetTimeline().IsComplete()&&(this.MaybeGetInstance(),!!this.IsInstanceValid())){const e=this._timeline.GetTime(),t=this._timeline.GetTotalTime();e>=t?this.Interpolate(t,!0):0>=e&&this.Interpolate(0,!0)}}Interpolate(t,a=!1,n=!1){if(this.MaybeGetInstance(),!this.IsInstanceValid())return!1;this._lastKeyframeDataItem=this.MaybeTriggerKeyframeReachedConditions(t,a);let r=!1,i=!1;for(const e of this._propertyTracks){const a=e.Interpolate(t,n);r||0==(a&C3.TimelineState.WORLD_INSTANCE_BOX_CHANGE)||(r=!0),i||0==(a&C3.TimelineState.LAYOUT_RENDER_CHANGE)||(i=!0)}if(r){const e=this.GetWorldInfo();e&&e.SetBboxChanged()}return i}MaybeTriggerKeyframeReachedConditions(e,t){if(!t)return;const a=this.GetTimeline();let n=this._trackData.GetKeyFrameDataItemAtTime(e,this._trackDataItem);return n?this.OnKeyframeReached(n):(n=a.IsForwardPlayBack()?this._trackData.GetFirstKeyFrameDataItemLowerOrEqualThan(e,this._trackDataItem):this._trackData.GetFirstKeyFrameDataItemHigherOrEqualThan(e,this._trackDataItem),n!==this._lastKeyframeDataItem&&this.OnKeyframeReached(n)),n}OnKeyframeReached(e){if(C3.Plugins.Timeline&&this.GetTimeline().constructor===C3.TimelineState){const t=this.GetTimeline();C3.Plugins.Timeline.Cnds.SetTriggerTimeline(t),C3.Plugins.Timeline.Cnds.SetTriggerKeyframe(e);const a=t.GetTimelineManager();a.Trigger(C3.Plugins.Timeline.Cnds.OnAnyKeyframeReached),a.Trigger(C3.Plugins.Timeline.Cnds.OnKeyframeReached),C3.Plugins.Timeline.Cnds.SetTriggerTimeline(null),C3.Plugins.Timeline.Cnds.SetTriggerKeyframe(null)}}AddKeyframe(){const e=this._trackDataItem.GetKeyframeData(),t=e.AddEmptyKeyframeDataItem();return t}AddPropertyTrack(){const e=this._trackDataItem.GetPropertyTrackData(),t=e.AddEmptyPropertyTrackDataItem(),a=C3.PropertyTrackState.Create(this,t);return this._propertyTracks.push(a),a}DeleteKeyframes(e){const t=this._trackDataItem.GetKeyframeData();t.DeleteKeyframeDataItems(e)}DeletePropertyKeyframes(e){for(const t of this._propertyTracks)t.DeletePropertyKeyframes(e)}SaveState(){for(const e of this._propertyTracks)e.SaveState()}CompareInitialStateWithCurrent(){if(this.MaybeGetInstance(),!!this.IsInstanceValid())for(const e of this._propertyTracks)e.CompareInitialStateWithCurrent()}CompareSaveStateWithCurrent(){if(this.MaybeGetInstance(),!this.IsInstanceValid())return;let e=!1;for(const t of this._propertyTracks){const a=t.CompareSaveStateWithCurrent();!e&&a&&(e=!0)}if(e){const e=this.AddKeyframe();e.SetTime(this.GetTimeline().GetTime()),e.SetEase('noease'),e.SetEnable(!0),e.SetTags('')}}_SaveToJson(){return{propertyTracksJson:this._SavePropertyTracksToJson(),lastKeyframeDataItemJson:this._SaveLastKeyframeDataItemToJson(),instanceUid:this._instanceUid}}_LoadFromJson(e){e&&(this._LoadPropertyTracksFromJson(e.propertyTracksJson),this._LoadLastKeyframeDataItemFromJson(e.lastKeyframeDataItemJson),this._LoadInstanceFromJson(e.instanceUid))}_SaveLastKeyframeDataItemToJson(){const e=this._trackDataItem.GetKeyframeData();return e.GetKeyframeDataItemIndex(this._lastKeyframeDataItem)}_SavePropertyTracksToJson(){return this._propertyTracks.map(e=>e._SaveToJson())}_LoadPropertyTracksFromJson(e){e.forEach((e,t)=>{const a=this._propertyTracks[t];a._LoadFromJson(e)})}_LoadInstanceFromJson(e){if(C3.IsFiniteNumber(e)){const t=this.GetRuntime().GetInstanceByUID(e);if(t){const e=this.GetTimeline();e.ClearTrackInstances(),e.SetTrackInstance(this._trackDataItem.GetId(),t)}}}_LoadLastKeyframeDataItemFromJson(e){const t=this._trackDataItem.GetKeyframeData();this._lastKeyframeDataItem=t.GetKeyframeDataItemFromIndex(e)}},'use strict',C3.PropertyTrackState=class extends C3.DefendedBase{constructor(e,t){super(),this._track=e,this._propertyTrackDataItem=t,this._propertyTrackData=t.GetPropertyTrackData(),this._sourceAdapter=this.GetSourceAdapter(),this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray()}static Create(e,t){return C3.New(C3.PropertyTrackState,e,t)}Release(){this._track=null,this._sourceAdapter&&(this._sourceAdapter.Release(),this._sourceAdapter=null),this._propertyKeyframeDataItems=null,this._propertyTrackDataItem=null,this._propertyTrackData=null}GetTrack(){return this._track}GetPropertyTrackDataItem(){return this._propertyTrackDataItem}GetPropertyTrackData(){return this._propertyTrackData}GetTimeline(){return this._track.GetTimeline()}GetRuntime(){return this._track.GetRuntime()}GetSourceAdapter(){if(this._sourceAdapter)return this._sourceAdapter;const e=this._propertyTrackDataItem.GetSourceAdapterId();let t;return'behavior'===e?t=new C3.PropertyTrackState.BehaviorSourceAdapter(this):'effect'===e?t=new C3.PropertyTrackState.EffectSourceAdapter(this):'instance-variable'===e?t=new C3.PropertyTrackState.InstanceVariableSourceAdapter(this):'plugin'===e?t=new C3.PropertyTrackState.PluginSourceAdapter(this):'world-instance'===e?t=new C3.PropertyTrackState.WorldInstanceSourceAdapter(this):'value'===e?t=new C3.PropertyTrackState.ValueSourceAdapter(this):void 0,this._sourceAdapter=t,this._sourceAdapter}GetSourceAdapterId(){return this._propertyTrackDataItem.GetSourceAdapterId()}SetSourceAdapterId(e){this._propertyTrackDataItem.SetSourceAdapterId(e)}GetSourceAdapterArgs(){return this._propertyTrackDataItem.GetSourceAdapterArguments()}SetSourceAdapterArgs(e){this._propertyTrackDataItem.SetSourceAdapterArguments(e)}GetSourceAdapterValue(){return this.GetSourceAdapter().GetValue()}GetPropertyName(){return this._propertyTrackDataItem.GetProperty()}SetPropertyName(e){this._propertyTrackDataItem.SetProperty(e)}GetPropertyType(){return this._propertyTrackDataItem.GetType()}SetPropertyType(e){this._propertyTrackDataItem.SetType(e)}GetPropertyKeyframeType(){return this.GetPropertyTrackData().GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem).GetType()}GetMin(){return this._propertyTrackDataItem.GetMin()}SetMin(e){this._propertyTrackDataItem.SetMin(e)}GetMax(){return this._propertyTrackDataItem.GetMax()}SetMax(e){this._propertyTrackDataItem.SetMax(e)}GetEnable(){return this._propertyTrackDataItem.GetEnable()}SetEnable(e){this._propertyTrackDataItem.SetEnable(e)}GetInterpolationMode(){return this._propertyTrackDataItem.GetInterpolationMode()}SetInterpolationMode(e){this._propertyTrackDataItem.SetInterpolationMode(e)}GetResultMode(){return this._propertyTrackDataItem.GetResultMode()}SetResultMode(e){this._propertyTrackDataItem.SetResultMode(e)}SetEase(e){for(const t of this.GetPropertyKeyframeDataItems())t.SetEase(e)}GetPropertyKeyframeDataItems(){return this._propertyKeyframeDataItems?this._propertyKeyframeDataItems:(this._propertyKeyframeDataItems=this._propertyTrackDataItem.GetPropertyKeyframeData().GetPropertyKeyframeDataItemArray(),this._propertyKeyframeDataItems)}*GetPropertyKeyframeValues(){for(const e of this.GetPropertyKeyframeDataItems())yield e.GetValueWithResultMode()}CleanCaches(){this.GetSourceAdapter().CleanCaches()}SetInitialState(){this.GetSourceAdapter().SetInitialState()}SetResumeState(){this.GetSourceAdapter().SetResumeState()}Interpolate(t,a=!1){const n=this._propertyTrackDataItem;let r=this._propertyTrackData.GetPropertyKeyFrameDataItemAtTime(t,n),i;return r?i=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherThan(t,n):(r=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(t,n),i=this._propertyTrackData.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(t,n)),this.GetSourceAdapter().Interpolate(t,r,i,a)}static GetStartPropertyKeyframeForTime(t,a){const n=a.GetPropertyTrackDataItem(),r=a._propertyTrackData;let i=r.GetPropertyKeyFrameDataItemAtTime(t,n);return i||(i=r.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(t,n)),i}static GetEndPropertyKeyframeForTime(t,a){const n=a.GetPropertyTrackDataItem(),r=a._propertyTrackData;let i=r.GetPropertyKeyFrameDataItemAtTime(t,n);return i?r.GetFirstPropertyKeyFrameDataItemHigherThan(t,n):r.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(t,n)}AddPropertyKeyframe(){const e=this._propertyTrackDataItem.GetPropertyKeyframeData(),t=e.AddEmptyPropertyKeyframeDataItem();return t}DeletePropertyKeyframes(e){const t=this._propertyTrackDataItem.GetPropertyKeyframeData();t.DeletePropertyKeyframeDataItems(e)}SaveState(){this.GetSourceAdapter().SaveState()}CompareInitialStateWithCurrent(){const e=this.GetSourceAdapter().CompareInitialStateWithCurrent();if(e){const e=this._propertyTrackData.GetFirstPropertyKeyframeDataItem(this._propertyTrackDataItem),t=this.GetSourceAdapter().GetCurrentState();e.SetAbsoluteValue(t)}}CompareSaveStateWithCurrent(){const e=this.GetSourceAdapter().CompareSaveStateWithCurrent();return e&&this.AddPropertyKeyframeAtCurrentTime(),this.GetSourceAdapter().ClearSaveState(),e}AddPropertyKeyframeAtCurrentTime(){const e=this.GetTimeline().GetTime(),t=this.GetSourceAdapter(),a=C3.PropertyTrackState.GetStartPropertyKeyframeForTime(e,this),n=this.AddPropertyKeyframe();n.SetType(a.GetType()),n.SetTime(e),n.SetEase(a.GetEase()),n.SetEnable(!0),n.SetValue(t.GetValueAtTime()),n.SetAbsoluteValue(t.GetCurrentState())}_SaveToJson(){return{sourceAdapterJson:this.GetSourceAdapter()._SaveToJson()}}_LoadFromJson(e){e&&this.GetSourceAdapter()._LoadFromJson(e.sourceAdapterJson)}},'use strict';{const t=C3.PropertyTrackState;t.PropertySourceAdapter=class{constructor(e){this._propertyTrack=e,this._propertyAdapter=null}Release(){this._propertyAdapter&&(this._propertyAdapter.Release(),this._propertyAdapter=null),this._propertyTrack=null}GetPropertyTrack(){return this._propertyTrack}CleanCaches(){this._propertyAdapter&&this._propertyAdapter.CleanCaches()}GetPropertyAdapter(){return this._propertyAdapter?this._propertyAdapter:(this._propertyAdapter=this._CreatePropertyAdapter(),this._propertyAdapter)}GetEditorIndex(){}GetIndex(){return this.GetEditorIndex()}GetTarget(){}SetInitialState(){this.GetPropertyAdapter().SetInitialState()}SetResumeState(){this.GetPropertyAdapter().SetResumeState()}Interpolate(a,n,r,i){const e=t.PropertySourceAdapter.GetInterpolateFunc(this._propertyTrack),s=e(a,n,r,this._propertyTrack);return this.GetPropertyAdapter().ChangeProperty(a,s,n,r,i)}SaveState(){this.GetPropertyAdapter().SetSaveState()}ClearSaveState(){this.GetPropertyAdapter().ClearSaveState()}GetCurrentState(){return this.GetPropertyAdapter().GetCurrentState()}CompareInitialStateWithCurrent(){return this.GetPropertyAdapter().CompareInitialStateWithCurrent()}CompareSaveStateWithCurrent(){return this.GetPropertyAdapter().CompareSaveStateWithCurrent()}GetValueAtTime(){return t.PropertySourceAdapter.GetValueAtTime(this._propertyTrack)}_CreatePropertyAdapter(){const e=this._propertyTrack.GetPropertyType(),a=this._propertyTrack.GetPropertyKeyframeType();return'combo'===a||'boolean'===a||'text'===a||'string'===a?new t.PropertyInterpolationAdapter.NoInterpolationAdapter(this):'numeric'===a||'number'===a||'angle'===a?'combo'===e?new t.PropertyInterpolationAdapter.NoInterpolationAdapter(this):new t.PropertyInterpolationAdapter.NumericInterpolationAdapter(this):'color'===a||'offsetColor'===a?new t.PropertyInterpolationAdapter.ColorInterpolationAdapter(this):void 0}_SaveToJson(){return{propertyAdapterJson:this.GetPropertyAdapter()._SaveToJson()}}_LoadFromJson(e){e&&this.GetPropertyAdapter()._LoadFromJson(e.propertyAdapterJson)}static GetValueAtTime(a){const n=a.GetTrack(),r=n.GetTimeline().GetTime(),i=t.GetStartPropertyKeyframeForTime(r,a),e=t.GetEndPropertyKeyframeForTime(r,a),s=t.PropertySourceAdapter.GetInterpolateFunc(a);return s(r,i,e,a)}static GetValue(e,t,a){let n=e.GetResultMode();return'combo'===e.GetPropertyType()&&(n='absolute'),'relative'===n?t+a:'absolute'===n?a:void 0}static GetInterpolateFunc(e){const a=e.GetPropertyKeyframeType();return'numeric'===a?t.NumericTypeAdapter.Interpolate:'angle'===a?t.AngleTypeAdapter.Interpolate:'boolean'===a?t.BooleanTypeAdapter.Interpolate:'color'===a?t.ColorTypeAdapter.Interpolate:'text'===a?t.TextTypeAdapter.Interpolate:void 0}static GetWillChangeFunc(e){const a=e.GetPropertyKeyframeType();return'numeric'===a?t.NumericTypeAdapter.WillChange:'angle'===a?t.AngleTypeAdapter.WillChange:'boolean'===a?t.BooleanTypeAdapter.WillChange:'color'===a?t.ColorTypeAdapter.WillChange:'text'===a?t.TextTypeAdapter.WillChange:void 0}}}{class e extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e)}}C3.PropertyTrackState.WorldInstanceSourceAdapter=e}{const e=0;class t extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e),this._updatedIndex=NaN}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[e]}GetIndex(){return this._updatedIndex?this._updatedIndex:super.GetIndex()}GetTarget(){return this._propertyTrack.GetTrack().GetInstance()}UpdateInstanceVariableIndex(t){const a=this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[e];a===t||(this._updatedIndex=t)}Interpolate(e,t,a,n){this.GetPropertyAdapter().CanChange(t.GetValue())&&super.Interpolate(e,t,a,n)}_SaveToJson(){return Object.assign(super._SaveToJson(),{index:this._updatedIndex})}_LoadFromJson(e){e&&(super._LoadFromJson(e),this._updatedIndex=e.index)}}C3.PropertyTrackState.InstanceVariableSourceAdapter=t}{const t=0;class e extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e),this._sid=NaN}GetEditorIndex(){const e=this._propertyTrack.GetPropertyTrackDataItem();return e.GetSourceAdapterArguments()[1]}GetTarget(){const a=this._propertyTrack.GetPropertyTrackDataItem(),n=this._propertyTrack.GetTrack(),r=this._sid?this._sid:a.GetSourceAdapterArguments()[t],i=n.GetInstance(),e=i.GetBehaviorIndexBySID(r),s=i.GetBehaviorInstances()[e];return s.GetSdkInstance()}GetBehaviorType(e){const t=this._propertyTrack.GetPropertyTrackDataItem(),a=t.GetSourceAdapterArguments()[2];return e.GetBehaviorTypeByName(a)}UpdateBehaviorTypeSid(e){const a=this._propertyTrack.GetPropertyTrackDataItem();a.GetSourceAdapterArguments()[t]===e||(this._sid=e)}Interpolate(t,a,n,r){const i=this._propertyTrack.GetTrack(),e=i.GetInstance();this.GetBehaviorType(e.GetObjectClass())&&super.Interpolate(t,a,n,r)}_SaveToJson(){return Object.assign(super._SaveToJson(),{sid:this._sid})}_LoadFromJson(e){e&&(super._LoadFromJson(e),this._sid=e.sid)}}C3.PropertyTrackState.BehaviorSourceAdapter=e}{class e extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[1]}GetTarget(){const t=this._propertyTrack,a=t.GetTrack(),n=a.GetWorldInfo(),r=n.GetInstanceEffectList(),i=r.GetEffectList(),e=this.GetEffectType(i),s=e.GetIndex();return r.IsEffectIndexActive(s)?r.GetEffectParametersForIndex(s):null}GetEffectType(e){const t=this._propertyTrack,a=t.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0];return e.GetEffectTypeByName(a)}Interpolate(e,t,a,n){this._IsEffectActive()&&super.Interpolate(e,t,a,n)}_IsEffectActive(){const t=this._propertyTrack,a=t.GetTrack(),n=a.GetWorldInfo(),r=n.GetInstanceEffectList(),i=r.GetEffectList(),e=this.GetEffectType(i);if(e){const t=e.GetIndex();return r.IsEffectIndexActive(t)}}}C3.PropertyTrackState.EffectSourceAdapter=e}{class e extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e)}GetEditorIndex(){return this._propertyTrack.GetPropertyTrackDataItem().GetSourceAdapterArguments()[0]}GetTarget(){return this._propertyTrack.GetTrack().GetInstance().GetSdkInstance()}Interpolate(t,a,n,r){const i=this._propertyTrack.GetTrack(),e=i.GetObjectClass().GetPlugin(),s=i.GetInstance().GetObjectClass().GetPlugin();e!==s||super.Interpolate(t,a,n,r)}}C3.PropertyTrackState.PluginSourceAdapter=e}{class e extends C3.PropertyTrackState.PropertySourceAdapter{constructor(e){super(e),this._value=0}SetInitialState(){const e=this._propertyTrack.GetPropertyTrackData();let t=this._propertyTrack.GetPropertyTrackDataItem();t=e.GetFirstPropertyKeyframeDataItem(t),this._value=t.GetValueWithResultMode()}SetResumeState(){}GetValue(){return this._value}Interpolate(e,t,a){const n=C3.PropertyTrackState.NumericTypeAdapter.Interpolate;this._value=n(e,t,a,this._propertyTrack)}SaveState(){}ClearSaveState(){}GetCurrentState(){return this._value}CompareInitialStateWithCurrent(){return!1}CompareSaveStateWithCurrent(){return!1}_SaveToJson(){return{value:this._value}}_LoadFromJson(e){e&&(this._value=e.value)}}C3.PropertyTrackState.ValueSourceAdapter=e}'use strict',C3.PropertyTrackState.PropertyInterpolationAdapter=class{constructor(e){this._sourceAdapter=e,this._propertyTrack=e.GetPropertyTrack(),this._worldInfo=this._propertyTrack.GetTrack().GetWorldInfo(),this._property=this._propertyTrack.GetPropertyName(),this._firstAbsoluteUpdate=!1,this._saveState=null,this._target=null}Release(){this._sourceAdapter=null,this._propertyTrack=null,this._worldInfo=null,this._saveState=null,this._target=null}CleanCaches(){this._worldInfo=null,this._saveState=null,this._target=null}GetWorldInfo(){return this._worldInfo?this._worldInfo:(this._worldInfo=this._propertyTrack.GetTrack().GetWorldInfo(),this._worldInfo)}SetFirstAbsoluteUpdate(e){this._firstAbsoluteUpdate=!!e}GetFirstAbsoluteUpdate(){return this._firstAbsoluteUpdate}SetInitialState(){}SetResumeState(){}SetSaveState(){this._saveState=this.GetCurrentState()}ClearSaveState(){this._saveState=null}GetCurrentState(){}CompareInitialStateWithCurrent(){}CompareSaveStateWithCurrent(){}CanChange(e){const t=typeof this._Getter();return t==typeof e}ChangeProperty(){}_FirstKeyframeGetter(){const e=this._PickTimelinePlaybackMode(()=>{const e=this._propertyTrack.GetPropertyTrackDataItem(),t=this._propertyTrack.GetPropertyTrackData();return t.GetFirstPropertyKeyframeDataItem(e)},()=>{const e=this._propertyTrack.GetPropertyTrackDataItem(),t=this._propertyTrack.GetPropertyTrackData();return t.GetLastPropertyKeyframeDataItem(e)});return e.GetAbsoluteValue()}_CurrentKeyframeGetter(){const e=this._propertyTrack.GetTimeline(),t=e.GetTime(),a=this._PickTimelinePlaybackMode(()=>{const e=this._propertyTrack.GetPropertyTrackDataItem(),a=this._propertyTrack.GetPropertyTrackData();return a.GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(t,e)},()=>{const e=this._propertyTrack.GetPropertyTrackDataItem(),a=this._propertyTrack.GetPropertyTrackData(),n=a.GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(t,e);return n?n:a.GetLastPropertyKeyframeDataItem(e)});return a.GetAbsoluteValue()}_PickTimelinePlaybackMode(e,t){const a=this._propertyTrack.GetTimeline();return a.IsForwardPlayBack()?e():t()}_PickResultMode(e,t){const a=this._propertyTrack.GetResultMode();return'relative'===a?e():t()}_PickFirstAbsoluteUpdate(e,t){return this.GetFirstAbsoluteUpdate()?(this.SetFirstAbsoluteUpdate(!1),e()):t()}_GetAbsoluteInitialValue(){}_GetIndex(){return this._sourceAdapter.GetIndex()}_GetTarget(){return this._target?this._target:(this._target=this._sourceAdapter.GetTarget(),this._target)}_PickSource(t,a,n,r,i){const e=this._propertyTrack.GetSourceAdapterId();return'behavior'===e?t():'effect'===e?a():'instance-variable'===e?n():'plugin'===e?r():'world-instance'===e?i():void 0}_SaveToJson(){return{firstAbsoluteUpdate:this._firstAbsoluteUpdate,saveState:this._saveState}}_LoadFromJson(e){e&&(this._firstAbsoluteUpdate=e.firstAbsoluteUpdate,this._saveState=e.saveState)}},'use strict';{class e extends C3.PropertyTrackState.PropertyInterpolationAdapter{constructor(e){super(e),this._lastValueR=0,this._lastValueG=0,this._lastValueB=0}SetInitialState(){this.SetFirstAbsoluteUpdate(!0);const e=this._GetAbsoluteInitialValue(this._FirstKeyframeGetter());this._lastValueR=e.getR(),this._lastValueG=e.getG(),this._lastValueB=e.getB()}SetResumeState(){if(!this._CompareColors(this._FirstKeyframeGetter(),this._CurrentKeyframeGetter())){this.SetFirstAbsoluteUpdate(!0);const e=this._GetAbsoluteInitialValue(this._CurrentKeyframeGetter());this._lastValueR=e.getR(),this._lastValueG=e.getG(),this._lastValueB=e.getB()}}GetCurrentState(){const e=this._propertyTrack.GetSourceAdapterId(),t=this._GetTarget(),a=this._GetIndex();switch(e){case'behavior':t.GetPropertyValueByIndex(a);break;case'effect':return t[a].toArray().slice(0,3);case'plugin':return t.GetPropertyValueByIndex(a);case'world-instance':return this._Getter().toArray().slice(0,3);}}CompareInitialStateWithCurrent(){const e=this._FirstKeyframeGetter();return!this._CompareColors(e,this._Getter())}CompareSaveStateWithCurrent(){return!C3.IsNullOrUndefined(this._saveState)&&!this._CompareColors(this._saveState,this._Getter())}_CompareColors(e,t){return e.equalsIgnoringAlpha(t)}_FirstKeyframeGetter(){const e=super._FirstKeyframeGetter();return this._GetColorFromArray(e)}_CurrentKeyframeGetter(){const e=super._CurrentKeyframeGetter();return this._GetColorFromArray(e)}_GetAbsoluteInitialValue(e){const t=this._GetColorFromArray(e);return C3.Color.Diff(t,this._Getter())}_GetColorFromArray(e){return C3.IsInstanceOf(e,C3.Color)?e:new C3.Color(e[0],e[1],e[2])}CanChange(){return!0}ChangeProperty(t,a){const n=a[0],r=a[1],e=a[2],i=this._lastValueR,s=this._lastValueG,l=this._lastValueB;return this._PickFirstAbsoluteUpdate(()=>{this._Setter(-i,-s,-l)},()=>{this._Setter(-i+n,-s+r,-l+e)}),this._lastValueR=n,this._lastValueG=r,this._lastValueB=e,C3.TimelineState.LAYOUT_RENDER_CHANGE}_Getter(){const e=this._propertyTrack.GetSourceAdapterId(),t=this._GetTarget(),a=this._GetIndex();return'behavior'===e?this._GetColorFromArray(t.GetPropertyValueByIndex(a)):'effect'===e?t[a].clone():'plugin'===e?this._GetColorFromArray(t.GetPropertyValueByIndex(a)):'world-instance'===e?this.GetWorldInfo().GetUnpremultipliedColor().clone():void 0}_Setter(t,a,n){const r=this._propertyTrack.GetSourceAdapterId(),i=this._GetTarget(),e=this._GetIndex();'behavior'===r?i.SetPropertyColorOffsetValueByIndex(e,t,a,n):'effect'===r?i[e].addRgb(t,a,n):'plugin'===r?i.SetPropertyColorOffsetValueByIndex(e,t,a,n):'world-instance'===r?this.GetWorldInfo().OffsetUnpremultipliedColorRGB(t,a,n):void 0}_SaveToJson(){return Object.assign(super._SaveToJson(),{r:this._lastValueR,g:this._lastValueG,b:this._lastValueB})}_LoadFromJson(e){e&&(super._LoadFromJson(e),this._lastValueR=e.r,this._lastValueG=e.g,this._lastValueB=e.b)}}C3.PropertyTrackState.PropertyInterpolationAdapter.ColorInterpolationAdapter=e}{class e extends C3.PropertyTrackState.PropertyInterpolationAdapter{constructor(e){super(e)}SetInitialState(){}SetResumeState(){}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){const e=this._FirstKeyframeGetter();return e!==this.GetCurrentState()}CompareSaveStateWithCurrent(){return!C3.IsNullOrUndefined(this._saveState)&&this._saveState!==this.GetCurrentState()}ChangeProperty(t,a){const n=C3.PropertyTrackState.PropertySourceAdapter.GetWillChangeFunc(this._propertyTrack),r=this._propertyTrack.GetSourceAdapterId(),i=n(this._GetIndex(),this._GetTarget(),a,r);if(i)return this._Setter(a),'behavior'===r||'effect'===r||'instance-variable'===r?void 0:'plugin'===r?C3.TimelineState.LAYOUT_RENDER_CHANGE:void 0}_Getter(){const e=this._propertyTrack.GetSourceAdapterId(),t=this._GetTarget(),a=this._GetIndex();switch(e){case'behavior':return t.GetPropertyValueByIndex(a);case'effect':return t[a];case'instance-variable':return t.GetInstanceVariableValue(a);case'plugin':return t.GetPropertyValueByIndex(a);;}}_Setter(e){const t=this._propertyTrack.GetSourceAdapterId(),a=this._GetTarget(),n=this._GetIndex();'behavior'===t?a.SetPropertyValueByIndex(n,e):'effect'===t?a[n]=e:'instance-variable'===t?a.SetInstanceVariableValue(n,e):'plugin'===t?a.SetPropertyValueByIndex(n,e):void 0}}C3.PropertyTrackState.PropertyInterpolationAdapter.NoInterpolationAdapter=e}{const t=new Map,e=(a,n,r,i)=>t.set(a,{setter:n,getter:r,round:i});e('offsetX',(e,t)=>e.OffsetX(t),e=>e.GetX(),!0),e('offsetY',(e,t)=>e.OffsetY(t),e=>e.GetY(),!0),e('offsetWidth',(e,t)=>e.OffsetWidth(t),e=>e.GetWidth(),!0),e('offsetHeight',(e,t)=>e.OffsetHeight(t),e=>e.GetHeight(),!0),e('offsetAngle',(e,t)=>e.OffsetAngle(t),e=>e.GetAngle(),!1),e('offsetOpacity',(e,t)=>e.OffsetOpacity(t),e=>e.GetOpacity(),!1),e('offsetOriginX',(e,t)=>e.OffsetOriginX(t),e=>e.GetOriginX(),!1),e('offsetOriginY',(e,t)=>e.OffsetOriginY(t),e=>e.GetOriginY(),!1),e('offsetZElevation',(e,t)=>e.OffsetZElevation(t),e=>e.GetZElevation(),!0);class a extends C3.PropertyTrackState.PropertyInterpolationAdapter{constructor(e){super(e),this._lastValue=0,this._instance_getter=null,this._instance_setter=null,this._round=!1;const a=this._propertyTrack.GetPropertyName();if('world-instance'===this._propertyTrack.GetSourceAdapterId()){const e=t.get(a);this._instance_getter=e.getter,this._instance_setter=e.setter,this._round=e.round}}Release(){this._instance_getter=null,this._instance_setter=null,super.Release()}SetInitialState(){this._lastValue=this._PickResultMode(()=>this._PickTimelinePlaybackMode(()=>0,()=>C3.PropertyTrackState.PropertySourceAdapter.GetValueAtTime(this._propertyTrack)),()=>(this.SetFirstAbsoluteUpdate(!0),this._GetAbsoluteInitialValue(this._FirstKeyframeGetter())))}SetResumeState(){this._FirstKeyframeGetter()===this._CurrentKeyframeGetter()||this._PickResultMode(()=>{},()=>{this.SetFirstAbsoluteUpdate(!0),this._lastValue=this._GetAbsoluteInitialValue(this._CurrentKeyframeGetter())})}GetCurrentState(){return this._Getter()}CompareInitialStateWithCurrent(){const e=this._FirstKeyframeGetter();return e!==this.GetCurrentState()}CompareSaveStateWithCurrent(){return!C3.IsNullOrUndefined(this._saveState)&&this._saveState!==this.GetCurrentState()}_GetAbsoluteInitialValue(e){return e-this.GetCurrentState()}ChangeProperty(t,a,n,r,i){return this._PickResultMode(()=>{this._Setter(a-this._lastValue,n,r),this._MaybeEnsureValue(t,n,r,i,this._lastValue,a)},()=>{this._PickFirstAbsoluteUpdate(()=>{this._Setter(this._lastValue,n,r)},()=>{this._Setter(a-this._lastValue,n,r),this._MaybeEnsureValue(t,n,r,i,this._lastValue,a)})}),this._lastValue=a,this._PickSource(()=>{},()=>C3.TimelineState.LAYOUT_RENDER_CHANGE,()=>{},()=>C3.TimelineState.LAYOUT_RENDER_CHANGE,()=>C3.TimelineState.LAYOUT_RENDER_CHANGE)}_Getter(){const e=this._GetTarget(),t=this._GetIndex();return this._PickSource(()=>e.GetPropertyValueByIndex(t),()=>e[t],()=>e.GetInstanceVariableValue(t),()=>e.GetPropertyValueByIndex(t),()=>this._instance_getter(this.GetWorldInfo()))}_Setter(e){const t=this._GetTarget(),a=this._GetIndex();this._PickSource(()=>t.OffsetPropertyValueByIndex(a,e),()=>t[a]+=e,()=>t.SetInstanceVariableOffset(a,e),()=>t.OffsetPropertyValueByIndex(a,e),()=>this._instance_setter(this.GetWorldInfo(),e))}_MaybeEnsureValue(t,a,n,r,i,e){r?a&&t===a.GetTime()?this._AddDelta(a.GetValueWithResultMode(),a,n):n&&t===n.GetTime()?this._AddDelta(n.GetValueWithResultMode(),a,n):!n&&this._AddDelta(a.GetValueWithResultMode(),a,n):a&&t===a.GetTime()?this._AddDelta(a.GetValueWithResultMode(),a,n):n&&t===n.GetTime()?this._AddDelta(n.GetValueWithResultMode(),a,n):0==e-i&&this._AddDelta(a.GetValueWithResultMode(),a,n)}_AddDelta(t,a,n){const r=t.toString(),i=r.split('.')[1]||'',e=i.length,s=this._Getter();let l;l=0===e?this._round?Math.round(s):s:C3.toFixed(s,e),this._Setter(l-s,a,n)}_SaveToJson(){return Object.assign(super._SaveToJson(),{v:this._lastValue})}_LoadFromJson(e){e&&(super._LoadFromJson(e),this._lastValue=e.v)}}C3.PropertyTrackState.PropertyInterpolationAdapter.NumericInterpolationAdapter=a}'use strict',C3.PropertyTrackState.NumericTypeAdapter=class{constructor(){}static WillChange(t,a,n,r){let i;return'behavior'===r?i=a.GetPropertyValueByIndex(t):'effect'===r?i=a[t]:'instance-variable'===r?i=a.GetInstanceVariableValue(t):'plugin'===r?i=a.GetPropertyValueByIndex(t):void 0,i!==n}static Interpolate(t,r,s,_){var d=Math.floor;if(!s){let e=_.GetPropertyTrackDataItem();const t=_.GetPropertyTrackData();return e=t.GetLastPropertyKeyframeDataItem(e),e.GetValueWithResultMode()}let u=_.GetInterpolationMode();if('default'===u&&(u='continuous'),'combo'===_.GetPropertyType()&&(u='discrete'),'discrete'===u)return r.GetValueWithResultMode();if('continuous'===u||'step'===u){if('step'===u){const e=_.GetTimeline().GetStep();if(0!==e){const a=1/e;t=d(t*a)/a}}const c=r.GetTime(),g=s.GetTime(),i=r.GetValueWithResultMode(),p=s.GetValueWithResultMode();if(i===p)return i;const h=C3.normalize(t,c,g),l=r.GetEase();let m;const e=r.GetAddOn('cubic-bezier'),n=s.GetAddOn('cubic-bezier');if(e&&e.GetStartEnable()&&n&&n.GetEndEnable()){const t=g-c;m=Ease.GetEase(l)(t*h,0,1,t),m=Ease.GetEase('cubicbezier')(m,i,i+e.GetStartAnchor(),p+n.GetEndAnchor(),p)}else m=Ease.GetEase(l)((g-c)*h,i,p-i,g-c);return'integer'===_.GetPropertyType()?d(m):m}}},'use strict',C3.PropertyTrackState.AngleTypeAdapter=class{constructor(){}static WillChange(t,a,n,r){let i;return'behavior'===r?i=a.GetPropertyValueByIndex(t):'effect'===r?i=a[t]:'instance-variable'===r?i=a.GetInstanceVariableValue(t):'plugin'===r?i=a.GetPropertyValueByIndex(t):void 0,i!==n}static Interpolate(t,n,r,i){if(!r){let e=i.GetPropertyTrackDataItem();const t=i.GetPropertyTrackData();return e=t.GetLastPropertyKeyframeDataItem(e),e.GetValueWithResultMode()}let s=i.GetInterpolationMode();if('default'===s&&(s='continuous'),'combo'===i.GetPropertyType()&&(s='discrete'),'discrete'===s)return n.GetValueWithResultMode();if('continuous'===s||'step'===s){if('step'===s){const e=i.GetTimeline().GetStep();if(0!==e){const a=1/e;t=Math.floor(t*a)/a}}const e=n.GetTime(),a=r.GetTime(),l=n.GetValueWithResultMode(),_=r.GetValueWithResultMode();if(l===_)return l;let d=C3.normalize(t,e,a);const u=Ease.GetEase(n.GetEase());return C3.angleLerp(l,_,u(d,0,1,1))}}},'use strict',C3.PropertyTrackState.BooleanTypeAdapter=class{constructor(){}static WillChange(t,a,n,r){let i;return'behavior'===r?i=a.GetPropertyValueByIndex(t):'effect'===r?i=a[t]:'instance-variable'===r?i=a.GetInstanceVariableValue(t):'plugin'===r?i=a.GetPropertyValueByIndex(t):void 0,!!i!=!!n}static Interpolate(e,t,a,n){if(!a){let e=n.GetPropertyTrackDataItem();const t=n.GetPropertyTrackData();return e=t.GetLastPropertyKeyframeDataItem(e),e.GetValueWithResultMode()?1:0}return t.GetValueWithResultMode()?1:0}},'use strict';{const _=[0,0,0],t=[0,0,0];C3.PropertyTrackState.ColorTypeAdapter=class{constructor(){}static WillChange(a,n,r,e){var i=Math.floor;let s;return'behavior'===e?s=n.GetPropertyValueByIndex(a):'effect'===e?s=n[a]:'instance-variable'===e?s=n.GetInstanceVariableValue(a):'plugin'===e?s=n.GetPropertyValueByIndex(a):void 0,Array.isArray(r)?(_[0]=r[0],_[1]=r[1],_[2]=r[2]):(TEMP_COLOR_ARRAY_3.parseCommaSeparatedRgb(r),_[0]=i(255*TEMP_COLOR_ARRAY_3.getR()),_[1]=i(255*TEMP_COLOR_ARRAY_3.getG()),_[2]=i(255*TEMP_COLOR_ARRAY_3.getB())),Array.isArray(s)?(t[0]=s[0],t[1]=s[1],t[2]=s[2]):(TEMP_COLOR_ARRAY_3.parseCommaSeparatedRgb(s),t[0]=i(255*TEMP_COLOR_ARRAY_3.getR()),t[1]=i(255*TEMP_COLOR_ARRAY_3.getG()),t[2]=i(255*TEMP_COLOR_ARRAY_3.getB())),_[0]!==t[0]||_[1]!==t[1]||_[2]!==t[2]}static Interpolate(y,a,c,t){if(!c){let a=t.GetPropertyTrackDataItem();const n=t.GetPropertyTrackData();a=n.GetLastPropertyKeyframeDataItem(a);const r=a.GetValueWithResultMode();return _[0]=r[0],_[1]=r[1],_[2]=r[2],_}let d=t.GetInterpolationMode();if('default'===d&&(d='continuous'),'discrete'===d){const e=a.GetValueWithResultMode();return _[0]=e[0],_[1]=e[1],_[2]=e[2],_}if('continuous'===d||'step'===d){if('step'===d){const e=t.GetTimeline().GetStep();if(0!==e){const t=1/e;y=Math.floor(y*t)/t}}const g=a.GetTime(),h=c.GetTime(),i=a.GetValueWithResultMode(),f=c.GetValueWithResultMode(),S=C3.normalize(y,g,h),l=a.GetEase(),m=i[0],e=i[1],n=i[2],G=f[0],p=f[1],I=f[2],r=Ease.GetEase(l),s=h-g,T=s*S;return _[0]=m===G?m:r(T,m,G-m,s),_[1]=e===p?e:r(T,e,p-e,s),_[2]=n===I?n:r(T,n,I-n,s),_}}}}'use strict',C3.PropertyTrackState.TextTypeAdapter=class{constructor(){}static WillChange(t,a,n,r){let i;return'behavior'===r?i=a.GetPropertyValueByIndex(t):'effect'===r?i=a[t]:'instance-variable'===r?i=a.GetInstanceVariableValue(t):'plugin'===r?i=a.GetPropertyValueByIndex(t):void 0,i!==n}static Interpolate(e,t,a,n){if(!a){let e=n.GetPropertyTrackDataItem();const t=n.GetPropertyTrackData();return e=t.GetLastPropertyKeyframeDataItem(e),e.GetValueWithResultMode()}return t.GetValueWithResultMode()}},'use strict',C3.TimelineDataManager=class{constructor(){this._timelineDataItems=new Map}Release(){for(const e of this._timelineDataItems.values())e.Release();this._timelineDataItems.clear(),this._timelineDataItems=null}Add(e){const t=new C3.TimelineDataItem(e),a=t.GetName();this._timelineDataItems.set(a,t)}Get(e){return this._timelineDataItems.get(e)}GetNameId(){return 0}static _CreateDataItems(t,a,n,r){if(a)for(const i of a)C3.TimelineDataManager._CreateDataItem('create',i,t,n,r)}static _LoadDataItemsFromJson(e,t,a,n){e.length?t.forEach((t,a)=>{e[a]._LoadFromJson(t)}):t.forEach(t=>{C3.TimelineDataManager._CreateDataItem('load',t,e,a,n)})}static _CreateDataItem(t,a,n,r,i){let e;if('function'==typeof r)'load'===t?e=new r(null,i):'create'===t?e=new r(a,i):void 0;else if('object'==typeof r){const n=r.prop,s=a[n],l=r.map.get(s);'load'===t?e=new l(null,i):'create'===t?e=new l(a,i):void 0}switch(t){case'load':e._LoadFromJson(a),n.push(e);break;case'create':if('function'==typeof e.GetEnable&&!e.GetEnable())return e.Release();n.push(e);}}},'use strict',C3.TimelineDataItem=class{constructor(e){this._name='',this._totalTime=NaN,this._step=0,this._interpolationMode='default',this._resultMode='default',this._loop=!1,this._pingPong=!1,this._repeatCount=1,this._trackData=null,e&&(this._name=e[0],this._totalTime=e[1],this._step=e[2],this._interpolationMode=e[3],this._resultMode=e[4],this._loop=!!e[6],this._pingPong=!!e[7],this._repeatCount=e[8],this._trackData=new C3.TrackData(e[5],this))}Release(){this._trackData.Release(),this._trackData=null}GetTrackData(){return this._trackData||(this._trackData=new C3.TrackData(null,this)),this._trackData}GetName(){return this._name}SetName(e){this._name=e}GetTotalTime(){return this._totalTime}SetTotalTime(e){this._totalTime=e}GetStep(){return this._step}SetStep(e){this._step=e}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(e){this._interpolationMode=e}GetResultMode(){return this._resultMode}SetResultMode(e){this._resultMode=e}GetLoop(){return this._loop}GetPingPong(){return this._pingPong}GetRepeatCount(){return this._repeatCount}_SaveToJson(){return{trackDataJson:this._trackData._SaveToJson(),name:this._name,totalTime:this._totalTime,step:this._step,interpolationMode:this._interpolationMode,resultMode:this._resultMode,loop:this._loop,pingPong:this._pingPong,repeatCount:this._repeatCount}}_LoadFromJson(e){e&&(this.GetTrackData()._LoadFromJson(e.trackDataJson),this._name=e.name,this._totalTime=e.totalTime,this._step=e.step,this._interpolationMode=e.interpolationMode,this._resultMode=e.resultMode,this._loop=e.loop,this._pingPong=e.pingPong,this._repeatCount=e.repeatCount)}},'use strict';{const e=0;class t{constructor(t,a){this._trackData=a,this._instanceData=null,this._instanceUid=NaN,this._objectClassIndex=NaN,this._interpolationMode='default',this._resultMode='default',this._enabled=!1,this._keyframeData=null,this._propertyTrackData=null,this._id='',t&&(this._instanceData=t[e],this._instanceUid=t[e][2],this._objectClassIndex=t[e][1],this._interpolationMode=t[1],this._resultMode=t[2],this._enabled=!!t[3],t[6]&&(this._id=t[6]),this._keyframeData=new C3.KeyframeData(t[4],this),this._propertyTrackData=new C3.PropertyTrackData(t[5],this))}Release(){this._trackData=null,this._keyframeData&&(this._keyframeData.Release(),this._keyframeData=null),this._propertyTrackData&&(this._propertyTrackData.Release(),this._propertyTrackData=null)}GetTrackData(){return this._trackData}GetKeyframeData(){return this._keyframeData||(this._keyframeData=new C3.KeyframeData(null,this)),this._keyframeData}GetPropertyTrackData(){return this._propertyTrackData||(this._propertyTrackData=new C3.PropertyTrackData(null,this)),this._propertyTrackData}GetInstanceData(){return this._instanceData}GetObjectClassIndex(){return this._objectClassIndex}SetObjectClassIndex(e){this._objectClassIndex=e}GetInstanceUID(){return this._instanceUid}SetInstanceUID(e){this._instanceUid=e}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(e){this._interpolationMode=e}GetResultMode(){return this._resultMode}SetResultMode(e){this._resultMode=e}GetEnable(){return this._enabled}SetEnable(e){this._enabled=!!e}GetId(){return this._id}_SaveToJson(){return{keyframeDataJson:this._keyframeData._SaveToJson(),propertyTrackDataJson:this._propertyTrackData._SaveToJson(),instanceData:this._instanceData,instanceUid:this._instanceUid,objectClassIndex:this._objectClassIndex,interpolationMode:this._interpolationMode,resultMode:this._resultMode,enabled:this._enabled,id:this._id}}_LoadFromJson(e){e&&(this._instanceData=e.instanceData,this._instanceUid=e.instanceUid,this._objectClassIndex=e.objectClassIndex,this._interpolationMode=e.interpolationMode,this._resultMode=e.resultMode,this._enabled=e.enabled,this._id=e.id,this.GetKeyframeData()._LoadFromJson(e.keyframeDataJson),this.GetPropertyTrackData()._LoadFromJson(e.propertyTrackDataJson))}}C3.TrackData=class{constructor(e,a){this._timelineData=a,this._trackDataItems=[],this._keyframeTimeMap=new Map,C3.TimelineDataManager._CreateDataItems(this._trackDataItems,e,t,this)}Release(){this._timelineData=null;for(const e of this._trackDataItems)e.Release();C3.clearArray(this._trackDataItems),this._trackDataItems=null,this._keyframeTimeMap.clear(),this._keyframeTimeMap=null}AddEmptyTrackDataItem(){const e=new t(null,this);return this._trackDataItems.push(e),e}GetFirstKeyframeDataItem(e){return e.GetKeyframeData().GetKeyframeDataItemArray()[0]}GetLastKeyframeDataItem(e){const t=e.GetKeyframeData().GetKeyframeDataItemArray();return t[t.length-1]}GetKeyFrameDataItemAtTime(e,t){const a=this._keyframeTimeMap.get(t);if(!!a&&a.has(e))return a.get(e);for(const n of t.GetKeyframeData().keyframeDataItems())if(n.GetTime()===e)return a||this._keyframeTimeMap.set(t,new Map),this._keyframeTimeMap.get(t).set(e,n),n}GetFirstKeyFrameDataItemHigherThan(e,t){for(const a of t.GetKeyframeData().keyframeDataItems())if(a.GetTime()>e)return a}GetFirstKeyFrameDataItemHigherOrEqualThan(e,t){for(const a of t.GetKeyframeData().keyframeDataItems())if(a.GetTime()>=e)return a}GetFirstKeyFrameDataItemLowerOrEqualThan(e,t){for(const a of t.GetKeyframeData().keyframeDataItemsReverse())if(a.GetTime()<=e)return a}*trackDataItems(){for(const e of this._trackDataItems)yield e}_SaveToJson(){return{trackDataItemsJson:this._trackDataItems.map(e=>e._SaveToJson())}}_LoadFromJson(e){e&&C3.TimelineDataManager._LoadDataItemsFromJson(this._trackDataItems,e.trackDataItemsJson,t,this)}}}{const e=0;class t{constructor(t,a){this._propertyTrackData=a,this._sourceAdapterId='',this._sourceAdapterArguments=null,this._property=null,this._type=null,this._min=NaN,this._max=NaN,this._interpolationMode='default',this._resultMode='default',this._enabled=!1,this._propertyKeyframeData=null,t&&(this._sourceAdapterId=t[e][0],this._sourceAdapterArguments=t[e].slice(1),this._property=t[1],this._type=t[2],this._min=t[3],this._max=t[4],this._interpolationMode=t[5],this._resultMode=t[6],this._enabled=!!t[7],this._propertyKeyframeData=new C3.PropertyKeyframeData(t[8],this))}Release(){this._propertyKeyframeData.Release(),this._propertyKeyframeData=null,this._propertyTrackData=null,this._sourceAdapterArguments=null}GetPropertyTrackData(){return this._propertyTrackData}GetPropertyKeyframeData(){return this._propertyKeyframeData||(this._propertyKeyframeData=new C3.PropertyKeyframeData(null,this)),this._propertyKeyframeData}GetSourceAdapterId(){return this._sourceAdapterId}SetSourceAdapterId(e){this._sourceAdapterId=e}GetSourceAdapterArguments(){return this._sourceAdapterArguments}SetSourceAdapterArguments(e){this._sourceAdapterArguments=e}GetProperty(){return this._property}SetProperty(e){this._property=e}GetType(){return this._type}SetType(e){this._type=e}GetMin(){return this._min}SetMin(e){this._min=e}GetMax(){return this._max}SetMax(e){this._max=e}GetInterpolationMode(){return this._interpolationMode}SetInterpolationMode(e){this._interpolationMode=e}GetResultMode(){return this._resultMode}SetResultMode(e){this._resultMode=e}GetEnable(){return this._enabled}SetEnable(e){this._enabled=!!e}_SaveToJson(){return{propertyKeyframeDataJson:this._propertyKeyframeData._SaveToJson(),sourceAdapterId:this._sourceAdapterId,sourceAdapterArguments:this._sourceAdapterArguments,property:this._property,type:this._type,min:this._min,max:this._max,interpolationMode:this._interpolationMode,resultMode:this._resultMode,enabled:this._enabled}}_LoadFromJson(e){e&&(this._sourceAdapterId=e.sourceAdapterId,this._sourceAdapterArguments=e.sourceAdapterArguments,this._property=e.property,this._type=e.type,this._min=e.min,this._max=e.max,this._interpolationMode=e.interpolationMode,this._resultMode=e.resultMode,this._enabled=e.enabled,this.GetPropertyKeyframeData()._LoadFromJson(e.propertyKeyframeDataJson))}}C3.PropertyTrackData=class{constructor(e,a){this._trackDataItem=a,this._propertyTrackDataItems=[],this._propertyKeyframeTimeMap=new Map,C3.TimelineDataManager._CreateDataItems(this._propertyTrackDataItems,e,t,this)}Release(){this._trackDataItem=null;for(const e of this._propertyTrackDataItems)e.Release();C3.clearArray(this._propertyTrackDataItems),this._propertyTrackDataItems=null,this._propertyKeyframeTimeMap.clear(),this._propertyKeyframeTimeMap=null}GetTrackDataItem(){return this._trackDataItem}AddEmptyPropertyTrackDataItem(){const e=new t(null,this);return this._propertyTrackDataItems.push(e),e}GetFirstPropertyKeyframeDataItem(e){const t=e.GetPropertyKeyframeData();return t.GetPropertyKeyframeDataItemArray()[0]}GetLastPropertyKeyframeDataItem(e){const t=e.GetPropertyKeyframeData(),a=t.GetPropertyKeyframeDataItemArray();return a[a.length-1]}GetPropertyKeyFrameDataItemAtTime(t,a){const n=this._propertyKeyframeTimeMap.get(a);if(!!n&&n.has(t))return n.get(t);const r=a.GetPropertyKeyframeData();for(const i of r.propertyKeyframeDataItems())if(i.GetTime()===t)return n||this._propertyKeyframeTimeMap.set(a,new Map),this._propertyKeyframeTimeMap.get(a).set(t,i),i}GetFirstPropertyKeyFrameDataItemHigherThan(e,t){const a=t.GetPropertyKeyframeData();for(const n of a.propertyKeyframeDataItems())if(n.GetTime()>e)return n}GetFirstPropertyKeyFrameDataItemHigherOrEqualThan(e,t){const a=t.GetPropertyKeyframeData();for(const n of a.propertyKeyframeDataItems())if(n.GetTime()>=e)return n}GetFirstPropertyKeyFrameDataItemLowerOrEqualThan(e,t){const a=t.GetPropertyKeyframeData();for(const n of a.propertyKeyframeDataItemsReverse())if(n.GetTime()<=e)return n}*propertyTrackDataItems(){for(const e of this._propertyTrackDataItems)yield e}_SaveToJson(){return{propertyTrackDataItemsJson:this._propertyTrackDataItems.map(e=>e._SaveToJson())}}_LoadFromJson(e){e&&C3.TimelineDataManager._LoadDataItemsFromJson(this._propertyTrackDataItems,e.propertyTrackDataItemsJson,t,this)}}}{class e{constructor(e,t){if(this._keyframeData=t,this._time=-1,this._ease='noease',this._enable=!1,this._tags=null,this._lowerTags=null,!!e){this._time=e[0],this._ease=e[1],this._enable=!!e[2];const t=e[3];this._tags=t?t.split(' '):[],this._lowerTags=new Set(this._tags.map(e=>e.toLowerCase()))}}Release(){this._keyframeData=null,C3.clearArray(this._tags),this._tags=null,this._lowerTags.clear(),this._lowerTags=null}GetKeyframeData(){return this._keyframeData}GetTime(){return this._time}SetTime(e){this._time=e}GetEase(){return this._ease}SetEase(e){this._ease=e}GetEnable(){return this._enable}SetEnable(e){this._enable=!!e}GetTags(){return this._tags}SetTags(e){this._tags=e?e.split(' '):[],this._lowerTags=new Set(this._tags.map(e=>e.toLowerCase()))}GetLowerTags(){return this._lowerTags}HasTag(e){return this._lowerTags.has(e.toLowerCase())}_SaveToJson(){return{time:this._time,ease:this._ease,enable:this._enable,tags:this._tags}}_LoadFromJson(e){e&&(this._time=e.time,this._ease=e.ease,this._enable=e.enable,this._tags=e.tags,this._lowerTags=new Set(this._tags.map(e=>e.toLowerCase())))}}C3.KeyframeData=class{constructor(t,a){this._trackDataItem=a,this._keyframeDataItems=[],C3.TimelineDataManager._CreateDataItems(this._keyframeDataItems,t,e,this)}Release(){this._trackDataItem=null;for(const e of this._keyframeDataItems)e.Release();C3.clearArray(this._keyframeDataItems),this._keyframeDataItems=null}GetTrackDataItem(){return this._trackDataItem}GetKeyframeDataItemCount(){return this._keyframeDataItems.length}GetKeyframeDataItemArray(){return this._keyframeDataItems}AddEmptyKeyframeDataItem(){const t=new e(null,this);return this._keyframeDataItems.push(t),t}DeleteKeyframeDataItems(e){for(const t of this._keyframeDataItems){if(!e(t))continue;const a=this._keyframeDataItems.indexOf(t);-1===a||(t.Release(),this._keyframeDataItems.splice(a,1))}this.SortKeyframeDataItems()}SortKeyframeDataItems(){this._keyframeDataItems.sort((e,t)=>e.GetTime()-t.GetTime())}GetKeyframeDataItemIndex(e){return this._keyframeDataItems.indexOf(e)}GetKeyframeDataItemFromIndex(e){return this._keyframeDataItems[e]}*keyframeDataItems(){for(const e of this._keyframeDataItems)yield e}*keyframeDataItemsReverse(){for(let e=this._keyframeDataItems.length-1;0<=e;e--)yield this._keyframeDataItems[e]}_SaveToJson(){return{keyframeDataItemsJson:this._keyframeDataItems.map(e=>e._SaveToJson())}}_LoadFromJson(t){t&&C3.TimelineDataManager._LoadDataItemsFromJson(this._keyframeDataItems,t.keyframeDataItemsJson,e,this)}}}{const e=0;class t{constructor(t,a){this._propertyKeyframeData=a,this._value=null,this._aValue=null,this._type='',this._time=NaN,this._ease='noease',this._enable=!1,this._addonData=null,t&&(this._value=t[e][0],this._aValue=t[e][1],this._type=t[e][2],this._time=t[1],this._ease=t[2],this._enable=!!t[3],this._addonData=null,!!t[4]&&(this._addonData=new C3.AddonData(t[4],this)))}Release(){this._propertyKeyframeData=null,this._addonData&&(this._addonData.Release(),this._addonData=null)}GetAddonData(){return this._addonData}GetValue(){return this._value}SetValue(e){'color'===this._type&&C3.IsFiniteNumber(e)?(this._value[0]=C3.GetRValue(e),this._value[1]=C3.GetGValue(e),this._value[2]=C3.GetBValue(e)):this._value=e}GetAbsoluteValue(){return this._aValue}SetAbsoluteValue(e){'color'===this._type&&C3.IsFiniteNumber(e)?(this._aValue[0]=C3.GetRValue(e),this._aValue[1]=C3.GetGValue(e),this._aValue[2]=C3.GetBValue(e)):this._aValue=e}GetValueWithResultMode(){const e=this._propertyKeyframeData.GetPropertyTrackDataItem().GetResultMode();return'relative'===e?this.GetValue():'absolute'===e?this.GetAbsoluteValue():void 0}GetType(){return this._type}SetType(e){this._type=e}GetTime(){return this._time}SetTime(e){this._time=e}GetEase(){return this._ease}SetEase(e){this._ease=e}GetEnable(){return this._enable}SetEnable(e){this._enable=!!e}GetAddOn(e){if(this.GetAddonData())for(const t of this.GetAddonData().addonDataItems())if(t.GetId()===e)return t}_SaveToJson(){const e=this._addonData;return{addonDataJson:e?e._SaveToJson():e,value:this._value,aValue:this._aValue,type:this._type,time:this._time,ease:this._ease,enable:this._enable}}_LoadFromJson(e){e&&(e.addonDataJson&&this._addonData._SetFromJson(e.addonDataJson),this._value=e.value,this._aValue=e.aValue,this._type=e.type,this._time=e.time,this._ease=e.ease,this._enable=e.enable)}}C3.PropertyKeyframeData=class{constructor(e,a){this._propertyTrackDataItem=a,this._propertyKeyframeDataItems=[],C3.TimelineDataManager._CreateDataItems(this._propertyKeyframeDataItems,e,t,this)}Release(){this._propertyTrackDataItem=null;for(const e of this._propertyKeyframeDataItems)e.Release();C3.clearArray(this._propertyKeyframeDataItems),this._propertyKeyframeDataItems=null}AddEmptyPropertyKeyframeDataItem(){const e=new t(null,this);return this._propertyKeyframeDataItems.push(e),e}DeletePropertyKeyframeDataItems(e){for(const t of this._propertyKeyframeDataItems){if(!e(t))continue;const a=this._propertyKeyframeDataItems.indexOf(t);-1===a||(t.Release(),this._propertyKeyframeDataItems.splice(a,1))}this.SortPropertyKeyFrameDataItems()}SortPropertyKeyFrameDataItems(){this._propertyKeyframeDataItems.sort((e,t)=>e.GetTime()-t.GetTime())}GetPropertyTrackDataItem(){return this._propertyTrackDataItem}GetPropertyKeyframeDataItemCount(){this._propertyKeyframeDataItems.length}GetPropertyKeyframeDataItemArray(){return this._propertyKeyframeDataItems}*propertyKeyframeDataItems(){for(const e of this._propertyKeyframeDataItems)yield e}*propertyKeyframeDataItemsReverse(){for(let e=this._propertyKeyframeDataItems.length-1;0<=e;e--)yield this._propertyKeyframeDataItems[e]}_SaveToJson(){return{propertyKeyframeDataItemsJson:this._propertyKeyframeDataItems.map(e=>e._SaveToJson())}}_LoadFromJson(e){e&&C3.TimelineDataManager._LoadDataItemsFromJson(this._propertyKeyframeDataItems,e.propertyKeyframeDataItemsJson,t,this)}}}{class e{constructor(e,t){this._addonData=t,this._id=e[0],this._data=e[1]}Release(){this._addonData=null,this._data=null}GetAddonData(){return this._addonData}GetId(){return this._id}_SaveToJson(){return{id:this._id,data:this._data}}_LoadFromJson(e){e&&(this._id=e.id,this._data=e.data)}}class t extends e{constructor(e,t){super(e,t),this._startAnchor=this._data[0],this._startEnable=!!this._data[1],this._endAnchor=this._data[2],this._endEnable=!!this._data[3]}Release(){super.Release()}GetStartAnchor(){return this._startAnchor}GetStartEnable(){return this._startEnable}GetEndAnchor(){return this._endAnchor}GetEndEnable(){return this._endEnable}_SaveToJson(){return Object.assign(super._SaveToJson(),{startAnchor:this._startAnchor,startEnable:!!this._startEnable,endAnchor:this._endAnchor,endEnable:!!this._endEnable})}_LoadFromJson(e){e&&(super._LoadFromJson(e),this._startAnchor=e.startAnchor,this._startEnable=!!e.startEnable,this._endAnchor=e.endAnchor,this._endEnable=!!e.endEnable)}}C3.AddonData=class{constructor(e,a){this._propertyKeyframeDataItem=a,this._addonDataItems=[],C3.TimelineDataManager._CreateDataItems(this._addonDataItems,e,{prop:0,map:new Map([['cubic-bezier',t]])},this)}Release(){this._propertyKeyframeDataItem=null;for(const e of this._addonDataItems)e.Release();C3.clearArray(this._addonDataItems),this._addonDataItems=null}GetPropertyKeyframeDataItem(){return this._propertyKeyframeDataItem}*addonDataItems(){for(const e of this._addonDataItems)yield e}_SaveToJson(){return{addonDataItemsJson:this._addonDataItems.map(e=>e._SaveToJson())}}_LoadFromJson(e){e&&C3.TimelineDataManager._LoadDataItemsFromJson(this._addonDataItems,e.addonDataItemsJson,{prop:'id',map:new Map([['cubic-bezier',t]])},this)}}}{let e=0;C3.Tween=class extends C3.TimelineState{constructor(t,a){super(`tween-${e++}`,t,a),this._id='',this._destroyInstanceOnComplete=!1,this._initialValueMode='start-value',this._on_completed_callbacks=null,this._on_started_callbacks=null}GetInstance(){const e=this.GetTracks();if(e&&e.length){const t=e[0];if(t){const e=t.GetInstance();return t.IsInstanceValid()?e:null}}}AddStartedCallback(e){this._on_started_callbacks||(this._on_started_callbacks=[]),this._on_started_callbacks.push(e)}AddCompletedCallback(e){this._on_completed_callbacks||(this._on_completed_callbacks=[]),this._on_completed_callbacks.push(e)}RemoveStartedCallback(e){if(this._on_started_callbacks){const t=this._on_started_callbacks.indexOf(e);-1!==t&&this._on_started_callbacks.splice(t,1)}}RemoveCompletedCallback(e){if(this._on_completed_callbacks){const t=this._on_completed_callbacks.indexOf(e);-1!==t&&this._on_completed_callbacks.splice(t,1)}}SetStartValue(t,a){for(const e of this._tracks)for(const n of e._propertyTracks){if(n.GetPropertyName()!==a)continue;const r=n.GetPropertyTrackData(),i=n.GetPropertyTrackDataItem(),e=r.GetFirstPropertyKeyframeDataItem(i);propertyKeyframe.SetValue(t),propertyKeyframe.SetAbsoluteValue(t)}}SetEndValue(t,a){for(const e of this._tracks)for(const n of e._propertyTracks){if(n.GetPropertyName()!==a)continue;const r=n.GetPropertyTrackData(),i=n.GetPropertyTrackDataItem(),e=r.GetLastPropertyKeyframeDataItem(i);e.SetValue(t),e.SetAbsoluteValue(t)}}SetId(e){this._id=e}GetId(){return this._id}SetInitialValueMode(e){this._initialValueMode=e}GetInitialValueMode(){return this._initialValueMode}SetDestroyInstanceOnComplete(e){this._destroyInstanceOnComplete=e}GetDestroyInstanceOnComplete(){return this._destroyInstanceOnComplete}OnStarted(){if(this._on_started_callbacks)for(const e of this._on_started_callbacks)e(this);if(!this.IsComplete())for(const e of this._tracks)e.CompareSaveStateWithCurrent()}OnCompleted(){this._completedTick=this._runtime.GetTickCount()}FinishTriggers(){if(!this._finishedTriggers&&(this._finishedTriggers=!0,this._on_completed_callbacks))for(const e of this._on_completed_callbacks)e(this)}SetTime(e){this._DeleteIntermediateKeyframes(),super.SetTime(e)}SetInitialState(e){if(!this.InitialStateSet()&&'current-state'===this.GetInitialValueMode())for(const e of this._tracks)e.CompareInitialStateWithCurrent();super.SetInitialState(e)}Stop(e=!1){if(super.Stop(e),!this.IsComplete())for(const e of this._tracks)e.SaveState()}Reset(){this._DeleteIntermediateKeyframes(),super.Reset()}_DeleteIntermediateKeyframes(){for(const e of this._tracks){const t=e=>{const t=e.GetTime(),a=this.GetTotalTime();return 0!==t&&t!==a};e.DeleteKeyframes(t),e.DeletePropertyKeyframes(t)}}MaybeTriggerKeyframeReachedConditions(){}Tick(){const e=this.GetInstance(),t=this.GetRuntime().GetDt(e);super.Tick(t,1)}_SaveToJson(){const e=super._SaveToJson(),t=this.GetTimelineDataItem();return Object.assign(e,{tweenDataItemJson:t._SaveToJson(),id:this._id,destroyInstanceOnComplete:this._destroyInstanceOnComplete,initialValueMode:this._initialValueMode})}_LoadFromJson(e){if(e){const t=this.GetTimelineDataItem();t._LoadFromJson(e.tweenDataItemJson),super._LoadFromJson(e),this._id=e.id,this._destroyInstanceOnComplete=e.destroyInstanceOnComplete,this._initialValueMode=e.initialValueMode}}static IsPlaying(e){return e.IsPlaying()}static Build(t){const a=t.runtime.GetTimelineManager(),n=new C3.TimelineDataItem;if(t.json){n._LoadFromJson(t.json.tweenDataItemJson);const e=new C3.Tween(n,a);return e._LoadFromJson(t.json),e}else{const r=new C3.Tween(n,a);C3.IsArray(t.propertyTracksConfig)||(t.propertyTracksConfig=[t.propertyTracksConfig]),r.SetId(t.id),r.SetTags(t.tags),r.SetInitialValueMode(t.initialValueMode),r.SetDestroyInstanceOnComplete(t.releaseOnComplete),r.SetTotalTime(t.time),r.SetStep(0),r.SetInterpolationMode('default'),r.SetResultMode(t.propertyTracksConfig[0].resultMode);const i=r.AddTrack();i.SetInstanceUID(t.instance.GetUID()),i.SetInterpolationMode('default'),i.SetResultMode(t.propertyTracksConfig[0].resultMode),i.SetEnable(!0),i.SetObjectClassIndex(t.instance.GetObjectClass().GetIndex());const e=i.AddKeyframe();e.SetTime(0),e.SetEase('noease'),e.SetEnable(!0),e.SetTags('');const s=i.AddKeyframe();s.SetTime(t.time),s.SetEase('noease'),s.SetEnable(!0),s.SetTags('');for(const e of t.propertyTracksConfig){const a=i.AddPropertyTrack();a.SetSourceAdapterId(e.sourceId),a.SetSourceAdapterArgs(e.sourceArgs),a.SetPropertyName(e.property),a.SetPropertyType(e.type),a.SetMin(NaN),a.SetMax(NaN),a.SetInterpolationMode('default'),a.SetResultMode(e.resultMode),a.SetEnable(!0);const n=a.AddPropertyKeyframe();n.SetType(e.valueType),n.SetTime(0),n.SetEase(e.ease),n.SetEnable(!0),n.SetValue(e.startValue),n.SetAbsoluteValue(e.startValue);const r=a.AddPropertyKeyframe();r.SetType(e.valueType),r.SetTime(t.time),r.SetEase(e.ease),r.SetEnable(!0),r.SetValue(e.endValue),r.SetAbsoluteValue(e.endValue)}return r}}}}'use strict',C3.Transition=class extends C3.DefendedBase{constructor(e){super(),this._name=e[0],this._transitionKeyframes=[];for(const t of e[1]){const e=C3.TransitionKeyframe.Create(this,t);this._transitionKeyframes.push(e)}this._precalculatedSamples=new Map,this._transitionKeyframeCache=new Map,this._PreCalcSamples(),Ease.AddCustomEase(this._name,(e,t,a,n)=>this.Interpolate(e,t,a,n))}static Create(e){return C3.New(C3.Transition,e)}Release(){for(const e of this._transitionKeyframes)e.Release();C3.clearArray(this._transitionKeyframes),this._transitionKeyframes=null,this._precalculatedSamples.clear(),this._precalculatedSamples=null,this._transitionKeyframeCache.clear(),this._transitionKeyframeCache=null}GetTransitionKeyFrameAt(e){const t=this._transitionKeyframeCache.get(e);if(t)return t;for(const t of this._transitionKeyframes)if(t.GetValueX()===e)return this._transitionKeyframeCache.set(e,t),t}GetFirstTransitionKeyFrameHigherThan(e){for(const t of this._transitionKeyframes)if(t.GetValueX()>e)return t}GetFirstTransitionKeyFrameHigherOrEqualThan(e){for(const t of this._transitionKeyframes)if(t.GetValueX()>=e)return t}GetFirstTransitionKeyFrameLowerOrEqualThan(e){for(let t=this._transitionKeyframes.length-1;0<=t;t--){const a=this._transitionKeyframes[t];if(a.GetValueX()<=e)return a}}Interpolate(t,a,s,_){const d=t/_;let e=this.GetTransitionKeyFrameAt(d),u=null;e?u=this.GetFirstTransitionKeyFrameHigherThan(d):(e=this.GetFirstTransitionKeyFrameLowerOrEqualThan(d),u=this.GetFirstTransitionKeyFrameHigherOrEqualThan(d));const c=u.GetValueX()-e.GetValueX(),h=C3.mapToRange(d,e.GetValueX(),u.GetValueX(),0,c),i=e.GetValueX(),y=e.GetValueY(),S=e.GetValueX()+e.GetStartAnchorX(),l=e.GetValueY()+e.GetStartAnchorY(),m=u.GetValueX()+u.GetEndAnchorX(),n=u.GetValueY()+u.GetEndAnchorY(),G=u.GetValueX(),p=u.GetValueY();let I=Ease.GetEase('spline')(h,i,y,S,l,m,n,G,p,this._precalculatedSamples.get(e));return I+=e.GetValueY(),(1-I)*a+I*(a+s)}_PreCalcSamples(){this._precalculatedSamples.clear();for(let t=0;tthis._InvokeFunctionFromJS(e,t)}Release(){this.ClearAllScheduledWaits(),this._eventStack.Release(),this._eventStack=null,this._localVarStack.Release(),this._localVarStack=null,C3.clearArray(this._queuedTriggers),C3.clearArray(this._queuedDebugTriggers),this._runtime=null,C3.clearArray(this._allSheets),this._sheetsByName.clear()}Create(e){const t=C3.New(C3.EventSheet,this,e);this._allSheets.push(t),this._sheetsByName.set(t.GetName().toLowerCase(),t)}_AddTriggerToPostInit(e){this._triggersToPostInit.push(e)}_PostInit(){for(const e of this._functionBlocksByName.values())e._PostInit(!1);for(const e of this._allSheets)e._PostInit();for(const e of this._allSheets)e._UpdateDeepIncludes();for(const e of this._triggersToPostInit)e._PostInit(!1);C3.clearArray(this._triggersToPostInit),this._localVarStack._SetInitialValues(this._localVarInitialValues)}GetRuntime(){return this._runtime}GetEventSheetByName(e){return this._sheetsByName.get(e.toLowerCase())||null}_RegisterGroup(e){this._allGroups.push(e),this._groupsByName.set(e.GetGroupName(),e)}_RegisterEventBlock(e){this._blocksBySid.set(e.GetSID(),e)}_RegisterCondition(e){this._cndsBySid.set(e.GetSID(),e)}_RegisterAction(e){this._actsBySid.set(e.GetSID(),e)}_RegisterFunctionBlock(e){this._functionBlocksByName.set(e.GetFunctionName().toLowerCase(),e)}_RegisterEventVariable(e){this._eventVarsBySid.set(e.GetSID(),e),e.IsGlobal()?this._allGlobalVars.push(e):this._allLocalVars.push(e)}_DeduplicateSolModifierList(n){2<=n.length&&n.sort(e);let r=this._allUniqueSolModifiers.get(n.length);r||(r=[],this._allUniqueSolModifiers.set(n.length,r));for(let i=0,a=r.length;ir=e);return this._queuedDebugTriggers.push([t,a,n,r]),i}*_RunQueuedDebugTriggersGen(){if(this._runtime.HitBreakpoint())throw new Error('should not be in breakpoint');for(const t=this._runtime.GetLayoutManager();this._queuedDebugTriggers.length;){const[a,n,r,i]=this._queuedDebugTriggers.shift(),e=yield*this._DebugTrigger(t,a,n,r);i(e)}}async RunQueuedDebugTriggersAsync(){for(const e of this._RunQueuedDebugTriggersGen())await this._runtime.DebugBreak(e)}_FastTrigger(t,n,r,i){let s=!1;const l=t.GetMainRunningLayout(),_=l.GetEventSheet();if(_){this._executingTriggerDepth++,this._runtime.PushCurrentLayout(l);const e=_.deepIncludes();for(let t=0,a=e.length;te.ShouldRelease());for(const t of e)t.Release()}ClearAllScheduledWaits(){for(const e of this._scheduledWaits)e.Release();C3.clearArray(this._scheduledWaits)}RemoveInstancesFromScheduledWaits(e){for(const t of this._scheduledWaits)t.RemoveInstances(e)}AddAsyncActionPromise(e){this._asyncActionPromises.push(e)}ClearAsyncActionPromises(){C3.clearArray(this._asyncActionPromises)}GetPromiseForAllAsyncActions(){const e=Promise.all(this._asyncActionPromises);return this._asyncActionPromises=[],e}_SaveToJson(){return{groups:this._SaveGroupsToJson(),cnds:this._SaveCndsToJson(),acts:this._SaveActsToJson(),vars:this._SaveVarsToJson(),waits:this._SaveScheduledWaitsToJson()}}_LoadFromJson(e){this._LoadGroupsFromJson(e.groups),this._LoadCndsFromJson(e.cnds),this._LoadActsFromJson(e.acts),this._LoadVarsFromJson(e.vars),this._LoadScheduledWaitsFromJson(e.waits)}_SaveGroupsToJson(){const e={};for(const t of this.GetAllGroups())e[t.GetSID().toString()]=t.IsGroupActive();return e}_LoadGroupsFromJson(e){for(const[t,n]of Object.entries(e)){const e=parseInt(t,10),a=this.GetEventGroupBySID(e);a&&a.SetGroupActive(n)}}_SaveCndsToJson(){const e={};for(const[t,a]of this._cndsBySid){const n=a._SaveToJson();n&&(e[t.toString()]=n)}return e}_LoadCndsFromJson(e){for(const[t,n]of Object.entries(e)){const e=parseInt(t,10),a=this.GetConditionBySID(e);a&&a._LoadFromJson(n)}}_SaveActsToJson(){const e={};for(const[t,a]of this._actsBySid){const n=a._SaveToJson();n&&(e[t.toString()]=n)}return e}_LoadActsFromJson(e){for(const[t,n]of Object.entries(e)){const e=parseInt(t,10),a=this.GetActionBySID(e);a&&a._LoadFromJson(n)}}_SaveVarsToJson(){const e={};for(const[t,a]of this._eventVarsBySid)!a.IsConstant()&&(a.IsGlobal()||a.IsStatic())&&(e[t.toString()]=a.GetValue());return e}_LoadVarsFromJson(e){for(const[t,n]of Object.entries(e)){const e=parseInt(t,10),a=this.GetEventVariableBySID(e);a&&a.SetValue(n)}}_SaveScheduledWaitsToJson(){return this._scheduledWaits.filter(e=>!e.IsPromise()).map(e=>e._SaveToJson())}_LoadScheduledWaitsFromJson(e){this.ClearAllScheduledWaits();for(const t of e){const e=C3.ScheduledWait._CreateFromJson(this,t);e&&this._scheduledWaits.push(e)}}_GetPerfRecords(){return[...this._runtime.GetLayoutManager().runningLayouts()].map(e=>e.GetEventSheet()).filter(e=>e).map(e=>e._GetPerfRecord())}FindFirstFunctionBlockParent(e){for(;e;){const t=e.GetScopeParent();if(t instanceof C3.FunctionBlock)return t;e=e.GetParent()}return null}_InvokeFunctionFromJS(t,a){Array.isArray(a)||(a=[]);const n=this.GetFunctionBlockByName(t.toLowerCase());if(!n)return null;if(!n.IsEnabled())return n.GetDefaultReturnValue();const r=n.GetFunctionParameters();if(a.lengthe.DebugCanRunFast()),e.canRunAllActionsFast=this._actions.every(e=>e.DebugCanRunFast()),e.canRunAllSubEventsFast=this._subEvents.every(e=>e.DebugCanRunFast()),e.canRunSelfFast=e.canRunAllConditionsFast&&e.canRunAllActionsFast&&e.canRunAllSubEventsFast}_UpdateCanRunFastRecursive(){let e=this;do e._UpdateCanRunFast(),e=e.GetParent();while(e)}_IdentifyTopLevelGroup(){if(!this.IsGroup())return;let e=this.GetParent();for(this._isTopLevelGroup=!0;e;){if(!e.IsGroup()){this._isTopLevelGroup=!1;break}e=e.GetParent()}}_IdentifySolModifiersIncludingParents(){const e=this._runtime.GetAllObjectClasses();if(this._solModifiers===e)this._solModifiersIncludingParents=e;else{this._solModifiersIncludingParents=C3.cloneArray(this._solModifiers);for(let e=this.GetParent();e;){for(const t of e._solModifiers)this._AddParentSolModifier(t);e=e.GetParent()}const e=this.GetEventSheetManager();this._solModifiers=e._DeduplicateSolModifierList(this._solModifiers),this._solModifiersIncludingParents=e._DeduplicateSolModifierList(this._solModifiersIncludingParents)}}_IdentifyTriggerParents(){if(this.HasAnyTriggeredCondition()){this._triggerParents=[];for(let e=this.GetParent();e;)this._triggerParents.push(e),e=e.GetParent();this._triggerParents.reverse()}}SetSolWriterAfterCnds(){this._isSolWriterAfterCnds=!0,this._parent&&this._parent.SetSolWriterAfterCnds()}IsSolWriterAfterCnds(){return this._isSolWriterAfterCnds}GetSolModifiers(){return this._solModifiers}GetSolModifiersIncludingParents(){return this._hasGotSolModifiersIncludingParents||(this._hasGotSolModifiersIncludingParents=!0,this._IdentifySolModifiersIncludingParents()),this._solModifiersIncludingParents}HasSolModifier(e){return this._solModifiers.includes(e)}GetTriggerParents(){return this._triggerParents}GetEventSheet(){return this._eventSheet}GetEventSheetManager(){return this._eventSheet.GetEventSheetManager()}GetRuntime(){return this._runtime}GetParent(){return this._parent}_SetScopeParent(e){this._scopeParent=e}GetScopeParent(){return this._scopeParent||this._parent}GetDisplayNumber(){return this._displayNumber}IsDebugBreakable(){return this._debugData&&this._debugData.isBreakable}IsDebugBreakpoint(){return this.IsDebugBreakable()&&this._debugData.isBreakpoint}_SetDebugBreakpoint(e){this._debugData.isBreakpoint=!!e,this._UpdateCanRunFastRecursive()}IsGroup(){return this._isGroup}IsTopLevelGroup(){return this._isTopLevelGroup}IsElseBlock(){return this._isElseBlock}HasElseBlock(){return this._hasElseBlock}GetGroupName(){return this._groupName}IsGroupActive(){return this._isGroupActive}ResetInitialActivation(){this.SetGroupActive(this._isInitiallyActive)}SetGroupActive(e){if(e=!!e,!this._isGroup)throw new Error('not a group');if(this._isGroupActive!==e){this._isGroupActive=e;for(const e of this._containedIncludes)e.UpdateActive();if(this._containedIncludes.length){const e=this._runtime.GetCurrentLayout(),t=e.GetEventSheet();t&&t._UpdateDeepIncludes()}}}GetSID(){return this._sid}IsOrBlock(){return this._isOrBlock}IsTrigger(){return this._conditions.length&&this._conditions[0].IsTrigger()}IsForFunctionBlock(){return this._scopeParent&&this._scopeParent instanceof C3.FunctionBlock}HasAnyTriggeredCondition(){return this.IsForFunctionBlock()||this._conditions.some(e=>e.IsTrigger())}GetConditions(){return this._conditions}GetConditionCount(){return this._conditions.length}GetConditionAt(e){if(e=Math.floor(e),0>e||e>=this._conditions.length)throw new RangeError('invalid condition index');return this._conditions[e]}GetConditionByDebugIndex(e){return this.GetConditionAt(e)}IsFirstConditionOfType(e){let t=e.GetIndex();if(0===t)return!0;for(;0<=t;--t)if(this._conditions[t].GetObjectClass()===e.GetObjectClass())return!1;return!0}GetActions(){return this._actions}GetActionCount(){return this._actions.length}GetActionAt(e){if(e=Math.floor(e),0>e||e>=this._actions.length)throw new RangeError('invalid action index');return this._actions[e]}GetActionByDebugIndex(e){e=Math.floor(e);const t=this._actions.find(t=>t.GetDebugIndex()===e);if(!t)throw new RangeError('invalid action debug index');return t}_HasActionIndex(e){return e=Math.floor(e),0<=e&&ee instanceof C3.EventVariable)}RunPreTrigger(t){t.SetCurrentEvent(this);let a=!1;const n=this._conditions;for(let r=0,e=n.length;re.Get(0));e.GetLocalVarStack().Push(),this._scopeParent.SetFunctionParameters(a)}else this._scopeParent.EvaluateFunctionParameters(t)}RunAsFunctionCall(t,a){let n,r;const s=0C3.EventVariable.Create(e,this,t)),this._isEnabled=n[3],this._isAsync=n[4],this._nextAsyncId=0,this._currentAsyncId=-1,this._asyncMap=new Map,this._eventBlock=C3.EventBlock.Create(e,t,a),this._eventBlock._SetScopeParent(this)}static Create(e,t,a){return C3.New(C3.FunctionBlock,e,t,a)}_PostInit(){for(const e of this._functionParameters)e._PostInit();this._eventBlock._PostInit(!1)}_GetEventVariableNameInScope(e){for(const t of this._functionParameters)if(C3.equalsNoCase(e,t.GetName()))return t;return null}_GetAllLocalVariablesInScope(){return this._functionParameters}GetFunctionParameters(){return this._functionParameters}GetFunctionParameterCount(){return this._functionParameters.length}EvaluateFunctionParameters(e){const t=this._functionParameters;for(let a=0,n=t.length;ae.GetValue())}GetParent(){return this._parent}GetScopeParent(){return this._parent}GetFunctionName(){return this._functionName}GetReturnType(){return this._returnType}IsEnabled(){return this._isEnabled}GetDefaultReturnValue(){switch(this._returnType){case 0:return null;case 2:return'';default:return 0;}}GetEventBlock(){return this._eventBlock}IsAsync(){return this._isAsync}StartAsyncFunctionCall(){const e=this._nextAsyncId++;this._currentAsyncId=e;let t;const a=new Promise(e=>t=e);return this._asyncMap.set(e,{resolve:t,pauseCount:0}),[e,a]}MaybeFinishAsyncFunctionCall(e){const t=this._asyncMap.get(e);0===t.pauseCount&&(t.resolve(),this._asyncMap.delete(e)),this._currentAsyncId=-1}PauseCurrentAsyncFunction(){const e=this._asyncMap.get(this._currentAsyncId);return e.pauseCount++,this._currentAsyncId}ResumeAsyncFunction(e){this._currentAsyncId=e;const t=this._asyncMap.get(e);t.pauseCount--}},'use strict';{const e=[];C3.EventVariable=class extends C3.DefendedBase{constructor(e,t,a){super();const n=e.GetEventSheetManager();this._eventSheet=e,this._eventSheetManager=n,this._runtime=e.GetRuntime(),this._parent=t,this._localVarStack=n.GetLocalVarStack(),this._name=a[1],this._type=a[2],this._initialValue=a[3],this._isStatic=!!a[4],this._isConstant=!!a[5],this._isFunctionParameter=t instanceof C3.FunctionBlock,this._sid=a[6],this._jsPropName=this._runtime.GetJsPropName(a[8]),this._scriptSetter=e=>this.SetValue(e),this._scriptGetter=()=>this.GetValue(),this._hasSingleValue=!this._parent||this._isStatic||this._isConstant,this._value=this._initialValue,this._localIndex=-1,this.IsBoolean()&&(this._value=this._value?1:0),!this.IsLocal()||this.IsStatic()||this.IsConstant()||(this._localIndex=n._GetNextLocalVarIndex(this)),n._RegisterEventVariable(this)}static Create(e,t,a){return C3.New(C3.EventVariable,e,t,a)}_PostInit(){}GetName(){return this._name}GetJsPropName(){return this._jsPropName}GetParent(){return this._parent}IsGlobal(){return!this.GetParent()}IsLocal(){return!this.IsGlobal()}IsFunctionParameter(){return this._isFunctionParameter}IsStatic(){return this._isStatic}IsConstant(){return this._isConstant}IsNumber(){return 0===this._type}IsString(){return 1===this._type}IsBoolean(){return 2===this._type}IsElseBlock(){return!1}GetSID(){return this._sid}GetInitialValue(){return this._initialValue}GetSolModifiers(){return e}Run(){!this.IsLocal()||this.IsStatic()||this.IsConstant()||this.SetValue(this.GetInitialValue())}DebugCanRunFast(){return!0}*DebugRun(e){this.Run(e)}SetValue(e){this.IsNumber()?'number'!=typeof e&&(e=parseFloat(e)):this.IsString()?'string'!=typeof e&&(e=e.toString()):this.IsBoolean()&&(e=e?1:0),this._hasSingleValue?this._value=e:this._localVarStack.GetCurrent()[this._localIndex]=e}GetValue(){return this._hasSingleValue?this._value:this._localVarStack.GetCurrent()[this._localIndex]}GetTypedValue(){let e=this.GetValue();return this.IsBoolean()&&(e=!!e),e}ResetToInitialValue(){this._value=this._initialValue}_GetScriptInterfaceDescriptor(){return{configurable:!1,enumerable:!0,get:this._scriptGetter,set:this._scriptSetter}}}}{const e=[];C3.EventInclude=class extends C3.DefendedBase{constructor(e,t,a){super();const n=e.GetEventSheetManager();this._eventSheet=e,this._eventSheetManager=n,this._runtime=e.GetRuntime(),this._parent=t,this._includeSheet=null,this._includeSheetName=a[1],this._isActive=!0}static Create(e,t,a){return C3.New(C3.EventInclude,e,t,a)}_PostInit(){this._includeSheet=this._eventSheetManager.GetEventSheetByName(this._includeSheetName),this._eventSheet._AddShallowInclude(this);for(let e=this.GetParent();e;)e instanceof C3.EventBlock&&e.IsGroup()&&e._AddContainedInclude(this),e=e.GetParent();this.UpdateActive(),this._runtime.IsDebug()&&this._eventSheet._GetPerfRecord().children.push(this._includeSheet._GetPerfRecord())}GetParent(){return this._parent}GetSolModifiers(){return e}GetIncludeSheet(){return this._includeSheet}Run(){const e=!!this.GetParent(),t=this._runtime.GetAllObjectClasses();e&&this._eventSheetManager.PushCleanSol(t),this._includeSheet.Run(),e&&this._eventSheetManager.PopSol(t)}*DebugRun(){const e=!!this.GetParent(),t=this._runtime.GetAllObjectClasses();e&&this._eventSheetManager.PushCleanSol(t),yield*this._includeSheet.DebugRun(),e&&this._eventSheetManager.PopSol(t)}DebugCanRunFast(){return!1}IsActive(){return this._isActive}UpdateActive(){for(let e=this.GetParent();e;){if(e instanceof C3.EventBlock&&e.IsGroup()&&!e.IsGroupActive())return void(this._isActive=!1);e=e.GetParent()}this._isActive=!0}}}{function t(e,t){return e>=t?e%t:0>e?(e<=-t&&(e%=t),0>e&&(e+=t),e):e}C3.ExpNode=class extends C3.DefendedBase{constructor(e){super(),this._owner=e,this._runtime=e.GetRuntime()}_PostInit(){}static CreateNode(t,a){const d=a[0];return C3.New([e,s,l,_,n,r][d],t,a)}};class n extends C3.ExpNode{constructor(e,t){super(e),this._systemPlugin=this._runtime.GetSystemPlugin(),this._func=this._runtime.GetObjectReference(t[1]),(this._func===C3.Plugins.System.Exps.random||this._func===C3.Plugins.System.Exps.choose)&&this._owner.SetVariesPerInstance()}GetBoundMethod(){return this._systemPlugin._GetBoundACEMethod(this._func,this._systemPlugin)}}class r extends C3.ExpNode{constructor(e,t){super(e),this._functionBlock=null,this._functionName=t[1],this._owner.SetVariesPerInstance()}_PostInit(){const e=this._runtime.GetEventSheetManager();this._functionBlock=e.GetFunctionBlockByName(this._functionName),this._functionName=null;const t=this._owner.GetEventBlock(),a=this._functionBlock.GetEventBlock();this._combinedSolModifiers=[...new Set([...t.GetSolModifiersIncludingParents(),...a.GetSolModifiersIncludingParents()])],this._combinedSolModifiers=e._DeduplicateSolModifierList(this._combinedSolModifiers)}GetBoundMethod(){const e=this._functionBlock;if(e.IsEnabled()){const t=e.GetEventBlock();return C3.EventBlock.prototype.RunAsExpressionFunctionCall.bind(t,this._combinedSolModifiers,e.GetReturnType(),e.GetDefaultReturnValue())}else{const t=e.GetDefaultReturnValue();return()=>t}}}class s extends C3.ExpNode{constructor(e,t){super(e),this._objectClass=this._runtime.GetObjectClassByIndex(t[1]),this._func=this._runtime.GetObjectReference(t[2]),this._returnsString=!!t[3],this._eventStack=this._runtime.GetEventSheetManager().GetEventStack(),this._owner._MaybeVaryFor(this._objectClass)}GetBoundMethod(){return this._objectClass.GetPlugin()._GetBoundACEMethod(this._func,this._objectClass.GetSingleGlobalInstance().GetSdkInstance())}ExpObject(...a){const n=this._objectClass,r=n.GetCurrentSol().GetExpressionInstances(),i=r.length;if(0===i)return this._returnsString?'':0;const e=t(this._owner.GetSolIndex(),i);return this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(n),this._func.apply(r[e].GetSdkInstance(),a)}ExpObject_InstExpr(a,...n){const r=this._objectClass,i=r.GetInstances(),e=i.length;if(0===e)return this._returnsString?'':0;const s=t(a,e);return this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(r),this._func.apply(i[s].GetSdkInstance(),n)}}class l extends C3.ExpNode{constructor(e,t){super(e),this._objectClass=this._runtime.GetObjectClassByIndex(t[1]),this._varIndex=t[3],this._returnsString=!!t[2],this._owner._MaybeVaryFor(this._objectClass)}ExpInstVar(){const e=this._objectClass.GetCurrentSol().GetExpressionInstances(),a=e.length;if(0===a)return this._returnsString?'':0;const n=t(this._owner.GetSolIndex(),a);return e[n]._GetInstanceVariableValueUnchecked(this._varIndex)}ExpInstVar_Family(){const a=this._objectClass,n=a.GetCurrentSol().GetExpressionInstances(),r=n.length;if(0===r)return this._returnsString?'':0;const i=t(this._owner.GetSolIndex(),r),e=n[i],s=e.GetObjectClass().GetFamilyInstanceVariableOffset(a.GetFamilyIndex());return e._GetInstanceVariableValueUnchecked(this._varIndex+s)}ExpInstVar_InstExpr(a){const n=this._objectClass,r=n.GetInstances(),i=r.length;if(0===i)return this._returnsString?'':0;const e=t(a,i),s=r[e];let l=0;return n.IsFamily()&&(l=s.GetObjectClass().GetFamilyInstanceVariableOffset(n.GetFamilyIndex())),s._GetInstanceVariableValueUnchecked(this._varIndex+l)}}class e extends C3.ExpNode{constructor(e,t){super(e),this._objectClass=this._runtime.GetObjectClassByIndex(t[1]),this._behaviorType=this._objectClass.GetBehaviorTypeByName(t[2]),this._behaviorIndex=this._objectClass.GetBehaviorIndexByName(t[2]),this._func=this._runtime.GetObjectReference(t[3]),this._returnsString=!!t[4],this._eventStack=this._runtime.GetEventSheetManager().GetEventStack(),this._owner._MaybeVaryFor(this._objectClass)}ExpBehavior(...a){const n=this._objectClass,r=n.GetCurrentSol().GetExpressionInstances(),i=r.length;if(0===i)return this._returnsString?'':0;const e=t(this._owner.GetSolIndex(),i);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(n);const s=r[e];let l=0;return n.IsFamily()&&(l=s.GetObjectClass().GetFamilyBehaviorOffset(n.GetFamilyIndex())),this._func.apply(s.GetBehaviorInstances()[this._behaviorIndex+l].GetSdkInstance(),a)}ExpBehavior_InstExpr(a,...n){const r=this._objectClass,s=r.GetInstances(),e=s.length;if(0===e)return this._returnsString?'':0;const l=t(a,e);this._eventStack.GetCurrentStackFrame().SetExpressionObjectClass(r);const _=s[l];let d=0;return r.IsFamily()&&(d=_.GetObjectClass().GetFamilyBehaviorOffset(r.GetFamilyIndex())),this._func.apply(_.GetBehaviorInstances()[this._behaviorIndex+d].GetSdkInstance(),n)}}class _ extends C3.ExpNode{constructor(e,t){super(e),this._eventVar=null,this._eventVarName=t[1]}_PostInit(){this._eventVar=this._runtime.GetEventSheetManager().GetEventVariableByName(this._eventVarName,this._owner.GetEventBlock()),this._eventVarName=null}GetVar(){return this._eventVar}}}{function t(e){const t=self.C3_ExpressionFuncs[e];if(!t)throw new Error('invalid expression number');return t}C3.Parameter=class extends C3.DefendedBase{constructor(e,t,a){super(),this._owner=e,this._index=a,this._type=t,this.Get=null,this._variesPerInstance=!1,this._isConstant=!1}static Create(t,a,p){const S=a[0];return C3.New([s,_,i,d,c,u,g,s,d,d,f,y,i,m,_,h,e,l,n][S],t,S,p,a)}_PostInit(){}SetVariesPerInstance(){this._variesPerInstance=!0}_MaybeVaryFor(e){!this._variesPerInstance&&e&&(e.GetPlugin().IsSingleGlobal()||(this._variesPerInstance=!0))}VariesPerInstance(){return this._variesPerInstance}GetIndex(){return this._index}GetRuntime(){return this._owner.GetRuntime()}GetEventBlock(){return this._owner.GetEventBlock()}IsConstant(){return this._isConstant}};class s extends C3.Parameter{constructor(a,n,r,i){super(a,n,r),this._solIndex=0;const e=i[1];this._expressionNumber=e[0],this._numberedNodes=[],this._expressionFunc=null;for(let t=1,s=e.length;te||e>=this._numberedNodes.length)throw new RangeError('invalid numbered node');return this._numberedNodes[e]}_PostInit(){for(const e of this._numberedNodes)e._PostInit();const e=t(this._expressionNumber);this._expressionFunc=this._numberedNodes.length?e(this):e}GetSolIndex(){return this._solIndex}GetExpression(e){return this._solIndex=e,this._expressionFunc()}}class _ extends s{constructor(e,t,a,n){super(e,t,a,n),this.Get=this.GetStringExpression,14===t&&(this.GetEventBlock().SetAllSolModifiers(),this._owner instanceof C3.Action&&this.GetEventBlock().SetSolWriterAfterCnds())}GetStringExpression(e){this._solIndex=e;const t=this._expressionFunc();return'string'==typeof t?t:''}_GetFastTriggerValue(){return t(this._expressionNumber)()}}class u extends s{constructor(e,t,a,n){super(e,t,a,n),this.Get=this.GetLayer,this._isConstant=!1}GetLayer(e){this._solIndex=e;const t=this._expressionFunc(),a=this.GetRuntime().GetCurrentLayout();return a.GetLayer(t)}}class d extends C3.Parameter{constructor(e,t,a,n){super(e,t,a),this._combo=n[1],this.Get=this.GetCombo,this._isConstant=!0}GetCombo(){return this._combo}}class e extends C3.Parameter{constructor(e,t,a,n){super(e,t,a),this._bool=n[1],this.Get=this.GetBoolean,this._isConstant=!0}GetBoolean(){return this._bool}}class c extends C3.Parameter{constructor(t,a,n,r){super(t,a,n),this._objectClass=this.GetRuntime().GetObjectClassByIndex(r[1]),this.Get=this.GetObjectClass;const i=this.GetEventBlock();i._AddSolModifier(this._objectClass),this._owner instanceof C3.Action?i.SetSolWriterAfterCnds():i.GetParent()&&i.GetParent().SetSolWriterAfterCnds(),this._isConstant=!0}GetObjectClass(){return this._objectClass}}class g extends C3.Parameter{constructor(e,t,a,n){super(e,t,a),this._layout=this.GetRuntime().GetLayoutManager().GetLayoutByName(n[1]),this.Get=this.GetLayout,this._isConstant=!0}GetLayout(){return this._layout}}class h extends C3.Parameter{constructor(e,t,a,n){super(e,t,a),this._timeline=this.GetRuntime().GetTimelineManager().GetTimelineByName(n[1]),this.Get=this.GetTimeline,this._isConstant=!0}GetTimeline(){return this._timeline}}class i extends C3.Parameter{constructor(e,t,a,n){super(e,t,a),this._fileInfo=n[1],this.Get=this.GetFile,this._isConstant=!0}GetFile(){return this._fileInfo}}class f extends C3.Parameter{constructor(t,a,n,r){super(t,a,n),this._instVarIndex=r[1];const i=this._owner.GetObjectClass();i&&i.IsFamily()?(this.Get=this.GetFamilyInstanceVariable,this.SetVariesPerInstance()):(this.Get=this.GetInstanceVariable,this._isConstant=!0)}GetInstanceVariable(){return this._instVarIndex}GetFamilyInstanceVariable(t){t=t||0;const n=this._owner.GetObjectClass(),r=n.GetCurrentSol(),i=r.GetInstances();let s=null;if(i.length)s=i[t%i.length].GetObjectClass();else if(r.HasAnyElseInstances()){const e=r.GetElseInstances();s=e[t%e.length].GetObjectClass()}else if(0[e[0].GetUID(),e[1].GetUID(),e[2]])),e[t]=n}return{ex:e}}_LoadFromJson(e){const t=this._runtime,n=e.ex;if(n){const r=this.GetSavedDataMap();r.clear();for(const[a,i]of Object.entries(n)){let e=i;'collmemory'===a&&(e=C3.New(C3.PairMap,i.map(e=>[t.GetInstanceByUID(e[0]),t.GetInstanceByUID(e[1]),e[2]]).filter(e=>e[0]&&e[1]))),r.set(a,e)}}else this._savedData&&(this._savedData.clear(),this._savedData=null)}}}{function e(e,t){for(let a=0,n=e.length;ae.VariesPerInstance())?(this.Run=this._RunObject_AllParamsVary,this.DebugRun=this._DebugRunObject_AllParamsVary):this._anyParamVariesPerInstance?(this.Run=this._RunObject_SomeParamsVary,this.DebugRun=this._DebugRunObject_SomeParamsVary):this._parameters.every(e=>e.IsConstant())?(e(this._parameters,this._results),this.Run=this._RunObject_ParamsConst,this.DebugRun=this._DebugRunObject_ParamsConst):(this.Run=this._RunObject_ParamsDontVary,this.DebugRun=this._DebugRunObject_ParamsDontVary):(this.Run=this._RunObject_ParamsConst,this.DebugRun=this._DebugRunObject_ParamsConst)}_SetSystemRunMethod(){const e=this._systemPlugin,t=this._systemPlugin;this._SetRunMethodForBoundFunc(e,t,this._RunSystem)}_SetSingleGlobalRunMethod(){const e=this._objectClass.GetPlugin(),t=this._objectClass.GetSingleGlobalInstance().GetSdkInstance();this._SetRunMethodForBoundFunc(e,t,this._RunSingleGlobal)}_SetCallFunctionRunMethod(){const e=this._eventBlock.GetEventSheetManager(),t=e.GetFunctionBlockByName(this._callFunctionName);t.IsEnabled()?(this._callEventBlock=t.GetEventBlock(),this._combinedSolModifiers=[...new Set([...this._eventBlock.GetSolModifiersIncludingParents(),...this._callEventBlock.GetSolModifiersIncludingParents()])],this._combinedSolModifiers=e._DeduplicateSolModifierList(this._combinedSolModifiers),this.Run=C3.EventBlock.prototype.RunAsFunctionCall.bind(this._callEventBlock,this._combinedSolModifiers,this._parameters),this.DebugRun=this._DebugRunCallFunction):(this.Run=n,this.DebugRun=r)}_SetRunMethodForBoundFunc(t,a,n){const r=this._func,i=this._parameters;if(0===i.length)this.Run=t._GetBoundACEMethod(r,a);else if(1===i.length){const n=i[0];if(n.IsConstant())this.Run=t._GetBoundACEMethod_1param(r,a,n.Get(0));else{const i=t._GetBoundACEMethod(r,a);this.Run=function(){return i(n.Get(0))}}}else if(2===i.length){const n=i[0],s=i[1];if(n.IsConstant()&&s.IsConstant())this.Run=t._GetBoundACEMethod_2params(r,a,n.Get(0),s.Get(0));else{const i=t._GetBoundACEMethod(r,a);this.Run=function(){return i(n.Get(0),s.Get(0))}}}else if(3===i.length){const n=i[0],s=i[1],l=i[2];if(n.IsConstant()&&s.IsConstant()&&l.IsConstant())this.Run=t._GetBoundACEMethod_3params(r,a,n.Get(0),s.Get(0),l.Get(0));else{const i=t._GetBoundACEMethod(r,a);this.Run=function(){return i(n.Get(0),s.Get(0),l.Get(0))}}}else this.Run=n}GetSID(){return this._sid}IsAsync(){return 1===this._actionReturnType}CanBailOut(){return 2===this._actionReturnType}HasReturnType(){return 0!==this._actionReturnType}GetObjectClass(){return this._objectClass}GetEventBlock(){return this._eventBlock}GetRuntime(){return this._runtime}GetIndex(){return this._index}GetDebugIndex(){return this._debugData.index}GetCombinedSolModifiers(){return this._combinedSolModifiers}IsBreakpoint(){return this._debugData.isBreakpoint}_SetBreakpoint(e){this._debugData.isBreakpoint=!!e,this._eventBlock._UpdateCanRunFastRecursive()}_DebugReturnsGenerator(){return this._debugData.canDebug}DebugCanRunFast(){return!this.IsBreakpoint()&&!this._runtime.DebugBreakNext()&&!this._DebugReturnsGenerator()}GetSavedDataMap(){return this._savedData||(this._savedData=new Map),this._savedData}GetUnsavedDataMap(){return this._unsavedData||(this._unsavedData=new Map),this._unsavedData}_RunSystem(){const t=this._results;return e(this._parameters,t),this._func.apply(this._systemPlugin,t)}*_DebugRunSystem(){if((this.IsBreakpoint()||this._runtime.DebugBreakNext())&&(yield this),this._DebugReturnsGenerator()){const t=this._results;e(this._parameters,t);const a=yield*this._func.apply(this._systemPlugin,t);return a}return this.Run()}*_DebugRunCallFunction(){(this.IsBreakpoint()||this._runtime.DebugBreakNext())&&(yield this);const e=yield*this._callEventBlock.DebugRunAsFunctionCall(this._combinedSolModifiers,this._parameters);return e}_RunSingleGlobal(){const t=this._results;return e(this._parameters,t),this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(),t)}*_DebugRunSingleGlobal(){if((this.IsBreakpoint()||this._runtime.DebugBreakNext())&&(yield this),this._DebugReturnsGenerator()){const t=this._results;e(this._parameters,t);const a=yield*this._func.apply(this._objectClass.GetSingleGlobalInstance().GetSdkInstance(),t);return a}return this.Run()}_RunObject_ParamsConst(){const e=this._results,t=this._objectClass.GetCurrentSol().GetInstances();for(let a=0,n=t.length;aa.getRight()||0>a.getBottom()||a.getLeft()>t.GetWidth()||a.getTop()>t.GetHeight()}function d(t,a,n){const r=this.GetCurrentSol(),s=r.GetInstances();if(!s.length)return!1;let e=s[0],l=e.GetWorldInfo(),_=e,u=C3.distanceSquared(l.GetX(),l.GetY(),a,n);for(let r=1,d=s.length;ru)&&(u=d,_=e)}return r.PickOne(_),!0}function e(e){const t=this.GetWorldInfo();t.GetX()===e||(t.SetX(e),t.SetBboxChanged())}function f(e){const t=this.GetWorldInfo();t.GetY()===e||(t.SetY(e),t.SetBboxChanged())}function g(e,t){const a=this.GetWorldInfo();a.EqualsXY(e,t)||(a.SetXY(e,t),a.SetBboxChanged())}function h(e,t){if(e){const n=e.GetPairedInstance(this._inst);if(n){const[r,a]=n.GetImagePoint(t),i=this.GetWorldInfo();i.GetX()===r&&i.GetY()===a||(i.SetXY(r,a),i.SetBboxChanged())}}}function i(e){if(0!==e){const t=this.GetWorldInfo();t.OffsetXY(t.GetCosAngle()*e,t.GetSinAngle()*e),t.SetBboxChanged()}}function j(e,t){if(0!==t){const a=this.GetWorldInfo();e=C3.toRadians(e),a.OffsetXY(Math.cos(e)*t,Math.sin(e)*t),a.SetBboxChanged()}}function k(){return this.GetWorldInfo().GetX()}function l(){return this.GetWorldInfo().GetY()}function m(){return this._runtime.GetDt(this._inst)}function n(e,t){return C3.compare(this.GetWorldInfo().GetWidth(),e,t)}function te(e,t){return C3.compare(this.GetWorldInfo().GetHeight(),e,t)}function p(e){const t=this.GetWorldInfo();t.GetWidth()===e||(t.SetWidth(e),t.SetBboxChanged())}function q(e){const t=this.GetWorldInfo();t.GetHeight()===e||(t.SetHeight(e),t.SetBboxChanged())}function r(e,t){const a=this.GetWorldInfo();a.GetWidth()===e&&a.GetHeight()===t||(a.SetSize(e,t),a.SetBboxChanged())}function s(){return this.GetWorldInfo().GetWidth()}function t(){return this.GetWorldInfo().GetHeight()}function u(){return this.GetWorldInfo().GetBoundingBox().getLeft()}function v(){return this.GetWorldInfo().GetBoundingBox().getTop()}function w(){return this.GetWorldInfo().GetBoundingBox().getRight()}function x(){return this.GetWorldInfo().GetBoundingBox().getBottom()}function y(e,t){return C3.angleDiff(this.GetWorldInfo().GetAngle(),C3.toRadians(t))<=C3.toRadians(e)}function z(e){return C3.angleClockwise(this.GetWorldInfo().GetAngle(),C3.toRadians(e))}function A(t,n){const a=C3.toRadians(t),r=C3.toRadians(n),i=this.GetWorldInfo().GetAngle(),e=!C3.angleClockwise(r,a);return e?C3.angleClockwise(i,a)||!C3.angleClockwise(i,r):C3.angleClockwise(i,a)&&!C3.angleClockwise(i,r)}function B(e){const t=this.GetWorldInfo(),a=C3.clampAngle(C3.toRadians(e));isNaN(a)||t.GetAngle()===a||(t.SetAngle(a),t.SetBboxChanged())}function C(e){if(!(isNaN(e)||0===e)){const t=this.GetWorldInfo();t.SetAngle(t.GetAngle()+C3.toRadians(e)),t.SetBboxChanged()}}function D(e){if(!(isNaN(e)||0===e)){const t=this.GetWorldInfo();t.SetAngle(t.GetAngle()-C3.toRadians(e)),t.SetBboxChanged()}}function E(t,n){const r=this.GetWorldInfo(),i=r.GetAngle(),e=C3.angleRotate(i,C3.toRadians(n),C3.toRadians(t));isNaN(e)||i===e||(r.SetAngle(e),r.SetBboxChanged())}function F(t,n,r){const s=this.GetWorldInfo(),e=s.GetAngle(),l=n-s.GetX(),a=r-s.GetY(),_=Math.atan2(a,l),d=C3.angleRotate(e,_,C3.toRadians(t));isNaN(d)||e===d||(s.SetAngle(d),s.SetBboxChanged())}function G(t,n){const r=this.GetWorldInfo(),i=r.GetAngle(),e=t-r.GetX(),a=n-r.GetY(),s=Math.atan2(a,e);isNaN(s)||i===s||(r.SetAngle(s),r.SetBboxChanged())}function H(){return C3.toDegrees(this.GetWorldInfo().GetAngle())}function I(e,t){return C3.compare(C3.round6dp(100*this.GetWorldInfo().GetOpacity()),e,t)}function J(){return this.GetWorldInfo().IsVisible()}function K(e){const t=this.GetWorldInfo();e=2===e?!t.IsVisible():0!=e,t.IsVisible()===e||(t.SetVisible(e),this._runtime.UpdateRender())}function L(e){const t=C3.clamp(e/100,0,1),a=this.GetWorldInfo();a.GetOpacity()===t||(a.SetOpacity(t),this._runtime.UpdateRender())}function M(e){ve.setFromRgbValue(e);const t=this.GetWorldInfo();t.GetUnpremultipliedColor().equalsIgnoringAlpha(ve)||(t.SetUnpremultipliedColor(ve),this._runtime.UpdateRender())}function N(){const e=this.GetWorldInfo().GetUnpremultipliedColor();return C3.PackRGBAEx(e.getR(),e.getG(),e.getB(),e.getA())}function O(){return C3.round6dp(100*this.GetWorldInfo().GetOpacity())}function P(e){return!!e&&this.GetWorldInfo().GetLayer()===e}function Q(t){const a=this.GetCurrentSol(),n=a.GetInstances();if(!n.length)return!1;let r=n[0],s=r;for(let e=1,a=n.length;ed||_===d&&r.GetZIndex()>l.GetZIndex())&&(s=a):(_t||t>=e.length)){const s=r.GetShaderProgram().GetParameterType(t);if('color'===s){ve.setFromRgbValue(n);const r=e[t];if(ve.equalsIgnoringAlpha(r))return;r.copyRgb(ve)}else{if('percent'===s&&(n/=100),e[t]===n)return;e[t]=n}a.IsEffectIndexActive(i)&&this._runtime.UpdateRender()}}}function re(e,t,a){return C3.compare(this.GetInstance().GetInstanceVariableValue(e),t,a)}function ie(e){return!!this.GetInstance().GetInstanceVariableValue(e)}function se(t,a){const n=this.GetCurrentSol(),r=n.GetInstances();if(!r.length)return!1;let i=r[0],s=i,l=i.GetInstanceVariableValue(a);for(let e=1,n=r.length;el)&&(l=n,s=i)}return n.PickOne(s),!0}function oe(e){return this._runtime.GetCurrentCondition().IsInverted()?_e(this,e):le(this,e)}function le(e,t){const a=e.GetRuntime().GetInstanceByUID(t);if(!a)return!1;const n=e.GetCurrentSol();if(!n.IsSelectAll()&&!n._GetOwnInstances().includes(a))return!1;if(e.IsFamily()){if(a.GetObjectClass().BelongsToFamily(e))return n.PickOne(a),e.ApplySolToContainer(),!0;}else if(a.GetObjectClass()===e)return n.PickOne(a),e.ApplySolToContainer(),!0;return!1}function _e(t,n){const r=t.GetCurrentSol();if(r.IsSelectAll()){r._SetSelectAll(!1),r.ClearArrays();const i=t.GetInstances();for(let t=0,a=i.length;tthis.SetSignalled()).catch(e=>{console.warn('[C3 runtime] Promise rejected in \'Wait for previous actions to complete\': ',e),this.SetSignalled()})}IsTimer(){return'timer'===this._type}IsSignal(){return'signal'===this._type}IsPromise(){return'promise'===this._type}GetSignalTag(){return this._signalTag}IsSignalled(){return this._isSignalled}SetSignalled(){this._isSignalled=!0}_ShouldRun(){return this.IsTimer()?this._time<=this._eventSheetManager.GetRuntime().GetGameTime():this.IsSignalled()}_RestoreState(e){e._Restore(this._event,this._actIndex);for(const[t,n]of this._sols.entries()){const e=t.GetCurrentSol();n._Restore(e)}const t=this._callingFunctionBlock;t&&(t.SetFunctionParameters(this._functionParameters),t.IsAsync()&&t.ResumeAsyncFunction(this._asyncId))}_Run(e){this._RestoreState(e),this._event._ResumeActionsAndSubEvents(e),this._callingFunctionBlock&&this._callingFunctionBlock.IsAsync()&&this._callingFunctionBlock.MaybeFinishAsyncFunctionCall(this._asyncId),this._eventSheetManager.ClearSol(this._solModifiers),this._shouldRelease=!0}async _DebugRun(e){this._RestoreState(e);for(const t of this._event._DebugResumeActionsAndSubEvents(e))await this._eventSheetManager.GetRuntime().DebugBreak(t);this._callingFunctionBlock&&this._callingFunctionBlock.IsAsync()&&this._callingFunctionBlock.MaybeFinishAsyncFunctionCall(this._asyncId),this._eventSheetManager.ClearSol(this._solModifiers),this._shouldRelease=!0}ShouldRelease(){return this._shouldRelease}RemoveInstances(e){for(const t of this._sols.values())t.RemoveInstances(e)}_SaveToJson(){const e={},t={t:this._time,st:this._signalTag,s:this._isSignalled,ev:this._event.GetSID(),sm:this._solModifiers.map(e=>e.GetSID()),sols:e};this._event._HasActionIndex(this._actIndex)&&(t.act=this._event.GetActionAt(this._actIndex).GetSID());for(const[t,a]of this._sols)e[t.GetSID().toString()]=a._SaveToJson();return t}static _CreateFromJson(t,a){const n=t.GetRuntime(),r=t.GetEventBlockBySID(a.ev);if(!r)return null;let i=0;if(a.hasOwnProperty('act')){const e=t.GetActionBySID(a.act);if(!e)return null;i=e.GetIndex()}const s=C3.New(C3.ScheduledWait,t);s._time=a.t,s._type=-1===s._time?'signal':'timer',s._signalTag=a.st,s._isSignalled=a.s,s._event=r,s._actIndex=i;for(const e of a.sm){const t=n.GetObjectClassBySID(e);t&&s._solModifiers.push(t)}for(const[r,i]of Object.entries(a.sols)){const e=parseInt(r,10),a=n.GetObjectClassBySID(e);if(!a)continue;const l=C3.New(C3.SolState,null);l._LoadFromJson(t,i),s._sols.set(a,l)}return s}},'use strict',C3.SolState=class extends C3.DefendedBase{constructor(e){super(),this._objectClass=null,this._isSelectAll=!0,this._instances=[],e&&(this._objectClass=e.GetObjectClass(),this._isSelectAll=e.IsSelectAll(),C3.shallowAssignArray(this._instances,e._GetOwnInstances()))}Release(){this._objectClass=null,C3.clearArray(this._instances)}_Restore(e){e._SetSelectAll(this._isSelectAll),C3.shallowAssignArray(e._GetOwnInstances(),this._instances)}RemoveInstances(e){C3.arrayRemoveAllInSet(this._instances,e)}_SaveToJson(){return{sa:this._isSelectAll,insts:this._instances.map(e=>e.GetUID())}}_LoadFromJson(e,t){const n=e.GetRuntime();this._isSelectAll=!!t.sa,C3.clearArray(this._instances);for(const r of t.insts){const e=n.GetInstanceByUID(r);e&&this._instances.push(e)}}},'use strict';{function t(e,t){let a=e.get(t);return a||(a=new Map,e.set(t,a)),a}C3.SDKPluginBase=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e.runtime,this._isSingleGlobal=!!e.isSingleGlobal,this._isWorldType=!!e.isWorld,this._isRotatable=!!e.isRotatable,this._mustPredraw=!!e.mustPredraw,this._hasEffects=!!e.hasEffects,this._singleGlobalObjectClass=null,this._boundACEMethodCache=new Map,this._boundACEMethodCache_1param=new Map,this._boundACEMethodCache_2params=new Map,this._boundACEMethodCache_3params=new Map}Release(){this._runtime=null}GetRuntime(){return this._runtime}OnCreate(){}IsSingleGlobal(){return this._isSingleGlobal}IsWorldType(){return this._isWorldType}IsRotatable(){return this._isRotatable}MustPreDraw(){return this._mustPredraw}HasEffects(){return this._hasEffects}_GetBoundACEMethod(e,t){if(!t)throw new Error('missing \'this\' binding');let a=this._boundACEMethodCache.get(e);return a?a:(a=e.bind(t),this._boundACEMethodCache.set(e,a),a)}_GetBoundACEMethod_1param(a,n,r){if(!n)throw new Error('missing \'this\' binding');const i=t(this._boundACEMethodCache_1param,a);let e=i.get(r);return e?e:(e=a.bind(n,r),i.set(r,e),e)}_GetBoundACEMethod_2params(a,n,r,i){if(!n)throw new Error('missing \'this\' binding');const e=t(this._boundACEMethodCache_2params,a),s=t(e,r);let l=s.get(i);return l?l:(l=a.bind(n,r,i),s.set(i,l),l)}_GetBoundACEMethod_3params(a,n,r,s,e){if(!n)throw new Error('missing \'this\' binding');const l=t(this._boundACEMethodCache_3params,a),_=t(l,r),d=t(_,s);let i=d.get(e);return i?i:(i=a.bind(n,r,s,e),d.set(e,i),i)}_SetSingleGlobalObjectClass(e){if(!this.IsSingleGlobal())throw new Error('must be single-global plugin');this._singleGlobalObjectClass=e}GetSingleGlobalObjectClass(){if(!this.IsSingleGlobal())throw new Error('must be single-global plugin');return this._singleGlobalObjectClass}GetSingleGlobalInstance(){if(!this.IsSingleGlobal())throw new Error('must be single-global plugin');return this._singleGlobalObjectClass.GetSingleGlobalInstance()}}}'use strict',C3.SDKDOMPluginBase=class extends C3.SDKPluginBase{constructor(e,t){super(e),this._domComponentId=t,this._nextElementId=0,this._instMap=new Map}Release(){super.Release()}_AddElement(e){const t=this._nextElementId++;return this._instMap.set(t,e),t}_RemoveElement(e){this._instMap.delete(e)}AddElementMessageHandler(e,t){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,e,e=>{const a=this._instMap.get(e.elementId);t(a,e)})}},'use strict',C3.SDKTypeBase=class extends C3.DefendedBase{constructor(e){super(),this._objectClass=e,this._runtime=e.GetRuntime(),this._plugin=e.GetPlugin()}Release(){this._objectClass=null,this._runtime=null,this._plugin=null}GetObjectClass(){return this._objectClass}GetRuntime(){return this._runtime}GetPlugin(){return this._plugin}GetImageInfo(){return this._objectClass.GetImageInfo()}FinishCondition(){}LoadTextures(){}ReleaseTextures(){}OnDynamicTextureLoadComplete(){}PreloadTexturesWithInstances(){}LoadTilePolyData(){}GetScriptInterfaceClass(){return null}},'use strict',C3.SDKInstanceBase=class extends C3.DefendedBase{constructor(e,t){super(),this._inst=e,this._domComponentId=t,this._runtime=e.GetRuntime(),this._objectClass=this._inst.GetObjectClass(),this._sdkType=this._objectClass.GetSdkType(),this._tickFunc=null,this._tick2Func=null,this._isTicking=!1,this._isTicking2=!1,this._disposables=null,this._wasReleased=!1}Release(){this._wasReleased=!0,this._StopTicking(),this._StopTicking2(),this._tickFunc=null,this._tick2Func=null,this._disposables&&(this._disposables.Release(),this._disposables=null),this._inst=null,this._runtime=null,this._objectClass=null,this._sdkType=null}WasReleased(){return this._wasReleased}GetInstance(){return this._inst}GetRuntime(){return this._runtime}GetObjectClass(){return this._objectClass}GetPlugin(){return this._sdkType.GetPlugin()}GetSdkType(){return this._sdkType}GetScriptInterface(){return this._inst.GetInterfaceClass()}Trigger(e){return this._runtime.Trigger(e,this._inst,null)}DebugTrigger(e){return this._runtime.DebugTrigger(e,this._inst,null)}TriggerAsync(e){return this._runtime.TriggerAsync(e,this._inst,null)}FastTrigger(e,t){return this._runtime.FastTrigger(e,this._inst,t)}DebugFastTrigger(e,t){return this._runtime.DebugFastTrigger(e,this._inst,t)}ScheduleTriggers(e){return this._runtime.ScheduleTriggers(e)}AddDOMMessageHandler(e,t){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,e,t)}AddDOMMessageHandlers(e){for(const[t,a]of e)this.AddDOMMessageHandler(t,a)}PostToDOM(e,t){this._runtime.PostComponentMessageToDOM(this._domComponentId,e,t)}PostToDOMAsync(e,t){return this._runtime.PostComponentMessageToDOMAsync(this._domComponentId,e,t)}_PostToDOMMaybeSync(e,t){this._runtime.IsInWorker()?this.PostToDOM(e,t):window.c3_runtimeInterface._OnMessageFromRuntime({type:'event',component:this._domComponentId,handler:e,data:t,responseId:null})}GetCurrentImageInfo(){return null}GetImagePoint(){const e=this._inst.GetWorldInfo();return[e.GetX(),e.GetY()]}Tick(){}Tick2(){}_StartTicking(){this._isTicking||(!this._tickFunc&&(this._tickFunc=()=>this.Tick()),this._runtime.Dispatcher().addEventListener('tick',this._tickFunc),this._isTicking=!0)}_StopTicking(){this._isTicking&&(this._runtime.Dispatcher().removeEventListener('tick',this._tickFunc),this._isTicking=!1)}IsTicking(){return this._isTicking}_StartTicking2(){this._isTicking2||(!this._tick2Func&&(this._tick2Func=()=>this.Tick2()),this._runtime.Dispatcher().addEventListener('tick2',this._tick2Func),this._isTicking2=!0)}_StopTicking2(){this._isTicking2&&(this._runtime.Dispatcher().removeEventListener('tick2',this._tick2Func),this._isTicking2=!1)}IsTicking2(){return this._isTicking2}GetDebuggerProperties(){return[]}SaveToJson(){return null}LoadFromJson(){}LoadTilemapData(){}TestPointOverlapTile(){}GetPropertyValueByIndex(){}SetPropertyValueByIndex(){}OffsetPropertyValueByIndex(e,t){if(0!==t){const a=this.GetPropertyValueByIndex(e);if('number'!=typeof a)throw new Error('expected number');this.SetPropertyValueByIndex(e,a+t)}}SetPropertyColorOffsetValueByIndex(){}CallAction(e,...t){e.call(this,...t)}CallExpression(e,...t){return e.call(this,...t)}GetScriptInterfaceClass(){return null}},'use strict',C3.SDKWorldInstanceBase=class extends C3.SDKInstanceBase{constructor(e,t){super(e,t),this._worldInfo=e.GetWorldInfo(),this._webglcontextlost_handler=null,this._webglcontextrestored_handler=null}Release(){if(this._webglcontextlost_handler){const e=this._runtime.Dispatcher();e.removeEventListener('webglcontextlost',this._webglcontextlost_handler),e.removeEventListener('webglcontextrestored',this._webglcontextrestored_handler),this._webglcontextlost_handler=null,this._webglcontextrestored_handler=null}this._worldInfo=null,super.Release()}HandleWebGLContextLoss(){if(!this._webglcontextlost_handler){this._webglcontextlost_handler=()=>this.OnWebGLContextLost(),this._webglcontextrestored_handler=()=>this.OnWebGLContextRestored();const e=this._runtime.Dispatcher();e.addEventListener('webglcontextlost',this._webglcontextlost_handler),e.addEventListener('webglcontextrestored',this._webglcontextrestored_handler)}}OnWebGLContextLost(){}OnWebGLContextRestored(){}GetWorldInfo(){return this._worldInfo}},'use strict';{const t=C3.New(C3.Rect);C3.SDKDOMInstanceBase=class extends C3.SDKWorldInstanceBase{constructor(e,t){super(e,t),this._elementId=this.GetPlugin()._AddElement(this),this._isElementShowing=!0,this._autoFontSize=!1,this._lastRect=C3.New(C3.Rect,0,0,-1,-1);const a=this._runtime.GetCanvasManager();this._lastWindowWidth=a.GetLastWidth(),this._lastWindowHeight=a.GetLastHeight(),this._isPendingUpdateState=!1,this._StartTicking()}Release(){this.GetPlugin()._RemoveElement(this._elementId),this.PostToDOMElement('destroy'),this._elementId=-1,super.Release()}PostToDOMElement(e,t){t||(t={}),t.elementId=this._elementId,this.PostToDOM(e,t)}PostToDOMElementAsync(e,t){return t||(t={}),t.elementId=this._elementId,this.PostToDOMAsync(e,t)}CreateElement(e){e||(e={});const t=this.GetWorldInfo().IsVisible();e.elementId=this._elementId,e.isVisible=t,Object.assign(e,this.GetElementState()),this._isElementShowing=!!e.isVisible,this.PostToDOM('create',e),this._UpdatePosition(!0)}SetElementVisible(e){e=!!e,this._isElementShowing===e||(this._isElementShowing=e,this.PostToDOMElement('set-visible',{isVisible:e}))}Tick(){this._UpdatePosition(!1)}_ShouldPreserveElement(){const e=this._runtime.GetCanvasManager().GetFullscreenMode();return'Android'===C3.Platform.OS&&('scale-inner'===e||'scale-outer'===e||'crop'===e)}_UpdatePosition(a){var r=Math.round;const s=this.GetWorldInfo(),_=s.GetLayer(),e=s.GetX(),d=s.GetY();let[u,c]=_.LayerToCanvasCss(e,d),[g,f]=_.LayerToCanvasCss(e+s.GetWidth(),d+s.GetHeight());const y=this._runtime.GetCanvasManager(),l=y.GetCssWidth(),m=y.GetCssHeight();if(!s.IsVisible()||!_.IsVisible())return void this.SetElementVisible(!1);if(!this._ShouldPreserveElement()){if(0>=g||0>=f||u>=l||c>=m)return void this.SetElementVisible(!1);1>u&&(u=1),1>c&&(c=1),g>=l&&(g=l-1),f>=m&&(f=m-1)}t.set(u,c,g,f);const n=y.GetLastWidth(),S=y.GetLastHeight();if(!a&&t.equals(this._lastRect)&&this._lastWindowWidth===n&&this._lastWindowHeight===S)return void this.SetElementVisible(!0);this._lastRect.copy(t),this._lastWindowWidth=n,this._lastWindowHeight=S,this.SetElementVisible(!0);let p=null;this._autoFontSize&&(p=_.GetDisplayScale()-.2),this.PostToDOMElement('update-position',{left:r(this._lastRect.getLeft())+y.GetCanvasClientX(),top:r(this._lastRect.getTop())+y.GetCanvasClientY(),width:r(this._lastRect.width()),height:r(this._lastRect.height()),fontSize:p})}FocusElement(){this.PostToDOMElement('focus',{focus:!0})}BlurElement(){this.PostToDOMElement('focus',{focus:!1})}SetElementCSSStyle(e,t){this.PostToDOMElement('set-css-style',{prop:C3.CSSToCamelCase(e),val:t})}UpdateElementState(){this._isPendingUpdateState||(this._isPendingUpdateState=!0,Promise.resolve().then(()=>{this._isPendingUpdateState=!1,this.PostToDOMElement('update-state',this.GetElementState())}))}GetElementState(){}GetElementId(){return this._elementId}}}'use strict',C3.SDKBehaviorBase=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e.runtime,this._myObjectClasses=C3.New(C3.ArraySet),this._myInstances=C3.New(C3.ArraySet)}Release(){this._myInstances.Release(),this._myObjectClasses.Release(),this._runtime=null}GetRuntime(){return this._runtime}OnCreate(){}_AddObjectClass(e){this._myObjectClasses.Add(e)}GetObjectClasses(){return this._myObjectClasses.GetArray()}_AddInstance(e){this._myInstances.Add(e)}_RemoveInstance(e){this._myInstances.Delete(e)}GetInstances(){return this._myInstances.GetArray()}},'use strict',C3.SDKBehaviorTypeBase=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e.GetRuntime(),this._behaviorType=e,this._objectClass=e.GetObjectClass(),this._behavior=e.GetBehavior(),this._behavior._AddObjectClass(this._objectClass)}Release(){this._runtime=null,this._behaviorType=null,this._objectClass=null,this._behavior=null}GetBehaviorType(){return this._behaviorType}GetObjectClass(){return this._objectClass}GetRuntime(){return this._runtime}GetBehavior(){return this._behavior}},'use strict',C3.SDKBehaviorInstanceBase=class extends C3.DefendedBase{constructor(e,t){super(),this._behInst=e,this._domComponentId=t,this._inst=e.GetObjectInstance(),this._runtime=e.GetRuntime(),this._behaviorType=e.GetBehaviorType(),this._sdkType=this._behaviorType.GetSdkType(),this._isTicking=!1,this._isTicking2=!1,this._isPostTicking=!1,this._disposables=null}Release(){this._StopTicking(),this._StopTicking2(),this._StopPostTicking(),this._disposables&&(this._disposables.Release(),this._disposables=null),this._behInst=null,this._inst=null,this._runtime=null,this._behaviorType=null,this._sdkType=null}GetBehavior(){return this._behaviorType.GetBehavior()}GetBehaviorInstance(){return this._behInst}GetObjectInstance(){return this._inst}GetObjectClass(){return this._inst.GetObjectClass()}GetWorldInfo(){return this._inst.GetWorldInfo()}GetRuntime(){return this._runtime}GetBehaviorType(){return this._behaviorType}GetSdkType(){return this._sdkType}Trigger(e){return this._runtime.Trigger(e,this._inst,this._behaviorType)}DebugTrigger(e){return this._runtime.DebugTrigger(e,this._inst,this._behaviorType)}TriggerAsync(e){return this._runtime.TriggerAsync(e,this._inst,this._behaviorType)}PostCreate(){}Tick(){}Tick2(){}PostTick(){}_StartTicking(){this._isTicking||(this._runtime._AddBehInstToTick(this),this._isTicking=!0)}_StopTicking(){this._isTicking&&(this._runtime._RemoveBehInstToTick(this),this._isTicking=!1)}IsTicking(){return this._isTicking}_StartTicking2(){this._isTicking2||(this._runtime._AddBehInstToTick2(this),this._isTicking2=!0)}_StopTicking2(){this._isTicking2&&(this._runtime._RemoveBehInstToTick2(this),this._isTicking2=!1)}IsTicking2(){return this._isTicking2}_StartPostTicking(){this._isPostTicking||(this._runtime._AddBehInstToPostTick(this),this._isPostTicking=!0)}_StopPostTicking(){this._isPostTicking&&(this._runtime._RemoveBehInstToPostTick(this),this._isPostTicking=!1)}IsPostTicking(){return this._isPostTicking}GetDebuggerProperties(){return[]}AddDOMMessageHandler(e,t){this._runtime.AddDOMComponentMessageHandler(this._domComponentId,e,t)}OnSpriteFrameChanged(){}SaveToJson(){return null}LoadFromJson(){}GetPropertyValueByIndex(){}SetPropertyValueByIndex(){}OffsetPropertyValueByIndex(e,t){if(0!==t){const a=this.GetPropertyValueByIndex(e);if('number'!=typeof a)throw new Error('expected number');this.SetPropertyValueByIndex(e,a+t)}}SetPropertyColorOffsetValueByIndex(){}CallAction(e,...t){e.call(this,...t)}CallExpression(e,...t){return e.call(this,...t)}GetScriptInterfaceClass(){return null}},'use strict';{function t(t,n){const a=t[0],r=n[0],i=a-r;if(0!=i)return i;const e=t[1],s=n[1];return e-s}let n=null;const r=new Set,s=[],l=[];self.IRuntime=class{constructor(e,t){n=e,Object.defineProperties(this,{assets:{value:n.GetAssetManager().GetIAssetManager(),writable:!1},objects:{value:t,writable:!1},globalVars:{value:{},writable:!1},projectName:{value:n.GetProjectName(),writable:!1},projectVersion:{value:n.GetProjectVersion(),writable:!1},storage:{value:new IStorage(n),writable:!1}}),n.UserScriptDispatcher().addEventListener('keydown',e=>r.has(e.key)?void e.stopPropagation():void r.add(e.key)),n.UserScriptDispatcher().addEventListener('keyup',e=>r.delete(e.key)),n.Dispatcher().addEventListener('window-blur',()=>r.clear())}_InitGlobalVars(e){Object.defineProperties(this.globalVars,e)}addEventListener(e,t){n.UserScriptDispatcher().addEventListener(e,t)}removeEventListener(e,t){n.UserScriptDispatcher().removeEventListener(e,t)}callFunction(t,...a){const r=n.GetEventSheetManager(),s=r.GetFunctionBlockByName(t);if(!s)throw new Error(`cannot find function name '${t}'`);if(!s.IsEnabled())return s.GetDefaultReturnValue();if(a.lengthe.GetILayout())}goToLayout(e){const t=n.GetLayoutManager();let a=null;if('number'==typeof e||'string'==typeof e)a=t.GetLayout(e);else throw new TypeError('expected string or number');if(!a)throw new Error('invalid layout');t.IsPendingChangeMainLayout()||t.ChangeMainLayout(a)}get keyboard(){const e=n._GetCommonScriptInterfaces().keyboard;if(!e)throw new Error('runtime.keyboard used but Keyboard object missing - add it to your project first');return e}get mouse(){const e=n._GetCommonScriptInterfaces().mouse;if(!e)throw new Error('runtime.mouse used but Mouse object missing - add it to your project first');return e}get touch(){const e=n._GetCommonScriptInterfaces().touch;if(!e)throw new Error('runtime.touch used but Touch object missing - add it to your project first');return e}invokeDownload(e,t){n.InvokeDownload(e,t)}sortZOrder(e,r){const _=n.GetCurrentLayout();for(const t of e){const e=IInstance._Unwrap(t);if(!e||!e.GetWorldInfo())throw new Error('invalid instance');const a=e.GetWorldInfo();s.push([a.GetLayer().GetIndex(),a.GetZIndex()]),l.push(e)}if(0===s.length)return;s.sort(t),l.sort((e,t)=>r(e.GetInterfaceClass(),t.GetInterfaceClass()));let d=!1;for(let t=0,a=s.length;te.GetInterfaceClass())}getFirstInstance(){const e=t.get(this).GetInstances();return 0e.GetInterfaceClass())}getFirstPickedInstance(){const e=t.get(this).GetCurrentSol().GetInstances();return 0e.GetILayer())}}}{const e=new WeakMap;self.ILayer=class{constructor(t){e.set(this,t),Object.defineProperties(this,{name:{value:t.GetName(),writable:!1},index:{value:t.GetIndex(),writable:!1},layout:{value:t.GetLayout().GetILayout(),writable:!1}})}static _Unwrap(t){return e.get(t)}get isVisible(){return e.get(this).IsVisible()}set isVisible(t){e.get(this).SetVisible(t)}get opacity(){return e.get(this).GetOpacity()}set opacity(t){t=C3.clamp(+t,0,1),isNaN(t)||e.get(this).SetOpacity(t)}getViewport(){return e.get(this).GetViewport().toDOMRect()}}}{function e(e){let t=n.get(e);return t?t:(t=C3.New(C3.Event.Dispatcher),n.set(e,t),t)}const t=new WeakMap,n=new WeakMap;let r=null;self.IInstance=class{constructor(){t.set(this,r);const e={runtime:{value:r.GetRuntime().GetIRuntime(),writable:!1},objectType:{value:r.GetObjectClass().GetIObjectClass(),writable:!1},uid:{value:r.GetUID(),writable:!1}};r._GetInstVarsScriptDescriptor(e),r._GetBehaviorsScriptDescriptor(e),Object.defineProperties(this,e)}static _Init(e){r=e}static _GetInitInst(){return r}static _Unwrap(e){return t.get(e)}_Release(){const e=n.get(this);e&&(e.Release(),n.delete(this)),t.delete(this)}addEventListener(t,a,n){e(this).addEventListener(t,a,n)}removeEventListener(t,a,n){e(this).removeEventListener(t,a,n)}dispatchEvent(t){e(this).dispatchEvent(t)}destroy(){const e=t.get(this);e.GetRuntime().DestroyInstance(e)}}}{const t=new WeakMap,n=new Map([['normal',0],['additive',1],['copy',3],['destination-over',4],['source-in',5],['destination-in',6],['source-out',7],['destination-out',8],['source-atop',9],['destination-atop',10]]),e=new Map([...n.entries()].map(e=>[e[1],e[0]])),r=C3.New(C3.Color);self.IWorldInstance=class extends IInstance{constructor(){super(),t.set(this,IInstance._GetInitInst())}get layout(){return t.get(this).GetWorldInfo().GetLayout().GetILayout()}get layer(){return t.get(this).GetWorldInfo().GetLayer().GetILayer()}get x(){return t.get(this).GetWorldInfo().GetX()}set x(e){e=+e;const n=t.get(this).GetWorldInfo();isNaN(e)||n.GetX()===e||(n.SetX(e),n.SetBboxChanged())}get y(){return t.get(this).GetWorldInfo().GetY()}set y(e){e=+e;const n=t.get(this).GetWorldInfo();isNaN(e)||n.GetY()===e||(n.SetY(e),n.SetBboxChanged())}get zElevation(){return t.get(this).GetWorldInfo().GetZElevation()}set zElevation(e){e=+e;const n=t.get(this),r=n.GetWorldInfo();r.GetZElevation()===e||(r.SetZElevation(e),n.GetRuntime().UpdateRender())}get totalZElevation(){return t.get(this).GetWorldInfo().GetTotalZElevation()}get width(){return t.get(this).GetWorldInfo().GetWidth()}set width(e){e=+e;const n=t.get(this).GetWorldInfo();isNaN(e)||n.GetWidth()===e||(n.SetWidth(e),n.SetBboxChanged())}get height(){return t.get(this).GetWorldInfo().GetHeight()}set height(e){e=+e;const n=t.get(this).GetWorldInfo();isNaN(e)||n.GetHeight()===e||(n.SetHeight(e),n.SetBboxChanged())}get angle(){return t.get(this).GetWorldInfo().GetAngle()}set angle(e){e=C3.clampAngle(+e);const a=t.get(this).GetWorldInfo();isNaN(e)||a.GetAngle()===e||(a.SetAngle(e),a.SetBboxChanged())}get angleDegrees(){return C3.toDegrees(this.angle)}set angleDegrees(e){this.angle=C3.toRadians(e)}getBoundingBox(){return t.get(this).GetWorldInfo().GetBoundingBox().toDOMRect()}getBoundingQuad(){return t.get(this).GetWorldInfo().GetBoundingQuad().toDOMQuad()}get isVisible(){return t.get(this).GetWorldInfo().IsVisible()}set isVisible(e){e=!!e;const n=t.get(this),r=n.GetWorldInfo();r.IsVisible()===e||(r.SetVisible(e),n.GetRuntime().UpdateRender())}get opacity(){return t.get(this).GetWorldInfo().GetOpacity()}set opacity(e){e=C3.clamp(+e,0,1);const n=t.get(this),r=n.GetWorldInfo();isNaN(e)||r.GetOpacity()===e||(r.SetOpacity(e),n.GetRuntime().UpdateRender())}set colorRgb(n){if(3>n.length)throw new Error('expected 3 elements');r.setRgb(n[0],n[1],n[2]);const a=t.get(this),i=a.GetWorldInfo();i.GetUnpremultipliedColor().equalsIgnoringAlpha(r)||(i.SetUnpremultipliedColor(r),a.GetRuntime().UpdateRender())}get colorRgb(){const e=t.get(this).GetWorldInfo().GetUnpremultipliedColor();return[e.getR(),e.getG(),e.getB()]}set blendMode(a){const r=n.get(a);if('number'!=typeof r)throw new Error('invalid blend mode');const i=t.get(this),e=i.GetWorldInfo();e.SetBlendMode(r),i.GetRuntime().UpdateRender()}get blendMode(){return e.get(t.get(this).GetWorldInfo().GetBlendMode())}moveToTop(){t.get(this).GetWorldInfo().ZOrderMoveToTop()}moveToBottom(){t.get(this).GetWorldInfo().ZOrderMoveToBottom()}moveToLayer(e){const a=ILayer._Unwrap(e);if(!a)throw new Error('invalid layer');t.get(this).GetWorldInfo().ZOrderMoveToLayer(a)}moveAdjacentToInstance(e,a){t.get(this).GetWorldInfo().ZOrderMoveAdjacentToInstance(t.get(e),a)}containsPoint(e,a){return t.get(this).GetWorldInfo().ContainsPoint(+e,+a)}testOverlap(n){const r=t.get(this),e=t.get(n);return r.GetRuntime().GetCollisionEngine().TestOverlap(r,e)}testOverlapSolid(){const e=t.get(this),a=e.GetRuntime().GetCollisionEngine().TestOverlapSolid(e);return a?a.GetInterfaceClass():null}}}{const e=new WeakMap;self.IDOMInstance=class extends IWorldInstance{constructor(){super(),e.set(this,IInstance._GetInitInst())}focus(){e.get(this).GetSdkInstance().FocusElement()}blur(){e.get(this).GetSdkInstance().BlurElement()}setCssStyle(t,a){e.get(this).GetSdkInstance().SetElementCSSStyle(t,a)}}}{const e=new WeakMap;let t=null;self.IBehaviorInstance=class{constructor(){e.set(this,t);const a={runtime:{value:t.GetRuntime().GetIRuntime(),writable:!1}};Object.defineProperties(this,a)}static _Init(e){t=e}static _GetInitInst(){return t}get instance(){return e.get(this).GetObjectInstance().GetInterfaceClass()}}}'use strict',C3.Plugins={},C3.Behaviors={},C3.PluginManager=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e,this._allPlugins=[],this._pluginsByCtor=new Map,this._systemPlugin=null,this._allBehaviors=[],this._behaviorsByCtor=new Map,this._solidBehavior=null,this._jumpthruBehavior=null}CreatePlugin(e){const t=this._runtime.GetObjectReference(e[0]);if(!t)throw new Error('missing plugin');C3.AddCommonACEs(e,t);const a=C3.New(t,{runtime:this._runtime,isSingleGlobal:e[1],isWorld:e[2],isRotatable:e[5],hasEffects:e[8],mustPredraw:e[9]});a.OnCreate(),this._allPlugins.push(a),this._pluginsByCtor.set(t,a)}CreateSystemPlugin(){this._systemPlugin=C3.New(C3.Plugins.System,{runtime:this._runtime,isSingleGlobal:!0}),this._systemPlugin.OnCreate()}CreateBehavior(e){const t=this._runtime.GetObjectReference(e[1]);if(!t)throw new Error('missing behavior');const a=C3.New(t,{runtime:this._runtime});a.OnCreate(),this._allBehaviors.push(a),this._behaviorsByCtor.set(t,a),!this._solidBehavior&&C3.Behaviors.solid&&a instanceof C3.Behaviors.solid?this._solidBehavior=a:!this._jumpthruBehavior&&C3.Behaviors.jumpthru&&a instanceof C3.Behaviors.jumpthru&&(this._jumpthruBehavior=a)}GetPluginByConstructorFunction(e){return this._pluginsByCtor.get(e)||null}HasBehaviorByConstructorFunction(e){return this._behaviorsByCtor.has(e)}GetBehaviorByConstructorFunction(e){return this._behaviorsByCtor.get(e)||null}GetSystemPlugin(){return this._systemPlugin}GetSolidBehavior(){return this._solidBehavior}GetJumpthruBehavior(){return this._jumpthruBehavior}},'use strict';{const e=new Set;C3.ImageInfo=class extends C3.DefendedBase{constructor(){super(),this._url='',this._size=0,this._pixelFormat=0,this._offsetX=0,this._offsetY=0,this._width=0,this._height=0,this._hasMetaData=!1,this._imageAsset=null,this._textureState='',this._rcTex=C3.New(C3.Rect),e.add(this)}Release(){this.ReleaseTexture(),this._imageAsset=null,e.delete(this)}static OnWebGLContextLost(){for(const t of e)t._textureState='',t._rcTex.set(0,0,0,0)}LoadData(e){this._url=e[0],this._size=e[1],this._pixelFormat=e[2],this._offsetX=e[3],this._offsetY=e[4],this._width=e[5],this._height=e[6],this._hasMetaData=!0}LoadAnimationFrameData(e){this._url=e[0],this._size=e[1],this._offsetX=e[2],this._offsetY=e[3],this._width=e[4],this._height=e[5],this._pixelFormat=e[11],this._hasMetaData=!0}LoadDynamicAsset(e,t){if(this._imageAsset)throw new Error('already loaded asset');this._url=t;const a={};return C3.IsAbsoluteURL(t)&&(a.loadPolicy='remote'),this.LoadAsset(e,a),this._imageAsset.Load()}ReplaceWith(e){if(e===this)throw new Error('cannot replace with self');this.ReleaseTexture(),this._url=e._url,this._size=e._size,this._pixelFormat=e._pixelFormat,this._offsetX=e._offsetX,this._offsetY=e._offsetY,this._width=e._width,this._height=e._height,this._hasMetaData=e._hasMetaData,this._imageAsset=e._imageAsset,this._textureState=e._textureState,this._rcTex=e._rcTex}GetURL(){return this._url}GetSize(){return this._size}GetPixelFormat(){return this._pixelFormat}GetOffsetX(){return this._offsetX}GetOffsetY(){return this._offsetY}GetWidth(){return this._width}GetHeight(){return this._height}GetSheetWidth(){return this._imageAsset.GetWidth()}GetSheetHeight(){return this._imageAsset.GetHeight()}LoadAsset(e,t){if(this._imageAsset)throw new Error('already got asset');t=Object.assign({},t,{url:this.GetURL(),size:this.GetSize()}),this._imageAsset=e.LoadImage(t)}async LoadStaticTexture(e,t){if(!this._imageAsset)throw new Error('no asset');if(this._textureState)throw new Error('already loaded texture');this._textureState='loading';const a=await this._imageAsset.LoadStaticTexture(e,t);return a?(this._textureState='loaded',this._hasMetaData||(this._width=a.GetWidth(),this._height=a.GetHeight(),this._hasMetaData=!0),this._rcTex.set(this._offsetX,this._offsetY,this._offsetX+this._width,this._offsetY+this._height),this._rcTex.divide(a.GetWidth(),a.GetHeight()),a):(this._textureState='',null)}ReleaseTexture(){this._textureState&&(this._imageAsset&&this._imageAsset.ReleaseTexture(),this._textureState='',this._rcTex.set(0,0,0,0))}GetTexture(){return this._imageAsset?this._imageAsset.GetTexture():null}GetTexRect(){return this._rcTex}async ExtractImageToCanvas(){const e=await this._imageAsset.LoadToDrawable(),t=C3.CreateCanvas(this._width,this._height),a=t.getContext('2d');return a.drawImage(e,this._offsetX,this._offsetY,this._width,this._height,0,0,this._width,this._height),t}}}'use strict',C3.AnimationInfo=class extends C3.DefendedBase{constructor(e){super(),this._name=e[0],this._speed=e[1],this._isLooping=!!e[2],this._repeatCount=e[3],this._repeatTo=e[4],this._isPingPong=!!e[5],this._sid=e[6],this._frames=e[7].map(e=>C3.New(C3.AnimationFrameInfo,e))}Release(){for(const e of this._frames)e.Release();C3.clearArray(this._frames)}LoadAllAssets(e){for(const t of this._frames)t.GetImageInfo().LoadAsset(e)}LoadAllTextures(e,t){return Promise.all(this._frames.map(a=>a.GetImageInfo().LoadStaticTexture(e,t)))}ReleaseAllTextures(){for(const e of this._frames)e.GetImageInfo().ReleaseTexture()}GetName(){return this._name}GetSID(){return this._sid}GetFrameCount(){return this._frames.length}GetFrames(){return this._frames}GetFrameAt(e){if(e=Math.floor(e),0>e||e>=this._frames.length)throw new RangeError('invalid frame');return this._frames[e]}GetSpeed(){return this._speed}IsLooping(){return this._isLooping}GetRepeatCount(){return this._repeatCount}GetRepeatTo(){return this._repeatTo}IsPingPong(){return this._isPingPong}},'use strict',C3.AnimationFrameInfo=class extends C3.DefendedBase{constructor(e){super(),this._imageInfo=C3.New(C3.ImageInfo),this._imageInfo.LoadAnimationFrameData(e),this._duration=e[6],this._origin=C3.New(C3.Vector2,e[7],e[8]),this._imagePoints=e[9].map(e=>C3.New(C3.ImagePoint,this,e)),this._imagePointsByName=new Map;for(const t of this._imagePoints)this._imagePointsByName.set(t.GetName().toLowerCase(),t);this._collisionPoly=null;const t=e[10];6<=t.length&&(this._collisionPoly=C3.New(C3.CollisionPoly,t))}Release(){this._collisionPoly&&(this._collisionPoly.Release(),this._collisionPoly=null),this._imageInfo.Release(),this._imageInfo=null}GetImageInfo(){return this._imageInfo}GetDuration(){return this._duration}GetOriginX(){return this._origin.getX()}GetOriginY(){return this._origin.getY()}GetCollisionPoly(){return this._collisionPoly}GetImagePointByName(e){return this._imagePointsByName.get(e.toLowerCase())||null}GetImagePointByIndex(e){return e=Math.floor(e),0>e||e>=this._imagePoints.length?null:this._imagePoints[e]}GetImagePointCount(){return this._imagePoints.length}},'use strict',C3.ImagePoint=class extends C3.DefendedBase{constructor(e,t){super(),this._afi=e,this._name=t[0],this._pos=C3.New(C3.Vector2,t[1],t[2])}Release(){}GetName(){return this._name}GetX(){return this._pos.getX()}GetY(){return this._pos.getY()}GetVec2(){return this._pos}},'use strict',C3.ObjectClass=class extends C3.DefendedBase{constructor(t,a,n){super();const r=t.GetObjectReference(n[1]);if(this._runtime=t,this._plugin=t.GetPluginManager().GetPluginByConstructorFunction(r),this._sdkType=null,this._instSdkCtor=r.Instance,this._index=a,this._sid=n[11],this._name=n[0],this._jsPropName=this._runtime.GetJsPropName(n[14]),this._isGlobal=!!n[9],this._isFamily=!!n[2],this._isOnLoaderLayout=!!n[10],this._instVars=n[3].map(e=>({sid:e[0],type:e[1],name:e[2],jsPropName:t.GetJsPropName(e[3])})),this._behaviorsCount=n[4],this._effectsCount=n[5],this._isWorldType=this._plugin.IsWorldType(),this._effectList=null,this._collisionGrid=C3.New(C3.SparseGrid,t.GetOriginalViewportWidth(),t.GetOriginalViewportHeight()),this._anyCollisionCellChanged=!0,this._anyInstanceParallaxed=!1,this._familyMembers=null,this._familyMembersSet=null,this._familyIndex=-1,this._families=null,this._familiesSet=null,this._familyInstVarMap=null,this._familyBehaviorMap=null,this._familyEffectMap=null,this._isInContainer=!1,this._container=null,this._behaviorTypes=n[8].map(e=>C3.BehaviorType.Create(this,e)),this._behaviorTypesIncludingInherited=[],this._behaviorsByName=new Map,this._behaviorNameToIndex=new Map,this._usedBehaviorCtors=new Set,this._solStack=C3.New(C3.SolStack,this),this._defaultInstanceData=null,this._defaultLayerIndex=0,this._isContained=!1,this._container=null,this._imageInfo=null,this._animations=null,this._animationsByName=null,this._animationsBySid=null,this._textureRefCount=0,this._savedData=new Map,this._unsavedData=new Map,this._instances=[],this._iidsStale=!0,this._plugin.HasEffects()&&(this._effectList=C3.New(C3.EffectList,this,n[12])),n[6]&&(this._imageInfo=C3.New(C3.ImageInfo),this._imageInfo.LoadData(n[6])),n[7]){this._animations=n[7].map(e=>C3.New(C3.AnimationInfo,e)),this._animationsByName=new Map,this._animationsBySid=new Map;for(const e of this._animations)this._animationsByName.set(e.GetName().toLowerCase(),e),this._animationsBySid.set(e.GetSID(),e)}this._isFamily?(this._familyMembers=[],this._familyMembersSet=new Set,this._familyIndex=this._runtime._GetNextFamilyIndex()):(this._families=[],this._familiesSet=new Set,this._familyInstVarMap=[],this._familyBehaviorMap=[],this._familyEffectMap=[]),this._sdkType=C3.New(r.Type,this),this._iObjectClass=null,this._instanceUserScriptClass=null;const i=this._sdkType.GetScriptInterfaceClass();if(!i)this._iObjectClass=new IObjectClass(this);else if(this._iObjectClass=new i(this),!(this._iObjectClass instanceof IObjectClass))throw new TypeError('script interface class must derive from IObjectClass');n[13]&&n[13].length&&this._sdkType.LoadTilePolyData(n[13]),(!this._runtime.UsesLoaderLayout()||this._isFamily||this._isOnLoaderLayout||!this._isWorldType)&&this.OnCreate(),this._plugin.IsSingleGlobal()&&(this._plugin._SetSingleGlobalObjectClass(this),this._CreateSingleGlobalInstance(n))}static Create(e,t,a){return C3.New(C3.ObjectClass,e,t,a)}Release(){if(this._imageInfo&&(this._imageInfo.Release(),this._imageInfo=null),this._animations){for(const e of this._animations)e.Release();C3.clearArray(this._animations),this._animationsByName.clear(),this._animationsBySid.clear()}this._solStack.Release(),this._solStack=null,this._savedData.clear(),this._unsavedData.clear(),this._container=null,this._runtime=null}_LoadFamily(e){for(let t=1,a=e.length;tthis._textureRefCount)throw new Error('released textures too many times');0===this._textureRefCount&&this._sdkType.ReleaseTextures()}}OnDynamicTextureLoadComplete(){if(this._isFamily)throw new Error('not applicable to family');this._sdkType.OnDynamicTextureLoadComplete()}PreloadTexturesWithInstances(e){return this._isFamily?Promise.resolve():this._sdkType.PreloadTexturesWithInstances(e)}GetRuntime(){return this._runtime}GetPlugin(){return this._plugin}GetInstanceSdkCtor(){return this._instSdkCtor}GetName(){return this._name}GetJsPropName(){return this._jsPropName}GetIndex(){return this._index}GetSID(){return this._sid}IsFamily(){return this._isFamily}IsGlobal(){return this._isGlobal}IsWorldType(){return this._isWorldType}GetFamilyIndex(){return this._familyIndex}GetBehaviorTypes(){return this._behaviorTypes}GetBehaviorTypesCount(){return this._behaviorsCount}UsesBehaviorByCtor(e){return e&&this._usedBehaviorCtors.has(e)}GetInstanceVariablesCount(){return this._instVars.length}GetInstanceVariableSIDs(){return this._instVars.map(e=>e.sid)}GetInstanceVariableIndexBySID(e){return this._instVars.findIndex(t=>t.sid===e)}GetInstanceVariableIndexByName(e){return this._instVars.findIndex(t=>t.name===e)}_GetAllInstanceVariableNames(){return this._instVars.map(e=>e.name)}_GetAllInstanceVariableJsPropNames(){return this._instVars.map(e=>e.jsPropName)}GetInstanceVariableType(e){if(e=Math.floor(e),0>e||e>=this._instVars.length)throw new RangeError('invalid instance variable index');return this._instVars[e].type}GetInstanceVariableName(e){if(e=Math.floor(e),0>e||e>=this._instVars.length)throw new RangeError('invalid instance variable index');return this._instVars[e].name}GetEffectTypesCount(){return this._effectsCount}GetBehaviorTypesIncludingInherited(){return this._behaviorTypesIncludingInherited}GetBehaviorTypeByName(e){return this._behaviorsByName.get(e.toLowerCase())||null}GetBehaviorIndexByName(e){const t=this._behaviorNameToIndex.get(e.toLowerCase());return'undefined'==typeof t?-1:t}GetEffectList(){return this._effectList}HasEffects(){return this._plugin.HasEffects()}UsesEffects(){return this._effectList&&this._effectList.HasAnyEffectType()}GetSolStack(){return this._solStack}GetCurrentSol(){return this._solStack.GetCurrentSol()}GetImageInfo(){return this._imageInfo}SetDefaultInstanceData(e){this._defaultInstanceData=e}GetDefaultInstanceData(){return this._defaultInstanceData}_SetDefaultLayerIndex(e){this._defaultLayerIndex=e}GetDefaultLayerIndex(){return this._defaultLayerIndex}GetAnimations(){return this._animations}GetAnimationCount(){return this._animations.length}GetFamilies(){return this._families}BelongsToFamily(e){return this._familiesSet.has(e)}GetFamilyMembers(){return this._familyMembers}FamilyHasMember(e){return this._familyMembersSet.has(e)}GetFamilyBehaviorOffset(e){return this._familyBehaviorMap[e]}GetFamilyInstanceVariableOffset(e){return this._familyInstVarMap[e]}GetAnimationByName(e){if(!this._animations)throw new Error('no animations');return this._animationsByName.get(e.toLowerCase())||null}GetAnimationBySID(e){if(!this._animations)throw new Error('no animations');return this._animationsBySid.get(e)||null}GetFirstAnimationFrame(){if(!this._animations)throw new Error('no animations');return this._animations[0].GetFrameAt(0)}GetDefaultInstanceSize(){if(this._animations){const e=this.GetFirstAnimationFrame().GetImageInfo();return[e.GetWidth(),e.GetHeight()]}return this._imageInfo?[this._imageInfo.GetWidth(),this._imageInfo.GetHeight()]:[100,100]}GetSingleGlobalInstance(){if(!this._plugin.IsSingleGlobal())throw new Error('not a single-global plugin');return this._instances[0]}GetInstances(){return this._instances}GetInstanceCount(){return this._instances.length}_AddInstance(e){this._instances.push(e)}_SetIIDsStale(){this._iidsStale=!0}_UpdateIIDs(){if(this._iidsStale&&!this._isFamily){const e=this._instances;let t=0;for(let a=e.length;te.SaveToJson())};return this._savedData&&this._savedData.size&&(e.ex=C3.ToSuperJSON(this._savedData)),e}_LoadFromJson(e){this._savedData&&(this._savedData.clear(),this._savedData=null);const t=e.ex;t&&(this._savedData=C3.FromSuperJSON(t));const a=this._instances,n=e.instances;for(let t=0,r=Math.min(a.length,n.length);te.IsWorldType())}},'use strict';{const t=[];let a=0;const n=new WeakMap,e=new WeakMap;C3.Instance=class extends C3.DefendedBase{constructor(n){super(),this._runtime=n.runtime,this._objectType=n.objectType,this._worldInfo=null,this._sdkInst=null,this._iScriptInterface=null,this._iid=0,this._uid=n.uid,this._puid=a++,this._flags=0,this._instVarValues=t,this._behaviorInstances=t;const r=this._objectType.GetBehaviorTypesIncludingInherited();0C3.New(C3.BehaviorInstance,{runtime:this._runtime,behaviorType:e,instance:this,index:t}))),this._siblings=this._objectType.IsInContainer()?[]:null,this._timeScale=-1,this._dispatcher=null;const i=this.GetPlugin();if(i.MustPreDraw()&&(this._flags|=4),i.IsWorldType())if(this._worldInfo=C3.New(C3.WorldInfo,this,n.layer),n.worldData)this._worldInfo.Init(n.worldData);else{this._worldInfo.InitNoData();const[e,t]=this._objectType.GetDefaultInstanceSize();this._worldInfo.SetSize(e,t),this.GetObjectClass().UsesEffects()&&this._worldInfo.GetInstanceEffectList().LoadDefaultEffectParameters()}n.instVarData?this._LoadInstanceVariableData(n.instVarData):this._LoadDefaultInstanceVariables()}Release(){if(this._iScriptInterface&&(this._iScriptInterface._Release(),this._iScriptInterface=null),0e||!isFinite(e))&&(e=0),this._timeScale=e}RestoreTimeScale(){this._timeScale=-1}Dispatcher(){return this._dispatcher||(this._dispatcher=C3.New(C3.Event.Dispatcher)),this._dispatcher}Draw(e){this._sdkInst.Draw(e)}OnCreate(e){this._sdkInst.OnCreate(e)}_SetHasTilemap(){this._flags|=2}HasTilemap(){return 0!=(2&this._flags)}_MarkDestroyed(){this._flags|=1}IsDestroyed(){return 0!=(1&this._flags)}MustPreDraw(){return 0!=(4&this._flags)}_IsSolidEnabled(){return 0!=(8&this._flags)}_SetSolidEnabled(e){e?this._flags|=8:this._flags&=-9}_IsJumpthruEnabled(){return 0!=(16&this._flags)}_SetJumpthruEnabled(e){e?this._flags|=16:this._flags&=-17}SetFlag(e,t){e<<=16,t?this._flags|=e:this._flags&=~e}GetFlag(e){return 0!=(this._flags&e<<16)}GetCurrentImageInfo(){return this._sdkInst.GetCurrentImageInfo()}GetImagePoint(e){return this._sdkInst.GetImagePoint(e)}GetObjectClass(){return this._objectType}BelongsToObjectClass(e){return e.IsFamily()?e.FamilyHasMember(this.GetObjectClass()):this.GetObjectClass()===e}IsInContainer(){return null!==this._siblings}_AddSibling(e){this._siblings.push(e)}GetSiblings(){return this._siblings}siblings(){return this._siblings}SetSiblingsSinglePicked(){for(const e of this.siblings())e.GetObjectClass().GetCurrentSol().SetSinglePicked(e)}_PushSiblingsToSolInstances(){for(const e of this.siblings())e.GetObjectClass().GetCurrentSol()._PushInstance(e)}_SetSiblingsToSolInstancesIndex(e){for(const t of this.siblings())t.GetObjectClass().GetCurrentSol()._GetOwnInstances()[e]=t}_PushSiblingsToSolElseInstances(){for(const e of this.siblings())e.GetObjectClass().GetCurrentSol()._PushElseInstance(e)}_SetSiblingsToSolElseInstancesIndex(e){for(const t of this.siblings())t.GetObjectClass().GetCurrentSol()._GetOwnElseInstances()[e]=t}GetPlugin(){return this._objectType.GetPlugin()}_SetIID(e){this._iid=e}GetIID(){return this._objectType._UpdateIIDs(),this._iid}GetUID(){return this._uid}GetPUID(){return this._puid}GetBehaviorInstances(){return this._behaviorInstances}GetBehaviorInstanceFromCtor(e){if(!e)return null;for(const t of this._behaviorInstances)if(t.GetBehavior()instanceof e)return t;return null}GetBehaviorSdkInstanceFromCtor(e){if(!e)return null;const t=this.GetBehaviorInstanceFromCtor(e);return t?t.GetSdkInstance():null}GetBehaviorIndexBySID(e){const t=this._behaviorInstances;for(let a=0,n=t.length;ae||e>=t.length)throw new RangeError('invalid instance variable');return t[e]}_GetInstanceVariableValueUnchecked(e){return this._instVarValues[e]}SetInstanceVariableValue(e,t){e|=0;const n=this._instVarValues;if(0>e||e>=n.length)throw new RangeError('invalid instance variable');const r=n[e];if('number'==typeof r)n[e]='number'==typeof t?t:parseFloat(t);else if('boolean'==typeof r)n[e]='boolean'==typeof t?t:!!t;else if('string'==typeof r)n[e]='string'==typeof t?t:t.toString();else throw new Error('unknown instance variable type')}SetInstanceVariableOffset(e,t){if(0!==t){e|=0;const a=this._instVarValues;if(0>e||e>=a.length)throw new RangeError('invalid instance variable');const n=a[e];if('number'==typeof n)a[e]+='number'==typeof t?t:parseFloat(t);else if('boolean'==typeof n)throw new Error('can not set offset of boolean variable');else if('string'==typeof n)throw new Error('can not set offset of string variable');else throw new Error('unknown instance variable type')}}GetSavedDataMap(){let e=n.get(this);return e?e:(e=new Map,n.set(this,e),e)}GetUnsavedDataMap(){let t=e.get(this);return t?t:(t=new Map,e.set(this,t),t)}_TriggerOnCreated(){this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnCreated,this,null)}_TriggerOnDestroyed(){this._runtime.Trigger(this.GetPlugin().constructor.Cnds.OnDestroyed,this,null)}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(e='full'){const t={};if('full'===e?t.uid=this.GetUID():t.c3=!0,'visual-state'!==e){const e=n.get(this);if(e&&e.size&&(t.ex=C3.ToSuperJSON(e)),-1!==this.GetTimeScale()&&(t.mts=this.GetTimeScale()),0r||r>=this._instVarValues.length)continue;let i=a;null===i&&(i=NaN),this._instVarValues[r]=i}}if(this.GetPlugin().IsWorldType()){const a=t.w,n=a.l;if(this._worldInfo.GetLayer().GetSID()!==n){const t=this._worldInfo.GetLayer(),a=t.GetLayout().GetLayerBySID(n);a?(this._worldInfo._SetLayer(a),t._RemoveInstance(this,!0),a._AddInstance(this,!0),a.SetZIndicesChanged(),this._worldInfo.SetBboxChanged()):'full'===e&&this._runtime.DestroyInstance(this)}this._worldInfo._LoadFromJson(a)}if('visual-state'!==e){const e=t.behs;if(e)for(const[t,a]of Object.entries(e)){const e=parseInt(t,10),n=this.GetBehaviorIndexBySID(e);0>n||n>=this._behaviorInstances.length||this._behaviorInstances[n].LoadFromJson(a)}}const a=t.data;a&&this._sdkInst.LoadFromJson(a)}GetInterfaceClass(){return this._iScriptInterface||this._InitUserScriptInterface()}_InitUserScriptInterface(){const e=this._worldInfo?IWorldInstance:IInstance,t=this._sdkInst.GetScriptInterfaceClass(),a=this._objectType._GetUserScriptInstanceClass();if(IInstance._Init(this),this._iScriptInterface=new(a||t||e),IInstance._Init(null),t&&!(this._iScriptInterface instanceof e))throw new TypeError(`script interface class '${t.name}' does not extend the right base class '${e.name}'`);if(a){const n=t||e;if(!(this._iScriptInterface instanceof n))throw new TypeError(`setInstanceClass(): class '${a.name}' does not extend the right base class '${n.name}'`)}return this._iScriptInterface}_GetInstVarsScriptDescriptor(e){if(0!==this._instVarValues.length){const t={},n=this._objectType._GetAllInstanceVariableJsPropNames();for(let e=0,a=n.length;e',this.GetSrcBlend(),this.GetDestBlend(),this._colorPremultiplied,this._zElevation)}}GetWebGLStateGroup(){return this._stateGroup}HasDefaultColor(){return this._color===s}SetBlendMode(e){this._blendMode===e||(this._blendMode=e,this._UpdateWebGLStateGroup())}GetBlendMode(){return this._blendMode}GetSrcBlend(){return this._runtime.GetWebGLRenderer().GetSrcBlendByIndex(this._blendMode)}GetDestBlend(){return this._runtime.GetWebGLRenderer().GetDestBlendByIndex(this._blendMode)}_SetLayer(e){this._layer=e,0!==this.GetZElevation()&&this._layer._SetAnyInstanceZElevated()}GetLayer(){return this._layer}GetLayout(){return this.GetLayer().GetLayout()}_SetZIndex(e){this._zIndex=0|e}GetZIndex(){return this._layer._UpdateZIndices(),this._zIndex}_GetLastCachedZIndex(){return this._zIndex}_SetFlag(e,t){t?this._flags|=e:this._flags&=~e}IsVisible(){return 0!=(this._flags&d)}SetVisible(e){this._SetFlag(d,e)}IsCollisionEnabled(){return 0!=(8&this._flags)}SetCollisionEnabled(e){e=!!e,this.IsCollisionEnabled()===e||(this._SetFlag(8,e),e?this.SetBboxChanged():this._RemoveFromCollisionCells())}SetSolidCollisionFilter(e,t){if(this._SetFlag(32,e),this._solidFilterTags&&this._solidFilterTags.clear(),!t.trim())return void(this._solidFilterTags=null);this._solidFilterTags||(this._solidFilterTags=new Set);for(const a of t.split(' '))a&&this._solidFilterTags.add(a.toLowerCase())}IsSolidCollisionAllowed(e){const t=0!=(32&this._flags),a=this._solidFilterTags;if(!e||!a)return!t;for(const n of a)if(e.has(n))return t;return!t}SetBboxChanged(){this._flags|=18,this._objectClass._SetAnyCollisionCellChanged(!0),this._runtime.UpdateRender(),this._layer.UsesRenderCells()&&(this._CalculateBbox(),this._UpdateRenderCell()),0!=(4&this._flags)&&this._inst.Dispatcher().dispatchEvent(a)}_CalculateBbox(){const t=this._boundingBox,a=this._boundingQuad,n=this._x,r=this._y,i=this._w,e=this._h;t.setWH(n-this._ox*i,r-this._oy*e,i,e),0===this._a?a.setFromRect(t):(t.offset(-n,-r),a.setFromRotatedRectPrecalc(t,this._sinA,this._cosA),a.offset(n,r),a.getBoundingBox(t)),t.normalize(),this._flags&=-3}_UpdateBbox(){0!=(2&this._flags)&&this._CalculateBbox()}GetBoundingBox(){return this._UpdateBbox(),this._boundingBox}GetBoundingQuad(){return this._UpdateBbox(),this._boundingQuad}OverwriteBoundingBox(e){this._boundingBox.copy(e),this._boundingQuad.setFromRect(this._boundingBox),this._flags&=-3,this._UpdateCollisionCell(),this._UpdateRenderCell()}SetBboxChangeEventEnabled(e){this._SetFlag(4,e)}IsBboxChangeEventEnabled(){return 0!=(4&this._flags)}IsInViewport(e){return 0===this._zElevation?e.intersectsRect(this.GetBoundingBox()):this._IsInViewport_ZElevated()}_IsInViewport_ZElevated(){const e=this.GetLayer(),t=this.GetTotalZElevation();return!(t>=e.GetCameraZ())&&(e.GetViewportForZ(t,n),n.intersectsRect(this.GetBoundingBox()))}SetSourceCollisionPoly(e){this._sourceCollisionPoly=e;const t=this._transformedPolyInfo;t&&(t.width=-1,t.height=-1,t.angle=0)}GetSourceCollisionPoly(){return this._sourceCollisionPoly}HasOwnCollisionPoly(){return!!this._sourceCollisionPoly}GetTransformedCollisionPoly(){return this._GetCustomTransformedCollisionPolyPrecalc(this.GetWidth(),this.GetHeight(),this.GetAngle(),this.GetSinAngle(),this.GetCosAngle())}GetCustomTransformedCollisionPoly(t,n,r){let i=0,s=1;return 0!==r&&(i=Math.sin(r),s=Math.cos(r)),this._GetCustomTransformedCollisionPolyPrecalc(t,n,r,i,s)}_GetCustomTransformedCollisionPolyPrecalc(t,n,r,i,a){let e=this._transformedPolyInfo;return(null===e&&(e={poly:C3.New(C3.CollisionPoly),width:-1,height:-1,angle:0},this._transformedPolyInfo=e),e.width===t&&e.height===n&&e.angle===r)?e.poly:(this._sourceCollisionPoly?(e.poly.copy(this._sourceCollisionPoly),e.poly.transformPrecalc(t,n,i,a)):e.poly.setFromQuad(this.GetBoundingQuad(),-this.GetX(),-this.GetY()),e.width=t,e.height=n,e.angle=r,e.poly)}HasTilemap(){return this._inst.HasTilemap()}ContainsPoint(e,t){return!!this.GetBoundingBox().containsPoint(e,t)&&!!this.GetBoundingQuad().containsPoint(e,t)&&(this.HasTilemap()?this._inst.GetSdkInstance().TestPointOverlapTile(e,t):!this.HasOwnCollisionPoly()||this.GetTransformedCollisionPoly().containsPoint(e-this.GetX(),t-this.GetY()))}_IsCollisionCellChanged(){return 0!=(16&this._flags)}_UpdateCollisionCell(){if(this._IsCollisionCellChanged()&&this.IsCollisionEnabled()){const a=this.GetBoundingBox(),n=this._objectClass._GetCollisionCellGrid(),r=this._collisionCells;if(t.set(n.XToCell(a.getLeft()),n.YToCell(a.getTop()),n.XToCell(a.getRight()),n.YToCell(a.getBottom())),!r.equals(t)){const a=this._inst;r===e?(n.Update(a,null,t),this._collisionCells=C3.New(C3.Rect,t)):(n.Update(a,r,t),r.copy(t)),this._flags&=-17}}}_RemoveFromCollisionCells(){const t=this._collisionCells;t===e||(this._objectClass._GetCollisionCellGrid().Update(this._inst,t,null),this._collisionCells=e)}_UpdateRenderCell(){const a=this.GetLayer();if(a.UsesRenderCells()){const n=a.GetRenderGrid(),r=this.GetBoundingBox(),i=this._renderCells;if(t.set(n.XToCell(r.getLeft()),n.YToCell(r.getTop()),n.XToCell(r.getRight()),n.YToCell(r.getBottom())),!i.equals(t)){const e=this._inst;i===l?(n.Update(e,null,t),this._renderCells=C3.New(C3.Rect,t)):(n.Update(e,i,t),i.copy(t)),a.SetRenderListStale()}}}_RemoveFromRenderCells(){const e=this._renderCells;e===l||(this.GetLayer().GetRenderGrid().Update(this._inst,e,null),this._renderCells=l)}GetRenderCellRange(){return this._renderCells}ZOrderMoveToTop(){const e=this._inst,t=this._layer,a=t._GetInstances();a.length&&a[a.length-1]===e||(t._RemoveInstance(e,!1),t._AddInstance(e,!1),this._runtime.UpdateRender())}ZOrderMoveToBottom(){const e=this._inst,t=this._layer,a=t._GetInstances();a.length&&a[0]===e||(t._RemoveInstance(e,!1),t._PrependInstance(e,!1),this._runtime.UpdateRender())}ZOrderMoveToLayer(e){const t=this._inst,a=this._layer;if(a.GetLayout()!==e.GetLayout())throw new Error('layer from different layout');e===a||(a._RemoveInstance(t,!0),this._SetLayer(e),e._AddInstance(t,!0),this._runtime.UpdateRender())}ZOrderMoveAdjacentToInstance(t,a){const n=this._inst,r=this._layer;if(t.GetUID()!==n.GetUID()){const i=t.GetWorldInfo();if(!i)throw new Error('expected world instance');const e=i.GetLayer();r.GetIndex()!==e.GetIndex()&&(r._RemoveInstance(n,!0),this._SetLayer(e),e._AddInstance(n,!0)),e.MoveInstanceAdjacent(n,t,!!a),this._runtime.UpdateRender()}}GetInstanceEffectList(){return this._instanceEffectList}_SetHasAnyActiveEffect(e){this._SetFlag(64,e)}HasAnyActiveEffect(){return 0!=(64&this._flags)}_SaveToJson(){const e={x:this.GetX(),y:this.GetY(),w:this.GetWidth(),h:this.GetHeight(),l:this.GetLayer().GetSID(),zi:this.GetZIndex()};0!==this.GetZElevation()&&(e.ze=this.GetZElevation()),0!==this.GetAngle()&&(e.a=this.GetAngle()),this.HasDefaultColor()||(e.c=this._color.toJSON()),.5!==this.GetOriginX()&&(e.oX=this.GetOriginX()),.5!==this.GetOriginY()&&(e.oY=this.GetOriginY()),0!==this.GetBlendMode()&&(e.bm=this.GetBlendMode()),this.IsVisible()||(e.v=this.IsVisible()),this.IsCollisionEnabled()||(e.ce=this.IsCollisionEnabled()),this.IsBboxChangeEventEnabled()&&(e.be=this.IsBboxChangeEventEnabled()),this._instanceEffectList&&(e.fx=this._instanceEffectList._SaveToJson());const t=0!=(32&this._flags);return t&&(e.sfi=t),this._solidFilterTags&&(e.sft=[...this._solidFilterTags].join(' ')),e}_LoadFromJson(e){_=!1,this.SetX(e.x),this.SetY(e.y),this.SetWidth(e.w),this.SetHeight(e.h),this._SetZIndex(e.zi),this.SetZElevation(e.hasOwnProperty('ze')?e.ze:0),this.SetAngle(e.hasOwnProperty('a')?e.a:0),e.hasOwnProperty('c')?r.setFromJSON(e.c):e.hasOwnProperty('o')?(r.copyRgb(this._color),r.a=e.o):r.setRgba(1,1,1,1),this._SetColor(r),this.SetOriginX(e.hasOwnProperty('oX')?e.oX:.5),this.SetOriginY(e.hasOwnProperty('oY')?e.oY:.5),this.SetBlendMode(e.hasOwnProperty('bm')?e.bm:0),this.SetVisible(!e.hasOwnProperty('v')||e.v),this.SetCollisionEnabled(!e.hasOwnProperty('ce')||e.ce),this.SetBboxChangeEventEnabled(!!e.hasOwnProperty('be')&&e.be),this.SetSolidCollisionFilter(!!e.hasOwnProperty('sfi')&&e.sfi,e.hasOwnProperty('sft')?e.sft:''),this._instanceEffectList&&e.hasOwnProperty('fx')&&this._instanceEffectList._LoadFromJson(e.fx),this.SetBboxChanged(),_=!0,this._UpdateWebGLStateGroup()}}}'use strict',C3.BehaviorType=class extends C3.DefendedBase{constructor(t,a){super();const n=t.GetRuntime(),r=n.GetPluginManager(),i=n.GetObjectReference(a[1]);r.HasBehaviorByConstructorFunction(i)||r.CreateBehavior(a),this._runtime=n,this._objectClass=t,this._behavior=r.GetBehaviorByConstructorFunction(i),this._sdkType=null,this._instSdkCtor=i.Instance,this._sid=a[2],this._name=a[0],this._jsPropName=this._runtime.GetJsPropName(a[3]),this._sdkType=C3.New(i.Type,this),this.OnCreate()}static Create(e,t){return C3.New(C3.BehaviorType,e,t)}Release(){this._runtime=null,this._behavior=null,this._sdkType.Release(),this._sdkType=null,this._instSdkCtor=null}GetSdkType(){return this._sdkType}OnCreate(){this._sdkType.OnCreate()}GetRuntime(){return this._runtime}GetObjectClass(){return this._objectClass}GetBehavior(){return this._behavior}GetInstanceSdkCtor(){return this._instSdkCtor}GetName(){return this._name}GetSID(){return this._sid}GetJsPropName(){return this._jsPropName}},'use strict',C3.BehaviorInstance=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e.runtime,this._behaviorType=e.behaviorType,this._behavior=this._behaviorType.GetBehavior(),this._inst=e.instance,this._index=e.index,this._sdkInst=null,this._iScriptInterface=null,this._behavior._AddInstance(this._inst)}Release(){this._behavior._RemoveInstance(this._inst),this._sdkInst.Release(),this._sdkInst=null,this._iScriptInterface=null,this._runtime=null,this._behaviorType=null,this._behavior=null,this._inst=null}_CreateSdkInstance(e){if(this._sdkInst)throw new Error('already got sdk instance');this._sdkInst=C3.New(this._behaviorType.GetInstanceSdkCtor(),this,e),this._InitScriptInterface()}GetSdkInstance(){return this._sdkInst}GetObjectInstance(){return this._inst}GetRuntime(){return this._runtime}GetBehaviorType(){return this._behaviorType}GetBehavior(){return this._behavior}_GetIndex(){return this._index}PostCreate(){this._sdkInst.PostCreate()}OnSpriteFrameChanged(e,t){this._sdkInst.OnSpriteFrameChanged(e,t)}_GetDebuggerProperties(){return this._sdkInst.GetDebuggerProperties()}SaveToJson(){return this._sdkInst.SaveToJson()}LoadFromJson(e){return this._sdkInst.LoadFromJson(e)}static SortByTickSequence(t,n){const a=t.GetObjectInstance(),r=n.GetObjectInstance(),i=a.GetObjectClass().GetIndex(),e=r.GetObjectClass().GetIndex();if(i!==e)return i-e;const s=a.GetPUID(),l=r.GetPUID();return s===l?t.GetBehaviorInstance()._GetIndex()-n.GetBehaviorInstance()._GetIndex():s-l}_InitScriptInterface(){const e=IBehaviorInstance,t=this._sdkInst.GetScriptInterfaceClass();if(IBehaviorInstance._Init(this),this._iScriptInterface=new(t||e),IBehaviorInstance._Init(null),t&&!(this._iScriptInterface instanceof e))throw new TypeError(`script interface class '${t.name}' does not extend the right base class '${e.name}'`)}GetScriptInterface(){return this._iScriptInterface}},'use strict',C3.EffectList=class extends C3.DefendedBase{constructor(e,t){super(),this._owner=e,this._allEffectTypes=[],this._activeEffectTypes=[],this._effectTypesByName=new Map,this._effectParams=[],this._preservesOpaqueness=!0;for(const n of t){const e=C3.New(C3.EffectType,this,n,this._allEffectTypes.length);this._allEffectTypes.push(e),this._effectTypesByName.set(e.GetName().toLowerCase(),e),3<=n.length&&this._effectParams.push(this._LoadSingleEffectParameters(n[2]))}this.GetRuntime()._AddEffectList(this)}Release(){C3.clearArray(this._allEffectTypes),C3.clearArray(this._activeEffectTypes),this._effectTypesByName.clear(),C3.clearArray(this._effectParams),this._owner=null}PrependEffectTypes(e){if(e.length){this._allEffectTypes=e.concat(this._allEffectTypes);for(const t of e)this._effectTypesByName.set(t.GetName().toLowerCase(),t);for(let e=0,t=this._allEffectTypes.length;e({name:e.GetName(),active:e.IsActive(),params:C3.EffectList.SaveFxParamsToJson(this._effectParams[e.GetIndex()])}))}LoadFromJson(e){for(const t of e){const e=this.GetEffectTypeByName(t.name);e&&(e.SetActive(t.active),this._effectParams[e.GetIndex()]=C3.EffectList.LoadFxParamsFromJson(t.params))}this.UpdateActiveEffects()}},'use strict',C3.EffectType=class extends C3.DefendedBase{constructor(e,t,a){super(),this._effectList=e,this._id=t[0],this._name=t[1],this._index=a,this._shaderProgram=null,this._isActive=!0}Release(){this._effectList=null,this._shaderProgram=null}Clone(e){const t=C3.New(C3.EffectType,e,[this._id,this._name],-1);return t._shaderProgram=this._shaderProgram,t._isActive=this._isActive,t}_InitRenderer(e){const t=e.GetShaderProgramByName(this._id);if(!t)throw new Error('failed to find shader program \''+this._id+'\'');this._shaderProgram=t}GetEffectList(){return this._effectList}GetName(){return this._name}_SetIndex(e){this._index=e}GetIndex(){return this._index}GetOwner(){return this._effectList.GetOwner()}GetRuntime(){return this._effectList.GetRuntime()}SetActive(e){this._isActive=!!e}IsActive(){return this._isActive}GetShaderProgram(){return this._shaderProgram}GetDefaultParameterValues(){const e=[];for(let t=0,a=this._shaderProgram.GetParameterCount();te.GetShaderProgram().UsesDest())}IsEffectIndexActive(e){return this._activeEffectFlags[e]}SetEffectIndexActive(e,t){this._activeEffectFlags[e]=!!t}_SaveToJson(){return this._effectList.GetAllEffectTypes().map(e=>({name:e.GetName(),active:this._activeEffectFlags[e.GetIndex()],params:C3.EffectList.SaveFxParamsToJson(this._effectParams[e.GetIndex()])}))}_LoadFromJson(e){for(const t of e){const e=this._effectList.GetEffectTypeByName(t.name);e&&(this._activeEffectFlags[e.GetIndex()]=t.active,this._effectParams[e.GetIndex()]=C3.EffectList.LoadFxParamsFromJson(t.params))}this.UpdateActiveEffects()}},'use strict';{const t=[],r=[],a=[],s=C3.New(C3.CollisionPoly),n=C3.New(C3.CollisionPoly),_=C3.New(C3.Quad),u=C3.New(C3.Rect),g=C3.New(C3.Rect);C3.CollisionEngine=class extends C3.DefendedBase{constructor(e){super(),this._runtime=e,this._registeredCollisions=[],this._collisionCheckCount=0,this._collisionCheckSec=0,this._polyCheckCount=0,this._polyCheckSec=0}Release(){this._runtime=null}_Update1sStats(){this._collisionCheckSec=this._collisionCheckCount,this._collisionCheckCount=0,this._polyCheckSec=this._polyCheckCount,this._polyCheckCount=0}Get1secCollisionChecks(){return this._collisionCheckSec}Get1secPolyChecks(){return this._polyCheckSec}RegisterCollision(e,t){const a=e.GetWorldInfo(),n=t.GetWorldInfo();a&&n&&a.IsCollisionEnabled()&&n.IsCollisionEnabled()&&this._registeredCollisions.push([e,t])}AddRegisteredCollisionCandidates(t,n,r){for(const[e,i]of this._registeredCollisions){let a=null;if(t===e)a=i;else if(t===i)a=e;else continue;a.BelongsToObjectClass(n)&&!r.includes(a)&&r.push(a)}}CheckRegisteredCollision(t,e){if(!this._registeredCollisions.length)return!1;for(const[a,n]of this._registeredCollisions)if(t===a&&e===n||t===n&&e===a)return!0;return!1}ClearRegisteredCollisions(){C3.clearArray(this._registeredCollisions)}TestOverlap(t,a){if(!t||!a||t===a)return!1;const n=t.GetWorldInfo(),e=a.GetWorldInfo();if(!n.IsCollisionEnabled()||!e.IsCollisionEnabled())return!1;this._collisionCheckCount++;const r=n.GetLayer(),s=e.GetLayer(),l=r!==s&&!r._IsCollisionCompatibleWith(s);return l?this._TestOverlap_DifferentLayers(n,e):this._TestOverlap_SameLayers(n,e)}_TestOverlap_SameLayers(e,t){if(!e.GetBoundingBox().intersectsRect(t.GetBoundingBox()))return!1;if(this._polyCheckCount++,!e.GetBoundingQuad().intersectsQuad(t.GetBoundingQuad()))return!1;if(e.HasTilemap()&&t.HasTilemap())return!1;if(e.HasTilemap())return this.TestTilemapOverlap(e,t);if(t.HasTilemap())return this.TestTilemapOverlap(t,e);if(!e.HasOwnCollisionPoly()&&!t.HasOwnCollisionPoly())return!0;const a=e.GetTransformedCollisionPoly(),n=t.GetTransformedCollisionPoly();return a.intersectsPoly(n,t.GetX()-e.GetX(),t.GetY()-e.GetY())}_TestOverlap_DifferentLayers(t,r){const a=t.GetLayer(),l=r.GetLayer();s.copy(t.GetTransformedCollisionPoly()),n.copy(r.GetTransformedCollisionPoly());const _=s.pointsArr();for(let n=0,i=_.length;nr;++r){const d=2*r-1;if(s.SetXY(e+a*c*d,l+n*c*d),s.SetBboxChanged(),!this.TestOverlap(t,_))if(_=this.TestOverlapSolid(t),_)u=_;else return u&&this.PushInFractional(t,a*d,n*d,u,16,!0),!0}return s.SetXY(e,l),s.SetBboxChanged(),!1}PushInFractional(t,a,n,r,s,_){let d=2,u=!1,c=!1;const p=t.GetWorldInfo();let m=p.GetX(),f=p.GetY();for(;d<=s;){const i=1/d;d*=2,p.OffsetXY(a*i*(u?1:-1),n*i*(u?1:-1)),p.SetBboxChanged(),this.TestOverlap(t,r)||_&&this.TestOverlapSolid(t)?(u=!0,c=!0):(u=!1,c=!1,m=p.GetX(),f=p.GetY())}c&&(p.SetXY(m,f),p.SetBboxChanged())}PushOutSolidNearest(t,a=100){var n=Math.floor;let r=0;const s=t.GetWorldInfo(),e=s.GetX(),l=s.GetY();let _=0,u=this.TestOverlapSolid(t);if(!u)return!0;for(;r<=a;){let a=0,i=0;if(0==_?(a=0,i=-1,r++):1==_?(a=1,i=-1):2==_?(a=1,i=0):3==_?(a=1,i=1):4==_?(a=0,i=1):5==_?(a=-1,i=1):6==_?(a=-1,i=0):7==_?(a=-1,i=-1):void 0,_=(_+1)%8,s.SetXY(n(e+a*r),n(l+i*r)),s.SetBboxChanged(),!this.TestOverlap(t,u)&&(u=this.TestOverlapSolid(t),!u))return!0}return s.SetXY(e,l),s.SetBboxChanged(),!1}CalculateBounceAngle(_,a,S,c){var d=Math.sin,e=Math.cos,f=Math.PI;const G=_.GetWorldInfo(),g=G.GetX(),h=G.GetY(),I=Math.max(10,C3.distanceTo(a,S,g,h)),l=C3.angleTo(a,S,g,h),m=c||this.TestOverlapSolid(_);if(!m)return C3.clampAngle(l+f);let n=m,T=0,b=0;const C=C3.toRadians(5);let r;for(r=1;36>r;++r){const t=l-r*C;if(G.SetXY(a+e(t)*I,S+d(t)*I),G.SetBboxChanged(),!this.TestOverlap(_,n)&&(n=c?null:this.TestOverlapSolid(_),!n)){T=t;break}}for(36===r&&(T=C3.clampAngle(l+f)),n=m,r=1;36>r;++r){const t=l+r*C;if(G.SetXY(a+e(t)*I,S+d(t)*I),G.SetBboxChanged(),!this.TestOverlap(_,n)&&(n=c?null:this.TestOverlapSolid(_),!n)){b=t;break}}if(36===r&&(b=C3.clampAngle(l+f)),G.SetXY(g,h),G.SetBboxChanged(),b===T)return b;const P=C3.angleDiff(b,T)/2;let i=C3.angleClockwise(b,T)?C3.clampAngle(T+P+f):C3.clampAngle(b+P);const t=e(l),u=d(l),v=e(i),R=d(i),x=t*v+u*R;return C3.angleTo(0,0,t-2*x*v,u-2*x*R)}TestSegmentOverlap(t,a,n,r,s){var e=Math.min,l=Math.max;if(!s)return!1;const _=s.GetWorldInfo();if(!_.IsCollisionEnabled())return!1;if(this._collisionCheckCount++,u.set(e(t,n),e(a,r),l(t,n),l(a,r)),!_.GetBoundingBox().intersectsRect(u))return!1;if(s.HasTilemap())return this._TestSegmentOverlapTilemap(t,a,n,r,s,_);if(this._polyCheckCount++,!_.GetBoundingQuad().intersectsSegment(t,a,n,r))return!1;if(!_.HasOwnCollisionPoly())return!0;const i=_.GetTransformedCollisionPoly();return i.intersectsSegment(_.GetX(),_.GetY(),t,a,n,r)}_TestSegmentOverlapTilemap(t,a,s,e,d,c){const i=c.GetX(),p=c.GetY(),l=d.GetSdkInstance(),m=r;g.set(t,a,s,e),g.normalize(),l.GetCollisionRectCandidates(g,m);for(let n=0,r=m.length;nthis._loadingProgress=e.progress,this._webglPercentText=null,this._loadingLogoAsset=null,this._splashTextures={logo:null,powered:null,website:null},this._splashFrameNumber=0,this._splashFadeInFinishTime=0,this._splashFadeOutStartTime=0,this._splashState='fade-in',this._splashDoneResolve=null,this._splashDonePromise=new Promise(e=>this._splashDoneResolve=e)}_SetGPUPowerPreference(e){this._gpuPreference=e}async CreateCanvas(e){this._canvas=e.canvas,this._canvas.addEventListener('webglcontextlost',e=>this._OnWebGLContextLost(e)),this._canvas.addEventListener('webglcontextrestored',e=>this._OnWebGLContextRestored(e));const t={powerPreference:this._gpuPreference,enableGpuProfiling:!0};'standard'===this._runtime.GetCompositingMode()?t.alpha=!0:(t.alpha=!1,t.lowLatency=!0),this._webglRenderer=C3.New(C3.Gfx.WebGLRenderer,this._canvas,t),await this._webglRenderer.InitState(),this._webglRenderer.SupportsGPUProfiling()||(this._gpuLastUtilisation=NaN),this._runtime.AddDOMComponentMessageHandler('runtime','window-resize',e=>this._OnWindowResize(e)),this._runtime.AddDOMComponentMessageHandler('runtime','fullscreenchange',e=>this._OnFullscreenChange(e)),this._runtime.AddDOMComponentMessageHandler('runtime','fullscreenerror',e=>this._OnFullscreenError(e)),this._isDocumentFullscreen=!!e.isFullscreen,this.SetSize(e.windowInnerWidth,e.windowInnerHeight,!0),this._shaderData=self.C3_Shaders,await this._LoadShaderPrograms();let n=!1;for(const t of this._runtime._GetAllEffectLists()){for(const e of t.GetAllEffectTypes())e._InitRenderer(this._webglRenderer),e.GetShaderProgram().UsesDest()&&(n=!0);t.UpdateActiveEffects()}this._runtime._SetUsesAnyBackgroundBlending(n),this._webglRenderer.SupportsGPUProfiling()&&(this._gpuFrameTimingsBuffer=C3.New(C3.Gfx.WebGLQueryResultBuffer,this._webglRenderer))}async _LoadShaderPrograms(){if(this._shaderData){const e=[];for(const[t,a]of Object.entries(this._shaderData)){const n=C3.Gfx.WebGLShaderProgram.GetDefaultVertexShaderSource(this._webglRenderer.Is3D());e.push(this._webglRenderer.CreateShaderProgram(a,n,t))}await Promise.all(e),this._webglRenderer.ResetLastProgram(),this._webglRenderer.SetTextureFillMode()}}Release(){this._runtime=null,this._webglRenderer=null,this._canvas=null}_OnWindowResize(e){const t=e.devicePixelRatio;this._runtime.IsInWorker()&&(self.devicePixelRatio=t),this._runtime._SetDevicePixelRatio(t),this.SetSize(e.innerWidth,e.innerHeight),this._runtime.UpdateRender()}_OnFullscreenChange(e){this._isDocumentFullscreen=!!e.isFullscreen,this.SetSize(e.innerWidth,e.innerHeight,!0),this._runtime.UpdateRender()}_OnFullscreenError(e){this._isDocumentFullscreen=!!e.isFullscreen,this.SetSize(e.innerWidth,e.innerHeight,!0),this._runtime.UpdateRender()}SetSize(e,t,n=!1){var r=Math.floor;if(e=r(e),t=r(t),0>=e||0>=t)throw new Error('invalid size');if(this._windowInnerWidth!==e||this._windowInnerHeight!==t||n){this._windowInnerWidth=e,this._windowInnerHeight=t;const a=this.GetCurrentFullscreenMode();'letterbox-scale'===a?this._CalculateLetterboxScale(e,t):'letterbox-integer-scale'===a?this._CalculateLetterboxIntegerScale(e,t):'off'===a?this._CalculateFixedSizeCanvas(e,t):this._CalculateFullsizeCanvas(e,t),this._UpdateFullscreenScalingQuality(a),this._canvas.width=this._canvasDeviceWidth,this._canvas.height=this._canvasDeviceHeight,this._runtime.PostComponentMessageToDOM('canvas','update-size',{marginLeft:this._canvasCssOffsetX,marginTop:this._canvasCssOffsetY,styleWidth:this._canvasCssWidth,styleHeight:this._canvasCssHeight}),this._webglRenderer.SetSize(this._canvasDeviceWidth,this._canvasDeviceHeight,!0)}}_CalculateLetterboxScale(t,a){var n=Math.round,r=Math.floor;const i=this._runtime.GetDevicePixelRatio(),e=this._runtime.GetOriginalViewportWidth(),s=this._runtime.GetOriginalViewportHeight(),l=e/s;t/a>l?(this._canvasCssWidth=n(a*l),this._canvasCssHeight=a,this._canvasCssOffsetX=r((t-this._canvasCssWidth)/2),this._canvasCssOffsetY=0):(this._canvasCssWidth=t,this._canvasCssHeight=n(t/l),this._canvasCssOffsetX=0,this._canvasCssOffsetY=r((a-this._canvasCssHeight)/2)),this._canvasDeviceWidth=n(this._canvasCssWidth*i),this._canvasDeviceHeight=n(this._canvasCssHeight*i),this._runtime.SetViewportSize(e,s)}_CalculateLetterboxIntegerScale(t,n){var r=Math.max,s=Math.round,l=Math.floor;const e=this._runtime.GetDevicePixelRatio();1!==e&&(t+=1,n+=1);const _=this._runtime.GetOriginalViewportWidth(),d=this._runtime.GetOriginalViewportHeight(),u=_/d,i=t/n;let c;if(i>u){const t=n*u;c=t*e/_}else{const a=t/u;c=a*e/d}1c&&(c=1/Math.ceil(1/c)),this._canvasDeviceWidth=s(_*c),this._canvasDeviceHeight=s(d*c),this._canvasCssWidth=this._canvasDeviceWidth/e,this._canvasCssHeight=this._canvasDeviceHeight/e,this._canvasCssOffsetX=r(l((t-this._canvasCssWidth)/2),0),this._canvasCssOffsetY=r(l((n-this._canvasCssHeight)/2),0),this._runtime.SetViewportSize(_,d)}_CalculateFullsizeCanvas(t,a){var n=Math.round;const r=this._runtime.GetDevicePixelRatio();this._canvasCssWidth=t,this._canvasCssHeight=a,this._canvasDeviceWidth=n(this._canvasCssWidth*r),this._canvasDeviceHeight=n(this._canvasCssHeight*r),this._canvasCssOffsetX=0,this._canvasCssOffsetY=0;const i=this.GetDisplayScale();this._runtime.SetViewportSize(this._canvasCssWidth/i,this._canvasCssHeight/i)}_CalculateFixedSizeCanvas(t,a){var n=Math.round,r=Math.floor;const i=this._runtime.GetDevicePixelRatio();this._canvasCssWidth=this._runtime.GetViewportWidth(),this._canvasCssHeight=this._runtime.GetViewportHeight(),this._canvasDeviceWidth=n(this._canvasCssWidth*i),this._canvasDeviceHeight=n(this._canvasCssHeight*i),this.IsDocumentFullscreen()?(this._canvasCssOffsetX=r((t-this._canvasCssWidth)/2),this._canvasCssOffsetY=r((a-this._canvasCssHeight)/2)):(this._canvasCssOffsetX=0,this._canvasCssOffsetY=0),this._runtime.SetViewportSize(this._runtime.GetViewportWidth(),this._runtime.GetViewportHeight())}_UpdateFullscreenScalingQuality(e){if('high'===this._wantFullscreenScalingQuality)this._drawWidth=this._canvasDeviceWidth,this._drawHeight=this._canvasDeviceHeight,this._fullscreenScalingQuality='high';else{let t,n;if('off'===this.GetCurrentFullscreenMode()?(t=this._runtime.GetViewportWidth(),n=this._runtime.GetViewportHeight()):(t=this._runtime.GetOriginalViewportWidth(),n=this._runtime.GetOriginalViewportHeight()),this._canvasDeviceWidthe&&(this._drawHeight=this._drawWidth/a)}else if('scale-outer'===e){const e=t/n,a=this._windowInnerWidth/this._windowInnerHeight;a>e?this._drawWidth=this._drawHeight*a:ar||'scale-inner'===t&&it.IsCompatibleWithOptions(e));let n;return-1===a?n=this._webglRenderer.CreateRenderTarget(e):(n=t[a],t.splice(a,1)),this._usedAdditionalRenderTargets.add(n),n}ReleaseAdditionalRenderTarget(e){if(!this._usedAdditionalRenderTargets.has(e))throw new Error('render target not in use');this._usedAdditionalRenderTargets.delete(e),this._availableAdditionalRenderTargets.push(e)}*activeLayersGpuProfiles(){for(const e of this._runtime.GetLayoutManager().runningLayouts())for(const t of e.GetLayers()){const e=this._layersGpuProfile.get(t);e&&(yield e)}}GetLayerTimingsBuffer(e){if(!this._webglRenderer.SupportsGPUProfiling())return null;let t=this._layersGpuProfile.get(e);return t||(t={name:e.GetName(),timingsBuffer:C3.New(C3.Gfx.WebGLQueryResultBuffer,this._webglRenderer),curUtilisation:0,lastUtilisation:0},this._layersGpuProfile.set(e,t)),t.timingsBuffer}_Update1sFrameRange(){if(this._webglRenderer.SupportsGPUProfiling()&&0===this._gpuTimeEndFrame){this._gpuTimeEndFrame=this._webglRenderer.GetFrameNumber(),this._gpuCurUtilisation=NaN;for(const e of this.activeLayersGpuProfiles())e.curUtilisation=NaN}}_UpdateTick(){var e=Math.min;if(this._webglRenderer.SupportsGPUProfiling()&&isNaN(this._gpuCurUtilisation)&&(this._gpuCurUtilisation=this._gpuFrameTimingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame,this._gpuTimeEndFrame),!isNaN(this._gpuCurUtilisation))){if(this._runtime.IsDebug())for(const e of this.activeLayersGpuProfiles())if(e.curUtilisation=e.timingsBuffer.GetFrameRangeResultSum(this._gpuTimeStartFrame,this._gpuTimeEndFrame),isNaN(e.curUtilisation))return;if(this._gpuFrameTimingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame),this._gpuLastUtilisation=e(this._gpuCurUtilisation,1),this._runtime.IsDebug()){for(const t of this.activeLayersGpuProfiles())t.timingsBuffer.DeleteAllBeforeFrameNumber(this._gpuTimeEndFrame),t.lastUtilisation=e(t.curUtilisation,1);C3Debugger.UpdateGPUProfile(this._gpuLastUtilisation,[...this.activeLayersGpuProfiles()])}this._gpuTimeStartFrame=this._gpuTimeEndFrame,this._gpuTimeEndFrame=0}}GetGPUFrameTimingsBuffer(){return this._gpuFrameTimingsBuffer}GetGPUUtilisation(){return this._gpuLastUtilisation}SnapshotCanvas(e,t){return(this._snapshotFormat=e,this._snapshotQuality=t,this._snapshotPromise)?this._snapshotPromise:(this._snapshotPromise=new Promise(e=>{this._snapshotResolve=e}),this._snapshotPromise)}_MaybeTakeSnapshot(){this._snapshotFormat&&(C3.CanvasToBlob(this._canvas,this._snapshotFormat,this._snapshotQuality).then(e=>{this._snapshotUrl=URL.createObjectURL(e),this._snapshotPromise=null,this._snapshotResolve(this._snapshotUrl)}),this._snapshotFormat='',this._snapshotQuality=1)}GetCanvasSnapshotUrl(){return this._snapshotUrl}InitLoadingScreen(e){if(2===e)this._webglPercentText=C3.New(C3.Gfx.WebGLText,this._webglRenderer),this._webglPercentText.SetIsAsync(!1),this._webglPercentText.SetFontName('Arial'),this._webglPercentText.SetFontSize(16),this._webglPercentText.SetHorizontalAlignment('center'),this._webglPercentText.SetVerticalAlignment('center'),this._webglPercentText.SetSize(300,200);else if(0===e){const e=this._runtime.GetAssetManager();let t;if(this._runtime.IsPreview()){if(!e._HasLocalUrlBlob('loading-logo.png'))return;t=e.GetLocalUrlAsBlobUrl('loading-logo.png')}else t=e.GetIconsSubfolder()+'loading-logo.png';this._loadingLogoAsset=e.LoadImage({url:t}),this._loadingLogoAsset.LoadStaticTexture(this._webglRenderer).catch(()=>console.warn(`[C3 runtime] Failed to load 'loading-logo.png' for loading screen. Check the project has an icon with that name.`))}else 4==e&&(this._LoadSvgSplashImage('splash-images/splash-logo.svg').then(e=>{'done'===this._splashState?this._webglRenderer.DeleteTexture(e):this._splashTextures.logo=e}).catch(e=>console.warn('Failed to load splash image: ',e)),this._LoadBitmapSplashImage('splash-images/splash-poweredby-512.png').then(e=>{'done'===this._splashState?this._webglRenderer.DeleteTexture(e):this._splashTextures.powered=e}).catch(e=>console.warn('Failed to load splash image: ',e)),this._LoadBitmapSplashImage('splash-images/splash-website-512.png').then(e=>{'done'===this._splashState?this._webglRenderer.DeleteTexture(e):this._splashTextures.website=e}).catch(e=>console.warn('Failed to load splash image: ',e)))}async _LoadSvgSplashImage(e){e=new URL(e,this._runtime.GetBaseURL()).toString();const t=await C3.FetchBlob(e),n=await this._runtime.RasterSvgImage(t,2048,2048);return await this._webglRenderer.CreateStaticTextureAsync(n,{mipMapQuality:'high'})}async _LoadBitmapSplashImage(e){e=new URL(e,this._runtime.GetBaseURL()).toString();const t=await C3.FetchBlob(e);return await this._webglRenderer.CreateStaticTextureAsync(t,{mipMapQuality:'high'})}StartLoadingScreen(){this._loaderStartTime=Date.now(),this._runtime.Dispatcher().addEventListener('loadingprogress',this._loadingprogress_handler),this._rafId=requestAnimationFrame(()=>this._DrawLoadingScreen())}async EndLoadingScreen(){this._loadingProgress=1,4===this._runtime.GetLoaderStyle()&&(await this._splashDonePromise),this._splashDoneResolve=null,this._splashDonePromise=null,-1!==this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=-1),this._runtime.Dispatcher().removeEventListener('loadingprogress',this._loadingprogress_handler),this._loadingprogress_handler=null,this._webglPercentText&&(this._webglPercentText.Release(),this._webglPercentText=null),this._loadingLogoAsset&&(this._loadingLogoAsset.Release(),this._loadingLogoAsset=null),this._webglRenderer.Start(),this._splashTextures.logo&&(this._webglRenderer.DeleteTexture(this._splashTextures.logo),this._splashTextures.logo=null),this._splashTextures.powered&&(this._webglRenderer.DeleteTexture(this._splashTextures.powered),this._splashTextures.powered=null),this._splashTextures.website&&(this._webglRenderer.DeleteTexture(this._splashTextures.website),this._splashTextures.website=null),this._webglRenderer.ClearRgba(0,0,0,0),this._webglRenderer.Finish(),this._splashState='done',this._gpuTimeStartFrame=this._webglRenderer.GetFrameNumber()}_DrawLoadingScreen(){if(-1!==this._rafId){const e=this._webglRenderer;e.Start(),this._rafId=-1;const t=this._runtime.GetAssetManager().HasHadErrorLoading(),a=this._runtime.GetLoaderStyle();if(3!==a&&(this.SetCssTransform(e),e.ClearRgba(0,0,0,0),e.ResetColor(),e.SetTextureFillMode(),e.SetTexture(null)),0===a)this._DrawProgressBarAndLogoLoadingScreen(t);else if(1===a)this._DrawProgressBarLoadingScreen(t,120,0);else if(2===a)this._DrawPercentTextLoadingScreen(t);else if(3===a)C3.noop();else if(4===a)this._DrawSplashLoadingScreen(t);else throw new Error('invalid loader style');e.Finish(),this._rafId=requestAnimationFrame(()=>this._DrawLoadingScreen())}}_DrawPercentTextLoadingScreen(e){e?this._webglPercentText.SetColorRgb(1,0,0):this._webglPercentText.SetColorRgb(.6,.6,.6),this._webglPercentText.SetText(Math.round(100*this._loadingProgress)+'%');const t=this._canvasCssWidth/2,a=this._canvasCssHeight/2;n.setRect(t-150,a-100,t+150,a+100),this._webglRenderer.SetTexture(this._webglPercentText.GetTexture()),this._webglRenderer.Quad3(n,this._webglPercentText.GetTexRect())}_DrawProgressBarLoadingScreen(t,a,n){const r=this._webglRenderer;r.SetColorFillMode(),t?r.SetColorRgba(1,0,0,1):r.SetColorRgba(.118,.565,1,1);const e=this._canvasCssWidth/2,i=this._canvasCssHeight/2,l=a/2;s.setWH(e-l,i-4+n,Math.floor(a*this._loadingProgress),8),r.Rect(s),s.setWH(e-l,i-4+n,a,8),s.offset(-.5,-.5),s.inflate(.5,.5),r.SetColorRgba(0,0,0,1),r.LineRect2(s),s.inflate(1,1),r.SetColorRgba(1,1,1,1),r.LineRect2(s)}_DrawProgressBarAndLogoLoadingScreen(t){if(!this._loadingLogoAsset)return void this._DrawProgressBarLoadingScreen(t,120,0);const a=this._loadingLogoAsset.GetTexture();if(!a)return void this._DrawProgressBarLoadingScreen(t,120,0);const r=a.GetWidth(),s=a.GetHeight(),e=this._canvasCssWidth/2,l=this._canvasCssHeight/2,_=r/2,d=s/2;n.setRect(e-_,l-d,e+_,l+d),this._webglRenderer.SetTexture(a),this._webglRenderer.Quad(n),this._DrawProgressBarLoadingScreen(t,r,d+16)}_DrawSplashLoadingScreen(t){var _=Math.min,d=Math.max,e=Math.ceil;const u=this._webglRenderer,c=this._splashTextures.logo,i=this._splashTextures.powered,g=this._splashTextures.website,f=Date.now();0===this._splashFrameNumber&&(this._loaderStartTime=f);const l=this._runtime.IsPreview()||this._runtime.IsFBInstantAvailable()&&!this._runtime.IsCordova(),m=l?0:200,n=l?0:3e3;let y=1;'fade-in'===this._splashState?y=_((f-this._loaderStartTime)/300,1):'fade-out'===this._splashState&&(y=d(1-(f-this._splashFadeOutStartTime)/300,0)),u.SetColorFillMode(),u.SetColorRgba(.231*y,.251*y,.271*y,y),s.set(0,0,this._canvasCssWidth,this._canvasCssHeight),u.Rect(s);const S=e(this._canvasCssWidth),a=e(this._canvasCssHeight);let G,I;256=n&&1<=this._loadingProgress&&(this._splashState='fade-out',this._splashFadeOutStartTime=f),('fade-out'===this._splashState&&f-this._splashFadeOutStartTime>=300+m||l&&1<=this._loadingProgress&&500>f-this._loaderStartTime)&&this._splashDoneResolve()}}}{const l={messagePort:null,baseUrl:'',headless:!1,hasDom:!0,isInWorker:!1,useAudio:!0,projectData:'',exportType:''};let _=!0;C3.Runtime=class extends C3.DefendedBase{constructor(e){e=Object.assign({},l,e),super(),this._messagePort=e.messagePort,this._baseUrl=e.baseUrl,this._isHeadless=!!e.headless,this._hasDom=!!e.hasDom,this._isInWorker=!!e.isInWorker,_=e.ife,this._useAudio=!!e.useAudio,this._exportType=e.exportType,this._isiOSCordova=!!e.isiOSCordova,this._isiOSWebView=!!e.isiOSWebView,this._isFBInstantAvailable=!!e.isFBInstantAvailable,this._opusWasmScriptUrl=e.opusWasmScriptUrl,this._opusWasmBinaryUrl=e.opusWasmBinaryUrl,this._dataJsonFilename='data.json',this._isDebug=!!('preview'===this._exportType&&e.isDebug),this._breakpointsEnabled=this._isDebug,this._isDebugging=this._isDebug,this._debuggingDisabled=0;const a=e.previewImageBlobs,t=e.previewProjectFileBlobs;t&&Object.assign(a,t);const s=e.projectData;s&&(a[this._dataJsonFilename]=s),this._additionalLoadPromises=[],this._projectName='',this._projectVersion='',this._projectUniqueId='',this._appId='',this._originalViewportWidth=0,this._originalViewportHeight=0,this._devicePixelRatio=self.devicePixelRatio,this._parallaxXorigin=0,this._parallaxYorigin=0,this._viewportWidth=0,this._viewportHeight=0,this._loaderStyle=0,this._usesLoaderLayout=!1,this._isLoading=!0,this._usesAnyBackgroundBlending=!1;const i='html5'===this._exportType||'scirra-arcade'===this._exportType||'instant-games'===this._exportType;this._assetManager=C3.New(C3.AssetManager,this,{defaultLoadPolicy:i?'remote':'local',localUrlBlobs:a,isCordova:'cordova'===this._exportType,isiOSCordova:this._isiOSCordova,supportedAudioFormats:e.supportedAudioFormats}),this._layoutManager=C3.New(C3.LayoutManager,this),this._eventSheetManager=C3.New(C3.EventSheetManager,this),this._pluginManager=C3.New(C3.PluginManager,this),this._collisionEngine=C3.New(C3.CollisionEngine,this),this._timelineManager=C3.New(C3.TimelineManager,this),this._transitionManager=C3.New(C3.TransitionManager,this),this._allObjectClasses=[],this._objectClassesByName=new Map,this._objectClassesBySid=new Map,this._familyCount=0,this._allContainers=[],this._allEffectLists=[],this._currentLayoutStack=[],this._instancesPendingCreate=[],this._instancesPendingDestroy=new Map,this._hasPendingInstances=!1,this._isFlushingPendingInstances=!1,this._objectCount=0,this._nextUid=0,this._instancesByUid=new Map,this._instancesToReleaseAtEndOfTick=new Set,this._instancesToReleaseAffectedObjectClasses=new Set,this._objectReferenceTable=[],this._jsPropNameTable=[],this._canvasManager=null,this._framerateMode='vsync',this._compositingMode='standard',this._sampling='trilinear',this._isPixelRoundingEnabled=!1,this._needRender=!0,this._pauseOnBlur=!1,this._isPausedOnBlur=!1,this._tickCallbacks={normal:t=>{this._rafId=-1,this._ruafId=-1,this.Tick(t)},tickOnly:t=>{this._ruafId=-1,this.Tick(t,!1,'skip-render')},renderOnly:()=>{this._rafId=-1,this.Render()}},this._rafId=-1,this._ruafId=-1,this._tickCount=0,this._tickCountNoSave=0,this._execCount=0,this._hasStarted=!1,this._isInTick=!1,this._hasStartedTicking=!1,this._isLayoutFirstTick=!0,this._suspendCount=0,this._scheduleTriggersThrottle=new C3.PromiseThrottle(1),this._randomNumberCallback=()=>Math.random(),this._startTime=0,this._lastTickTime=0,this._dt1=0,this._dt=0,this._timeScale=1,this._minimumFramerate=30,this._gameTime=C3.New(C3.KahanSum),this._wallTime=C3.New(C3.KahanSum),this._fpsFrameCount=-1,this._fpsLastTime=0,this._fps=0,this._mainThreadTimeCounter=0,this._mainThreadTime=0,this._isLoadingState=!1,this._saveToSlotName='',this._loadFromSlotName='',this._loadFromJson=null,this._lastSaveJson='',this._triggerOnCreateAfterLoad=[],this._projectStorage=null,this._savegamesStorage=null,this._dispatcher=C3.New(C3.Event.Dispatcher),this._domEventHandlers=new Map,this._pendingResponsePromises=new Map,this._nextDomResponseId=0,this._didRequestDeviceOrientationEvent=!1,this._didRequestDeviceMotionEvent=!1,this._isReadyToHandleEvents=!1,this._waitingToHandleEvents=[],this._eventObjects={pretick:C3.New(C3.Event,'pretick',!1),tick:C3.New(C3.Event,'tick',!1),tick2:C3.New(C3.Event,'tick2',!1),instancedestroy:C3.New(C3.Event,'instancedestroy',!1),beforelayoutchange:C3.New(C3.Event,'beforelayoutchange',!1),layoutchange:C3.New(C3.Event,'layoutchange',!1)},this._eventObjects.instancedestroy.instance=null,this._userScriptDispatcher=C3.New(C3.Event.Dispatcher),this._userScriptEventObjects=null,this._behInstsToTick=C3.New(C3.RedBlackSet,C3.BehaviorInstance.SortByTickSequence),this._behInstsToPostTick=C3.New(C3.RedBlackSet,C3.BehaviorInstance.SortByTickSequence),this._behInstsToTick2=C3.New(C3.RedBlackSet,C3.BehaviorInstance.SortByTickSequence),this._jobScheduler=C3.New(C3.JobSchedulerRuntime,this,e.jobScheduler),e.canvas&&(this._canvasManager=C3.New(C3.CanvasManager,this)),this._messagePort.onmessage=e=>this._OnMessageFromDOM(e.data),this.AddDOMComponentMessageHandler('runtime','visibilitychange',e=>this._OnVisibilityChange(e)),this.AddDOMComponentMessageHandler('runtime','opus-decode',e=>this._WasmDecodeWebMOpus(e.arrayBuffer)),this.AddDOMComponentMessageHandler('runtime','get-remote-preview-status-info',()=>this._GetRemotePreviewStatusInfo()),this.AddDOMComponentMessageHandler('runtime','js-invoke-function',e=>this._InvokeFunctionFromJS(e)),this.AddDOMComponentMessageHandler('runtime','go-to-last-error-script',self.goToLastErrorScript),this._dispatcher.addEventListener('window-blur',e=>this._OnWindowBlur(e)),this._dispatcher.addEventListener('window-focus',()=>this._OnWindowFocus()),this._timelineManager.AddRuntimeListeners(),this._iRuntime=null,this._commonScriptInterfaces={keyboard:null,mouse:null,touch:null}}static Create(t){return C3.New(C3.Runtime,t)}Release(){C3.clearArray(this._allObjectClasses),this._objectClassesByName.clear(),this._objectClassesBySid.clear(),this._layoutManager.Release(),this._layoutManager=null,this._eventSheetManager.Release(),this._eventSheetManager=null,this._pluginManager.Release(),this._pluginManager=null,this._assetManager.Release(),this._assetManager=null,this._collisionEngine.Release(),this._collisionEngine=null,this._timelineManager.Release(),this._timelineManager=null,this._transitionManager.Release(),this._transitionManager=null,this._canvasManager&&(this._canvasManager.Release(),this._canvasManager=null),this._dispatcher.Release(),this._dispatcher=null,this._tickEvent=null}['_OnMessageFromDOM'](t){const e=t.type;if('event'===e)this._OnEventFromDOM(t);else if('result'===e)this._OnResultFromDOM(t);else throw new Error(`unknown message '${e}'`)}_OnEventFromDOM(u){if(!this._isReadyToHandleEvents)return void this._waitingToHandleEvents.push(u);const c=u.component,g=u.handler,p=u.data,e=u.dispatchOpts,t=!!(e&&e.dispatchRuntimeEvent),a=!!(e&&e.dispatchUserScriptEvent),n=u.responseId;if('runtime'===c){if(t){const t=new C3.Event(g);t.data=p,this._dispatcher.dispatchEventAndWaitAsyncSequential(t)}if(a){const t=new C3.Event(g,!0);for(const[e,a]of Object.entries(p))t[e]=a;this.DispatchUserScriptEvent(t)}}const r=this._domEventHandlers.get(c);if(!r)return void(t||a||console.warn(`[Runtime] No DOM event handlers for component '${c}'`));const i=r.get(g);if(!i)return void(t||a||console.warn(`[Runtime] No DOM handler '${g}' for component '${c}'`));let s=null;try{s=i(p)}catch(e){return console.error(`Exception in '${c}' handler '${g}':`,e),void(null!==n&&this._PostResultToDOM(n,!1,e.toString()))}null!==n&&(s&&s.then?s.then(t=>this._PostResultToDOM(n,!0,t)).catch(e=>{console.error(`Rejection from '${c}' handler '${g}':`,e),this._PostResultToDOM(n,!1,e.toString())}):this._PostResultToDOM(n,!0,s))}_PostResultToDOM(t,e,a){this._messagePort.postMessage({type:'result',responseId:t,isOk:e,result:a})}_OnResultFromDOM(r){const e=r.responseId,a=r.isOk,n=r.result,t=this._pendingResponsePromises.get(e);a?t.resolve(n):t.reject(n),this._pendingResponsePromises.delete(e)}AddDOMComponentMessageHandler(r,e,a){let n=this._domEventHandlers.get(r);if(n||(n=new Map,this._domEventHandlers.set(r,n)),n.has(e))throw new Error(`[Runtime] Component '${r}' already has handler '${e}'`);n.set(e,a)}PostComponentMessageToDOM(t,e,a){this._messagePort.postMessage({type:'event',component:t,handler:e,data:a,responseId:null})}PostComponentMessageToDOMAsync(r,e,a){const n=this._nextDomResponseId++,t=new Promise((t,e)=>{this._pendingResponsePromises.set(n,{resolve:t,reject:e})});return this._messagePort.postMessage({type:'event',component:r,handler:e,data:a,responseId:n}),t}PostToDebugger(t){if(!this.IsDebug())throw new Error('not in debug mode');this.PostComponentMessageToDOM('runtime','post-to-debugger',t)}async Init(t){this.IsDebug()?await C3Debugger.Init(this):self.C3Debugger&&self.C3Debugger.InitPreview(this);const[e]=await Promise.all([this._assetManager.FetchJson(this._dataJsonFilename),this._MaybeLoadOpusDecoder(),this._jobScheduler.Init()]);this._LoadDataJson(e),await this._InitialiseCanvas(t),this.IsPreview()||console.info('Made with Construct 3, the game and app creator :: https://www.construct.net');const a=this.GetWebGLRenderer();a?(console.info(`[C3 runtime] Hosted in ${this.IsInWorker()?'worker':'DOM'}, rendering with WebGL ${a.GetWebGLVersionNumber()} [${a.GetUnmaskedRenderer()}] (${a.IsDesynchronized()?'desynchronized':'standard'} compositing)`),a.HasMajorPerformanceCaveat()&&console.warn('[C3 runtime] WebGL indicates a major performance caveat. Software rendering may be in use. This can result in significantly degraded performance.')):console.info(`[C3 runtime] Hosted in ${this.IsInWorker()?'worker':'DOM'}, headless`),this._isReadyToHandleEvents=!0;for(const e of this._waitingToHandleEvents)this._OnEventFromDOM(e);C3.clearArray(this._waitingToHandleEvents),this._canvasManager&&this._canvasManager.StartLoadingScreen();for(const e of t.runOnStartupFunctions)this._additionalLoadPromises.push(this._RunOnStartupFunction(e));if(await Promise.all([this._assetManager.WaitForAllToLoad(),...this._additionalLoadPromises]),!this._assetManager.HasHadErrorLoading())return this._canvasManager&&(await this._canvasManager.EndLoadingScreen()),await this._dispatcher.dispatchEventAndWaitAsync(new C3.Event('beforeruntimestart')),await this.Start(),this._messagePort.postMessage({type:'runtime-ready'}),this}async _RunOnStartupFunction(t){try{await t(this._iRuntime)}catch(t){console.error('[C3 runtime] Error in runOnStartup function: ',t)}}_LoadDataJson(r){const e=r.project;this._projectName=e[0],this._projectVersion=e[16],this._projectUniqueId=e[31],this._appId=e[38],this._isPixelRoundingEnabled=!!e[9],this._originalViewportWidth=this._viewportWidth=e[10],this._originalViewportHeight=this._viewportHeight=e[11],this._parallaxXorigin=this._originalViewportWidth/2,this._parallaxYorigin=this._originalViewportHeight/2,this._compositingMode=e[36],this._framerateMode=e[37],'low-latency'===this._compositingMode&&this.IsAndroidWebView()&&77>=C3.Platform.BrowserVersionNumber&&(console.warn('[C3 runtime] Desynchronized (low-latency) compositing is enabled, but is disabled in the Android WebView <=77 due to crbug.com/1008842. Reverting to synchronized (standard) compositing.'),this._compositingMode='standard'),this._sampling=e[14],this._usesLoaderLayout=!!e[18],this._loaderStyle=e[19],this._nextUid=e[21],this._pauseOnBlur=e[22],this._assetManager._SetAudioFiles(e[7],e[25]),this._assetManager._SetMediaSubfolder(e[8]),this._assetManager._SetFontsSubfolder(e[32]),this._assetManager._SetIconsSubfolder(e[28]),this._assetManager._SetWebFonts(e[29]),this._canvasManager&&(this._canvasManager.SetFullscreenMode(C3.CanvasManager._FullscreenModeNumberToString(e[12])),this._canvasManager.SetFullscreenScalingQuality(e[23]?'high':'low'),this._canvasManager._SetGPUPowerPreference(e[34])),this._pluginManager.CreateSystemPlugin(),this._objectReferenceTable=self.C3_GetObjectRefTable();for(const t of e[2])this._pluginManager.CreatePlugin(t);this._objectReferenceTable=self.C3_GetObjectRefTable(),this._LoadJsPropNameTable();for(const t of e[3]){const a=C3.ObjectClass.Create(this,this._allObjectClasses.length,t);this._allObjectClasses.push(a),this._objectClassesByName.set(a.GetName().toLowerCase(),a),this._objectClassesBySid.set(a.GetSID(),a)}for(const t of e[4]){const a=this._allObjectClasses[t[0]];a._LoadFamily(t)}for(const t of e[27]){const a=t.map(t=>this._allObjectClasses[t]);this._allContainers.push(C3.New(C3.Container,this,a))}for(const e of this._allObjectClasses)e._OnAfterCreate();for(const t of e[5])this._layoutManager.Create(t);const a=e[1];if(a){const t=this._layoutManager.GetLayoutByName(a);t&&this._layoutManager.SetFirstLayout(t)}for(const t of e[33])this._timelineManager.Create(t);for(const t of e[35])this._transitionManager.Create(t);this._InitScriptInterfaces();for(const t of e[6])this._eventSheetManager.Create(t);this._eventSheetManager._PostInit(),this._InitGlobalVariableScriptInterface(),C3.clearArray(this._objectReferenceTable),this.FlushPendingInstances();let n='any';const i=e[20];1===i?n='portrait':2===i&&(n='landscape'),this.PostComponentMessageToDOM('runtime','set-target-orientation',{targetOrientation:n})}GetLoaderStyle(){return this._loaderStyle}IsFBInstantAvailable(){return this._isFBInstantAvailable}IsLoading(){return this._isLoading}AddLoadPromise(t){this._additionalLoadPromises.push(t)}_GetNextFamilyIndex(){return this._familyCount++}GetFamilyCount(){return this._familyCount}_AddEffectList(t){this._allEffectLists.push(t)}_GetAllEffectLists(){return this._allEffectLists}async _InitialiseCanvas(t){this._canvasManager&&(await this._canvasManager.CreateCanvas(t),this._canvasManager.InitLoadingScreen(this._loaderStyle))}async _MaybeLoadOpusDecoder(){if(this._assetManager.IsAudioFormatSupported('audio/webm; codecs=opus'))return;let t=null,n=null;try{this.IsiOSCordova()?n=await this._assetManager.CordovaFetchLocalFileAsArrayBuffer(this._opusWasmBinaryUrl):t=await this._assetManager.FetchBlob(this._opusWasmBinaryUrl)}catch(t){return void console.info('Failed to fetch Opus decoder WASM; assuming project has no Opus audio.',t)}n?this.AddJobWorkerBuffer(n,'opus-decoder-wasm'):this.AddJobWorkerBlob(t,'opus-decoder-wasm'),await this.AddJobWorkerScripts([this._opusWasmScriptUrl])}async _WasmDecodeWebMOpus(t){const e=await this.AddJob('OpusDecode',{arrayBuffer:t},[t]);return e}async Start(){if(this._hasStarted=!0,this._startTime=Date.now(),this._usesLoaderLayout){for(const t of this._allObjectClasses)t.IsFamily()||t.IsOnLoaderLayout()||!t.IsWorldType()||t.OnCreate();this._assetManager.WaitForAllToLoad().then(()=>{this._isLoading=!1,this._OnLoadFinished()})}else this._isLoading=!1;this._assetManager.SetInitialLoadFinished(),this.IsDebug()&&C3Debugger.RuntimeInit(_);for(const t of this._layoutManager.GetAllLayouts())t._CreateGlobalNonWorlds();const t=this._layoutManager.GetFirstLayout();await t._Load(null,this.GetWebGLRenderer()),await t._StartRunning(!0),this._fpsLastTime=performance.now(),this._usesLoaderLayout||this._OnLoadFinished();const e=await this.PostComponentMessageToDOMAsync('runtime','before-start-ticking');e.isSuspended?this._suspendCount++:this.Tick()}_OnLoadFinished(){this.Trigger(C3.Plugins.System.Cnds.OnLoadFinished,null,null),this.PostComponentMessageToDOM('runtime','register-sw')}GetObjectReference(t){t=Math.floor(t);const n=this._objectReferenceTable;if(0>t||t>=n.length)throw new Error('invalid object reference');return n[t]}_LoadJsPropNameTable(){for(const t of self.C3_JsPropNameTable){const e=C3.first(Object.keys(t));this._jsPropNameTable.push(e)}}GetJsPropName(t){t=Math.floor(t);const n=this._jsPropNameTable;if(0>t||t>=n.length)throw new Error('invalid prop reference');return n[t]}HasDOM(){return this._hasDom}IsHeadless(){return this._isHeadless}IsInWorker(){return this._isInWorker}GetBaseURL(){return this._baseUrl}GetEventSheetManager(){return this._eventSheetManager}GetEventStack(){return this._eventSheetManager.GetEventStack()}GetCurrentEventStackFrame(){return this._eventSheetManager.GetCurrentEventStackFrame()}GetCurrentEvent(){return this._eventSheetManager.GetCurrentEvent()}GetCurrentCondition(){return this._eventSheetManager.GetCurrentCondition()}IsCurrentConditionFirst(){return 0===this.GetCurrentEventStackFrame().GetConditionIndex()}GetCurrentAction(){return this._eventSheetManager.GetCurrentAction()}GetPluginManager(){return this._pluginManager}GetSystemPlugin(){return this._pluginManager.GetSystemPlugin()}GetObjectClassByIndex(t){if(t=Math.floor(t),0>t||t>=this._allObjectClasses.length)throw new RangeError('invalid index');return this._allObjectClasses[t]}GetObjectClassByName(t){return this._objectClassesByName.get(t.toLowerCase())||null}GetObjectClassBySID(t){return this._objectClassesBySid.get(t)||null}GetSingleGlobalObjectClassByCtor(t){const e=this._pluginManager.GetPluginByConstructorFunction(t);return e?e.GetSingleGlobalObjectClass():null}GetAllObjectClasses(){return this._allObjectClasses}Dispatcher(){return this._dispatcher}UserScriptDispatcher(){return this._userScriptDispatcher}DispatchUserScriptEvent(t){const a=this.IsDebug()&&!this._eventSheetManager.IsInEventEngine();a&&C3Debugger.StartMeasuringScriptTime(),this._userScriptDispatcher.dispatchEvent(t),a&&C3Debugger.AddScriptTime()}GetOriginalViewportWidth(){return this._originalViewportWidth}GetOriginalViewportHeight(){return this._originalViewportHeight}SetOriginalViewportSize(t,e){this._originalViewportWidth=t,this._originalViewportHeight=e}GetViewportWidth(){return this._viewportWidth}GetViewportHeight(){return this._viewportHeight}SetViewportSize(t,e){this._viewportWidth=t,this._viewportHeight=e}_SetDevicePixelRatio(t){this._devicePixelRatio=t}GetDevicePixelRatio(){return this._devicePixelRatio}GetParallaxXOrigin(){return this._parallaxXorigin}GetParallaxYOrigin(){return this._parallaxYorigin}GetCanvasManager(){return this._canvasManager}GetDrawWidth(){return this._canvasManager?this._canvasManager.GetDrawWidth():this._viewportWidth}GetDrawHeight(){return this._canvasManager?this._canvasManager.GetDrawHeight():this._viewportHeight}GetRenderScale(){return this._canvasManager?this._canvasManager.GetRenderScale():1}GetDisplayScale(){return this._canvasManager?this._canvasManager.GetDisplayScale():1}GetCanvasClientX(){return this._canvasManager?this._canvasManager.GetCanvasClientX():0}GetCanvasClientY(){return this._canvasManager?this._canvasManager.GetCanvasClientY():0}GetCanvasCssWidth(){return this._canvasManager?this._canvasManager.GetCssWidth():0}GetCanvasCssHeight(){return this._canvasManager?this._canvasManager.GetCssHeight():0}GetFullscreenMode(){return this._canvasManager?this._canvasManager.GetFullscreenMode():'off'}GetAdditionalRenderTarget(t){return this._canvasManager?this._canvasManager.GetAdditionalRenderTarget(t):null}ReleaseAdditionalRenderTarget(t){this._canvasManager&&this._canvasManager.ReleaseAdditionalRenderTarget(t)}_SetUsesAnyBackgroundBlending(t){this._usesAnyBackgroundBlending=!!t}UsesAnyBackgroundBlending(){return this._usesAnyBackgroundBlending}GetGPUUtilisation(){return this._canvasManager?this._canvasManager.GetGPUUtilisation():NaN}IsLinearSampling(){return'nearest'!==this.GetSampling()}GetFramerateMode(){return this._framerateMode}GetCompositingMode(){return this._compositingMode}GetSampling(){return this._sampling}UsesLoaderLayout(){return this._usesLoaderLayout}GetLayoutManager(){return this._layoutManager}GetMainRunningLayout(){return this._layoutManager.GetMainRunningLayout()}GetTimelineManager(){return this._timelineManager}GetTransitionManager(){return this._transitionManager}GetAssetManager(){return this._assetManager}LoadImage(t){return this._assetManager.LoadImage(t)}CreateInstance(r,e,a,n){return this.CreateInstanceFromData(r,e,!1,a,n)}CreateInstanceFromData(h,e,f,n,t,s){let i=null,y=null;if(h instanceof C3.ObjectClass){if(y=h,y.IsFamily()){const t=y.GetFamilyMembers(),e=Math.floor(this.Random()*t.length);y=t[e]}i=y.GetDefaultInstanceData()}else i=h,y=this.GetObjectClassByIndex(i[1]);const S=y.GetPlugin().IsWorldType();if(this._isLoading&&S&&!y.IsOnLoaderLayout())return null;const d=e;S||(e=null);let _=f&&!s&&i&&!this._instancesByUid.has(i[2])?i[2]:this._nextUid++;const l=i?i[0]:null,g=C3.New(C3.Instance,{runtime:this,objectType:y,layer:e,worldData:l,instVarData:i?i[3]:null,uid:_});this._instancesByUid.set(_,g);let c=null;if(S&&(c=g.GetWorldInfo(),'undefined'!=typeof n&&'undefined'!=typeof t&&(c.SetX(n),c.SetY(t)),y._SetAnyCollisionCellChanged(!0)),e&&(e._AddInstance(g,!0),(1!==e.GetParallaxX()||1!==e.GetParallaxY())&&y._SetAnyInstanceParallaxed(!0),e.GetLayout().MaybeLoadTexturesFor(y)),this._objectCount++,y.IsInContainer()&&!f&&!s){for(const r of y.GetContainer().objectTypes()){if(r===y)continue;const e=this.CreateInstanceFromData(r,d,!1,c?c.GetX():n,c?c.GetY():t,!0);g._AddSibling(e)}for(const t of g.siblings()){t._AddSibling(g);for(const e of g.siblings())t!==e&&t._AddSibling(e)}}y._SetIIDsStale();const G=i?C3.cloneArray(i[5]):null,m=i?i[4].map(t=>C3.cloneArray(t)):null;if(g._CreateSdkInstance(G,m),S&&l&&14===l.length){const t=l[13];g._SetHasTilemap(),g.GetSdkInstance().LoadTilemapData(t[2],t[0],t[1])}return this._instancesPendingCreate.push(g),this._hasPendingInstances=!0,this.IsDebug()&&C3Debugger.InstanceCreated(g),g}DestroyInstance(t){if(this._instancesToReleaseAtEndOfTick.has(t))return;const e=t.GetObjectClass();let a=this._instancesPendingDestroy.get(e);if(a){if(a.has(t))return;a.add(t)}else a=new Set,a.add(t),this._instancesPendingDestroy.set(e,a);if(this.IsDebug()&&C3Debugger.InstanceDestroyed(t),t._MarkDestroyed(),this._hasPendingInstances=!0,t.IsInContainer())for(const e of t.siblings())this.DestroyInstance(e);if(this._isFlushingPendingInstances&&C3.NotYetImplemented(),!this._layoutManager.IsEndingLayout()){const e=this.GetEventSheetManager();e.BlockFlushingInstances(!0),t._TriggerOnDestroyed(),e.BlockFlushingInstances(!1)}}FlushPendingInstances(){this._hasPendingInstances&&(this._isFlushingPendingInstances=!0,this._FlushInstancesPendingCreate(),this._FlushInstancesPendingDestroy(),this._isFlushingPendingInstances=!1,this._hasPendingInstances=!1,this.UpdateRender())}_FlushInstancesPendingCreate(){for(const t of this._instancesPendingCreate){const e=t.GetObjectClass();e._AddInstance(t);for(const a of e.GetFamilies())a._AddInstance(t),a._SetIIDsStale()}C3.clearArray(this._instancesPendingCreate)}_FlushInstancesPendingDestroy(){this._dispatcher.SetDelayRemoveEventsEnabled(!0);for(const[t,e]of this._instancesPendingDestroy.entries())this._FlushInstancesPendingDestroyForObjectClass(t,e),e.clear();this._instancesPendingDestroy.clear(),this._dispatcher.SetDelayRemoveEventsEnabled(!1)}_FlushInstancesPendingDestroyForObjectClass(t,r){C3.arrayRemoveAllInSet(t.GetInstances(),r),t._SetIIDsStale(),this._instancesToReleaseAffectedObjectClasses.add(t),0===t.GetInstances().length&&t._SetAnyInstanceParallaxed(!1);for(const e of t.GetFamilies())C3.arrayRemoveAllInSet(e.GetInstances(),r),e._SetIIDsStale(),this._instancesToReleaseAffectedObjectClasses.add(e);if(t.GetPlugin().IsWorldType()){const t=new Set([...r].map(t=>t.GetWorldInfo().GetLayer()));for(const e of t)e._RemoveAllInstancesInSet(r)}for(const i of r){const t=this._eventObjects.instancedestroy;t.instance=i,this._dispatcher.dispatchEvent(t),this._instancesByUid.delete(i.GetUID());const e=i.GetWorldInfo();e&&(e._RemoveFromCollisionCells(),e._RemoveFromRenderCells()),this._instancesToReleaseAtEndOfTick.add(i),this._objectCount--}}_GetInstancesPendingCreate(){return this._instancesPendingCreate}_GetNewUID(){return this._nextUid++}_MapInstanceByUID(t,e){this._instancesByUid.set(t,e)}_OnWebGLContextLost(){this._dispatcher.dispatchEvent(C3.New(C3.Event,'webglcontextlost')),this.SetSuspended(!0);for(const t of this._allObjectClasses)!t.IsFamily()&&t.HasLoadedTextures()&&t.ReleaseTextures();this.GetMainRunningLayout()._OnWebGLContextLost(),C3.ImageInfo.OnWebGLContextLost(),C3.ImageAsset.OnWebGLContextLost()}async _OnWebGLContextRestored(){await this.GetMainRunningLayout()._Load(null,this.GetWebGLRenderer()),this._dispatcher.dispatchEvent(C3.New(C3.Event,'webglcontextrestored')),this.SetSuspended(!1),this.UpdateRender()}_OnVisibilityChange(e){this.SetSuspended(e.hidden)}_OnWindowBlur(e){this.IsPreview()&&this._pauseOnBlur&&!C3.Platform.IsMobile&&(e.data.parentHasFocus||(this.SetSuspended(!0),this._isPausedOnBlur=!0))}_OnWindowFocus(){this._isPausedOnBlur&&(this.SetSuspended(!1),this._isPausedOnBlur=!1)}_RequestAnimationFrame(){const t=this._tickCallbacks;'vsync'===this._framerateMode?-1===this._rafId&&(this._rafId=self.requestAnimationFrame(t.normal)):'unlimited-tick'===this._framerateMode?(-1===this._ruafId&&(this._ruafId=C3.RequestUnlimitedAnimationFrame(t.tickOnly)),-1===this._rafId&&(this._rafId=self.requestAnimationFrame(t.renderOnly))):-1===this._ruafId&&(this._ruafId=C3.RequestUnlimitedAnimationFrame(t.normal))}_CancelAnimationFrame(){-1!==this._rafId&&(self.cancelAnimationFrame(this._rafId),this._rafId=-1),-1!==this._ruafId&&(C3.CancelUnlimitedAnimationFrame(this._ruafId),this._ruafId=-1)}IsSuspended(){return 0this._suspendCount&&(this._suspendCount=0);const a=this.IsSuspended();if(!e&&a)console.log('[Construct 3] Suspending'),this._CancelAnimationFrame(),this._dispatcher.dispatchEvent(C3.New(C3.Event,'suspend')),this.Trigger(C3.Plugins.System.Cnds.OnSuspend,null,null);else if(e&&!a){console.log('[Construct 3] Resuming');const t=performance.now();this._lastTickTime=t,this._fpsLastTime=t,this._fpsFrameCount=0,this._fps=0,this._mainThreadTime=0,this._mainThreadTimeCounter=0,this._dispatcher.dispatchEvent(C3.New(C3.Event,'resume')),this.Trigger(C3.Plugins.System.Cnds.OnResume,null,null),this.HitBreakpoint()||this.Tick(t)}}_AddBehInstToTick(t){this._behInstsToTick.Add(t)}_AddBehInstToPostTick(t){this._behInstsToPostTick.Add(t)}_AddBehInstToTick2(t){this._behInstsToTick2.Add(t)}_RemoveBehInstToTick(t){this._behInstsToTick.Remove(t)}_RemoveBehInstToPostTick(t){this._behInstsToPostTick.Remove(t)}_RemoveBehInstToTick2(t){this._behInstsToTick2.Remove(t)}_BehaviorTick(){this._behInstsToTick.SetQueueingEnabled(!0);for(const t of this._behInstsToTick)t.Tick();this._behInstsToTick.SetQueueingEnabled(!1)}_BehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(!0);for(const t of this._behInstsToPostTick)t.PostTick();this._behInstsToPostTick.SetQueueingEnabled(!1)}_BehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(!0);for(const t of this._behInstsToTick2)t.Tick2();this._behInstsToTick2.SetQueueingEnabled(!1)}*_DebugBehaviorTick(){this._behInstsToTick.SetQueueingEnabled(!0);for(const t of this._behInstsToTick){const e=t.Tick();C3.IsIterator(e)&&(yield*e)}this._behInstsToTick.SetQueueingEnabled(!1)}*_DebugBehaviorPostTick(){this._behInstsToPostTick.SetQueueingEnabled(!0);for(const t of this._behInstsToPostTick){const e=t.PostTick();C3.IsIterator(e)&&(yield*e)}this._behInstsToPostTick.SetQueueingEnabled(!1)}*_DebugBehaviorTick2(){this._behInstsToTick2.SetQueueingEnabled(!0);for(const t of this._behInstsToTick2){const e=t.Tick2();C3.IsIterator(e)&&(yield*e)}this._behInstsToTick2.SetQueueingEnabled(!1)}async Tick(l,r,_){this._hasStartedTicking=!0;const n='background-wake'===_;if(this._hasStarted&&(!this.IsSuspended()||r||n)){const e=performance.now();this._isInTick=!0,l||(l=e),this._MeasureDt(l);const t=this.Step_BeforePreTick();this.IsDebugging()&&(await t);const a=this._dispatcher.dispatchEventAndWait_AsyncOptional(this._eventObjects.pretick);a instanceof Promise&&(await a);const i=this.Step_AfterPreTick();this.IsDebugging()&&(await i),this._NeedsHandleSaveOrLoad()&&(await this._HandleSaveOrLoad()),this.GetLayoutManager().IsPendingChangeMainLayout()&&(await this._MaybeChangeLayout());const r=this.Step_RunEventsEtc();this.IsDebugging()&&(await r),'background-wake'!=_&&'skip-render'!=_&&this.Render(),this.IsSuspended()||n||this._RequestAnimationFrame(),this._tickCount++,this._tickCountNoSave++,this._execCount++,this._isInTick=!1,this._mainThreadTimeCounter+=performance.now()-e}}async Step_BeforePreTick(){const t=this._eventSheetManager,e=this.IsDebug();this.FlushPendingInstances(),t.BlockFlushingInstances(!0),this.PushCurrentLayout(this.GetMainRunningLayout()),e&&C3Debugger.StartMeasuringTime(),this.IsDebugging()?await t.DebugRunScheduledWaits():t.RunScheduledWaits(),e&&C3Debugger.AddEventsTime(),this.PopCurrentLayout(),t.BlockFlushingInstances(!1),this.FlushPendingInstances(),t.BlockFlushingInstances(!0)}async Step_AfterPreTick(){const r=this.IsDebug(),e=this.IsDebugging(),a=this._dispatcher,n=this._eventObjects,t=this._userScriptEventObjects;r&&C3Debugger.StartMeasuringTime(),e?await this.DebugIterateAndBreak(this._DebugBehaviorTick()):this._BehaviorTick(),e?await this.DebugIterateAndBreak(this._DebugBehaviorPostTick()):this._BehaviorPostTick(),r&&C3Debugger.AddBehaviorTickTime(),r&&C3Debugger.StartMeasuringTime(),e?await this.DebugFireGeneratorEventAndBreak(n.tick):a.dispatchEvent(n.tick),r&&C3Debugger.AddPluginTickTime(),this._eventSheetManager.BlockFlushingInstances(!1),this.DispatchUserScriptEvent(t.tick)}async Step_RunEventsEtc(){const r=this._eventSheetManager,e=this._dispatcher,a=this._eventObjects,n=this.IsDebug(),t=this.IsDebugging();if(n&&C3Debugger.StartMeasuringTime(),t?await r.DebugRunEvents(this._layoutManager):r.RunEvents(this._layoutManager),n&&C3Debugger.AddEventsTime(),this._collisionEngine.ClearRegisteredCollisions(),0e++;)await this._DoChangeLayout(t.GetPendingChangeMainLayout())}_MeasureDt(t){if(0!==this._lastTickTime){const e=Math.max(t-this._lastTickTime,0);this._dt1=e/1e3;const a=1/this._minimumFramerate;.5a&&(this._dt1=a)}this._lastTickTime=t,this._dt=this._dt1*this._timeScale,this._gameTime.Add(this._dt),this._wallTime.Add(this._dt1),this._canvasManager&&this._canvasManager._UpdateTick(),1e3<=t-this._fpsLastTime&&(this._fpsLastTime+=1e3,1e3<=t-this._fpsLastTime&&(this._fpsLastTime=t),this._fps=this._fpsFrameCount,this._fpsFrameCount=0,this._mainThreadTime=Math.min(this._mainThreadTimeCounter/1e3,1),this._mainThreadTimeCounter=0,this._canvasManager&&this._canvasManager._Update1sFrameRange(),this._collisionEngine._Update1sStats(),this.IsDebug()&&C3Debugger.Update1sPerfStats()),this._fpsFrameCount++}async _DoChangeLayout(r){const e=this._dispatcher,a=this.GetLayoutManager(),n=a.GetMainRunningLayout();await n._StopRunning(),n._Unload(r,this.GetWebGLRenderer()),n===r&&this._eventSheetManager.ClearAllScheduledWaits(),this._collisionEngine.ClearRegisteredCollisions(),e.dispatchEvent(this._eventObjects.beforelayoutchange),C3.Asyncify.SetHighThroughputMode(!0),await r._Load(n,this.GetWebGLRenderer()),C3.Asyncify.SetHighThroughputMode(!1),await r._StartRunning(!1),e.dispatchEvent(this._eventObjects.layoutchange),this.UpdateRender(),this._isLayoutFirstTick=!0,this.FlushPendingInstances()}UpdateRender(){this._needRender=!0}GetWebGLRenderer(){return this._canvasManager?this._canvasManager.GetWebGLRenderer():null}Render(){if(!this._canvasManager||this._canvasManager.IsWebGLContextLost())return;const r=this.GetWebGLRenderer();if(r.Start(),r.CheckForQueryResults(),!this._needRender)return void r.IncrementFrameNumber();const e=this.IsDebug();e&&C3Debugger.StartMeasuringTime(),this._needRender=!1;let a=null;r.SupportsGPUProfiling()&&(a=this._canvasManager.GetGPUFrameTimingsBuffer().AddTimeElapsedQuery(),r.StartQuery(a)),r.SetTextureFillMode(),r.SetAlphaBlend(),r.SetColorRgba(1,1,1,1),r.SetRenderTarget(null),r.SetTexture(null);const i=this._layoutManager.GetMainRunningLayout();i.Draw(r),a&&r.EndQuery(a),r.Finish(),e&&(C3Debugger.AddDrawCallsTime(),C3Debugger.UpdateInspectHighlight()),this._canvasManager&&this._canvasManager._MaybeTakeSnapshot()}Trigger(l,e,a){if(!this._hasStarted)return!1;const n=!this._isInTick&&!this._eventSheetManager.IsInTrigger();let t=0;n&&(t=performance.now());const _=this.IsDebug();_&&this.SetDebuggingEnabled(!1);const i=this._eventSheetManager._Trigger(this._layoutManager,l,e,a);if(n){const a=performance.now()-t;this._mainThreadTimeCounter+=a,_&&C3Debugger.AddTriggersTime(a)}return _&&this.SetDebuggingEnabled(!0),i}DebugTrigger(t,e,a){if(!this.IsDebug())return this.Trigger(t,e,a);if(this.HitBreakpoint())throw new Error('called DebugTrigger() while stopped on breakpoint');if(!this._isInTick&&!this._eventSheetManager.IsInTrigger())throw new Error('called DebugTrigger() outside of event code - use TriggerAsync() instead');return this._eventSheetManager._DebugTrigger(this._layoutManager,t,e,a)}async TriggerAsync(r,e,a){if(!this.IsDebugging())return this.Trigger(r,e,a);if(!this._hasStarted)return!1;if(this.HitBreakpoint())return this._eventSheetManager.QueueDebugTrigger(r,e,a);if(!this.GetMainRunningLayout())return this._eventSheetManager.QueueTrigger(r,e,a);const n=performance.now(),t=this._eventSheetManager._DebugTrigger(this._layoutManager,r,e,a);let s=t.next();for(;!s.done;)await this.DebugBreak(s.value),s=t.next();return this.IsSuspended()||this._eventSheetManager.IsInTrigger()||(await this._eventSheetManager.RunQueuedDebugTriggersAsync(),this._hasStartedTicking&&!this._isInTick&&this._RequestAnimationFrame()),this._mainThreadTimeCounter+=performance.now()-n,s.value}FastTrigger(r,e,a){const n=this.IsDebug();n&&this.SetDebuggingEnabled(!1);const t=this._eventSheetManager._FastTrigger(this._layoutManager,r,e,a);return n&&this.SetDebuggingEnabled(!0),t}DebugFastTrigger(t,e,a){return this._eventSheetManager._DebugFastTrigger(this._layoutManager,t,e,a)}ScheduleTriggers(t){return this._scheduleTriggersThrottle.Add(t)}PushCurrentLayout(t){this._currentLayoutStack.push(t)}PopCurrentLayout(){if(!this._currentLayoutStack.length)throw new Error('layout stack empty');this._currentLayoutStack.pop()}GetCurrentLayout(){return this._currentLayoutStack.length?this._currentLayoutStack[this._currentLayoutStack.length-1]:this.GetMainRunningLayout()}GetDt(t){return t&&-1!==t.GetTimeScale()?this._dt1*t.GetTimeScale():this._dt}_GetDtFast(){return this._dt}GetDt1(){return this._dt1}GetTimeScale(){return this._timeScale}SetTimeScale(t){(isNaN(t)||0>t)&&(t=0),this._timeScale=t}SetMinimumFramerate(t){this._minimumFramerate=C3.clamp(t,1,120)}GetMinimumFramerate(){return this._minimumFramerate}GetFPS(){return this._fps}GetMainThreadTime(){return this._mainThreadTime}GetStartTime(){return this._startTime}GetGameTime(){return this._gameTime.Get()}GetWallTime(){return this._wallTime.Get()}GetTickCount(){return this._tickCount}GetTickCountNoSave(){return this._tickCountNoSave}IncrementExecCount(){++this._execCount}GetExecCount(){return this._execCount}GetObjectCount(){return this._objectCount}GetProjectName(){return this._projectName}GetProjectVersion(){return this._projectVersion}GetProjectUniqueId(){return this._projectUniqueId}GetAppId(){return this._appId}GetInstanceByUID(t){if(this._isLoadingState)throw new Error('cannot call while loading state - wait until afterload event');return this._instancesByUid.get(t)||null}_RefreshUidMap(){this._instancesByUid.clear();for(const t of this._allObjectClasses)if(!t.IsFamily())for(const e of t.GetInstances())this._instancesByUid.set(e.GetUID(),e)}IsPreview(){return'preview'===this._exportType}IsDebug(){return this._isDebug}GetExportType(){return this._exportType}IsCordova(){return'cordova'===this._exportType}IsAndroidWebView(){return'Android'===C3.Platform.OS&&('cordova'===this._exportType||'playable-ad'===this._exportType||'instant-games'===this._exportType)}IsiOSCordova(){return this._isiOSCordova}IsiOSWebView(){return this._isiOSWebView}GetCollisionEngine(){return this._collisionEngine}GetSolidBehavior(){return this._pluginManager.GetSolidBehavior()}GetJumpthruBehavior(){return this._pluginManager.GetJumpthruBehavior()}IsLayoutFirstTick(){return this._isLayoutFirstTick}SetPixelRoundingEnabled(e){e=!!e,this._isPixelRoundingEnabled===e||(this._isPixelRoundingEnabled=e,this.UpdateRender())}IsPixelRoundingEnabled(){return this._isPixelRoundingEnabled}SaveToSlot(t){this._saveToSlotName=t}LoadFromSlot(t){this._loadFromSlotName=t}LoadFromJsonString(t){this._loadFromJson=t}GetLastSaveJsonString(){return this._lastSaveJson}_NeedsHandleSaveOrLoad(){return!!(this._saveToSlotName||this._loadFromSlotName||null!==this._loadFromJson)}async _HandleSaveOrLoad(){if(this._saveToSlotName&&(this.FlushPendingInstances(),await this._DoSaveToSlot(this._saveToSlotName),this._ClearSaveOrLoad()),this._loadFromSlotName&&(await this._DoLoadFromSlot(this._loadFromSlotName),this._ClearSaveOrLoad(),this.IsDebug()&&C3Debugger.StepIfPausedInDebugger()),null!==this._loadFromJson){this.FlushPendingInstances();try{await this._DoLoadFromJsonString(this._loadFromJson),this._lastSaveJson=this._loadFromJson,await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadComplete,null),this._lastSaveJson=''}catch(t){console.error('[Construct 3] Failed to load state from JSON string: ',t),await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadFailed,null)}this._ClearSaveOrLoad()}}_ClearSaveOrLoad(){this._saveToSlotName='',this._loadFromSlotName='',this._loadFromJson=null}_GetProjectStorage(){return this._projectStorage||(this._projectStorage=localforage.createInstance({name:'c3-localstorage-'+this.GetProjectUniqueId(),description:this.GetProjectName()})),this._projectStorage}_GetSavegamesStorage(){return this._savegamesStorage||(this._savegamesStorage=localforage.createInstance({name:'c3-savegames-'+this.GetProjectUniqueId(),description:this.GetProjectName()})),this._savegamesStorage}async _DoSaveToSlot(t){const e=this._SaveToJsonString();try{await this._GetSavegamesStorage().setItem(t,e),console.log('[Construct 3] Saved state to storage ('+e.length+' chars)'),this._lastSaveJson=e,await this.TriggerAsync(C3.Plugins.System.Cnds.OnSaveComplete,null),this._lastSaveJson=''}catch(t){console.error('[Construct 3] Failed to save state to storage: ',t),await this.TriggerAsync(C3.Plugins.System.Cnds.OnSaveFailed,null)}}async _DoLoadFromSlot(t){try{const e=await this._GetSavegamesStorage().getItem(t);if(!e)throw new Error('empty slot');console.log('[Construct 3] Loaded state from storage ('+e.length+' chars)'),await this._DoLoadFromJsonString(e),this._lastSaveJson=e,await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadComplete,null),this._lastSaveJson=''}catch(t){console.error('[Construct 3] Failed to load state from storage: ',t),await this.TriggerAsync(C3.Plugins.System.Cnds.OnLoadFailed,null)}}_SaveToJsonString(){const t={c3save:!0,version:1,rt:{time:this.GetGameTime(),walltime:this.GetWallTime(),timescale:this.GetTimeScale(),tickcount:this.GetTickCount(),execcount:this.GetExecCount(),next_uid:this._nextUid,running_layout:this.GetMainRunningLayout().GetSID(),start_time_offset:Date.now()-this._startTime},types:{},layouts:{},events:this._eventSheetManager._SaveToJson(),timelines:this._timelineManager._SaveToJson(),user_script_data:null};for(const e of this._allObjectClasses)e.IsFamily()||e.HasNoSaveBehavior()||(t.types[e.GetSID().toString()]=e._SaveToJson());for(const e of this._layoutManager.GetAllLayouts())t.layouts[e.GetSID().toString()]=e._SaveToJson();const e=this._CreateUserScriptEvent('save');return e.saveData=null,this.DispatchUserScriptEvent(e),t.user_script_data=e.saveData,JSON.stringify(t)}IsLoadingState(){return this._isLoadingState}_TriggerOnCreateAfterLoad(t){C3.shallowAssignArray(this._triggerOnCreateAfterLoad,t)}async _DoLoadFromJsonString(r){const e=JSON.parse(r);if(e.c2save)throw new Error('C2 saves are incompatible with C3 runtime');if(!e.c3save)throw new Error('not valid C3 save data');if(1e||e>=t.length)throw new Error('missing sibling instance');a._AddSibling(t[e])}}this._timelineManager._LoadFromJson(e.timelines),this._dispatcher.dispatchEvent(C3.New(C3.Event,'afterload'));const t=this._CreateUserScriptEvent('load');t.saveData=e.user_script_data,this.DispatchUserScriptEvent(t),this.UpdateRender()}async AddJobWorkerScripts(t){const e=await Promise.all(t.map(t=>this._assetManager.FetchBlob(t))),a=e.map(t=>URL.createObjectURL(t));this._jobScheduler.ImportScriptsToJobWorkers(a)}AddJobWorkerBlob(t,e){this._jobScheduler.SendBlobToJobWorkers(t,e)}AddJobWorkerBuffer(t,e){this._jobScheduler.SendBufferToJobWorkers(t,e)}AddJob(t,e,a){return this._jobScheduler.AddJob(t,e,a)}BroadcastJob(t,e,a){return this._jobScheduler.BroadcastJob(t,e,a)}InvokeDownload(t,e){this.PostComponentMessageToDOM('runtime','invoke-download',{url:t,filename:e})}async RasterSvgImage(l,e,a,n,_,d){if(n=n||e,_=_||a,this.IsInWorker()){const t=await this.PostComponentMessageToDOMAsync('runtime','raster-svg-image',{blob:l,imageWidth:e,imageHeight:a,surfaceWidth:n,surfaceHeight:_,imageBitmapOpts:d});return t.imageBitmap}else{const t=await self.C3_RasterSvgImageBlob(l,e,a,n,_);return d?await self.createImageBitmap(t,d):t}}async GetSvgImageSize(t){return this.IsInWorker()?await this.PostComponentMessageToDOMAsync('runtime','get-svg-image-size',{blob:t}):await self.C3_GetSvgImageSize(t)}RequestDeviceOrientationEvent(){this._didRequestDeviceOrientationEvent||(this._didRequestDeviceOrientationEvent=!0,this.PostComponentMessageToDOM('runtime','enable-device-orientation'))}RequestDeviceMotionEvent(){this._didRequestDeviceMotionEvent||(this._didRequestDeviceMotionEvent=!0,this.PostComponentMessageToDOM('runtime','enable-device-motion'))}Random(){return this._randomNumberCallback()}SetRandomNumberGeneratorCallback(t){this._randomNumberCallback=t}_GetRemotePreviewStatusInfo(){return{fps:this.GetFPS(),cpu:this.GetMainThreadTime(),gpu:this.GetGPUUtilisation(),layout:this.GetMainRunningLayout()?this.GetMainRunningLayout().GetName():'',renderer:this.GetWebGLRenderer().GetUnmaskedRenderer()}}HitBreakpoint(){return!!this.IsDebug()&&C3Debugger.HitBreakpoint()}DebugBreak(t){return this.IsDebugging()?C3Debugger.DebugBreak(t):Promise.resolve()}DebugBreakNext(){return!!this.IsDebugging()&&C3Debugger.BreakNext()}SetDebugBreakpointsEnabled(e){this._breakpointsEnabled=!!e,this._UpdateDebuggingFlag()}AreDebugBreakpointsEnabled(){return this._breakpointsEnabled}IsDebugging(){return this._isDebugging}SetDebuggingEnabled(t){t?this._debuggingDisabled--:this._debuggingDisabled++,this._UpdateDebuggingFlag()}_UpdateDebuggingFlag(){this._isDebugging=this.IsDebug()&&this._breakpointsEnabled&&0===this._debuggingDisabled}IsCPUProfiling(){return this.IsDebug()&&C3Debugger.IsCPUProfiling()}IsGPUProfiling(){return this.IsDebug()&&this.GetWebGLRenderer().SupportsGPUProfiling()&&C3Debugger.IsGPUProfiling()}async DebugIterateAndBreak(t){if(t)for(const e of t)await this.DebugBreak(e)}DebugFireGeneratorEventAndBreak(t){return this.DebugIterateAndBreak(this._dispatcher.dispatchGeneratorEvent(t))}_InvokeFunctionFromJS(e){return this._eventSheetManager._InvokeFunctionFromJS(e.name,e.params)}GetIRuntime(){return this._iRuntime}_CreateUserScriptEvent(e){const t=C3.New(C3.Event,e,!1);return t.runtime=this._iRuntime,t}_InitScriptInterfaces(){const t={};for(const e of this._allObjectClasses)t[e.GetJsPropName()]={value:e.GetIObjectClass(),enumerable:!0,writable:!1};const e=Object.create(Object.prototype,t);this._iRuntime=new IRuntime(this,e),this._userScriptEventObjects={tick:this._CreateUserScriptEvent('tick')}}_InitGlobalVariableScriptInterface(){const t={};for(const e of this.GetEventSheetManager().GetAllGlobalVariables())t[e.GetJsPropName()]=e._GetScriptInterfaceDescriptor();this._iRuntime._InitGlobalVars(t)}_GetCommonScriptInterfaces(){return this._commonScriptInterfaces}},self.C3_CreateRuntime=C3.Runtime.Create,self.C3_InitRuntime=(t,e)=>t.Init(e)}'use strict',C3.JobSchedulerRuntime=class extends C3.DefendedBase{constructor(e,t){super(),this._runtime=e,this._jobPromises=new Map,this._nextJobId=0,this._inputPort=t.inputPort,t.outputPort.onmessage=e=>this._OnJobWorkerMessage(e),this._maxNumWorkers=t.maxNumWorkers,this._jobWorkerCount=1,this._isCreatingWorker=!1,this._hadErrorCreatingWorker=!1,this._isBroken=!1,this._testOkResolve=null}async Init(){await this._TestMessageChannelWorks()}ImportScriptsToJobWorkers(e){this._isBroken||this._inputPort.postMessage({type:'_import_scripts',scripts:e})}SendBlobToJobWorkers(e,t){this._isBroken||this._inputPort.postMessage({type:'_send_blob',blob:e,id:t})}SendBufferToJobWorkers(e,t){this._isBroken||this._inputPort.postMessage({type:'_send_buffer',buffer:e,id:t},[e])}AddJob(t,a,n,r,i){if(this._isBroken)return Promise.reject('messagechannels broken');n||(n=[]);const e=this._nextJobId++,s={type:t,isBroadcast:!1,jobId:e,params:a,transferables:n},l=new Promise((t,a)=>{this._jobPromises.set(e,{resolve:t,progress:r,reject:a,cancelled:!1})});return i&&i.SetAction(()=>this._CancelJob(e)),this._inputPort.postMessage(s,n),this._MaybeCreateExtraWorker(),l}BroadcastJob(t,a,n){if(!this._isBroken){n||(n=[]);const r=this._nextJobId++,i={type:t,isBroadcast:!0,jobId:r,params:a,transferables:n};this._inputPort.postMessage(i,n)}}_CancelJob(e){const t=this._jobPromises.get(e);t&&(t.cancelled=!0,t.resolve=null,t.progress=null,t.reject=null,this._inputPort.postMessage({type:'_cancel',jobId:e}))}_OnJobWorkerMessage(e){const t=e.data,a=t.type,n=t.jobId;switch(a){case'result':this._OnJobResult(n,t.result);break;case'progress':this._OnJobProgress(n,t.progress);break;case'error':this._OnJobError(n,t.error);break;case'ready':this._OnJobWorkerReady();break;case'_testMessageChannelOk':this._OnTestMessageChannelOk();break;default:throw new Error(`unknown message from worker '${a}'`);}}_OnJobResult(e,t){const a=this._jobPromises.get(e);if(!a)throw new Error('invalid job ID');a.cancelled||a.resolve(t),this._jobPromises.delete(e)}_OnJobProgress(e,t){const a=this._jobPromises.get(e);if(!a)throw new Error('invalid job ID');!a.cancelled&&a.progress&&a.progress(t)}_OnJobError(e,t){const a=this._jobPromises.get(e);if(!a)throw new Error('invalid job ID');a.cancelled||a.reject(t),this._jobPromises.delete(e)}_OnJobWorkerReady(){this._isCreatingWorker&&(this._isCreatingWorker=!1,this._jobWorkerCount++,this._jobWorkerCount=this._maxNumWorkers||this._isCreatingWorker||this._hadErrorCreatingWorker||this._jobPromises.size<=this._jobWorkerCount))try{this._isCreatingWorker=!0;const e=await this._runtime.PostComponentMessageToDOMAsync('runtime','create-job-worker');e.outputPort.onmessage=e=>this._OnJobWorkerMessage(e)}catch(e){this._hadErrorCreatingWorker=!0,this._isCreatingWorker=!1,console.error(`[Construct 3] Failed to create job worker; stopping creating any more (created ${this._jobWorkerCount} so far)`,e)}}_TestMessageChannelWorks(){return this._inputPort.postMessage({type:'_testMessageChannel'}),self.setTimeout(()=>this._CheckMessageChannelTestTimedOut(),2e3),new Promise(e=>this._testOkResolve=e)}_OnTestMessageChannelOk(){this._testOkResolve(),this._testOkResolve=null}_CheckMessageChannelTestTimedOut(){this._testOkResolve&&(console.warn('MessageChannel determined to be broken. Job scheduler disabled.'),this._isBroken=!0,this._testOkResolve(),this._testOkResolve=null)}},self.C3_Shaders={},self.C3_Shaders.warpripple={src:'varying mediump vec2 vTex;\nuniform lowp sampler2D samplerFront;\nuniform mediump vec2 srcOriginStart;\nuniform mediump vec2 srcOriginEnd;\nuniform mediump float seconds;\nuniform mediump vec2 pixelSize;\nuniform mediump float freq;\nuniform mediump float amp;\nuniform mediump float speed;\nconst mediump float PI = 3.1415926;\nvoid main(void)\n{\nmediump vec2 srcOriginSize = srcOriginEnd - srcOriginStart;\nmediump vec2 tex = (vTex - srcOriginStart) / srcOriginSize;\ntex = tex * 2.0 - 1.0;\nmediump float d = length(tex);\nmediump float a = atan(tex.y, tex.x);\nd += sin((d * 2.0 * PI) * freq / (pixelSize.x * 750.0) + (seconds * speed)) * amp * (pixelSize.x * 750.0);\ntex.x = cos(a) * d;\ntex.y = sin(a) * d;\ntex = (tex + 1.0) / 2.0;\ntex = clamp(tex, 0.0, 1.0);\ntex = tex * srcOriginSize + srcOriginStart;\ngl_FragColor = texture2D(samplerFront, tex);\n}',extendBoxHorizontal:50,extendBoxVertical:50,crossSampling:!1,mustPreDraw:!1,preservesOpaqueness:!1,animated:!0,parameters:[['freq',0,'float'],['amp',0,'percent'],['speed',0,'float']]},'use strict';{function t(e,t){const n=e[1],r=t[1];if('number'==typeof n&&'number'==typeof r)return n-r;else{const e=''+n,t=''+r;return et?1:0}}let n=null,r='',s='',l=[],e='',_='',u='';const y=C3.New(C3.ArrayStack);C3.Plugins.System=class extends C3.SDKPluginBase{constructor(e){super(e),this._loopStack=this._runtime.GetEventSheetManager().GetLoopStack(),this._eventStack=this._runtime.GetEventSheetManager().GetEventStack(),this._imagesLoadingTotal=0,this._imagesLoadingComplete=0,this._functionMaps=new Map}Release(){super.Release()}UpdateRender(){this._runtime.UpdateRender()}Trigger(e){this._runtime.Trigger(e,null,null)}GetRegex(t,a){return n&&t===r&&a===s||(n=new RegExp(t,a),r=t,s=a),n.lastIndex=0,n}GetRegexMatches(t,a,n){if(t===e&&a===_&&n===u)return l;const r=this.GetRegex(a,n);return l=t.match(r),e=t,_=a,u=n,l}async _LoadTexturesForObjectClasses(e,t){if(t.length){this._imagesLoadingTotal+=t.length;const a=[];for(const n of t)a.push(e.MaybeLoadTexturesFor(n));await C3.PromiseAllWithProgress(a,()=>{this._imagesLoadingComplete++}),this._imagesLoadingComplete++,this._imagesLoadingComplete===this._imagesLoadingTotal&&(this._runtime.Trigger(C3.Plugins.System.Cnds.OnImageLoadingComplete,null,null),this._imagesLoadingComplete=0,this._imagesLoadingTotal=0)}}_UnloadTexturesForObjectClasses(e,t){for(const a of t)0===a.GetInstanceCount()&&e.MaybeUnloadTexturesFor(a)}_GetForEachStack(){return y}_Repeat(t){const a=this._runtime.GetEventSheetManager(),n=a.GetEventStack(),r=n.GetCurrentStackFrame(),s=r.GetCurrentEvent(),e=s.GetSolModifiers(),l=r.IsSolModifierAfterCnds(),_=n.Push(s),d=a.GetLoopStack(),i=d.Push();if(i.SetEnd(t),l)for(let n=0;n=r&&!g.IsStopped();--t)s.PushCopySol(d),g.SetIndex(t),_.Retrigger(e,i),s.PopSol(d);else for(let t=n;t>=r&&!g.IsStopped();--t)g.SetIndex(t),_.Retrigger(e,i);}else if(u)for(let t=n;t<=r&&!g.IsStopped();++t)s.PushCopySol(d),g.SetIndex(t),_.Retrigger(e,i),s.PopSol(d);else for(let t=n;t<=r&&!g.IsStopped();++t)g.SetIndex(t),_.Retrigger(e,i);return a.Pop(),c.Pop(),!1}*_DebugFor(t,n,r){const s=this._runtime.GetEventSheetManager(),a=s.GetEventStack(),e=a.GetCurrentStackFrame(),_=e.GetCurrentEvent(),d=_.GetSolModifiers(),u=e.IsSolModifierAfterCnds(),i=a.Push(_),c=s.GetLoopStack(),g=c.Push();if(g.SetName(t),g.SetEnd(r),r=r&&!g.IsStopped();--t)s.PushCopySol(d),g.SetIndex(t),yield*_.DebugRetrigger(e,i),s.PopSol(d);else for(let t=n;t>=r&&!g.IsStopped();--t)g.SetIndex(t),yield*_.DebugRetrigger(e,i);}else if(u)for(let t=n;t<=r&&!g.IsStopped();++t)s.PushCopySol(d),g.SetIndex(t),yield*_.DebugRetrigger(e,i),s.PopSol(d);else for(let t=n;t<=r&&!g.IsStopped();++t)g.SetIndex(t),yield*_.DebugRetrigger(e,i);return a.Pop(),c.Pop(),!1}_ForEach(t){const a=this._runtime.GetEventSheetManager(),r=a.GetEventStack(),i=r.GetCurrentStackFrame(),s=i.GetCurrentEvent(),e=s.GetSolModifiers(),_=i.IsSolModifierAfterCnds(),d=r.Push(s),u=a.GetLoopStack(),p=u.Push(),h=t.IsInContainer(),l=t.GetCurrentSol(),m=y.Push();if(C3.shallowAssignArray(m,l.GetInstances()),p.SetEnd(m.length),_)for(let n=0,r=m.length;n=r+e?(n.set('Every_lastTime',r+e),i>=n.get('Every_lastTime')+.04&&n.set('Every_lastTime',i),n.set('Every_seconds',t),!0):(i=t&&e<=n},CompareVar(e,t,a){return C3.compare(e.GetValue(),t,a)},CompareBoolVar(e){return!!e.GetValue()},CompareTime(e,t){const n=this._runtime.GetGameTime();if(0===e){const e=this._runtime.GetCurrentCondition(),a=e.GetSavedDataMap();return!a.get('CompareTime_executed')&&n>=t&&(a.set('CompareTime_executed',!0),!0)}return C3.compare(n,e,t)},IsNaN(e){return isNaN(e)},AngleWithin(e,t,a){return C3.angleDiff(C3.toRadians(e),C3.toRadians(a))<=C3.toRadians(t)},IsClockwiseFrom(e,t){return C3.angleClockwise(C3.toRadians(e),C3.toRadians(t))},IsBetweenAngles(t,n,a){let r=C3.toRadians(t),i=C3.toRadians(n),e=C3.toRadians(a),s=!C3.angleClockwise(e,i);return s?C3.angleClockwise(r,i)||!C3.angleClockwise(r,e):C3.angleClockwise(r,i)&&!C3.angleClockwise(r,e)},IsValueType(e,t){return'number'==typeof e?0===t:1===t},PickByComparison(t,n,r,s){if(!t)return!1;const a=this._GetForEachStack(),l=a.Push(),_=t.GetCurrentSol();C3.shallowAssignArray(l,_.GetInstances()),_.IsSelectAll()&&C3.clearArray(_._GetOwnElseInstances());const u=this._runtime.GetCurrentCondition();let c=0;for(let d=0,e=l.length;d=r.length)return!1;const i=r[a];return n.PickOne(i),t.ApplySolToContainer(),!0},PickRandom(t){if(!t)return!1;const a=t.GetCurrentSol(),n=a.GetInstances(),r=Math.floor(this._runtime.Random()*n.length);if(r>=n.length)return!1;const i=n[r];return a.PickOne(i),t.ApplySolToContainer(),!0},PickAll(e){if(!e)return!1;if(!e.GetInstanceCount())return!1;const t=e.GetCurrentSol();return t._SetSelectAll(!0),e.ApplySolToContainer(),!0},PickOverlappingPoint(a,n,r){if(!a)return!1;const i=a.GetCurrentSol(),e=i.GetInstances(),s=this._runtime.GetCurrentEvent(),l=s.IsOrBlock(),_=this._runtime.GetCurrentCondition().IsInverted();i.IsSelectAll()?(C3.shallowAssignArray(t,e),i.ClearArrays(),i._SetSelectAll(!1)):l?(C3.shallowAssignArray(t,i._GetOwnElseInstances()),C3.clearArray(i._GetOwnElseInstances())):(C3.shallowAssignArray(t,i._GetOwnInstances()),C3.clearArray(i._GetOwnInstances()));for(let e=0,s=t.length;et&&(t=0),!!e){const a=e.GetCurrentSol(),n=a.GetInstances();for(const e of n)e.SetTimeScale(t)}},RestoreObjectTimescale(e){if(e){const t=e.GetCurrentSol(),n=t.GetInstances();for(const e of n)e.RestoreTimeScale()}},Wait(e){if(!(0>e))return this._runtime.GetEventSheetManager().AddScheduledWait().InitTimer(e),!0},WaitForSignal(e){return this._runtime.GetEventSheetManager().AddScheduledWait().InitSignal(e),!0},WaitForPreviousActions(){const e=this._runtime.GetEventSheetManager();return e.AddScheduledWait().InitPromise(e.GetPromiseForAllAsyncActions()),!0},Signal(e){const t=e.toLowerCase();for(const a of this._runtime.GetEventSheetManager().scheduledWaits())a.IsSignal()&&a.GetSignalTag()===t&&a.SetSignalled()},async SnapshotCanvas(e,t){const a=this._runtime.GetCanvasManager();a&&(this.UpdateRender(),await a.SnapshotCanvas(0===e?'image/png':'image/jpeg',t/100),await this._runtime.TriggerAsync(C3.Plugins.System.Cnds.OnCanvasSnapshot,null))},SetCanvasSize(e,t){if(!(0>=e||0>=t)){this._runtime.SetViewportSize(e,t);const a=this._runtime.GetCanvasManager();a&&('off'===a.GetCurrentFullscreenMode()?a.SetSize(a.GetLastWidth(),a.GetLastHeight(),!0):(this._runtime.SetOriginalViewportSize(e,t),a.SetSize(a.GetLastWidth(),a.GetLastHeight(),!0)),this._runtime.UpdateRender())}},SetFullscreenQuality(e){const t=this._runtime.GetCanvasManager();t&&'off'!==t.GetCurrentFullscreenMode()&&(t.SetFullscreenScalingQuality(0===e?'low':'high'),t.SetSize(t.GetLastWidth(),t.GetLastHeight(),!0))},SaveState(e){this._runtime.SaveToSlot(e)},LoadState(e){this._runtime.LoadFromSlot(e)},LoadStateJSON(e){this._runtime.LoadFromJsonString(e)},SetHalfFramerateMode(){},ResetPersisted(){for(const e of this._runtime.GetLayoutManager().GetAllLayouts())e.ResetPersistData()},SetPixelRounding(e){this._runtime.SetPixelRoundingEnabled(0!==e)},SetMinimumFramerate(e){this._runtime.SetMinimumFramerate(e)},SortZOrderByInstVar(s,e){if(!s)return;const _=s.GetCurrentSol(),u=_.GetInstances(),g=r,p=i,h=this._runtime.GetCurrentLayout(),l=s.IsFamily(),m=s.GetFamilyIndex();for(let t=0,a=u.length;tr||r>=t.length)){const e=l.GetShaderProgram().GetParameterType(r);if('color'===e){n.setFromRgbValue(i);const e=t[r];if(n.equalsIgnoringAlpha(e))return;e.copyRgb(n)}else{if('percent'===e&&(i/=100),t[r]===i)return;t[r]=i}l.IsActive()&&this._runtime.UpdateRender()}}}},SetLayerForceOwnTexture(e,t){e&&(t=!!t,e.IsForceOwnTexture()===t||(e.SetForceOwnTexture(t),this.UpdateRender()))},SetLayoutScale(e){const t=this._runtime.GetCurrentLayout();t.GetScale()===e||(t.SetScale(e),this.UpdateRender())},SetLayoutAngle(e){e=C3.clampAngle(C3.toRadians(+e));const t=this._runtime.GetCurrentLayout();t.GetAngle()===e||(t.SetAngle(e),this.UpdateRender())},SetLayoutEffectEnabled(e,t){const a=this._runtime.GetCurrentLayout(),n=a.GetEffectList(),r=n.GetEffectTypeByName(t);if(r){const t=1===e;r.IsActive()===t||(r.SetActive(t),n.UpdateActiveEffects(),this._runtime.UpdateRender())}},SetLayoutEffectParam(e,t,r){const a=this._runtime.GetCurrentLayout(),i=a.GetEffectList(),s=i.GetEffectTypeByName(e);if(s){const e=s.GetIndex(),l=i.GetEffectParametersForIndex(e);if(t=Math.floor(t),!(0>t||t>=l.length)){const e=s.GetShaderProgram().GetParameterType(t);if('color'===e){n.setFromRgbValue(r);const e=l[t];if(n.equalsIgnoringAlpha(e))return;e.copyRgb(n)}else{if('percent'===e&&(r/=100),l[t]===r)return;l[t]=r}s.IsActive()&&this._runtime.UpdateRender()}}},ScrollX(e){const t=this._runtime.GetCurrentLayout();t.SetScrollX(e)},ScrollY(e){const t=this._runtime.GetCurrentLayout();t.SetScrollY(e)},Scroll(e,t){const a=this._runtime.GetCurrentLayout();a.SetScrollX(e),a.SetScrollY(t)},ScrollToObject(e){if(e){const t=e.GetFirstPicked();if(t){const e=t.GetWorldInfo();if(e){const t=this._runtime.GetCurrentLayout();t.SetScrollX(e.GetX()),t.SetScrollY(e.GetY())}}}},async LoadObjectTextures(e){const t=this._runtime.GetMainRunningLayout();if(t&&e&&!this._runtime.IsLoading()){const a=e.IsFamily()?e.GetFamilyMembers():[e];await this._LoadTexturesForObjectClasses(t,a)}},async LoadObjectTexturesByName(e){await C3.Plugins.System.Acts.LoadObjectTextures.call(this,this._runtime.GetObjectClassByName(e))},UnloadObjectTextures(e){const t=this._runtime.GetMainRunningLayout();if(t&&e){const a=e.IsFamily()?e.GetFamilyMembers():[e];this._UnloadTexturesForObjectClasses(t,a)}},UnloadObjectTexturesByName(e){C3.Plugins.System.Acts.UnloadObjectTexturesByName.call(this,this._runtime.GetObjectClassByName(e))},UnloadUnusedTextures(){const e=this._runtime.GetMainRunningLayout();if(e){const t=e._GetTextureLoadedObjectTypes();this._UnloadTexturesForObjectClasses(e,t)}},async LoadLayoutTextures(e){const t=this._runtime.GetMainRunningLayout();e&&t&&!this._runtime.IsLoading()&&(await this._LoadTexturesForObjectClasses(t,e._GetInitialObjectClasses()))},async LoadLayoutTexturesByName(e){const t=this._runtime.GetMainRunningLayout(),a=this._runtime.GetLayoutManager().GetLayoutByName(e);a&&t&&!this._runtime.IsLoading()&&(await this._LoadTexturesForObjectClasses(t,a._GetInitialObjectClasses()))},SetFunctionReturnValue(e){const t=this._eventStack.GetCurrentExpFuncStackFrame();if(t)switch(t.GetFunctionReturnType()){case 1:'number'==typeof e&&t.SetFunctionReturnValue(e);break;case 2:'string'==typeof e&&t.SetFunctionReturnValue(e);break;case 3:t.SetFunctionReturnValue(e);}},MapFunction(t,a,n){const r=this._GetFunctionMap(t.toLowerCase(),!0),i=r.strMap,e=a.toLowerCase();i.has(e)&&console.warn(`[Construct 3] Function map '${t}' string '${a}' already in map; overwriting entry`);const s=C3.first(i.values())||r.defaultFunc;if(s){const r=0!==s.GetReturnType(),i=0!==n.GetReturnType();if(r!=i)return void console.error(`[Construct 3] Function map '${t}' string '${a}' function return type not compatible with other functions in the map; entry ignored`)}i.set(e,n)},MapFunctionDefault(t,a){const e=this._GetFunctionMap(t.toLowerCase(),!0);e.defaultFunc&&console.warn(`[Construct 3] Function map '${t}' already has a default; overwriting entry`);const n=C3.first(e.strMap.values())||e.defaultFunc;if(n){const r=0!==n.GetReturnType(),i=0!==a.GetReturnType();if(r!=i)return void console.error(`[Construct 3] Function map '${t}' default: function return type not compatible with other functions in the map; entry ignored`)}e.defaultFunc=a},CallMappedFunction(t,a,n){n=Math.floor(n);const r=this._GetFunctionMap(t.toLowerCase(),!1);if(!r)return void console.warn(`[Construct 3] Call mapped function: map name '${t}' not found; call ignored`);let s=r.strMap.get(a.toLowerCase());if(!s)if(r.defaultFunc)s=r.defaultFunc,n=0;else return void console.warn(`[Construct 3] Call mapped function: no function associated with map '${t}' string '${a}'; call ignored (consider setting a default)`);if(s.IsEnabled()){if(0!==s.GetReturnType())return void console.warn(`[Construct 3] Call mapped function: map '${t}' string '${a}' has a return type so cannot be called`);const e=this._runtime,r=e.GetEventSheetManager(),_=r.GetCurrentEvent(),d=_.GetSolModifiersIncludingParents(),u=0e&&(a=e);return a},clamp(e,t,a){return C3.clamp(e,t,a)},distance(e,t,a,n){return C3.distanceTo(e,t,a,n)},angle(e,t,a,n){return C3.toDegrees(C3.angleTo(e,t,a,n))},lerp(e,t,a){return C3.lerp(e,t,a)},unlerp(e,t,a){return C3.unlerp(e,t,a)},qarp(e,t,a,n){return C3.qarp(e,t,a,n)},cubic(t,e,a,n,r){return C3.cubic(t,e,a,n,r)},cosp(e,t,a){return C3.cosp(e,t,a)},anglediff(e,t){return C3.toDegrees(C3.angleDiff(C3.toRadians(e),C3.toRadians(t)))},anglelerp(e,t,a){return C3.toDegrees(C3.angleLerp(C3.toRadians(e),C3.toRadians(t),a))},anglerotate(e,t,a){return C3.toDegrees(C3.angleRotate(C3.toRadians(e),C3.toRadians(t),C3.toRadians(a)))},setbit(e,t,n){return e|=0,t|=0,n=0===n?0:1,e&~(1<a?e.substr(t):e.substr(t,a):''},right(e,t){return'string'==typeof e?e.substr(e.length-t):''},trim(e){return'string'==typeof e?e.trim():''},tokenat(e,t,a){if('string'!=typeof e||'string'!=typeof a)return'';let n=e.split(a);return t=Math.floor(t),0>t||t>=n.length?'':n[t]},tokencount(e,t){return'string'==typeof e&&'string'==typeof t&&e.length?e.split(t).length:0},find(e,t){return'string'==typeof e&&'string'==typeof t?e.search(new RegExp(C3.EscapeRegex(t),'i')):-1},findcase(e,t){return'string'==typeof e&&'string'==typeof t?e.search(new RegExp(C3.EscapeRegex(t),'')):-1},replace(e,t,a){return'string'==typeof e&&'string'==typeof t&&'string'==typeof a?e.replace(new RegExp(C3.EscapeRegex(t),'gi'),a):'string'==typeof e?e:''},regexsearch(e,t,a){const n=this.GetRegex(t,a);return e?e.search(n):-1},regexreplace(t,a,n,r){const i=this.GetRegex(a,n);return t?t.replace(i,r):''},regexmatchcount(e,t,a){const n=this.GetRegexMatches(e.toString(),t,a);return n?n.length:0},regexmatchat(t,a,n,r){r=Math.floor(r);const i=this.GetRegexMatches(t.toString(),a,n);return!i||0>r||r>=i.length?'':i[r]},zeropad(e,t){let n=0>e?'-':'';0>e&&(e=-e);const r=t-e.toString().length;return n+='0'.repeat(Math.max(r,0)),n+e.toString()},urlencode(e){return encodeURIComponent(e)},urldecode(e){return decodeURIComponent(e)},dt(){return this._runtime._GetDtFast()},timescale(){return this._runtime.GetTimeScale()},wallclocktime(){return(Date.now()-this._runtime.GetStartTime())/1e3},unixtime(){return Date.now()},time(){return this._runtime.GetGameTime()},tickcount(){return this._runtime.GetTickCount()},objectcount(){return this._runtime.GetObjectCount()},fps(){return this._runtime.GetFPS()},cpuutilisation(){return this._runtime.GetMainThreadTime()},gpuutilisation(){return this._runtime.GetGPUUtilisation()},windowwidth(){return this._runtime.GetCanvasManager().GetDeviceWidth()},windowheight(){return this._runtime.GetCanvasManager().GetDeviceHeight()},originalwindowwidth(){return this._runtime.GetOriginalViewportWidth()},originalwindowheight(){return this._runtime.GetOriginalViewportHeight()},originalviewportwidth(){return this._runtime.GetOriginalViewportWidth()},originalviewportheight(){return this._runtime.GetOriginalViewportHeight()},scrollx(){return this._runtime.GetCurrentLayout().GetScrollX()},scrolly(){return this._runtime.GetCurrentLayout().GetScrollY()},layoutname(){return this._runtime.GetCurrentLayout().GetName()},layoutscale(){return this._runtime.GetCurrentLayout().GetScale()},layoutangle(){return C3.toDegrees(this._runtime.GetCurrentLayout().GetAngle())},layoutwidth(){return this._runtime.GetCurrentLayout().GetWidth()},layoutheight(){return this._runtime.GetCurrentLayout().GetHeight()},viewportleft(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().getLeft():0},viewporttop(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().getTop():0},viewportright(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().getRight():0},viewportbottom(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().getBottom():0},viewportwidth(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().width():0},viewportheight(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetViewport().height():0},canvastolayerx(e,t,a){const n=this._runtime.GetCurrentLayout().GetLayer(e);return n?n.CanvasCssToLayer(t,a)[0]:0},canvastolayery(e,t,a){const n=this._runtime.GetCurrentLayout().GetLayer(e);return n?n.CanvasCssToLayer(t,a)[1]:0},layertocanvasx(e,t,a){const n=this._runtime.GetCurrentLayout().GetLayer(e);return n?n.LayerToCanvasCss(t,a)[0]:0},layertocanvasy(e,t,a){const n=this._runtime.GetCurrentLayout().GetLayer(e);return n?n.LayerToCanvasCss(t,a)[1]:0},layerscale(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetOwnScale():0},layerangle(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?C3.toDegrees(t.GetOwnAngle()):0},layeropacity(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?100*t.GetOpacity():0},layerscalerate(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetScaleRate():0},layerparallaxx(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?100*t.GetParallaxX():0},layerparallaxy(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?100*t.GetParallaxY():0},layerzelevation(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetZElevation():0},layerindex(e){const t=this._runtime.GetCurrentLayout().GetLayer(e);return t?t.GetIndex():-1},canvassnapshot(){const e=this._runtime.GetCanvasManager();return e?e.GetCanvasSnapshotUrl():''},loopindex(e){const t=this._loopStack;if(!t.IsInLoop())return 0;if(e){const a=t.FindByName(e);return a?a.GetIndex():0}return t.GetCurrent().GetIndex()},savestatejson(){return this._runtime.GetLastSaveJsonString()},callmapped(t,a,...r){const s=this._GetFunctionMap(t.toLowerCase(),!1);if(!s)return console.warn(`[Construct 3] Call mapped function: map name '${t}' not found; returning 0`),0;let _=s.strMap.get(a.toLowerCase());if(!_)if(s.defaultFunc)_=s.defaultFunc;else return console.warn(`[Construct 3] Call mapped function: no function associated with map '${t}' string '${a}'; returning 0 (consider setting a default)`),0;const d=_.GetReturnType(),u=_.GetDefaultReturnValue();if(0===d)return console.warn(`[Construct 3] Call mapped function: map '${t}' string '${a}' has no return type so cannot be called from an expression; returning 0`),0;if(!_.IsEnabled())return u;const c=this._runtime,g=c.GetEventSheetManager(),i=g.GetCurrentEvent(),p=i.GetSolModifiersIncludingParents(),h=0a.LoadAllTextures(e,t)))}ReleaseTextures(){for(const e of this._animations)e.ReleaseAllTextures()}OnDynamicTextureLoadComplete(){this._UpdateAllCurrentTexture()}_UpdateAllCurrentTexture(){for(const e of this._objectClass.GetInstances())e.GetSdkInstance()._UpdateCurrentTexture()}FinishCondition(e){C3.Plugins.Sprite._FinishCondition(this,e)}},'use strict';{const t=C3.New(C3.Quad),n=C3.New(C3.Vector2);C3.Plugins.Sprite.Instance=class extends C3.SDKWorldInstanceBase{constructor(t,a){super(t);let n=!0,r='',i=0,s=!0;a&&(n=!!a[0],r=a[1],i=a[2],s=a[3]),this._currentAnimation=this._objectClass.GetAnimationByName(r)||this._objectClass.GetAnimations()[0],this._currentFrameIndex=C3.clamp(i,0,this._currentAnimation.GetFrameCount()-1),this._currentAnimationFrame=this._currentAnimation.GetFrameAt(this._currentFrameIndex);const l=this._currentAnimationFrame.GetImageInfo();this._currentTexture=l.GetTexture(),this._currentRcTex=l.GetTexRect(),this.HandleWebGLContextLoss(),t.SetFlag(2,!0),t.SetFlag(1,0<=this._currentAnimation.GetSpeed()),this._currentAnimationSpeed=Math.abs(this._currentAnimation.GetSpeed()),this._currentAnimationRepeatTo=this._currentAnimation.GetRepeatTo(),this._animationTimer=C3.New(C3.KahanSum),this._frameStartTime=0,this._animationRepeats=0,this._animTriggerName='',this._changeAnimFrameIndex=-1,this._changeAnimationName='',this._changeAnimationFrom=0;const _=this.GetWorldInfo();this._bquadRef=_.GetBoundingQuad(),_.SetVisible(n),_.SetCollisionEnabled(s),_.SetOriginX(this._currentAnimationFrame.GetOriginX()),_.SetOriginY(this._currentAnimationFrame.GetOriginY()),_.SetSourceCollisionPoly(this._currentAnimationFrame.GetCollisionPoly()),_.SetBboxChanged(),(1!==this._objectClass.GetAnimationCount()||1!==this._objectClass.GetAnimations()[0].GetFrameCount())&&0!==this._currentAnimationSpeed&&this._StartTicking()}Release(){this._currentAnimation=null,this._currentAnimationFrame=null,this._currentTexture=null,this._animationTimer=null,super.Release()}GetCurrentImageInfo(){return this._currentAnimationFrame.GetImageInfo()}OnWebGLContextLost(){this._currentTexture=null}OnWebGLContextRestored(){this._UpdateCurrentTexture()}Draw(a){var n=Math.round;const r=this._currentTexture;if(null!==r){const i=this._bquadRef,e=this._currentRcTex;if(a.SetTexture(r),this._runtime.IsPixelRoundingEnabled()){const r=this.GetWorldInfo(),s=n(r.GetX())-r.GetX(),l=n(r.GetY())-r.GetY();t.copy(i),t.offset(s,l),a.Quad3(t,e)}else a.Quad3(i,e)}}_DrawCollisionPoly(t){const a=this.GetWorldInfo(),n=a.GetTransformedCollisionPoly();t.SetColorFillMode(),t.SetColorRgba(1,0,0,1);const r=n.pointsArr(),s=a.GetX(),e=a.GetY();for(let a=0,n=r.length;a=l&&(i?(this.SetPlayingForwards(!1),this._currentFrameIndex=l-2):d?this._currentFrameIndex=a:(this._animationRepeats++,this._animationRepeats>=_?this._FinishAnimation(!1):this._currentFrameIndex=a)),0>this._currentFrameIndex&&(i?(this._currentFrameIndex=1,this.SetPlayingForwards(!0),!d&&(this._animationRepeats++,this._animationRepeats>=_&&this._FinishAnimation(!0))):d?this._currentFrameIndex=a:(this._animationRepeats++,this._animationRepeats>=_?this._FinishAnimation(!0):this._currentFrameIndex=a)),this._currentFrameIndex=C3.clamp(this._currentFrameIndex,0,l-1);const u=e.GetFrameAt(this._currentFrameIndex);n>this._frameStartTime+u.GetDuration()/t&&(this._frameStartTime=n),this._OnFrameChanged(r,u)}}_FinishAnimation(e){this._currentFrameIndex=e?0:this._currentAnimation.GetFrameCount()-1,this.SetAnimationPlaying(!1),this._animTriggerName=this._currentAnimation.GetName(),this.SetInAnimationTrigger(!0),this.Trigger(C3.Plugins.Sprite.Cnds.OnAnyAnimFinished),this.Trigger(C3.Plugins.Sprite.Cnds.OnAnimFinished),this.SetInAnimationTrigger(!1),this._animationRepeats=0}_OnFrameChanged(t,a){const n=this.GetWorldInfo(),r=t.GetImageInfo(),s=a.GetImageInfo(),e=r.GetWidth(),l=r.GetHeight(),_=s.GetWidth(),d=s.GetHeight();e!==_&&n.SetWidth(n.GetWidth()*(_/e)),l!==d&&n.SetHeight(n.GetHeight()*(d/l)),n.SetOriginX(a.GetOriginX()),n.SetOriginY(a.GetOriginY()),n.SetSourceCollisionPoly(a.GetCollisionPoly()),n.SetBboxChanged(),this._currentAnimationFrame=a,this._currentTexture=s.GetTexture(),this._currentRcTex=s.GetTexRect();const i=this.GetInstance().GetBehaviorInstances();for(let e=0,n=i.length;ethis.CallAction(e.SetAnim,t,0)},{name:'plugins.sprite.debugger.animation-properties.current-frame',value:this._currentFrameIndex,onedit:t=>this.CallAction(e.SetAnimFrame,t)},{name:'plugins.sprite.debugger.animation-properties.is-playing',value:this.IsAnimationPlaying(),onedit:t=>t?this.CallAction(e.StartAnim,0):this.CallAction(e.StopAnim)},{name:'plugins.sprite.debugger.animation-properties.speed',value:this._currentAnimationSpeed,onedit:t=>this.CallAction(e.SetAnimSpeed,t)},{name:'plugins.sprite.debugger.animation-properties.repeats',value:this._animationRepeats,onedit:e=>this._animationRepeats=e}]}]}SaveToJson(){const e={a:this._currentAnimation.GetSID()};0!==this._frameStartTime&&(e.fs=this._frameStartTime);const t=this.GetAnimationTime();0!==t&&(e.at=t),0!==this._currentFrameIndex&&(e.f=this._currentFrameIndex),0!==this._currentAnimationSpeed&&(e.cas=this._currentAnimationSpeed),1!==this._animationRepeats&&(e.ar=this._animationRepeats),0!==this._currentAnimationRepeatTo&&(e.rt=this._currentAnimationRepeatTo),this.IsAnimationPlaying()||(e.ap=this.IsAnimationPlaying()),this.IsPlayingForwards()||(e.af=this.IsPlayingForwards());const a=this.GetWorldInfo();return a.IsCollisionEnabled()&&(e.ce=a.IsCollisionEnabled()),e}LoadFromJson(t){const a=this.GetObjectClass().GetAnimationBySID(t.a);a&&(this._currentAnimation=a),this._frameStartTime=t.hasOwnProperty('fs')?t.fs:0,this._animationTimer.Set(t.hasOwnProperty('at')?t.at:0);const n=t.hasOwnProperty('f')?t.f:0;this._currentFrameIndex=C3.clamp(n,0,this._currentAnimation.GetFrameCount()-1),this._currentAnimationSpeed=t.hasOwnProperty('cas')?t.cas:0,this._animationRepeats=t.hasOwnProperty('ar')?t.ar:1;const r=t.hasOwnProperty('rt')?t.rt:0;this._currentAnimationRepeatTo=C3.clamp(r,0,this._currentAnimation.GetFrameCount()-1),this.SetAnimationPlaying(!t.hasOwnProperty('ap')||!!t.ap),this.SetPlayingForwards(!t.hasOwnProperty('af')||!!t.af);const i=this._currentAnimation.GetFrameAt(this._currentFrameIndex),e=i.GetImageInfo();this._currentAnimationFrame=i,this._currentTexture=e.GetTexture(),this._currentRcTex=e.GetTexRect();const s=this.GetWorldInfo();s.SetOriginX(i.GetOriginX()),s.SetOriginY(i.GetOriginY()),s.SetSourceCollisionPoly(i.GetCollisionPoly()),s.SetCollisionEnabled(!!t.ce)}GetPropertyValueByIndex(e){const t=this.GetWorldInfo();return 3===e?t.IsCollisionEnabled():void 0}SetPropertyValueByIndex(e,t){const a=this.GetWorldInfo();3===e?a.SetCollisionEnabled(!!t):void 0}GetScriptInterfaceClass(){return ISpriteInstance}};const r=new WeakMap,i=new Map([['current-frame',0],['beginning',1]]);self.ISpriteInstance=class extends IWorldInstance{constructor(){super(),r.set(this,IInstance._GetInitInst().GetSdkInstance())}getImagePointX(e){if('string'!=typeof e&&'number'!=typeof e)throw new TypeError('expected string or number');return r.get(this).GetImagePoint(e)[0]}getImagePointY(e){if('string'!=typeof e&&'number'!=typeof e)throw new TypeError('expected string or number');return r.get(this).GetImagePoint(e)[1]}stopAnimation(){r.get(this).SetAnimationPlaying(!1)}startAnimation(e='current-frame'){const t=i.get(e);if('undefined'==typeof t)throw new Error('invalid mode');r.get(this)._StartAnim(t)}setAnimation(t,a='beginning'){const n=i.get(a);if('undefined'==typeof n)throw new Error('invalid mode');r.get(this)._SetAnim(t,n)}get animationName(){return r.get(this)._GetCurrentAnimationName()}set animationFrame(e){r.get(this)._SetAnimFrame(e)}get animationFrame(){return r.get(this)._GetAnimFrame()}set animationSpeed(e){r.get(this)._SetAnimSpeed(e)}get animationSpeed(){return r.get(this)._GetAnimSpeed()}set animationRepeatToFrame(e){r.get(this)._SetAnimRepeatToFrame(e)}get animationRepeatToFrame(){return r.get(this)._GetAnimRepeatToFrame()}get imageWidth(){return r.get(this).GetCurrentImageInfo().GetWidth()}get imageHeight(){return r.get(this).GetCurrentImageInfo().GetHeight()}}}{function t(t,n,r,a){const i=n.GetUID(),e=r.GetUID();in(r,e.instance)));const h=G.GetCurrentSol(),b=y.GetCurrentSol(),u=h.GetInstances();let v=null;for(let e=0;en(r,e.instance)));const f=T.GetCurrentSol(),b=y.GetCurrentSol(),u=f.GetInstances();let C=null;for(let e=0;ethis.GetWorldInfo().GetWidth()},IsFlipped(){return 0>this.GetWorldInfo().GetHeight()},OnURLLoaded(){return!0},IsCollisionEnabled(){return this.GetWorldInfo().IsCollisionEnabled()}}}'use strict',C3.Plugins.Sprite.Acts={Spawn(t,a,n){if(!t||!a)return;const[r,s]=this.GetImagePoint(n),e=this._runtime.CreateInstance(t,a,r,s);if(!e)return;if(t.GetPlugin().IsRotatable()){const t=e.GetWorldInfo();t.SetAngle(this.GetWorldInfo().GetAngle()),t.SetBboxChanged()}const l=this._runtime.GetEventSheetManager();if(l.BlockFlushingInstances(!0),e._TriggerOnCreated(),e.IsInContainer())for(const t of e.siblings())t._TriggerOnCreated();l.BlockFlushingInstances(!1);const _=this._runtime.GetCurrentAction(),d=_.GetSavedDataMap();let i=!1;if((!d.has('Spawn_LastExec')||d.get('Spawn_LastExec')r.GetWidth()?-1:1,e=0>r.GetHeight()?-1:1,s=n.GetWidth()*t*i,l=n.GetHeight()*t*e;(r.GetWidth()!==s||r.GetHeight()!==l)&&(r.SetSize(s,l),r.SetBboxChanged())},async LoadURL(t,a){const n=this._currentAnimationFrame,r=n.GetImageInfo(),i=this.GetWorldInfo(),e=this._runtime;if(r.GetURL()===t)return 0===a&&(i.SetSize(r.GetWidth(),r.GetHeight()),i.SetBboxChanged()),void this.Trigger(C3.Plugins.Sprite.Cnds.OnURLLoaded);const s=C3.New(C3.ImageInfo);await s.LoadDynamicAsset(e,t),await s.LoadStaticTexture(e.GetWebGLRenderer(),{sampling:this._runtime.GetSampling()}),r.ReplaceWith(s),this._sdkType._UpdateAllCurrentTexture(),this.WasReleased()||0!==a||(i.SetSize(r.GetWidth(),r.GetHeight()),i.SetBboxChanged()),e.UpdateRender(),this.WasReleased()||(await this.TriggerAsync(C3.Plugins.Sprite.Cnds.OnURLLoaded))},SetCollisions(e){this.GetWorldInfo().SetCollisionEnabled(e)},SetSolidCollisionFilter(e,t){this.GetWorldInfo().SetSolidCollisionFilter(0===e,t)},SetEffect(e){this.GetWorldInfo().SetBlendMode(e),this._runtime.UpdateRender()}},'use strict',C3.Plugins.Sprite.Exps={AnimationFrame(){return this._currentFrameIndex},AnimationFrameCount(){return this._currentAnimation.GetFrameCount()},AnimationName(){return this._currentAnimation.GetName()},AnimationSpeed(){return this._GetAnimSpeed()},OriginalAnimationSpeed(){return this._currentAnimation.GetSpeed()},ImagePointX(e){return this.GetImagePoint(e)[0]},ImagePointY(e){return this.GetImagePoint(e)[1]},ImagePointCount(){return this._currentAnimationFrame.GetImagePointCount()},ImageWidth(){return this.GetCurrentImageInfo().GetWidth()},ImageHeight(){return this.GetCurrentImageInfo().GetHeight()}},'use strict',C3.Plugins.Keyboard=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict';{function e(){return t.GetSingleGlobalInstance().GetSdkInstance()}C3.Plugins.Keyboard.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return IKeyboardObjectType}};let t=null;self.IKeyboardObjectType=class extends IObjectClass{constructor(e){super(e),t=e,e.GetRuntime()._GetCommonScriptInterfaces().keyboard=this}isKeyDown(t){const a=e();if('string'==typeof t)return a.IsKeyDown(t);if('number'==typeof t)return a.IsKeyCodeDown(t);throw new TypeError('expected string or number')}}}'use strict',C3.Plugins.Keyboard.Instance=class extends C3.SDKInstanceBase{constructor(e){super(e),this._keysDownByString=new Set,this._keysDownByWhich=new Set,this._triggerWhich=0,this._triggerString='',this._triggerTypedKey='';const t=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(t,'keydown',e=>this._OnKeyDown(e.data)),C3.Disposable.From(t,'keyup',e=>this._OnKeyUp(e.data)),C3.Disposable.From(t,'window-blur',()=>this._OnWindowBlur()))}Release(){super.Release()}_OnKeyDown(e){const t=e.which,a=e.code||t.toString(),n=e.key;this._keysDownByString.has(a)||(this._keysDownByString.add(a),this._keysDownByWhich.add(t),this._triggerString=a,this._triggerWhich=t,this._triggerTypedKey=n,this.Trigger(C3.Plugins.Keyboard.Cnds.OnAnyKey),this.Trigger(C3.Plugins.Keyboard.Cnds.OnKey),this.Trigger(C3.Plugins.Keyboard.Cnds.OnLeftRightKeyPressed),this.Trigger(C3.Plugins.Keyboard.Cnds.OnKeyCode))}_OnKeyUp(e){const t=e.which,a=e.code||t.toString(),n=e.key;this._keysDownByString.delete(a),this._keysDownByWhich.delete(t),this._triggerString=a,this._triggerWhich=t,this._triggerTypedKey=n,this.Trigger(C3.Plugins.Keyboard.Cnds.OnAnyKeyReleased),this.Trigger(C3.Plugins.Keyboard.Cnds.OnKeyReleased),this.Trigger(C3.Plugins.Keyboard.Cnds.OnLeftRightKeyReleased),this.Trigger(C3.Plugins.Keyboard.Cnds.OnKeyCodeReleased)}_OnWindowBlur(){for(const e of this._keysDownByWhich)this._keysDownByWhich.delete(e),this._triggerWhich=e,this.Trigger(C3.Plugins.Keyboard.Cnds.OnAnyKeyReleased),this.Trigger(C3.Plugins.Keyboard.Cnds.OnKeyReleased),this.Trigger(C3.Plugins.Keyboard.Cnds.OnKeyCodeReleased);this._keysDownByString.clear()}IsKeyDown(e){return this._keysDownByString.has(e)}IsKeyCodeDown(e){return this._keysDownByWhich.has(e)}SaveToJson(){return{tk:this._triggerWhich,tkk:this._triggerTypedKey}}LoadFromJson(e){this._triggerWhich=e.tk,e.hasOwnProperty('tkk')&&(this._triggerTypedKey=e.tkk)}GetDebuggerProperties(){return[{title:'plugins.keyboard.name',properties:[{name:'plugins.keyboard.debugger.last-key-code',value:this._triggerWhich},{name:'plugins.keyboard.debugger.last-key-string',value:C3.Plugins.Keyboard.Exps.StringFromKeyCode(this._triggerWhich)},{name:'plugins.keyboard.debugger.last-typed-key',value:this._triggerTypedKey}]}]}},'use strict';{const e=['ShiftLeft','ShiftRight','ControlLeft','ControlRight','AltLeft','AltRight','MetaLeft','MetaRight'];C3.Plugins.Keyboard.Cnds={IsKeyDown(e){return this._keysDownByWhich.has(e)},OnKey(e){return this._triggerWhich===e},OnAnyKey(){return!0},OnAnyKeyReleased(){return!0},OnKeyReleased(e){return this._triggerWhich===e},IsKeyCodeDown(e){return e=Math.floor(e),this._keysDownByWhich.has(e)},OnKeyCode(e){return this._triggerWhich===e},OnKeyCodeReleased(e){return this._triggerWhich===e},OnLeftRightKeyPressed(t){const a=e[t];return this._triggerString===a},OnLeftRightKeyReleased(t){const a=e[t];return this._triggerString===a},IsLeftRightKeyDown(t){const a=e[t];return this._keysDownByString.has(a)}}}'use strict',C3.Plugins.Keyboard.Acts={},'use strict';{function e(e){return e=Math.floor(e),8===e?'backspace':9===e?'tab':13===e?'enter':16===e?'shift':17===e?'control':18===e?'alt':19===e?'pause':20===e?'capslock':27===e?'esc':33===e?'pageup':34===e?'pagedown':35===e?'end':36===e?'home':37===e?'\u2190':38===e?'\u2191':39===e?'\u2192':40===e?'\u2193':45===e?'insert':46===e?'del':91===e?'left window key':92===e?'right window key':93===e?'select':96===e?'numpad 0':97===e?'numpad 1':98===e?'numpad 2':99===e?'numpad 3':100===e?'numpad 4':101===e?'numpad 5':102===e?'numpad 6':103===e?'numpad 7':104===e?'numpad 8':105===e?'numpad 9':106===e?'numpad *':107===e?'numpad +':109===e?'numpad -':110===e?'numpad .':111===e?'numpad /':112===e?'F1':113===e?'F2':114===e?'F3':115===e?'F4':116===e?'F5':117===e?'F6':118===e?'F7':119===e?'F8':120===e?'F9':121===e?'F10':122===e?'F11':123===e?'F12':144===e?'numlock':145===e?'scroll lock':186===e?';':187===e?'=':188===e?',':189===e?'-':190===e?'.':191===e?'/':192===e?'\'':219===e?'[':220===e?'\\':221===e?']':222===e?'#':223===e?'`':String.fromCharCode(e)}C3.Plugins.Keyboard.Exps={LastKeyCode(){return this._triggerWhich},StringFromKeyCode(t){return e(t)},TypedKey(){return this._triggerTypedKey}}}'use strict',C3.Plugins.Audio=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict';{function e(){if(self.C3Audio_DOMInterface)return self.C3Audio_DOMInterface;throw new Error('audio scripting API cannot be used here - make sure the project is using DOM mode, not worker mode')}C3.Plugins.Audio.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}GetScriptInterfaceClass(){return IAudioObjectType}},self.IAudioObjectType=class extends IObjectClass{constructor(e){super(e)}get audioContext(){return e().GetAudioContext()}get destinationNode(){return e().GetDestinationNode()}}}{const t=['interactive','balanced','playback'];C3.Plugins.Audio.Instance=class extends C3.SDKInstanceBase{constructor(a,n){super(a,'audio'),this._nextPlayTime=0,this._triggerTag='',this._timeScaleMode=0,this._saveLoadMode=0,this._playInBackground=!1,this._panningModel=1,this._distanceModel=1,this._listenerX=this._runtime.GetViewportWidth()/2,this._listenerY=this._runtime.GetViewportHeight()/2,this._listenerZ=-600,this._referenceDistance=600,this._maxDistance=1e4,this._rolloffFactor=1,this._listenerInst=null,this._loadListenerUid=-1,this._masterVolume=1,this._isSilent=!1,this._sampleRate=0,this._effectCount=new Map,this._preloadTotal=0,this._preloadCount=0;let r='interactive';n&&(this._timeScaleMode=n[0],this._saveLoadMode=n[1],this._playInBackground=n[2],r=t[n[3]],this._panningModel=n[4],this._distanceModel=n[5],this._listenerZ=-n[6],this._referenceDistance=n[7],this._maxDistance=n[8],this._rolloffFactor=n[9]),this._lastAIState=[],this._lastFxState=[],this._lastAnalysersData=[],this.AddDOMMessageHandlers([['state',e=>this._OnUpdateState(e)],['fxstate',e=>this._OnUpdateFxState(e)],['trigger',e=>this._OnTrigger(e)]]);const i=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(i,'instancedestroy',e=>this._OnInstanceDestroyed(e.instance)),C3.Disposable.From(i,'afterload',()=>this._OnAfterLoad()),C3.Disposable.From(i,'suspend',()=>this._OnSuspend()),C3.Disposable.From(i,'resume',()=>this._OnResume())),this._runtime.AddLoadPromise(this.PostToDOMAsync('create-audio-context',{preloadList:this._runtime.GetAssetManager().GetAudioToPreload().map(e=>({originalUrl:e.originalUrl,url:e.url,type:e.type,fileSize:e.fileSize})),isiOSCordova:this._runtime.IsiOSCordova(),timeScaleMode:this._timeScaleMode,latencyHint:r,panningModel:this._panningModel,distanceModel:this._distanceModel,refDistance:this._referenceDistance,maxDistance:this._maxDistance,rolloffFactor:this._rolloffFactor,listenerPos:[this._listenerX,this._listenerY,this._listenerZ]}).then(e=>{this._sampleRate=e.sampleRate})),this._StartTicking()}Release(){this._listenerInst=null,super.Release()}_OnInstanceDestroyed(e){this._listenerInst===e&&(this._listenerInst=null)}DbToLinearNoCap(e){return Math.pow(10,e/20)}DbToLinear(e){const t=this.DbToLinearNoCap(e);return isFinite(t)?Math.max(Math.min(t,1),0):0}LinearToDbNoCap(e){return 20*(Math.log(e)/2.302585092994046)}LinearToDb(e){return this.LinearToDbNoCap(Math.max(Math.min(e,1),0))}_OnSuspend(){this._playInBackground||this.PostToDOM('set-suspended',{isSuspended:!0})}_OnResume(){this._playInBackground||this.PostToDOM('set-suspended',{isSuspended:!1})}_OnUpdateState(e){const t=e.tickCount,a=this._lastAIState.filter(e=>e.hasOwnProperty('placeholder')&&(e.placeholder>t||-1===e.placeholder));this._lastAIState=e.audioInstances,this._lastAnalysersData=e.analysers,0C3.equalsNoCase(e,t.tag)&&t.isPlaying)}_MaybeMarkAsPlaying(t,a,n,r){if(this._IsTagPlaying(t))return null;const i={tag:t,duration:0,volume:r,isPlaying:!0,playbackTime:0,playbackRate:1,uid:-1,bufferOriginalUrl:'',bufferUrl:'',bufferType:'',isMusic:a,isLooping:n,isMuted:!1,resumePosition:0,pan:null,placeholder:-1};return this._lastAIState.push(i),i}async _OnTrigger(e){const t=e.type;this._triggerTag=e.tag,'ended'===t?await this.TriggerAsync(C3.Plugins.Audio.Cnds.OnEnded):'fade-ended'===t&&(await this.TriggerAsync(C3.Plugins.Audio.Cnds.OnFadeEnded))}Tick(){const e={timeScale:this._runtime.GetTimeScale(),gameTime:this._runtime.GetGameTime(),instPans:this.GetInstancePans(),tickCount:this._runtime.GetTickCountNoSave()};if(this._listenerInst){const t=this._listenerInst.GetWorldInfo();this._listenerX=t.GetX(),this._listenerY=t.GetY(),e.listenerPos=[this._listenerX,this._listenerY,this._listenerZ]}this.PostToDOM('tick',e)}rotatePtAround(t,n,r,s,a){if(0===r)return[t,n];const e=Math.sin(r),l=Math.cos(r);t-=s,n-=a;const _=t*e,d=n*e,i=t*l,u=n*l;return t=i-d,n=u+_,t+=s,n+=a,[t,n]}GetInstancePans(){return this._lastAIState.filter(e=>-1!==e.uid).map(e=>this._runtime.GetInstanceByUID(e.uid)).filter(e=>e).map(t=>{const a=t.GetWorldInfo(),n=a.GetLayer().GetAngle(),[r,i]=this.rotatePtAround(a.GetX(),a.GetY(),-n,this._listenerX,this._listenerY);return{uid:t.GetUID(),x:r,y:i,angle:a.GetAngle()-n}})}GetAnalyserData(e,t){for(const a of this._lastAnalysersData)if(a.index===t&&C3.equalsNoCase(a.tag,e))return a;return null}_IncrementEffectCount(e){this._effectCount.set(e,(this._effectCount.get(e)||0)+1)}_ShouldSave(e){return!e.hasOwnProperty('placeholder')&&3!==this._saveLoadMode&&!(e.isMusic&&1===this._saveLoadMode)&&!!(e.isMusic||2!==this._saveLoadMode)}SaveToJson(){return{isSilent:this._isSilent,masterVolume:this._masterVolume,listenerZ:this._listenerZ,listenerUid:this._listenerInst?this._listenerInst.GetUID():-1,playing:this._lastAIState.filter(e=>this._ShouldSave(e)),effects:this._lastFxState,analysers:this._lastAnalysersData}}LoadFromJson(e){this._isSilent=e.isSilent,this._masterVolume=e.masterVolume,this._listenerZ=e.listenerZ,this._listenerInst=null,this._loadListenerUid=e.listenerUid,this._lastAIState=e.playing,this._lastFxState=e.effects,this._lastAnalysersData=e.analysers}_OnAfterLoad(){if(-1!==this._loadListenerUid&&(this._listenerInst=this._runtime.GetInstanceByUID(this._loadListenerUid),this._loadListenerUid=-1,this._listenerInst)){const e=this._listenerInst.GetWorldInfo();this._listenerX=e.GetX(),this._listenerY=e.GetY()}for(const e of this._lastAIState){const t=this._runtime.GetAssetManager().GetProjectAudioFileUrl(e.bufferOriginalUrl);t?(e.bufferUrl=t.url,e.bufferType=t.type):e.bufferUrl=null}for(const e of Object.values(this._lastFxState))for(const t of e)if(t.hasOwnProperty('bufferOriginalUrl')){const e=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t.bufferOriginalUrl);e&&(t.bufferUrl=e.url,t.bufferType=e.type)}this.PostToDOM('load-state',{saveLoadMode:this._saveLoadMode,timeScale:this._runtime.GetTimeScale(),gameTime:this._runtime.GetGameTime(),listenerPos:[this._listenerX,this._listenerY,this._listenerZ],isSilent:this._isSilent,masterVolume:this._masterVolume,playing:this._lastAIState.filter(e=>null!==e.bufferUrl),effects:this._lastFxState})}GetDebuggerProperties(){var e=Math.round;const t=[];for(const[e,a]of Object.entries(this._lastFxState))t.push({name:'$'+e,value:a.map(e=>e.type).join(', ')});return[{title:'plugins.audio.debugger.tag-effects',properties:t},{title:'plugins.audio.debugger.currently-playing',properties:[{name:'plugins.audio.debugger.currently-playing-count',value:this._lastAIState.length},...this._lastAIState.map((t,a)=>({name:'$#'+a,value:`${t.bufferOriginalUrl} ("${t.tag}") ${e(10*t.playbackTime)/10} / ${e(10*t.duration)/10}`}))]}]}}}'use strict',C3.Plugins.Audio.Cnds={OnEnded(e){return C3.equalsNoCase(this._triggerTag,e)},OnFadeEnded(e){return C3.equalsNoCase(this._triggerTag,e)},PreloadsComplete(){return this._preloadCount===this._preloadTotal},AdvancedAudioSupported(){return!0},IsSilent(){return this._isSilent},IsAnyPlaying(){for(const e of this._lastAIState)if(e.isPlaying)return!0;return!1},IsTagPlaying(e){return this._IsTagPlaying(e)}},'use strict';{const t=['lowpass','highpass','bandpass','lowshelf','highshelf','peaking','notch','allpass'];C3.Plugins.Audio.Acts={async Play(t,a,n,r){if(!this._isSilent){const i=t[1],e=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t[0]);if(e){const s=this._nextPlayTime;this._nextPlayTime=0;const l=this._MaybeMarkAsPlaying(r.toLowerCase(),i,0!==a,this.DbToLinear(n));try{await this.PostToDOMAsync('play',{originalUrl:t[0],url:e.url,type:e.type,isMusic:i,tag:r.toLowerCase(),isLooping:0!==a,vol:this.DbToLinear(n),pos:0,off:s,trueClock:!!self.C3_GetAudioContextCurrentTime})}finally{l&&(l.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtPosition(t,a,r,n,s,e,_,d,u,i){if(!this._isSilent){const c=t[1],g=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t[0]);if(g){const l=this._nextPlayTime;this._nextPlayTime=0;const p=this._MaybeMarkAsPlaying(i.toLowerCase(),c,0!==a,this.DbToLinear(r));try{await this.PostToDOMAsync('play',{originalUrl:t[0],url:g.url,type:g.type,isMusic:c,tag:i.toLowerCase(),isLooping:0!==a,vol:this.DbToLinear(r),pos:0,off:l,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:n,y:s,angle:C3.toRadians(e),innerAngle:C3.toRadians(_),outerAngle:C3.toRadians(d),outerGain:this.DbToLinear(u)}})}finally{p&&(p.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtObject(t,a,r,n,s,e,_,u){if(!this._isSilent&&n){const c=n.GetFirstPicked();if(c&&c.GetWorldInfo()){const i=c.GetWorldInfo(),d=i.GetLayer().GetAngle(),[g,p]=this.rotatePtAround(i.GetX(),i.GetY(),-d,this._listenerX,this._listenerY),l=t[1],m=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t[0]);if(m){const n=this._nextPlayTime;this._nextPlayTime=0;const h=this._MaybeMarkAsPlaying(u.toLowerCase(),l,0!==a,this.DbToLinear(r));try{await this.PostToDOMAsync('play',{originalUrl:t[0],url:m.url,type:m.type,isMusic:l,tag:u.toLowerCase(),isLooping:0!==a,vol:this.DbToLinear(r),pos:0,off:n,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:g,y:p,angle:i.GetAngle()-d,innerAngle:C3.toRadians(s),outerAngle:C3.toRadians(e),outerGain:this.DbToLinear(_),uid:c.GetUID()}})}finally{h&&(h.placeholder=this._runtime.GetTickCountNoSave())}}}}},async PlayByName(t,n,r,i,s){if(!this._isSilent){const e=1===t,l=this._runtime.GetAssetManager().GetProjectAudioFileUrl(n);if(l){const t=this._nextPlayTime;this._nextPlayTime=0;const a=this._MaybeMarkAsPlaying(s.toLowerCase(),e,0!==r,this.DbToLinear(i));try{await this.PostToDOMAsync('play',{originalUrl:n,url:l.url,type:l.type,isMusic:e,tag:s.toLowerCase(),isLooping:0!==r,vol:this.DbToLinear(i),pos:0,off:t,trueClock:!!self.C3_GetAudioContextCurrentTime})}finally{a&&(a.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtPositionByName(t,n,r,s,_,e,d,u,c,i,g){if(!this._isSilent){const p=1===t,l=this._runtime.GetAssetManager().GetProjectAudioFileUrl(n);if(l){const t=this._nextPlayTime;this._nextPlayTime=0;const a=this._MaybeMarkAsPlaying(g.toLowerCase(),p,0!==r,this.DbToLinear(s));try{await this.PostToDOMAsync('play',{originalUrl:n,url:l.url,type:l.type,isMusic:p,tag:g.toLowerCase(),isLooping:0!==r,vol:this.DbToLinear(s),pos:0,off:t,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:_,y:e,angle:C3.toRadians(d),innerAngle:C3.toRadians(u),outerAngle:C3.toRadians(c),outerGain:this.DbToLinear(i)}})}finally{a&&(a.placeholder=this._runtime.GetTickCountNoSave())}}}},async PlayAtObjectByName(t,r,s,_,a,d,u,c,g){if(!this._isSilent&&!this._isSilent&&a){const i=a.GetFirstPicked();if(i&&i.GetWorldInfo()){const p=i.GetWorldInfo(),e=p.GetLayer().GetAngle(),[h,l]=this.rotatePtAround(p.GetX(),p.GetY(),-e,this._listenerX,this._listenerY),m=1===t,n=this._runtime.GetAssetManager().GetProjectAudioFileUrl(r);if(n){const t=this._nextPlayTime;this._nextPlayTime=0;const a=this._MaybeMarkAsPlaying(g.toLowerCase(),m,0!==s,this.DbToLinear(_));try{await this.PostToDOMAsync('play',{originalUrl:r,url:n.url,type:n.type,isMusic:m,tag:g.toLowerCase(),isLooping:0!==s,vol:this.DbToLinear(_),pos:0,off:t,trueClock:!!self.C3_GetAudioContextCurrentTime,panning:{x:h,y:l,angle:p.GetAngle()-e,innerAngle:C3.toRadians(d),outerAngle:C3.toRadians(u),outerGain:this.DbToLinear(c),uid:i.GetUID()}})}finally{a&&(a.placeholder=this._runtime.GetTickCountNoSave())}}}}},SetLooping(e,t){this.PostToDOM('set-looping',{tag:e.toLowerCase(),isLooping:0===t})},SetMuted(e,t){this.PostToDOM('set-muted',{tag:e.toLowerCase(),isMuted:0===t})},SetVolume(e,t){this.PostToDOM('set-volume',{tag:e.toLowerCase(),vol:this.DbToLinear(t)})},FadeVolume(e,t,a,n){this.PostToDOM('fade-volume',{tag:e.toLowerCase(),vol:this.DbToLinear(t),duration:a,stopOnEnd:0===n})},async Preload(e){const t=e[1],a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(e[0]);a&&(this._preloadTotal++,await this.PostToDOMAsync('preload',{originalUrl:e[0],url:a.url,type:a.type,isMusic:t}),this._preloadCount++)},async PreloadByName(e,t){const a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t);a&&(this._preloadTotal++,await this.PostToDOMAsync('preload',{originalUrl:t,url:a.url,type:a.type,isMusic:1===e}),this._preloadCount++)},SetPlaybackRate(e,t){this.PostToDOM('set-playback-rate',{tag:e.toLowerCase(),rate:Math.max(t,0)})},Stop(e){this.PostToDOM('stop',{tag:e.toLowerCase()})},StopAll(){this.PostToDOM('stop-all')},SetPaused(e,t){this.PostToDOM('set-paused',{tag:e.toLowerCase(),paused:0===t})},Seek(e,t){this.PostToDOM('seek',{tag:e.toLowerCase(),pos:t})},SetSilent(e){2===e&&(e=this._isSilent?1:0),e=0===e,this._isSilent===e||(this._isSilent=e,this.PostToDOM('set-silent',{isSilent:e}))},SetMasterVolume(e){const t=this.DbToLinear(e);this._masterVolume===t||(this._masterVolume=t,this.PostToDOM('set-master-volume',{vol:t}))},AddFilterEffect(a,n,r,s,e,l,_){a=a.toLowerCase();const d=t[n];this._IncrementEffectCount(a),this.PostToDOM('add-effect',{type:'filter',tag:a,params:[d,r,s,e,l,C3.clamp(_/100,0,1)]})},AddDelayEffect(e,t,n,r){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'delay',tag:e,params:[t,this.DbToLinear(n),C3.clamp(r/100,0,1)]})},AddFlangerEffect(t,n,r,i,s,e){t=t.toLowerCase(),this._IncrementEffectCount(t),this.PostToDOM('add-effect',{type:'flanger',tag:t,params:[n/1e3,r/1e3,i,s/100,C3.clamp(e/100,0,1)]})},AddPhaserEffect(t,n,r,i,s,e,l){t=t.toLowerCase(),this._IncrementEffectCount(t),this.PostToDOM('add-effect',{type:'phaser',tag:t,params:[n,r,i,s,e,C3.clamp(l/100,0,1)]})},AddConvolutionEffect(t,n,r,i){t=t.toLowerCase();const s=this._runtime.GetAssetManager().GetProjectAudioFileUrl(n[0]);s&&(this._IncrementEffectCount(t),this.PostToDOM('add-effect',{type:'convolution',tag:t,bufferOriginalUrl:n[0],bufferUrl:s.url,bufferType:s.type,params:[0===r,C3.clamp(i/100,0,1)]}))},AddGainEffect(e,t){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'gain',tag:e,params:[this.DbToLinear(t)]})},AddMuteEffect(e){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'gain',tag:e,params:[0]})},AddTremoloEffect(e,t,n){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'tremolo',tag:e,params:[t,C3.clamp(n/100,0,1)]})},AddRingModEffect(e,t,n){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'ringmod',tag:e,params:[t,C3.clamp(n/100,0,1)]})},AddDistortionEffect(t,n,r,i,s,e){t=t.toLowerCase(),this._IncrementEffectCount(t),this.PostToDOM('add-effect',{type:'distortion',tag:t,params:[this.DbToLinearNoCap(n),this.DbToLinearNoCap(r),i,this.DbToLinearNoCap(s),C3.clamp(e/100,0,1)]})},AddCompressorEffect(t,n,r,i,s,e){t=t.toLowerCase(),this._IncrementEffectCount(t),this.PostToDOM('add-effect',{type:'compressor',tag:t,params:[n,r,i,s/1e3,e/1e3]})},AddAnalyserEffect(e,t,n){e=e.toLowerCase(),this._IncrementEffectCount(e),this.PostToDOM('add-effect',{type:'analyser',tag:e,params:[t,n]})},RemoveEffects(e){e=e.toLowerCase(),this._effectCount.set(e,0),this.PostToDOM('remove-effects',{tag:e}),this._lastFxState={}},SetEffectParameter(t,a,n,r,i,e){this.PostToDOM('set-effect-param',{tag:t.toLowerCase(),index:Math.floor(a),param:n,value:r,ramp:i,time:e})},SetListenerObject(e){if(e){const t=e.GetFirstPicked();t&&t.GetWorldInfo()&&(this._listenerInst=t)}},SetListenerZ(e){this._listenerZ=e},ScheduleNextPlay(e){this._nextPlayTime=Math.max(e,0)},UnloadAudio(e){const t=e[1],a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(e[0]);a&&this.PostToDOM('unload',{url:a.url,type:a.type,isMusic:t})},UnloadAudioByName(e,t){const a=this._runtime.GetAssetManager().GetProjectAudioFileUrl(t);a&&this.PostToDOM('unload',{url:a.url,type:a.type,isMusic:1===e})},UnloadAll(){this.PostToDOM('unload-all')}}}'use strict',C3.Plugins.Audio.Exps={Duration(e){const t=this._GetFirstAudioStateByTag(e);return t?t.duration:0},PlaybackTime(e){const t=this._GetFirstAudioStateByTag(e);return t?t.playbackTime:0},PlaybackRate(e){const t=this._GetFirstAudioStateByTag(e);return t?t.playbackRate:0},Volume(e){const t=this._GetFirstAudioStateByTag(e);return t?this.LinearToDb(t.volume):0},MasterVolume(){return this.LinearToDb(this._masterVolume)},EffectCount(e){return this._effectCount.get(e.toLowerCase())||0},AnalyserFreqBinCount(e,t){const a=this.GetAnalyserData(e,Math.floor(t));return a?a.binCount:0},AnalyserFreqBinAt(t,a,n){var r=Math.floor;const i=this.GetAnalyserData(t,r(a));return i?(n=r(n),0>n||n>=i.binCount?0:i.freqBins[n]):0},AnalyserPeakLevel(e,t){const a=this.GetAnalyserData(e,Math.floor(t));return a?a.peak:0},AnalyserRMSLevel(e,t){const a=this.GetAnalyserData(e,Math.floor(t));return a?a.rms:0},SampleRate(){return this._sampleRate},CurrentTime(){return self.C3_GetAudioContextCurrentTime?self.C3_GetAudioContextCurrentTime():performance.now()/1e3}},'use strict',C3.Plugins.TiledBg=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Plugins.TiledBg.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}LoadTextures(e){return this.GetImageInfo().LoadStaticTexture(e,{sampling:this._runtime.GetSampling(),isTiled:!0})}ReleaseTextures(){this.GetImageInfo().ReleaseTexture()}},'use strict';{const t=C3.New(C3.Quad),a=C3.New(C3.Rect),n=C3.New(C3.Quad);C3.Plugins.TiledBg.Instance=class extends C3.SDKWorldInstanceBase{constructor(e,t){super(e),this._imageOffsetX=0,this._imageOffsetY=0,this._imageScaleX=1,this._imageScaleY=1,this._imageAngle=0,this._ownImageInfo=null,t&&(this.GetWorldInfo().SetVisible(!!t[0]),this._imageOffsetX=t[2],this._imageOffsetY=t[3],this._imageScaleX=t[4],this._imageScaleY=t[5],this._imageAngle=C3.toRadians(t[6]))}Release(){this._ReleaseOwnImage(),super.Release()}_ReleaseOwnImage(){this._ownImageInfo&&(this._ownImageInfo.Release(),this._ownImageInfo=null)}Draw(r){var s=Math.round;const e=this.GetCurrentImageInfo(),_=e.GetTexture();if(!_)return;const d=this.GetWorldInfo();let u=d.GetBoundingQuad();r.SetTexture(_);const c=e.GetWidth(),g=e.GetHeight(),p=this._imageOffsetX/c,l=this._imageOffsetY/g;if(a.set(0,0,d.GetWidth()/(c*this._imageScaleX),d.GetHeight()/(g*this._imageScaleY)),a.offset(-p,-l),this._runtime.IsPixelRoundingEnabled()){const e=s(d.GetX())-d.GetX(),a=s(d.GetY())-d.GetY();t.copy(u),t.offset(e,a),u=t}0===this._imageAngle?r.Quad3(u,a):(n.setFromRotatedRect(a,-this._imageAngle),r.Quad4(u,n))}GetCurrentImageInfo(){return this._ownImageInfo||this._objectClass.GetImageInfo()}_SetImageOffsetX(e){this._imageOffsetX===e||(this._imageOffsetX=e,this._runtime.UpdateRender())}_GetImageOffsetX(){return this._imageOffsetX}_SetImageOffsetY(e){this._imageOffsetY===e||(this._imageOffsetY=e,this._runtime.UpdateRender())}_GetImageOffsetY(){return this._imageOffsetY}_SetImageScaleX(e){this._imageScaleX===e||(this._imageScaleX=e,this._runtime.UpdateRender())}_GetImageScaleX(){return this._imageScaleX}_SetImageScaleY(e){this._imageScaleY===e||(this._imageScaleY=e,this._runtime.UpdateRender())}_GetImageScaleY(){return this._imageScaleY}_SetImageAngle(e){this._imageAngle===e||(this._imageAngle=e,this._runtime.UpdateRender())}_GetImageAngle(){return this._imageAngle}GetPropertyValueByIndex(e){return 2===e?this._GetImageOffsetX():3===e?this._GetImageOffsetY():4===e?this._GetImageScaleX():5===e?this._GetImageScaleY():6===e?this._GetImageAngle():void 0}SetPropertyValueByIndex(e,t){2===e?this._SetImageOffsetX(t):3===e?this._SetImageOffsetY(t):4===e?this._SetImageScaleX(t):5===e?this._SetImageScaleY(t):6===e?this._SetImageAngle(t):void 0}GetScriptInterfaceClass(){return ITiledBackgroundInstance}};const e=new WeakMap;self.ITiledBackgroundInstance=class extends IWorldInstance{constructor(){super(),e.set(this,IInstance._GetInitInst().GetSdkInstance())}set imageOffsetX(t){e.get(this)._SetImageOffsetX(t)}get imageOffsetX(){return e.get(this)._GetImageOffsetX()}set imageOffsetY(t){e.get(this)._SetImageOffsetY(t)}get imageOffsetY(){return e.get(this)._GetImageOffsetY()}set imageScaleX(t){e.get(this)._SetImageScaleX(t)}get imageScaleX(){return e.get(this)._GetImageScaleX()}set imageScaleY(t){e.get(this)._SetImageScaleY(t)}get imageScaleY(){return e.get(this)._GetImageScaleY()}set imageAngle(t){e.get(this)._SetImageAngle(t)}get imageAngle(){return e.get(this)._GetImageAngle()}set imageAngleDegrees(t){e.get(this)._SetImageAngle(C3.toRadians(t))}get imageAngleDegrees(){return C3.toDegrees(e.get(this)._GetImageAngle())}}}'use strict',C3.Plugins.TiledBg.Cnds={OnURLLoaded(){return!0}},'use strict',C3.Plugins.TiledBg.Acts={SetImageOffsetX(e){this._SetImageOffsetX(e)},SetImageOffsetY(e){this._SetImageOffsetY(e)},SetImageScaleX(e){this._SetImageScaleX(e/100)},SetImageScaleY(e){this._SetImageScaleY(e/100)},SetImageAngle(e){this._SetImageAngle(C3.toRadians(e))},SetEffect(e){this.GetWorldInfo().SetBlendMode(e),this._runtime.UpdateRender()},async LoadURL(e){if(!(this._ownImageInfo&&this._ownImageInfo.GetURL()===e)){const t=this._runtime,a=C3.New(C3.ImageInfo);if(await a.LoadDynamicAsset(t,e),this.WasReleased())return a.Release(),null;const n=await a.LoadStaticTexture(t.GetWebGLRenderer(),{sampling:this._runtime.GetSampling(),isTiled:!0});return n?this.WasReleased()?void a.Release():void(this._ReleaseOwnImage(),this._ownImageInfo=a,t.UpdateRender(),await this.TriggerAsync(C3.Plugins.TiledBg.Cnds.OnURLLoaded)):void 0}}},'use strict',C3.Plugins.TiledBg.Exps={ImageWidth(){return this.GetCurrentImageInfo().GetWidth()},ImageHeight(){return this.GetCurrentImageInfo().GetHeight()},ImageOffsetX(){return this._imageOffsetX},ImageOffsetY(){return this._imageOffsetY},ImageScaleX(){return 100*this._imageScaleX},ImageScaleY(){return 100*this._imageScaleY},ImageAngle(){return C3.toDegrees(this._imageAngle)}},'use strict',C3.Plugins.Spritefont2=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Plugins.Spritefont2.Type=class extends C3.SDKTypeBase{constructor(e){super(e),this._spriteFont=C3.New(SpriteFont)}Release(){super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}LoadTextures(e){return this.GetImageInfo().LoadStaticTexture(e,{sampling:this._runtime.GetSampling(),isTiled:!0})}ReleaseTextures(){this.GetImageInfo().ReleaseTexture()}GetSpriteFont(){return this._spriteFont}UpdateSettings(t,a,n,r){const i=this.GetImageInfo(),e=this._spriteFont;e.SetWidth(i.GetWidth()),e.SetHeight(i.GetHeight()),e.SetCharacterWidth(t),e.SetCharacterHeight(a),e.SetCharacterSet(n),e.SetSpacingData(r),e.UpdateCharacterMap()}},'use strict';{const t=['left','center','right'],a=['top','center','bottom'],n=C3.New(C3.Quad);C3.Plugins.Spritefont2.Instance=class extends C3.SDKWorldInstanceBase{constructor(e,t){super(e),this._text='',this._enableBBcode=!0,this._characterWidth=16,this._characterHeight=16,this._characterSet='';let n=[];if(this._characterScale=1,this._characterSpacing=0,this._lineHeight=0,this._horizontalAlign=0,this._verticalAlign=0,this._wrapByWord=!0,this._spriteFontText=null,this._typewriterStartTime=-1,this._typewriterEndTime=-1,this._typewriterLength=0,t){this._text=t[0],this._enableBBcode=t[1],this._characterWidth=t[2],this._characterHeight=t[3],this._characterSet=t[4],n=t[5],this._characterScale=t[6],this._characterSpacing=t[7],this._lineHeight=t[8],this._horizontalAlign=t[9],this._verticalAlign=t[10],this._wrapByWord=0===t[11];const e=this.GetWorldInfo();e.SetVisible(t[12])}this._sdkType.UpdateSettings(this._characterWidth,this._characterHeight,this._characterSet,n),this._spriteFontText=C3.New(SpriteFontText,this._sdkType.GetSpriteFont());const a=this.GetWorldInfo();this._spriteFontText.SetSize(a.GetWidth(),a.GetHeight()),this._UpdateSettings()}Release(){this._CancelTypewriter(),this._spriteFontText.Release(),this._spriteFontText=null,super.Release()}_UpdateSettings(){const e=this._spriteFontText;e&&(e.SetBBCodeEnabled(this._enableBBcode),e.SetText(this._text),e.SetWordWrapMode(this._wrapByWord?'word':'character'),e.SetHorizontalAlign(t[this._horizontalAlign]),e.SetVerticalAlign(a[this._verticalAlign]),e.SetScale(this._characterScale),e.SetSpacing(this._characterSpacing),e.SetLineHeight(this._lineHeight))}Draw(t){var r=Math.round;const a=this._objectClass.GetImageInfo(),i=a.GetTexture();if(!i)return;t.SetTexture(i);const e=this.GetWorldInfo();let s=e.GetBoundingQuad();const l=this._spriteFontText;if(this._runtime.IsPixelRoundingEnabled()){const t=r(e.GetX())-e.GetX(),a=r(e.GetY())-e.GetY();n.copy(s),n.offset(t,a),s=n}l.SetSize(e.GetWidth(),e.GetHeight()),l.GetSpriteFont().SetTexRect(a.GetTexRect()),l.SetColor(e.GetUnpremultipliedColor()),l.Draw(t,s.getTlx(),s.getTly(),e.GetAngle())}SaveToJson(){const e={t:this._text,ebbc:this._enableBBcode,csc:this._characterScale,csp:this._characterSpacing,lh:this._lineHeight,ha:this._horizontalAlign,va:this._verticalAlign,w:this._wrapByWord,cw:this._sdkType.GetSpriteFont().GetCharacterWidth(),ch:this._sdkType.GetSpriteFont().GetCharacterHeight(),cs:this._sdkType.GetSpriteFont().GetCharacterSet(),sd:this._sdkType.GetSpriteFont().GetSpacingData()};return-1!==this._typewriterEndTime&&(o.tw={st:this._typewriterStartTime,en:this._typewriterEndTime,l:this._typewriterLength}),e}LoadFromJson(e){if(this._CancelTypewriter(),this._text=e.t,this._enableBBcode=e.ebbc,this._characterScale=e.csc,this._characterSpacing=e.csp,this._lineHeight=e.lh,this._horizontalAlign=e.ha,this._verticalAlign=e.va,this._wrapByWord=e.w,e.hasOwnProperty('tw')){const t=e.tw;this._typewriterStartTime=t.st,this._typewriterEndTime=t.en,this._typewriterLength=e.l}const t=this._sdkType.GetSpriteFont();t.SetCharacterWidth(e.cw),t.SetCharacterHeight(e.ch),t.SetCharacterSet(e.cs),t.SetSpacingData(e.sd),this._UpdateSettings(),-1!==this._typewriterEndTime&&this._StartTicking()}GetPropertyValueByIndex(e){return 0===e?this._text:1===e?this._enableBBcode:2===e?this._sdkType.GetSpriteFont().GetCharacterWidth():3===e?this._sdkType.GetSpriteFont().GetCharacterHeight():4===e?this._sdkType.GetSpriteFont().GetCharacterSet():5===e?this._sdkType.GetSpriteFont().GetSpacingData():6===e?this._characterScale:7===e?this._characterSpacing:8===e?this._lineHeight:9===e?this._horizontalAlign:10===e?this._verticalAlign:11===e?this._wrapByWord?1:0:void 0}SetPropertyValueByIndex(e,t){switch(e){case 0:if(this._text===t)return;this._text=t,this._UpdateSettings();break;case 1:if(this._enableBBcode===!!t)return;this._enableBBcode=!!t,this._UpdateSettings();break;case 2:this._sdkType.GetSpriteFont().SetCharacterWidth(t);break;case 3:this._sdkType.GetSpriteFont().SetCharacterHeight(t);break;case 4:this._sdkType.GetSpriteFont().SetCharacterSet(t);break;case 5:this._sdkType.GetSpriteFont().SetSpacingData(t);break;case 6:if(this._characterScale===t)return;this._characterScale=t,this._UpdateSettings();break;case 7:if(this._characterSpacing===t)return;this._characterSpacing=t,this._UpdateSettings();break;case 8:if(this._lineHeight===t)return;this._lineHeight=t,this._UpdateSettings();break;case 9:if(this._horizontalAlign===t)return;this._horizontalAlign=t,this._UpdateSettings();break;case 10:if(this._verticalAlign===t)return;this._verticalAlign=t,this._UpdateSettings();break;case 11:if(this._wrapByWord===(0===t))return;this._wrapByWord=0===t,this._UpdateSettings();}}_SetText(e){this._text===e||(this._text=e,this._spriteFontText.SetText(e),this._runtime.UpdateRender())}GetText(){return this._text}_StartTypewriter(e,t){this._SetText(e),this._typewriterStartTime=this._runtime.GetGameTime(),this._typewriterEndTime=this._typewriterStartTime+t,this._typewriterLength=C3.BBString.StripAnyTags(e).length,this._spriteFontText.SetDrawMaxCharacterCount(0),this._StartTicking()}_CancelTypewriter(){this._typewriterStartTime=-1,this._typewriterEndTime=-1,this._typewriterLength=0,this._spriteFontText.SetDrawMaxCharacterCount(-1),this._StopTicking()}_FinishTypewriter(){-1===this._typewriterEndTime||(this._CancelTypewriter(),this.Trigger(C3.Plugins.Spritefont2.Cnds.OnTypewriterTextFinished),this._runtime.UpdateRender())}_SetScale(e){this._characterScale===e||(this._characterScale=e,this._spriteFontText.SetScale(this._characterScale),this._runtime.UpdateRender())}_GetScale(){return this._characterScale}_SetCharacterSpacing(e){this._characterSpacing===e||(this._characterSpacing=e,this._spriteFontText.SetSpacing(this._characterSpacing),this._runtime.UpdateRender())}_GetCharacterSpacing(){return this._characterSpacing}_SetLineHeight(e){this._lineHeight===e||(this._lineHeight=e,this._spriteFontText.SetLineHeight(this._lineHeight),this._runtime.UpdateRender())}_GetLineHeight(){return this._lineHeight}_SetHAlign(e){this._horizontalAlign===e||(this._horizontalAlign=e,this._UpdateSettings(),this._runtime.UpdateRender())}_GetHAlign(){return this._horizontalAlign}_SetVAlign(e){this._verticalAlign===e||(this._verticalAlign=e,this._UpdateSettings(),this._runtime.UpdateRender())}_GetVAlign(){return this._verticalAlign}_SetWrapByWord(e){e=!!e,this._wrapByWord===e||(this._wrapByWord=e,this._UpdateSettings(),this._runtime.UpdateRender())}_IsWrapByWord(){return this._wrapByWord}Tick(){const e=this._runtime.GetGameTime();if(e>=this._typewriterEndTime)this._CancelTypewriter(),this.Trigger(C3.Plugins.Spritefont2.Cnds.OnTypewriterTextFinished),this._runtime.UpdateRender();else{let t=C3.relerp(this._typewriterStartTime,this._typewriterEndTime,e,0,this._typewriterLength);t=Math.floor(t),t!==this._spriteFontText.GetDrawMaxCharacterCount()&&(this._spriteFontText.SetDrawMaxCharacterCount(t),this._runtime.UpdateRender())}}GetDebuggerProperties(){return[{title:'plugins.spritefont2.name',properties:[{name:'plugins.spritefont2.properties.text.name',value:this._text,onedit:e=>this._SetText(e)}]}]}GetScriptInterfaceClass(){return ISpriteFontInstance}};const r=new WeakMap,i=new Map([['left',0],['center',1],['right',2]]),e=new Map([['top',0],['center',1],['bottom',2]]),s=new Map([['word',!0],['character',!1]]);self.ISpriteFontInstance=class extends IWorldInstance{constructor(){super(),r.set(this,IInstance._GetInitInst().GetSdkInstance())}get text(){return r.get(this).GetText()}set text(e){const t=r.get(this);t._CancelTypewriter(),t._SetText(e)}typewriterText(e,t){const a=r.get(this);a._CancelTypewriter(),a._StartTypewriter(e,t)}typewriterFinish(){r.get(this)._FinishTypewriter()}set characterScale(e){r.get(this)._SetScale(e)}get characterScale(){return r.get(this)._GetScale()}set characterSpacing(e){r.get(this)._SetCharacterSpacing(e)}get characterSpacing(){return r.get(this)._GetCharacterSpacing()}set lineHeight(e){r.get(this)._SetLineHeight(e)}get lineHeight(){return r.get(this)._GetLineHeight()}set horizontalAlign(e){const t=i.get(e);if('undefined'==typeof t)throw new Error('invalid mode');r.get(this)._SetHAlign(t)}get horizontalAlign(){return t[r.get(this)._GetHAlign()]}set verticalAlign(t){const a=e.get(t);if('undefined'==typeof a)throw new Error('invalid mode');r.get(this)._SetVAlign(a)}get verticalAlign(){return a[r.get(this)._GetVAlign()]}set wordWrapMode(e){const t=s.get(e);if('undefined'==typeof t)throw new Error('invalid mode');r.get(this)._SetWrapByWord(t)}get wordWrapMode(){return r.get(this)._IsWrapByWord()?'word':'character'}}}'use strict',C3.Plugins.Spritefont2.Cnds={CompareText(e,t){return t?this._text===e:C3.equalsNoCase(this._text,e)},IsRunningTypewriterText(){return-1!==this._typewriterEndTime},OnTypewriterTextFinished(){return!0}},'use strict',C3.Plugins.Spritefont2.Acts={SetText(e){this._CancelTypewriter(),'number'==typeof e&&1e9>e&&(e=Math.round(1e10*e)/1e10),this._SetText(e.toString())},AppendText(e){this._CancelTypewriter(),'number'==typeof e&&1e9>e&&(e=Math.round(1e10*e)/1e10),e=e.toString(),e&&this._SetText(this._text+e)},TypewriterText(e,t){this._CancelTypewriter(),'number'==typeof e&&1e9>e&&(e=Math.round(1e10*e)/1e10),this._StartTypewriter(e.toString(),t)},TypewriterFinish(){this._FinishTypewriter()},SetScale(e){this._SetScale(e)},SetCharacterSpacing(e){this._SetCharacterSpacing(e)},SetLineHeight(e){this._SetLineHeight(e)},SetCharacterWidth(t,n){let r=!1;const i=this._sdkType.GetSpriteFont();for(const s of t)if(' '===s)i.SetSpaceWidth(n),r=!0;else{const e=i.GetCharacter(s);e&&(e.SetDisplayWidth(n),r=!0)}r&&i.SetCharacterWidthsChanged(),this._runtime.UpdateRender()},SetEffect(e){this.GetWorldInfo().SetBlendMode(e),this._runtime.UpdateRender()},SetHAlign(e){this._SetHAlign(e)},SetVAlign(e){this._SetVAlign(e)},SetWrapping(e){this._SetWrapByWord(0===e)}},'use strict',C3.Plugins.Spritefont2.Exps={CharacterWidth(e){const t=this._sdkType.GetSpriteFont().GetCharacter(e);return t?t.GetDisplayWidth():this._sdkType.GetSpriteFont().GetCharacterWidth()},CharacterHeight(){return this._characterHeight},CharacterScale(){return this._characterScale},CharacterSpacing(){return this._characterSpacing},LineHeight(){return this._lineHeight},Text(){return this._text},PlainText(){return this._enableBBcode?C3.BBString.StripAnyTags(this._text):this._text},TextWidth(){const e=this.GetWorldInfo();return this._spriteFontText.SetSize(e.GetWidth(),e.GetHeight()),this._spriteFontText.GetTextWidth()},TextHeight(){const e=this.GetWorldInfo();return this._spriteFontText.SetSize(e.GetWidth(),e.GetHeight()),this._spriteFontText.GetTextHeight()}},'use strict';{const e={width:256,height:256,characterWidth:16,characterHeight:16,characterSet:''};self.SpriteFont=class{constructor(t){if(t=Object.assign({},e,t),0>=t.width||0>=t.height||0>=t.characterWidth||0>=t.characterHeight)throw new Error('invalid size');this._width=t.width,this._height=t.height,this._characterWidth=t.characterWidth,this._characterHeight=t.characterHeight,this._characterSet=t.characterSet,this._spacingData='',this._spacingParsed=null,this._hasAnyCustomWidths=!1,this._spaceWidth=-1,this._texRect=new C3.Rect(0,0,1,1),this._characterMap=new Map,this._mapChanged=!0,this._allTexts=new Set}Release(){this._texRect=null,this._ReleaseCharacters(),this._characterMap=null,this._allTexts&&this._allTexts.clear(),this._allTexts=null}_ReleaseCharacters(){for(let e of this._characterMap.values())e.Release();this._characterMap.clear()}_AddSpriteFontText(e){this._allTexts.add(e)}_RemoveSpriteFontText(e){this._allTexts.delete(e)}UpdateCharacterMap(){var t=Math.floor;if(this._mapChanged){this._ReleaseCharacters();let a=[...this._characterSet],n=t(this._width/this._characterWidth),r=t(this._height/this._characterHeight);for(let i=0,e=a.length;i=n*r);++i){let e=i%n,r=t(i/n),s=a[i];this._characterMap.set(s,C3.New(SpriteFontCharacter,this,s,e*this._characterWidth,r*this._characterHeight))}if(this._hasAnyCustomWidths=!1,this._spaceWidth=-1,Array.isArray(this._spacingParsed))for(let e of this._spacingParsed){if(!Array.isArray(e))continue;if(2!==e.length)continue;let t=e[0],n=e[1];if('number'==typeof t&&isFinite(t)&&'string'==typeof n&&t!==this._characterWidth)for(let e of n){let a=this._characterMap.get(e);a?(a.SetDisplayWidth(t),this._hasAnyCustomWidths=!0):' '===e&&(this._spaceWidth=t,this._hasAnyCustomWidths=!0)}}this._mapChanged=!1;for(let e of this._allTexts)e._SetWrapChanged()}}SetCharacterWidthsChanged(){this._hasAnyCustomWidths=!0;for(const e of this._allTexts)e._SetWrapChanged()}GetCharacter(e){return this.UpdateCharacterMap(),this._characterMap.get(e)||null}HasAnyCustomWidths(){return this._hasAnyCustomWidths}SetWidth(e){if(e=Math.floor(e),0>=e)throw new Error('invalid size');this._width===e||(this._width=e,this._mapChanged=!0)}GetWidth(){return this._width}SetHeight(e){if(e=Math.floor(e),0>=e)throw new Error('invalid size');this._height===e||(this._height=e,this._mapChanged=!0)}GetHeight(){return this._height}SetTexRect(e){if(!this._texRect.equals(e)){this._texRect.copy(e);for(const e of this._characterMap.values())e._UpdateTexRect()}}GetTexRect(){return this._texRect}SetCharacterWidth(e){if(e=Math.floor(e),0>=e)throw new Error('invalid size');this._characterWidth===e||(this._characterWidth=e,this._mapChanged=!0)}GetCharacterWidth(){return this._characterWidth}SetCharacterHeight(e){if(e=Math.floor(e),0>=e)throw new Error('invalid size');this._characterHeight===e||(this._characterHeight=e,this._mapChanged=!0)}GetCharacterHeight(){return this._characterHeight}SetCharacterSet(e){this._characterSet===e||(this._characterSet=e,this._mapChanged=!0)}GetCharacterSet(){return this._characterSet}SetSpacingData(e){if(this._spacingData!==e&&(this._spacingData=e,this._mapChanged=!0,this._spacingParsed=null,this._spacingData.length))try{this._spacingParsed=JSON.parse(this._spacingData)}catch(e){this._spacingParsed=null}}GetSpacingData(){return this._spacingData}SetSpaceWidth(e){0>e&&(e=-1),this._spaceWidth===e||(this._spaceWidth=e,0<=this._spaceWidth&&(this._hasAnyCustomWidths=!0))}GetSpaceWidth(){return 0>this._spaceWidth?this._characterWidth:this._spaceWidth}}}'use strict',self.SpriteFontCharacter=class{constructor(t,a,n,r){let i=t.GetCharacterWidth(),e=t.GetCharacterHeight();this._spriteFont=t,this._char=a,this._pxRect=new C3.Rect(n,r,n+i,r+e),this._texRect=new C3.Rect,this._displayWidth=-1,this._UpdateTexRect()}Release(){this._spriteFont=null,this._pxRect=null,this._texRect=null}_UpdateTexRect(){let e=this._spriteFont.GetWidth(),t=this._spriteFont.GetHeight();this._texRect.copy(this._pxRect),this._texRect.divide(e,t),this._texRect.lerpInto(this._spriteFont.GetTexRect())}GetSpriteFont(){return this._spriteFont}GetChar(){return this._char}GetTexRect(){return this._texRect}SetDisplayWidth(e){this._displayWidth=e}GetDisplayWidth(){return 0>this._displayWidth?this._spriteFont.GetCharacterWidth():this._displayWidth}},'use strict';{const _=new C3.Rect,a=new C3.Quad,S=new C3.Color,t=new Set(['left','center','right']),n=new Set(['top','center','bottom']),e=new Set(['word','character']);self.SpriteFontText=class{constructor(e){this._spriteFont=e,this._cssWidth=0,this._cssHeight=0,this._text='',this._isBBcodeEnabled=!1,this._bbString=null,this._wrappedText=C3.New(C3.WordWrap),this._wrapMode='word',this._wrapChanged=!1,this._horizontalAlign='left',this._verticalAlign='top',this._scale=1,this._spacing=0,this._lineHeight=0,this._color=C3.New(C3.Color),this._drawMaxCharCount=-1,this._drawCharCount=0,this._measureTextCallback=(e,t)=>this._MeasureText(e,t),this._spriteFont._AddSpriteFontText(this)}Release(){this._spriteFont._RemoveSpriteFontText(this),this._color=null,this._measureTextCallback=null,this._wrappedText.Clear(),this._wrappedText=null,this._spriteFont=null,this._bbString=null}_MeasureText(t,a){const n=this._GetStyleTag(a,'scale'),r=n?parseFloat(n.param):this._scale,s=this._GetStyleTag(a,'scalex'),_=(s?parseFloat(s.param):1)*r,e=this._GetStyleTag(a,'scaley'),d=(e?parseFloat(e.param):1)*r,u=this._spriteFont.GetCharacterHeight()*d+this._lineHeight,i=this.GetSpriteFont(),g=i.GetCharacterWidth()*_,p=this.GetSpacing();if(i.HasAnyCustomWidths()){let n=0,r=0;for(const s of t){let t=g;const a=i.GetCharacter(s);a?t=a.GetDisplayWidth()*_:' '===s&&(t=i.GetSpaceWidth()*_),r+=t,++n}return{width:r+n*p,height:u}}else{const e=[...t].length,a=Math.max(e,0);return{width:g*e+a*p,height:u}}}_SetWrapChanged(){this._wrapChanged=!0,this._wrappedText.Clear()}SetSize(e,t){0>=e||0>=t||this._cssWidth===e&&this._cssHeight===t||(this._cssWidth!==e&&this._SetWrapChanged(),this._cssWidth=e,this._cssHeight=t)}SetDrawMaxCharacterCount(e){this._drawMaxCharCount=Math.floor(e)}GetDrawMaxCharacterCount(){return this._drawMaxCharCount}_GetStyleTag(e,t){for(let a=e.length-1;0<=a;--a){const n=e[a];if(n.tag===t)return n}return null}_HasStyleTag(e,t){return!!this._GetStyleTag(e,t)}_MaybeWrapText(){if(this._wrapChanged){this._isBBcodeEnabled&&(!this._bbString||this._bbString.toString()!==this._text)&&(this._bbString=new C3.BBString(this._text,{noEscape:!0}));const e=-this.GetSpacing();this._wrappedText.WordWrap(this._isBBcodeEnabled?this._bbString.toFragmentList():this._text,this._measureTextCallback,this._cssWidth,this._wrapMode,e),this._wrapChanged=!1}}Draw(t,a,n,r){var s=Math.floor;this._MaybeWrapText(),this._drawCharCount=0;let l=0;const _=this._lineHeight,u=C3.cloneArray(this._wrappedText.GetLines()),c=Math.sin(r),g=Math.cos(r),e=u.reduce((e,t)=>e+t.height,0)-_;'center'===this._verticalAlign?l=Math.max(s(this._cssHeight/2-e/2),0):'bottom'===this._verticalAlign&&(l=s(this._cssHeight-e));for(let s=0,e=u.length;sthis._cssHeight-(r-_))break;0<=l&&this._DrawLine(t,e,a,n,l,c,g),l+=r}}_DrawLine(t,a,n,r,s,e,l){var _=Math.floor,d=Math.max;const i=a.height;let u=0;'center'===this._horizontalAlign?u=d(_((this._cssWidth-a.width)/2),0):'right'===this._horizontalAlign&&(u=d(_(this._cssWidth-a.width),0));for(const _ of a.fragments)this._DrawFragment(t,_,n,r,u,s,e,l,i),u+=_.width}_DrawFragment(G,t,d,f,g,I,T,b,c){let e=t.text,l=t.width;const P=t.styles;if(-1!==this._drawMaxCharCount){if(this._drawCharCount>=this._drawMaxCharCount)return;this._drawCharCount+e.length>this._drawMaxCharCount&&(e=e.substr(0,this._drawMaxCharCount-this._drawCharCount),l=this._MeasureText(e,P).width),this._drawCharCount+=e.length}const R=this._GetStyleTag(P,'background');if(!(C3.IsStringAllWhitespace(e)&&!R||this._HasStyleTag(P,'hide'))){const n=this._GetStyleTag(P,'scale'),i=n?parseFloat(n.param):this._scale,p=this._GetStyleTag(P,'scalex'),r=(p?parseFloat(p.param):1)*i,s=this._GetStyleTag(P,'scaley'),t=(s?parseFloat(s.param):1)*i,u=this._spriteFont.GetCharacterHeight()*t,m=this._lineHeight;I+=c-m-u;const h=this._GetStyleTag(P,'offsetx');g+=h?parseFloat(h.param):0;const v=this._GetStyleTag(P,'offsety');I+=v?parseFloat(v.param):0,R&&(G.SetColorFillMode(),S.parseString(R.param),S.setA(1),G.SetColor(S),_.set(g,I,g+l,I+u),_.getRight()>this._cssWidth&&_.setRight(this._cssWidth),a.setFromRotatedRectPrecalc(_,T,b),a.offset(d,f),G.Quad(a),G.SetTextureFillMode());const y=this._GetStyleTag(P,'color');y?(S.parseString(y.param),S.setA(this._color.getA())):S.copy(this._color);const x=this._GetStyleTag(P,'opacity');x&&S.setA(S.getA()*parseFloat(x.param)/100),S.premultiply(),G.SetColor(S);const A=this._spriteFont.GetCharacterWidth()*r,D=Math.abs(this.GetSpacing());for(const t of e){const n=this._spriteFont.GetCharacter(t);if(n){const e=n.GetDisplayWidth()*r;if(g+e>this._cssWidth+D+1e-5)return;_.set(g,I,g+A,I+u),a.setFromRotatedRectPrecalc(_,T,b),a.offset(d,f),G.Quad3(a,n.GetTexRect()),g+=e+this._spacing}else g+=this._spriteFont.GetSpaceWidth()*r+this._spacing}}}GetSpriteFont(){return this._spriteFont}SetBBCodeEnabled(e){e=!!e,this._isBBcodeEnabled===e||(this._isBBcodeEnabled=e,this._SetWrapChanged())}IsBBCodeEnabled(){return this._isBBcodeEnabled}SetText(e){this._text===e||(this._text=e,this._SetWrapChanged())}SetWordWrapMode(t){if(!e.has(t))throw new Error('invalid word wrap mode');this._wrapMode===t||(this._wrapMode=t,this._SetWrapChanged())}SetHorizontalAlign(e){if(!t.has(e))throw new Error('invalid alignment');this._horizontalAlign=e}SetVerticalAlign(e){if(!n.has(e))throw new Error('invalid alignment');this._verticalAlign=e}SetScale(e){this._scale===e||(this._scale=e,this._SetWrapChanged())}GetScale(){return this._scale}SetSpacing(e){this._spacing===e||(this._spacing=e,this._SetWrapChanged())}GetSpacing(){return this._spacing}SetLineHeight(e){this._lineHeight=e,this._SetWrapChanged()}GetLineHeight(){return this._lineHeight}SetColor(e){this._color.equals(e)||this._color.copy(e)}GetColor(){return this._color}GetTextWidth(){return this._MaybeWrapText(),this._wrappedText.GetMaxLineWidth()}GetTextHeight(){this._MaybeWrapText();const e=this._spriteFont.GetCharacterHeight()*this._scale,t=this._lineHeight;return this._wrappedText.GetLineCount()*(e+t)-t}}}'use strict',C3.Plugins.DrawingCanvas=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Plugins.DrawingCanvas.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict';{const t=C3.New(C3.Color);let _=0;C3.Plugins.DrawingCanvas.Instance=class extends C3.SDKWorldInstanceBase{constructor(e,t){super(e),this._renderTarget=null,this._rcTex=C3.New(C3.Rect),this._multisampling=0,this._texRenderTarget=null,this._drawCommands=[],this._currentPoly=[],this._drawSrcBlend=0,this._drawDestBlend=0,this._drawScale=1,this._texScale=1,this._lineDashTexture=null,this._savedImageUrl='',this._snapshot=null,this._tempRect=C3.New(C3.Rect),this._tempQuad=C3.New(C3.Quad),t&&(this.GetWorldInfo().SetVisible(!!t[0]),this._multisampling=[0,2,4,8][t[2]]);const a=this._runtime.GetWebGLRenderer();this._SetDrawingBlendMode(0,a),2>a.GetWebGLVersionNumber()&&(this._multisampling=0),this._StartTicking2()}Release(){this._renderTarget&&(this._renderTarget.GetWebGLRenderer().DeleteRenderTarget(this._renderTarget),this._renderTarget=null),this._texRenderTarget&&(this._texRenderTarget.GetWebGLRenderer().DeleteRenderTarget(this._texRenderTarget),this._texRenderTarget=null),C3.clearArray(this._drawCommands),super.Release()}_ClonePoly(){return this._currentPoly.map(e=>e.slice(0))}_GetLineDashTexture(){return this._MaybeCreateLineDashTexture(),this._lineDashTexture}_MaybeCreateLineDashTexture(){if(!this._lineDashTexture){const e=C3.CreateCanvas(512,8),t=e.getContext('2d');t.clearRect(0,0,512,8),t.fillStyle='white',t.fillRect(0,0,256,8),this._lineDashTexture=this._runtime.GetWebGLRenderer().CreateStaticTexture(e,{isTiled:!0,sampling:this._runtime.GetSampling()})}}_SetDrawingBlendMode(e,t){this._drawSrcBlend=t.GetSrcBlendByIndex(e),this._drawDestBlend=t.GetDestBlendByIndex(e)}_ApplyCurrentDrawingBlendMode(e){e.SetBlend(this._drawSrcBlend,this._drawDestBlend)}_AddDrawCommand(e){this._drawCommands.push(e),this._runtime.UpdateRender()}_UpdateRenderTargetSize(e,t,a){this._renderTarget&&e.DeleteRenderTarget(this._renderTarget),this._renderTarget=e.CreateRenderTarget({width:t,height:a,sampling:this._runtime.GetSampling(),readback:0===this._multisampling,multisampling:this._multisampling}),0!(e instanceof C3.Plugins.DrawingCanvas.DrawCommand.SaveImage))}Tick2(){var y=Math.ceil,a=Math.round;const c=this._runtime.GetWebGLRenderer(),d=this.GetWorldInfo(),e=d.GetLayer(),f=this._tempQuad,g=this._tempRect;++_;const h=d.GetBoundingQuad(),[i,S]=e.LayerToDrawSurface(h.getTlx(),h.getTly()),[G,l]=e.LayerToDrawSurface(h.getBrx(),h.getBry()),m=i-a(i),n=S-a(S);g.set(i,S,G,l),g.offset(-m,-n),g.normalize(),f.setFromRect(g);let I=y(g.width()),T=y(g.height());this._rcTex.set(0,1,g.width()/I,1-g.height()/T);const b=c.GetMaxTextureSize(),r=Math.max(I,T);if(r>b?(this._texScale=b/r,I=a(I*this._texScale),T=a(T*this._texScale)):this._texScale=1,0>=I||0>=T)return void--_;this._drawScale=g.width()/d.GetWidth();const s=this._drawScale*this._texScale,t=!this._renderTarget||this._renderTarget.GetWidth()!==I||this._renderTarget.GetHeight()!==T;if(t&&this.Trigger(C3.Plugins.DrawingCanvas.Cnds.OnResolutionChanged),0t||0>a||t>=e||a>=r)return[0,0,0,0];const s=this._snapshot.data,i=4*(a*e)+4*t;let _=s[i]/255,u=s[i+1]/255,p=s[i+2]/255,m=s[i+3]/255;return 0!=m&&(_/=m,u/=m,p/=m),[100*_,100*u,100*p,100*m]}SetSnapshotPixel(a,n,r){var i=Math.floor;if(!this._snapshot)return[0,0,0,0];t.setFromRgbValue(r),t.premultiply();const e=this._snapshot.width,s=this._snapshot.height;if(a=i(a),n=s-1-i(n),!(0>a||0>n||a>=e||n>=s)){const r=this._snapshot.data,s=4*(n*e)+4*a;r[s]=i(255*t.getR()),r[s+1]=i(255*t.getG()),r[s+2]=i(255*t.getB()),r[s+3]=i(255*t.getA())}}GetImagePixelData(){return new Promise(t=>{this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.SaveImage(async a=>{const n=a.data.buffer,r=a.width,i=a.height,e=await this._runtime.AddJob('ProcessImageData',{buffer:n,width:r,height:i,unpremultiply:!0,flipY:!0},[n]);t(new ImageData(new Uint8ClampedArray(e),r,i))}))})}LoadImagePixelData(t,a){if(!this._renderTarget)throw new Error('canvas not yet ready');if(t.width!==this._renderTarget.GetWidth()||t.height!==this._renderTarget.GetHeight())throw new Error(`wrong size ImageData: expected ${this._renderTarget.GetWidth()} x ${this._renderTarget.GetHeight()}, got ${t.width} x ${t.height}`);C3.clearArray(this._drawCommands);const n=this._runtime.GetWebGLRenderer();if(this._texRenderTarget){const r=n.GetRenderTarget(),i=this._texRenderTarget.GetTexture();n.UpdateTexture(t,i,{premultiplyAlpha:!!a}),n.SetRenderTarget(this._renderTarget),n.CopyRenderTarget(this._texRenderTarget,'crop'),n.SetRenderTarget(r)}else{const e=this._renderTarget.GetTexture();n.UpdateTexture(t,e,{premultiplyAlpha:!!a})}this._runtime.UpdateRender()}GetScriptInterfaceClass(){return IDrawingCanvasInstance}};const e=new WeakMap;self.IDrawingCanvasInstance=class extends IWorldInstance{constructor(){super(),e.set(this,IInstance._GetInitInst().GetSdkInstance())}getImagePixelData(){return e.get(this).GetImagePixelData()}loadImagePixelData(t,a=!1){e.get(this).LoadImagePixelData(t,a)}get surfaceDeviceWidth(){const t=e.get(this)._GetRenderTarget();if(!t)throw new Error('canvas not yet ready');return t.GetWidth()}get surfaceDeviceHeight(){const t=e.get(this)._GetRenderTarget();if(!t)throw new Error('canvas not yet ready');return t.GetHeight()}}}'use strict',C3.Plugins.DrawingCanvas.Cnds={OnSavedImage(){return!0},OnSnapshot(){return!0},OnResolutionChanged(){return!0}},'use strict';{function t(e,t){return e.GetWorldInfo().GetZIndex()-t.GetWorldInfo().GetZIndex()}C3.Plugins.DrawingCanvas.Acts={SetEffect(e){this.GetWorldInfo().SetBlendMode(e),this._runtime.UpdateRender()},ClearCanvas(e){C3.clearArray(this._drawCommands),this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.ClearCanvas(e))},ClearRect(t,a,n,r,i){t===n||a===r||this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.ClearRect(t,a,n,r,i))},FillRect(t,a,n,r,i){t===n||a===r||this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.FillRect(t,a,n,r,i))},FillLinearGradient(t,a,n,r,i,e,s){t===n||a===r||this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.FillLinearGradient(t,a,n,r,i,e,s))},FillEllipse(t,a,n,r,i,e){0>=n||0>=r||this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.FillEllipse(t,a,n,r,i,0!==e))},OutlineEllipse(t,a,n,r,i,e,s){0>=n||0>=r||0>=e||this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.OutlineEllipse(t,a,n,r,i,e,0!==s))},OutlineRect(t,a,n,r,i,e){t===n||a===r||0>=e||this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.OutlineRect(t,a,n,r,i,e))},Line(t,a,n,r,i,e,s){if(!(t===n&&a===r||0>=e)){const l=0===s?'butt':'square';this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.Line(t,a,n,r,i,e,l))}},LineDashed(t,a,n,r,s,e,l,_){if(!(t===n&&a===r||0>=e||0>=l)){const d=0===_?'butt':'square',i=this._GetLineDashTexture();this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.LineDashed(t,a,n,r,s,e,l,i,d))}},AddPolyPoint(e,t){this._currentPoly.push([e,t])},ResetPoly(){C3.clearArray(this._currentPoly)},LinePoly(e,t,a){if(!(2>this._currentPoly.length||0>=t)){const n=0===a?'butt':'square';this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.LinePoly(this._ClonePoly(),e,t,n))}},LineDashedPoly(t,a,n,r){if(!(2>this._currentPoly.length||0>=a||0>=n)){const i=0===r?'butt':'square',e=this._GetLineDashTexture();this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.LineDashedPoly(this._ClonePoly(),t,a,n,e,i))}},FillPoly(e){3>this._currentPoly.length||this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.FillPoly(this._ClonePoly(),e))},SetDrawBlend(e){2<=e&&e++,this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.SetDrawBlend(e))},PasteObject(a,n){if(!a)return;const r=this.GetWorldInfo().GetBoundingBox(),i=a.GetCurrentSol().GetInstances().filter(e=>e.GetWorldInfo()&&r.intersectsRect(e.GetWorldInfo().GetBoundingBox()));0===i.length||(i.sort(t),this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.DrawInstances(i,0!==n)))},SaveImage(e,t){const n=0===e?'image/png':'image/jpeg';return t/=100,new Promise(r=>{this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.SaveImage(async s=>{const a=s.data.buffer,e=s.width,l=s.height,_=await this._runtime.AddJob('ProcessImageData',{buffer:a,width:e,height:l,unpremultiply:!0,flipY:!C3.Supports.ImageBitmapOptions},[a]);s=new ImageData(new Uint8ClampedArray(_),e,l);let u;if(C3.Supports.ImageBitmapOptions){const e=await createImageBitmap(s,{premultiplyAlpha:'none',imageOrientation:'flipY'});u=await C3.DrawableToBlob(e,n,t)}else u=await C3.ImageDataToBlob(s,n,t);this._savedImageUrl&&URL.revokeObjectURL(this._savedImageUrl),this._savedImageUrl=URL.createObjectURL(u),this.Trigger(C3.Plugins.DrawingCanvas.Cnds.OnSavedImage),r()}))})},SaveSnapshot(){return new Promise(e=>{this._AddDrawCommand(new C3.Plugins.DrawingCanvas.DrawCommand.SaveImage(t=>{this._snapshot=t,this.Trigger(C3.Plugins.DrawingCanvas.Cnds.OnSnapshot),e()}))})},ClearSnapshot(){this._snapshot=null},SnapshotSetPixel(e,t,a){this.SetSnapshotPixel(e,t,a)},LoadSnapshot(){this._snapshot&&this._renderTarget&&this._snapshot.width===this._renderTarget.GetWidth()&&this._snapshot.height===this._renderTarget.GetHeight()&&this.LoadImagePixelData(this._snapshot,!1)}}}'use strict',C3.Plugins.DrawingCanvas.Exps={SavedImageURL(){return this._savedImageUrl},SnapshotRedAt(e,t){return this.GetSnapshotPixel(e,t)[0]},SnapshotGreenAt(e,t){return this.GetSnapshotPixel(e,t)[1]},SnapshotBlueAt(e,t){return this.GetSnapshotPixel(e,t)[2]},SnapshotAlphaAt(e,t){return this.GetSnapshotPixel(e,t)[3]},SnapshotWidth(){return this._snapshot?this._snapshot.width:0},SnapshotHeight(){return this._snapshot?this._snapshot.height:0},PixelScale(){return 1/(this._drawScale*this._texScale)}},'use strict';{const e=C3.New(C3.Quad),t=C3.New(C3.Quad);C3.Plugins.DrawingCanvas.DrawCommand=class{constructor(){}Do(){throw new Error('required override')}};const a=C3.Plugins.DrawingCanvas.DrawCommand;a.SaveImage=class extends a{constructor(e){super(),this._callback=e}Do(e,t,a){let n=e.GetRenderTarget();if(0[e,e.SaveToJson('visual-state')]),this._includeFx=t}Do(t,a,s){const _=s.GetRuntime().GetCanvasManager(),u=s.GetWorldInfo().GetLayer(),e=u.GetViewport(),d=s.GetWorldInfo().GetBoundingBox(),y=s._GetRenderTarget(),h=0u._SetTransform(t,p,G)})&&u._SetTransform(t,p,G),s.SetBboxChanged(),s.GetBoundingBox()):u._DrawInstance(n,s,t),n.LoadFromJson(i,'visual-state')}_.SetDeviceTransformOffset(0,0),s._SetRenderTargetDeviceTransform(t),s._ApplyCurrentDrawingBlendMode(t)}}}'use strict',C3.Plugins.Arr=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Plugins.Arr.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict';{function t(e,t){const a=[];if('function'==typeof t)for(let n=0;ne.length)if('function'==typeof a)for(let n=e.length;nt(this._cy,()=>t(this._cz,0)))}Release(){this._arr=null,super.Release()}At(e,t,n){var r=Math.floor;return e=r(e),t=r(t),n=r(n),0<=e&&ea&&(a=0),0>r&&(r=0),0>i&&(i=0),this._cx!==a||this._cy!==r||this._cz!==i){this._cx=a,this._cy=r,this._cz=i;const e=this._arr;n(e,a,()=>t(r,()=>t(i,0)));for(let s=0;st(i,0));for(let t=0;tthis.SetSize(e,this._cy,this._cz)},{name:'plugins.arr.properties.height.name',value:this._cy,onedit:e=>this.SetSize(this._cx,e,this._cz)},{name:'plugins.arr.properties.depth.name',value:this._cz,onedit:e=>this.SetSize(this._cx,this._cy,e)},{name:'plugins.arr.properties.elements.name',value:this._cx*this._cy*this._cz}]}],t=[];if(1===this._cy&&1===this._cz)for(let e=0;ethis._arr[e][0][0]=t});else for(let e=0;en?1:0}}C3.Plugins.Arr.Acts={Clear(t){const a=this._cx,n=this._cy,r=this._cz,i=this._arr;for(let e=0;et(s,r));0===n?l.push(a):l.unshift(a),this._cx++}else if(1===a){for(let a=0;ae(t[0][0],n[0][0]));else if(1===t)for(let t=0;te(t[0],n[0]));else for(let t=0;tt)){const a=this._cx,r=this._cy,i=this._cz,e=this._arr;if(0===n){if(t>=a)return;e.splice(t,1),this._cx--}else if(1===n){if(t>=r)return;for(let n=0;n=i)return;for(let n=0;nr)return;const i=this._cx,e=this._cy,s=this._cz,l=this._arr;if(0===a){if(r>i)return;l.splice(r,0,t(e,()=>t(s,n))),this._cx++}else if(1===a){if(r>e)return;for(let e=0;es)return;for(let t=0;tthis._OnPointerMove(e.data)),C3.Disposable.From(t,'pointerdown',e=>this._OnPointerDown(e.data)),C3.Disposable.From(t,'pointerup',e=>this._OnPointerUp(e.data)),C3.Disposable.From(t,'dblclick',e=>this._OnDoubleClick(e.data)),C3.Disposable.From(t,'wheel',e=>this._OnMouseWheel(e.data)),C3.Disposable.From(t,'window-blur',()=>this._OnWindowBlur()))}Release(){super.Release()}_OnPointerDown(e){'mouse'!==e.pointerType||(this._mouseXcanvas=e.clientX-this._runtime.GetCanvasClientX(),this._mouseYcanvas=e.clientY-this._runtime.GetCanvasClientY(),this._CheckButtonChanges(e.lastButtons,e.buttons))}_OnPointerMove(e){'mouse'!==e.pointerType||(this._mouseXcanvas=e.clientX-this._runtime.GetCanvasClientX(),this._mouseYcanvas=e.clientY-this._runtime.GetCanvasClientY(),this._CheckButtonChanges(e.lastButtons,e.buttons))}_OnPointerUp(e){'mouse'!==e.pointerType||this._CheckButtonChanges(e.lastButtons,e.buttons)}_CheckButtonChanges(e,t){this._CheckButtonChange(e,t,1,0),this._CheckButtonChange(e,t,4,1),this._CheckButtonChange(e,t,2,2)}_CheckButtonChange(e,t,a,n){!(e&a)&&t&a?this._OnMouseDown(n):e&a&&!(t&a)&&this._OnMouseUp(n)}_OnMouseDown(e){this._buttonMap[e]=!0,this.Trigger(C3.Plugins.Mouse.Cnds.OnAnyClick),this._triggerButton=e,this._triggerType=0,this.Trigger(C3.Plugins.Mouse.Cnds.OnClick),this.Trigger(C3.Plugins.Mouse.Cnds.OnObjectClicked)}_OnMouseUp(e){this._buttonMap[e]&&(this._buttonMap[e]=!1,this._triggerButton=e,this.Trigger(C3.Plugins.Mouse.Cnds.OnRelease))}_OnDoubleClick(e){this._triggerButton=e.button,this._triggerType=1,this.Trigger(C3.Plugins.Mouse.Cnds.OnClick),this.Trigger(C3.Plugins.Mouse.Cnds.OnObjectClicked)}_OnMouseWheel(e){this._triggerDir=0>e.deltaY?1:0,this.Trigger(C3.Plugins.Mouse.Cnds.OnWheel)}_OnWindowBlur(){for(let e=0,t=this._buttonMap.length;e({name:'$'+e.GetName(),value:e.CanvasCssToLayer(this._mouseXcanvas,this._mouseYcanvas).join(', ')}))}]}},'use strict',C3.Plugins.Mouse.Cnds={OnClick(e,t){return this._triggerButton===e&&this._triggerType===t},OnAnyClick(){return!0},IsButtonDown(e){return this._buttonMap[e]},OnRelease(e){return this._triggerButton===e},IsOverObject(t){if(!this._IsMouseOverCanvas())return!1;const a=this._runtime.GetCurrentCondition(),n=a.IsInverted(),r=this._mouseXcanvas,i=this._mouseYcanvas;return C3.xor(this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(t,r,i,n),n)},OnObjectClicked(t,a,n){if(t!==this._triggerButton||a!==this._triggerType)return!1;if(!this._IsMouseOverCanvas())return!1;const r=this._mouseXcanvas,i=this._mouseYcanvas;return this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(n,r,i,!1)},OnWheel(e){return this._triggerDir===e}},'use strict';{let t=null;const e=['auto','pointer','text','crosshair','move','help','wait','none'];C3.Plugins.Mouse.Acts={SetCursor(a){const n=e[a];t===n||(t=n,this.PostToDOM('cursor',n))},SetCursorSprite(a){if(C3.Platform.IsMobile||!a)return;const n=a.GetFirstPicked();if(!n)return;const r=n.GetWorldInfo(),i=n.GetCurrentImageInfo();r&&i&&t!==i&&(t=i,i.ExtractImageToCanvas().then(e=>C3.CanvasToBlob(e)).then(e=>{var t=Math.round;const a=URL.createObjectURL(e),n=`url(${a}) ${t(r.GetOriginX()*i.GetWidth())} ${t(r.GetOriginY()*i.GetHeight())}, auto`;this.PostToDOM('cursor',''),this.PostToDOM('cursor',n)}))}}}'use strict',C3.Plugins.Mouse.Exps={X(e){return this.GetMousePositionForLayer(e,!0)},Y(e){return this.GetMousePositionForLayer(e,!1)},AbsoluteX(){return this._mouseXcanvas},AbsoluteY(){return this._mouseYcanvas}},'use strict',C3.Plugins.Particles=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Plugins.Particles.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){this.GetImageInfo().LoadAsset(this._runtime)}LoadTextures(e){return this.GetImageInfo().LoadStaticTexture(e,{sampling:this._runtime.GetSampling(),isTiled:!0})}ReleaseTextures(){this.GetImageInfo().ReleaseTexture()}},'use strict';{const t=C3.New(C3.Rect);C3.Plugins.Particles.Instance=class extends C3.SDKWorldInstanceBase{constructor(e,t){super(e),this._isFirstTick=!0;const a=C3.New(ParticleEngine);this._particleEngine=a,a.ononeshotfinish=()=>this._OnOneShotFinish(),this._spawnObjectClass=null,this._particleUpdateCallback=(t,a,n,r,i,e)=>this._OnParticleUpdate(t,a,n,r,i,e),this._particleDestroyCallback=e=>this._OnParticleDestroy(e),this._hasAnyDefaultParticle=!0,t&&(a.SetRate(t[0]),a.SetSprayCone(C3.toRadians(t[1])),a.SetSprayType(t[2]?'one-shot':'continuous-spray'),this._SetParticleObjectClass(this._runtime.GetObjectClassBySID(t[3])),a.SetInitSpeed(t[4]),a.SetInitSize(t[5]),a.SetInitOpacity(t[6]/100),a.SetGrowRate(t[7]),a.SetInitXRandom(t[8]),a.SetInitYRandom(t[9]),a.SetInitSpeedRandom(t[10]),a.SetInitSizeRandom(t[11]),a.SetGrowRandom(t[12]),a.SetAcceleration(t[13]),a.SetGravity(t[14]),a.SetLifeAngleRandom(t[15]),a.SetLifeSpeedRandom(t[16]),a.SetLifeOpacityRandom(t[17]),a.SetDestroyModeIndex(t[18]),a.SetTimeout(t[19])),this._UpdateEngineParameters(),this._spawnObjectClass&&(this._hasAnyDefaultParticle=!1),'one-shot'===a.GetSprayType()?a.CreateOneShotSpray():a.SetSpraying(!0);const n=this.GetWorldInfo();n.SetBboxChangeEventEnabled(!0),this._inst.Dispatcher().addEventListener('bboxchange',()=>{n.OverwriteBoundingBox(this._particleEngine.GetBoundingBox())}),this._StartTicking()}Release(){this._particleEngine.Release(),this._particleEngine=null,this._particleUpdateCallback=null,this._particleDestroyCallback=null,super.Release()}_SetParticleObjectClass(e){e===this.GetObjectClass()&&(e=null),this._spawnObjectClass=e,this._particleEngine.onparticlecreate=e?e=>this._OnParticleCreate(e):null,this._spawnObjectClass||(this._hasAnyDefaultParticle=!0)}_UpdateEngineParameters(){const e=this._particleEngine,t=this.GetWorldInfo();e.SetMasterOpacity(t.GetOpacity()),e.SetPixelRounding(this._runtime.IsPixelRoundingEnabled()),e.SetSpawnX(t.GetX()),e.SetSpawnY(t.GetY()),e.SetSpawnAngle(t.GetAngle())}_OnOneShotFinish(){this._runtime.DestroyInstance(this._inst)}Draw(a){if(this._hasAnyDefaultParticle){const n=this._objectClass.GetImageInfo(),r=n.GetTexture();if(r){const i=this.GetWorldInfo(),e=i.GetLayer(),s=t;e.GetViewportForZ(i.GetTotalZElevation(),s),a.SetTexture(r);const l=e.Get2DScaleFactorToZ(i.GetTotalZElevation());this._particleEngine.SetParticleScale(e.GetRenderScale()*l),this._particleEngine.Draw(a,n.GetTexRect(),s)}}}SaveToJson(){const e=this._particleEngine;return{r:e.GetRate(),sc:e.GetSprayCone(),st:e.GetSprayType(),isp:e.GetInitSpeed(),isz:e.GetInitSize(),io:e.GetInitOpacity(),gr:e.GetGrowRate(),xr:e.GetInitXRandom(),yr:e.GetInitYRandom(),spr:e.GetInitSpeedRandom(),szr:e.GetInitSizeRandom(),grnd:e.GetGrowRandom(),acc:e.GetAcceleration(),g:e.GetGravity(),lar:e.GetLifeAngleRandom(),lsr:e.GetLifeSpeedRandom(),lor:e.GetLifeOpacityRandom(),dm:e.GetDestroyModeIndex(),to:e.GetTimeout(),s:e.IsSpraying(),pcc:e._GetCreateCounter(),ft:this._isFirstTick,p:e.GetParticles().map(e=>e.toJSON())}}LoadFromJson(e){const t=this._particleEngine;t.SetRate(e.r),t.SetSprayCone(e.sc),t.SetSprayType(e.st),t.SetInitSpeed(e.isp),t.SetInitSize(e.isz),t.SetInitOpacity(e.io),t.SetGrowRate(e.gr),t.SetInitXRandom(e.xr),t.SetInitYRandom(e.yr),t.SetInitSpeedRandom(e.spr),t.SetInitSizeRandom(e.szr),t.SetGrowRandom(e.grnd),t.SetAcceleration(e.acc),t.SetGravity(e.g),t.SetLifeAngleRandom(e.lar),t.SetLifeSpeedRandom(e.lsr),t.SetLifeOpacityRandom(e.lor),t.SetDestroyModeIndex(e.dm),t.SetTimeout(e.to),t.SetSpraying(e.s),t._SetCreateCounter(e.pcc),this._isFirstTick=e.ft;const a=e.p;t.SetParticleCount(a.length);const n=t.GetParticles();for(let t=0,r=n.length;te.SetSpraying(t)},{name:'plugins.particles.properties.rate.name',value:e.GetRate(),onedit:t=>e.SetRate(t)},{name:'plugins.particles.properties.spray-cone.name',value:C3.toDegrees(e.GetSprayCone()),onedit:t=>e.SetSprayCone(C3.toRadians(t))},{name:'plugins.particles.properties.speed.name',value:e.GetInitSpeed(),onedit:t=>e.SetInitSpeed(t)},{name:'plugins.particles.properties.size.name',value:e.GetInitSize(),onedit:t=>e.SetInitSize(t)},{name:'plugins.particles.properties.opacity.name',value:e.GetInitOpacity(),onedit:t=>e.SetInitOpacity(t)},{name:'plugins.particles.properties.grow-rate.name',value:e.GetGrowRate(),onedit:t=>e.SetGrowRate(t)},{name:'plugins.particles.properties.x-randomiser.name',value:e.GetInitXRandom(),onedit:t=>e.SetInitXRandom(t)},{name:'plugins.particles.properties.y-randomiser.name',value:e.GetInitYRandom(),onedit:t=>e.SetInitYRandom(t)},{name:'plugins.particles.properties.initial-speed-randomiser.name',value:e.GetInitSpeedRandom(),onedit:t=>e.SetInitSpeedRandom(t)},{name:'plugins.particles.properties.size-randomiser.name',value:e.GetInitSizeRandom(),onedit:t=>e.SetInitSizeRandom(t)},{name:'plugins.particles.properties.grow-rate-randomiser.name',value:e.GetGrowRandom(),onedit:t=>e.SetGrowRandom(t)},{name:'plugins.particles.properties.acceleration.name',value:e.GetAcceleration(),onedit:t=>e.SetAcceleration(t)},{name:'plugins.particles.properties.gravity.name',value:e.GetGravity(),onedit:t=>e.SetGravity(t)},{name:'plugins.particles.properties.angle-randomiser.name',value:e.GetLifeAngleRandom(),onedit:t=>e.SetLifeAngleRandom(t)},{name:'plugins.particles.properties.life-speed-randomiser.name',value:e.GetLifeSpeedRandom(),onedit:t=>e.SetLifeSpeedRandom(t)},{name:'plugins.particles.properties.opacity-randomiser.name',value:e.GetLifeOpacityRandom(),onedit:t=>e.SetLifeOpacityRandom(t)},{name:'plugins.particles.properties.timeout.name',value:e.GetTimeout(),onedit:t=>e.SetTimeout(t)}]}]}}}'use strict',C3.Plugins.Particles.Cnds={IsSpraying(){return this._particleEngine.IsSpraying()}},'use strict',C3.Plugins.Particles.Acts={SetSpraying(e){this._particleEngine.SetSpraying(0!==e)},SetRate(e){this._particleEngine.SetRate(e),'one-shot'===this._particleEngine.GetSprayType()&&this._isFirstTick&&this._particleEngine.SetParticleCount(e)},SetParticleObject(e){this._SetParticleObjectClass(e)},UnsetParticleObject(){this._SetParticleObjectClass(null)},SetSprayCone(e){this._particleEngine.SetSprayCone(C3.toRadians(e))},SetInitSpeed(e){this._particleEngine.SetInitSpeed(e)},SetInitSize(e){this._particleEngine.SetInitSize(e)},SetInitOpacity(e){this._particleEngine.SetInitOpacity(e/100)},SetGrowRate(e){this._particleEngine.SetGrowRate(e)},SetXRandomiser(e){this._particleEngine.SetInitXRandom(e)},SetYRandomiser(e){this._particleEngine.SetInitYRandom(e)},SetSpeedRandomiser(e){this._particleEngine.SetInitSpeedRandom(e)},SetSizeRandomiser(e){this._particleEngine.SetInitSizeRandom(e)},SetGrowRateRandomiser(e){this._particleEngine.SetGrowRandom(e)},SetParticleAcc(e){this._particleEngine.SetAcceleration(e)},SetGravity(e){this._particleEngine.SetGravity(e)},SetAngleRandomiser(e){this._particleEngine.SetLifeAngleRandom(e)},SetLifeSpeedRandomiser(e){this._particleEngine.SetLifeSpeedRandom(e)},SetOpacityRandomiser(e){this._particleEngine.SetLifeOpacityRandom(e)},SetTimeout(e){this._particleEngine.SetTimeout(e)},SetEffect(e){this.GetWorldInfo().SetBlendMode(e),this._runtime.UpdateRender()}},'use strict',C3.Plugins.Particles.Exps={ParticleCount(){return this._particleEngine.GetParticleCount()},Rate(){return this._particleEngine.GetRate()},SprayCone(){return C3.toDegrees(this._particleEngine.GetSprayCone())},InitSpeed(){return this._particleEngine.GetInitSpeed()},InitSize(){return this._particleEngine.GetInitSize()},InitOpacity(){return 100*this._particleEngine.GetInitOpacity()},InitGrowRate(){return this._particleEngine.GetGrowRate()},XRandom(){return this._particleEngine.GetInitXRandom()},YRandom(){return this._particleEngine.GetInitYRandom()},InitSpeedRandom(){return this._particleEngine.GetInitSpeedRandom()},InitGrowRandom(){return this._particleEngine.GetGrowRandom()},ParticleAcceleration(){return this._particleEngine.GetAcceleration()},Gravity(){return this._particleEngine.GetGravity()},ParticleAngleRandom(){return this._particleEngine.GetLifeAngleRandom()},ParticleSpeedRandom(){return this._particleEngine.GetLifeSpeedRandom()},ParticleOpacityRandom(){return this._particleEngine.GetLifeOpacityRandom()},Timeout(){return this._particleEngine.GetTimeout()}},'use strict';{function t(e){return Math.random()*e-e/2}const n=new C3.Quad,a=new C3.Color,r=self.devicePixelRatio||1;let s=!1;self.Particle=class{constructor(e){this._engine=e,this._isActive=!1,this._x=0,this._y=0,this._speed=0,this._angle=0,this._opacity=1,this._lastOpacity=0,this._grow=0,this._size=0,this._halfSize=0,this._gs=0,this._age=0,this._bbox=new C3.Rect,this._userData=null,this._updateCallback=null,this._destroyCallback=null}SetEngine(e){this._engine=e}Init(e){this._isActive=!0,this._x=this._engine.GetSpawnX()+t(this._engine.GetInitXRandom()),this._y=this._engine.GetSpawnY()+t(this._engine.GetInitYRandom()),this._speed=this._engine.GetInitSpeed()+t(this._engine.GetInitSpeedRandom()),this._angle=this._engine.GetInitAngle()+t(this._engine.GetSprayCone()),this._opacity=this._engine.GetInitOpacity(),this._lastOpacity=this._opacity,this._size=this._engine.GetInitSize()+t(this._engine.GetInitSizeRandom()),this._halfSize=this._size/2,this._grow=this._engine.GetGrowRate()+t(this._engine.GetGrowRandom()),this._gs=0,this._age=0,this._UpdateBoundingBox(),e?!this._userData&&(this._userData=e(this)):(this._userData=null,this._updateCallback=null,this._destroyCallback=null)}SetUpdateCallback(e){this._updateCallback=e}SetDestroyCallback(e){this._destroyCallback=e}Destroy(){const e=this._destroyCallback;e&&e(this._userData),this._userData=null,this._updateCallback=null,this._destroyCallback=null}toJSON(){return[this._x,this._y,this._speed,this._angle,this._opacity,this._grow,this._size,this._gs,this._age]}setFromJSON(e){this._x=e[0],this._y=e[1],this._speed=e[2],this._angle=e[3],this._opacity=e[4],this._grow=e[5],this._size=e[6],this._gs=e[7],this._age=e[8],this._halfSize=this._size/2,this._UpdateBoundingBox()}Tick(r){const s=this._engine,_=this._speed*r,e=this._angle,d=Math.cos(e)*_,a=Math.sin(e)*_+this._gs*r;this._x+=d,this._y+=a;const u=this._grow*r;this._size+=u,this._halfSize=this._size/2,this._speed+=s.GetAcceleration()*r,this._gs+=s.GetGravity()*r,this._age+=r,this._UpdateBoundingBox();const c=s.GetLifeAngleRandom(),i=s.GetLifeSpeedRandom(),g=s.GetLifeOpacityRandom();let p=0;0!==c&&(p=t(c*r),this._angle+=p),0!==i&&(this._speed+=t(i*r)),0!==g&&(this._opacity=C3.clamp(this._opacity+t(g*r),0,1));const h=1<=this._size&&(2===s.GetDestroyModeIndex()?0=d)return;const u=this._size,i=u*_.GetParticleScale()*r;if(1>i)return;let c=this._x,g=this._y;_.IsPixelRounding()&&(c=0|c+.5,g=0|g+.5),i>e.GetMaxPointSize()||in.length){const t=e-n.length;for(let e=0;ethis._OnPermissionResult(e));const a=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(a,'pointerdown',e=>this._OnPointerDown(e.data)),C3.Disposable.From(a,'pointermove',e=>this._OnPointerMove(e.data)),C3.Disposable.From(a,'pointerup',e=>this._OnPointerUp(e.data,!1)),C3.Disposable.From(a,'pointercancel',e=>this._OnPointerUp(e.data,!0)),C3.Disposable.From(a,'deviceorientation',e=>this._OnDeviceOrientation(e.data)),C3.Disposable.From(a,'devicemotion',e=>this._OnDeviceMotion(e.data)),C3.Disposable.From(a,'tick2',()=>this._OnTick2()))}Release(){this._touches.clear(),super.Release()}_OnPointerDown(t){if('mouse'===t.pointerType)if(this._useMouseInput)this._isMouseDown=!0;else return;const a=t.pointerId;if(!this._touches.has(a)){const n=t.clientX-this._runtime.GetCanvasClientX(),r=t.clientY-this._runtime.GetCanvasClientY(),i=t.timeStamp,e=this._touches.size;this._triggerIndex=e,this._triggerId=a;const s=C3.New(C3.Plugins.Touch.TouchInfo);s.Init(i,n,r,a,e),this._touches.set(a,s),this.Trigger(C3.Plugins.Touch.Cnds.OnNthTouchStart),this.Trigger(C3.Plugins.Touch.Cnds.OnTouchStart),this._curTouchX=n,this._curTouchY=r,this.Trigger(C3.Plugins.Touch.Cnds.OnTouchObject)}}_OnPointerMove(t){if('mouse'!==t.pointerType||this._isMouseDown){const a=this._touches.get(t.pointerId);if(a){const n=t.timeStamp;if(!(2>n-a.GetTime())){const r=t.clientX-this._runtime.GetCanvasClientX(),i=t.clientY-this._runtime.GetCanvasClientY();a.Update(n,r,i,t.width,t.height,t.pressure)}}}}_OnPointerUp(t,a){if('mouse'===t.pointerType)if(this._isMouseDown)this._isMouseDown=!1;else return;const n=t.timeStamp,r=t.pointerId,i=this._touches.get(r);if(i){if(this._triggerIndex=i.GetStartIndex(),this._triggerId=i.GetId(),this.Trigger(C3.Plugins.Touch.Cnds.OnNthTouchEnd),this.Trigger(C3.Plugins.Touch.Cnds.OnTouchEnd),!a){const e=i.ShouldTriggerTap(n);'single-tap'===e?(this.Trigger(C3.Plugins.Touch.Cnds.OnTapGesture),this._curTouchX=i.GetX(),this._curTouchY=i.GetY(),this.Trigger(C3.Plugins.Touch.Cnds.OnTapGestureObject)):'double-tap'===e&&(this.Trigger(C3.Plugins.Touch.Cnds.OnDoubleTapGesture),this._curTouchX=i.GetX(),this._curTouchY=i.GetY(),this.Trigger(C3.Plugins.Touch.Cnds.OnDoubleTapGestureObject))}i.Release(),this._touches.delete(r)}}_RequestPermission(e){return this._PostToDOMMaybeSync('request-permission',{type:e}),new Promise((t,a)=>{this._permissionPromises.push({type:e,resolve:t,reject:a})})}_OnPermissionResult(e){const t=e.result,n=e.type;this._triggerPermission=n;const a=this._permissionPromises.filter(e=>e.type===n);for(const n of a)n.resolve(t?'granted':'denied');this._permissionPromises=this._permissionPromises.filter(e=>e.type!==n),t?(this.Trigger(C3.Plugins.Touch.Cnds.OnPermissionGranted),0===n?this._runtime.RequestDeviceOrientationEvent():this._runtime.RequestDeviceMotionEvent()):this.Trigger(C3.Plugins.Touch.Cnds.OnPermissionDenied)}_OnDeviceOrientation(e){this._orientAlpha=e.alpha,this._orientBeta=e.beta,this._orientGamma=e.gamma}_OnDeviceMotion(e){const t=e.acceleration;t&&(this._accX=t.x,this._accY=t.y,this._accZ=t.z);const a=e.accelerationIncludingGravity;a&&(this._accWithGX=a.x,this._accWithGY=a.y,this._accWithGZ=a.z)}_OnTick2(){const e=performance.now();let t=0;for(const a of this._touches.values())a.GetTime()<=e-50&&a._SetLastTime(e),a.ShouldTriggerHold(e)&&(this._triggerIndex=a.GetStartIndex(),this._triggerId=a.GetId(),this._getTouchIndex=t,this.Trigger(C3.Plugins.Touch.Cnds.OnHoldGesture),this._curTouchX=a.GetX(),this._curTouchY=a.GetY(),this.Trigger(C3.Plugins.Touch.Cnds.OnHoldGestureObject),this._getTouchIndex=0),++t}_GetTouchByIndex(e){e=Math.floor(e);for(const t of this._touches.values()){if(0===e)return t;--e}return null}_IsClientPosOnCanvas(e,t){return 0<=e&&0<=t&&e({name:'$'+e.GetId(),value:e.GetX()+', '+e.GetY()}))}]}},'use strict';{const e=[];C3.Plugins.Touch.Cnds={OnTouchStart(){return!0},OnTouchEnd(){return!0},IsInTouch(){return 0=e+1},OnHoldGesture(){return!0},OnTapGesture(){return!0},OnDoubleTapGesture(){return!0},OnHoldGestureObject(e){return!!e&&!!this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)&&this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(e,this._curTouchX,this._curTouchY,!1)},OnTapGestureObject(e){return!!e&&!!this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)&&this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(e,this._curTouchX,this._curTouchY,!1)},OnDoubleTapGestureObject(e){return!!e&&!!this._IsClientPosOnCanvas(this._curTouchX,this._curTouchY)&&this._runtime.GetCollisionEngine().TestAndSelectCanvasPointOverlap(e,this._curTouchX,this._curTouchY,!1)},OnPermissionGranted(e){return this._triggerPermission===e},OnPermissionDenied(e){return this._triggerPermission===e}}}'use strict',C3.Plugins.Touch.Acts={RequestPermission(e){this._RequestPermission(e)}},'use strict',C3.Plugins.Touch.Exps={TouchCount(){return this._touches.size},X(e){const t=this._GetTouchByIndex(this._getTouchIndex);return t?t.GetPositionForLayer(this._runtime.GetCurrentLayout(),e,!0):0},Y(e){const t=this._GetTouchByIndex(this._getTouchIndex);return t?t.GetPositionForLayer(this._runtime.GetCurrentLayout(),e,!1):0},XAt(e,t){const a=this._GetTouchByIndex(e);return a?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),t,!0):0},YAt(e,t){const a=this._GetTouchByIndex(e);return a?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),t,!1):0},XForID(e,t){const a=this._touches.get(e);return a?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),t,!0):0},YForID(e,t){const a=this._touches.get(e);return a?a.GetPositionForLayer(this._runtime.GetCurrentLayout(),t,!1):0},AbsoluteX(){const e=this._GetTouchByIndex(0);return e?e.GetX():0},AbsoluteY(){const e=this._GetTouchByIndex(0);return e?e.GetY():0},AbsoluteXAt(e){const t=this._GetTouchByIndex(e);return t?t.GetX():0},AbsoluteYAt(e){const t=this._GetTouchByIndex(e);return t?t.GetY():0},AbsoluteXForID(e){const t=this._touches.get(e);return t?t.GetX():0},AbsoluteYForID(e){const t=this._touches.get(e);return t?t.GetY():0},SpeedAt(e){const t=this._GetTouchByIndex(e);return t?t.GetSpeed():0},SpeedForID(e){const t=this._touches.get(e);return t?t.GetSpeed():0},AngleAt(e){const t=this._GetTouchByIndex(e);return t?C3.toDegrees(t.GetAngle()):0},AngleForID(e){const t=this._touches.get(e);return t?C3.toDegrees(t.GetAngle()):0},Alpha(){return this._runtime.RequestDeviceOrientationEvent(),this._orientAlpha},Beta(){return this._runtime.RequestDeviceOrientationEvent(),this._orientBeta},Gamma(){return this._runtime.RequestDeviceOrientationEvent(),this._orientGamma},AccelerationXWithG(){return this._runtime.RequestDeviceMotionEvent(),this._accWithGX},AccelerationYWithG(){return this._runtime.RequestDeviceMotionEvent(),this._accWithGY},AccelerationZWithG(){return this._runtime.RequestDeviceMotionEvent(),this._accWithGZ},AccelerationX(){return this._runtime.RequestDeviceMotionEvent(),this._accX},AccelerationY(){return this._runtime.RequestDeviceMotionEvent(),this._accY},AccelerationZ(){return this._runtime.RequestDeviceMotionEvent(),this._accZ},TouchIndex(){return this._triggerIndex},TouchID(){return this._triggerId},WidthForID(e){const t=this._touches.get(e);return t?t.GetWidth():0},HeightForID(e){const t=this._touches.get(e);return t?t.GetHeight():0},PressureForID(e){const t=this._touches.get(e);return t?t.GetPressure():0}},'use strict';{const t=15;let a=-1e3,n=-1e3,r=-1e4;C3.Plugins.Touch.TouchInfo=class extends C3.DefendedBase{constructor(){super(),this._pointerId=0,this._startIndex=0,this._startTime=0,this._time=0,this._lastTime=0,this._startX=0,this._startY=0,this._x=0,this._y=0,this._lastX=0,this._lastY=0,this._width=0,this._height=0,this._pressure=0,this._hasTriggeredHold=!1,this._isTooFarForHold=!1}Release(){}Init(t,a,n,r,i){this._pointerId=r,this._startIndex=i,this._time=t,this._lastTime=t,this._startTime=t,this._startX=a,this._startY=n,this._x=a,this._y=n,this._lastX=a,this._lastY=n}Update(a,n,r,i,e,s){this._lastTime=this._time,this._time=a,this._lastX=this._x,this._lastY=this._y,this._x=n,this._y=r,this._width=i,this._height=e,this._pressure=s,!this._isTooFarForHold&&C3.distanceTo(this._startX,this._startY,this._x,this._y)>=t&&(this._isTooFarForHold=!0)}GetId(){return this._pointerId}GetStartIndex(){return this._startIndex}GetTime(){return this._time}_SetLastTime(e){this._lastTime=e}GetX(){return this._x}GetY(){return this._y}GetSpeed(){const e=C3.distanceTo(this._x,this._y,this._lastX,this._lastY),t=(this._time-this._lastTime)/1e3;return 0=i-this._startTime&&!this._isTooFarForHold&&C3.distanceTo(this._startX,this._startY,this._x,this._y)=i-r&&25>C3.distanceTo(a,n,this._x,this._y)?(a=-1e3,n=-1e3,r=-1e4,'double-tap'):(a=this._x,n=this._y,r=i,'single-tap'):''}GetPositionForLayer(e,t,a){if('undefined'==typeof t){const t=e.GetLayerByIndex(0);return t.CanvasCssToLayer_DefaultTransform(this._x,this._y)[a?0:1]}else{const n=e.GetLayer(t);return n?n.CanvasCssToLayer(this._x,this._y)[a?0:1]:0}}}}'use strict',C3.Plugins.Browser=class extends C3.SDKPluginBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Plugins.Browser.Type=class extends C3.SDKTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Plugins.Browser.Instance=class extends C3.SDKInstanceBase{constructor(e){super(e,'browser'),this._initLocationStr='',this._isOnline=!1,this._referrer='',this._docTitle='',this._isCookieEnabled=!1,this._screenWidth=0,this._screenHeight=0,this._windowOuterWidth=0,this._windowOuterHeight=0,this._isScirraArcade=!1,this.AddDOMMessageHandler('online-state',e=>this._OnOnlineStateChanged(e)),this.AddDOMMessageHandler('backbutton',()=>this._OnBackButton()),this.AddDOMMessageHandler('sw-message',e=>this._OnSWMessage(e));const t=this.GetRuntime().Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(t,'afterfirstlayoutstart',()=>this._OnAfterFirstLayoutStart()),C3.Disposable.From(t,'window-resize',()=>this._OnWindowResize()),C3.Disposable.From(t,'suspend',()=>this._OnSuspend()),C3.Disposable.From(t,'resume',()=>this._OnResume())),this._runtime.AddLoadPromise(this.PostToDOMAsync('get-initial-state',{exportType:this._runtime.GetExportType()}).then(e=>{this._initLocationStr=e.location,this._isOnline=e.isOnline,this._referrer=e.referrer,this._docTitle=e.title,this._isCookieEnabled=e.isCookieEnabled,this._screenWidth=e.screenWidth,this._screenHeight=e.screenHeight,this._windowOuterWidth=e.windowOuterWidth,this._windowOuterHeight=e.windowOuterHeight,this._isScirraArcade=e.isScirraArcade}))}Release(){super.Release()}_OnAfterFirstLayoutStart(){this.PostToDOM('ready-for-sw-messages')}async _OnOnlineStateChanged(e){const t=!!e.isOnline;this._isOnline===t||(this._isOnline=t,this._isOnline?await this.TriggerAsync(C3.Plugins.Browser.Cnds.OnOnline):await this.TriggerAsync(C3.Plugins.Browser.Cnds.OnOffline))}async _OnWindowResize(){await this.TriggerAsync(C3.Plugins.Browser.Cnds.OnResize)}_OnSuspend(){this.Trigger(C3.Plugins.Browser.Cnds.OnPageHidden)}_OnResume(){this.Trigger(C3.Plugins.Browser.Cnds.OnPageVisible)}async _OnBackButton(){await this.TriggerAsync(C3.Plugins.Browser.Cnds.OnBackButton)}_OnSWMessage(e){const t=e.type;'downloading-update'===t?this.Trigger(C3.Plugins.Browser.Cnds.OnUpdateFound):'update-ready'===t||'update-pending'===t?this.Trigger(C3.Plugins.Browser.Cnds.OnUpdateReady):'offline-ready'===t&&this.Trigger(C3.Plugins.Browser.Cnds.OnOfflineReady)}GetDebuggerProperties(){return[{title:'plugins.browser.name',properties:[{name:'plugins.browser.debugger.user-agent',value:navigator.userAgent},{name:'plugins.browser.debugger.is-online',value:this._isOnline},{name:'plugins.browser.debugger.is-fullscreen',value:this._runtime.GetCanvasManager().IsDocumentFullscreen()}]}]}},'use strict',C3.Plugins.Browser.Cnds={IsOnline(){return this._isOnline},OnOnline(){return!0},OnOffline(){return!0},OnResize(){return!0},CookiesEnabled(){return this._isCookieEnabled},IsFullscreen(){return this._runtime.GetCanvasManager().IsDocumentFullscreen()},OnBackButton(){return!0},IsPortraitLandscape(e){const t=this._runtime.GetCanvasManager().GetLastWidth(),a=this._runtime.GetCanvasManager().GetLastHeight(),n=t<=a?0:1;return n===e},OnUpdateFound(){return!0},OnUpdateReady(){return!0},OnOfflineReady(){return!0},PageVisible(){return!this._runtime.IsSuspended()},OnPageHidden(){return!0},OnPageVisible(){return!0},HasJava(){return!1},IsDownloadingUpdate(){return!1},OnMenuButton(){return!1},OnSearchButton(){return!1},IsMetered(){return!1},IsCharging(){return!0},SupportsFullscreen(){return!0}},'use strict';{const ORIENTATIONS=['portrait','landscape','portrait-primary','portrait-secondary','landscape-primary','landscape-secondary'];C3.Plugins.Browser.Acts={Alert(e){this.PostToDOM('alert',{message:e.toString()})},Close(){this._isScirraArcade||(this._runtime.IsDebug()?C3Debugger.CloseWindow():this.PostToDOM('close'))},Focus(){this.PostToDOM('set-focus',{isFocus:!0})},Blur(){this.PostToDOM('set-focus',{isFocus:!1})},GoBack(){this._isScirraArcade||this.PostToDOM('navigate',{type:'back'})},GoForward(){this._isScirraArcade||this.PostToDOM('navigate',{type:'forward'})},GoHome(){this._isScirraArcade||this.PostToDOM('navigate',{type:'home'})},Reload(){this._isScirraArcade||this.PostToDOM('navigate',{type:'reload'})},GoToURL(e,t){this._PostToDOMMaybeSync('navigate',{type:'url',url:e,target:t,exportType:this._runtime.GetExportType()})},GoToURLWindow(e,t){this._PostToDOMMaybeSync('navigate',{type:'new-window',url:e,tag:t,exportType:this._runtime.GetExportType()})},RequestFullScreen(e,t){2<=e&&(e+=1),6===e&&(e=2),1===e&&(e=0);const n=C3.CanvasManager._FullscreenModeNumberToString(e);this._runtime.GetCanvasManager().SetDocumentFullscreenMode(n),this._PostToDOMMaybeSync('request-fullscreen',{navUI:t})},CancelFullScreen(){this._PostToDOMMaybeSync('exit-fullscreen')},Vibrate(e){const t=e.split(',');for(let a=0,n=t.length;ae||e>=ORIENTATIONS.length)){const t=ORIENTATIONS[e];this._PostToDOMMaybeSync('lock-orientation',{orientation:t})}},UnlockOrientation(){this._PostToDOMMaybeSync('unlock-orientation')},LoadStyleSheet(e){this._runtime.GetAssetManager().LoadStyleSheet(e)}}}'use strict',C3.Plugins.Browser.Exps={URL(){return this._runtime.IsInWorker()?this._initLocationStr:location.toString()},Protocol(){return this._runtime.IsInWorker()?new URL(this._initLocationStr).protocol:location.protocol},Domain(){return this._runtime.IsInWorker()?new URL(this._initLocationStr).hostname:location.hostname},PathName(){return this._runtime.IsInWorker()?new URL(this._initLocationStr).pathname:location.pathname},Hash(){return this._runtime.IsInWorker()?new URL(this._initLocationStr).hash:location.hash},QueryString(){return this._runtime.IsInWorker()?new URL(this._initLocationStr).search:location.search},QueryParam(e){const t=this._runtime.IsInWorker()?new URL(this._initLocationStr).search:location.search,a=RegExp('[?&]'+e+'=([^&]*)').exec(t);return a?decodeURIComponent(a[1].replace(/\+/g,' ')):''},Referrer(){return this._referrer},Title(){return this._docTitle},Language(){return navigator.language},Platform(){return navigator.platform},UserAgent(){return navigator.userAgent},ExecJS(jsStr){let result=0;try{result=eval(jsStr)}catch(e){console.error('Error executing JavaScript: ',e)}return'number'==typeof result||'string'==typeof result?result:'boolean'==typeof result?result?1:0:0},Name(){return navigator.appName},Version(){return navigator.appVersion},Product(){return navigator.product},Vendor(){return navigator.vendor},BatteryLevel(){return 1},BatteryTimeLeft(){return 1/0},Bandwidth(){const e=navigator.connection;return e?e.downlink||e.downlinkMax||e.bandwidth||1/0:1/0},ConnectionType(){const e=navigator.connection;return e?e.type||'unknown':'unknown'},DevicePixelRatio(){return self.devicePixelRatio},ScreenWidth(){return this._screenWidth},ScreenHeight(){return this._screenHeight},WindowInnerWidth(){return this._runtime.GetCanvasManager().GetLastWidth()},WindowInnerHeight(){return this._runtime.GetCanvasManager().GetLastHeight()},WindowOuterWidth(){return this._windowOuterWidth},WindowOuterHeight(){return this._windowOuterWidth}},'use strict';{let t=null,n=null,r=[],s=null;const _='Physics_DisabledCollisions';C3.Behaviors.Physics=class extends C3.SDKBehaviorBase{constructor(e){super(e),this._world=null,this._worldG=10,this._worldScale=.02,this._lastUpdateTick=-1,this._steppingMode=0,this._velocityIterations=8,this._positionIterations=3,this._allCollisionsEnabled=!0,this._runtime.AddLoadPromise(this._LoadBox2DWasm())}async _LoadBox2DWasm(){const e=await this._runtime.GetAssetManager().GetProjectFileUrl('box2d.wasm');await new Promise(t=>{self.Box2DWasmModule({wasmBinaryFile:e}).then(e=>{s=e,this._InitBox2DWorld(),t()})})}_InitBox2DWorld(){const r=this._runtime.GetCollisionEngine();t=C3.Behaviors.Physics.GetVec2(0,0),n=C3.Behaviors.Physics.GetVec2(0,0),this._world=new s.b2World(C3.Behaviors.Physics.GetTempVec2A(0,this._worldG),!0);const e=new s.JSContactListener;e.BeginContact=t=>{const a=s.wrapPointer(t,s.b2Contact),n=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(a.GetFixtureA().GetBody()),e=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(a.GetFixtureB().GetBody());r.RegisterCollision(n.GetObjectInstance(),e.GetObjectInstance())},e.EndContact=()=>{},e.PreSolve=()=>{},e.PostSolve=()=>{},this._world.SetContactListener(e);const a=new s.JSContactFilter;a.ShouldCollide=(e,t)=>{if(this._allCollisionsEnabled)return!0;const a=s.wrapPointer(e,s.b2Fixture),r=s.wrapPointer(t,s.b2Fixture),d=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(a.GetBody()),u=C3.Behaviors.Physics.Instance.LookupBehInstFromBody(r.GetBody()),c=d.GetObjectInstance().GetObjectClass(),i=u.GetObjectInstance().GetObjectClass(),g=c.GetSID(),p=i.GetSID(),l=c.GetSavedDataMap().get(_);if(l&&l.has(p))return!1;const m=i.GetSavedDataMap().get(_);return!(m&&m.has(g))},this._world.SetContactFilter(a)}Release(){super.Release()}GetBox2D(){return s}GetWorld(){return this._world}GetWorldScale(){return this._worldScale}GetSteppingMode(){return this._steppingMode}SetSteppingMode(e){this._steppingMode=e}SetLastUpdateTick(e){this._lastUpdateTick=e}GetLastUpdateTick(){return this._lastUpdateTick}GetVelocityIterations(){return this._velocityIterations}GetPositionIterations(){return this._positionIterations}SetIterations(e,t){this._velocityIterations=e,this._positionIterations=t}GetGravity(){return this._worldG}SetGravity(e){e===this._worldG||(this._world.SetGravity(C3.Behaviors.Physics.GetTempVec2A(0,e)),this._worldG=e,this._WakeUpAllPhysicsBodies())}_WakeUpAllPhysicsBodies(){for(const e of this.GetInstances()){const t=C3.Behaviors.Physics.Instance.LookupBehInstFromInst(e);if(!t)continue;const a=t.GetBody();a&&a.SetAwake(!0)}}DisableShouldCollideFastPath(){this._allCollisionsEnabled=!1}static GetPhysicsCollisionKey(){return _}static GetVec2(e,t){if(r.length){const a=r.pop();return a.set_x(e),a.set_y(t),a}else{const a=s.b2Vec2;return new a(e,t)}}static FreeVec2(e){r.push(e)}static GetTempVec2A(e,a){return t.set_x(e),t.set_y(a),t}static GetTempVec2B(e,t){return n.set_x(e),n.set_y(t),n}static CreatePolygonShape(t){const a=s.b2PolygonShape,n=new a,r=s._malloc(8*t.length);let e=0;for(let a=0;a>2]=t[a].get_x(),s.HEAPF32[r+(e+4)>>2]=t[a].get_y(),e+=8;const i=s.wrapPointer(r,s.b2Vec2);return n.Set(i,t.length),s._free(r),n}}}'use strict',C3.Behaviors.Physics.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict';{const t=new WeakMap,n=new WeakMap,r=new WeakMap;C3.Behaviors.Physics.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(t,a){super(t);const r=this.GetBehavior(),i=this.GetWorldInfo();this._box2d=r.GetBox2D(),this._world=r.GetWorld(),this._worldScale=r.GetWorldScale(),this._isImmovable=!1,this._collisionMask=0,this._preventRotation=!1,this._density=1,this._friction=.5,this._restitution=.2,this._linearDamping=0,this._angularDamping=.01,this._isBullet=!1,this._isEnabled=!0,this._body=null,this._fixtures=[],this._myJoints=[],this._myCreatedJoints=[],this._joiningMe=new Set,this._lastKnownX=i.GetX(),this._lastKnownY=i.GetY(),this._lastKnownAngle=i.GetAngle(),this._lastWidth=0,this._lastHeight=0,this._lastTickOverride=!1,this._recreateBody=!1,this._lastImageInfo=null,a&&(this._isImmovable=!!a[0],this._collisionMask=a[1],this._preventRotation=!!a[2],this._density=a[3],this._friction=a[4],this._restitution=a[5],this._linearDamping=a[6],this._angularDamping=a[7],this._isBullet=!!a[8],this._isEnabled=!!a[9]);const e=this._runtime.Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(e,'instancedestroy',e=>this._OnInstanceDestroyed(e.instance)),C3.Disposable.From(e,'afterload',()=>this._OnAfterLoad())),n.set(this._inst,this),this._isEnabled&&this._StartTicking()}PostCreate(){this._CreateBody(),this._lastImageInfo=this._inst.GetCurrentImageInfo()}Release(){this._DestroyMyJoints(),C3.clearArray(this._myCreatedJoints),this._joiningMe.clear(),this._body&&(this._DestroyFixtures(),this._world.DestroyBody(this._body),this._body=null),super.Release()}_CreateFixture(e){if(this._body){const t=this._body.CreateFixture(e);return this._fixtures.push(t),t}}_DestroyFixtures(){if(this._body){for(const e of this._fixtures)this._body.DestroyFixture(e);C3.clearArray(this._fixtures)}}_Destroy(e){this._box2d.destroy(e)}_CreateBody(){var a=Math.max,n=Math.abs;if(!this._isEnabled)return;const r=this._box2d.b2FixtureDef,s=this._box2d.b2BodyDef,e=this.GetWorldInfo();if(!this._body){const a=new s;a.set_type(this._isImmovable?0:2);const n=e.GetBoundingQuad();a.set_position(C3.Behaviors.Physics.GetTempVec2B(n.midX()*this._worldScale,n.midY()*this._worldScale)),a.set_angle(e.GetAngle()),a.set_fixedRotation(this._preventRotation),a.set_linearDamping(this._linearDamping),a.set_angularDamping(this._angularDamping),a.set_bullet(this._isBullet),this._body=this._world.CreateBody(a),this._Destroy(a),t.set(this._body,this)}this._DestroyFixtures();const l=new r;l.set_density(this._density),l.set_friction(this._friction),l.set_restitution(this._restitution);const _=e.HasOwnCollisionPoly();let d=this._collisionMask;_||this._inst.HasTilemap()||0!==d||(d=1);const u=a(n(e.GetWidth()),1),c=a(n(e.GetHeight()),1);0===d?this._inst.HasTilemap()?this._CreateTilemapFixtures(l):this._CreatePolygonFixture(l,u,c):1===d?this._CreateBoundingBoxFixture(l,u,c):this._CreateCircleFixture(l,u,c),this._lastWidth=e.GetWidth(),this._lastHeight=e.GetHeight(),this._Destroy(l)}_CreateBoundingBoxFixture(t,a,n){const r=this._box2d.b2PolygonShape,i=new r;i.SetAsBox(.5*(a*this._worldScale),.5*(n*this._worldScale)),t.set_shape(i),this._CreateFixture(t),this._Destroy(i)}_CreateCircleFixture(t,a,n){const r=this._box2d.b2CircleShape,i=new r;i.set_m_radius(.5*(Math.min(a,n)*this._worldScale)),t.set_shape(i),this._CreateFixture(t),this._Destroy(i)}_CreatePolygonFixture(t,a,r){const s=this.GetWorldInfo(),_=0>s.GetWidth(),e=0>s.GetHeight(),d=this._worldScale,u=s.GetAngle();0!==u&&(s.SetAngle(0),s.SetBboxChanged());const c=s.GetBoundingQuad(),i=c.midX()-s.GetX(),g=c.midY()-s.GetY();0!==u&&(s.SetAngle(u),s.SetBboxChanged());const h=s.GetCustomTransformedCollisionPoly(_?-a:a,e?-r:r,0),l=h.pointsArr(),m=l.length/2,n=[];for(let e=0;e1/30&&(n=1/30));const r=e.GetTickCountNoSave();if(r>t.GetLastUpdateTick()&&0this._SetEnabled(e)},{name:'behaviors.physics.properties.immovable.name',value:this._isImmovable,onedit:t=>this.CallAction(e.SetImmovable,t)},{name:'behaviors.physics.properties.density.name',value:this._density,onedit:t=>this.CallAction(e.SetDensity,t)},{name:'behaviors.physics.properties.friction.name',value:this._friction,onedit:t=>this.CallAction(e.SetFriction,t)},{name:'behaviors.physics.properties.elasticity.name',value:this._restitution,onedit:t=>this.CallAction(e.SetElasticity,t)},{name:'behaviors.physics.properties.linear-damping.name',value:this._linearDamping,onedit:t=>this.CallAction(e.SetLinearDamping,t)},{name:'behaviors.physics.properties.angular-damping.name',value:this._angularDamping,onedit:t=>this.CallAction(e.SetAngularDamping,t)}];return this._isEnabled&&(a.push({name:'behaviors.physics.debugger.is-sleeping',value:!this._body.IsAwake()}),a.push({name:'behaviors.physics.debugger.velocity-x',value:this.CallExpression(t.VelocityX),onedit:a=>this.CallAction(e.SetVelocity,a,this.CallExpression(t.VelocityY))}),a.push({name:'behaviors.physics.debugger.velocity-y',value:this.CallExpression(t.VelocityY),onedit:a=>this.CallAction(e.SetVelocity,this.CallExpression(t.VelocityX),a)}),a.push({name:'behaviors.physics.debugger.angular-velocity',value:this.CallExpression(t.AngularVelocity),onedit:t=>this.CallAction(e.SetAngularVelocity,t)}),a.push({name:'behaviors.physics.debugger.mass',value:this._body.GetMass()/this._worldScale})),[{title:'$'+this.GetBehaviorType().GetName(),properties:a}]}}}'use strict',C3.Behaviors.Physics.Cnds={IsSleeping(){return!!this._isEnabled&&!this._body.IsAwake()},CompareVelocity(t,a,n){if(!this._isEnabled)return!1;const r=this._worldScale,i=this._body.GetLinearVelocity();let e=0;if(0===t)e=i.get_x()/r;else if(1===t)e=i.get_y()/r;else{const t=i.get_x()/r,a=i.get_y()/r;e=Math.hypot(t,a)}return C3.compare(e,a,n)},CompareAngularVelocity(e,t){if(!this._isEnabled)return!1;const a=C3.toDegrees(this._body.GetAngularVelocity());return C3.compare(a,e,t)},CompareMass(e,t){if(!this._isEnabled)return!1;const a=this._body.GetMass()/this._worldScale;return C3.compare(a,e,t)},IsEnabled(){return this._isEnabled}},'use strict';{function e(t,a,n){const i=t.GetSavedDataMap(),e=a.GetSavedDataMap();if(n){const n=i.get(r);n&&n.delete(a.GetSID());const s=e.get(r);s&&s.delete(t.GetSID())}else{let n=i.get(r);n||(n=new Set,i.set(r,n));let s=e.get(r);s||(s=new Set,e.set(r,s)),n.add(a.GetSID()),s.add(t.GetSID())}}const t=C3.Behaviors.Physics.GetTempVec2A,n=C3.Behaviors.Physics.GetTempVec2B,r=C3.Behaviors.Physics.GetPhysicsCollisionKey();C3.Behaviors.Physics.Acts={ApplyForce(r,a,i){if(this._isEnabled){const e=this._worldScale,[s,l]=this._GetInstImagePoint(i);this._body.ApplyForce(t(r,a),n(s*e,l*e),!0)}},ApplyForceToward(a,r,e,s){if(this._isEnabled){const l=this._worldScale,[_,i]=this._GetInstImagePoint(s),d=C3.angleTo(_,i,r,e);this._body.ApplyForce(t(Math.cos(d)*a,Math.sin(d)*a),n(_*l,i*l),!0)}},ApplyForceAtAngle(r,i,s){if(this._isEnabled){i=C3.toRadians(i);const e=this._worldScale,[a,l]=this._GetInstImagePoint(s);this._body.ApplyForce(t(Math.cos(i)*r,Math.sin(i)*r),n(a*e,l*e),!0)}},ApplyImpulse(r,a,s){if(this._isEnabled){const e=this._worldScale,[l,_]=this._GetInstImagePoint(s);this._body.ApplyLinearImpulse(t(r,a),n(l*e,_*e),!0);const d=this.GetWorldInfo();this._lastKnownX=d.GetX(),this._lastKnownY=d.GetY(),this._lastTickOverride=!1}},ApplyImpulseToward(r,s,e,l){if(this._isEnabled){const _=this._worldScale,[d,i]=this._GetInstImagePoint(l),u=C3.angleTo(d,i,s,e);this._body.ApplyLinearImpulse(t(Math.cos(u)*r,Math.sin(u)*r),n(d*_,i*_),!0);const c=this.GetWorldInfo();this._lastKnownX=c.GetX(),this._lastKnownY=c.GetY(),this._lastTickOverride=!1}},ApplyImpulseAtAngle(r,s,l){if(this._isEnabled){s=C3.toRadians(s);const e=this._worldScale,[a,_]=this._GetInstImagePoint(l);this._body.ApplyLinearImpulse(t(Math.cos(s)*r,Math.sin(s)*r),n(a*e,_*e),!0);const d=this.GetWorldInfo();this._lastKnownX=d.GetX(),this._lastKnownY=d.GetY(),this._lastTickOverride=!1}},ApplyTorque(e){this._isEnabled&&this._body.ApplyTorque(C3.toRadians(e),!0)},ApplyTorqueToAngle(e,t){this._isEnabled&&(e=C3.toRadians(e),t=C3.toRadians(t),C3.angleClockwise(this.GetWorldInfo().GetAngle(),t)?this._body.ApplyTorque(-e,!0):this._body.ApplyTorque(e,!0))},ApplyTorqueToPosition(t,a,n){if(this._isEnabled){t=C3.toRadians(t);const r=this.GetWorldInfo(),e=C3.angleTo(r.GetX(),r.GetY(),a,n);C3.angleClockwise(r.GetAngle(),e)?this._body.ApplyTorque(-t,!0):this._body.ApplyTorque(t,!0)}},SetAngularVelocity(e){this._isEnabled&&(this._body.SetAngularVelocity(C3.toRadians(e)),this._body.SetAwake(!0))},CreateDistanceJoint(t,a,n,r,i){if(a&&this._isEnabled){const e=a.GetFirstPicked(this._inst);e&&e!==this._inst&&C3.Behaviors.Physics.Instance.LookupBehInstFromInst(e)&&(this._myCreatedJoints.push({type:0,params:[t,e.GetUID(),n,r,i]}),this._DoCreateDistanceJoint(t,e.GetUID(),n,r,i))}},CreateRevoluteJoint(e,t){if(t&&this._isEnabled){const a=t.GetFirstPicked(this._inst);a&&a!==this._inst&&C3.Behaviors.Physics.Instance.LookupBehInstFromInst(a)&&(this._myCreatedJoints.push({type:1,params:[e,a.GetUID()]}),this._DoCreateRevoluteJoint(e,a.GetUID()))}},CreateLimitedRevoluteJoint(t,a,n,r){if(a&&this._isEnabled){const i=a.GetFirstPicked(this._inst);i&&i!==this._inst&&C3.Behaviors.Physics.Instance.LookupBehInstFromInst(i)&&(this._myCreatedJoints.push({type:2,params:[t,i.GetUID(),n,r]}),this._DoCreateLimitedRevoluteJoint(t,i.GetUID(),n,r))}},CreatePrismaticJoint(t,a,n,r,s,e,l,_,d){if(a&&this._isEnabled){const i=a.GetFirstPicked(this._inst);i&&i!==this._inst&&C3.Behaviors.Physics.Instance.LookupBehInstFromInst(i)&&(this._myCreatedJoints.push({type:3,params:[t,i.GetUID(),n,r,s,e,l,_,d]}),this._DoCreatePrismaticJoint(t,i.GetUID(),n,r,s,e,l,_,d))}},SetWorldGravity(e){this.GetBehavior().SetGravity(e)},SetSteppingMode(e){this.GetBehavior().SetSteppingMode(e)},SetIterations(e,t){1>e&&(e=1),1>t&&(t=1),this.GetBehavior().SetIterations(e,t)},SetVelocity(n,a){if(this._isEnabled){const r=this._worldScale;this._body.SetLinearVelocity(t(n*r,a*r)),this._body.SetAwake(!0);const i=this.GetWorldInfo();this._lastKnownX=i.GetX(),this._lastKnownY=i.GetY(),this._lastTickOverride=!1}},SetDensity(e){if(this._isEnabled&&this._density!==e){this._density=e;for(const t of this._fixtures)t.SetDensity(e);this._body.ResetMassData()}},SetFriction(e){if(this._isEnabled&&this._friction!==e){this._friction=e;for(const t of this._fixtures)t.SetFriction(e);for(let e=this._body.GetContactList();this._box2d.getPointer(e);e=e.get_next()){const t=e.get_contact();t&&t.ResetFriction()}}},SetElasticity(e){if(this._isEnabled&&this._restitution!==e){this._restitution=e;for(const t of this._fixtures)t.SetRestitution(e)}},SetLinearDamping(e){this._isEnabled&&this._linearDamping!==e&&(this._linearDamping=e,this._body.SetLinearDamping(e))},SetAngularDamping(e){this._isEnabled&&this._angularDamping!==e&&(this._angularDamping=e,this._body.SetAngularDamping(e))},SetImmovable(e){this._isEnabled&&(e=!!e,this._isImmovable===e||(this._isImmovable=e,this._body.SetType(this._isImmovable?0:2),this._body.SetAwake(!0)))},EnableCollisions(t,a){if(t&&this._isEnabled){if(t.IsFamily())for(const n of t.GetFamilyMembers())e(this.GetObjectClass(),n,0!==a);else e(this.GetObjectClass(),t,0!==a);this.GetBehavior().DisableShouldCollideFastPath()}},SetPreventRotate(e){this._isEnabled&&(e=0!==e,this._preventRotation===e||(this._preventRotation=e,this._body.SetFixedRotation(this._preventRotation),this._body.SetAngularVelocity(0),this._body.SetAwake(!0)))},SetBullet(e){this._isEnabled&&(e=0!==e,this._isBullet===e||(this._isBullet=e,this._body.SetBullet(this._isBullet),this._body.SetAwake(!0)))},RemoveJoints(){this._isEnabled&&(this._DestroyMyJoints(),C3.clearArray(this._myCreatedJoints),this._joiningMe.clear())},SetEnabled(e){this._SetEnabled(0!==e)}}}'use strict',C3.Behaviors.Physics.Exps={VelocityX(){return this._isEnabled?this._body.GetLinearVelocity().get_x()/this._worldScale:0},VelocityY(){return this._isEnabled?this._body.GetLinearVelocity().get_y()/this._worldScale:0},AngularVelocity(){return this._isEnabled?C3.toDegrees(this._body.GetAngularVelocity()):0},Mass(){return this._isEnabled?this._body.GetMass()/this._worldScale:0},CenterOfMassX(){return this._isEnabled?(this._body.GetPosition().get_x()+this._body.GetLocalCenter().get_x())/this._worldScale:0},CenterOfMassY(){return this._isEnabled?(this._body.GetPosition().get_y()+this._body.GetLocalCenter().get_y())/this._worldScale:0},Density(){return this._isEnabled?this._density:0},Friction(){return this._isEnabled?this._friction:0},Elasticity(){return this._isEnabled?this._restitution:0},LinearDamping(){return this._isEnabled?this._linearDamping:0},AngularDamping(){return this._isEnabled?this._angularDamping:0}},'use strict';{function t(e){return u(e.get_x(),e.get_y())}function n(e){const t=[];for(const a of e)8>=a.length?t.push(a):t.push.apply(t,r(a));return t}function r(a){const n=[a.splice(0,8)],r=n[0][0];for(let i=n[0][7];a.length;){const e=a.splice(0,Math.min(a.length,6));let s=e[e.length-1];e.push(t(r)),e.push(t(i)),n.push(e),i=s}return n}const _={};C3.Behaviors.Physics.Separator=_;const u=C3.Behaviors.Physics.GetVec2,e=C3.Behaviors.Physics.FreeVec2;_.det=function(t,a,n,r,i,e){return t*r+n*e+i*a-a*n-r*i-e*t},_.hitRay=function(e,t,d,c,g,h,i,f){const y=d-e,l=c-t,m=i-g,n=f-h,S=(m*(h-t)-n*(g-e))/(l*m-y*n),p=e+S*y,a=t+S*l,G=_.isOnSegment(d,c,e,t,p,a),r=_.isOnSegment(p,a,g,h,i,f);return G&&r?u(p,a):null},_.isOnSegment=function(e,t,a,n,r,i){return(a+.1>=e&&e>=r-.1||a-.1<=e&&e<=r+.1)&&(n+.1>=t&&t>=i-.1||n-.1<=t&&t<=i+.1)&&_.isOnLine(e,t,a,n,r,i)},_.isOnLine=function(t,a,n,r,i,e){var s=Math.abs;if(.1l}return .1>s(t-n)},_.pointsMatch=function(t,a,n,r){var i=Math.abs;return .1>i(n-t)&&.1>i(r-a)},_.Separate=function(t,r){const s=_.calcShapes(t);let l=[];for(let n=0,a=s.length;n=.001*r)l.push(_);else for(let t=0,a=_.length;tT){for(J=!1,O=1e9,I=0;IX||X>=G)return[];_.isOnSegment(ae.get_x(),ae.get_y(),a[X].get_x(),a[X].get_y(),Z.get_x(),Z.get_y())||Y.push(a[H]);break}X=H,0>H-1?H=G-1:H--}for(Y.reverse(),X=-1,H=N;;){if(H!=V)K.push(a[H]);else{if(0>X||X>=G)return[];H!=V||_.isOnSegment(te.get_x(),te.get_y(),a[X].get_x(),a[X].get_y(),$.get_x(),$.get_y())||K.push(a[H]);break}X=H,H+1>G-1?H=0:H++}D.push(Y,K),D.shift();break}J&&Q.push(D.shift())}return Q}}'use strict',C3.Behaviors.Pin=class extends C3.SDKBehaviorBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Behaviors.Pin.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Behaviors.Pin.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(e){super(e),this._pinInst=null,this._pinUid=-1,this._pinAngle=0,this._pinDist=0,this._myStartAngle=0,this._theirStartAngle=0,this._lastKnownAngle=0,this._mode=0;const t=this._runtime.Dispatcher();this._disposables=new C3.CompositeDisposable(C3.Disposable.From(t,'instancedestroy',e=>this._OnInstanceDestroyed(e.instance)),C3.Disposable.From(t,'afterload',()=>this._OnAfterLoad()))}Release(){this._pinInst=null,super.Release()}_SetPinInst(e){e?(this._pinInst=e,this._StartTicking2()):(this._pinInst=null,this._StopTicking2())}SaveToJson(){return{uid:this._pinInst?this._pinInst.GetUID():-1,pa:this._pinAngle,pd:this._pinDist,msa:this._myStartAngle,tsa:this._theirStartAngle,lka:this._lastKnownAngle,m:this._mode}}LoadFromJson(e){this._pinUid=e.uid,this._pinAngle=e.pa,this._pinDist=e.pd,this._myStartAngle=e.msa,this._theirStartAngle=e.tsa,this._lastKnownAngle=e.lka,this._mode=e.m}_OnAfterLoad(){-1===this._pinUid?this._SetPinInst(null):(this._SetPinInst(this._runtime.GetInstanceByUID(this._pinUid)),this._pinUid=-1)}_OnInstanceDestroyed(e){this._pinInst===e&&this._SetPinInst(null)}Tick2(){var t=Math.sin,n=Math.cos;const r=this._pinInst;if(!r)return;const s=r.GetWorldInfo(),a=this._inst,l=a.GetWorldInfo(),e=this._mode;this._lastKnownAngle!==l.GetAngle()&&(this._myStartAngle=C3.clampAngle(this._myStartAngle+(l.GetAngle()-this._lastKnownAngle)));let _=l.GetX(),d=l.GetY();if(3===e||4===e){const r=C3.distanceTo(l.GetX(),l.GetY(),s.GetX(),s.GetY());if(r>this._pinDist||4===e&&r=this._duration}Update(){if(this.HasFinished())if(this._isRegular)this._current.Subtract(this._duration);else return!0;return!1}SaveToJson(){return{c:this._current.Get(),t:this._total.Get(),d:this._duration,r:this._isRegular,p:this._isPaused}}LoadFromJson(e){this._current.Set(e.c),this._total.Set(e.t),this._duration=e.d,this._isRegular=!!e.r,this._isPaused=!!e.p}},C3.Behaviors.Timer.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(e){super(e),this._timers=new Map}Release(){this._timers.clear(),super.Release()}_UpdateTickState(){0({name:'$'+t[0],value:`${e(10*t[1].GetCurrentTime())/10} / ${e(10*t[1].GetDuration())/10}`}))}]}},'use strict',C3.Behaviors.Timer.Cnds={OnTimer(e){const t=this._timers.get(e.toLowerCase());return!!t&&t.HasFinished()},IsTimerRunning(e){return this._timers.has(e.toLowerCase())},IsTimerPaused(e){const t=this._timers.get(e.toLowerCase());return t&&t.IsPaused()}},'use strict',C3.Behaviors.Timer.Acts={StartTimer(e,t,a){const n=new C3.Behaviors.Timer.SingleTimer(0,0,e,1===t);this._timers.set(a.toLowerCase(),n),this._UpdateTickState()},StopTimer(e){this._timers.delete(e.toLowerCase()),this._UpdateTickState()},PauseResumeTimer(e,t){const a=this._timers.get(e.toLowerCase());a&&a.SetPaused(0===t)}},'use strict',C3.Behaviors.Timer.Exps={CurrentTime(e){const t=this._timers.get(e.toLowerCase());return t?t.GetCurrentTime():0},TotalTime(e){const t=this._timers.get(e.toLowerCase());return t?t.GetTotalTime():0},Duration(e){const t=this._timers.get(e.toLowerCase());return t?t.GetDuration():0}},'use strict',C3.Behaviors.Tween=class extends C3.SDKBehaviorBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Behaviors.Tween.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict';{const t=C3.Behaviors.Tween;t.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(e,t){super(e),this._allowMultiple=!1,this._enabled=!0,t&&(this._allowMultiple=!1,this._enabled=!!t[0]),this._activeTweens=new Map,this._disabledTweens=[],this._waitingForReleaseTweens=new Map,this._finishingTween=null,this._activeTweensJson=null,this._disabledTweensJson=null,this._waitingForReleaseTweensJson=null,this._finishingTweenName='',this._enabled&&this._StartTicking2(),this._afterLoad=e=>this._OnAfterLoad(e),this.GetRuntime().Dispatcher().addEventListener('afterload',this._afterLoad)}Release(){this.GetRuntime().Dispatcher().removeEventListener('afterload',this._afterLoad),this._afterLoad=null,this._finishingTween&&(this.ReleaseAndCompleteTween(this._finishingTween),this._finishingTween=null),this.ReleaseAndCompleteTweens(),this._tweens=null,this.ClearDisabledList(),this._disabledTweens=null,this._ReleaseWaitingTweens(),this._waitingForReleaseTweens=null,super.Release()}SetEnabled(e){this._enabled=e,this._enabled?this._StartTicking2():this._StopTicking2()}GetEnabled(){return this._enabled}AddToDisabledList(e){this._disabledTweens.push(e)}IsInDisabledList(e){return this._disabledTweens.includes(e)}ClearDisabledList(){C3.clearArray(this._disabledTweens)}GetFinishingTween(){return this._finishingTween}IsInstanceValid(){const e=this.GetObjectInstance();return!!e&&!e.IsDestroyed()}GetTween(e,t,a=!1){const n=t?this.PropertyTweens(t,a):this.AllTweens(a);if(n&&n.length)for(const t of n)if(t.HasTags(e))return t}GetTweenIncludingWaitingForRelease(e,t){return this.GetTween(e,t,!0)}*GetTweens(e,t,a=!1){const n=t?this.PropertyTweens(t,a):this.AllTweens(a);if(n&&n.length)for(const t of n)t.HasTags(e)&&(yield t)}*GetTweensIncludingWaitingForRelease(e,t){yield*this.GetTweens(e,t,!0)}PropertyTweens(e,t){if(t){let t=this._activeTweens.get(e),a=this._waitingForReleaseTweens.get(e);return t||(t=[]),a||(a=[]),t.concat(a).filter(e=>e)}else{let t=this._activeTweens.get(e);return t||(t=[]),t.filter(e=>e)}}AllTweens(e){if(e){const e=[...this._activeTweens.values()].flat(),t=[...this._waitingForReleaseTweens.values()].flat();return e.concat(t).filter(e=>e)}else{const e=[...this._activeTweens.values()].flat();return e.filter(e=>e)}}AllTweensIncludingWaitingForRelease(){return this.AllTweens(!0)}SaveToJson(){return{s:!1,e:!!this._enabled,at:this._SaveActiveTweensToJson(),dt:this._SaveDisabledTweensToJson(),wt:this._SaveWaitingForReleaseTweensToJson(),ft:this._SaveFinishingTweenToJson()}}LoadFromJson(e){e&&(this._activeTweensJson=e.at,this._disabledTweensJson=e.dt,this._waitingForReleaseTweensJson=e.wt,this._finishingTweenName=e.ft,this._allowMultiple=!1,this._enabled=!!e.e)}_OnAfterLoad(){const e=this.GetRuntime().GetTimelineManager();if(this._PopulateTweenMap(this._activeTweensJson,this._activeTweens,e),this._disabledTweensJson){C3.clearArray(this._disabledTweens);for(const t of this._disabledTweensJson)this._PopulateTweenArray(this._disabledTweens,t,e)}this._PopulateTweenMap(this._waitingForReleaseTweensJson,this._waitingForReleaseTweens,e),this._finishingTween=this._GetTween(this._finishingTweenName,e),this._enabled?this._StartTicking2():this._StopTicking2()}_PopulateTweenMap(t,a,n){if(t)for(const r in t){let i=a.get(r);i?C3.clearArray(i):i=[];const e=t[r];for(const t of e){const e=this._PopulateTweenArray(i,t.name,n);if(!e){const e=C3.Tween.Build({runtime:this.GetRuntime(),json:t});e.AddCompletedCallback(e=>this._FinishTriggers(e)),n.AddScheduledTimeline(e),this._PopulateTweenArray(i,e,n)}else this._LoadTweenFromJson(t.name,t,n)}a.set(r,i)}}_GetTween(e,t){return t.GetScheduledOrPlayingTimelineByName(e)}_PopulateTweenArray(e,t,a){if('string'==typeof t){const n=this._GetTween(t,a);if(n)return!!e.push(n)}else return!!e.push(t);return!1}_LoadTweenFromJson(e,t,a){if('string'==typeof e){const n=this._GetTween(e,a);n&&n._LoadFromJson(t)}else e._LoadFromJson(t)}_SaveActiveTweensToJson(){const e={};for(const[t,a]of this._activeTweens)e[t]=a.map(e=>e._SaveToJson());return e}_SaveDisabledTweensToJson(){return this._disabledTweens.map(e=>e.GetName())}_SaveWaitingForReleaseTweensToJson(){const e={};for(const[t,a]of this._waitingForReleaseTweens)e[t]=a.map(e=>e._SaveToJson());return e}_SaveFinishingTweenToJson(){return this._finishingTween?this._finishingTween.GetName():''}Tick2(){this._ReleaseWaitingTweens()}CreateTween(a){const n=t.Config.GetPropertyTracksConfig(a.property,a.startValue,a.endValue,a.ease,a.resultMode,this.GetObjectInstance()),r=t.Maps.GetPropertyFromIndex(a.property);t.Maps.IsValueId(r)||this.ReleaseTweens(a.property);const i=C3.Tween.Build({runtime:this.GetRuntime(),id:r,tags:a.tags,time:a.time,instance:this.GetObjectInstance(),releaseOnComplete:!!a.releaseOnComplete,initialValueMode:a.initialValueMode,propertyTracksConfig:n});return i.AddCompletedCallback(e=>this._FinishTriggers(e)),this._AddTween(i,a.property),i}ReleaseTween(e,t=!1){const a=e.GetId();if(this._activeTweens.has(a)){const t=this._activeTweens.get(a);if(t){const a=t.indexOf(e);-1!==a&&t.splice(a,1)}}e.IsReleased()||this._IsInWaitingList(e)||(e.Stop(t),this._AddToWaitingList(e))}ReleaseTweens(a,n=!1){if(C3.IsFiniteNumber(a)){const r=t.Maps.GetPropertyFromIndex(a);if(!this._activeTweens.has(r))return;const i=this._activeTweens.get(r),e=this.GetFinishingTween();for(const t of i)t!==e&&(t.IsReleased()||this._IsInWaitingList(t)||(t.Stop(n),t.Release()));C3.clearArray(i)}else{const e=this.GetFinishingTween();for(const t of this.AllTweens())t!==e&&(t.IsReleased()||this._IsInWaitingList(t)||(t.Stop(n),t.Release()));for(const e of this._activeTweens.keys())C3.clearArray(this._activeTweens.get(e)),this._activeTweens.delete(e);this._activeTweens.clear()}}ReleaseAndCompleteTween(e){this.ReleaseTween(e,!0)}ReleaseAndCompleteTweens(){this.ReleaseTweens(NaN,!0)}GetPropertyValueByIndex(e){return 0===e?this._enabled:void 0}SetPropertyValueByIndex(e,t){0===e?this._enabled=!!t:void 0}_FinishTriggers(e){this.GetRuntime()&&(this._finishingTween=e,t.Cnds.SetFinishingTween(e),this.Trigger(t.Cnds.OnTweensFinished),this.Trigger(t.Cnds.OnAnyTweensFinished),t.Cnds.SetFinishingTween(null),this._finishingTween=null,this.ReleaseTween(e),e.GetDestroyInstanceOnComplete()&&this.GetRuntime().DestroyInstance(this.GetObjectInstance()))}_AddTween(a,n){const r=t.Maps.GetPropertyFromIndex(n);this._activeTweens.has(r)||this._activeTweens.set(r,[]);const i=this._activeTweens.get(r);i.push(a)}_AddToWaitingList(e){const t=e.GetId();this._waitingForReleaseTweens.has(t)||this._waitingForReleaseTweens.set(t,[]),this._waitingForReleaseTweens.get(t).push(e)}_IsInWaitingList(e){const t=e.GetId();return!!this._waitingForReleaseTweens.has(t)&&this._waitingForReleaseTweens.get(t).includes(e)}_ReleaseWaitingTweens(){if(this._waitingForReleaseTweens.size){for(const e of this._waitingForReleaseTweens.values()){for(const t of e)t.IsReleased()||t.Release();C3.clearArray(e)}this._waitingForReleaseTweens.clear()}}}}{let e=null;C3.Behaviors.Tween.Cnds={SetFinishingTween(t){e=t},OnTweensFinished(t){return e.HasTags(t)},OnAnyTweensFinished(){return!0},IsPlaying(e){const t=[...this.GetTweensIncludingWaitingForRelease(e)];return!!t&&!!t.length&&t.some(C3.Tween.IsPlaying)},IsAnyPlaying(){const e=[...this.AllTweensIncludingWaitingForRelease()];return!!e&&!!e.length&&e.some(C3.Tween.IsPlaying)}}}{const e=C3.Behaviors.Tween;e.Acts={SetEnabled(e){this.SetEnabled(!!e);for(const t of this.AllTweens())e?this.IsInDisabledList(t)&&t.Resume():((t.IsPlaying()||t.IsScheduled())&&this.AddToDisabledList(t),t.Stop());e&&this.ClearDisabledList()},async TweenOneProperty(...t){if(this.GetEnabled()&&this.IsInstanceValid()){const a=this.CreateTween(e.TweenArguments.OneProperty(this,...t));a.Play()&&(await a.GetPlayPromise())}},async TweenTwoProperties(...t){if(this.GetEnabled()&&this.IsInstanceValid()){const a=this.CreateTween(e.TweenArguments.TwoProperties(this,...t));a.Play()&&(await a.GetPlayPromise())}},async TweenValue(...t){if(this.GetEnabled()&&this.IsInstanceValid()){const a=this.CreateTween(e.TweenArguments.ValueProperty(this,...t));a.Play()&&(await a.GetPlayPromise())}},PauseTweens(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.GetTweens(e))t.Stop()},PauseAllTweens(){if(this.GetEnabled()&&this.IsInstanceValid())for(const e of this.AllTweens())e.Stop()},ResumeTweens(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.GetTweens(e))t.Resume()},ResumeAllTweens(){if(this.GetEnabled()&&this.IsInstanceValid())for(const e of this.AllTweens())e.Resume()},StopTweens(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.GetTweens(e))this.ReleaseTween(t)},StopAllTweens(){if(this.GetEnabled()&&this.IsInstanceValid())for(const e of this.AllTweens())this.ReleaseTween(e)},SetOnePropertyTweensEndValue(e,t,a){if(this.GetEnabled()&&this.IsInstanceValid())for(const n of this.GetTweens(e))n.SetEndValue(t,a)},SetTwoPropertiesTweensEndValue(t,a,n,r){if(this.GetEnabled()&&this.IsInstanceValid()){const i=C3.Behaviors.Tween.Maps.GetRealProperties(a);for(const e of this.GetTweens(t))e.SetEndValue(n,i[0]),e.SetEndValue(r,i[1])}},SetValuePropertyTweensStartValue(e,t){if(this.GetEnabled()&&this.IsInstanceValid())for(const a of this.GetTweens(e,'value'))a.SetStartValue(t,'value')},SetValuePropertyTweensEndValue(e,t){if(this.GetEnabled()&&this.IsInstanceValid())for(const a of this.GetTweens(e,'value'))a.SetEndValue(t,'value')},SetTweensEase(e,t){if(this.GetEnabled()&&this.IsInstanceValid()){const a=Ease.GetEaseFromIndex(t);for(const t of this.GetTweens(e))t.SetEase(a)}},SetAllTweensEase(e){if(this.GetEnabled()&&this.IsInstanceValid()){const t=Ease.GetEaseFromIndex(e);for(const e of this.AllTweens())e.SetEase(t)}},SetTweensTime(e,t){if(this.GetEnabled()&&this.IsInstanceValid())for(const a of this.GetTweens(e))a.SetTime(t)},SetAllTweensTime(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.AllTweens())t.SetTime(e)},SetTweensPlaybackRate(e,t){if(this.GetEnabled()&&this.IsInstanceValid())for(const a of this.GetTweens(e))a.SetPlaybackRate(t)},SetAllTweensPlaybackRate(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.AllTweens())t.SetPlaybackRate(e)},SetTweensDestroyOnComplete(e,t){if(this.GetEnabled()&&this.IsInstanceValid())for(const a of this.GetTweens(e))a.SetDestroyInstanceOnComplete(!!t)},SetAllTweensDestroyOnComplete(e){if(this.GetEnabled()&&this.IsInstanceValid())for(const t of this.AllTweens())t.SetDestroyInstanceOnComplete(!!e)}}}'use strict',C3.Behaviors.Tween.Exps={Time(e){const t=this.GetTweenIncludingWaitingForRelease(e);return t?t.GetTime():0},Progress(e){const t=this.GetTweenIncludingWaitingForRelease(e);return t?t.GetTime()/t.GetTotalTime():0},Value(e){const t=this.GetTweenIncludingWaitingForRelease(e,'value');return t?t.GetPropertyTrack('value').GetSourceAdapterValue():0},Tags(){return this.GetFinishingTween()?this.GetFinishingTween().GetStringTags():''}},'use strict';{const t=['position','size'],n=['offsetX','offsetY','offsetWidth','offsetHeight','offsetAngle','offsetOpacity','offsetColor','offsetZElevation'],r=['value'],i=[].concat(t).concat(n).concat(r),s={position:['offsetX','offsetY'],size:['offsetWidth','offsetHeight']},e=Object.assign({},i.reduce((e,t)=>Object.assign({},e,{[t]:[t]}),{}),s);C3.Behaviors.Tween.Maps=class{constructor(){}static GetEases(){return[...Ease.GetEaseNames()]}static GetEaseFromIndex(e){return[...Ease.GetEaseNames()][e]}static GetPropertyFromIndex(e){return i[e]}static GetPropertyIndexFromName(e){return i.indexOf(e)}static GetPairPropertyFromIndex(e){return t[e]}static GetSinglePropertyFromIndex(e){return n[e]}static GetValuePropertyFromIndex(e){return r[e]}static GetPairProperties(e){return s[e]}static GetRealProperties(t){return C3.IsString(t)?e[t]:e[i[t]]}static IsPairId(e){return!!s[e]}static IsColorId(e){return'offsetColor'===e}static IsAngleId(e){return'offsetAngle'===e}static IsOpacityId(e){return'offsetOpacity'===e}static IsValueId(e){return'value'===e}}}{const t=C3.Behaviors.Tween,n=new Map;t.Config=class{constructor(){}static GetPropertyTracksConfig(a,r,s,e,l,_){0===n.size&&this._CreateConfigObjects();const d=t.PropertyTypes.Pick(a);let i=n.get(d);return C3.IsFiniteNumber(a)&&(a=t.Maps.GetPropertyFromIndex(a)),this._GetConfig(i,a,r,s,e,l,_)}static TransformValue(e,t){const a=C3.Behaviors.Tween.GetPropertyTracksConfig(e);return a.valueGetter(t)}static _CreateConfigObjects(){const e=t.PropertyTypes,a=t.ValueGetters;this._AddConfigObject(e.PAIR,this._GetPairConfig,a._GetPropertyValue),this._AddConfigObject(e.COLOR,this._GetColorConfig,a._GetColorPropertyValue),this._AddConfigObject(e.ANGLE,this._GetAngleConfig,a._GetPropertyAngleValue),this._AddConfigObject(e.VALUE,this._GetValueConfig,a._GetPropertyValue),this._AddConfigObject(e.OTHER,this._GetCommonConfig,a._GetPropertyValue)}static _AddConfigObject(e,t,a){n.set(e,this._CreateConfigObject(e,t,a))}static _CreateConfigObject(e,t,a){return{name:e,configFunc:t,valueGetter:a}}static _GetConfig(t,a,n,r,i,e,s){return t.configFunc(a,t.valueGetter(n),t.valueGetter(r),i,e,s)}static _GetPairConfig(a,n,r,i,e){const s=t.Maps.GetPairProperties(a);return s.map((a,s)=>({sourceId:'world-instance',property:a,type:'float',valueType:'numeric',startValue:n[s],endValue:r[s],ease:t.Maps.GetEaseFromIndex(i),resultMode:e}))}static _GetColorConfig(a,n,r,i,e,s){return C3.Plugins.Text&&s.GetPlugin()instanceof C3.Plugins.Text?{sourceId:'plugin',sourceArgs:[7],property:'color',type:'color',valueType:'color',startValue:n,endValue:r,ease:t.Maps.GetEaseFromIndex(i),resultMode:e}:{sourceId:'world-instance',property:a,type:'color',valueType:'color',startValue:n,endValue:r,ease:t.Maps.GetEaseFromIndex(i),resultMode:e}}static _GetAngleConfig(a,n,r,i,e){return{sourceId:'world-instance',property:a,type:'angle',valueType:'angle',startValue:n,endValue:r,ease:t.Maps.GetEaseFromIndex(i),resultMode:e}}static _GetCommonConfig(a,n,r,i,e){return{sourceId:'world-instance',property:a,type:'float',valueType:'numeric',startValue:n,endValue:r,ease:t.Maps.GetEaseFromIndex(i),resultMode:e}}static _GetValueConfig(a,n,r,i,e){return{sourceId:'value',property:a,type:'float',valueType:'numeric',startValue:n,endValue:r,ease:t.Maps.GetEaseFromIndex(i),resultMode:e}}}}{const t=C3.Behaviors.Tween,a=Object.assign({},{resultMode:'absolute'},{tags:'',property:'',time:0,ease:0,releaseOnComplete:0}),n=Object.assign({},a,{initialValueMode:'current-state',startValue:0,endValue:0}),r=Object.assign({},a,{initialValueMode:'current-state',startValue:[0,0],endValue:[0,0]}),s=Object.assign({},a,{initialValueMode:'current-state',startValue:[0,0,0],endValue:[0,0,0]}),l=Object.assign({},n,{initialValueMode:'start-value'});t.TweenArguments=class{constructor(){}static _SetCommonProperties(t,a,n,r,i){t.tags=a,t.time=n,t.ease=r,t.releaseOnComplete=i}static OneProperty(e,a,r,_,d,u,i){const c=t.Maps.GetSinglePropertyFromIndex(r),g=t.Maps.IsColorId(c)?s:n;return this._SetCommonProperties(g,a,d,u,i),t.Maps.IsColorId(c)?(s.endValue[0]=C3.GetRValue(_),s.endValue[1]=C3.GetGValue(_),s.endValue[2]=C3.GetBValue(_),s.property=t.Maps.GetPropertyIndexFromName(c)):t.Maps.IsOpacityId(c)?n.endValue=_/100:n.endValue=_,g.property=t.Maps.GetPropertyIndexFromName(c),g}static TwoProperties(a,n,s,e,l,_,d,i){this._SetCommonProperties(r,n,_,d,i);const u=t.Maps.GetPairPropertyFromIndex(s);return r.endValue[0]=e,r.endValue[1]=l,r.property=t.Maps.GetPropertyIndexFromName(u),r}static ValueProperty(a,n,r,s,e,_,d){return this._SetCommonProperties(l,n,e,_,d),l.startValue=r,l.endValue=s,l.property=t.Maps.GetPropertyIndexFromName('value'),l}}}{const e=C3.Behaviors.Tween,t=[];e.PropertyTypes=class{constructor(){}static Pick(n){if(0===t.length){const a=t;a.push({checkFunc:e.Maps.IsPairId,result:this.PAIR}),a.push({checkFunc:e.Maps.IsColorId,result:this.COLOR}),a.push({checkFunc:e.Maps.IsAngleId,result:this.ANGLE}),a.push({checkFunc:e.Maps.IsValueId,result:this.VALUE}),a.push({checkFunc:()=>!0,result:this.OTHER})}C3.IsFiniteNumber(n)&&(n=C3.Behaviors.Tween.Maps.GetPropertyFromIndex(n));for(const e of t)if(e.checkFunc(n))return e.result}static get PAIR(){return'pair'}static get COLOR(){return'color'}static get ANGLE(){return'angle'}static get VALUE(){return'value'}static get OTHER(){return'other'}}}{const e=C3.Behaviors.Tween;e.ValueGetters=class{constructor(){}static _GetPropertyAngleValue(e){const t=C3.toRadians(parseFloat(e));return C3.clampAngle(t)}static _GetColorPropertyValue(e){return e.slice(0)}static _GetPropertyValue(e){return e}}}'use strict',C3.Behaviors.Anchor=class extends C3.SDKBehaviorBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Behaviors.Anchor.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Behaviors.Anchor.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(e,t){super(e),this._anchorLeft=2,this._anchorTop=2,this._anchorRight=0,this._anchorBottom=0,this._isEnabled=!0;const a=this._inst.GetWorldInfo().GetBoundingBox();this._xLeft=a.getLeft(),this._yTop=a.getTop(),this._xRight=this._runtime.GetOriginalViewportWidth()-a.getLeft(),this._yBottom=this._runtime.GetOriginalViewportHeight()-a.getTop(),this._rDiff=this._runtime.GetOriginalViewportWidth()-a.getRight(),this._bDiff=this._runtime.GetOriginalViewportHeight()-a.getBottom(),t&&(this._anchorLeft=t[0],this._anchorTop=t[1],this._anchorRight=t[2],this._anchorBottom=t[3],this._isEnabled=!!t[4]),this._isEnabled&&this._StartTicking()}Release(){super.Release()}SaveToJson(){return{xl:this._xLeft,yt:this._yTop,xr:this._xRight,yb:this._yBottom,rd:this._rDiff,bd:this._bDiff,al:this._anchorLeft,at:this._anchorTop,ar:this._anchorRight,ab:this._anchorBottom,e:this._isEnabled}}LoadFromJson(e){this._xLeft=e.xl,this._yTop=e.yt,this._xRight=e.xr,this._yBottom=e.yb,this._rDiff=e.rd,this._bDiff=e.bd,this._anchorLeft=e.al,this._anchorTop=e.at,this._anchorRight=e.ar,this._anchorBottom=e.ab,this._isEnabled=e.e,this._isEnabled?this._StartTicking():this._StopTicking()}Tick(){var e=Math.max;if(this._isEnabled){const t=this._inst.GetWorldInfo(),n=t.GetLayer().GetViewport();if(0===this._anchorLeft){const e=n.getLeft()+this._xLeft-t.GetBoundingBox().getLeft();0!=e&&(t.OffsetX(e),t.SetBboxChanged())}else if(1===this._anchorLeft){const e=n.getRight()-this._xRight-t.GetBoundingBox().getLeft();0!=e&&(t.OffsetX(e),t.SetBboxChanged())}if(0===this._anchorTop){const e=n.getTop()+this._yTop-t.GetBoundingBox().getTop();0!=e&&(t.OffsetY(e),t.SetBboxChanged())}else if(1===this._anchorTop){const e=n.getBottom()-this._yBottom-t.GetBoundingBox().getTop();0!=e&&(t.OffsetY(e),t.SetBboxChanged())}if(1===this._anchorRight){const a=n.getRight()-this._rDiff-t.GetBoundingBox().getRight();0!=a&&(t.OffsetX(t.GetOriginX()*a),t.SetWidth(e(t.GetWidth()+a),0),t.SetBboxChanged(),this._rDiff=n.getRight()-t.GetBoundingBox().getRight())}if(1===this._anchorBottom){const a=n.getBottom()-this._bDiff-t.GetBoundingBox().getBottom();0!=a&&(t.OffsetY(t.GetOriginY()*a),t.SetHeight(e(t.GetHeight()+a,0)),t.SetBboxChanged(),this._bDiff=n.getBottom()-t.GetBoundingBox().getBottom())}}}GetPropertyValueByIndex(e){return 0===e?this._anchorLeft:1===e?this._anchorTop:2===e?this._anchorRight:3===e?this._anchorBottom:4===e?this._isEnabled:void 0}SetPropertyValueByIndex(e,t){0===e?this._anchorLeft=t:1===e?this._anchorTop=t:2===e?this._anchorRight=t:3===e?this._anchorBottom=t:4===e?(this._isEnabled=!!t,this._isEnabled?this._StartTicking():this._StopTicking()):void 0}},'use strict',C3.Behaviors.Anchor.Cnds={IsEnabled(){return this._isEnabled}},'use strict',C3.Behaviors.Anchor.Acts={SetEnabled(e){if(this._isEnabled&&0===e)this._isEnabled=!1,this._StopTicking();else if(!this._isEnabled&&0!==e){const e=this._inst.GetWorldInfo().GetBoundingBox();this._xLeft=e.getLeft(),this._yTop=e.getTop(),this._xRight=this._runtime.GetOriginalViewportWidth()-e.getLeft(),this._yBottom=this._runtime.GetOriginalViewportHeight()-e.getTop(),this._rDiff=this._runtime.GetOriginalViewportWidth()-e.getRight(),this._bDiff=this._runtime.GetOriginalViewportHeight()-e.getBottom(),this._isEnabled=!0,this._StartTicking()}}},'use strict',C3.Behaviors.Anchor.Exps={},'use strict',C3.Behaviors.Sin=class extends C3.SDKBehaviorBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Behaviors.Sin.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict';{const t=2*Math.PI,a=Math.PI/2,n=3*Math.PI/2,e=[0,1,8,3,4,2,5,6,7];C3.Behaviors.Sin.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(a,n){super(a),this._i=0,this._movement=0,this._wave=0,this._period=0,this._mag=0,this._isEnabled=!0,this._basePeriod=0,this._basePeriodOffset=0,this._baseMag=0,this._periodRandom=0,this._periodOffsetRandom=0,this._magnitudeRandom=0,this._initialValue=0,this._initialValue2=0,this._lastKnownValue=0,this._lastKnownValue2=0,this._ratio=0,n&&(this._movement=e[n[0]],this._wave=n[1],this._periodRandom=this._runtime.Random()*n[3],this._basePeriod=n[2],this._period=n[2],this._period+=this._periodRandom,this._basePeriodOffset=n[4],0!==this._period&&(this._periodOffsetRandom=this._runtime.Random()*n[5],this._i=n[4]/this._period*t,this._i+=this._periodOffsetRandom/this._period*t),this._magnitudeRandom=this._runtime.Random()*n[7],this._baseMag=n[6],this._mag=n[6],this._mag+=this._magnitudeRandom,this._isEnabled=!!n[8]),5===this._movement&&(this._mag=C3.toRadians(this._mag)),this.Init(),this._isEnabled&&this._StartTicking()}Release(){super.Release()}SaveToJson(){return{i:this._i,e:this._isEnabled,mv:this._movement,w:this._wave,p:this._period,mag:this._mag,iv:this._initialValue,iv2:this._initialValue2,r:this._ratio,lkv:this._lastKnownValue,lkv2:this._lastKnownValue2}}LoadFromJson(e){this._i=e.i,this._SetEnabled(e.e),this._movement=e.mv,this._wave=e.w,this._period=e.p,this._mag=e.mag,this._initialValue=e.iv,this._initialValue2=e.iv2,this._ratio=e.r,this._lastKnownValue=e.lkv,this._lastKnownValue2=e.lkv2}Init(){const e=this._inst.GetWorldInfo();switch(this._movement){case 0:this._initialValue=e.GetX();break;case 1:this._initialValue=e.GetY();break;case 2:this._initialValue=e.GetWidth(),this._ratio=e.GetHeight()/e.GetWidth();break;case 3:this._initialValue=e.GetWidth();break;case 4:this._initialValue=e.GetHeight();break;case 5:this._initialValue=e.GetAngle();break;case 6:this._initialValue=e.GetOpacity();break;case 7:this._initialValue=0;break;case 8:this._initialValue=e.GetX(),this._initialValue2=e.GetY();break;default:;}this._lastKnownValue=this._initialValue,this._lastKnownValue2=this._initialValue2}WaveFunc(r){var i=Math.PI;switch(r%=t,this._wave){case 0:return Math.sin(r);case 1:return r<=a?r/a:r<=n?1-2*(r-a)/i:(r-n)/a-1;case 2:return 2*r/t-1;case 3:return-2*r/t+1;case 4:return rthis._SetEnabled(e)},{name:'behaviors.sin.properties.period.name',value:this._period,onedit:e=>this._period=e},{name:'behaviors.sin.properties.magnitude.name',value:this._mag,onedit:e=>this._mag=e},{name:'behaviors.sin.debugger.value',value:this.WaveFunc(this._i)*this._mag}]}]}}}'use strict',C3.Behaviors.Sin.Cnds={IsEnabled(){return this._isEnabled},CompareMovement(e){return this._movement===e},ComparePeriod(e,t){return C3.compare(this._period,e,t)},CompareMagnitude(e,t){return 5===this._movement?C3.compare(this._mag,e,C3.toRadians(t)):C3.compare(this._mag,e,t)},CompareWave(e){return this._wave===e}},'use strict',C3.Behaviors.Sin.Acts={SetEnabled(e){this._SetEnabled(0!==e)},SetPeriod(e){this._period=e},SetMagnitude(e){this._mag=e,5===this._movement&&(this._mag=C3.toRadians(this._mag))},SetMovement(e){5===this._movement&&5!==e&&(this._mag=C3.toDegrees(this._mag)),this._movement=e,this.Init()},SetWave(e){this._wave=e},SetPhase(e){const t=2*Math.PI;this._i=e*t%t,this._UpdateFromPhase()},UpdateInitialState(){this.Init()}},'use strict',C3.Behaviors.Sin.Exps={CyclePosition(){return this._i/(2*Math.PI)},Period(){return this._period},Magnitude(){return 5===this._movement?C3.toDegrees(this._mag):this._mag},Value(){return this.WaveFunc(this._i)*this._mag}},'use strict',C3.Behaviors.Fade=class extends C3.SDKBehaviorBase{constructor(e){super(e)}Release(){super.Release()}},'use strict',C3.Behaviors.Fade.Type=class extends C3.SDKBehaviorTypeBase{constructor(e){super(e)}Release(){super.Release()}OnCreate(){}},'use strict',C3.Behaviors.Fade.Instance=class extends C3.SDKBehaviorInstanceBase{constructor(e,t){super(e),this._fadeInTime=0,this._waitTime=0,this._fadeOutTime=0,this._destroy=!0,this._activeAtStart=!0,this._setMaxOpacity=!1,this._stage=0,this._stageTime=C3.New(C3.KahanSum),this._maxOpacity=this._inst.GetWorldInfo().GetOpacity()||1,t&&(this._fadeInTime=t[0],this._waitTime=t[1],this._fadeOutTime=t[2],this._destroy=!!t[3],this._activeAtStart=!!t[4],this._stage=this._activeAtStart?0:3),this._activeAtStart&&(0===this._fadeInTime?(this._stage=1,0===this._waitTime&&(this._stage=2)):(this._inst.GetWorldInfo().SetOpacity(0),this._runtime.UpdateRender())),this._StartTicking()}Release(){super.Release()}SaveToJson(){return{fit:this._fadeInTime,wt:this._waitTime,fot:this._fadeOutTime,d:this._destroy,s:this._stage,st:this._stageTime.Get(),mo:this._maxOpacity}}LoadFromJson(e){this._fadeInTime=e.fit,this._waitTime=e.wt,this._fadeOutTime=e.fot,this._destroy=e.d,this._stage=e.s,this._stageTime.Set(e.st),this._maxOpacity=e.mo}Tick(){const e=this._runtime.GetDt(this._inst);this._stageTime.Add(e);const t=this._inst.GetWorldInfo();0===this._stage&&(t.SetOpacity(this._stageTime.Get()/this._fadeInTime)*this._maxOpacity,this._runtime.UpdateRender(),t.GetOpacity()>=this._maxOpacity&&(t.SetOpacity(this._maxOpacity),this._stage=1,this._stageTime.Reset(),this.Trigger(C3.Behaviors.Fade.Cnds.OnFadeInEnd))),1===this._stage&&this._stageTime.Get()>=this._waitTime&&(this._stage=2,this._stageTime.Reset(),this.Trigger(C3.Behaviors.Fade.Cnds.OnWaitEnd)),2===this._stage&&0!==this._fadeOutTime&&(t.SetOpacity(this._maxOpacity-this._stageTime.Get()/this._fadeOutTime*this._maxOpacity),this._runtime.UpdateRender(),0>=t.GetOpacity()&&(this._stage=3,this._stageTime.Reset(),this.Trigger(C3.Behaviors.Fade.Cnds.OnFadeOutEnd),this._destroy&&this._runtime.DestroyInstance(this._inst)))}Start(){this._stage=0,this._stageTime.Reset(),0===this._fadeInTime?(this._stage=1,0===this._waitTime&&(this._stage=2)):(this._inst.GetWorldInfo().SetOpacity(0),this._runtime.UpdateRender())}GetPropertyValueByIndex(e){return 0===e?this._fadeInTime:1===e?this._waitTime:2===e?this._fadeOutTime:3===e?this._destroy:void 0}SetPropertyValueByIndex(e,t){0===e?this._fadeInTime=t:1===e?this._waitTime=t:2===e?this._fadeOutTime=t:3===e?this._destroy=!!t:void 0}GetDebuggerProperties(){return[{title:'$'+this.GetBehaviorType().GetName(),properties:[{name:'behaviors.fade.properties.fade-in-time.name',value:this._fadeInTime,onedit:e=>this._fadeInTime=e},{name:'behaviors.fade.properties.wait-time.name',value:this._waitTime,onedit:e=>this._waitTime=e},{name:'behaviors.fade.properties.fade-out-time.name',value:this._fadeOutTime,onedit:e=>this._fadeOutTime=e},{name:'behaviors.fade.debugger.stage',value:['behaviors.fade.debugger.'+['fade-in','wait','fade-out','done'][this._stage]]}]}]}},'use strict',C3.Behaviors.Fade.Cnds={OnFadeOutEnd(){return!0},OnFadeInEnd(){return!0},OnWaitEnd(){return!0}},'use strict',C3.Behaviors.Fade.Acts={StartFade(){this._activeAtStart||this._setMaxOpacity||(this._maxOpacity=this._inst.GetWorldInfo().GetOpacity()||1,this._setMaxOpacity=!0),3===this._stage&&this.Start()},RestartFade(){this.Start()},SetFadeInTime(e){0>e&&(e=0),this._fadeInTime=e},SetWaitTime(e){0>e&&(e=0),this._waitTime=e},SetFadeOutTime(e){0>e&&(e=0),this._fadeOutTime=e}},'use strict',C3.Behaviors.Fade.Exps={FadeInTime(){return this._fadeInTime},WaitTime(){return this._waitTime},FadeOutTime(){return this._fadeOutTime}},'use strict',self.C3_GetObjectRefTable=function(){return[C3.Plugins.Sprite,C3.Behaviors.Physics,C3.Behaviors.Pin,C3.Behaviors.Timer,C3.Plugins.Keyboard,C3.Plugins.Audio,C3.Behaviors.Tween,C3.Behaviors.Anchor,C3.Plugins.TiledBg,C3.Plugins.Spritefont2,C3.Behaviors.Sin,C3.Plugins.DrawingCanvas,C3.Plugins.Arr,C3.Plugins.Mouse,C3.Plugins.Particles,C3.Plugins.Touch,C3.Plugins.Browser,C3.Behaviors.Fade,C3.Plugins.System.Cnds.IsGroupActive,C3.Plugins.System.Cnds.OnLayoutStart,C3.Plugins.Arr.Acts.SetSize,C3.Plugins.Arr.Acts.Clear,C3.Plugins.Sprite.Cnds.IsOverlapping,C3.Behaviors.Physics.Cnds.CompareVelocity,C3.Behaviors.Physics.Acts.SetVelocity,C3.Behaviors.Physics.Exps.VelocityX,C3.Behaviors.Physics.Acts.SetAngularVelocity,C3.Behaviors.Physics.Exps.VelocityY,C3.Plugins.Sprite.Acts.SetX,C3.Plugins.Sprite.Exps.X,C3.Plugins.Sprite.Acts.SetScale,C3.Plugins.System.Exps.max,C3.Plugins.Sprite.Exps.Y,C3.Plugins.Sprite.Acts.SetAnimSpeed,C3.Plugins.System.Exps.min,C3.Plugins.Sprite.Cnds.CompareX,C3.Plugins.System.Cnds.CompareVar,C3.Plugins.System.Cnds.TriggerOnce,C3.Plugins.System.Acts.SetVar,C3.Plugins.Sprite.Acts.SetVisible,C3.Plugins.System.Acts.SetTimescale,C3.Plugins.Audio.Acts.Play,C3.Plugins.System.Acts.Wait,C3.Plugins.System.Acts.RestartLayout,C3.Behaviors.Physics.Exps.AngularVelocity,C3.Plugins.Sprite.Cnds.OnCollision,C3.Plugins.Sprite.Acts.AddInstanceVar,C3.Plugins.Browser.Cnds.OnResize,C3.Plugins.TiledBg.Acts.SetWidth,C3.Plugins.System.Exps.viewportright,C3.Plugins.System.Exps.viewportleft,C3.Plugins.TiledBg.Acts.SetX,C3.Plugins.System.Exps.int,C3.Plugins.System.Exps.random,C3.Plugins.System.Cnds.While,C3.Plugins.System.Exps.choose,C3.Plugins.TiledBg.Acts.Destroy,C3.Plugins.System.Acts.SetLayerBackground,C3.Plugins.System.Exps.rgbex255,C3.Plugins.System.Cnds.Else,C3.Plugins.TiledBg.Acts.SetDefaultColor,C3.Plugins.TiledBg.Acts.SetEffectParam,C3.Plugins.Sprite.Cnds.CompareInstanceVar,C3.Plugins.Sprite.Acts.SetAnimFrame,C3.Plugins.Sprite.Cnds.OnCreated,C3.Plugins.Sprite.Exps.AnimationFrameCount,C3.Plugins.Sprite.Acts.SetDefaultColor,C3.Plugins.Sprite.Exps.ColorValue,C3.Plugins.Touch.Cnds.IsTouchingObject,C3.Plugins.Keyboard.Cnds.IsKeyDown,C3.Plugins.Sprite.Acts.SetSize,C3.Plugins.System.Exps.viewportbottom,C3.Plugins.System.Exps.viewporttop,C3.Plugins.Sprite.Acts.Destroy,C3.Plugins.Spritefont2.Cnds.CompareInstanceVar,C3.Plugins.Spritefont2.Acts.SetVisible,C3.Plugins.Audio.Cnds.IsTagPlaying,C3.Plugins.System.Cnds.Compare,C3.Plugins.Spritefont2.Acts.SetText,C3.Plugins.System.Cnds.PickOverlappingPoint,C3.Plugins.System.Acts.SetObjectTimescale,C3.Plugins.System.Acts.AddVar,C3.Behaviors.Timer.Acts.StartTimer,C3.Plugins.System.Acts.ResetPersisted,C3.Plugins.System.Acts.Scroll,C3.Plugins.System.Exps.scrollx,C3.Plugins.System.Exps.dt,C3.Plugins.System.Exps.scrolly,C3.Plugins.System.Acts.SetLayoutScale,C3.Plugins.System.Exps.layoutscale,C3.Behaviors.Timer.Cnds.OnTimer,C3.Plugins.Spritefont2.Acts.SetScale,C3.Plugins.Spritefont2.Acts.SetDefaultColor,C3.Behaviors.Tween.Cnds.IsPlaying,C3.Plugins.System.Acts.SetLayerOpacity,C3.Behaviors.Tween.Exps.Value,C3.Behaviors.Tween.Cnds.OnTweensFinished,C3.Plugins.Audio.Acts.Stop,C3.Behaviors.Tween.Acts.TweenValue,C3.Plugins.System.Acts.SetLayerVisible,C3.Plugins.Sprite.Acts.MoveToLayer,C3.Plugins.Spritefont2.Acts.MoveToLayer,C3.Plugins.System.Acts.CreateObject,C3.Plugins.TiledBg.Acts.SetSize,C3.Behaviors.Tween.Acts.TweenOneProperty,C3.Plugins.Sprite.Acts.SetInstanceVar,C3.Behaviors.Timer.Acts.StopTimer,C3.Behaviors.Physics.Acts.CreateLimitedRevoluteJoint,C3.Behaviors.Physics.Acts.EnableCollisions,C3.Behaviors.Pin.Acts.Pin,C3.Behaviors.Physics.Acts.ApplyForce,C3.Plugins.Sprite.Exps.ImagePointX,C3.Plugins.Sprite.Cnds.CompareY,C3.Plugins.Sprite.Exps.ImagePointY,C3.Plugins.Sprite.Cnds.IsBetweenAngles,C3.Plugins.Sprite.Acts.SubInstanceVar,C3.Behaviors.Physics.Acts.ApplyForceToward,C3.Behaviors.Timer.Cnds.IsTimerRunning,C3.Plugins.System.Cnds.Every,C3.Plugins.Arr.Acts.Push,C3.Plugins.Arr.Acts.SetXY,C3.Plugins.Arr.Exps.Width,C3.Plugins.DrawingCanvas.Acts.ClearCanvas,C3.Plugins.System.Exps.rgba,C3.Plugins.Arr.Cnds.CompareSize,C3.Plugins.Arr.Acts.Pop,C3.Plugins.System.Cnds.Repeat,C3.Plugins.System.Exps.loopindex,C3.Plugins.Arr.Exps.At,C3.Plugins.DrawingCanvas.Acts.ResetPoly,C3.Plugins.DrawingCanvas.Acts.AddPolyPoint,C3.Plugins.DrawingCanvas.Acts.FillPoly,C3.Plugins.Sprite.Acts.SetPos,C3.Plugins.Sprite.Acts.MoveToTop,C3.Plugins.Particles.Acts.Destroy,C3.Behaviors.Physics.Acts.SetFriction,C3.Plugins.Sprite.Acts.SetY,C3.Plugins.Sprite.Acts.SetAnim,C3.Behaviors.Physics.Acts.SetWorldGravity,C3.Plugins.Sprite.Acts.SetWidth,C3.Plugins.System.Cnds.ForEach,C3.Behaviors.Tween.Acts.TweenTwoProperties,C3.Behaviors.Sin.Acts.SetEnabled,C3.Plugins.Sprite.Acts.SetAngle,C3.Behaviors.Pin.Acts.Unpin,C3.Plugins.Sprite.Cnds.PickDistance,C3.Plugins.Sprite.Acts.SetHeight,C3.Plugins.Sprite.Exps.Height,C3.Plugins.Sprite.Exps.Width,C3.Plugins.Sprite.Acts.Spawn,C3.Plugins.Sprite.Acts.ZMoveToObject,C3.Plugins.Touch.Cnds.OnTouchObject,C3.Plugins.Browser.Acts.GoToURLWindow,C3.Plugins.Sprite.Cnds.IsVisible,C3.Plugins.Audio.Acts.SetSilent,C3.Plugins.Touch.Cnds.OnTouchEnd,C3.Plugins.Sprite.Cnds.CompareFrame,C3.Plugins.System.Cnds.PickAll,C3.Plugins.Audio.Acts.StopAll,C3.Plugins.System.Acts.ResetGlobals,C3.Plugins.Sprite.Acts.SetCollisions,C3.Behaviors.Physics.Acts.SetImmovable,C3.Behaviors.Tween.Cnds.IsAnyPlaying,C3.Plugins.Audio.Acts.SetPlaybackRate,C3.Plugins.Audio.Acts.Seek,C3.Behaviors.Fade.Acts.StartFade,C3.Behaviors.Tween.Cnds.OnAnyTweensFinished,C3.Plugins.Mouse.Cnds.IsOverObject,C3.Plugins.Sprite.Cnds.OnDestroyed,C3.Plugins.System.Cnds.EveryTick,C3.Plugins.Sprite.Acts.StopAnim,C3.Plugins.Mouse.Acts.SetCursor,C3.Plugins.System.Acts.GoToLayout]},self.C3_JsPropNameTable=[{var:0},{adjust:0},{Physics:0},{Pin:0},{landPhysics:0},{which:0},{first:0},{angular:0},{jump:0},{moreJump:0},{Timer:0},{body:0},{Keyboard:0},{shootAngle:0},{leg:0},{playerLine:0},{armRight:0},{armLeft:0},{arm2Line:0},{arm1Line:0},{legLine:0},{head:0},{headLine:0},{Audio:0},{kale:0},{tail:0},{americanBall:0},{groundCollision:0},{ballLine:0},{rightShoe:0},{hair:0},{rightShort:0},{leftShort:0},{rightTshirt:0},{leftTshirt:0},{leftShoe:0},{tshirt:0},{kaleBack:0},{Tween:0},{file:0},{kaleTop:0},{ballShadow:0},{playerShadow:0},{snow:0},{Anchor:0},{pause:0},{groundTile:0},{groundLine:0},{whiteLine:0},{TPG:0},{scoreBG:0},{fontWonder:0},{fenceTile:0},{grassTile:0},{Sine:0},{cloudTile:0},{buildingTile:0},{DrawingCanvas:0},{Array:0},{head2:0},{armRight2:0},{armLeft2:0},{body2:0},{leg2:0},{Mouse:0},{p2Collision:0},{p1Collision:0},{head3:0},{armRight3:0},{armLeft3:0},{body3:0},{leg3:0},{p3Collision:0},{head4:0},{armRight4:0},{armLeft4:0},{body4:0},{leg4:0},{p4Collision:0},{night:0},{starTile:0},{normalBall:0},{bigBall:0},{snowParticle:0},{portraitCoverTile:0},{Touch:0},{buttonRight:0},{buttonLeft:0},{tutorial:0},{pauseButtons:0},{Browser:0},{Fade:0},{fadeOut:0},{titleBG:0},{title:0},{cpu:0},{hover:0},{startButton:0},{moreButton:0},{startButton2:0},{hitfx:0},{goalText:0},{game_bg:0},{introtwporg:0},{play_intro_btn:0},{groundTileSnow:0},{buildingTile2:0},{buildingTile3:0},{smallBall:0},{startX:0},{titleChars:0},{groundTilePlaj:0},{seaTile:0},{mountain:0},{ships:0},{seaWhite:0},{player:0},{skin:0},{tiles:0},{line:0},{balls:0},{startButtons:0},{angularMaxRND:0},{angularMinRND:0},{wooble:0},{angularSub:0},{snowSlip:0},{P1Control:0},{P2Control:0},{p1Score:0},{p2Score:0},{goal:0},{CPU:0},{velX:0},{velAng:0},{ang:0},{team1:0},{team2:0},{screenWidth:0},{screenHeight:0},{rnd:0},{who:0},{upArrow:0},{W:0},{op:0},{i:0},{x0:0},{y0:0},{a0:0},{x1:0},{y1:0},{a1:0},{rndChar:0},{rndBall:0},{rndGoal:0},{rndPlace:0},{speed:0},{effectAdjust:0},{menu:0}],'use strict';{self.C3_ExpressionFuncs=[()=>'Ball',()=>0,()=>3,()=>1,e=>{const t=e._GetNode(0);return()=>t.ExpBehavior()},()=>-100,e=>{const t=e._GetNode(0);return()=>5*t.ExpBehavior()},e=>{const t=e._GetNode(0);return()=>C3.clamp(t.ExpBehavior(),-150,150)},e=>{const t=e._GetNode(0);return()=>C3.clamp(t.ExpBehavior(),-120,120)},e=>{const t=e._GetNode(0);return()=>t.ExpObject()},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1),n=e._GetNode(2),r=e._GetNode(3);return()=>t(.2,a.ExpInstVar_Family()-(n.ExpObject()-r.ExpObject())/150)},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1);return()=>t(Math.abs(a.ExpBehavior()),20)},()=>290,()=>.1,()=>-10,()=>'',()=>'Players',e=>{const t=e._GetNode(0),a=e._GetNode(1).GetVar(),n=e._GetNode(2).GetVar();return()=>C3.clamp(t.ExpBehavior(),-1*a.GetValue(),n.GetValue())},e=>{const t=e._GetNode(0);return()=>C3.clamp(t.ExpBehavior(),-100,100)},e=>{const t=e._GetNode(0),a=e._GetNode(1);return()=>3*t.ExpBehavior()+a.ExpBehavior()},e=>{const t=e._GetNode(0),a=e._GetNode(1).GetVar();return()=>3*t.ExpBehavior()+a.GetValue()},e=>{const t=e._GetNode(0);return()=>t.ExpBehavior()/2},()=>'General',e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod();return()=>t('BG')-a('BG')+100},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t('BG')-50},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod();return()=>t(a(8))},e=>{const t=e._GetNode(0).GetVar();return()=>t.GetValue()},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(0,1,2)},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(149,237,244)},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(255,214,159)},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(254,240,220)},()=>2,e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(89,89,198)},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(119,120,210)},()=>'back',e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(82,82,186)},()=>'middle',e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(72,68,159)},()=>'front',e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(63,52,145)},()=>4,()=>5,()=>6,()=>7,()=>8,e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod(),n=e._GetNode(2);return()=>t(a(n.ExpObject()))},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod(),n=e._GetNode(2).GetBoundMethod(),r=e._GetNode(3).GetBoundMethod();return()=>t(a(138,72,54),n(255,216,60),r(39,39,39))},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod(),n=e._GetNode(2).GetBoundMethod(),r=e._GetNode(3).GetBoundMethod(),i=e._GetNode(4).GetBoundMethod();return()=>t(a(255,225,188),n(143,98,87),r(246,202,159),i(214,169,124))},()=>'Control',e=>{const t=e._GetNode(0),a=e._GetNode(1).GetBoundMethod();return()=>t.ExpObject()-a('UI')},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod();return()=>t('UI')-a('UI')},()=>-5,()=>'jump1',()=>'jump2',()=>'Goal',e=>{const t=e._GetNode(0).GetVar(),a=e._GetNode(1).GetVar();return()=>t.GetValue()+a.GetValue()},()=>'blink1',()=>.2,()=>.01,()=>'blue',()=>'red',e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1),n=e._GetNode(2).GetBoundMethod();return()=>C3.lerp(t(),a.ExpObject(),n())},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t()},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod();return()=>C3.lerp(t(),1.5,a())},()=>1.2,e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(255,200,37)},()=>'blink2',e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(255,255,255)},()=>'End',()=>'OPOutOver',()=>'OP',e=>{const t=e._GetNode(0);return()=>t.ExpBehavior('OPOutOver')},()=>60,()=>'menu',()=>'music',()=>'sound',()=>.3,()=>'Op',()=>'Top',()=>26,()=>27,()=>21,()=>55,()=>-160,()=>39,()=>'appear',()=>145,()=>85,()=>113,()=>204,()=>'CPU',e=>{const t=e._GetNode(0).GetBoundMethod();return()=>.4+t(5)/20},()=>'jump',e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(10)/20},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>.3+t(10)/20},()=>'P1',()=>'arm1',()=>-15,()=>'arm2',()=>15,()=>'head',()=>-8,()=>'leg',()=>90,e=>{const t=e._GetNode(0);return()=>t.ExpInstVar()},e=>{const t=e._GetNode(0);return()=>2*t.ExpBehavior()},e=>{const t=e._GetNode(0);return()=>t.ExpObject(1)},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetVar(),n=e._GetNode(2).GetVar();return()=>t(a.GetValue(),n.GetValue())},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetVar(),n=e._GetNode(2).GetVar();return()=>-1*t(a.GetValue(),n.GetValue())},e=>{const t=e._GetNode(0).GetVar();return()=>-1*t.GetValue()},e=>{const t=e._GetNode(0),a=e._GetNode(1).GetBoundMethod();return()=>C3.lerp(t.ExpInstVar(),0,a())},e=>{const t=e._GetNode(0),a=e._GetNode(1).GetBoundMethod();return()=>C3.lerp(t.ExpInstVar(),0,2*a())},()=>'P1 Control',()=>800,()=>10,()=>-800,()=>'wait',()=>100,e=>{const t=e._GetNode(0),a=e._GetNode(1);return()=>-5*(t.ExpObject()-a.ExpObject(1))},()=>'P1 skin',e=>{const t=e._GetNode(0);return()=>t.ExpObject(6)},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod(),n=e._GetNode(2),r=e._GetNode(3);return()=>t(a(.2,1-(n.ExpObject()-r.ExpObject())/150),1)},()=>'P2',()=>-90,e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetVar(),n=e._GetNode(2).GetVar(),r=e._GetNode(3);return()=>t(a.GetValue(),n.GetValue())*r.ExpInstVar()},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetVar(),n=e._GetNode(2).GetVar(),r=e._GetNode(3);return()=>-1*t(a.GetValue(),n.GetValue())*r.ExpInstVar()},()=>'P2 Control',()=>'P2 skin',()=>'Trail',e=>{const t=e._GetNode(0);return()=>t.ExpObject()+85},e=>{const t=e._GetNode(0);return()=>t.ExpObject()-1},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(0,0,0,0)},e=>{const t=e._GetNode(0);return()=>t.ExpObject()-3},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t()+1},e=>{const t=e._GetNode(0),a=e._GetNode(1).GetVar();return()=>t.ExpObject(a.GetValue(),0)},e=>{const t=e._GetNode(0),a=e._GetNode(1).GetVar();return()=>t.ExpObject(a.GetValue(),1)},e=>{const t=e._GetNode(0),a=e._GetNode(1).GetVar(),n=e._GetNode(2),r=e._GetNode(3).GetVar(),i=e._GetNode(4),s=e._GetNode(5).GetVar(),l=e._GetNode(6),_=e._GetNode(7).GetVar();return()=>C3.toDegrees(C3.angleTo(t.ExpObject(a.GetValue()-1,0),n.ExpObject(r.GetValue()-1,1),i.ExpObject(s.GetValue(),0),l.ExpObject(_.GetValue(),1)))+90},e=>{const t=e._GetNode(0),a=e._GetNode(1).GetVar();return()=>t.ExpObject(a.GetValue()+1,0)},e=>{const t=e._GetNode(0),a=e._GetNode(1).GetVar();return()=>t.ExpObject(a.GetValue()+1,1)},e=>{const t=e._GetNode(0),a=e._GetNode(1).GetVar(),n=e._GetNode(2),r=e._GetNode(3).GetVar(),i=e._GetNode(4),s=e._GetNode(5).GetVar(),l=e._GetNode(6),_=e._GetNode(7).GetVar();return()=>C3.toDegrees(C3.angleTo(t.ExpObject(a.GetValue(),0),n.ExpObject(r.GetValue(),1),i.ExpObject(s.GetValue()+1,0),l.ExpObject(_.GetValue()+1,1)))+90},e=>{const t=e._GetNode(0).GetVar(),a=e._GetNode(1),n=e._GetNode(2).GetVar(),r=e._GetNode(3).GetVar();return()=>t.GetValue()-a.ExpInstVar_Family()*Math.cos(C3.toRadians(n.GetValue()))*r.GetValue()},e=>{const t=e._GetNode(0).GetVar(),a=e._GetNode(1),n=e._GetNode(2).GetVar(),r=e._GetNode(3).GetVar();return()=>t.GetValue()-a.ExpInstVar_Family()*Math.sin(C3.toRadians(n.GetValue()))*r.GetValue()},e=>{const t=e._GetNode(0).GetVar(),a=e._GetNode(1),n=e._GetNode(2).GetVar(),r=e._GetNode(3).GetVar();return()=>t.GetValue()+a.ExpInstVar_Family()*Math.cos(C3.toRadians(n.GetValue()))*r.GetValue()},e=>{const t=e._GetNode(0).GetVar(),a=e._GetNode(1),n=e._GetNode(2).GetVar(),r=e._GetNode(3).GetVar();return()=>t.GetValue()+a.ExpInstVar_Family()*Math.sin(C3.toRadians(n.GetValue()))*r.GetValue()},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1),n=e._GetNode(2).GetVar(),r=e._GetNode(3).GetVar();return()=>t(100,100,100,a.ExpInstVar_Family()*n.GetValue()*r.GetValue())},()=>'P3',()=>'P3 Control',()=>12,()=>125,()=>'P3 skin',()=>'P4',()=>'P4 Control',()=>'P4 skin',()=>'Bonus',()=>95,e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod();return()=>2*(t('Top')-a('Top'))},()=>-1,e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod(),n=e._GetNode(2).GetBoundMethod();return()=>t(-1,-1,a(n(3)))},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod(),n=e._GetNode(2).GetBoundMethod();return()=>t(-1,a(n(3)))},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod(),n=e._GetNode(2).GetBoundMethod();return()=>t(-1,-1,a(n(2)))},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(0,0,1,2)},()=>200,()=>150,()=>-281492157629439,e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(255,228,228)},()=>400,()=>250,e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(246,229,206)},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(162,226,253)},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(246,252,254)},()=>1.5,e=>{const t=e._GetNode(0);return()=>t.ExpObject()-.001},()=>.6,()=>'Game',()=>'american',()=>.8,()=>'bigball',()=>1.1,()=>'smallball',()=>.5,e=>{const t=e._GetNode(0),a=e._GetNode(1);return()=>t.ExpObject()+((195>a.ExpObject()?1:0)?5:-5)},()=>56,e=>{const t=e._GetNode(0),a=e._GetNode(1);return()=>t.ExpObject()+((195114,()=>'Effect',()=>'goal',()=>110,()=>30,()=>'move',()=>'move2',()=>450,e=>{const t=e._GetNode(0),a=e._GetNode(1).GetVar();return()=>t.ExpObject()-a.GetValue()},e=>{const t=e._GetNode(0),a=e._GetNode(1).GetVar();return()=>t.ExpObject()+a.GetValue()},()=>'shrink',()=>'bup',()=>-6,()=>.05,()=>'http://www.twoplayergames.org/?utm_source=Html5Game&utm_medium=SoccerRandom',()=>'NewWindow',()=>70,()=>205,()=>'Menu',e=>{const t=e._GetNode(0),a=e._GetNode(1);return()=>t.ExpObject()-a.ExpObject()},()=>-12,()=>'size',()=>-20,()=>.9,e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(60)},()=>'disappear',()=>'OPOutMenu',e=>{const t=e._GetNode(0);return()=>t.ExpInstVar_Family()},e=>{const t=e._GetNode(0);return()=>t.ExpBehavior('OPOutMenu')},()=>1.15,e=>{const t=e._GetNode(0),a=e._GetNode(1);return()=>t.ExpObject()+a.ExpInstVar()},e=>{const t=e._GetNode(0).GetBoundMethod(),a=e._GetNode(1).GetBoundMethod();return()=>t('Top')-a('Top')},e=>{const t=e._GetNode(0).GetBoundMethod();return()=>t(0,10)},e=>{const t=e._GetNode(0);return()=>t.ExpObject()+4},()=>.4]}{self.C3.ScriptsInEvents={}} \ No newline at end of file diff --git a/soccerrandom/scripts/dispatchworker.js b/soccerrandom/scripts/dispatchworker.js new file mode 100644 index 00000000..8f92f7b0 --- /dev/null +++ b/soccerrandom/scripts/dispatchworker.js @@ -0,0 +1 @@ +"use strict";self.inputPort=null,self.jobQueue=[],self.jobWorkers=[],self.sentBlobs=[],self.sentBuffers=[],self.importedScripts=[],self.lastBroadcasts=new Map;class JobWorker{constructor(a,b){this._port=a,this._number=b,this._isReady=!1,this._isBusy=!1,this._port.onmessage=(a)=>this._OnMessage(a.data)}ImportScripts(a){this._port.postMessage({"type":"_import_scripts","scripts":a})}SendBlob(a,b){this._port.postMessage({"type":"_send_blob","blob":a,"id":b})}SendBuffer(a,b){this._port.postMessage({"type":"_send_buffer","buffer":a,"id":b})}SendJob(a){if(this._isBusy||!this._isReady)throw new Error("cannot take job");this._isBusy=!0,this._port.postMessage(a,a["transferables"])}_InitBroadcast(a){this._port.postMessage(a,a["transferables"])}SendReady(){this._port.postMessage({"type":"_ready"})}IsReady(){return this._isReady}_OnReady(){this._isReady=!0,this.MaybeStartNextJob()}IsBusy(){return this._isBusy}GetNumber(){return this._number}_OnMessage(a){const b=a["type"];return"ready"===b?void this._OnReady():"done"===b?void this._OnJobDone():void console.error("unknown message from worker '"+b+"'")}_OnJobDone(){this._isBusy=!1,this.MaybeStartNextJob()}MaybeStartNextJob(){if(!this._isBusy&&this._isReady){const a=this._FindAvailableJob();if(-1!==a){const b=self.jobQueue[a],c=b["isBroadcast"];c?(b["doneFlags"][this._number]=!0,b["doneFlags"].every((a)=>a)&&self.jobQueue.splice(a,1)):self.jobQueue.splice(a,1),this.SendJob(b)}}}_FindAvailableJob(){for(let a=0,b=self.jobQueue.length;a{const b=a.data,c=b["type"];"_init"===c?(self.inputPort=b["in-port"],self.inputPort.onmessage=OnInputPortMessage):"_addJobWorker"===c&&AddJobWorker(b["port"])});function OnInputPortMessage(a){const b=a.data,c=b["type"];if("_cancel"===c)return void CancelJob(b.jobId);if("_import_scripts"===c){const a=b["scripts"];for(const b of self.jobWorkers)b.ImportScripts(a);return void self.importedScripts.push(a)}if("_send_blob"===c){const a=b["blob"],c=b["id"];for(const b of self.jobWorkers)b.SendBlob(a,c);return void self.sentBlobs.push([a,c])}if("_send_buffer"===c){const a=b["buffer"],c=b["id"];for(const b of self.jobWorkers)b.SendBuffer(a,c);return void self.sentBuffers.push([a,c])}if("_no_more_workers"===c)return self.sentBlobs.length=0,self.sentBuffers.length=0,self.importedScripts.length=0,void self.lastBroadcasts.clear();if("_testMessageChannel"===c)return void self.jobWorkers[0].TestMessageChannel();self.jobQueue.push(b),b["isBroadcast"]&&(b["doneFlags"]=Array(self.jobWorkers.length).fill(!1),b["transferables"]=[],self.lastBroadcasts.set(b["type"],b));for(const b of self.jobWorkers)b.MaybeStartNextJob()} \ No newline at end of file diff --git a/soccerrandom/scripts/jobworker.js b/soccerrandom/scripts/jobworker.js new file mode 100644 index 00000000..936a7ef3 --- /dev/null +++ b/soccerrandom/scripts/jobworker.js @@ -0,0 +1 @@ +"use strict";self.dispatchPort=null,self.outputPort=null,self.workerNumber=-1,self.activeJobId=null,self.sentBlobs=new Map,self.sentBuffers=new Map,self.JobHandlers={};function FlipImageData(a,b,c){const d=4*b,e=new Uint8Array(d),f=a.buffer;for(let g=0,h=Math.floor(c/2);g{const b=a.data,c=b["type"];return"init"===c?(self.workerNumber=b["number"],self.dispatchPort=b["dispatch-port"],self.dispatchPort.onmessage=OnDispatchWorkerMessage,void(self.outputPort=b["output-port"])):"terminate"===c?void self.close():void console.error("unknown message '"+c+"'")});function SendReady(){self.dispatchPort.postMessage({"type":"ready"}),self.outputPort.postMessage({"type":"ready"})}function SendError(a,b){a||self.outputPort.postMessage({"type":"error","jobId":self.activeJobId,"error":b.toString()}),SendDone()}function SendResult(a,b){if(!a){const a=b.transferables||[];self.outputPort.postMessage({"type":"result","jobId":self.activeJobId,"result":b.result},a)}SendDone()}function SendDone(){self.activeJobId=null,self.dispatchPort.postMessage({"type":"done"})}function SendProgress(a){self.outputPort.postMessage({"type":"progress","jobId":self.activeJobId,"progress":a})}function OnDispatchWorkerMessage(a){const b=a.data,c=b["type"];if("_import_scripts"===c)return void importScripts(...b["scripts"]);if("_send_blob"===c)return void self.sentBlobs.set(b["id"],b["blob"]);if("_send_buffer"===c)return void self.sentBuffers.set(b["id"],b["buffer"]);if("_testMessageChannel"===c)return void self.outputPort.postMessage({"type":"_testMessageChannelOk"});if("_ready"===c)return void SendReady();const d=b["jobId"],f=b["isBroadcast"],e=b["params"];let g;if(self.activeJobId=d,!self.JobHandlers.hasOwnProperty(c))return void console.error(`no handler for message type '${c}'`);try{g=self.JobHandlers[c](e)}catch(a){return void SendError(f,"Exception in job handler: "+a)}g&&g.then?g.then((a)=>SendResult(f,a)).catch((a)=>SendError(f,"Rejection in job handler: "+a)):SendResult(f,g)} \ No newline at end of file diff --git a/soccerrandom/scripts/main.js b/soccerrandom/scripts/main.js new file mode 100644 index 00000000..234da284 --- /dev/null +++ b/soccerrandom/scripts/main.js @@ -0,0 +1 @@ +"use strict";window.DOMHandler=class{constructor(e,t){this._iRuntime=e,this._componentId=t,this._hasTickCallback=!1,this._tickCallback=()=>this.Tick()}Attach(){}PostToRuntime(e,t,n,a){this._iRuntime.PostToRuntimeComponent(this._componentId,e,t,n,a)}PostToRuntimeAsync(e,t,n,a){return this._iRuntime.PostToRuntimeComponentAsync(this._componentId,e,t,n,a)}_PostToRuntimeMaybeSync(e,t,n){this._iRuntime.UsesWorker()?this.PostToRuntime(e,t,n):this._iRuntime._GetLocalRuntime()._OnMessageFromDOM({type:"event",component:this._componentId,handler:e,dispatchOpts:n||null,data:t,responseId:null})}AddRuntimeMessageHandler(e,t){this._iRuntime.AddRuntimeComponentMessageHandler(this._componentId,e,t)}AddRuntimeMessageHandlers(e){for(const[t,n]of e)this.AddRuntimeMessageHandler(t,n)}GetRuntimeInterface(){return this._iRuntime}GetComponentID(){return this._componentId}_StartTicking(){this._hasTickCallback||(this._iRuntime._AddRAFCallback(this._tickCallback),this._hasTickCallback=!0)}_StopTicking(){this._hasTickCallback&&(this._iRuntime._RemoveRAFCallback(this._tickCallback),this._hasTickCallback=!1)}Tick(){}},window.RateLimiter=class{constructor(e,t){this._callback=e,this._interval=t,this._timerId=-1,this._lastCallTime=-Infinity,this._timerCallFunc=()=>this._OnTimer(),this._ignoreReset=!1,this._canRunImmediate=!1}SetCanRunImmediate(e){this._canRunImmediate=!!e}Call(){if(-1===this._timerId){const e=Date.now(),t=e-this._lastCallTime,n=this._interval;t>=n&&this._canRunImmediate?(this._lastCallTime=e,this._RunCallback()):this._timerId=self.setTimeout(this._timerCallFunc,Math.max(n-t,4))}}_RunCallback(){this._ignoreReset=!0,this._callback(),this._ignoreReset=!1}Reset(){this._ignoreReset||(this._CancelTimer(),this._lastCallTime=Date.now())}_OnTimer(){this._timerId=-1,this._lastCallTime=Date.now(),this._RunCallback()}_CancelTimer(){-1!==this._timerId&&(self.clearTimeout(this._timerId),this._timerId=-1)}Release(){this._CancelTimer(),this._callback=null,this._timerCallFunc=null}},"use strict",window.DOMElementHandler=class extends DOMHandler{constructor(e,t){super(e,t),this._elementMap=new Map,this._autoAttach=!0,this.AddRuntimeMessageHandler("create",e=>this._OnCreate(e)),this.AddRuntimeMessageHandler("destroy",e=>this._OnDestroy(e)),this.AddRuntimeMessageHandler("set-visible",e=>this._OnSetVisible(e)),this.AddRuntimeMessageHandler("update-position",e=>this._OnUpdatePosition(e)),this.AddRuntimeMessageHandler("update-state",e=>this._OnUpdateState(e)),this.AddRuntimeMessageHandler("focus",e=>this._OnSetFocus(e)),this.AddRuntimeMessageHandler("set-css-style",e=>this._OnSetCssStyle(e))}SetAutoAttach(e){this._autoAttach=!!e}AddDOMElementMessageHandler(e,t){this.AddRuntimeMessageHandler(e,e=>{const n=e.elementId,a=this._elementMap.get(n);return t(a,e)})}_OnCreate(e){const t=e.elementId,n=this.CreateElement(t,e);this._elementMap.set(t,n),e.isVisible||(n.style.display="none"),this._autoAttach&&document.body.appendChild(n)}CreateElement(){throw new Error("required override")}DestroyElement(){}_OnDestroy(e){const t=e.elementId,n=this._elementMap.get(t);this.DestroyElement(n),this._autoAttach&&n.parentElement.removeChild(n),this._elementMap.delete(t)}PostToRuntimeElement(e,t,n){n||(n={}),n.elementId=t,this.PostToRuntime(e,n)}_PostToRuntimeElementMaybeSync(e,t,n){n||(n={}),n.elementId=t,this._PostToRuntimeMaybeSync(e,n)}_OnSetVisible(e){if(this._autoAttach){const t=this._elementMap.get(e.elementId);t.style.display=e.isVisible?"":"none"}}_OnUpdatePosition(e){if(this._autoAttach){const t=this._elementMap.get(e.elementId);t.style.left=e.left+"px",t.style.top=e.top+"px",t.style.width=e.width+"px",t.style.height=e.height+"px";const n=e.fontSize;null!==n&&(t.style.fontSize=n+"em")}}_OnUpdateState(e){const t=this._elementMap.get(e.elementId);this.UpdateState(t,e)}UpdateState(){throw new Error("required override")}_OnSetFocus(e){const t=this._elementMap.get(e.elementId);e.focus?t.focus():t.blur()}_OnSetCssStyle(e){const t=this._elementMap.get(e.elementId);t.style[e.prop]=e.val}GetElementById(e){return this._elementMap.get(e)}},"use strict";{function t(e){if(e.isStringSrc){const t=document.createElement("script");t.async=!1,t.textContent=e.str,document.head.appendChild(t)}else return new Promise((t,n)=>{const a=document.createElement("script");a.onload=t,a.onerror=n,a.async=!1,a.src=e,document.head.appendChild(a)})}async function r(e){const t=await s(e),n=new TextDecoder("utf-8");return n.decode(t)}function s(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=e=>t(e.target.result),a.onerror=e=>n(e),a.readAsArrayBuffer(e)})}function u(e){return n.has(e)}const a=/(iphone|ipod|ipad)/i.test(navigator.userAgent);let e=new Audio;const d={"audio/webm; codecs=opus":!!e.canPlayType("audio/webm; codecs=opus"),"audio/ogg; codecs=opus":!!e.canPlayType("audio/ogg; codecs=opus"),"audio/webm; codecs=vorbis":!!e.canPlayType("audio/webm; codecs=vorbis"),"audio/ogg; codecs=vorbis":!!e.canPlayType("audio/ogg; codecs=vorbis"),"audio/mp4":!!e.canPlayType("audio/mp4"),"audio/mpeg":!!e.canPlayType("audio/mpeg")};e=null;const _=[];let p=0;window.RealFile=window.File;const i=[],y=new Map,g=new Map;let l=0;const m=[];self.runOnStartup=function(e){if("function"!=typeof e)throw new Error("runOnStartup called without a function");m.push(e)};const n=new Set(["cordova","playable-ad","instant-games"]);window.RuntimeInterface=class e{constructor(e){this._useWorker=e.useWorker,this._messageChannelPort=null,this._baseUrl="",this._scriptFolder=e.scriptFolder,this._workerScriptBlobURLs={},this._worker=null,this._localRuntime=null,this._domHandlers=[],this._runtimeDomHandler=null,this._canvas=null,this._jobScheduler=null,this._rafId=-1,this._rafFunc=()=>this._OnRAFCallback(),this._rafCallbacks=[],this._exportType=e.exportType,u(this._exportType)&&this._useWorker&&(console.warn("[C3 runtime] Worker mode is enabled and supported, but is disabled in WebViews due to crbug.com/923007. Reverting to DOM mode."),this._useWorker=!1),this._transferablesBroken=!1,this._localFileBlobs=null,this._localFileStrings=null,("html5"===this._exportType||"playable-ad"===this._exportType)&&"file"===location.protocol.substr(0,4)&&alert("Exported games won't work until you upload them. (When running on the file: protocol, browsers block many features from working for security reasons.)"),this.AddRuntimeComponentMessageHandler("runtime","cordova-fetch-local-file",e=>this._OnCordovaFetchLocalFile(e)),this.AddRuntimeComponentMessageHandler("runtime","create-job-worker",e=>this._OnCreateJobWorker(e)),"cordova"===this._exportType?document.addEventListener("deviceready",()=>this._Init(e)):this._Init(e)}Release(){this._CancelAnimationFrame(),this._messageChannelPort&&(this._messageChannelPort.onmessage=null,this._messageChannelPort=null),this._worker&&(this._worker.terminate(),this._worker=null),this._localRuntime&&(this._localRuntime.Release(),this._localRuntime=null),this._canvas&&(this._canvas.parentElement.removeChild(this._canvas),this._canvas=null)}GetCanvas(){return this._canvas}GetBaseURL(){return this._baseUrl}UsesWorker(){return this._useWorker}GetExportType(){return this._exportType}IsiOSCordova(){return a&&"cordova"===this._exportType}IsiOSWebView(){return a&&u(this._exportType)}async _Init(e){if("playable-ad"===this._exportType){this._localFileBlobs=self.c3_base64files,this._localFileStrings={},await this._ConvertDataUrisToBlobs();for(let t=0,n=e.engineScripts.length;tthis._OnMessageFromRuntime(e.data),window.c3_addPortMessageHandler&&window.c3_addPortMessageHandler(e=>this._OnMessageFromDebugger(e)),this._jobScheduler=new self.JobSchedulerDOM(this),await this._jobScheduler.Init(),this.MaybeForceBodySize(),"object"==typeof window.StatusBar&&window.StatusBar.hide(),"object"==typeof window.AndroidFullScreen&&window.AndroidFullScreen.immersiveMode(),await this._TestTransferablesWork(),this._useWorker?await this._InitWorker(e,t.port2):await this._InitDOM(e,t.port2)}_GetWorkerURL(e){return this._workerScriptBlobURLs.hasOwnProperty(e)?this._workerScriptBlobURLs[e]:e.endsWith("/workermain.js")&&this._workerScriptBlobURLs.hasOwnProperty("workermain.js")?this._workerScriptBlobURLs["workermain.js"]:"playable-ad"===this._exportType&&this._localFileBlobs.hasOwnProperty(e.toLowerCase())?URL.createObjectURL(this._localFileBlobs[e.toLowerCase()]):e}async CreateWorker(t,n,o){if(t.startsWith("blob:"))return new Worker(t,o);if(this.IsiOSCordova()){const e=await this.CordovaFetchLocalFileAsArrayBuffer(this._scriptFolder+t),n=new Blob([e],{type:"application/javascript"});return new Worker(URL.createObjectURL(n),o)}const i=new URL(t,n),a=location.origin!==i.origin;if(a){const e=await fetch(i);if(!e.ok)throw new Error("failed to fetch worker script");const t=await e.blob();return new Worker(URL.createObjectURL(t),o)}return new Worker(i,o)}MaybeForceBodySize(){if(this.IsiOSWebView()){const t=document.documentElement.style,n=document.body.style,a=window.innerWidthnew e(this)),this._FindRuntimeDOMHandler(),self.c3_callFunction=(e,t)=>this._runtimeDomHandler._InvokeFunctionFromJS(e,t),"preview"===this._exportType&&(self.goToLastErrorScript=()=>this.PostToRuntimeComponent("runtime","go-to-last-error-script"))}async _InitDOM(n,a){this._canvas=document.createElement("canvas"),this._canvas.style.display="none",document.body.appendChild(this._canvas),window.c3canvas=this._canvas,this._domHandlers=i.map(e=>new e(this)),this._FindRuntimeDOMHandler();const o=n.engineScripts.map(e=>"string"==typeof e?new URL(e,this._baseUrl).toString():e);if(Array.isArray(n.workerDependencyScripts)&&o.unshift(...n.workerDependencyScripts),await Promise.all(o.map(e=>t(e))),n.projectScripts&&0t(e[1]))),Object.values(e).some(e=>!e))return void self.setTimeout(()=>this._ReportProjectScriptError(e),100)}catch(t){return console.error("[Preview] Error loading project scripts: ",t),void self.setTimeout(()=>this._ReportProjectScriptError(e),100)}}if("preview"===this._exportType&&"object"!=typeof self.C3.ScriptsInEvents)return console.error("[C3 runtime] Failed to load JavaScript code used in events. Check all your JavaScript code has valid syntax."),void alert("Failed to load JavaScript code used in events. Check all your JavaScript code has valid syntax.");const r=Object.assign(this._GetCommonRuntimeOptions(n),{isInWorker:!1,messagePort:a,canvas:this._canvas,runOnStartupFunctions:m});this._localRuntime=self.C3_CreateRuntime(r),await self.C3_InitRuntime(this._localRuntime,r)}_ReportProjectScriptError(e){const t=Object.entries(e).filter(e=>!e[1]).map(e=>e[0]),n=`Failed to load project script '${t[0]}'. Check all your JavaScript code has valid syntax.`;console.error("[Preview] "+n),alert(n)}async _OnCreateJobWorker(){const e=await this._jobScheduler._CreateJobWorker();return{outputPort:e,transferables:[e]}}_GetLocalRuntime(){if(this._useWorker)throw new Error("not available in worker mode");return this._localRuntime}PostToRuntimeComponent(t,n,a,o,i){this._messageChannelPort.postMessage({type:"event",component:t,handler:n,dispatchOpts:o||null,data:a,responseId:null},this._transferablesBroken?void 0:i)}PostToRuntimeComponentAsync(t,n,a,o,i){const e=l++,r=new Promise((t,n)=>{g.set(e,{resolve:t,reject:n})});return this._messageChannelPort.postMessage({type:"event",component:t,handler:n,dispatchOpts:o||null,data:a,responseId:e},this._transferablesBroken?void 0:i),r}["_OnMessageFromRuntime"](e){const t=e.type;if("event"===t)this._OnEventFromRuntime(e);else if("result"===t)this._OnResultFromRuntime(e);else if("runtime-ready"===t)this._OnRuntimeReady();else if("alert"===t)alert(e.message);else throw new Error(`unknown message '${t}'`)}_OnEventFromRuntime(t){const n=t.component,o=t.handler,a=t.data,i=t.responseId,e=y.get(n);if(!e)return void console.warn(`[DOM] No event handlers for component '${n}'`);const r=e.get(o);if(!r)return void console.warn(`[DOM] No handler '${o}' for component '${n}'`);let d=null;try{d=r(a)}catch(e){return console.error(`Exception in '${n}' handler '${o}':`,e),void(null!==i&&this._PostResultToRuntime(i,!1,e.toString()))}null!==i&&(d&&d.then?d.then(e=>this._PostResultToRuntime(i,!0,e)).catch(e=>{console.error(`Rejection from '${n}' handler '${o}':`,e),this._PostResultToRuntime(i,!1,e.toString())}):this._PostResultToRuntime(i,!0,d))}_PostResultToRuntime(e,t,n){let a;n&&n.transferables&&(a=n.transferables),this._messageChannelPort.postMessage({type:"result",responseId:e,isOk:t,result:n},a)}_OnResultFromRuntime(t){const n=t.responseId,a=t.isOk,o=t.result,i=g.get(n);a?i.resolve(o):i.reject(o),g.delete(n)}AddRuntimeComponentMessageHandler(e,t,n){let a=y.get(e);if(a||(a=new Map,y.set(e,a)),a.has(t))throw new Error(`[DOM] Component '${e}' already has handler '${t}'`);a.set(t,n)}static AddDOMHandlerClass(e){if(i.includes(e))throw new Error("DOM handler already added");i.push(e)}_FindRuntimeDOMHandler(){for(const e of this._domHandlers)if("runtime"===e.GetComponentID())return void(this._runtimeDomHandler=e);throw new Error("cannot find runtime DOM handler")}_OnMessageFromDebugger(e){this.PostToRuntimeComponent("debugger","message",e)}_OnRuntimeReady(){for(const e of this._domHandlers)e.Attach()}static IsDocumentFullscreen(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement)}async GetRemotePreviewStatusInfo(){return await this.PostToRuntimeComponentAsync("runtime","get-remote-preview-status-info")}_AddRAFCallback(e){this._rafCallbacks.push(e),this._RequestAnimationFrame()}_RemoveRAFCallback(e){const t=this._rafCallbacks.indexOf(e);if(-1===t)throw new Error("invalid callback");this._rafCallbacks.splice(t,1),this._rafCallbacks.length||this._CancelAnimationFrame()}_RequestAnimationFrame(){-1===this._rafId&&this._rafCallbacks.length&&(this._rafId=requestAnimationFrame(this._rafFunc))}_CancelAnimationFrame(){-1!==this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=-1)}_OnRAFCallback(){this._rafId=-1;for(const e of this._rafCallbacks)e();this._RequestAnimationFrame()}TryPlayMedia(e){this._runtimeDomHandler.TryPlayMedia(e)}RemovePendingPlay(e){this._runtimeDomHandler.RemovePendingPlay(e)}_PlayPendingMedia(){this._runtimeDomHandler._PlayPendingMedia()}SetSilent(e){this._runtimeDomHandler.SetSilent(e)}IsAudioFormatSupported(e){return!!d[e]}async _WasmDecodeWebMOpus(e){const t=await this.PostToRuntimeComponentAsync("runtime","opus-decode",{arrayBuffer:e},null,[e]);return new Float32Array(t)}IsAbsoluteURL(e){return /^(?:[a-z]+:)?\/\//.test(e)||"data:"===e.substr(0,5)||"blob:"===e.substr(0,5)}IsRelativeURL(e){return!this.IsAbsoluteURL(e)}async _OnCordovaFetchLocalFile(e){const t=e.filename;switch(e.as){case"text":return await this.CordovaFetchLocalFileAsText(t);case"buffer":return await this.CordovaFetchLocalFileAsArrayBuffer(t);default:throw new Error("unsupported type");}}_GetPermissionAPI(){const e=window.cordova&&window.cordova.plugins&&window.cordova.plugins.permissions;if("object"!=typeof e)throw new Error("Permission API is not loaded");return e}_MapPermissionID(e,t){const n=e[t];if("string"!=typeof n)throw new Error("Invalid permission name");return n}_HasPermission(e){const t=this._GetPermissionAPI();return new Promise((n,a)=>t.checkPermission(this._MapPermissionID(t,e),e=>n(!!e.hasPermission),a))}_RequestPermission(e){const t=this._GetPermissionAPI();return new Promise((n,a)=>t.requestPermission(this._MapPermissionID(t,e),e=>n(!!e.hasPermission),a))}async RequestPermissions(e){if("cordova"!==this.GetExportType())return!0;if(this.IsiOSCordova())return!0;for(const t of e){const e=await this._HasPermission(t);if(e)continue;const n=await this._RequestPermission(t);if(!1===n)return!1}return!0}async RequirePermissions(...e){if(!1===(await this.RequestPermissions(e)))throw new Error("Permission not granted")}CordovaFetchLocalFile(e){const t=window.cordova.file.applicationDirectory+"www/"+e.toLowerCase();return new Promise((e,n)=>{window.resolveLocalFileSystemURL(t,t=>{t.file(e,n)},n)})}async CordovaFetchLocalFileAsText(e){const t=await this.CordovaFetchLocalFile(e);return await r(t)}_CordovaMaybeStartNextArrayBufferRead(){if(_.length&&!(8<=p)){p++;const e=_.shift();this._CordovaDoFetchLocalFileAsAsArrayBuffer(e.filename,e.successCallback,e.errorCallback)}}CordovaFetchLocalFileAsArrayBuffer(e){return new Promise((t,n)=>{_.push({filename:e,successCallback:e=>{p--,this._CordovaMaybeStartNextArrayBufferRead(),t(e)},errorCallback:e=>{p--,this._CordovaMaybeStartNextArrayBufferRead(),n(e)}}),this._CordovaMaybeStartNextArrayBufferRead()})}async _CordovaDoFetchLocalFileAsAsArrayBuffer(t,n,e){try{const a=await this.CordovaFetchLocalFile(t),o=await s(a);n(o)}catch(t){e(t)}}async _ConvertDataUrisToBlobs(){const e=[];for(const[t,n]of Object.entries(this._localFileBlobs))e.push(this._ConvertDataUriToBlobs(t,n));await Promise.all(e)}async _ConvertDataUriToBlobs(e,t){if("object"==typeof t)this._localFileBlobs[e]=new Blob([t.str],{type:t.type}),this._localFileStrings[e]=t.str;else{let n=await this._FetchDataUri(t);n||(n=this._DataURIToBinaryBlobSync(t)),this._localFileBlobs[e]=n}}async _FetchDataUri(e){try{const t=await fetch(e);return await t.blob()}catch(e){return console.warn("Failed to fetch a data: URI. Falling back to a slower workaround. This is probably because the Content Security Policy unnecessarily blocked it. Allow data: URIs in your CSP to avoid this.",e),null}}_DataURIToBinaryBlobSync(e){const t=this._ParseDataURI(e);return this._BinaryStringToBlob(t.data,t.mime_type)}_ParseDataURI(t){const n=t.indexOf(",");if(0>n)throw new URIError("expected comma in data: uri");const a=t.substring(5,n),o=t.substring(n+1),r=a.split(";"),e=r[0]||"",d=r[1],s=r[2];let u;return u="base64"===d||"base64"===s?atob(o):decodeURIComponent(o),{mime_type:e,data:u}}_BinaryStringToBlob(t,n){let a,o,i=t.length,e=i>>2,r=new Uint8Array(i),s=new Uint32Array(r.buffer,0,e);for(a=0,o=0;ae=t),n=new ArrayBuffer(1),o=new MessageChannel;return o.port2.onmessage=t=>{t.data&&t.data.arrayBuffer||(this._transferablesBroken=!0,console.warn("MessageChannel transfers determined to be broken. Disabling transferables.")),e()},o.port1.postMessage({arrayBuffer:n},[n]),t}}}{function t(e){return e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents||e.originalEvent&&e.originalEvent.sourceCapabilities&&e.originalEvent.sourceCapabilities.firesTouchEvents}function s(e){return new Promise((t,n)=>{const a=document.createElement("link");a.onload=()=>t(a),a.onerror=e=>n(e),a.rel="stylesheet",a.href=e,document.head.appendChild(a)})}function a(e){return new Promise((t,n)=>{const a=new Image;a.onload=()=>t(a),a.onerror=e=>n(e),a.src=e})}async function u(e){const t=URL.createObjectURL(e);try{return await a(t)}finally{URL.revokeObjectURL(t)}}function d(e){return new Promise((t,n)=>{let a=new FileReader;a.onload=e=>t(e.target.result),a.onerror=e=>n(e),a.readAsText(e)})}async function _(e,t,n){if(!/firefox/i.test(navigator.userAgent))return await u(e);let o=await d(e);const r=new DOMParser,s=r.parseFromString(o,"image/svg+xml"),l=s.documentElement;if(l.hasAttribute("width")&&l.hasAttribute("height")){const t=l.getAttribute("width"),n=l.getAttribute("height");if(!t.includes("%")&&!n.includes("%"))return await u(e)}l.setAttribute("width",t+"px"),l.setAttribute("height",n+"px");const i=new XMLSerializer;return o=i.serializeToString(s),e=new Blob([o],{type:"image/svg+xml"}),await u(e)}function e(e){do{if(e.parentNode&&e.hasAttribute("contenteditable"))return!0;e=e.parentNode}while(e);return!1}function f(e){const t=e.target.tagName.toLowerCase();o.has(t)&&e.preventDefault()}function g(e){(e.metaKey||e.ctrlKey)&&e.preventDefault()}function i(){try{return window.parent&&window.parent.document.hasFocus()}catch(e){return!1}}function c(){const t=document.activeElement;if(!t)return!1;const n=t.tagName.toLowerCase(),a=new Set(["email","number","password","search","tel","text","url"]);return"textarea"===n||("input"===n?a.has(t.type.toLowerCase()||"text"):e(t))}const y=new Map([["OSLeft","MetaLeft"],["OSRight","MetaRight"]]),l={dispatchRuntimeEvent:!0,dispatchUserScriptEvent:!0},m={dispatchUserScriptEvent:!0},n={dispatchRuntimeEvent:!0},o=new Set(["canvas","body","html"]);self.C3_GetSvgImageSize=async function(e){const t=await u(e);if(0p=!0),document.addEventListener("resume",()=>p=!1);const b=class extends DOMHandler{constructor(t){super(t,"runtime"),this._isFirstSizeUpdate=!0,this._simulatedResizeTimerId=-1,this._targetOrientation="any",this._attachedDeviceOrientationEvent=!1,this._attachedDeviceMotionEvent=!1,this._debugHighlightElem=null,this._pointerRawUpdateRateLimiter=null,this._lastPointerRawUpdateEvent=null,t.AddRuntimeComponentMessageHandler("canvas","update-size",e=>this._OnUpdateCanvasSize(e)),t.AddRuntimeComponentMessageHandler("runtime","invoke-download",e=>this._OnInvokeDownload(e)),t.AddRuntimeComponentMessageHandler("runtime","raster-svg-image",e=>this._OnRasterSvgImage(e)),t.AddRuntimeComponentMessageHandler("runtime","get-svg-image-size",e=>this._OnGetSvgImageSize(e)),t.AddRuntimeComponentMessageHandler("runtime","set-target-orientation",e=>this._OnSetTargetOrientation(e)),t.AddRuntimeComponentMessageHandler("runtime","register-sw",()=>this._OnRegisterSW()),t.AddRuntimeComponentMessageHandler("runtime","post-to-debugger",e=>this._OnPostToDebugger(e)),t.AddRuntimeComponentMessageHandler("runtime","go-to-script",e=>this._OnPostToDebugger(e)),t.AddRuntimeComponentMessageHandler("runtime","before-start-ticking",()=>this._OnBeforeStartTicking()),t.AddRuntimeComponentMessageHandler("runtime","debug-highlight",e=>this._OnDebugHighlight(e)),t.AddRuntimeComponentMessageHandler("runtime","enable-device-orientation",()=>this._AttachDeviceOrientationEvent()),t.AddRuntimeComponentMessageHandler("runtime","enable-device-motion",()=>this._AttachDeviceMotionEvent()),t.AddRuntimeComponentMessageHandler("runtime","add-stylesheet",e=>this._OnAddStylesheet(e));const n=new Set(["input","textarea","datalist"]);window.addEventListener("contextmenu",t=>{const a=t.target,o=a.tagName.toLowerCase();n.has(o)||e(a)||t.preventDefault()});const a=t.GetCanvas();window.addEventListener("selectstart",f),window.addEventListener("gesturehold",f),a.addEventListener("selectstart",f),a.addEventListener("gesturehold",f),window.addEventListener("touchstart",f,{passive:!1}),"undefined"==typeof PointerEvent?a.addEventListener("touchstart",f):(window.addEventListener("pointerdown",f,{passive:!1}),a.addEventListener("pointerdown",f)),this._mousePointerLastButtons=0,window.addEventListener("mousedown",e=>{1===e.button&&e.preventDefault()}),window.addEventListener("mousewheel",g,{passive:!1}),window.addEventListener("wheel",g,{passive:!1}),window.addEventListener("resize",()=>this._OnWindowResize()),t.IsiOSWebView()&&window.addEventListener("focusout",()=>{c()||(document.scrollingElement.scrollTop=0)}),this._mediaPendingPlay=new Set,this._mediaRemovedPendingPlay=new WeakSet,this._isSilent=!1}_OnBeforeStartTicking(){return"cordova"===this._iRuntime.GetExportType()?(document.addEventListener("pause",()=>this._OnVisibilityChange(!0)),document.addEventListener("resume",()=>this._OnVisibilityChange(!1))):document.addEventListener("visibilitychange",()=>this._OnVisibilityChange(document.hidden)),{isSuspended:!!(document.hidden||p)}}Attach(){window.addEventListener("focus",()=>this._PostRuntimeEvent("window-focus")),window.addEventListener("blur",()=>{this._PostRuntimeEvent("window-blur",{parentHasFocus:i()}),this._mousePointerLastButtons=0}),window.addEventListener("fullscreenchange",()=>this._OnFullscreenChange()),window.addEventListener("webkitfullscreenchange",()=>this._OnFullscreenChange()),window.addEventListener("mozfullscreenchange",()=>this._OnFullscreenChange()),window.addEventListener("fullscreenerror",e=>this._OnFullscreenError(e)),window.addEventListener("webkitfullscreenerror",e=>this._OnFullscreenError(e)),window.addEventListener("mozfullscreenerror",e=>this._OnFullscreenError(e)),window.addEventListener("keydown",e=>this._OnKeyEvent("keydown",e)),window.addEventListener("keyup",e=>this._OnKeyEvent("keyup",e)),window.addEventListener("dblclick",e=>this._OnMouseEvent("dblclick",e,l)),window.addEventListener("wheel",e=>this._OnMouseWheelEvent("wheel",e)),"undefined"==typeof PointerEvent?(window.addEventListener("mousedown",e=>this._OnMouseEventAsPointer("pointerdown",e)),window.addEventListener("mousemove",e=>this._OnMouseEventAsPointer("pointermove",e)),window.addEventListener("mouseup",e=>this._OnMouseEventAsPointer("pointerup",e)),window.addEventListener("touchstart",e=>this._OnTouchEvent("pointerdown",e)),window.addEventListener("touchmove",e=>this._OnTouchEvent("pointermove",e)),window.addEventListener("touchend",e=>this._OnTouchEvent("pointerup",e)),window.addEventListener("touchcancel",e=>this._OnTouchEvent("pointercancel",e))):(window.addEventListener("pointerdown",e=>this._OnPointerEvent("pointerdown",e)),this._iRuntime.UsesWorker()&&"undefined"!=typeof window.onpointerrawupdate?(this._pointerRawUpdateRateLimiter=new RateLimiter(()=>this._DoSendPointerRawUpdate(),5),this._pointerRawUpdateRateLimiter.SetCanRunImmediate(!0),window.addEventListener("pointerrawupdate",e=>this._OnPointerRawUpdate(e))):window.addEventListener("pointermove",e=>this._OnPointerEvent("pointermove",e)),window.addEventListener("pointerup",e=>this._OnPointerEvent("pointerup",e)),window.addEventListener("pointercancel",e=>this._OnPointerEvent("pointercancel",e)));const e=()=>this._PlayPendingMedia();window.addEventListener("pointerup",e,!0),window.addEventListener("touchend",e,!0),window.addEventListener("click",e,!0),window.addEventListener("keydown",e,!0),window.addEventListener("gamepadconnected",e,!0)}_PostRuntimeEvent(e,t){this.PostToRuntime(e,t||null,n)}_GetWindowInnerWidth(){return Math.max(window.innerWidth,1)}_GetWindowInnerHeight(){return Math.max(window.innerHeight,1)}_OnWindowResize(){const e=this._GetWindowInnerWidth(),t=this._GetWindowInnerHeight();this._PostRuntimeEvent("window-resize",{innerWidth:e,innerHeight:t,devicePixelRatio:window.devicePixelRatio}),this._iRuntime.IsiOSWebView()&&(-1!==this._simulatedResizeTimerId&&clearTimeout(this._simulatedResizeTimerId),this._OnSimulatedResize(e,t,0))}_ScheduleSimulatedResize(e,t,n){-1!==this._simulatedResizeTimerId&&clearTimeout(this._simulatedResizeTimerId),this._simulatedResizeTimerId=setTimeout(()=>this._OnSimulatedResize(e,t,n),48)}_OnSimulatedResize(t,n,a){const o=this._GetWindowInnerWidth(),i=this._GetWindowInnerHeight();this._simulatedResizeTimerId=-1,o!=t||i!=n?this._PostRuntimeEvent("window-resize",{innerWidth:o,innerHeight:i,devicePixelRatio:window.devicePixelRatio}):10>a&&this._ScheduleSimulatedResize(o,i,a+1)}_OnSetTargetOrientation(e){this._targetOrientation=e.targetOrientation}_TrySetTargetOrientation(){const e=this._targetOrientation;if(screen.orientation&&screen.orientation.lock)screen.orientation.lock(e).catch(e=>console.warn("[Construct 3] Failed to lock orientation: ",e));else try{let t=!1;screen.lockOrientation?t=screen.lockOrientation(e):screen.webkitLockOrientation?t=screen.webkitLockOrientation(e):screen.mozLockOrientation?t=screen.mozLockOrientation(e):screen.msLockOrientation&&(t=screen.msLockOrientation(e)),t||console.warn("[Construct 3] Failed to lock orientation")}catch(e){console.warn("[Construct 3] Failed to lock orientation: ",e)}}_OnFullscreenChange(){const e=RuntimeInterface.IsDocumentFullscreen();e&&"any"!==this._targetOrientation&&this._TrySetTargetOrientation(),this.PostToRuntime("fullscreenchange",{isFullscreen:e,innerWidth:this._GetWindowInnerWidth(),innerHeight:this._GetWindowInnerHeight()})}_OnFullscreenError(e){console.warn("[Construct 3] Fullscreen request failed: ",e),this.PostToRuntime("fullscreenerror",{isFullscreen:RuntimeInterface.IsDocumentFullscreen(),innerWidth:this._GetWindowInnerWidth(),innerHeight:this._GetWindowInnerHeight()})}_OnVisibilityChange(e){e?this._iRuntime._CancelAnimationFrame():this._iRuntime._RequestAnimationFrame(),this.PostToRuntime("visibilitychange",{hidden:e})}_OnKeyEvent(e,t){"Backspace"===t.key&&f(t);const n=y.get(t.code)||t.code;this._PostToRuntimeMaybeSync(e,{code:n,key:t.key,which:t.which,repeat:t.repeat,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey,timeStamp:t.timeStamp},l)}_OnMouseWheelEvent(e,t){this.PostToRuntime(e,{clientX:t.clientX,clientY:t.clientY,deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode,timeStamp:t.timeStamp},l)}_OnMouseEvent(e,n,a){t(n)||("mousedown"===e&&window!==window.top&&window.focus(),this._PostToRuntimeMaybeSync(e,{button:n.button,buttons:n.buttons,clientX:n.clientX,clientY:n.clientY,timeStamp:n.timeStamp},a))}_OnMouseEventAsPointer(e,n){if(!t(n)){"pointerdown"===e&&window!==window.top&&window.focus();const t=this._mousePointerLastButtons;"pointerdown"===e&&0!==t?e="pointermove":"pointerup"==e&&0!==n.buttons&&(e="pointermove"),this._PostToRuntimeMaybeSync(e,{pointerId:1,pointerType:"mouse",button:n.button,buttons:n.buttons,lastButtons:t,clientX:n.clientX,clientY:n.clientY,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,timeStamp:n.timeStamp},l),this._mousePointerLastButtons=n.buttons,this._OnMouseEvent(n.type,n,m)}}_OnPointerEvent(e,t){"pointerdown"===e&&window!==window.top&&window.focus(),this._pointerRawUpdateRateLimiter&&"pointermove"!==e&&this._pointerRawUpdateRateLimiter.Reset();let n=0;if("mouse"===t.pointerType&&(n=this._mousePointerLastButtons),this._PostToRuntimeMaybeSync(e,{pointerId:t.pointerId,pointerType:t.pointerType,button:t.button,buttons:t.buttons,lastButtons:n,clientX:t.clientX,clientY:t.clientY,width:t.width||0,height:t.height||0,pressure:t.pressure||0,tangentialPressure:t.tangentialPressure||0,tiltX:t.tiltX||0,tiltY:t.tiltY||0,twist:t.twist||0,timeStamp:t.timeStamp},l),"mouse"===t.pointerType){let n="mousemove";"pointerdown"===e?n="mousedown":"pointerup"==e&&(n="pointerup"),this._OnMouseEvent(n,t,m),this._mousePointerLastButtons=t.buttons}}_OnPointerRawUpdate(e){this._lastPointerRawUpdateEvent=e,this._pointerRawUpdateRateLimiter.Call()}_DoSendPointerRawUpdate(){this._OnPointerEvent("pointermove",this._lastPointerRawUpdateEvent),this._lastPointerRawUpdateEvent=null}_OnTouchEvent(e,t){"pointerdown"===e&&window!==window.top&&window.focus();for(let n=0,a=t.changedTouches.length;nthis._OnDeviceOrientation(e)))}_AttachDeviceMotionEvent(){this._attachedDeviceMotionEvent||(this._attachedDeviceMotionEvent=!0,window.addEventListener("devicemotion",e=>this._OnDeviceMotion(e)))}_OnDeviceOrientation(e){this.PostToRuntime("deviceorientation",{alpha:e.alpha||0,beta:e.beta||0,gamma:e.gamma||0,timeStamp:e.timeStamp},l)}_OnDeviceMotion(t){let n=null;const a=t.acceleration;a&&(n={x:a.x||0,y:a.y||0,z:a.z||0});let o=null;const i=t.accelerationIncludingGravity;i&&(o={x:i.x||0,y:i.y||0,z:i.z||0});let e=null;const r=t.rotationRate;r&&(e={alpha:r.alpha||0,beta:r.beta||0,gamma:r.gamma||0}),this.PostToRuntime("devicemotion",{acceleration:n,accelerationIncludingGravity:o,rotationRate:e,interval:t.interval,timeStamp:t.timeStamp},l)}_OnUpdateCanvasSize(e){const t=this.GetRuntimeInterface(),n=t.GetCanvas();n.style.width=e.styleWidth+"px",n.style.height=e.styleHeight+"px",n.style.marginLeft=e.marginLeft+"px",n.style.marginTop=e.marginTop+"px",t.MaybeForceBodySize(),this._isFirstSizeUpdate&&(n.style.display="",this._isFirstSizeUpdate=!1)}_OnInvokeDownload(t){const n=t.url,o=t.filename,i=document.createElement("a"),e=document.body;i.textContent=o,i.href=n,i.download=o,e.appendChild(i),i.click(),e.removeChild(i)}async _OnRasterSvgImage(t){const n=t.blob,a=t.imageWidth,o=t.imageHeight,r=t.surfaceWidth,e=t.surfaceHeight,d=t.imageBitmapOpts,s=await self.C3_RasterSvgImageBlob(n,a,o,r,e);let u;return u=d?await createImageBitmap(s,d):await createImageBitmap(s),{imageBitmap:u,transferables:[u]}}async _OnGetSvgImageSize(e){return await self.C3_GetSvgImageSize(e.blob)}async _OnAddStylesheet(e){await s(e.url)}_PlayPendingMedia(){const e=[...this._mediaPendingPlay];if(this._mediaPendingPlay.clear(),!this._isSilent)for(const t of e){const e=t.play();e&&e.catch(()=>{this._mediaRemovedPendingPlay.has(t)||this._mediaPendingPlay.add(t)})}}TryPlayMedia(e){if("function"!=typeof e.play)throw new Error("missing play function");this._mediaRemovedPendingPlay.delete(e);let t;try{t=e.play()}catch(t){return void this._mediaPendingPlay.add(e)}t&&t.catch(()=>{this._mediaRemovedPendingPlay.has(e)||this._mediaPendingPlay.add(e)})}RemovePendingPlay(e){this._mediaPendingPlay.delete(e),this._mediaRemovedPendingPlay.add(e)}SetSilent(e){this._isSilent=!!e}_OnDebugHighlight(e){const t=e.show;if(!t)return void(this._debugHighlightElem&&(this._debugHighlightElem.style.display="none"));this._debugHighlightElem||(this._debugHighlightElem=document.createElement("div"),this._debugHighlightElem.id="inspectOutline",document.body.appendChild(this._debugHighlightElem));const n=this._debugHighlightElem;n.style.display="",n.style.left=e.left-1+"px",n.style.top=e.top-1+"px",n.style.width=e.width+2+"px",n.style.height=e.height+2+"px",n.textContent=e.name}_OnRegisterSW(){window.C3_RegisterSW&&window.C3_RegisterSW()}_OnPostToDebugger(e){window.c3_postToMessagePort&&(e.from="runtime",window.c3_postToMessagePort(e))}_InvokeFunctionFromJS(e,t){return this.PostToRuntimeAsync("js-invoke-function",{name:e,params:t})}};RuntimeInterface.AddDOMHandlerClass(b)}{const e=document.currentScript.src;self.JobSchedulerDOM=class{constructor(t){this._runtimeInterface=t,this._baseUrl=e?e.substr(0,e.lastIndexOf("/")+1):t.GetBaseURL(),this._maxNumWorkers=Math.min(navigator.hardwareConcurrency||2,16),this._dispatchWorker=null,this._jobWorkers=[],this._inputPort=null,this._outputPort=null}async Init(){if(this._hasInitialised)throw new Error("already initialised");this._hasInitialised=!0;const e=this._runtimeInterface._GetWorkerURL("dispatchworker.js");this._dispatchWorker=await this._runtimeInterface.CreateWorker(e,this._baseUrl,{name:"DispatchWorker"});const t=new MessageChannel;this._inputPort=t.port1,this._dispatchWorker.postMessage({type:"_init","in-port":t.port2},[t.port2]),this._outputPort=await this._CreateJobWorker()}async _CreateJobWorker(){const t=this._jobWorkers.length,n=this._runtimeInterface._GetWorkerURL("jobworker.js"),a=await this._runtimeInterface.CreateWorker(n,this._baseUrl,{name:"JobWorker"+t}),o=new MessageChannel,i=new MessageChannel;return this._dispatchWorker.postMessage({type:"_addJobWorker",port:o.port1},[o.port1]),a.postMessage({type:"init",number:t,"dispatch-port":o.port2,"output-port":i.port2},[o.port2,i.port2]),this._jobWorkers.push(a),i.port1}GetPortData(){return{inputPort:this._inputPort,outputPort:this._outputPort,maxNumWorkers:this._maxNumWorkers}}GetPortTransferables(){return[this._inputPort,this._outputPort]}}}if("use strict",window.C3_IsSupported){"undefined"!=typeof OffscreenCanvas;window.c3_runtimeInterface=new RuntimeInterface({useWorker:!1,workerMainUrl:"workermain.js",engineScripts:["scripts/c3runtime.js"],scriptFolder:"scripts/",workerDependencyScripts:[],exportType:"html5"})}{function e(e,t){return e.length===t.length&&(e===t||e.toLowerCase()===t.toLowerCase())}const t=class extends DOMHandler{constructor(e){super(e,"audio"),this._audioContext=null,this._destinationNode=null,this._hasUnblocked=!1,this._unblockFunc=()=>this._UnblockAudioContext(),this._audioBuffers=[],this._audioInstances=[],this._lastAudioInstance=null,this._lastPlayedTag="",this._lastTickCount=-1,this._pendingTags=new Map,this._masterVolume=1,this._isSilent=!1,this._timeScaleMode=0,this._timeScale=1,this._gameTime=0,this._panningModel="HRTF",this._distanceModel="inverse",this._refDistance=600,this._maxDistance=1e4,this._rolloffFactor=1,this._playMusicAsSound=!1,this._hasAnySoftwareDecodedMusic=!1,this._supportsWebMOpus=this._iRuntime.IsAudioFormatSupported("audio/webm; codecs=opus"),this._effects=new Map,this._analysers=new Set,this._isPendingPostFxState=!1,this._microphoneTag="",this._microphoneSource=null,self.C3Audio_OnMicrophoneStream=(e,t)=>this._OnMicrophoneStream(e,t),this._destMediaStreamNode=null,self.C3Audio_GetOutputStream=()=>this._OnGetOutputStream(),self.C3Audio_DOMInterface=this,this.AddRuntimeMessageHandlers([["create-audio-context",e=>this._CreateAudioContext(e)],["play",e=>this._Play(e)],["stop",e=>this._Stop(e)],["stop-all",()=>this._StopAll()],["set-paused",e=>this._SetPaused(e)],["set-volume",e=>this._SetVolume(e)],["fade-volume",e=>this._FadeVolume(e)],["set-master-volume",e=>this._SetMasterVolume(e)],["set-muted",e=>this._SetMuted(e)],["set-silent",e=>this._SetSilent(e)],["set-looping",e=>this._SetLooping(e)],["set-playback-rate",e=>this._SetPlaybackRate(e)],["seek",e=>this._Seek(e)],["preload",e=>this._Preload(e)],["unload",e=>this._Unload(e)],["unload-all",()=>this._UnloadAll()],["set-suspended",e=>this._SetSuspended(e)],["add-effect",e=>this._AddEffect(e)],["set-effect-param",e=>this._SetEffectParam(e)],["remove-effects",e=>this._RemoveEffects(e)],["tick",e=>this._OnTick(e)],["load-state",e=>this._OnLoadState(e)]])}async _CreateAudioContext(e){e.isiOSCordova&&(this._playMusicAsSound=!0),this._timeScaleMode=e.timeScaleMode,this._panningModel=["equalpower","HRTF","soundfield"][e.panningModel],this._distanceModel=["linear","inverse","exponential"][e.distanceModel],this._refDistance=e.refDistance,this._maxDistance=e.maxDistance,this._rolloffFactor=e.rolloffFactor;const t={latencyHint:e.latencyHint};if("undefined"!=typeof AudioContext)this._audioContext=new AudioContext(t);else if("undefined"!=typeof webkitAudioContext)this._audioContext=new webkitAudioContext(t);else throw new Error("Web Audio API not supported");this._destinationNode=this._audioContext.createGain(),this._destinationNode.connect(this._audioContext.destination);const n=e.listenerPos;this._audioContext.listener.setPosition(n[0],n[1],n[2]),this._audioContext.listener.setOrientation(0,0,1,0,-1,0),window.addEventListener("pointerup",this._unblockFunc,!0),window.addEventListener("touchend",this._unblockFunc,!0),window.addEventListener("click",this._unblockFunc,!0),window.addEventListener("keydown",this._unblockFunc,!0),self.C3_GetAudioContextCurrentTime=()=>this.GetAudioCurrentTime();try{await Promise.all(e.preloadList.map(e=>this._GetAudioBuffer(e.originalUrl,e.url,e.type,!1)))}catch(e){console.error("[Construct 3] Preloading sounds failed: ",e)}return{sampleRate:this._audioContext.sampleRate}}_UnblockAudioContext(){if(!this._hasUnblocked){const e=this._audioContext;"suspended"===e.state&&e.resume&&e.resume();const t=e.createBuffer(1,220,22050),n=e.createBufferSource();n.buffer=t,n.connect(e.destination),n.start(0),"running"===e.state&&(this._hasUnblocked=!0,window.removeEventListener("pointerup",this._unblockFunc,!0),window.removeEventListener("touchend",this._unblockFunc,!0),window.removeEventListener("click",this._unblockFunc,!0),window.removeEventListener("keydown",this._unblockFunc,!0),this._unblockFunc=null)}}GetAudioContext(){return this._audioContext}GetAudioCurrentTime(){return this._audioContext.currentTime}GetDestinationNode(){return this._destinationNode}GetDestinationForTag(e){const t=this._effects.get(e.toLowerCase());return t?t[0].GetInputNode():this.GetDestinationNode()}AddEffectForTag(e,t){e=e.toLowerCase();let n=this._effects.get(e);n||(n=[],this._effects.set(e,n)),t._SetIndex(n.length),t._SetTag(e),n.push(t),this._ReconnectEffects(e)}_ReconnectEffects(e){let t=this.GetDestinationNode();const n=this._effects.get(e);if(n&&n.length){t=n[0].GetInputNode();for(let e=0,t=n.length;e{const t=this._audioContext.createBuffer(1,e.length,48e3),n=t.getChannelData(0);return n.set(e),t}):new Promise((t,n)=>{this._audioContext.decodeAudioData(e,t,n)})}TryPlayMedia(e){this._iRuntime.TryPlayMedia(e)}RemovePendingPlay(e){this._iRuntime.RemovePendingPlay(e)}ReleaseInstancesForBuffer(t){let n=0;for(let o=0,e=this._audioInstances.length;on=e);t={pendingCount:0,promise:a,resolve:n},this._pendingTags.set(e,t)}t.pendingCount++}_RemovePendingTag(e){const t=this._pendingTags.get(e);if(!t)throw new Error("expected pending tag");t.pendingCount--,0===t.pendingCount&&(t.resolve(),this._pendingTags.delete(e))}TagReady(e){e||(e=this._lastPlayedTag);const t=this._pendingTags.get(e);return t?t.promise:Promise.resolve()}_MaybeStartTicking(){if(0e.IsActive()).map(e=>e.GetState());this.PostToRuntime("state",{tickCount:this._lastTickCount,audioInstances:t,analysers:[...this._analysers].map(e=>e.GetData())}),0===t.length&&0===this._analysers.size&&this._StopTicking()}PostTrigger(e,t){this.PostToRuntime("trigger",{type:e,tag:t})}async _Play(t){const n=t.originalUrl,a=t.url,o=t.type,r=t.isMusic,e=t.tag,d=t.isLooping,s=t.vol,u=t.pos,i=t.panning;let l=t.off;if(0a||a>=d.length||(d[a].SetParam(o,i,e,r),this._PostUpdatedFxState())}_RemoveEffects(e){const t=e.tag.toLowerCase(),n=this._effects.get(t);if(n&&n.length){for(const e of n)e.Release();this._effects.delete(t),this._ReconnectEffects(t)}}_AddAnalyser(e){this._analysers.add(e),this._MaybeStartTicking()}_RemoveAnalyser(e){this._analysers.delete(e)}_PostUpdatedFxState(){this._isPendingPostFxState||(this._isPendingPostFxState=!0,Promise.resolve().then(()=>this._DoPostUpdatedFxState()))}_DoPostUpdatedFxState(){const e={};for(const[t,n]of this._effects)e[t]=n.map(e=>e.GetState());this.PostToRuntime("fxstate",{fxstate:e}),this._isPendingPostFxState=!1}async _OnLoadState(e){const t=e.saveLoadMode;if(3!==t)for(const e of this._audioInstances)e.IsMusic()&&1===t||!e.IsMusic()&&2===t||e.Stop();for(const t of this._effects.values())for(const e of t)e.Release();this._effects.clear(),this._timeScale=e.timeScale,this._gameTime=e.gameTime;const n=e.listenerPos;this._audioContext.listener.setPosition(n[0],n[1],n[2]),this._isSilent=e.isSilent,this._iRuntime.SetSilent(this._isSilent),this._masterVolume=e.masterVolume;const a=[];for(const t of Object.values(e.effects))a.push(Promise.all(t.map(e=>this._AddEffect(e))));await Promise.all(a),await Promise.all(e.playing.map(e=>this._LoadAudioInstance(e,t))),this._MaybeStartTicking()}async _LoadAudioInstance(t,n){if(3===n)return;const a=t.bufferOriginalUrl,o=t.bufferUrl,r=t.bufferType,e=t.isMusic,d=t.tag,s=t.isLooping,u=t.volume,i=t.playbackTime;if(e&&1===n)return;if(!e&&2===n)return;let l=null;try{l=await this._GetAudioInstance(a,o,r,d,e)}catch(e){return void console.error("[Construct 3] Audio: error loading audio state: ",e)}l.LoadPanState(t.pan),l.Play(s,u,i,0),t.isPlaying||l.Pause(),l._LoadAdditionalState(t)}_OnMicrophoneStream(e,t){this._microphoneSource&&this._microphoneSource.disconnect(),this._microphoneTag=t.toLowerCase(),this._microphoneSource=this._audioContext.createMediaStreamSource(e),this._microphoneSource.connect(this.GetDestinationForTag(this._microphoneTag))}_OnGetOutputStream(){return this._destMediaStreamNode||(this._destMediaStreamNode=this._audioContext.createMediaStreamDestination(),this._destinationNode.connect(this._destMediaStreamNode)),this._destMediaStreamNode.stream}};RuntimeInterface.AddDOMHandlerClass(t)}"use strict",self.C3AudioBuffer=class{constructor(t,n,a,o,i){this._audioDomHandler=t,this._originalUrl=n,this._url=a,this._type=o,this._isMusic=i,this._api="",this._loadState="not-loaded",this._loadPromise=null}Release(){this._loadState="not-loaded",this._audioDomHandler=null,this._loadPromise=null}static Create(t,n,a,o,i){const e="audio/webm; codecs=opus"===o&&!t.SupportsWebMOpus();return i&&e&&t._SetHasAnySoftwareDecodedMusic(),!i||t.IsPlayMusicAsSound()||e?new C3WebAudioBuffer(t,n,a,o,i,e):new C3Html5AudioBuffer(t,n,a,o,i)}CreateInstance(e){return"html5"===this._api?new C3Html5AudioInstance(this._audioDomHandler,this,e):new C3WebAudioInstance(this._audioDomHandler,this,e)}_Load(){}Load(){return this._loadPromise||(this._loadPromise=this._Load()),this._loadPromise}IsLoaded(){}IsLoadedAndDecoded(){}HasFailedToLoad(){return"failed"===this._loadState}GetAudioContext(){return this._audioDomHandler.GetAudioContext()}GetApi(){return this._api}GetOriginalUrl(){return this._originalUrl}GetUrl(){return this._url}GetContentType(){return this._type}IsMusic(){return this._isMusic}GetDuration(){}},"use strict",self.C3Html5AudioBuffer=class extends C3AudioBuffer{constructor(t,n,a,o,i){super(t,n,a,o,i),this._api="html5",this._audioElem=new Audio,this._audioElem.crossOrigin="anonymous",this._audioElem.autoplay=!1,this._audioElem.preload="auto",this._loadResolve=null,this._loadReject=null,this._reachedCanPlayThrough=!1,this._audioElem.addEventListener("canplaythrough",()=>this._reachedCanPlayThrough=!0),this._outNode=this.GetAudioContext().createGain(),this._mediaSourceNode=null,this._audioElem.addEventListener("canplay",()=>{this._loadResolve&&(this._loadState="loaded",this._loadResolve(),this._loadResolve=null,this._loadReject=null),this._mediaSourceNode||!this._audioElem||(this._mediaSourceNode=this.GetAudioContext().createMediaElementSource(this._audioElem),this._mediaSourceNode.connect(this._outNode))}),this.onended=null,this._audioElem.addEventListener("ended",()=>{this.onended&&this.onended()}),this._audioElem.addEventListener("error",e=>this._OnError(e))}Release(){this._audioDomHandler.ReleaseInstancesForBuffer(this),this._outNode.disconnect(),this._outNode=null,this._mediaSourceNode.disconnect(),this._mediaSourceNode=null,this._audioElem&&!this._audioElem.paused&&this._audioElem.pause(),this.onended=null,this._audioElem=null,super.Release()}_Load(){return this._loadState="loading",new Promise((e,t)=>{this._loadResolve=e,this._loadReject=t,this._audioElem.src=this._url})}_OnError(e){console.error(`[Construct 3] Audio '${this._url}' error: `,e),this._loadReject&&(this._loadState="failed",this._loadReject(e),this._loadResolve=null,this._loadReject=null)}IsLoaded(){const e=4<=this._audioElem.readyState;return e&&(this._reachedCanPlayThrough=!0),e||this._reachedCanPlayThrough}IsLoadedAndDecoded(){return this.IsLoaded()}GetAudioElement(){return this._audioElem}GetOutputNode(){return this._outNode}GetDuration(){return this._audioElem.duration}},"use strict",self.C3WebAudioBuffer=class extends C3AudioBuffer{constructor(t,n,a,o,i,e){super(t,n,a,o,i),this._api="webaudio",this._audioData=null,this._audioBuffer=null,this._needsSoftwareDecode=!!e}Release(){this._audioDomHandler.ReleaseInstancesForBuffer(this),this._audioData=null,this._audioBuffer=null,super.Release()}async _Fetch(){if(this._audioData)return this._audioData;const e=this._audioDomHandler.GetRuntimeInterface();if("cordova"===e.GetExportType()&&e.IsRelativeURL(this._url))this._audioData=await e.CordovaFetchLocalFileAsArrayBuffer(this._url);else{const e=await fetch(this._url);if(!e.ok)throw new Error(`error fetching audio data: ${e.status} ${e.statusText}`);this._audioData=await e.arrayBuffer()}}async _Decode(){return this._audioBuffer?this._audioBuffer:void(this._audioBuffer=await this._audioDomHandler.DecodeAudioData(this._audioData,this._needsSoftwareDecode),this._audioData=null)}async _Load(){try{this._loadState="loading",await this._Fetch(),await this._Decode(),this._loadState="loaded"}catch(e){this._loadState="failed",console.error(`[Construct 3] Failed to load audio '${this._url}': `,e)}}IsLoaded(){return!!(this._audioData||this._audioBuffer)}IsLoadedAndDecoded(){return!!this._audioBuffer}GetAudioBuffer(){return this._audioBuffer}GetDuration(){return this._audioBuffer?this._audioBuffer.duration:0}},"use strict";{function t(t){return t*e}const e=180/Math.PI;self.C3AudioInstance=class{constructor(e,t,n){this._audioDomHandler=e,this._buffer=t,this._tag=n,this._gainNode=this.GetAudioContext().createGain(),this._gainNode.connect(this.GetDestinationNode()),this._pannerNode=null,this._isPannerEnabled=!1,this._isStopped=!0,this._isPaused=!1,this._resumeMe=!1,this._isLooping=!1,this._volume=1,this._isMuted=!1,this._playbackRate=1;const a=this._audioDomHandler.GetTimeScaleMode();this._isTimescaled=1===a&&!this.IsMusic()||2===a,this._instUid=-1,this._fadeEndTime=-1,this._stopOnFadeEnd=!1}Release(){this._audioDomHandler=null,this._buffer=null,this._pannerNode&&(this._pannerNode.disconnect(),this._pannerNode=null),this._gainNode.disconnect(),this._gainNode=null}GetAudioContext(){return this._audioDomHandler.GetAudioContext()}GetDestinationNode(){return this._audioDomHandler.GetDestinationForTag(this._tag)}GetMasterVolume(){return this._audioDomHandler.GetMasterVolume()}GetCurrentTime(){return this._isTimescaled?this._audioDomHandler.GetGameTime():performance.now()/1e3}GetOriginalUrl(){return this._buffer.GetOriginalUrl()}GetUrl(){return this._buffer.GetUrl()}GetContentType(){return this._buffer.GetContentType()}GetBuffer(){return this._buffer}IsMusic(){return this._buffer.IsMusic()}SetTag(e){this._tag=e}GetTag(){return this._tag}HasEnded(){}CanBeRecycled(){}IsPlaying(){return!this._isStopped&&!this._isPaused&&!this.HasEnded()}IsActive(){return!this._isStopped&&!this.HasEnded()}GetPlaybackTime(){}GetDuration(e){let t=this._buffer.GetDuration();return e&&(t/=this._playbackRate||.001),t}Play(){}Stop(){}Pause(){}IsPaused(){return this._isPaused}Resume(){}SetVolume(e){this._volume=e,this._gainNode.gain.cancelScheduledValues(0),this._fadeEndTime=-1,this._gainNode.gain.value=this.GetOverallVolume()}FadeVolume(t,n,o){if(!this.IsMuted()){t*=this.GetMasterVolume();const a=this._gainNode.gain;a.cancelScheduledValues(0);const i=this._audioDomHandler.GetAudioCurrentTime(),e=i+n;a.setValueAtTime(a.value,i),a.linearRampToValueAtTime(t,e),this._volume=t,this._fadeEndTime=e,this._stopOnFadeEnd=o}}_UpdateVolume(){this.SetVolume(this._volume)}Tick(e){-1!==this._fadeEndTime&&e>=this._fadeEndTime&&(this._fadeEndTime=-1,this._stopOnFadeEnd&&this.Stop(),this._audioDomHandler.PostTrigger("fade-ended",this._tag))}GetOverallVolume(){const e=this._volume*this.GetMasterVolume();return isFinite(e)?e:0}SetMuted(e){e=!!e,this._isMuted===e||(this._isMuted=e,this._UpdateMuted())}IsMuted(){return this._isMuted}IsSilent(){return this._audioDomHandler.IsSilent()}_UpdateMuted(){}SetLooping(){}IsLooping(){return this._isLooping}SetPlaybackRate(e){this._playbackRate===e||(this._playbackRate=e,this._UpdatePlaybackRate())}_UpdatePlaybackRate(){}GetPlaybackRate(){return this._playbackRate}Seek(){}SetSuspended(){}SetPannerEnabled(e){e=!!e,this._isPannerEnabled===e||(this._isPannerEnabled=e,this._isPannerEnabled?(!this._pannerNode&&(this._pannerNode=this.GetAudioContext().createPanner(),this._pannerNode.panningModel=this._audioDomHandler.GetPanningModel(),this._pannerNode.distanceModel=this._audioDomHandler.GetDistanceModel(),this._pannerNode.refDistance=this._audioDomHandler.GetReferenceDistance(),this._pannerNode.maxDistance=this._audioDomHandler.GetMaxDistance(),this._pannerNode.rolloffFactor=this._audioDomHandler.GetRolloffFactor()),this._gainNode.disconnect(),this._gainNode.connect(this._pannerNode),this._pannerNode.connect(this.GetDestinationNode())):(this._pannerNode.disconnect(),this._gainNode.disconnect(),this._gainNode.connect(this.GetDestinationNode())))}SetPan(n,a,o,i,e,r){this._isPannerEnabled&&(this.SetPanXYA(n,a,o),this._pannerNode.coneInnerAngle=t(i),this._pannerNode.coneOuterAngle=t(e),this._pannerNode.coneOuterGain=r)}SetPanXYA(e,t,n){this._isPannerEnabled&&(this._pannerNode.setPosition(e,t,0),this._pannerNode.setOrientation(Math.cos(n),Math.sin(n),0))}SetUID(e){this._instUid=e}GetUID(){return this._instUid}GetResumePosition(){}Reconnect(e){const t=this._pannerNode||this._gainNode;t.disconnect(),t.connect(e)}GetState(){return{tag:this._tag,duration:this.GetDuration(),volume:this._volume,isPlaying:this.IsPlaying(),playbackTime:this.GetPlaybackTime(),playbackRate:this.GetPlaybackRate(),uid:this._instUid,bufferOriginalUrl:this.GetOriginalUrl(),bufferUrl:"",bufferType:this.GetContentType(),isMusic:this.IsMusic(),isLooping:this.IsLooping(),isMuted:this.IsMuted(),resumePosition:this.GetResumePosition(),pan:this.GetPanState()}}_LoadAdditionalState(e){this.SetPlaybackRate(e.playbackRate),this.SetMuted(e.isMuted)}GetPanState(){if(!this._pannerNode)return null;const e=this._pannerNode;return{pos:[e.positionX.value,e.positionY.value,e.positionZ.value],orient:[e.orientationX.value,e.orientationY.value,e.orientationZ.value],cia:e.coneInnerAngle,coa:e.coneOuterAngle,cog:e.coneOuterGain,uid:this._instUid}}LoadPanState(e){if(!e)return void this.SetPannerEnabled(!1);this.SetPannerEnabled(!0);const t=this._pannerNode;t.setPosition(...t.pos),t.setOrientation(...t.orient),t.coneInnerAngle=t.cia,t.coneOuterAngle=t.coa,t.coneOuterGain=t.cog,this._instUid=t.uid}}}"use strict",self.C3Html5AudioInstance=class extends C3AudioInstance{constructor(e,t,n){super(e,t,n),this._buffer.GetOutputNode().connect(this._gainNode),this._buffer.onended=()=>this._OnEnded()}Release(){this.Stop(),this._buffer.GetOutputNode().disconnect(),super.Release()}GetAudioElement(){return this._buffer.GetAudioElement()}_OnEnded(){this._isStopped=!0,this._instUid=-1,this._audioDomHandler.PostTrigger("ended",this._tag)}HasEnded(){return this.GetAudioElement().ended}CanBeRecycled(){return!!this._isStopped||this.HasEnded()}GetPlaybackTime(e){let t=this.GetAudioElement().currentTime;return e&&(t*=this._playbackRate),this._isLooping||(t=Math.min(t,this.GetDuration())),t}Play(e,t,n){const a=this.GetAudioElement();if(1!==a.playbackRate&&(a.playbackRate=1),a.loop!==e&&(a.loop=e),this.SetVolume(t),a.muted&&(a.muted=!1),a.currentTime!==n)try{a.currentTime=n}catch(e){console.warn(`[Construct 3] Exception seeking audio '${this._buffer.GetUrl()}' to position '${n}': `,e)}this._audioDomHandler.TryPlayMedia(a),this._isStopped=!1,this._isPaused=!1,this._isLooping=e,this._playbackRate=1}Stop(){const e=this.GetAudioElement();e.paused||e.pause(),this._audioDomHandler.RemovePendingPlay(e),this._isStopped=!0,this._isPaused=!1,this._instUid=-1}Pause(){if(!(this._isPaused||this._isStopped||this.HasEnded())){const e=this.GetAudioElement();e.paused||e.pause(),this._audioDomHandler.RemovePendingPlay(e),this._isPaused=!0}}Resume(){!this._isPaused||this._isStopped||this.HasEnded()||(this._audioDomHandler.TryPlayMedia(this.GetAudioElement()),this._isPaused=!1)}_UpdateMuted(){this.GetAudioElement().muted=this._isMuted||this.IsSilent()}SetLooping(e){e=!!e,this._isLooping===e||(this._isLooping=e,this.GetAudioElement().loop=e)}_UpdatePlaybackRate(){let e=this._playbackRate;this._isTimescaled&&(e*=this._audioDomHandler.GetTimeScale());try{this.GetAudioElement().playbackRate=e}catch(t){console.warn(`[Construct 3] Unable to set playback rate '${e}':`,t)}}Seek(e){if(!(this._isStopped||this.HasEnded()))try{this.GetAudioElement().currentTime=e}catch(t){console.warn(`[Construct 3] Error seeking audio to '${e}': `,t)}}GetResumePosition(){return this.GetPlaybackTime()}SetSuspended(e){e?this.IsPlaying()?(this.GetAudioElement().pause(),this._resumeMe=!0):this._resumeMe=!1:this._resumeMe&&(this._audioDomHandler.TryPlayMedia(this.GetAudioElement()),this._resumeMe=!1)}},"use strict",self.C3WebAudioInstance=class extends C3AudioInstance{constructor(e,t,n){super(e,t,n),this._bufferSource=null,this._onended_handler=e=>this._OnEnded(e),this._hasPlaybackEnded=!0,this._activeSource=null,this._startTime=0,this._resumePosition=0,this._muteVol=1}Release(){this.Stop(),this._ReleaseBufferSource(),this._onended_handler=null,super.Release()}_ReleaseBufferSource(){this._bufferSource&&this._bufferSource.disconnect(),this._bufferSource=null,this._activeSource=null}_OnEnded(e){this._isPaused||this._resumeMe||e.target!==this._activeSource||(this._hasPlaybackEnded=!0,this._isStopped=!0,this._instUid=-1,this._ReleaseBufferSource(),this._audioDomHandler.PostTrigger("ended",this._tag))}HasEnded(){return!(!this._isStopped&&this._bufferSource&&this._bufferSource.loop)&&!this._isPaused&&this._hasPlaybackEnded}CanBeRecycled(){return!this._bufferSource||this._isStopped||this.HasEnded()}GetPlaybackTime(e){let t=0;return t=this._isPaused?this._resumePosition:this.GetCurrentTime()-this._startTime,e&&(t*=this._playbackRate),this._isLooping||(t=Math.min(t,this.GetDuration())),t}Play(e,t,n,a){this._muteVol=1,this.SetVolume(t),this._ReleaseBufferSource(),this._bufferSource=this.GetAudioContext().createBufferSource(),this._bufferSource.buffer=this._buffer.GetAudioBuffer(),this._bufferSource.connect(this._gainNode),this._activeSource=this._bufferSource,this._bufferSource.onended=this._onended_handler,this._bufferSource.loop=e,this._bufferSource.start(a,n),this._hasPlaybackEnded=!1,this._isStopped=!1,this._isPaused=!1,this._isLooping=e,this._playbackRate=1,this._startTime=this.GetCurrentTime()-n}Stop(){this._bufferSource&&this._bufferSource.stop(0),this._isStopped=!0,this._isPaused=!1,this._instUid=-1}Pause(){this._isPaused||this._isStopped||this.HasEnded()||(this._resumePosition=this.GetPlaybackTime(!0),this._isLooping&&(this._resumePosition%=this.GetDuration()),this._isPaused=!0,this._bufferSource.stop(0))}Resume(){!this._isPaused||this._isStopped||this.HasEnded()||(this._ReleaseBufferSource(),this._bufferSource=this.GetAudioContext().createBufferSource(),this._bufferSource.buffer=this._buffer.GetAudioBuffer(),this._bufferSource.connect(this._gainNode),this._activeSource=this._bufferSource,this._bufferSource.onended=this._onended_handler,this._bufferSource.loop=this._isLooping,this._UpdateVolume(),this._UpdatePlaybackRate(),this._startTime=this.GetCurrentTime()-this._resumePosition/(this._playbackRate||.001),this._bufferSource.start(0,this._resumePosition),this._isPaused=!1)}GetOverallVolume(){return super.GetOverallVolume()*this._muteVol}_UpdateMuted(){this._muteVol=this._isMuted||this.IsSilent()?0:1,this._UpdateVolume()}SetLooping(e){e=!!e,this._isLooping===e||(this._isLooping=e,this._bufferSource&&(this._bufferSource.loop=e))}_UpdatePlaybackRate(){let e=this._playbackRate;this._isTimescaled&&(e*=this._audioDomHandler.GetTimeScale()),this._bufferSource&&(this._bufferSource.playbackRate.value=e)}Seek(e){this._isStopped||this.HasEnded()||(this._isPaused?this._resumePosition=e:(this.Pause(),this._resumePosition=e,this.Resume()))}GetResumePosition(){return this._resumePosition}SetSuspended(e){e?this.IsPlaying()?(this._resumeMe=!0,this._resumePosition=this.GetPlaybackTime(!0),this._isLooping&&(this._resumePosition%=this.GetDuration()),this._bufferSource.stop(0)):this._resumeMe=!1:this._resumeMe&&(this._ReleaseBufferSource(),this._bufferSource=this.GetAudioContext().createBufferSource(),this._bufferSource.buffer=this._buffer.GetAudioBuffer(),this._bufferSource.connect(this._gainNode),this._activeSource=this._bufferSource,this._bufferSource.onended=this._onended_handler,this._bufferSource.loop=this._isLooping,this._UpdateVolume(),this._UpdatePlaybackRate(),this._startTime=this.GetCurrentTime()-this._resumePosition/(this._playbackRate||.001),this._bufferSource.start(0,this._resumePosition),this._resumeMe=!1)}_LoadAdditionalState(e){super._LoadAdditionalState(e),this._resumePosition=e.resumePosition}},"use strict";{function t(e){return Math.pow(10,e/20)}function n(e){return Math.max(Math.min(t(e),1),0)}function o(e){return 20*(Math.log(e)/2.302585092994046)}function i(e){return o(Math.max(Math.min(e,1),0))}function r(e,t){return 1-Math.exp(-t*e)}class e{constructor(e){this._audioDomHandler=e,this._audioContext=e.GetAudioContext(),this._index=-1,this._tag="",this._type="",this._params=null}Release(){this._audioContext=null}_SetIndex(e){this._index=e}GetIndex(){return this._index}_SetTag(e){this._tag=e}GetTag(){return this._tag}CreateGain(){return this._audioContext.createGain()}GetInputNode(){}ConnectTo(){}SetAudioParam(t,n,a,o){if(t.cancelScheduledValues(0),0===o)return void(t.value=n);const i=this._audioContext.currentTime;o+=i,0===a?t.setValueAtTime(n,o):1===a?(t.setValueAtTime(t.value,i),t.linearRampToValueAtTime(n,o)):2===a?(t.setValueAtTime(t.value,i),t.exponentialRampToValueAtTime(n,o)):void 0}GetState(){return{type:this._type,tag:this._tag,params:this._params}}}self.C3AudioFilterFX=class extends e{constructor(t,n,a,o,i,e,r){super(t),this._type="filter",this._params=[n,a,o,i,e,r],this._inputNode=this.CreateGain(),this._wetNode=this.CreateGain(),this._wetNode.gain.value=r,this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-r,this._filterNode=this._audioContext.createBiquadFilter(),this._filterNode.type=n,this._filterNode.frequency.value=a,this._filterNode.detune.value=o,this._filterNode.Q.value=i,this._filterNode.gain.vlaue=e,this._inputNode.connect(this._filterNode),this._inputNode.connect(this._dryNode),this._filterNode.connect(this._wetNode)}Release(){this._inputNode.disconnect(),this._filterNode.disconnect(),this._wetNode.disconnect(),this._dryNode.disconnect(),super.Release()}ConnectTo(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[5]=t,this.SetAudioParam(this._wetNode.gain,t,n,a),this.SetAudioParam(this._dryNode.gain,1-t,n,a)):1===e?(this._params[1]=t,this.SetAudioParam(this._filterNode.frequency,t,n,a)):2===e?(this._params[2]=t,this.SetAudioParam(this._filterNode.detune,t,n,a)):3===e?(this._params[3]=t,this.SetAudioParam(this._filterNode.Q,t,n,a)):4===e?(this._params[4]=t,this.SetAudioParam(this._filterNode.gain,t,n,a)):void 0}},self.C3AudioDelayFX=class extends e{constructor(e,t,n,a){super(e),this._type="delay",this._params=[t,n,a],this._inputNode=this.CreateGain(),this._wetNode=this.CreateGain(),this._wetNode.gain.value=a,this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-a,this._mainNode=this.CreateGain(),this._delayNode=this._audioContext.createDelay(t),this._delayNode.delayTime.value=t,this._delayGainNode=this.CreateGain(),this._delayGainNode.gain.value=n,this._inputNode.connect(this._mainNode),this._inputNode.connect(this._dryNode),this._mainNode.connect(this._wetNode),this._mainNode.connect(this._delayNode),this._delayNode.connect(this._delayGainNode),this._delayGainNode.connect(this._mainNode)}Release(){this._inputNode.disconnect(),this._wetNode.disconnect(),this._dryNode.disconnect(),this._mainNode.disconnect(),this._delayNode.disconnect(),this._delayGainNode.disconnect(),super.Release()}ConnectTo(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(t,a,o,i){0===t?(a=Math.max(Math.min(a/100,1),0),this._params[2]=a,this.SetAudioParam(this._wetNode.gain,a,o,i),this.SetAudioParam(this._dryNode.gain,1-a,o,i)):4===t?(this._params[1]=n(a),this.SetAudioParam(this._delayGainNode.gain,n(a),o,i)):5===t?(this._params[0]=a,this.SetAudioParam(this._delayNode.delayTime,a,o,i)):void 0}},self.C3AudioConvolveFX=class extends e{constructor(e,t,n,a){super(e),this._type="convolution",this._params=[n,a],this._bufferOriginalUrl="",this._bufferUrl="",this._bufferType="",this._inputNode=this.CreateGain(),this._wetNode=this.CreateGain(),this._wetNode.gain.value=a,this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-a,this._convolveNode=this._audioContext.createConvolver(),this._convolveNode.normalize=n,this._convolveNode.buffer=t,this._inputNode.connect(this._convolveNode),this._inputNode.connect(this._dryNode),this._convolveNode.connect(this._wetNode)}Release(){this._inputNode.disconnect(),this._convolveNode.disconnect(),this._wetNode.disconnect(),this._dryNode.disconnect(),super.Release()}ConnectTo(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[1]=t,this.SetAudioParam(this._wetNode.gain,t,n,a),this.SetAudioParam(this._dryNode.gain,1-t,n,a)):void 0}_SetBufferInfo(e,t,n){this._bufferOriginalUrl=e,this._bufferUrl=t,this._bufferType=n}GetState(){const e=super.GetState();return e.bufferOriginalUrl=this._bufferOriginalUrl,e.bufferUrl="",e.bufferType=this._bufferType,e}},self.C3AudioFlangerFX=class extends e{constructor(t,n,a,o,i,e){super(t),this._type="flanger",this._params=[n,a,o,i,e],this._inputNode=this.CreateGain(),this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-e/2,this._wetNode=this.CreateGain(),this._wetNode.gain.value=e/2,this._feedbackNode=this.CreateGain(),this._feedbackNode.gain.value=i,this._delayNode=this._audioContext.createDelay(n+a),this._delayNode.delayTime.value=n,this._oscNode=this._audioContext.createOscillator(),this._oscNode.frequency.value=o,this._oscGainNode=this.CreateGain(),this._oscGainNode.gain.value=a,this._inputNode.connect(this._delayNode),this._inputNode.connect(this._dryNode),this._delayNode.connect(this._wetNode),this._delayNode.connect(this._feedbackNode),this._feedbackNode.connect(this._delayNode),this._oscNode.connect(this._oscGainNode),this._oscGainNode.connect(this._delayNode.delayTime),this._oscNode.start(0)}Release(){this._oscNode.stop(0),this._inputNode.disconnect(),this._delayNode.disconnect(),this._oscNode.disconnect(),this._oscGainNode.disconnect(),this._dryNode.disconnect(),this._wetNode.disconnect(),this._feedbackNode.disconnect(),super.Release()}ConnectTo(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[4]=t,this.SetAudioParam(this._wetNode.gain,t/2,n,a),this.SetAudioParam(this._dryNode.gain,1-t/2,n,a)):6===e?(this._params[1]=t/1e3,this.SetAudioParam(this._oscGainNode.gain,t/1e3,n,a)):7===e?(this._params[2]=t,this.SetAudioParam(this._oscNode.frequency,t,n,a)):8===e?(this._params[3]=t/100,this.SetAudioParam(this._feedbackNode.gain,t/100,n,a)):void 0}},self.C3AudioPhaserFX=class extends e{constructor(t,n,a,o,i,e,r){super(t),this._type="phaser",this._params=[n,a,o,i,e,r],this._inputNode=this.CreateGain(),this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-r/2,this._wetNode=this.CreateGain(),this._wetNode.gain.value=r/2,this._filterNode=this._audioContext.createBiquadFilter(),this._filterNode.type="allpass",this._filterNode.frequency.value=n,this._filterNode.detune.value=a,this._filterNode.Q.value=o,this._oscNode=this._audioContext.createOscillator(),this._oscNode.frequency.value=e,this._oscGainNode=this.CreateGain(),this._oscGainNode.gain.value=i,this._inputNode.connect(this._filterNode),this._inputNode.connect(this._dryNode),this._filterNode.connect(this._wetNode),this._oscNode.connect(this._oscGainNode),this._oscGainNode.connect(this._filterNode.frequency),this._oscNode.start(0)}Release(){this._oscNode.stop(0),this._inputNode.disconnect(),this._filterNode.disconnect(),this._oscNode.disconnect(),this._oscGainNode.disconnect(),this._dryNode.disconnect(),this._wetNode.disconnect(),super.Release()}ConnectTo(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[5]=t,this.SetAudioParam(this._wetNode.gain,t/2,n,a),this.SetAudioParam(this._dryNode.gain,1-t/2,n,a)):1===e?(this._params[0]=t,this.SetAudioParam(this._filterNode.frequency,t,n,a)):2===e?(this._params[1]=t,this.SetAudioParam(this._filterNode.detune,t,n,a)):3===e?(this._params[2]=t,this.SetAudioParam(this._filterNode.Q,t,n,a)):6===e?(this._params[3]=t,this.SetAudioParam(this._oscGainNode.gain,t,n,a)):7===e?(this._params[4]=t,this.SetAudioParam(this._oscNode.frequency,t,n,a)):void 0}},self.C3AudioGainFX=class extends e{constructor(e,t){super(e),this._type="gain",this._params=[t],this._node=this.CreateGain(),this._node.gain.value=t}Release(){this._node.disconnect(),super.Release()}ConnectTo(e){this._node.disconnect(),this._node.connect(e)}GetInputNode(){return this._node}SetParam(t,a,o,i){4===t?(this._params[0]=n(a),this.SetAudioParam(this._node.gain,n(a),o,i)):void 0}},self.C3AudioTremoloFX=class extends e{constructor(e,t,n){super(e),this._type="tremolo",this._params=[t,n],this._node=this.CreateGain(),this._node.gain.value=1-n/2,this._oscNode=this._audioContext.createOscillator(),this._oscNode.frequency.value=t,this._oscGainNode=this.CreateGain(),this._oscGainNode.gain.value=n/2,this._oscNode.connect(this._oscGainNode),this._oscGainNode.connect(this._node.gain),this._oscNode.start(0)}Release(){this._oscNode.stop(0),this._oscNode.disconnect(),this._oscGainNode.disconnect(),this._node.disconnect(),super.Release()}ConnectTo(e){this._node.disconnect(),this._node.connect(e)}GetInputNode(){return this._node}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[1]=t,this.SetAudioParam(this._node.gain.value,1-t/2,n,a),this.SetAudioParam(this._oscGainNode.gain.value,t/2,n,a)):7===e?(this._params[0]=t,this.SetAudioParam(this._oscNode.frequency,t,n,a)):void 0}},self.C3AudioRingModFX=class extends e{constructor(e,t,n){super(e),this._type="ringmod",this._params=[t,n],this._inputNode=this.CreateGain(),this._wetNode=this.CreateGain(),this._wetNode.gain.value=n,this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-n,this._ringNode=this.CreateGain(),this._ringNode.gain.value=0,this._oscNode=this._audioContext.createOscillator(),this._oscNode.frequency.value=t,this._oscNode.connect(this._ringNode.gain),this._oscNode.start(0),this._inputNode.connect(this._ringNode),this._inputNode.connect(this._dryNode),this._ringNode.connect(this._wetNode)}Release(){this._oscNode.stop(0),this._oscNode.disconnect(),this._ringNode.disconnect(),this._inputNode.disconnect(),this._wetNode.disconnect(),this._dryNode.disconnect(),super.Release()}ConnectTo(e){this._wetNode.disconnect(),this._wetNode.connect(e),this._dryNode.disconnect(),this._dryNode.connect(e)}GetInputNode(){return this._inputNode}SetParam(e,t,n,a){0===e?(t=Math.max(Math.min(t/100,1),0),this._params[1]=t,this.SetAudioParam(this._wetNode.gain,t,n,a),this.SetAudioParam(this._dryNode.gain,1-t,n,a)):7===e?(this._params[0]=t,this.SetAudioParam(this._oscNode.frequency,t,n,a)):void 0}},self.C3AudioDistortionFX=class extends e{constructor(t,n,a,o,i,e){super(t),this._type="distortion",this._params=[n,a,o,i,e],this._inputNode=this.CreateGain(),this._preGain=this.CreateGain(),this._postGain=this.CreateGain(),this._SetDrive(o,i),this._wetNode=this.CreateGain(),this._wetNode.gain.value=e,this._dryNode=this.CreateGain(),this._dryNode.gain.value=1-e,this._waveShaper=this._audioContext.createWaveShaper(),this._curve=new Float32Array(65536),this._GenerateColortouchCurve(n,a),this._waveShaper.curve=this._curve,this._inputNode.connect(this._preGain),this._inputNode.connect(this._dryNode),this._preGain.connect(this._waveShaper),this._waveShaper.connect(this._postGain),this._postGain.connect(this._wetNode)}Release(){this._inputNode.disconnect(),this._preGain.disconnect(),this._waveShaper.disconnect(),this._postGain.disconnect(),this._wetNode.disconnect(),this._dryNode.disconnect(),super.Release()}_SetDrive(e,t){.01>e&&(e=.01),this._preGain.gain.value=e,this._postGain.gain.value=Math.pow(1/e,.6)*t}_GenerateColortouchCurve(e,t){for(let n,a=0;32768>a;++a)n=a/32768,n=this._Shape(n,e,t),this._curve[32768+a]=n,this._curve[32768-a-1]=-n}_Shape(e,t,n){const a=1.05*n*t-t,o=0>e?-1:1,i=0>e?-e:e;let d=in&&(n=-n),this._peakthis._OnChangeCursorStyle(e))}_OnChangeCursorStyle(e){document.body.style.cursor=e}};RuntimeInterface.AddDOMHandlerClass(e)}{const e=class extends DOMHandler{constructor(e){super(e,"touch"),this.AddRuntimeMessageHandler("request-permission",e=>this._OnRequestPermission(e))}async _OnRequestPermission(e){const t=e.type;let n=!0;0===t?n=await this._RequestOrientationPermission():1===t&&(n=await this._RequestMotionPermission()),this.PostToRuntime("permission-result",{type:t,result:n})}async _RequestOrientationPermission(){if(!self.DeviceOrientationEvent||!self.DeviceOrientationEvent.requestPermission)return!0;try{const e=await self.DeviceOrientationEvent.requestPermission();return"granted"===e}catch(e){return console.warn("[Touch] Failed to request orientation permission: ",e),!1}}async _RequestMotionPermission(){if(!self.DeviceMotionEvent||!self.DeviceMotionEvent.requestPermission)return!0;try{const e=await self.DeviceMotionEvent.requestPermission();return"granted"===e}catch(e){return console.warn("[Touch] Failed to request motion permission: ",e),!1}}};RuntimeInterface.AddDOMHandlerClass(e)}{const e=class extends DOMHandler{constructor(e){super(e,"browser"),this._exportType="",this.AddRuntimeMessageHandler("get-initial-state",e=>this._OnGetInitialState(e)),this.AddRuntimeMessageHandler("ready-for-sw-messages",()=>this._OnReadyForSWMessages()),this.AddRuntimeMessageHandler("alert",e=>this._OnAlert(e)),this.AddRuntimeMessageHandler("close",()=>this._OnClose()),this.AddRuntimeMessageHandler("set-focus",e=>this._OnSetFocus(e)),this.AddRuntimeMessageHandler("vibrate",e=>this._OnVibrate(e)),this.AddRuntimeMessageHandler("lock-orientation",e=>this._OnLockOrientation(e)),this.AddRuntimeMessageHandler("unlock-orientation",()=>this._OnUnlockOrientation()),this.AddRuntimeMessageHandler("navigate",e=>this._OnNavigate(e)),this.AddRuntimeMessageHandler("request-fullscreen",e=>this._OnRequestFullscreen(e)),this.AddRuntimeMessageHandler("exit-fullscreen",()=>this._OnExitFullscreen()),window.addEventListener("online",()=>this._OnOnlineStateChanged(!0)),window.addEventListener("offline",()=>this._OnOnlineStateChanged(!1)),document.addEventListener("backbutton",()=>this._OnCordovaBackButton()),"undefined"!=typeof Windows&&Windows.UI.Core.SystemNavigationManager.getForCurrentView().addEventListener("backrequested",e=>this._OnWin10BackRequested(e))}_OnGetInitialState(e){return this._exportType=e.exportType,{location:location.toString(),isOnline:!!navigator.onLine,referrer:document.referrer,title:document.title,isCookieEnabled:!!navigator.cookieEnabled,screenWidth:screen.width,screenHeight:screen.height,windowOuterWidth:window.outerWidth,windowOuterHeight:window.outerHeight,isScirraArcade:"undefined"!=typeof window.is_scirra_arcade}}_OnReadyForSWMessages(){window.C3_RegisterSW&&window.OfflineClientInfo&&window.OfflineClientInfo.SetMessageCallback(e=>this.PostToRuntime("sw-message",e.data))}_OnOnlineStateChanged(e){this.PostToRuntime("online-state",{isOnline:e})}_OnCordovaBackButton(){this.PostToRuntime("backbutton")}_OnWin10BackRequested(e){e.handled=!0,this.PostToRuntime("backbutton")}GetNWjsWindow(){return"nwjs"===this._exportType?nw.Window.get():null}_OnAlert(e){alert(e.message)}_OnClose(){navigator.app&&navigator.app.exitApp?navigator.app.exitApp():navigator.device&&navigator.device.exitApp?navigator.device.exitApp():window.close()}_OnSetFocus(e){const t=e.isFocus;if("nwjs"===this._exportType){const e=this.GetNWjsWindow();t?e.focus():e.blur()}else t?window.focus():window.blur()}_OnVibrate(e){navigator.vibrate&&navigator.vibrate(e.pattern)}_OnLockOrientation(e){const t=e.orientation;if(screen.orientation&&screen.orientation.lock)screen.orientation.lock(t).catch(e=>console.warn("[Construct 3] Failed to lock orientation: ",e));else try{let e=!1;screen.lockOrientation?e=screen.lockOrientation(t):screen.webkitLockOrientation?e=screen.webkitLockOrientation(t):screen.mozLockOrientation?e=screen.mozLockOrientation(t):screen.msLockOrientation&&(e=screen.msLockOrientation(t)),e||console.warn("[Construct 3] Failed to lock orientation")}catch(e){console.warn("[Construct 3] Failed to lock orientation: ",e)}}_OnUnlockOrientation(){try{screen.orientation&&screen.orientation.unlock?screen.orientation.unlock():screen.unlockOrientation?screen.unlockOrientation():screen.webkitUnlockOrientation?screen.webkitUnlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()}catch(e){}}_OnNavigate(e){const t=e.type;if("back"===t)navigator.app&&navigator.app.backHistory?navigator.app.backHistory():window.back();else if("forward"===t)window.forward();else if("home"===t)window.home();else if("reload"===t)location.reload();else if("url"===t){const t=e.url,n=e.target,a=e.exportType;"windows-uwp"===a&&"undefined"!=typeof Windows?Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(t)):"cordova"===a?window.open(t,"_system"):"preview"===a?window.open(t,"_blank"):!this._isScirraArcade&&(2===n?window.top.location=t:1===n?window.parent.location=t:window.location=t)}else if("new-window"===t){const t=e.url,n=e.tag,a=e.exportType;"windows-uwp"===a&&"undefined"!=typeof Windows?Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(t)):"cordova"===a?window.open(t,"_system"):window.open(t,n)}}_OnRequestFullscreen(e){const t={navigationUI:"auto"},n=e.navUI;1===n?t.navigationUI="hide":2===n&&(t.navigationUI="show");const a=document.documentElement;a.requestFullscreen?a.requestFullscreen(t):a.mozRequestFullScreen?a.mozRequestFullScreen(t):a.msRequestFullscreen?a.msRequestFullscreen(t):a.webkitRequestFullScreen&&("undefined"==typeof Element.ALLOW_KEYBOARD_INPUT?a.webkitRequestFullScreen():a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT))}_OnExitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}};RuntimeInterface.AddDOMHandlerClass(e)} \ No newline at end of file diff --git a/soccerrandom/scripts/offlineclient.js b/soccerrandom/scripts/offlineclient.js new file mode 100644 index 00000000..d8c3274b --- /dev/null +++ b/soccerrandom/scripts/offlineclient.js @@ -0,0 +1 @@ +"use strict";{window.OfflineClientInfo=new class{constructor(){if(this._broadcastChannel="undefined"==typeof BroadcastChannel?null:new BroadcastChannel("offline"),this._queuedMessages=[],this._onMessageCallback=null,this._broadcastChannel){var a=this;this._broadcastChannel.onmessage=function(b){a._OnBroadcastChannelMessage(b)}}}_OnBroadcastChannelMessage(a){return this._onMessageCallback?void this._onMessageCallback(a):void this._queuedMessages.push(a)}SetMessageCallback(a){this._onMessageCallback=a;for(let b of this._queuedMessages)this._onMessageCallback(b);this._queuedMessages.length=0}}} \ No newline at end of file diff --git a/soccerrandom/scripts/register-sw.js b/soccerrandom/scripts/register-sw.js new file mode 100644 index 00000000..aeb70f5b --- /dev/null +++ b/soccerrandom/scripts/register-sw.js @@ -0,0 +1 @@ +"use strict";window.C3_RegisterSW=async function(){if(navigator.serviceWorker)try{const a=await navigator.serviceWorker.register("sw.js",{scope:"./"});console.info("Registered service worker on "+a.scope)}catch(a){console.warn("Failed to register service worker: ",a)}}; \ No newline at end of file diff --git a/soccerrandom/scripts/supportcheck.js b/soccerrandom/scripts/supportcheck.js new file mode 100644 index 00000000..a17ff0a7 --- /dev/null +++ b/soccerrandom/scripts/supportcheck.js @@ -0,0 +1 @@ +"use strict";(function(){var a=!!document.querySelector("script[src*=\"kaspersky\"]"),b=document.createElement("canvas"),c=!!(b.getContext("webgl")||b.getContext("experimental-webgl")),d=[];if(c||d.push("WebGL"),"undefined"==typeof WebAssembly&&d.push("WebAssembly"),0===d.length&&!a)window["C3_IsSupported"]=!0;else{var e=document.createElement("div");e.id="notSupportedWrap",document.body.appendChild(e);var f=document.createElement("h2");f.id="notSupportedTitle",f.textContent=a?"Kaspersky Internet Security broke this export":"Software update needed",e.appendChild(f);var g=document.createElement("p");g.className="notSupportedMessage";var h="This content is not supported because your device's software is out-of-date. ",i=navigator.userAgent;/android/i.test(i)?h+="

On Android, fix this by making sure the
Android System Webview app has updates enabled and is up-to-date.":/iphone|ipad|ipod/i.test(i)?h+="

Note: the iOS simulator is not currently supported due to an Apple bug. If you are using the simulator, try testing on a real device instead.":(/msie/i.test(i)||/trident/i.test(i))&&!/edge\//i.test(i)?h+="

Note: Internet Explorer is not supported. Try using Chrome or Firefox instead.":a?h="It appears a script was added to this export by Kaspersky software. This prevents the exported project from working. Try disabling Kaspersky and exporting again.":h+="Try installing any available software updates. Alternatively try on a different device.",h+="

Missing features: "+d.join(", ")+"
User agent: "+navigator.userAgent+"
",g.innerHTML=h,e.appendChild(g)}})(); \ No newline at end of file diff --git a/soccerrandom/style.css b/soccerrandom/style.css new file mode 100644 index 00000000..1e9e0074 --- /dev/null +++ b/soccerrandom/style.css @@ -0,0 +1,39 @@ +html, body { + padding: 0; + margin: 0; + overflow: hidden; + + background: #000000; + color: white; +} + +html, body, canvas { + touch-action: none; + touch-action-delay: none; +} + +#notSupportedWrap { + margin: 2em auto 1em auto; + width: 75%; + max-width: 45em; + border: 2px solid #aaa; + border-radius: 1em; + padding: 2em; + background-color: #f0f0f0; + font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif; + color: black; +} + +#notSupportedTitle { + font-size: 1.8em; +} + +.notSupportedMessage { + font-size: 1.2em; +} + +.notSupportedMessage em { + color: #888; +} + + diff --git a/soccerrandom/sw.js b/soccerrandom/sw.js new file mode 100644 index 00000000..43669971 --- /dev/null +++ b/soccerrandom/sw.js @@ -0,0 +1 @@ +"use strict";const OFFLINE_DATA_FILE="offline.json",CACHE_NAME_PREFIX="c3offline",BROADCASTCHANNEL_NAME="offline",CONSOLE_PREFIX="[SW] ",LAZYLOAD_KEYNAME="",broadcastChannel="undefined"==typeof BroadcastChannel?null:new BroadcastChannel("offline");function PostBroadcastMessage(a){broadcastChannel&&setTimeout(()=>broadcastChannel.postMessage(a),3e3)}function Broadcast(a){PostBroadcastMessage({"type":a})}function BroadcastDownloadingUpdate(a){PostBroadcastMessage({"type":"downloading-update","version":a})}function BroadcastUpdateReady(a){PostBroadcastMessage({"type":"update-ready","version":a})}function IsUrlInLazyLoadList(a,b){if(!b)return!1;try{for(const c of b)if(new RegExp(c).test(a))return!0}catch(a){console.error("[SW] Error matching in lazy-load list: ",a)}return!1}function WriteLazyLoadListToStorage(a){return"undefined"==typeof localforage?Promise.resolve():localforage.setItem(LAZYLOAD_KEYNAME,a)}function ReadLazyLoadListFromStorage(){return"undefined"==typeof localforage?Promise.resolve([]):localforage.getItem(LAZYLOAD_KEYNAME)}function GetCacheBaseName(){return"c3offline-"+self.registration.scope}function GetCacheVersionName(a){return GetCacheBaseName()+"-v"+a}async function GetAvailableCacheNames(){const a=await caches.keys(),b=GetCacheBaseName();return a.filter((a)=>a.startsWith(b))}async function IsUpdatePending(){const a=await GetAvailableCacheNames();return 2<=a.length}async function GetMainPageUrl(){const a=await clients.matchAll({includeUncontrolled:!0,type:"window"});for(const b of a){let a=b.url;if(a.startsWith(self.registration.scope)&&(a=a.substring(self.registration.scope.length)),a&&"/"!==a)return a.startsWith("?")&&(a="/"+a),a}return""}function fetchWithBypass(a,b){return"string"==typeof a&&(a=new Request(a)),b?fetch(a.url,{headers:a.headers,mode:a.mode,credentials:a.credentials,redirect:a.redirect,cache:"no-store"}):fetch(a)}async function CreateCacheFromFileList(a,b,c){const d=await Promise.all(b.map((a)=>fetchWithBypass(a,c)));let e=!0;for(const f of d)f.ok||(e=!1,console.error("[SW] Error fetching '"+f.url+"' ("+f.status+" "+f.statusText+")"));if(!e)throw new Error("not all resources were fetched successfully");const f=await caches.open(a);try{return await Promise.all(d.map((a,c)=>f.put(b[c],a)))}catch(b){throw console.error("[SW] Error writing cache entries: ",b),caches.delete(a),b}}async function UpdateCheck(a){try{const b=await fetchWithBypass(OFFLINE_DATA_FILE,!0);if(!b.ok)throw new Error("offline.json responded with "+b.status+" "+b.statusText);const c=await b.json(),d=c.version,e=c.fileList,f=c.lazyLoad,g=GetCacheVersionName(d),h=await caches.has(g);if(h){const a=await IsUpdatePending();return void(a?(console.log("[SW] Update pending"),Broadcast("update-pending")):(console.log("[SW] Up to date"),Broadcast("up-to-date")))}const i=await GetMainPageUrl();e.unshift("./"),i&&-1===e.indexOf(i)&&e.unshift(i),console.log("[SW] Caching "+e.length+" files for offline use"),a?Broadcast("downloading"):BroadcastDownloadingUpdate(d),f&&(await WriteLazyLoadListToStorage(f)),await CreateCacheFromFileList(g,e,!a);const j=await IsUpdatePending();j?(console.log("[SW] All resources saved, update ready"),BroadcastUpdateReady(d)):(console.log("[SW] All resources saved, offline support ready"),Broadcast("offline-ready"))}catch(a){console.warn("[SW] Update check failed: ",a)}}self.addEventListener("install",(a)=>{a.waitUntil(UpdateCheck(!0).catch(()=>null))});async function GetCacheNameToUse(a,b){if(1===a.length||!b)return a[0];const c=await clients.matchAll();if(1caches.delete(a))),d}async function HandleFetch(a,b){const c=await GetAvailableCacheNames();if(!c.length)return fetch(a.request);const d=await GetCacheNameToUse(c,b),e=await caches.open(d),f=await e.match(a.request);if(f)return f;const g=await Promise.all([fetch(a.request),ReadLazyLoadListFromStorage()]),h=g[0],i=g[1];if(IsUrlInLazyLoadList(a.request.url,i))try{await e.put(a.request,h.clone())}catch(b){console.warn("[SW] Error caching '"+a.request.url+"': ",b)}return h}self.addEventListener("fetch",(a)=>{if(new URL(a.request.url).origin===location.origin){const b="navigate"===a.request.mode,c=HandleFetch(a,b);b&&a.waitUntil(c.then(()=>UpdateCheck(!1))),a.respondWith(c)}}); \ No newline at end of file