wao 0.40.2 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/cjs/accounts-web.js +25 -0
  2. package/cjs/accounts.js +38 -0
  3. package/cjs/adaptor-base.js +504 -287
  4. package/cjs/adaptor-cf.js +42 -0
  5. package/cjs/ao-loader.js +1 -1
  6. package/cjs/ao.js +18 -6
  7. package/cjs/aoconnect-base.js +1010 -546
  8. package/cjs/aoconnect-cf.js +24 -0
  9. package/cjs/ar-remote.js +277 -0
  10. package/cjs/armem-base.js +822 -211
  11. package/cjs/armem-cf.js +128 -0
  12. package/cjs/armem.js +11 -5
  13. package/cjs/bar.js +511 -173
  14. package/cjs/car.js +37 -0
  15. package/cjs/cf-env.js +54 -0
  16. package/cjs/cf.js +76 -0
  17. package/cjs/cli.js +12 -6
  18. package/cjs/create.js +1 -1
  19. package/cjs/devs.js +53 -0
  20. package/cjs/dodb.js +116 -0
  21. package/cjs/hb.js +136 -53
  22. package/cjs/hyperbeam.js +85 -44
  23. package/cjs/keygen.js +94 -0
  24. package/cjs/run.js +4 -1
  25. package/cjs/server.js +40 -9
  26. package/cjs/storage-multi.js +525 -0
  27. package/cjs/tgql-d1.js +664 -0
  28. package/cjs/tgql.js +293 -172
  29. package/cjs/workspace/.claude/agents/tester.md +2 -2
  30. package/cjs/workspace/.claude/skills/build/SKILL.md +2 -2
  31. package/cjs/workspace/.claude/skills/test/SKILL.md +3 -2
  32. package/cjs/workspace/CLAUDE.md +2 -2
  33. package/cjs/workspace/README.md +1 -1
  34. package/cjs/workspace/docs/debug.md +9 -4
  35. package/cjs/workspace/docs/hyperbeam-devices.md +50 -1
  36. package/cjs/workspace/package.json +3 -3
  37. package/esm/accounts-web.js +14 -0
  38. package/esm/accounts.js +27 -0
  39. package/esm/adaptor-base.js +129 -31
  40. package/esm/adaptor-cf.js +11 -0
  41. package/esm/ao-loader.js +1 -1
  42. package/esm/ao.js +21 -2
  43. package/esm/aoconnect-base.js +248 -7
  44. package/esm/aoconnect-cf.js +9 -0
  45. package/esm/ar-remote.js +87 -0
  46. package/esm/armem-base.js +304 -53
  47. package/esm/armem-cf.js +67 -0
  48. package/esm/armem.js +7 -2
  49. package/esm/bar.js +126 -16
  50. package/esm/car.js +10 -0
  51. package/esm/cf-env.js +29 -0
  52. package/esm/cf.js +11 -0
  53. package/esm/cli.js +6 -2
  54. package/esm/create.js +1 -1
  55. package/esm/devs.js +15 -0
  56. package/esm/dodb.js +26 -0
  57. package/esm/hb.js +93 -16
  58. package/esm/hyperbeam.js +68 -30
  59. package/esm/keygen.js +47 -0
  60. package/esm/run.js +4 -1
  61. package/esm/server.js +29 -9
  62. package/esm/storage-multi.js +183 -0
  63. package/esm/tgql-d1.js +407 -0
  64. package/esm/tgql.js +29 -10
  65. package/esm/workspace/.claude/agents/tester.md +2 -2
  66. package/esm/workspace/.claude/skills/build/SKILL.md +2 -2
  67. package/esm/workspace/.claude/skills/test/SKILL.md +3 -2
  68. package/esm/workspace/CLAUDE.md +2 -2
  69. package/esm/workspace/README.md +1 -1
  70. package/esm/workspace/docs/debug.md +9 -4
  71. package/esm/workspace/docs/hyperbeam-devices.md +50 -1
  72. package/esm/workspace/package.json +3 -3
  73. package/package.json +10 -3
  74. package/postinstall.cjs +84 -0
package/cjs/ao-loader.js CHANGED
@@ -56,7 +56,7 @@ ungotten:[],error:false});if(stream.stream_ops.open){stream.stream_ops.open(stre
56
56
  };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.length<digits){str=character[0]+str;}return str;}function leadingNulls(value,digits){return leadingSomething(value,digits,"0");}function compareByDay(date1,date2){function sgn(value){return value<0?-1:value>0?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(date2){var thisDate=__addDays(new Date(date2.tm_year+1900,0,1),date2.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 a(date2){return WEEKDAYS[date2.tm_wday].substring(0,3);},"%A":function A(date2){return WEEKDAYS[date2.tm_wday];},"%b":function b(date2){return MONTHS[date2.tm_mon].substring(0,3);},"%B":function B(date2){return MONTHS[date2.tm_mon];},"%C":function C(date2){var year=date2.tm_year+1900;return leadingNulls(year/100|0,2);},"%d":function d(date2){return leadingNulls(date2.tm_mday,2);},"%e":function e(date2){return leadingSomething(date2.tm_mday,2," ");},"%g":function g(date2){return getWeekBasedYear(date2).toString().substring(2);},"%G":function G(date2){return getWeekBasedYear(date2);},"%H":function H(date2){return leadingNulls(date2.tm_hour,2);},"%I":function I(date2){var twelveHour=date2.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2);},"%j":function j(date2){return leadingNulls(date2.tm_mday+__arraySum(__isLeapYear(date2.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date2.tm_mon-1),3);},"%m":function m(date2){return leadingNulls(date2.tm_mon+1,2);},"%M":function M(date2){return leadingNulls(date2.tm_min,2);},"%n":function n(){return"\n";},"%p":function p(date2){if(date2.tm_hour>=0&&date2.tm_hour<12){return"AM";}else{return"PM";}},"%S":function S(date2){return leadingNulls(date2.tm_sec,2);},"%t":function t(){return" ";},"%u":function u(date2){return date2.tm_wday||7;},"%U":function U(date2){var days=date2.tm_yday+7-date2.tm_wday;return leadingNulls(Math.floor(days/7),2);},"%V":function V(date2){var val=Math.floor((date2.tm_yday+7-(date2.tm_wday+6)%7)/7);if((date2.tm_wday+371-date2.tm_yday-2)%7<=2){val++;}if(!val){val=52;var dec31=(date2.tm_wday+7-date2.tm_yday-1)%7;if(dec31==4||dec31==5&&__isLeapYear(date2.tm_year%400-1)){val++;}}else if(val==53){var jan1=(date2.tm_wday+371-date2.tm_yday)%7;if(jan1!=4&&(jan1!=3||!__isLeapYear(date2.tm_year)))val=1;}return leadingNulls(val,2);},"%w":function w(date2){return date2.tm_wday;},"%W":function W(date2){var days=date2.tm_yday+7-(date2.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2);},"%y":function y(date2){return(date2.tm_year+1900).toString().substring(2);},"%Y":function Y(date2){return date2.tm_year+1900;},"%z":function z(date2){var off=date2.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4);},"%Z":function Z(date2){return date2.tm_zone;},"%%":function _(){return"%";}};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date));}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0;}writeArrayToMemory(bytes,s);return bytes.length-1;}function _system(command){if(false){if(!command)return 1;var cmdstr=UTF8ToString(command);if(!cmdstr.length)return 0;var cp=null;var ret=cp.spawnSync(cmdstr,[],{shell:true,stdio:"inherit"});var _W_EXITCODE=function _W_EXITCODE(ret2,sig){return ret2<<8|sig;};if(ret.status===null){var signalToNumber=function signalToNumber(sig){switch(sig){case"SIGHUP":return 1;case"SIGINT":return 2;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15;}return 2;};return _W_EXITCODE(0,signalToNumber(ret.signal));}return _W_EXITCODE(ret.status,0);}if(!command)return 0;setErrNo(52);return-1;}var FSNode=/** @constructor */function FSNode(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;};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:/** @this{FSNode} */function get(){return(this.mode&readMode)===readMode;},set:/** @this{FSNode} */function set(val){val?this.mode|=readMode:this.mode&=~readMode;}},write:{get:/** @this{FSNode} */function get(){return(this.mode&writeMode)===writeMode;},set:/** @this{FSNode} */function set(val){val?this.mode|=writeMode:this.mode&=~writeMode;}},isFolder:{get:/** @this{FSNode} */function get(){return FS.isDir(this.mode);}},isDevice:{get:/** @this{FSNode} */function get(){return FS.isChrdev(this.mode);}}});FS.FSNode=FSNode;FS.staticInit();ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var ASSERTIONS=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;}function intArrayToString(array){var ret=[];for(var i=0;i<array.length;i++){var chr=array[i];if(chr>255){if(ASSERTIONS){assert(false,"Character code "+chr+" ("+String.fromCharCode(chr)+") at offset "+i+" not in 0x00-0xFF.");}chr&=255;}ret.push(String.fromCharCode(chr));}return ret.join("");}function checkIncomingModuleAPI(){ignoredModuleProp("fetchSettings");}var asmLibraryArg={__assert_fail:___assert_fail,__syscall_chmod:___syscall_chmod,__syscall_dup3:___syscall_dup3,__syscall_faccessat:___syscall_faccessat,__syscall_fchmod:___syscall_fchmod,__syscall_fchown32:___syscall_fchown32,__syscall_fcntl64:___syscall_fcntl64,__syscall_fstat64:___syscall_fstat64,__syscall_ftruncate64:___syscall_ftruncate64,__syscall_getcwd:___syscall_getcwd,__syscall_ioctl:___syscall_ioctl,__syscall_lstat64:___syscall_lstat64,__syscall_mkdirat:___syscall_mkdirat,__syscall_newfstatat:___syscall_newfstatat,__syscall_openat:___syscall_openat,__syscall_readlinkat:___syscall_readlinkat,__syscall_renameat:___syscall_renameat,__syscall_rmdir:___syscall_rmdir,__syscall_stat64:___syscall_stat64,__syscall_unlinkat:___syscall_unlinkat,__syscall_utimensat:___syscall_utimensat,_dlinit:__dlinit,_dlopen_js:__dlopen_js,_dlsym_js:__dlsym_js,_emscripten_date_now:__emscripten_date_now,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_gmtime_js:__gmtime_js,_localtime_js:__localtime_js,_mktime_js:__mktime_js,_mmap_js:__mmap_js,_munmap_js:__munmap_js,_tzset_js:__tzset_js,abort:_abort,emscripten_get_heap_max:_emscripten_get_heap_max,emscripten_get_now:_emscripten_get_now,emscripten_memcpy_big:_emscripten_memcpy_big,emscripten_resize_heap:_emscripten_resize_heap,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,exit:_exit,fd_close:_fd_close,fd_fdstat_get:_fd_fdstat_get,fd_read:_fd_read,fd_seek:_fd_seek,fd_sync:_fd_sync,fd_write:_fd_write,getTempRet0:_getTempRet0,invoke_vii:invoke_vii,setTempRet0:_setTempRet0,strftime:_strftime,system:_system};var asm=createWasm();var ___wasm_call_ctors=Module2["___wasm_call_ctors"]=createExportWrapper("__wasm_call_ctors");var _handle=Module2["_handle"]=createExportWrapper("handle");var _main=Module2["_main"]=createExportWrapper("main");var _malloc=Module2["_malloc"]=createExportWrapper("malloc");var _saveSetjmp=Module2["_saveSetjmp"]=createExportWrapper("saveSetjmp");var _free=Module2["_free"]=createExportWrapper("free");var ___errno_location=Module2["___errno_location"]=createExportWrapper("__errno_location");var _fflush=Module2["_fflush"]=createExportWrapper("fflush");var ___dl_seterr=Module2["___dl_seterr"]=createExportWrapper("__dl_seterr");var _emscripten_builtin_memalign=Module2["_emscripten_builtin_memalign"]=createExportWrapper("emscripten_builtin_memalign");var _sbrk=Module2["_sbrk"]=createExportWrapper("sbrk");var _setThrew=Module2["_setThrew"]=createExportWrapper("setThrew");var _emscripten_stack_init=Module2["_emscripten_stack_init"]=function(){return(_emscripten_stack_init=Module2["_emscripten_stack_init"]=Module2["asm"]["emscripten_stack_init"]).apply(null,arguments);};var _emscripten_stack_get_free=Module2["_emscripten_stack_get_free"]=function(){return(_emscripten_stack_get_free=Module2["_emscripten_stack_get_free"]=Module2["asm"]["emscripten_stack_get_free"]).apply(null,arguments);};var _emscripten_stack_get_base=Module2["_emscripten_stack_get_base"]=function(){return(_emscripten_stack_get_base=Module2["_emscripten_stack_get_base"]=Module2["asm"]["emscripten_stack_get_base"]).apply(null,arguments);};var _emscripten_stack_get_end=Module2["_emscripten_stack_get_end"]=function(){return(_emscripten_stack_get_end=Module2["_emscripten_stack_get_end"]=Module2["asm"]["emscripten_stack_get_end"]).apply(null,arguments);};var stackSave=Module2["stackSave"]=createExportWrapper("stackSave");var stackRestore=Module2["stackRestore"]=createExportWrapper("stackRestore");var stackAlloc=Module2["stackAlloc"]=createExportWrapper("stackAlloc");var dynCall_viiiij=Module2["dynCall_viiiij"]=createExportWrapper("dynCall_viiiij");var dynCall_iiiij=Module2["dynCall_iiiij"]=createExportWrapper("dynCall_iiiij");var dynCall_iij=Module2["dynCall_iij"]=createExportWrapper("dynCall_iij");var dynCall_iijii=Module2["dynCall_iijii"]=createExportWrapper("dynCall_iijii");var dynCall_iiji=Module2["dynCall_iiji"]=createExportWrapper("dynCall_iiji");var dynCall_iiiiiij=Module2["dynCall_iiiiiij"]=createExportWrapper("dynCall_iiiiiij");var dynCall_iiij=Module2["dynCall_iiij"]=createExportWrapper("dynCall_iiij");var dynCall_jii=Module2["dynCall_jii"]=createExportWrapper("dynCall_jii");var dynCall_ji=Module2["dynCall_ji"]=createExportWrapper("dynCall_ji");var dynCall_vij=Module2["dynCall_vij"]=createExportWrapper("dynCall_vij");var dynCall_iiiiijii=Module2["dynCall_iiiiijii"]=createExportWrapper("dynCall_iiiiijii");var dynCall_j=Module2["dynCall_j"]=createExportWrapper("dynCall_j");var dynCall_jj=Module2["dynCall_jj"]=createExportWrapper("dynCall_jj");var dynCall_jiij=Module2["dynCall_jiij"]=createExportWrapper("dynCall_jiij");var dynCall_iiiiji=Module2["dynCall_iiiiji"]=createExportWrapper("dynCall_iiiiji");var dynCall_iiiijii=Module2["dynCall_iiiijii"]=createExportWrapper("dynCall_iiiijii");var dynCall_ij=Module2["dynCall_ij"]=createExportWrapper("dynCall_ij");var dynCall_viiji=Module2["dynCall_viiji"]=createExportWrapper("dynCall_viiji");var dynCall_viijii=Module2["dynCall_viijii"]=createExportWrapper("dynCall_viijii");var dynCall_jiji=Module2["dynCall_jiji"]=createExportWrapper("dynCall_jiji");function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}var MAGIC=0;Math.random=function(){MAGIC=Math.pow(MAGIC+1.8912,3)%1;return MAGIC;};var TIME=1e4;datenow=function datenow(){return TIME++;};if((typeof performance==="undefined"?"undefined":_typeof(performance))=="object")performance.now=datenow;if(ENVIRONMENT_IS_NODE)process["hrtime"]=datenow;if(!Module2)Module2={};Module2["thisProgram"]="thisProgram";function hashMemory(id){var ret=0;var len=_sbrk();for(var i=0;i<len;i++){ret=ret*17+HEAPU8[i]|0;}return id+":"+ret;}function hashString(s){var ret=0;for(var i=0;i<s.length;i++){ret=ret*17+s.charCodeAt(i)|0;}return ret;}unexportedRuntimeFunction("ccall",false);Module2["cwrap"]=cwrap;unexportedRuntimeFunction("allocate",false);unexportedRuntimeFunction("UTF8ArrayToString",false);unexportedRuntimeFunction("UTF8ToString",false);unexportedRuntimeFunction("stringToUTF8Array",false);unexportedRuntimeFunction("stringToUTF8",false);unexportedRuntimeFunction("lengthBytesUTF8",false);unexportedRuntimeFunction("addOnPreRun",false);unexportedRuntimeFunction("addOnInit",false);unexportedRuntimeFunction("addOnPreMain",false);unexportedRuntimeFunction("addOnExit",false);unexportedRuntimeFunction("addOnPostRun",false);unexportedRuntimeFunction("addRunDependency",true);unexportedRuntimeFunction("removeRunDependency",true);unexportedRuntimeFunction("FS_createFolder",false);unexportedRuntimeFunction("FS_createPath",true);unexportedRuntimeFunction("FS_createDataFile",true);unexportedRuntimeFunction("FS_createPreloadedFile",true);unexportedRuntimeFunction("FS_createLazyFile",true);unexportedRuntimeFunction("FS_createLink",false);unexportedRuntimeFunction("FS_createDevice",true);unexportedRuntimeFunction("FS_unlink",true);unexportedRuntimeFunction("getLEB",false);unexportedRuntimeFunction("getFunctionTables",false);unexportedRuntimeFunction("alignFunctionTables",false);unexportedRuntimeFunction("registerFunctions",false);unexportedRuntimeFunction("addFunction",false);unexportedRuntimeFunction("removeFunction",false);unexportedRuntimeFunction("prettyPrint",false);unexportedRuntimeFunction("getCompilerSetting",false);unexportedRuntimeFunction("print",false);unexportedRuntimeFunction("printErr",false);unexportedRuntimeFunction("getTempRet0",false);unexportedRuntimeFunction("setTempRet0",false);unexportedRuntimeFunction("callMain",false);unexportedRuntimeFunction("abort",false);unexportedRuntimeFunction("keepRuntimeAlive",false);unexportedRuntimeFunction("wasmMemory",false);unexportedRuntimeFunction("warnOnce",false);unexportedRuntimeFunction("stackSave",false);unexportedRuntimeFunction("stackRestore",false);unexportedRuntimeFunction("stackAlloc",false);unexportedRuntimeFunction("AsciiToString",false);unexportedRuntimeFunction("stringToAscii",false);unexportedRuntimeFunction("UTF16ToString",false);unexportedRuntimeFunction("stringToUTF16",false);unexportedRuntimeFunction("lengthBytesUTF16",false);unexportedRuntimeFunction("UTF32ToString",false);unexportedRuntimeFunction("stringToUTF32",false);unexportedRuntimeFunction("lengthBytesUTF32",false);unexportedRuntimeFunction("allocateUTF8",false);unexportedRuntimeFunction("allocateUTF8OnStack",false);unexportedRuntimeFunction("ExitStatus",false);unexportedRuntimeFunction("intArrayFromString",false);unexportedRuntimeFunction("intArrayToString",false);unexportedRuntimeFunction("writeStringToMemory",false);unexportedRuntimeFunction("writeArrayToMemory",false);unexportedRuntimeFunction("writeAsciiToMemory",false);Module2["writeStackCookie"]=writeStackCookie;Module2["checkStackCookie"]=checkStackCookie;unexportedRuntimeFunction("ptrToString",false);unexportedRuntimeFunction("zeroMemory",false);unexportedRuntimeFunction("stringToNewUTF8",false);unexportedRuntimeFunction("getHeapMax",false);unexportedRuntimeFunction("emscripten_realloc_buffer",false);unexportedRuntimeFunction("ENV",false);unexportedRuntimeFunction("ERRNO_CODES",false);unexportedRuntimeFunction("ERRNO_MESSAGES",false);unexportedRuntimeFunction("setErrNo",false);unexportedRuntimeFunction("inetPton4",false);unexportedRuntimeFunction("inetNtop4",false);unexportedRuntimeFunction("inetPton6",false);unexportedRuntimeFunction("inetNtop6",false);unexportedRuntimeFunction("readSockaddr",false);unexportedRuntimeFunction("writeSockaddr",false);unexportedRuntimeFunction("DNS",false);unexportedRuntimeFunction("getHostByName",false);unexportedRuntimeFunction("Protocols",false);unexportedRuntimeFunction("Sockets",false);unexportedRuntimeFunction("getRandomDevice",false);unexportedRuntimeFunction("traverseStack",false);unexportedRuntimeFunction("UNWIND_CACHE",false);unexportedRuntimeFunction("convertPCtoSourceLocation",false);unexportedRuntimeFunction("readAsmConstArgsArray",false);unexportedRuntimeFunction("readAsmConstArgs",false);unexportedRuntimeFunction("mainThreadEM_ASM",false);unexportedRuntimeFunction("jstoi_q",false);unexportedRuntimeFunction("jstoi_s",false);unexportedRuntimeFunction("getExecutableName",false);unexportedRuntimeFunction("listenOnce",false);unexportedRuntimeFunction("autoResumeAudioContext",false);unexportedRuntimeFunction("dynCallLegacy",false);unexportedRuntimeFunction("getDynCaller",false);unexportedRuntimeFunction("dynCall",false);unexportedRuntimeFunction("handleException",false);unexportedRuntimeFunction("runtimeKeepalivePush",false);unexportedRuntimeFunction("runtimeKeepalivePop",false);unexportedRuntimeFunction("callUserCallback",false);unexportedRuntimeFunction("maybeExit",false);unexportedRuntimeFunction("safeSetTimeout",false);unexportedRuntimeFunction("asmjsMangle",false);unexportedRuntimeFunction("asyncLoad",false);unexportedRuntimeFunction("alignMemory",false);unexportedRuntimeFunction("mmapAlloc",false);unexportedRuntimeFunction("writeI53ToI64",false);unexportedRuntimeFunction("writeI53ToI64Clamped",false);unexportedRuntimeFunction("writeI53ToI64Signaling",false);unexportedRuntimeFunction("writeI53ToU64Clamped",false);unexportedRuntimeFunction("writeI53ToU64Signaling",false);unexportedRuntimeFunction("readI53FromI64",false);unexportedRuntimeFunction("readI53FromU64",false);unexportedRuntimeFunction("convertI32PairToI53",false);unexportedRuntimeFunction("convertI32PairToI53Checked",false);unexportedRuntimeFunction("convertU32PairToI53",false);unexportedRuntimeFunction("reallyNegative",false);unexportedRuntimeFunction("unSign",false);unexportedRuntimeFunction("strLen",false);unexportedRuntimeFunction("reSign",false);unexportedRuntimeFunction("formatString",false);unexportedRuntimeFunction("setValue",false);unexportedRuntimeFunction("getValue",false);unexportedRuntimeFunction("PATH",false);unexportedRuntimeFunction("PATH_FS",false);unexportedRuntimeFunction("SYSCALLS",false);unexportedRuntimeFunction("getSocketFromFD",false);unexportedRuntimeFunction("getSocketAddress",false);unexportedRuntimeFunction("JSEvents",false);unexportedRuntimeFunction("registerKeyEventCallback",false);unexportedRuntimeFunction("specialHTMLTargets",false);unexportedRuntimeFunction("maybeCStringToJsString",false);unexportedRuntimeFunction("findEventTarget",false);unexportedRuntimeFunction("findCanvasEventTarget",false);unexportedRuntimeFunction("getBoundingClientRect",false);unexportedRuntimeFunction("fillMouseEventData",false);unexportedRuntimeFunction("registerMouseEventCallback",false);unexportedRuntimeFunction("registerWheelEventCallback",false);unexportedRuntimeFunction("registerUiEventCallback",false);unexportedRuntimeFunction("registerFocusEventCallback",false);unexportedRuntimeFunction("fillDeviceOrientationEventData",false);unexportedRuntimeFunction("registerDeviceOrientationEventCallback",false);unexportedRuntimeFunction("fillDeviceMotionEventData",false);unexportedRuntimeFunction("registerDeviceMotionEventCallback",false);unexportedRuntimeFunction("screenOrientation",false);unexportedRuntimeFunction("fillOrientationChangeEventData",false);unexportedRuntimeFunction("registerOrientationChangeEventCallback",false);unexportedRuntimeFunction("fillFullscreenChangeEventData",false);unexportedRuntimeFunction("registerFullscreenChangeEventCallback",false);unexportedRuntimeFunction("JSEvents_requestFullscreen",false);unexportedRuntimeFunction("JSEvents_resizeCanvasForFullscreen",false);unexportedRuntimeFunction("registerRestoreOldStyle",false);unexportedRuntimeFunction("hideEverythingExceptGivenElement",false);unexportedRuntimeFunction("restoreHiddenElements",false);unexportedRuntimeFunction("setLetterbox",false);unexportedRuntimeFunction("currentFullscreenStrategy",false);unexportedRuntimeFunction("restoreOldWindowedStyle",false);unexportedRuntimeFunction("softFullscreenResizeWebGLRenderTarget",false);unexportedRuntimeFunction("doRequestFullscreen",false);unexportedRuntimeFunction("fillPointerlockChangeEventData",false);unexportedRuntimeFunction("registerPointerlockChangeEventCallback",false);unexportedRuntimeFunction("registerPointerlockErrorEventCallback",false);unexportedRuntimeFunction("requestPointerLock",false);unexportedRuntimeFunction("fillVisibilityChangeEventData",false);unexportedRuntimeFunction("registerVisibilityChangeEventCallback",false);unexportedRuntimeFunction("registerTouchEventCallback",false);unexportedRuntimeFunction("fillGamepadEventData",false);unexportedRuntimeFunction("registerGamepadEventCallback",false);unexportedRuntimeFunction("registerBeforeUnloadEventCallback",false);unexportedRuntimeFunction("fillBatteryEventData",false);unexportedRuntimeFunction("battery",false);unexportedRuntimeFunction("registerBatteryEventCallback",false);unexportedRuntimeFunction("setCanvasElementSize",false);unexportedRuntimeFunction("getCanvasElementSize",false);unexportedRuntimeFunction("demangle",false);unexportedRuntimeFunction("demangleAll",false);unexportedRuntimeFunction("jsStackTrace",false);unexportedRuntimeFunction("stackTrace",false);unexportedRuntimeFunction("getEnvStrings",false);unexportedRuntimeFunction("checkWasiClock",false);unexportedRuntimeFunction("doReadv",false);unexportedRuntimeFunction("doWritev",false);unexportedRuntimeFunction("dlopenMissingError",false);unexportedRuntimeFunction("setImmediateWrapped",false);unexportedRuntimeFunction("clearImmediateWrapped",false);unexportedRuntimeFunction("polyfillSetImmediate",false);unexportedRuntimeFunction("uncaughtExceptionCount",false);unexportedRuntimeFunction("exceptionLast",false);unexportedRuntimeFunction("exceptionCaught",false);unexportedRuntimeFunction("ExceptionInfo",false);unexportedRuntimeFunction("exception_addRef",false);unexportedRuntimeFunction("exception_decRef",false);unexportedRuntimeFunction("Browser",false);unexportedRuntimeFunction("setMainLoop",false);unexportedRuntimeFunction("wget",false);unexportedRuntimeFunction("FS",false);unexportedRuntimeFunction("MEMFS",false);unexportedRuntimeFunction("TTY",false);unexportedRuntimeFunction("PIPEFS",false);unexportedRuntimeFunction("SOCKFS",false);unexportedRuntimeFunction("_setNetworkCallback",false);unexportedRuntimeFunction("tempFixedLengthArray",false);unexportedRuntimeFunction("miniTempWebGLFloatBuffers",false);unexportedRuntimeFunction("heapObjectForWebGLType",false);unexportedRuntimeFunction("heapAccessShiftForWebGLHeap",false);unexportedRuntimeFunction("GL",false);unexportedRuntimeFunction("emscriptenWebGLGet",false);unexportedRuntimeFunction("computeUnpackAlignedImageSize",false);unexportedRuntimeFunction("emscriptenWebGLGetTexPixelData",false);unexportedRuntimeFunction("emscriptenWebGLGetUniform",false);unexportedRuntimeFunction("webglGetUniformLocation",false);unexportedRuntimeFunction("webglPrepareUniformLocationsBeforeFirstUse",false);unexportedRuntimeFunction("webglGetLeftBracePos",false);unexportedRuntimeFunction("emscriptenWebGLGetVertexAttrib",false);unexportedRuntimeFunction("writeGLArray",false);unexportedRuntimeFunction("AL",false);unexportedRuntimeFunction("SDL_unicode",false);unexportedRuntimeFunction("SDL_ttfContext",false);unexportedRuntimeFunction("SDL_audio",false);unexportedRuntimeFunction("SDL",false);unexportedRuntimeFunction("SDL_gfx",false);unexportedRuntimeFunction("GLUT",false);unexportedRuntimeFunction("EGL",false);unexportedRuntimeFunction("GLFW_Window",false);unexportedRuntimeFunction("GLFW",false);unexportedRuntimeFunction("GLEW",false);unexportedRuntimeFunction("IDBStore",false);unexportedRuntimeFunction("runAndAbortIfError",false);unexportedRuntimeSymbol("ALLOC_NORMAL",false);unexportedRuntimeSymbol("ALLOC_STACK",false);var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status;}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller;};function callMain(args){assert(runDependencies==0,'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])');assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called");var entryFunction=Module2["_main"];args=args||[];args.unshift(thisProgram);var argc=args.length;var argv=stackAlloc((argc+1)*4);var argv_ptr=argv>>2;args.forEach(function(arg){HEAP32[argv_ptr++]=allocateUTF8OnStack(arg);});HEAP32[argv_ptr]=0;try{var ret=entryFunction(argc,argv);exit(ret,/* implicit = */true);return ret;}catch(e){return handleException(e);}finally{calledMain=true;}}function stackCheckInit(){_emscripten_stack_init();writeStackCookie();}function run(args){args=args||arguments_;if(runDependencies>0){return;}stackCheckInit();preRun();if(runDependencies>0){return;}function doRun(){if(calledRun)return;calledRun=true;Module2["calledRun"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module2);if(Module2["onRuntimeInitialized"])Module2["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun();}if(Module2["setStatus"]){Module2["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module2["setStatus"]("");},1);doRun();},1);}else{doRun();}checkStackCookie();}Module2["run"]=run;function checkUnflushedContent(){var oldOut=out;var oldErr=err;var has=false;out=err=function err(x){has=true;};try{_fflush(0);["stdout","stderr"].forEach(function(name){var info=FS.analyzePath("/dev/"+name);if(!info)return;var stream=info.object;var rdev=stream.rdev;var tty=TTY.ttys[rdev];if(tty&&tty.output&&tty.output.length){has=true;}});}catch(e){}out=oldOut;err=oldErr;if(has){warnOnce("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.");}}function exit(status,implicit){EXITSTATUS=status;checkUnflushedContent();if(keepRuntimeAlive()&&!implicit){var msg="program exited (with status: "+status+"), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)";readyPromiseReject(msg);err(msg);}procExit(status);}function procExit(code){EXITSTATUS=code;if(!keepRuntimeAlive()){if(Module2["onExit"])Module2["onExit"](code);ABORT=true;}quit_(code,new ExitStatus(code));}if(Module2["preInit"]){if(typeof Module2["preInit"]=="function")Module2["preInit"]=[Module2["preInit"]];while(Module2["preInit"].length>0){Module2["preInit"].pop()();}}var shouldRunNow=true;if(Module2["noInitialRun"])shouldRunNow=false;run();Module2.resizeHeap=_emscripten_resize_heap;return Module2.ready;};}();module2.exports=Module;}});// src/formats/emscripten3.cjs
57
57
  var require_emscripten3=__commonJS({"src/formats/emscripten3.cjs":function src_formats_emscripten3Cjs(exports2,module2){var DEFAULT_GAS_LIMIT=9e15;var Module=function(){var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:void 0;if(typeof __filename!=="undefined")_scriptDir=_scriptDir||__filename;return function(binaryOrInstantiate,_ref7){var computeLimit=_ref7.computeLimit,memoryLimit=_ref7.memoryLimit,extensions=_ref7.extensions,format=_ref7.format;var Module2=Module2||{};if(typeof binaryOrInstantiate==="function")Module2.instantiateWasm=binaryOrInstantiate;else Module2.wasmBinary=binaryOrInstantiate;Module2.gas={limit:computeLimit||DEFAULT_GAS_LIMIT,used:0,use:function use(amount){Module2.gas.used+=amount;},refill:function refill(amount){if(!amount)Module2.gas.used=0;else Module2.gas.used=Math.max(Module2.gas.used-amount,0);},isEmpty:function isEmpty(){return Module2.gas.used>Module2.gas.limit;}};var _listeners_=[];Module2.cleanupListeners=function(){_listeners_.forEach(function(_ref8){var _ref9=_slicedToArray(_ref8,2),name=_ref9[0],l=_ref9[1];return process.removeListener(name,l);});};function uncaughtException(ex){if(!(ex instanceof ExitStatus)){throw ex;}}function unhandledRejection(reason){throw reason;}_listeners_.push(["uncaughtException",uncaughtException],["unhandledRejection",unhandledRejection]);var readyPromiseResolve,readyPromiseReject;Module2["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject;});["_memory","_handle","___indirect_function_table","_main","onRuntimeInitialized"].forEach(function(prop){if(!Object.getOwnPropertyDescriptor(Module2["ready"],prop)){Object.defineProperty(Module2["ready"],prop,{get:function get(){return abort("You are getting "+prop+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");},set:function set(){return abort("You are setting "+prop+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}});Module2.locateFile=function(url){return url;};var moduleOverrides=Object.assign({},Module2);var arguments_=[];var thisProgram="./this.program";var quit_=function quit_(status,toThrow){throw toThrow;};var ENVIRONMENT_IS_WEB=(typeof window==="undefined"?"undefined":_typeof(window))=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=(typeof process==="undefined"?"undefined":_typeof(process))=="object"&&_typeof(process.versions)=="object"&&typeof process.versions.node=="string";var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module2["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");}var scriptDirectory="";function locateFile(path){if(Module2["locateFile"]){return Module2["locateFile"](path,scriptDirectory);}return scriptDirectory+path;}var read_,readAsync,readBinary;if(ENVIRONMENT_IS_NODE){if(typeof process=="undefined"||!process.release||process.release.name!=="node")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var nodeVersion=process.versions.node;var numericVersion=nodeVersion.split(".").slice(0,3);numericVersion=numericVersion[0]*1e4+numericVersion[1]*100+numericVersion[2].split("-")[0]*1;var minVersion=16e4;if(numericVersion<16e4){throw new Error("This emscripten-generated code requires node v16.0.0 (detected v"+nodeVersion+")");}var fs=_require("./fs");var nodePath=_require("path");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/";}else{scriptDirectory=__dirname+"/";}read_=function read_(filename,binary){filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?void 0:"utf8");};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret);}assert(ret.buffer);return ret;};readAsync=function readAsync(filename,onload,onerror){var binary=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?void 0:"utf8",function(err2,data){if(err2)onerror(err2);else onload(binary?data.buffer:data);});};if(!Module2["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/");}arguments_=process.argv.slice(2);quit_=function quit_(status,toThrow){process.exitCode=status;throw toThrow;};}else if(ENVIRONMENT_IS_SHELL){if((typeof process==="undefined"?"undefined":_typeof(process))=="object"&&typeof _require==="function"||(typeof window==="undefined"?"undefined":_typeof(window))=="object"||typeof importScripts=="function")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");if(typeof read!="undefined"){read_=read;}readBinary=function readBinary(f){if(typeof readbuffer=="function"){return new Uint8Array(readbuffer(f));}var data=read(f,"binary");assert(_typeof(data)=="object");return data;};readAsync=function readAsync(f,onload,onerror){setTimeout(function(){return onload(readBinary(f));});};if(typeof clearTimeout=="undefined"){globalThis.clearTimeout=function(id){};}if(typeof setTimeout=="undefined"){globalThis.setTimeout=function(f){return typeof f=="function"?f():abort();};}if(typeof scriptArgs!="undefined"){arguments_=scriptArgs;}else if(typeof arguments!="undefined"){arguments_=arguments;}if(typeof quit=="function"){quit_=function quit_(status,toThrow){setTimeout(function(){if(!(toThrow instanceof ExitStatus)){var toLog=toThrow;if(toThrow&&_typeof(toThrow)=="object"&&toThrow.stack){toLog=[toThrow,toThrow.stack];}err("exiting due to exception: ".concat(toLog));}quit(status);});throw toThrow;};}if(typeof print!="undefined"){if(typeof console=="undefined")console=/** @type{!Console} */{};console.log=/** @type{!function(this:Console, ...*): undefined} */print;console.warn=console.error=/** @type{!function(this:Console, ...*): undefined} */typeof printErr!="undefined"?printErr:print;}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href;}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src;}if(_scriptDir){scriptDirectory=_scriptDir;}if(scriptDirectory.startsWith("blob:")){scriptDirectory="";}else{scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1);}if(!((typeof window==="undefined"?"undefined":_typeof(window))=="object"||typeof importScripts=="function"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");{read_=function read_(url){var xhr=new XMLHttpRequest();xhr.open("GET",url,false);xhr.send(null);return xhr.responseText;};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest();xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(/** @type{!ArrayBuffer} */xhr.response);};}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest();xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return;}onerror();};xhr.onerror=onerror;xhr.send(null);};}}else{throw new Error("environment detection error");}var out=Module2["print"]||console.log.bind(console);var err=Module2["printErr"]||console.error.bind(console);Object.assign(Module2,moduleOverrides);moduleOverrides=null;checkIncomingModuleAPI();if(Module2["arguments"])arguments_=Module2["arguments"];legacyModuleProp("arguments","arguments_");if(Module2["thisProgram"])thisProgram=Module2["thisProgram"];legacyModuleProp("thisProgram","thisProgram");if(Module2["quit"])quit_=Module2["quit"];legacyModuleProp("quit","quit_");assert(typeof Module2["memoryInitializerPrefixURL"]=="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["pthreadMainPrefixURL"]=="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["cdInitializerPrefixURL"]=="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["filePackagePrefixURL"]=="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["read"]=="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module2["readAsync"]=="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module2["readBinary"]=="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module2["setWindowTitle"]=="undefined","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)");assert(typeof Module2["TOTAL_MEMORY"]=="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");legacyModuleProp("asm","wasmExports");legacyModuleProp("read","read_");legacyModuleProp("readAsync","readAsync");legacyModuleProp("readBinary","readBinary");legacyModuleProp("setWindowTitle","setWindowTitle");var IDBFS="IDBFS is no longer included by default; build with -lidbfs.js";var PROXYFS="PROXYFS is no longer included by default; build with -lproxyfs.js";var WORKERFS="WORKERFS is no longer included by default; build with -lworkerfs.js";var FETCHFS="FETCHFS is no longer included by default; build with -lfetchfs.js";var ICASEFS="ICASEFS is no longer included by default; build with -licasefs.js";var JSFILEFS="JSFILEFS is no longer included by default; build with -ljsfilefs.js";var OPFS="OPFS is no longer included by default; build with -lopfs.js";var NODEFS="NODEFS is no longer included by default; build with -lnodefs.js";assert(!ENVIRONMENT_IS_SHELL,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");var wasmBinary;if(Module2["wasmBinary"])wasmBinary=Module2["wasmBinary"];legacyModuleProp("wasmBinary","wasmBinary");if((typeof WebAssembly==="undefined"?"undefined":_typeof(WebAssembly))!="object"){abort("no native wasm support detected");}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed"+(text?": "+text:""));}}function _malloc(){abort("malloc() called but not included in the build - add `_malloc` to EXPORTED_FUNCTIONS");}function _free(){abort("free() called but not included in the build - add `_free` to EXPORTED_FUNCTIONS");}var HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module2["HEAP8"]=HEAP8=new Int8Array(b);Module2["HEAP16"]=HEAP16=new Int16Array(b);Module2["HEAPU8"]=HEAPU8=new Uint8Array(b);Module2["HEAPU16"]=HEAPU16=new Uint16Array(b);Module2["HEAP32"]=HEAP32=new Int32Array(b);Module2["HEAPU32"]=HEAPU32=new Uint32Array(b);Module2["HEAPF32"]=HEAPF32=new Float32Array(b);Module2["HEAPF64"]=HEAPF64=new Float64Array(b);}assert(!Module2["STACK_SIZE"],"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time");assert(typeof Int32Array!="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!=void 0&&Int32Array.prototype.set!=void 0,"JS engine does not provide full typed array support");assert(!Module2["wasmMemory"],"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally");assert(!Module2["INITIAL_MEMORY"],"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");function writeStackCookie(){var max=_emscripten_stack_get_end2();assert((max&3)==0);if(max==0){max+=4;}HEAPU32[max>>>2>>>0]=34821223;HEAPU32[max+4>>>2>>>0]=2310721022;HEAPU32[0>>>2>>>0]=1668509029;}function checkStackCookie(){if(ABORT)return;var max=_emscripten_stack_get_end2();if(max==0){max+=4;}var cookie1=HEAPU32[max>>>2>>>0];var cookie2=HEAPU32[max+4>>>2>>>0];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten at ".concat(ptrToString(max),", expected hex dwords 0x89BACDFE and 0x2135467, but received ").concat(ptrToString(cookie2)," ").concat(ptrToString(cookie1)));}if(HEAPU32[0>>>2>>>0]!=1668509029){abort("Runtime error: The application has corrupted its heap memory area (address zero)!");}};(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";})();var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module2["preRun"]){if(typeof Module2["preRun"]=="function")Module2["preRun"]=[Module2["preRun"]];while(Module2["preRun"].length){addOnPreRun(Module2["preRun"].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){assert(!runtimeInitialized);runtimeInitialized=true;checkStackCookie();if(!Module2["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__);}function preMain(){checkStackCookie();callRuntimeCallbacks(__ATMAIN__);}function postRun(){checkStackCookie();if(Module2["postRun"]){if(typeof Module2["postRun"]=="function")Module2["postRun"]=[Module2["postRun"]];while(Module2["postRun"].length){addOnPostRun(Module2["postRun"].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}function addOnInit(cb){__ATINIT__.unshift(cb);}function addOnPreMain(cb){__ATMAIN__.unshift(cb);}function addOnExit(cb){}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function getUniqueRunDependency(id){var orig=id;while(1){if(!runDependencyTracking[id])return id;id=orig+Math.random();}}function addRunDependency(id){var _Module2$monitorRunDe;runDependencies++;(_Module2$monitorRunDe=Module2["monitorRunDependencies"])===null||_Module2$monitorRunDe===void 0||_Module2$monitorRunDe.call(Module2,runDependencies);if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return;}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:");}err("dependency: ".concat(dep));}if(shown){err("(end of list)");}},1e4);}}else{err("warning: run dependency added without ID");}}function removeRunDependency(id){var _Module2$monitorRunDe2;runDependencies--;(_Module2$monitorRunDe2=Module2["monitorRunDependencies"])===null||_Module2$monitorRunDe2===void 0||_Module2$monitorRunDe2.call(Module2,runDependencies);if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id];}else{err("warning: run dependency removed without ID");}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null;}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();}}}function abort(what){var _Module2$onAbort;(_Module2$onAbort=Module2["onAbort"])===null||_Module2$onAbort===void 0||_Module2$onAbort.call(Module2,what);what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e;}var dataURIPrefix="data:application/octet-stream;base64,";var isDataURI=function isDataURI(filename){return filename.startsWith(dataURIPrefix);};var isFileURI=function isFileURI(filename){return filename.startsWith("file://");};function createExportWrapper(name){return function(){assert(runtimeInitialized,"native function `".concat(name,"` called before runtime initialization"));var f=wasmExports[name];assert(f,"exported native function `".concat(name,"` not found"));return f.apply(void 0,arguments);};}var wasmBinaryFile;wasmBinaryFile="AOS.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile);}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary);}if(readBinary){return readBinary(file);}throw"both async and sync fetching of the wasm failed";}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(binaryFile)){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '".concat(binaryFile,"'");}return response["arrayBuffer"]();})["catch"](function(){return getBinarySync(binaryFile);});}else if(readAsync){return new Promise(function(resolve,reject){readAsync(binaryFile,function(response){return resolve(new Uint8Array(/** @type{!ArrayBuffer} */response));},reject);});}}return Promise.resolve().then(function(){return getBinarySync(binaryFile);});}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(function(binary){return WebAssembly.instantiate(binary,imports);}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: ".concat(reason));if(isFileURI(wasmBinaryFile)){err("warning: Loading from a file URI (".concat(wasmBinaryFile,") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"));}abort(reason);});}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err("wasm streaming compile failed: ".concat(reason));err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback);});});}return instantiateArrayBuffer(binaryFile,imports,callback);}function createWasm(){var info={env:wasmImports,wasi_snapshot_preview1:wasmImports,metering:{usegas:function usegas(gas){Module2.gas.use(gas);if(Module2.gas.isEmpty())throw Error("out of gas!");}}};function receiveInstance(instance,module3){wasmExports=instance.exports;wasmExports=applySignatureConversions(wasmExports);wasmMemory=wasmExports["memory"];assert(wasmMemory,"memory not found in wasm exports");updateMemoryViews();wasmTable=wasmExports["__indirect_function_table"];assert(wasmTable,"table not found in wasm exports");addOnInit(wasmExports["__wasm_call_ctors"]);removeRunDependency("wasm-instantiate");return wasmExports;}addRunDependency("wasm-instantiate");var trueModule=Module2;function receiveInstantiationResult(result){assert(Module2===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(result["instance"]);}if(Module2["instantiateWasm"]){try{return Module2["instantiateWasm"](info,receiveInstance);}catch(e){err("Module.instantiateWasm callback failed with error: ".concat(e));readyPromiseReject(e);}}instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult)["catch"](readyPromiseReject);return{};}var tempDouble;var tempI64;function legacyModuleProp(prop,newName){var incoming=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;if(!Object.getOwnPropertyDescriptor(Module2,prop)){Object.defineProperty(Module2,prop,{configurable:true,get:function get(){var extra=incoming?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":"";abort("`Module.".concat(prop,"` has been replaced by `").concat(newName,"`")+extra);}});}}function ignoredModuleProp(prop){if(Object.getOwnPropertyDescriptor(Module2,prop)){abort("`Module.".concat(prop,"` was supplied but `").concat(prop,"` not included in INCOMING_MODULE_JS_API"));}}function isExportedByForceFilesystem(name){return name==="FS_createPath"||name==="FS_createDataFile"||name==="FS_createPreloadedFile"||name==="FS_unlink"||name==="addRunDependency"||name==="FS_createLazyFile"||name==="FS_createDevice"||name==="removeRunDependency";}function missingGlobal(sym,msg){if(typeof globalThis!=="undefined"){Object.defineProperty(globalThis,sym,{configurable:true,get:function get(){_warnOnce("`".concat(sym,"` is not longer defined by emscripten. ").concat(msg));return void 0;}});}}missingGlobal("buffer","Please use HEAP8.buffer or wasmMemory.buffer");missingGlobal("asm","Please use wasmExports instead");function missingLibrarySymbol(sym){if(typeof globalThis!=="undefined"&&!Object.getOwnPropertyDescriptor(globalThis,sym)){Object.defineProperty(globalThis,sym,{configurable:true,get:function get(){var msg="`".concat(sym,"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line");var librarySymbol=sym;if(!librarySymbol.startsWith("_")){librarySymbol="$"+sym;}msg+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='".concat(librarySymbol,"')");if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";}_warnOnce(msg);return void 0;}});}unexportedRuntimeSymbol(sym);}function unexportedRuntimeSymbol(sym){if(!Object.getOwnPropertyDescriptor(Module2,sym)){Object.defineProperty(Module2,sym,{configurable:true,get:function get(){var msg="'".concat(sym,"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)");if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";}abort(msg);}});}}function dbg(){var _console;(_console=console).warn.apply(_console,arguments);}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit(".concat(status,")");this.status=status;}var callRuntimeCallbacks=function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module2);}};function getValue(ptr){var type=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"i8";if(type.endsWith("*"))type="*";switch(type){case"i1":return HEAP8[ptr>>>0];case"i8":return HEAP8[ptr>>>0];case"i16":return HEAP16[ptr>>>1>>>0];case"i32":return HEAP32[ptr>>>2>>>0];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[ptr>>>2>>>0];case"double":return HEAPF64[ptr>>>3>>>0];case"*":return HEAPU32[ptr>>>2>>>0];default:abort("invalid type for getValue: ".concat(type));}}var noExitRuntime=Module2["noExitRuntime"]||true;var ptrToString=function ptrToString(ptr){assert(typeof ptr==="number");return"0x"+ptr.toString(16).padStart(8,"0");};function setValue(ptr,value){var type=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"i8";if(type.endsWith("*"))type="*";switch(type){case"i1":HEAP8[ptr>>>0]=value;break;case"i8":HEAP8[ptr>>>0]=value;break;case"i16":HEAP16[ptr>>>1>>>0]=value;break;case"i32":HEAP32[ptr>>>2>>>0]=value;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[ptr>>>2>>>0]=value;break;case"double":HEAPF64[ptr>>>3>>>0]=value;break;case"*":HEAPU32[ptr>>>2>>>0]=value;break;default:abort("invalid type for setValue: ".concat(type));}}var _warnOnce=function warnOnce(text){_warnOnce.shown||(_warnOnce.shown={});if(!_warnOnce.shown[text]){_warnOnce.shown[text]=1;if(ENVIRONMENT_IS_NODE)text="warning: "+text;err(text);}};var PATH={isAbs:function isAbs(path){return path.charAt(0)==="/";},splitPath:function splitPath(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1);},normalizeArray:function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1);}else if(last===".."){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}if(allowAboveRoot){for(;up;up--){parts.unshift("..");}}return parts;},normalize:function normalize(path){var isAbsolute=PATH.isAbs(path),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 dirname(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return".";}if(dir){dir=dir.substr(0,dir.length-1);}return root+dir;},basename:function basename(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1);},join:function join(){for(var _len=arguments.length,paths=new Array(_len),_key=0;_key<_len;_key++){paths[_key]=arguments[_key];}return PATH.normalize(paths.join("/"));},join2:function join2(l,r){return PATH.normalize(l+"/"+r);}};var initRandomFill=function initRandomFill(){if((typeof crypto==="undefined"?"undefined":_typeof(crypto))=="object"&&typeof crypto["getRandomValues"]=="function"){return function(view){return crypto.getRandomValues(view);};}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=_require("crypto");var randomFillSync=crypto_module["randomFillSync"];if(randomFillSync){return function(view){return crypto_module["randomFillSync"](view);};}var randomBytes=crypto_module["randomBytes"];return function(view){return view.set(randomBytes(view.byteLength)),view;};}catch(e){}}abort("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };");};var _randomFill=function randomFill(view){return(_randomFill=initRandomFill())(view);};var PATH_FS={resolve:function resolve(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?i<0||arguments.length<=i?undefined: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.isAbs(path);}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p;}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||".";},relative:function relative(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break;}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break;}if(start>end)return[];return arr.slice(start,end-start+1);}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break;}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..");}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/");}};var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;var UTF8ArrayToString=function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){idx>>>=0;var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr));}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue;}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue;}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2;}else{if((u0&248)!=240)_warnOnce("Invalid UTF-8 leading byte "+ptrToString(u0)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63;}if(u0<65536){str+=String.fromCharCode(u0);}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023);}}return str;};var FS_stdin_getChar_buffer=[];var lengthBytesUTF8=function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++;}else if(c<=2047){len+=2;}else if(c>=55296&&c<=57343){len+=4;++i;}else{len+=3;}}return len;};var stringToUTF8Array=function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){outIdx>>>=0;assert(typeof str==="string","stringToUTF8Array expects a string (got ".concat(_typeof(str),")"));if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023;}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++>>>0]=u;}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++>>>0]=192|u>>6;heap[outIdx++>>>0]=128|u&63;}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++>>>0]=224|u>>12;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63;}else{if(outIdx+3>=endIdx)break;if(u>1114111)_warnOnce("Invalid Unicode code point "+ptrToString(u)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");heap[outIdx++>>>0]=240|u>>18;heap[outIdx++>>>0]=128|u>>12&63;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63;}}heap[outIdx>>>0]=0;return outIdx-startIdx;};function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array;}var FS_stdin_getChar=function FS_stdin_getChar(){if(!FS_stdin_getChar_buffer.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;try{bytesRead=fs.readSync(fd,buf);}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e;}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8");}else{result=null;}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n";}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n";}}if(!result){return null;}FS_stdin_getChar_buffer=intArrayFromString(result,true);}return FS_stdin_getChar_buffer.shift();};var TTY={ttys:[],init:function init(){},shutdown:function shutdown(){},register:function register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops);},stream_ops:{open:function open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43);}stream.tty=tty;stream.seekable=false;},close:function close(stream){stream.tty.ops.fsync(stream.tty);},fsync:function fsync(stream){stream.tty.ops.fsync(stream.tty);},read:function read(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60);}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty);}catch(e){throw new FS.ErrnoError(29);}if(result===void 0&&bytesRead===0){throw new FS.ErrnoError(6);}if(result===null||result===void 0)break;bytesRead++;buffer[offset+i]=result;}if(bytesRead){stream.node.timestamp=datenow();}return bytesRead;},write:function write(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(60);}try{for(var i=0;i<length;i++){stream.tty.ops.put_char(stream.tty,buffer[offset+i]);}}catch(e){throw new FS.ErrnoError(29);}if(length){stream.node.timestamp=datenow();}return i;}},default_tty_ops:{get_char:function get_char(tty){return FS_stdin_getChar();},put_char:function put_char(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[];}else{if(val!=0)tty.output.push(val);}},fsync:function fsync(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[];}},ioctl_tcgets:function ioctl_tcgets(tty){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};},ioctl_tcsets:function ioctl_tcsets(tty,optional_actions,data){return 0;},ioctl_tiocgwinsz:function ioctl_tiocgwinsz(tty){return[24,80];}},default_tty1_ops:{put_char:function put_char(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[];}else{if(val!=0)tty.output.push(val);}},fsync:function fsync(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[];}}}};var zeroMemory=function zeroMemory(address,size){HEAPU8.fill(0,address,address+size);return address;};var alignMemory=function alignMemory(size,alignment){assert(alignment,"alignment argument is required");return Math.ceil(size/alignment)*alignment;};var mmapAlloc=function mmapAlloc(size){size=alignMemory(size,65536);var ptr=_emscripten_builtin_memalign(65536,size);if(!ptr)return 0;return zeroMemory(ptr,size);};var MEMFS={ops_table:null,mount:function mount(_mount2){return MEMFS.createNode(null,"/",16384|511,/* 0777 */0);},createNode:function createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63);}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=datenow();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp;}return node;},getFileDataAsTypedArray:function getFileDataAsTypedArray(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents);},expandFileStorage:function expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)>>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);},resizeFileStorage:function resizeFileStorage(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)));}node.usedBytes=newSize;}},node_ops:{getattr:function getattr(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096;}else if(FS.isFile(node.mode)){attr.size=node.usedBytes;}else if(FS.isLink(node.mode)){attr.size=node.link.length;}else{attr.size=0;}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr;},setattr:function setattr(node,attr){if(attr.mode!==void 0){node.mode=attr.mode;}if(attr.timestamp!==void 0){node.timestamp=attr.timestamp;}if(attr.size!==void 0){MEMFS.resizeFileStorage(node,attr.size);}},lookup:function lookup(parent,name){throw FS.genericErrors[44];},mknod:function mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev);},rename:function rename(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55);}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=datenow();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir;},unlink:function unlink(parent,name){delete parent.contents[name];parent.timestamp=datenow();},rmdir:function rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55);}delete parent.contents[name];parent.timestamp=datenow();},readdir:function readdir(node){var entries=[".",".."];for(var _i=0,_Object$keys=Object.keys(node.contents);_i<_Object$keys.length;_i++){var key=_Object$keys[_i];entries.push(key);}return entries;},symlink:function symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511/* 0777 */|40960,0);node.link=oldpath;return node;},readlink:function readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28);}return node.link;}},stream_ops:{read:function read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset);}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i];}return size;},write:function write(stream,buffer,offset,length,position,canOwn){assert(!(buffer instanceof ArrayBuffer));if(buffer.buffer===HEAP8.buffer){canOwn=false;}if(!length)return 0;var node=stream.node;node.timestamp=datenow();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){assert(position===0,"canOwn must imply no weird position inside the file");node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length;}else if(node.usedBytes===0&&position===0){node.contents=buffer.slice(offset,offset+length);node.usedBytes=length;return length;}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length;}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray){node.contents.set(buffer.subarray(offset,offset+length),position);}else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i];}}node.usedBytes=Math.max(node.usedBytes,position+length);return length;},llseek:function llseek(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.usedBytes;}}if(position<0){throw new FS.ErrnoError(28);}return position;},allocate:function allocate(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length);},mmap:function mmap(stream,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43);}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&contents.buffer===HEAP8.buffer){allocated=false;ptr=contents.byteOffset;}else{if(position>0||position+length<contents.length){if(contents.subarray){contents=contents.subarray(position,position+length);}else{contents=Array.prototype.slice.call(contents,position,position+length);}}allocated=true;ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48);}HEAP8.set(contents,ptr>>>0);}return{ptr:ptr,allocated:allocated};},msync:function msync(stream,buffer,offset,length,mmapFlags){MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0;}}};var asyncLoad=function asyncLoad(url,onload,onerror,noRunDep){var dep=!noRunDep?getUniqueRunDependency("al ".concat(url)):"";readAsync(url,function(arrayBuffer){assert(arrayBuffer,"Loading data file \"".concat(url,"\" failed (no arrayBuffer)."));onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep);},function(event){if(onerror){onerror();}else{throw"Loading data file \"".concat(url,"\" failed.");}});if(dep)addRunDependency(dep);};var FS_createDataFile=function FS_createDataFile(parent,name,fileData,canRead,canWrite,canOwn){FS.createDataFile(parent,name,fileData,canRead,canWrite,canOwn);};var preloadPlugins=Module2["preloadPlugins"]||[];var FS_handledByPreloadPlugin=function FS_handledByPreloadPlugin(byteArray,fullname,finish,onerror){if(typeof Browser!="undefined")Browser.init();var handled=false;preloadPlugins.forEach(function(plugin){if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,onerror);handled=true;}});return handled;};var FS_createPreloadedFile=function FS_createPreloadedFile(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish){var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency("cp ".concat(fullname));function processData(byteArray){function finish(byteArray2){preFinish===null||preFinish===void 0||preFinish();if(!dontCreateFile){FS_createDataFile(parent,name,byteArray2,canRead,canWrite,canOwn);}onload===null||onload===void 0||onload();removeRunDependency(dep);}if(FS_handledByPreloadPlugin(byteArray,fullname,finish,function(){onerror===null||onerror===void 0||onerror();removeRunDependency(dep);})){return;}finish(byteArray);}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,processData,onerror);}else{processData(url);}};var FS_modeStringToFlags=function FS_modeStringToFlags(str){var flagModes={r:0,"r+":2,w:512|64|1,"w+":512|64|2,a:1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error("Unknown file open mode: ".concat(str));}return flags;};var FS_getMode=function FS_getMode(canRead,canWrite){var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode;};var ERRNO_MESSAGES={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"};var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:/*#__PURE__*/function(_Error){function ErrnoError(errno){var _this;_classCallCheck(this,ErrnoError);_this=_callSuper(this,ErrnoError,[ERRNO_MESSAGES[errno]]);_this.name="ErrnoError";_this.errno=errno;for(var key in ERRNO_CODES){if(ERRNO_CODES[key]===errno){_this.code=key;break;}}return _this;}_inherits(ErrnoError,_Error);return _createClass(ErrnoError);}(/*#__PURE__*/_wrapNativeSuper(Error)),genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:/*#__PURE__*/function(){function FSStream(){_classCallCheck(this,FSStream);this.shared={};}return _createClass(FSStream,[{key:"object",get:function get(){return this.node;},set:function set(val){this.node=val;}},{key:"isRead",get:function get(){return(this.flags&2097155)!==1;}},{key:"isWrite",get:function get(){return(this.flags&2097155)!==0;}},{key:"isAppend",get:function get(){return this.flags&1024;}},{key:"flags",get:function get(){return this.shared.flags;},set:function set(val){this.shared.flags=val;}},{key:"position",get:function get(){return this.shared.position;},set:function set(val){this.shared.position=val;}}]);}(),FSNode:/*#__PURE__*/function(){function FSNode(parent,name,mode,rdev){_classCallCheck(this,FSNode);if(!parent){parent=this;}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev;this.readMode=292/*292*/|73;this.writeMode=146;}/*146*/return _createClass(FSNode,[{key:"read",get:function get(){return(this.mode&this.readMode)===this.readMode;},set:function set(val){val?this.mode|=this.readMode:this.mode&=~this.readMode;}},{key:"write",get:function get(){return(this.mode&this.writeMode)===this.writeMode;},set:function set(val){val?this.mode|=this.writeMode:this.mode&=~this.writeMode;}},{key:"isFolder",get:function get(){return FS.isDir(this.mode);}},{key:"isDevice",get:function get(){return FS.isChrdev(this.mode);}}]);}(),lookupPath:function lookupPath(path){var opts=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};path=PATH_FS.resolve(path);if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};opts=Object.assign(defaults,opts);if(opts.recurse_count>8){throw new FS.ErrnoError(32);}var parts=path.split("/").filter(function(p){return!!p;});var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break;}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root;}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH_FS.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count+1});current=lookup.node;if(count++>40){throw new FS.ErrnoError(32);}}}}return{path:current_path,node:current};},getPath:function getPath(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?"".concat(mount,"/").concat(path):mount+path;}path=path?"".concat(node.name,"/").concat(path):node.name;node=node.parent;}},hashName:function hashName(parentid,name){var hash=0;for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0;}return(parentid+hash>>>0)%FS.nameTable.length;},hashAddNode:function hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node;},hashRemoveNode:function hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next;}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break;}current=current.name_next;}}},lookupNode:function lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode);}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node;}}return FS.lookup(parent,name);},createNode:function createNode(parent,name,mode,rdev){assert(_typeof(parent)=="object");var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node;},destroyNode:function destroyNode(node){FS.hashRemoveNode(node);},isRoot:function isRoot(node){return node===node.parent;},isMountpoint:function isMountpoint(node){return!!node.mounted;},isFile:function isFile(mode){return(mode&61440)===32768;},isDir:function isDir(mode){return(mode&61440)===16384;},isLink:function isLink(mode){return(mode&61440)===40960;},isChrdev:function isChrdev(mode){return(mode&61440)===8192;},isBlkdev:function isBlkdev(mode){return(mode&61440)===24576;},isFIFO:function isFIFO(mode){return(mode&61440)===4096;},isSocket:function isSocket(mode){return(mode&49152)===49152;},flagsToPermissionString:function flagsToPermissionString(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w";}return perms;},nodePermissions:function nodePermissions(node,perms){if(FS.ignorePermissions){return 0;}if(perms.includes("r")&&!(node.mode&292)){return 2;}else if(perms.includes("w")&&!(node.mode&146)){return 2;}else if(perms.includes("x")&&!(node.mode&73)){return 2;}return 0;},mayLookup:function mayLookup(dir){if(!FS.isDir(dir.mode))return 54;var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0;},mayCreate:function mayCreate(dir,name){try{var node=FS.lookupNode(dir,name);return 20;}catch(e){}return FS.nodePermissions(dir,"wx");},mayDelete:function mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name);}catch(e){return e.errno;}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode;}if(isdir){if(!FS.isDir(node.mode)){return 54;}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10;}}else{if(FS.isDir(node.mode)){return 31;}}return 0;},mayOpen:function mayOpen(node,flags){if(!node){return 44;}if(FS.isLink(node.mode)){return 32;}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31;}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags));},MAX_OPEN_FDS:4096,nextfd:function nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd;}}throw new FS.ErrnoError(33);},getStreamChecked:function getStreamChecked(fd){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8);}return stream;},getStream:function getStream(fd){return FS.streams[fd];},createStream:function createStream(stream){var fd=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;stream=Object.assign(new FS.FSStream(),stream);if(fd==-1){fd=FS.nextfd();}stream.fd=fd;FS.streams[fd]=stream;return stream;},closeStream:function closeStream(fd){FS.streams[fd]=null;},dupStream:function dupStream(origStream){var _stream$stream_ops,_stream$stream_ops$du;var fd=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var stream=FS.createStream(origStream,fd);(_stream$stream_ops=stream.stream_ops)===null||_stream$stream_ops===void 0||(_stream$stream_ops$du=_stream$stream_ops.dup)===null||_stream$stream_ops$du===void 0||_stream$stream_ops$du.call(_stream$stream_ops,stream);return stream;},chrdev_stream_ops:{open:function open(stream){var _stream$stream_ops$op,_stream$stream_ops2;var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;(_stream$stream_ops$op=(_stream$stream_ops2=stream.stream_ops).open)===null||_stream$stream_ops$op===void 0||_stream$stream_ops$op.call(_stream$stream_ops2,stream);},llseek:function llseek(){throw new FS.ErrnoError(70);}},major:function major(dev){return dev>>8;},minor:function minor(dev){return dev&255;},makedev:function makedev(ma,mi){return ma<<8|mi;},registerDevice:function registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops};},getDevice:function getDevice(dev){return FS.devices[dev];},getMounts:function getMounts(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,_toConsumableArray(m.mounts));}return mounts;},syncfs:function syncfs(populate,callback){if(typeof populate=="function"){callback=populate;populate=false;}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: ".concat(FS.syncFSRequests," FS.syncfs operations in flight at once, probably just doing extra work"));}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(errCode);}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode);}return;}if(++completed>=mounts.length){doCallback(null);}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null);}mount.type.syncfs(mount,populate,done);});},mount:function mount(type,opts,mountpoint){if(typeof type=="string"){throw type;}var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10);}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54);}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot;}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount);}}return mountRoot;},unmount:function unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28);}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current);}current=next;}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1);},lookup:function lookup(parent,name){return parent.node_ops.lookup(parent,name);},mknod:function mknod(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28);}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63);}return parent.node_ops.mknod(parent,name,mode,dev);},create:function create(path,mode){mode=mode!==void 0?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0);},mkdir:function mkdir(path,mode){mode=mode!==void 0?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0);},mkdirTree:function mkdirTree(path,mode){var dirs=path.split("/");var d="";for(var i=0;i<dirs.length;++i){if(!dirs[i])continue;d+="/"+dirs[i];try{FS.mkdir(d,mode);}catch(e){if(e.errno!=20)throw e;}}},mkdev:function mkdev(path,mode,dev){if(typeof dev=="undefined"){dev=mode;mode=438;}mode|=8192;return FS.mknod(path,mode,dev);},symlink:function symlink(oldpath,newpath){if(!PATH_FS.resolve(oldpath)){throw new FS.ErrnoError(44);}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44);}var newname=PATH.basename(newpath);var errCode=FS.mayCreate(parent,newname);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.symlink){throw new FS.ErrnoError(63);}return parent.node_ops.symlink(parent,newname,oldpath);},rename:function rename(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node;if(!old_dir||!new_dir)throw new FS.ErrnoError(44);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(75);}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH_FS.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(28);}relative=PATH_FS.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(55);}var new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}if(old_node===new_node){return;}var isdir=FS.isDir(old_node.mode);var errCode=FS.mayDelete(old_dir,old_name,isdir);if(errCode){throw new FS.ErrnoError(errCode);}errCode=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(errCode){throw new FS.ErrnoError(errCode);}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(63);}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(10);}if(new_dir!==old_dir){errCode=FS.nodePermissions(old_dir,"w");if(errCode){throw new FS.ErrnoError(errCode);}}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name);}catch(e){throw e;}finally{FS.hashAddNode(old_node);}},rmdir:function rmdir(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,true);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(63);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);},readdir:function readdir(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(54);}return node.node_ops.readdir(node);},unlink:function unlink(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44);}var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,false);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.unlink){throw new FS.ErrnoError(63);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}parent.node_ops.unlink(parent,name);FS.destroyNode(node);},readlink:function readlink(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(44);}if(!link.node_ops.readlink){throw new FS.ErrnoError(28);}return PATH_FS.resolve(FS.getPath(link.parent),link.node_ops.readlink(link));},stat:function stat(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(44);}if(!node.node_ops.getattr){throw new FS.ErrnoError(63);}return node.node_ops.getattr(node);},lstat:function lstat(path){return FS.stat(path,true);},chmod:function chmod(path,mode,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:datenow()});},lchmod:function lchmod(path,mode){FS.chmod(path,mode,true);},fchmod:function fchmod(fd,mode){var stream=FS.getStreamChecked(fd);FS.chmod(stream.node,mode);},chown:function chown(path,uid,gid,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}node.node_ops.setattr(node,{timestamp:datenow()});},lchown:function lchown(path,uid,gid){FS.chown(path,uid,gid,true);},fchown:function fchown(fd,uid,gid){var stream=FS.getStreamChecked(fd);FS.chown(stream.node,uid,gid);},truncate:function truncate(path,len){if(len<0){throw new FS.ErrnoError(28);}var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}if(FS.isDir(node.mode)){throw new FS.ErrnoError(31);}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(28);}var errCode=FS.nodePermissions(node,"w");if(errCode){throw new FS.ErrnoError(errCode);}node.node_ops.setattr(node,{size:len,timestamp:datenow()});},ftruncate:function ftruncate(fd,len){var stream=FS.getStreamChecked(fd);if((stream.flags&2097155)===0){throw new FS.ErrnoError(28);}FS.truncate(stream.node,len);},utime:function utime(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)});},open:function open(path,flags,mode){if(path===""){throw new FS.ErrnoError(44);}flags=typeof flags=="string"?FS_modeStringToFlags(flags):flags;mode=typeof mode=="undefined"?438:/* 0666 */mode;if(flags&64){mode=mode&4095|32768;}else{mode=0;}var node;if(_typeof(path)=="object"){node=path;}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node;}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(20);}}else{node=FS.mknod(path,mode,0);created=true;}}if(!node){throw new FS.ErrnoError(44);}if(FS.isChrdev(node.mode)){flags&=~512;}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(54);}if(!created){var errCode=FS.mayOpen(node,flags);if(errCode){throw new FS.ErrnoError(errCode);}}if(flags&512&&!created){FS.truncate(node,0);}flags&=~(128|512|131072);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false});if(stream.stream_ops.open){stream.stream_ops.open(stream);}if(Module2["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;}}return stream;},close:function close(stream){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream);}}catch(e){throw e;}finally{FS.closeStream(stream.fd);}stream.fd=null;},isClosed:function isClosed(stream){return stream.fd===null;},llseek:function llseek(stream,offset,whence){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(70);}if(whence!=0&&whence!=1&&whence!=2){throw new FS.ErrnoError(28);}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position;},read:function read(stream,buffer,offset,length,position){assert(offset>=0);if(length<0||position<0){throw new FS.ErrnoError(28);}if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if((stream.flags&2097155)===1){throw new FS.ErrnoError(8);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31);}if(!stream.stream_ops.read){throw new FS.ErrnoError(28);}var seeking=typeof position!="undefined";if(!seeking){position=stream.position;}else if(!stream.seekable){throw new FS.ErrnoError(70);}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead;},write:function write(stream,buffer,offset,length,position,canOwn){assert(offset>=0);if(length<0||position<0){throw new FS.ErrnoError(28);}if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31);}if(!stream.stream_ops.write){throw new FS.ErrnoError(28);}if(stream.seekable&&stream.flags&1024){FS.llseek(stream,0,2);}var seeking=typeof position!="undefined";if(!seeking){position=stream.position;}else if(!stream.seekable){throw new FS.ErrnoError(70);}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;return bytesWritten;},allocate:function allocate(stream,offset,length){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(offset<0||length<=0){throw new FS.ErrnoError(28);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8);}if(!FS.isFile(stream.node.mode)&&!FS.isDir(stream.node.mode)){throw new FS.ErrnoError(43);}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(138);}stream.stream_ops.allocate(stream,offset,length);},mmap:function mmap(stream,length,position,prot,flags){if((prot&2)!==0&&(flags&2)===0&&(stream.flags&2097155)!==2){throw new FS.ErrnoError(2);}if((stream.flags&2097155)===1){throw new FS.ErrnoError(2);}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(43);}return stream.stream_ops.mmap(stream,length,position,prot,flags);},msync:function msync(stream,buffer,offset,length,mmapFlags){assert(offset>=0);if(!stream.stream_ops.msync){return 0;}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags);},ioctl:function ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59);}return stream.stream_ops.ioctl(stream,cmd,arg);},readFile:function readFile(path){var opts=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error("Invalid encoding type \"".concat(opts.encoding,"\""));}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0);}else if(opts.encoding==="binary"){ret=buf;}FS.close(stream);return ret;},writeFile:function writeFile(path,data){var opts=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,void 0,opts.canOwn);}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,void 0,opts.canOwn);}else{throw new Error("Unsupported data type");}FS.close(stream);},cwd:function cwd(){return FS.currentPath;},chdir:function chdir(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44);}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54);}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode);}FS.currentPath=lookup.path;},createDefaultDirectories:function createDefaultDirectories(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user");},createDefaultDevices:function createDefaultDevices(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:function read(){return 0;},write:function write(stream,buffer,offset,length,pos){return length;}});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=function randomByte(){if(randomLeft===0){randomLeft=_randomFill(randomBuffer).byteLength;}return randomBuffer[--randomLeft];};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp");},createSpecialDirectories:function createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:function mount(){var node=FS.createNode(proc_self,"fd",16384|511,/* 0777 */73);node.node_ops={lookup:function lookup(parent,name){var fd=+name;var stream=FS.getStreamChecked(fd);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function readlink(){return stream.path;}}};ret.parent=ret;return ret;}};return node;}},{},"/proc/self/fd");},createStandardStreams:function createStandardStreams(){if(Module2["stdin"]){FS.createDevice("/dev","stdin",Module2["stdin"]);}else{FS.symlink("/dev/tty","/dev/stdin");}if(Module2["stdout"]){FS.createDevice("/dev","stdout",null,Module2["stdout"]);}else{FS.symlink("/dev/tty","/dev/stdout");}if(Module2["stderr"]){FS.createDevice("/dev","stderr",null,Module2["stderr"]);}else{FS.symlink("/dev/tty1","/dev/stderr");}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1);assert(stdin.fd===0,"invalid handle for stdin (".concat(stdin.fd,")"));assert(stdout.fd===1,"invalid handle for stdout (".concat(stdout.fd,")"));assert(stderr.fd===2,"invalid handle for stderr (".concat(stderr.fd,")"));},staticInit:function staticInit(){;[44].forEach(function(code){FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>";});FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={MEMFS:MEMFS};},init:function init(input,output,error){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");FS.init.initialized=true;Module2["stdin"]=input||Module2["stdin"];Module2["stdout"]=output||Module2["stdout"];Module2["stderr"]=error||Module2["stderr"];FS.createStandardStreams();},quit:function quit(){FS.init.initialized=false;_fflush(0);for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue;}FS.close(stream);}},findObject:function findObject(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink);if(!ret.exists){return null;}return ret.object;},analyzePath:function analyzePath(path,dontResolveLastLink){try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path;}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/";}catch(e){ret.error=e.errno;}return ret;},createPath:function createPath(parent,path,canRead,canWrite){parent=typeof parent=="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current);}catch(e){}parent=current;}return current;},createFile:function createFile(parent,name,properties,canRead,canWrite){var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(canRead,canWrite);return FS.create(path,mode);},createDataFile:function createDataFile(parent,name,data,canRead,canWrite,canOwn){var path=name;if(parent){parent=typeof parent=="string"?parent:FS.getPath(parent);path=name?PATH.join2(parent,name):parent;}var mode=FS_getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data=="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr;}FS.chmod(node,mode|146);var stream=FS.open(node,577);FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode);}},createDevice:function createDevice(parent,name,input,output){var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:function open(stream){stream.seekable=false;},close:function close(stream){var _output$buffer;if(output!==null&&output!==void 0&&(_output$buffer=output.buffer)!==null&&_output$buffer!==void 0&&_output$buffer.length){output(10);}},read:function read(stream,buffer,offset,length,pos){var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input();}catch(e){throw new FS.ErrnoError(29);}if(result===void 0&&bytesRead===0){throw new FS.ErrnoError(6);}if(result===null||result===void 0)break;bytesRead++;buffer[offset+i]=result;}if(bytesRead){stream.node.timestamp=datenow();}return bytesRead;},write:function write(stream,buffer,offset,length,pos){for(var i=0;i<length;i++){try{output(buffer[offset+i]);}catch(e){throw new FS.ErrnoError(29);}}if(length){stream.node.timestamp=datenow();}return i;}});return FS.mkdev(path,mode,dev);},forceLoadFile:function forceLoadFile(obj){if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;if(typeof XMLHttpRequest!="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");}else if(read_){try{obj.contents=intArrayFromString(read_(obj.url),true);obj.usedBytes=obj.contents.length;}catch(e){throw new FS.ErrnoError(29);}}else{throw new Error("Cannot load without read() or XMLHttpRequest.");}},createLazyFile:function createLazyFile(parent,name,url,canRead,canWrite){var LazyUint8Array=/*#__PURE__*/function(){function LazyUint8Array(){_classCallCheck(this,LazyUint8Array);this.lengthKnown=false;this.chunks=[];}return _createClass(LazyUint8Array,[{key:"get",value:function get(idx){if(idx>this.length-1||idx<0){return void 0;}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset];}},{key:"setDataGetter",value:function setDataGetter(getter){this.getter=getter;}},{key:"cacheLength",value:function 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 doXHR(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr2=new XMLHttpRequest();xhr2.open("GET",url,false);if(datalength!==chunkSize)xhr2.setRequestHeader("Range","bytes="+from+"-"+to);xhr2.responseType="arraybuffer";if(xhr2.overrideMimeType){xhr2.overrideMimeType("text/plain; charset=x-user-defined");}xhr2.send(null);if(!(xhr2.status>=200&&xhr2.status<300||xhr2.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr2.status);if(xhr2.response!==void 0){return new Uint8Array(/** @type{Array<number>} */xhr2.response||[]);}return intArrayFromString(xhr2.responseText||"",true);};var lazyArray2=this;lazyArray2.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray2.chunks[chunkNum]=="undefined"){lazyArray2.chunks[chunkNum]=doXHR(start,end);}if(typeof lazyArray2.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray2.chunks[chunkNum];});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed");}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true;}},{key:"length",get:function get(){if(!this.lengthKnown){this.cacheLength();}return this._length;}},{key:"chunkSize",get:function get(){if(!this.lengthKnown){this.cacheLength();}return this._chunkSize;}}]);}();if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array();var properties={isDevice:false,contents:lazyArray};}else{var properties={isDevice:false,url:url};}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents;}else if(properties.url){node.contents=null;node.url=properties.url;}Object.defineProperties(node,{usedBytes:{get:function get(){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(){FS.forceLoadFile(node);return fn.apply(void 0,arguments);};});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i];}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i);}}return size;}stream_ops.read=function(stream,buffer,offset,length,position){FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position);};stream_ops.mmap=function(stream,length,position,prot,flags){FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48);}writeChunks(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true};};node.stream_ops=stream_ops;return node;},absolutePath:function absolutePath(){abort("FS.absolutePath has been removed; use PATH_FS.resolve instead");},createFolder:function createFolder(){abort("FS.createFolder has been removed; use FS.mkdir instead");},createLink:function createLink(){abort("FS.createLink has been removed; use FS.symlink instead");},joinPath:function joinPath(){abort("FS.joinPath has been removed; use PATH.join instead");},mmapAlloc:function mmapAlloc(){abort("FS.mmapAlloc has been replaced by the top level function mmapAlloc");},standardizePath:function standardizePath(){abort("FS.standardizePath has been removed; use PATH.normalize instead");}};var UTF8ToString=function UTF8ToString(ptr,maxBytesToRead){assert(typeof ptr=="number","UTF8ToString expects a number (got ".concat(_typeof(ptr),")"));ptr>>>=0;return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";};var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path;}var dir;if(dirfd===-100){dir=FS.cwd();}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path;}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44);}return dir;}return PATH.join2(dir,path);},doStat:function doStat(func,path,buf){var stat=func(path);HEAP32[buf>>>2>>>0]=stat.dev;HEAP32[buf+4>>>2>>>0]=stat.mode;HEAPU32[buf+8>>>2>>>0]=stat.nlink;HEAP32[buf+12>>>2>>>0]=stat.uid;HEAP32[buf+16>>>2>>>0]=stat.gid;HEAP32[buf+20>>>2>>>0]=stat.rdev;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+24>>>2>>>0]=tempI64[0],HEAP32[buf+28>>>2>>>0]=tempI64[1];HEAP32[buf+32>>>2>>>0]=4096;HEAP32[buf+36>>>2>>>0]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();tempI64=[Math.floor(atime/1e3)>>>0,(tempDouble=Math.floor(atime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>>2>>>0]=tempI64[0],HEAP32[buf+44>>>2>>>0]=tempI64[1];HEAPU32[buf+48>>>2>>>0]=atime%1e3*1e3;tempI64=[Math.floor(mtime/1e3)>>>0,(tempDouble=Math.floor(mtime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+56>>>2>>>0]=tempI64[0],HEAP32[buf+60>>>2>>>0]=tempI64[1];HEAPU32[buf+64>>>2>>>0]=mtime%1e3*1e3;tempI64=[Math.floor(ctime/1e3)>>>0,(tempDouble=Math.floor(ctime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+72>>>2>>>0]=tempI64[0],HEAP32[buf+76>>>2>>>0]=tempI64[1];HEAPU32[buf+80>>>2>>>0]=ctime%1e3*1e3;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+88>>>2>>>0]=tempI64[0],HEAP32[buf+92>>>2>>>0]=tempI64[1];return 0;},doMsync:function doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43);}if(flags&2){return 0;}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags);},varargs:void 0,get:function get(){assert(SYSCALLS.varargs!=void 0);var ret=HEAP32[+SYSCALLS.varargs>>>2>>>0];SYSCALLS.varargs+=4;return ret;},getp:function getp(){return SYSCALLS.get();},getStr:function getStr(ptr){var ret=UTF8ToString(ptr);return ret;},getStreamFromFD:function getStreamFromFD(fd){var stream=FS.getStreamChecked(fd);return stream;}};var convertI32PairToI53Checked=function convertI32PairToI53Checked(lo,hi){assert(lo==lo>>>0||lo==(lo|0));assert(hi===(hi|0));return hi+2097152>>>0<4194305-!!lo?(lo>>>0)+hi*4294967296:NaN;};function ___syscall_chmod(path,mode){path>>>=0;try{path=SYSCALLS.getStr(path);FS.chmod(path,mode);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_dup3(fd,newfd,flags){try{var old=SYSCALLS.getStreamFromFD(fd);assert(!flags);if(old.fd===newfd)return-28;var existing=FS.getStream(newfd);if(existing)FS.close(existing);return FS.dupStream(old,newfd).fd;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_faccessat(dirfd,path,amode,flags){path>>>=0;try{path=SYSCALLS.getStr(path);assert(flags===0);path=SYSCALLS.calculateAt(dirfd,path);if(amode&~7){return-28;}var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node){return-44;}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms/* otherwise, they've just passed F_OK */&&FS.nodePermissions(node,perms)){return-2;}return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fchmod(fd,mode){try{FS.fchmod(fd,mode);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fchown32(fd,owner,group){try{FS.fchown(fd,owner,group);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fcntl64(fd,cmd,varargs){varargs>>>=0;SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28;}while(FS.streams[arg]){arg++;}var newStream;newStream=FS.dupStream(stream,arg);return newStream.fd;}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0;}case 12:{var arg=SYSCALLS.getp();var offset=0;HEAP16[arg+offset>>>1>>>0]=2;return 0;}case 13:case 14:return 0;}return-28;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fstat64(fd,buf){buf>>>=0;try{var stream=SYSCALLS.getStreamFromFD(fd);return SYSCALLS.doStat(FS.stat,stream.path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_ftruncate64(fd,length_low,length_high){var length=convertI32PairToI53Checked(length_low,length_high);try{if(isNaN(length))return 61;FS.ftruncate(fd,length);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var stringToUTF8=function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);};function ___syscall_getcwd(buf,size){buf>>>=0;size>>>=0;try{if(size===0)return-28;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd)+1;if(size<cwdLengthInBytes)return-68;stringToUTF8(cwd,buf,size);return cwdLengthInBytes;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_ioctl(fd,op,varargs){varargs>>>=0;SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:{if(!stream.tty)return-59;return 0;}case 21505:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcgets){var termios=stream.tty.ops.ioctl_tcgets(stream);var argp=SYSCALLS.getp();HEAP32[argp>>>2>>>0]=termios.c_iflag||0;HEAP32[argp+4>>>2>>>0]=termios.c_oflag||0;HEAP32[argp+8>>>2>>>0]=termios.c_cflag||0;HEAP32[argp+12>>>2>>>0]=termios.c_lflag||0;for(var i=0;i<32;i++){HEAP8[argp+i+17>>>0]=termios.c_cc[i]||0;}return 0;}return 0;}case 21510:case 21511:case 21512:{if(!stream.tty)return-59;return 0;}case 21506:case 21507:case 21508:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcsets){var argp=SYSCALLS.getp();var c_iflag=HEAP32[argp>>>2>>>0];var c_oflag=HEAP32[argp+4>>>2>>>0];var c_cflag=HEAP32[argp+8>>>2>>>0];var c_lflag=HEAP32[argp+12>>>2>>>0];var c_cc=[];for(var i=0;i<32;i++){c_cc.push(HEAP8[argp+i+17>>>0]);}return stream.tty.ops.ioctl_tcsets(stream.tty,op,{c_iflag:c_iflag,c_oflag:c_oflag,c_cflag:c_cflag,c_lflag:c_lflag,c_cc:c_cc});}return 0;}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.getp();HEAP32[argp>>>2>>>0]=0;return 0;}case 21520:{if(!stream.tty)return-59;return-28;}case 21531:{var argp=SYSCALLS.getp();return FS.ioctl(stream,op,argp);}case 21523:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tiocgwinsz){var winsize=stream.tty.ops.ioctl_tiocgwinsz(stream.tty);var argp=SYSCALLS.getp();HEAP16[argp>>>1>>>0]=winsize[0];HEAP16[argp+2>>>1>>>0]=winsize[1];}return 0;}case 21524:{if(!stream.tty)return-59;return 0;}case 21515:{if(!stream.tty)return-59;return 0;}default:return-28;}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_lstat64(path,buf){path>>>=0;buf>>>=0;try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.lstat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_mkdirat(dirfd,path,mode){path>>>=0;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_newfstatat(dirfd,path,buf,flags){path>>>=0;buf>>>=0;try{path=SYSCALLS.getStr(path);var nofollow=flags&256;var allowEmpty=flags&4096;flags=flags&~6400;assert(!flags,"unknown flags in __syscall_newfstatat: ".concat(flags));path=SYSCALLS.calculateAt(dirfd,path,allowEmpty);return SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_openat(dirfd,path,flags,varargs){path>>>=0;varargs>>>=0;SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?SYSCALLS.get():0;return FS.open(path,flags,mode).fd;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_readlinkat(dirfd,path,buf,bufsize){path>>>=0;buf>>>=0;bufsize>>>=0;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len>>>0];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len>>>0]=endChar;return len;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_renameat(olddirfd,oldpath,newdirfd,newpath){oldpath>>>=0;newpath>>>=0;try{oldpath=SYSCALLS.getStr(oldpath);newpath=SYSCALLS.getStr(newpath);oldpath=SYSCALLS.calculateAt(olddirfd,oldpath);newpath=SYSCALLS.calculateAt(newdirfd,newpath);FS.rename(oldpath,newpath);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_rmdir(path){path>>>=0;try{path=SYSCALLS.getStr(path);FS.rmdir(path);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_stat64(path,buf){path>>>=0;buf>>>=0;try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_unlinkat(dirfd,path,flags){path>>>=0;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(flags===0){FS.unlink(path);}else if(flags===512){FS.rmdir(path);}else{abort("Invalid flags passed to unlinkat");}return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var readI53FromI64=function readI53FromI64(ptr){return HEAPU32[ptr>>>2>>>0]+HEAP32[ptr+4>>>2>>>0]*4294967296;};function ___syscall_utimensat(dirfd,path,times,flags){path>>>=0;times>>>=0;try{path=SYSCALLS.getStr(path);assert(flags===0);path=SYSCALLS.calculateAt(dirfd,path,true);if(!times){var atime=datenow();var mtime=atime;}else{var seconds=readI53FromI64(times);var nanoseconds=HEAP32[times+8>>>2>>>0];atime=seconds*1e3+nanoseconds/(1e3*1e3);times+=16;seconds=readI53FromI64(times);nanoseconds=HEAP32[times+8>>>2>>>0];mtime=seconds*1e3+nanoseconds/(1e3*1e3);}FS.utime(path,atime,mtime);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var nowIsMonotonic=1;var __emscripten_get_now_is_monotonic=function __emscripten_get_now_is_monotonic(){return nowIsMonotonic;};function __emscripten_system(command){command>>>=0;if(false){if(!command)return 1;var cmdstr=UTF8ToString(command);if(!cmdstr.length)return 0;var cp=null;var ret=cp.spawnSync(cmdstr,[],{shell:true,stdio:"inherit"});var _W_EXITCODE=function _W_EXITCODE(ret2,sig){return ret2<<8|sig;};if(ret.status===null){var signalToNumber=function signalToNumber(sig){switch(sig){case"SIGHUP":return 1;case"SIGINT":return 2;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15;}return 2;};return _W_EXITCODE(0,signalToNumber(ret.signal));}return _W_EXITCODE(ret.status,0);}if(!command)return 0;return-52;}var __emscripten_throw_longjmp=function __emscripten_throw_longjmp(){throw Infinity;};function __gmtime_js(time_low,time_high,tmPtr){var time=convertI32PairToI53Checked(time_low,time_high);tmPtr>>>=0;var date=new Date(time*1e3);HEAP32[tmPtr>>>2>>>0]=date.getUTCSeconds();HEAP32[tmPtr+4>>>2>>>0]=date.getUTCMinutes();HEAP32[tmPtr+8>>>2>>>0]=date.getUTCHours();HEAP32[tmPtr+12>>>2>>>0]=date.getUTCDate();HEAP32[tmPtr+16>>>2>>>0]=date.getUTCMonth();HEAP32[tmPtr+20>>>2>>>0]=date.getUTCFullYear()-1900;HEAP32[tmPtr+24>>>2>>>0]=date.getUTCDay();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>>>0]=yday;}var isLeapYear=function isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0);};var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];var ydayFromDate=function ydayFromDate(date){var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday;};function __localtime_js(time_low,time_high,tmPtr){var time=convertI32PairToI53Checked(time_low,time_high);tmPtr>>>=0;var date=new Date(time*1e3);HEAP32[tmPtr>>>2>>>0]=date.getSeconds();HEAP32[tmPtr+4>>>2>>>0]=date.getMinutes();HEAP32[tmPtr+8>>>2>>>0]=date.getHours();HEAP32[tmPtr+12>>>2>>>0]=date.getDate();HEAP32[tmPtr+16>>>2>>>0]=date.getMonth();HEAP32[tmPtr+20>>>2>>>0]=date.getFullYear()-1900;HEAP32[tmPtr+24>>>2>>>0]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>>2>>>0]=yday;HEAP32[tmPtr+36>>>2>>>0]=-(date.getTimezoneOffset()*60);var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>>2>>>0]=dst;}var __mktime_js=function __mktime_js(tmPtr){tmPtr>>>=0;var ret=function(){var date=new Date(HEAP32[tmPtr+20>>>2>>>0]+1900,HEAP32[tmPtr+16>>>2>>>0],HEAP32[tmPtr+12>>>2>>>0],HEAP32[tmPtr+8>>>2>>>0],HEAP32[tmPtr+4>>>2>>>0],HEAP32[tmPtr>>>2>>>0],0);var dst=HEAP32[tmPtr+32>>>2>>>0];var guessedOffset=date.getTimezoneOffset();var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dstOffset=Math.min(winterOffset,summerOffset);if(dst<0){HEAP32[tmPtr+32>>>2>>>0]=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>>>0]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>>2>>>0]=yday;HEAP32[tmPtr>>>2>>>0]=date.getSeconds();HEAP32[tmPtr+4>>>2>>>0]=date.getMinutes();HEAP32[tmPtr+8>>>2>>>0]=date.getHours();HEAP32[tmPtr+12>>>2>>>0]=date.getDate();HEAP32[tmPtr+16>>>2>>>0]=date.getMonth();HEAP32[tmPtr+20>>>2>>>0]=date.getYear();var timeMs=date.getTime();if(isNaN(timeMs)){return-1;}return timeMs/1e3;}();return setTempRet0((tempDouble=ret,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)),ret>>>0;};function __mmap_js(len,prot,flags,fd,offset_low,offset_high,allocated,addr){len>>>=0;var offset=convertI32PairToI53Checked(offset_low,offset_high);allocated>>>=0;addr>>>=0;try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);var res=FS.mmap(stream,len,offset,prot,flags);var ptr=res.ptr;HEAP32[allocated>>>2>>>0]=res.allocated;HEAPU32[addr>>>2>>>0]=ptr;return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function __munmap_js(addr,len,prot,flags,fd,offset_low,offset_high){addr>>>=0;len>>>=0;var offset=convertI32PairToI53Checked(offset_low,offset_high);try{var stream=SYSCALLS.getStreamFromFD(fd);if(prot&2){SYSCALLS.doMsync(addr,stream,len,flags,offset);}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function __tzset_js(timezone,daylight,std_name,dst_name){timezone>>>=0;daylight>>>=0;std_name>>>=0;dst_name>>>=0;var currentYear=/* @__PURE__ */new Date().getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU32[timezone>>>2>>>0]=stdTimezoneOffset*60;HEAP32[daylight>>>2>>>0]=Number(winterOffset!=summerOffset);function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT";}var winterName=extractZone(winter);var summerName=extractZone(summer);if(summerOffset<winterOffset){stringToUTF8(winterName,std_name,7);stringToUTF8(summerName,dst_name,7);}else{stringToUTF8(winterName,dst_name,7);stringToUTF8(summerName,std_name,7);}}var _abort=function _abort(){abort("native code called abort()");};var _emscripten_date_now=function _emscripten_date_now(){return datenow();};var getHeapMax=function getHeapMax(){return 4294901760;};function _emscripten_get_heap_max(){return getHeapMax();}var _emscripten_get_now;_emscripten_get_now=function _emscripten_get_now(){return deterministicNow();};function _emscripten_memcpy_js(dest,src,num){dest>>>=0;src>>>=0;num>>>=0;return HEAPU8.copyWithin(dest>>>0,src>>>0,src+num>>>0);}var growMemory=function growMemory(size){var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536;try{wasmMemory.grow(pages);updateMemoryViews();return 1;}catch(e){err("growMemory: Attempted to grow heap from ".concat(b.byteLength," bytes to ").concat(size," bytes, but got error: ").concat(e));}};function _emscripten_resize_heap(requestedSize){requestedSize>>>=0;var oldSize=HEAPU8.length;assert(requestedSize>oldSize);var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){err("Cannot enlarge memory, requested ".concat(requestedSize," bytes, but the limit is ").concat(maxHeapSize," bytes!"));return false;}var alignUp=function alignUp(x,multiple){return x+(multiple-x%multiple)%multiple;};for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+0.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true;}}err("Failed to grow the heap from ".concat(oldSize," bytes to ").concat(newSize," bytes, not enough memory!"));return false;}var ENV={};var getExecutableName=function getExecutableName(){return thisProgram||"./this.program";};var _getEnvStrings=function getEnvStrings(){if(!_getEnvStrings.strings){var lang="C.UTF-8";var env={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:lang,_:getExecutableName()};for(var x in ENV){if(ENV[x]===void 0)delete env[x];else env[x]=ENV[x];}var strings=[];for(var x in env){strings.push("".concat(x,"=").concat(env[x]));}_getEnvStrings.strings=strings;}return _getEnvStrings.strings;};var stringToAscii=function stringToAscii(str,buffer){for(var i=0;i<str.length;++i){assert(str.charCodeAt(i)===(str.charCodeAt(i)&255));HEAP8[buffer++>>>0]=str.charCodeAt(i);}HEAP8[buffer>>>0]=0;};var _environ_get=function _environ_get(__environ,environ_buf){__environ>>>=0;environ_buf>>>=0;var bufSize=0;_getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>>2>>>0]=ptr;stringToAscii(string,ptr);bufSize+=string.length+1;});return 0;};var _environ_sizes_get=function _environ_sizes_get(penviron_count,penviron_buf_size){penviron_count>>>=0;penviron_buf_size>>>=0;var strings=_getEnvStrings();HEAPU32[penviron_count>>>2>>>0]=strings.length;var bufSize=0;strings.forEach(function(string){return bufSize+=string.length+1;});HEAPU32[penviron_buf_size>>>2>>>0]=bufSize;return 0;};var runtimeKeepaliveCounter=0;var keepRuntimeAlive=function keepRuntimeAlive(){return noExitRuntime||runtimeKeepaliveCounter>0;};var _proc_exit=function _proc_exit(code){EXITSTATUS=code;if(!keepRuntimeAlive()){var _Module2$onExit;(_Module2$onExit=Module2["onExit"])===null||_Module2$onExit===void 0||_Module2$onExit.call(Module2,code);ABORT=true;}quit_(code,new ExitStatus(code));};var exitJS=function exitJS(status,implicit){EXITSTATUS=status;checkUnflushedContent();if(keepRuntimeAlive()&&!implicit){var msg="program exited (with status: ".concat(status,"), but keepRuntimeAlive() is set (counter=").concat(runtimeKeepaliveCounter,") due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)");readyPromiseReject(msg);err(msg);}_proc_exit(status);};var _exit=exitJS;function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}function _fd_fdstat_get(fd,pbuf){pbuf>>>=0;try{var rightsBase=0;var rightsInheriting=0;var flags=0;{var stream=SYSCALLS.getStreamFromFD(fd);var type=stream.tty?2:FS.isDir(stream.mode)?3:FS.isLink(stream.mode)?7:4;}HEAP8[pbuf>>>0]=type;HEAP16[pbuf+2>>>1>>>0]=flags;tempI64=[rightsBase>>>0,(tempDouble=rightsBase,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[pbuf+8>>>2>>>0]=tempI64[0],HEAP32[pbuf+12>>>2>>>0]=tempI64[1];tempI64=[rightsInheriting>>>0,(tempDouble=rightsInheriting,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[pbuf+16>>>2>>>0]=tempI64[0],HEAP32[pbuf+20>>>2>>>0]=tempI64[1];return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var doReadv=function doReadv(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>>2>>>0];var len=HEAPU32[iov+4>>>2>>>0];iov+=8;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break;if(typeof offset!=="undefined"){offset+=curr;}}return ret;};function _fd_read(fd,iov,iovcnt,pnum){iov>>>=0;iovcnt>>>=0;pnum>>>=0;try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doReadv(stream,iov,iovcnt);HEAPU32[pnum>>>2>>>0]=num;return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){var offset=convertI32PairToI53Checked(offset_low,offset_high);newOffset>>>=0;try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>>2>>>0]=tempI64[0],HEAP32[newOffset+4>>>2>>>0]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}function _fd_sync(fd){try{var _stream$stream_ops3;var stream=SYSCALLS.getStreamFromFD(fd);if((_stream$stream_ops3=stream.stream_ops)!==null&&_stream$stream_ops3!==void 0&&_stream$stream_ops3.fsync){return stream.stream_ops.fsync(stream);}return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var doWritev=function doWritev(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>>2>>>0];var len=HEAPU32[iov+4>>>2>>>0];iov+=8;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(typeof offset!=="undefined"){offset+=curr;}}return ret;};function _fd_write(fd,iov,iovcnt,pnum){iov>>>=0;iovcnt>>>=0;pnum>>>=0;try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doWritev(stream,iov,iovcnt);HEAPU32[pnum>>>2>>>0]=num;return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var arraySum=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];var addDays=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;};var writeArrayToMemory=function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer>>>0);};function _strftime(s,maxsize,format2,tm){s>>>=0;maxsize>>>=0;format2>>>=0;tm>>>=0;var tm_zone=HEAPU32[tm+40>>>2>>>0];var date={tm_sec:HEAP32[tm>>>2>>>0],tm_min:HEAP32[tm+4>>>2>>>0],tm_hour:HEAP32[tm+8>>>2>>>0],tm_mday:HEAP32[tm+12>>>2>>>0],tm_mon:HEAP32[tm+16>>>2>>>0],tm_year:HEAP32[tm+20>>>2>>>0],tm_wday:HEAP32[tm+24>>>2>>>0],tm_yday:HEAP32[tm+28>>>2>>>0],tm_isdst:HEAP32[tm+32>>>2>>>0],tm_gmtoff:HEAP32[tm+36>>>2>>>0],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format2);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","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var 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.length<digits){str=character[0]+str;}return str;}function leadingNulls(value,digits){return leadingSomething(value,digits,"0");}function compareByDay(date1,date2){function sgn(value){return value<0?-1:value>0?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(date2){var thisDate=addDays(new Date(date2.tm_year+1900,0,1),date2.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;}return thisDate.getFullYear();}return thisDate.getFullYear()-1;}var EXPANSION_RULES_2={"%a":function a(date2){return WEEKDAYS[date2.tm_wday].substring(0,3);},"%A":function A(date2){return WEEKDAYS[date2.tm_wday];},"%b":function b(date2){return MONTHS[date2.tm_mon].substring(0,3);},"%B":function B(date2){return MONTHS[date2.tm_mon];},"%C":function C(date2){var year=date2.tm_year+1900;return leadingNulls(year/100|0,2);},"%d":function d(date2){return leadingNulls(date2.tm_mday,2);},"%e":function e(date2){return leadingSomething(date2.tm_mday,2," ");},"%g":function g(date2){return getWeekBasedYear(date2).toString().substring(2);},"%G":getWeekBasedYear,"%H":function H(date2){return leadingNulls(date2.tm_hour,2);},"%I":function I(date2){var twelveHour=date2.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2);},"%j":function j(date2){return leadingNulls(date2.tm_mday+arraySum(isLeapYear(date2.tm_year+1900)?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,date2.tm_mon-1),3);},"%m":function m(date2){return leadingNulls(date2.tm_mon+1,2);},"%M":function M(date2){return leadingNulls(date2.tm_min,2);},"%n":function n(){return"\n";},"%p":function p(date2){if(date2.tm_hour>=0&&date2.tm_hour<12){return"AM";}return"PM";},"%S":function S(date2){return leadingNulls(date2.tm_sec,2);},"%t":function t(){return" ";},"%u":function u(date2){return date2.tm_wday||7;},"%U":function U(date2){var days=date2.tm_yday+7-date2.tm_wday;return leadingNulls(Math.floor(days/7),2);},"%V":function V(date2){var val=Math.floor((date2.tm_yday+7-(date2.tm_wday+6)%7)/7);if((date2.tm_wday+371-date2.tm_yday-2)%7<=2){val++;}if(!val){val=52;var dec31=(date2.tm_wday+7-date2.tm_yday-1)%7;if(dec31==4||dec31==5&&isLeapYear(date2.tm_year%400-1)){val++;}}else if(val==53){var jan1=(date2.tm_wday+371-date2.tm_yday)%7;if(jan1!=4&&(jan1!=3||!isLeapYear(date2.tm_year)))val=1;}return leadingNulls(val,2);},"%w":function w(date2){return date2.tm_wday;},"%W":function W(date2){var days=date2.tm_yday+7-(date2.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2);},"%y":function y(date2){return(date2.tm_year+1900).toString().substring(2);},"%Y":function Y(date2){return date2.tm_year+1900;},"%z":function z(date2){var off=date2.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4);},"%Z":function Z(date2){return date2.tm_zone;},"%%":function _(){return"%";}};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date));}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0;}writeArrayToMemory(bytes,s);return bytes.length-1;}var handleException=function handleException(e){if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS;}checkStackCookie();if(e instanceof WebAssembly.RuntimeError){if(_emscripten_stack_get_current2()<=0){err("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 209715200)");}}quit_(1,e);};var wasmTableMirror=[];var wasmTable;var getWasmTableEntry=function getWasmTableEntry(funcPtr){var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr);}assert(wasmTable.get(funcPtr)==func,"JavaScript-side Wasm function table mirror is out of date!");return func;};var getCFunc=function getCFunc(ident){var func=Module2["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func;};var stringToUTF8OnStack=function stringToUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret;};var ccall=function ccall(ident,returnType,argTypes,args,opts){var toC={string:function string(str){var ret2=0;if(str!==null&&str!==void 0&&str!==0){ret2=stringToUTF8OnStack(str);}return ret2;},array:function array(arr){var ret2=stackAlloc(arr.length);writeArrayToMemory(arr,ret2);return ret2;}};function convertReturnValue(ret2){if(returnType==="string"){return UTF8ToString(ret2);}if(returnType==="boolean")return Boolean(ret2);return ret2;}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i]);}else{cArgs[i]=args[i];}}}var ret=func.apply(void 0,cArgs);function onDone(ret2){if(stack!==0)stackRestore(stack);return convertReturnValue(ret2);}ret=onDone(ret);return ret;};var cwrap=function cwrap(ident,returnType,argTypes,opts){return function(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}return ccall(ident,returnType,argTypes,args,opts);};};FS.createPreloadedFile=FS_createPreloadedFile;FS.staticInit();function checkIncomingModuleAPI(){ignoredModuleProp("fetchSettings");}var wasmImports={/** @export */__syscall_chmod:___syscall_chmod,/** @export */__syscall_dup3:___syscall_dup3,/** @export */__syscall_faccessat:___syscall_faccessat,/** @export */__syscall_fchmod:___syscall_fchmod,/** @export */__syscall_fchown32:___syscall_fchown32,/** @export */__syscall_fcntl64:___syscall_fcntl64,/** @export */__syscall_fstat64:___syscall_fstat64,/** @export */__syscall_ftruncate64:___syscall_ftruncate64,/** @export */__syscall_getcwd:___syscall_getcwd,/** @export */__syscall_ioctl:___syscall_ioctl,/** @export */__syscall_lstat64:___syscall_lstat64,/** @export */__syscall_mkdirat:___syscall_mkdirat,/** @export */__syscall_newfstatat:___syscall_newfstatat,/** @export */__syscall_openat:___syscall_openat,/** @export */__syscall_readlinkat:___syscall_readlinkat,/** @export */__syscall_renameat:___syscall_renameat,/** @export */__syscall_rmdir:___syscall_rmdir,/** @export */__syscall_stat64:___syscall_stat64,/** @export */__syscall_unlinkat:___syscall_unlinkat,/** @export */__syscall_utimensat:___syscall_utimensat,/** @export */_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,/** @export */_emscripten_system:__emscripten_system,/** @export */_emscripten_throw_longjmp:__emscripten_throw_longjmp,/** @export */_gmtime_js:__gmtime_js,/** @export */_localtime_js:__localtime_js,/** @export */_mktime_js:__mktime_js,/** @export */_mmap_js:__mmap_js,/** @export */_munmap_js:__munmap_js,/** @export */_tzset_js:__tzset_js,/** @export */abort:_abort,/** @export */emscripten_date_now:_emscripten_date_now,/** @export */emscripten_get_heap_max:_emscripten_get_heap_max,/** @export */emscripten_get_now:_emscripten_get_now,/** @export */emscripten_memcpy_js:_emscripten_memcpy_js,/** @export */emscripten_resize_heap:_emscripten_resize_heap,/** @export */environ_get:_environ_get,/** @export */environ_sizes_get:_environ_sizes_get,/** @export */exit:_exit,/** @export */fd_close:_fd_close,/** @export */fd_fdstat_get:_fd_fdstat_get,/** @export */fd_read:_fd_read,/** @export */fd_seek:_fd_seek,/** @export */fd_sync:_fd_sync,/** @export */fd_write:_fd_write,/** @export */invoke_vii:invoke_vii,/** @export */strftime:_strftime};var wasmExports=createWasm();var ___wasm_call_ctors=createExportWrapper("__wasm_call_ctors");var _handle=Module2["_handle"]=createExportWrapper("handle");var _main=Module2["_main"]=createExportWrapper("main");var setTempRet0=createExportWrapper("setTempRet0");var _fflush=createExportWrapper("fflush");var _emscripten_builtin_memalign=createExportWrapper("emscripten_builtin_memalign");var _sbrk=createExportWrapper("sbrk");var _setThrew=createExportWrapper("setThrew");var _emscripten_stack_init2=function _emscripten_stack_init(){return(_emscripten_stack_init2=wasmExports["emscripten_stack_init"])();};var _emscripten_stack_get_free2=function _emscripten_stack_get_free(){return(_emscripten_stack_get_free2=wasmExports["emscripten_stack_get_free"])();};var _emscripten_stack_get_base2=function _emscripten_stack_get_base(){return(_emscripten_stack_get_base2=wasmExports["emscripten_stack_get_base"])();};var _emscripten_stack_get_end2=function _emscripten_stack_get_end(){return(_emscripten_stack_get_end2=wasmExports["emscripten_stack_get_end"])();};var stackSave=createExportWrapper("stackSave");var stackRestore=createExportWrapper("stackRestore");var stackAlloc=createExportWrapper("stackAlloc");var _emscripten_stack_get_current2=function _emscripten_stack_get_current(){return(_emscripten_stack_get_current2=wasmExports["emscripten_stack_get_current"])();};var dynCall_viiiij=Module2["dynCall_viiiij"]=createExportWrapper("dynCall_viiiij");var dynCall_ij=Module2["dynCall_ij"]=createExportWrapper("dynCall_ij");var dynCall_iiiij=Module2["dynCall_iiiij"]=createExportWrapper("dynCall_iiiij");var dynCall_vijii=Module2["dynCall_vijii"]=createExportWrapper("dynCall_vijii");var dynCall_iij=Module2["dynCall_iij"]=createExportWrapper("dynCall_iij");var dynCall_iijii=Module2["dynCall_iijii"]=createExportWrapper("dynCall_iijii");var dynCall_iiji=Module2["dynCall_iiji"]=createExportWrapper("dynCall_iiji");var dynCall_iiiiiij=Module2["dynCall_iiiiiij"]=createExportWrapper("dynCall_iiiiiij");var dynCall_iiij=Module2["dynCall_iiij"]=createExportWrapper("dynCall_iiij");var dynCall_jii=Module2["dynCall_jii"]=createExportWrapper("dynCall_jii");var dynCall_ji=Module2["dynCall_ji"]=createExportWrapper("dynCall_ji");var dynCall_vij=Module2["dynCall_vij"]=createExportWrapper("dynCall_vij");var dynCall_iiiiijii=Module2["dynCall_iiiiijii"]=createExportWrapper("dynCall_iiiiijii");var dynCall_j=Module2["dynCall_j"]=createExportWrapper("dynCall_j");var dynCall_jj=Module2["dynCall_jj"]=createExportWrapper("dynCall_jj");var dynCall_jiij=Module2["dynCall_jiij"]=createExportWrapper("dynCall_jiij");var dynCall_iiiiji=Module2["dynCall_iiiiji"]=createExportWrapper("dynCall_iiiiji");var dynCall_iiiijii=Module2["dynCall_iiiijii"]=createExportWrapper("dynCall_iiiijii");var dynCall_viiji=Module2["dynCall_viiji"]=createExportWrapper("dynCall_viiji");var dynCall_viijii=Module2["dynCall_viijii"]=createExportWrapper("dynCall_viijii");var dynCall_iiiijji=Module2["dynCall_iiiijji"]=createExportWrapper("dynCall_iiiijji");var dynCall_jiji=Module2["dynCall_jiji"]=createExportWrapper("dynCall_jiji");function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function applySignatureConversions(wasmExports2){wasmExports2=Object.assign({},wasmExports2);var makeWrapper_ppp=function makeWrapper_ppp(f){return function(a0,a1){return f(a0,a1)>>>0;};};var makeWrapper_pP=function makeWrapper_pP(f){return function(a0){return f(a0)>>>0;};};var makeWrapper_p=function makeWrapper_p(f){return function(){return f()>>>0;};};var makeWrapper_pp=function makeWrapper_pp(f){return function(a0){return f(a0)>>>0;};};wasmExports2["emscripten_builtin_memalign"]=makeWrapper_ppp(wasmExports2["emscripten_builtin_memalign"]);wasmExports2["sbrk"]=makeWrapper_pP(wasmExports2["sbrk"]);wasmExports2["emscripten_stack_get_base"]=makeWrapper_p(wasmExports2["emscripten_stack_get_base"]);wasmExports2["emscripten_stack_get_end"]=makeWrapper_p(wasmExports2["emscripten_stack_get_end"]);wasmExports2["stackSave"]=makeWrapper_p(wasmExports2["stackSave"]);wasmExports2["stackAlloc"]=makeWrapper_pp(wasmExports2["stackAlloc"]);wasmExports2["emscripten_stack_get_current"]=makeWrapper_p(wasmExports2["emscripten_stack_get_current"]);return wasmExports2;}var MAGIC=0;Math.random=function(){MAGIC=Math.pow(MAGIC+1.8912,3)%1;return MAGIC;};var TIME=1e4;function deterministicNow(){return TIME++;}datenow=deterministicNow;Module2["thisProgram"]="thisProgram";function hashMemory(id){var ret=0;var len=_sbrk(0);for(var i=0;i<len;i++){ret=ret*17+HEAPU8[i>>>0]|0;}return id+":"+ret;}function hashString(s){var ret=0;for(var i=0;i<s.length;i++){ret=ret*17+s.charCodeAt(i)|0;}return ret;}Module2["cwrap"]=cwrap;var missingLibrarySymbols=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromU64","convertI32PairToI53","convertU32PairToI53","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getCallstack","emscriptenLog","convertPCtoSourceLocation","readEmAsmArgs","jstoi_q","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asmjsMangle","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","stackTrace","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","ExceptionInfo","findMatchingCatch","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_unlink","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","demangle"];missingLibrarySymbols.forEach(missingLibrarySymbol);var unexportedSymbols=["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createLazyFile","FS_createLink","FS_createDevice","FS_readFile","out","err","callMain","abort","wasmMemory","wasmExports","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","readI53FromI64","convertI32PairToI53Checked","ptrToString","zeroMemory","exitJS","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","arraySum","addDays","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","UNWIND_CACHE","readEmAsmArgsArray","jstoi_s","getExecutableName","handleException","keepRuntimeAlive","asyncLoad","alignMemory","mmapAlloc","wasmTable","noExitRuntime","getCFunc","ccall","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","Browser","getPreloadedImageData__data","wget","SYSCALLS","preloadPlugins","FS_createPreloadedFile","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS","FS_createDataFile","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack"];unexportedSymbols.forEach(unexportedRuntimeSymbol);var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller;};function callMain(){assert(runDependencies==0,'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])');assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called");var entryFunction=_main;var argc=0;var argv=0;try{var ret=entryFunction(argc,argv);exitJS(ret,/* implicit = */true);return ret;}catch(e){return handleException(e);}}function stackCheckInit(){_emscripten_stack_init2();writeStackCookie();}function run(){if(runDependencies>0){return;}stackCheckInit();preRun();if(runDependencies>0){return;}function doRun(){if(calledRun)return;calledRun=true;Module2["calledRun"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module2);if(Module2["onRuntimeInitialized"])Module2["onRuntimeInitialized"]();if(shouldRunNow)callMain();postRun();}if(Module2["setStatus"]){Module2["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module2["setStatus"]("");},1);doRun();},1);}else{doRun();}checkStackCookie();}function checkUnflushedContent(){var oldOut=out;var oldErr=err;var has=false;out=err=function err(x){has=true;};try{_fflush(0);["stdout","stderr"].forEach(function(name){var _tty$output;var info=FS.analyzePath("/dev/"+name);if(!info)return;var stream=info.object;var rdev=stream.rdev;var tty=TTY.ttys[rdev];if(tty!==null&&tty!==void 0&&(_tty$output=tty.output)!==null&&_tty$output!==void 0&&_tty$output.length){has=true;}});}catch(e){}out=oldOut;err=oldErr;if(has){_warnOnce("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.");}}if(Module2["preInit"]){if(typeof Module2["preInit"]=="function")Module2["preInit"]=[Module2["preInit"]];while(Module2["preInit"].length>0){Module2["preInit"].pop()();}}var shouldRunNow=true;if(Module2["noInitialRun"])shouldRunNow=false;run();Module2.resizeHeap=_emscripten_resize_heap;return Module2.ready;};}();module2.exports=Module;}});// src/formats/emscripten4.cjs
58
58
  var require_emscripten4=__commonJS({"src/formats/emscripten4.cjs":function src_formats_emscripten4Cjs(exports2,module2){var DEFAULT_GAS_LIMIT=9e15;var Module=function(_document$currentScri){var _scriptName=typeof document!="undefined"?(_document$currentScri=document.currentScript)===null||_document$currentScri===void 0?void 0:_document$currentScri.src:void 0;if(typeof __filename!="undefined")_scriptName||(_scriptName=__filename);return function(){var moduleArg=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var moduleRtn;var Module2=Object.assign({},moduleArg);Module2.gas={limit:Module2.computeLimit||DEFAULT_GAS_LIMIT,used:0,use:function use(amount){Module2.gas.used+=amount;},refill:function refill(amount){if(!amount)Module2.gas.used=0;else Module2.gas.used=Math.max(Module2.gas.used-amount,0);},isEmpty:function isEmpty(){return Module2.gas.used>Module2.gas.limit;}};var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject;});["_malloc","_memory","___asyncjs__weavedrive_open","___asyncjs__weavedrive_read","___asyncjs__weavedrive_close","_metering_gasUsed","_handle","___indirect_function_table","onRuntimeInitialized"].forEach(function(prop){if(!Object.getOwnPropertyDescriptor(readyPromise,prop)){Object.defineProperty(readyPromise,prop,{get:function get(){return abort("You are getting "+prop+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");},set:function set(){return abort("You are setting "+prop+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}});var ENVIRONMENT_IS_WEB=(typeof window==="undefined"?"undefined":_typeof(window))=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=(typeof process==="undefined"?"undefined":_typeof(process))=="object"&&_typeof(process.versions)=="object"&&typeof process.versions.node=="string";var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module2["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");}if(ENVIRONMENT_IS_NODE){}Module2.locateFile=function(url){return url;};var moduleOverrides=Object.assign({},Module2);var arguments_=[];var thisProgram="./this.program";var quit_=function quit_(status,toThrow){throw toThrow;};var scriptDirectory="";function locateFile(path){if(Module2["locateFile"]){return Module2["locateFile"](path,scriptDirectory);}return scriptDirectory+path;}var read_,readAsync,readBinary;if(ENVIRONMENT_IS_NODE){if(typeof process=="undefined"||!process.release||process.release.name!=="node")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var nodeVersion=process.versions.node;var numericVersion=nodeVersion.split(".").slice(0,3);numericVersion=numericVersion[0]*1e4+numericVersion[1]*100+numericVersion[2].split("-")[0]*1;if(numericVersion<16e4){throw new Error("This emscripten-generated code requires node v16.0.0 (detected v"+nodeVersion+")");}var fs=_require("./fs");var nodePath=_require("path");scriptDirectory=__dirname+"/";read_=function read_(filename,binary){filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?void 0:"utf8");};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret);}assert(ret.buffer);return ret;};readAsync=function readAsync(filename,onload,onerror){var binary=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?void 0:"utf8",function(err2,data){if(err2)onerror(err2);else onload(binary?data.buffer:data);});};if(!Module2["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/");}arguments_=process.argv.slice(2);quit_=function quit_(status,toThrow){process.exitCode=status;throw toThrow;};}else if(ENVIRONMENT_IS_SHELL){if((typeof process==="undefined"?"undefined":_typeof(process))=="object"&&typeof _require==="function"||(typeof window==="undefined"?"undefined":_typeof(window))=="object"||typeof importScripts=="function")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href;}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src;}if(_scriptName){scriptDirectory=_scriptName;}if(scriptDirectory.startsWith("blob:")){scriptDirectory="";}else{scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1);}if(!((typeof window==="undefined"?"undefined":_typeof(window))=="object"||typeof importScripts=="function"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");{read_=function read_(url){var xhr=new XMLHttpRequest();xhr.open("GET",url,false);xhr.send(null);return xhr.responseText;};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest();xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(/** @type{!ArrayBuffer} */xhr.response);};}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest();xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return;}onerror();};xhr.onerror=onerror;xhr.send(null);};}}else{throw new Error("environment detection error");}var out=Module2["print"]||console.log.bind(console);var err=Module2["printErr"]||console.error.bind(console);Object.assign(Module2,moduleOverrides);moduleOverrides=null;checkIncomingModuleAPI();if(Module2["arguments"])arguments_=Module2["arguments"];legacyModuleProp("arguments","arguments_");if(Module2["thisProgram"])thisProgram=Module2["thisProgram"];legacyModuleProp("thisProgram","thisProgram");if(Module2["quit"])quit_=Module2["quit"];legacyModuleProp("quit","quit_");assert(typeof Module2["memoryInitializerPrefixURL"]=="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["pthreadMainPrefixURL"]=="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["cdInitializerPrefixURL"]=="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["filePackagePrefixURL"]=="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["read"]=="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module2["readAsync"]=="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module2["readBinary"]=="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module2["setWindowTitle"]=="undefined","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)");assert(typeof Module2["TOTAL_MEMORY"]=="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");legacyModuleProp("asm","wasmExports");legacyModuleProp("read","read_");legacyModuleProp("readAsync","readAsync");legacyModuleProp("readBinary","readBinary");legacyModuleProp("setWindowTitle","setWindowTitle");assert(!ENVIRONMENT_IS_SHELL,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");var wasmBinary;if(Module2["wasmBinary"])wasmBinary=Module2["wasmBinary"];legacyModuleProp("wasmBinary","wasmBinary");if((typeof WebAssembly==="undefined"?"undefined":_typeof(WebAssembly))!="object"){err("no native wasm support detected");}function intArrayFromBase64(s){if(typeof ENVIRONMENT_IS_NODE!="undefined"&&ENVIRONMENT_IS_NODE){var buf=Buffer.from(s,"base64");return new Uint8Array(buf.buffer,buf.byteOffset,buf.length);}var decoded=atob(s);var bytes=new Uint8Array(decoded.length);for(var i=0;i<decoded.length;++i){bytes[i]=decoded.charCodeAt(i);}return bytes;}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed"+(text?": "+text:""));}}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module2["HEAP8"]=HEAP8=new Int8Array(b);Module2["HEAP16"]=HEAP16=new Int16Array(b);Module2["HEAPU8"]=HEAPU8=new Uint8Array(b);Module2["HEAPU16"]=HEAPU16=new Uint16Array(b);Module2["HEAP32"]=HEAP32=new Int32Array(b);Module2["HEAPU32"]=HEAPU32=new Uint32Array(b);Module2["HEAPF32"]=HEAPF32=new Float32Array(b);Module2["HEAPF64"]=HEAPF64=new Float64Array(b);}assert(!Module2["STACK_SIZE"],"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time");assert(typeof Int32Array!="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!=void 0&&Int32Array.prototype.set!=void 0,"JS engine does not provide full typed array support");assert(!Module2["wasmMemory"],"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally");assert(!Module2["INITIAL_MEMORY"],"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");function writeStackCookie(){var max=_emscripten_stack_get_end3();assert((max&3)==0);if(max==0){max+=4;}HEAPU32[max>>>2>>>0]=34821223;HEAPU32[max+4>>>2>>>0]=2310721022;HEAPU32[0>>>2>>>0]=1668509029;}function checkStackCookie(){if(ABORT)return;var max=_emscripten_stack_get_end3();if(max==0){max+=4;}var cookie1=HEAPU32[max>>>2>>>0];var cookie2=HEAPU32[max+4>>>2>>>0];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten at ".concat(ptrToString(max),", expected hex dwords 0x89BACDFE and 0x2135467, but received ").concat(ptrToString(cookie2)," ").concat(ptrToString(cookie1)));}if(HEAPU32[0>>>2>>>0]!=1668509029){abort("Runtime error: The application has corrupted its heap memory area (address zero)!");}};(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";})();var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module2["preRun"]){if(typeof Module2["preRun"]=="function")Module2["preRun"]=[Module2["preRun"]];while(Module2["preRun"].length){addOnPreRun(Module2["preRun"].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){assert(!runtimeInitialized);runtimeInitialized=true;checkStackCookie();if(!Module2["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__);}function postRun(){checkStackCookie();if(Module2["postRun"]){if(typeof Module2["postRun"]=="function")Module2["postRun"]=[Module2["postRun"]];while(Module2["postRun"].length){addOnPostRun(Module2["postRun"].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}function addOnInit(cb){__ATINIT__.unshift(cb);}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function getUniqueRunDependency(id){var orig=id;while(1){if(!runDependencyTracking[id])return id;id=orig+Math.random();}}function addRunDependency(id){var _Module2$monitorRunDe3;runDependencies++;(_Module2$monitorRunDe3=Module2["monitorRunDependencies"])===null||_Module2$monitorRunDe3===void 0||_Module2$monitorRunDe3.call(Module2,runDependencies);if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return;}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:");}err("dependency: ".concat(dep));}if(shown){err("(end of list)");}},1e4);}}else{err("warning: run dependency added without ID");}}function removeRunDependency(id){var _Module2$monitorRunDe4;runDependencies--;(_Module2$monitorRunDe4=Module2["monitorRunDependencies"])===null||_Module2$monitorRunDe4===void 0||_Module2$monitorRunDe4.call(Module2,runDependencies);if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id];}else{err("warning: run dependency removed without ID");}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null;}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();}}}function abort(what){var _Module2$onAbort2;(_Module2$onAbort2=Module2["onAbort"])===null||_Module2$onAbort2===void 0||_Module2$onAbort2.call(Module2,what);what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;if(what.indexOf("RuntimeError: unreachable")>=0){what+='. "unreachable" may be due to ASYNCIFY_STACK_SIZE not being large enough (try increasing it)';}var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e;}var dataURIPrefix="data:application/octet-stream;base64,";var isDataURI=function isDataURI(filename){return filename.startsWith(dataURIPrefix);};var isFileURI=function isFileURI(filename){return filename.startsWith("file://");};function createExportWrapper(name,nargs){return function(){assert(runtimeInitialized,"native function `".concat(name,"` called before runtime initialization"));var f=wasmExports[name];assert(f,"exported native function `".concat(name,"` not found"));assert(arguments.length<=nargs,"native function `".concat(name,"` called with ").concat(arguments.length," args but expects ").concat(nargs));return f.apply(void 0,arguments);};}function findWasmBinary(){var f="process.wasm";if(!isDataURI(f)){return locateFile(f);}return f;}var wasmBinaryFile;function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary);}if(readBinary){return readBinary(file);}throw"both async and sync fetching of the wasm failed";}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(binaryFile)){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '".concat(binaryFile,"'");}return response["arrayBuffer"]();})["catch"](function(){return getBinarySync(binaryFile);});}else if(readAsync){return new Promise(function(resolve,reject){readAsync(binaryFile,function(response){return resolve(new Uint8Array(/** @type{!ArrayBuffer} */response));},reject);});}}return Promise.resolve().then(function(){return getBinarySync(binaryFile);});}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(function(binary){return WebAssembly.instantiate(binary,imports);}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: ".concat(reason));if(isFileURI(wasmBinaryFile)){err("warning: Loading from a file URI (".concat(wasmBinaryFile,") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"));}abort(reason);});}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err("wasm streaming compile failed: ".concat(reason));err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback);});});}return instantiateArrayBuffer(binaryFile,imports,callback);}function getWasmImports(){Asyncify.instrumentWasmImports(wasmImports);return{env:wasmImports,wasi_snapshot_preview1:wasmImports,metering:{usegas:function usegas(gas){Module2.gas.use(gas);if(Module2.gas.isEmpty())throw Error("out of gas!");}}};}function createWasm(){var info=getWasmImports();function receiveInstance(instance,module3){wasmExports=instance.exports;wasmExports=Asyncify.instrumentWasmExports(wasmExports);wasmExports=applySignatureConversions(wasmExports);wasmMemory=wasmExports["memory"];assert(wasmMemory,"memory not found in wasm exports");updateMemoryViews();wasmTable=wasmExports["__indirect_function_table"];assert(wasmTable,"table not found in wasm exports");addOnInit(wasmExports["__wasm_call_ctors"]);removeRunDependency("wasm-instantiate");return wasmExports;}addRunDependency("wasm-instantiate");var trueModule=Module2;function receiveInstantiationResult(result){assert(Module2===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(result["instance"]);}if(Module2["instantiateWasm"]){try{return Module2["instantiateWasm"](info,receiveInstance);}catch(e){err("Module.instantiateWasm callback failed with error: ".concat(e));readyPromiseReject(e);}}if(!wasmBinaryFile)wasmBinaryFile=findWasmBinary();instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult)["catch"](readyPromiseReject);return{};}var tempDouble;var tempI64;function legacyModuleProp(prop,newName){var incoming=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;if(!Object.getOwnPropertyDescriptor(Module2,prop)){Object.defineProperty(Module2,prop,{configurable:true,get:function get(){var extra=incoming?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":"";abort("`Module.".concat(prop,"` has been replaced by `").concat(newName,"`")+extra);}});}}function ignoredModuleProp(prop){if(Object.getOwnPropertyDescriptor(Module2,prop)){abort("`Module.".concat(prop,"` was supplied but `").concat(prop,"` not included in INCOMING_MODULE_JS_API"));}}function isExportedByForceFilesystem(name){return name==="FS_createPath"||name==="FS_createDataFile"||name==="FS_createPreloadedFile"||name==="FS_unlink"||name==="addRunDependency"||name==="FS_createLazyFile"||name==="FS_createDevice"||name==="removeRunDependency";}function missingGlobal(sym,msg){if(typeof globalThis!="undefined"){Object.defineProperty(globalThis,sym,{configurable:true,get:function get(){_warnOnce2("`".concat(sym,"` is not longer defined by emscripten. ").concat(msg));return void 0;}});}}missingGlobal("buffer","Please use HEAP8.buffer or wasmMemory.buffer");missingGlobal("asm","Please use wasmExports instead");function missingLibrarySymbol(sym){if(typeof globalThis!="undefined"&&!Object.getOwnPropertyDescriptor(globalThis,sym)){Object.defineProperty(globalThis,sym,{configurable:true,get:function get(){var msg="`".concat(sym,"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line");var librarySymbol=sym;if(!librarySymbol.startsWith("_")){librarySymbol="$"+sym;}msg+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='".concat(librarySymbol,"')");if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";}_warnOnce2(msg);return void 0;}});}unexportedRuntimeSymbol(sym);}function unexportedRuntimeSymbol(sym){if(!Object.getOwnPropertyDescriptor(Module2,sym)){Object.defineProperty(Module2,sym,{configurable:true,get:function get(){var msg="'".concat(sym,"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)");if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";}abort(msg);}});}}function __asyncjs__weavedrive_open(c_filename,mode){return Asyncify.handleAsync(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(){var filename,drive;return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:filename=UTF8ToString(Number(c_filename));if(Module2.WeaveDrive){_context.n=1;break;}return _context.a(2,Promise.resolve(null));case 1:drive=Module2.WeaveDrive(Module2,FS);_context.n=2;return drive.open(filename);case 2:return _context.a(2,_context.v);}},_callee);})));}function __asyncjs__weavedrive_read(fd,dst_ptr,length){return Asyncify.handleAsync(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(){var drive,_t;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:drive=Module2.WeaveDrive(Module2,FS);_t=Promise;_context2.n=1;return drive.read(fd,dst_ptr,length);case 1:return _context2.a(2,_t.resolve.call(_t,_context2.v));}},_callee2);})));}function __asyncjs__weavedrive_close(fd){return Asyncify.handleAsync(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(){var drive;return _regenerator().w(function(_context3){while(1)switch(_context3.n){case 0:drive=Module2.WeaveDrive(Module2,FS);return _context3.a(2,drive.close(fd));}},_callee3);})));}function metering_gasUsed(){return Module2.gas.used;}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit(".concat(status,")");this.status=status;}var callRuntimeCallbacks=function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module2);}};var noExitRuntime=Module2["noExitRuntime"]||true;var ptrToString=function ptrToString(ptr){assert(typeof ptr==="number");return"0x"+ptr.toString(16).padStart(8,"0");};var stackRestore=function stackRestore(val){return _emscripten_stack_restore(val);};var stackSave=function stackSave(){return _emscripten_stack_get_current3();};var _warnOnce2=function warnOnce(text){_warnOnce2.shown||(_warnOnce2.shown={});if(!_warnOnce2.shown[text]){_warnOnce2.shown[text]=1;if(ENVIRONMENT_IS_NODE)text="warning: "+text;err(text);}};var convertI32PairToI53Checked=function convertI32PairToI53Checked(lo,hi){assert(lo==lo>>>0||lo==(lo|0));assert(hi===(hi|0));return hi+2097152>>>0<4194305-!!lo?(lo>>>0)+hi*4294967296:NaN;};var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;var UTF8ArrayToString=function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){idx>>>=0;var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr));}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue;}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue;}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2;}else{if((u0&248)!=240)_warnOnce2("Invalid UTF-8 leading byte "+ptrToString(u0)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63;}if(u0<65536){str+=String.fromCharCode(u0);}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023);}}return str;};var UTF8ToString=function UTF8ToString(ptr,maxBytesToRead){assert(typeof ptr=="number","UTF8ToString expects a number (got ".concat(_typeof(ptr),")"));ptr>>>=0;return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";};function ___assert_fail(condition,filename,line,func){condition>>>=0;filename>>>=0;func>>>=0;abort("Assertion failed: ".concat(UTF8ToString(condition),", at: ")+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"]);}var ExceptionInfo=/*#__PURE__*/function(){function ExceptionInfo(excPtr){_classCallCheck(this,ExceptionInfo);this.excPtr=excPtr;this.ptr=excPtr-24;}return _createClass(ExceptionInfo,[{key:"set_type",value:function set_type(type){HEAPU32[this.ptr+4>>>2>>>0]=type;}},{key:"get_type",value:function get_type(){return HEAPU32[this.ptr+4>>>2>>>0];}},{key:"set_destructor",value:function set_destructor(destructor){HEAPU32[this.ptr+8>>>2>>>0]=destructor;}},{key:"get_destructor",value:function get_destructor(){return HEAPU32[this.ptr+8>>>2>>>0];}},{key:"set_caught",value:function set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12>>>0]=caught;}},{key:"get_caught",value:function get_caught(){return HEAP8[this.ptr+12>>>0]!=0;}},{key:"set_rethrown",value:function set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>>0]=rethrown;}},{key:"get_rethrown",value:function get_rethrown(){return HEAP8[this.ptr+13>>>0]!=0;}},{key:"init",value:function init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);}},{key:"set_adjusted_ptr",value:function set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>>2>>>0]=adjustedPtr;}},{key:"get_adjusted_ptr",value:function get_adjusted_ptr(){return HEAPU32[this.ptr+16>>>2>>>0];}},{key:"get_exception_ptr",value:function get_exception_ptr(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>>2>>>0];}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr;}}]);}();var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){ptr>>>=0;type>>>=0;destructor>>>=0;var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;assert(false,"Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.");}var PATH={isAbs:function isAbs(path){return path.charAt(0)==="/";},splitPath:function splitPath(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1);},normalizeArray:function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1);}else if(last===".."){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}if(allowAboveRoot){for(;up;up--){parts.unshift("..");}}return parts;},normalize:function normalize(path){var isAbsolute=PATH.isAbs(path),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 dirname(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return".";}if(dir){dir=dir.substr(0,dir.length-1);}return root+dir;},basename:function basename(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1);},join:function join(){for(var _len3=arguments.length,paths=new Array(_len3),_key3=0;_key3<_len3;_key3++){paths[_key3]=arguments[_key3];}return PATH.normalize(paths.join("/"));},join2:function join2(l,r){return PATH.normalize(l+"/"+r);}};var initRandomFill=function initRandomFill(){if((typeof crypto==="undefined"?"undefined":_typeof(crypto))=="object"&&typeof crypto["getRandomValues"]=="function"){return function(view){return crypto.getRandomValues(view);};}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=_require("crypto");var randomFillSync=crypto_module["randomFillSync"];if(randomFillSync){return function(view){return crypto_module["randomFillSync"](view);};}var randomBytes=crypto_module["randomBytes"];return function(view){return view.set(randomBytes(view.byteLength)),view;};}catch(e){}}abort("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };");};var _randomFill2=function randomFill(view){return(_randomFill2=initRandomFill())(view);};var PATH_FS={resolve:function resolve(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?i<0||arguments.length<=i?undefined: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.isAbs(path);}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p;}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||".";},relative:function relative(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break;}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break;}if(start>end)return[];return arr.slice(start,end-start+1);}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break;}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..");}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/");}};var FS_stdin_getChar_buffer=[];var lengthBytesUTF8=function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++;}else if(c<=2047){len+=2;}else if(c>=55296&&c<=57343){len+=4;++i;}else{len+=3;}}return len;};var stringToUTF8Array=function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){outIdx>>>=0;assert(typeof str==="string","stringToUTF8Array expects a string (got ".concat(_typeof(str),")"));if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023;}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++>>>0]=u;}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++>>>0]=192|u>>6;heap[outIdx++>>>0]=128|u&63;}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++>>>0]=224|u>>12;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63;}else{if(outIdx+3>=endIdx)break;if(u>1114111)_warnOnce2("Invalid Unicode code point "+ptrToString(u)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");heap[outIdx++>>>0]=240|u>>18;heap[outIdx++>>>0]=128|u>>12&63;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63;}}heap[outIdx>>>0]=0;return outIdx-startIdx;};function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array;}var FS_stdin_getChar=function FS_stdin_getChar(){if(!FS_stdin_getChar_buffer.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;try{bytesRead=fs.readSync(fd,buf);}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e;}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8");}else{result=null;}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n";}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n";}}if(!result){return null;}FS_stdin_getChar_buffer=intArrayFromString(result,true);}return FS_stdin_getChar_buffer.shift();};var TTY={ttys:[],init:function init(){},shutdown:function shutdown(){},register:function register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops);},stream_ops:{open:function open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43);}stream.tty=tty;stream.seekable=false;},close:function close(stream){stream.tty.ops.fsync(stream.tty);},fsync:function fsync(stream){stream.tty.ops.fsync(stream.tty);},read:function read(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60);}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty);}catch(e){throw new FS.ErrnoError(29);}if(result===void 0&&bytesRead===0){throw new FS.ErrnoError(6);}if(result===null||result===void 0)break;bytesRead++;buffer[offset+i]=result;}if(bytesRead){stream.node.timestamp=datenow();}return bytesRead;},write:function write(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(60);}try{for(var i=0;i<length;i++){stream.tty.ops.put_char(stream.tty,buffer[offset+i]);}}catch(e){throw new FS.ErrnoError(29);}if(length){stream.node.timestamp=datenow();}return i;}},default_tty_ops:{get_char:function get_char(tty){return FS_stdin_getChar();},put_char:function put_char(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[];}else{if(val!=0)tty.output.push(val);}},fsync:function fsync(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[];}},ioctl_tcgets:function ioctl_tcgets(tty){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};},ioctl_tcsets:function ioctl_tcsets(tty,optional_actions,data){return 0;},ioctl_tiocgwinsz:function ioctl_tiocgwinsz(tty){return[24,80];}},default_tty1_ops:{put_char:function put_char(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[];}else{if(val!=0)tty.output.push(val);}},fsync:function fsync(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[];}}}};var zeroMemory=function zeroMemory(address,size){HEAPU8.fill(0,address,address+size);return address;};var alignMemory=function alignMemory(size,alignment){assert(alignment,"alignment argument is required");return Math.ceil(size/alignment)*alignment;};var mmapAlloc=function mmapAlloc(size){size=alignMemory(size,65536);var ptr=_emscripten_builtin_memalign(65536,size);if(!ptr)return 0;return zeroMemory(ptr,size);};var MEMFS={ops_table:null,mount:function mount(_mount3){return MEMFS.createNode(null,"/",16384|511,/* 0777 */0);},createNode:function createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63);}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=datenow();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp;}return node;},getFileDataAsTypedArray:function getFileDataAsTypedArray(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents);},expandFileStorage:function expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)>>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);},resizeFileStorage:function resizeFileStorage(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)));}node.usedBytes=newSize;}},node_ops:{getattr:function getattr(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096;}else if(FS.isFile(node.mode)){attr.size=node.usedBytes;}else if(FS.isLink(node.mode)){attr.size=node.link.length;}else{attr.size=0;}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr;},setattr:function setattr(node,attr){if(attr.mode!==void 0){node.mode=attr.mode;}if(attr.timestamp!==void 0){node.timestamp=attr.timestamp;}if(attr.size!==void 0){MEMFS.resizeFileStorage(node,attr.size);}},lookup:function lookup(parent,name){throw FS.genericErrors[44];},mknod:function mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev);},rename:function rename(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55);}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=datenow();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir;},unlink:function unlink(parent,name){delete parent.contents[name];parent.timestamp=datenow();},rmdir:function rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55);}delete parent.contents[name];parent.timestamp=datenow();},readdir:function readdir(node){var entries=[".",".."];for(var _i2=0,_Object$keys2=Object.keys(node.contents);_i2<_Object$keys2.length;_i2++){var key=_Object$keys2[_i2];entries.push(key);}return entries;},symlink:function symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511/* 0777 */|40960,0);node.link=oldpath;return node;},readlink:function readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28);}return node.link;}},stream_ops:{read:function read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset);}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i];}return size;},write:function write(stream,buffer,offset,length,position,canOwn){assert(!(buffer instanceof ArrayBuffer));if(buffer.buffer===HEAP8.buffer){canOwn=false;}if(!length)return 0;var node=stream.node;node.timestamp=datenow();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){assert(position===0,"canOwn must imply no weird position inside the file");node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length;}else if(node.usedBytes===0&&position===0){node.contents=buffer.slice(offset,offset+length);node.usedBytes=length;return length;}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length;}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray){node.contents.set(buffer.subarray(offset,offset+length),position);}else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i];}}node.usedBytes=Math.max(node.usedBytes,position+length);return length;},llseek:function llseek(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.usedBytes;}}if(position<0){throw new FS.ErrnoError(28);}return position;},allocate:function allocate(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length);},mmap:function mmap(stream,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43);}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&contents.buffer===HEAP8.buffer){allocated=false;ptr=contents.byteOffset;}else{if(position>0||position+length<contents.length){if(contents.subarray){contents=contents.subarray(position,position+length);}else{contents=Array.prototype.slice.call(contents,position,position+length);}}allocated=true;ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48);}HEAP8.set(contents,ptr>>>0);}return{ptr:ptr,allocated:allocated};},msync:function msync(stream,buffer,offset,length,mmapFlags){MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0;}}};var asyncLoad=function asyncLoad(url,onload,onerror,noRunDep){var dep=!noRunDep?getUniqueRunDependency("al ".concat(url)):"";readAsync(url,function(arrayBuffer){assert(arrayBuffer,"Loading data file \"".concat(url,"\" failed (no arrayBuffer)."));onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep);},function(event){if(onerror){onerror();}else{throw"Loading data file \"".concat(url,"\" failed.");}});if(dep)addRunDependency(dep);};var FS_createDataFile=function FS_createDataFile(parent,name,fileData,canRead,canWrite,canOwn){FS.createDataFile(parent,name,fileData,canRead,canWrite,canOwn);};var preloadPlugins=Module2["preloadPlugins"]||[];var FS_handledByPreloadPlugin=function FS_handledByPreloadPlugin(byteArray,fullname,finish,onerror){if(typeof Browser!="undefined")Browser.init();var handled=false;preloadPlugins.forEach(function(plugin){if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,onerror);handled=true;}});return handled;};var FS_createPreloadedFile=function FS_createPreloadedFile(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish){var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency("cp ".concat(fullname));function processData(byteArray){function finish(byteArray2){preFinish===null||preFinish===void 0||preFinish();if(!dontCreateFile){FS_createDataFile(parent,name,byteArray2,canRead,canWrite,canOwn);}onload===null||onload===void 0||onload();removeRunDependency(dep);}if(FS_handledByPreloadPlugin(byteArray,fullname,finish,function(){onerror===null||onerror===void 0||onerror();removeRunDependency(dep);})){return;}finish(byteArray);}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,processData,onerror);}else{processData(url);}};var FS_modeStringToFlags=function FS_modeStringToFlags(str){var flagModes={r:0,"r+":2,w:512|64|1,"w+":512|64|2,a:1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error("Unknown file open mode: ".concat(str));}return flags;};var FS_getMode=function FS_getMode(canRead,canWrite){var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode;};var ERRNO_MESSAGES={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"};var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:/*#__PURE__*/function(_Error2){function ErrnoError(errno){var _this2;_classCallCheck(this,ErrnoError);_this2=_callSuper(this,ErrnoError,[ERRNO_MESSAGES[errno]]);_this2.name="ErrnoError";_this2.errno=errno;for(var key in ERRNO_CODES){if(ERRNO_CODES[key]===errno){_this2.code=key;break;}}return _this2;}_inherits(ErrnoError,_Error2);return _createClass(ErrnoError);}(/*#__PURE__*/_wrapNativeSuper(Error)),genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:/*#__PURE__*/function(){function FSStream(){_classCallCheck(this,FSStream);this.shared={};}return _createClass(FSStream,[{key:"object",get:function get(){return this.node;},set:function set(val){this.node=val;}},{key:"isRead",get:function get(){return(this.flags&2097155)!==1;}},{key:"isWrite",get:function get(){return(this.flags&2097155)!==0;}},{key:"isAppend",get:function get(){return this.flags&1024;}},{key:"flags",get:function get(){return this.shared.flags;},set:function set(val){this.shared.flags=val;}},{key:"position",get:function get(){return this.shared.position;},set:function set(val){this.shared.position=val;}}]);}(),FSNode:/*#__PURE__*/function(){function FSNode(parent,name,mode,rdev){_classCallCheck(this,FSNode);if(!parent){parent=this;}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev;this.readMode=292/*292*/|73;this.writeMode=146;}/*146*/return _createClass(FSNode,[{key:"read",get:function get(){return(this.mode&this.readMode)===this.readMode;},set:function set(val){val?this.mode|=this.readMode:this.mode&=~this.readMode;}},{key:"write",get:function get(){return(this.mode&this.writeMode)===this.writeMode;},set:function set(val){val?this.mode|=this.writeMode:this.mode&=~this.writeMode;}},{key:"isFolder",get:function get(){return FS.isDir(this.mode);}},{key:"isDevice",get:function get(){return FS.isChrdev(this.mode);}}]);}(),lookupPath:function lookupPath(path){var opts=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};path=PATH_FS.resolve(path);if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};opts=Object.assign(defaults,opts);if(opts.recurse_count>8){throw new FS.ErrnoError(32);}var parts=path.split("/").filter(function(p){return!!p;});var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break;}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root;}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH_FS.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count+1});current=lookup.node;if(count++>40){throw new FS.ErrnoError(32);}}}}return{path:current_path,node:current};},getPath:function getPath(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?"".concat(mount,"/").concat(path):mount+path;}path=path?"".concat(node.name,"/").concat(path):node.name;node=node.parent;}},hashName:function hashName(parentid,name){var hash=0;for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0;}return(parentid+hash>>>0)%FS.nameTable.length;},hashAddNode:function hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node;},hashRemoveNode:function hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next;}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break;}current=current.name_next;}}},lookupNode:function lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode);}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node;}}return FS.lookup(parent,name);},createNode:function createNode(parent,name,mode,rdev){assert(_typeof(parent)=="object");var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node;},destroyNode:function destroyNode(node){FS.hashRemoveNode(node);},isRoot:function isRoot(node){return node===node.parent;},isMountpoint:function isMountpoint(node){return!!node.mounted;},isFile:function isFile(mode){return(mode&61440)===32768;},isDir:function isDir(mode){return(mode&61440)===16384;},isLink:function isLink(mode){return(mode&61440)===40960;},isChrdev:function isChrdev(mode){return(mode&61440)===8192;},isBlkdev:function isBlkdev(mode){return(mode&61440)===24576;},isFIFO:function isFIFO(mode){return(mode&61440)===4096;},isSocket:function isSocket(mode){return(mode&49152)===49152;},flagsToPermissionString:function flagsToPermissionString(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w";}return perms;},nodePermissions:function nodePermissions(node,perms){if(FS.ignorePermissions){return 0;}if(perms.includes("r")&&!(node.mode&292)){return 2;}else if(perms.includes("w")&&!(node.mode&146)){return 2;}else if(perms.includes("x")&&!(node.mode&73)){return 2;}return 0;},mayLookup:function mayLookup(dir){if(!FS.isDir(dir.mode))return 54;var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0;},mayCreate:function mayCreate(dir,name){try{var node=FS.lookupNode(dir,name);return 20;}catch(e){}return FS.nodePermissions(dir,"wx");},mayDelete:function mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name);}catch(e){return e.errno;}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode;}if(isdir){if(!FS.isDir(node.mode)){return 54;}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10;}}else{if(FS.isDir(node.mode)){return 31;}}return 0;},mayOpen:function mayOpen(node,flags){if(!node){return 44;}if(FS.isLink(node.mode)){return 32;}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31;}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags));},MAX_OPEN_FDS:4096,nextfd:function nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd;}}throw new FS.ErrnoError(33);},getStreamChecked:function getStreamChecked(fd){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8);}return stream;},getStream:function getStream(fd){return FS.streams[fd];},createStream:function createStream(stream){var fd=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;stream=Object.assign(new FS.FSStream(),stream);if(fd==-1){fd=FS.nextfd();}stream.fd=fd;FS.streams[fd]=stream;return stream;},closeStream:function closeStream(fd){FS.streams[fd]=null;},dupStream:function dupStream(origStream){var _stream$stream_ops4,_stream$stream_ops4$d;var fd=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var stream=FS.createStream(origStream,fd);(_stream$stream_ops4=stream.stream_ops)===null||_stream$stream_ops4===void 0||(_stream$stream_ops4$d=_stream$stream_ops4.dup)===null||_stream$stream_ops4$d===void 0||_stream$stream_ops4$d.call(_stream$stream_ops4,stream);return stream;},chrdev_stream_ops:{open:function open(stream){var _stream$stream_ops$op2,_stream$stream_ops5;var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;(_stream$stream_ops$op2=(_stream$stream_ops5=stream.stream_ops).open)===null||_stream$stream_ops$op2===void 0||_stream$stream_ops$op2.call(_stream$stream_ops5,stream);},llseek:function llseek(){throw new FS.ErrnoError(70);}},major:function major(dev){return dev>>8;},minor:function minor(dev){return dev&255;},makedev:function makedev(ma,mi){return ma<<8|mi;},registerDevice:function registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops};},getDevice:function getDevice(dev){return FS.devices[dev];},getMounts:function getMounts(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,_toConsumableArray(m.mounts));}return mounts;},syncfs:function syncfs(populate,callback){if(typeof populate=="function"){callback=populate;populate=false;}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: ".concat(FS.syncFSRequests," FS.syncfs operations in flight at once, probably just doing extra work"));}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(errCode);}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode);}return;}if(++completed>=mounts.length){doCallback(null);}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null);}mount.type.syncfs(mount,populate,done);});},mount:function mount(type,opts,mountpoint){if(typeof type=="string"){throw type;}var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10);}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54);}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot;}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount);}}return mountRoot;},unmount:function unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28);}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current);}current=next;}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1);},lookup:function lookup(parent,name){return parent.node_ops.lookup(parent,name);},mknod:function mknod(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28);}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63);}return parent.node_ops.mknod(parent,name,mode,dev);},create:function create(path,mode){mode=mode!==void 0?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0);},mkdir:function mkdir(path,mode){mode=mode!==void 0?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0);},mkdirTree:function mkdirTree(path,mode){var dirs=path.split("/");var d="";for(var i=0;i<dirs.length;++i){if(!dirs[i])continue;d+="/"+dirs[i];try{FS.mkdir(d,mode);}catch(e){if(e.errno!=20)throw e;}}},mkdev:function mkdev(path,mode,dev){if(typeof dev=="undefined"){dev=mode;mode=438;}mode|=8192;return FS.mknod(path,mode,dev);},symlink:function symlink(oldpath,newpath){if(!PATH_FS.resolve(oldpath)){throw new FS.ErrnoError(44);}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44);}var newname=PATH.basename(newpath);var errCode=FS.mayCreate(parent,newname);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.symlink){throw new FS.ErrnoError(63);}return parent.node_ops.symlink(parent,newname,oldpath);},rename:function rename(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node;if(!old_dir||!new_dir)throw new FS.ErrnoError(44);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(75);}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH_FS.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(28);}relative=PATH_FS.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(55);}var new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}if(old_node===new_node){return;}var isdir=FS.isDir(old_node.mode);var errCode=FS.mayDelete(old_dir,old_name,isdir);if(errCode){throw new FS.ErrnoError(errCode);}errCode=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(errCode){throw new FS.ErrnoError(errCode);}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(63);}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(10);}if(new_dir!==old_dir){errCode=FS.nodePermissions(old_dir,"w");if(errCode){throw new FS.ErrnoError(errCode);}}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name);}catch(e){throw e;}finally{FS.hashAddNode(old_node);}},rmdir:function rmdir(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,true);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(63);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);},readdir:function readdir(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(54);}return node.node_ops.readdir(node);},unlink:function unlink(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44);}var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,false);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.unlink){throw new FS.ErrnoError(63);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}parent.node_ops.unlink(parent,name);FS.destroyNode(node);},readlink:function readlink(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(44);}if(!link.node_ops.readlink){throw new FS.ErrnoError(28);}return PATH_FS.resolve(FS.getPath(link.parent),link.node_ops.readlink(link));},stat:function stat(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(44);}if(!node.node_ops.getattr){throw new FS.ErrnoError(63);}return node.node_ops.getattr(node);},lstat:function lstat(path){return FS.stat(path,true);},chmod:function chmod(path,mode,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:datenow()});},lchmod:function lchmod(path,mode){FS.chmod(path,mode,true);},fchmod:function fchmod(fd,mode){var stream=FS.getStreamChecked(fd);FS.chmod(stream.node,mode);},chown:function chown(path,uid,gid,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}node.node_ops.setattr(node,{timestamp:datenow()});},lchown:function lchown(path,uid,gid){FS.chown(path,uid,gid,true);},fchown:function fchown(fd,uid,gid){var stream=FS.getStreamChecked(fd);FS.chown(stream.node,uid,gid);},truncate:function truncate(path,len){if(len<0){throw new FS.ErrnoError(28);}var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}if(FS.isDir(node.mode)){throw new FS.ErrnoError(31);}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(28);}var errCode=FS.nodePermissions(node,"w");if(errCode){throw new FS.ErrnoError(errCode);}node.node_ops.setattr(node,{size:len,timestamp:datenow()});},ftruncate:function ftruncate(fd,len){var stream=FS.getStreamChecked(fd);if((stream.flags&2097155)===0){throw new FS.ErrnoError(28);}FS.truncate(stream.node,len);},utime:function utime(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)});},open:function open(path,flags,mode){if(path===""){throw new FS.ErrnoError(44);}flags=typeof flags=="string"?FS_modeStringToFlags(flags):flags;mode=typeof mode=="undefined"?438:/* 0666 */mode;if(flags&64){mode=mode&4095|32768;}else{mode=0;}var node;if(_typeof(path)=="object"){node=path;}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node;}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(20);}}else{node=FS.mknod(path,mode,0);created=true;}}if(!node){throw new FS.ErrnoError(44);}if(FS.isChrdev(node.mode)){flags&=~512;}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(54);}if(!created){var errCode=FS.mayOpen(node,flags);if(errCode){throw new FS.ErrnoError(errCode);}}if(flags&512&&!created){FS.truncate(node,0);}flags&=~(128|512|131072);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false});if(stream.stream_ops.open){stream.stream_ops.open(stream);}if(Module2["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;}}return stream;},close:function close(stream){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream);}}catch(e){throw e;}finally{FS.closeStream(stream.fd);}stream.fd=null;},isClosed:function isClosed(stream){return stream.fd===null;},llseek:function llseek(stream,offset,whence){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(70);}if(whence!=0&&whence!=1&&whence!=2){throw new FS.ErrnoError(28);}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position;},read:function read(stream,buffer,offset,length,position){assert(offset>=0);if(length<0||position<0){throw new FS.ErrnoError(28);}if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if((stream.flags&2097155)===1){throw new FS.ErrnoError(8);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31);}if(!stream.stream_ops.read){throw new FS.ErrnoError(28);}var seeking=typeof position!="undefined";if(!seeking){position=stream.position;}else if(!stream.seekable){throw new FS.ErrnoError(70);}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead;},write:function write(stream,buffer,offset,length,position,canOwn){assert(offset>=0);if(length<0||position<0){throw new FS.ErrnoError(28);}if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31);}if(!stream.stream_ops.write){throw new FS.ErrnoError(28);}if(stream.seekable&&stream.flags&1024){FS.llseek(stream,0,2);}var seeking=typeof position!="undefined";if(!seeking){position=stream.position;}else if(!stream.seekable){throw new FS.ErrnoError(70);}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;return bytesWritten;},allocate:function allocate(stream,offset,length){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(offset<0||length<=0){throw new FS.ErrnoError(28);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8);}if(!FS.isFile(stream.node.mode)&&!FS.isDir(stream.node.mode)){throw new FS.ErrnoError(43);}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(138);}stream.stream_ops.allocate(stream,offset,length);},mmap:function mmap(stream,length,position,prot,flags){if((prot&2)!==0&&(flags&2)===0&&(stream.flags&2097155)!==2){throw new FS.ErrnoError(2);}if((stream.flags&2097155)===1){throw new FS.ErrnoError(2);}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(43);}return stream.stream_ops.mmap(stream,length,position,prot,flags);},msync:function msync(stream,buffer,offset,length,mmapFlags){assert(offset>=0);if(!stream.stream_ops.msync){return 0;}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags);},ioctl:function ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59);}return stream.stream_ops.ioctl(stream,cmd,arg);},readFile:function readFile(path){var opts=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error("Invalid encoding type \"".concat(opts.encoding,"\""));}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0);}else if(opts.encoding==="binary"){ret=buf;}FS.close(stream);return ret;},writeFile:function writeFile(path,data){var opts=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,void 0,opts.canOwn);}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,void 0,opts.canOwn);}else{throw new Error("Unsupported data type");}FS.close(stream);},cwd:function cwd(){return FS.currentPath;},chdir:function chdir(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44);}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54);}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode);}FS.currentPath=lookup.path;},createDefaultDirectories:function createDefaultDirectories(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user");},createDefaultDevices:function createDefaultDevices(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:function read(){return 0;},write:function write(stream,buffer,offset,length,pos){return length;}});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=function randomByte(){if(randomLeft===0){randomLeft=_randomFill2(randomBuffer).byteLength;}return randomBuffer[--randomLeft];};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp");},createSpecialDirectories:function createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:function mount(){var node=FS.createNode(proc_self,"fd",16384|511,/* 0777 */73);node.node_ops={lookup:function lookup(parent,name){var fd=+name;var stream=FS.getStreamChecked(fd);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function readlink(){return stream.path;}}};ret.parent=ret;return ret;}};return node;}},{},"/proc/self/fd");},createStandardStreams:function createStandardStreams(){if(Module2["stdin"]){FS.createDevice("/dev","stdin",Module2["stdin"]);}else{FS.symlink("/dev/tty","/dev/stdin");}if(Module2["stdout"]){FS.createDevice("/dev","stdout",null,Module2["stdout"]);}else{FS.symlink("/dev/tty","/dev/stdout");}if(Module2["stderr"]){FS.createDevice("/dev","stderr",null,Module2["stderr"]);}else{FS.symlink("/dev/tty1","/dev/stderr");}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1);assert(stdin.fd===0,"invalid handle for stdin (".concat(stdin.fd,")"));assert(stdout.fd===1,"invalid handle for stdout (".concat(stdout.fd,")"));assert(stderr.fd===2,"invalid handle for stderr (".concat(stderr.fd,")"));},staticInit:function staticInit(){;[44].forEach(function(code){FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>";});FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={MEMFS:MEMFS};},init:function init(input,output,error){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");FS.init.initialized=true;Module2["stdin"]=input||Module2["stdin"];Module2["stdout"]=output||Module2["stdout"];Module2["stderr"]=error||Module2["stderr"];FS.createStandardStreams();},quit:function quit(){FS.init.initialized=false;_fflush(0);for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue;}FS.close(stream);}},findObject:function findObject(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink);if(!ret.exists){return null;}return ret.object;},analyzePath:function analyzePath(path,dontResolveLastLink){try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path;}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/";}catch(e){ret.error=e.errno;}return ret;},createPath:function createPath(parent,path,canRead,canWrite){parent=typeof parent=="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current);}catch(e){}parent=current;}return current;},createFile:function createFile(parent,name,properties,canRead,canWrite){var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(canRead,canWrite);return FS.create(path,mode);},createDataFile:function createDataFile(parent,name,data,canRead,canWrite,canOwn){var path=name;if(parent){parent=typeof parent=="string"?parent:FS.getPath(parent);path=name?PATH.join2(parent,name):parent;}var mode=FS_getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data=="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr;}FS.chmod(node,mode|146);var stream=FS.open(node,577);FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode);}},createDevice:function createDevice(parent,name,input,output){var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:function open(stream){stream.seekable=false;},close:function close(stream){var _output$buffer2;if(output!==null&&output!==void 0&&(_output$buffer2=output.buffer)!==null&&_output$buffer2!==void 0&&_output$buffer2.length){output(10);}},read:function read(stream,buffer,offset,length,pos){var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input();}catch(e){throw new FS.ErrnoError(29);}if(result===void 0&&bytesRead===0){throw new FS.ErrnoError(6);}if(result===null||result===void 0)break;bytesRead++;buffer[offset+i]=result;}if(bytesRead){stream.node.timestamp=datenow();}return bytesRead;},write:function write(stream,buffer,offset,length,pos){for(var i=0;i<length;i++){try{output(buffer[offset+i]);}catch(e){throw new FS.ErrnoError(29);}}if(length){stream.node.timestamp=datenow();}return i;}});return FS.mkdev(path,mode,dev);},forceLoadFile:function forceLoadFile(obj){if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;if(typeof XMLHttpRequest!="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");}else if(read_){try{obj.contents=intArrayFromString(read_(obj.url),true);obj.usedBytes=obj.contents.length;}catch(e){throw new FS.ErrnoError(29);}}else{throw new Error("Cannot load without read() or XMLHttpRequest.");}},createLazyFile:function createLazyFile(parent,name,url,canRead,canWrite){var LazyUint8Array=/*#__PURE__*/function(){function LazyUint8Array(){_classCallCheck(this,LazyUint8Array);this.lengthKnown=false;this.chunks=[];}return _createClass(LazyUint8Array,[{key:"get",value:function get(idx){if(idx>this.length-1||idx<0){return void 0;}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset];}},{key:"setDataGetter",value:function setDataGetter(getter){this.getter=getter;}},{key:"cacheLength",value:function 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 doXHR(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr2=new XMLHttpRequest();xhr2.open("GET",url,false);if(datalength!==chunkSize)xhr2.setRequestHeader("Range","bytes="+from+"-"+to);xhr2.responseType="arraybuffer";if(xhr2.overrideMimeType){xhr2.overrideMimeType("text/plain; charset=x-user-defined");}xhr2.send(null);if(!(xhr2.status>=200&&xhr2.status<300||xhr2.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr2.status);if(xhr2.response!==void 0){return new Uint8Array(/** @type{Array<number>} */xhr2.response||[]);}return intArrayFromString(xhr2.responseText||"",true);};var lazyArray2=this;lazyArray2.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray2.chunks[chunkNum]=="undefined"){lazyArray2.chunks[chunkNum]=doXHR(start,end);}if(typeof lazyArray2.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray2.chunks[chunkNum];});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed");}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true;}},{key:"length",get:function get(){if(!this.lengthKnown){this.cacheLength();}return this._length;}},{key:"chunkSize",get:function get(){if(!this.lengthKnown){this.cacheLength();}return this._chunkSize;}}]);}();if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array();var properties={isDevice:false,contents:lazyArray};}else{var properties={isDevice:false,url:url};}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents;}else if(properties.url){node.contents=null;node.url=properties.url;}Object.defineProperties(node,{usedBytes:{get:function get(){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(){FS.forceLoadFile(node);return fn.apply(void 0,arguments);};});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i];}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i);}}return size;}stream_ops.read=function(stream,buffer,offset,length,position){FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position);};stream_ops.mmap=function(stream,length,position,prot,flags){FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48);}writeChunks(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true};};node.stream_ops=stream_ops;return node;},absolutePath:function absolutePath(){abort("FS.absolutePath has been removed; use PATH_FS.resolve instead");},createFolder:function createFolder(){abort("FS.createFolder has been removed; use FS.mkdir instead");},createLink:function createLink(){abort("FS.createLink has been removed; use FS.symlink instead");},joinPath:function joinPath(){abort("FS.joinPath has been removed; use PATH.join instead");},mmapAlloc:function mmapAlloc(){abort("FS.mmapAlloc has been replaced by the top level function mmapAlloc");},standardizePath:function standardizePath(){abort("FS.standardizePath has been removed; use PATH.normalize instead");}};var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path;}var dir;if(dirfd===-100){dir=FS.cwd();}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path;}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44);}return dir;}return PATH.join2(dir,path);},doStat:function doStat(func,path,buf){var stat=func(path);HEAP32[buf>>>2>>>0]=stat.dev;HEAP32[buf+4>>>2>>>0]=stat.mode;HEAPU32[buf+8>>>2>>>0]=stat.nlink;HEAP32[buf+12>>>2>>>0]=stat.uid;HEAP32[buf+16>>>2>>>0]=stat.gid;HEAP32[buf+20>>>2>>>0]=stat.rdev;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+24>>>2>>>0]=tempI64[0],HEAP32[buf+28>>>2>>>0]=tempI64[1];HEAP32[buf+32>>>2>>>0]=4096;HEAP32[buf+36>>>2>>>0]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();tempI64=[Math.floor(atime/1e3)>>>0,(tempDouble=Math.floor(atime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>>2>>>0]=tempI64[0],HEAP32[buf+44>>>2>>>0]=tempI64[1];HEAPU32[buf+48>>>2>>>0]=atime%1e3*1e3;tempI64=[Math.floor(mtime/1e3)>>>0,(tempDouble=Math.floor(mtime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+56>>>2>>>0]=tempI64[0],HEAP32[buf+60>>>2>>>0]=tempI64[1];HEAPU32[buf+64>>>2>>>0]=mtime%1e3*1e3;tempI64=[Math.floor(ctime/1e3)>>>0,(tempDouble=Math.floor(ctime/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+72>>>2>>>0]=tempI64[0],HEAP32[buf+76>>>2>>>0]=tempI64[1];HEAPU32[buf+80>>>2>>>0]=ctime%1e3*1e3;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+88>>>2>>>0]=tempI64[0],HEAP32[buf+92>>>2>>>0]=tempI64[1];return 0;},doMsync:function doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43);}if(flags&2){return 0;}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags);},getStreamFromFD:function getStreamFromFD(fd){var stream=FS.getStreamChecked(fd);return stream;},varargs:void 0,getStr:function getStr(ptr){var ret=UTF8ToString(ptr);return ret;}};function ___syscall_chmod(path,mode){try{path=SYSCALLS.getStr(path);FS.chmod(path,mode);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_dup3(fd,newfd,flags){try{var old=SYSCALLS.getStreamFromFD(fd);assert(!flags);if(old.fd===newfd)return-28;var existing=FS.getStream(newfd);if(existing)FS.close(existing);return FS.dupStream(old,newfd).fd;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_faccessat(dirfd,path,amode,flags){try{path=SYSCALLS.getStr(path);assert(flags===0);path=SYSCALLS.calculateAt(dirfd,path);if(amode&~7){return-28;}var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node){return-44;}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms/* otherwise, they've just passed F_OK */&&FS.nodePermissions(node,perms)){return-2;}return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fchmod(fd,mode){try{FS.fchmod(fd,mode);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fchown32(fd,owner,group){try{FS.fchown(fd,owner,group);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function syscallGetVarargI(){assert(SYSCALLS.varargs!=void 0);var ret=HEAP32[+SYSCALLS.varargs>>>2>>>0];SYSCALLS.varargs+=4;return ret;}var syscallGetVarargP=syscallGetVarargI;function ___syscall_fcntl64(fd,cmd,varargs){varargs>>>=0;SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=syscallGetVarargI();if(arg<0){return-28;}while(FS.streams[arg]){arg++;}var newStream;newStream=FS.dupStream(stream,arg);return newStream.fd;}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=syscallGetVarargI();stream.flags|=arg;return 0;}case 12:{var arg=syscallGetVarargP();var offset=0;HEAP16[arg+offset>>>1>>>0]=2;return 0;}case 13:case 14:return 0;}return-28;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fstat64(fd,buf){try{var stream=SYSCALLS.getStreamFromFD(fd);return SYSCALLS.doStat(FS.stat,stream.path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var convertI32PairToI53Checked=function convertI32PairToI53Checked(lo,hi){assert(lo==lo>>>0||lo==(lo|0));assert(hi===(hi|0));return hi+2097152>>>0<4194305-!!lo?(lo>>>0)+hi*4294967296:NaN;};function ___syscall_ftruncate64(fd,length_low,length_high){var length=convertI32PairToI53Checked(length_low,length_high);try{if(isNaN(length))return 61;FS.ftruncate(fd,length);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var stringToUTF8=function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);};function ___syscall_getcwd(buf,size){try{if(size===0)return-28;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd)+1;if(size<cwdLengthInBytes)return-68;stringToUTF8(cwd,buf,size);return cwdLengthInBytes;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_ioctl(fd,op,varargs){varargs>>>=0;SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:{if(!stream.tty)return-59;return 0;}case 21505:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcgets){var termios=stream.tty.ops.ioctl_tcgets(stream);var argp=syscallGetVarargP();HEAP32[argp>>>2>>>0]=termios.c_iflag||0;HEAP32[argp+4>>>2>>>0]=termios.c_oflag||0;HEAP32[argp+8>>>2>>>0]=termios.c_cflag||0;HEAP32[argp+12>>>2>>>0]=termios.c_lflag||0;for(var i=0;i<32;i++){HEAP8[argp+i+17>>>0]=termios.c_cc[i]||0;}return 0;}return 0;}case 21510:case 21511:case 21512:{if(!stream.tty)return-59;return 0;}case 21506:case 21507:case 21508:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcsets){var argp=syscallGetVarargP();var c_iflag=HEAP32[argp>>>2>>>0];var c_oflag=HEAP32[argp+4>>>2>>>0];var c_cflag=HEAP32[argp+8>>>2>>>0];var c_lflag=HEAP32[argp+12>>>2>>>0];var c_cc=[];for(var i=0;i<32;i++){c_cc.push(HEAP8[argp+i+17>>>0]);}return stream.tty.ops.ioctl_tcsets(stream.tty,op,{c_iflag:c_iflag,c_oflag:c_oflag,c_cflag:c_cflag,c_lflag:c_lflag,c_cc:c_cc});}return 0;}case 21519:{if(!stream.tty)return-59;var argp=syscallGetVarargP();HEAP32[argp>>>2>>>0]=0;return 0;}case 21520:{if(!stream.tty)return-59;return-28;}case 21531:{var argp=syscallGetVarargP();return FS.ioctl(stream,op,argp);}case 21523:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tiocgwinsz){var winsize=stream.tty.ops.ioctl_tiocgwinsz(stream.tty);var argp=syscallGetVarargP();HEAP16[argp>>>1>>>0]=winsize[0];HEAP16[argp+2>>>1>>>0]=winsize[1];}return 0;}case 21524:{if(!stream.tty)return-59;return 0;}case 21515:{if(!stream.tty)return-59;return 0;}default:return-28;}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_lstat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.lstat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_mkdirat(dirfd,path,mode){try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_newfstatat(dirfd,path,buf,flags){try{path=SYSCALLS.getStr(path);var nofollow=flags&256;var allowEmpty=flags&4096;flags=flags&~6400;assert(!flags,"unknown flags in __syscall_newfstatat: ".concat(flags));path=SYSCALLS.calculateAt(dirfd,path,allowEmpty);return SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_openat(dirfd,path,flags,varargs){path>>>=0;varargs>>>=0;SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?syscallGetVarargI():0;return FS.open(path,flags,mode).fd;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var stringToUTF8=function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);};function ___syscall_readlinkat(dirfd,path,buf,bufsize){path>>>=0;buf>>>=0;bufsize>>>=0;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len>>>0];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len>>>0]=endChar;return len;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_renameat(olddirfd,oldpath,newdirfd,newpath){oldpath>>>=0;newpath>>>=0;try{oldpath=SYSCALLS.getStr(oldpath);newpath=SYSCALLS.getStr(newpath);oldpath=SYSCALLS.calculateAt(olddirfd,oldpath);newpath=SYSCALLS.calculateAt(newdirfd,newpath);FS.rename(oldpath,newpath);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_rmdir(path){path>>>=0;try{path=SYSCALLS.getStr(path);FS.rmdir(path);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_unlinkat(dirfd,path,flags){path>>>=0;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(flags===0){FS.unlink(path);}else if(flags===512){FS.rmdir(path);}else{abort("Invalid flags passed to unlinkat");}return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var readI53FromI64=function readI53FromI64(ptr){return HEAPU32[ptr>>2]+HEAP32[ptr+4>>2]*4294967296;};function ___syscall_utimensat(dirfd,path,times,flags){try{path=SYSCALLS.getStr(path);assert(flags===0);path=SYSCALLS.calculateAt(dirfd,path,true);if(!times){var atime=datenow();var mtime=atime;}else{var seconds=readI53FromI64(times);var nanoseconds=HEAP32[times+8>>2];atime=seconds*1e3+nanoseconds/(1e3*1e3);times+=16;seconds=readI53FromI64(times);nanoseconds=HEAP32[times+8>>2];mtime=seconds*1e3+nanoseconds/(1e3*1e3);}FS.utime(path,atime,mtime);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var __abort_js=function __abort_js(){abort("native code called abort()");};var nowIsMonotonic=1;var __emscripten_get_now_is_monotonic=function __emscripten_get_now_is_monotonic(){return nowIsMonotonic;};function __emscripten_memcpy_js(dest,src,num){dest>>>=0;src>>>=0;num>>>=0;return HEAPU8.copyWithin(dest>>>0,src>>>0,src+num>>>0);}function __emscripten_system(command){command>>>=0;if(ENVIRONMENT_IS_NODE){if(!command)return 1;var cmdstr=UTF8ToString(command);if(!cmdstr.length)return 0;var cp=_require("./child_process");var ret=cp.spawnSync(cmdstr,[],{shell:true,stdio:"inherit"});var _W_EXITCODE=function _W_EXITCODE(ret2,sig){return ret2<<8|sig;};if(ret.status===null){var signalToNumber=function signalToNumber(sig){switch(sig){case"SIGHUP":return 1;case"SIGINT":return 2;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15;}return 2;};return _W_EXITCODE(0,signalToNumber(ret.signal));}return _W_EXITCODE(ret.status,0);}if(!command)return 0;return-52;}var __emscripten_throw_longjmp=function __emscripten_throw_longjmp(){throw Infinity;};function __gmtime_js(time_low,time_high,tmPtr){var time=convertI32PairToI53Checked(time_low,time_high);tmPtr>>>=0;var date=new Date(time*1e3);HEAP32[tmPtr>>>2>>>0]=date.getUTCSeconds();HEAP32[tmPtr+4>>>2>>>0]=date.getUTCMinutes();HEAP32[tmPtr+8>>>2>>>0]=date.getUTCHours();HEAP32[tmPtr+12>>>2>>>0]=date.getUTCDate();HEAP32[tmPtr+16>>>2>>>0]=date.getUTCMonth();HEAP32[tmPtr+20>>>2>>>0]=date.getUTCFullYear()-1900;HEAP32[tmPtr+24>>>2>>>0]=date.getUTCDay();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>>>0]=yday;}var isLeapYear=function isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0);};var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];var ydayFromDate=function ydayFromDate(date){var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday;};function __localtime_js(time_low,time_high,tmPtr){var time=convertI32PairToI53Checked(time_low,time_high);tmPtr>>>=0;var date=new Date(time*1e3);HEAP32[tmPtr>>>2>>>0]=date.getSeconds();HEAP32[tmPtr+4>>>2>>>0]=date.getMinutes();HEAP32[tmPtr+8>>>2>>>0]=date.getHours();HEAP32[tmPtr+12>>>2>>>0]=date.getDate();HEAP32[tmPtr+16>>>2>>>0]=date.getMonth();HEAP32[tmPtr+20>>>2>>>0]=date.getFullYear()-1900;HEAP32[tmPtr+24>>>2>>>0]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>>2>>>0]=yday;HEAP32[tmPtr+36>>>2>>>0]=-(date.getTimezoneOffset()*60);var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>>2>>>0]=dst;}var setTempRet0=function setTempRet0(val){return __emscripten_tempret_set(val);};var __mktime_js=function __mktime_js(tmPtr){tmPtr>>>=0;var ret=function(){var date=new Date(HEAP32[tmPtr+20>>>2>>>0]+1900,HEAP32[tmPtr+16>>>2>>>0],HEAP32[tmPtr+12>>>2>>>0],HEAP32[tmPtr+8>>>2>>>0],HEAP32[tmPtr+4>>>2>>>0],HEAP32[tmPtr>>>2>>>0],0);var dst=HEAP32[tmPtr+32>>>2>>>0];var guessedOffset=date.getTimezoneOffset();var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dstOffset=Math.min(winterOffset,summerOffset);if(dst<0){HEAP32[tmPtr+32>>>2>>>0]=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>>>0]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>>2>>>0]=yday;HEAP32[tmPtr>>>2>>>0]=date.getSeconds();HEAP32[tmPtr+4>>>2>>>0]=date.getMinutes();HEAP32[tmPtr+8>>>2>>>0]=date.getHours();HEAP32[tmPtr+12>>>2>>>0]=date.getDate();HEAP32[tmPtr+16>>>2>>>0]=date.getMonth();HEAP32[tmPtr+20>>>2>>>0]=date.getYear();var timeMs=date.getTime();if(isNaN(timeMs)){return-1;}return timeMs/1e3;}();return setTempRet0((tempDouble=ret,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)),ret>>>0;};function __munmap_js(addr,len,prot,flags,fd,offset_low,offset_high){var offset=convertI32PairToI53Checked(offset_low,offset_high);try{var stream=SYSCALLS.getStreamFromFD(fd);if(prot&2){SYSCALLS.doMsync(addr,stream,len,flags,offset);}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var __tzset_js=function __tzset_js(timezone,daylight,std_name,dst_name){timezone>>>=0;daylight>>>=0;std_name>>>=0;dst_name>>>=0;var currentYear=/* @__PURE__ */new Date().getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU32[timezone>>>2>>>0]=stdTimezoneOffset*60;HEAP32[daylight>>>2>>>0]=Number(winterOffset!=summerOffset);var extractZone=function extractZone(date){return date.toLocaleTimeString(void 0,{hour12:false,timeZoneName:"short"}).split(" ")[1];};var winterName=extractZone(winter);var summerName=extractZone(summer);assert(winterName);assert(summerName);assert(lengthBytesUTF8(winterName)<=16,"timezone name truncated to fit in TZNAME_MAX (".concat(winterName,")"));assert(lengthBytesUTF8(summerName)<=16,"timezone name truncated to fit in TZNAME_MAX (".concat(summerName,")"));if(summerOffset<winterOffset){stringToUTF8(winterName,std_name,17);stringToUTF8(summerName,dst_name,17);}else{stringToUTF8(winterName,dst_name,17);stringToUTF8(summerName,std_name,17);}};var _emscripten_date_now=function _emscripten_date_now(){return datenow();};var getHeapMax=function getHeapMax(){return 4294901760;};function _emscripten_get_heap_max(){return getHeapMax();}var _emscripten_get_now;_emscripten_get_now=function _emscripten_get_now(){return deterministicNow();};var growMemory=function growMemory(size){var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536;try{wasmMemory.grow(pages);updateMemoryViews();return 1;}catch(e){err("growMemory: Attempted to grow heap from ".concat(b.byteLength," bytes to ").concat(size," bytes, but got error: ").concat(e));}};function _emscripten_resize_heap(requestedSize){requestedSize>>>=0;var oldSize=HEAPU8.length;assert(requestedSize>oldSize);var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){err("Cannot enlarge memory, requested ".concat(requestedSize," bytes, but the limit is ").concat(maxHeapSize," bytes!"));return false;}var alignUp=function alignUp(x,multiple){return x+(multiple-x%multiple)%multiple;};for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+0.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true;}}err("Failed to grow the heap from ".concat(oldSize," bytes to ").concat(newSize," bytes, not enough memory!"));return false;}var ENV={};var getExecutableName=function getExecutableName(){return thisProgram||"./this.program";};var _getEnvStrings2=function getEnvStrings(){if(!_getEnvStrings2.strings){var lang="C.UTF-8";var env={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:lang,_:getExecutableName()};for(var x in ENV){if(ENV[x]===void 0)delete env[x];else env[x]=ENV[x];}var strings=[];for(var x in env){strings.push("".concat(x,"=").concat(env[x]));}_getEnvStrings2.strings=strings;}return _getEnvStrings2.strings;};var stringToAscii=function stringToAscii(str,buffer){for(var i=0;i<str.length;++i){assert(str.charCodeAt(i)===(str.charCodeAt(i)&255));HEAP8[buffer++>>>0]=str.charCodeAt(i);}HEAP8[buffer>>>0]=0;};var _environ_get=function _environ_get(__environ,environ_buf){__environ>>>=0;environ_buf>>>=0;var bufSize=0;_getEnvStrings2().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>>2>>>0]=ptr;stringToAscii(string,ptr);bufSize+=string.length+1;});return 0;};var _environ_sizes_get=function _environ_sizes_get(penviron_count,penviron_buf_size){penviron_count>>>=0;penviron_buf_size>>>=0;var strings=_getEnvStrings2();HEAPU32[penviron_count>>>2>>>0]=strings.length;var bufSize=0;strings.forEach(function(string){return bufSize+=string.length+1;});HEAPU32[penviron_buf_size>>>2>>>0]=bufSize;return 0;};var runtimeKeepaliveCounter=0;var keepRuntimeAlive=function keepRuntimeAlive(){return noExitRuntime||runtimeKeepaliveCounter>0;};var _proc_exit=function _proc_exit(code){EXITSTATUS=code;if(!keepRuntimeAlive()){var _Module2$onExit2;(_Module2$onExit2=Module2["onExit"])===null||_Module2$onExit2===void 0||_Module2$onExit2.call(Module2,code);ABORT=true;}quit_(code,new ExitStatus(code));};var exitJS=function exitJS(status,implicit){EXITSTATUS=status;checkUnflushedContent();if(keepRuntimeAlive()&&!implicit){var msg="program exited (with status: ".concat(status,"), but keepRuntimeAlive() is set (counter=").concat(runtimeKeepaliveCounter,") due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)");readyPromiseReject(msg);err(msg);}_proc_exit(status);};var _exit=exitJS;function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}function _fd_fdstat_get(fd,pbuf){try{var rightsBase=0;var rightsInheriting=0;var flags=0;{var stream=SYSCALLS.getStreamFromFD(fd);var type=stream.tty?2:FS.isDir(stream.mode)?3:FS.isLink(stream.mode)?7:4;}HEAP8[pbuf]=type;HEAP16[pbuf+2>>1]=flags;tempI64=[rightsBase>>>0,(tempDouble=rightsBase,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[pbuf+8>>2]=tempI64[0],HEAP32[pbuf+12>>2]=tempI64[1];tempI64=[rightsInheriting>>>0,(tempDouble=rightsInheriting,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[pbuf+16>>2]=tempI64[0],HEAP32[pbuf+20>>2]=tempI64[1];return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var doReadv=function doReadv(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>>2>>>0];var len=HEAPU32[iov+4>>>2>>>0];iov+=8;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break;if(typeof offset!="undefined"){offset+=curr;}}return ret;};function _fd_read(fd,iov,iovcnt,pnum){iov>>>=0;iovcnt>>>=0;pnum>>>=0;try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doReadv(stream,iov,iovcnt);HEAPU32[pnum>>>2>>>0]=num;return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){var offset=convertI32PairToI53Checked(offset_low,offset_high);newOffset>>>=0;try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?+Math.floor(tempDouble/4294967296)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>>2>>>0]=tempI64[0],HEAP32[newOffset+4>>>2>>>0]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var _fd_sync=function _fd_sync(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);return Asyncify.handleSleep(function(wakeUp){var mount=stream.node.mount;if(!mount.type.syncfs){wakeUp(0);return;}mount.type.syncfs(mount,false,function(err2){if(err2){wakeUp(29);return;}wakeUp(0);});});}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}};_fd_sync.isAsync=true;var doWritev=function doWritev(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>>2>>>0];var len=HEAPU32[iov+4>>>2>>>0];iov+=8;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(typeof offset!="undefined"){offset+=curr;}}return ret;};function _fd_write(fd,iov,iovcnt,pnum){iov>>>=0;iovcnt>>>=0;pnum>>>=0;try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doWritev(stream,iov,iovcnt);HEAPU32[pnum>>>2>>>0]=num;return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var arraySum=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];var addDays=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;};var writeArrayToMemory=function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer>>>0);};function _strftime(s,maxsize,format,tm){s>>>=0;maxsize>>>=0;format>>>=0;tm>>>=0;var tm_zone=HEAPU32[tm+40>>>2>>>0];var date={tm_sec:HEAP32[tm>>>2>>>0],tm_min:HEAP32[tm+4>>>2>>>0],tm_hour:HEAP32[tm+8>>>2>>>0],tm_mday:HEAP32[tm+12>>>2>>>0],tm_mon:HEAP32[tm+16>>>2>>>0],tm_year:HEAP32[tm+20>>>2>>>0],tm_wday:HEAP32[tm+24>>>2>>>0],tm_yday:HEAP32[tm+28>>>2>>>0],tm_isdst:HEAP32[tm+32>>>2>>>0],tm_gmtoff:HEAP32[tm+36>>>2>>>0],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(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","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var 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.length<digits){str=character[0]+str;}return str;}function leadingNulls(value,digits){return leadingSomething(value,digits,"0");}function compareByDay(date1,date2){function sgn(value){return value<0?-1:value>0?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(date2){var thisDate=addDays(new Date(date2.tm_year+1900,0,1),date2.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;}return thisDate.getFullYear();}return thisDate.getFullYear()-1;}var EXPANSION_RULES_2={"%a":function a(date2){return WEEKDAYS[date2.tm_wday].substring(0,3);},"%A":function A(date2){return WEEKDAYS[date2.tm_wday];},"%b":function b(date2){return MONTHS[date2.tm_mon].substring(0,3);},"%B":function B(date2){return MONTHS[date2.tm_mon];},"%C":function C(date2){var year=date2.tm_year+1900;return leadingNulls(year/100|0,2);},"%d":function d(date2){return leadingNulls(date2.tm_mday,2);},"%e":function e(date2){return leadingSomething(date2.tm_mday,2," ");},"%g":function g(date2){return getWeekBasedYear(date2).toString().substring(2);},"%G":getWeekBasedYear,"%H":function H(date2){return leadingNulls(date2.tm_hour,2);},"%I":function I(date2){var twelveHour=date2.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2);},"%j":function j(date2){return leadingNulls(date2.tm_mday+arraySum(isLeapYear(date2.tm_year+1900)?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,date2.tm_mon-1),3);},"%m":function m(date2){return leadingNulls(date2.tm_mon+1,2);},"%M":function M(date2){return leadingNulls(date2.tm_min,2);},"%n":function n(){return"\n";},"%p":function p(date2){if(date2.tm_hour>=0&&date2.tm_hour<12){return"AM";}return"PM";},"%S":function S(date2){return leadingNulls(date2.tm_sec,2);},"%t":function t(){return" ";},"%u":function u(date2){return date2.tm_wday||7;},"%U":function U(date2){var days=date2.tm_yday+7-date2.tm_wday;return leadingNulls(Math.floor(days/7),2);},"%V":function V(date2){var val=Math.floor((date2.tm_yday+7-(date2.tm_wday+6)%7)/7);if((date2.tm_wday+371-date2.tm_yday-2)%7<=2){val++;}if(!val){val=52;var dec31=(date2.tm_wday+7-date2.tm_yday-1)%7;if(dec31==4||dec31==5&&isLeapYear(date2.tm_year%400-1)){val++;}}else if(val==53){var jan1=(date2.tm_wday+371-date2.tm_yday)%7;if(jan1!=4&&(jan1!=3||!isLeapYear(date2.tm_year)))val=1;}return leadingNulls(val,2);},"%w":function w(date2){return date2.tm_wday;},"%W":function W(date2){var days=date2.tm_yday+7-(date2.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2);},"%y":function y(date2){return(date2.tm_year+1900).toString().substring(2);},"%Y":function Y(date2){return date2.tm_year+1900;},"%z":function z(date2){var off=date2.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4);},"%Z":function Z(date2){return date2.tm_zone;},"%%":function _(){return"%";}};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date));}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0;}writeArrayToMemory(bytes,s);return bytes.length-1;}function _strftime_l(s,maxsize,format,tm,loc){s>>>=0;maxsize>>>=0;format>>>=0;tm>>>=0;loc>>>=0;return _strftime(s,maxsize,format,tm);}var wasmTableMirror=[];var wasmTable;var runAndAbortIfError=function runAndAbortIfError(func){try{return func();}catch(e){abort(e);}};var handleException=function handleException(e){if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS;}checkStackCookie();if(e instanceof WebAssembly.RuntimeError){if(_emscripten_stack_get_current3()<=0){err("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 41943040)");}}quit_(1,e);};var maybeExit=function maybeExit(){if(!keepRuntimeAlive()){try{_exit(EXITSTATUS);}catch(e){handleException(e);}}};var callUserCallback=function callUserCallback(func){if(ABORT){err("user callback triggered after runtime exited or application aborted. Ignoring.");return;}try{func();maybeExit();}catch(e){handleException(e);}};var runtimeKeepalivePush=function runtimeKeepalivePush(){runtimeKeepaliveCounter+=1;};var runtimeKeepalivePop=function runtimeKeepalivePop(){assert(runtimeKeepaliveCounter>0);runtimeKeepaliveCounter-=1;};var Asyncify={instrumentWasmImports:function instrumentWasmImports(imports){var importPattern=/^(invoke_.*|__asyncjs__.*)$/;var _loop=function _loop(){var _Object$entries$_i=_slicedToArray(_Object$entries[_i3],2),x=_Object$entries$_i[0],original=_Object$entries$_i[1];if(typeof original=="function"){var isAsyncifyImport=original.isAsync||importPattern.test(x);imports[x]=function(){var originalAsyncifyState=Asyncify.state;try{return original.apply(void 0,arguments);}finally{var changedToDisabled=originalAsyncifyState===Asyncify.State.Normal&&Asyncify.state===Asyncify.State.Disabled;var ignoredInvoke=x.startsWith("invoke_")&&true;if(Asyncify.state!==originalAsyncifyState&&!isAsyncifyImport&&!changedToDisabled&&!ignoredInvoke){throw new Error("import ".concat(x," was not in ASYNCIFY_IMPORTS, but changed the state"));}}};}};for(var _i3=0,_Object$entries=Object.entries(imports);_i3<_Object$entries.length;_i3++){_loop();}},instrumentWasmExports:function instrumentWasmExports(exports3){var ret={};var _loop2=function _loop2(){var _Object$entries2$_i=_slicedToArray(_Object$entries2[_i4],2),x=_Object$entries2$_i[0],original=_Object$entries2$_i[1];if(typeof original=="function"){ret[x]=function(){Asyncify.exportCallStack.push(x);try{return original.apply(void 0,arguments);}finally{if(!ABORT){var y=Asyncify.exportCallStack.pop();assert(y===x);Asyncify.maybeStopUnwind();}}};}else{ret[x]=original;}};for(var _i4=0,_Object$entries2=Object.entries(exports3);_i4<_Object$entries2.length;_i4++){_loop2();}return ret;},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:41943040,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId:function getCallStackId(funcName){var id=Asyncify.callStackNameToId[funcName];if(id===void 0){id=Asyncify.callStackId++;Asyncify.callStackNameToId[funcName]=id;Asyncify.callStackIdToName[id]=funcName;}return id;},maybeStopUnwind:function maybeStopUnwind(){if(Asyncify.currData&&Asyncify.state===Asyncify.State.Unwinding&&Asyncify.exportCallStack.length===0){Asyncify.state=Asyncify.State.Normal;runAndAbortIfError(_asyncify_stop_unwind);if(typeof Fibers!="undefined"){Fibers.trampoline();}}},whenDone:function whenDone(){assert(Asyncify.currData,"Tried to wait for an async operation when none is in progress.");assert(!Asyncify.asyncPromiseHandlers,"Cannot have multiple async operations in flight at once");return new Promise(function(resolve,reject){Asyncify.asyncPromiseHandlers={resolve:resolve,reject:reject};});},allocateData:function allocateData(){var ptr=_malloc(12+Asyncify.StackSize);Asyncify.setDataHeader(ptr,ptr+12,Asyncify.StackSize);Asyncify.setDataRewindFunc(ptr);return ptr;},setDataHeader:function setDataHeader(ptr,stack,stackSize){HEAPU32[ptr>>>2>>>0]=stack;HEAPU32[ptr+4>>>2>>>0]=stack+stackSize;},setDataRewindFunc:function setDataRewindFunc(ptr){var bottomOfCallStack=Asyncify.exportCallStack[0];var rewindId=Asyncify.getCallStackId(bottomOfCallStack);HEAP32[ptr+8>>>2>>>0]=rewindId;},getDataRewindFunc:function getDataRewindFunc(ptr){var id=HEAP32[ptr+8>>>2>>>0];var name=Asyncify.callStackIdToName[id];var func=wasmExports[name];return func;},doRewind:function doRewind(ptr){var start=Asyncify.getDataRewindFunc(ptr);return start();},handleSleep:function handleSleep(startAsync){assert(Asyncify.state!==Asyncify.State.Disabled,"Asyncify cannot be done during or after the runtime exits");if(ABORT)return;if(Asyncify.state===Asyncify.State.Normal){var reachedCallback=false;var reachedAfterCallback=false;startAsync(function(){var handleSleepReturnValue=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;assert(!handleSleepReturnValue||typeof handleSleepReturnValue=="number"||typeof handleSleepReturnValue=="boolean");if(ABORT)return;Asyncify.handleSleepReturnValue=handleSleepReturnValue;reachedCallback=true;if(!reachedAfterCallback){return;}assert(!Asyncify.exportCallStack.length,"Waking up (starting to rewind) must be done from JS, without compiled code on the stack.");Asyncify.state=Asyncify.State.Rewinding;runAndAbortIfError(function(){return _asyncify_start_rewind(Asyncify.currData);});if(typeof Browser!="undefined"&&Browser.mainLoop.func){Browser.mainLoop.resume();}var asyncWasmReturnValue,isError=false;try{asyncWasmReturnValue=Asyncify.doRewind(Asyncify.currData);}catch(err2){asyncWasmReturnValue=err2;isError=true;}var handled=false;if(!Asyncify.currData){var asyncPromiseHandlers=Asyncify.asyncPromiseHandlers;if(asyncPromiseHandlers){Asyncify.asyncPromiseHandlers=null;(isError?asyncPromiseHandlers.reject:asyncPromiseHandlers.resolve)(asyncWasmReturnValue);handled=true;}}if(isError&&!handled){throw asyncWasmReturnValue;}});reachedAfterCallback=true;if(!reachedCallback){Asyncify.state=Asyncify.State.Unwinding;Asyncify.currData=Asyncify.allocateData();if(typeof Browser!="undefined"&&Browser.mainLoop.func){Browser.mainLoop.pause();}runAndAbortIfError(function(){return _asyncify_start_unwind(Asyncify.currData);});}}else if(Asyncify.state===Asyncify.State.Rewinding){Asyncify.state=Asyncify.State.Normal;runAndAbortIfError(_asyncify_stop_rewind);_free(Asyncify.currData);Asyncify.currData=null;Asyncify.sleepCallbacks.forEach(callUserCallback);}else{abort("invalid state: ".concat(Asyncify.state));}return Asyncify.handleSleepReturnValue;},handleAsync:function handleAsync(startAsync){return Asyncify.handleSleep(function(wakeUp){startAsync().then(wakeUp);});}};var getCFunc=function getCFunc(ident){var func=Module2["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func;};var stackAlloc=function stackAlloc(sz){return _emscripten_stack_alloc(sz);};var stringToUTF8OnStack=function stringToUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret;};var ccall=function ccall(ident,returnType,argTypes,args,opts){var toC={string:function string(str){var ret2=0;if(str!==null&&str!==void 0&&str!==0){ret2=stringToUTF8OnStack(str);}return ret2;},array:function array(arr){var ret2=stackAlloc(arr.length);writeArrayToMemory(arr,ret2);return ret2;}};function convertReturnValue(ret2){if(returnType==="string"){return UTF8ToString(ret2);}if(returnType==="boolean")return Boolean(ret2);return ret2;}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i]);}else{cArgs[i]=args[i];}}}var previousAsync=Asyncify.currData;var ret=func.apply(void 0,cArgs);function onDone(ret2){runtimeKeepalivePop();if(stack!==0)stackRestore(stack);return convertReturnValue(ret2);}var asyncMode=opts===null||opts===void 0?void 0:opts.async;runtimeKeepalivePush();if(Asyncify.currData!=previousAsync){assert(!(previousAsync&&Asyncify.currData),"We cannot start an async operation when one is already flight");assert(!(previousAsync&&!Asyncify.currData),"We cannot stop an async operation in flight");assert(asyncMode,"The call to "+ident+" is running asynchronously. If this was intended, add the async option to the ccall/cwrap call.");return Asyncify.whenDone().then(onDone);}ret=onDone(ret);if(asyncMode)return Promise.resolve(ret);return ret;};var cwrap=function cwrap(ident,returnType,argTypes,opts){return function(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4];}return ccall(ident,returnType,argTypes,args,opts);};};FS.createPreloadedFile=FS_createPreloadedFile;FS.staticInit();Module2["FS_createPath"]=FS.createPath;Module2["FS_createDataFile"]=FS.createDataFile;Module2["FS_createPreloadedFile"]=FS.createPreloadedFile;Module2["FS_unlink"]=FS.unlink;Module2["FS_createLazyFile"]=FS.createLazyFile;Module2["FS_createDevice"]=FS.createDevice;function checkIncomingModuleAPI(){ignoredModuleProp("fetchSettings");}var wasmImports={/** @export */__assert_fail:___assert_fail,/** @export */metering_gasUsed:metering_gasUsed,/** @export */__asyncjs__weavedrive_close:__asyncjs__weavedrive_close,/** @export */__asyncjs__weavedrive_open:__asyncjs__weavedrive_open,/** @export */__asyncjs__weavedrive_read:__asyncjs__weavedrive_read,/** @export */__cxa_throw:___cxa_throw,/** @export */__syscall_chmod:___syscall_chmod,/** @export */__syscall_dup3:___syscall_dup3,/** @export */__syscall_faccessat:___syscall_faccessat,/** @export */__syscall_fchmod:___syscall_fchmod,/** @export */__syscall_fchown32:___syscall_fchown32,/** @export */__syscall_fcntl64:___syscall_fcntl64,/** @export */__syscall_fstat64:___syscall_fstat64,/** @export */__syscall_ftruncate64:___syscall_ftruncate64,/** @export */__syscall_getcwd:___syscall_getcwd,/** @export */__syscall_ioctl:___syscall_ioctl,/** @export */__syscall_lstat64:___syscall_lstat64,/** @export */__syscall_mkdirat:___syscall_mkdirat,/** @export */__syscall_newfstatat:___syscall_newfstatat,/** @export */__syscall_openat:___syscall_openat,/** @export */__syscall_readlinkat:___syscall_readlinkat,/** @export */__syscall_renameat:___syscall_renameat,/** @export */__syscall_rmdir:___syscall_rmdir,/** @export */__syscall_stat64:___syscall_stat64,/** @export */__syscall_unlinkat:___syscall_unlinkat,/** @export */__syscall_utimensat:___syscall_utimensat,/** @export */_abort_js:__abort_js,/** @export */_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,/** @export */_emscripten_memcpy_js:__emscripten_memcpy_js,/** @export */_emscripten_system:__emscripten_system,/** @export */_emscripten_throw_longjmp:__emscripten_throw_longjmp,/** @export */_gmtime_js:__gmtime_js,/** @export */_localtime_js:__localtime_js,/** @export */_mktime_js:__mktime_js,/** @export */_munmap_js:__munmap_js,/** @export */_tzset_js:__tzset_js,/** @export */emscripten_date_now:_emscripten_date_now,/** @export */emscripten_get_heap_max:_emscripten_get_heap_max,/** @export */emscripten_get_now:_emscripten_get_now,/** @export */emscripten_resize_heap:_emscripten_resize_heap,/** @export */environ_get:_environ_get,/** @export */environ_sizes_get:_environ_sizes_get,/** @export */exit:_exit,/** @export */fd_close:_fd_close,/** @export */fd_fdstat_get:_fd_fdstat_get,/** @export */fd_read:_fd_read,/** @export */fd_seek:_fd_seek,/** @export */fd_sync:_fd_sync,/** @export */fd_write:_fd_write,/** @export */invoke_vii:invoke_vii,/** @export */strftime:_strftime,/** @export */strftime_l:_strftime_l};var wasmExports=createWasm();var ___wasm_call_ctors=createExportWrapper("__wasm_call_ctors",0);var _malloc=Module2["_malloc"]=createExportWrapper("malloc",1);var _handle=Module2["_handle"]=createExportWrapper("handle",2);var _main=createExportWrapper("main",2);var _free=createExportWrapper("free",1);var _fflush=createExportWrapper("fflush",1);var _emscripten_builtin_memalign=createExportWrapper("emscripten_builtin_memalign",2);var _sbrk=createExportWrapper("sbrk",1);var _setThrew=createExportWrapper("setThrew",2);var __emscripten_tempret_set=createExportWrapper("_emscripten_tempret_set",1);var _emscripten_stack_init3=function _emscripten_stack_init(){return(_emscripten_stack_init3=wasmExports["emscripten_stack_init"])();};var _emscripten_stack_get_free3=function _emscripten_stack_get_free(){return(_emscripten_stack_get_free3=wasmExports["emscripten_stack_get_free"])();};var _emscripten_stack_get_base3=function _emscripten_stack_get_base(){return(_emscripten_stack_get_base3=wasmExports["emscripten_stack_get_base"])();};var _emscripten_stack_get_end3=function _emscripten_stack_get_end(){return(_emscripten_stack_get_end3=wasmExports["emscripten_stack_get_end"])();};var _emscripten_stack_restore=function __emscripten_stack_restore(a0){return(_emscripten_stack_restore=wasmExports["_emscripten_stack_restore"])(a0);};var _emscripten_stack_alloc=function __emscripten_stack_alloc(a0){return(_emscripten_stack_alloc=wasmExports["_emscripten_stack_alloc"])(a0);};var _emscripten_stack_get_current3=function _emscripten_stack_get_current(){return(_emscripten_stack_get_current3=wasmExports["emscripten_stack_get_current"])();};var ___cxa_is_pointer_type=createExportWrapper("__cxa_is_pointer_type",1);var dynCall_iii=Module2["dynCall_iii"]=createExportWrapper("dynCall_iii",3);var dynCall_vii=Module2["dynCall_vii"]=createExportWrapper("dynCall_vii",3);var dynCall_ii=Module2["dynCall_ii"]=createExportWrapper("dynCall_ii",2);var dynCall_iiii=Module2["dynCall_iiii"]=createExportWrapper("dynCall_iiii",4);var dynCall_iiiii=Module2["dynCall_iiiii"]=createExportWrapper("dynCall_iiiii",5);var dynCall_vi=Module2["dynCall_vi"]=createExportWrapper("dynCall_vi",2);var dynCall_viii=Module2["dynCall_viii"]=createExportWrapper("dynCall_viii",4);var dynCall_v=Module2["dynCall_v"]=createExportWrapper("dynCall_v",1);var dynCall_jiii=Module2["dynCall_jiii"]=createExportWrapper("dynCall_jiii",4);var dynCall_vij=Module2["dynCall_vij"]=createExportWrapper("dynCall_vij",4);var dynCall_viij=Module2["dynCall_viij"]=createExportWrapper("dynCall_viij",5);var dynCall_iiiiii=Module2["dynCall_iiiiii"]=createExportWrapper("dynCall_iiiiii",6);var dynCall_viiiii=Module2["dynCall_viiiii"]=createExportWrapper("dynCall_viiiii",6);var dynCall_viiiiii=Module2["dynCall_viiiiii"]=createExportWrapper("dynCall_viiiiii",7);var dynCall_i=Module2["dynCall_i"]=createExportWrapper("dynCall_i",1);var dynCall_viiii=Module2["dynCall_viiii"]=createExportWrapper("dynCall_viiii",5);var dynCall_fi=Module2["dynCall_fi"]=createExportWrapper("dynCall_fi",2);var dynCall_jii=Module2["dynCall_jii"]=createExportWrapper("dynCall_jii",3);var dynCall_viiiiiii=Module2["dynCall_viiiiiii"]=createExportWrapper("dynCall_viiiiiii",8);var dynCall_viiiiifii=Module2["dynCall_viiiiifii"]=createExportWrapper("dynCall_viiiiifii",9);var dynCall_viiiiiiii=Module2["dynCall_viiiiiiii"]=createExportWrapper("dynCall_viiiiiiii",9);var dynCall_viiiiiiiiiii=Module2["dynCall_viiiiiiiiiii"]=createExportWrapper("dynCall_viiiiiiiiiii",12);var dynCall_viiiiiiiii=Module2["dynCall_viiiiiiiii"]=createExportWrapper("dynCall_viiiiiiiii",10);var dynCall_vif=Module2["dynCall_vif"]=createExportWrapper("dynCall_vif",3);var dynCall_iif=Module2["dynCall_iif"]=createExportWrapper("dynCall_iif",3);var dynCall_iiff=Module2["dynCall_iiff"]=createExportWrapper("dynCall_iiff",4);var dynCall_fiiii=Module2["dynCall_fiiii"]=createExportWrapper("dynCall_fiiii",5);var dynCall_viifiii=Module2["dynCall_viifiii"]=createExportWrapper("dynCall_viifiii",7);var dynCall_viiifiii=Module2["dynCall_viiifiii"]=createExportWrapper("dynCall_viiifiii",8);var dynCall_vifi=Module2["dynCall_vifi"]=createExportWrapper("dynCall_vifi",4);var dynCall_viiiiiiiiii=Module2["dynCall_viiiiiiiiii"]=createExportWrapper("dynCall_viiiiiiiiii",11);var dynCall_fiif=Module2["dynCall_fiif"]=createExportWrapper("dynCall_fiif",4);var dynCall_vifiiii=Module2["dynCall_vifiiii"]=createExportWrapper("dynCall_vifiiii",7);var dynCall_jiji=Module2["dynCall_jiji"]=createExportWrapper("dynCall_jiji",5);var dynCall_iidiiii=Module2["dynCall_iidiiii"]=createExportWrapper("dynCall_iidiiii",7);var dynCall_viijii=Module2["dynCall_viijii"]=createExportWrapper("dynCall_viijii",7);var dynCall_iiiiiiiii=Module2["dynCall_iiiiiiiii"]=createExportWrapper("dynCall_iiiiiiiii",9);var dynCall_iiiiiii=Module2["dynCall_iiiiiii"]=createExportWrapper("dynCall_iiiiiii",7);var dynCall_iiiiij=Module2["dynCall_iiiiij"]=createExportWrapper("dynCall_iiiiij",7);var dynCall_iiiiid=Module2["dynCall_iiiiid"]=createExportWrapper("dynCall_iiiiid",6);var dynCall_iiiiijj=Module2["dynCall_iiiiijj"]=createExportWrapper("dynCall_iiiiijj",9);var dynCall_iiiiiiii=Module2["dynCall_iiiiiiii"]=createExportWrapper("dynCall_iiiiiiii",8);var dynCall_iiiiiijj=Module2["dynCall_iiiiiijj"]=createExportWrapper("dynCall_iiiiiijj",10);var _asyncify_start_unwind=createExportWrapper("asyncify_start_unwind",1);var _asyncify_stop_unwind=createExportWrapper("asyncify_stop_unwind",0);var _asyncify_start_rewind=createExportWrapper("asyncify_start_rewind",1);var _asyncify_stop_rewind=createExportWrapper("asyncify_stop_rewind",0);var ___start_em_js=Module2["___start_em_js"]=543408;var ___stop_em_js=Module2["___stop_em_js"]=543834;function invoke_vii(index,a1,a2){var sp=stackSave();try{dynCall_vii(index,a1,a2);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function applySignatureConversions(wasmExports2){wasmExports2=Object.assign({},wasmExports2);var makeWrapper_pp=function makeWrapper_pp(f){return function(a0){return f(a0)>>>0;};};var makeWrapper_pP=function makeWrapper_pP(f){return function(a0){return f(a0)>>>0;};};var makeWrapper_p=function makeWrapper_p(f){return function(){return f()>>>0;};};wasmExports2["malloc"]=makeWrapper_pp(wasmExports2["malloc"]);wasmExports2["sbrk"]=makeWrapper_pP(wasmExports2["sbrk"]);wasmExports2["emscripten_stack_get_base"]=makeWrapper_p(wasmExports2["emscripten_stack_get_base"]);wasmExports2["emscripten_stack_get_end"]=makeWrapper_p(wasmExports2["emscripten_stack_get_end"]);wasmExports2["_emscripten_stack_alloc"]=makeWrapper_pp(wasmExports2["_emscripten_stack_alloc"]);wasmExports2["emscripten_stack_get_current"]=makeWrapper_p(wasmExports2["emscripten_stack_get_current"]);return wasmExports2;}var MAGIC=0;Math.random=function(){MAGIC=Math.pow(MAGIC+1.8912,3)%1;return MAGIC;};var TIME=1e4;function deterministicNow(){return TIME++;}datenow=deterministicNow;Module2["thisProgram"]="thisProgram";Module2["addRunDependency"]=addRunDependency;Module2["removeRunDependency"]=removeRunDependency;Module2["FS_createPath"]=FS.createPath;Module2["FS_createLazyFile"]=FS.createLazyFile;Module2["FS_createDevice"]=FS.createDevice;Module2["cwrap"]=cwrap;Module2["FS_createPreloadedFile"]=FS.createPreloadedFile;Module2["FS_createDataFile"]=FS.createDataFile;Module2["FS_unlink"]=FS.unlink;var missingLibrarySymbols=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromU64","convertI32PairToI53","convertU32PairToI53","getTempRet0","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","emscriptenLog","readEmAsmArgs","jstoi_q","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","asmjsMangle","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","uleb128Encode","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","findMatchingCatch","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","demangle","stackTrace"];missingLibrarySymbols.forEach(missingLibrarySymbol);var unexportedSymbols=["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","FS_createFolder","FS_createLink","FS_readFile","out","err","callMain","abort","wasmMemory","wasmExports","writeStackCookie","checkStackCookie","readI53FromI64","convertI32PairToI53Checked","stackSave","stackRestore","stackAlloc","setTempRet0","ptrToString","zeroMemory","exitJS","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","arraySum","addDays","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","readEmAsmArgsArray","jstoi_s","getExecutableName","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asyncLoad","alignMemory","mmapAlloc","wasmTable","noExitRuntime","getCFunc","ccall","sigToWasmTypes","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","Browser","getPreloadedImageData__data","wget","SYSCALLS","preloadPlugins","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","runAndAbortIfError","Asyncify","Fibers","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack"];unexportedSymbols.forEach(unexportedRuntimeSymbol);var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller;};function stackCheckInit(){_emscripten_stack_init3();writeStackCookie();}function run(){if(runDependencies>0){return;}stackCheckInit();preRun();if(runDependencies>0){return;}function doRun(){if(calledRun)return;calledRun=true;Module2["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module2);if(Module2["onRuntimeInitialized"])Module2["onRuntimeInitialized"]();assert(!Module2["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun();}if(Module2["setStatus"]){Module2["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module2["setStatus"]("");},1);doRun();},1);}else{doRun();}checkStackCookie();}function checkUnflushedContent(){var oldOut=out;var oldErr=err;var has=false;out=err=function err(x){has=true;};try{_fflush(0);["stdout","stderr"].forEach(function(name){var _tty$output2;var info=FS.analyzePath("/dev/"+name);if(!info)return;var stream=info.object;var rdev=stream.rdev;var tty=TTY.ttys[rdev];if(tty!==null&&tty!==void 0&&(_tty$output2=tty.output)!==null&&_tty$output2!==void 0&&_tty$output2.length){has=true;}});}catch(e){}out=oldOut;err=oldErr;if(has){_warnOnce2("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.");}}if(Module2["preInit"]){if(typeof Module2["preInit"]=="function")Module2["preInit"]=[Module2["preInit"]];while(Module2["preInit"].length>0){Module2["preInit"].pop()();}}run();moduleRtn=readyPromise;Module2.resizeHeap=_emscripten_resize_heap;var _loop3=function _loop3(){var prop=_Object$keys3[_i5];if(!(prop in moduleArg)){Object.defineProperty(moduleArg,prop,{configurable:true,get:function get(){abort("Access to module property ('".concat(prop,"') is no longer possible via the module constructor argument; Instead, use the result of the module constructor."));}});}};for(var _i5=0,_Object$keys3=Object.keys(Module2);_i5<_Object$keys3.length;_i5++){_loop3();}return moduleRtn;};}();if(_typeof(exports2)==="object"&&_typeof(module2)==="object")module2.exports=Module;else if(typeof define==="function"&&define["amd"])define([],function(){return Module;});}});// src/formats/wasm64-emscripten.cjs
59
- var require_wasm64_emscripten=__commonJS({"src/formats/wasm64-emscripten.cjs":function src_formats_wasm64EmscriptenCjs(exports2,module2){var DEFAULT_GAS_LIMIT=9e15;var Module=function(_document$currentScri2){var _scriptName=typeof document!="undefined"?(_document$currentScri2=document.currentScript)===null||_document$currentScri2===void 0?void 0:_document$currentScri2.src:void 0;if(typeof __filename!="undefined")_scriptName||(_scriptName=__filename);return function(){var moduleArg=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var moduleRtn;var Module2=Object.assign({},moduleArg);Module2.gas={limit:Module2.computeLimit||DEFAULT_GAS_LIMIT,used:0,use:function use(amount){Module2.gas.used+=Number(amount);},refill:function refill(amount){if(!amount)Module2.gas.used=0;else Module2.gas.used=Math.max(Module2.gas.used-amount,0);},isEmpty:function isEmpty(){return Module2.gas.used>Module2.gas.limit;}};var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject;});["_malloc","_memory","___asyncjs__weavedrive_open","___asyncjs__weavedrive_read","___asyncjs__weavedrive_close","_metering_gasUsed","_handle","___indirect_function_table","onRuntimeInitialized"].forEach(function(prop){if(!Object.getOwnPropertyDescriptor(readyPromise,prop)){Object.defineProperty(readyPromise,prop,{get:function get(){return abort("You are getting "+prop+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");},set:function set(){return abort("You are setting "+prop+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}});var ENVIRONMENT_IS_WEB=(typeof window==="undefined"?"undefined":_typeof(window))=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=(typeof process==="undefined"?"undefined":_typeof(process))=="object"&&_typeof(process.versions)=="object"&&typeof process.versions.node=="string";var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module2["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");}if(ENVIRONMENT_IS_NODE){}Module2.locateFile=function(url){return url;};var moduleOverrides=Object.assign({},Module2);var arguments_=[];var thisProgram="./this.program";var quit_=function quit_(status,toThrow){throw toThrow;};var scriptDirectory="";function locateFile(path){if(Module2["locateFile"]){return Module2["locateFile"](path,scriptDirectory);}return scriptDirectory+path;}var read_,readAsync,readBinary;if(ENVIRONMENT_IS_NODE){if(typeof process=="undefined"||!process.release||process.release.name!=="node")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var nodeVersion=process.versions.node;var numericVersion=nodeVersion.split(".").slice(0,3);numericVersion=numericVersion[0]*1e4+numericVersion[1]*100+numericVersion[2].split("-")[0]*1;if(numericVersion<16e4){throw new Error("This emscripten-generated code requires node v16.0.0 (detected v"+nodeVersion+")");}var fs=_require("./fs");var nodePath=_require("path");scriptDirectory=__dirname+"/";read_=function read_(filename,binary){filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?void 0:"utf8");};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret);}assert(ret.buffer);return ret;};readAsync=function readAsync(filename,onload,onerror){var binary=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?void 0:"utf8",function(err2,data){if(err2)onerror(err2);else onload(binary?data.buffer:data);});};if(!Module2["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/");}arguments_=process.argv.slice(2);quit_=function quit_(status,toThrow){process.exitCode=status;throw toThrow;};}else if(ENVIRONMENT_IS_SHELL){if((typeof process==="undefined"?"undefined":_typeof(process))=="object"&&typeof _require==="function"||(typeof window==="undefined"?"undefined":_typeof(window))=="object"||typeof importScripts=="function")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href;}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src;}if(_scriptName){scriptDirectory=_scriptName;}if(scriptDirectory.startsWith("blob:")){scriptDirectory="";}else{scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1);}if(!((typeof window==="undefined"?"undefined":_typeof(window))=="object"||typeof importScripts=="function"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");{read_=function read_(url){var xhr=new XMLHttpRequest();xhr.open("GET",url,false);xhr.send(null);return xhr.responseText;};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest();xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(/** @type{!ArrayBuffer} */xhr.response);};}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest();xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return;}onerror();};xhr.onerror=onerror;xhr.send(null);};}}else{throw new Error("environment detection error");}var out=Module2["print"]||console.log.bind(console);var err=Module2["printErr"]||console.error.bind(console);Object.assign(Module2,moduleOverrides);moduleOverrides=null;checkIncomingModuleAPI();if(Module2["arguments"])arguments_=Module2["arguments"];legacyModuleProp("arguments","arguments_");if(Module2["thisProgram"])thisProgram=Module2["thisProgram"];legacyModuleProp("thisProgram","thisProgram");if(Module2["quit"])quit_=Module2["quit"];legacyModuleProp("quit","quit_");assert(typeof Module2["memoryInitializerPrefixURL"]=="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["pthreadMainPrefixURL"]=="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["cdInitializerPrefixURL"]=="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["filePackagePrefixURL"]=="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["read"]=="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module2["readAsync"]=="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module2["readBinary"]=="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module2["setWindowTitle"]=="undefined","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)");assert(typeof Module2["TOTAL_MEMORY"]=="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");legacyModuleProp("asm","wasmExports");legacyModuleProp("read","read_");legacyModuleProp("readAsync","readAsync");legacyModuleProp("readBinary","readBinary");legacyModuleProp("setWindowTitle","setWindowTitle");assert(!ENVIRONMENT_IS_SHELL,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");var wasmBinary;if(Module2["wasmBinary"])wasmBinary=Module2["wasmBinary"];legacyModuleProp("wasmBinary","wasmBinary");if((typeof WebAssembly==="undefined"?"undefined":_typeof(WebAssembly))!="object"){err("no native wasm support detected");}function intArrayFromBase64(s){if(typeof ENVIRONMENT_IS_NODE!="undefined"&&ENVIRONMENT_IS_NODE){var buf=Buffer.from(s,"base64");return new Uint8Array(buf.buffer,buf.byteOffset,buf.length);}var decoded=atob(s);var bytes=new Uint8Array(decoded.length);for(var i=0;i<decoded.length;++i){bytes[i]=decoded.charCodeAt(i);}return bytes;}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed"+(text?": "+text:""));}}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAP64,HEAPU64,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module2["HEAP8"]=HEAP8=new Int8Array(b);Module2["HEAP16"]=HEAP16=new Int16Array(b);Module2["HEAPU8"]=HEAPU8=new Uint8Array(b);Module2["HEAPU16"]=HEAPU16=new Uint16Array(b);Module2["HEAP32"]=HEAP32=new Int32Array(b);Module2["HEAPU32"]=HEAPU32=new Uint32Array(b);Module2["HEAPF32"]=HEAPF32=new Float32Array(b);Module2["HEAPF64"]=HEAPF64=new Float64Array(b);Module2["HEAP64"]=HEAP64=new BigInt64Array(b);Module2["HEAPU64"]=HEAPU64=new BigUint64Array(b);}assert(!Module2["STACK_SIZE"],"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time");assert(typeof Int32Array!="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!=void 0&&Int32Array.prototype.set!=void 0,"JS engine does not provide full typed array support");assert(!Module2["wasmMemory"],"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally");assert(!Module2["INITIAL_MEMORY"],"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");function writeStackCookie(){var max=_emscripten_stack_get_end4();assert((max&3)==0);if(max==0){max+=4;}HEAPU32[max/4]=34821223;HEAPU32[(max+4)/4]=2310721022;HEAPU32[0/4]=1668509029;}function checkStackCookie(){if(ABORT)return;var max=_emscripten_stack_get_end4();if(max==0){max+=4;}var cookie1=HEAPU32[max/4];var cookie2=HEAPU32[(max+4)/4];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten at ".concat(ptrToString(max),", expected hex dwords 0x89BACDFE and 0x2135467, but received ").concat(ptrToString(cookie2)," ").concat(ptrToString(cookie1)));}if(HEAPU32[0/4]!=1668509029){abort("Runtime error: The application has corrupted its heap memory area (address zero)!");}};(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";})();var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module2["preRun"]){if(typeof Module2["preRun"]=="function")Module2["preRun"]=[Module2["preRun"]];while(Module2["preRun"].length){addOnPreRun(Module2["preRun"].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){assert(!runtimeInitialized);runtimeInitialized=true;checkStackCookie();if(!Module2["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__);}function postRun(){checkStackCookie();if(Module2["postRun"]){if(typeof Module2["postRun"]=="function")Module2["postRun"]=[Module2["postRun"]];while(Module2["postRun"].length){addOnPostRun(Module2["postRun"].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}function addOnInit(cb){__ATINIT__.unshift(cb);}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function getUniqueRunDependency(id){var orig=id;while(1){if(!runDependencyTracking[id])return id;id=orig+Math.random();}}function addRunDependency(id){var _Module2$monitorRunDe5;runDependencies++;(_Module2$monitorRunDe5=Module2["monitorRunDependencies"])===null||_Module2$monitorRunDe5===void 0||_Module2$monitorRunDe5.call(Module2,runDependencies);if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return;}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:");}err("dependency: ".concat(dep));}if(shown){err("(end of list)");}},1e4);}}else{err("warning: run dependency added without ID");}}function removeRunDependency(id){var _Module2$monitorRunDe6;runDependencies--;(_Module2$monitorRunDe6=Module2["monitorRunDependencies"])===null||_Module2$monitorRunDe6===void 0||_Module2$monitorRunDe6.call(Module2,runDependencies);if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id];}else{err("warning: run dependency removed without ID");}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null;}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();}}}function abort(what){var _Module2$onAbort3;(_Module2$onAbort3=Module2["onAbort"])===null||_Module2$onAbort3===void 0||_Module2$onAbort3.call(Module2,what);what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;if(what.indexOf("RuntimeError: unreachable")>=0){what+='. "unreachable" may be due to ASYNCIFY_STACK_SIZE not being large enough (try increasing it)';}var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e;}var dataURIPrefix="data:application/octet-stream;base64,";var isDataURI=function isDataURI(filename){return filename.startsWith(dataURIPrefix);};var isFileURI=function isFileURI(filename){return filename.startsWith("file://");};function createExportWrapper(name,nargs){return function(){assert(runtimeInitialized,"native function `".concat(name,"` called before runtime initialization"));var f=wasmExports[name];assert(f,"exported native function `".concat(name,"` not found"));assert(arguments.length<=nargs,"native function `".concat(name,"` called with ").concat(arguments.length," args but expects ").concat(nargs));return f.apply(void 0,arguments);};}function findWasmBinary(){var f="AOS.wasm";if(!isDataURI(f)){return locateFile(f);}return f;}var wasmBinaryFile;function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary);}if(readBinary){return readBinary(file);}throw"both async and sync fetching of the wasm failed";}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(binaryFile)){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '".concat(binaryFile,"'");}return response["arrayBuffer"]();})["catch"](function(){return getBinarySync(binaryFile);});}else if(readAsync){return new Promise(function(resolve,reject){readAsync(binaryFile,function(response){return resolve(new Uint8Array(/** @type{!ArrayBuffer} */response));},reject);});}}return Promise.resolve().then(function(){return getBinarySync(binaryFile);});}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(function(binary){return WebAssembly.instantiate(binary,imports);}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: ".concat(reason));if(isFileURI(wasmBinaryFile)){err("warning: Loading from a file URI (".concat(wasmBinaryFile,") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"));}abort(reason);});}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err("wasm streaming compile failed: ".concat(reason));err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback);});});}return instantiateArrayBuffer(binaryFile,imports,callback);}function getWasmImports(){Asyncify.instrumentWasmImports(wasmImports);return{env:wasmImports,wasi_snapshot_preview1:wasmImports,metering:{usegas:function usegas(gas){Module2.gas.use(gas);if(Module2.gas.isEmpty())throw Error("out of gas!");}}};}function createWasm(){var info=getWasmImports();function receiveInstance(instance,module3){wasmExports=instance.exports;wasmExports=Asyncify.instrumentWasmExports(wasmExports);wasmExports=applySignatureConversions(wasmExports);wasmMemory=wasmExports["memory"];assert(wasmMemory,"memory not found in wasm exports");updateMemoryViews();wasmTable=wasmExports["__indirect_function_table"];assert(wasmTable,"table not found in wasm exports");addOnInit(wasmExports["__wasm_call_ctors"]);removeRunDependency("wasm-instantiate");return wasmExports;}addRunDependency("wasm-instantiate");var trueModule=Module2;function receiveInstantiationResult(result){assert(Module2===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(result["instance"]);}if(Module2["instantiateWasm"]){try{return Module2["instantiateWasm"](info,receiveInstance);}catch(e){err("Module.instantiateWasm callback failed with error: ".concat(e));readyPromiseReject(e);}}if(!wasmBinaryFile)wasmBinaryFile=findWasmBinary();instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult)["catch"](readyPromiseReject);return{};}function legacyModuleProp(prop,newName){var incoming=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;if(!Object.getOwnPropertyDescriptor(Module2,prop)){Object.defineProperty(Module2,prop,{configurable:true,get:function get(){var extra=incoming?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":"";abort("`Module.".concat(prop,"` has been replaced by `").concat(newName,"`")+extra);}});}}function ignoredModuleProp(prop){if(Object.getOwnPropertyDescriptor(Module2,prop)){abort("`Module.".concat(prop,"` was supplied but `").concat(prop,"` not included in INCOMING_MODULE_JS_API"));}}function isExportedByForceFilesystem(name){return name==="FS_createPath"||name==="FS_createDataFile"||name==="FS_createPreloadedFile"||name==="FS_unlink"||name==="addRunDependency"||name==="FS_createLazyFile"||name==="FS_createDevice"||name==="removeRunDependency";}function missingGlobal(sym,msg){if(typeof globalThis!="undefined"){Object.defineProperty(globalThis,sym,{configurable:true,get:function get(){_warnOnce3("`".concat(sym,"` is not longer defined by emscripten. ").concat(msg));return void 0;}});}}missingGlobal("buffer","Please use HEAP8.buffer or wasmMemory.buffer");missingGlobal("asm","Please use wasmExports instead");function missingLibrarySymbol(sym){if(typeof globalThis!="undefined"&&!Object.getOwnPropertyDescriptor(globalThis,sym)){Object.defineProperty(globalThis,sym,{configurable:true,get:function get(){var msg="`".concat(sym,"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line");var librarySymbol=sym;if(!librarySymbol.startsWith("_")){librarySymbol="$"+sym;}msg+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='".concat(librarySymbol,"')");if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";}_warnOnce3(msg);return void 0;}});}unexportedRuntimeSymbol(sym);}function unexportedRuntimeSymbol(sym){if(!Object.getOwnPropertyDescriptor(Module2,sym)){Object.defineProperty(Module2,sym,{configurable:true,get:function get(){var msg="'".concat(sym,"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)");if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";}abort(msg);}});}}function __asyncjs__weavedrive_open(c_filename,mode){return Asyncify.handleAsync(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(){var filename,drive,driveResponse;return _regenerator().w(function(_context4){while(1)switch(_context4.n){case 0:filename=UTF8ToString(Number(c_filename));if(Module2.WeaveDrive){_context4.n=1;break;}return _context4.a(2,Promise.resolve(null));case 1:drive=Module2.WeaveDrive(Module2,FS);_context4.n=2;return drive.open(filename);case 2:driveResponse=_context4.v;if(!(typeof driveResponse==="string")){_context4.n=3;break;}throw new Error("HALT: FILE NOT FOUND");case 3:return _context4.a(2,driveResponse);}},_callee4);})));}function __asyncjs__weavedrive_read(fd,dst_ptr,length){return Asyncify.handleAsync(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(){var drive,_t2;return _regenerator().w(function(_context5){while(1)switch(_context5.n){case 0:drive=Module2.WeaveDrive(Module2,FS);_t2=Promise;_context5.n=1;return drive.read(fd,dst_ptr,length);case 1:return _context5.a(2,_t2.resolve.call(_t2,_context5.v));}},_callee5);})));}function __asyncjs__weavedrive_close(fd){return Asyncify.handleAsync(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(){var drive;return _regenerator().w(function(_context6){while(1)switch(_context6.n){case 0:drive=Module2.WeaveDrive(Module2,FS);return _context6.a(2,drive.close(fd));}},_callee6);})));}function metering_gasUsed(){return Module2.gas.used;}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit(".concat(status,")");this.status=status;}var callRuntimeCallbacks=function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module2);}};var noExitRuntime=Module2["noExitRuntime"]||true;var ptrToString=function ptrToString(ptr){assert(typeof ptr==="number");return"0x"+ptr.toString(16).padStart(8,"0");};var stackRestore=function stackRestore(val){return _emscripten_stack_restore2(val);};var stackSave=function stackSave(){return _emscripten_stack_get_current4();};var _warnOnce3=function warnOnce(text){_warnOnce3.shown||(_warnOnce3.shown={});if(!_warnOnce3.shown[text]){_warnOnce3.shown[text]=1;if(ENVIRONMENT_IS_NODE)text="warning: "+text;err(text);}};var MAX_INT53=9007199254740992;var MIN_INT53=-9007199254740992;var bigintToI53Checked=function bigintToI53Checked(num){return num<MIN_INT53||num>MAX_INT53?NaN:Number(num);};var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;var UTF8ArrayToString=function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr));}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue;}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue;}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2;}else{if((u0&248)!=240)_warnOnce3("Invalid UTF-8 leading byte "+ptrToString(u0)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63;}if(u0<65536){str+=String.fromCharCode(u0);}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023);}}return str;};var UTF8ToString=function UTF8ToString(ptr,maxBytesToRead){assert(typeof ptr=="number","UTF8ToString expects a number (got ".concat(_typeof(ptr),")"));return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";};function ___assert_fail(condition,filename,line,func){condition=bigintToI53Checked(condition);filename=bigintToI53Checked(filename);func=bigintToI53Checked(func);abort("Assertion failed: ".concat(UTF8ToString(condition),", at: ")+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"]);}var ExceptionInfo=/*#__PURE__*/function(){function ExceptionInfo(excPtr){_classCallCheck(this,ExceptionInfo);this.excPtr=excPtr;this.ptr=excPtr-48;}return _createClass(ExceptionInfo,[{key:"set_type",value:function set_type(type){HEAPU64[(this.ptr+8)/8]=BigInt(type);}},{key:"get_type",value:function get_type(){return Number(HEAPU64[(this.ptr+8)/8]);}},{key:"set_destructor",value:function set_destructor(destructor){HEAPU64[(this.ptr+16)/8]=BigInt(destructor);}},{key:"get_destructor",value:function get_destructor(){return Number(HEAPU64[(this.ptr+16)/8]);}},{key:"set_caught",value:function set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+24]=caught;}},{key:"get_caught",value:function get_caught(){return HEAP8[this.ptr+24]!=0;}},{key:"set_rethrown",value:function set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+25]=rethrown;}},{key:"get_rethrown",value:function get_rethrown(){return HEAP8[this.ptr+25]!=0;}},{key:"init",value:function init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);}},{key:"set_adjusted_ptr",value:function set_adjusted_ptr(adjustedPtr){HEAPU64[(this.ptr+32)/8]=BigInt(adjustedPtr);}},{key:"get_adjusted_ptr",value:function get_adjusted_ptr(){return Number(HEAPU64[(this.ptr+32)/8]);}},{key:"get_exception_ptr",value:function get_exception_ptr(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return Number(HEAPU64[this.excPtr/8]);}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr;}}]);}();var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){ptr=bigintToI53Checked(ptr);type=bigintToI53Checked(type);destructor=bigintToI53Checked(destructor);var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;assert(false,"Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.");}var PATH={isAbs:function isAbs(path){return path.charAt(0)==="/";},splitPath:function splitPath(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1);},normalizeArray:function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1);}else if(last===".."){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}if(allowAboveRoot){for(;up;up--){parts.unshift("..");}}return parts;},normalize:function normalize(path){var isAbsolute=PATH.isAbs(path),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 dirname(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return".";}if(dir){dir=dir.substr(0,dir.length-1);}return root+dir;},basename:function basename(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1);},join:function join(){for(var _len5=arguments.length,paths=new Array(_len5),_key5=0;_key5<_len5;_key5++){paths[_key5]=arguments[_key5];}return PATH.normalize(paths.join("/"));},join2:function join2(l,r){return PATH.normalize(l+"/"+r);}};var initRandomFill=function initRandomFill(){if((typeof crypto==="undefined"?"undefined":_typeof(crypto))=="object"&&typeof crypto["getRandomValues"]=="function"){return function(view){return crypto.getRandomValues(view);};}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=_require("crypto");var randomFillSync=crypto_module["randomFillSync"];if(randomFillSync){return function(view){return crypto_module["randomFillSync"](view);};}var randomBytes=crypto_module["randomBytes"];return function(view){return view.set(randomBytes(view.byteLength)),view;};}catch(e){}}abort("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };");};var _randomFill3=function randomFill(view){return(_randomFill3=initRandomFill())(view);};var PATH_FS={resolve:function resolve(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?i<0||arguments.length<=i?undefined: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.isAbs(path);}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p;}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||".";},relative:function relative(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break;}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break;}if(start>end)return[];return arr.slice(start,end-start+1);}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break;}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..");}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/");}};var FS_stdin_getChar_buffer=[];var lengthBytesUTF8=function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++;}else if(c<=2047){len+=2;}else if(c>=55296&&c<=57343){len+=4;++i;}else{len+=3;}}return len;};var stringToUTF8Array=function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){assert(typeof str==="string","stringToUTF8Array expects a string (got ".concat(_typeof(str),")"));if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023;}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u;}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63;}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}else{if(outIdx+3>=endIdx)break;if(u>1114111)_warnOnce3("Invalid Unicode code point "+ptrToString(u)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}}heap[outIdx]=0;return outIdx-startIdx;};function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array;}var FS_stdin_getChar=function FS_stdin_getChar(){if(!FS_stdin_getChar_buffer.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;try{bytesRead=fs.readSync(fd,buf);}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e;}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8");}else{result=null;}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n";}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n";}}if(!result){return null;}FS_stdin_getChar_buffer=intArrayFromString(result,true);}return FS_stdin_getChar_buffer.shift();};var TTY={ttys:[],init:function init(){},shutdown:function shutdown(){},register:function register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops);},stream_ops:{open:function open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43);}stream.tty=tty;stream.seekable=false;},close:function close(stream){stream.tty.ops.fsync(stream.tty);},fsync:function fsync(stream){stream.tty.ops.fsync(stream.tty);},read:function read(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60);}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty);}catch(e){throw new FS.ErrnoError(29);}if(result===void 0&&bytesRead===0){throw new FS.ErrnoError(6);}if(result===null||result===void 0)break;bytesRead++;buffer[offset+i]=result;}if(bytesRead){stream.node.timestamp=datenow();}return bytesRead;},write:function write(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(60);}try{for(var i=0;i<length;i++){stream.tty.ops.put_char(stream.tty,buffer[offset+i]);}}catch(e){throw new FS.ErrnoError(29);}if(length){stream.node.timestamp=datenow();}return i;}},default_tty_ops:{get_char:function get_char(tty){return FS_stdin_getChar();},put_char:function put_char(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[];}else{if(val!=0)tty.output.push(val);}},fsync:function fsync(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[];}},ioctl_tcgets:function ioctl_tcgets(tty){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};},ioctl_tcsets:function ioctl_tcsets(tty,optional_actions,data){return 0;},ioctl_tiocgwinsz:function ioctl_tiocgwinsz(tty){return[24,80];}},default_tty1_ops:{put_char:function put_char(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[];}else{if(val!=0)tty.output.push(val);}},fsync:function fsync(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[];}}}};var zeroMemory=function zeroMemory(address,size){HEAPU8.fill(0,address,address+size);return address;};var alignMemory=function alignMemory(size,alignment){assert(alignment,"alignment argument is required");return Math.ceil(size/alignment)*alignment;};var mmapAlloc=function mmapAlloc(size){size=alignMemory(size,65536);var ptr=_emscripten_builtin_memalign(65536,size);if(!ptr)return 0;return zeroMemory(ptr,size);};var MEMFS={ops_table:null,mount:function mount(_mount4){return MEMFS.createNode(null,"/",16384|511,/* 0777 */0);},createNode:function createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63);}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=datenow();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp;}return node;},getFileDataAsTypedArray:function getFileDataAsTypedArray(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents);},expandFileStorage:function expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)>>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);},resizeFileStorage:function resizeFileStorage(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)));}node.usedBytes=newSize;}},node_ops:{getattr:function getattr(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096;}else if(FS.isFile(node.mode)){attr.size=node.usedBytes;}else if(FS.isLink(node.mode)){attr.size=node.link.length;}else{attr.size=0;}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr;},setattr:function setattr(node,attr){if(attr.mode!==void 0){node.mode=attr.mode;}if(attr.timestamp!==void 0){node.timestamp=attr.timestamp;}if(attr.size!==void 0){MEMFS.resizeFileStorage(node,attr.size);}},lookup:function lookup(parent,name){throw FS.genericErrors[44];},mknod:function mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev);},rename:function rename(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55);}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=datenow();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir;},unlink:function unlink(parent,name){delete parent.contents[name];parent.timestamp=datenow();},rmdir:function rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55);}delete parent.contents[name];parent.timestamp=datenow();},readdir:function readdir(node){var entries=[".",".."];for(var _i6=0,_Object$keys4=Object.keys(node.contents);_i6<_Object$keys4.length;_i6++){var key=_Object$keys4[_i6];entries.push(key);}return entries;},symlink:function symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511/* 0777 */|40960,0);node.link=oldpath;return node;},readlink:function readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28);}return node.link;}},stream_ops:{read:function read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset);}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i];}return size;},write:function write(stream,buffer,offset,length,position,canOwn){assert(!(buffer instanceof ArrayBuffer));if(buffer.buffer===HEAP8.buffer){canOwn=false;}if(!length)return 0;var node=stream.node;node.timestamp=datenow();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){assert(position===0,"canOwn must imply no weird position inside the file");node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length;}else if(node.usedBytes===0&&position===0){node.contents=buffer.slice(offset,offset+length);node.usedBytes=length;return length;}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length;}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray){node.contents.set(buffer.subarray(offset,offset+length),position);}else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i];}}node.usedBytes=Math.max(node.usedBytes,position+length);return length;},llseek:function llseek(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.usedBytes;}}if(position<0){throw new FS.ErrnoError(28);}return position;},allocate:function allocate(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length);},mmap:function mmap(stream,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43);}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&contents.buffer===HEAP8.buffer){allocated=false;ptr=contents.byteOffset;}else{if(position>0||position+length<contents.length){if(contents.subarray){contents=contents.subarray(position,position+length);}else{contents=Array.prototype.slice.call(contents,position,position+length);}}allocated=true;ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48);}HEAP8.set(contents,ptr);}return{ptr:ptr,allocated:allocated};},msync:function msync(stream,buffer,offset,length,mmapFlags){MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0;}}};var asyncLoad=function asyncLoad(url,onload,onerror,noRunDep){var dep=!noRunDep?getUniqueRunDependency("al ".concat(url)):"";readAsync(url,function(arrayBuffer){assert(arrayBuffer,"Loading data file \"".concat(url,"\" failed (no arrayBuffer)."));onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep);},function(event){if(onerror){onerror();}else{throw"Loading data file \"".concat(url,"\" failed.");}});if(dep)addRunDependency(dep);};var FS_createDataFile=function FS_createDataFile(parent,name,fileData,canRead,canWrite,canOwn){FS.createDataFile(parent,name,fileData,canRead,canWrite,canOwn);};var preloadPlugins=Module2["preloadPlugins"]||[];var FS_handledByPreloadPlugin=function FS_handledByPreloadPlugin(byteArray,fullname,finish,onerror){if(typeof Browser!="undefined")Browser.init();var handled=false;preloadPlugins.forEach(function(plugin){if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,onerror);handled=true;}});return handled;};var FS_createPreloadedFile=function FS_createPreloadedFile(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish){var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency("cp ".concat(fullname));function processData(byteArray){function finish(byteArray2){preFinish===null||preFinish===void 0||preFinish();if(!dontCreateFile){FS_createDataFile(parent,name,byteArray2,canRead,canWrite,canOwn);}onload===null||onload===void 0||onload();removeRunDependency(dep);}if(FS_handledByPreloadPlugin(byteArray,fullname,finish,function(){onerror===null||onerror===void 0||onerror();removeRunDependency(dep);})){return;}finish(byteArray);}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,processData,onerror);}else{processData(url);}};var FS_modeStringToFlags=function FS_modeStringToFlags(str){var flagModes={r:0,"r+":2,w:512|64|1,"w+":512|64|2,a:1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error("Unknown file open mode: ".concat(str));}return flags;};var FS_getMode=function FS_getMode(canRead,canWrite){var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode;};var ERRNO_MESSAGES={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"};var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:/*#__PURE__*/function(_Error3){function ErrnoError(errno){var _this3;_classCallCheck(this,ErrnoError);_this3=_callSuper(this,ErrnoError,[ERRNO_MESSAGES[errno]]);_this3.name="ErrnoError";_this3.errno=errno;for(var key in ERRNO_CODES){if(ERRNO_CODES[key]===errno){_this3.code=key;break;}}return _this3;}_inherits(ErrnoError,_Error3);return _createClass(ErrnoError);}(/*#__PURE__*/_wrapNativeSuper(Error)),genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:/*#__PURE__*/function(){function FSStream(){_classCallCheck(this,FSStream);this.shared={};}return _createClass(FSStream,[{key:"object",get:function get(){return this.node;},set:function set(val){this.node=val;}},{key:"isRead",get:function get(){return(this.flags&2097155)!==1;}},{key:"isWrite",get:function get(){return(this.flags&2097155)!==0;}},{key:"isAppend",get:function get(){return this.flags&1024;}},{key:"flags",get:function get(){return this.shared.flags;},set:function set(val){this.shared.flags=val;}},{key:"position",get:function get(){return this.shared.position;},set:function set(val){this.shared.position=val;}}]);}(),FSNode:/*#__PURE__*/function(){function FSNode(parent,name,mode,rdev){_classCallCheck(this,FSNode);if(!parent){parent=this;}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev;this.readMode=292/*292*/|73;this.writeMode=146;}/*146*/return _createClass(FSNode,[{key:"read",get:function get(){return(this.mode&this.readMode)===this.readMode;},set:function set(val){val?this.mode|=this.readMode:this.mode&=~this.readMode;}},{key:"write",get:function get(){return(this.mode&this.writeMode)===this.writeMode;},set:function set(val){val?this.mode|=this.writeMode:this.mode&=~this.writeMode;}},{key:"isFolder",get:function get(){return FS.isDir(this.mode);}},{key:"isDevice",get:function get(){return FS.isChrdev(this.mode);}}]);}(),lookupPath:function lookupPath(path){var opts=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};path=PATH_FS.resolve(path);if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};opts=Object.assign(defaults,opts);if(opts.recurse_count>8){throw new FS.ErrnoError(32);}var parts=path.split("/").filter(function(p){return!!p;});var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break;}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root;}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH_FS.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count+1});current=lookup.node;if(count++>40){throw new FS.ErrnoError(32);}}}}return{path:current_path,node:current};},getPath:function getPath(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?"".concat(mount,"/").concat(path):mount+path;}path=path?"".concat(node.name,"/").concat(path):node.name;node=node.parent;}},hashName:function hashName(parentid,name){var hash=0;for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0;}return(parentid+hash>>>0)%FS.nameTable.length;},hashAddNode:function hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node;},hashRemoveNode:function hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next;}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break;}current=current.name_next;}}},lookupNode:function lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode);}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node;}}return FS.lookup(parent,name);},createNode:function createNode(parent,name,mode,rdev){assert(_typeof(parent)=="object");var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node;},destroyNode:function destroyNode(node){FS.hashRemoveNode(node);},isRoot:function isRoot(node){return node===node.parent;},isMountpoint:function isMountpoint(node){return!!node.mounted;},isFile:function isFile(mode){return(mode&61440)===32768;},isDir:function isDir(mode){return(mode&61440)===16384;},isLink:function isLink(mode){return(mode&61440)===40960;},isChrdev:function isChrdev(mode){return(mode&61440)===8192;},isBlkdev:function isBlkdev(mode){return(mode&61440)===24576;},isFIFO:function isFIFO(mode){return(mode&61440)===4096;},isSocket:function isSocket(mode){return(mode&49152)===49152;},flagsToPermissionString:function flagsToPermissionString(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w";}return perms;},nodePermissions:function nodePermissions(node,perms){if(FS.ignorePermissions){return 0;}if(perms.includes("r")&&!(node.mode&292)){return 2;}else if(perms.includes("w")&&!(node.mode&146)){return 2;}else if(perms.includes("x")&&!(node.mode&73)){return 2;}return 0;},mayLookup:function mayLookup(dir){if(!FS.isDir(dir.mode))return 54;var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0;},mayCreate:function mayCreate(dir,name){try{var node=FS.lookupNode(dir,name);return 20;}catch(e){}return FS.nodePermissions(dir,"wx");},mayDelete:function mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name);}catch(e){return e.errno;}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode;}if(isdir){if(!FS.isDir(node.mode)){return 54;}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10;}}else{if(FS.isDir(node.mode)){return 31;}}return 0;},mayOpen:function mayOpen(node,flags){if(!node){return 44;}if(FS.isLink(node.mode)){return 32;}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31;}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags));},MAX_OPEN_FDS:4096,nextfd:function nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd;}}throw new FS.ErrnoError(33);},getStreamChecked:function getStreamChecked(fd){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8);}return stream;},getStream:function getStream(fd){return FS.streams[fd];},createStream:function createStream(stream){var fd=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;stream=Object.assign(new FS.FSStream(),stream);if(fd==-1){fd=FS.nextfd();}stream.fd=fd;FS.streams[fd]=stream;return stream;},closeStream:function closeStream(fd){FS.streams[fd]=null;},dupStream:function dupStream(origStream){var _stream$stream_ops6,_stream$stream_ops6$d;var fd=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var stream=FS.createStream(origStream,fd);(_stream$stream_ops6=stream.stream_ops)===null||_stream$stream_ops6===void 0||(_stream$stream_ops6$d=_stream$stream_ops6.dup)===null||_stream$stream_ops6$d===void 0||_stream$stream_ops6$d.call(_stream$stream_ops6,stream);return stream;},chrdev_stream_ops:{open:function open(stream){var _stream$stream_ops$op3,_stream$stream_ops7;var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;(_stream$stream_ops$op3=(_stream$stream_ops7=stream.stream_ops).open)===null||_stream$stream_ops$op3===void 0||_stream$stream_ops$op3.call(_stream$stream_ops7,stream);},llseek:function llseek(){throw new FS.ErrnoError(70);}},major:function major(dev){return dev>>8;},minor:function minor(dev){return dev&255;},makedev:function makedev(ma,mi){return ma<<8|mi;},registerDevice:function registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops};},getDevice:function getDevice(dev){return FS.devices[dev];},getMounts:function getMounts(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,_toConsumableArray(m.mounts));}return mounts;},syncfs:function syncfs(populate,callback){if(typeof populate=="function"){callback=populate;populate=false;}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: ".concat(FS.syncFSRequests," FS.syncfs operations in flight at once, probably just doing extra work"));}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(errCode);}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode);}return;}if(++completed>=mounts.length){doCallback(null);}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null);}mount.type.syncfs(mount,populate,done);});},mount:function mount(type,opts,mountpoint){if(typeof type=="string"){throw type;}var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10);}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54);}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot;}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount);}}return mountRoot;},unmount:function unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28);}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current);}current=next;}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1);},lookup:function lookup(parent,name){return parent.node_ops.lookup(parent,name);},mknod:function mknod(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28);}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63);}return parent.node_ops.mknod(parent,name,mode,dev);},create:function create(path,mode){mode=mode!==void 0?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0);},mkdir:function mkdir(path,mode){mode=mode!==void 0?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0);},mkdirTree:function mkdirTree(path,mode){var dirs=path.split("/");var d="";for(var i=0;i<dirs.length;++i){if(!dirs[i])continue;d+="/"+dirs[i];try{FS.mkdir(d,mode);}catch(e){if(e.errno!=20)throw e;}}},mkdev:function mkdev(path,mode,dev){if(typeof dev=="undefined"){dev=mode;mode=438;}mode|=8192;return FS.mknod(path,mode,dev);},symlink:function symlink(oldpath,newpath){if(!PATH_FS.resolve(oldpath)){throw new FS.ErrnoError(44);}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44);}var newname=PATH.basename(newpath);var errCode=FS.mayCreate(parent,newname);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.symlink){throw new FS.ErrnoError(63);}return parent.node_ops.symlink(parent,newname,oldpath);},rename:function rename(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node;if(!old_dir||!new_dir)throw new FS.ErrnoError(44);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(75);}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH_FS.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(28);}relative=PATH_FS.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(55);}var new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}if(old_node===new_node){return;}var isdir=FS.isDir(old_node.mode);var errCode=FS.mayDelete(old_dir,old_name,isdir);if(errCode){throw new FS.ErrnoError(errCode);}errCode=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(errCode){throw new FS.ErrnoError(errCode);}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(63);}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(10);}if(new_dir!==old_dir){errCode=FS.nodePermissions(old_dir,"w");if(errCode){throw new FS.ErrnoError(errCode);}}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name);}catch(e){throw e;}finally{FS.hashAddNode(old_node);}},rmdir:function rmdir(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,true);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(63);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);},readdir:function readdir(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(54);}return node.node_ops.readdir(node);},unlink:function unlink(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44);}var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,false);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.unlink){throw new FS.ErrnoError(63);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}parent.node_ops.unlink(parent,name);FS.destroyNode(node);},readlink:function readlink(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(44);}if(!link.node_ops.readlink){throw new FS.ErrnoError(28);}return PATH_FS.resolve(FS.getPath(link.parent),link.node_ops.readlink(link));},stat:function stat(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(44);}if(!node.node_ops.getattr){throw new FS.ErrnoError(63);}return node.node_ops.getattr(node);},lstat:function lstat(path){return FS.stat(path,true);},chmod:function chmod(path,mode,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:datenow()});},lchmod:function lchmod(path,mode){FS.chmod(path,mode,true);},fchmod:function fchmod(fd,mode){var stream=FS.getStreamChecked(fd);FS.chmod(stream.node,mode);},chown:function chown(path,uid,gid,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}node.node_ops.setattr(node,{timestamp:datenow()});},lchown:function lchown(path,uid,gid){FS.chown(path,uid,gid,true);},fchown:function fchown(fd,uid,gid){var stream=FS.getStreamChecked(fd);FS.chown(stream.node,uid,gid);},truncate:function truncate(path,len){if(len<0){throw new FS.ErrnoError(28);}var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}if(FS.isDir(node.mode)){throw new FS.ErrnoError(31);}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(28);}var errCode=FS.nodePermissions(node,"w");if(errCode){throw new FS.ErrnoError(errCode);}node.node_ops.setattr(node,{size:len,timestamp:datenow()});},ftruncate:function ftruncate(fd,len){var stream=FS.getStreamChecked(fd);if((stream.flags&2097155)===0){throw new FS.ErrnoError(28);}FS.truncate(stream.node,len);},utime:function utime(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)});},open:function open(path,flags,mode){if(path===""){throw new FS.ErrnoError(44);}flags=typeof flags=="string"?FS_modeStringToFlags(flags):flags;mode=typeof mode=="undefined"?438:/* 0666 */mode;if(flags&64){mode=mode&4095|32768;}else{mode=0;}var node;if(_typeof(path)=="object"){node=path;}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node;}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(20);}}else{node=FS.mknod(path,mode,0);created=true;}}if(!node){throw new FS.ErrnoError(44);}if(FS.isChrdev(node.mode)){flags&=~512;}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(54);}if(!created){var errCode=FS.mayOpen(node,flags);if(errCode){throw new FS.ErrnoError(errCode);}}if(flags&512&&!created){FS.truncate(node,0);}flags&=~(128|512|131072);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false});if(stream.stream_ops.open){stream.stream_ops.open(stream);}if(Module2["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;}}return stream;},close:function close(stream){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream);}}catch(e){throw e;}finally{FS.closeStream(stream.fd);}stream.fd=null;},isClosed:function isClosed(stream){return stream.fd===null;},llseek:function llseek(stream,offset,whence){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(70);}if(whence!=0&&whence!=1&&whence!=2){throw new FS.ErrnoError(28);}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position;},read:function read(stream,buffer,offset,length,position){assert(offset>=0);if(length<0||position<0){throw new FS.ErrnoError(28);}if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if((stream.flags&2097155)===1){throw new FS.ErrnoError(8);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31);}if(!stream.stream_ops.read){throw new FS.ErrnoError(28);}var seeking=typeof position!="undefined";if(!seeking){position=stream.position;}else if(!stream.seekable){throw new FS.ErrnoError(70);}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead;},write:function write(stream,buffer,offset,length,position,canOwn){assert(offset>=0);if(length<0||position<0){throw new FS.ErrnoError(28);}if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31);}if(!stream.stream_ops.write){throw new FS.ErrnoError(28);}if(stream.seekable&&stream.flags&1024){FS.llseek(stream,0,2);}var seeking=typeof position!="undefined";if(!seeking){position=stream.position;}else if(!stream.seekable){throw new FS.ErrnoError(70);}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;return bytesWritten;},allocate:function allocate(stream,offset,length){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(offset<0||length<=0){throw new FS.ErrnoError(28);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8);}if(!FS.isFile(stream.node.mode)&&!FS.isDir(stream.node.mode)){throw new FS.ErrnoError(43);}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(138);}stream.stream_ops.allocate(stream,offset,length);},mmap:function mmap(stream,length,position,prot,flags){if((prot&2)!==0&&(flags&2)===0&&(stream.flags&2097155)!==2){throw new FS.ErrnoError(2);}if((stream.flags&2097155)===1){throw new FS.ErrnoError(2);}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(43);}return stream.stream_ops.mmap(stream,length,position,prot,flags);},msync:function msync(stream,buffer,offset,length,mmapFlags){assert(offset>=0);if(!stream.stream_ops.msync){return 0;}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags);},ioctl:function ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59);}return stream.stream_ops.ioctl(stream,cmd,arg);},readFile:function readFile(path){var opts=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error("Invalid encoding type \"".concat(opts.encoding,"\""));}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0);}else if(opts.encoding==="binary"){ret=buf;}FS.close(stream);return ret;},writeFile:function writeFile(path,data){var opts=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,void 0,opts.canOwn);}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,void 0,opts.canOwn);}else{throw new Error("Unsupported data type");}FS.close(stream);},cwd:function cwd(){return FS.currentPath;},chdir:function chdir(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44);}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54);}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode);}FS.currentPath=lookup.path;},createDefaultDirectories:function createDefaultDirectories(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user");},createDefaultDevices:function createDefaultDevices(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:function read(){return 0;},write:function write(stream,buffer,offset,length,pos){return length;}});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=function randomByte(){if(randomLeft===0){randomLeft=_randomFill3(randomBuffer).byteLength;}return randomBuffer[--randomLeft];};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp");},createSpecialDirectories:function createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:function mount(){var node=FS.createNode(proc_self,"fd",16384|511,/* 0777 */73);node.node_ops={lookup:function lookup(parent,name){var fd=+name;var stream=FS.getStreamChecked(fd);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function readlink(){return stream.path;}}};ret.parent=ret;return ret;}};return node;}},{},"/proc/self/fd");},createStandardStreams:function createStandardStreams(){if(Module2["stdin"]){FS.createDevice("/dev","stdin",Module2["stdin"]);}else{FS.symlink("/dev/tty","/dev/stdin");}if(Module2["stdout"]){FS.createDevice("/dev","stdout",null,Module2["stdout"]);}else{FS.symlink("/dev/tty","/dev/stdout");}if(Module2["stderr"]){FS.createDevice("/dev","stderr",null,Module2["stderr"]);}else{FS.symlink("/dev/tty1","/dev/stderr");}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1);assert(stdin.fd===0,"invalid handle for stdin (".concat(stdin.fd,")"));assert(stdout.fd===1,"invalid handle for stdout (".concat(stdout.fd,")"));assert(stderr.fd===2,"invalid handle for stderr (".concat(stderr.fd,")"));},staticInit:function staticInit(){;[44].forEach(function(code){FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>";});FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={MEMFS:MEMFS};},init:function init(input,output,error){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");FS.init.initialized=true;Module2["stdin"]=input||Module2["stdin"];Module2["stdout"]=output||Module2["stdout"];Module2["stderr"]=error||Module2["stderr"];FS.createStandardStreams();},quit:function quit(){FS.init.initialized=false;_fflush(0);for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue;}FS.close(stream);}},findObject:function findObject(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink);if(!ret.exists){return null;}return ret.object;},analyzePath:function analyzePath(path,dontResolveLastLink){try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path;}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/";}catch(e){ret.error=e.errno;}return ret;},createPath:function createPath(parent,path,canRead,canWrite){parent=typeof parent=="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current);}catch(e){}parent=current;}return current;},createFile:function createFile(parent,name,properties,canRead,canWrite){var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(canRead,canWrite);return FS.create(path,mode);},createDataFile:function createDataFile(parent,name,data,canRead,canWrite,canOwn){var path=name;if(parent){parent=typeof parent=="string"?parent:FS.getPath(parent);path=name?PATH.join2(parent,name):parent;}var mode=FS_getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data=="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr;}FS.chmod(node,mode|146);var stream=FS.open(node,577);FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode);}},createDevice:function createDevice(parent,name,input,output){var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:function open(stream){stream.seekable=false;},close:function close(stream){var _output$buffer3;if(output!==null&&output!==void 0&&(_output$buffer3=output.buffer)!==null&&_output$buffer3!==void 0&&_output$buffer3.length){output(10);}},read:function read(stream,buffer,offset,length,pos){var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input();}catch(e){throw new FS.ErrnoError(29);}if(result===void 0&&bytesRead===0){throw new FS.ErrnoError(6);}if(result===null||result===void 0)break;bytesRead++;buffer[offset+i]=result;}if(bytesRead){stream.node.timestamp=datenow();}return bytesRead;},write:function write(stream,buffer,offset,length,pos){for(var i=0;i<length;i++){try{output(buffer[offset+i]);}catch(e){throw new FS.ErrnoError(29);}}if(length){stream.node.timestamp=datenow();}return i;}});return FS.mkdev(path,mode,dev);},forceLoadFile:function forceLoadFile(obj){if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;if(typeof XMLHttpRequest!="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");}else if(read_){try{obj.contents=intArrayFromString(read_(obj.url),true);obj.usedBytes=obj.contents.length;}catch(e){throw new FS.ErrnoError(29);}}else{throw new Error("Cannot load without read() or XMLHttpRequest.");}},createLazyFile:function createLazyFile(parent,name,url,canRead,canWrite){var LazyUint8Array=/*#__PURE__*/function(){function LazyUint8Array(){_classCallCheck(this,LazyUint8Array);this.lengthKnown=false;this.chunks=[];}return _createClass(LazyUint8Array,[{key:"get",value:function get(idx){if(idx>this.length-1||idx<0){return void 0;}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset];}},{key:"setDataGetter",value:function setDataGetter(getter){this.getter=getter;}},{key:"cacheLength",value:function 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 doXHR(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr2=new XMLHttpRequest();xhr2.open("GET",url,false);if(datalength!==chunkSize)xhr2.setRequestHeader("Range","bytes="+from+"-"+to);xhr2.responseType="arraybuffer";if(xhr2.overrideMimeType){xhr2.overrideMimeType("text/plain; charset=x-user-defined");}xhr2.send(null);if(!(xhr2.status>=200&&xhr2.status<300||xhr2.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr2.status);if(xhr2.response!==void 0){return new Uint8Array(/** @type{Array<number>} */xhr2.response||[]);}return intArrayFromString(xhr2.responseText||"",true);};var lazyArray2=this;lazyArray2.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray2.chunks[chunkNum]=="undefined"){lazyArray2.chunks[chunkNum]=doXHR(start,end);}if(typeof lazyArray2.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray2.chunks[chunkNum];});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed");}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true;}},{key:"length",get:function get(){if(!this.lengthKnown){this.cacheLength();}return this._length;}},{key:"chunkSize",get:function get(){if(!this.lengthKnown){this.cacheLength();}return this._chunkSize;}}]);}();if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array();var properties={isDevice:false,contents:lazyArray};}else{var properties={isDevice:false,url:url};}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents;}else if(properties.url){node.contents=null;node.url=properties.url;}Object.defineProperties(node,{usedBytes:{get:function get(){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(){FS.forceLoadFile(node);return fn.apply(void 0,arguments);};});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i];}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i);}}return size;}stream_ops.read=function(stream,buffer,offset,length,position){FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position);};stream_ops.mmap=function(stream,length,position,prot,flags){FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48);}writeChunks(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true};};node.stream_ops=stream_ops;return node;},absolutePath:function absolutePath(){abort("FS.absolutePath has been removed; use PATH_FS.resolve instead");},createFolder:function createFolder(){abort("FS.createFolder has been removed; use FS.mkdir instead");},createLink:function createLink(){abort("FS.createLink has been removed; use FS.symlink instead");},joinPath:function joinPath(){abort("FS.joinPath has been removed; use PATH.join instead");},mmapAlloc:function mmapAlloc(){abort("FS.mmapAlloc has been replaced by the top level function mmapAlloc");},standardizePath:function standardizePath(){abort("FS.standardizePath has been removed; use PATH.normalize instead");}};var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path;}var dir;if(dirfd===-100){dir=FS.cwd();}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path;}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44);}return dir;}return PATH.join2(dir,path);},doStat:function doStat(func,path,buf){var stat=func(path);HEAP32[buf/4]=stat.dev;HEAP32[(buf+4)/4]=stat.mode;HEAPU64[(buf+8)/8]=BigInt(stat.nlink);HEAP32[(buf+16)/4]=stat.uid;HEAP32[(buf+20)/4]=stat.gid;HEAP32[(buf+24)/4]=stat.rdev;HEAP64[(buf+32)/8]=BigInt(stat.size);HEAP32[(buf+40)/4]=4096;HEAP32[(buf+44)/4]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();HEAP64[(buf+48)/8]=BigInt(Math.floor(atime/1e3));HEAPU64[(buf+56)/8]=BigInt(atime%1e3*1e3);HEAP64[(buf+64)/8]=BigInt(Math.floor(mtime/1e3));HEAPU64[(buf+72)/8]=BigInt(mtime%1e3*1e3);HEAP64[(buf+80)/8]=BigInt(Math.floor(ctime/1e3));HEAPU64[(buf+88)/8]=BigInt(ctime%1e3*1e3);HEAP64[(buf+96)/8]=BigInt(stat.ino);return 0;},doMsync:function doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43);}if(flags&2){return 0;}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags);},getStreamFromFD:function getStreamFromFD(fd){var stream=FS.getStreamChecked(fd);return stream;},varargs:void 0,getStr:function getStr(ptr){var ret=UTF8ToString(ptr);return ret;}};function ___syscall_chmod(path,mode){path=bigintToI53Checked(path);try{path=SYSCALLS.getStr(path);FS.chmod(path,mode);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_dup3(fd,newfd,flags){try{var old=SYSCALLS.getStreamFromFD(fd);assert(!flags);if(old.fd===newfd)return-28;var existing=FS.getStream(newfd);if(existing)FS.close(existing);return FS.dupStream(old,newfd).fd;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_faccessat(dirfd,path,amode,flags){path=bigintToI53Checked(path);try{path=SYSCALLS.getStr(path);assert(flags===0);path=SYSCALLS.calculateAt(dirfd,path);if(amode&~7){return-28;}var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node){return-44;}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms/* otherwise, they've just passed F_OK */&&FS.nodePermissions(node,perms)){return-2;}return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fchmod(fd,mode){try{FS.fchmod(fd,mode);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fchown32(fd,owner,group){try{FS.fchown(fd,owner,group);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function syscallGetVarargP(){assert(SYSCALLS.varargs!=void 0);var ret=Number(HEAPU64[SYSCALLS.varargs/8]);SYSCALLS.varargs+=8;return ret;}function syscallGetVarargI(){assert(SYSCALLS.varargs!=void 0);var ret=HEAP32[+SYSCALLS.varargs/4];SYSCALLS.varargs+=4;return ret;}function ___syscall_fcntl64(fd,cmd,varargs){varargs=bigintToI53Checked(varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=syscallGetVarargI();if(arg<0){return-28;}while(FS.streams[arg]){arg++;}var newStream;newStream=FS.dupStream(stream,arg);return newStream.fd;}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=syscallGetVarargI();stream.flags|=arg;return 0;}case 5:{var arg=syscallGetVarargP();var offset=0;HEAP16[(arg+offset)/2]=2;return 0;}case 6:case 7:return 0;}return-28;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fstat64(fd,buf){buf=bigintToI53Checked(buf);try{var stream=SYSCALLS.getStreamFromFD(fd);return SYSCALLS.doStat(FS.stat,stream.path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_ftruncate64(fd,length){length=bigintToI53Checked(length);try{if(isNaN(length))return 61;FS.ftruncate(fd,length);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var stringToUTF8=function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);};function ___syscall_getcwd(buf,size){buf=bigintToI53Checked(buf);size=bigintToI53Checked(size);try{if(size===0)return-28;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd)+1;if(size<cwdLengthInBytes)return-68;stringToUTF8(cwd,buf,size);return cwdLengthInBytes;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_ioctl(fd,op,varargs){varargs=bigintToI53Checked(varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:{if(!stream.tty)return-59;return 0;}case 21505:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcgets){var termios=stream.tty.ops.ioctl_tcgets(stream);var argp=syscallGetVarargP();HEAP32[argp/4]=termios.c_iflag||0;HEAP32[(argp+4)/4]=termios.c_oflag||0;HEAP32[(argp+8)/4]=termios.c_cflag||0;HEAP32[(argp+12)/4]=termios.c_lflag||0;for(var i=0;i<32;i++){HEAP8[argp+i+17]=termios.c_cc[i]||0;}return 0;}return 0;}case 21510:case 21511:case 21512:{if(!stream.tty)return-59;return 0;}case 21506:case 21507:case 21508:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcsets){var argp=syscallGetVarargP();var c_iflag=HEAP32[argp/4];var c_oflag=HEAP32[(argp+4)/4];var c_cflag=HEAP32[(argp+8)/4];var c_lflag=HEAP32[(argp+12)/4];var c_cc=[];for(var i=0;i<32;i++){c_cc.push(HEAP8[argp+i+17]);}return stream.tty.ops.ioctl_tcsets(stream.tty,op,{c_iflag:c_iflag,c_oflag:c_oflag,c_cflag:c_cflag,c_lflag:c_lflag,c_cc:c_cc});}return 0;}case 21519:{if(!stream.tty)return-59;var argp=syscallGetVarargP();HEAP32[argp/4]=0;return 0;}case 21520:{if(!stream.tty)return-59;return-28;}case 21531:{var argp=syscallGetVarargP();return FS.ioctl(stream,op,argp);}case 21523:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tiocgwinsz){var winsize=stream.tty.ops.ioctl_tiocgwinsz(stream.tty);var argp=syscallGetVarargP();HEAP16[argp/2]=winsize[0];HEAP16[(argp+2)/2]=winsize[1];}return 0;}case 21524:{if(!stream.tty)return-59;return 0;}case 21515:{if(!stream.tty)return-59;return 0;}default:return-28;}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_lstat64(path,buf){path=bigintToI53Checked(path);buf=bigintToI53Checked(buf);try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.lstat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_mkdirat(dirfd,path,mode){path=bigintToI53Checked(path);try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_newfstatat(dirfd,path,buf,flags){path=bigintToI53Checked(path);buf=bigintToI53Checked(buf);try{path=SYSCALLS.getStr(path);var nofollow=flags&256;var allowEmpty=flags&4096;flags=flags&~6400;assert(!flags,"unknown flags in __syscall_newfstatat: ".concat(flags));path=SYSCALLS.calculateAt(dirfd,path,allowEmpty);return SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_openat(dirfd,path,flags,varargs){path=bigintToI53Checked(path);varargs=bigintToI53Checked(varargs);SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?syscallGetVarargI():0;return FS.open(path,flags,mode).fd;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_readlinkat(dirfd,path,buf,bufsize){path=bigintToI53Checked(path);buf=bigintToI53Checked(buf);bufsize=bigintToI53Checked(bufsize);try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_renameat(olddirfd,oldpath,newdirfd,newpath){oldpath=bigintToI53Checked(oldpath);newpath=bigintToI53Checked(newpath);try{oldpath=SYSCALLS.getStr(oldpath);newpath=SYSCALLS.getStr(newpath);oldpath=SYSCALLS.calculateAt(olddirfd,oldpath);newpath=SYSCALLS.calculateAt(newdirfd,newpath);FS.rename(oldpath,newpath);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_rmdir(path){path=bigintToI53Checked(path);try{path=SYSCALLS.getStr(path);FS.rmdir(path);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_stat64(path,buf){path=bigintToI53Checked(path);buf=bigintToI53Checked(buf);try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_unlinkat(dirfd,path,flags){path=bigintToI53Checked(path);try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(flags===0){FS.unlink(path);}else if(flags===512){FS.rmdir(path);}else{abort("Invalid flags passed to unlinkat");}return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var readI53FromI64=function readI53FromI64(ptr){return HEAPU32[ptr/4]+HEAP32[(ptr+4)/4]*4294967296;};function ___syscall_utimensat(dirfd,path,times,flags){path=bigintToI53Checked(path);times=bigintToI53Checked(times);try{path=SYSCALLS.getStr(path);assert(flags===0);path=SYSCALLS.calculateAt(dirfd,path,true);if(!times){var atime=datenow();var mtime=atime;}else{var seconds=readI53FromI64(times);var nanoseconds=HEAP32[(times+8)/4];atime=seconds*1e3+nanoseconds/(1e3*1e3);times+=16;seconds=readI53FromI64(times);nanoseconds=HEAP32[(times+8)/4];mtime=seconds*1e3+nanoseconds/(1e3*1e3);}FS.utime(path,atime,mtime);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var __abort_js=function __abort_js(){abort("native code called abort()");};var nowIsMonotonic=1;var __emscripten_get_now_is_monotonic=function __emscripten_get_now_is_monotonic(){return nowIsMonotonic;};function __emscripten_memcpy_js(dest,src,num){dest=bigintToI53Checked(dest);src=bigintToI53Checked(src);num=bigintToI53Checked(num);return HEAPU8.copyWithin(dest,src,src+num);}function __emscripten_system(command){command=bigintToI53Checked(command);if(false){if(!command)return 1;var cmdstr=UTF8ToString(command);if(!cmdstr.length)return 0;var cp=null;var ret=cp.spawnSync(cmdstr,[],{shell:true,stdio:"inherit"});var _W_EXITCODE=function _W_EXITCODE(ret2,sig){return ret2<<8|sig;};if(ret.status===null){var signalToNumber=function signalToNumber(sig){switch(sig){case"SIGHUP":return 1;case"SIGINT":return 2;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15;}return 2;};return _W_EXITCODE(0,signalToNumber(ret.signal));}return _W_EXITCODE(ret.status,0);}if(!command)return 0;return-52;}var __emscripten_throw_longjmp=function __emscripten_throw_longjmp(){throw Infinity;};function __gmtime_js(time,tmPtr){time=bigintToI53Checked(time);tmPtr=bigintToI53Checked(tmPtr);var date=new Date(time*1e3);HEAP32[tmPtr/4]=date.getUTCSeconds();HEAP32[(tmPtr+4)/4]=date.getUTCMinutes();HEAP32[(tmPtr+8)/4]=date.getUTCHours();HEAP32[(tmPtr+12)/4]=date.getUTCDate();HEAP32[(tmPtr+16)/4]=date.getUTCMonth();HEAP32[(tmPtr+20)/4]=date.getUTCFullYear()-1900;HEAP32[(tmPtr+24)/4]=date.getUTCDay();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)/4]=yday;}var isLeapYear=function isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0);};var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];var ydayFromDate=function ydayFromDate(date){var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday;};function __localtime_js(time,tmPtr){time=bigintToI53Checked(time);tmPtr=bigintToI53Checked(tmPtr);var date=new Date(time*1e3);HEAP32[tmPtr/4]=date.getSeconds();HEAP32[(tmPtr+4)/4]=date.getMinutes();HEAP32[(tmPtr+8)/4]=date.getHours();HEAP32[(tmPtr+12)/4]=date.getDate();HEAP32[(tmPtr+16)/4]=date.getMonth();HEAP32[(tmPtr+20)/4]=date.getFullYear()-1900;HEAP32[(tmPtr+24)/4]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[(tmPtr+28)/4]=yday;HEAP64[(tmPtr+40)/8]=BigInt(-(date.getTimezoneOffset()*60));var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[(tmPtr+32)/4]=dst;}var __mktime_js=function __mktime_js(tmPtr){tmPtr=bigintToI53Checked(tmPtr);var ret=function(){var date=new Date(HEAP32[(tmPtr+20)/4]+1900,HEAP32[(tmPtr+16)/4],HEAP32[(tmPtr+12)/4],HEAP32[(tmPtr+8)/4],HEAP32[(tmPtr+4)/4],HEAP32[tmPtr/4],0);var dst=HEAP32[(tmPtr+32)/4];var guessedOffset=date.getTimezoneOffset();var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dstOffset=Math.min(winterOffset,summerOffset);if(dst<0){HEAP32[(tmPtr+32)/4]=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)/4]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[(tmPtr+28)/4]=yday;HEAP32[tmPtr/4]=date.getSeconds();HEAP32[(tmPtr+4)/4]=date.getMinutes();HEAP32[(tmPtr+8)/4]=date.getHours();HEAP32[(tmPtr+12)/4]=date.getDate();HEAP32[(tmPtr+16)/4]=date.getMonth();HEAP32[(tmPtr+20)/4]=date.getYear();var timeMs=date.getTime();if(isNaN(timeMs)){return-1;}return timeMs/1e3;}();return BigInt(ret);};function __munmap_js(addr,len,prot,flags,fd,offset){addr=bigintToI53Checked(addr);len=bigintToI53Checked(len);offset=bigintToI53Checked(offset);try{var stream=SYSCALLS.getStreamFromFD(fd);if(prot&2){SYSCALLS.doMsync(addr,stream,len,flags,offset);}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var __tzset_js=function __tzset_js(timezone,daylight,std_name,dst_name){timezone=bigintToI53Checked(timezone);daylight=bigintToI53Checked(daylight);std_name=bigintToI53Checked(std_name);dst_name=bigintToI53Checked(dst_name);var currentYear=/* @__PURE__ */new Date().getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU64[timezone/8]=BigInt(stdTimezoneOffset*60);HEAP32[daylight/4]=Number(winterOffset!=summerOffset);var extractZone=function extractZone(date){return date.toLocaleTimeString(void 0,{hour12:false,timeZoneName:"short"}).split(" ")[1];};var winterName=extractZone(winter);var summerName=extractZone(summer);assert(winterName);assert(summerName);assert(lengthBytesUTF8(winterName)<=16,"timezone name truncated to fit in TZNAME_MAX (".concat(winterName,")"));assert(lengthBytesUTF8(summerName)<=16,"timezone name truncated to fit in TZNAME_MAX (".concat(summerName,")"));if(summerOffset<winterOffset){stringToUTF8(winterName,std_name,17);stringToUTF8(summerName,dst_name,17);}else{stringToUTF8(winterName,dst_name,17);stringToUTF8(summerName,std_name,17);}};var _emscripten_date_now=function _emscripten_date_now(){return datenow();};function _emscripten_err(str){str=bigintToI53Checked(str);return err(UTF8ToString(str));}var getHeapMax=function getHeapMax(){return 17179869184;};var _emscripten_get_heap_max=function _emscripten_get_heap_max(){return BigInt(getHeapMax());};var _emscripten_get_now;_emscripten_get_now=function _emscripten_get_now(){return deterministicNow();};var growMemory=function growMemory(size){var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536;try{wasmMemory.grow(pages);updateMemoryViews();return 1;}catch(e){err("growMemory: Attempted to grow heap from ".concat(b.byteLength," bytes to ").concat(size," bytes, but got error: ").concat(e));}};function _emscripten_resize_heap(requestedSize){requestedSize=bigintToI53Checked(requestedSize);var oldSize=HEAPU8.length;assert(requestedSize>oldSize);var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){err("Cannot enlarge memory, requested ".concat(requestedSize," bytes, but the limit is ").concat(maxHeapSize," bytes!"));return false;}var alignUp=function alignUp(x,multiple){return x+(multiple-x%multiple)%multiple;};for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+0.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true;}}err("Failed to grow the heap from ".concat(oldSize," bytes to ").concat(newSize," bytes, not enough memory!"));return false;}var ENV={};var getExecutableName=function getExecutableName(){return thisProgram||"./this.program";};var _getEnvStrings3=function getEnvStrings(){if(!_getEnvStrings3.strings){var lang="C.UTF-8";var env={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:lang,_:getExecutableName()};for(var x in ENV){if(ENV[x]===void 0)delete env[x];else env[x]=ENV[x];}var strings=[];for(var x in env){strings.push("".concat(x,"=").concat(env[x]));}_getEnvStrings3.strings=strings;}return _getEnvStrings3.strings;};var stringToAscii=function stringToAscii(str,buffer){for(var i=0;i<str.length;++i){assert(str.charCodeAt(i)===(str.charCodeAt(i)&255));HEAP8[buffer++]=str.charCodeAt(i);}HEAP8[buffer]=0;};var _environ_get=function _environ_get(__environ,environ_buf){__environ=bigintToI53Checked(__environ);environ_buf=bigintToI53Checked(environ_buf);var bufSize=0;_getEnvStrings3().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAPU64[(__environ+i*8)/8]=BigInt(ptr);stringToAscii(string,ptr);bufSize+=string.length+1;});return 0;};var _environ_sizes_get=function _environ_sizes_get(penviron_count,penviron_buf_size){penviron_count=bigintToI53Checked(penviron_count);penviron_buf_size=bigintToI53Checked(penviron_buf_size);var strings=_getEnvStrings3();HEAPU64[penviron_count/8]=BigInt(strings.length);var bufSize=0;strings.forEach(function(string){return bufSize+=string.length+1;});HEAPU64[penviron_buf_size/8]=BigInt(bufSize);return 0;};var runtimeKeepaliveCounter=0;var keepRuntimeAlive=function keepRuntimeAlive(){return noExitRuntime||runtimeKeepaliveCounter>0;};var _proc_exit=function _proc_exit(code){EXITSTATUS=code;if(!keepRuntimeAlive()){var _Module2$onExit3;(_Module2$onExit3=Module2["onExit"])===null||_Module2$onExit3===void 0||_Module2$onExit3.call(Module2,code);ABORT=true;}quit_(code,new ExitStatus(code));};var exitJS=function exitJS(status,implicit){EXITSTATUS=status;checkUnflushedContent();if(keepRuntimeAlive()&&!implicit){var msg="program exited (with status: ".concat(status,"), but keepRuntimeAlive() is set (counter=").concat(runtimeKeepaliveCounter,") due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)");readyPromiseReject(msg);err(msg);}_proc_exit(status);};var _exit=exitJS;function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}function _fd_fdstat_get(fd,pbuf){pbuf=bigintToI53Checked(pbuf);try{var rightsBase=0;var rightsInheriting=0;var flags=0;{var stream=SYSCALLS.getStreamFromFD(fd);var type=stream.tty?2:FS.isDir(stream.mode)?3:FS.isLink(stream.mode)?7:4;}HEAP8[pbuf]=type;HEAP16[(pbuf+2)/2]=flags;HEAP64[(pbuf+8)/8]=BigInt(rightsBase);HEAP64[(pbuf+16)/8]=BigInt(rightsInheriting);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var doReadv=function doReadv(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=Number(HEAPU64[iov/8]);var len=Number(HEAPU64[(iov+8)/8]);iov+=16;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break;if(typeof offset!="undefined"){offset+=curr;}}return ret;};function _fd_read(fd,iov,iovcnt,pnum){iov=bigintToI53Checked(iov);iovcnt=bigintToI53Checked(iovcnt);pnum=bigintToI53Checked(pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doReadv(stream,iov,iovcnt);HEAPU64[pnum/8]=BigInt(num);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}function _fd_seek(fd,offset,whence,newOffset){offset=bigintToI53Checked(offset);newOffset=bigintToI53Checked(newOffset);try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);HEAP64[newOffset/8]=BigInt(stream.position);if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var _fd_sync=function _fd_sync(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);return Asyncify.handleSleep(function(wakeUp){var mount=stream.node.mount;if(!mount.type.syncfs){wakeUp(0);return;}mount.type.syncfs(mount,false,function(err2){if(err2){wakeUp(29);return;}wakeUp(0);});});}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}};_fd_sync.isAsync=true;var doWritev=function doWritev(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=Number(HEAPU64[iov/8]);var len=Number(HEAPU64[(iov+8)/8]);iov+=16;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(typeof offset!="undefined"){offset+=curr;}}return ret;};function _fd_write(fd,iov,iovcnt,pnum){iov=bigintToI53Checked(iov);iovcnt=bigintToI53Checked(iovcnt);pnum=bigintToI53Checked(pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doWritev(stream,iov,iovcnt);HEAPU64[pnum/8]=BigInt(num);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var arraySum=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];var addDays=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;};var writeArrayToMemory=function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer);};var _strftime=function _strftime(s,maxsize,format,tm){s=bigintToI53Checked(s);maxsize=bigintToI53Checked(maxsize);format=bigintToI53Checked(format);tm=bigintToI53Checked(tm);var ret=function(){var tm_zone=Number(HEAPU64[(tm+48)/8]);var date={tm_sec:HEAP32[tm/4],tm_min:HEAP32[(tm+4)/4],tm_hour:HEAP32[(tm+8)/4],tm_mday:HEAP32[(tm+12)/4],tm_mon:HEAP32[(tm+16)/4],tm_year:HEAP32[(tm+20)/4],tm_wday:HEAP32[(tm+24)/4],tm_yday:HEAP32[(tm+28)/4],tm_isdst:HEAP32[(tm+32)/4],tm_gmtoff:HEAP64[(tm+40)/8],tm_zone:tm_zone?UTF8ToString(tm_zone):""};date.tm_gmtoff=Number(date.tm_gmtoff);var pattern=UTF8ToString(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","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var 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.length<digits){str=character[0]+str;}return str;}function leadingNulls(value,digits){return leadingSomething(value,digits,"0");}function compareByDay(date1,date2){function sgn(value){return value<0?-1:value>0?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(date2){var thisDate=addDays(new Date(date2.tm_year+1900,0,1),date2.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;}return thisDate.getFullYear();}return thisDate.getFullYear()-1;}var EXPANSION_RULES_2={"%a":function a(date2){return WEEKDAYS[date2.tm_wday].substring(0,3);},"%A":function A(date2){return WEEKDAYS[date2.tm_wday];},"%b":function b(date2){return MONTHS[date2.tm_mon].substring(0,3);},"%B":function B(date2){return MONTHS[date2.tm_mon];},"%C":function C(date2){var year=date2.tm_year+1900;return leadingNulls(year/100|0,2);},"%d":function d(date2){return leadingNulls(date2.tm_mday,2);},"%e":function e(date2){return leadingSomething(date2.tm_mday,2," ");},"%g":function g(date2){return getWeekBasedYear(date2).toString().substring(2);},"%G":getWeekBasedYear,"%H":function H(date2){return leadingNulls(date2.tm_hour,2);},"%I":function I(date2){var twelveHour=date2.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2);},"%j":function j(date2){return leadingNulls(date2.tm_mday+arraySum(isLeapYear(date2.tm_year+1900)?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,date2.tm_mon-1),3);},"%m":function m(date2){return leadingNulls(date2.tm_mon+1,2);},"%M":function M(date2){return leadingNulls(date2.tm_min,2);},"%n":function n(){return"\n";},"%p":function p(date2){if(date2.tm_hour>=0&&date2.tm_hour<12){return"AM";}return"PM";},"%S":function S(date2){return leadingNulls(date2.tm_sec,2);},"%t":function t(){return" ";},"%u":function u(date2){return date2.tm_wday||7;},"%U":function U(date2){var days=date2.tm_yday+7-date2.tm_wday;return leadingNulls(Math.floor(days/7),2);},"%V":function V(date2){var val=Math.floor((date2.tm_yday+7-(date2.tm_wday+6)%7)/7);if((date2.tm_wday+371-date2.tm_yday-2)%7<=2){val++;}if(!val){val=52;var dec31=(date2.tm_wday+7-date2.tm_yday-1)%7;if(dec31==4||dec31==5&&isLeapYear(date2.tm_year%400-1)){val++;}}else if(val==53){var jan1=(date2.tm_wday+371-date2.tm_yday)%7;if(jan1!=4&&(jan1!=3||!isLeapYear(date2.tm_year)))val=1;}return leadingNulls(val,2);},"%w":function w(date2){return date2.tm_wday;},"%W":function W(date2){var days=date2.tm_yday+7-(date2.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2);},"%y":function y(date2){return(date2.tm_year+1900).toString().substring(2);},"%Y":function Y(date2){return date2.tm_year+1900;},"%z":function z(date2){var off=date2.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4);},"%Z":function Z(date2){return date2.tm_zone;},"%%":function _(){return"%";}};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date));}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0;}writeArrayToMemory(bytes,s);return bytes.length-1;}();return BigInt(ret);};var _strftime_l=function _strftime_l(s,maxsize,format,tm,loc){s=bigintToI53Checked(s);maxsize=bigintToI53Checked(maxsize);format=bigintToI53Checked(format);tm=bigintToI53Checked(tm);loc=bigintToI53Checked(loc);var ret=function(){return _strftime(s,maxsize,format,tm);}();return BigInt(ret);};var wasmTableMirror=[];var wasmTable;var runAndAbortIfError=function runAndAbortIfError(func){try{return func();}catch(e){abort(e);}};var handleException=function handleException(e){if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS;}checkStackCookie();if(e instanceof WebAssembly.RuntimeError){if(_emscripten_stack_get_current4()<=0){err("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 41943040)");}}quit_(1,e);};var maybeExit=function maybeExit(){if(!keepRuntimeAlive()){try{_exit(EXITSTATUS);}catch(e){handleException(e);}}};var callUserCallback=function callUserCallback(func){if(ABORT){err("user callback triggered after runtime exited or application aborted. Ignoring.");return;}try{func();maybeExit();}catch(e){handleException(e);}};var runtimeKeepalivePush=function runtimeKeepalivePush(){runtimeKeepaliveCounter+=1;};var runtimeKeepalivePop=function runtimeKeepalivePop(){assert(runtimeKeepaliveCounter>0);runtimeKeepaliveCounter-=1;};var Asyncify={rewindArguments:{},instrumentWasmImports:function instrumentWasmImports(imports){var importPattern=/^(invoke_.*|__asyncjs__.*)$/;var _loop4=function _loop4(){var _Object$entries3$_i=_slicedToArray(_Object$entries3[_i7],2),x=_Object$entries3$_i[0],original=_Object$entries3$_i[1];if(typeof original=="function"){var isAsyncifyImport=original.isAsync||importPattern.test(x);imports[x]=function(){var originalAsyncifyState=Asyncify.state;try{return original.apply(void 0,arguments);}finally{var changedToDisabled=originalAsyncifyState===Asyncify.State.Normal&&Asyncify.state===Asyncify.State.Disabled;var ignoredInvoke=x.startsWith("invoke_")&&true;if(Asyncify.state!==originalAsyncifyState&&!isAsyncifyImport&&!changedToDisabled&&!ignoredInvoke){throw new Error("import ".concat(x," was not in ASYNCIFY_IMPORTS, but changed the state"));}}};}};for(var _i7=0,_Object$entries3=Object.entries(imports);_i7<_Object$entries3.length;_i7++){_loop4();}},saveOrRestoreRewindArguments:function saveOrRestoreRewindArguments(funcName,passedArguments){if(passedArguments.length===0){return Asyncify.rewindArguments[funcName]||[];}return Asyncify.rewindArguments[funcName]=Array.from(passedArguments);},instrumentWasmExports:function instrumentWasmExports(exports3){var ret={};var _loop5=function _loop5(){var _Object$entries4$_i=_slicedToArray(_Object$entries4[_i8],2),x=_Object$entries4$_i[0],original=_Object$entries4$_i[1];if(typeof original=="function"){ret[x]=function(){Asyncify.exportCallStack.push(x);try{for(var _len6=arguments.length,args=new Array(_len6),_key6=0;_key6<_len6;_key6++){args[_key6]=arguments[_key6];}return original.apply(void 0,_toConsumableArray(Asyncify.saveOrRestoreRewindArguments(x,args)));}finally{if(!ABORT){var y=Asyncify.exportCallStack.pop();assert(y===x);Asyncify.maybeStopUnwind();}}};}else{ret[x]=original;}};for(var _i8=0,_Object$entries4=Object.entries(exports3);_i8<_Object$entries4.length;_i8++){_loop5();}return ret;},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:41943040,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId:function getCallStackId(funcName){var id=Asyncify.callStackNameToId[funcName];if(id===void 0){id=Asyncify.callStackId++;Asyncify.callStackNameToId[funcName]=id;Asyncify.callStackIdToName[id]=funcName;}return id;},maybeStopUnwind:function maybeStopUnwind(){if(Asyncify.currData&&Asyncify.state===Asyncify.State.Unwinding&&Asyncify.exportCallStack.length===0){Asyncify.state=Asyncify.State.Normal;runAndAbortIfError(_asyncify_stop_unwind);if(typeof Fibers!="undefined"){Fibers.trampoline();}}},whenDone:function whenDone(){assert(Asyncify.currData,"Tried to wait for an async operation when none is in progress.");assert(!Asyncify.asyncPromiseHandlers,"Cannot have multiple async operations in flight at once");return new Promise(function(resolve,reject){Asyncify.asyncPromiseHandlers={resolve:resolve,reject:reject};});},allocateData:function allocateData(){var ptr=_malloc(24+Asyncify.StackSize);Asyncify.setDataHeader(ptr,ptr+24,Asyncify.StackSize);Asyncify.setDataRewindFunc(ptr);return ptr;},setDataHeader:function setDataHeader(ptr,stack,stackSize){HEAPU64[ptr/8]=BigInt(stack);HEAPU64[(ptr+8)/8]=BigInt(stack+stackSize);},setDataRewindFunc:function setDataRewindFunc(ptr){var bottomOfCallStack=Asyncify.exportCallStack[0];var rewindId=Asyncify.getCallStackId(bottomOfCallStack);HEAP32[(ptr+16)/4]=rewindId;},getDataRewindFunc:function getDataRewindFunc(ptr){var id=HEAP32[(ptr+16)/4];var name=Asyncify.callStackIdToName[id];var func=wasmExports[name];return func;},doRewind:function doRewind(ptr){var start=Asyncify.getDataRewindFunc(ptr);return start();},handleSleep:function handleSleep(startAsync){assert(Asyncify.state!==Asyncify.State.Disabled,"Asyncify cannot be done during or after the runtime exits");if(ABORT)return;if(Asyncify.state===Asyncify.State.Normal){var reachedCallback=false;var reachedAfterCallback=false;startAsync(function(){var handleSleepReturnValue=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;assert(!handleSleepReturnValue||typeof handleSleepReturnValue=="number"||typeof handleSleepReturnValue=="boolean");if(ABORT)return;Asyncify.handleSleepReturnValue=handleSleepReturnValue;reachedCallback=true;if(!reachedAfterCallback){return;}assert(!Asyncify.exportCallStack.length,"Waking up (starting to rewind) must be done from JS, without compiled code on the stack.");Asyncify.state=Asyncify.State.Rewinding;runAndAbortIfError(function(){return _asyncify_start_rewind(Asyncify.currData);});if(typeof Browser!="undefined"&&Browser.mainLoop.func){Browser.mainLoop.resume();}var asyncWasmReturnValue,isError=false;try{asyncWasmReturnValue=Asyncify.doRewind(Asyncify.currData);}catch(err2){asyncWasmReturnValue=err2;isError=true;}var handled=false;if(!Asyncify.currData){var asyncPromiseHandlers=Asyncify.asyncPromiseHandlers;if(asyncPromiseHandlers){Asyncify.asyncPromiseHandlers=null;(isError?asyncPromiseHandlers.reject:asyncPromiseHandlers.resolve)(asyncWasmReturnValue);handled=true;}}if(isError&&!handled){throw asyncWasmReturnValue;}});reachedAfterCallback=true;if(!reachedCallback){Asyncify.state=Asyncify.State.Unwinding;Asyncify.currData=Asyncify.allocateData();if(typeof Browser!="undefined"&&Browser.mainLoop.func){Browser.mainLoop.pause();}runAndAbortIfError(function(){return _asyncify_start_unwind(Asyncify.currData);});}}else if(Asyncify.state===Asyncify.State.Rewinding){Asyncify.state=Asyncify.State.Normal;runAndAbortIfError(_asyncify_stop_rewind);_free(Asyncify.currData);Asyncify.currData=null;Asyncify.sleepCallbacks.forEach(callUserCallback);}else{abort("invalid state: ".concat(Asyncify.state));}return Asyncify.handleSleepReturnValue;},handleAsync:function handleAsync(startAsync){return Asyncify.handleSleep(function(wakeUp){startAsync().then(wakeUp);});}};var getCFunc=function getCFunc(ident){var func=Module2["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func;};var stackAlloc=function stackAlloc(sz){return _emscripten_stack_alloc2(sz);};var stringToUTF8OnStack=function stringToUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret;};var ccall=function ccall(ident,returnType,argTypes,args,opts){var toC={pointer:function pointer(p){return BigInt(p);},string:function string(str){var ret2=0;if(str!==null&&str!==void 0&&str!==0){ret2=stringToUTF8OnStack(str);}return BigInt(ret2);},array:function array(arr){var ret2=stackAlloc(arr.length);writeArrayToMemory(arr,ret2);return BigInt(ret2);}};function convertReturnValue(ret2){if(returnType==="string"){ret2=Number(ret2);return UTF8ToString(ret2);}if(returnType==="pointer")return Number(ret2);if(returnType==="boolean")return Boolean(ret2);return ret2;}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i]);}else{cArgs[i]=args[i];}}}var previousAsync=Asyncify.currData;var ret=func.apply(void 0,cArgs);function onDone(ret2){runtimeKeepalivePop();if(stack!==0)stackRestore(stack);return convertReturnValue(ret2);}var asyncMode=opts===null||opts===void 0?void 0:opts.async;runtimeKeepalivePush();if(Asyncify.currData!=previousAsync){assert(!(previousAsync&&Asyncify.currData),"We cannot start an async operation when one is already flight");assert(!(previousAsync&&!Asyncify.currData),"We cannot stop an async operation in flight");assert(asyncMode,"The call to "+ident+" is running asynchronously. If this was intended, add the async option to the ccall/cwrap call.");return Asyncify.whenDone().then(onDone).then(function(res2){return res2;});}var res=onDone(ret);if(asyncMode)return Promise.resolve(res);return res;};var cwrap=function cwrap(ident,returnType,argTypes,opts){return function(){for(var _len7=arguments.length,args=new Array(_len7),_key7=0;_key7<_len7;_key7++){args[_key7]=arguments[_key7];}return ccall(ident,returnType,argTypes,args,opts);};};FS.createPreloadedFile=FS_createPreloadedFile;FS.staticInit();Module2["FS_createPath"]=FS.createPath;Module2["FS_createDataFile"]=FS.createDataFile;Module2["FS_createPreloadedFile"]=FS.createPreloadedFile;Module2["FS_unlink"]=FS.unlink;Module2["FS_createLazyFile"]=FS.createLazyFile;Module2["FS_createDevice"]=FS.createDevice;function checkIncomingModuleAPI(){ignoredModuleProp("fetchSettings");}var wasmImports={/** @export */__assert_fail:___assert_fail,/** @export */metering_gasUsed:metering_gasUsed,/** @export */__asyncjs__weavedrive_close:__asyncjs__weavedrive_close,/** @export */__asyncjs__weavedrive_open:__asyncjs__weavedrive_open,/** @export */__asyncjs__weavedrive_read:__asyncjs__weavedrive_read,/** @export */__cxa_throw:___cxa_throw,/** @export */__syscall_chmod:___syscall_chmod,/** @export */__syscall_dup3:___syscall_dup3,/** @export */__syscall_faccessat:___syscall_faccessat,/** @export */__syscall_fchmod:___syscall_fchmod,/** @export */__syscall_fchown32:___syscall_fchown32,/** @export */__syscall_fcntl64:___syscall_fcntl64,/** @export */__syscall_fstat64:___syscall_fstat64,/** @export */__syscall_ftruncate64:___syscall_ftruncate64,/** @export */__syscall_getcwd:___syscall_getcwd,/** @export */__syscall_ioctl:___syscall_ioctl,/** @export */__syscall_lstat64:___syscall_lstat64,/** @export */__syscall_mkdirat:___syscall_mkdirat,/** @export */__syscall_newfstatat:___syscall_newfstatat,/** @export */__syscall_openat:___syscall_openat,/** @export */__syscall_readlinkat:___syscall_readlinkat,/** @export */__syscall_renameat:___syscall_renameat,/** @export */__syscall_rmdir:___syscall_rmdir,/** @export */__syscall_stat64:___syscall_stat64,/** @export */__syscall_unlinkat:___syscall_unlinkat,/** @export */__syscall_utimensat:___syscall_utimensat,/** @export */_abort_js:__abort_js,/** @export */_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,/** @export */_emscripten_memcpy_js:__emscripten_memcpy_js,/** @export */_emscripten_system:__emscripten_system,/** @export */_emscripten_throw_longjmp:__emscripten_throw_longjmp,/** @export */_gmtime_js:__gmtime_js,/** @export */_localtime_js:__localtime_js,/** @export */_mktime_js:__mktime_js,/** @export */_munmap_js:__munmap_js,/** @export */_tzset_js:__tzset_js,/** @export */emscripten_date_now:_emscripten_date_now,/** @export */emscripten_err:_emscripten_err,/** @export */emscripten_get_heap_max:_emscripten_get_heap_max,/** @export */emscripten_get_now:_emscripten_get_now,/** @export */emscripten_resize_heap:_emscripten_resize_heap,/** @export */environ_get:_environ_get,/** @export */environ_sizes_get:_environ_sizes_get,/** @export */exit:_exit,/** @export */fd_close:_fd_close,/** @export */fd_fdstat_get:_fd_fdstat_get,/** @export */fd_read:_fd_read,/** @export */fd_seek:_fd_seek,/** @export */fd_sync:_fd_sync,/** @export */fd_write:_fd_write,/** @export */invoke_vjj:invoke_vjj,/** @export */strftime:_strftime,/** @export */strftime_l:_strftime_l};var wasmExports=createWasm();var ___wasm_call_ctors=createExportWrapper("__wasm_call_ctors",0);var _malloc=Module2["_malloc"]=createExportWrapper("malloc",1);var _handle=Module2["_handle"]=createExportWrapper("handle",2);var _main=createExportWrapper("main",2);var _free=createExportWrapper("free",1);var _fflush=createExportWrapper("fflush",1);var _emscripten_builtin_memalign=createExportWrapper("emscripten_builtin_memalign",2);var _sbrk=createExportWrapper("sbrk",1);var _setThrew=createExportWrapper("setThrew",2);var _emscripten_stack_init4=function _emscripten_stack_init(){return(_emscripten_stack_init4=wasmExports["emscripten_stack_init"])();};var _emscripten_stack_get_free4=function _emscripten_stack_get_free(){return(_emscripten_stack_get_free4=wasmExports["emscripten_stack_get_free"])();};var _emscripten_stack_get_base4=function _emscripten_stack_get_base(){return(_emscripten_stack_get_base4=wasmExports["emscripten_stack_get_base"])();};var _emscripten_stack_get_end4=function _emscripten_stack_get_end(){return(_emscripten_stack_get_end4=wasmExports["emscripten_stack_get_end"])();};var _emscripten_stack_restore2=function __emscripten_stack_restore(a0){return(_emscripten_stack_restore2=wasmExports["_emscripten_stack_restore"])(a0);};var _emscripten_stack_alloc2=function __emscripten_stack_alloc(a0){return(_emscripten_stack_alloc2=wasmExports["_emscripten_stack_alloc"])(a0);};var _emscripten_stack_get_current4=function _emscripten_stack_get_current(){return(_emscripten_stack_get_current4=wasmExports["emscripten_stack_get_current"])();};var ___cxa_is_pointer_type=createExportWrapper("__cxa_is_pointer_type",1);var dynCall_ij=Module2["dynCall_ij"]=createExportWrapper("dynCall_ij",2);var dynCall_vi=Module2["dynCall_vi"]=createExportWrapper("dynCall_vi",2);var dynCall_vjj=Module2["dynCall_vjj"]=createExportWrapper("dynCall_vjj",3);var dynCall_jjj=Module2["dynCall_jjj"]=createExportWrapper("dynCall_jjj",3);var dynCall_jjjj=Module2["dynCall_jjjj"]=createExportWrapper("dynCall_jjjj",4);var dynCall_jjjjj=Module2["dynCall_jjjjj"]=createExportWrapper("dynCall_jjjjj",5);var dynCall_ijij=Module2["dynCall_ijij"]=createExportWrapper("dynCall_ijij",4);var dynCall_ijjjj=Module2["dynCall_ijjjj"]=createExportWrapper("dynCall_ijjjj",5);var dynCall_vjij=Module2["dynCall_vjij"]=createExportWrapper("dynCall_vjij",4);var dynCall_vj=Module2["dynCall_vj"]=createExportWrapper("dynCall_vj",2);var dynCall_ijijij=Module2["dynCall_ijijij"]=createExportWrapper("dynCall_ijijij",6);var dynCall_iji=Module2["dynCall_iji"]=createExportWrapper("dynCall_iji",3);var dynCall_vjijjj=Module2["dynCall_vjijjj"]=createExportWrapper("dynCall_vjijjj",6);var dynCall_ijijj=Module2["dynCall_ijijj"]=createExportWrapper("dynCall_ijijj",5);var dynCall_i=Module2["dynCall_i"]=createExportWrapper("dynCall_i",1);var dynCall_ji=Module2["dynCall_ji"]=createExportWrapper("dynCall_ji",2);var dynCall_ijjjiji=Module2["dynCall_ijjjiji"]=createExportWrapper("dynCall_ijjjiji",7);var dynCall_vjjj=Module2["dynCall_vjjj"]=createExportWrapper("dynCall_vjjj",4);var dynCall_ijj=Module2["dynCall_ijj"]=createExportWrapper("dynCall_ijj",3);var dynCall_ijiji=Module2["dynCall_ijiji"]=createExportWrapper("dynCall_ijiji",5);var dynCall_ijiij=Module2["dynCall_ijiij"]=createExportWrapper("dynCall_ijiij",5);var dynCall_ijjji=Module2["dynCall_ijjji"]=createExportWrapper("dynCall_ijjji",5);var dynCall_ijjjjj=Module2["dynCall_ijjjjj"]=createExportWrapper("dynCall_ijjjjj",6);var dynCall_vjjjij=Module2["dynCall_vjjjij"]=createExportWrapper("dynCall_vjjjij",6);var dynCall_iijj=Module2["dynCall_iijj"]=createExportWrapper("dynCall_iijj",4);var dynCall_jj=Module2["dynCall_jj"]=createExportWrapper("dynCall_jj",2);var dynCall_vjjii=Module2["dynCall_vjjii"]=createExportWrapper("dynCall_vjjii",5);var dynCall_ijijiii=Module2["dynCall_ijijiii"]=createExportWrapper("dynCall_ijijiii",7);var dynCall_ijjj=Module2["dynCall_ijjj"]=createExportWrapper("dynCall_ijjj",4);var dynCall_ijjij=Module2["dynCall_ijjij"]=createExportWrapper("dynCall_ijjij",5);var dynCall_vjjji=Module2["dynCall_vjjji"]=createExportWrapper("dynCall_vjjji",5);var dynCall_vjjjj=Module2["dynCall_vjjjj"]=createExportWrapper("dynCall_vjjjj",5);var dynCall_vjjij=Module2["dynCall_vjjij"]=createExportWrapper("dynCall_vjjij",5);var dynCall_ijjjij=Module2["dynCall_ijjjij"]=createExportWrapper("dynCall_ijjjij",6);var dynCall_ijji=Module2["dynCall_ijji"]=createExportWrapper("dynCall_ijji",4);var dynCall_ijiiij=Module2["dynCall_ijiiij"]=createExportWrapper("dynCall_ijiiij",6);var dynCall_ijiii=Module2["dynCall_ijiii"]=createExportWrapper("dynCall_ijiii",5);var dynCall_ijii=Module2["dynCall_ijii"]=createExportWrapper("dynCall_ijii",4);var dynCall_ii=Module2["dynCall_ii"]=createExportWrapper("dynCall_ii",2);var dynCall_iij=Module2["dynCall_iij"]=createExportWrapper("dynCall_iij",3);var dynCall_iiij=Module2["dynCall_iiij"]=createExportWrapper("dynCall_iiij",4);var dynCall_jijj=Module2["dynCall_jijj"]=createExportWrapper("dynCall_jijj",4);var dynCall_iii=Module2["dynCall_iii"]=createExportWrapper("dynCall_iii",3);var dynCall_iiii=Module2["dynCall_iiii"]=createExportWrapper("dynCall_iiii",4);var dynCall_jjjiiij=Module2["dynCall_jjjiiij"]=createExportWrapper("dynCall_jjjiiij",7);var dynCall_ijjijjj=Module2["dynCall_ijjijjj"]=createExportWrapper("dynCall_ijjijjj",7);var dynCall_jji=Module2["dynCall_jji"]=createExportWrapper("dynCall_jji",3);var dynCall_ijid=Module2["dynCall_ijid"]=createExportWrapper("dynCall_ijid",4);var dynCall_dji=Module2["dynCall_dji"]=createExportWrapper("dynCall_dji",3);var dynCall_ijjijj=Module2["dynCall_ijjijj"]=createExportWrapper("dynCall_ijjijj",6);var dynCall_ijjiijjjj=Module2["dynCall_ijjiijjjj"]=createExportWrapper("dynCall_ijjiijjjj",9);var dynCall_ijjjjjj=Module2["dynCall_ijjjjjj"]=createExportWrapper("dynCall_ijjjjjj",7);var dynCall_j=Module2["dynCall_j"]=createExportWrapper("dynCall_j",1);var dynCall_vjijj=Module2["dynCall_vjijj"]=createExportWrapper("dynCall_vjijj",5);var dynCall_vjd=Module2["dynCall_vjd"]=createExportWrapper("dynCall_vjd",3);var dynCall_vjji=Module2["dynCall_vjji"]=createExportWrapper("dynCall_vjji",4);var dynCall_vji=Module2["dynCall_vji"]=createExportWrapper("dynCall_vji",3);var dynCall_jijjj=Module2["dynCall_jijjj"]=createExportWrapper("dynCall_jijjj",5);var dynCall_ijjjjjjjjj=Module2["dynCall_ijjjjjjjjj"]=createExportWrapper("dynCall_ijjjjjjjjj",10);var dynCall_v=Module2["dynCall_v"]=createExportWrapper("dynCall_v",1);var dynCall_dj=Module2["dynCall_dj"]=createExportWrapper("dynCall_dj",2);var dynCall_ijjjjjij=Module2["dynCall_ijjjjjij"]=createExportWrapper("dynCall_ijjjjjij",8);var dynCall_ijjii=Module2["dynCall_ijjii"]=createExportWrapper("dynCall_ijjii",5);var dynCall_vij=Module2["dynCall_vij"]=createExportWrapper("dynCall_vij",3);var dynCall_iijji=Module2["dynCall_iijji"]=createExportWrapper("dynCall_iijji",5);var dynCall_ijjiijjjjj=Module2["dynCall_ijjiijjjjj"]=createExportWrapper("dynCall_ijjiijjjjj",10);var dynCall_ijijji=Module2["dynCall_ijijji"]=createExportWrapper("dynCall_ijijji",6);var dynCall_vijj=Module2["dynCall_vijj"]=createExportWrapper("dynCall_vijj",4);var dynCall_ijijjj=Module2["dynCall_ijijjj"]=createExportWrapper("dynCall_ijijjj",6);var dynCall_ijijjji=Module2["dynCall_ijijjji"]=createExportWrapper("dynCall_ijijjji",7);var dynCall_vjjjji=Module2["dynCall_vjjjji"]=createExportWrapper("dynCall_vjjjji",6);var dynCall_ijjiijj=Module2["dynCall_ijjiijj"]=createExportWrapper("dynCall_ijjiijj",7);var dynCall_vjii=Module2["dynCall_vjii"]=createExportWrapper("dynCall_vjii",4);var dynCall_ijjiijjjjjj=Module2["dynCall_ijjiijjjjjj"]=createExportWrapper("dynCall_ijjiijjjjjj",11);var dynCall_jjjjij=Module2["dynCall_jjjjij"]=createExportWrapper("dynCall_jjjjij",6);var dynCall_ijjjjji=Module2["dynCall_ijjjjji"]=createExportWrapper("dynCall_ijjjjji",7);var dynCall_jjjji=Module2["dynCall_jjjji"]=createExportWrapper("dynCall_jjjji",5);var dynCall_dd=Module2["dynCall_dd"]=createExportWrapper("dynCall_dd",2);var dynCall_ddd=Module2["dynCall_ddd"]=createExportWrapper("dynCall_ddd",3);var dynCall_jiii=Module2["dynCall_jiii"]=createExportWrapper("dynCall_jiii",4);var dynCall_jjii=Module2["dynCall_jjii"]=createExportWrapper("dynCall_jjii",4);var dynCall_ijiijj=Module2["dynCall_ijiijj"]=createExportWrapper("dynCall_ijiijj",6);var dynCall_ijjijij=Module2["dynCall_ijjijij"]=createExportWrapper("dynCall_ijjijij",7);var dynCall_jjji=Module2["dynCall_jjji"]=createExportWrapper("dynCall_jjji",4);var dynCall_ijdiiii=Module2["dynCall_ijdiiii"]=createExportWrapper("dynCall_ijdiiii",7);var dynCall_vjjjii=Module2["dynCall_vjjjii"]=createExportWrapper("dynCall_vjjjii",6);var dynCall_ijjjjjjjj=Module2["dynCall_ijjjjjjjj"]=createExportWrapper("dynCall_ijjjjjjjj",9);var dynCall_jjjjjjj=Module2["dynCall_jjjjjjj"]=createExportWrapper("dynCall_jjjjjjj",7);var dynCall_jjjjii=Module2["dynCall_jjjjii"]=createExportWrapper("dynCall_jjjjii",6);var dynCall_jjjjid=Module2["dynCall_jjjjid"]=createExportWrapper("dynCall_jjjjid",6);var dynCall_jjjjijj=Module2["dynCall_jjjjijj"]=createExportWrapper("dynCall_jjjjijj",7);var dynCall_jjjjjjjii=Module2["dynCall_jjjjjjjii"]=createExportWrapper("dynCall_jjjjjjjii",9);var dynCall_jjjjijii=Module2["dynCall_jjjjijii"]=createExportWrapper("dynCall_jjjjijii",8);var dynCall_jjjjijjj=Module2["dynCall_jjjjijjj"]=createExportWrapper("dynCall_jjjjijjj",8);var dynCall_jjjijijj=Module2["dynCall_jjjijijj"]=createExportWrapper("dynCall_jjjijijj",8);var dynCall_jjjijij=Module2["dynCall_jjjijij"]=createExportWrapper("dynCall_jjjijij",7);var dynCall_vjjjiij=Module2["dynCall_vjjjiij"]=createExportWrapper("dynCall_vjjjiij",7);var dynCall_vjjjjii=Module2["dynCall_vjjjjii"]=createExportWrapper("dynCall_vjjjjii",7);var dynCall_ifj=Module2["dynCall_ifj"]=createExportWrapper("dynCall_ifj",3);var dynCall_vijjjjjji=Module2["dynCall_vijjjjjji"]=createExportWrapper("dynCall_vijjjjjji",9);var dynCall_vjjjjj=Module2["dynCall_vjjjjj"]=createExportWrapper("dynCall_vjjjjj",6);var _asyncify_start_unwind=createExportWrapper("asyncify_start_unwind",1);var _asyncify_stop_unwind=createExportWrapper("asyncify_stop_unwind",0);var _asyncify_start_rewind=createExportWrapper("asyncify_start_rewind",1);var _asyncify_stop_rewind=createExportWrapper("asyncify_stop_rewind",0);var ___start_em_js=Module2["___start_em_js"]=543408;var ___stop_em_js=Module2["___stop_em_js"]=543834;function invoke_vjj(index,a1,a2){var sp=stackSave();try{dynCall_vjj(Number(index),a1,a2);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function applySignatureConversions(wasmExports2){wasmExports2=Object.assign({},wasmExports2);var makeWrapper_pp=function makeWrapper_pp(f){return function(a0){return Number(f(BigInt(a0)));};};var makeWrapper___PP=function makeWrapper___PP(f){return function(a0,a1,a2){return f(a0,BigInt(a1?a1:0),BigInt(a2?a2:0));};};var makeWrapper__p=function makeWrapper__p(f){return function(a0){return f(BigInt(a0));};};var makeWrapper_ppp=function makeWrapper_ppp(f){return function(a0,a1){return Number(f(BigInt(a0),BigInt(a1)));};};var makeWrapper_pP=function makeWrapper_pP(f){return function(a0){return Number(f(BigInt(a0?a0:0)));};};var makeWrapper_p=function makeWrapper_p(f){return function(){return Number(f());};};wasmExports2["malloc"]=makeWrapper_pp(wasmExports2["malloc"]);wasmExports2["main"]=makeWrapper___PP(wasmExports2["main"]);wasmExports2["free"]=makeWrapper__p(wasmExports2["free"]);wasmExports2["fflush"]=makeWrapper__p(wasmExports2["fflush"]);wasmExports2["emscripten_builtin_memalign"]=makeWrapper_ppp(wasmExports2["emscripten_builtin_memalign"]);wasmExports2["sbrk"]=makeWrapper_pP(wasmExports2["sbrk"]);wasmExports2["setThrew"]=makeWrapper__p(wasmExports2["setThrew"]);wasmExports2["emscripten_stack_get_base"]=makeWrapper_p(wasmExports2["emscripten_stack_get_base"]);wasmExports2["emscripten_stack_get_end"]=makeWrapper_p(wasmExports2["emscripten_stack_get_end"]);wasmExports2["_emscripten_stack_restore"]=makeWrapper__p(wasmExports2["_emscripten_stack_restore"]);wasmExports2["_emscripten_stack_alloc"]=makeWrapper_pp(wasmExports2["_emscripten_stack_alloc"]);wasmExports2["emscripten_stack_get_current"]=makeWrapper_p(wasmExports2["emscripten_stack_get_current"]);wasmExports2["__cxa_is_pointer_type"]=makeWrapper__p(wasmExports2["__cxa_is_pointer_type"]);wasmExports2["asyncify_start_unwind"]=makeWrapper__p(wasmExports2["asyncify_start_unwind"]);wasmExports2["asyncify_start_rewind"]=makeWrapper__p(wasmExports2["asyncify_start_rewind"]);return wasmExports2;}var MAGIC=0;Math.random=function(){MAGIC=Math.pow(MAGIC+1.8912,3)%1;return MAGIC;};var TIME=1e4;function deterministicNow(){return TIME++;}datenow=deterministicNow;Module2["thisProgram"]="thisProgram";Module2["addRunDependency"]=addRunDependency;Module2["removeRunDependency"]=removeRunDependency;Module2["FS_createPath"]=FS.createPath;Module2["FS_createLazyFile"]=FS.createLazyFile;Module2["FS_createDevice"]=FS.createDevice;Module2["cwrap"]=cwrap;Module2["FS_createPreloadedFile"]=FS.createPreloadedFile;Module2["FS_createDataFile"]=FS.createDataFile;Module2["FS_unlink"]=FS.unlink;var missingLibrarySymbols=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getTempRet0","setTempRet0","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","emscriptenLog","readEmAsmArgs","jstoi_q","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","asmjsMangle","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","uleb128Encode","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","findMatchingCatch","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","demangle","stackTrace"];missingLibrarySymbols.forEach(missingLibrarySymbol);var unexportedSymbols=["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","FS_createFolder","FS_createLink","FS_readFile","out","err","callMain","abort","wasmMemory","wasmExports","writeStackCookie","checkStackCookie","readI53FromI64","MAX_INT53","MIN_INT53","bigintToI53Checked","stackSave","stackRestore","stackAlloc","ptrToString","zeroMemory","exitJS","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","arraySum","addDays","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","readEmAsmArgsArray","jstoi_s","getExecutableName","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asyncLoad","alignMemory","mmapAlloc","wasmTable","noExitRuntime","getCFunc","ccall","sigToWasmTypes","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","Browser","getPreloadedImageData__data","wget","SYSCALLS","preloadPlugins","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","runAndAbortIfError","Asyncify","Fibers","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack"];unexportedSymbols.forEach(unexportedRuntimeSymbol);var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller;};function stackCheckInit(){_emscripten_stack_init4();writeStackCookie();}function run(){if(runDependencies>0){return;}stackCheckInit();preRun();if(runDependencies>0){return;}function doRun(){if(calledRun)return;calledRun=true;Module2["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module2);if(Module2["onRuntimeInitialized"])Module2["onRuntimeInitialized"]();assert(!Module2["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun();}if(Module2["setStatus"]){Module2["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module2["setStatus"]("");},1);doRun();},1);}else{doRun();}checkStackCookie();}function checkUnflushedContent(){var oldOut=out;var oldErr=err;var has=false;out=err=function err(x){has=true;};try{_fflush(0);["stdout","stderr"].forEach(function(name){var _tty$output3;var info=FS.analyzePath("/dev/"+name);if(!info)return;var stream=info.object;var rdev=stream.rdev;var tty=TTY.ttys[rdev];if(tty!==null&&tty!==void 0&&(_tty$output3=tty.output)!==null&&_tty$output3!==void 0&&_tty$output3.length){has=true;}});}catch(e){}out=oldOut;err=oldErr;if(has){_warnOnce3("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.");}}if(Module2["preInit"]){if(typeof Module2["preInit"]=="function")Module2["preInit"]=[Module2["preInit"]];while(Module2["preInit"].length>0){Module2["preInit"].pop()();}}run();moduleRtn=readyPromise;Module2.resizeHeap=_emscripten_resize_heap;var _loop6=function _loop6(){var prop=_Object$keys5[_i9];if(!(prop in moduleArg)){Object.defineProperty(moduleArg,prop,{configurable:true,get:function get(){abort("Access to module property ('".concat(prop,"') is no longer possible via the module constructor argument; Instead, use the result of the module constructor."));}});}};for(var _i9=0,_Object$keys5=Object.keys(Module2);_i9<_Object$keys5.length;_i9++){_loop6();}return moduleRtn;};}();if(_typeof(exports2)==="object"&&_typeof(module2)==="object")module2.exports=Module;else if(typeof define==="function"&&define["amd"])define([],function(){return Module;});}});// node_modules/bn.js/lib/bn.js
59
+ var require_wasm64_emscripten=__commonJS({"src/formats/wasm64-emscripten.cjs":function src_formats_wasm64EmscriptenCjs(exports2,module2){var DEFAULT_GAS_LIMIT=9e15;var Module=function(_document$currentScri2){var _scriptName=typeof document!="undefined"?(_document$currentScri2=document.currentScript)===null||_document$currentScri2===void 0?void 0:_document$currentScri2.src:void 0;if(typeof __filename!="undefined")_scriptName||(_scriptName=__filename);return function(){var moduleArg=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var moduleRtn;var Module2=Object.assign({},moduleArg);Module2.gas={limit:Module2.computeLimit||DEFAULT_GAS_LIMIT,used:0,use:function use(amount){Module2.gas.used+=Number(amount);},refill:function refill(amount){if(!amount)Module2.gas.used=0;else Module2.gas.used=Math.max(Module2.gas.used-amount,0);},isEmpty:function isEmpty(){return Module2.gas.used>Module2.gas.limit;}};var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject;});["_malloc","_memory","___asyncjs__weavedrive_open","___asyncjs__weavedrive_read","___asyncjs__weavedrive_close","_metering_gasUsed","_handle","___indirect_function_table","onRuntimeInitialized"].forEach(function(prop){if(!Object.getOwnPropertyDescriptor(readyPromise,prop)){Object.defineProperty(readyPromise,prop,{get:function get(){return abort("You are getting "+prop+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");},set:function set(){return abort("You are setting "+prop+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}});var ENVIRONMENT_IS_WEB=(typeof window==="undefined"?"undefined":_typeof(window))=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=(typeof process==="undefined"?"undefined":_typeof(process))=="object"&&_typeof(process.versions)=="object"&&typeof process.versions.node=="string";var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module2["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");}if(ENVIRONMENT_IS_NODE){}Module2.locateFile=function(url){return url;};var moduleOverrides=Object.assign({},Module2);var arguments_=[];var thisProgram="./this.program";var quit_=function quit_(status,toThrow){throw toThrow;};var scriptDirectory="";function locateFile(path){if(Module2["locateFile"]){return Module2["locateFile"](path,scriptDirectory);}return scriptDirectory+path;}var read_,readAsync,readBinary;if(ENVIRONMENT_IS_NODE){if(typeof process=="undefined"||!process.release||process.release.name!=="node")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var nodeVersion=process.versions.node;var numericVersion=nodeVersion.split(".").slice(0,3);numericVersion=numericVersion[0]*1e4+numericVersion[1]*100+numericVersion[2].split("-")[0]*1;if(numericVersion<16e4){throw new Error("This emscripten-generated code requires node v16.0.0 (detected v"+nodeVersion+")");}var fs=_require("./fs");var nodePath=_require("path");scriptDirectory=__dirname+"/";read_=function read_(filename,binary){filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?void 0:"utf8");};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret);}assert(ret.buffer);return ret;};readAsync=function readAsync(filename,onload,onerror){var binary=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?void 0:"utf8",function(err2,data){if(err2)onerror(err2);else onload(binary?data.buffer:data);});};if(!Module2["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/");}arguments_=process.argv.slice(2);quit_=function quit_(status,toThrow){process.exitCode=status;throw toThrow;};}else if(ENVIRONMENT_IS_SHELL){if((typeof process==="undefined"?"undefined":_typeof(process))=="object"&&typeof _require==="function"||(typeof window==="undefined"?"undefined":_typeof(window))=="object"||typeof importScripts=="function")throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href;}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src;}if(_scriptName){scriptDirectory=_scriptName;}if(scriptDirectory.startsWith("blob:")){scriptDirectory="";}else{scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1);}if(!((typeof window==="undefined"?"undefined":_typeof(window))=="object"||typeof importScripts=="function"))throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");{read_=function read_(url){var xhr=new XMLHttpRequest();xhr.open("GET",url,false);xhr.send(null);return xhr.responseText;};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest();xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(/** @type{!ArrayBuffer} */xhr.response);};}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest();xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return;}onerror();};xhr.onerror=onerror;xhr.send(null);};}}else{throw new Error("environment detection error");}var out=Module2["print"]||console.log.bind(console);var err=Module2["printErr"]||console.error.bind(console);Object.assign(Module2,moduleOverrides);moduleOverrides=null;checkIncomingModuleAPI();if(Module2["arguments"])arguments_=Module2["arguments"];legacyModuleProp("arguments","arguments_");if(Module2["thisProgram"])thisProgram=Module2["thisProgram"];legacyModuleProp("thisProgram","thisProgram");if(Module2["quit"])quit_=Module2["quit"];legacyModuleProp("quit","quit_");assert(typeof Module2["memoryInitializerPrefixURL"]=="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["pthreadMainPrefixURL"]=="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["cdInitializerPrefixURL"]=="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["filePackagePrefixURL"]=="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module2["read"]=="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module2["readAsync"]=="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module2["readBinary"]=="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module2["setWindowTitle"]=="undefined","Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)");assert(typeof Module2["TOTAL_MEMORY"]=="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");legacyModuleProp("asm","wasmExports");legacyModuleProp("read","read_");legacyModuleProp("readAsync","readAsync");legacyModuleProp("readBinary","readBinary");legacyModuleProp("setWindowTitle","setWindowTitle");assert(!ENVIRONMENT_IS_SHELL,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");var wasmBinary;if(Module2["wasmBinary"])wasmBinary=Module2["wasmBinary"];legacyModuleProp("wasmBinary","wasmBinary");if((typeof WebAssembly==="undefined"?"undefined":_typeof(WebAssembly))!="object"){err("no native wasm support detected");}function intArrayFromBase64(s){if(typeof ENVIRONMENT_IS_NODE!="undefined"&&ENVIRONMENT_IS_NODE){var buf=Buffer.from(s,"base64");return new Uint8Array(buf.buffer,buf.byteOffset,buf.length);}var decoded=atob(s);var bytes=new Uint8Array(decoded.length);for(var i=0;i<decoded.length;++i){bytes[i]=decoded.charCodeAt(i);}return bytes;}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed"+(text?": "+text:""));}}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAP64,HEAPU64,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module2["HEAP8"]=HEAP8=new Int8Array(b);Module2["HEAP16"]=HEAP16=new Int16Array(b);Module2["HEAPU8"]=HEAPU8=new Uint8Array(b);Module2["HEAPU16"]=HEAPU16=new Uint16Array(b);Module2["HEAP32"]=HEAP32=new Int32Array(b);Module2["HEAPU32"]=HEAPU32=new Uint32Array(b);Module2["HEAPF32"]=HEAPF32=new Float32Array(b);Module2["HEAPF64"]=HEAPF64=new Float64Array(b);Module2["HEAP64"]=HEAP64=new BigInt64Array(b);Module2["HEAPU64"]=HEAPU64=new BigUint64Array(b);}assert(!Module2["STACK_SIZE"],"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time");assert(typeof Int32Array!="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!=void 0&&Int32Array.prototype.set!=void 0,"JS engine does not provide full typed array support");assert(!Module2["wasmMemory"],"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally");assert(!Module2["INITIAL_MEMORY"],"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically");function writeStackCookie(){var max=_emscripten_stack_get_end4();assert((max&3)==0);if(max==0){max+=4;}HEAPU32[max/4]=34821223;HEAPU32[(max+4)/4]=2310721022;HEAPU32[0/4]=1668509029;}function checkStackCookie(){if(ABORT)return;var max=_emscripten_stack_get_end4();if(max==0){max+=4;}var cookie1=HEAPU32[max/4];var cookie2=HEAPU32[(max+4)/4];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten at ".concat(ptrToString(max),", expected hex dwords 0x89BACDFE and 0x2135467, but received ").concat(ptrToString(cookie2)," ").concat(ptrToString(cookie1)));}if(HEAPU32[0/4]!=1668509029){abort("Runtime error: The application has corrupted its heap memory area (address zero)!");}};(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";})();var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module2["preRun"]){if(typeof Module2["preRun"]=="function")Module2["preRun"]=[Module2["preRun"]];while(Module2["preRun"].length){addOnPreRun(Module2["preRun"].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){assert(!runtimeInitialized);runtimeInitialized=true;checkStackCookie();if(!Module2["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__);}function postRun(){checkStackCookie();if(Module2["postRun"]){if(typeof Module2["postRun"]=="function")Module2["postRun"]=[Module2["postRun"]];while(Module2["postRun"].length){addOnPostRun(Module2["postRun"].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}function addOnInit(cb){__ATINIT__.unshift(cb);}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function getUniqueRunDependency(id){var orig=id;while(1){if(!runDependencyTracking[id])return id;id=orig+Math.random();}}function addRunDependency(id){var _Module2$monitorRunDe5;runDependencies++;(_Module2$monitorRunDe5=Module2["monitorRunDependencies"])===null||_Module2$monitorRunDe5===void 0||_Module2$monitorRunDe5.call(Module2,runDependencies);if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return;}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:");}err("dependency: ".concat(dep));}if(shown){err("(end of list)");}},1e4);}}else{err("warning: run dependency added without ID");}}function removeRunDependency(id){var _Module2$monitorRunDe6;runDependencies--;(_Module2$monitorRunDe6=Module2["monitorRunDependencies"])===null||_Module2$monitorRunDe6===void 0||_Module2$monitorRunDe6.call(Module2,runDependencies);if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id];}else{err("warning: run dependency removed without ID");}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null;}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();}}}function abort(what){var _Module2$onAbort3;(_Module2$onAbort3=Module2["onAbort"])===null||_Module2$onAbort3===void 0||_Module2$onAbort3.call(Module2,what);what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;if(what.indexOf("RuntimeError: unreachable")>=0){what+='. "unreachable" may be due to ASYNCIFY_STACK_SIZE not being large enough (try increasing it)';}var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e;}var dataURIPrefix="data:application/octet-stream;base64,";var isDataURI=function isDataURI(filename){return filename.startsWith(dataURIPrefix);};var isFileURI=function isFileURI(filename){return filename.startsWith("file://");};function createExportWrapper(name,nargs){return function(){assert(runtimeInitialized,"native function `".concat(name,"` called before runtime initialization"));var f=wasmExports[name];assert(f,"exported native function `".concat(name,"` not found"));assert(arguments.length<=nargs,"native function `".concat(name,"` called with ").concat(arguments.length," args but expects ").concat(nargs));return f.apply(void 0,arguments);};}function findWasmBinary(){var f="AOS.wasm";if(!isDataURI(f)){return locateFile(f);}return f;}var wasmBinaryFile;function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary);}if(readBinary){return readBinary(file);}throw"both async and sync fetching of the wasm failed";}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(binaryFile)){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '".concat(binaryFile,"'");}return response["arrayBuffer"]();})["catch"](function(){return getBinarySync(binaryFile);});}else if(readAsync){return new Promise(function(resolve,reject){readAsync(binaryFile,function(response){return resolve(new Uint8Array(/** @type{!ArrayBuffer} */response));},reject);});}}return Promise.resolve().then(function(){return getBinarySync(binaryFile);});}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(function(binary){return WebAssembly.instantiate(binary,imports);}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: ".concat(reason));if(isFileURI(wasmBinaryFile)){err("warning: Loading from a file URI (".concat(wasmBinaryFile,") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"));}abort(reason);});}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err("wasm streaming compile failed: ".concat(reason));err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback);});});}return instantiateArrayBuffer(binaryFile,imports,callback);}function getWasmImports(){Asyncify.instrumentWasmImports(wasmImports);return{env:wasmImports,wasi_snapshot_preview1:wasmImports,metering:{usegas:function usegas(gas){Module2.gas.use(gas);if(Module2.gas.isEmpty())throw Error("out of gas!");}}};}function createWasm(){var info=getWasmImports();function receiveInstance(instance,module3){wasmExports=instance.exports;wasmExports=Asyncify.instrumentWasmExports(wasmExports);wasmExports=applySignatureConversions(wasmExports);wasmMemory=wasmExports["memory"];assert(wasmMemory,"memory not found in wasm exports");updateMemoryViews();wasmTable=wasmExports["__indirect_function_table"];assert(wasmTable,"table not found in wasm exports");addOnInit(wasmExports["__wasm_call_ctors"]);removeRunDependency("wasm-instantiate");return wasmExports;}addRunDependency("wasm-instantiate");var trueModule=Module2;function receiveInstantiationResult(result){assert(Module2===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(result["instance"]);}if(Module2["instantiateWasm"]){try{return Module2["instantiateWasm"](info,receiveInstance);}catch(e){err("Module.instantiateWasm callback failed with error: ".concat(e));readyPromiseReject(e);}}if(!wasmBinaryFile)wasmBinaryFile=findWasmBinary();instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult)["catch"](readyPromiseReject);return{};}function legacyModuleProp(prop,newName){var incoming=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;if(!Object.getOwnPropertyDescriptor(Module2,prop)){Object.defineProperty(Module2,prop,{configurable:true,get:function get(){var extra=incoming?" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)":"";abort("`Module.".concat(prop,"` has been replaced by `").concat(newName,"`")+extra);}});}}function ignoredModuleProp(prop){if(Object.getOwnPropertyDescriptor(Module2,prop)){abort("`Module.".concat(prop,"` was supplied but `").concat(prop,"` not included in INCOMING_MODULE_JS_API"));}}function isExportedByForceFilesystem(name){return name==="FS_createPath"||name==="FS_createDataFile"||name==="FS_createPreloadedFile"||name==="FS_unlink"||name==="addRunDependency"||name==="FS_createLazyFile"||name==="FS_createDevice"||name==="removeRunDependency";}function missingGlobal(sym,msg){if(typeof globalThis!="undefined"){Object.defineProperty(globalThis,sym,{configurable:true,get:function get(){_warnOnce3("`".concat(sym,"` is not longer defined by emscripten. ").concat(msg));return void 0;}});}}missingGlobal("buffer","Please use HEAP8.buffer or wasmMemory.buffer");missingGlobal("asm","Please use wasmExports instead");function missingLibrarySymbol(sym){if(typeof globalThis!="undefined"&&!Object.getOwnPropertyDescriptor(globalThis,sym)){Object.defineProperty(globalThis,sym,{configurable:true,get:function get(){var msg="`".concat(sym,"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line");var librarySymbol=sym;if(!librarySymbol.startsWith("_")){librarySymbol="$"+sym;}msg+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='".concat(librarySymbol,"')");if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";}_warnOnce3(msg);return void 0;}});}unexportedRuntimeSymbol(sym);}function unexportedRuntimeSymbol(sym){if(!Object.getOwnPropertyDescriptor(Module2,sym)){Object.defineProperty(Module2,sym,{configurable:true,get:function get(){var msg="'".concat(sym,"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)");if(isExportedByForceFilesystem(sym)){msg+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";}abort(msg);}});}}function __asyncjs__weavedrive_open(c_filename,mode){return Asyncify.handleAsync(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(){var filename,drive,driveResponse;return _regenerator().w(function(_context4){while(1)switch(_context4.n){case 0:filename=UTF8ToString(Number(c_filename));if(Module2.WeaveDrive){_context4.n=1;break;}return _context4.a(2,Promise.resolve(null));case 1:drive=Module2.WeaveDrive(Module2,FS);_context4.n=2;return drive.open(filename);case 2:driveResponse=_context4.v;if(!(typeof driveResponse==="string")){_context4.n=3;break;}throw new Error("HALT: FILE NOT FOUND");case 3:return _context4.a(2,driveResponse);}},_callee4);})));}function __asyncjs__weavedrive_read(fd,dst_ptr,length){return Asyncify.handleAsync(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(){var drive,_t2;return _regenerator().w(function(_context5){while(1)switch(_context5.n){case 0:drive=Module2.WeaveDrive(Module2,FS);_t2=Promise;_context5.n=1;return drive.read(fd,dst_ptr,length);case 1:return _context5.a(2,_t2.resolve.call(_t2,_context5.v));}},_callee5);})));}function __asyncjs__weavedrive_close(fd){return Asyncify.handleAsync(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(){var drive;return _regenerator().w(function(_context6){while(1)switch(_context6.n){case 0:drive=Module2.WeaveDrive(Module2,FS);return _context6.a(2,drive.close(fd));}},_callee6);})));}function metering_gasUsed(){return Module2.gas.used;}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit(".concat(status,")");this.status=status;}var callRuntimeCallbacks=function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module2);}};var noExitRuntime=Module2["noExitRuntime"]||true;var ptrToString=function ptrToString(ptr){assert(typeof ptr==="number");return"0x"+ptr.toString(16).padStart(8,"0");};var stackRestore=function stackRestore(val){return _emscripten_stack_restore2(val);};var stackSave=function stackSave(){return _emscripten_stack_get_current4();};var _warnOnce3=function warnOnce(text){_warnOnce3.shown||(_warnOnce3.shown={});if(!_warnOnce3.shown[text]){_warnOnce3.shown[text]=1;if(ENVIRONMENT_IS_NODE)text="warning: "+text;err(text);}};var MAX_INT53=9007199254740992;var MIN_INT53=-9007199254740992;var bigintToI53Checked=function bigintToI53Checked(num){return num<MIN_INT53||num>MAX_INT53?NaN:Number(num);};var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;var UTF8ArrayToString=function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr));}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue;}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue;}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2;}else{if((u0&248)!=240)_warnOnce3("Invalid UTF-8 leading byte "+ptrToString(u0)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!");u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63;}if(u0<65536){str+=String.fromCharCode(u0);}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023);}}return str;};var UTF8ToString=function UTF8ToString(ptr,maxBytesToRead){assert(typeof ptr=="number","UTF8ToString expects a number (got ".concat(_typeof(ptr),")"));return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";};function ___assert_fail(condition,filename,line,func){condition=bigintToI53Checked(condition);filename=bigintToI53Checked(filename);func=bigintToI53Checked(func);abort("Assertion failed: ".concat(UTF8ToString(condition),", at: ")+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"]);}var ExceptionInfo=/*#__PURE__*/function(){function ExceptionInfo(excPtr){_classCallCheck(this,ExceptionInfo);this.excPtr=excPtr;this.ptr=excPtr-48;}return _createClass(ExceptionInfo,[{key:"set_type",value:function set_type(type){HEAPU64[(this.ptr+8)/8]=BigInt(type);}},{key:"get_type",value:function get_type(){return Number(HEAPU64[(this.ptr+8)/8]);}},{key:"set_destructor",value:function set_destructor(destructor){HEAPU64[(this.ptr+16)/8]=BigInt(destructor);}},{key:"get_destructor",value:function get_destructor(){return Number(HEAPU64[(this.ptr+16)/8]);}},{key:"set_caught",value:function set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+24]=caught;}},{key:"get_caught",value:function get_caught(){return HEAP8[this.ptr+24]!=0;}},{key:"set_rethrown",value:function set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+25]=rethrown;}},{key:"get_rethrown",value:function get_rethrown(){return HEAP8[this.ptr+25]!=0;}},{key:"init",value:function init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);}},{key:"set_adjusted_ptr",value:function set_adjusted_ptr(adjustedPtr){HEAPU64[(this.ptr+32)/8]=BigInt(adjustedPtr);}},{key:"get_adjusted_ptr",value:function get_adjusted_ptr(){return Number(HEAPU64[(this.ptr+32)/8]);}},{key:"get_exception_ptr",value:function get_exception_ptr(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return Number(HEAPU64[this.excPtr/8]);}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr;}}]);}();var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){ptr=bigintToI53Checked(ptr);type=bigintToI53Checked(type);destructor=bigintToI53Checked(destructor);var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;assert(false,"Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.");}var PATH={isAbs:function isAbs(path){return path.charAt(0)==="/";},splitPath:function splitPath(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1);},normalizeArray:function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1);}else if(last===".."){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}if(allowAboveRoot){for(;up;up--){parts.unshift("..");}}return parts;},normalize:function normalize(path){var isAbsolute=PATH.isAbs(path),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 dirname(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return".";}if(dir){dir=dir.substr(0,dir.length-1);}return root+dir;},basename:function basename(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1);},join:function join(){for(var _len5=arguments.length,paths=new Array(_len5),_key5=0;_key5<_len5;_key5++){paths[_key5]=arguments[_key5];}return PATH.normalize(paths.join("/"));},join2:function join2(l,r){return PATH.normalize(l+"/"+r);}};var initRandomFill=function initRandomFill(){if((typeof crypto==="undefined"?"undefined":_typeof(crypto))=="object"&&typeof crypto["getRandomValues"]=="function"){return function(view){return crypto.getRandomValues(view);};}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=_require("crypto");var randomFillSync=crypto_module["randomFillSync"];if(randomFillSync){return function(view){return crypto_module["randomFillSync"](view);};}var randomBytes=crypto_module["randomBytes"];return function(view){return view.set(randomBytes(view.byteLength)),view;};}catch(e){}}abort("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };");};var _randomFill3=function randomFill(view){return(_randomFill3=initRandomFill())(view);};var PATH_FS={resolve:function resolve(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?i<0||arguments.length<=i?undefined: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.isAbs(path);}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p;}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||".";},relative:function relative(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break;}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break;}if(start>end)return[];return arr.slice(start,end-start+1);}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break;}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..");}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/");}};var FS_stdin_getChar_buffer=[];var lengthBytesUTF8=function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++;}else if(c<=2047){len+=2;}else if(c>=55296&&c<=57343){len+=4;++i;}else{len+=3;}}return len;};var stringToUTF8Array=function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){assert(typeof str==="string","stringToUTF8Array expects a string (got ".concat(_typeof(str),")"));if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023;}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u;}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63;}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}else{if(outIdx+3>=endIdx)break;if(u>1114111)_warnOnce3("Invalid Unicode code point "+ptrToString(u)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}}heap[outIdx]=0;return outIdx-startIdx;};function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array;}var FS_stdin_getChar=function FS_stdin_getChar(){if(!FS_stdin_getChar_buffer.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;try{bytesRead=fs.readSync(fd,buf);}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e;}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8");}else{result=null;}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n";}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n";}}if(!result){return null;}FS_stdin_getChar_buffer=intArrayFromString(result,true);}return FS_stdin_getChar_buffer.shift();};var TTY={ttys:[],init:function init(){},shutdown:function shutdown(){},register:function register(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops);},stream_ops:{open:function open(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(43);}stream.tty=tty;stream.seekable=false;},close:function close(stream){stream.tty.ops.fsync(stream.tty);},fsync:function fsync(stream){stream.tty.ops.fsync(stream.tty);},read:function read(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(60);}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty);}catch(e){throw new FS.ErrnoError(29);}if(result===void 0&&bytesRead===0){throw new FS.ErrnoError(6);}if(result===null||result===void 0)break;bytesRead++;buffer[offset+i]=result;}if(bytesRead){stream.node.timestamp=datenow();}return bytesRead;},write:function write(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(60);}try{for(var i=0;i<length;i++){stream.tty.ops.put_char(stream.tty,buffer[offset+i]);}}catch(e){throw new FS.ErrnoError(29);}if(length){stream.node.timestamp=datenow();}return i;}},default_tty_ops:{get_char:function get_char(tty){return FS_stdin_getChar();},put_char:function put_char(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[];}else{if(val!=0)tty.output.push(val);}},fsync:function fsync(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[];}},ioctl_tcgets:function ioctl_tcgets(tty){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};},ioctl_tcsets:function ioctl_tcsets(tty,optional_actions,data){return 0;},ioctl_tiocgwinsz:function ioctl_tiocgwinsz(tty){return[24,80];}},default_tty1_ops:{put_char:function put_char(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[];}else{if(val!=0)tty.output.push(val);}},fsync:function fsync(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[];}}}};var zeroMemory=function zeroMemory(address,size){HEAPU8.fill(0,address,address+size);return address;};var alignMemory=function alignMemory(size,alignment){assert(alignment,"alignment argument is required");return Math.ceil(size/alignment)*alignment;};var mmapAlloc=function mmapAlloc(size){size=alignMemory(size,65536);var ptr=_emscripten_builtin_memalign(65536,size);if(!ptr)return 0;return zeroMemory(ptr,size);};var MEMFS={ops_table:null,mount:function mount(_mount4){return MEMFS.createNode(null,"/",16384|511,/* 0777 */0);},createNode:function createNode(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63);}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=datenow();if(parent){parent.contents[name]=node;parent.timestamp=node.timestamp;}return node;},getFileDataAsTypedArray:function getFileDataAsTypedArray(node){if(!node.contents)return new Uint8Array(0);if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents);},expandFileStorage:function expandFileStorage(node,newCapacity){var prevCapacity=node.contents?node.contents.length:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)>>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);},resizeFileStorage:function resizeFileStorage(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)));}node.usedBytes=newSize;}},node_ops:{getattr:function getattr(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096;}else if(FS.isFile(node.mode)){attr.size=node.usedBytes;}else if(FS.isLink(node.mode)){attr.size=node.link.length;}else{attr.size=0;}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr;},setattr:function setattr(node,attr){if(attr.mode!==void 0){node.mode=attr.mode;}if(attr.timestamp!==void 0){node.timestamp=attr.timestamp;}if(attr.size!==void 0){MEMFS.resizeFileStorage(node,attr.size);}},lookup:function lookup(parent,name){throw FS.genericErrors[44];},mknod:function mknod(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev);},rename:function rename(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55);}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=datenow();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir;},unlink:function unlink(parent,name){delete parent.contents[name];parent.timestamp=datenow();},rmdir:function rmdir(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55);}delete parent.contents[name];parent.timestamp=datenow();},readdir:function readdir(node){var entries=[".",".."];for(var _i6=0,_Object$keys4=Object.keys(node.contents);_i6<_Object$keys4.length;_i6++){var key=_Object$keys4[_i6];entries.push(key);}return entries;},symlink:function symlink(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511/* 0777 */|40960,0);node.link=oldpath;return node;},readlink:function readlink(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28);}return node.link;}},stream_ops:{read:function read(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset);}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i];}return size;},write:function write(stream,buffer,offset,length,position,canOwn){assert(!(buffer instanceof ArrayBuffer));if(buffer.buffer===HEAP8.buffer){canOwn=false;}if(!length)return 0;var node=stream.node;node.timestamp=datenow();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){assert(position===0,"canOwn must imply no weird position inside the file");node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length;}else if(node.usedBytes===0&&position===0){node.contents=buffer.slice(offset,offset+length);node.usedBytes=length;return length;}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length;}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray){node.contents.set(buffer.subarray(offset,offset+length),position);}else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i];}}node.usedBytes=Math.max(node.usedBytes,position+length);return length;},llseek:function llseek(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.usedBytes;}}if(position<0){throw new FS.ErrnoError(28);}return position;},allocate:function allocate(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length);},mmap:function mmap(stream,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43);}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&contents.buffer===HEAP8.buffer){allocated=false;ptr=contents.byteOffset;}else{if(position>0||position+length<contents.length){if(contents.subarray){contents=contents.subarray(position,position+length);}else{contents=Array.prototype.slice.call(contents,position,position+length);}}allocated=true;ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48);}HEAP8.set(contents,ptr);}return{ptr:ptr,allocated:allocated};},msync:function msync(stream,buffer,offset,length,mmapFlags){MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0;}}};var asyncLoad=function asyncLoad(url,onload,onerror,noRunDep){var dep=!noRunDep?getUniqueRunDependency("al ".concat(url)):"";readAsync(url,function(arrayBuffer){assert(arrayBuffer,"Loading data file \"".concat(url,"\" failed (no arrayBuffer)."));onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep);},function(event){if(onerror){onerror();}else{throw"Loading data file \"".concat(url,"\" failed.");}});if(dep)addRunDependency(dep);};var FS_createDataFile=function FS_createDataFile(parent,name,fileData,canRead,canWrite,canOwn){FS.createDataFile(parent,name,fileData,canRead,canWrite,canOwn);};var preloadPlugins=Module2["preloadPlugins"]||[];var FS_handledByPreloadPlugin=function FS_handledByPreloadPlugin(byteArray,fullname,finish,onerror){if(typeof Browser!="undefined")Browser.init();var handled=false;preloadPlugins.forEach(function(plugin){if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,onerror);handled=true;}});return handled;};var FS_createPreloadedFile=function FS_createPreloadedFile(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish){var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency("cp ".concat(fullname));function processData(byteArray){function finish(byteArray2){preFinish===null||preFinish===void 0||preFinish();if(!dontCreateFile){FS_createDataFile(parent,name,byteArray2,canRead,canWrite,canOwn);}onload===null||onload===void 0||onload();removeRunDependency(dep);}if(FS_handledByPreloadPlugin(byteArray,fullname,finish,function(){onerror===null||onerror===void 0||onerror();removeRunDependency(dep);})){return;}finish(byteArray);}addRunDependency(dep);if(typeof url=="string"){asyncLoad(url,processData,onerror);}else{processData(url);}};var FS_modeStringToFlags=function FS_modeStringToFlags(str){var flagModes={r:0,"r+":2,w:512|64|1,"w+":512|64|2,a:1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error("Unknown file open mode: ".concat(str));}return flags;};var FS_getMode=function FS_getMode(canRead,canWrite){var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode;};var ERRNO_MESSAGES={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"};var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:/*#__PURE__*/function(_Error3){function ErrnoError(errno){var _this3;_classCallCheck(this,ErrnoError);_this3=_callSuper(this,ErrnoError,[ERRNO_MESSAGES[errno]]);_this3.name="ErrnoError";_this3.errno=errno;for(var key in ERRNO_CODES){if(ERRNO_CODES[key]===errno){_this3.code=key;break;}}return _this3;}_inherits(ErrnoError,_Error3);return _createClass(ErrnoError);}(/*#__PURE__*/_wrapNativeSuper(Error)),genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:/*#__PURE__*/function(){function FSStream(){_classCallCheck(this,FSStream);this.shared={};}return _createClass(FSStream,[{key:"object",get:function get(){return this.node;},set:function set(val){this.node=val;}},{key:"isRead",get:function get(){return(this.flags&2097155)!==1;}},{key:"isWrite",get:function get(){return(this.flags&2097155)!==0;}},{key:"isAppend",get:function get(){return this.flags&1024;}},{key:"flags",get:function get(){return this.shared.flags;},set:function set(val){this.shared.flags=val;}},{key:"position",get:function get(){return this.shared.position;},set:function set(val){this.shared.position=val;}}]);}(),FSNode:/*#__PURE__*/function(){function FSNode(parent,name,mode,rdev){_classCallCheck(this,FSNode);if(!parent){parent=this;}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev;this.readMode=292/*292*/|73;this.writeMode=146;}/*146*/return _createClass(FSNode,[{key:"read",get:function get(){return(this.mode&this.readMode)===this.readMode;},set:function set(val){val?this.mode|=this.readMode:this.mode&=~this.readMode;}},{key:"write",get:function get(){return(this.mode&this.writeMode)===this.writeMode;},set:function set(val){val?this.mode|=this.writeMode:this.mode&=~this.writeMode;}},{key:"isFolder",get:function get(){return FS.isDir(this.mode);}},{key:"isDevice",get:function get(){return FS.isChrdev(this.mode);}}]);}(),lookupPath:function lookupPath(path){var opts=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};path=PATH_FS.resolve(path);if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};opts=Object.assign(defaults,opts);if(opts.recurse_count>8){throw new FS.ErrnoError(32);}var parts=path.split("/").filter(function(p){return!!p;});var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break;}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root;}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH_FS.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count+1});current=lookup.node;if(count++>40){throw new FS.ErrnoError(32);}}}}return{path:current_path,node:current};},getPath:function getPath(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?"".concat(mount,"/").concat(path):mount+path;}path=path?"".concat(node.name,"/").concat(path):node.name;node=node.parent;}},hashName:function hashName(parentid,name){var hash=0;for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0;}return(parentid+hash>>>0)%FS.nameTable.length;},hashAddNode:function hashAddNode(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node;},hashRemoveNode:function hashRemoveNode(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next;}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break;}current=current.name_next;}}},lookupNode:function lookupNode(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode);}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node;}}return FS.lookup(parent,name);},createNode:function createNode(parent,name,mode,rdev){assert(_typeof(parent)=="object");var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node;},destroyNode:function destroyNode(node){FS.hashRemoveNode(node);},isRoot:function isRoot(node){return node===node.parent;},isMountpoint:function isMountpoint(node){return!!node.mounted;},isFile:function isFile(mode){return(mode&61440)===32768;},isDir:function isDir(mode){return(mode&61440)===16384;},isLink:function isLink(mode){return(mode&61440)===40960;},isChrdev:function isChrdev(mode){return(mode&61440)===8192;},isBlkdev:function isBlkdev(mode){return(mode&61440)===24576;},isFIFO:function isFIFO(mode){return(mode&61440)===4096;},isSocket:function isSocket(mode){return(mode&49152)===49152;},flagsToPermissionString:function flagsToPermissionString(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w";}return perms;},nodePermissions:function nodePermissions(node,perms){if(FS.ignorePermissions){return 0;}if(perms.includes("r")&&!(node.mode&292)){return 2;}else if(perms.includes("w")&&!(node.mode&146)){return 2;}else if(perms.includes("x")&&!(node.mode&73)){return 2;}return 0;},mayLookup:function mayLookup(dir){if(!FS.isDir(dir.mode))return 54;var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0;},mayCreate:function mayCreate(dir,name){try{var node=FS.lookupNode(dir,name);return 20;}catch(e){}return FS.nodePermissions(dir,"wx");},mayDelete:function mayDelete(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name);}catch(e){return e.errno;}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode;}if(isdir){if(!FS.isDir(node.mode)){return 54;}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10;}}else{if(FS.isDir(node.mode)){return 31;}}return 0;},mayOpen:function mayOpen(node,flags){if(!node){return 44;}if(FS.isLink(node.mode)){return 32;}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31;}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags));},MAX_OPEN_FDS:4096,nextfd:function nextfd(){for(var fd=0;fd<=FS.MAX_OPEN_FDS;fd++){if(!FS.streams[fd]){return fd;}}throw new FS.ErrnoError(33);},getStreamChecked:function getStreamChecked(fd){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(8);}return stream;},getStream:function getStream(fd){return FS.streams[fd];},createStream:function createStream(stream){var fd=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;stream=Object.assign(new FS.FSStream(),stream);if(fd==-1){fd=FS.nextfd();}stream.fd=fd;FS.streams[fd]=stream;return stream;},closeStream:function closeStream(fd){FS.streams[fd]=null;},dupStream:function dupStream(origStream){var _stream$stream_ops6,_stream$stream_ops6$d;var fd=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var stream=FS.createStream(origStream,fd);(_stream$stream_ops6=stream.stream_ops)===null||_stream$stream_ops6===void 0||(_stream$stream_ops6$d=_stream$stream_ops6.dup)===null||_stream$stream_ops6$d===void 0||_stream$stream_ops6$d.call(_stream$stream_ops6,stream);return stream;},chrdev_stream_ops:{open:function open(stream){var _stream$stream_ops$op3,_stream$stream_ops7;var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;(_stream$stream_ops$op3=(_stream$stream_ops7=stream.stream_ops).open)===null||_stream$stream_ops$op3===void 0||_stream$stream_ops$op3.call(_stream$stream_ops7,stream);},llseek:function llseek(){throw new FS.ErrnoError(70);}},major:function major(dev){return dev>>8;},minor:function minor(dev){return dev&255;},makedev:function makedev(ma,mi){return ma<<8|mi;},registerDevice:function registerDevice(dev,ops){FS.devices[dev]={stream_ops:ops};},getDevice:function getDevice(dev){return FS.devices[dev];},getMounts:function getMounts(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,_toConsumableArray(m.mounts));}return mounts;},syncfs:function syncfs(populate,callback){if(typeof populate=="function"){callback=populate;populate=false;}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: ".concat(FS.syncFSRequests," FS.syncfs operations in flight at once, probably just doing extra work"));}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(errCode);}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode);}return;}if(++completed>=mounts.length){doCallback(null);}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null);}mount.type.syncfs(mount,populate,done);});},mount:function mount(type,opts,mountpoint){if(typeof type=="string"){throw type;}var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10);}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54);}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot;}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount);}}return mountRoot;},unmount:function unmount(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28);}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current);}current=next;}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1);},lookup:function lookup(parent,name){return parent.node_ops.lookup(parent,name);},mknod:function mknod(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28);}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63);}return parent.node_ops.mknod(parent,name,mode,dev);},create:function create(path,mode){mode=mode!==void 0?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0);},mkdir:function mkdir(path,mode){mode=mode!==void 0?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0);},mkdirTree:function mkdirTree(path,mode){var dirs=path.split("/");var d="";for(var i=0;i<dirs.length;++i){if(!dirs[i])continue;d+="/"+dirs[i];try{FS.mkdir(d,mode);}catch(e){if(e.errno!=20)throw e;}}},mkdev:function mkdev(path,mode,dev){if(typeof dev=="undefined"){dev=mode;mode=438;}mode|=8192;return FS.mknod(path,mode,dev);},symlink:function symlink(oldpath,newpath){if(!PATH_FS.resolve(oldpath)){throw new FS.ErrnoError(44);}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44);}var newname=PATH.basename(newpath);var errCode=FS.mayCreate(parent,newname);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.symlink){throw new FS.ErrnoError(63);}return parent.node_ops.symlink(parent,newname,oldpath);},rename:function rename(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node;if(!old_dir||!new_dir)throw new FS.ErrnoError(44);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(75);}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH_FS.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(28);}relative=PATH_FS.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(55);}var new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}if(old_node===new_node){return;}var isdir=FS.isDir(old_node.mode);var errCode=FS.mayDelete(old_dir,old_name,isdir);if(errCode){throw new FS.ErrnoError(errCode);}errCode=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(errCode){throw new FS.ErrnoError(errCode);}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(63);}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(10);}if(new_dir!==old_dir){errCode=FS.nodePermissions(old_dir,"w");if(errCode){throw new FS.ErrnoError(errCode);}}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name);}catch(e){throw e;}finally{FS.hashAddNode(old_node);}},rmdir:function rmdir(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,true);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(63);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);},readdir:function readdir(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(54);}return node.node_ops.readdir(node);},unlink:function unlink(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(44);}var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var errCode=FS.mayDelete(parent,name,false);if(errCode){throw new FS.ErrnoError(errCode);}if(!parent.node_ops.unlink){throw new FS.ErrnoError(63);}if(FS.isMountpoint(node)){throw new FS.ErrnoError(10);}parent.node_ops.unlink(parent,name);FS.destroyNode(node);},readlink:function readlink(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(44);}if(!link.node_ops.readlink){throw new FS.ErrnoError(28);}return PATH_FS.resolve(FS.getPath(link.parent),link.node_ops.readlink(link));},stat:function stat(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(44);}if(!node.node_ops.getattr){throw new FS.ErrnoError(63);}return node.node_ops.getattr(node);},lstat:function lstat(path){return FS.stat(path,true);},chmod:function chmod(path,mode,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:datenow()});},lchmod:function lchmod(path,mode){FS.chmod(path,mode,true);},fchmod:function fchmod(fd,mode){var stream=FS.getStreamChecked(fd);FS.chmod(stream.node,mode);},chown:function chown(path,uid,gid,dontFollow){var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}node.node_ops.setattr(node,{timestamp:datenow()});},lchown:function lchown(path,uid,gid){FS.chown(path,uid,gid,true);},fchown:function fchown(fd,uid,gid){var stream=FS.getStreamChecked(fd);FS.chown(stream.node,uid,gid);},truncate:function truncate(path,len){if(len<0){throw new FS.ErrnoError(28);}var node;if(typeof path=="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;}else{node=path;}if(!node.node_ops.setattr){throw new FS.ErrnoError(63);}if(FS.isDir(node.mode)){throw new FS.ErrnoError(31);}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(28);}var errCode=FS.nodePermissions(node,"w");if(errCode){throw new FS.ErrnoError(errCode);}node.node_ops.setattr(node,{size:len,timestamp:datenow()});},ftruncate:function ftruncate(fd,len){var stream=FS.getStreamChecked(fd);if((stream.flags&2097155)===0){throw new FS.ErrnoError(28);}FS.truncate(stream.node,len);},utime:function utime(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)});},open:function open(path,flags,mode){if(path===""){throw new FS.ErrnoError(44);}flags=typeof flags=="string"?FS_modeStringToFlags(flags):flags;mode=typeof mode=="undefined"?438:/* 0666 */mode;if(flags&64){mode=mode&4095|32768;}else{mode=0;}var node;if(_typeof(path)=="object"){node=path;}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node;}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(20);}}else{node=FS.mknod(path,mode,0);created=true;}}if(!node){throw new FS.ErrnoError(44);}if(FS.isChrdev(node.mode)){flags&=~512;}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(54);}if(!created){var errCode=FS.mayOpen(node,flags);if(errCode){throw new FS.ErrnoError(errCode);}}if(flags&512&&!created){FS.truncate(node,0);}flags&=~(128|512|131072);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false});if(stream.stream_ops.open){stream.stream_ops.open(stream);}if(Module2["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;}}return stream;},close:function close(stream){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream);}}catch(e){throw e;}finally{FS.closeStream(stream.fd);}stream.fd=null;},isClosed:function isClosed(stream){return stream.fd===null;},llseek:function llseek(stream,offset,whence){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(70);}if(whence!=0&&whence!=1&&whence!=2){throw new FS.ErrnoError(28);}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position;},read:function read(stream,buffer,offset,length,position){assert(offset>=0);if(length<0||position<0){throw new FS.ErrnoError(28);}if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if((stream.flags&2097155)===1){throw new FS.ErrnoError(8);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31);}if(!stream.stream_ops.read){throw new FS.ErrnoError(28);}var seeking=typeof position!="undefined";if(!seeking){position=stream.position;}else if(!stream.seekable){throw new FS.ErrnoError(70);}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead;},write:function write(stream,buffer,offset,length,position,canOwn){assert(offset>=0);if(length<0||position<0){throw new FS.ErrnoError(28);}if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8);}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(31);}if(!stream.stream_ops.write){throw new FS.ErrnoError(28);}if(stream.seekable&&stream.flags&1024){FS.llseek(stream,0,2);}var seeking=typeof position!="undefined";if(!seeking){position=stream.position;}else if(!stream.seekable){throw new FS.ErrnoError(70);}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;return bytesWritten;},allocate:function allocate(stream,offset,length){if(FS.isClosed(stream)){throw new FS.ErrnoError(8);}if(offset<0||length<=0){throw new FS.ErrnoError(28);}if((stream.flags&2097155)===0){throw new FS.ErrnoError(8);}if(!FS.isFile(stream.node.mode)&&!FS.isDir(stream.node.mode)){throw new FS.ErrnoError(43);}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(138);}stream.stream_ops.allocate(stream,offset,length);},mmap:function mmap(stream,length,position,prot,flags){if((prot&2)!==0&&(flags&2)===0&&(stream.flags&2097155)!==2){throw new FS.ErrnoError(2);}if((stream.flags&2097155)===1){throw new FS.ErrnoError(2);}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(43);}return stream.stream_ops.mmap(stream,length,position,prot,flags);},msync:function msync(stream,buffer,offset,length,mmapFlags){assert(offset>=0);if(!stream.stream_ops.msync){return 0;}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags);},ioctl:function ioctl(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(59);}return stream.stream_ops.ioctl(stream,cmd,arg);},readFile:function readFile(path){var opts=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};opts.flags=opts.flags||0;opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error("Invalid encoding type \"".concat(opts.encoding,"\""));}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0);}else if(opts.encoding==="binary"){ret=buf;}FS.close(stream);return ret;},writeFile:function writeFile(path,data){var opts=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};opts.flags=opts.flags||577;var stream=FS.open(path,opts.flags,opts.mode);if(typeof data=="string"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,void 0,opts.canOwn);}else if(ArrayBuffer.isView(data)){FS.write(stream,data,0,data.byteLength,void 0,opts.canOwn);}else{throw new Error("Unsupported data type");}FS.close(stream);},cwd:function cwd(){return FS.currentPath;},chdir:function chdir(path){var lookup=FS.lookupPath(path,{follow:true});if(lookup.node===null){throw new FS.ErrnoError(44);}if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(54);}var errCode=FS.nodePermissions(lookup.node,"x");if(errCode){throw new FS.ErrnoError(errCode);}FS.currentPath=lookup.path;},createDefaultDirectories:function createDefaultDirectories(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user");},createDefaultDevices:function createDefaultDevices(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:function read(){return 0;},write:function write(stream,buffer,offset,length,pos){return length;}});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var randomBuffer=new Uint8Array(1024),randomLeft=0;var randomByte=function randomByte(){if(randomLeft===0){randomLeft=_randomFill3(randomBuffer).byteLength;}return randomBuffer[--randomLeft];};FS.createDevice("/dev","random",randomByte);FS.createDevice("/dev","urandom",randomByte);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp");},createSpecialDirectories:function createSpecialDirectories(){FS.mkdir("/proc");var proc_self=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:function mount(){var node=FS.createNode(proc_self,"fd",16384|511,/* 0777 */73);node.node_ops={lookup:function lookup(parent,name){var fd=+name;var stream=FS.getStreamChecked(fd);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function readlink(){return stream.path;}}};ret.parent=ret;return ret;}};return node;}},{},"/proc/self/fd");},createStandardStreams:function createStandardStreams(){if(Module2["stdin"]){FS.createDevice("/dev","stdin",Module2["stdin"]);}else{FS.symlink("/dev/tty","/dev/stdin");}if(Module2["stdout"]){FS.createDevice("/dev","stdout",null,Module2["stdout"]);}else{FS.symlink("/dev/tty","/dev/stdout");}if(Module2["stderr"]){FS.createDevice("/dev","stderr",null,Module2["stderr"]);}else{FS.symlink("/dev/tty1","/dev/stderr");}var stdin=FS.open("/dev/stdin",0);var stdout=FS.open("/dev/stdout",1);var stderr=FS.open("/dev/stderr",1);assert(stdin.fd===0,"invalid handle for stdin (".concat(stdin.fd,")"));assert(stdout.fd===1,"invalid handle for stdout (".concat(stdout.fd,")"));assert(stderr.fd===2,"invalid handle for stderr (".concat(stderr.fd,")"));},staticInit:function staticInit(){;[44].forEach(function(code){FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>";});FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={MEMFS:MEMFS};},init:function init(input,output,error){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");FS.init.initialized=true;Module2["stdin"]=input||Module2["stdin"];Module2["stdout"]=output||Module2["stdout"];Module2["stderr"]=error||Module2["stderr"];FS.createStandardStreams();},quit:function quit(){FS.init.initialized=false;_fflush(0);for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue;}FS.close(stream);}},findObject:function findObject(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink);if(!ret.exists){return null;}return ret.object;},analyzePath:function analyzePath(path,dontResolveLastLink){try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path;}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/";}catch(e){ret.error=e.errno;}return ret;},createPath:function createPath(parent,path,canRead,canWrite){parent=typeof parent=="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current);}catch(e){}parent=current;}return current;},createFile:function createFile(parent,name,properties,canRead,canWrite){var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(canRead,canWrite);return FS.create(path,mode);},createDataFile:function createDataFile(parent,name,data,canRead,canWrite,canOwn){var path=name;if(parent){parent=typeof parent=="string"?parent:FS.getPath(parent);path=name?PATH.join2(parent,name):parent;}var mode=FS_getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data=="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr;}FS.chmod(node,mode|146);var stream=FS.open(node,577);FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode);}},createDevice:function createDevice(parent,name,input,output){var path=PATH.join2(typeof parent=="string"?parent:FS.getPath(parent),name);var mode=FS_getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:function open(stream){stream.seekable=false;},close:function close(stream){var _output$buffer3;if(output!==null&&output!==void 0&&(_output$buffer3=output.buffer)!==null&&_output$buffer3!==void 0&&_output$buffer3.length){output(10);}},read:function read(stream,buffer,offset,length,pos){var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input();}catch(e){throw new FS.ErrnoError(29);}if(result===void 0&&bytesRead===0){throw new FS.ErrnoError(6);}if(result===null||result===void 0)break;bytesRead++;buffer[offset+i]=result;}if(bytesRead){stream.node.timestamp=datenow();}return bytesRead;},write:function write(stream,buffer,offset,length,pos){for(var i=0;i<length;i++){try{output(buffer[offset+i]);}catch(e){throw new FS.ErrnoError(29);}}if(length){stream.node.timestamp=datenow();}return i;}});return FS.mkdev(path,mode,dev);},forceLoadFile:function forceLoadFile(obj){if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;if(typeof XMLHttpRequest!="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");}else if(read_){try{obj.contents=intArrayFromString(read_(obj.url),true);obj.usedBytes=obj.contents.length;}catch(e){throw new FS.ErrnoError(29);}}else{throw new Error("Cannot load without read() or XMLHttpRequest.");}},createLazyFile:function createLazyFile(parent,name,url,canRead,canWrite){var LazyUint8Array=/*#__PURE__*/function(){function LazyUint8Array(){_classCallCheck(this,LazyUint8Array);this.lengthKnown=false;this.chunks=[];}return _createClass(LazyUint8Array,[{key:"get",value:function get(idx){if(idx>this.length-1||idx<0){return void 0;}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset];}},{key:"setDataGetter",value:function setDataGetter(getter){this.getter=getter;}},{key:"cacheLength",value:function 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 doXHR(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr2=new XMLHttpRequest();xhr2.open("GET",url,false);if(datalength!==chunkSize)xhr2.setRequestHeader("Range","bytes="+from+"-"+to);xhr2.responseType="arraybuffer";if(xhr2.overrideMimeType){xhr2.overrideMimeType("text/plain; charset=x-user-defined");}xhr2.send(null);if(!(xhr2.status>=200&&xhr2.status<300||xhr2.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr2.status);if(xhr2.response!==void 0){return new Uint8Array(/** @type{Array<number>} */xhr2.response||[]);}return intArrayFromString(xhr2.responseText||"",true);};var lazyArray2=this;lazyArray2.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray2.chunks[chunkNum]=="undefined"){lazyArray2.chunks[chunkNum]=doXHR(start,end);}if(typeof lazyArray2.chunks[chunkNum]=="undefined")throw new Error("doXHR failed!");return lazyArray2.chunks[chunkNum];});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed");}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true;}},{key:"length",get:function get(){if(!this.lengthKnown){this.cacheLength();}return this._length;}},{key:"chunkSize",get:function get(){if(!this.lengthKnown){this.cacheLength();}return this._chunkSize;}}]);}();if(typeof XMLHttpRequest!="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array();var properties={isDevice:false,contents:lazyArray};}else{var properties={isDevice:false,url:url};}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents;}else if(properties.url){node.contents=null;node.url=properties.url;}Object.defineProperties(node,{usedBytes:{get:function get(){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(){FS.forceLoadFile(node);return fn.apply(void 0,arguments);};});function writeChunks(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i];}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i);}}return size;}stream_ops.read=function(stream,buffer,offset,length,position){FS.forceLoadFile(node);return writeChunks(stream,buffer,offset,length,position);};stream_ops.mmap=function(stream,length,position,prot,flags){FS.forceLoadFile(node);var ptr=mmapAlloc(length);if(!ptr){throw new FS.ErrnoError(48);}writeChunks(stream,HEAP8,ptr,length,position);return{ptr:ptr,allocated:true};};node.stream_ops=stream_ops;return node;},absolutePath:function absolutePath(){abort("FS.absolutePath has been removed; use PATH_FS.resolve instead");},createFolder:function createFolder(){abort("FS.createFolder has been removed; use FS.mkdir instead");},createLink:function createLink(){abort("FS.createLink has been removed; use FS.symlink instead");},joinPath:function joinPath(){abort("FS.joinPath has been removed; use PATH.join instead");},mmapAlloc:function mmapAlloc(){abort("FS.mmapAlloc has been replaced by the top level function mmapAlloc");},standardizePath:function standardizePath(){abort("FS.standardizePath has been removed; use PATH.normalize instead");}};var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function calculateAt(dirfd,path,allowEmpty){if(PATH.isAbs(path)){return path;}var dir;if(dirfd===-100){dir=FS.cwd();}else{var dirstream=SYSCALLS.getStreamFromFD(dirfd);dir=dirstream.path;}if(path.length==0){if(!allowEmpty){throw new FS.ErrnoError(44);}return dir;}return PATH.join2(dir,path);},doStat:function doStat(func,path,buf){var stat=func(path);HEAP32[buf/4]=stat.dev;HEAP32[(buf+4)/4]=stat.mode;HEAPU64[(buf+8)/8]=BigInt(stat.nlink);HEAP32[(buf+16)/4]=stat.uid;HEAP32[(buf+20)/4]=stat.gid;HEAP32[(buf+24)/4]=stat.rdev;HEAP64[(buf+32)/8]=BigInt(stat.size);HEAP32[(buf+40)/4]=4096;HEAP32[(buf+44)/4]=stat.blocks;var atime=stat.atime.getTime();var mtime=stat.mtime.getTime();var ctime=stat.ctime.getTime();HEAP64[(buf+48)/8]=BigInt(Math.floor(atime/1e3));HEAPU64[(buf+56)/8]=BigInt(atime%1e3*1e3);HEAP64[(buf+64)/8]=BigInt(Math.floor(mtime/1e3));HEAPU64[(buf+72)/8]=BigInt(mtime%1e3*1e3);HEAP64[(buf+80)/8]=BigInt(Math.floor(ctime/1e3));HEAPU64[(buf+88)/8]=BigInt(ctime%1e3*1e3);HEAP64[(buf+96)/8]=BigInt(stat.ino);return 0;},doMsync:function doMsync(addr,stream,len,flags,offset){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(43);}if(flags&2){return 0;}var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags);},getStreamFromFD:function getStreamFromFD(fd){var stream=FS.getStreamChecked(fd);return stream;},varargs:void 0,getStr:function getStr(ptr){var ret=UTF8ToString(ptr);return ret;}};function ___syscall_chmod(path,mode){path=bigintToI53Checked(path);try{path=SYSCALLS.getStr(path);FS.chmod(path,mode);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_dup3(fd,newfd,flags){try{var old=SYSCALLS.getStreamFromFD(fd);assert(!flags);if(old.fd===newfd)return-28;var existing=FS.getStream(newfd);if(existing)FS.close(existing);return FS.dupStream(old,newfd).fd;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_faccessat(dirfd,path,amode,flags){path=bigintToI53Checked(path);try{path=SYSCALLS.getStr(path);assert(flags===0);path=SYSCALLS.calculateAt(dirfd,path);if(amode&~7){return-28;}var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node){return-44;}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms/* otherwise, they've just passed F_OK */&&FS.nodePermissions(node,perms)){return-2;}return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fchmod(fd,mode){try{FS.fchmod(fd,mode);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fchown32(fd,owner,group){try{FS.fchown(fd,owner,group);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function syscallGetVarargP(){assert(SYSCALLS.varargs!=void 0);var ret=Number(HEAPU64[SYSCALLS.varargs/8]);SYSCALLS.varargs+=8;return ret;}function syscallGetVarargI(){assert(SYSCALLS.varargs!=void 0);var ret=HEAP32[+SYSCALLS.varargs/4];SYSCALLS.varargs+=4;return ret;}function ___syscall_fcntl64(fd,cmd,varargs){varargs=bigintToI53Checked(varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=syscallGetVarargI();if(arg<0){return-28;}while(FS.streams[arg]){arg++;}var newStream;newStream=FS.dupStream(stream,arg);return newStream.fd;}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=syscallGetVarargI();stream.flags|=arg;return 0;}case 5:{var arg=syscallGetVarargP();var offset=0;HEAP16[(arg+offset)/2]=2;return 0;}case 6:case 7:return 0;}return-28;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_fstat64(fd,buf){buf=bigintToI53Checked(buf);try{var stream=SYSCALLS.getStreamFromFD(fd);return SYSCALLS.doStat(FS.stat,stream.path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_ftruncate64(fd,length){length=bigintToI53Checked(length);try{if(isNaN(length))return 61;FS.ftruncate(fd,length);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var stringToUTF8=function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);};function ___syscall_getcwd(buf,size){buf=bigintToI53Checked(buf);size=bigintToI53Checked(size);try{if(size===0)return-28;var cwd=FS.cwd();var cwdLengthInBytes=lengthBytesUTF8(cwd)+1;if(size<cwdLengthInBytes)return-68;stringToUTF8(cwd,buf,size);return cwdLengthInBytes;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_ioctl(fd,op,varargs){varargs=bigintToI53Checked(varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:{if(!stream.tty)return-59;return 0;}case 21505:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcgets){var termios=stream.tty.ops.ioctl_tcgets(stream);var argp=syscallGetVarargP();HEAP32[argp/4]=termios.c_iflag||0;HEAP32[(argp+4)/4]=termios.c_oflag||0;HEAP32[(argp+8)/4]=termios.c_cflag||0;HEAP32[(argp+12)/4]=termios.c_lflag||0;for(var i=0;i<32;i++){HEAP8[argp+i+17]=termios.c_cc[i]||0;}return 0;}return 0;}case 21510:case 21511:case 21512:{if(!stream.tty)return-59;return 0;}case 21506:case 21507:case 21508:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tcsets){var argp=syscallGetVarargP();var c_iflag=HEAP32[argp/4];var c_oflag=HEAP32[(argp+4)/4];var c_cflag=HEAP32[(argp+8)/4];var c_lflag=HEAP32[(argp+12)/4];var c_cc=[];for(var i=0;i<32;i++){c_cc.push(HEAP8[argp+i+17]);}return stream.tty.ops.ioctl_tcsets(stream.tty,op,{c_iflag:c_iflag,c_oflag:c_oflag,c_cflag:c_cflag,c_lflag:c_lflag,c_cc:c_cc});}return 0;}case 21519:{if(!stream.tty)return-59;var argp=syscallGetVarargP();HEAP32[argp/4]=0;return 0;}case 21520:{if(!stream.tty)return-59;return-28;}case 21531:{var argp=syscallGetVarargP();return FS.ioctl(stream,op,argp);}case 21523:{if(!stream.tty)return-59;if(stream.tty.ops.ioctl_tiocgwinsz){var winsize=stream.tty.ops.ioctl_tiocgwinsz(stream.tty);var argp=syscallGetVarargP();HEAP16[argp/2]=winsize[0];HEAP16[(argp+2)/2]=winsize[1];}return 0;}case 21524:{if(!stream.tty)return-59;return 0;}case 21515:{if(!stream.tty)return-59;return 0;}default:return-28;}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_lstat64(path,buf){path=bigintToI53Checked(path);buf=bigintToI53Checked(buf);try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.lstat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_mkdirat(dirfd,path,mode){path=bigintToI53Checked(path);try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_newfstatat(dirfd,path,buf,flags){path=bigintToI53Checked(path);buf=bigintToI53Checked(buf);try{path=SYSCALLS.getStr(path);var nofollow=flags&256;var allowEmpty=flags&4096;flags=flags&~6400;assert(!flags,"unknown flags in __syscall_newfstatat: ".concat(flags));path=SYSCALLS.calculateAt(dirfd,path,allowEmpty);return SYSCALLS.doStat(nofollow?FS.lstat:FS.stat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_openat(dirfd,path,flags,varargs){path=bigintToI53Checked(path);varargs=bigintToI53Checked(varargs);SYSCALLS.varargs=varargs;try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);var mode=varargs?syscallGetVarargI():0;return FS.open(path,flags,mode).fd;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_readlinkat(dirfd,path,buf,bufsize){path=bigintToI53Checked(path);buf=bigintToI53Checked(buf);bufsize=bigintToI53Checked(bufsize);try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_renameat(olddirfd,oldpath,newdirfd,newpath){oldpath=bigintToI53Checked(oldpath);newpath=bigintToI53Checked(newpath);try{oldpath=SYSCALLS.getStr(oldpath);newpath=SYSCALLS.getStr(newpath);oldpath=SYSCALLS.calculateAt(olddirfd,oldpath);newpath=SYSCALLS.calculateAt(newdirfd,newpath);FS.rename(oldpath,newpath);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_rmdir(path){path=bigintToI53Checked(path);try{path=SYSCALLS.getStr(path);FS.rmdir(path);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_stat64(path,buf){path=bigintToI53Checked(path);buf=bigintToI53Checked(buf);try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf);}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}function ___syscall_unlinkat(dirfd,path,flags){path=bigintToI53Checked(path);try{path=SYSCALLS.getStr(path);path=SYSCALLS.calculateAt(dirfd,path);if(flags===0){FS.unlink(path);}else if(flags===512){FS.rmdir(path);}else{abort("Invalid flags passed to unlinkat");}return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var readI53FromI64=function readI53FromI64(ptr){return HEAPU32[ptr/4]+HEAP32[(ptr+4)/4]*4294967296;};function ___syscall_utimensat(dirfd,path,times,flags){path=bigintToI53Checked(path);times=bigintToI53Checked(times);try{path=SYSCALLS.getStr(path);assert(flags===0);path=SYSCALLS.calculateAt(dirfd,path,true);if(!times){var atime=datenow();var mtime=atime;}else{var seconds=readI53FromI64(times);var nanoseconds=HEAP32[(times+8)/4];atime=seconds*1e3+nanoseconds/(1e3*1e3);times+=16;seconds=readI53FromI64(times);nanoseconds=HEAP32[(times+8)/4];mtime=seconds*1e3+nanoseconds/(1e3*1e3);}FS.utime(path,atime,mtime);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var __abort_js=function __abort_js(){abort("native code called abort()");};var nowIsMonotonic=1;var __emscripten_get_now_is_monotonic=function __emscripten_get_now_is_monotonic(){return nowIsMonotonic;};function __emscripten_memcpy_js(dest,src,num){dest=bigintToI53Checked(dest);src=bigintToI53Checked(src);num=bigintToI53Checked(num);return HEAPU8.copyWithin(dest,src,src+num);}function __emscripten_system(command){command=bigintToI53Checked(command);if(false){if(!command)return 1;var cmdstr=UTF8ToString(command);if(!cmdstr.length)return 0;var cp=null;var ret=cp.spawnSync(cmdstr,[],{shell:true,stdio:"inherit"});var _W_EXITCODE=function _W_EXITCODE(ret2,sig){return ret2<<8|sig;};if(ret.status===null){var signalToNumber=function signalToNumber(sig){switch(sig){case"SIGHUP":return 1;case"SIGINT":return 2;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15;}return 2;};return _W_EXITCODE(0,signalToNumber(ret.signal));}return _W_EXITCODE(ret.status,0);}if(!command)return 0;return-52;}var __emscripten_throw_longjmp=function __emscripten_throw_longjmp(){throw Infinity;};function __gmtime_js(time,tmPtr){time=bigintToI53Checked(time);tmPtr=bigintToI53Checked(tmPtr);var date=new Date(time*1e3);HEAP32[tmPtr/4]=date.getUTCSeconds();HEAP32[(tmPtr+4)/4]=date.getUTCMinutes();HEAP32[(tmPtr+8)/4]=date.getUTCHours();HEAP32[(tmPtr+12)/4]=date.getUTCDate();HEAP32[(tmPtr+16)/4]=date.getUTCMonth();HEAP32[(tmPtr+20)/4]=date.getUTCFullYear()-1900;HEAP32[(tmPtr+24)/4]=date.getUTCDay();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)/4]=yday;}var isLeapYear=function isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0);};var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];var ydayFromDate=function ydayFromDate(date){var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday;};function __localtime_js(time,tmPtr){time=bigintToI53Checked(time);tmPtr=bigintToI53Checked(tmPtr);var date=new Date(time*1e3);HEAP32[tmPtr/4]=date.getSeconds();HEAP32[(tmPtr+4)/4]=date.getMinutes();HEAP32[(tmPtr+8)/4]=date.getHours();HEAP32[(tmPtr+12)/4]=date.getDate();HEAP32[(tmPtr+16)/4]=date.getMonth();HEAP32[(tmPtr+20)/4]=date.getFullYear()-1900;HEAP32[(tmPtr+24)/4]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[(tmPtr+28)/4]=yday;HEAP64[(tmPtr+40)/8]=BigInt(-(date.getTimezoneOffset()*60));var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[(tmPtr+32)/4]=dst;}var __mktime_js=function __mktime_js(tmPtr){tmPtr=bigintToI53Checked(tmPtr);var ret=function(){var date=new Date(HEAP32[(tmPtr+20)/4]+1900,HEAP32[(tmPtr+16)/4],HEAP32[(tmPtr+12)/4],HEAP32[(tmPtr+8)/4],HEAP32[(tmPtr+4)/4],HEAP32[tmPtr/4],0);var dst=HEAP32[(tmPtr+32)/4];var guessedOffset=date.getTimezoneOffset();var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dstOffset=Math.min(winterOffset,summerOffset);if(dst<0){HEAP32[(tmPtr+32)/4]=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)/4]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[(tmPtr+28)/4]=yday;HEAP32[tmPtr/4]=date.getSeconds();HEAP32[(tmPtr+4)/4]=date.getMinutes();HEAP32[(tmPtr+8)/4]=date.getHours();HEAP32[(tmPtr+12)/4]=date.getDate();HEAP32[(tmPtr+16)/4]=date.getMonth();HEAP32[(tmPtr+20)/4]=date.getYear();var timeMs=date.getTime();if(isNaN(timeMs)){return-1;}return timeMs/1e3;}();return BigInt(ret);};function __munmap_js(addr,len,prot,flags,fd,offset){addr=bigintToI53Checked(addr);len=bigintToI53Checked(len);offset=bigintToI53Checked(offset);try{var stream=SYSCALLS.getStreamFromFD(fd);if(prot&2){SYSCALLS.doMsync(addr,stream,len,flags,offset);}}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return-e.errno;}}var __tzset_js=function __tzset_js(timezone,daylight,std_name,dst_name){timezone=bigintToI53Checked(timezone);daylight=bigintToI53Checked(daylight);std_name=bigintToI53Checked(std_name);dst_name=bigintToI53Checked(dst_name);var currentYear=/* @__PURE__ */new Date().getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU64[timezone/8]=BigInt(stdTimezoneOffset*60);HEAP32[daylight/4]=Number(winterOffset!=summerOffset);var extractZone=function extractZone(date){return date.toLocaleTimeString(void 0,{hour12:false,timeZoneName:"short"}).split(" ")[1];};var winterName=extractZone(winter);var summerName=extractZone(summer);assert(winterName);assert(summerName);assert(lengthBytesUTF8(winterName)<=16,"timezone name truncated to fit in TZNAME_MAX (".concat(winterName,")"));assert(lengthBytesUTF8(summerName)<=16,"timezone name truncated to fit in TZNAME_MAX (".concat(summerName,")"));if(summerOffset<winterOffset){stringToUTF8(winterName,std_name,17);stringToUTF8(summerName,dst_name,17);}else{stringToUTF8(winterName,dst_name,17);stringToUTF8(summerName,std_name,17);}};var _emscripten_date_now=function _emscripten_date_now(){return datenow();};function _emscripten_err(str){str=bigintToI53Checked(str);return err(UTF8ToString(str));}var getHeapMax=function getHeapMax(){return 17179869184;};var _emscripten_get_heap_max=function _emscripten_get_heap_max(){return BigInt(getHeapMax());};var _emscripten_get_now;_emscripten_get_now=function _emscripten_get_now(){return deterministicNow();};var growMemory=function growMemory(size){var b=wasmMemory.buffer;var pages=BigInt(Math.ceil((size-b.byteLength)/65536));try{wasmMemory.grow(pages);updateMemoryViews();return 1;}catch(e){err("growMemory: Attempted to grow heap from ".concat(b.byteLength," bytes to ").concat(size," bytes, but got error: ").concat(e));}};function _emscripten_resize_heap(requestedSize){requestedSize=bigintToI53Checked(requestedSize);var oldSize=HEAPU8.length;assert(requestedSize>oldSize);var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){err("Cannot enlarge memory, requested ".concat(requestedSize," bytes, but the limit is ").concat(maxHeapSize," bytes!"));return false;}var alignUp=function alignUp(x,multiple){return x+(multiple-x%multiple)%multiple;};for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+0.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true;}}err("Failed to grow the heap from ".concat(oldSize," bytes to ").concat(newSize," bytes, not enough memory!"));return false;}var ENV={};var getExecutableName=function getExecutableName(){return thisProgram||"./this.program";};var _getEnvStrings3=function getEnvStrings(){if(!_getEnvStrings3.strings){var lang="C.UTF-8";var env={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:lang,_:getExecutableName()};for(var x in ENV){if(ENV[x]===void 0)delete env[x];else env[x]=ENV[x];}var strings=[];for(var x in env){strings.push("".concat(x,"=").concat(env[x]));}_getEnvStrings3.strings=strings;}return _getEnvStrings3.strings;};var stringToAscii=function stringToAscii(str,buffer){for(var i=0;i<str.length;++i){assert(str.charCodeAt(i)===(str.charCodeAt(i)&255));HEAP8[buffer++]=str.charCodeAt(i);}HEAP8[buffer]=0;};var _environ_get=function _environ_get(__environ,environ_buf){__environ=bigintToI53Checked(__environ);environ_buf=bigintToI53Checked(environ_buf);var bufSize=0;_getEnvStrings3().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAPU64[(__environ+i*8)/8]=BigInt(ptr);stringToAscii(string,ptr);bufSize+=string.length+1;});return 0;};var _environ_sizes_get=function _environ_sizes_get(penviron_count,penviron_buf_size){penviron_count=bigintToI53Checked(penviron_count);penviron_buf_size=bigintToI53Checked(penviron_buf_size);var strings=_getEnvStrings3();HEAPU64[penviron_count/8]=BigInt(strings.length);var bufSize=0;strings.forEach(function(string){return bufSize+=string.length+1;});HEAPU64[penviron_buf_size/8]=BigInt(bufSize);return 0;};var runtimeKeepaliveCounter=0;var keepRuntimeAlive=function keepRuntimeAlive(){return noExitRuntime||runtimeKeepaliveCounter>0;};var _proc_exit=function _proc_exit(code){EXITSTATUS=code;if(!keepRuntimeAlive()){var _Module2$onExit3;(_Module2$onExit3=Module2["onExit"])===null||_Module2$onExit3===void 0||_Module2$onExit3.call(Module2,code);ABORT=true;}quit_(code,new ExitStatus(code));};var exitJS=function exitJS(status,implicit){EXITSTATUS=status;checkUnflushedContent();if(keepRuntimeAlive()&&!implicit){var msg="program exited (with status: ".concat(status,"), but keepRuntimeAlive() is set (counter=").concat(runtimeKeepaliveCounter,") due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)");readyPromiseReject(msg);err(msg);}_proc_exit(status);};var _exit=exitJS;function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}function _fd_fdstat_get(fd,pbuf){pbuf=bigintToI53Checked(pbuf);try{var rightsBase=0;var rightsInheriting=0;var flags=0;{var stream=SYSCALLS.getStreamFromFD(fd);var type=stream.tty?2:FS.isDir(stream.mode)?3:FS.isLink(stream.mode)?7:4;}HEAP8[pbuf]=type;HEAP16[(pbuf+2)/2]=flags;HEAP64[(pbuf+8)/8]=BigInt(rightsBase);HEAP64[(pbuf+16)/8]=BigInt(rightsInheriting);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var doReadv=function doReadv(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=Number(HEAPU64[iov/8]);var len=Number(HEAPU64[(iov+8)/8]);iov+=16;var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break;if(typeof offset!="undefined"){offset+=curr;}}return ret;};function _fd_read(fd,iov,iovcnt,pnum){iov=bigintToI53Checked(iov);iovcnt=bigintToI53Checked(iovcnt);pnum=bigintToI53Checked(pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doReadv(stream,iov,iovcnt);HEAPU64[pnum/8]=BigInt(num);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}function _fd_seek(fd,offset,whence,newOffset){offset=bigintToI53Checked(offset);newOffset=bigintToI53Checked(newOffset);try{if(isNaN(offset))return 61;var stream=SYSCALLS.getStreamFromFD(fd);FS.llseek(stream,offset,whence);HEAP64[newOffset/8]=BigInt(stream.position);if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var _fd_sync=function _fd_sync(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);return Asyncify.handleSleep(function(wakeUp){var mount=stream.node.mount;if(!mount.type.syncfs){wakeUp(0);return;}mount.type.syncfs(mount,false,function(err2){if(err2){wakeUp(29);return;}wakeUp(0);});});}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}};_fd_sync.isAsync=true;var doWritev=function doWritev(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=Number(HEAPU64[iov/8]);var len=Number(HEAPU64[(iov+8)/8]);iov+=16;var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(typeof offset!="undefined"){offset+=curr;}}return ret;};function _fd_write(fd,iov,iovcnt,pnum){iov=bigintToI53Checked(iov);iovcnt=bigintToI53Checked(iovcnt);pnum=bigintToI53Checked(pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=doWritev(stream,iov,iovcnt);HEAPU64[pnum/8]=BigInt(num);return 0;}catch(e){if(typeof FS=="undefined"||!(e.name==="ErrnoError"))throw e;return e.errno;}}var arraySum=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];var addDays=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;};var writeArrayToMemory=function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer);};var _strftime=function _strftime(s,maxsize,format,tm){s=bigintToI53Checked(s);maxsize=bigintToI53Checked(maxsize);format=bigintToI53Checked(format);tm=bigintToI53Checked(tm);var ret=function(){var tm_zone=Number(HEAPU64[(tm+48)/8]);var date={tm_sec:HEAP32[tm/4],tm_min:HEAP32[(tm+4)/4],tm_hour:HEAP32[(tm+8)/4],tm_mday:HEAP32[(tm+12)/4],tm_mon:HEAP32[(tm+16)/4],tm_year:HEAP32[(tm+20)/4],tm_wday:HEAP32[(tm+24)/4],tm_yday:HEAP32[(tm+28)/4],tm_isdst:HEAP32[(tm+32)/4],tm_gmtoff:HEAP64[(tm+40)/8],tm_zone:tm_zone?UTF8ToString(tm_zone):""};date.tm_gmtoff=Number(date.tm_gmtoff);var pattern=UTF8ToString(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","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var 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.length<digits){str=character[0]+str;}return str;}function leadingNulls(value,digits){return leadingSomething(value,digits,"0");}function compareByDay(date1,date2){function sgn(value){return value<0?-1:value>0?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(date2){var thisDate=addDays(new Date(date2.tm_year+1900,0,1),date2.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;}return thisDate.getFullYear();}return thisDate.getFullYear()-1;}var EXPANSION_RULES_2={"%a":function a(date2){return WEEKDAYS[date2.tm_wday].substring(0,3);},"%A":function A(date2){return WEEKDAYS[date2.tm_wday];},"%b":function b(date2){return MONTHS[date2.tm_mon].substring(0,3);},"%B":function B(date2){return MONTHS[date2.tm_mon];},"%C":function C(date2){var year=date2.tm_year+1900;return leadingNulls(year/100|0,2);},"%d":function d(date2){return leadingNulls(date2.tm_mday,2);},"%e":function e(date2){return leadingSomething(date2.tm_mday,2," ");},"%g":function g(date2){return getWeekBasedYear(date2).toString().substring(2);},"%G":getWeekBasedYear,"%H":function H(date2){return leadingNulls(date2.tm_hour,2);},"%I":function I(date2){var twelveHour=date2.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2);},"%j":function j(date2){return leadingNulls(date2.tm_mday+arraySum(isLeapYear(date2.tm_year+1900)?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,date2.tm_mon-1),3);},"%m":function m(date2){return leadingNulls(date2.tm_mon+1,2);},"%M":function M(date2){return leadingNulls(date2.tm_min,2);},"%n":function n(){return"\n";},"%p":function p(date2){if(date2.tm_hour>=0&&date2.tm_hour<12){return"AM";}return"PM";},"%S":function S(date2){return leadingNulls(date2.tm_sec,2);},"%t":function t(){return" ";},"%u":function u(date2){return date2.tm_wday||7;},"%U":function U(date2){var days=date2.tm_yday+7-date2.tm_wday;return leadingNulls(Math.floor(days/7),2);},"%V":function V(date2){var val=Math.floor((date2.tm_yday+7-(date2.tm_wday+6)%7)/7);if((date2.tm_wday+371-date2.tm_yday-2)%7<=2){val++;}if(!val){val=52;var dec31=(date2.tm_wday+7-date2.tm_yday-1)%7;if(dec31==4||dec31==5&&isLeapYear(date2.tm_year%400-1)){val++;}}else if(val==53){var jan1=(date2.tm_wday+371-date2.tm_yday)%7;if(jan1!=4&&(jan1!=3||!isLeapYear(date2.tm_year)))val=1;}return leadingNulls(val,2);},"%w":function w(date2){return date2.tm_wday;},"%W":function W(date2){var days=date2.tm_yday+7-(date2.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2);},"%y":function y(date2){return(date2.tm_year+1900).toString().substring(2);},"%Y":function Y(date2){return date2.tm_year+1900;},"%z":function z(date2){var off=date2.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4);},"%Z":function Z(date2){return date2.tm_zone;},"%%":function _(){return"%";}};pattern=pattern.replace(/%%/g,"\0\0");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date));}}pattern=pattern.replace(/\0\0/g,"%");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0;}writeArrayToMemory(bytes,s);return bytes.length-1;}();return BigInt(ret);};var _strftime_l=function _strftime_l(s,maxsize,format,tm,loc){s=bigintToI53Checked(s);maxsize=bigintToI53Checked(maxsize);format=bigintToI53Checked(format);tm=bigintToI53Checked(tm);loc=bigintToI53Checked(loc);var ret=function(){return _strftime(s,maxsize,format,tm);}();return BigInt(ret);};var wasmTableMirror=[];var wasmTable;var runAndAbortIfError=function runAndAbortIfError(func){try{return func();}catch(e){abort(e);}};var handleException=function handleException(e){if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS;}checkStackCookie();if(e instanceof WebAssembly.RuntimeError){if(_emscripten_stack_get_current4()<=0){err("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 41943040)");}}quit_(1,e);};var maybeExit=function maybeExit(){if(!keepRuntimeAlive()){try{_exit(EXITSTATUS);}catch(e){handleException(e);}}};var callUserCallback=function callUserCallback(func){if(ABORT){err("user callback triggered after runtime exited or application aborted. Ignoring.");return;}try{func();maybeExit();}catch(e){handleException(e);}};var runtimeKeepalivePush=function runtimeKeepalivePush(){runtimeKeepaliveCounter+=1;};var runtimeKeepalivePop=function runtimeKeepalivePop(){assert(runtimeKeepaliveCounter>0);runtimeKeepaliveCounter-=1;};var Asyncify={rewindArguments:{},instrumentWasmImports:function instrumentWasmImports(imports){var importPattern=/^(invoke_.*|__asyncjs__.*)$/;var _loop4=function _loop4(){var _Object$entries3$_i=_slicedToArray(_Object$entries3[_i7],2),x=_Object$entries3$_i[0],original=_Object$entries3$_i[1];if(typeof original=="function"){var isAsyncifyImport=original.isAsync||importPattern.test(x);imports[x]=function(){var originalAsyncifyState=Asyncify.state;try{return original.apply(void 0,arguments);}finally{var changedToDisabled=originalAsyncifyState===Asyncify.State.Normal&&Asyncify.state===Asyncify.State.Disabled;var ignoredInvoke=x.startsWith("invoke_")&&true;if(Asyncify.state!==originalAsyncifyState&&!isAsyncifyImport&&!changedToDisabled&&!ignoredInvoke){throw new Error("import ".concat(x," was not in ASYNCIFY_IMPORTS, but changed the state"));}}};}};for(var _i7=0,_Object$entries3=Object.entries(imports);_i7<_Object$entries3.length;_i7++){_loop4();}},saveOrRestoreRewindArguments:function saveOrRestoreRewindArguments(funcName,passedArguments){if(passedArguments.length===0){return Asyncify.rewindArguments[funcName]||[];}return Asyncify.rewindArguments[funcName]=Array.from(passedArguments);},instrumentWasmExports:function instrumentWasmExports(exports3){var ret={};var _loop5=function _loop5(){var _Object$entries4$_i=_slicedToArray(_Object$entries4[_i8],2),x=_Object$entries4$_i[0],original=_Object$entries4$_i[1];if(typeof original=="function"){ret[x]=function(){Asyncify.exportCallStack.push(x);try{for(var _len6=arguments.length,args=new Array(_len6),_key6=0;_key6<_len6;_key6++){args[_key6]=arguments[_key6];}return original.apply(void 0,_toConsumableArray(Asyncify.saveOrRestoreRewindArguments(x,args)));}finally{if(!ABORT){var y=Asyncify.exportCallStack.pop();assert(y===x);Asyncify.maybeStopUnwind();}}};}else{ret[x]=original;}};for(var _i8=0,_Object$entries4=Object.entries(exports3);_i8<_Object$entries4.length;_i8++){_loop5();}return ret;},State:{Normal:0,Unwinding:1,Rewinding:2,Disabled:3},state:0,StackSize:41943040,currData:null,handleSleepReturnValue:0,exportCallStack:[],callStackNameToId:{},callStackIdToName:{},callStackId:0,asyncPromiseHandlers:null,sleepCallbacks:[],getCallStackId:function getCallStackId(funcName){var id=Asyncify.callStackNameToId[funcName];if(id===void 0){id=Asyncify.callStackId++;Asyncify.callStackNameToId[funcName]=id;Asyncify.callStackIdToName[id]=funcName;}return id;},maybeStopUnwind:function maybeStopUnwind(){if(Asyncify.currData&&Asyncify.state===Asyncify.State.Unwinding&&Asyncify.exportCallStack.length===0){Asyncify.state=Asyncify.State.Normal;runAndAbortIfError(_asyncify_stop_unwind);if(typeof Fibers!="undefined"){Fibers.trampoline();}}},whenDone:function whenDone(){assert(Asyncify.currData,"Tried to wait for an async operation when none is in progress.");assert(!Asyncify.asyncPromiseHandlers,"Cannot have multiple async operations in flight at once");return new Promise(function(resolve,reject){Asyncify.asyncPromiseHandlers={resolve:resolve,reject:reject};});},allocateData:function allocateData(){var ptr=_malloc(24+Asyncify.StackSize);Asyncify.setDataHeader(ptr,ptr+24,Asyncify.StackSize);Asyncify.setDataRewindFunc(ptr);return ptr;},setDataHeader:function setDataHeader(ptr,stack,stackSize){HEAPU64[ptr/8]=BigInt(stack);HEAPU64[(ptr+8)/8]=BigInt(stack+stackSize);},setDataRewindFunc:function setDataRewindFunc(ptr){var bottomOfCallStack=Asyncify.exportCallStack[0];var rewindId=Asyncify.getCallStackId(bottomOfCallStack);HEAP32[(ptr+16)/4]=rewindId;},getDataRewindFunc:function getDataRewindFunc(ptr){var id=HEAP32[(ptr+16)/4];var name=Asyncify.callStackIdToName[id];var func=wasmExports[name];return func;},doRewind:function doRewind(ptr){var start=Asyncify.getDataRewindFunc(ptr);return start();},handleSleep:function handleSleep(startAsync){assert(Asyncify.state!==Asyncify.State.Disabled,"Asyncify cannot be done during or after the runtime exits");if(ABORT)return;if(Asyncify.state===Asyncify.State.Normal){var reachedCallback=false;var reachedAfterCallback=false;startAsync(function(){var handleSleepReturnValue=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;assert(!handleSleepReturnValue||typeof handleSleepReturnValue=="number"||typeof handleSleepReturnValue=="boolean");if(ABORT)return;Asyncify.handleSleepReturnValue=handleSleepReturnValue;reachedCallback=true;if(!reachedAfterCallback){return;}assert(!Asyncify.exportCallStack.length,"Waking up (starting to rewind) must be done from JS, without compiled code on the stack.");Asyncify.state=Asyncify.State.Rewinding;runAndAbortIfError(function(){return _asyncify_start_rewind(Asyncify.currData);});if(typeof Browser!="undefined"&&Browser.mainLoop.func){Browser.mainLoop.resume();}var asyncWasmReturnValue,isError=false;try{asyncWasmReturnValue=Asyncify.doRewind(Asyncify.currData);}catch(err2){asyncWasmReturnValue=err2;isError=true;}var handled=false;if(!Asyncify.currData){var asyncPromiseHandlers=Asyncify.asyncPromiseHandlers;if(asyncPromiseHandlers){Asyncify.asyncPromiseHandlers=null;(isError?asyncPromiseHandlers.reject:asyncPromiseHandlers.resolve)(asyncWasmReturnValue);handled=true;}}if(isError&&!handled){throw asyncWasmReturnValue;}});reachedAfterCallback=true;if(!reachedCallback){Asyncify.state=Asyncify.State.Unwinding;Asyncify.currData=Asyncify.allocateData();if(typeof Browser!="undefined"&&Browser.mainLoop.func){Browser.mainLoop.pause();}runAndAbortIfError(function(){return _asyncify_start_unwind(Asyncify.currData);});}}else if(Asyncify.state===Asyncify.State.Rewinding){Asyncify.state=Asyncify.State.Normal;runAndAbortIfError(_asyncify_stop_rewind);_free(Asyncify.currData);Asyncify.currData=null;Asyncify.sleepCallbacks.forEach(callUserCallback);}else{abort("invalid state: ".concat(Asyncify.state));}return Asyncify.handleSleepReturnValue;},handleAsync:function handleAsync(startAsync){return Asyncify.handleSleep(function(wakeUp){startAsync().then(wakeUp);});}};var getCFunc=function getCFunc(ident){var func=Module2["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func;};var stackAlloc=function stackAlloc(sz){return _emscripten_stack_alloc2(sz);};var stringToUTF8OnStack=function stringToUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret;};var ccall=function ccall(ident,returnType,argTypes,args,opts){var toC={pointer:function pointer(p){return BigInt(p);},string:function string(str){var ret2=0;if(str!==null&&str!==void 0&&str!==0){ret2=stringToUTF8OnStack(str);}return BigInt(ret2);},array:function array(arr){var ret2=stackAlloc(arr.length);writeArrayToMemory(arr,ret2);return BigInt(ret2);}};function convertReturnValue(ret2){if(returnType==="string"){ret2=Number(ret2);return UTF8ToString(ret2);}if(returnType==="pointer")return Number(ret2);if(returnType==="boolean")return Boolean(ret2);return ret2;}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i]);}else{cArgs[i]=args[i];}}}var previousAsync=Asyncify.currData;var ret=func.apply(void 0,cArgs);function onDone(ret2){runtimeKeepalivePop();if(stack!==0)stackRestore(stack);return convertReturnValue(ret2);}var asyncMode=opts===null||opts===void 0?void 0:opts.async;runtimeKeepalivePush();if(Asyncify.currData!=previousAsync){assert(!(previousAsync&&Asyncify.currData),"We cannot start an async operation when one is already flight");assert(!(previousAsync&&!Asyncify.currData),"We cannot stop an async operation in flight");assert(asyncMode,"The call to "+ident+" is running asynchronously. If this was intended, add the async option to the ccall/cwrap call.");return Asyncify.whenDone().then(onDone).then(function(res2){return res2;});}var res=onDone(ret);if(asyncMode)return Promise.resolve(res);return res;};var cwrap=function cwrap(ident,returnType,argTypes,opts){return function(){for(var _len7=arguments.length,args=new Array(_len7),_key7=0;_key7<_len7;_key7++){args[_key7]=arguments[_key7];}return ccall(ident,returnType,argTypes,args,opts);};};FS.createPreloadedFile=FS_createPreloadedFile;FS.staticInit();Module2["FS_createPath"]=FS.createPath;Module2["FS_createDataFile"]=FS.createDataFile;Module2["FS_createPreloadedFile"]=FS.createPreloadedFile;Module2["FS_unlink"]=FS.unlink;Module2["FS_createLazyFile"]=FS.createLazyFile;Module2["FS_createDevice"]=FS.createDevice;function checkIncomingModuleAPI(){ignoredModuleProp("fetchSettings");}var wasmImports={/** @export */__assert_fail:___assert_fail,/** @export */metering_gasUsed:metering_gasUsed,/** @export */__asyncjs__weavedrive_close:__asyncjs__weavedrive_close,/** @export */__asyncjs__weavedrive_open:__asyncjs__weavedrive_open,/** @export */__asyncjs__weavedrive_read:__asyncjs__weavedrive_read,/** @export */__cxa_throw:___cxa_throw,/** @export */__syscall_chmod:___syscall_chmod,/** @export */__syscall_dup3:___syscall_dup3,/** @export */__syscall_faccessat:___syscall_faccessat,/** @export */__syscall_fchmod:___syscall_fchmod,/** @export */__syscall_fchown32:___syscall_fchown32,/** @export */__syscall_fcntl64:___syscall_fcntl64,/** @export */__syscall_fstat64:___syscall_fstat64,/** @export */__syscall_ftruncate64:___syscall_ftruncate64,/** @export */__syscall_getcwd:___syscall_getcwd,/** @export */__syscall_ioctl:___syscall_ioctl,/** @export */__syscall_lstat64:___syscall_lstat64,/** @export */__syscall_mkdirat:___syscall_mkdirat,/** @export */__syscall_newfstatat:___syscall_newfstatat,/** @export */__syscall_openat:___syscall_openat,/** @export */__syscall_readlinkat:___syscall_readlinkat,/** @export */__syscall_renameat:___syscall_renameat,/** @export */__syscall_rmdir:___syscall_rmdir,/** @export */__syscall_stat64:___syscall_stat64,/** @export */__syscall_unlinkat:___syscall_unlinkat,/** @export */__syscall_utimensat:___syscall_utimensat,/** @export */_abort_js:__abort_js,/** @export */_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,/** @export */_emscripten_memcpy_js:__emscripten_memcpy_js,/** @export */_emscripten_system:__emscripten_system,/** @export */_emscripten_throw_longjmp:__emscripten_throw_longjmp,/** @export */_gmtime_js:__gmtime_js,/** @export */_localtime_js:__localtime_js,/** @export */_mktime_js:__mktime_js,/** @export */_munmap_js:__munmap_js,/** @export */_tzset_js:__tzset_js,/** @export */emscripten_date_now:_emscripten_date_now,/** @export */emscripten_err:_emscripten_err,/** @export */emscripten_get_heap_max:_emscripten_get_heap_max,/** @export */emscripten_get_now:_emscripten_get_now,/** @export */emscripten_resize_heap:_emscripten_resize_heap,/** @export */environ_get:_environ_get,/** @export */environ_sizes_get:_environ_sizes_get,/** @export */exit:_exit,/** @export */fd_close:_fd_close,/** @export */fd_fdstat_get:_fd_fdstat_get,/** @export */fd_read:_fd_read,/** @export */fd_seek:_fd_seek,/** @export */fd_sync:_fd_sync,/** @export */fd_write:_fd_write,/** @export */invoke_vjj:invoke_vjj,/** @export */strftime:_strftime,/** @export */strftime_l:_strftime_l};var wasmExports=createWasm();var ___wasm_call_ctors=createExportWrapper("__wasm_call_ctors",0);var _malloc=Module2["_malloc"]=createExportWrapper("malloc",1);var _handle=Module2["_handle"]=createExportWrapper("handle",2);var _main=createExportWrapper("main",2);var _free=createExportWrapper("free",1);var _fflush=createExportWrapper("fflush",1);var _emscripten_builtin_memalign=createExportWrapper("emscripten_builtin_memalign",2);var _sbrk=createExportWrapper("sbrk",1);var _setThrew=createExportWrapper("setThrew",2);var _emscripten_stack_init4=function _emscripten_stack_init(){return(_emscripten_stack_init4=wasmExports["emscripten_stack_init"])();};var _emscripten_stack_get_free4=function _emscripten_stack_get_free(){return(_emscripten_stack_get_free4=wasmExports["emscripten_stack_get_free"])();};var _emscripten_stack_get_base4=function _emscripten_stack_get_base(){return(_emscripten_stack_get_base4=wasmExports["emscripten_stack_get_base"])();};var _emscripten_stack_get_end4=function _emscripten_stack_get_end(){return(_emscripten_stack_get_end4=wasmExports["emscripten_stack_get_end"])();};var _emscripten_stack_restore2=function __emscripten_stack_restore(a0){return(_emscripten_stack_restore2=wasmExports["_emscripten_stack_restore"])(a0);};var _emscripten_stack_alloc2=function __emscripten_stack_alloc(a0){return(_emscripten_stack_alloc2=wasmExports["_emscripten_stack_alloc"])(a0);};var _emscripten_stack_get_current4=function _emscripten_stack_get_current(){return(_emscripten_stack_get_current4=wasmExports["emscripten_stack_get_current"])();};var ___cxa_is_pointer_type=createExportWrapper("__cxa_is_pointer_type",1);var dynCall_ij=Module2["dynCall_ij"]=createExportWrapper("dynCall_ij",2);var dynCall_vi=Module2["dynCall_vi"]=createExportWrapper("dynCall_vi",2);var dynCall_vjj=Module2["dynCall_vjj"]=createExportWrapper("dynCall_vjj",3);var dynCall_jjj=Module2["dynCall_jjj"]=createExportWrapper("dynCall_jjj",3);var dynCall_jjjj=Module2["dynCall_jjjj"]=createExportWrapper("dynCall_jjjj",4);var dynCall_jjjjj=Module2["dynCall_jjjjj"]=createExportWrapper("dynCall_jjjjj",5);var dynCall_ijij=Module2["dynCall_ijij"]=createExportWrapper("dynCall_ijij",4);var dynCall_ijjjj=Module2["dynCall_ijjjj"]=createExportWrapper("dynCall_ijjjj",5);var dynCall_vjij=Module2["dynCall_vjij"]=createExportWrapper("dynCall_vjij",4);var dynCall_vj=Module2["dynCall_vj"]=createExportWrapper("dynCall_vj",2);var dynCall_ijijij=Module2["dynCall_ijijij"]=createExportWrapper("dynCall_ijijij",6);var dynCall_iji=Module2["dynCall_iji"]=createExportWrapper("dynCall_iji",3);var dynCall_vjijjj=Module2["dynCall_vjijjj"]=createExportWrapper("dynCall_vjijjj",6);var dynCall_ijijj=Module2["dynCall_ijijj"]=createExportWrapper("dynCall_ijijj",5);var dynCall_i=Module2["dynCall_i"]=createExportWrapper("dynCall_i",1);var dynCall_ji=Module2["dynCall_ji"]=createExportWrapper("dynCall_ji",2);var dynCall_ijjjiji=Module2["dynCall_ijjjiji"]=createExportWrapper("dynCall_ijjjiji",7);var dynCall_vjjj=Module2["dynCall_vjjj"]=createExportWrapper("dynCall_vjjj",4);var dynCall_ijj=Module2["dynCall_ijj"]=createExportWrapper("dynCall_ijj",3);var dynCall_ijiji=Module2["dynCall_ijiji"]=createExportWrapper("dynCall_ijiji",5);var dynCall_ijiij=Module2["dynCall_ijiij"]=createExportWrapper("dynCall_ijiij",5);var dynCall_ijjji=Module2["dynCall_ijjji"]=createExportWrapper("dynCall_ijjji",5);var dynCall_ijjjjj=Module2["dynCall_ijjjjj"]=createExportWrapper("dynCall_ijjjjj",6);var dynCall_vjjjij=Module2["dynCall_vjjjij"]=createExportWrapper("dynCall_vjjjij",6);var dynCall_iijj=Module2["dynCall_iijj"]=createExportWrapper("dynCall_iijj",4);var dynCall_jj=Module2["dynCall_jj"]=createExportWrapper("dynCall_jj",2);var dynCall_vjjii=Module2["dynCall_vjjii"]=createExportWrapper("dynCall_vjjii",5);var dynCall_ijijiii=Module2["dynCall_ijijiii"]=createExportWrapper("dynCall_ijijiii",7);var dynCall_ijjj=Module2["dynCall_ijjj"]=createExportWrapper("dynCall_ijjj",4);var dynCall_ijjij=Module2["dynCall_ijjij"]=createExportWrapper("dynCall_ijjij",5);var dynCall_vjjji=Module2["dynCall_vjjji"]=createExportWrapper("dynCall_vjjji",5);var dynCall_vjjjj=Module2["dynCall_vjjjj"]=createExportWrapper("dynCall_vjjjj",5);var dynCall_vjjij=Module2["dynCall_vjjij"]=createExportWrapper("dynCall_vjjij",5);var dynCall_ijjjij=Module2["dynCall_ijjjij"]=createExportWrapper("dynCall_ijjjij",6);var dynCall_ijji=Module2["dynCall_ijji"]=createExportWrapper("dynCall_ijji",4);var dynCall_ijiiij=Module2["dynCall_ijiiij"]=createExportWrapper("dynCall_ijiiij",6);var dynCall_ijiii=Module2["dynCall_ijiii"]=createExportWrapper("dynCall_ijiii",5);var dynCall_ijii=Module2["dynCall_ijii"]=createExportWrapper("dynCall_ijii",4);var dynCall_ii=Module2["dynCall_ii"]=createExportWrapper("dynCall_ii",2);var dynCall_iij=Module2["dynCall_iij"]=createExportWrapper("dynCall_iij",3);var dynCall_iiij=Module2["dynCall_iiij"]=createExportWrapper("dynCall_iiij",4);var dynCall_jijj=Module2["dynCall_jijj"]=createExportWrapper("dynCall_jijj",4);var dynCall_iii=Module2["dynCall_iii"]=createExportWrapper("dynCall_iii",3);var dynCall_iiii=Module2["dynCall_iiii"]=createExportWrapper("dynCall_iiii",4);var dynCall_jjjiiij=Module2["dynCall_jjjiiij"]=createExportWrapper("dynCall_jjjiiij",7);var dynCall_ijjijjj=Module2["dynCall_ijjijjj"]=createExportWrapper("dynCall_ijjijjj",7);var dynCall_jji=Module2["dynCall_jji"]=createExportWrapper("dynCall_jji",3);var dynCall_ijid=Module2["dynCall_ijid"]=createExportWrapper("dynCall_ijid",4);var dynCall_dji=Module2["dynCall_dji"]=createExportWrapper("dynCall_dji",3);var dynCall_ijjijj=Module2["dynCall_ijjijj"]=createExportWrapper("dynCall_ijjijj",6);var dynCall_ijjiijjjj=Module2["dynCall_ijjiijjjj"]=createExportWrapper("dynCall_ijjiijjjj",9);var dynCall_ijjjjjj=Module2["dynCall_ijjjjjj"]=createExportWrapper("dynCall_ijjjjjj",7);var dynCall_j=Module2["dynCall_j"]=createExportWrapper("dynCall_j",1);var dynCall_vjijj=Module2["dynCall_vjijj"]=createExportWrapper("dynCall_vjijj",5);var dynCall_vjd=Module2["dynCall_vjd"]=createExportWrapper("dynCall_vjd",3);var dynCall_vjji=Module2["dynCall_vjji"]=createExportWrapper("dynCall_vjji",4);var dynCall_vji=Module2["dynCall_vji"]=createExportWrapper("dynCall_vji",3);var dynCall_jijjj=Module2["dynCall_jijjj"]=createExportWrapper("dynCall_jijjj",5);var dynCall_ijjjjjjjjj=Module2["dynCall_ijjjjjjjjj"]=createExportWrapper("dynCall_ijjjjjjjjj",10);var dynCall_v=Module2["dynCall_v"]=createExportWrapper("dynCall_v",1);var dynCall_dj=Module2["dynCall_dj"]=createExportWrapper("dynCall_dj",2);var dynCall_ijjjjjij=Module2["dynCall_ijjjjjij"]=createExportWrapper("dynCall_ijjjjjij",8);var dynCall_ijjii=Module2["dynCall_ijjii"]=createExportWrapper("dynCall_ijjii",5);var dynCall_vij=Module2["dynCall_vij"]=createExportWrapper("dynCall_vij",3);var dynCall_iijji=Module2["dynCall_iijji"]=createExportWrapper("dynCall_iijji",5);var dynCall_ijjiijjjjj=Module2["dynCall_ijjiijjjjj"]=createExportWrapper("dynCall_ijjiijjjjj",10);var dynCall_ijijji=Module2["dynCall_ijijji"]=createExportWrapper("dynCall_ijijji",6);var dynCall_vijj=Module2["dynCall_vijj"]=createExportWrapper("dynCall_vijj",4);var dynCall_ijijjj=Module2["dynCall_ijijjj"]=createExportWrapper("dynCall_ijijjj",6);var dynCall_ijijjji=Module2["dynCall_ijijjji"]=createExportWrapper("dynCall_ijijjji",7);var dynCall_vjjjji=Module2["dynCall_vjjjji"]=createExportWrapper("dynCall_vjjjji",6);var dynCall_ijjiijj=Module2["dynCall_ijjiijj"]=createExportWrapper("dynCall_ijjiijj",7);var dynCall_vjii=Module2["dynCall_vjii"]=createExportWrapper("dynCall_vjii",4);var dynCall_ijjiijjjjjj=Module2["dynCall_ijjiijjjjjj"]=createExportWrapper("dynCall_ijjiijjjjjj",11);var dynCall_jjjjij=Module2["dynCall_jjjjij"]=createExportWrapper("dynCall_jjjjij",6);var dynCall_ijjjjji=Module2["dynCall_ijjjjji"]=createExportWrapper("dynCall_ijjjjji",7);var dynCall_jjjji=Module2["dynCall_jjjji"]=createExportWrapper("dynCall_jjjji",5);var dynCall_dd=Module2["dynCall_dd"]=createExportWrapper("dynCall_dd",2);var dynCall_ddd=Module2["dynCall_ddd"]=createExportWrapper("dynCall_ddd",3);var dynCall_jiii=Module2["dynCall_jiii"]=createExportWrapper("dynCall_jiii",4);var dynCall_jjii=Module2["dynCall_jjii"]=createExportWrapper("dynCall_jjii",4);var dynCall_ijiijj=Module2["dynCall_ijiijj"]=createExportWrapper("dynCall_ijiijj",6);var dynCall_ijjijij=Module2["dynCall_ijjijij"]=createExportWrapper("dynCall_ijjijij",7);var dynCall_jjji=Module2["dynCall_jjji"]=createExportWrapper("dynCall_jjji",4);var dynCall_ijdiiii=Module2["dynCall_ijdiiii"]=createExportWrapper("dynCall_ijdiiii",7);var dynCall_vjjjii=Module2["dynCall_vjjjii"]=createExportWrapper("dynCall_vjjjii",6);var dynCall_ijjjjjjjj=Module2["dynCall_ijjjjjjjj"]=createExportWrapper("dynCall_ijjjjjjjj",9);var dynCall_jjjjjjj=Module2["dynCall_jjjjjjj"]=createExportWrapper("dynCall_jjjjjjj",7);var dynCall_jjjjii=Module2["dynCall_jjjjii"]=createExportWrapper("dynCall_jjjjii",6);var dynCall_jjjjid=Module2["dynCall_jjjjid"]=createExportWrapper("dynCall_jjjjid",6);var dynCall_jjjjijj=Module2["dynCall_jjjjijj"]=createExportWrapper("dynCall_jjjjijj",7);var dynCall_jjjjjjjii=Module2["dynCall_jjjjjjjii"]=createExportWrapper("dynCall_jjjjjjjii",9);var dynCall_jjjjijii=Module2["dynCall_jjjjijii"]=createExportWrapper("dynCall_jjjjijii",8);var dynCall_jjjjijjj=Module2["dynCall_jjjjijjj"]=createExportWrapper("dynCall_jjjjijjj",8);var dynCall_jjjijijj=Module2["dynCall_jjjijijj"]=createExportWrapper("dynCall_jjjijijj",8);var dynCall_jjjijij=Module2["dynCall_jjjijij"]=createExportWrapper("dynCall_jjjijij",7);var dynCall_vjjjiij=Module2["dynCall_vjjjiij"]=createExportWrapper("dynCall_vjjjiij",7);var dynCall_vjjjjii=Module2["dynCall_vjjjjii"]=createExportWrapper("dynCall_vjjjjii",7);var dynCall_ifj=Module2["dynCall_ifj"]=createExportWrapper("dynCall_ifj",3);var dynCall_vijjjjjji=Module2["dynCall_vijjjjjji"]=createExportWrapper("dynCall_vijjjjjji",9);var dynCall_vjjjjj=Module2["dynCall_vjjjjj"]=createExportWrapper("dynCall_vjjjjj",6);var _asyncify_start_unwind=createExportWrapper("asyncify_start_unwind",1);var _asyncify_stop_unwind=createExportWrapper("asyncify_stop_unwind",0);var _asyncify_start_rewind=createExportWrapper("asyncify_start_rewind",1);var _asyncify_stop_rewind=createExportWrapper("asyncify_stop_rewind",0);var ___start_em_js=Module2["___start_em_js"]=543408;var ___stop_em_js=Module2["___stop_em_js"]=543834;function invoke_vjj(index,a1,a2){var sp=stackSave();try{dynCall_vjj(Number(index),a1,a2);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function applySignatureConversions(wasmExports2){wasmExports2=Object.assign({},wasmExports2);var makeWrapper_pp=function makeWrapper_pp(f){return function(a0){return Number(f(BigInt(a0)));};};var makeWrapper___PP=function makeWrapper___PP(f){return function(a0,a1,a2){return f(a0,BigInt(a1?a1:0),BigInt(a2?a2:0));};};var makeWrapper__p=function makeWrapper__p(f){return function(a0){return f(BigInt(a0));};};var makeWrapper_ppp=function makeWrapper_ppp(f){return function(a0,a1){return Number(f(BigInt(a0),BigInt(a1)));};};var makeWrapper_pP=function makeWrapper_pP(f){return function(a0){return Number(f(BigInt(a0?a0:0)));};};var makeWrapper_p=function makeWrapper_p(f){return function(){return Number(f());};};wasmExports2["malloc"]=makeWrapper_pp(wasmExports2["malloc"]);wasmExports2["main"]=makeWrapper___PP(wasmExports2["main"]);wasmExports2["free"]=makeWrapper__p(wasmExports2["free"]);wasmExports2["fflush"]=makeWrapper__p(wasmExports2["fflush"]);wasmExports2["emscripten_builtin_memalign"]=makeWrapper_ppp(wasmExports2["emscripten_builtin_memalign"]);wasmExports2["sbrk"]=makeWrapper_pP(wasmExports2["sbrk"]);wasmExports2["setThrew"]=makeWrapper__p(wasmExports2["setThrew"]);wasmExports2["emscripten_stack_get_base"]=makeWrapper_p(wasmExports2["emscripten_stack_get_base"]);wasmExports2["emscripten_stack_get_end"]=makeWrapper_p(wasmExports2["emscripten_stack_get_end"]);wasmExports2["_emscripten_stack_restore"]=makeWrapper__p(wasmExports2["_emscripten_stack_restore"]);wasmExports2["_emscripten_stack_alloc"]=makeWrapper_pp(wasmExports2["_emscripten_stack_alloc"]);wasmExports2["emscripten_stack_get_current"]=makeWrapper_p(wasmExports2["emscripten_stack_get_current"]);wasmExports2["__cxa_is_pointer_type"]=makeWrapper__p(wasmExports2["__cxa_is_pointer_type"]);wasmExports2["asyncify_start_unwind"]=makeWrapper__p(wasmExports2["asyncify_start_unwind"]);wasmExports2["asyncify_start_rewind"]=makeWrapper__p(wasmExports2["asyncify_start_rewind"]);return wasmExports2;}var MAGIC=0;Math.random=function(){MAGIC=Math.pow(MAGIC+1.8912,3)%1;return MAGIC;};var TIME=1e4;function deterministicNow(){return TIME++;}datenow=deterministicNow;Module2["thisProgram"]="thisProgram";Module2["addRunDependency"]=addRunDependency;Module2["removeRunDependency"]=removeRunDependency;Module2["FS_createPath"]=FS.createPath;Module2["FS_createLazyFile"]=FS.createLazyFile;Module2["FS_createDevice"]=FS.createDevice;Module2["cwrap"]=cwrap;Module2["FS_createPreloadedFile"]=FS.createPreloadedFile;Module2["FS_createDataFile"]=FS.createDataFile;Module2["FS_unlink"]=FS.unlink;var missingLibrarySymbols=["writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getTempRet0","setTempRet0","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","emscriptenLog","readEmAsmArgs","jstoi_q","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","asmjsMangle","HandleAllocator","getNativeTypeSize","STACK_SIZE","STACK_ALIGN","POINTER_SIZE","ASSERTIONS","uleb128Encode","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","getFunctionAddress","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","stringToNewUTF8","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","getCallstack","convertPCtoSourceLocation","checkWasiClock","wasiRightsToMuslOFlags","wasiOFlagsToMuslOFlags","createDyncallWrapper","safeSetTimeout","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","getPromise","makePromise","idsToPromises","makePromiseCallback","findMatchingCatch","Browser_asyncPrepareDataCounter","setMainLoop","getSocketFromFD","getSocketAddress","FS_mkdirTree","_setNetworkCallback","heapObjectForWebGLType","toTypedArrayIndex","webgl_enable_ANGLE_instanced_arrays","webgl_enable_OES_vertex_array_object","webgl_enable_WEBGL_draw_buffers","webgl_enable_WEBGL_multi_draw","emscriptenWebGLGet","computeUnpackAlignedImageSize","colorChannelsInGlTextureFormat","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","__glGetActiveAttribOrUniform","writeGLArray","registerWebGlEventCallback","ALLOC_NORMAL","ALLOC_STACK","allocate","writeStringToMemory","writeAsciiToMemory","setErrNo","demangle","stackTrace"];missingLibrarySymbols.forEach(missingLibrarySymbol);var unexportedSymbols=["run","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","FS_createFolder","FS_createLink","FS_readFile","out","err","callMain","abort","wasmMemory","wasmExports","writeStackCookie","checkStackCookie","readI53FromI64","MAX_INT53","MIN_INT53","bigintToI53Checked","stackSave","stackRestore","stackAlloc","ptrToString","zeroMemory","exitJS","getHeapMax","growMemory","ENV","MONTH_DAYS_REGULAR","MONTH_DAYS_LEAP","MONTH_DAYS_REGULAR_CUMULATIVE","MONTH_DAYS_LEAP_CUMULATIVE","isLeapYear","ydayFromDate","arraySum","addDays","ERRNO_CODES","ERRNO_MESSAGES","DNS","Protocols","Sockets","initRandomFill","randomFill","timers","warnOnce","readEmAsmArgsArray","jstoi_s","getExecutableName","handleException","keepRuntimeAlive","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","asyncLoad","alignMemory","mmapAlloc","wasmTable","noExitRuntime","getCFunc","ccall","sigToWasmTypes","freeTableIndexes","functionsInTableMap","setValue","getValue","PATH","PATH_FS","UTF8Decoder","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","intArrayFromString","stringToAscii","UTF16Decoder","stringToUTF8OnStack","writeArrayToMemory","JSEvents","specialHTMLTargets","findCanvasEventTarget","currentFullscreenStrategy","restoreOldWindowedStyle","UNWIND_CACHE","ExitStatus","getEnvStrings","doReadv","doWritev","promiseMap","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","Browser","getPreloadedImageData__data","wget","SYSCALLS","preloadPlugins","FS_modeStringToFlags","FS_getMode","FS_stdin_getChar_buffer","FS_stdin_getChar","FS","MEMFS","TTY","PIPEFS","SOCKFS","tempFixedLengthArray","miniTempWebGLFloatBuffers","miniTempWebGLIntBuffers","GL","AL","GLUT","EGL","GLEW","IDBStore","runAndAbortIfError","Asyncify","Fibers","SDL","SDL_gfx","allocateUTF8","allocateUTF8OnStack"];unexportedSymbols.forEach(unexportedRuntimeSymbol);var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller;};function stackCheckInit(){_emscripten_stack_init4();writeStackCookie();}function run(){if(runDependencies>0){return;}stackCheckInit();preRun();if(runDependencies>0){return;}function doRun(){if(calledRun)return;calledRun=true;Module2["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module2);if(Module2["onRuntimeInitialized"])Module2["onRuntimeInitialized"]();assert(!Module2["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun();}if(Module2["setStatus"]){Module2["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module2["setStatus"]("");},1);doRun();},1);}else{doRun();}checkStackCookie();}function checkUnflushedContent(){var oldOut=out;var oldErr=err;var has=false;out=err=function err(x){has=true;};try{_fflush(0);["stdout","stderr"].forEach(function(name){var _tty$output3;var info=FS.analyzePath("/dev/"+name);if(!info)return;var stream=info.object;var rdev=stream.rdev;var tty=TTY.ttys[rdev];if(tty!==null&&tty!==void 0&&(_tty$output3=tty.output)!==null&&_tty$output3!==void 0&&_tty$output3.length){has=true;}});}catch(e){}out=oldOut;err=oldErr;if(has){_warnOnce3("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.");}}if(Module2["preInit"]){if(typeof Module2["preInit"]=="function")Module2["preInit"]=[Module2["preInit"]];while(Module2["preInit"].length>0){Module2["preInit"].pop()();}}run();moduleRtn=readyPromise;Module2.resizeHeap=_emscripten_resize_heap;var _loop6=function _loop6(){var prop=_Object$keys5[_i9];if(!(prop in moduleArg)){Object.defineProperty(moduleArg,prop,{configurable:true,get:function get(){abort("Access to module property ('".concat(prop,"') is no longer possible via the module constructor argument; Instead, use the result of the module constructor."));}});}};for(var _i9=0,_Object$keys5=Object.keys(Module2);_i9<_Object$keys5.length;_i9++){_loop6();}return moduleRtn;};}();if(_typeof(exports2)==="object"&&_typeof(module2)==="object")module2.exports=Module;else if(typeof define==="function"&&define["amd"])define([],function(){return Module;});}});// node_modules/bn.js/lib/bn.js
60
60
  var require_bn=__commonJS({"node_modules/bn.js/lib/bn.js":function node_modules_bnJs_lib_bnJs(exports2,module2){;(function(module3,exports3){"use strict";function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed");}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function TempCtor(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor();ctor.prototype.constructor=ctor;}function BN(number,base,endian){if(BN.isBN(number)){return number;}this.negative=0;this.words=null;this.length=0;this.red=null;if(number!==null){if(base==="le"||base==="be"){endian=base;base=10;}this._init(number||0,base||10,endian||"be");}}if(_typeof(module3)==="object"){module3.exports=BN;}else{exports3.BN=BN;}BN.BN=BN;BN.wordSize=26;var Buffer2;try{if(typeof window!=="undefined"&&typeof window.Buffer!=="undefined"){Buffer2=window.Buffer;}else{Buffer2=_require("buffer").Buffer;}}catch(e){}BN.isBN=function isBN(num){if(num instanceof BN){return true;}return num!==null&&_typeof(num)==="object"&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words);};BN.max=function max(left,right){if(left.cmp(right)>0)return left;return right;};BN.min=function min(left,right){if(left.cmp(right)<0)return left;return right;};BN.prototype._init=function init(number,base,endian){if(typeof number==="number"){return this._initNumber(number,base,endian);}if(_typeof(number)==="object"){return this._initArray(number,base,endian);}if(base==="hex"){base=16;}assert(base===(base|0)&&base>=2&&base<=36);number=number.toString().replace(/\s+/g,"");var start=0;if(number[0]==="-"){start++;this.negative=1;}if(start<number.length){if(base===16){this._parseHex(number,start,endian);}else{this._parseBase(number,base,start);if(endian==="le"){this._initArray(this.toArray(),base,endian);}}}};BN.prototype._initNumber=function _initNumber(number,base,endian){if(number<0){this.negative=1;number=-number;}if(number<67108864){this.words=[number&67108863];this.length=1;}else if(number<4503599627370496){this.words=[number&67108863,number/67108864&67108863];this.length=2;}else{assert(number<9007199254740992);this.words=[number&67108863,number/67108864&67108863,1];this.length=3;}if(endian!=="le")return;this._initArray(this.toArray(),base,endian);};BN.prototype._initArray=function _initArray(number,base,endian){assert(typeof number.length==="number");if(number.length<=0){this.words=[0];this.length=1;return this;}this.length=Math.ceil(number.length/3);this.words=new Array(this.length);for(var i=0;i<this.length;i++){this.words[i]=0;}var j,w;var off=0;if(endian==="be"){for(i=number.length-1,j=0;i>=0;i-=3){w=number[i]|number[i-1]<<8|number[i-2]<<16;this.words[j]|=w<<off&67108863;this.words[j+1]=w>>>26-off&67108863;off+=24;if(off>=26){off-=26;j++;}}}else if(endian==="le"){for(i=0,j=0;i<number.length;i+=3){w=number[i]|number[i+1]<<8|number[i+2]<<16;this.words[j]|=w<<off&67108863;this.words[j+1]=w>>>26-off&67108863;off+=24;if(off>=26){off-=26;j++;}}}return this.strip();};function parseHex4Bits(string,index){var c=string.charCodeAt(index);if(c>=65&&c<=70){return c-55;}else if(c>=97&&c<=102){return c-87;}else{return c-48&15;}}function parseHexByte(string,lowerBound,index){var r=parseHex4Bits(string,index);if(index-1>=lowerBound){r|=parseHex4Bits(string,index-1)<<4;}return r;}BN.prototype._parseHex=function _parseHex(number,start,endian){this.length=Math.ceil((number.length-start)/6);this.words=new Array(this.length);for(var i=0;i<this.length;i++){this.words[i]=0;}var off=0;var j=0;var w;if(endian==="be"){for(i=number.length-1;i>=start;i-=2){w=parseHexByte(number,start,i)<<off;this.words[j]|=w&67108863;if(off>=18){off-=18;j+=1;this.words[j]|=w>>>26;}else{off+=8;}}}else{var parseLength=number.length-start;for(i=parseLength%2===0?start+1:start;i<number.length;i+=2){w=parseHexByte(number,start,i)<<off;this.words[j]|=w&67108863;if(off>=18){off-=18;j+=1;this.words[j]|=w>>>26;}else{off+=8;}}}this.strip();};function parseBase(str,start,end,mul){var r=0;var len=Math.min(str.length,end);for(var i=start;i<len;i++){var c=str.charCodeAt(i)-48;r*=mul;if(c>=49){r+=c-49+10;}else if(c>=17){r+=c-17+10;}else{r+=c;}}return r;}BN.prototype._parseBase=function _parseBase(number,base,start){this.words=[0];this.length=1;for(var limbLen=0,limbPow=1;limbPow<=67108863;limbPow*=base){limbLen++;}limbLen--;limbPow=limbPow/base|0;var total=number.length-start;var mod=total%limbLen;var end=Math.min(total,total-mod)+start;var word=0;for(var i=start;i<end;i+=limbLen){word=parseBase(number,i,i+limbLen,base);this.imuln(limbPow);if(this.words[0]+word<67108864){this.words[0]+=word;}else{this._iaddn(word);}}if(mod!==0){var pow=1;word=parseBase(number,i,number.length,base);for(i=0;i<mod;i++){pow*=base;}this.imuln(pow);if(this.words[0]+word<67108864){this.words[0]+=word;}else{this._iaddn(word);}}this.strip();};BN.prototype.copy=function copy(dest){dest.words=new Array(this.length);for(var i=0;i<this.length;i++){dest.words[i]=this.words[i];}dest.length=this.length;dest.negative=this.negative;dest.red=this.red;};BN.prototype.clone=function clone(){var r=new BN(null);this.copy(r);return r;};BN.prototype._expand=function _expand(size){while(this.length<size){this.words[this.length++]=0;}return this;};BN.prototype.strip=function strip(){while(this.length>1&&this.words[this.length-1]===0){this.length--;}return this._normSign();};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0;}return this;};BN.prototype.inspect=function inspect(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">";};var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];var groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];var groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(base,padding){base=base||10;padding=padding|0||1;var out;if(base===16||base==="hex"){out="";var off=0;var carry=0;for(var i=0;i<this.length;i++){var w=this.words[i];var word=((w<<off|carry)&16777215).toString(16);carry=w>>>24-off&16777215;if(carry!==0||i!==this.length-1){out=zeros[6-word.length]+word+out;}else{out=word+out;}off+=2;if(off>=26){off-=26;i--;}}if(carry!==0){out=carry.toString(16)+out;}while(out.length%padding!==0){out="0"+out;}if(this.negative!==0){out="-"+out;}return out;}if(base===(base|0)&&base>=2&&base<=36){var groupSize=groupSizes[base];var groupBase=groupBases[base];out="";var c=this.clone();c.negative=0;while(!c.isZero()){var r=c.modn(groupBase).toString(base);c=c.idivn(groupBase);if(!c.isZero()){out=zeros[groupSize-r.length]+r+out;}else{out=r+out;}}if(this.isZero()){out="0"+out;}while(out.length%padding!==0){out="0"+out;}if(this.negative!==0){out="-"+out;}return out;}assert(false,"Base should be between 2 and 36");};BN.prototype.toNumber=function toNumber(){var ret=this.words[0];if(this.length===2){ret+=this.words[1]*67108864;}else if(this.length===3&&this.words[2]===1){ret+=4503599627370496+this.words[1]*67108864;}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits");}return this.negative!==0?-ret:ret;};BN.prototype.toJSON=function toJSON(){return this.toString(16);};BN.prototype.toBuffer=function toBuffer(endian,length){assert(typeof Buffer2!=="undefined");return this.toArrayLike(Buffer2,endian,length);};BN.prototype.toArray=function toArray(endian,length){return this.toArrayLike(Array,endian,length);};BN.prototype.toArrayLike=function toArrayLike(ArrayType,endian,length){var byteLength=this.byteLength();var reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length");assert(reqLength>0,"Requested array length <= 0");this.strip();var littleEndian=endian==="le";var res=new ArrayType(reqLength);var b,i;var q=this.clone();if(!littleEndian){for(i=0;i<reqLength-byteLength;i++){res[i]=0;}for(i=0;!q.isZero();i++){b=q.andln(255);q.iushrn(8);res[reqLength-i-1]=b;}}else{for(i=0;!q.isZero();i++){b=q.andln(255);q.iushrn(8);res[i]=b;}for(;i<reqLength;i++){res[i]=0;}}return res;};if(Math.clz32){BN.prototype._countBits=function _countBits(w){return 32-Math.clz32(w);};}else{BN.prototype._countBits=function _countBits(w){var t=w;var r=0;if(t>=4096){r+=13;t>>>=13;}if(t>=64){r+=7;t>>>=7;}if(t>=8){r+=4;t>>>=4;}if(t>=2){r+=2;t>>>=2;}return r+t;};}BN.prototype._zeroBits=function _zeroBits(w){if(w===0)return 26;var t=w;var r=0;if((t&8191)===0){r+=13;t>>>=13;}if((t&127)===0){r+=7;t>>>=7;}if((t&15)===0){r+=4;t>>>=4;}if((t&3)===0){r+=2;t>>>=2;}if((t&1)===0){r++;}return r;};BN.prototype.bitLength=function bitLength(){var w=this.words[this.length-1];var hi=this._countBits(w);return(this.length-1)*26+hi;};function toBitArray(num){var w=new Array(num.bitLength());for(var bit=0;bit<w.length;bit++){var off=bit/26|0;var wbit=bit%26;w[bit]=(num.words[off]&1<<wbit)>>>wbit;}return w;}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var r=0;for(var i=0;i<this.length;i++){var b=this._zeroBits(this.words[i]);r+=b;if(b!==26)break;}return r;};BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8);};BN.prototype.toTwos=function toTwos(width){if(this.negative!==0){return this.abs().inotn(width).iaddn(1);}return this.clone();};BN.prototype.fromTwos=function fromTwos(width){if(this.testn(width-1)){return this.notn(width).iaddn(1).ineg();}return this.clone();};BN.prototype.isNeg=function isNeg(){return this.negative!==0;};BN.prototype.neg=function neg(){return this.clone().ineg();};BN.prototype.ineg=function ineg(){if(!this.isZero()){this.negative^=1;}return this;};BN.prototype.iuor=function iuor(num){while(this.length<num.length){this.words[this.length++]=0;}for(var i=0;i<num.length;i++){this.words[i]=this.words[i]|num.words[i];}return this.strip();};BN.prototype.ior=function ior(num){assert((this.negative|num.negative)===0);return this.iuor(num);};BN.prototype.or=function or(num){if(this.length>num.length)return this.clone().ior(num);return num.clone().ior(this);};BN.prototype.uor=function uor(num){if(this.length>num.length)return this.clone().iuor(num);return num.clone().iuor(this);};BN.prototype.iuand=function iuand(num){var b;if(this.length>num.length){b=num;}else{b=this;}for(var i=0;i<b.length;i++){this.words[i]=this.words[i]&num.words[i];}this.length=b.length;return this.strip();};BN.prototype.iand=function iand(num){assert((this.negative|num.negative)===0);return this.iuand(num);};BN.prototype.and=function and(num){if(this.length>num.length)return this.clone().iand(num);return num.clone().iand(this);};BN.prototype.uand=function uand(num){if(this.length>num.length)return this.clone().iuand(num);return num.clone().iuand(this);};BN.prototype.iuxor=function iuxor(num){var a;var b;if(this.length>num.length){a=this;b=num;}else{a=num;b=this;}for(var i=0;i<b.length;i++){this.words[i]=a.words[i]^b.words[i];}if(this!==a){for(;i<a.length;i++){this.words[i]=a.words[i];}}this.length=a.length;return this.strip();};BN.prototype.ixor=function ixor(num){assert((this.negative|num.negative)===0);return this.iuxor(num);};BN.prototype.xor=function xor(num){if(this.length>num.length)return this.clone().ixor(num);return num.clone().ixor(this);};BN.prototype.uxor=function uxor(num){if(this.length>num.length)return this.clone().iuxor(num);return num.clone().iuxor(this);};BN.prototype.inotn=function inotn(width){assert(typeof width==="number"&&width>=0);var bytesNeeded=Math.ceil(width/26)|0;var bitsLeft=width%26;this._expand(bytesNeeded);if(bitsLeft>0){bytesNeeded--;}for(var i=0;i<bytesNeeded;i++){this.words[i]=~this.words[i]&67108863;}if(bitsLeft>0){this.words[i]=~this.words[i]&67108863>>26-bitsLeft;}return this.strip();};BN.prototype.notn=function notn(width){return this.clone().inotn(width);};BN.prototype.setn=function setn(bit,val){assert(typeof bit==="number"&&bit>=0);var off=bit/26|0;var wbit=bit%26;this._expand(off+1);if(val){this.words[off]=this.words[off]|1<<wbit;}else{this.words[off]=this.words[off]&~(1<<wbit);}return this.strip();};BN.prototype.iadd=function iadd(num){var r;if(this.negative!==0&&num.negative===0){this.negative=0;r=this.isub(num);this.negative^=1;return this._normSign();}else if(this.negative===0&&num.negative!==0){num.negative=0;r=this.isub(num);num.negative=1;return r._normSign();}var a,b;if(this.length>num.length){a=this;b=num;}else{a=num;b=this;}var carry=0;for(var i=0;i<b.length;i++){r=(a.words[i]|0)+(b.words[i]|0)+carry;this.words[i]=r&67108863;carry=r>>>26;}for(;carry!==0&&i<a.length;i++){r=(a.words[i]|0)+carry;this.words[i]=r&67108863;carry=r>>>26;}this.length=a.length;if(carry!==0){this.words[this.length]=carry;this.length++;}else if(a!==this){for(;i<a.length;i++){this.words[i]=a.words[i];}}return this;};BN.prototype.add=function add(num){var res;if(num.negative!==0&&this.negative===0){num.negative=0;res=this.sub(num);num.negative^=1;return res;}else if(num.negative===0&&this.negative!==0){this.negative=0;res=num.sub(this);this.negative=1;return res;}if(this.length>num.length)return this.clone().iadd(num);return num.clone().iadd(this);};BN.prototype.isub=function isub(num){if(num.negative!==0){num.negative=0;var r=this.iadd(num);num.negative=1;return r._normSign();}else if(this.negative!==0){this.negative=0;this.iadd(num);this.negative=1;return this._normSign();}var cmp=this.cmp(num);if(cmp===0){this.negative=0;this.length=1;this.words[0]=0;return this;}var a,b;if(cmp>0){a=this;b=num;}else{a=num;b=this;}var carry=0;for(var i=0;i<b.length;i++){r=(a.words[i]|0)-(b.words[i]|0)+carry;carry=r>>26;this.words[i]=r&67108863;}for(;carry!==0&&i<a.length;i++){r=(a.words[i]|0)+carry;carry=r>>26;this.words[i]=r&67108863;}if(carry===0&&i<a.length&&a!==this){for(;i<a.length;i++){this.words[i]=a.words[i];}}this.length=Math.max(this.length,i);if(a!==this){this.negative=1;}return this.strip();};BN.prototype.sub=function sub(num){return this.clone().isub(num);};function smallMulTo(self2,num,out){out.negative=num.negative^self2.negative;var len=self2.length+num.length|0;out.length=len;len=len-1|0;var a=self2.words[0]|0;var b=num.words[0]|0;var r=a*b;var lo=r&67108863;var carry=r/67108864|0;out.words[0]=lo;for(var k=1;k<len;k++){var ncarry=carry>>>26;var rword=carry&67108863;var maxJ=Math.min(k,num.length-1);for(var j=Math.max(0,k-self2.length+1);j<=maxJ;j++){var i=k-j|0;a=self2.words[i]|0;b=num.words[j]|0;r=a*b+rword;ncarry+=r/67108864|0;rword=r&67108863;}out.words[k]=rword|0;carry=ncarry|0;}if(carry!==0){out.words[k]=carry|0;}else{out.length--;}return out.strip();}var comb10MulTo=function comb10MulTo2(self2,num,out){var a=self2.words;var b=num.words;var o=out.words;var c=0;var lo;var mid;var hi;var a0=a[0]|0;var al0=a0&8191;var ah0=a0>>>13;var a1=a[1]|0;var al1=a1&8191;var ah1=a1>>>13;var a2=a[2]|0;var al2=a2&8191;var ah2=a2>>>13;var a3=a[3]|0;var al3=a3&8191;var ah3=a3>>>13;var a4=a[4]|0;var al4=a4&8191;var ah4=a4>>>13;var a5=a[5]|0;var al5=a5&8191;var ah5=a5>>>13;var a6=a[6]|0;var al6=a6&8191;var ah6=a6>>>13;var a7=a[7]|0;var al7=a7&8191;var ah7=a7>>>13;var a8=a[8]|0;var al8=a8&8191;var ah8=a8>>>13;var a9=a[9]|0;var al9=a9&8191;var ah9=a9>>>13;var b0=b[0]|0;var bl0=b0&8191;var bh0=b0>>>13;var b1=b[1]|0;var bl1=b1&8191;var bh1=b1>>>13;var b2=b[2]|0;var bl2=b2&8191;var bh2=b2>>>13;var b3=b[3]|0;var bl3=b3&8191;var bh3=b3>>>13;var b4=b[4]|0;var bl4=b4&8191;var bh4=b4>>>13;var b5=b[5]|0;var bl5=b5&8191;var bh5=b5>>>13;var b6=b[6]|0;var bl6=b6&8191;var bh6=b6>>>13;var b7=b[7]|0;var bl7=b7&8191;var bh7=b7>>>13;var b8=b[8]|0;var bl8=b8&8191;var bh8=b8>>>13;var b9=b[9]|0;var bl9=b9&8191;var bh9=b9>>>13;out.negative=self2.negative^num.negative;out.length=19;lo=Math.imul(al0,bl0);mid=Math.imul(al0,bh0);mid=mid+Math.imul(ah0,bl0)|0;hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0;w0&=67108863;lo=Math.imul(al1,bl0);mid=Math.imul(al1,bh0);mid=mid+Math.imul(ah1,bl0)|0;hi=Math.imul(ah1,bh0);lo=lo+Math.imul(al0,bl1)|0;mid=mid+Math.imul(al0,bh1)|0;mid=mid+Math.imul(ah0,bl1)|0;hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0;w1&=67108863;lo=Math.imul(al2,bl0);mid=Math.imul(al2,bh0);mid=mid+Math.imul(ah2,bl0)|0;hi=Math.imul(ah2,bh0);lo=lo+Math.imul(al1,bl1)|0;mid=mid+Math.imul(al1,bh1)|0;mid=mid+Math.imul(ah1,bl1)|0;hi=hi+Math.imul(ah1,bh1)|0;lo=lo+Math.imul(al0,bl2)|0;mid=mid+Math.imul(al0,bh2)|0;mid=mid+Math.imul(ah0,bl2)|0;hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0;w2&=67108863;lo=Math.imul(al3,bl0);mid=Math.imul(al3,bh0);mid=mid+Math.imul(ah3,bl0)|0;hi=Math.imul(ah3,bh0);lo=lo+Math.imul(al2,bl1)|0;mid=mid+Math.imul(al2,bh1)|0;mid=mid+Math.imul(ah2,bl1)|0;hi=hi+Math.imul(ah2,bh1)|0;lo=lo+Math.imul(al1,bl2)|0;mid=mid+Math.imul(al1,bh2)|0;mid=mid+Math.imul(ah1,bl2)|0;hi=hi+Math.imul(ah1,bh2)|0;lo=lo+Math.imul(al0,bl3)|0;mid=mid+Math.imul(al0,bh3)|0;mid=mid+Math.imul(ah0,bl3)|0;hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0;w3&=67108863;lo=Math.imul(al4,bl0);mid=Math.imul(al4,bh0);mid=mid+Math.imul(ah4,bl0)|0;hi=Math.imul(ah4,bh0);lo=lo+Math.imul(al3,bl1)|0;mid=mid+Math.imul(al3,bh1)|0;mid=mid+Math.imul(ah3,bl1)|0;hi=hi+Math.imul(ah3,bh1)|0;lo=lo+Math.imul(al2,bl2)|0;mid=mid+Math.imul(al2,bh2)|0;mid=mid+Math.imul(ah2,bl2)|0;hi=hi+Math.imul(ah2,bh2)|0;lo=lo+Math.imul(al1,bl3)|0;mid=mid+Math.imul(al1,bh3)|0;mid=mid+Math.imul(ah1,bl3)|0;hi=hi+Math.imul(ah1,bh3)|0;lo=lo+Math.imul(al0,bl4)|0;mid=mid+Math.imul(al0,bh4)|0;mid=mid+Math.imul(ah0,bl4)|0;hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0;w4&=67108863;lo=Math.imul(al5,bl0);mid=Math.imul(al5,bh0);mid=mid+Math.imul(ah5,bl0)|0;hi=Math.imul(ah5,bh0);lo=lo+Math.imul(al4,bl1)|0;mid=mid+Math.imul(al4,bh1)|0;mid=mid+Math.imul(ah4,bl1)|0;hi=hi+Math.imul(ah4,bh1)|0;lo=lo+Math.imul(al3,bl2)|0;mid=mid+Math.imul(al3,bh2)|0;mid=mid+Math.imul(ah3,bl2)|0;hi=hi+Math.imul(ah3,bh2)|0;lo=lo+Math.imul(al2,bl3)|0;mid=mid+Math.imul(al2,bh3)|0;mid=mid+Math.imul(ah2,bl3)|0;hi=hi+Math.imul(ah2,bh3)|0;lo=lo+Math.imul(al1,bl4)|0;mid=mid+Math.imul(al1,bh4)|0;mid=mid+Math.imul(ah1,bl4)|0;hi=hi+Math.imul(ah1,bh4)|0;lo=lo+Math.imul(al0,bl5)|0;mid=mid+Math.imul(al0,bh5)|0;mid=mid+Math.imul(ah0,bl5)|0;hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0;w5&=67108863;lo=Math.imul(al6,bl0);mid=Math.imul(al6,bh0);mid=mid+Math.imul(ah6,bl0)|0;hi=Math.imul(ah6,bh0);lo=lo+Math.imul(al5,bl1)|0;mid=mid+Math.imul(al5,bh1)|0;mid=mid+Math.imul(ah5,bl1)|0;hi=hi+Math.imul(ah5,bh1)|0;lo=lo+Math.imul(al4,bl2)|0;mid=mid+Math.imul(al4,bh2)|0;mid=mid+Math.imul(ah4,bl2)|0;hi=hi+Math.imul(ah4,bh2)|0;lo=lo+Math.imul(al3,bl3)|0;mid=mid+Math.imul(al3,bh3)|0;mid=mid+Math.imul(ah3,bl3)|0;hi=hi+Math.imul(ah3,bh3)|0;lo=lo+Math.imul(al2,bl4)|0;mid=mid+Math.imul(al2,bh4)|0;mid=mid+Math.imul(ah2,bl4)|0;hi=hi+Math.imul(ah2,bh4)|0;lo=lo+Math.imul(al1,bl5)|0;mid=mid+Math.imul(al1,bh5)|0;mid=mid+Math.imul(ah1,bl5)|0;hi=hi+Math.imul(ah1,bh5)|0;lo=lo+Math.imul(al0,bl6)|0;mid=mid+Math.imul(al0,bh6)|0;mid=mid+Math.imul(ah0,bl6)|0;hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0;w6&=67108863;lo=Math.imul(al7,bl0);mid=Math.imul(al7,bh0);mid=mid+Math.imul(ah7,bl0)|0;hi=Math.imul(ah7,bh0);lo=lo+Math.imul(al6,bl1)|0;mid=mid+Math.imul(al6,bh1)|0;mid=mid+Math.imul(ah6,bl1)|0;hi=hi+Math.imul(ah6,bh1)|0;lo=lo+Math.imul(al5,bl2)|0;mid=mid+Math.imul(al5,bh2)|0;mid=mid+Math.imul(ah5,bl2)|0;hi=hi+Math.imul(ah5,bh2)|0;lo=lo+Math.imul(al4,bl3)|0;mid=mid+Math.imul(al4,bh3)|0;mid=mid+Math.imul(ah4,bl3)|0;hi=hi+Math.imul(ah4,bh3)|0;lo=lo+Math.imul(al3,bl4)|0;mid=mid+Math.imul(al3,bh4)|0;mid=mid+Math.imul(ah3,bl4)|0;hi=hi+Math.imul(ah3,bh4)|0;lo=lo+Math.imul(al2,bl5)|0;mid=mid+Math.imul(al2,bh5)|0;mid=mid+Math.imul(ah2,bl5)|0;hi=hi+Math.imul(ah2,bh5)|0;lo=lo+Math.imul(al1,bl6)|0;mid=mid+Math.imul(al1,bh6)|0;mid=mid+Math.imul(ah1,bl6)|0;hi=hi+Math.imul(ah1,bh6)|0;lo=lo+Math.imul(al0,bl7)|0;mid=mid+Math.imul(al0,bh7)|0;mid=mid+Math.imul(ah0,bl7)|0;hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0;w7&=67108863;lo=Math.imul(al8,bl0);mid=Math.imul(al8,bh0);mid=mid+Math.imul(ah8,bl0)|0;hi=Math.imul(ah8,bh0);lo=lo+Math.imul(al7,bl1)|0;mid=mid+Math.imul(al7,bh1)|0;mid=mid+Math.imul(ah7,bl1)|0;hi=hi+Math.imul(ah7,bh1)|0;lo=lo+Math.imul(al6,bl2)|0;mid=mid+Math.imul(al6,bh2)|0;mid=mid+Math.imul(ah6,bl2)|0;hi=hi+Math.imul(ah6,bh2)|0;lo=lo+Math.imul(al5,bl3)|0;mid=mid+Math.imul(al5,bh3)|0;mid=mid+Math.imul(ah5,bl3)|0;hi=hi+Math.imul(ah5,bh3)|0;lo=lo+Math.imul(al4,bl4)|0;mid=mid+Math.imul(al4,bh4)|0;mid=mid+Math.imul(ah4,bl4)|0;hi=hi+Math.imul(ah4,bh4)|0;lo=lo+Math.imul(al3,bl5)|0;mid=mid+Math.imul(al3,bh5)|0;mid=mid+Math.imul(ah3,bl5)|0;hi=hi+Math.imul(ah3,bh5)|0;lo=lo+Math.imul(al2,bl6)|0;mid=mid+Math.imul(al2,bh6)|0;mid=mid+Math.imul(ah2,bl6)|0;hi=hi+Math.imul(ah2,bh6)|0;lo=lo+Math.imul(al1,bl7)|0;mid=mid+Math.imul(al1,bh7)|0;mid=mid+Math.imul(ah1,bl7)|0;hi=hi+Math.imul(ah1,bh7)|0;lo=lo+Math.imul(al0,bl8)|0;mid=mid+Math.imul(al0,bh8)|0;mid=mid+Math.imul(ah0,bl8)|0;hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0;w8&=67108863;lo=Math.imul(al9,bl0);mid=Math.imul(al9,bh0);mid=mid+Math.imul(ah9,bl0)|0;hi=Math.imul(ah9,bh0);lo=lo+Math.imul(al8,bl1)|0;mid=mid+Math.imul(al8,bh1)|0;mid=mid+Math.imul(ah8,bl1)|0;hi=hi+Math.imul(ah8,bh1)|0;lo=lo+Math.imul(al7,bl2)|0;mid=mid+Math.imul(al7,bh2)|0;mid=mid+Math.imul(ah7,bl2)|0;hi=hi+Math.imul(ah7,bh2)|0;lo=lo+Math.imul(al6,bl3)|0;mid=mid+Math.imul(al6,bh3)|0;mid=mid+Math.imul(ah6,bl3)|0;hi=hi+Math.imul(ah6,bh3)|0;lo=lo+Math.imul(al5,bl4)|0;mid=mid+Math.imul(al5,bh4)|0;mid=mid+Math.imul(ah5,bl4)|0;hi=hi+Math.imul(ah5,bh4)|0;lo=lo+Math.imul(al4,bl5)|0;mid=mid+Math.imul(al4,bh5)|0;mid=mid+Math.imul(ah4,bl5)|0;hi=hi+Math.imul(ah4,bh5)|0;lo=lo+Math.imul(al3,bl6)|0;mid=mid+Math.imul(al3,bh6)|0;mid=mid+Math.imul(ah3,bl6)|0;hi=hi+Math.imul(ah3,bh6)|0;lo=lo+Math.imul(al2,bl7)|0;mid=mid+Math.imul(al2,bh7)|0;mid=mid+Math.imul(ah2,bl7)|0;hi=hi+Math.imul(ah2,bh7)|0;lo=lo+Math.imul(al1,bl8)|0;mid=mid+Math.imul(al1,bh8)|0;mid=mid+Math.imul(ah1,bl8)|0;hi=hi+Math.imul(ah1,bh8)|0;lo=lo+Math.imul(al0,bl9)|0;mid=mid+Math.imul(al0,bh9)|0;mid=mid+Math.imul(ah0,bl9)|0;hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0;w9&=67108863;lo=Math.imul(al9,bl1);mid=Math.imul(al9,bh1);mid=mid+Math.imul(ah9,bl1)|0;hi=Math.imul(ah9,bh1);lo=lo+Math.imul(al8,bl2)|0;mid=mid+Math.imul(al8,bh2)|0;mid=mid+Math.imul(ah8,bl2)|0;hi=hi+Math.imul(ah8,bh2)|0;lo=lo+Math.imul(al7,bl3)|0;mid=mid+Math.imul(al7,bh3)|0;mid=mid+Math.imul(ah7,bl3)|0;hi=hi+Math.imul(ah7,bh3)|0;lo=lo+Math.imul(al6,bl4)|0;mid=mid+Math.imul(al6,bh4)|0;mid=mid+Math.imul(ah6,bl4)|0;hi=hi+Math.imul(ah6,bh4)|0;lo=lo+Math.imul(al5,bl5)|0;mid=mid+Math.imul(al5,bh5)|0;mid=mid+Math.imul(ah5,bl5)|0;hi=hi+Math.imul(ah5,bh5)|0;lo=lo+Math.imul(al4,bl6)|0;mid=mid+Math.imul(al4,bh6)|0;mid=mid+Math.imul(ah4,bl6)|0;hi=hi+Math.imul(ah4,bh6)|0;lo=lo+Math.imul(al3,bl7)|0;mid=mid+Math.imul(al3,bh7)|0;mid=mid+Math.imul(ah3,bl7)|0;hi=hi+Math.imul(ah3,bh7)|0;lo=lo+Math.imul(al2,bl8)|0;mid=mid+Math.imul(al2,bh8)|0;mid=mid+Math.imul(ah2,bl8)|0;hi=hi+Math.imul(ah2,bh8)|0;lo=lo+Math.imul(al1,bl9)|0;mid=mid+Math.imul(al1,bh9)|0;mid=mid+Math.imul(ah1,bl9)|0;hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0;w10&=67108863;lo=Math.imul(al9,bl2);mid=Math.imul(al9,bh2);mid=mid+Math.imul(ah9,bl2)|0;hi=Math.imul(ah9,bh2);lo=lo+Math.imul(al8,bl3)|0;mid=mid+Math.imul(al8,bh3)|0;mid=mid+Math.imul(ah8,bl3)|0;hi=hi+Math.imul(ah8,bh3)|0;lo=lo+Math.imul(al7,bl4)|0;mid=mid+Math.imul(al7,bh4)|0;mid=mid+Math.imul(ah7,bl4)|0;hi=hi+Math.imul(ah7,bh4)|0;lo=lo+Math.imul(al6,bl5)|0;mid=mid+Math.imul(al6,bh5)|0;mid=mid+Math.imul(ah6,bl5)|0;hi=hi+Math.imul(ah6,bh5)|0;lo=lo+Math.imul(al5,bl6)|0;mid=mid+Math.imul(al5,bh6)|0;mid=mid+Math.imul(ah5,bl6)|0;hi=hi+Math.imul(ah5,bh6)|0;lo=lo+Math.imul(al4,bl7)|0;mid=mid+Math.imul(al4,bh7)|0;mid=mid+Math.imul(ah4,bl7)|0;hi=hi+Math.imul(ah4,bh7)|0;lo=lo+Math.imul(al3,bl8)|0;mid=mid+Math.imul(al3,bh8)|0;mid=mid+Math.imul(ah3,bl8)|0;hi=hi+Math.imul(ah3,bh8)|0;lo=lo+Math.imul(al2,bl9)|0;mid=mid+Math.imul(al2,bh9)|0;mid=mid+Math.imul(ah2,bl9)|0;hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0;w11&=67108863;lo=Math.imul(al9,bl3);mid=Math.imul(al9,bh3);mid=mid+Math.imul(ah9,bl3)|0;hi=Math.imul(ah9,bh3);lo=lo+Math.imul(al8,bl4)|0;mid=mid+Math.imul(al8,bh4)|0;mid=mid+Math.imul(ah8,bl4)|0;hi=hi+Math.imul(ah8,bh4)|0;lo=lo+Math.imul(al7,bl5)|0;mid=mid+Math.imul(al7,bh5)|0;mid=mid+Math.imul(ah7,bl5)|0;hi=hi+Math.imul(ah7,bh5)|0;lo=lo+Math.imul(al6,bl6)|0;mid=mid+Math.imul(al6,bh6)|0;mid=mid+Math.imul(ah6,bl6)|0;hi=hi+Math.imul(ah6,bh6)|0;lo=lo+Math.imul(al5,bl7)|0;mid=mid+Math.imul(al5,bh7)|0;mid=mid+Math.imul(ah5,bl7)|0;hi=hi+Math.imul(ah5,bh7)|0;lo=lo+Math.imul(al4,bl8)|0;mid=mid+Math.imul(al4,bh8)|0;mid=mid+Math.imul(ah4,bl8)|0;hi=hi+Math.imul(ah4,bh8)|0;lo=lo+Math.imul(al3,bl9)|0;mid=mid+Math.imul(al3,bh9)|0;mid=mid+Math.imul(ah3,bl9)|0;hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0;w12&=67108863;lo=Math.imul(al9,bl4);mid=Math.imul(al9,bh4);mid=mid+Math.imul(ah9,bl4)|0;hi=Math.imul(ah9,bh4);lo=lo+Math.imul(al8,bl5)|0;mid=mid+Math.imul(al8,bh5)|0;mid=mid+Math.imul(ah8,bl5)|0;hi=hi+Math.imul(ah8,bh5)|0;lo=lo+Math.imul(al7,bl6)|0;mid=mid+Math.imul(al7,bh6)|0;mid=mid+Math.imul(ah7,bl6)|0;hi=hi+Math.imul(ah7,bh6)|0;lo=lo+Math.imul(al6,bl7)|0;mid=mid+Math.imul(al6,bh7)|0;mid=mid+Math.imul(ah6,bl7)|0;hi=hi+Math.imul(ah6,bh7)|0;lo=lo+Math.imul(al5,bl8)|0;mid=mid+Math.imul(al5,bh8)|0;mid=mid+Math.imul(ah5,bl8)|0;hi=hi+Math.imul(ah5,bh8)|0;lo=lo+Math.imul(al4,bl9)|0;mid=mid+Math.imul(al4,bh9)|0;mid=mid+Math.imul(ah4,bl9)|0;hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0;w13&=67108863;lo=Math.imul(al9,bl5);mid=Math.imul(al9,bh5);mid=mid+Math.imul(ah9,bl5)|0;hi=Math.imul(ah9,bh5);lo=lo+Math.imul(al8,bl6)|0;mid=mid+Math.imul(al8,bh6)|0;mid=mid+Math.imul(ah8,bl6)|0;hi=hi+Math.imul(ah8,bh6)|0;lo=lo+Math.imul(al7,bl7)|0;mid=mid+Math.imul(al7,bh7)|0;mid=mid+Math.imul(ah7,bl7)|0;hi=hi+Math.imul(ah7,bh7)|0;lo=lo+Math.imul(al6,bl8)|0;mid=mid+Math.imul(al6,bh8)|0;mid=mid+Math.imul(ah6,bl8)|0;hi=hi+Math.imul(ah6,bh8)|0;lo=lo+Math.imul(al5,bl9)|0;mid=mid+Math.imul(al5,bh9)|0;mid=mid+Math.imul(ah5,bl9)|0;hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0;w14&=67108863;lo=Math.imul(al9,bl6);mid=Math.imul(al9,bh6);mid=mid+Math.imul(ah9,bl6)|0;hi=Math.imul(ah9,bh6);lo=lo+Math.imul(al8,bl7)|0;mid=mid+Math.imul(al8,bh7)|0;mid=mid+Math.imul(ah8,bl7)|0;hi=hi+Math.imul(ah8,bh7)|0;lo=lo+Math.imul(al7,bl8)|0;mid=mid+Math.imul(al7,bh8)|0;mid=mid+Math.imul(ah7,bl8)|0;hi=hi+Math.imul(ah7,bh8)|0;lo=lo+Math.imul(al6,bl9)|0;mid=mid+Math.imul(al6,bh9)|0;mid=mid+Math.imul(ah6,bl9)|0;hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0;w15&=67108863;lo=Math.imul(al9,bl7);mid=Math.imul(al9,bh7);mid=mid+Math.imul(ah9,bl7)|0;hi=Math.imul(ah9,bh7);lo=lo+Math.imul(al8,bl8)|0;mid=mid+Math.imul(al8,bh8)|0;mid=mid+Math.imul(ah8,bl8)|0;hi=hi+Math.imul(ah8,bh8)|0;lo=lo+Math.imul(al7,bl9)|0;mid=mid+Math.imul(al7,bh9)|0;mid=mid+Math.imul(ah7,bl9)|0;hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0;w16&=67108863;lo=Math.imul(al9,bl8);mid=Math.imul(al9,bh8);mid=mid+Math.imul(ah9,bl8)|0;hi=Math.imul(ah9,bh8);lo=lo+Math.imul(al8,bl9)|0;mid=mid+Math.imul(al8,bh9)|0;mid=mid+Math.imul(ah8,bl9)|0;hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0;w17&=67108863;lo=Math.imul(al9,bl9);mid=Math.imul(al9,bh9);mid=mid+Math.imul(ah9,bl9)|0;hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w18>>>26)|0;w18&=67108863;o[0]=w0;o[1]=w1;o[2]=w2;o[3]=w3;o[4]=w4;o[5]=w5;o[6]=w6;o[7]=w7;o[8]=w8;o[9]=w9;o[10]=w10;o[11]=w11;o[12]=w12;o[13]=w13;o[14]=w14;o[15]=w15;o[16]=w16;o[17]=w17;o[18]=w18;if(c!==0){o[19]=c;out.length++;}return out;};if(!Math.imul){comb10MulTo=smallMulTo;}function bigMulTo(self2,num,out){out.negative=num.negative^self2.negative;out.length=self2.length+num.length;var carry=0;var hncarry=0;for(var k=0;k<out.length-1;k++){var ncarry=hncarry;hncarry=0;var rword=carry&67108863;var maxJ=Math.min(k,num.length-1);for(var j=Math.max(0,k-self2.length+1);j<=maxJ;j++){var i=k-j;var a=self2.words[i]|0;var b=num.words[j]|0;var r=a*b;var lo=r&67108863;ncarry=ncarry+(r/67108864|0)|0;lo=lo+rword|0;rword=lo&67108863;ncarry=ncarry+(lo>>>26)|0;hncarry+=ncarry>>>26;ncarry&=67108863;}out.words[k]=rword;carry=ncarry;ncarry=hncarry;}if(carry!==0){out.words[k]=carry;}else{out.length--;}return out.strip();}function jumboMulTo(self2,num,out){var fftm=new FFTM();return fftm.mulp(self2,num,out);}BN.prototype.mulTo=function mulTo(num,out){var res;var len=this.length+num.length;if(this.length===10&&num.length===10){res=comb10MulTo(this,num,out);}else if(len<63){res=smallMulTo(this,num,out);}else if(len<1024){res=bigMulTo(this,num,out);}else{res=jumboMulTo(this,num,out);}return res;};function FFTM(x,y){this.x=x;this.y=y;}FFTM.prototype.makeRBT=function makeRBT(N){var t=new Array(N);var l=BN.prototype._countBits(N)-1;for(var i=0;i<N;i++){t[i]=this.revBin(i,l,N);}return t;};FFTM.prototype.revBin=function revBin(x,l,N){if(x===0||x===N-1)return x;var rb=0;for(var i=0;i<l;i++){rb|=(x&1)<<l-i-1;x>>=1;}return rb;};FFTM.prototype.permute=function permute(rbt,rws,iws,rtws,itws,N){for(var i=0;i<N;i++){rtws[i]=rws[rbt[i]];itws[i]=iws[rbt[i]];}};FFTM.prototype.transform=function transform(rws,iws,rtws,itws,N,rbt){this.permute(rbt,rws,iws,rtws,itws,N);for(var s=1;s<N;s<<=1){var l=s<<1;var rtwdf=Math.cos(2*Math.PI/l);var itwdf=Math.sin(2*Math.PI/l);for(var p=0;p<N;p+=l){var rtwdf_=rtwdf;var itwdf_=itwdf;for(var j=0;j<s;j++){var re=rtws[p+j];var ie=itws[p+j];var ro=rtws[p+j+s];var io=itws[p+j+s];var rx=rtwdf_*ro-itwdf_*io;io=rtwdf_*io+itwdf_*ro;ro=rx;rtws[p+j]=re+ro;itws[p+j]=ie+io;rtws[p+j+s]=re-ro;itws[p+j+s]=ie-io;if(j!==l){rx=rtwdf*rtwdf_-itwdf*itwdf_;itwdf_=rtwdf*itwdf_+itwdf*rtwdf_;rtwdf_=rx;}}}}};FFTM.prototype.guessLen13b=function guessLen13b(n,m){var N=Math.max(m,n)|1;var odd=N&1;var i=0;for(N=N/2|0;N;N=N>>>1){i++;}return 1<<i+1+odd;};FFTM.prototype.conjugate=function conjugate(rws,iws,N){if(N<=1)return;for(var i=0;i<N/2;i++){var t=rws[i];rws[i]=rws[N-i-1];rws[N-i-1]=t;t=iws[i];iws[i]=-iws[N-i-1];iws[N-i-1]=-t;}};FFTM.prototype.normalize13b=function normalize13b(ws,N){var carry=0;for(var i=0;i<N/2;i++){var w=Math.round(ws[2*i+1]/N)*8192+Math.round(ws[2*i]/N)+carry;ws[i]=w&67108863;if(w<67108864){carry=0;}else{carry=w/67108864|0;}}return ws;};FFTM.prototype.convert13b=function convert13b(ws,len,rws,N){var carry=0;for(var i=0;i<len;i++){carry=carry+(ws[i]|0);rws[2*i]=carry&8191;carry=carry>>>13;rws[2*i+1]=carry&8191;carry=carry>>>13;}for(i=2*len;i<N;++i){rws[i]=0;}assert(carry===0);assert((carry&~8191)===0);};FFTM.prototype.stub=function stub(N){var ph=new Array(N);for(var i=0;i<N;i++){ph[i]=0;}return ph;};FFTM.prototype.mulp=function mulp(x,y,out){var N=2*this.guessLen13b(x.length,y.length);var rbt=this.makeRBT(N);var _=this.stub(N);var rws=new Array(N);var rwst=new Array(N);var iwst=new Array(N);var nrws=new Array(N);var nrwst=new Array(N);var niwst=new Array(N);var rmws=out.words;rmws.length=N;this.convert13b(x.words,x.length,rws,N);this.convert13b(y.words,y.length,nrws,N);this.transform(rws,_,rwst,iwst,N,rbt);this.transform(nrws,_,nrwst,niwst,N,rbt);for(var i=0;i<N;i++){var rx=rwst[i]*nrwst[i]-iwst[i]*niwst[i];iwst[i]=rwst[i]*niwst[i]+iwst[i]*nrwst[i];rwst[i]=rx;}this.conjugate(rwst,iwst,N);this.transform(rwst,iwst,rmws,_,N,rbt);this.conjugate(rmws,_,N);this.normalize13b(rmws,N);out.negative=x.negative^y.negative;out.length=x.length+y.length;return out.strip();};BN.prototype.mul=function mul(num){var out=new BN(null);out.words=new Array(this.length+num.length);return this.mulTo(num,out);};BN.prototype.mulf=function mulf(num){var out=new BN(null);out.words=new Array(this.length+num.length);return jumboMulTo(this,num,out);};BN.prototype.imul=function imul(num){return this.clone().mulTo(num,this);};BN.prototype.imuln=function imuln(num){assert(typeof num==="number");assert(num<67108864);var carry=0;for(var i=0;i<this.length;i++){var w=(this.words[i]|0)*num;var lo=(w&67108863)+(carry&67108863);carry>>=26;carry+=w/67108864|0;carry+=lo>>>26;this.words[i]=lo&67108863;}if(carry!==0){this.words[i]=carry;this.length++;}return this;};BN.prototype.muln=function muln(num){return this.clone().imuln(num);};BN.prototype.sqr=function sqr(){return this.mul(this);};BN.prototype.isqr=function isqr(){return this.imul(this.clone());};BN.prototype.pow=function pow(num){var w=toBitArray(num);if(w.length===0)return new BN(1);var res=this;for(var i=0;i<w.length;i++,res=res.sqr()){if(w[i]!==0)break;}if(++i<w.length){for(var q=res.sqr();i<w.length;i++,q=q.sqr()){if(w[i]===0)continue;res=res.mul(q);}}return res;};BN.prototype.iushln=function iushln(bits){assert(typeof bits==="number"&&bits>=0);var r=bits%26;var s=(bits-r)/26;var carryMask=67108863>>>26-r<<26-r;var i;if(r!==0){var carry=0;for(i=0;i<this.length;i++){var newCarry=this.words[i]&carryMask;var c=(this.words[i]|0)-newCarry<<r;this.words[i]=c|carry;carry=newCarry>>>26-r;}if(carry){this.words[i]=carry;this.length++;}}if(s!==0){for(i=this.length-1;i>=0;i--){this.words[i+s]=this.words[i];}for(i=0;i<s;i++){this.words[i]=0;}this.length+=s;}return this.strip();};BN.prototype.ishln=function ishln(bits){assert(this.negative===0);return this.iushln(bits);};BN.prototype.iushrn=function iushrn(bits,hint,extended){assert(typeof bits==="number"&&bits>=0);var h;if(hint){h=(hint-hint%26)/26;}else{h=0;}var r=bits%26;var s=Math.min((bits-r)/26,this.length);var mask=67108863^67108863>>>r<<r;var maskedWords=extended;h-=s;h=Math.max(0,h);if(maskedWords){for(var i=0;i<s;i++){maskedWords.words[i]=this.words[i];}maskedWords.length=s;}if(s===0){}else if(this.length>s){this.length-=s;for(i=0;i<this.length;i++){this.words[i]=this.words[i+s];}}else{this.words[0]=0;this.length=1;}var carry=0;for(i=this.length-1;i>=0&&(carry!==0||i>=h);i--){var word=this.words[i]|0;this.words[i]=carry<<26-r|word>>>r;carry=word&mask;}if(maskedWords&&carry!==0){maskedWords.words[maskedWords.length++]=carry;}if(this.length===0){this.words[0]=0;this.length=1;}return this.strip();};BN.prototype.ishrn=function ishrn(bits,hint,extended){assert(this.negative===0);return this.iushrn(bits,hint,extended);};BN.prototype.shln=function shln(bits){return this.clone().ishln(bits);};BN.prototype.ushln=function ushln(bits){return this.clone().iushln(bits);};BN.prototype.shrn=function shrn(bits){return this.clone().ishrn(bits);};BN.prototype.ushrn=function ushrn(bits){return this.clone().iushrn(bits);};BN.prototype.testn=function testn(bit){assert(typeof bit==="number"&&bit>=0);var r=bit%26;var s=(bit-r)/26;var q=1<<r;if(this.length<=s)return false;var w=this.words[s];return!!(w&q);};BN.prototype.imaskn=function imaskn(bits){assert(typeof bits==="number"&&bits>=0);var r=bits%26;var s=(bits-r)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=s){return this;}if(r!==0){s++;}this.length=Math.min(s,this.length);if(r!==0){var mask=67108863^67108863>>>r<<r;this.words[this.length-1]&=mask;}return this.strip();};BN.prototype.maskn=function maskn(bits){return this.clone().imaskn(bits);};BN.prototype.iaddn=function iaddn(num){assert(typeof num==="number");assert(num<67108864);if(num<0)return this.isubn(-num);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<num){this.words[0]=num-(this.words[0]|0);this.negative=0;return this;}this.negative=0;this.isubn(num);this.negative=1;return this;}return this._iaddn(num);};BN.prototype._iaddn=function _iaddn(num){this.words[0]+=num;for(var i=0;i<this.length&&this.words[i]>=67108864;i++){this.words[i]-=67108864;if(i===this.length-1){this.words[i+1]=1;}else{this.words[i+1]++;}}this.length=Math.max(this.length,i+1);return this;};BN.prototype.isubn=function isubn(num){assert(typeof num==="number");assert(num<67108864);if(num<0)return this.iaddn(-num);if(this.negative!==0){this.negative=0;this.iaddn(num);this.negative=1;return this;}this.words[0]-=num;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1;}else{for(var i=0;i<this.length&&this.words[i]<0;i++){this.words[i]+=67108864;this.words[i+1]-=1;}}return this.strip();};BN.prototype.addn=function addn(num){return this.clone().iaddn(num);};BN.prototype.subn=function subn(num){return this.clone().isubn(num);};BN.prototype.iabs=function iabs(){this.negative=0;return this;};BN.prototype.abs=function abs(){return this.clone().iabs();};BN.prototype._ishlnsubmul=function _ishlnsubmul(num,mul,shift){var len=num.length+shift;var i;this._expand(len);var w;var carry=0;for(i=0;i<num.length;i++){w=(this.words[i+shift]|0)+carry;var right=(num.words[i]|0)*mul;w-=right&67108863;carry=(w>>26)-(right/67108864|0);this.words[i+shift]=w&67108863;}for(;i<this.length-shift;i++){w=(this.words[i+shift]|0)+carry;carry=w>>26;this.words[i+shift]=w&67108863;}if(carry===0)return this.strip();assert(carry===-1);carry=0;for(i=0;i<this.length;i++){w=-(this.words[i]|0)+carry;carry=w>>26;this.words[i]=w&67108863;}this.negative=1;return this.strip();};BN.prototype._wordDiv=function _wordDiv(num,mode){var shift=this.length-num.length;var a=this.clone();var b=num;var bhi=b.words[b.length-1]|0;var bhiBits=this._countBits(bhi);shift=26-bhiBits;if(shift!==0){b=b.ushln(shift);a.iushln(shift);bhi=b.words[b.length-1]|0;}var m=a.length-b.length;var q;if(mode!=="mod"){q=new BN(null);q.length=m+1;q.words=new Array(q.length);for(var i=0;i<q.length;i++){q.words[i]=0;}}var diff=a.clone()._ishlnsubmul(b,1,m);if(diff.negative===0){a=diff;if(q){q.words[m]=1;}}for(var j=m-1;j>=0;j--){var qj=(a.words[b.length+j]|0)*67108864+(a.words[b.length+j-1]|0);qj=Math.min(qj/bhi|0,67108863);a._ishlnsubmul(b,qj,j);while(a.negative!==0){qj--;a.negative=0;a._ishlnsubmul(b,1,j);if(!a.isZero()){a.negative^=1;}}if(q){q.words[j]=qj;}}if(q){q.strip();}a.strip();if(mode!=="div"&&shift!==0){a.iushrn(shift);}return{div:q||null,mod:a};};BN.prototype.divmod=function divmod(num,mode,positive){assert(!num.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)};}var div,mod,res;if(this.negative!==0&&num.negative===0){res=this.neg().divmod(num,mode);if(mode!=="mod"){div=res.div.neg();}if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.iadd(num);}}return{div:div,mod:mod};}if(this.negative===0&&num.negative!==0){res=this.divmod(num.neg(),mode);if(mode!=="mod"){div=res.div.neg();}return{div:div,mod:res.mod};}if((this.negative&num.negative)!==0){res=this.neg().divmod(num.neg(),mode);if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.isub(num);}}return{div:res.div,mod:mod};}if(num.length>this.length||this.cmp(num)<0){return{div:new BN(0),mod:this};}if(num.length===1){if(mode==="div"){return{div:this.divn(num.words[0]),mod:null};}if(mode==="mod"){return{div:null,mod:new BN(this.modn(num.words[0]))};}return{div:this.divn(num.words[0]),mod:new BN(this.modn(num.words[0]))};}return this._wordDiv(num,mode);};BN.prototype.div=function div(num){return this.divmod(num,"div",false).div;};BN.prototype.mod=function mod(num){return this.divmod(num,"mod",false).mod;};BN.prototype.umod=function umod(num){return this.divmod(num,"mod",true).mod;};BN.prototype.divRound=function divRound(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=dm.div.negative!==0?dm.mod.isub(num):dm.mod;var half=num.ushrn(1);var r2=num.andln(1);var cmp=mod.cmp(half);if(cmp<0||r2===1&&cmp===0)return dm.div;return dm.div.negative!==0?dm.div.isubn(1):dm.div.iaddn(1);};BN.prototype.modn=function modn(num){assert(num<=67108863);var p=(1<<26)%num;var acc=0;for(var i=this.length-1;i>=0;i--){acc=(p*acc+(this.words[i]|0))%num;}return acc;};BN.prototype.idivn=function idivn(num){assert(num<=67108863);var carry=0;for(var i=this.length-1;i>=0;i--){var w=(this.words[i]|0)+carry*67108864;this.words[i]=w/num|0;carry=w%num;}return this.strip();};BN.prototype.divn=function divn(num){return this.clone().idivn(num);};BN.prototype.egcd=function egcd(p){assert(p.negative===0);assert(!p.isZero());var x=this;var y=p.clone();if(x.negative!==0){x=x.umod(p);}else{x=x.clone();}var A=new BN(1);var B=new BN(0);var C=new BN(0);var D=new BN(1);var g=0;while(x.isEven()&&y.isEven()){x.iushrn(1);y.iushrn(1);++g;}var yp=y.clone();var xp=x.clone();while(!x.isZero()){for(var i=0,im=1;(x.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){x.iushrn(i);while(i-->0){if(A.isOdd()||B.isOdd()){A.iadd(yp);B.isub(xp);}A.iushrn(1);B.iushrn(1);}}for(var j=0,jm=1;(y.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){y.iushrn(j);while(j-->0){if(C.isOdd()||D.isOdd()){C.iadd(yp);D.isub(xp);}C.iushrn(1);D.iushrn(1);}}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D);}else{y.isub(x);C.isub(A);D.isub(B);}}return{a:C,b:D,gcd:y.iushln(g)};};BN.prototype._invmp=function _invmp(p){assert(p.negative===0);assert(!p.isZero());var a=this;var b=p.clone();if(a.negative!==0){a=a.umod(p);}else{a=a.clone();}var x1=new BN(1);var x2=new BN(0);var delta=b.clone();while(a.cmpn(1)>0&&b.cmpn(1)>0){for(var i=0,im=1;(a.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){a.iushrn(i);while(i-->0){if(x1.isOdd()){x1.iadd(delta);}x1.iushrn(1);}}for(var j=0,jm=1;(b.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){b.iushrn(j);while(j-->0){if(x2.isOdd()){x2.iadd(delta);}x2.iushrn(1);}}if(a.cmp(b)>=0){a.isub(b);x1.isub(x2);}else{b.isub(a);x2.isub(x1);}}var res;if(a.cmpn(1)===0){res=x1;}else{res=x2;}if(res.cmpn(0)<0){res.iadd(p);}return res;};BN.prototype.gcd=function gcd(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone();var b=num.clone();a.negative=0;b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++){a.iushrn(1);b.iushrn(1);}do{while(a.isEven()){a.iushrn(1);}while(b.isEven()){b.iushrn(1);}var r=a.cmp(b);if(r<0){var t=a;a=b;b=t;}else if(r===0||b.cmpn(1)===0){break;}a.isub(b);}while(true);return b.iushln(shift);};BN.prototype.invm=function invm(num){return this.egcd(num).a.umod(num);};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0;};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1;};BN.prototype.andln=function andln(num){return this.words[0]&num;};BN.prototype.bincn=function bincn(bit){assert(typeof bit==="number");var r=bit%26;var s=(bit-r)/26;var q=1<<r;if(this.length<=s){this._expand(s+1);this.words[s]|=q;return this;}var carry=q;for(var i=s;carry!==0&&i<this.length;i++){var w=this.words[i]|0;w+=carry;carry=w>>>26;w&=67108863;this.words[i]=w;}if(carry!==0){this.words[i]=carry;this.length++;}return this;};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0;};BN.prototype.cmpn=function cmpn(num){var negative=num<0;if(this.negative!==0&&!negative)return-1;if(this.negative===0&&negative)return 1;this.strip();var res;if(this.length>1){res=1;}else{if(negative){num=-num;}assert(num<=67108863,"Number is too big");var w=this.words[0]|0;res=w===num?0:w<num?-1:1;}if(this.negative!==0)return-res|0;return res;};BN.prototype.cmp=function cmp(num){if(this.negative!==0&&num.negative===0)return-1;if(this.negative===0&&num.negative!==0)return 1;var res=this.ucmp(num);if(this.negative!==0)return-res|0;return res;};BN.prototype.ucmp=function ucmp(num){if(this.length>num.length)return 1;if(this.length<num.length)return-1;var res=0;for(var i=this.length-1;i>=0;i--){var a=this.words[i]|0;var b=num.words[i]|0;if(a===b)continue;if(a<b){res=-1;}else if(a>b){res=1;}break;}return res;};BN.prototype.gtn=function gtn(num){return this.cmpn(num)===1;};BN.prototype.gt=function gt(num){return this.cmp(num)===1;};BN.prototype.gten=function gten(num){return this.cmpn(num)>=0;};BN.prototype.gte=function gte(num){return this.cmp(num)>=0;};BN.prototype.ltn=function ltn(num){return this.cmpn(num)===-1;};BN.prototype.lt=function lt(num){return this.cmp(num)===-1;};BN.prototype.lten=function lten(num){return this.cmpn(num)<=0;};BN.prototype.lte=function lte(num){return this.cmp(num)<=0;};BN.prototype.eqn=function eqn(num){return this.cmpn(num)===0;};BN.prototype.eq=function eq(num){return this.cmp(num)===0;};BN.red=function red(num){return new Red(num);};BN.prototype.toRed=function toRed(ctx){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return ctx.convertTo(this)._forceRed(ctx);};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this);};BN.prototype._forceRed=function _forceRed(ctx){this.red=ctx;return this;};BN.prototype.forceRed=function forceRed(ctx){assert(!this.red,"Already a number in reduction context");return this._forceRed(ctx);};BN.prototype.redAdd=function redAdd(num){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,num);};BN.prototype.redIAdd=function redIAdd(num){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,num);};BN.prototype.redSub=function redSub(num){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,num);};BN.prototype.redISub=function redISub(num){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,num);};BN.prototype.redShl=function redShl(num){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,num);};BN.prototype.redMul=function redMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.mul(this,num);};BN.prototype.redIMul=function redIMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.imul(this,num);};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this);};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this);};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this);};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this);};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this);};BN.prototype.redPow=function redPow(num){assert(this.red&&!num.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,num);};var primes={k256:null,p224:null,p192:null,p25519:null};function MPrime(name,p){this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp();}MPrime.prototype._tmp=function _tmp(){var tmp=new BN(null);tmp.words=new Array(Math.ceil(this.n/13));return tmp;};MPrime.prototype.ireduce=function ireduce(num){var r=num;var rlen;do{this.split(r,this.tmp);r=this.imulK(r);r=r.iadd(this.tmp);rlen=r.bitLength();}while(rlen>this.n);var cmp=rlen<this.n?-1:r.ucmp(this.p);if(cmp===0){r.words[0]=0;r.length=1;}else if(cmp>0){r.isub(this.p);}else{if(r.strip!==void 0){r.strip();}else{r._strip();}}return r;};MPrime.prototype.split=function split(input,out){input.iushrn(this.n,0,out);};MPrime.prototype.imulK=function imulK(num){return num.imul(this.k);};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");}inherits(K256,MPrime);K256.prototype.split=function split(input,output){var mask=4194303;var outLen=Math.min(input.length,9);for(var i=0;i<outLen;i++){output.words[i]=input.words[i];}output.length=outLen;if(input.length<=9){input.words[0]=0;input.length=1;return;}var prev=input.words[9];output.words[output.length++]=prev&mask;for(i=10;i<input.length;i++){var next=input.words[i]|0;input.words[i-10]=(next&mask)<<4|prev>>>22;prev=next;}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10){input.length-=10;}else{input.length-=9;}};K256.prototype.imulK=function imulK(num){num.words[num.length]=0;num.words[num.length+1]=0;num.length+=2;var lo=0;for(var i=0;i<num.length;i++){var w=num.words[i]|0;lo+=w*977;num.words[i]=lo&67108863;lo=w*64+(lo/67108864|0);}if(num.words[num.length-1]===0){num.length--;if(num.words[num.length-1]===0){num.length--;}}return num;};function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");}inherits(P224,MPrime);function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");}inherits(P192,MPrime);function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");}inherits(P25519,MPrime);P25519.prototype.imulK=function imulK(num){var carry=0;for(var i=0;i<num.length;i++){var hi=(num.words[i]|0)*19+carry;var lo=hi&67108863;hi>>>=26;num.words[i]=lo;carry=hi;}if(carry!==0){num.words[num.length++]=carry;}return num;};BN._prime=function prime(name){if(primes[name])return primes[name];var prime2;if(name==="k256"){prime2=new K256();}else if(name==="p224"){prime2=new P224();}else if(name==="p192"){prime2=new P192();}else if(name==="p25519"){prime2=new P25519();}else{throw new Error("Unknown prime "+name);}primes[name]=prime2;return prime2;};function Red(m){if(typeof m==="string"){var prime=BN._prime(m);this.m=prime.p;this.prime=prime;}else{assert(m.gtn(1),"modulus must be greater than 1");this.m=m;this.prime=null;}}Red.prototype._verify1=function _verify1(a){assert(a.negative===0,"red works only with positives");assert(a.red,"red works only with red numbers");};Red.prototype._verify2=function _verify2(a,b){assert((a.negative|b.negative)===0,"red works only with positives");assert(a.red&&a.red===b.red,"red works only with red numbers");};Red.prototype.imod=function imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.umod(this.m)._forceRed(this);};Red.prototype.neg=function neg(a){if(a.isZero()){return a.clone();}return this.m.sub(a)._forceRed(this);};Red.prototype.add=function add(a,b){this._verify2(a,b);var res=a.add(b);if(res.cmp(this.m)>=0){res.isub(this.m);}return res._forceRed(this);};Red.prototype.iadd=function iadd(a,b){this._verify2(a,b);var res=a.iadd(b);if(res.cmp(this.m)>=0){res.isub(this.m);}return res;};Red.prototype.sub=function sub(a,b){this._verify2(a,b);var res=a.sub(b);if(res.cmpn(0)<0){res.iadd(this.m);}return res._forceRed(this);};Red.prototype.isub=function isub(a,b){this._verify2(a,b);var res=a.isub(b);if(res.cmpn(0)<0){res.iadd(this.m);}return res;};Red.prototype.shl=function shl(a,num){this._verify1(a);return this.imod(a.ushln(num));};Red.prototype.imul=function imul(a,b){this._verify2(a,b);return this.imod(a.imul(b));};Red.prototype.mul=function mul(a,b){this._verify2(a,b);return this.imod(a.mul(b));};Red.prototype.isqr=function isqr(a){return this.imul(a,a.clone());};Red.prototype.sqr=function sqr(a){return this.mul(a,a);};Red.prototype.sqrt=function sqrt(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);assert(mod3%2===1);if(mod3===3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow);}var q=this.m.subn(1);var s=0;while(!q.isZero()&&q.andln(1)===0){s++;q.iushrn(1);}assert(!q.isZero());var one=new BN(1).toRed(this);var nOne=one.redNeg();var lpow=this.m.subn(1).iushrn(1);var z=this.m.bitLength();z=new BN(2*z*z).toRed(this);while(this.pow(z,lpow).cmp(nOne)!==0){z.redIAdd(nOne);}var c=this.pow(z,q);var r=this.pow(a,q.addn(1).iushrn(1));var t=this.pow(a,q);var m=s;while(t.cmp(one)!==0){var tmp=t;for(var i=0;tmp.cmp(one)!==0;i++){tmp=tmp.redSqr();}assert(i<m);var b=this.pow(c,new BN(1).iushln(m-i-1));r=r.redMul(b);c=b.redSqr();t=t.redMul(c);m=i;}return r;};Red.prototype.invm=function invm(a){var inv=a._invmp(this.m);if(inv.negative!==0){inv.negative=0;return this.imod(inv).redNeg();}else{return this.imod(inv);}};Red.prototype.pow=function pow(a,num){if(num.isZero())return new BN(1).toRed(this);if(num.cmpn(1)===0)return a.clone();var windowSize=4;var wnd=new Array(1<<windowSize);wnd[0]=new BN(1).toRed(this);wnd[1]=a;for(var i=2;i<wnd.length;i++){wnd[i]=this.mul(wnd[i-1],a);}var res=wnd[0];var current=0;var currentLen=0;var start=num.bitLength()%26;if(start===0){start=26;}for(i=num.length-1;i>=0;i--){var word=num.words[i];for(var j=start-1;j>=0;j--){var bit=word>>j&1;if(res!==wnd[0]){res=this.sqr(res);}if(bit===0&&current===0){currentLen=0;continue;}current<<=1;current|=bit;currentLen++;if(currentLen!==windowSize&&(i!==0||j!==0))continue;res=this.mul(res,wnd[current]);currentLen=0;current=0;}start=26;}return res;};Red.prototype.convertTo=function convertTo(num){var r=num.umod(this.m);return r===num?r.clone():r;};Red.prototype.convertFrom=function convertFrom(num){var res=num.clone();res.red=null;return res;};BN.mont=function mont(num){return new Mont(num);};function Mont(m){Red.call(this,m);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26;}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv);}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(num){return this.imod(num.ushln(this.shift));};Mont.prototype.convertFrom=function convertFrom(num){var r=this.imod(num.mul(this.rinv));r.red=null;return r;};Mont.prototype.imul=function imul(a,b){if(a.isZero()||b.isZero()){a.words[0]=0;a.length=1;return a;}var t=a.imul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m);}else if(u.cmpn(0)<0){res=u.iadd(this.m);}return res._forceRed(this);};Mont.prototype.mul=function mul(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m);}else if(u.cmpn(0)<0){res=u.iadd(this.m);}return res._forceRed(this);};Mont.prototype.invm=function invm(a){var res=this.imod(a._invmp(this.m).mul(this.r2));return res._forceRed(this);};})(typeof module2==="undefined"||module2,exports2);}});// node_modules/safe-buffer/index.js
61
61
  var require_safe_buffer=__commonJS({"node_modules/safe-buffer/index.js":function node_modules_safeBuffer_indexJs(exports2,module2){var buffer=_require("buffer");var Buffer2=buffer.Buffer;function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}if(Buffer2.from&&Buffer2.alloc&&Buffer2.allocUnsafe&&Buffer2.allocUnsafeSlow){module2.exports=buffer;}else{copyProps(buffer,exports2);exports2.Buffer=SafeBuffer;}function SafeBuffer(arg,encodingOrOffset,length){return Buffer2(arg,encodingOrOffset,length);}SafeBuffer.prototype=Object.create(Buffer2.prototype);copyProps(Buffer2,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg==="number"){throw new TypeError("Argument must not be a number");}return Buffer2(arg,encodingOrOffset,length);};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!=="number"){throw new TypeError("Argument must be a number");}var buf=Buffer2(size);if(fill!==void 0){if(typeof encoding==="string"){buf.fill(fill,encoding);}else{buf.fill(fill);}}else{buf.fill(0);}return buf;};SafeBuffer.allocUnsafe=function(size){if(typeof size!=="number"){throw new TypeError("Argument must be a number");}return Buffer2(size);};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!=="number"){throw new TypeError("Argument must be a number");}return buffer.SlowBuffer(size);};}});// node_modules/leb128/node_modules/buffer-pipe/index.js
62
62
  var require_buffer_pipe=__commonJS({"node_modules/leb128/node_modules/buffer-pipe/index.js":function node_modules_leb128_node_modules_bufferPipe_indexJs(exports2,module2){var Buffer2=require_safe_buffer().Buffer;module2.exports=/*#__PURE__*/function(){/**