nwlink 0.0.1
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.
- package/index.js +1 -0
- package/ld.wasm +0 -0
- package/objcopy.wasm +0 -0
- package/package.json +19 -0
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={827:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(e){var t,o,i=void 0!==(e=e||{})?e:{};i.ready=new Promise((function(e,r){t=e,o=r}));var s,a,c,u,l,d,f=Object.assign({},i),h=[],p="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,w="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,v="";y?(v=w?r(17).dirname(v)+"/":__dirname+"/",d=()=>{l||(u=r(147),l=r(17))},s=function(e,t){return d(),e=l.normalize(e),u.readFileSync(e,t?void 0:"utf8")},c=e=>{var t=s(e,!0);return t.buffer||(t=new Uint8Array(t)),t},a=(e,t,r)=>{d(),e=l.normalize(e),u.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),h=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof Ce))throw e})),process.on("unhandledRejection",(function(e){throw e})),m=(e,t)=>{if(G())throw process.exitCode=e,t;var r;(r=t)instanceof Ce||b("exiting due to exception: "+r),process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):(g||w)&&(w?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),n&&(v=n),v=0!==v.indexOf("blob:")?v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},w&&(c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),a=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var S,E=i.print||console.log.bind(console),b=i.printErr||console.warn.bind(console);Object.assign(i,f),f=null,i.arguments&&(h=i.arguments),i.thisProgram&&(p=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(S=i.wasmBinary);var A,_=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&te("no native wasm support detected");var I,C=!1;function P(e,t){e||te(t)}var k,T,D,O,R,M="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function F(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&M)return M.decode(e.subarray(t,o));for(var i="";t<o;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var c=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|c:(7&s)<<18|a<<12|c<<6|63&e[t++])<65536)i+=String.fromCharCode(s);else{var u=s-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function x(e,t){return e?F(D,e,t):""}function N(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(r>=i)break;t[r++]=a}else if(a<=2047){if(r+1>=i)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=i)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=i)break;t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a}}return t[r]=0,r-o}function H(e,t,r){return N(e,D,t,r)}function L(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}function U(e){var t=L(e)+1,r=Ie(t);return N(e,T,r,t),r}i.INITIAL_MEMORY;var B,z=[],V=[],j=[],$=[];function G(){return _}var X,K,q,W,Y=0,Z=null,J=null;function Q(e){Y++,i.monitorRunDependencies&&i.monitorRunDependencies(Y)}function ee(e){if(Y--,i.monitorRunDependencies&&i.monitorRunDependencies(Y),0==Y&&(null!==Z&&(clearInterval(Z),Z=null),J)){var t=J;J=null,t()}}function te(e){i.onAbort&&i.onAbort(e),b(e="Aborted("+e+")"),C=!0,I=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function re(e){return e.startsWith("data:application/octet-stream;base64,")}function ne(e){return e.startsWith("file://")}function oe(e){try{if(e==X&&S)return new Uint8Array(S);if(c)return c(e);throw"both async and sync fetching of the wasm failed"}catch(e){te(e)}}function ie(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?se(r)():se(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(i)}}function se(e){return B.get(e)}re(X="ld.wasm")||(K=X,X=i.locateFile?i.locateFile(K,v):v+K);var ae,ce={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=ce.isAbs(e),r="/"===e.substr(-1);return(e=ce.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=ce.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=ce.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return ce.normalize(e.join("/"))},join2:(e,t)=>ce.normalize(e+"/"+t)},ue={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:fe.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=ce.isAbs(n)}return(t?"/":"")+(e=ce.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ue.resolve(e).substr(1),t=ue.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),s=i,a=0;a<i;a++)if(n[a]!==o[a]){s=a;break}var c=[];for(a=s;a<n.length;a++)c.push("..");return(c=c.concat(o.slice(s))).join("/")}},le={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){le.ttys[e]={input:[],output:[],ops:t},fe.registerDevice(e,le.stream_ops)},stream_ops:{open:function(e){var t=le.ttys[e.node.rdev];if(!t)throw new fe.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new fe.ErrnoError(60);for(var i=0,s=0;s<n;s++){var a;try{a=e.tty.ops.get_char(e.tty)}catch(e){throw new fe.ErrnoError(29)}if(void 0===a&&0===i)throw new fe.ErrnoError(6);if(null==a)break;i++,t[r+s]=a}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new fe.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new fe.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(y){var r=Buffer.alloc(256),n=0;try{n=u.readSync(process.stdin.fd,r,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;n=0}t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=Ee(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(E(F(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(E(F(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(b(F(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(b(F(e.output,0)),e.output=[])}}},de={ops_table:null,mount:function(e){return de.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(fe.isBlkdev(r)||fe.isFIFO(r))throw new fe.ErrnoError(63);de.ops_table||(de.ops_table={dir:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr,lookup:de.node_ops.lookup,mknod:de.node_ops.mknod,rename:de.node_ops.rename,unlink:de.node_ops.unlink,rmdir:de.node_ops.rmdir,readdir:de.node_ops.readdir,symlink:de.node_ops.symlink},stream:{llseek:de.stream_ops.llseek}},file:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr},stream:{llseek:de.stream_ops.llseek,read:de.stream_ops.read,write:de.stream_ops.write,allocate:de.stream_ops.allocate,mmap:de.stream_ops.mmap,msync:de.stream_ops.msync}},link:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr,readlink:de.node_ops.readlink},stream:{}},chrdev:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr},stream:fe.chrdev_stream_ops}});var o=fe.createNode(e,t,r,n);return fe.isDir(o.mode)?(o.node_ops=de.ops_table.dir.node,o.stream_ops=de.ops_table.dir.stream,o.contents={}):fe.isFile(o.mode)?(o.node_ops=de.ops_table.file.node,o.stream_ops=de.ops_table.file.stream,o.usedBytes=0,o.contents=null):fe.isLink(o.mode)?(o.node_ops=de.ops_table.link.node,o.stream_ops=de.ops_table.link.stream):fe.isChrdev(o.mode)&&(o.node_ops=de.ops_table.chrdev.node,o.stream_ops=de.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=fe.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,fe.isDir(e.mode)?t.size=4096:fe.isFile(e.mode)?t.size=e.usedBytes:fe.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&de.resizeFileStorage(e,t.size)},lookup:function(e,t){throw fe.genericErrors[44]},mknod:function(e,t,r,n){return de.createNode(e,t,r,n)},rename:function(e,t,r){if(fe.isDir(e.mode)){var n;try{n=fe.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new fe.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=fe.lookupNode(e,t);for(var n in r.contents)throw new fe.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=de.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!fe.isLink(e.mode))throw new fe.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&i.subarray)t.set(i.subarray(o,o+s),r);else for(var a=0;a<s;a++)t[r+a]=i[o+a];return s},write:function(e,t,r,n,o,i){if(!n)return 0;var s=e.node;if(s.timestamp=Date.now(),t.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=t.subarray(r,r+n),s.usedBytes=n,n;if(0===s.usedBytes&&0===o)return s.contents=t.slice(r,r+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(t.subarray(r,r+n),o),n}if(de.expandFileStorage(s,o+n),s.contents.subarray&&t.subarray)s.contents.set(t.subarray(r,r+n),o);else for(var a=0;a<n;a++)s.contents[o+a]=t[r+a];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&fe.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new fe.ErrnoError(28);return n},allocate:function(e,t,r){de.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,i){if(0!==t)throw new fe.ErrnoError(28);if(!fe.isFile(e.node.mode))throw new fe.ErrnoError(43);var s,a,c=e.node.contents;if(2&i||c.buffer!==k){if((n>0||n+r<c.length)&&(c=c.subarray?c.subarray(n,n+r):Array.prototype.slice.call(c,n,n+r)),a=!0,!(s=void te()))throw new fe.ErrnoError(48);T.set(c,s)}else a=!1,s=c.byteOffset;return{ptr:s,allocated:a}},msync:function(e,t,r,n,o){if(!fe.isFile(e.node.mode))throw new fe.ErrnoError(43);return 2&o||de.stream_ops.write(e,t,0,n,r,!1),0}}},fe={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=ue.resolve(fe.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new fe.ErrnoError(32);for(var r=ce.normalizeArray(e.split("/").filter((e=>!!e)),!1),n=fe.root,o="/",i=0;i<r.length;i++){var s=i===r.length-1;if(s&&t.parent)break;if(n=fe.lookupNode(n,r[i]),o=ce.join2(o,r[i]),fe.isMountpoint(n)&&(!s||s&&t.follow_mount)&&(n=n.mounted.root),!s||t.follow)for(var a=0;fe.isLink(n.mode);){var c=fe.readlink(o);if(o=ue.resolve(ce.dirname(o),c),n=fe.lookupPath(o,{recurse_count:t.recurse_count+1}).node,a++>40)throw new fe.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(fe.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%fe.nameTable.length},hashAddNode:e=>{var t=fe.hashName(e.parent.id,e.name);e.name_next=fe.nameTable[t],fe.nameTable[t]=e},hashRemoveNode:e=>{var t=fe.hashName(e.parent.id,e.name);if(fe.nameTable[t]===e)fe.nameTable[t]=e.name_next;else for(var r=fe.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=fe.mayLookup(e);if(r)throw new fe.ErrnoError(r,e);for(var n=fe.hashName(e.id,t),o=fe.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return fe.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new fe.FSNode(e,t,r,n);return fe.hashAddNode(o),o},destroyNode:e=>{fe.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=fe.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>fe.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>{var t=fe.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return fe.lookupNode(e,t),20}catch(e){}return fe.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=fe.lookupNode(e,t)}catch(e){return e.errno}var o=fe.nodePermissions(e,"wx");if(o)return o;if(r){if(!fe.isDir(n.mode))return 54;if(fe.isRoot(n)||fe.getPath(n)===fe.cwd())return 10}else if(fe.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?fe.isLink(e.mode)?32:fe.isDir(e.mode)&&("r"!==fe.flagsToPermissionString(t)||512&t)?31:fe.nodePermissions(e,fe.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=fe.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!fe.streams[r])return r;throw new fe.ErrnoError(33)},getStream:e=>fe.streams[e],createStream:(e,t,r)=>{fe.FSStream||(fe.FSStream=function(){this.shared={}},fe.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get function(){return this.shared.position},set:function(e){this.shared.position=e}}}),e=Object.assign(new fe.FSStream,e);var n=fe.nextfd(t,r);return e.fd=n,fe.streams[n]=e,e},closeStream:e=>{fe.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=fe.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new fe.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{fe.devices[e]={stream_ops:t}},getDevice:e=>fe.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),fe.syncFSRequests++,fe.syncFSRequests>1&&b("warning: "+fe.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=fe.getMounts(fe.root.mount),n=0;function o(e){return fe.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&fe.root)throw new fe.ErrnoError(10);if(!o&&!i){var s=fe.lookupPath(r,{follow_mount:!1});if(r=s.path,n=s.node,fe.isMountpoint(n))throw new fe.ErrnoError(10);if(!fe.isDir(n.mode))throw new fe.ErrnoError(54)}var a={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(a);return c.mount=a,a.root=c,o?fe.root=c:n&&(n.mounted=a,n.mount&&n.mount.mounts.push(a)),c},unmount:e=>{var t=fe.lookupPath(e,{follow_mount:!1});if(!fe.isMountpoint(t.node))throw new fe.ErrnoError(28);var r=t.node,n=r.mounted,o=fe.getMounts(n);Object.keys(fe.nameTable).forEach((e=>{for(var t=fe.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&fe.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=fe.lookupPath(e,{parent:!0}).node,o=ce.basename(e);if(!o||"."===o||".."===o)throw new fe.ErrnoError(28);var i=fe.mayCreate(n,o);if(i)throw new fe.ErrnoError(i);if(!n.node_ops.mknod)throw new fe.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,fe.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,fe.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{fe.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,fe.mknod(e,t,r)),symlink:(e,t)=>{if(!ue.resolve(e))throw new fe.ErrnoError(44);var r=fe.lookupPath(t,{parent:!0}).node;if(!r)throw new fe.ErrnoError(44);var n=ce.basename(t),o=fe.mayCreate(r,n);if(o)throw new fe.ErrnoError(o);if(!r.node_ops.symlink)throw new fe.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=ce.dirname(e),i=ce.dirname(t),s=ce.basename(e),a=ce.basename(t);if(r=fe.lookupPath(e,{parent:!0}).node,n=fe.lookupPath(t,{parent:!0}).node,!r||!n)throw new fe.ErrnoError(44);if(r.mount!==n.mount)throw new fe.ErrnoError(75);var c,u=fe.lookupNode(r,s),l=ue.relative(e,i);if("."!==l.charAt(0))throw new fe.ErrnoError(28);if("."!==(l=ue.relative(t,o)).charAt(0))throw new fe.ErrnoError(55);try{c=fe.lookupNode(n,a)}catch(e){}if(u!==c){var d=fe.isDir(u.mode),f=fe.mayDelete(r,s,d);if(f)throw new fe.ErrnoError(f);if(f=c?fe.mayDelete(n,a,d):fe.mayCreate(n,a))throw new fe.ErrnoError(f);if(!r.node_ops.rename)throw new fe.ErrnoError(63);if(fe.isMountpoint(u)||c&&fe.isMountpoint(c))throw new fe.ErrnoError(10);if(n!==r&&(f=fe.nodePermissions(r,"w")))throw new fe.ErrnoError(f);fe.hashRemoveNode(u);try{r.node_ops.rename(u,n,a)}catch(e){throw e}finally{fe.hashAddNode(u)}}},rmdir:e=>{var t=fe.lookupPath(e,{parent:!0}).node,r=ce.basename(e),n=fe.lookupNode(t,r),o=fe.mayDelete(t,r,!0);if(o)throw new fe.ErrnoError(o);if(!t.node_ops.rmdir)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);t.node_ops.rmdir(t,r),fe.destroyNode(n)},readdir:e=>{var t=fe.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new fe.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=fe.lookupPath(e,{parent:!0}).node;if(!t)throw new fe.ErrnoError(44);var r=ce.basename(e),n=fe.lookupNode(t,r),o=fe.mayDelete(t,r,!1);if(o)throw new fe.ErrnoError(o);if(!t.node_ops.unlink)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);t.node_ops.unlink(t,r),fe.destroyNode(n)},readlink:e=>{var t=fe.lookupPath(e).node;if(!t)throw new fe.ErrnoError(44);if(!t.node_ops.readlink)throw new fe.ErrnoError(28);return ue.resolve(fe.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=fe.lookupPath(e,{follow:!t}).node;if(!r)throw new fe.ErrnoError(44);if(!r.node_ops.getattr)throw new fe.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>fe.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?fe.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{fe.chmod(e,t,!0)},fchmod:(e,t)=>{var r=fe.getStream(e);if(!r)throw new fe.ErrnoError(8);fe.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?fe.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{fe.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=fe.getStream(e);if(!n)throw new fe.ErrnoError(8);fe.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new fe.ErrnoError(28);var r;if(!(r="string"==typeof e?fe.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);if(fe.isDir(r.mode))throw new fe.ErrnoError(31);if(!fe.isFile(r.mode))throw new fe.ErrnoError(28);var n=fe.nodePermissions(r,"w");if(n)throw new fe.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=fe.getStream(e);if(!r)throw new fe.ErrnoError(8);if(0==(2097155&r.flags))throw new fe.ErrnoError(28);fe.truncate(r.node,t)},utime:(e,t,r)=>{var n=fe.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r,n,o)=>{if(""===e)throw new fe.ErrnoError(44);var s;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?fe.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)s=e;else{e=ce.normalize(e);try{s=fe.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t)if(s){if(128&t)throw new fe.ErrnoError(20)}else s=fe.mknod(e,r,0),a=!0;if(!s)throw new fe.ErrnoError(44);if(fe.isChrdev(s.mode)&&(t&=-513),65536&t&&!fe.isDir(s.mode))throw new fe.ErrnoError(54);if(!a){var c=fe.mayOpen(s,t);if(c)throw new fe.ErrnoError(c)}512&t&&fe.truncate(s,0),t&=-131713;var u=fe.createStream({node:s,path:fe.getPath(s),flags:t,seekable:!0,position:0,stream_ops:s.stream_ops,ungotten:[],error:!1},n,o);return u.stream_ops.open&&u.stream_ops.open(u),!i.logReadFiles||1&t||(fe.readFiles||(fe.readFiles={}),e in fe.readFiles||(fe.readFiles[e]=1)),u},close:e=>{if(fe.isClosed(e))throw new fe.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{fe.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(fe.isClosed(e))throw new fe.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new fe.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new fe.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new fe.ErrnoError(28);if(fe.isClosed(e))throw new fe.ErrnoError(8);if(1==(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.read)throw new fe.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new fe.ErrnoError(70)}else o=e.position;var s=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=s),s},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new fe.ErrnoError(28);if(fe.isClosed(e))throw new fe.ErrnoError(8);if(0==(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.write)throw new fe.ErrnoError(28);e.seekable&&1024&e.flags&&fe.llseek(e,0,2);var s=void 0!==o;if(s){if(!e.seekable)throw new fe.ErrnoError(70)}else o=e.position;var a=e.stream_ops.write(e,t,r,n,o,i);return s||(e.position+=a),a},allocate:(e,t,r)=>{if(fe.isClosed(e))throw new fe.ErrnoError(8);if(t<0||r<=0)throw new fe.ErrnoError(28);if(0==(2097155&e.flags))throw new fe.ErrnoError(8);if(!fe.isFile(e.node.mode)&&!fe.isDir(e.node.mode))throw new fe.ErrnoError(43);if(!e.stream_ops.allocate)throw new fe.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o,i)=>{if(0!=(2&o)&&0==(2&i)&&2!=(2097155&e.flags))throw new fe.ErrnoError(2);if(1==(2097155&e.flags))throw new fe.ErrnoError(2);if(!e.stream_ops.mmap)throw new fe.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,i)},msync:(e,t,r,n,o)=>e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new fe.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,n=fe.open(e,t.flags),o=fe.stat(e).size,i=new Uint8Array(o);return fe.read(n,i,0,o,0),"utf8"===t.encoding?r=F(i,0):"binary"===t.encoding&&(r=i),fe.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=fe.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(L(t)+1),i=N(t,o,0,o.length);fe.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");fe.write(n,t,0,t.byteLength,void 0,r.canOwn)}fe.close(n)},cwd:()=>fe.currentPath,chdir:e=>{var t=fe.lookupPath(e,{follow:!0});if(null===t.node)throw new fe.ErrnoError(44);if(!fe.isDir(t.node.mode))throw new fe.ErrnoError(54);var r=fe.nodePermissions(t.node,"x");if(r)throw new fe.ErrnoError(r);fe.currentPath=t.path},createDefaultDirectories:()=>{fe.mkdir("/tmp"),fe.mkdir("/home"),fe.mkdir("/home/web_user")},createDefaultDevices:()=>{fe.mkdir("/dev"),fe.registerDevice(fe.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),fe.mkdev("/dev/null",fe.makedev(1,3)),le.register(fe.makedev(5,0),le.default_tty_ops),le.register(fe.makedev(6,0),le.default_tty1_ops),fe.mkdev("/dev/tty",fe.makedev(5,0)),fe.mkdev("/dev/tty1",fe.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(y)try{var t=r(113);return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){te("randomDevice")}}();fe.createDevice("/dev","random",e),fe.createDevice("/dev","urandom",e),fe.mkdir("/dev/shm"),fe.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{fe.mkdir("/proc");var e=fe.mkdir("/proc/self");fe.mkdir("/proc/self/fd"),fe.mount({mount:()=>{var t=fe.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=fe.getStream(r);if(!n)throw new fe.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?fe.createDevice("/dev","stdin",i.stdin):fe.symlink("/dev/tty","/dev/stdin"),i.stdout?fe.createDevice("/dev","stdout",null,i.stdout):fe.symlink("/dev/tty","/dev/stdout"),i.stderr?fe.createDevice("/dev","stderr",null,i.stderr):fe.symlink("/dev/tty1","/dev/stderr"),fe.open("/dev/stdin",0),fe.open("/dev/stdout",1),fe.open("/dev/stderr",1)},ensureErrnoError:()=>{fe.ErrnoError||(fe.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},fe.ErrnoError.prototype=new Error,fe.ErrnoError.prototype.constructor=fe.ErrnoError,[44].forEach((e=>{fe.genericErrors[e]=new fe.ErrnoError(e),fe.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{fe.ensureErrnoError(),fe.nameTable=new Array(4096),fe.mount(de,{},"/"),fe.createDefaultDirectories(),fe.createDefaultDevices(),fe.createSpecialDirectories(),fe.filesystems={MEMFS:de}},init:(e,t,r)=>{fe.init.initialized=!0,fe.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,fe.createStandardStreams()},quit:()=>{fe.init.initialized=!1;for(var e=0;e<fe.streams.length;e++){var t=fe.streams[e];t&&fe.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=fe.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=fe.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=fe.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ce.basename(e),n=fe.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:fe.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var s=ce.join2(e,i);try{fe.mkdir(s)}catch(e){}e=s}}return s},createFile:(e,t,r,n,o)=>{var i=ce.join2("string"==typeof e?e:fe.getPath(e),t),s=fe.getMode(n,o);return fe.create(i,s)},createDataFile:(e,t,r,n,o,i)=>{var s=t;e&&(e="string"==typeof e?e:fe.getPath(e),s=t?ce.join2(e,t):e);var a=fe.getMode(n,o),c=fe.create(s,a);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,d=r.length;l<d;++l)u[l]=r.charCodeAt(l);r=u}fe.chmod(c,146|a);var f=fe.open(c,577);fe.write(f,r,0,r.length,0,i),fe.close(f),fe.chmod(c,a)}return c},createDevice:(e,t,r,n)=>{var o=ce.join2("string"==typeof e?e:fe.getPath(e),t),i=fe.getMode(!!r,!!n);fe.createDevice.major||(fe.createDevice.major=64);var s=fe.makedev(fe.createDevice.major++,0);return fe.registerDevice(s,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var s=0,a=0;a<o;a++){var c;try{c=r()}catch(e){throw new fe.ErrnoError(29)}if(void 0===c&&0===s)throw new fe.ErrnoError(6);if(null==c)break;s++,t[n+a]=c}return s&&(e.node.timestamp=Date.now()),s},write:(e,t,r,o,i)=>{for(var s=0;s<o;s++)try{n(t[r+s])}catch(e){throw new fe.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),s}}),fe.mkdev(o,i,s)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)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.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Ee(s(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new fe.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,s=1048576;o||(s=n);var a=this;a.setDataGetter((e=>{var t=e*s,o=(e+1)*s-1;if(o=Math.min(o,n-1),void 0===a.chunks[e]&&(a.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==s&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Ee(o.responseText||"",!0)})(t,o)),void 0===a.chunks[e])throw new Error("doXHR failed!");return a.chunks[e]})),!i&&n||(s=n=1,n=this.getter(0).length,s=n,E("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=s,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!w)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:s}}else a={isDevice:!1,url:r};var c=fe.createFile(e,t,a,n,o);a.contents?c.contents=a.contents:a.url&&(c.contents=null,c.url=a.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];u[e]=function(){return fe.forceLoadFile(c),t.apply(null,arguments)}})),u.read=(e,t,r,n,o)=>{fe.forceLoadFile(c);var i=e.node.contents;if(o>=i.length)return 0;var s=Math.min(i.length-o,n);if(i.slice)for(var a=0;a<s;a++)t[r+a]=i[o+a];else for(a=0;a<s;a++)t[r+a]=i.get(o+a);return s},c.stream_ops=u,c},createPreloadedFile:(e,t,r,n,o,i,s,c,u,l)=>{var d=t?ue.resolve(ce.join2(e,t)):e;function f(r){function a(r){l&&l(),c||fe.createDataFile(e,t,r,n,o,u),i&&i(),ee()}Browser.handledByPreloadPlugin(r,d,a,(()=>{s&&s(),ee()}))||a(r)}Q(),"string"==typeof r?function(e,t,r,n){var o=n?"":"al "+e;a(e,(function(r){P(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&ee()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&Q()}(r,(e=>f(e)),s):f(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=fe.indexedDB();try{var o=n.open(fe.DB_NAME(),fe.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{E("creating db"),o.result.createObjectStore(fe.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([fe.DB_STORE_NAME],"readwrite"),i=n.objectStore(fe.DB_STORE_NAME),s=0,a=0,c=e.length;function u(){0==a?t():r()}e.forEach((e=>{var t=i.put(fe.analyzePath(e).object.contents,e);t.onsuccess=()=>{++s+a==c&&u()},t.onerror=()=>{a++,s+a==c&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=fe.indexedDB();try{var o=n.open(fe.DB_NAME(),fe.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([fe.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var s=i.objectStore(fe.DB_STORE_NAME),a=0,c=0,u=e.length;function l(){0==c?t():r()}e.forEach((e=>{var t=s.get(e);t.onsuccess=()=>{fe.analyzePath(e).exists&&fe.unlink(e),fe.createDataFile(ce.dirname(e),ce.basename(e),t.result,!0,!0,!0),++a+c==u&&l()},t.onerror=()=>{c++,a+c==u&&l()}})),i.onerror=r},o.onerror=r}},he={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(ce.isAbs(t))return t;var n;if(-100===e)n=fe.cwd();else{var o=fe.getStream(e);if(!o)throw new fe.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new fe.ErrnoError(44);return n}return ce.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&ce.normalize(t)!==ce.normalize(fe.getPath(e.node)))return-54;throw e}return R[r>>2]=n.dev,R[r+4>>2]=0,R[r+8>>2]=n.ino,R[r+12>>2]=n.mode,R[r+16>>2]=n.nlink,R[r+20>>2]=n.uid,R[r+24>>2]=n.gid,R[r+28>>2]=n.rdev,R[r+32>>2]=0,W=[n.size>>>0,(q=n.size,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],R[r+40>>2]=W[0],R[r+44>>2]=W[1],R[r+48>>2]=4096,R[r+52>>2]=n.blocks,R[r+56>>2]=n.atime.getTime()/1e3|0,R[r+60>>2]=0,R[r+64>>2]=n.mtime.getTime()/1e3|0,R[r+68>>2]=0,R[r+72>>2]=n.ctime.getTime()/1e3|0,R[r+76>>2]=0,W=[n.ino>>>0,(q=n.ino,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],R[r+80>>2]=W[0],R[r+84>>2]=W[1],0},doMsync:function(e,t,r,n,o){var i=D.slice(e,e+r);fe.msync(t,i,o,r,n)},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return fe.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var n=fe.readlink(e),o=Math.min(r,L(n)),i=T[t+o];return H(n,t,r+1),T[t+o]=i,o},doAccess:function(e,t){if(-8&t)return-28;var r=fe.lookupPath(e,{follow:!0}).node;if(!r)return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&fe.nodePermissions(r,n)?-2:0},doReadv:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var s=R[t>>2],a=R[t+4>>2];t+=8;var c=fe.read(e,T,s,a,n);if(c<0)return-1;if(o+=c,c<a)break}return o},doWritev:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var s=R[t>>2],a=R[t+4>>2];t+=8;var c=fe.write(e,T,s,a,n);if(c<0)return-1;o+=c}return o},varargs:void 0,get:function(){return he.varargs+=4,R[he.varargs-4>>2]},getStr:function(e){return x(e)},getStreamFromFD:function(e){var t=fe.getStream(e);if(!t)throw new fe.ErrnoError(8);return t}},pe={BUCKET_BUFFER_SIZE:8192,mount:function(e){return fe.createNode(null,"/",16895,0)},createPipe:function(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(pe.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=pe.nextname(),r=pe.nextname(),n=fe.createNode(pe.root,t,4096,0),o=fe.createNode(pe.root,r,4096,0);n.pipe=e,o.pipe=e;var i=fe.createStream({path:t,node:n,flags:0,seekable:!1,stream_ops:pe.stream_ops});n.stream=i;var s=fe.createStream({path:r,node:o,flags:1,seekable:!1,stream_ops:pe.stream_ops});return o.stream=s,{readable_fd:i.fd,writable_fd:s.fd}},stream_ops:{poll:function(e){var t=e.node.pipe;if(1==(2097155&e.flags))return 260;if(t.buckets.length>0)for(var r=0;r<t.buckets.length;r++){var n=t.buckets[r];if(n.offset-n.roffset>0)return 65}return 0},ioctl:function(e,t,r){return 28},fsync:function(e){return 28},read:function(e,t,r,n,o){for(var i=e.node.pipe,s=0,a=0;a<i.buckets.length;a++){var c=i.buckets[a];s+=c.offset-c.roffset}P(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var u=t.subarray(r,r+n);if(n<=0)return 0;if(0==s)throw new fe.ErrnoError(6);var l=Math.min(s,n),d=l,f=0;for(a=0;a<i.buckets.length;a++){var h=i.buckets[a],p=h.offset-h.roffset;if(l<=p){var m=h.buffer.subarray(h.roffset,h.offset);l<p?(m=m.subarray(0,l),h.roffset+=l):f++,u.set(m);break}m=h.buffer.subarray(h.roffset,h.offset),u.set(m),u=u.subarray(m.byteLength),l-=m.byteLength,f++}return f&&f==i.buckets.length&&(f--,i.buckets[f].offset=0,i.buckets[f].roffset=0),i.buckets.splice(0,f),d},write:function(e,t,r,n,o){var i=e.node.pipe;P(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var s=t.subarray(r,r+n),a=s.byteLength;if(a<=0)return 0;var c=null;0==i.buckets.length?(c={buffer:new Uint8Array(pe.BUCKET_BUFFER_SIZE),offset:0,roffset:0},i.buckets.push(c)):c=i.buckets[i.buckets.length-1],P(c.offset<=pe.BUCKET_BUFFER_SIZE);var u=pe.BUCKET_BUFFER_SIZE-c.offset;if(u>=a)return c.buffer.set(s,c.offset),c.offset+=a,a;u>0&&(c.buffer.set(s.subarray(0,u),c.offset),c.offset+=u,s=s.subarray(u,s.byteLength));for(var l=s.byteLength/pe.BUCKET_BUFFER_SIZE|0,d=s.byteLength%pe.BUCKET_BUFFER_SIZE,f=0;f<l;f++){var h={buffer:new Uint8Array(pe.BUCKET_BUFFER_SIZE),offset:pe.BUCKET_BUFFER_SIZE,roffset:0};i.buckets.push(h),h.buffer.set(s.subarray(0,pe.BUCKET_BUFFER_SIZE)),s=s.subarray(pe.BUCKET_BUFFER_SIZE,s.byteLength)}return d>0&&(h={buffer:new Uint8Array(pe.BUCKET_BUFFER_SIZE),offset:s.byteLength,roffset:0},i.buckets.push(h),h.buffer.set(s)),a},close:function(e){var t=e.node.pipe;t.refcnt--,0===t.refcnt&&(t.buckets=null)}},nextname:function(){return pe.nextname.current||(pe.nextname.current=0),"pipe["+pe.nextname.current+++"]"}},me="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";ae=y?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now();var ge={};function we(){if(!we.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(var t in ge)void 0===ge[t]?delete e[t]:e[t]=ge[t];var r=[];for(var t in e)r.push(t+"="+e[t]);we.strings=r}return we.strings}var ye=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=fe.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},ve=365,Se=146;function Ee(e,t,r){var n=r>0?r:L(e)+1,o=new Array(n),i=N(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(ye.prototype,{read:{get:function(){return(this.mode&ve)===ve},set:function(e){e?this.mode|=ve:this.mode&=-366}},write:{get:function(){return(this.mode&Se)===Se},set:function(e){e?this.mode|=Se:this.mode&=-147}},isFolder:{get:function(){return fe.isDir(this.mode)}},isDevice:{get:function(){return fe.isChrdev(this.mode)}}}),fe.FSNode=ye,fe.staticInit();var be,Ae={a:function(e,t,r,n){te("Assertion failed: "+x(e)+", at: "+[t?x(t):"unknown filename",r,n?x(n):"unknown function"])},G:function(e,t){try{return e=he.getStr(e),fe.chmod(e,t),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},F:function(e){try{var t=he.getStreamFromFD(e);return fe.createStream(t,0).fd}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},H:function(e,t,r,n){try{return t=he.getStr(t),t=he.calculateAt(e,t),he.doAccess(t,r)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},e:function(e,t,r){he.varargs=r;try{var n=he.getStreamFromFD(e);switch(t){case 0:return(o=he.get())<0?-28:fe.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=he.get();return n.flags|=o,0;case 5:return o=he.get(),O[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,R[_e()>>2]=i,-1}}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}var i},z:function(e,t){try{var r=he.getStreamFromFD(e);return he.doStat(fe.stat,r.path,t)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},v:function(e,t){try{if(0===t)return-28;var r=fe.cwd(),n=L(r)+1;return t<n?-68:(H(r,e,t),n)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},m:function(e,t,r){he.varargs=r;try{var n=he.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=he.get();return R[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=he.get(),fe.ioctl(n,t,o);default:te("bad ioctl syscall "+t)}}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},x:function(e,t){try{return e=he.getStr(e),he.doStat(fe.lstat,e,t)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},w:function(e,t,r,n){try{t=he.getStr(t);var o=256&n,i=4096&n;return n&=-4353,t=he.calculateAt(e,t,i),he.doStat(o?fe.lstat:fe.stat,t,r)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},h:function(e,t,r,n){he.varargs=n;try{t=he.getStr(t),t=he.calculateAt(e,t);var o=n?he.get():0;return fe.open(t,r,o).fd}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},t:function(e){try{if(0==e)throw new fe.ErrnoError(21);var t=pe.createPipe();return R[e>>2]=t.readable_fd,R[e+4>>2]=t.writable_fd,0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},s:function(e,t,r,n){try{return t=he.getStr(t),t=he.calculateAt(e,t),he.doReadlink(t,r,n)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},q:function(e){try{return e=he.getStr(e),fe.rmdir(e),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},y:function(e,t){try{return e=he.getStr(e),he.doStat(fe.stat,e,t)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},g:function(e,t,r){try{return t=he.getStr(t),t=he.calculateAt(e,t),0===r?fe.unlink(t):512===r?fe.rmdir(t):te("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},C:function(e){},E:function(e,t){te(me)},D:function(e,t){te(me)},l:function(){return Date.now()},B:function(){return!0},b:function(){te("")},k:ae,A:function(e,t,r){D.copyWithin(e,t,t+r)},f:function(e){D.length,te("OOM")},n:function(e,t){var r=0;return we().forEach((function(n,o){var i=t+r;R[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)T[t++>>0]=e.charCodeAt(n);r||(T[t>>0]=0)}(n,i),r+=n.length+1})),0},r:function(e,t){var r=we();R[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),R[t>>2]=n,0},d:function(e){Te(e)},c:function(e){try{var t=he.getStreamFromFD(e);return fe.close(t),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},u:function(e,t){try{var r=he.getStreamFromFD(e),n=r.tty?2:fe.isDir(r.mode)?3:fe.isLink(r.mode)?7:4;return T[t>>0]=n,0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},o:function(e,t,r,n,o,i){try{var s=he.getStreamFromFD(e),a=he.doReadv(s,t,r,n);return R[i>>2]=a,0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},j:function(e,t,r,n){try{var o=he.getStreamFromFD(e),i=he.doReadv(o,t,r);return R[n>>2]=i,0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},p:function(e,t,r,n,o){try{var i=he.getStreamFromFD(e),s=4294967296*r+(t>>>0),a=9007199254740992;return s<=-a||s>=a?-61:(fe.llseek(i,s,n),W=[i.position>>>0,(q=i.position,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],R[o>>2]=W[0],R[o+4>>2]=W[1],i.getdents&&0===s&&0===n&&(i.getdents=null),0)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},i:function(e,t,r,n){try{var o=he.getStreamFromFD(e),i=he.doWritev(o,t,r);return R[n>>2]=i,0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},I:function(e){De(e)}},_e=(function(){var e={a:Ae};function t(e,t){var r,n,o=e.exports;i.asm=o,A=i.asm.J,r=A.buffer,k=r,i.HEAP8=T=new Int8Array(r),i.HEAP16=O=new Int16Array(r),i.HEAP32=R=new Int32Array(r),i.HEAPU8=D=new Uint8Array(r),i.HEAPU16=new Uint16Array(r),i.HEAPU32=new Uint32Array(r),i.HEAPF32=new Float32Array(r),i.HEAPF64=new Float64Array(r),B=i.asm.N,n=i.asm.K,V.unshift(n),ee()}function r(e){t(e.instance)}function n(t){return function(){if(!S&&(g||w)){if("function"==typeof fetch&&!ne(X))return fetch(X,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+X+"'";return e.arrayBuffer()})).catch((function(){return oe(X)}));if(a)return new Promise((function(e,t){a(X,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return oe(X)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){b("failed to asynchronously prepare wasm: "+e),te(e)}))}if(Q(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return b("Module.instantiateWasm callback failed with error: "+e),!1}(S||"function"!=typeof WebAssembly.instantiateStreaming||re(X)||ne(X)||"function"!=typeof fetch?n(r):fetch(X,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return b("wasm streaming compile failed: "+e),b("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.K).apply(null,arguments)},i.___errno_location=function(){return(_e=i.___errno_location=i.asm.L).apply(null,arguments)}),Ie=(i._main=function(){return(i._main=i.asm.M).apply(null,arguments)},i.stackAlloc=function(){return(Ie=i.stackAlloc=i.asm.O).apply(null,arguments)});function Ce(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Pe(e){var t=i._main,r=(e=e||[]).length+1,n=Ie(4*(r+1));R[n>>2]=U(p);for(var o=1;o<r;o++)R[(n>>2)+o]=U(e[o-1]);R[(n>>2)+r]=0;try{var s=t(r,n);return Te(s),s}catch(e){return function(e){if(e instanceof Ce||"unwind"==e)return I;m(1,e)}(e)}}function ke(e){function r(){be||(be=!0,i.calledRun=!0,C||(i.noFSInit||fe.init.initialized||fe.init(),fe.ignorePermissions=!1,le.init(),pe.root=fe.mount(pe,{},null),ie(V),ie(j),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Oe&&Pe(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),$.unshift(e);var e;ie($)}()))}e=e||h,Y>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),z.unshift(e);var e;ie(z)}(),Y>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function Te(e,t){I=e,De(e)}function De(e){I=e,G()||(i.onExit&&i.onExit(e),C=!0),m(e,new Ce(e))}if(i.FS=fe,J=function e(){be||ke(),be||(J=e)},i.run=ke,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Oe=!0;return i.noInitialRun&&(Oe=!1),ke(),e.ready});e.exports=o},890:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(e){var t,o,i=void 0!==(e=e||{})?e:{};i.ready=new Promise((function(e,r){t=e,o=r}));var s,a,c,u,l,d,f=Object.assign({},i),h=[],p="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,w="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,v="";y?(v=w?r(17).dirname(v)+"/":__dirname+"/",d=()=>{l||(u=r(147),l=r(17))},s=function(e,t){return d(),e=l.normalize(e),u.readFileSync(e,t?void 0:"utf8")},c=e=>{var t=s(e,!0);return t.buffer||(t=new Uint8Array(t)),t},a=(e,t,r)=>{d(),e=l.normalize(e),u.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),h=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof Ae))throw e})),process.on("unhandledRejection",(function(e){throw e})),m=(e,t)=>{if($())throw process.exitCode=e,t;var r;(r=t)instanceof Ae||b("exiting due to exception: "+r),process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):(g||w)&&(w?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),n&&(v=n),v=0!==v.indexOf("blob:")?v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},w&&(c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),a=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var S,E=i.print||console.log.bind(console),b=i.printErr||console.warn.bind(console);Object.assign(i,f),f=null,i.arguments&&(h=i.arguments),i.thisProgram&&(p=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(S=i.wasmBinary);var A,_=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&ee("no native wasm support detected");var I,C,P,k,T,D,O=!1,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function M(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&R)return R.decode(e.subarray(t,o));for(var i="";t<o;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var c=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|c:(7&s)<<18|a<<12|c<<6|63&e[t++])<65536)i+=String.fromCharCode(s);else{var u=s-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function F(e,t){return e?M(k,e,t):""}function x(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(r>=i)break;t[r++]=a}else if(a<=2047){if(r+1>=i)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=i)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=i)break;t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a}}return t[r]=0,r-o}function N(e,t,r){return x(e,k,t,r)}function H(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}function L(e){var t=H(e)+1,r=be(t);return x(e,P,r,t),r}i.INITIAL_MEMORY;var U,B=[],z=[],V=[],j=[];function $(){return _}var G,X,K,q,W=0,Y=null,Z=null;function J(e){W++,i.monitorRunDependencies&&i.monitorRunDependencies(W)}function Q(e){if(W--,i.monitorRunDependencies&&i.monitorRunDependencies(W),0==W&&(null!==Y&&(clearInterval(Y),Y=null),Z)){var t=Z;Z=null,t()}}function ee(e){i.onAbort&&i.onAbort(e),b(e="Aborted("+e+")"),O=!0,I=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function te(e){return e.startsWith("data:application/octet-stream;base64,")}function re(e){return e.startsWith("file://")}function ne(e){try{if(e==G&&S)return new Uint8Array(S);if(c)return c(e);throw"both async and sync fetching of the wasm failed"}catch(e){ee(e)}}function oe(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?ie(r)():ie(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(i)}}function ie(e){return U.get(e)}te(G="objcopy.wasm")||(X=G,G=i.locateFile?i.locateFile(X,v):v+X);var se={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=se.isAbs(e),r="/"===e.substr(-1);return(e=se.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=se.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=se.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return se.normalize(e.join("/"))},join2:(e,t)=>se.normalize(e+"/"+t)},ae={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:de.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=se.isAbs(n)}return(t?"/":"")+(e=se.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ae.resolve(e).substr(1),t=ae.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),s=i,a=0;a<i;a++)if(n[a]!==o[a]){s=a;break}var c=[];for(a=s;a<n.length;a++)c.push("..");return(c=c.concat(o.slice(s))).join("/")}},ce={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){ce.ttys[e]={input:[],output:[],ops:t},de.registerDevice(e,ce.stream_ops)},stream_ops:{open:function(e){var t=ce.ttys[e.node.rdev];if(!t)throw new de.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new de.ErrnoError(60);for(var i=0,s=0;s<n;s++){var a;try{a=e.tty.ops.get_char(e.tty)}catch(e){throw new de.ErrnoError(29)}if(void 0===a&&0===i)throw new de.ErrnoError(6);if(null==a)break;i++,t[r+s]=a}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new de.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new de.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(y){var r=Buffer.alloc(256),n=0;try{n=u.readSync(process.stdin.fd,r,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;n=0}t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=ye(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(E(M(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(E(M(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(b(M(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(b(M(e.output,0)),e.output=[])}}},ue={ops_table:null,mount:function(e){return ue.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(de.isBlkdev(r)||de.isFIFO(r))throw new de.ErrnoError(63);ue.ops_table||(ue.ops_table={dir:{node:{getattr:ue.node_ops.getattr,setattr:ue.node_ops.setattr,lookup:ue.node_ops.lookup,mknod:ue.node_ops.mknod,rename:ue.node_ops.rename,unlink:ue.node_ops.unlink,rmdir:ue.node_ops.rmdir,readdir:ue.node_ops.readdir,symlink:ue.node_ops.symlink},stream:{llseek:ue.stream_ops.llseek}},file:{node:{getattr:ue.node_ops.getattr,setattr:ue.node_ops.setattr},stream:{llseek:ue.stream_ops.llseek,read:ue.stream_ops.read,write:ue.stream_ops.write,allocate:ue.stream_ops.allocate,mmap:ue.stream_ops.mmap,msync:ue.stream_ops.msync}},link:{node:{getattr:ue.node_ops.getattr,setattr:ue.node_ops.setattr,readlink:ue.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ue.node_ops.getattr,setattr:ue.node_ops.setattr},stream:de.chrdev_stream_ops}});var o=de.createNode(e,t,r,n);return de.isDir(o.mode)?(o.node_ops=ue.ops_table.dir.node,o.stream_ops=ue.ops_table.dir.stream,o.contents={}):de.isFile(o.mode)?(o.node_ops=ue.ops_table.file.node,o.stream_ops=ue.ops_table.file.stream,o.usedBytes=0,o.contents=null):de.isLink(o.mode)?(o.node_ops=ue.ops_table.link.node,o.stream_ops=ue.ops_table.link.stream):de.isChrdev(o.mode)&&(o.node_ops=ue.ops_table.chrdev.node,o.stream_ops=ue.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=de.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,de.isDir(e.mode)?t.size=4096:de.isFile(e.mode)?t.size=e.usedBytes:de.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ue.resizeFileStorage(e,t.size)},lookup:function(e,t){throw de.genericErrors[44]},mknod:function(e,t,r,n){return ue.createNode(e,t,r,n)},rename:function(e,t,r){if(de.isDir(e.mode)){var n;try{n=de.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new de.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=de.lookupNode(e,t);for(var n in r.contents)throw new de.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=ue.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!de.isLink(e.mode))throw new de.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&i.subarray)t.set(i.subarray(o,o+s),r);else for(var a=0;a<s;a++)t[r+a]=i[o+a];return s},write:function(e,t,r,n,o,i){if(!n)return 0;var s=e.node;if(s.timestamp=Date.now(),t.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=t.subarray(r,r+n),s.usedBytes=n,n;if(0===s.usedBytes&&0===o)return s.contents=t.slice(r,r+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(t.subarray(r,r+n),o),n}if(ue.expandFileStorage(s,o+n),s.contents.subarray&&t.subarray)s.contents.set(t.subarray(r,r+n),o);else for(var a=0;a<n;a++)s.contents[o+a]=t[r+a];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&de.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new de.ErrnoError(28);return n},allocate:function(e,t,r){ue.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,i){if(0!==t)throw new de.ErrnoError(28);if(!de.isFile(e.node.mode))throw new de.ErrnoError(43);var s,a,c=e.node.contents;if(2&i||c.buffer!==C){if((n>0||n+r<c.length)&&(c=c.subarray?c.subarray(n,n+r):Array.prototype.slice.call(c,n,n+r)),a=!0,!(s=void ee()))throw new de.ErrnoError(48);P.set(c,s)}else a=!1,s=c.byteOffset;return{ptr:s,allocated:a}},msync:function(e,t,r,n,o){if(!de.isFile(e.node.mode))throw new de.ErrnoError(43);return 2&o||ue.stream_ops.write(e,t,0,n,r,!1),0}}};function le(e,t,r,n){var o=n?"":"al "+e;a(e,(function(r){var n;n='Loading data file "'+e+'" failed (no arrayBuffer).',r||ee(n),t(new Uint8Array(r)),o&&Q()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&J()}var de={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=ae.resolve(de.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new de.ErrnoError(32);for(var r=se.normalizeArray(e.split("/").filter((e=>!!e)),!1),n=de.root,o="/",i=0;i<r.length;i++){var s=i===r.length-1;if(s&&t.parent)break;if(n=de.lookupNode(n,r[i]),o=se.join2(o,r[i]),de.isMountpoint(n)&&(!s||s&&t.follow_mount)&&(n=n.mounted.root),!s||t.follow)for(var a=0;de.isLink(n.mode);){var c=de.readlink(o);if(o=ae.resolve(se.dirname(o),c),n=de.lookupPath(o,{recurse_count:t.recurse_count+1}).node,a++>40)throw new de.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(de.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%de.nameTable.length},hashAddNode:e=>{var t=de.hashName(e.parent.id,e.name);e.name_next=de.nameTable[t],de.nameTable[t]=e},hashRemoveNode:e=>{var t=de.hashName(e.parent.id,e.name);if(de.nameTable[t]===e)de.nameTable[t]=e.name_next;else for(var r=de.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=de.mayLookup(e);if(r)throw new de.ErrnoError(r,e);for(var n=de.hashName(e.id,t),o=de.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return de.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new de.FSNode(e,t,r,n);return de.hashAddNode(o),o},destroyNode:e=>{de.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=de.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>de.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>{var t=de.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return de.lookupNode(e,t),20}catch(e){}return de.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=de.lookupNode(e,t)}catch(e){return e.errno}var o=de.nodePermissions(e,"wx");if(o)return o;if(r){if(!de.isDir(n.mode))return 54;if(de.isRoot(n)||de.getPath(n)===de.cwd())return 10}else if(de.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?de.isLink(e.mode)?32:de.isDir(e.mode)&&("r"!==de.flagsToPermissionString(t)||512&t)?31:de.nodePermissions(e,de.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=de.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!de.streams[r])return r;throw new de.ErrnoError(33)},getStream:e=>de.streams[e],createStream:(e,t,r)=>{de.FSStream||(de.FSStream=function(){this.shared={}},de.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get function(){return this.shared.position},set:function(e){this.shared.position=e}}}),e=Object.assign(new de.FSStream,e);var n=de.nextfd(t,r);return e.fd=n,de.streams[n]=e,e},closeStream:e=>{de.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=de.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new de.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{de.devices[e]={stream_ops:t}},getDevice:e=>de.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),de.syncFSRequests++,de.syncFSRequests>1&&b("warning: "+de.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=de.getMounts(de.root.mount),n=0;function o(e){return de.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&de.root)throw new de.ErrnoError(10);if(!o&&!i){var s=de.lookupPath(r,{follow_mount:!1});if(r=s.path,n=s.node,de.isMountpoint(n))throw new de.ErrnoError(10);if(!de.isDir(n.mode))throw new de.ErrnoError(54)}var a={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(a);return c.mount=a,a.root=c,o?de.root=c:n&&(n.mounted=a,n.mount&&n.mount.mounts.push(a)),c},unmount:e=>{var t=de.lookupPath(e,{follow_mount:!1});if(!de.isMountpoint(t.node))throw new de.ErrnoError(28);var r=t.node,n=r.mounted,o=de.getMounts(n);Object.keys(de.nameTable).forEach((e=>{for(var t=de.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&de.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=de.lookupPath(e,{parent:!0}).node,o=se.basename(e);if(!o||"."===o||".."===o)throw new de.ErrnoError(28);var i=de.mayCreate(n,o);if(i)throw new de.ErrnoError(i);if(!n.node_ops.mknod)throw new de.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,de.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,de.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{de.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,de.mknod(e,t,r)),symlink:(e,t)=>{if(!ae.resolve(e))throw new de.ErrnoError(44);var r=de.lookupPath(t,{parent:!0}).node;if(!r)throw new de.ErrnoError(44);var n=se.basename(t),o=de.mayCreate(r,n);if(o)throw new de.ErrnoError(o);if(!r.node_ops.symlink)throw new de.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=se.dirname(e),i=se.dirname(t),s=se.basename(e),a=se.basename(t);if(r=de.lookupPath(e,{parent:!0}).node,n=de.lookupPath(t,{parent:!0}).node,!r||!n)throw new de.ErrnoError(44);if(r.mount!==n.mount)throw new de.ErrnoError(75);var c,u=de.lookupNode(r,s),l=ae.relative(e,i);if("."!==l.charAt(0))throw new de.ErrnoError(28);if("."!==(l=ae.relative(t,o)).charAt(0))throw new de.ErrnoError(55);try{c=de.lookupNode(n,a)}catch(e){}if(u!==c){var d=de.isDir(u.mode),f=de.mayDelete(r,s,d);if(f)throw new de.ErrnoError(f);if(f=c?de.mayDelete(n,a,d):de.mayCreate(n,a))throw new de.ErrnoError(f);if(!r.node_ops.rename)throw new de.ErrnoError(63);if(de.isMountpoint(u)||c&&de.isMountpoint(c))throw new de.ErrnoError(10);if(n!==r&&(f=de.nodePermissions(r,"w")))throw new de.ErrnoError(f);de.hashRemoveNode(u);try{r.node_ops.rename(u,n,a)}catch(e){throw e}finally{de.hashAddNode(u)}}},rmdir:e=>{var t=de.lookupPath(e,{parent:!0}).node,r=se.basename(e),n=de.lookupNode(t,r),o=de.mayDelete(t,r,!0);if(o)throw new de.ErrnoError(o);if(!t.node_ops.rmdir)throw new de.ErrnoError(63);if(de.isMountpoint(n))throw new de.ErrnoError(10);t.node_ops.rmdir(t,r),de.destroyNode(n)},readdir:e=>{var t=de.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new de.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=de.lookupPath(e,{parent:!0}).node;if(!t)throw new de.ErrnoError(44);var r=se.basename(e),n=de.lookupNode(t,r),o=de.mayDelete(t,r,!1);if(o)throw new de.ErrnoError(o);if(!t.node_ops.unlink)throw new de.ErrnoError(63);if(de.isMountpoint(n))throw new de.ErrnoError(10);t.node_ops.unlink(t,r),de.destroyNode(n)},readlink:e=>{var t=de.lookupPath(e).node;if(!t)throw new de.ErrnoError(44);if(!t.node_ops.readlink)throw new de.ErrnoError(28);return ae.resolve(de.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=de.lookupPath(e,{follow:!t}).node;if(!r)throw new de.ErrnoError(44);if(!r.node_ops.getattr)throw new de.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>de.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?de.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new de.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{de.chmod(e,t,!0)},fchmod:(e,t)=>{var r=de.getStream(e);if(!r)throw new de.ErrnoError(8);de.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?de.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new de.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{de.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=de.getStream(e);if(!n)throw new de.ErrnoError(8);de.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new de.ErrnoError(28);var r;if(!(r="string"==typeof e?de.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new de.ErrnoError(63);if(de.isDir(r.mode))throw new de.ErrnoError(31);if(!de.isFile(r.mode))throw new de.ErrnoError(28);var n=de.nodePermissions(r,"w");if(n)throw new de.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=de.getStream(e);if(!r)throw new de.ErrnoError(8);if(0==(2097155&r.flags))throw new de.ErrnoError(28);de.truncate(r.node,t)},utime:(e,t,r)=>{var n=de.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r,n,o)=>{if(""===e)throw new de.ErrnoError(44);var s;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?de.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)s=e;else{e=se.normalize(e);try{s=de.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var a=!1;if(64&t)if(s){if(128&t)throw new de.ErrnoError(20)}else s=de.mknod(e,r,0),a=!0;if(!s)throw new de.ErrnoError(44);if(de.isChrdev(s.mode)&&(t&=-513),65536&t&&!de.isDir(s.mode))throw new de.ErrnoError(54);if(!a){var c=de.mayOpen(s,t);if(c)throw new de.ErrnoError(c)}512&t&&de.truncate(s,0),t&=-131713;var u=de.createStream({node:s,path:de.getPath(s),flags:t,seekable:!0,position:0,stream_ops:s.stream_ops,ungotten:[],error:!1},n,o);return u.stream_ops.open&&u.stream_ops.open(u),!i.logReadFiles||1&t||(de.readFiles||(de.readFiles={}),e in de.readFiles||(de.readFiles[e]=1)),u},close:e=>{if(de.isClosed(e))throw new de.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{de.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(de.isClosed(e))throw new de.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new de.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new de.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new de.ErrnoError(28);if(de.isClosed(e))throw new de.ErrnoError(8);if(1==(2097155&e.flags))throw new de.ErrnoError(8);if(de.isDir(e.node.mode))throw new de.ErrnoError(31);if(!e.stream_ops.read)throw new de.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new de.ErrnoError(70)}else o=e.position;var s=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=s),s},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new de.ErrnoError(28);if(de.isClosed(e))throw new de.ErrnoError(8);if(0==(2097155&e.flags))throw new de.ErrnoError(8);if(de.isDir(e.node.mode))throw new de.ErrnoError(31);if(!e.stream_ops.write)throw new de.ErrnoError(28);e.seekable&&1024&e.flags&&de.llseek(e,0,2);var s=void 0!==o;if(s){if(!e.seekable)throw new de.ErrnoError(70)}else o=e.position;var a=e.stream_ops.write(e,t,r,n,o,i);return s||(e.position+=a),a},allocate:(e,t,r)=>{if(de.isClosed(e))throw new de.ErrnoError(8);if(t<0||r<=0)throw new de.ErrnoError(28);if(0==(2097155&e.flags))throw new de.ErrnoError(8);if(!de.isFile(e.node.mode)&&!de.isDir(e.node.mode))throw new de.ErrnoError(43);if(!e.stream_ops.allocate)throw new de.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o,i)=>{if(0!=(2&o)&&0==(2&i)&&2!=(2097155&e.flags))throw new de.ErrnoError(2);if(1==(2097155&e.flags))throw new de.ErrnoError(2);if(!e.stream_ops.mmap)throw new de.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,i)},msync:(e,t,r,n,o)=>e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new de.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,n=de.open(e,t.flags),o=de.stat(e).size,i=new Uint8Array(o);return de.read(n,i,0,o,0),"utf8"===t.encoding?r=M(i,0):"binary"===t.encoding&&(r=i),de.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=de.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(H(t)+1),i=x(t,o,0,o.length);de.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");de.write(n,t,0,t.byteLength,void 0,r.canOwn)}de.close(n)},cwd:()=>de.currentPath,chdir:e=>{var t=de.lookupPath(e,{follow:!0});if(null===t.node)throw new de.ErrnoError(44);if(!de.isDir(t.node.mode))throw new de.ErrnoError(54);var r=de.nodePermissions(t.node,"x");if(r)throw new de.ErrnoError(r);de.currentPath=t.path},createDefaultDirectories:()=>{de.mkdir("/tmp"),de.mkdir("/home"),de.mkdir("/home/web_user")},createDefaultDevices:()=>{de.mkdir("/dev"),de.registerDevice(de.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),de.mkdev("/dev/null",de.makedev(1,3)),ce.register(de.makedev(5,0),ce.default_tty_ops),ce.register(de.makedev(6,0),ce.default_tty1_ops),de.mkdev("/dev/tty",de.makedev(5,0)),de.mkdev("/dev/tty1",de.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(y)try{var t=r(113);return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){ee("randomDevice")}}();de.createDevice("/dev","random",e),de.createDevice("/dev","urandom",e),de.mkdir("/dev/shm"),de.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{de.mkdir("/proc");var e=de.mkdir("/proc/self");de.mkdir("/proc/self/fd"),de.mount({mount:()=>{var t=de.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=de.getStream(r);if(!n)throw new de.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?de.createDevice("/dev","stdin",i.stdin):de.symlink("/dev/tty","/dev/stdin"),i.stdout?de.createDevice("/dev","stdout",null,i.stdout):de.symlink("/dev/tty","/dev/stdout"),i.stderr?de.createDevice("/dev","stderr",null,i.stderr):de.symlink("/dev/tty1","/dev/stderr"),de.open("/dev/stdin",0),de.open("/dev/stdout",1),de.open("/dev/stderr",1)},ensureErrnoError:()=>{de.ErrnoError||(de.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},de.ErrnoError.prototype=new Error,de.ErrnoError.prototype.constructor=de.ErrnoError,[44].forEach((e=>{de.genericErrors[e]=new de.ErrnoError(e),de.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{de.ensureErrnoError(),de.nameTable=new Array(4096),de.mount(ue,{},"/"),de.createDefaultDirectories(),de.createDefaultDevices(),de.createSpecialDirectories(),de.filesystems={MEMFS:ue}},init:(e,t,r)=>{de.init.initialized=!0,de.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,de.createStandardStreams()},quit:()=>{de.init.initialized=!1;for(var e=0;e<de.streams.length;e++){var t=de.streams[e];t&&de.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=de.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=de.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=de.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=se.basename(e),n=de.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:de.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var s=se.join2(e,i);try{de.mkdir(s)}catch(e){}e=s}}return s},createFile:(e,t,r,n,o)=>{var i=se.join2("string"==typeof e?e:de.getPath(e),t),s=de.getMode(n,o);return de.create(i,s)},createDataFile:(e,t,r,n,o,i)=>{var s=t;e&&(e="string"==typeof e?e:de.getPath(e),s=t?se.join2(e,t):e);var a=de.getMode(n,o),c=de.create(s,a);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,d=r.length;l<d;++l)u[l]=r.charCodeAt(l);r=u}de.chmod(c,146|a);var f=de.open(c,577);de.write(f,r,0,r.length,0,i),de.close(f),de.chmod(c,a)}return c},createDevice:(e,t,r,n)=>{var o=se.join2("string"==typeof e?e:de.getPath(e),t),i=de.getMode(!!r,!!n);de.createDevice.major||(de.createDevice.major=64);var s=de.makedev(de.createDevice.major++,0);return de.registerDevice(s,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var s=0,a=0;a<o;a++){var c;try{c=r()}catch(e){throw new de.ErrnoError(29)}if(void 0===c&&0===s)throw new de.ErrnoError(6);if(null==c)break;s++,t[n+a]=c}return s&&(e.node.timestamp=Date.now()),s},write:(e,t,r,o,i)=>{for(var s=0;s<o;s++)try{n(t[r+s])}catch(e){throw new de.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),s}}),de.mkdev(o,i,s)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)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.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ye(s(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new de.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,s=1048576;o||(s=n);var a=this;a.setDataGetter((e=>{var t=e*s,o=(e+1)*s-1;if(o=Math.min(o,n-1),void 0===a.chunks[e]&&(a.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==s&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ye(o.responseText||"",!0)})(t,o)),void 0===a.chunks[e])throw new Error("doXHR failed!");return a.chunks[e]})),!i&&n||(s=n=1,n=this.getter(0).length,s=n,E("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=s,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!w)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:s}}else a={isDevice:!1,url:r};var c=de.createFile(e,t,a,n,o);a.contents?c.contents=a.contents:a.url&&(c.contents=null,c.url=a.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];u[e]=function(){return de.forceLoadFile(c),t.apply(null,arguments)}})),u.read=(e,t,r,n,o)=>{de.forceLoadFile(c);var i=e.node.contents;if(o>=i.length)return 0;var s=Math.min(i.length-o,n);if(i.slice)for(var a=0;a<s;a++)t[r+a]=i[o+a];else for(a=0;a<s;a++)t[r+a]=i.get(o+a);return s},c.stream_ops=u,c},createPreloadedFile:(e,t,r,n,o,i,s,a,c,u)=>{var l=t?ae.resolve(se.join2(e,t)):e;function d(r){function d(r){u&&u(),a||de.createDataFile(e,t,r,n,o,c),i&&i(),Q()}Browser.handledByPreloadPlugin(r,l,d,(()=>{s&&s(),Q()}))||d(r)}J(),"string"==typeof r?le(r,(e=>d(e)),s):d(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=de.indexedDB();try{var o=n.open(de.DB_NAME(),de.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{E("creating db"),o.result.createObjectStore(de.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([de.DB_STORE_NAME],"readwrite"),i=n.objectStore(de.DB_STORE_NAME),s=0,a=0,c=e.length;function u(){0==a?t():r()}e.forEach((e=>{var t=i.put(de.analyzePath(e).object.contents,e);t.onsuccess=()=>{++s+a==c&&u()},t.onerror=()=>{a++,s+a==c&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=de.indexedDB();try{var o=n.open(de.DB_NAME(),de.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([de.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var s=i.objectStore(de.DB_STORE_NAME),a=0,c=0,u=e.length;function l(){0==c?t():r()}e.forEach((e=>{var t=s.get(e);t.onsuccess=()=>{de.analyzePath(e).exists&&de.unlink(e),de.createDataFile(se.dirname(e),se.basename(e),t.result,!0,!0,!0),++a+c==u&&l()},t.onerror=()=>{c++,a+c==u&&l()}})),i.onerror=r},o.onerror=r}},fe={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(se.isAbs(t))return t;var n;if(-100===e)n=de.cwd();else{var o=de.getStream(e);if(!o)throw new de.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new de.ErrnoError(44);return n}return se.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&se.normalize(t)!==se.normalize(de.getPath(e.node)))return-54;throw e}return D[r>>2]=n.dev,D[r+4>>2]=0,D[r+8>>2]=n.ino,D[r+12>>2]=n.mode,D[r+16>>2]=n.nlink,D[r+20>>2]=n.uid,D[r+24>>2]=n.gid,D[r+28>>2]=n.rdev,D[r+32>>2]=0,q=[n.size>>>0,(K=n.size,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],D[r+40>>2]=q[0],D[r+44>>2]=q[1],D[r+48>>2]=4096,D[r+52>>2]=n.blocks,D[r+56>>2]=n.atime.getTime()/1e3|0,D[r+60>>2]=0,D[r+64>>2]=n.mtime.getTime()/1e3|0,D[r+68>>2]=0,D[r+72>>2]=n.ctime.getTime()/1e3|0,D[r+76>>2]=0,q=[n.ino>>>0,(K=n.ino,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],D[r+80>>2]=q[0],D[r+84>>2]=q[1],0},doMsync:function(e,t,r,n,o){var i=k.slice(e,e+r);de.msync(t,i,o,r,n)},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return de.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var n=de.readlink(e),o=Math.min(r,H(n)),i=P[t+o];return N(n,t,r+1),P[t+o]=i,o},doAccess:function(e,t){if(-8&t)return-28;var r=de.lookupPath(e,{follow:!0}).node;if(!r)return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&de.nodePermissions(r,n)?-2:0},doReadv:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var s=D[t>>2],a=D[t+4>>2];t+=8;var c=de.read(e,P,s,a,n);if(c<0)return-1;if(o+=c,c<a)break}return o},doWritev:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var s=D[t>>2],a=D[t+4>>2];t+=8;var c=de.write(e,P,s,a,n);if(c<0)return-1;o+=c}return o},varargs:void 0,get:function(){return fe.varargs+=4,D[fe.varargs-4>>2]},getStr:function(e){return F(e)},getStreamFromFD:function(e){var t=de.getStream(e);if(!t)throw new de.ErrnoError(8);return t}},he={};function pe(){if(!pe.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(var t in he)void 0===he[t]?delete e[t]:e[t]=he[t];var r=[];for(var t in e)r.push(t+"="+e[t]);pe.strings=r}return pe.strings}var me=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=de.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},ge=365,we=146;function ye(e,t,r){var n=r>0?r:H(e)+1,o=new Array(n),i=x(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(me.prototype,{read:{get:function(){return(this.mode&ge)===ge},set:function(e){e?this.mode|=ge:this.mode&=-366}},write:{get:function(){return(this.mode&we)===we},set:function(e){e?this.mode|=we:this.mode&=-147}},isFolder:{get:function(){return de.isDir(this.mode)}},isDevice:{get:function(){return de.isChrdev(this.mode)}}}),de.FSNode=me,de.staticInit();var ve,Se={b:function(e,t,r,n){ee("Assertion failed: "+F(e)+", at: "+[t?F(t):"unknown filename",r,n?F(n):"unknown function"])},k:function(e,t){try{return e=fe.getStr(e),de.chmod(e,t),0}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},D:function(e){try{var t=fe.getStreamFromFD(e);return de.createStream(t,0).fd}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},E:function(e,t,r,n){try{return t=fe.getStr(t),t=fe.calculateAt(e,t),fe.doAccess(t,r)}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},B:function(e,t){try{return de.fchmod(e,t),0}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},d:function(e,t,r){fe.varargs=r;try{var n=fe.getStreamFromFD(e);switch(t){case 0:return(o=fe.get())<0?-28:de.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=fe.get();return n.flags|=o,0;case 5:return o=fe.get(),T[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,D[Ee()>>2]=i,-1}}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}var i},z:function(e,t){try{var r=fe.getStreamFromFD(e);return fe.doStat(de.stat,r.path,t)}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},v:function(e,t){try{if(0===t)return-28;var r=de.cwd(),n=H(r)+1;return t<n?-68:(N(r,e,t),n)}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},l:function(e,t,r){fe.varargs=r;try{var n=fe.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=fe.get();return D[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=fe.get(),de.ioctl(n,t,o);default:ee("bad ioctl syscall "+t)}}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},x:function(e,t){try{return e=fe.getStr(e),fe.doStat(de.lstat,e,t)}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},u:function(e,t,r){try{return t=fe.getStr(t),t=fe.calculateAt(e,t),"/"===(t=se.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),de.mkdir(t,r,0),0}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},w:function(e,t,r,n){try{t=fe.getStr(t);var o=256&n,i=4096&n;return n&=-4353,t=fe.calculateAt(e,t,i),fe.doStat(o?de.lstat:de.stat,t,r)}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},i:function(e,t,r,n){fe.varargs=n;try{t=fe.getStr(t),t=fe.calculateAt(e,t);var o=n?fe.get():0;return de.open(t,r,o).fd}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},t:function(e,t,r,n){try{return t=fe.getStr(t),t=fe.calculateAt(e,t),fe.doReadlink(t,r,n)}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},s:function(e){try{return e=fe.getStr(e),de.rmdir(e),0}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},y:function(e,t){try{return e=fe.getStr(e),fe.doStat(de.stat,e,t)}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},r:function(e,t,r){try{return t=fe.getStr(t),t=fe.calculateAt(e,t),0===r?de.unlink(t):512===r?de.rmdir(t):ee("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},q:function(e,t,r,n){try{if(t=fe.getStr(t),t=fe.calculateAt(e,t,!0),r){var o=D[r>>2],i=D[r+4>>2];s=1e3*o+i/1e6,a=1e3*(o=D[(r+=8)>>2])+(i=D[r+4>>2])/1e6}else var s=Date.now(),a=s;return de.utime(t,s,a),0}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return-e.errno}},j:function(){return Date.now()},C:function(){return!0},a:function(){ee("")},A:function(e,t,r){k.copyWithin(e,t,t+r)},e:function(e){k.length,ee("OOM")},m:function(e,t){var r=0;return pe().forEach((function(n,o){var i=t+r;D[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)P[t++>>0]=e.charCodeAt(n);r||(P[t>>0]=0)}(n,i),r+=n.length+1})),0},o:function(e,t){var r=pe();D[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),D[t>>2]=n,0},f:function(e){Ce(e)},c:function(e){try{var t=fe.getStreamFromFD(e);return de.close(t),0}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return e.errno}},p:function(e,t){try{var r=fe.getStreamFromFD(e),n=r.tty?2:de.isDir(r.mode)?3:de.isLink(r.mode)?7:4;return P[t>>0]=n,0}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return e.errno}},h:function(e,t,r,n){try{var o=fe.getStreamFromFD(e),i=fe.doReadv(o,t,r);return D[n>>2]=i,0}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return e.errno}},n:function(e,t,r,n,o){try{var i=fe.getStreamFromFD(e),s=4294967296*r+(t>>>0),a=9007199254740992;return s<=-a||s>=a?-61:(de.llseek(i,s,n),q=[i.position>>>0,(K=i.position,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],D[o>>2]=q[0],D[o+4>>2]=q[1],i.getdents&&0===s&&0===n&&(i.getdents=null),0)}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return e.errno}},g:function(e,t,r,n){try{var o=fe.getStreamFromFD(e),i=fe.doWritev(o,t,r);return D[n>>2]=i,0}catch(e){if(void 0===de||!(e instanceof de.ErrnoError))throw e;return e.errno}},F:function(e){Pe(e)}},Ee=(function(){var e={a:Se};function t(e,t){var r,n,o=e.exports;i.asm=o,A=i.asm.G,r=A.buffer,C=r,i.HEAP8=P=new Int8Array(r),i.HEAP16=T=new Int16Array(r),i.HEAP32=D=new Int32Array(r),i.HEAPU8=k=new Uint8Array(r),i.HEAPU16=new Uint16Array(r),i.HEAPU32=new Uint32Array(r),i.HEAPF32=new Float32Array(r),i.HEAPF64=new Float64Array(r),U=i.asm.K,n=i.asm.H,z.unshift(n),Q()}function r(e){t(e.instance)}function n(t){return function(){if(!S&&(g||w)){if("function"==typeof fetch&&!re(G))return fetch(G,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+G+"'";return e.arrayBuffer()})).catch((function(){return ne(G)}));if(a)return new Promise((function(e,t){a(G,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return ne(G)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){b("failed to asynchronously prepare wasm: "+e),ee(e)}))}if(J(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return b("Module.instantiateWasm callback failed with error: "+e),!1}(S||"function"!=typeof WebAssembly.instantiateStreaming||te(G)||re(G)||"function"!=typeof fetch?n(r):fetch(G,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return b("wasm streaming compile failed: "+e),b("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.H).apply(null,arguments)},i._main=function(){return(i._main=i.asm.I).apply(null,arguments)},i.___errno_location=function(){return(Ee=i.___errno_location=i.asm.J).apply(null,arguments)}),be=i.stackAlloc=function(){return(be=i.stackAlloc=i.asm.L).apply(null,arguments)};function Ae(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function _e(e){var t=i._main,r=(e=e||[]).length+1,n=be(4*(r+1));D[n>>2]=L(p);for(var o=1;o<r;o++)D[(n>>2)+o]=L(e[o-1]);D[(n>>2)+r]=0;try{var s=t(r,n);return Ce(s),s}catch(e){return function(e){if(e instanceof Ae||"unwind"==e)return I;m(1,e)}(e)}}function Ie(e){function r(){ve||(ve=!0,i.calledRun=!0,O||(i.noFSInit||de.init.initialized||de.init(),de.ignorePermissions=!1,ce.init(),oe(z),oe(V),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),ke&&_e(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),j.unshift(e);var e;oe(j)}()))}e=e||h,W>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),B.unshift(e);var e;oe(B)}(),W>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function Ce(e,t){I=e,Pe(e)}function Pe(e){I=e,$()||(i.onExit&&i.onExit(e),O=!0),m(e,new Ae(e))}if(i.FS=de,Z=function e(){ve||Ie(),ve||(Z=e)},i.run=Ie,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var ke=!0;return i.noInitialRun&&(ke=!1),Ie(),e.ready});e.exports=o},435:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toNumberSafe=t.divide=t.add=t.subtract=void 0,t.subtract=function(e,t){return"bigint"==typeof e&&"bigint"==typeof t||"number"==typeof e&&"number"==typeof t?e-t:BigInt(e)-BigInt(t)},t.add=function(e,t){return"bigint"==typeof e&&"bigint"==typeof t||"number"==typeof e&&"number"==typeof t?e+t:BigInt(e)+BigInt(t)},t.divide=function(e,t){return"bigint"==typeof e&&"bigint"==typeof t?e/t:"number"==typeof e&&"number"==typeof t?parseInt(e/t):BigInt(e)/BigInt(t)};const r=BigInt(1e51);t.toNumberSafe=function(e,t){if("bigint"==typeof e){if(!(e>r))return Number(e);if(!t)throw new Error("BigInt Overflow");t.push("BigInt Overflow")}else if("number"==typeof e)return e;throw new Error("Invalid Input for BigInt conversion")}},411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debug=void 0;const n=r(524);function o(e,t=0){if(void 0!==e){const r=e.toString(16);return 0==t&&(t="bigint"==typeof e?8:r.length<=2?2:r.length<=4?4:8),`0x${r.padStart(t,"0")}`}return"<undefined>"}t.debug=function(e){let t="";const r=e.elf?e.elf:e;if(r){const e=r.bits?r.bits/4:8;if(t+=`Path: ${r.path}\n`,t+=`Class: ${r.classDescription} (${r.class})\n`,t+=`Bits: ${r.bits} bits\n`,t+=`Data: ${r.dataDescription} (${r.data})\n`,t+=`Version: ${r.version}\n`,t+=`OS/ABI: ${r.abiDescription} (${o(r.abi)})\n`,t+=`ABI version: ${r.abiVersion}\n`,t+=`Type: ${r.typeDescription} (${o(r.type)})\n`,t+=`ISA/machine: ${r.isaDescription} (${o(r.isa)})\n`,t+=`ISA/machine version: ${r.isaVersion}\n`,t+=`Entry Point: ${o(r.entryPoint)}\n`,t+=`Program header offset: ${o(r.programHeaderOffset)}\n`,t+=`Section header offset: ${o(r.sectionHeaderOffset)}\n`,t+=`Flags: ${r.flagsDescription} (${o(r.flags)})\n`,t+=`Program headers: ${r.programHeaderEntrySize} bytes × ${r.segments.length}\n`,t+=`Section headers: ${r.sectionHeaderEntrySize} bytes × ${r.sections.length}\n`,t+=`String table section index: ${r.shstrIndex}\n`,r.segments.length){t+="\n\nProgram Header Entries:\n\n",32==r.bits?t+=" # Type Offset VirtAddr PhysAddr FileSize MemSiz Align Flags\n":t+=" # Type Offset VirtAddr PhysAddr FileSize MemSiz Align Flags\n";for(const n of r.segments)t+=` ${n.index.toString().padEnd(3)} `,t+=`${n.typeDescription.padEnd(20)} `,t+=`${o(n.offset,e)} `,t+=`${o(n.vaddr,e)} `,t+=`${o(n.paddr,e)} `,t+=`${o(n.filesz,e)} `,t+=`${o(n.memsz,e)} `,t+=`${o(n.align,8)} `,t+=`${n.flagsDescription}\n`}if(r.sections.length){t+="\n\nSections:\n\n",32==r.bits?t+=" # Name Type Address Offset Size EntSize Link Info Align Flags\n":t+=" # Name Type Address Offset Size EntSize Link Info Align Flags\n";for(const n of r.sections)t+=` ${n.index.toString().padEnd(3)} `,t+=`${n.name.substr(0,18).padEnd(18)} `,t+=`${n.typeDescription.padEnd(32)} `,t+=`${o(n.addr,e)} `,t+=`${o(n.offset,e)} `,t+=`${o(n.size,e)} `,t+=`${o(n.entsize,e)} `,t+=`${(n.link||"").toString().padStart(4)} `,t+=`${(n.info||"").toString().padStart(4)} `,t+=`${o(n.addralign,8)} `,t+=`${n.flagsDescription}\n`}for(const i of r.sections)if(t+=`\n\n${i.typeDescription} section #${i.index} ${i.name}:\n\n`,(0,n.isSymbolSection)(i)){32==r.bits?t+=" # Value Size Type Bind Visibility Name\n":t+=" # Value Info Type Bind Visibility Name\n";let n=0;for(const r of i.symbols)t+=` ${(n++).toString().padStart(5)} `,t+=`${o(r.value,e)} `,t+=`${o(r.size,8)} `,t+=`${r.typeDescription.padEnd(28)} `,t+=`${r.bindingDescription.padEnd(6)} `,t+=`${r.visibilityDescription.padEnd(10)} `,t+=`${r.name}\n`}else if((0,n.isStringSection)(i))for(const e in i.strings)t+=` #${e} - ${i.strings[e]}\n`;else if((0,n.isRelocationSection)(i)){32==r.bits?t+=" # Offset Size Type Bind Visibility Name\n":t+=" # Offset Size Type Bind Visibility Name\n";let n=0;for(const r of i.relocations)t+=` ${(n++).toString().padStart(5)} `,t+=`${o(r.addr,e)} `,t+=`${o(r.info,e)} `,t+="\n"}}else t+="<undefined>";return t}},302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDisassembler=t.available=t.getCapstone=void 0;const n=r(735),o=r(744),i=Symbol.for("__capstone"),s=void 0!==typeof global?global:void 0!==typeof window?window:void 0;function a(){return s[i]}function c(e){switch(e){case o.ISA.ARM:return n.Architecture.ARM;case o.ISA.AARCH64:return n.Architecture.ARM64;case o.ISA.MIPS:case o.ISA.MIPS_RS3_LE:case o.ISA.MIPS_X:return n.Architecture.MIPS;case o.ISA.x86:case o.ISA.X86_64:return n.Architecture.X86;case o.ISA.PPC:case o.ISA.PPC64:return n.Architecture.PPC;case o.ISA.SPARC:case o.ISA.SPARC32PLUS:case o.ISA.SPARCV9:return n.Architecture.SPARC;case o.ISA.XCORE:return n.Architecture.XCORE;case o.ISA.ISA68K:return n.Architecture.M68K;case o.ISA.BPF:return n.Architecture.BPF;case o.ISA.RISCV:return n.Architecture.RISCV;case o.ISA.XTENSA:return n.Architecture.XTENSA;default:return}}t.getCapstone=a,t.available=function(){return s&&!!s[i]};const u={},l=new WeakMap;t.getDisassembler=function(e){const t=function(e){const t=c(e.isa);if(t){const r=`${n.Architecture[t]}-${e.bits.toString()}-${2==e.data?"big":"little"}`;return u[r]||(u[r]={})}}(e);if(t){const r=l.get(t);if(r)return r;{const r=function(e){const t=a();if(t){let r=(2==e.data?n.Mode.BIG_ENDIAN:n.Mode.LittleEndian)|(64==e.bits?n.Mode.Bits64:n.Mode.Bits32),o=c(e.isa);if(void 0!==o){const e=t.createInstance(o,r);if(e)return{normal:e,thumb:o===n.Architecture.ARM?t.createInstance(o,r|n.Mode.Thumb):void 0}}}}(e);if(r)return l.set(t,r),r}}}},798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disassembleWithReader=t.disassemble=t.getSymbolsByName=t.getSymbolByName=t.getSectionsByName=t.getSectionByName=t.fileOffsetToVirtualAddress=t.fileOffsetToPhysicalAddress=t.physicalAddressToFileOffset=t.physicalAddressToVirtual=t.virtualAddressToFileOffset=t.virtualAddressToPhysical=t.getSegmentsAtPhysicalMemoryLocation=t.getSegmentsAtVirtualMemoryLocation=t.getSectionsAtPhysicalMemoryLocation=t.getSectionsAtVirtualMemoryLocation=t.getSymbolsAtPhysicalMemoryLocation=t.getSymbolsAtVirtualMemoryLocation=t.getSegmentForSymbol=t.getSegmentsForSymbol=t.getSectionForSymbol=t.getSectionsForSymbol=t.getSectionsInSegment=t.getSymbolsInSegment=t.getSymbolsInSection=t.getSymbols=void 0;const n=r(435),o=r(524),i=r(115),s=r(302);function a(e,t,r){const i=(0,n.add)(t,r),s=[];for(const r of e.sections)if((0,o.isSymbolSection)(r))for(const e of r.symbols)e.virtualAddress&&e.virtualAddress>=t&&e.virtualAddress<i&&s.push(e);return s}function c(e,t){const r=[];for(const o of e.sections)t.virtualAddress&&t.virtualAddress>=o.addr&&t.virtualAddress<=(0,n.add)(o.addr,o.size)&&r.push(o);return r}function u(e,t){const r=[];for(const o of e.segments)t.virtualAddress&&t.virtualAddress>=o.vaddr&&t.virtualAddress<=(0,n.add)(o.vaddr,o.memsz)&&r.push(o);return r}function l(e,t){const r=[];for(const i of e.sections)if((0,o.isSymbolSection)(i))for(const e of i.symbols)0==e.size?e.virtualAddress===t&&r.push(e):e.virtualAddress&&t>=e.virtualAddress&&t<(0,n.add)(e.virtualAddress,e.size)&&r.push(e);return r}function d(e,t){const r=[];for(const o of e.sections)t>=o.addr&&t<(0,n.add)(o.addr,o.size)&&r.push(o);return r}function f(e,t){for(const r of e.segments)if(t>=r.vaddr&&t<(0,n.add)(r.vaddr,r.memsz)){const e=(0,n.toNumberSafe)((0,n.subtract)(t,r.vaddr));if(e<r.filesz)return r.offset+e}}function h(e,t){for(const r of e.segments)if(t>=r.paddr&&t<(0,n.add)(r.paddr,r.filesz)){const e=(0,n.subtract)(t,r.paddr);return(0,n.add)(r.vaddr,e)}}function p(e,t){return e.sections.filter((e=>e.name.toUpperCase()==t.toUpperCase()))}t.getSymbols=function(e){const t=[];for(const r of e.sections)if((0,o.isSymbolSection)(r))for(const e of r.symbols)t.push(e);return t},t.getSymbolsInSection=function(e,t){const r="number"==typeof t?e.sections[t]:t;return a(e,r.addr,r.size)},t.getSymbolsInSegment=function(e,t){const r="number"==typeof t?e.segments[t]:t;return a(e,r.vaddr,r.memsz)},t.getSectionsInSegment=function(e,t){const r="number"==typeof t?e.segments[t]:t;return e.sections.filter((e=>e.addr>r.vaddr&&e.addr<(0,n.add)(r.vaddr,r.memsz)))},t.getSectionsForSymbol=c,t.getSectionForSymbol=function(e,t){return c(e,t)[0]},t.getSegmentsForSymbol=u,t.getSegmentForSymbol=function(e,t){return u(e,t)[0]},t.getSymbolsAtVirtualMemoryLocation=l,t.getSymbolsAtPhysicalMemoryLocation=function(e,t){const r=h(e,t);return r?l(e,r):[]},t.getSectionsAtVirtualMemoryLocation=d,t.getSectionsAtPhysicalMemoryLocation=function(e,t){const r=h(e,t);return r?d(e,r):[]},t.getSegmentsAtVirtualMemoryLocation=function(e,t){const r=[];for(const o of e.segments)t>=o.vaddr&&t<(0,n.add)(o.vaddr,o.memsz)&&r.push(o);return r},t.getSegmentsAtPhysicalMemoryLocation=function(e,t){const r=[];for(const o of e.segments)t>=o.paddr&&t<(0,n.add)(o.paddr,o.filesz)&&r.push(o);return r},t.virtualAddressToPhysical=function(e,t){for(const r of e.segments)if(t>=r.vaddr&&t<=(0,n.add)(r.vaddr,r.memsz)){const e=(0,n.subtract)(t,r.vaddr);if(e<r.filesz)return(0,n.add)(r.paddr,e)}},t.virtualAddressToFileOffset=f,t.physicalAddressToVirtual=h,t.physicalAddressToFileOffset=function(e,t){for(const r of e.segments)if(t>=r.paddr&&t<(0,n.add)(r.paddr,r.filesz)){const e=(0,n.toNumberSafe)((0,n.subtract)(t,r.paddr));return r.offset+e}},t.fileOffsetToPhysicalAddress=function(e,t){for(const r of e.segments)if(t>=r.offset&&t<(0,n.add)(r.offset,r.filesz)){const e=(0,n.subtract)(t,r.offset);return(0,n.add)(r.paddr,e)}},t.fileOffsetToVirtualAddress=function(e,t){for(const r of e.segments)if(t>=r.offset&&t<(0,n.add)(r.offset,r.filesz)){const e=(0,n.subtract)(t,r.offset);return(0,n.add)(r.vaddr,e)}},t.getSectionByName=function(e,t){return p(e,t)[0]},t.getSectionsByName=p,t.getSymbolByName=function(e,t){for(const r of e.sections)if((0,o.isSymbolSection)(r))for(const e of r.symbols)if(e.name&&e.name.toUpperCase()==t.toUpperCase())return e},t.getSymbolsByName=function(e,t){const r=[];for(const n of e.sections)if((0,o.isSymbolSection)(n))for(const e of n.symbols)e.name&&e.name.toUpperCase()==t.toUpperCase()&&r.push(e);return r},t.disassemble=function(e,t,r){const n=null==t?void 0:t.virtualAddress;if(t.type===i.SymbolType.Function&&t.size>0&&void 0!==n){const o=t.data;if(o&&o.byteLength>0){const t=(0,s.getDisassembler)(e);if(t){const e="number"==typeof n?BigInt(n):n;return t.normal.disassemble(o,e)}if(r)throw new Error("Could not create a disassembler instance.")}else if(r)throw new Error("Symbol data is not available.")}else if(r)throw new Error("the symbol is not valid for disassembly.");return[]},t.disassembleWithReader=async function(e,t,r,n){const o=null==t?void 0:t.virtualAddress;if(t.type===i.SymbolType.Function&&t.size>0&&void 0!==o){const i=f(e,o);if(i){const a=await r.view(t.size,i);if(a&&a.byteLength>0){const t=(0,s.getDisassembler)(e);if(t){const e="number"==typeof o?BigInt(o):o;return t.normal.disassemble(a,e)}if(n)throw new Error("Could not create a disassembler instance.")}else if(n)throw new Error("Symbol data is not available.")}else if(n)throw new Error("Symbol does not have a file offset.")}else if(n)throw new Error("the symbol is not valid for disassembly.");return[]}},501:(e,t,r)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.decode=void 0,t.decode=function(e,t,r){if(n)return n(e,t,r);throw new Error("There is no supported utf-8 decoder")};try{const{StringDecoder:e}=r(576),t=new e("utf8");t&&(n=(e,r,n)=>t.end(e.subarray(r,r+n)))}catch(e){}if(void 0===n&&"undefined"!=typeof TextDecoder){const e=new TextDecoder;n=(t,r,n)=>e.decode(t.subarray(r,r+n))}},115:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.open=void 0;const a=i(r(91)),c=r(366);t.open=function(e,t,r){let n;var o;return t||(t={}),e instanceof Uint8Array||e instanceof ArrayBuffer?n=(0,c.readElf)(a.buffer(e),t):e instanceof Array?n=(0,c.readElf)(a.array(e),t):n="object"==typeof(o=e)&&"function"==typeof o.close&&"function"==typeof o.open&&"function"==typeof o.read&&"function"==typeof o.size&&"function"==typeof o.view?(0,c.readElf)(e,t):"number"==typeof e?(0,c.readElf)(a.syncfile(e),t):function(e){return"object"==typeof e&&"number"==typeof e.fd&&"function"==typeof e.stat&&"function"==typeof e.read}(e)?(0,c.readElf)(a.asyncfile(e),t):function(e){return"object"==typeof e&&"number"==typeof e.size&&"function"==typeof e.arrayBuffer}(e)?(0,c.readElf)(a.blob(e),t):"string"==typeof e?(0,c.readElf)(a.file(e),t):new Promise((e=>{e({success:!1,errors:["unsupported input type"],warnings:[]})})),r&&n.then(r),n},s(r(91),t),s(r(798),t),s(r(744),t),s(r(411),t)},366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readElf=void 0;const n=r(228),o=r(744),i=r(533),s=r(524),a=r(798),c=r(435);t.readElf=async function(e,t){var r,u;let l=!1;const d=[],f=[];let h,p;try{await e.open();const p=await e.size();if(p<=64)d.push("Not a valid ELF file. Too small.");else{const m=await e.view(16),g=1179403647;m.getInt32(0,!0)!==g&&f.push("Not a valid ELF file. The file does not start with 0x7f ELF.");const w=m.getUint8(4),y=m.getUint8(5),v=m.getUint8(6),S=m.getUint8(7),E=m.getUint8(8);if((w<1||w>2)&&d.push("Not a valid ELF file. Class is invalid"),(y<1||y>2)&&d.push("Not a valid ELF file. Endianness is invalid"),1!=v&&f.push("Not a valid ELF file. Version is invalid"),0==d.length){const f=1===w?32:64,m=1!==y,g=S,b=32==f?36:48,A=await e.view(b),_=e=>A.getUint16(e,!m),I=e=>A.getUint32(e,!m),C=e=>A.getBigUint64(e,!m);let P=0;const k=_(P);P+=2;const T=_(P);P+=2;const D=I(P);let O,R,M;P+=4,32===f?(O=I(P),P+=4,R=I(P),P+=4,M=I(P),P+=4):(O=C(P),P+=8,R=(0,c.toNumberSafe)(C(P)),P+=8,M=(0,c.toNumberSafe)(C(P)),P+=8);const F=I(P);P+=4;const x=_(P);P+=2;const N=_(P);P+=2;const H=_(P);P+=2;const L=_(P);P+=2;const U=_(P);P+=2;const B=_(P);if(P+=2,(32===f&&52!==x||64==f&&64!==x)&&d.push("Invalid ELF file. Unexpected header size"),(0!=H&&(R<x||R>p)||0!=U&&(M<x||M>p))&&d.push("Invalid ELF file. Invalid offsets"),0!=H&&(32==f&&N<32||64==f&&N<56||N>255)&&d.push("Invalid ELF file. Program header entry size invalid"),0!=U&&(32==f&&L<40||64==f&&L<64||N>255)&&d.push("Invalid ELF file. Section header entry size invalid"),0==d.length){const d=k,p=T,S=await(0,i.readProgramHeaderEntries)(e,R,N,H,f,m),b=await(0,s.readSectionHeaderEntries)(e,M,L,U,f,m,B,null!==(r=t.readSymbolData)&&void 0!==r&&r);h={path:e.path,class:w,classDescription:1==w?"ELF32":"ELF64",data:y,dataDescription:1==y?"Little endian":"Big endian",version:v,bits:f,abi:g,abiVersion:E,abiDescription:(0,n.abiToString)(g),isa:p,isaDescription:(0,n.isaToString)(p),isaVersion:D,type:d,typeDescription:(0,n.objectTypeToString)(d),flags:F,flagsDescription:(0,n.elfFlagsToString)(p,F),entryPoint:O,programHeaderOffset:R,programHeaderEntrySize:N,numProgramHeaderEntries:H,sectionHeaderOffset:M,sectionHeaderEntrySize:L,numSectionHeaderEntries:U,shstrIndex:B,segments:S,sections:b},await async function(e,t,r){const n=t.size(),i=e.type;if(i===o.ObjectType.Executable||i===o.ObjectType.Relocatable||i===o.ObjectType.Shared)for(const u of e.sections)if((0,s.isSymbolSection)(u))for(const s of u.symbols)if(i===o.ObjectType.Relocatable?s.shndx<e.sections.length?s.virtualAddress=(0,c.add)(s.value,e.sections[s.shndx].addr):65521==s.shndx&&(s.virtualAddress=s.value):s.virtualAddress=s.value,r&&s.virtualAddress&&(s.type===o.SymbolType.Function||s.type===o.SymbolType.Object)&&s.size){const r=(0,a.virtualAddressToFileOffset)(e,s.value);r&&r+s.size<=n&&(s.data=await t.read(s.size,r))}}(h,e,null!==(u=t.readSymbolData)&&void 0!==u&&u),l=!0}}}}catch(e){d.push(`Exception caught: ${e.toString()}`)}if(t.returnReader)p=e;else{p=void 0;try{e&&await e.close()}catch(e){d.push(`Exception caught: ${e.toString()}`)}}return{success:l,errors:d,warnings:f,elf:h,reader:p}}},91:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.blob=t.file=t.syncfile=t.asyncfile=t.buffer=t.array=void 0;const s=r(292),a=i(r(147)),c=i(r(17));function u(e,t,r){let n=!1;const{array:o}=e;return o?t?(r||(r=e.position,n=!0),r<=e.size?(r+t>e.size&&(t=e.size-r),t<0&&(t=0),n&&(e.position+=t),Promise.resolve(new Uint8Array(o,e.offset+r,t))):Promise.reject("read past end of file")):Promise.reject("Length must be specified"):Promise.reject("state.array must be defined")}async function l(e,t,r){if(!e)throw"File not open";const n=new Uint8Array(t),{bytesRead:o}=await e.read(n,0,t,r);return o<t?n.slice(0,o):n}function d(e,t,r){return new Promise(((n,o)=>{const i=new Uint8Array(t);a.read(e,i,0,t,null!=r?r:null,((e,r)=>{e?o(e):n(r<t?i.slice(0,r):i)}))}))}function f(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function h(e){return{open:()=>Promise.reject(e),read:(t,r)=>Promise.reject(e),view:(t,r)=>Promise.reject(e),size:()=>-1,close:()=>Promise.reject(e)}}function p(e){const t={array:e instanceof Uint8Array?e.buffer:e,offset:0,position:0,size:e.byteLength};return e instanceof Uint8Array&&(t.offset=e.byteOffset),{open:()=>Promise.resolve(),size:()=>t.size,close:()=>Promise.resolve(),read:(e,r)=>u(t,e,r),view:(e,r)=>u(t,e,r).then(f)}}t.array=function(e){return p(Uint8Array.from(e))},t.buffer=p,t.asyncfile=function(e,t){if(!a)return h("No filesystem");const r={fh:e,size:0,ownshandle:t};return{open:()=>r.fh.stat().then((e=>{r.size=e.size})),read:(e,t)=>l(r.fh,e,t),view:(e,t)=>l(r.fh,e,t).then(f),size:()=>r.size,close:()=>r.ownshandle?r.fh.close():Promise.resolve()}},t.syncfile=function(e,t){if(!a)return h("No filesystem");const r={ownshandle:t,handle:e,size:0};return{open:()=>new Promise(((e,t)=>a.fstat(r.handle,((n,o)=>{n?t(n):(r.size=o.size,e())})))),read:(e,t)=>d(r.handle,e,t),view:(e,t)=>d(r.handle,e,t).then(f),size:()=>r.size,close:()=>new Promise(((e,t)=>{r.ownshandle?a.close(r.handle,(r=>{r?t(r):e()})):e()}))}},t.file=function(e){if(!a)return h("No filesystem");const t={path:e,fh:void 0,size:0};return{open:()=>(0,s.open)(t.path,"r").then((e=>(t.fh=e,e.stat().then((e=>{t.size=e.size}))))),read:(e,r)=>l(t.fh,e,r),view:(e,r)=>l(t.fh,e,r).then(f),size:()=>t.size,close:()=>t.fh?t.fh.close():Promise.resolve(),path:c.resolve(e)}},t.blob=function(e){const t={offset:0,position:0,size:0};return{open:()=>e.arrayBuffer().then((e=>{t.array=e,t.offset=0,t.position=0,t.size=e.byteLength})),close:()=>Promise.resolve(),size:()=>t.size,read:(e,r)=>u(t,e,r),view:(e,r)=>u(t,e,r).then(f)}}},524:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRelocationSection=t.isSymbolSection=t.isStringSection=t.readSectionHeaderEntries=void 0;const n=r(744),o=r(228),i=r(435),s=r(501);function a(e,t){let r=e[t];if(!r)for(const n in e){const o=parseInt(n);if(o<t){const n=e[o];if(o+n.length>t){r=n.substr(t-o);break}}}return r}async function c(e,t,r){const n=await e.read(Number(r),Number(t));let o=0;const i={};for(let e=0;e<r;e++)if(0==n[e]){const t=e-o;t>0&&(i[o]=(0,s.decode)(n,o,t)),o=e+1}return i}async function u(e,t,r,n,s,a){await e.size();const c=(0,i.divide)(r,n);const u=[];for(let r=0;r<c;r++){const i=await e.view(n,t+r*n),c=i.getUint8.bind(i),l=e=>i.getUint16(e,!s),d=e=>i.getUint32(e,!s),f=e=>i.getBigUint64(e,!s);let h,p,m,g,w,y,v=0;32==a?(h=d(v),v+=4,w=d(v),v+=4,y=d(v),v+=4,p=c(v),v+=1,m=c(v),v+=1,g=l(v),v+=2):(h=d(v),v+=4,p=c(v),v+=1,m=c(v),v+=1,g=l(v),v+=2,w=f(v),v+=8,y=Number(f(v)),v+=8);const S=15&p,E=p>>4,b=3&m;u[r]={nameix:h,name:"",info:p,other:m,shndx:g,value:w,size:y,type:S,binding:E,visibility:b,typeDescription:(0,o.symbolTypeToString)(S),bindingDescription:(0,o.symbolBindingToString)(E),visibilityDescription:(0,o.symbolVisibilityToString)(b)}}return u}async function l(e,t,r,n,o,s,a){await e.size();const c=(0,i.toNumberSafe)((0,i.divide)(r,n));const u=new Array(c);for(let r=0;r<c;r++){const c=await e.view(n,t+r*n),l=e=>c.getUint32(e,!o),d=e=>c.getBigUint64(e,!o),f=e=>c.getInt32(e,!o),h=e=>c.getBigInt64(e,!o);let p,m,g,w,y,v=0;32==s?(p=l(v),v+=4,m=l(v),v+=4,a&&(y=f(v),v+=4),g=m>>8,w=255&m):(p=d(v),v+=8,m=d(v),v+=8,a&&(y=h(v),v+=8),g=(0,i.toNumberSafe)(m>>BigInt(32)),w=(0,i.toNumberSafe)(m&BigInt(4294967295))),u[r]={addr:p,info:m,addend:y,symbolIndex:g,type:w}}return u}function d(e,t){if(t)for(let r=0;r<e.length;r++)e[r].name=a(t,e[r].nameix)||""}function f(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.StrTab}function h(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.DynSym||(null==e?void 0:e.type)===n.SectionHeaderEntryType.SymTab}function p(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.Rel||(null==e?void 0:e.type)===n.SectionHeaderEntryType.Rela}t.readSectionHeaderEntries=async function(e,t,r,s,m,g,w,y){if(0==s)return[];const v=new Array(s);for(let n=0;n<s;n++){const s=await e.view(r,Number(t)+n*Number(r)),a=e=>s.getUint32(e,!g),c=e=>s.getBigUint64(e,!g),u=a(0),l=a(4);let d,f,h,p,w,y,S,E,b=8;32==m?(d=a(b),b+=4,f=a(b),b+=4,h=a(b),b+=4,p=a(b),b+=4,w=a(b),b+=4,y=a(b),b+=4,S=a(b),b+=4,E=a(b),b+=4):(d=(0,i.toNumberSafe)(c(b)),b+=8,f=c(b),b+=8,h=(0,i.toNumberSafe)(c(b)),b+=8,p=(0,i.toNumberSafe)(c(b)),b+=8,w=a(b),b+=4,y=a(b),b+=4,S=(0,i.toNumberSafe)(c(b)),b+=8,E=(0,i.toNumberSafe)(c(b)),b+=8);const A={index:n,name:"",nameix:u,type:l,typeDescription:(0,o.sectionHeaderEntryTypeToString)(l),flags:d,flagsDescription:(0,o.sectionFlagsToString)(d),addr:f,offset:h,size:p,link:w,info:y,addralign:S,entsize:E};v[n]=A}for(const t of v)if(f(t)){const{size:r,offset:n}=t;t.strings=await c(e,n,r)}for(const t of v){if(h(t)){const{size:r,offset:n,entsize:o,link:i}=t;if(t.symbols=await u(e,n,r,o,g,m),i>=0&&i<v.length){const e=v[i];f(e)&&d(t.symbols,e.strings)}}if(p(t)){const{size:r,offset:o,entsize:i}=t;t.relocations=await l(e,o,r,i,g,m,t.type===n.SectionHeaderEntryType.Rela)}}return function(e,t){if(t<e.length){const r=e[t];if(f(r)){const t=r.strings;t&&e.forEach((e=>{if(0==e.nameix)e.name="<null>";else{const r=a(t,e.nameix);r&&(e.name=r)}}))}}}(v,w),v},t.isStringSection=f,t.isSymbolSection=h,t.isRelocationSection=p},533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readProgramHeaderEntries=void 0;const n=r(228),o=r(435);t.readProgramHeaderEntries=async function(e,t,r,i,s,a){if(0==i)return[];const c=new Array(i);for(let u=0;u<i;u++){const i=await e.view(r,Number(t)+u*Number(r)),l=e=>i.getUint32(e,!a),d=e=>i.getBigUint64(e,!a),f=l(0);let h,p,m,g,w,y,v,S=4;32==s?(p=l(S),S+=4,m=l(S),S+=4,g=l(S),S+=4,w=l(S),S+=4,y=l(S),S+=4,h=l(S),S+=4,v=l(S),S+=4):(h=l(S),S+=4,p=(0,o.toNumberSafe)(d(S)),S+=8,m=d(S),S+=8,g=d(S),S+=8,w=(0,o.toNumberSafe)(d(S)),S+=8,y=(0,o.toNumberSafe)(d(S)),S+=8,v=(0,o.toNumberSafe)(d(S)),S+=8),c[u]={index:u,type:f,typeDescription:(0,n.programHeaderEntryTypeToString)(f),flags:h,flagsDescription:(0,n.programHeaderFlagsToString)(h),offset:p,vaddr:m,paddr:g,filesz:w,memsz:y,align:v}}return c}},228:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.symbolVisibilityToString=t.symbolBindingToString=t.symbolTypeToString=t.elfFlagsToString=t.programHeaderFlagsToString=t.sectionFlagsToString=t.sectionHeaderEntryTypeToString=t.programHeaderEntryTypeToString=t.objectTypeToString=t.abiToString=t.isaToString=void 0;const n=r(744);t.isaToString=function(e){switch(e){case n.ISA.None:return"No machine";case n.ISA.M32:return"AT&T WE 32100";case n.ISA.SPARC:return"SUN SPARC";case n.ISA.x86:return"Intel x86";case n.ISA.ISA68K:return"Motorola m68k family";case n.ISA.ISA88K:return"Motorola m88k family";case n.ISA.IAMCU:return"Intel MCU";case n.ISA.ISA860:return"Intel 80860";case n.ISA.MIPS:return"MIPS R3000 big-endian";case n.ISA.S370:return"IBM System/370";case n.ISA.MIPS_RS3_LE:return"MIPS R3000 little-endian";case n.ISA.PARISC:return"HPPA";case n.ISA.VPP500:return"Fujitsu VPP500";case n.ISA.SPARC32PLUS:return'Sun\'s "v8plus"';case n.ISA.ISA960:return"Intel 80960";case n.ISA.PPC:return"PowerPC";case n.ISA.PPC64:return"PowerPC 64-bit";case n.ISA.S390:return"IBM S390";case n.ISA.SPU:return"IBM SPU/SPC";case n.ISA.V800:return"NEC V800 series";case n.ISA.FR20:return"Fujitsu FR20";case n.ISA.RH32:return"TRW RH-32";case n.ISA.RCE:return"Motorola RCE";case n.ISA.ARM:return"ARM";case n.ISA.FAKE_ALPHA:return"Digital Alpha";case n.ISA.SH:return"Hitachi SH";case n.ISA.SPARCV9:return"SPARC v9 64-bit";case n.ISA.TRICORE:return"Siemens Tricore";case n.ISA.ARC:return"Argonaut RISC Core";case n.ISA.H8_300:return"Hitachi H8/300";case n.ISA.H8_300H:return"Hitachi H8/300H";case n.ISA.H8S:return"Hitachi H8S";case n.ISA.H8_500:return"Hitachi H8/500";case n.ISA.IA_64:return"Intel Merced";case n.ISA.MIPS_X:return"Stanford MIPS-X";case n.ISA.COLDFIRE:return"Motorola Coldfire";case n.ISA.ISA68HC12:return"Motorola M68HC12";case n.ISA.MMA:return"Fujitsu MMA Multimedia Accelerator";case n.ISA.PCP:return"Siemens PCP";case n.ISA.NCPU:return"Sony nCPU embeeded RISC";case n.ISA.NDR1:return"Denso NDR1 microprocessor";case n.ISA.STARCORE:return"Motorola Start*Core processor";case n.ISA.ME16:return"Toyota ME16 processor";case n.ISA.ST100:return"STMicroelectronic ST100 processor";case n.ISA.TINYJ:return"Advanced Logic Corp. Tinyj emb.fam";case n.ISA.X86_64:return"AMD x86-64 architecture";case n.ISA.PDSP:return"Sony DSP Processor";case n.ISA.PDP10:return"Digital PDP-10";case n.ISA.PDP11:return"Digital PDP-11";case n.ISA.FX66:return"Siemens FX66 microcontroller";case n.ISA.ST9PLUS:return"STMicroelectronics ST9+ 8/16 mc";case n.ISA.ST7:return"STmicroelectronics ST7 8 bit mc";case n.ISA.ISA68HC16:return"Motorola MC68HC16 microcontroller";case n.ISA.ISA68HC11:return"Motorola MC68HC11 microcontroller";case n.ISA.ISA68HC08:return"Motorola MC68HC08 microcontroller";case n.ISA.ISA68HC05:return"Motorola MC68HC05 microcontroller";case n.ISA.SVX:return"Silicon Graphics SVx";case n.ISA.ST19:return"STMicroelectronics ST19 8 bit mc";case n.ISA.VAX:return"Digital VAX";case n.ISA.CRIS:return"Axis Communications 32-bit emb.proc";case n.ISA.JAVELIN:return"Infineon Technologies 32-bit emb.proc";case n.ISA.FIREPATH:return"Element 14 64-bit DSP Processor";case n.ISA.ZSP:return"LSI Logic 16-bit DSP Processor";case n.ISA.MMIX:return"Donald Knuth's educational 64-bit proc";case n.ISA.HUANY:return"Harvard University machine-independent object files";case n.ISA.PRISM:return"SiTera Prism";case n.ISA.AVR:return"Atmel AVR 8-bit microcontroller";case n.ISA.FR30:return"Fujitsu FR30";case n.ISA.D10V:return"Mitsubishi D10V";case n.ISA.D30V:return"Mitsubishi D30V";case n.ISA.V850:return"NEC v850";case n.ISA.M32R:return"Mitsubishi M32R";case n.ISA.MN10300:return"Matsushita MN10300";case n.ISA.MN10200:return"Matsushita MN10200";case n.ISA.PJ:return"picoJava";case n.ISA.OPENRISC:return"OpenRISC 32-bit embedded processor";case n.ISA.ARC_COMPACT:return"ARC International ARCompact";case n.ISA.XTENSA:return"Tensilica Xtensa Architecture";case n.ISA.VIDEOCORE:return"Alphamosaic VideoCore";case n.ISA.TMM_GPP:return"Thompson Multimedia General Purpose Proc";case n.ISA.NS32K:return"National Semi. 32000";case n.ISA.TPC:return"Tenor Network TPC";case n.ISA.SNP1K:return"Trebia SNP 1000";case n.ISA.ST200:return"STMicroelectronics ST200";case n.ISA.IP2K:return"Ubicom IP2xxx";case n.ISA.MAX:return"MAX processor";case n.ISA.CR:return"National Semi. CompactRISC";case n.ISA.F2MC16:return"Fujitsu F2MC16";case n.ISA.MSP430:return"Texas Instruments msp430";case n.ISA.BLACKFIN:return"Analog Devices Blackfin DSP";case n.ISA.SE_C33:return"Seiko Epson S1C33 family";case n.ISA.SEP:return"Sharp embedded microprocessor";case n.ISA.ARCA:return"Arca RISC";case n.ISA.UNICORE:return"PKU-Unity & MPRC Peking Uni. mc series";case n.ISA.EXCESS:return"eXcess configurable cpu";case n.ISA.DXP:return"Icera Semi. Deep Execution Processor";case n.ISA.ALTERA_NIOS2:return"Altera Nios II";case n.ISA.CRX:return"National Semi. CompactRISC CRX";case n.ISA.XGATE:return"Motorola XGATE";case n.ISA.C166:return"Infineon C16x/XC16x";case n.ISA.M16C:return"Renesas M16C";case n.ISA.DSPIC30F:return"Microchip Technology dsPIC30F";case n.ISA.CE:return"Freescale Communication Engine RISC";case n.ISA.M32C:return"Renesas M32C";case n.ISA.TSK3000:return"Altium TSK3000";case n.ISA.RS08:return"Freescale RS08";case n.ISA.SHARC:return"Analog Devices SHARC family";case n.ISA.ECOG2:return"Cyan Technology eCOG2";case n.ISA.SCORE7:return"Sunplus S+core7 RISC";case n.ISA.DSP24:return"New Japan Radio (NJR) 24-bit DSP";case n.ISA.VIDEOCORE3:return"Broadcom VideoCore III";case n.ISA.LATTICEMICO32:return"RISC for Lattice FPGA";case n.ISA.SE_C17:return"Seiko Epson C17";case n.ISA.TI_C6000:return"Texas Instruments TMS320C6000 DSP";case n.ISA.TI_C2000:return"Texas Instruments TMS320C2000 DSP";case n.ISA.TI_C5500:return"Texas Instruments TMS320C55x DSP";case n.ISA.TI_ARP32:return"Texas Instruments App. Specific RISC";case n.ISA.TI_PRU:return"Texas Instruments Prog. Realtime Unit";case n.ISA.MMDSP_PLUS:return"STMicroelectronics 64bit VLIW DSP";case n.ISA.CYPRESS_M8C:return"Cypress M8C";case n.ISA.R32C:return"Renesas R32C";case n.ISA.TRIMEDIA:return"NXP Semi. TriMedia";case n.ISA.QDSP6:return"QUALCOMM DSP6";case n.ISA.ISA8051:return"Intel 8051 and variants";case n.ISA.STXP7X:return"STMicroelectronics STxP7x";case n.ISA.NDS32:return"Andes Tech. compact code emb. RISC";case n.ISA.ECOG1X:return"Cyan Technology eCOG1X";case n.ISA.MAXQ30:return"Dallas Semi. MAXQ30 mc";case n.ISA.XIMO16:return"New Japan Radio (NJR) 16-bit DSP";case n.ISA.MANIK:return"M2000 Reconfigurable RISC";case n.ISA.CRAYNV2:return"Cray NV2 vector architecture";case n.ISA.RX:return"Renesas RX";case n.ISA.METAG:return"Imagination Tech. META";case n.ISA.MCST_ELBRUS:return"MCST Elbrus";case n.ISA.ECOG16:return"Cyan Technology eCOG16";case n.ISA.CR16:return"National Semi. CompactRISC CR16";case n.ISA.ETPU:return"Freescale Extended Time Processing Unit";case n.ISA.SLE9X:return"Infineon Tech. SLE9X";case n.ISA.L10M:return"Intel L10M";case n.ISA.K10M:return"Intel K10M";case n.ISA.AARCH64:return"ARM AARCH64";case n.ISA.AVR32:return"Amtel 32-bit microprocessor";case n.ISA.STM8:return"STMicroelectronics STM8";case n.ISA.TILE64:return"Tileta TILE64";case n.ISA.TILEPRO:return"Tilera TILEPro";case n.ISA.MICROBLAZE:return"Xilinx MicroBlaze";case n.ISA.CUDA:return"NVIDIA CUDA";case n.ISA.TILEGX:return"Tilera TILE-Gx";case n.ISA.CLOUDSHIELD:return"CloudShield";case n.ISA.COREA_1ST:return"KIPO-KAIST Core-A 1st gen.";case n.ISA.COREA_2ND:return"KIPO-KAIST Core-A 2nd gen.";case n.ISA.ARC_COMPACT2:return"Synopsys ARCompact V2";case n.ISA.OPEN8:return"Open8 RISC";case n.ISA.RL78:return"Renesas RL78";case n.ISA.VIDEOCORE5:return"Broadcom VideoCore V";case n.ISA.ISA78KOR:return"Renesas 78KOR";case n.ISA.ISA56800EX:return"Freescale 56800EX DSC";case n.ISA.BA1:return"Beyond BA1";case n.ISA.BA2:return"Beyond BA2";case n.ISA.XCORE:return"XMOS xCORE";case n.ISA.MCHP_PIC:return"Microchip 8-bit PIC(r)";case n.ISA.KM32:return"KM211 KM32";case n.ISA.KMX32:return"KM211 KMX32";case n.ISA.EMX16:return"KM211 KMX16";case n.ISA.EMX8:return"KM211 KMX8";case n.ISA.KVARC:return"KM211 KVARC";case n.ISA.CDP:return"Paneve CDP";case n.ISA.COGE:return"Cognitive Smart Memory Processor";case n.ISA.COOL:return"Bluechip CoolEngine";case n.ISA.NORC:return"Nanoradio Optimized RISC";case n.ISA.CSR_KALIMBA:return"CSR Kalimba";case n.ISA.Z80:return"Zilog Z80";case n.ISA.VISIUM:return"Controls and Data Services VISIUMcore";case n.ISA.FT32:return"FTDI Chip FT32";case n.ISA.MOXIE:return"Moxie processor";case n.ISA.AMDGPU:return"AMD GPU";case n.ISA.RISCV:return"RISC-V";case n.ISA.BPF:return"Linux BPF";case n.ISA.CSKY:return"C-SKY"}},t.abiToString=function(e){switch(e){case n.ABI.GNUHurd:return"GNU Hurd";case n.ABI.NovelloModesto:return"Novello Modesto";case n.ABI.HPUX:return"HP-UX";case n.ABI.NonStopKernel:return"NonStop Kernel";case n.ABI.FenixOS:return"Fenix OS";case n.ABI.ARMEABI:return"ARM EABI";default:return n.ABI[e]||e.toString()}},t.objectTypeToString=function(e){return n.ObjectType[e]||e.toString()},t.programHeaderEntryTypeToString=function(e){switch(e){case n.ProgramHeaderEntryType.ProgramHeaderTable:return"Program Header Table";case n.ProgramHeaderEntryType.GnuEhFrame:return"GNU EH frame";case n.ProgramHeaderEntryType.GnuStack:return"GNU stack info";case n.ProgramHeaderEntryType.GnuRelRo:return"GNU ro relocation";default:return n.ProgramHeaderEntryType[e]||e.toString()}},t.sectionHeaderEntryTypeToString=function(e){switch(e){case n.SectionHeaderEntryType.Null:return"NULL";case n.SectionHeaderEntryType.ProgBits:return"Prog bits";case n.SectionHeaderEntryType.SymTab:return"Symbol table";case n.SectionHeaderEntryType.StrTab:return"String table";case n.SectionHeaderEntryType.Rela:return"Relocation with addends";case n.SectionHeaderEntryType.Hash:return"Symbol hash table";case n.SectionHeaderEntryType.Dynamic:return"Dynamic";case n.SectionHeaderEntryType.Note:return"Note";case n.SectionHeaderEntryType.NoBits:return"No bits";case n.SectionHeaderEntryType.Rel:return"Relocation";case n.SectionHeaderEntryType.ShLib:return"ShLib";case n.SectionHeaderEntryType.DynSym:return"Dynamic linking symbols";case n.SectionHeaderEntryType.InitArray:return"Init array";case n.SectionHeaderEntryType.FiniArray:return"Fini array";case n.SectionHeaderEntryType.PreInitArray:return"Pre-init array";case n.SectionHeaderEntryType.Group:return"Section group";case n.SectionHeaderEntryType.ShNdx:return"Extended symbol table index";case n.SectionHeaderEntryType.Num:return"Num";case n.SectionHeaderEntryType.GnuAttributes:return"GNU object attributes";case n.SectionHeaderEntryType.GnuHash:return"GNU hash";case n.SectionHeaderEntryType.GnuLibList:return"GNU pre-link library list";case n.SectionHeaderEntryType.GnuVerDef:return"GNU version definition";case n.SectionHeaderEntryType.GnuVerNeed:return"GNU version needs";case n.SectionHeaderEntryType.GnuVerSym:return"GNU version symbol table";default:return n.SectionHeaderEntryType[e]||Number(e).toString()}},t.sectionFlagsToString=function(e){let t=[];return 1&(e=Number(e))&&t.push("Writeable"),2&e&&t.push("Alloc"),4&e&&t.push("Executable"),16&e&&t.push("Merge"),32&e&&t.push("Strings"),64&e&&t.push("Info Link"),128&e&&t.push("Link Order"),256&e&&t.push("Nonconforming"),512&e&&t.push("Group"),1024&e&&t.push("Thread Local Storage"),67108864&e&&t.push("Special ordering"),134217728&e&&t.push("Exclude"),0==t.length?"<none>":t.join(" | ")},t.programHeaderFlagsToString=function(e){let t=[];return 4&e&&t.push("Read"),2&e&&t.push("Write"),1&e&&t.push("Execute"),t.join(" | ")},t.elfFlagsToString=function(e,t){if(e===n.ISA.ARM){const e=(4278190080&t)>>24;let r=[`Version: ${e}`];return 8388608&t&&r.push("BE-8"),e<=4&&4194304&t&&r.push("Legacy"),e>=5&&1024&t&&r.push("Hard Float"),e>=5&&512&t&&r.push("Soft Float"),r.join(" | ")}return t.toString()},t.symbolTypeToString=function(e){switch(e){case n.SymbolType.RelocationExpression:return"Relocation Expression";case n.SymbolType.SignedRelocationExpression:return"Signed Relocation Expression";case n.SymbolType.ThreadLocalStorage:return"Thread Local Storage";default:return n.SymbolType[e]||e.toString()}},t.symbolBindingToString=function(e){return n.SymbolBinding[e]||e.toString()},t.symbolVisibilityToString=function(e){return n.SymbolVisibility[e]||e.toString()}},744:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolVisibility=t.SymbolBinding=t.SymbolType=t.SectionHeaderEntryType=t.ProgramHeaderEntryType=t.ObjectType=t.ABI=t.ISA=void 0,function(e){e[e.None=0]="None",e[e.M32=1]="M32",e[e.SPARC=2]="SPARC",e[e.x86=3]="x86",e[e.ISA68K=4]="ISA68K",e[e.ISA88K=5]="ISA88K",e[e.IAMCU=6]="IAMCU",e[e.ISA860=7]="ISA860",e[e.MIPS=8]="MIPS",e[e.S370=9]="S370",e[e.MIPS_RS3_LE=10]="MIPS_RS3_LE",e[e.PARISC=15]="PARISC",e[e.VPP500=17]="VPP500",e[e.SPARC32PLUS=18]="SPARC32PLUS",e[e.ISA960=19]="ISA960",e[e.PPC=20]="PPC",e[e.PPC64=21]="PPC64",e[e.S390=22]="S390",e[e.SPU=23]="SPU",e[e.V800=36]="V800",e[e.FR20=37]="FR20",e[e.RH32=38]="RH32",e[e.RCE=39]="RCE",e[e.ARM=40]="ARM",e[e.FAKE_ALPHA=41]="FAKE_ALPHA",e[e.SH=42]="SH",e[e.SPARCV9=43]="SPARCV9",e[e.TRICORE=44]="TRICORE",e[e.ARC=45]="ARC",e[e.H8_300=46]="H8_300",e[e.H8_300H=47]="H8_300H",e[e.H8S=48]="H8S",e[e.H8_500=49]="H8_500",e[e.IA_64=50]="IA_64",e[e.MIPS_X=51]="MIPS_X",e[e.COLDFIRE=52]="COLDFIRE",e[e.ISA68HC12=53]="ISA68HC12",e[e.MMA=54]="MMA",e[e.PCP=55]="PCP",e[e.NCPU=56]="NCPU",e[e.NDR1=57]="NDR1",e[e.STARCORE=58]="STARCORE",e[e.ME16=59]="ME16",e[e.ST100=60]="ST100",e[e.TINYJ=61]="TINYJ",e[e.X86_64=62]="X86_64",e[e.PDSP=63]="PDSP",e[e.PDP10=64]="PDP10",e[e.PDP11=65]="PDP11",e[e.FX66=66]="FX66",e[e.ST9PLUS=67]="ST9PLUS",e[e.ST7=68]="ST7",e[e.ISA68HC16=69]="ISA68HC16",e[e.ISA68HC11=70]="ISA68HC11",e[e.ISA68HC08=71]="ISA68HC08",e[e.ISA68HC05=72]="ISA68HC05",e[e.SVX=73]="SVX",e[e.ST19=74]="ST19",e[e.VAX=75]="VAX",e[e.CRIS=76]="CRIS",e[e.JAVELIN=77]="JAVELIN",e[e.FIREPATH=78]="FIREPATH",e[e.ZSP=79]="ZSP",e[e.MMIX=80]="MMIX",e[e.HUANY=81]="HUANY",e[e.PRISM=82]="PRISM",e[e.AVR=83]="AVR",e[e.FR30=84]="FR30",e[e.D10V=85]="D10V",e[e.D30V=86]="D30V",e[e.V850=87]="V850",e[e.M32R=88]="M32R",e[e.MN10300=89]="MN10300",e[e.MN10200=90]="MN10200",e[e.PJ=91]="PJ",e[e.OPENRISC=92]="OPENRISC",e[e.ARC_COMPACT=93]="ARC_COMPACT",e[e.XTENSA=94]="XTENSA",e[e.VIDEOCORE=95]="VIDEOCORE",e[e.TMM_GPP=96]="TMM_GPP",e[e.NS32K=97]="NS32K",e[e.TPC=98]="TPC",e[e.SNP1K=99]="SNP1K",e[e.ST200=100]="ST200",e[e.IP2K=101]="IP2K",e[e.MAX=102]="MAX",e[e.CR=103]="CR",e[e.F2MC16=104]="F2MC16",e[e.MSP430=105]="MSP430",e[e.BLACKFIN=106]="BLACKFIN",e[e.SE_C33=107]="SE_C33",e[e.SEP=108]="SEP",e[e.ARCA=109]="ARCA",e[e.UNICORE=110]="UNICORE",e[e.EXCESS=111]="EXCESS",e[e.DXP=112]="DXP",e[e.ALTERA_NIOS2=113]="ALTERA_NIOS2",e[e.CRX=114]="CRX",e[e.XGATE=115]="XGATE",e[e.C166=116]="C166",e[e.M16C=117]="M16C",e[e.DSPIC30F=118]="DSPIC30F",e[e.CE=119]="CE",e[e.M32C=120]="M32C",e[e.TSK3000=131]="TSK3000",e[e.RS08=132]="RS08",e[e.SHARC=133]="SHARC",e[e.ECOG2=134]="ECOG2",e[e.SCORE7=135]="SCORE7",e[e.DSP24=136]="DSP24",e[e.VIDEOCORE3=137]="VIDEOCORE3",e[e.LATTICEMICO32=138]="LATTICEMICO32",e[e.SE_C17=139]="SE_C17",e[e.TI_C6000=140]="TI_C6000",e[e.TI_C2000=141]="TI_C2000",e[e.TI_C5500=142]="TI_C5500",e[e.TI_ARP32=143]="TI_ARP32",e[e.TI_PRU=144]="TI_PRU",e[e.MMDSP_PLUS=160]="MMDSP_PLUS",e[e.CYPRESS_M8C=161]="CYPRESS_M8C",e[e.R32C=162]="R32C",e[e.TRIMEDIA=163]="TRIMEDIA",e[e.QDSP6=164]="QDSP6",e[e.ISA8051=165]="ISA8051",e[e.STXP7X=166]="STXP7X",e[e.NDS32=167]="NDS32",e[e.ECOG1X=168]="ECOG1X",e[e.MAXQ30=169]="MAXQ30",e[e.XIMO16=170]="XIMO16",e[e.MANIK=171]="MANIK",e[e.CRAYNV2=172]="CRAYNV2",e[e.RX=173]="RX",e[e.METAG=174]="METAG",e[e.MCST_ELBRUS=175]="MCST_ELBRUS",e[e.ECOG16=176]="ECOG16",e[e.CR16=177]="CR16",e[e.ETPU=178]="ETPU",e[e.SLE9X=179]="SLE9X",e[e.L10M=180]="L10M",e[e.K10M=181]="K10M",e[e.AARCH64=183]="AARCH64",e[e.AVR32=185]="AVR32",e[e.STM8=186]="STM8",e[e.TILE64=187]="TILE64",e[e.TILEPRO=188]="TILEPRO",e[e.MICROBLAZE=189]="MICROBLAZE",e[e.CUDA=190]="CUDA",e[e.TILEGX=191]="TILEGX",e[e.CLOUDSHIELD=192]="CLOUDSHIELD",e[e.COREA_1ST=193]="COREA_1ST",e[e.COREA_2ND=194]="COREA_2ND",e[e.ARC_COMPACT2=195]="ARC_COMPACT2",e[e.OPEN8=196]="OPEN8",e[e.RL78=197]="RL78",e[e.VIDEOCORE5=198]="VIDEOCORE5",e[e.ISA78KOR=199]="ISA78KOR",e[e.ISA56800EX=200]="ISA56800EX",e[e.BA1=201]="BA1",e[e.BA2=202]="BA2",e[e.XCORE=203]="XCORE",e[e.MCHP_PIC=204]="MCHP_PIC",e[e.KM32=210]="KM32",e[e.KMX32=211]="KMX32",e[e.EMX16=212]="EMX16",e[e.EMX8=213]="EMX8",e[e.KVARC=214]="KVARC",e[e.CDP=215]="CDP",e[e.COGE=216]="COGE",e[e.COOL=217]="COOL",e[e.NORC=218]="NORC",e[e.CSR_KALIMBA=219]="CSR_KALIMBA",e[e.Z80=220]="Z80",e[e.VISIUM=221]="VISIUM",e[e.FT32=222]="FT32",e[e.MOXIE=223]="MOXIE",e[e.AMDGPU=224]="AMDGPU",e[e.RISCV=243]="RISCV",e[e.BPF=247]="BPF",e[e.CSKY=252]="CSKY"}(t.ISA||(t.ISA={})),function(e){e[e.SystemV=0]="SystemV",e[e.HPUX=1]="HPUX",e[e.NetBSD=2]="NetBSD",e[e.Linux=3]="Linux",e[e.GNUHurd=4]="GNUHurd",e[e.Solaris=6]="Solaris",e[e.AIX=7]="AIX",e[e.IRIX=8]="IRIX",e[e.FreeBSD=9]="FreeBSD",e[e.Tru64=10]="Tru64",e[e.NovelloModesto=11]="NovelloModesto",e[e.OpenBSD=12]="OpenBSD",e[e.OpenVMS=13]="OpenVMS",e[e.NonStopKernel=14]="NonStopKernel",e[e.AROS=15]="AROS",e[e.FenixOS=16]="FenixOS",e[e.CloudABI=17]="CloudABI",e[e.ARMEABI=64]="ARMEABI",e[e.ARM=97]="ARM",e[e.Standalone=255]="Standalone"}(t.ABI||(t.ABI={})),function(e){e[e.None=0]="None",e[e.Relocatable=1]="Relocatable",e[e.Executable=2]="Executable",e[e.Shared=3]="Shared",e[e.Core=4]="Core"}(t.ObjectType||(t.ObjectType={})),function(e){e[e.Null=0]="Null",e[e.Load=1]="Load",e[e.Dynamic=2]="Dynamic",e[e.Interp=3]="Interp",e[e.Note=4]="Note",e[e.ShLib=5]="ShLib",e[e.ProgramHeaderTable=6]="ProgramHeaderTable",e[e.GnuEhFrame=1685382480]="GnuEhFrame",e[e.GnuStack=1685382481]="GnuStack",e[e.GnuRelRo=1685382482]="GnuRelRo"}(t.ProgramHeaderEntryType||(t.ProgramHeaderEntryType={})),function(e){e[e.Null=0]="Null",e[e.ProgBits=1]="ProgBits",e[e.SymTab=2]="SymTab",e[e.StrTab=3]="StrTab",e[e.Rela=4]="Rela",e[e.Hash=5]="Hash",e[e.Dynamic=6]="Dynamic",e[e.Note=7]="Note",e[e.NoBits=8]="NoBits",e[e.Rel=9]="Rel",e[e.ShLib=10]="ShLib",e[e.DynSym=11]="DynSym",e[e.InitArray=14]="InitArray",e[e.FiniArray=15]="FiniArray",e[e.PreInitArray=16]="PreInitArray",e[e.Group=17]="Group",e[e.ShNdx=18]="ShNdx",e[e.Num=19]="Num",e[e.GnuAttributes=1879048181]="GnuAttributes",e[e.GnuHash=1879048182]="GnuHash",e[e.GnuLibList=1879048183]="GnuLibList",e[e.GnuVerDef=1879048189]="GnuVerDef",e[e.GnuVerNeed=1879048190]="GnuVerNeed",e[e.GnuVerSym=1879048191]="GnuVerSym"}(t.SectionHeaderEntryType||(t.SectionHeaderEntryType={})),function(e){e[e.None=0]="None",e[e.Object=1]="Object",e[e.Function=2]="Function",e[e.Section=3]="Section",e[e.File=4]="File",e[e.Common=5]="Common",e[e.ThreadLocalStorage=6]="ThreadLocalStorage",e[e.RelocationExpression=7]="RelocationExpression",e[e.SignedRelocationExpression=8]="SignedRelocationExpression"}(t.SymbolType||(t.SymbolType={})),function(e){e[e.Local=0]="Local",e[e.Global=1]="Global",e[e.Weak=2]="Weak"}(t.SymbolBinding||(t.SymbolBinding={})),function(e){e[e.Default=0]="Default",e[e.Internal=1]="Internal",e[e.Hidden=2]="Hidden",e[e.Protected=3]="Protected"}(t.SymbolVisibility||(t.SymbolVisibility={}))},397:(e,t)=>{!function(e){var t=/\S/,r=/\"/g,n=/\n/g,o=/\r/g,i=/\\/g,s=/\u2028/,a=/\u2029/;function c(e){"}"===e.n.substr(e.n.length-1)&&(e.n=e.n.substring(0,e.n.length-1))}function u(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function l(e,t,r){if(t.charAt(r)!=e.charAt(0))return!1;for(var n=1,o=e.length;n<o;n++)if(t.charAt(r+n)!=e.charAt(n))return!1;return!0}e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(r,n){var o=r.length,i=0,s=null,a=null,d="",f=[],h=!1,p=0,m=0,g="{{",w="}}";function y(){d.length>0&&(f.push({tag:"_t",text:new String(d)}),d="")}function v(r,n){if(y(),r&&function(){for(var r=!0,n=m;n<f.length;n++)if(!(r=e.tags[f[n].tag]<e.tags._v||"_t"==f[n].tag&&null===f[n].text.match(t)))return!1;return r}())for(var o,i=m;i<f.length;i++)f[i].text&&((o=f[i+1])&&">"==o.tag&&(o.indent=f[i].text.toString()),f.splice(i,1));else n||f.push({tag:"\n"});h=!1,m=f.length}function S(e,t){var r="="+w,n=e.indexOf(r,t),o=u(e.substring(e.indexOf("=",t)+1,n)).split(" ");return g=o[0],w=o[o.length-1],n+r.length-1}for(n&&(n=n.split(" "),g=n[0],w=n[1]),p=0;p<o;p++)0==i?l(g,r,p)?(--p,y(),i=1):"\n"==r.charAt(p)?v(h):d+=r.charAt(p):1==i?(p+=g.length-1,"="==(s=(a=e.tags[r.charAt(p+1)])?r.charAt(p+1):"_v")?(p=S(r,p),i=0):(a&&p++,i=2),h=p):l(w,r,p)?(f.push({tag:s,n:u(d),otag:g,ctag:w,i:"/"==s?h-g.length:p+w.length}),d="",p+=w.length-1,i=0,"{"==s&&("}}"==w?p++:c(f[f.length-1]))):d+=r.charAt(p);return v(h,!0),f};var d={_t:!0,"\n":!0,$:!0,"/":!0};function f(t,r,n,o){var i,s=[],a=null,c=null;for(i=n[n.length-1];t.length>0;){if(c=t.shift(),i&&"<"==i.tag&&!(c.tag in d))throw new Error("Illegal content in < super tag.");if(e.tags[c.tag]<=e.tags.$||h(c,o))n.push(c),c.nodes=f(t,c.tag,n,o);else{if("/"==c.tag){if(0===n.length)throw new Error("Closing tag without opener: /"+c.n);if(a=n.pop(),c.n!=a.n&&!p(c.n,a.n,o))throw new Error("Nesting error: "+a.n+" vs. "+c.n);return a.end=c.i,s}"\n"==c.tag&&(c.last=0==t.length||"\n"==t[0].tag)}s.push(c)}if(n.length>0)throw new Error("missing closing tag: "+n.pop().n);return s}function h(e,t){for(var r=0,n=t.length;r<n;r++)if(t[r].o==e.n)return e.tag="#",!0}function p(e,t,r){for(var n=0,o=r.length;n<o;n++)if(r[n].c==e&&r[n].o==t)return!0}function m(e){var t=[];for(var r in e.partials)t.push('"'+w(r)+'":{name:"'+w(e.partials[r].name)+'", '+m(e.partials[r])+"}");return"partials: {"+t.join(",")+"}, subs: "+function(e){var t=[];for(var r in e)t.push('"'+w(r)+'": function(c,p,t,i) {'+e[r]+"}");return"{ "+t.join(",")+" }"}(e.subs)}e.stringify=function(t,r,n){return"{code: function (c,p,i) { "+e.wrapMain(t.code)+" },"+m(t)+"}"};var g=0;function w(e){return e.replace(i,"\\\\").replace(r,'\\"').replace(n,"\\n").replace(o,"\\r").replace(s,"\\u2028").replace(a,"\\u2029")}function y(e){return~e.indexOf(".")?"d":"f"}function v(e,t){var r="<"+(t.prefix||"")+e.n+g++;return t.partials[r]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+w(r)+'",c,p,"'+(e.indent||"")+'"));',r}function S(e,t){t.code+="t.b(t.t(t."+y(e.n)+'("'+w(e.n)+'",c,p,0)));'}function E(e){return"t.b("+e+");"}e.generate=function(t,r,n){g=0;var o={code:"",subs:{},partials:{}};return e.walk(t,o),n.asString?this.stringify(o,r,n):this.makeTemplate(o,r,n)},e.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(e,t,r){var n=this.makePartials(e);return n.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(n,t,this,r)},e.makePartials=function(e){var t,r={subs:{},partials:e.partials,name:e.name};for(t in r.partials)r.partials[t]=this.makePartials(r.partials[t]);for(t in e.subs)r.subs[t]=new Function("c","p","t","i",e.subs[t]);return r},e.codegen={"#":function(t,r){r.code+="if(t.s(t."+y(t.n)+'("'+w(t.n)+'",c,p,1),c,p,0,'+t.i+","+t.end+',"'+t.otag+" "+t.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(t.nodes,r),r.code+="});c.pop();}"},"^":function(t,r){r.code+="if(!t.s(t."+y(t.n)+'("'+w(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,r),r.code+="};"},">":v,"<":function(t,r){var n={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,n);var o=r.partials[v(t,r)];o.subs=n.subs,o.partials=n.partials},$:function(t,r){var n={subs:{},code:"",partials:r.partials,prefix:t.n};e.walk(t.nodes,n),r.subs[t.n]=n.code,r.inPartial||(r.code+='t.sub("'+w(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=E('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+y(e.n)+'("'+w(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=E('"'+w(e.text)+'"')},"{":S,"&":S},e.walk=function(t,r){for(var n,o=0,i=t.length;o<i;o++)(n=e.codegen[t[o].tag])&&n(t[o],r);return r},e.parse=function(e,t,r){return f(e,0,[],(r=r||{}).sectionTags||[])},e.cache={},e.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},e.compile=function(t,r){r=r||{};var n=e.cacheKey(t,r),o=this.cache[n];if(o){var i=o.partials;for(var s in i)delete i[s].instance;return o}return o=this.generate(this.parse(this.scan(t,r.delimiters),t,r),t,r),this.cache[n]=o}}(t)},485:(e,t,r)=>{var n=r(397);n.Template=r(882).Template,n.template=n.Template,e.exports=n},882:(e,t)=>{!function(e){function t(e,t,r){var n;return t&&"object"==typeof t&&(void 0!==t[e]?n=t[e]:r&&t.get&&"function"==typeof t.get&&(n=t.get(e))),n}e.Template=function(e,t,r,n){e=e||{},this.r=e.code||this.r,this.c=r,this.options=n||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},e.Template.prototype={r:function(e,t,r){return""},v:function(e){return e=c(e),a.test(e)?e.replace(r,"&").replace(n,"<").replace(o,">").replace(i,"'").replace(s,"""):e},t:c,render:function(e,t,r){return this.ri([e],t||{},r)},ri:function(e,t,r){return this.r(e,t,r)},ep:function(e,t){var r=this.partials[e],n=t[r.name];if(r.instance&&r.base==n)return r.instance;if("string"==typeof n){if(!this.c)throw new Error("No compiler available.");n=this.c.compile(n,this.options)}if(!n)return null;if(this.partials[e].base=n,r.subs){for(key in t.stackText||(t.stackText={}),r.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);n=function(e,t,r,n,o,i){function s(){}function a(){}var c;s.prototype=e,a.prototype=e.subs;var u=new s;for(c in u.subs=new a,u.subsText={},u.buf="",n=n||{},u.stackSubs=n,u.subsText=i,t)n[c]||(n[c]=t[c]);for(c in n)u.subs[c]=n[c];for(c in o=o||{},u.stackPartials=o,r)o[c]||(o[c]=r[c]);for(c in o)u.partials[c]=o[c];return u}(n,r.subs,r.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=n,n},rp:function(e,t,r,n){var o=this.ep(e,r);return o?o.ri(t,r,n):""},rs:function(e,t,r){var n=e[e.length-1];if(u(n))for(var o=0;o<n.length;o++)e.push(n[o]),r(e,t,this),e.pop();else r(e,t,this)},s:function(e,t,r,n,o,i,s){var a;return(!u(e)||0!==e.length)&&("function"==typeof e&&(e=this.ms(e,t,r,n,o,i,s)),a=!!e,!n&&a&&t&&t.push("object"==typeof e?e:t[t.length-1]),a)},d:function(e,r,n,o){var i,s=e.split("."),a=this.f(s[0],r,n,o),c=this.options.modelGet,l=null;if("."===e&&u(r[r.length-2]))a=r[r.length-1];else for(var d=1;d<s.length;d++)void 0!==(i=t(s[d],a,c))?(l=a,a=i):a="";return!(o&&!a)&&(o||"function"!=typeof a||(r.push(l),a=this.mv(a,r,n),r.pop()),a)},f:function(e,r,n,o){for(var i=!1,s=!1,a=this.options.modelGet,c=r.length-1;c>=0;c--)if(void 0!==(i=t(e,r[c],a))){s=!0;break}return s?(o||"function"!=typeof i||(i=this.mv(i,r,n)),i):!o&&""},ls:function(e,t,r,n,o){var i=this.options.delimiters;return this.options.delimiters=o,this.b(this.ct(c(e.call(t,n)),t,r)),this.options.delimiters=i,!1},ct:function(e,t,r){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,r)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,r,n,o,i,s){var a,c=t[t.length-1],u=e.call(c);return"function"==typeof u?!!n||(a=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(u,c,r,a.substring(o,i),s)):u},mv:function(e,t,r){var n=t[t.length-1],o=e.call(n);return"function"==typeof o?this.ct(c(o.call(n)),n,r):o},sub:function(e,t,r,n){var o=this.subs[e];o&&(this.activeSub=e,o(t,r,this,n),this.activeSub=!1)}};var r=/&/g,n=/</g,o=/>/g,i=/\'/g,s=/\"/g,a=/[&<>\"\']/;function c(e){return String(null==e?"":e)}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}(t)},405:(e,t,r)=>{var n=r(887),o=r(325),i=65536,s=15,a=f(5<<20),c=function(){try{return new Uint32Array(i)}catch(r){for(var e=new Array(i),t=0;t<i;t++)e[t]=0;return e}}(),u=407708164,l=2147483648,d={4:65536,5:262144,6:1048576,7:4194304};function f(e){try{return new Uint8Array(e)}catch(n){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t}}function h(e,t,r){if(void 0!==typeof e.buffer){if(Uint8Array.prototype.slice)return e.slice(t,r);var n=e.length;t=(t|=0)<0?Math.max(n+t,0):Math.min(t,n),r=(r=void 0===r?n:0|r)<0?Math.max(n+r,0):Math.min(r,n);for(var o=new Uint8Array(r-t),i=t,s=0;i<r;)o[s++]=e[i++];return o}return e.slice(t,r)}t.compressBound=function(e){return e+e/255+16|0},t.decompressBound=function(e){var t=0;if(o.readU32(e,t)!==u)throw new Error("invalid magic number");t+=4;var r=e[t++];if(64!=(192&r))throw new Error("incompatible descriptor version "+(192&r));var n=0!=(16&r),i=0!=(8&r),s=e[t++]>>4&7;if(void 0===d[s])throw new Error("invalid block size "+s);var a=d[s];if(i)return o.readU64(e,t);t++;for(var c=0;;){var f=o.readU32(e,t);if(t+=4,c+=f&l?f&=2147483647:a,0===f)return c;n&&(t+=4),t+=f}},t.makeBuffer=f,t.decompressBlock=function(e,t,r,n,o){var i,s,a,c,u;for(a=r+n;r<a;){var l=e[r++],d=l>>4;if(d>0){if(15===d)for(;d+=e[r],255===e[r++];);for(c=r+d;r<c;)t[o++]=e[r++]}if(r>=a)break;if(i=15&l,s=e[r++]|e[r++]<<8,15===i)for(;i+=e[r],255===e[r++];);for(c=(u=o-s)+(i+=4);u<c;)t[o++]=0|t[u++]}return o},t.compressBlock=function(e,t,r,n,i){var a,c,u,l,d,f,h,p;if(f=0,h=n+r,c=r,n>=13)for(var m=67;r+4<h-5;){var g=o.readU32(e,r),w=o.hashU32(g)>>>0;if(a=i[w=(w>>16^w)>>>0&65535]-1,i[w]=r+1,a<0||r-a>>>16>0||o.readU32(e,a)!==g)r+=m++>>6;else{for(m=67,d=r-c,l=r-a,a+=4,u=r+=4;r<h-5&&e[r]===e[a];)r++,a++;var y=(u=r-u)<15?u:15;if(d>=s){for(t[f++]=240+y,p=d-s;p>=255;p-=255)t[f++]=255;t[f++]=p}else t[f++]=(d<<4)+y;for(var v=0;v<d;v++)t[f++]=e[c+v];if(t[f++]=l,t[f++]=l>>8,u>=15){for(p=u-15;p>=255;p-=255)t[f++]=255;t[f++]=p}c=r}}if(0===c)return 0;if((d=h-c)>=s){for(t[f++]=240,p=d-s;p>=255;p-=255)t[f++]=255;t[f++]=p}else t[f++]=d<<4;for(r=c;r<h;)t[f++]=e[r++];return f},t.decompressFrame=function(e,r){var n,i,s,a,c=0,f=0;if(o.readU32(e,c)!==u)throw new Error("invalid magic number");if(c+=4,64!=(192&(a=e[c++])))throw new Error("incompatible descriptor version");n=0!=(16&a),i=0!=(4&a),s=0!=(8&a);var h=e[c++]>>4&7;if(void 0===d[h])throw new Error("invalid block size");for(s&&(c+=8),c++;;){var p;if(p=o.readU32(e,c),c+=4,0===p)break;if(n&&(c+=4),0!=(p&l)){p&=2147483647;for(var m=0;m<p;m++)r[f++]=e[c++]}else f=t.decompressBlock(e,r,c,p,f),c+=p}return i&&(c+=4),f},t.compressFrame=function(e,r){var s=0;o.writeU32(r,s,u),s+=4,r[s++]=64,r[s++]=112,r[s]=n.hash(0,r,4,s-4)>>8,s++;var l=d[7],f=e.length,h=0;for(!function(e){for(var t=0;t<i;t++)c[t]=0}();f>0;){var p,m=f>l?l:f;if((p=t.compressBlock(e,a,h,m,c))>m||0===p){o.writeU32(r,s,2147483648|m),s+=4;for(var g=h+m;h<g;)r[s++]=e[h++];f-=m}else{o.writeU32(r,s,p),s+=4;for(var w=0;w<p;)r[s++]=a[w++];h+=m,f-=m}}return o.writeU32(r,s,0),s+=4},t.decompress=function(e,r){var n,o;return void 0===r&&(r=t.decompressBound(e)),n=t.makeBuffer(r),(o=t.decompressFrame(e,n))!==r&&(n=h(n,0,o)),n},t.compress=function(e,r){var n,o;return void 0===r&&(r=t.compressBound(e.length)),n=t.makeBuffer(r),(o=t.compressFrame(e,n))!==r&&(n=h(n,0,o)),n}},325:(e,t)=>{t.hashU32=function(e){return-1252372727^(e=(e=(e=(e=-949894596^(e=(e|=0)+2127912214+(e<<12)|0)^e>>>19)+374761393+(e<<5)|0)+-744332180^e<<9)+-42973499+(e<<3)|0)^e>>>16|0},t.readU64=function(e,t){var r=0;return r|=e[t++]<<0,r|=e[t++]<<8,r|=e[t++]<<16,r|=e[t++]<<24,r|=e[t++]<<32,r|=e[t++]<<40,r|=e[t++]<<48,r|=e[t++]<<56},t.readU32=function(e,t){var r=0;return r|=e[t++]<<0,r|=e[t++]<<8,r|=e[t++]<<16,r|=e[t++]<<24},t.writeU32=function(e,t,r){e[t++]=r>>0&255,e[t++]=r>>8&255,e[t++]=r>>16&255,e[t++]=r>>24&255},t.imul=function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16)*n+r*(t>>>16)<<16)|0}},887:(e,t,r)=>{var n=r(325),o=2654435761,i=2246822519,s=3266489917,a=374761393;function c(e,t){return(e|=0)>>>(32-(t|=0)|0)|e<<t|0}function u(e,t,r){return e|=0,t|=0,r|=0,0|n.imul(e>>>(32-t|0)|e<<t,r)}function l(e,t){return(e|=0)>>>(t|=0)^e|0}function d(e,t,r,o,i){return u(n.imul(t,r)+e,o,i)}function f(e,t,r){return u(e+n.imul(t[r],a),11,o)}function h(e,t,r){return d(e,n.readU32(t,r),s,17,668265263)}function p(e,t,r){return[d(e[0],n.readU32(t,r+0),i,13,o),d(e[1],n.readU32(t,r+4),i,13,o),d(e[2],n.readU32(t,r+8),i,13,o),d(e[3],n.readU32(t,r+12),i,13,o)]}t.hash=function(e,t,r,u){var d,m;if(m=u,u>=16){for(d=[e+o+i,e+i,e,e-o];u>=16;)d=p(d,t,r),r+=16,u-=16;d=c(d[0],1)+c(d[1],7)+c(d[2],12)+c(d[3],18)+m}else d=e+a+u>>>0;for(;u>=4;)d=h(d,t,r),r+=4,u-=4;for(;u>0;)d=f(d,t,r),r++,u--;return(d=l(n.imul(l(n.imul(l(d,15),i),13),s),16))>>>0}},118:(e,t,r)=>{var n=r(485);e.exports=function(){var e=new n.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b("MEMORY {"),n.b("\n"+r),n.b(" FLASH (rx) : ORIGIN = "),n.b(n.v(n.f("flashStart",e,t,0))),n.b(", LENGTH = "),n.b(n.v(n.f("flashLength",e,t,0))),n.b("\n"+r),n.b(" RAM (rwx) : ORIGIN = "),n.b(n.v(n.f("ramStart",e,t,0))),n.b(", LENGTH = "),n.b(n.v(n.f("ramLength",e,t,0))),n.b("\n"+r),n.b("}"),n.b("\n"),n.b("\n"+r),n.b("PROVIDE(eadk_external_data = _binary_input_dat_start);"),n.b("\n"),n.b("\n"+r),n.b("SECTIONS {"),n.b("\n"+r),n.b(" .eadk_app_info ORIGIN(FLASH) : {"),n.b("\n"+r),n.b(" LONG(0xDEC0BEBA);"),n.b("\n"+r),n.b(" *(.rodata.eadk_app_api_level)"),n.b("\n"+r),n.b(" LONG(eadk_app_name - ORIGIN(FLASH)); /* This symbol must be defined and point to a NULL-terminated UTF-8 string */"),n.b("\n"+r),n.b(" LONG(SIZEOF(.rodata.eadk_app_icon));"),n.b("\n"+r),n.b(" LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(_eadk_start - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(_eadk_app_end - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(0xDEC0BEBA);"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .text : {"),n.b("\n"+r),n.b(" *(.text)"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" *(.rodata)"),n.b("\n"+r),n.b(" _eadk_app_end = .;"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .data : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" _data_section_start_flash = LOADADDR(.data);"),n.b("\n"+r),n.b(" _data_section_start_ram = .;"),n.b("\n"+r),n.b(" *(.data)"),n.b("\n"+r),n.b(" _data_section_end_ram = .;"),n.b("\n"+r),n.b(" } >RAM AT >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .bss : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" _bss_section_start_ram = .;"),n.b("\n"+r),n.b(" *(.bss)"),n.b("\n"+r),n.b(" _bss_section_end_ram = .;"),n.b("\n"+r),n.b(" } >RAM"),n.b("\n"),n.b("\n"+r),n.b(" .heap : {"),n.b("\n"+r),n.b(" _heap_start = .;"),n.b("\n"+r),n.b(" . = (ORIGIN(RAM) + LENGTH(RAM));"),n.b("\n"+r),n.b(" _heap_end = .;"),n.b("\n"+r),n.b(" } >RAM"),n.b("\n"+r),n.b("}"),n.b("\n"),n.fl()},partials:{},subs:{}},"MEMORY {\n FLASH (rx) : ORIGIN = {{ flashStart }}, LENGTH = {{ flashLength }}\n RAM (rwx) : ORIGIN = {{ ramStart }}, LENGTH = {{ ramLength }}\n}\n\nPROVIDE(eadk_external_data = _binary_input_dat_start);\n\nSECTIONS {\n .eadk_app_info ORIGIN(FLASH) : {\n LONG(0xDEC0BEBA);\n *(.rodata.eadk_app_api_level)\n LONG(eadk_app_name - ORIGIN(FLASH)); /* This symbol must be defined and point to a NULL-terminated UTF-8 string */\n LONG(SIZEOF(.rodata.eadk_app_icon));\n LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));\n LONG(_eadk_start - ORIGIN(FLASH));\n LONG(_eadk_app_end - ORIGIN(FLASH));\n LONG(0xDEC0BEBA);\n } >FLASH\n\n .text : {\n *(.text)\n } >FLASH\n\n .rodata : {\n . = ALIGN(4);\n *(.rodata)\n _eadk_app_end = .;\n } >FLASH\n\n .data : {\n . = ALIGN(4);\n _data_section_start_flash = LOADADDR(.data);\n _data_section_start_ram = .;\n *(.data)\n _data_section_end_ram = .;\n } >RAM AT >FLASH\n\n .bss : {\n . = ALIGN(4);\n _bss_section_start_ram = .;\n *(.bss)\n _bss_section_end_ram = .;\n } >RAM\n\n .heap : {\n _heap_start = .;\n . = (ORIGIN(RAM) + LENGTH(RAM));\n _heap_end = .;\n } >RAM\n}\n",n);return e.render.apply(e,arguments)}},898:e=>{"use strict";e.exports={type:"Buffer",data:[127,69,76,70,1,1,1,0,0,0,0,0,0,0,0,0,1,0,40,0,1,0,0,0,0,0,0,0,0,0,0,0,4,4,0,0,0,0,0,5,52,0,0,0,0,0,40,0,8,0,7,0,16,181,1,223,4,70,224,178,16,189,2,223,112,71,16,181,3,223,4,70,224,178,16,189,16,181,4,223,4,70,224,178,16,189,5,223,16,238,16,202,0,238,16,202,112,71,130,176,2,171,3,233,3,0,18,223,2,176,112,71,130,176,2,171,3,233,3,0,19,223,2,176,112,71,130,176,2,171,3,233,3,0,20,223,2,176,112,71,16,181,21,223,4,70,224,178,16,189,51,180,189,248,16,80,1,145,124,70,164,13,4,149,164,5,4,245,128,52,36,107,164,70,2,176,48,188,96,71,0,34,0,35,19,181,108,70,205,233,0,35,34,223,32,96,97,96,212,233,0,1,2,176,16,189,0,34,0,35,19,181,108,70,205,233,0,35,48,223,32,96,97,96,212,233,0,1,2,176,16,189,49,223,112,71,50,223,112,71,16,181,45,223,4,70,32,70,16,189,65,36,0,0,0,97,101,97,98,105,0,1,26,0,0,0,5,67,111,114,116,101,120,45,77,55,0,6,13,7,77,9,2,10,8,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,4,0,4,0,0,0,1,0,0,0,0,0,0,0,18,0,1,0,30,0,0,0,10,0,0,0,0,0,0,0,16,0,1,0,60,0,0,0,14,0,0,0,0,0,0,0,16,0,1,0,85,0,0,0,24,0,0,0,0,0,0,0,16,0,1,0,104,0,0,0,34,0,0,0,0,0,0,0,16,0,1,0,125,0,0,0,46,0,0,0,0,0,0,0,16,0,1,0,148,0,0,0,60,0,0,0,0,0,0,0,16,0,1,0,171,0,0,0,74,0,0,0,0,0,0,0,16,0,1,0,202,0,0,0,88,0,0,0,0,0,0,0,16,0,1,0,231,0,0,0,98,0,0,0,0,0,0,0,16,0,1,0,0,1,0,0,128,0,0,0,0,0,0,0,16,0,1,0,19,1,0,0,154,0,0,0,0,0,0,0,16,0,1,0,38,1,0,0,180,0,0,0,0,0,0,0,16,0,1,0,57,1,0,0,184,0,0,0,0,0,0,0,16,0,1,0,76,1,0,0,188,0,0,0,0,0,0,0,16,0,1,0,0,36,116,0,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,98,114,105,103,104,116,110,101,115,115,0,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,115,101,116,95,98,114,105,103,104,116,110,101,115,115,0,101,97,100,107,95,98,97,116,116,101,114,121,95,105,115,95,99,104,97,114,103,105,110,103,0,101,97,100,107,95,98,97,116,116,101,114,121,95,108,101,118,101,108,0,101,97,100,107,95,98,97,116,116,101,114,121,95,118,111,108,116,97,103,101,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,95,117,110,105,102,111,114,109,0,101,97,100,107,95,100,105,115,112,108,97,121,95,119,97,105,116,95,102,111,114,95,118,98,108,97,110,107,0,101,97,100,107,95,100,105,115,112,108,97,121,95,100,114,97,119,95,115,116,114,105,110,103,0,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,101,97,100,107,95,114,97,110,100,111,109,0,0,46,115,121,109,116,97,98,0,46,115,116,114,116,97,98,0,46,115,104,115,116,114,116,97,98,0,46,116,101,120,116,0,46,100,97,116,97,0,46,98,115,115,0,46,65,82,77,46,97,116,116,114,105,98,117,116,101,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,52,0,0,0,198,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,33,0,0,0,1,0,0,0,3,0,0,0,0,0,0,0,250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,39,0,0,0,8,0,0,0,3,0,0,0,0,0,0,0,250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,44,0,0,0,3,0,0,112,0,0,0,0,0,0,0,0,250,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,32,1,0,0,80,1,0,0,6,0,0,0,6,0,0,0,4,0,0,0,16,0,0,0,9,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,112,2,0,0,88,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,17,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,200,3,0,0,60,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0]}},573:(e,t,r)=>{"use strict";e.exports=r.p+"ld.wasm"},835:(e,t,r)=>{"use strict";e.exports=r.p+"objcopy.wasm"},81:e=>{"use strict";e.exports=require("child_process")},113:e=>{"use strict";e.exports=require("crypto")},361:e=>{"use strict";e.exports=require("events")},147:e=>{"use strict";e.exports=require("fs")},292:e=>{"use strict";e.exports=require("fs/promises")},17:e=>{"use strict";e.exports=require("path")},168:e=>{"use strict";e.exports=require("process")},576:e=>{"use strict";e.exports=require("string_decoder")},735:()=>{},461:(e,t,r)=>{const{Argument:n}=r(998),{Command:o}=r(282),{CommanderError:i,InvalidArgumentError:s}=r(56),{Help:a}=r(917),{Option:c}=r(790);(t=e.exports=new o).program=t,t.Argument=n,t.Command=o,t.CommanderError=i,t.Help=a,t.InvalidArgumentError=s,t.InvalidOptionArgumentError=s,t.Option=c},998:(e,t,r)=>{const{InvalidArgumentError:n}=r(56);t.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},t.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"}},282:(e,t,r)=>{const n=r(361).EventEmitter,o=r(81),i=r(17),s=r(147),a=r(168),{Argument:c,humanReadableArgName:u}=r(998),{CommanderError:l}=r(56),{Help:d}=r(917),{Option:f,splitOptionFlags:h,DualOptions:p}=r(790),{suggestSimilar:m}=r(812);class g extends n{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:e=>a.stdout.write(e),writeErr:e=>a.stderr.write(e),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:void 0,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,t,r){let n=t,o=r;"object"==typeof n&&null!==n&&(o=n,n=null),o=o||{};const[,i,s]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(i);return n&&(a.description(n),a._executableHandler=!0),o.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!o.noHelp&&!o.hidden),a._executableFile=o.executableFile||null,s&&a.arguments(s),this.commands.push(a),a.parent=this,a.copyInheritedSettings(this),n?this:a}createCommand(e){return new g(e)}createHelp(){return Object.assign(new d,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,t){return new c(e,t)}argument(e,t,r,n){const o=this.createArgument(e,t);return"function"==typeof r?o.default(n).argParser(r):o.default(r),this.addArgument(o),this}arguments(e){return e.split(/ +/).forEach((e=>{this.argument(e)})),this}addArgument(e){const t=this._args.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){const r=["preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,r){this._exitCallback&&this._exitCallback(new l(e,t,r)),a.exit(e)}action(e){return this._actionHandler=t=>{const r=this._args.length,n=t.slice(0,r);return this._storeOptionsAsProperties?n[r]=this:n[r]=this.opts(),n.push(this),e.apply(this,n)},this}createOption(e,t){return new f(e,t)}addOption(e){const t=e.name(),r=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(r,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(r,e.defaultValue,"default");this.options.push(e);const n=(t,n,o)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const i=this.getOptionValue(r);if(null!==t&&e.parseArg)try{t=e.parseArg(t,i)}catch(e){if("commander.invalidArgument"===e.code){const t=`${n} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}else null!==t&&e.variadic&&(t=e._concatValue(t,i));null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(r,t,o)};return this.on("option:"+t,(t=>{const r=`error: option '${e.flags}' argument '${t}' is invalid.`;n(t,r,"cli")})),e.envVar&&this.on("optionEnv:"+t,(t=>{const r=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;n(t,r,"env")})),this}_optionEx(e,t,r,n,o){if("object"==typeof t&&t instanceof f)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const i=this.createOption(t,r);if(i.makeOptionMandatory(!!e.mandatory),"function"==typeof n)i.default(o).argParser(n);else if(n instanceof RegExp){const e=n;n=(t,r)=>{const n=e.exec(t);return n?n[0]:r},i.default(o).argParser(n)}else i.default(n);return this.addOption(i)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this}setOptionValueWithSource(e,t,r){return this.setOptionValue(e,t),this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");let r;switch(t=t||{},void 0===e&&(e=a.argv,a.versions&&a.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":a.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,t){const r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){const r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_executeSubCommand(e,t){t=t.slice();let r=!1;const n=[".js",".ts",".tsx",".mjs",".cjs"];function c(e,t){const r=i.resolve(e,t);if(s.existsSync(r))return r;if(n.includes(i.extname(t)))return;const o=n.find((e=>s.existsSync(`${r}${e}`)));return o?`${r}${o}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u,d=e._executableFile||`${this._name}-${e._name}`,f=this._executableDir||"";if(this._scriptPath){let e;try{e=s.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}f=i.resolve(i.dirname(e),f)}if(f){let t=c(f,d);if(!t&&!e._executableFile&&this._scriptPath){const r=i.basename(this._scriptPath,i.extname(this._scriptPath));r!==this._name&&(t=c(f,`${r}-${e._name}`))}d=t||d}if(r=n.includes(i.extname(d)),"win32"!==a.platform?r?(t.unshift(d),t=y(a.execArgv).concat(t),u=o.spawn(a.argv[0],t,{stdio:"inherit"})):u=o.spawn(d,t,{stdio:"inherit"}):(t.unshift(d),t=y(a.execArgv).concat(t),u=o.spawn(a.execPath,t,{stdio:"inherit"})),!u.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((e=>{a.on(e,(()=>{!1===u.killed&&null===u.exitCode&&u.kill(e)}))}))}const h=this._exitCallback;h?u.on("close",(()=>{h(new l(a.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):u.on("close",a.exit.bind(a)),u.on("error",(t=>{if("ENOENT"===t.code){const t=f?`searched for local subcommand relative to directory '${f}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",r=`'${d}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(r)}if("EACCES"===t.code)throw new Error(`'${d}' not executable`);if(h){const e=new l(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,h(e)}else a.exit(1)})),this.runningCommand=u}_dispatchSubcommand(e,t,r){const n=this._findCommand(e);if(n||this.help({error:!0}),!n._executableHandler)return n._parseCommand(t,r);this._executeSubCommand(n,t.concat(r))}_checkNumberOfArguments(){this._args.forEach(((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,r)=>{let n=t;if(null!==t&&e.parseArg)try{n=e.parseArg(t,r)}catch(r){if("commander.invalidArgument"===r.code){const n=`error: command-argument value '${t}' is invalid for argument '${e.name()}'. ${r.message}`;this.error(n,{exitCode:r.exitCode,code:r.code})}throw r}return n};this._checkNumberOfArguments();const t=[];this._args.forEach(((r,n)=>{let o=r.defaultValue;r.variadic?n<this.args.length?(o=this.args.slice(n),r.parseArg&&(o=o.reduce(((t,n)=>e(r,n,t)),r.defaultValue))):void 0===o&&(o=[]):n<this.args.length&&(o=this.args[n],r.parseArg&&(o=e(r,o,r.defaultValue))),t[n]=o})),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then((()=>t())):t()}_chainOrCallHooks(e,t){let r=e;const n=[];return v(this).reverse().filter((e=>void 0!==e._lifeCycleHooks[t])).forEach((e=>{e._lifeCycleHooks[t].forEach((t=>{n.push({hookedCommand:e,callback:t})}))})),"postAction"===t&&n.reverse(),n.forEach((e=>{r=this._chainOrCall(r,(()=>e.callback(e.hookedCommand,this)))})),r}_parseCommand(e,t){const r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return 1===e.length&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return w(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),w(this,r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const n=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){let r;return n(),this._processArguments(),r=this._chainOrCallHooks(r,"preAction"),r=this._chainOrCall(r,(()=>this._actionHandler(this.processedArgs))),this.parent&&(r=this._chainOrCall(r,(()=>{this.parent.emit(o,e,t)}))),r=this._chainOrCallHooks(r,"postAction"),r}if(this.parent&&this.parent.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find((t=>t._name===e||t._aliases.includes(e)))}_findOption(e){return this.options.find((t=>t.is(e)))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach((t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)}))}_checkForConflictingLocalOptions(){const e=this.options.filter((e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)}));e.filter((e=>e.conflictsWith.length>0)).forEach((t=>{const r=e.find((e=>t.conflictsWith.includes(e.attributeName())));r&&this._conflictingOption(t,r)}))}_checkForConflictingOptions(){for(let e=this;e;e=e.parent)e._checkForConflictingLocalOptions()}parseOptions(e){const t=[],r=[];let n=t;const o=e.slice();function i(e){return e.length>1&&"-"===e[0]}let s=null;for(;o.length;){const e=o.shift();if("--"===e){n===r&&n.push(e),n.push(...o);break}if(!s||i(e)){if(s=null,i(e)){const t=this._findOption(e);if(t){if(t.required){const e=o.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;o.length>0&&!i(o[0])&&(e=o.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);s=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),o.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),r=this._findOption(e.slice(0,t));if(r&&(r.required||r.optional)){this.emit(`option:${r.name()}`,e.slice(t+1));continue}}if(i(e)&&(n=r),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===r.length){if(this._findCommand(e)){t.push(e),o.length>0&&r.push(...o);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),o.length>0&&t.push(...o);break}if(this._defaultCommandName){r.push(e),o.length>0&&r.push(...o);break}}if(this._passThroughOptions){n.push(e),o.length>0&&n.push(...o);break}n.push(e)}else this.emit(`option:${s.name()}`,e)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let r=0;r<t;r++){const t=this.options[r].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return v(this).reduce(((e,t)=>Object.assign(e,t.opts())),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const r=t||{},n=r.exitCode||1,o=r.code||"commander.error";this._exit(n,o,e)}_parseOptionsEnv(){this.options.forEach((e=>{if(e.envVar&&e.envVar in a.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,a.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}}))}_parseOptionsImplied(){const e=new p(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter((r=>void 0!==r.implied&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r))).forEach((e=>{Object.keys(e.implied).filter((e=>!t(e))).forEach((t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")}))}))}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const r=e=>{const t=e.attributeName(),r=this.getOptionValue(t),n=this.options.find((e=>e.negate&&t===e.attributeName())),o=this.options.find((e=>!e.negate&&t===e.attributeName()));return n&&(void 0===n.presetArg&&!1===r||void 0!==n.presetArg&&r===n.presetArg)?n:o||e},n=e=>{const t=r(e),n=t.attributeName();return"env"===this.getOptionValueSource(n)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},o=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let r=[],n=this;do{const e=n.createHelp().visibleOptions(n).filter((e=>e.long)).map((e=>e.long));r=r.concat(e),n=n.parent}while(n&&!n._enablePositionalOptions);t=m(e,r)}const r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this._args.length,r=1===t?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${r} but got ${e.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const r=[];this.createHelp().visibleCommands(this).forEach((e=>{r.push(e.name()),e.alias()&&r.push(e.alias())})),t=m(e,r)}const r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";const n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this.options.push(n),this.on("option:"+n.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)})),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach((e=>this.alias(e))),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this._args.map((e=>u(e)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=i.basename(e,i.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let r;return r=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||r,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const r=this._getHelpContext(e);v(this).reverse().forEach((e=>e.emit("beforeAllHelp",r))),this.emit("beforeHelp",r);let n=this.helpInformation(r);if(t&&(n=t(n),"string"!=typeof n&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(n),this.emit(this._helpLongFlag),this.emit("afterHelp",r),v(this).forEach((e=>e.emit("afterAllHelp",r)))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;const r=h(this._helpFlags);return this._helpShortFlag=r.shortFlag,this._helpLongFlag=r.longFlag,this}help(e){this.outputHelp(e);let t=a.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${r.join("', '")}'`);const n=`${e}Help`;return this.on(n,(e=>{let r;r="function"==typeof t?t({error:e.error,command:e.command}):t,r&&e.write(`${r}\n`)})),this}}function w(e,t){e._hasHelpOption&&t.find((t=>t===e._helpLongFlag||t===e._helpShortFlag))&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function y(e){return e.map((e=>{if(!e.startsWith("--inspect"))return e;let t,r,n="127.0.0.1",o="9229";return null!==(r=e.match(/^(--inspect(-brk)?)$/))?t=r[1]:null!==(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=r[1],/^\d+$/.test(r[3])?o=r[3]:n=r[3]):null!==(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=r[1],n=r[3],o=r[4]),t&&"0"!==o?`${t}=${n}:${parseInt(o)+1}`:e}))}function v(e){const t=[];for(let r=e;r;r=r.parent)t.push(r);return t}t.Command=g},56:(e,t)=>{class r extends Error{constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}t.CommanderError=r,t.InvalidArgumentError=class extends r{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},917:(e,t,r)=>{const{humanReadableArgName:n}=r(998);t.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){const t=e.commands.filter((e=>!e._hidden));if(e._hasImplicitHelpCommand()){const[,r,n]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=e.createCommand(r).helpOption(!1);o.description(e._helpCommandDescription),n&&o.arguments(n),t.push(o)}return this.sortSubcommands&&t.sort(((e,t)=>e.name().localeCompare(t.name()))),t}visibleOptions(e){const t=e.options.filter((e=>!e.hidden)),r=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),n=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(r||n){let o;o=r?n?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(o)}if(this.sortOptions){const e=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");t.sort(((t,r)=>e(t).localeCompare(e(r))))}return t}visibleArguments(e){return e._argsDescription&&e._args.forEach((t=>{t.description=t.description||e._argsDescription[t.name()]||""})),e._args.find((e=>e.description))?e._args:[]}subcommandTerm(e){const t=e._args.map((e=>n(e))).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce(((e,r)=>Math.max(e,t.subcommandTerm(r).length)),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce(((e,r)=>Math.max(e,t.optionTerm(r).length)),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce(((e,r)=>Math.max(e,t.argumentTerm(r).length)),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let t=e.parent;t;t=t.parent)r=t.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}return void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatHelp(e,t){const r=t.padWidth(e,t),n=t.helpWidth||80;function o(e,o){if(o){const i=`${e.padEnd(r+2)}${o}`;return t.wrap(i,n-2,r+2)}return e}function i(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let s=[`Usage: ${t.commandUsage(e)}`,""];const a=t.commandDescription(e);a.length>0&&(s=s.concat([a,""]));const c=t.visibleArguments(e).map((e=>o(t.argumentTerm(e),t.argumentDescription(e))));c.length>0&&(s=s.concat(["Arguments:",i(c),""]));const u=t.visibleOptions(e).map((e=>o(t.optionTerm(e),t.optionDescription(e))));u.length>0&&(s=s.concat(["Options:",i(u),""]));const l=t.visibleCommands(e).map((e=>o(t.subcommandTerm(e),t.subcommandDescription(e))));return l.length>0&&(s=s.concat(["Commands:",i(l),""])),s.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,r,n=40){if(e.match(/[\n]\s+/))return e;const o=t-r;if(o<n)return e;const i=e.slice(0,r),s=e.slice(r),a=" ".repeat(r),c=new RegExp(".{1,"+(o-1)+"}([\\s]|$)|[^\\s]+?([\\s]|$)","g");return i+(s.match(c)||[]).map(((e,t)=>("\n"===e.slice(-1)&&(e=e.slice(0,e.length-1)),(t>0?a:"")+e.trimRight()))).join("\n")}}},790:(e,t,r)=>{const{InvalidArgumentError:n}=r(56);function o(e){let t,r;const n=e.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(t=n.shift()),r=n.shift(),!t&&/^-[^-]$/.test(r)&&(t=r,r=void 0),{shortFlag:t,longFlag:r}}t.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const r=o(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){return this.implied=Object.assign(this.implied||{},e),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((e,t)=>e+t[0].toUpperCase()+t.slice(1)))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},t.splitOptionFlags=o,t.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)})),this.negativeOptions.forEach(((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)}))}valueFromOption(e,t){const r=t.attributeName();if(!this.dualOptions.has(r))return!0;const n=this.negativeOptions.get(r).presetArg,o=void 0!==n&&n;return t.negate===(o===e)}}},812:(e,t)=>{t.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const r=e.startsWith("--");r&&(e=e.slice(2),t=t.map((e=>e.slice(2))));let n=[],o=3;return t.forEach((t=>{if(t.length<=1)return;const r=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);const r=[];for(let t=0;t<=e.length;t++)r[t]=[t];for(let e=0;e<=t.length;e++)r[0][e]=e;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let i=1;i=e[o-1]===t[n-1]?0:1,r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+i),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[e.length][t.length]}(e,t),i=Math.max(e.length,t.length);(i-r)/i>.4&&(r<o?(o=r,n=[t]):r===o&&n.push(t))})),n.sort(((e,t)=>e.localeCompare(t))),r&&(n=n.map((e=>`--${e}`))),n.length>1?`\n(Did you mean one of ${n.join(", ")}?)`:1===n.length?`\n(Did you mean ${n[0]}?)`:""}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.p="",(()=>{"use strict";const e=require("usb");class t extends Error{constructor(e,...t){super(...t),this.name=e}}const n=t;class o{static Content="";static append(e,...t){let r="";t.forEach((e=>{r+=e+","})),o.Content+=+new Date+","+e+","+r+"\n"}static info(...e){o.append("info",...e)}static warn(...e){o.append("warn",...e)}static error(...e){o.append("error",...e)}}const i=o,s=6,a=8,c=10,u=2,l=3,d=4,f=1033;function h(e){return{bLength:e.getUint8(0),bDescriptorType:e.getUint8(1),bInterfaceNumber:e.getUint8(2),bAlternateSetting:e.getUint8(3),bNumEndpoints:e.getUint8(4),bInterfaceClass:e.getUint8(5),bInterfaceSubClass:e.getUint8(6),bInterfaceProtocol:e.getUint8(7),iInterface:e.getUint8(8),endpoints:[]}}function p(e){let t=function(e){let t,r=e,n=[];for(;r.byteLength>2;){let e=r.getUint8(0),o=r.getUint8(1),i=new DataView(r.buffer.slice(0,e));if(o==d)t=h(i),n.push(t);else{let r={bLength:e,bDescriptorType:o,data:i};t?t.endpoints.push(r):n.push(r)}r=new DataView(r.buffer.slice(e))}return n}(new DataView(e.buffer.slice(9)));return{bLength:e.getUint8(0),bDescriptorType:e.getUint8(1),wTotalLength:e.getUint16(2,!0),bNumInterfaces:e.getUint8(4),bConfigurationValue:e.getUint8(5),iConfiguration:e.getUint8(6),bmAttributes:e.getUint8(7),bMaxPower:e.getUint8(8),interfaces:t}}const m={Offset:0,Size:11,Signature:{Offset:0,Size:5}},g={Offset:11,TargetPrefix:{Offset:0,Size:274,Signature:{Offset:0,Size:6},NbElements:{Offset:270,Size:4}},Element:{Offset:274,Address:{Offset:0,Size:4},Size:{Offset:4,Size:4},Data:{Offset:8}}},w=1,y=2,v=3,S=4,E=5,b=6,A=0,_=2,I=4,C=5,P=7,k=10,T=33,D=65;class O extends n{constructor(...e){super("DFUError",...e)}}class R extends n{constructor(...e){super("DFUInterfaceError",...e)}}function M(e,t,r,n=0){return i.info("DFU","requestIn","bRequest: "+t,"data: "+r,"wValue: "+n),new Promise(((o,i)=>{e.device.controlTransferIn({requestType:"class",recipient:"interface",request:t,value:n,index:e.settings.interface.interfaceNumber},r).then((e=>{"ok"==e.status?o(e.data):i(new Error("Wrong requestIn status: "+e.status))})).catch((e=>{i(new Error("ControlTransferIn failed --\x3e "+e))}))}))}function F(e,t,r,n=0){return i.info("DFU","requestOut","bRequest: "+t,"data: "+r,"wValue: "+n),new Promise(((o,i)=>{e.device.controlTransferOut({requestType:"class",recipient:"interface",request:t,value:n,index:e.settings.interface.interfaceNumber},r).then((e=>{"ok"==e.status?o(e.bytesWritten):i(new Error("Wrong requestOut status: "+e.status))})).catch((e=>{i(new Error("ControlTransferOut failed --\x3e "+e))}))}))}function x(e){return i.info("DFU","getState"),new Promise(((t,r)=>{M(e,E,1).then((e=>{t(e.getUint8(0))})).catch((e=>{r(new Error("Get state failed --\x3e "+e))}))}))}function N(e){return i.info("DFU","getStatus"),new Promise(((t,r)=>{M(e,v,6).then((e=>{t({status:e.getUint8(0),pollTimeout:16777215&e.getUint32(1,!0),state:e.getUint8(4)})})).catch((e=>{r(new Error("Get status failed --\x3e "+e))}))}))}async function H(e){i.info("DFU","abortToIdle");try{await F(e,b);let t=await x(e);if(t==k&&(await F(e,S),t=await x(e)),t!=_)throw new Error("State is "+t.state+"instead of DFU IDLE (2).")}catch(e){throw new Error("Abort to idle failed --\x3e "+e)}}async function L(e,t){function r(e){return new Promise(((t,r)=>{setTimeout(t,e)}))}i.info("DFU","pollUntil",t);try{let n=await N(e);for(;!t(n.state)&&n.state!=k;)await r(n.pollTimeout),n=await N(e);return n}catch(e){throw new Error("Poll until failed --\x3e "+e)}}async function U(e,t){i.info("DFU","setAddress",Number(t).toString(16));let r=new ArrayBuffer(5),n=new DataView(r);n.setUint8(0,T),n.setUint32(1,t,!0);try{await F(e,w,r,0);let t=await L(e,(e=>e!=I));if(t.status!=A)throw"Status is "+t.status+" instead of Status OK (0)."}catch(e){throw"Set address to "+t+" failed --\x3e "+e}}const B=class{constructor(e,t){this.TransferSize=t,this.device=e;for(let t of e.configurations)for(let e of t.interfaces)for(let r of e.alternates)if(254==r.interfaceClass&&1==r.interfaceSubclass&&(1==r.interfaceProtocol||2==r.interfaceProtocol))return this.settings={configuration:t,interface:e,alternate:r},this;return this.settings={configuration:{configurationValue:1},interface:{interfaceNumber:0},alternate:{alternateSetting:0}},this}static Parse(e){new DataView(e);let t=new TextDecoder("utf-8").decode(new Uint8Array(e.slice(m.Signature.Offset,m.Signature.Offset+m.Signature.Size)));if("DfuSe"!=t)throw new O("Parsed file is not a DFU file (invalid signature)");let r=e.slice(g.Offset);if(t=new TextDecoder("utf-8").decode(new Uint8Array(r.slice(g.TargetPrefix.Signature.Offset,g.TargetPrefix.Signature.Size))),"Target"!=t)throw new O("Corrupted DFU file (invalid target signature)");let n=[],o=new DataView(r,g.TargetPrefix.NbElements.Offset,g.TargetPrefix.NbElements.Offset+g.TargetPrefix.NbElements.Size).getUint32(0,!0),i=r.slice(g.Element.Offset);for(let e=0;e<o;e++){let e=new DataView(i,g.Element.Address.Offset,g.Element.Address.Offset+g.Element.Address.Size).getUint32(0,!0),t=new DataView(i,g.Element.Size.Offset,g.Element.Address.Offset+g.Element.Size.Size).getUint32(0,!0),r=i.slice(g.Element.Data.Offset,g.Element.Data.Offset+t);i=i.slice(g.Element.Data.Offset+t),n.push({address:e,size:t,data:r})}return n}open=async function(){i.info("DFU","open");try{await this.device.open()}catch(e){throw new O("OPEN failed --\x3e "+e)}const e=this.settings.configuration.configurationValue;if(null==this.device.configuration||this.device.configuration.configurationValue!=e)try{await this.device.selectConfiguration(e)}catch(e){throw new O("OPEN failed: could not select configuration --\x3e "+e)}const t=this.settings.interface.interfaceNumber;if(!this.device.configuration.interfaces[t].claimed)try{await this.device.claimInterface(t)}catch(e){throw new R("OPEN failed: could not claim interface --\x3e "+e)}const r=this.settings.alternate.alternateSetting;if(null==this.device.configuration.interfaces[t].alternate||this.device.configuration.interfaces[t].alternate!=r)try{await this.device.selectAlternateInterface(t,r)}catch(e){throw new O("OPEN failed: could not select alternate interface --\x3e "+e)}};close=async function(){i.info("DFU","close");try{await this.device.close()}catch(e){throw new O("CLOSE failed --\x3e "+e)}};getMemoryLayout=async function(){i.info("DFU","getMemoryLayout");try{let e=await function(e){return i.info("DFU","getConfiguration"),new Promise(((t,r)=>{e.device.controlTransferIn({requestType:"standard",recipient:"device",request:a,value:0,index:0},1).then((e=>{"ok"==e.status?t(e.data.getInt8(0)):r(new Error("Wrong getConfiguration status: "+e.status))})).catch((e=>{r(new Error("Get configuration failed --\x3e "+e))}))}))}(this),t=await function(e,t){return i.info("DFU","getConfigurationDescriptor","index "+t),new Promise(((r,n)=>{e.device.controlTransferIn({requestType:"standard",recipient:"device",request:s,value:t|u<<8,index:0},4).then((o=>{if("ok"==o.status){let i=o.data.getUint16(2,!0);e.device.controlTransferIn({requestType:"standard",recipient:"device",request:s,value:t|u<<8,index:0},i).then((e=>{"ok"==e.status?r(p(e.data)):n(new Error("Wrong getConfigurationDescriptor status: "+e.status))})).catch((e=>{n(e)}))}else n(new Error("Wrong getConfigurationDescriptor status: "+o.status))})).catch((e=>{n(new Error("Get configuration descriptor failed --\x3e "+e))}))}))}(this,e-1),r=await function(e){return i.info("DFU","getInterface"),new Promise(((t,r)=>{e.device.controlTransferIn({requestType:"standard",recipient:"interface",request:c,value:0,index:e.settings.interface.interfaceNumber},1).then((e=>{"ok"==e.status?t(e.data.getInt8(0)):r(new Error("Wrong getInterface status: "+e.status))})).catch((e=>{r(new Error("Get interface failed --\x3e "+e))}))}))}(this),n=t.interfaces[r].iInterface,o=await function(e,t){return i.info("DFU","getStringDescriptor","index "+t),new Promise(((r,n)=>{e.device.controlTransferIn({requestType:"standard",recipient:"device",request:s,value:t|l<<8,index:f},255).then((e=>{"ok"==e.status?(e.data.getInt8(1)!=l&&n(new Error("Wrong descriptor type: "+e.data.getInt8(1))),r(new TextDecoder("utf-16").decode(new Uint16Array(e.data.buffer,2)))):n(new Error("Wrong getStringDescriptor status: "+e.status))})).catch((e=>{n(new Error("Get string descriptor failed --\x3e "+e))}))}))}(this,n),d=o.split("/"),h=[];for(let e=1;e<d.length;e+=2){let t=parseInt(d[e]),r=d[e+1].split(","),n=/(\d+)\*(\d+)([K|M])g/;r.forEach((e=>{let r=e.match(n),o=parseInt(r[1]),i=parseInt(r[2]),s=r[3];"K"==s?i*=1024:"M"==s&&(i*=1048576);let a=o*i,c={address:t,lastAddress:t+a-1,size:a,nbPage:o,pageSize:i};h.push(c),t+=a}))}return h}catch(e){throw new O("GET MEMORY LAYOUT failed --\x3e "+e)}};upload=async function(e,t,r){i.info("DFU","upload","address "+Number(e).toString(16),"Length "+Number(t).toString(16));try{await x(this)!=_&&await H(this),await U(this,e),await H(this);let o,s=2,a=new Uint8Array(t),c=0;r&&r(0);do{let e=Math.min(this.TransferSize,t-c);if(i.info("DFU","upload","block number "+s,"bytes to read "+e),o=await M(this,y,e,s++),o.byteLength>0){var n=new Uint8Array(o.buffer);a.set(n,c),c+=o.byteLength}r&&r(c/t)}while(c<t);return await H(this),a}catch(r){throw await H(this),new O("UPLOAD failed at address "+e+" of length "+t+" --\x3e "+r)}};download=async function(e,t,r){i.info("DFU","download","address "+Number(e).toString(16));try{let n=0,o=t.byteLength,s=e;for(r&&r(0);n<o;){const a=o-n,c=Math.min(a,this.TransferSize);i.info("DFU","download step, at address "+Number(e).toString(16));let u,l=0;if(await U(this,s),l=await F(this,w,t.slice(n,n+c),2),u=await L(this,(e=>e==C||e==_)),s+=c,u.status!=A)throw`state=${u.state}, status=${u.status}`;n+=l,r&&r(n/o)}}catch(t){throw new O("DOWNLOAD failed at address "+Number(e).toString(16)+" --\x3e "+t)}};leave=async function(e){i.info("DFU","leave","address "+Number(e).toString(16));try{await U(this,e),await F(this,w,new ArrayBuffer,2),await L(this,(e=>e==P))}catch(t){throw new O("LEAVE failed at address "+Number(e).toString(16)+" --\x3e "+t)}};eraseSegment=async function(e){i.info("DFU","eraseSegment","address "+Number(e).toString(16));try{await x(this)!=_&&await H(this);let t=new ArrayBuffer(5),r=new DataView(t);r.setUint8(0,D),r.setUint32(1,e,!0),await F(this,w,t,0);let n=await N(this);if(n.state!=I)throw"wrong DFU state: "+n.state;if(n=await L(this,(e=>e!=I)),n.status!=A)throw"wrong DFU status: "+n.status}catch(t){throw new O("ERASE SEGMENT failed at address "+e+" --\x3e "+t)}}};function z(e){return new TextDecoder("utf-8").decode(e.subarray(0,e.indexOf(0)))}function V(e){let t=new TextEncoder("utf-8").encode(e),r=new Uint8Array(t.length+1);return r.set(t,0),r.set([0],t.length),r}function j(e){let t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++)t[r]=parseInt(e.substr(2*r,2),16);return t}function $(e){const t=atob(e);let r="";for(let e=0;e<t.length;e++){const n=t.charCodeAt(e).toString(16);r+=2===n.length?n:"0"+n}return r.toUpperCase()}class G extends n{constructor(...e){super("StorageError",...e)}}function X(e){return new DataView(e.buffer,e.byteOffset).getUint16(0,!0)}function K(e){let t={size:0,name:"unknown",content:"unknown"};return t.size=X(e),t.name=z(e.subarray(2)),t.content=e.subarray(2+t.name.length+1,t.size),t}class q{constructor(e){this.records=e}[Symbol.iterator](){let e=this.records;return{next:()=>{let t=X(e);if(0===t)return{done:!0};{let r=K(e);return e=e.subarray(t),{value:r,done:!1}}}}}}const W=class{constructor(e){this.data=e}availableSize=function(){let e=0,t=new q(this.data);for(let r of t)e+=r.size;return this.totalSize()-e};totalSize=function(){return this.data.byteLength-2};recordsWithExtension=function(e){let t=[],r=new q(this.data);for(let n of r)n.name.endsWith(e)&&t.push(n.name);return t};size=function(e){let t=new q(this.data);for(let r of t)if(r.name===e)return r.size};content=function(e){let t=new q(this.data);for(let r of t)if(r.name===e)return r.content};setContent=function(e,t){let r=new q(this.data),n=0,o=0;for(let t of r){if(t.name===e){o=t.size;break}n+=t.size}let i=this.data.slice(n+o),s=n,a=function(e,t){if(void 0===t)return;let r=e.length+1+t.byteLength+2,n=new Uint8Array(r);return new DataView(n.buffer,n.byteOffset).setUint16(0,r,!0),n.set(V(e),2),n.set(t,2+e.length+1),n}(e,t);if(void 0!==a){if(K(a).size>this.availableSize()+o)throw new G("The storage on calculator is full");this.data.set(a,n),s+=a.length,i=i.slice(0,this.data.length-(n+a.length))}this.data.set(i,s),this.data.fill(0,s+i.length)}},Y=j("F00DC0DE"),Z=j("FEEDC0DE"),J=j("BADBEEEF");class Q extends n{constructor(...e){super("CalculatorMemoryCorruption",...e)}}class ee extends n{constructor(...e){super("BusyCalculatorError",...e)}}class te extends n{constructor(...e){super("WebUSBError",...e)}}class re extends n{constructor(...e){super("USBConnectionError",...e)}}class ne extends n{constructor(...e){super("ForbiddenMemoryAccessError",...e)}}const oe={N0100:{name:"N0100",RAMAddressStart:536870912,RAMAddressEnd:537133056},N0110:{name:"N0110",RAMAddressStart:536870912,RAMAddressEnd:537133056},N0120:{name:"N0120",RAMAddressStart:603979776,RAMAddressEnd:604307456},N0120Prototype:{displayed_name:"N0120",name:"N0120_PORTUGAL_PROTOTYPE_20210930",RAMAddressStart:603979776,RAMAddressEnd:604307456}},ie=j("BADD0BEE");function se(e,t){if(e.length<t.length)return!1;for(let r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}function ae(e,t){if(e.length<t.length)return!1;return se(e.subarray(e.length-t.length),t)}function ce(e,t){if(!(e>=134217728&&e+t<=135266304||e>=2415919104&&e+t<=2424307712))throw new ne("Access to address: "+e+" (length "+t+") is out of flash range")}function ue(e,t,r){if(t<e.RAMAddressStart||t+r>=e.RAMAddressEnd)throw new ne("Access to address: "+t+" (length "+r+") is out of RAM range")}function le(e,t){if(i.info("Calculator","parseFirmwareHeader","header "+e),!se(e,Y))return t;t.version=z(e.subarray(4)),t.patch=z(e.subarray(12));let r=e.subarray(20);if(se(r,Y))return t;let n=new DataView(e.buffer,e.byteOffset);return t.storageAddress=n.getUint32(20,!0),r=e.subarray(24),se(r,Y)||(t.storageSize=n.getUint32(24,!0)),t}async function de(e,t,r){i.info("Calculator","uploadHeader","address "+Number(t[0].address).toString(16));let n={version:"0.0.0",patch:"0000000",userlandVersion:"unknown",externalAppsFlashStart:"unknown",externalAppsFlashEnd:"unknown",externalAppsRamStart:"unknown",externalAppsRamEnd:"unknown",storageAddress:"unknown",storageSize:4096};try{var o,s=t[0].address+me.Header0.Offset,a=me.Header0.Size;if(ce(s,a),se(o=await e.upload(s,a),Y)&&ae(o,Y))return le(o,n);if(ce(s=t[0].address+me.Header1.Offset,a=me.Header1.Size),se(o=await e.upload(s,a),Y)&&ae(o,Y))return le(o,n);ue(r,s=r.RAMAddressStart,a=me.Header2.SlotInfoSize);try{let t=function(e){if(i.info("Calculator","parseSlotInfo","header info "+e),!se(e,J)||!ae(e,J))return null;let t=new DataView(e.buffer,e.byteOffset);return{kernelHeaderAddress:t.getUint32(4,!0),userlandHeaderAddress:t.getUint32(8,!0)}}(await e.upload(s,a));if(null==t)throw new Q("The slot info was corrupted");return ce(s=t.kernelHeaderAddress,a=me.Header2.KernelHeaderSize),n=le(await e.upload(s,a),n),ce(s=t.userlandHeaderAddress,a=me.Header2.UserlandHeaderSize),n=function(e,t){if(i.info("Calculator","parseUserlandHeader","header "+e),!se(e,Z))return t;t.userlandVersion=z(e.subarray(4));let r=new DataView(e.buffer,e.byteOffset),n=12;return t.storageAddress=r.getUint32(n,!0),n+=4,t.storageSize=r.getUint32(n,!0),n+=4,t.externalAppsFlashStart=r.getUint32(n,!0),n+=4,t.externalAppsFlashEnd=r.getUint32(n,!0),n+=4,t.externalAppsRamStart=r.getUint32(n,!0),n+=4,t.externalAppsRamEnd=r.getUint32(n,!0),t}(await e.upload(s,a),n),n}catch(e){return le(o,n)}}catch(e){throw e.message="Upload header failed --\x3e "+e.message,e}}function fe(e,t){if(i.info("Calculator","calculatorGetStorage","address "+Number(t.firmware.storageAddress).toString(16)),"unknown"===t.firmware.storageAddress)throw new Q("The Storage address could not be found in header");try{ue(t.model,t.firmware.storageAddress,t.firmware.storageSize+2*ie.length)}catch(e){throw new Q("Calculator Get Storage failed --\x3e "+e)}return!1!==e.storage?e.storage:new Promise(((r,n)=>{e.dfu.upload(t.firmware.storageAddress,t.firmware.storageSize+2*ie.length).then((o=>{if(se(o,ie)&&ae(o,ie)){let n=o.subarray(ie.length,t.firmware.storageSize+ie.length);e.storage=new W(n),r(e.storage)}else n(new Q("Memory is corrupted: could not find storage tags"))})).catch((e=>{e.message="CalculationGetStorage failed --\x3e "+e.message,n(e)}))}))}function he(e,t,r){i.info("Calculator","calculatorSetStorage","address "+Number(t.firmware.storageAddress).toString(16));try{ue(t.model,t.firmware.storageAddress+ie.length,r.data)}catch(e){throw new Q("Calculator Set Storage failed --\x3e "+e)}return new Promise(((n,o)=>{e.dfu.download(t.firmware.storageAddress+ie.length,r.data).then((()=>{n(!0)})).catch((e=>{e.message="CalculationSetStorage failed --\x3e "+e.message,o(e)}))}))}function pe(e){let t=V(e),r=new Uint8Array(t.length+1);return r[0]=1,r.set(t,1),r}class me{static Product={Numworks:"numworks",ST:"ST"};static Header0={Offset:428,Size:24};static Header1={Offset:452,Size:32};static Header2={SlotInfoSize:16,KernelHeaderSize:24,UserlandHeaderSize:40};static CheckFirmware(e,t){for(let r=0;r<t.byteLength;r++)if(e[r]!=t[r])throw new Q("The uploaded firmware differs from the reference at byte "+r);return!0}constructor(){this.dfu=!1,this.running=!1,this.storage=!1,this.infos=!1}connectAndProcess(e,t=[me.Product.Numworks],r=!1){let n;return i.info("Calculator","connectAndProcess"),new Promise(((o,i)=>{this.running?new Promise(((e,t)=>{e(!0)})).then((()=>i(new ee("Calculator is already processing another request")))):(this.running=!0,this.connect(t,r).then((t=>{if(!t.connected())return this.running=!1,i(new re("No usb connection found"));this.dfu.open().then((()=>e(t))).then((e=>{if(n=e,this.dfu.opened)return this.dfu.close()})).then((()=>(this.running=!1,o(n)))).catch((e=>(this.running=!1,i(e))))})).catch((e=>{this.running=!1,i(e)})))}))}connected(){return!1!==this.dfu}connect(e,t){i.info("Calculator","connect",e),this.storage=!1,this.dfu=!1,this.infos=!1;let r=e.map((e=>e==me.Product.Numworks?41617:57105)),n=[];return r.forEach((e=>n.push({vendorId:1155,productId:e}))),new Promise(((e,o)=>{null==navigator.usb?new Promise(((e,t)=>{e(!0)})).then((()=>o(new te("Web usb unvailable")))):t?(i.info("Calculator","connect","request device"),navigator.usb.requestDevice({filters:n}).then((t=>(this.dfu=new B(t,2048),e(this)))).catch((e=>{o(new re("Usb device selection failure: "+e))}))):(i.info("Calculator","connect","get device"),navigator.usb.getDevices().then((t=>{for(let e of t)1155===e.vendorId&&r.includes(e.productId)&&(this.dfu=new B(e,2048));return e(this)})).catch((e=>{o(new re("Usb device failed: "+e))})))}))}getInfos(){return i.info("Calculator","getInfos"),new Promise(((e,t)=>{let r,n;return!1!==this.infos?e(this.infos):this.dfu.getMemoryLayout().then((e=>(r=e,n=function(e,t){if("NumWorks Calculator"==e.productName&&2==e.deviceVersionMinor){let t="EAAbABVROTUxNDM4";return e.serialNumber==t?oe.N0120Prototype:oe.N0120}let r=t[t.length-1].lastAddress;return r>135135232&&r<2415919104?oe.N0100:oe.N0110}(this.dfu.device,r),de(this.dfu,r,n)))).then((e=>{this.infos={serialNumber:$(this.dfu.device.serialNumber),displayedSerialNumber:this.dfu.device.serialNumber,model:n,memoryLayout:r,firmware:e}})).then((()=>{e(this.infos)})).catch((e=>{e.message="getInfos failed --\x3e "+e.message,t(e)}))}))}uploadFlash(e,t,r){return i.info("Calculator","uploadFlash","address "+Number(e).toString(16),"length "+Number(t).toString(16)),new Promise(((n,o)=>{try{ce(e,t)}catch(e){e.message="uploadFlash failed --\x3e "+e.message,o(e)}this.dfu.upload(e,t,r).then((e=>{n(e)})).catch((e=>{e.message="uploadFlash failed --\x3e "+e.message,o(e)}))}))}downloadFlash(e,t,r,n,o){return i.info("Calculator","downloadFlash","address "+Number(e).toString(16)),new Promise(((i,s)=>{try{ce(e,t.byteLength)}catch(e){e.message="downloadFlash failed --\x3e "+e.message,s(e)}(async function(e,t,r,n,o){let i=0,s=0,a=-1,c=-1,u=-1,l=-1;e:for(let e=0;e<t.length;e++){if(a<0){if(r>t[e].lastAddress)continue e;a=e}t:for(let o=0;o<t[e].nbPage;o++){if(c<0){if(r!=t[e].address+o*t[e].pageSize)continue t;c=o}if(i+=t[e].pageSize,i>=n.byteLength){u=e,l=o;break e}}}for(let r=a;r<=u;r++){let n=r==a?c:0,d=r==u?l+1:t[r].nbPage;for(let a=n;a<d;a++){let n=t[r].address+a*t[r].pageSize;await e.eraseSegment(n),s+=t[r].pageSize,o(s/i),n+=t[r].pageSize}}})(this.dfu,r.memoryLayout,e,t,(function(e){return n(e)})).then((()=>{i(this.dfu.download(e,t,(function(e){return o(e)})))})).catch((e=>{e.message="downloadFlash failed --\x3e "+e.message,s(e)}))}))}reset(e){return i.info("Calculator","reset"),new Promise(((t,r)=>{try{ce(e.memoryLayout[0].address,0)}catch(e){e.message="reset failed --\x3e "+e.message,r(e)}return this.dfu.leave(134217728).then((e=>{t(!0)})).catch((e=>{e.message="reset failed --\x3e "+e.message,r(e)}))}))}getAvailableSpaceInfo(){return i.info("Calculator","getAvailableSpaceInfo"),new Promise(((e,t)=>{let r={availableSize:!1,totalSize:!1};this.getInfos().then((e=>fe(this,e))).then((t=>{r.availableSize=t.availableSize(),r.totalSize=t.totalSize(),e(r)})).catch((e=>{e.message="getAvailableSpaceInfo failed --\x3e "+e.message,t(e)}))}))}getScripts(){return i.info("Calculator","getScripts"),new Promise(((e,t)=>{this.getInfos().then((e=>fe(this,e))).then((e=>e.recordsWithExtension(".py").map(((t,r)=>({name:t,size:e.size(t),content:z(e.content(t).subarray(1))}))))).then((t=>{e(t)})).catch((e=>{e.message="getScripts failed --\x3e "+e.message,t(e)}))}))}removeScripts(){return i.info("Calculator","removeScripts"),new Promise(((e,t)=>{this.getInfos().then((e=>fe(this,e))).then((e=>{e.recordsWithExtension(".py").map(((t,r)=>{e.setContent(t)}));return he(this,this.infos,e)})).then((()=>{e(!0)})).catch((e=>{e.message="removeScripts failed --\x3e "+e.message,t(e)}))}))}getSizeForRecord(e){return i.info("Calculator","getSizeForRecord","name "+e),new Promise(((t,r)=>{let n;this.getInfos().then((e=>fe(this,e))).then((r=>{n=r.size(e),t(n)})).catch((e=>{e.message="getSizeForRecord failed --\x3e "+e.message,r(e)}))}))}setContentForRecord(e,t){return i.info("Calculator","setContentForRecord","name "+e),new Promise(((r,n)=>{this.getInfos().then((e=>fe(this,e))).then((r=>{try{r.setContent(e,t)}catch(e){n(e)}return he(this,this.infos,r)})).then((()=>{r(!0)})).catch((e=>{e.message="setContentForRecord failed --\x3e "+e.message,n(e)}))}))}setContentForScript(e,t){return i.info("Calculator","setContentForScript","name "+e),new Promise(((r,n)=>{this.setContentForRecord(e,pe(t)).then((()=>{r(!0)})).catch((e=>{e.message="setContentForScript failed --\x3e "+e.message,n(e)}))}))}setRecords(e){return i.info("Calculator","setRecords",e),new Promise(((t,r)=>{this.getInfos().then((e=>fe(this,e))).then((t=>{try{e.forEach(((e,r)=>{t.setContent(e.name,e.content)}))}catch(e){r(e)}return t})).then((e=>he(this,this.infos,e))).then((()=>{t(!0)})).catch((e=>{e.message="setRecords failed --\x3e "+e.message,r(e)}))}))}setScripts(e){return i.info("Calculator","setScripts",e),new Promise(((t,r)=>{let n=[];e.forEach(((e,t)=>{n[t]={name:e.name,content:pe(e.content)}})),this.setRecords(n).then((()=>{t(!0)})).catch((e=>{e.message="setScripts failed --\x3e "+e.message,r(e)}))}))}removeRecord(e){return i.info("Calculator","removeRecord","name "+e),new Promise(((t,r)=>{this.getInfos().then((e=>fe(this,e))).then((t=>(t.setContent(e),he(this,this.infos,t)))).then((()=>{t(!0)})).catch((e=>{e.memory="removeRecord failed --\x3e "+e.message,r(e)}))}))}}const ge=me;var we=r(115),ye=(r(744),r(405)),ve=r(827),Se=r.n(ve),Ee=r(890),be=r.n(Ee);const Ae=r(118),_e=r(898);class Ie{static AppSectorSize=65536;static async from(e){const t=await we.open(e,{readSymbolData:!0});return new Ie(e,t.elf)}constructor(e,t){this.packedElfData=e,this.packedElfAnalysis=t,this.size=void 0,this.refreshNeedsExternalData(),this.refreshSize()}name(){let e=this.dataForSymbolNamed("eadk_app_name");return(new TextDecoder).decode(e)}async refreshSize(){if(!this.needsExternalData){const e=await this.flatBin({flashStart:2415919104,flashLength:8388608,ramStart:536870912,ramLength:262144});let t=e.byteLength+(Ie.AppSectorSize-e.byteLength%Ie.AppSectorSize);this.size=t}}icon(){let e=this.dataForSymbolNamed("eadk_app_icon"),t=new Uint8Array(6160);ye.decompressBlock(e,t,0,e.length,0);let r=this.rgb565ToRGBA8888(t);return this.rgba8888ToPNG(r)}async flatElf(e){let t={arguments:["--script","linker.ld","eadk.o","app-pack.elf"],inputs:{"linker.ld":Ae(e),"app-pack.elf":this.packedElfData,"eadk.o":new Uint8Array(_e.data)}};if(this.externalData){let e="extra-data.o";t.arguments.push(e),t.inputs[e]=await this.externalObject()}return await this.ld(t)}async flatBin(e){return await this.objcopy({arguments:["--output-target","binary"],input:await this.flatElf(e)})}setExternalData(e){this.externalData=e,this.refreshNeedsExternalData(),this.refreshSize()}symbols(){return we.getSymbols(this.packedElfAnalysis)}symbolNamed(e){return this.symbols().find((t=>t.name==e))}dataForSymbol(e){let t=this.sectionForSymbol(e),r=t.offset+(e.virtualAddress-t.addr);return this.packedElfData.slice(r,r+e.size)}dataForSymbolNamed(e){return this.dataForSymbol(this.symbolNamed(e))}sectionForSymbol(e){return this.packedElfAnalysis.sections.find((t=>t.addr<=e.virtualAddress&&t.addr+t.size>=e.virtualAddress+e.size))}ld(e){return new Promise(((t,n)=>{let o={locateFile:function(e,t){return r(573)},preRun:function(){for(const[t,r]of Object.entries(e.inputs))o.FS.writeFile(t,r)},onAbort:n,arguments:e.arguments.concat(["--output","output.elf"]),postRun:function(){t(o.FS.readFile("output.elf"))}};Se()(o)}))}objcopy(e){return new Promise(((t,n)=>{let o={locateFile:function(e,t){return r(835)},preRun:function(){o.FS.writeFile("input.dat",e.input)},onAbort:n,arguments:e.arguments.concat(["input.dat","output.dat"]),postRun:function(){t(o.FS.readFile(e.output||"output.dat"))}};be()(o)}))}rgb565ToRGBA8888(e){let t=new Uint8ClampedArray(2*e.length);for(var r=0;r<e.length/2;r++){let n=e[2*r+1]<<8|e[2*r],o=n>>11&31,i=n>>5&63,s=31&n;function a(e,t){return e<<8-t}t[4*r]=a(o,5),t[4*r+1]=a(i,6),t[4*r+2]=a(s,5),t[4*r+3]=255}return t}rgba8888ToPNG(e){let t=new ImageData(e,55,56),r=document.createElement("canvas");return r.width=55,r.height=56,r.getContext("2d").putImageData(t,0,0),r.toDataURL()}refreshNeedsExternalData(){let e=void 0!==this.symbolNamed("eadk_external_data"),t=void 0!==this.externalData;this.needsExternalData=e&&!t}externalObject(){return this.objcopy({arguments:["--input-target","binary","--output-target","elf32-littlearm","--rename-section",".data=.rodata"],input:this.externalData})}}const Ce=Ie;class Pe extends n{constructor(...e){super("CalculatorMemoryOverflow",...e)}}const ke=class{constructor(){this.apps=[]}push(e){this.apps.push(e)}isReadyToUpload(){for(const e of this.apps)if(e.needsExternalData)return!1;return this.apps.length>0}async upload(e,t){let r,n=e.infos.firmware,o={flashStart:n.externalAppsFlashStart,flashLength:n.externalAppsFlashEnd-n.externalAppsFlashStart,ramStart:n.externalAppsRamStart,ramLength:n.externalAppsRamEnd-n.externalAppsRamStart};r=await this.flatBin(o);e.downloadFlash(o.flashStart,r,e.infos,(function(e){t(.2*e)}),(function(e){t(.2+.8*e)})).then((function(){e.dfu.leave(o.flashStart)}))}concatenateU8A(e,t){let r=new Uint8Array(e.byteLength+t.byteLength);return r.set(e,0),r.set(t,e.byteLength),r}async flatBin(e){let t=new Uint8Array(0),r=e.flashStart+e.flashLength,n=e.flashStart;for(const o of this.apps){if(n>=r)throw new Pe("External app sector would be overflown");const i=await o.flatBin({flashStart:n,flashLength:r-n,ramStart:e.ramStart,ramLength:e.ramLength});t=this.concatenateU8A(t,i),n+=i.byteLength;let s=i.byteLength%Ce.AppSectorSize;if(s>0){let e=Ce.AppSectorSize-s,r=new Uint8Array(e);r.fill(255),t=this.concatenateU8A(t,r),n+=e}}if(n<r){let e=new Uint8Array(Ce.AppSectorSize);e.fill(255),t=this.concatenateU8A(t,e)}return t}totalSize(){let e=0;for(const t of this.apps)e+=t.size||0;return e}removeAppAtIndex(e){this.apps.splice(e,1)}},Te=r(147).promises,{Command:De}=r(461),Oe=new De;global.navigator={usb:e.webusb},Oe.name("nwlink").description("Command-line tool to interact with a NumWorks calculator").version("0.0.0"),Oe.command("install-nwa").description("Install a NWA app").argument("<string>","string to split").option("-d, --data <file>","Data file").action((async function(e,t){console.log("Installing",e,"with",t),console.log("Hey");let r=await Te.readFile(e);console.log("Hey2");let n=await Ce.from(r);if(t.data){let e=await Te.readFile(t.data);n.setExternalData(e)}let o=new ke;o.push(n);let i=new ge;i.connectAndProcess((async function(e){console.log("Got infos");await e.getInfos();o.upload(i,(function(e){console.log("Upload progress",e)}))}),[ge.Product.Numworks],!0)})),Oe.parse()})()})();
|
package/ld.wasm
ADDED
|
Binary file
|
package/objcopy.wasm
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nwlink",
|
|
3
|
+
"description": "Command-line interface to your NumWorks calculator",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"calculator",
|
|
11
|
+
"numworks",
|
|
12
|
+
"usb"
|
|
13
|
+
],
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"usb": "2.4.3"
|
|
16
|
+
},
|
|
17
|
+
"author": "NumWorks",
|
|
18
|
+
"license": "All rights reserved"
|
|
19
|
+
}
|