nwlink 0.0.10 → 0.0.12

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/dist/index.js CHANGED
@@ -1 +1 @@
1
- (()=>{var e={5827:(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 a,s,c,u,l,f,h=Object.assign({},i),p=[],d="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,v="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,_="";y?(_=v?r(1017).dirname(_)+"/":__dirname+"/",f=()=>{l||(u=r(7147),l=r(1017))},a=function(e,t){return f(),e=l.normalize(e),u.readFileSync(e,t?void 0:"utf8")},c=e=>{var t=a(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,r)=>{f(),e=l.normalize(e),u.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),p=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof ke))throw e})),process.on("unhandledRejection",(function(e){throw e})),m=(e,t)=>{if(G())throw process.exitCode=e,t;var r;(r=t)instanceof ke||E("exiting due to exception: "+r),process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):(g||v)&&(v?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),n&&(_=n),_=0!==_.indexOf("blob:")?_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},v&&(c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=(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 b,w=i.print||console.log.bind(console),E=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(p=i.arguments),i.thisProgram&&(d=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(b=i.wasmBinary);var S,A=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&ee("no native wasm support detected");var C,k=!1;function x(e,t){e||ee(t)}var P,I,T,O,R,F,D="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&&D)return D.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var c=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|c:(7&a)<<18|s<<12|c<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function N(e,t){return e?M(T,e,t):""}function L(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function j(e,t,r){return L(e,T,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}i.INITIAL_MEMORY;var B=[],U=[],z=[],V=[];function G(){return A}var $,X,q,K,W=0,Y=null,Z=null;function Q(e){W++,i.monitorRunDependencies&&i.monitorRunDependencies(W)}function J(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),E(e="Aborted("+e+")"),k=!0,C=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){try{if(e==$&&b)return new Uint8Array(b);if(c)return c(e);throw"both async and sync fetching of the wasm failed"}catch(e){ee(e)}}function ne(e){for(;e.length>0;)e.shift()(i)}te($="ld.wasm")||(X=$,$=i.locateFile?i.locateFile(X,_):_+X);var oe={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=oe.isAbs(e),r="/"===e.substr(-1);return(e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=oe.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=oe.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return oe.normalize(e.join("/"))},join2:(e,t)=>oe.normalize(e+"/"+t)},ie={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:le.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=oe.isAbs(n)}return(t?"/":"")+(e=oe.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=ie.resolve(e).substr(1),t=ie.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")}},ae={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){ae.ttys[e]={input:[],output:[],ops:t},le.registerDevice(e,ae.stream_ops)},stream_ops:{open:function(e){var t=ae.ttys[e.node.rdev];if(!t)throw new le.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 le.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new le.ErrnoError(29)}if(void 0===s&&0===i)throw new le.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}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 le.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new le.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=we(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(w(M(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(w(M(e.output,0)),e.output=[])}},default_tty1_ops:{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=[])}}};function se(e){ee()}var ce,ue={ops_table:null,mount:function(e){return ue.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(le.isBlkdev(r)||le.isFIFO(r))throw new le.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:le.chrdev_stream_ops}});var o=le.createNode(e,t,r,n);return le.isDir(o.mode)?(o.node_ops=ue.ops_table.dir.node,o.stream_ops=ue.ops_table.dir.stream,o.contents={}):le.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):le.isLink(o.mode)?(o.node_ops=ue.ops_table.link.node,o.stream_ops=ue.ops_table.link.stream):le.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=le.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,le.isDir(e.mode)?t.size=4096:le.isFile(e.mode)?t.size=e.usedBytes:le.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 le.genericErrors[44]},mknod:function(e,t,r,n){return ue.createNode(e,t,r,n)},rename:function(e,t,r){if(le.isDir(e.mode)){var n;try{n=le.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new le.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=le.lookupNode(e,t);for(var n in r.contents)throw new le.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(!le.isLink(e.mode))throw new le.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 a=Math.min(e.node.usedBytes-o,n);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(ue.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&le.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new le.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){if(!le.isFile(e.node.mode))throw new le.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==P){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(i=se()))throw new le.ErrnoError(48);I.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(e,t,r,n,o){if(!le.isFile(e.node.mode))throw new le.ErrnoError(43);return 2&o||ue.stream_ops.write(e,t,0,n,r,!1),0}}},le={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=ie.resolve(le.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new le.ErrnoError(32);for(var r=oe.normalizeArray(e.split("/").filter((e=>!!e)),!1),n=le.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=le.lookupNode(n,r[i]),o=oe.join2(o,r[i]),le.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;le.isLink(n.mode);){var c=le.readlink(o);if(o=ie.resolve(oe.dirname(o),c),n=le.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new le.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(le.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)%le.nameTable.length},hashAddNode:e=>{var t=le.hashName(e.parent.id,e.name);e.name_next=le.nameTable[t],le.nameTable[t]=e},hashRemoveNode:e=>{var t=le.hashName(e.parent.id,e.name);if(le.nameTable[t]===e)le.nameTable[t]=e.name_next;else for(var r=le.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=le.mayLookup(e);if(r)throw new le.ErrnoError(r,e);for(var n=le.hashName(e.id,t),o=le.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return le.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new le.FSNode(e,t,r,n);return le.hashAddNode(o),o},destroyNode:e=>{le.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=le.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)=>le.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=le.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return le.lookupNode(e,t),20}catch(e){}return le.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=le.lookupNode(e,t)}catch(e){return e.errno}var o=le.nodePermissions(e,"wx");if(o)return o;if(r){if(!le.isDir(n.mode))return 54;if(le.isRoot(n)||le.getPath(n)===le.cwd())return 10}else if(le.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?le.isLink(e.mode)?32:le.isDir(e.mode)&&("r"!==le.flagsToPermissionString(t)||512&t)?31:le.nodePermissions(e,le.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=le.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!le.streams[r])return r;throw new le.ErrnoError(33)},getStream:e=>le.streams[e],createStream:(e,t,r)=>{le.FSStream||(le.FSStream=function(){this.shared={}},le.FSStream.prototype={},Object.defineProperties(le.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 le.FSStream,e);var n=le.nextfd(t,r);return e.fd=n,le.streams[n]=e,e},closeStream:e=>{le.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=le.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new le.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{le.devices[e]={stream_ops:t}},getDevice:e=>le.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),le.syncFSRequests++,le.syncFSRequests>1&&E("warning: "+le.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=le.getMounts(le.root.mount),n=0;function o(e){return le.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&&le.root)throw new le.ErrnoError(10);if(!o&&!i){var a=le.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,le.isMountpoint(n))throw new le.ErrnoError(10);if(!le.isDir(n.mode))throw new le.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,o?le.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:e=>{var t=le.lookupPath(e,{follow_mount:!1});if(!le.isMountpoint(t.node))throw new le.ErrnoError(28);var r=t.node,n=r.mounted,o=le.getMounts(n);Object.keys(le.nameTable).forEach((e=>{for(var t=le.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&le.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=le.lookupPath(e,{parent:!0}).node,o=oe.basename(e);if(!o||"."===o||".."===o)throw new le.ErrnoError(28);var i=le.mayCreate(n,o);if(i)throw new le.ErrnoError(i);if(!n.node_ops.mknod)throw new le.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,le.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,le.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{le.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,le.mknod(e,t,r)),symlink:(e,t)=>{if(!ie.resolve(e))throw new le.ErrnoError(44);var r=le.lookupPath(t,{parent:!0}).node;if(!r)throw new le.ErrnoError(44);var n=oe.basename(t),o=le.mayCreate(r,n);if(o)throw new le.ErrnoError(o);if(!r.node_ops.symlink)throw new le.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=oe.dirname(e),i=oe.dirname(t),a=oe.basename(e),s=oe.basename(t);if(r=le.lookupPath(e,{parent:!0}).node,n=le.lookupPath(t,{parent:!0}).node,!r||!n)throw new le.ErrnoError(44);if(r.mount!==n.mount)throw new le.ErrnoError(75);var c,u=le.lookupNode(r,a),l=ie.relative(e,i);if("."!==l.charAt(0))throw new le.ErrnoError(28);if("."!==(l=ie.relative(t,o)).charAt(0))throw new le.ErrnoError(55);try{c=le.lookupNode(n,s)}catch(e){}if(u!==c){var f=le.isDir(u.mode),h=le.mayDelete(r,a,f);if(h)throw new le.ErrnoError(h);if(h=c?le.mayDelete(n,s,f):le.mayCreate(n,s))throw new le.ErrnoError(h);if(!r.node_ops.rename)throw new le.ErrnoError(63);if(le.isMountpoint(u)||c&&le.isMountpoint(c))throw new le.ErrnoError(10);if(n!==r&&(h=le.nodePermissions(r,"w")))throw new le.ErrnoError(h);le.hashRemoveNode(u);try{r.node_ops.rename(u,n,s)}catch(e){throw e}finally{le.hashAddNode(u)}}},rmdir:e=>{var t=le.lookupPath(e,{parent:!0}).node,r=oe.basename(e),n=le.lookupNode(t,r),o=le.mayDelete(t,r,!0);if(o)throw new le.ErrnoError(o);if(!t.node_ops.rmdir)throw new le.ErrnoError(63);if(le.isMountpoint(n))throw new le.ErrnoError(10);t.node_ops.rmdir(t,r),le.destroyNode(n)},readdir:e=>{var t=le.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new le.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=le.lookupPath(e,{parent:!0}).node;if(!t)throw new le.ErrnoError(44);var r=oe.basename(e),n=le.lookupNode(t,r),o=le.mayDelete(t,r,!1);if(o)throw new le.ErrnoError(o);if(!t.node_ops.unlink)throw new le.ErrnoError(63);if(le.isMountpoint(n))throw new le.ErrnoError(10);t.node_ops.unlink(t,r),le.destroyNode(n)},readlink:e=>{var t=le.lookupPath(e).node;if(!t)throw new le.ErrnoError(44);if(!t.node_ops.readlink)throw new le.ErrnoError(28);return ie.resolve(le.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=le.lookupPath(e,{follow:!t}).node;if(!r)throw new le.ErrnoError(44);if(!r.node_ops.getattr)throw new le.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>le.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?le.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new le.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{le.chmod(e,t,!0)},fchmod:(e,t)=>{var r=le.getStream(e);if(!r)throw new le.ErrnoError(8);le.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?le.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new le.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{le.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=le.getStream(e);if(!n)throw new le.ErrnoError(8);le.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new le.ErrnoError(28);var r;if(!(r="string"==typeof e?le.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new le.ErrnoError(63);if(le.isDir(r.mode))throw new le.ErrnoError(31);if(!le.isFile(r.mode))throw new le.ErrnoError(28);var n=le.nodePermissions(r,"w");if(n)throw new le.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=le.getStream(e);if(!r)throw new le.ErrnoError(8);if(0==(2097155&r.flags))throw new le.ErrnoError(28);le.truncate(r.node,t)},utime:(e,t,r)=>{var n=le.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new le.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?le.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=oe.normalize(e);try{n=le.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new le.ErrnoError(20)}else n=le.mknod(e,r,0),o=!0;if(!n)throw new le.ErrnoError(44);if(le.isChrdev(n.mode)&&(t&=-513),65536&t&&!le.isDir(n.mode))throw new le.ErrnoError(54);if(!o){var a=le.mayOpen(n,t);if(a)throw new le.ErrnoError(a)}512&t&&!o&&le.truncate(n,0),t&=-131713;var s=le.createStream({node:n,path:le.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&t||(le.readFiles||(le.readFiles={}),e in le.readFiles||(le.readFiles[e]=1)),s},close:e=>{if(le.isClosed(e))throw new le.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{le.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(le.isClosed(e))throw new le.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new le.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new le.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 le.ErrnoError(28);if(le.isClosed(e))throw new le.ErrnoError(8);if(1==(2097155&e.flags))throw new le.ErrnoError(8);if(le.isDir(e.node.mode))throw new le.ErrnoError(31);if(!e.stream_ops.read)throw new le.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new le.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new le.ErrnoError(28);if(le.isClosed(e))throw new le.ErrnoError(8);if(0==(2097155&e.flags))throw new le.ErrnoError(8);if(le.isDir(e.node.mode))throw new le.ErrnoError(31);if(!e.stream_ops.write)throw new le.ErrnoError(28);e.seekable&&1024&e.flags&&le.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new le.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:(e,t,r)=>{if(le.isClosed(e))throw new le.ErrnoError(8);if(t<0||r<=0)throw new le.ErrnoError(28);if(0==(2097155&e.flags))throw new le.ErrnoError(8);if(!le.isFile(e.node.mode)&&!le.isDir(e.node.mode))throw new le.ErrnoError(43);if(!e.stream_ops.allocate)throw new le.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new le.ErrnoError(2);if(1==(2097155&e.flags))throw new le.ErrnoError(2);if(!e.stream_ops.mmap)throw new le.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},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 le.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=le.open(e,t.flags),o=le.stat(e).size,i=new Uint8Array(o);return le.read(n,i,0,o,0),"utf8"===t.encoding?r=M(i,0):"binary"===t.encoding&&(r=i),le.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=le.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(H(t)+1),i=L(t,o,0,o.length);le.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");le.write(n,t,0,t.byteLength,void 0,r.canOwn)}le.close(n)},cwd:()=>le.currentPath,chdir:e=>{var t=le.lookupPath(e,{follow:!0});if(null===t.node)throw new le.ErrnoError(44);if(!le.isDir(t.node.mode))throw new le.ErrnoError(54);var r=le.nodePermissions(t.node,"x");if(r)throw new le.ErrnoError(r);le.currentPath=t.path},createDefaultDirectories:()=>{le.mkdir("/tmp"),le.mkdir("/home"),le.mkdir("/home/web_user")},createDefaultDevices:()=>{le.mkdir("/dev"),le.registerDevice(le.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),le.mkdev("/dev/null",le.makedev(1,3)),ae.register(le.makedev(5,0),ae.default_tty_ops),ae.register(le.makedev(6,0),ae.default_tty1_ops),le.mkdev("/dev/tty",le.makedev(5,0)),le.mkdev("/dev/tty1",le.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(6113);return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){ee("randomDevice")}}();le.createDevice("/dev","random",e),le.createDevice("/dev","urandom",e),le.mkdir("/dev/shm"),le.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{le.mkdir("/proc");var e=le.mkdir("/proc/self");le.mkdir("/proc/self/fd"),le.mount({mount:()=>{var t=le.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=le.getStream(r);if(!n)throw new le.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?le.createDevice("/dev","stdin",i.stdin):le.symlink("/dev/tty","/dev/stdin"),i.stdout?le.createDevice("/dev","stdout",null,i.stdout):le.symlink("/dev/tty","/dev/stdout"),i.stderr?le.createDevice("/dev","stderr",null,i.stderr):le.symlink("/dev/tty1","/dev/stderr"),le.open("/dev/stdin",0),le.open("/dev/stdout",1),le.open("/dev/stderr",1)},ensureErrnoError:()=>{le.ErrnoError||(le.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},le.ErrnoError.prototype=new Error,le.ErrnoError.prototype.constructor=le.ErrnoError,[44].forEach((e=>{le.genericErrors[e]=new le.ErrnoError(e),le.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{le.ensureErrnoError(),le.nameTable=new Array(4096),le.mount(ue,{},"/"),le.createDefaultDirectories(),le.createDefaultDevices(),le.createSpecialDirectories(),le.filesystems={MEMFS:ue}},init:(e,t,r)=>{le.init.initialized=!0,le.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,le.createStandardStreams()},quit:()=>{le.init.initialized=!1;for(var e=0;e<le.streams.length;e++){var t=le.streams[e];t&&le.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=le.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=le.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=le.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=oe.basename(e),n=le.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:le.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=oe.join2(e,i);try{le.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=oe.join2("string"==typeof e?e:le.getPath(e),t),a=le.getMode(n,o);return le.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:le.getPath(e),a=t?oe.join2(e,t):e);var s=le.getMode(n,o),c=le.create(a,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,f=r.length;l<f;++l)u[l]=r.charCodeAt(l);r=u}le.chmod(c,146|s);var h=le.open(c,577);le.write(h,r,0,r.length,0,i),le.close(h),le.chmod(c,s)}return c},createDevice:(e,t,r,n)=>{var o=oe.join2("string"==typeof e?e:le.getPath(e),t),i=le.getMode(!!r,!!n);le.createDevice.major||(le.createDevice.major=64);var a=le.makedev(le.createDevice.major++,0);return le.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var c;try{c=r()}catch(e){throw new le.ErrnoError(29)}if(void 0===c&&0===a)throw new le.ErrnoError(6);if(null==c)break;a++,t[n+s]=c}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new le.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),le.mkdev(o,i,a)},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(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=we(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new le.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,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.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!==a&&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||[]):we(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var c=le.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a}return Object.keys(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];u[e]=function(){return le.forceLoadFile(c),t.apply(null,arguments)}})),u.read=(e,t,r,n,o)=>(le.forceLoadFile(c),l(e,t,r,n,o)),u.mmap=(e,t,r,n,o)=>{le.forceLoadFile(c);var i=se();if(!i)throw new le.ErrnoError(48);return l(e,I,i,t,r),{ptr:i,allocated:!0}},c.stream_ops=u,c},createPreloadedFile:(e,t,r,n,o,i,a,c,u,l)=>{var f=t?ie.resolve(oe.join2(e,t)):e;function h(r){function s(r){l&&l(),c||le.createDataFile(e,t,r,n,o,u),i&&i(),J()}Browser.handledByPreloadPlugin(r,f,s,(()=>{a&&a(),J()}))||s(r)}Q(),"string"==typeof r?function(e,t,r,n){var o=n?"":"al "+e;s(e,(function(r){x(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&J()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&Q()}(r,(e=>h(e)),a):h(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=le.indexedDB();try{var o=n.open(le.DB_NAME(),le.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{w("creating db"),o.result.createObjectStore(le.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([le.DB_STORE_NAME],"readwrite"),i=n.objectStore(le.DB_STORE_NAME),a=0,s=0,c=e.length;function u(){0==s?t():r()}e.forEach((e=>{var t=i.put(le.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==c&&u()},t.onerror=()=>{s++,a+s==c&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=le.indexedDB();try{var o=n.open(le.DB_NAME(),le.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([le.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(le.DB_STORE_NAME),s=0,c=0,u=e.length;function l(){0==c?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{le.analyzePath(e).exists&&le.unlink(e),le.createDataFile(oe.dirname(e),oe.basename(e),t.result,!0,!0,!0),++s+c==u&&l()},t.onerror=()=>{c++,s+c==u&&l()}})),i.onerror=r},o.onerror=r}},fe={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(oe.isAbs(t))return t;var n;if(-100===e)n=le.cwd();else{var o=le.getStream(e);if(!o)throw new le.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new le.ErrnoError(44);return n}return oe.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&oe.normalize(t)!==oe.normalize(le.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,K=[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]=K[0],R[r+44>>2]=K[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,K=[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]=K[0],R[r+84>>2]=K[1],0},doMsync:function(e,t,r,n,o){var i=T.slice(e,e+r);le.msync(t,i,o,r,n)},varargs:void 0,get:function(){return fe.varargs+=4,R[fe.varargs-4>>2]},getStr:function(e){return N(e)},getStreamFromFD:function(e){var t=le.getStream(e);if(!t)throw new le.ErrnoError(8);return t}},he={BUCKET_BUFFER_SIZE:8192,mount:function(e){return le.createNode(null,"/",16895,0)},createPipe:function(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(he.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=he.nextname(),r=he.nextname(),n=le.createNode(he.root,t,4096,0),o=le.createNode(he.root,r,4096,0);n.pipe=e,o.pipe=e;var i=le.createStream({path:t,node:n,flags:0,seekable:!1,stream_ops:he.stream_ops});n.stream=i;var a=le.createStream({path:r,node:o,flags:1,seekable:!1,stream_ops:he.stream_ops});return o.stream=a,{readable_fd:i.fd,writable_fd:a.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,a=0,s=0;s<i.buckets.length;s++){var c=i.buckets[s];a+=c.offset-c.roffset}x(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var u=t.subarray(r,r+n);if(n<=0)return 0;if(0==a)throw new le.ErrnoError(6);var l=Math.min(a,n),f=l,h=0;for(s=0;s<i.buckets.length;s++){var p=i.buckets[s],d=p.offset-p.roffset;if(l<=d){var m=p.buffer.subarray(p.roffset,p.offset);l<d?(m=m.subarray(0,l),p.roffset+=l):h++,u.set(m);break}m=p.buffer.subarray(p.roffset,p.offset),u.set(m),u=u.subarray(m.byteLength),l-=m.byteLength,h++}return h&&h==i.buckets.length&&(h--,i.buckets[h].offset=0,i.buckets[h].roffset=0),i.buckets.splice(0,h),f},write:function(e,t,r,n,o){var i=e.node.pipe;x(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var a=t.subarray(r,r+n),s=a.byteLength;if(s<=0)return 0;var c=null;0==i.buckets.length?(c={buffer:new Uint8Array(he.BUCKET_BUFFER_SIZE),offset:0,roffset:0},i.buckets.push(c)):c=i.buckets[i.buckets.length-1],x(c.offset<=he.BUCKET_BUFFER_SIZE);var u=he.BUCKET_BUFFER_SIZE-c.offset;if(u>=s)return c.buffer.set(a,c.offset),c.offset+=s,s;u>0&&(c.buffer.set(a.subarray(0,u),c.offset),c.offset+=u,a=a.subarray(u,a.byteLength));for(var l=a.byteLength/he.BUCKET_BUFFER_SIZE|0,f=a.byteLength%he.BUCKET_BUFFER_SIZE,h=0;h<l;h++){var p={buffer:new Uint8Array(he.BUCKET_BUFFER_SIZE),offset:he.BUCKET_BUFFER_SIZE,roffset:0};i.buckets.push(p),p.buffer.set(a.subarray(0,he.BUCKET_BUFFER_SIZE)),a=a.subarray(he.BUCKET_BUFFER_SIZE,a.byteLength)}return f>0&&(p={buffer:new Uint8Array(he.BUCKET_BUFFER_SIZE),offset:a.byteLength,roffset:0},i.buckets.push(p),p.buffer.set(a)),s},close:function(e){var t=e.node.pipe;t.refcnt--,0===t.refcnt&&(t.buckets=null)}},nextname:function(){return he.nextname.current||(he.nextname.current=0),"pipe["+he.nextname.current+++"]"}},pe="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";ce=y?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now();var de={};function me(){if(!me.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",_:d||"./this.program"};for(var t in de)void 0===de[t]?delete e[t]:e[t]=de[t];var r=[];for(var t in e)r.push(t+"="+e[t]);me.strings=r}return me.strings}function ge(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=F[t>>2],s=F[t+4>>2];t+=8;var c=le.read(e,I,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o}function ve(e,t){return t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN}var ye=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=le.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},_e=365,be=146;function we(e,t,r){var n=r>0?r:H(e)+1,o=new Array(n),i=L(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(ye.prototype,{read:{get:function(){return(this.mode&_e)===_e},set:function(e){e?this.mode|=_e:this.mode&=-366}},write:{get:function(){return(this.mode&be)===be},set:function(e){e?this.mode|=be:this.mode&=-147}},isFolder:{get:function(){return le.isDir(this.mode)}},isDevice:{get:function(){return le.isChrdev(this.mode)}}}),le.FSNode=ye,le.staticInit();var Ee,Se={a:function(e,t,r,n){ee("Assertion failed: "+N(e)+", at: "+[t?N(t):"unknown filename",r,n?N(n):"unknown function"])},G:function(e,t){try{return e=fe.getStr(e),le.chmod(e,t),0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},F:function(e){try{var t=fe.getStreamFromFD(e);return le.createStream(t,0).fd}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},H:function(e,t,r,n){try{if(t=fe.getStr(t),t=fe.calculateAt(e,t),-8&r)return-28;var o=le.lookupPath(t,{follow:!0}).node;if(!o)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&&le.nodePermissions(o,i)?-2:0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},e:function(e,t,r){fe.varargs=r;try{var n=fe.getStreamFromFD(e);switch(t){case 0:return(o=fe.get())<0?-28:le.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(),O[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,R[Ae()>>2]=i,-1}}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}var i},z:function(e,t){try{var r=fe.getStreamFromFD(e);return fe.doStat(le.stat,r.path,t)}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},v:function(e,t){try{if(0===t)return-28;var r=le.cwd(),n=H(r)+1;return t<n?-68:(j(r,e,t),n)}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},m: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 R[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=fe.get(),le.ioctl(n,t,o);default:ee("bad ioctl syscall "+t)}}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},x:function(e,t){try{return e=fe.getStr(e),fe.doStat(le.lstat,e,t)}catch(e){if(void 0===le||!(e instanceof le.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?le.lstat:le.stat,t,r)}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},h: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 le.open(t,r,o).fd}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},t:function(e){try{if(0==e)throw new le.ErrnoError(21);var t=he.createPipe();return R[e>>2]=t.readable_fd,R[e+4>>2]=t.writable_fd,0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},s:function(e,t,r,n){try{if(t=fe.getStr(t),t=fe.calculateAt(e,t),n<=0)return-28;var o=le.readlink(t),i=Math.min(n,H(o)),a=I[r+i];return j(o,r,n+1),I[r+i]=a,i}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},q:function(e){try{return e=fe.getStr(e),le.rmdir(e),0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},y:function(e,t){try{return e=fe.getStr(e),fe.doStat(le.stat,e,t)}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},g:function(e,t,r){try{return t=fe.getStr(t),t=fe.calculateAt(e,t),0===r?le.unlink(t):512===r?le.rmdir(t):ee("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},C:function(e){},E:function(e,t){ee(pe)},D:function(e,t){ee(pe)},l:function(){return Date.now()},B:function(){return!0},b:function(){ee("")},k:ce,A:function(e,t,r){T.copyWithin(e,t,t+r)},f:function(e){T.length,ee("OOM")},n:function(e,t){var r=0;return me().forEach((function(n,o){var i=t+r;F[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)I[t++>>0]=e.charCodeAt(n);r||(I[t>>0]=0)}(n,i),r+=n.length+1})),0},r:function(e,t){var r=me();F[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),F[t>>2]=n,0},d:function(e){Ie(e)},c:function(e){try{var t=fe.getStreamFromFD(e);return le.close(t),0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},u:function(e,t){try{var r=fe.getStreamFromFD(e),n=r.tty?2:le.isDir(r.mode)?3:le.isLink(r.mode)?7:4;return I[t>>0]=n,0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},o:function(e,t,r,n,o,i){try{var a=ve(n,o);if(isNaN(a))return 61;var s=ge(fe.getStreamFromFD(e),t,r,a);return R[i>>2]=s,0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},j:function(e,t,r,n){try{var o=ge(fe.getStreamFromFD(e),t,r);return R[n>>2]=o,0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},p:function(e,t,r,n,o){try{var i=ve(t,r);if(isNaN(i))return 61;var a=fe.getStreamFromFD(e);return le.llseek(a,i,n),K=[a.position>>>0,(q=a.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]=K[0],R[o+4>>2]=K[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},i:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=F[t>>2],s=F[t+4>>2];t+=8;var c=le.write(e,I,a,s,n);if(c<0)return-1;o+=c}return o}(fe.getStreamFromFD(e),t,r);return F[n>>2]=o,0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},I:function(e){Te(e)}},Ae=(function(){var e={a:Se};function t(e,t){var r,n,o=e.exports;i.asm=o,S=i.asm.J,r=S.buffer,P=r,i.HEAP8=I=new Int8Array(r),i.HEAP16=O=new Int16Array(r),i.HEAP32=R=new Int32Array(r),i.HEAPU8=T=new Uint8Array(r),i.HEAPU16=new Uint16Array(r),i.HEAPU32=F=new Uint32Array(r),i.HEAPF32=new Float32Array(r),i.HEAPF64=new Float64Array(r),i.asm.N,n=i.asm.K,U.unshift(n),J()}function r(e){t(e.instance)}function n(t){return(b||!g&&!v||"function"!=typeof fetch?Promise.resolve().then((function(){return re($)})):fetch($,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+$+"'";return e.arrayBuffer()})).catch((function(){return re($)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){E("failed to asynchronously prepare wasm: "+e),ee(e)}))}if(Q(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return E("Module.instantiateWasm callback failed with error: "+e),!1}(b||"function"!=typeof WebAssembly.instantiateStreaming||te($)||y||"function"!=typeof fetch?n(r):fetch($,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return E("wasm streaming compile failed: "+e),E("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(Ae=i.___errno_location=i.asm.L).apply(null,arguments)}),Ce=(i._main=function(){return(i._main=i.asm.M).apply(null,arguments)},i.stackAlloc=function(){return(Ce=i.stackAlloc=i.asm.O).apply(null,arguments)});function ke(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function xe(e){var t=i._main;(e=e||[]).unshift(d);var r=e.length,n=Ce(4*(r+1)),o=n>>2;e.forEach((e=>{R[o++]=function(e){var t=H(e)+1,r=Ce(t);return L(e,I,r,t),r}(e)})),R[o]=0;try{var a=t(r,n);return Ie(a),a}catch(e){return function(e){if(e instanceof ke||"unwind"==e)return C;m(1,e)}(e)}}function Pe(e){function r(){Ee||(Ee=!0,i.calledRun=!0,k||(i.noFSInit||le.init.initialized||le.init(),le.ignorePermissions=!1,ae.init(),he.root=le.mount(he,{},null),ne(U),ne(z),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Oe&&xe(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),V.unshift(e);var e;ne(V)}()))}e=e||p,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;ne(B)}(),W>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function Ie(e,t){C=e,Te(e)}function Te(e){C=e,G()||(i.onExit&&i.onExit(e),k=!0),m(e,new ke(e))}if(i.FS=le,Z=function e(){Ee||Pe(),Ee||(Z=e)},i.run=Pe,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),Pe(),e.ready});e.exports=o},2890:(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 a,s,c,u,l,f,h=Object.assign({},i),p=[],d="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,v="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,_="";y?(_=v?r(1017).dirname(_)+"/":__dirname+"/",f=()=>{l||(u=r(7147),l=r(1017))},a=function(e,t){return f(),e=l.normalize(e),u.readFileSync(e,t?void 0:"utf8")},c=e=>{var t=a(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,r)=>{f(),e=l.normalize(e),u.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),p=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof we))throw e})),process.on("unhandledRejection",(function(e){throw e})),m=(e,t)=>{if(V())throw process.exitCode=e,t;var r;(r=t)instanceof we||E("exiting due to exception: "+r),process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):(g||v)&&(v?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),n&&(_=n),_=0!==_.indexOf("blob:")?_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},v&&(c=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=(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 b,w=i.print||console.log.bind(console),E=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(p=i.arguments),i.thisProgram&&(d=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(b=i.wasmBinary);var S,A=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&J("no native wasm support detected");var C,k,x,P,I,T,O,R=!1,F="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function D(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&F)return F.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var c=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|c:(7&a)<<18|s<<12|c<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function M(e,t){return e?D(P,e,t):""}function N(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function L(e,t,r){return N(e,P,t,r)}function j(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}i.INITIAL_MEMORY;var H=[],B=[],U=[],z=[];function V(){return A}var G,$,X,q,K=0,W=null,Y=null;function Z(e){K++,i.monitorRunDependencies&&i.monitorRunDependencies(K)}function Q(e){if(K--,i.monitorRunDependencies&&i.monitorRunDependencies(K),0==K&&(null!==W&&(clearInterval(W),W=null),Y)){var t=Y;Y=null,t()}}function J(e){i.onAbort&&i.onAbort(e),E(e="Aborted("+e+")"),R=!0,C=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function ee(e){return e.startsWith("data:application/octet-stream;base64,")}function te(e){try{if(e==G&&b)return new Uint8Array(b);if(c)return c(e);throw"both async and sync fetching of the wasm failed"}catch(e){J(e)}}function re(e){for(;e.length>0;)e.shift()(i)}ee(G="objcopy.wasm")||($=G,G=i.locateFile?i.locateFile($,_):_+$);var ne={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=ne.isAbs(e),r="/"===e.substr(-1);return(e=ne.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=ne.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=ne.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return ne.normalize(e.join("/"))},join2:(e,t)=>ne.normalize(e+"/"+t)},oe={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:ue.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=ne.isAbs(n)}return(t?"/":"")+(e=ne.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=oe.resolve(e).substr(1),t=oe.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")}},ie={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){ie.ttys[e]={input:[],output:[],ops:t},ue.registerDevice(e,ie.stream_ops)},stream_ops:{open:function(e){var t=ie.ttys[e.node.rdev];if(!t)throw new ue.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 ue.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new ue.ErrnoError(29)}if(void 0===s&&0===i)throw new ue.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}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 ue.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new ue.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=ge(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(w(D(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(w(D(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(E(D(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(E(D(e.output,0)),e.output=[])}}};function ae(e){J()}var se={ops_table:null,mount:function(e){return se.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(ue.isBlkdev(r)||ue.isFIFO(r))throw new ue.ErrnoError(63);se.ops_table||(se.ops_table={dir:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr,lookup:se.node_ops.lookup,mknod:se.node_ops.mknod,rename:se.node_ops.rename,unlink:se.node_ops.unlink,rmdir:se.node_ops.rmdir,readdir:se.node_ops.readdir,symlink:se.node_ops.symlink},stream:{llseek:se.stream_ops.llseek}},file:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr},stream:{llseek:se.stream_ops.llseek,read:se.stream_ops.read,write:se.stream_ops.write,allocate:se.stream_ops.allocate,mmap:se.stream_ops.mmap,msync:se.stream_ops.msync}},link:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr,readlink:se.node_ops.readlink},stream:{}},chrdev:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr},stream:ue.chrdev_stream_ops}});var o=ue.createNode(e,t,r,n);return ue.isDir(o.mode)?(o.node_ops=se.ops_table.dir.node,o.stream_ops=se.ops_table.dir.stream,o.contents={}):ue.isFile(o.mode)?(o.node_ops=se.ops_table.file.node,o.stream_ops=se.ops_table.file.stream,o.usedBytes=0,o.contents=null):ue.isLink(o.mode)?(o.node_ops=se.ops_table.link.node,o.stream_ops=se.ops_table.link.stream):ue.isChrdev(o.mode)&&(o.node_ops=se.ops_table.chrdev.node,o.stream_ops=se.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=ue.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,ue.isDir(e.mode)?t.size=4096:ue.isFile(e.mode)?t.size=e.usedBytes:ue.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&&se.resizeFileStorage(e,t.size)},lookup:function(e,t){throw ue.genericErrors[44]},mknod:function(e,t,r,n){return se.createNode(e,t,r,n)},rename:function(e,t,r){if(ue.isDir(e.mode)){var n;try{n=ue.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new ue.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=ue.lookupNode(e,t);for(var n in r.contents)throw new ue.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=se.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!ue.isLink(e.mode))throw new ue.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 a=Math.min(e.node.usedBytes-o,n);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(se.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&ue.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ue.ErrnoError(28);return n},allocate:function(e,t,r){se.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o){if(!ue.isFile(e.node.mode))throw new ue.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==k){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(i=ae()))throw new ue.ErrnoError(48);x.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(e,t,r,n,o){if(!ue.isFile(e.node.mode))throw new ue.ErrnoError(43);return 2&o||se.stream_ops.write(e,t,0,n,r,!1),0}}};function ce(e,t,r,n){var o=n?"":"al "+e;s(e,(function(r){var n;n='Loading data file "'+e+'" failed (no arrayBuffer).',r||J(n),t(new Uint8Array(r)),o&&Q()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&Z()}var ue={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=oe.resolve(ue.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new ue.ErrnoError(32);for(var r=ne.normalizeArray(e.split("/").filter((e=>!!e)),!1),n=ue.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=ue.lookupNode(n,r[i]),o=ne.join2(o,r[i]),ue.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;ue.isLink(n.mode);){var c=ue.readlink(o);if(o=oe.resolve(ne.dirname(o),c),n=ue.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new ue.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(ue.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)%ue.nameTable.length},hashAddNode:e=>{var t=ue.hashName(e.parent.id,e.name);e.name_next=ue.nameTable[t],ue.nameTable[t]=e},hashRemoveNode:e=>{var t=ue.hashName(e.parent.id,e.name);if(ue.nameTable[t]===e)ue.nameTable[t]=e.name_next;else for(var r=ue.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=ue.mayLookup(e);if(r)throw new ue.ErrnoError(r,e);for(var n=ue.hashName(e.id,t),o=ue.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return ue.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new ue.FSNode(e,t,r,n);return ue.hashAddNode(o),o},destroyNode:e=>{ue.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=ue.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)=>ue.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=ue.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return ue.lookupNode(e,t),20}catch(e){}return ue.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=ue.lookupNode(e,t)}catch(e){return e.errno}var o=ue.nodePermissions(e,"wx");if(o)return o;if(r){if(!ue.isDir(n.mode))return 54;if(ue.isRoot(n)||ue.getPath(n)===ue.cwd())return 10}else if(ue.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?ue.isLink(e.mode)?32:ue.isDir(e.mode)&&("r"!==ue.flagsToPermissionString(t)||512&t)?31:ue.nodePermissions(e,ue.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=ue.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!ue.streams[r])return r;throw new ue.ErrnoError(33)},getStream:e=>ue.streams[e],createStream:(e,t,r)=>{ue.FSStream||(ue.FSStream=function(){this.shared={}},ue.FSStream.prototype={},Object.defineProperties(ue.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 ue.FSStream,e);var n=ue.nextfd(t,r);return e.fd=n,ue.streams[n]=e,e},closeStream:e=>{ue.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=ue.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new ue.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{ue.devices[e]={stream_ops:t}},getDevice:e=>ue.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),ue.syncFSRequests++,ue.syncFSRequests>1&&E("warning: "+ue.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=ue.getMounts(ue.root.mount),n=0;function o(e){return ue.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&&ue.root)throw new ue.ErrnoError(10);if(!o&&!i){var a=ue.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,ue.isMountpoint(n))throw new ue.ErrnoError(10);if(!ue.isDir(n.mode))throw new ue.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,o?ue.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:e=>{var t=ue.lookupPath(e,{follow_mount:!1});if(!ue.isMountpoint(t.node))throw new ue.ErrnoError(28);var r=t.node,n=r.mounted,o=ue.getMounts(n);Object.keys(ue.nameTable).forEach((e=>{for(var t=ue.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&ue.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=ue.lookupPath(e,{parent:!0}).node,o=ne.basename(e);if(!o||"."===o||".."===o)throw new ue.ErrnoError(28);var i=ue.mayCreate(n,o);if(i)throw new ue.ErrnoError(i);if(!n.node_ops.mknod)throw new ue.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,ue.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,ue.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{ue.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,ue.mknod(e,t,r)),symlink:(e,t)=>{if(!oe.resolve(e))throw new ue.ErrnoError(44);var r=ue.lookupPath(t,{parent:!0}).node;if(!r)throw new ue.ErrnoError(44);var n=ne.basename(t),o=ue.mayCreate(r,n);if(o)throw new ue.ErrnoError(o);if(!r.node_ops.symlink)throw new ue.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=ne.dirname(e),i=ne.dirname(t),a=ne.basename(e),s=ne.basename(t);if(r=ue.lookupPath(e,{parent:!0}).node,n=ue.lookupPath(t,{parent:!0}).node,!r||!n)throw new ue.ErrnoError(44);if(r.mount!==n.mount)throw new ue.ErrnoError(75);var c,u=ue.lookupNode(r,a),l=oe.relative(e,i);if("."!==l.charAt(0))throw new ue.ErrnoError(28);if("."!==(l=oe.relative(t,o)).charAt(0))throw new ue.ErrnoError(55);try{c=ue.lookupNode(n,s)}catch(e){}if(u!==c){var f=ue.isDir(u.mode),h=ue.mayDelete(r,a,f);if(h)throw new ue.ErrnoError(h);if(h=c?ue.mayDelete(n,s,f):ue.mayCreate(n,s))throw new ue.ErrnoError(h);if(!r.node_ops.rename)throw new ue.ErrnoError(63);if(ue.isMountpoint(u)||c&&ue.isMountpoint(c))throw new ue.ErrnoError(10);if(n!==r&&(h=ue.nodePermissions(r,"w")))throw new ue.ErrnoError(h);ue.hashRemoveNode(u);try{r.node_ops.rename(u,n,s)}catch(e){throw e}finally{ue.hashAddNode(u)}}},rmdir:e=>{var t=ue.lookupPath(e,{parent:!0}).node,r=ne.basename(e),n=ue.lookupNode(t,r),o=ue.mayDelete(t,r,!0);if(o)throw new ue.ErrnoError(o);if(!t.node_ops.rmdir)throw new ue.ErrnoError(63);if(ue.isMountpoint(n))throw new ue.ErrnoError(10);t.node_ops.rmdir(t,r),ue.destroyNode(n)},readdir:e=>{var t=ue.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new ue.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=ue.lookupPath(e,{parent:!0}).node;if(!t)throw new ue.ErrnoError(44);var r=ne.basename(e),n=ue.lookupNode(t,r),o=ue.mayDelete(t,r,!1);if(o)throw new ue.ErrnoError(o);if(!t.node_ops.unlink)throw new ue.ErrnoError(63);if(ue.isMountpoint(n))throw new ue.ErrnoError(10);t.node_ops.unlink(t,r),ue.destroyNode(n)},readlink:e=>{var t=ue.lookupPath(e).node;if(!t)throw new ue.ErrnoError(44);if(!t.node_ops.readlink)throw new ue.ErrnoError(28);return oe.resolve(ue.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=ue.lookupPath(e,{follow:!t}).node;if(!r)throw new ue.ErrnoError(44);if(!r.node_ops.getattr)throw new ue.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>ue.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?ue.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new ue.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{ue.chmod(e,t,!0)},fchmod:(e,t)=>{var r=ue.getStream(e);if(!r)throw new ue.ErrnoError(8);ue.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?ue.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ue.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{ue.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=ue.getStream(e);if(!n)throw new ue.ErrnoError(8);ue.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new ue.ErrnoError(28);var r;if(!(r="string"==typeof e?ue.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ue.ErrnoError(63);if(ue.isDir(r.mode))throw new ue.ErrnoError(31);if(!ue.isFile(r.mode))throw new ue.ErrnoError(28);var n=ue.nodePermissions(r,"w");if(n)throw new ue.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=ue.getStream(e);if(!r)throw new ue.ErrnoError(8);if(0==(2097155&r.flags))throw new ue.ErrnoError(28);ue.truncate(r.node,t)},utime:(e,t,r)=>{var n=ue.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new ue.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?ue.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=ne.normalize(e);try{n=ue.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new ue.ErrnoError(20)}else n=ue.mknod(e,r,0),o=!0;if(!n)throw new ue.ErrnoError(44);if(ue.isChrdev(n.mode)&&(t&=-513),65536&t&&!ue.isDir(n.mode))throw new ue.ErrnoError(54);if(!o){var a=ue.mayOpen(n,t);if(a)throw new ue.ErrnoError(a)}512&t&&!o&&ue.truncate(n,0),t&=-131713;var s=ue.createStream({node:n,path:ue.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&t||(ue.readFiles||(ue.readFiles={}),e in ue.readFiles||(ue.readFiles[e]=1)),s},close:e=>{if(ue.isClosed(e))throw new ue.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ue.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(ue.isClosed(e))throw new ue.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ue.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new ue.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 ue.ErrnoError(28);if(ue.isClosed(e))throw new ue.ErrnoError(8);if(1==(2097155&e.flags))throw new ue.ErrnoError(8);if(ue.isDir(e.node.mode))throw new ue.ErrnoError(31);if(!e.stream_ops.read)throw new ue.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new ue.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new ue.ErrnoError(28);if(ue.isClosed(e))throw new ue.ErrnoError(8);if(0==(2097155&e.flags))throw new ue.ErrnoError(8);if(ue.isDir(e.node.mode))throw new ue.ErrnoError(31);if(!e.stream_ops.write)throw new ue.ErrnoError(28);e.seekable&&1024&e.flags&&ue.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new ue.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:(e,t,r)=>{if(ue.isClosed(e))throw new ue.ErrnoError(8);if(t<0||r<=0)throw new ue.ErrnoError(28);if(0==(2097155&e.flags))throw new ue.ErrnoError(8);if(!ue.isFile(e.node.mode)&&!ue.isDir(e.node.mode))throw new ue.ErrnoError(43);if(!e.stream_ops.allocate)throw new ue.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new ue.ErrnoError(2);if(1==(2097155&e.flags))throw new ue.ErrnoError(2);if(!e.stream_ops.mmap)throw new ue.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},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 ue.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=ue.open(e,t.flags),o=ue.stat(e).size,i=new Uint8Array(o);return ue.read(n,i,0,o,0),"utf8"===t.encoding?r=D(i,0):"binary"===t.encoding&&(r=i),ue.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=ue.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(j(t)+1),i=N(t,o,0,o.length);ue.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");ue.write(n,t,0,t.byteLength,void 0,r.canOwn)}ue.close(n)},cwd:()=>ue.currentPath,chdir:e=>{var t=ue.lookupPath(e,{follow:!0});if(null===t.node)throw new ue.ErrnoError(44);if(!ue.isDir(t.node.mode))throw new ue.ErrnoError(54);var r=ue.nodePermissions(t.node,"x");if(r)throw new ue.ErrnoError(r);ue.currentPath=t.path},createDefaultDirectories:()=>{ue.mkdir("/tmp"),ue.mkdir("/home"),ue.mkdir("/home/web_user")},createDefaultDevices:()=>{ue.mkdir("/dev"),ue.registerDevice(ue.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),ue.mkdev("/dev/null",ue.makedev(1,3)),ie.register(ue.makedev(5,0),ie.default_tty_ops),ie.register(ue.makedev(6,0),ie.default_tty1_ops),ue.mkdev("/dev/tty",ue.makedev(5,0)),ue.mkdev("/dev/tty1",ue.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(6113);return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){J("randomDevice")}}();ue.createDevice("/dev","random",e),ue.createDevice("/dev","urandom",e),ue.mkdir("/dev/shm"),ue.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{ue.mkdir("/proc");var e=ue.mkdir("/proc/self");ue.mkdir("/proc/self/fd"),ue.mount({mount:()=>{var t=ue.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=ue.getStream(r);if(!n)throw new ue.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?ue.createDevice("/dev","stdin",i.stdin):ue.symlink("/dev/tty","/dev/stdin"),i.stdout?ue.createDevice("/dev","stdout",null,i.stdout):ue.symlink("/dev/tty","/dev/stdout"),i.stderr?ue.createDevice("/dev","stderr",null,i.stderr):ue.symlink("/dev/tty1","/dev/stderr"),ue.open("/dev/stdin",0),ue.open("/dev/stdout",1),ue.open("/dev/stderr",1)},ensureErrnoError:()=>{ue.ErrnoError||(ue.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},ue.ErrnoError.prototype=new Error,ue.ErrnoError.prototype.constructor=ue.ErrnoError,[44].forEach((e=>{ue.genericErrors[e]=new ue.ErrnoError(e),ue.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{ue.ensureErrnoError(),ue.nameTable=new Array(4096),ue.mount(se,{},"/"),ue.createDefaultDirectories(),ue.createDefaultDevices(),ue.createSpecialDirectories(),ue.filesystems={MEMFS:se}},init:(e,t,r)=>{ue.init.initialized=!0,ue.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,ue.createStandardStreams()},quit:()=>{ue.init.initialized=!1;for(var e=0;e<ue.streams.length;e++){var t=ue.streams[e];t&&ue.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=ue.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=ue.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=ue.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ne.basename(e),n=ue.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:ue.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ne.join2(e,i);try{ue.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=ne.join2("string"==typeof e?e:ue.getPath(e),t),a=ue.getMode(n,o);return ue.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:ue.getPath(e),a=t?ne.join2(e,t):e);var s=ue.getMode(n,o),c=ue.create(a,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,f=r.length;l<f;++l)u[l]=r.charCodeAt(l);r=u}ue.chmod(c,146|s);var h=ue.open(c,577);ue.write(h,r,0,r.length,0,i),ue.close(h),ue.chmod(c,s)}return c},createDevice:(e,t,r,n)=>{var o=ne.join2("string"==typeof e?e:ue.getPath(e),t),i=ue.getMode(!!r,!!n);ue.createDevice.major||(ue.createDevice.major=64);var a=ue.makedev(ue.createDevice.major++,0);return ue.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var c;try{c=r()}catch(e){throw new ue.ErrnoError(29)}if(void 0===c&&0===a)throw new ue.ErrnoError(6);if(null==c)break;a++,t[n+s]=c}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new ue.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),ue.mkdev(o,i,a)},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(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ge(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new ue.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,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.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!==a&&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||[]):ge(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var c=ue.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};function l(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a}return Object.keys(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];u[e]=function(){return ue.forceLoadFile(c),t.apply(null,arguments)}})),u.read=(e,t,r,n,o)=>(ue.forceLoadFile(c),l(e,t,r,n,o)),u.mmap=(e,t,r,n,o)=>{ue.forceLoadFile(c);var i=ae();if(!i)throw new ue.ErrnoError(48);return l(e,x,i,t,r),{ptr:i,allocated:!0}},c.stream_ops=u,c},createPreloadedFile:(e,t,r,n,o,i,a,s,c,u)=>{var l=t?oe.resolve(ne.join2(e,t)):e;function f(r){function f(r){u&&u(),s||ue.createDataFile(e,t,r,n,o,c),i&&i(),Q()}Browser.handledByPreloadPlugin(r,l,f,(()=>{a&&a(),Q()}))||f(r)}Z(),"string"==typeof r?ce(r,(e=>f(e)),a):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=ue.indexedDB();try{var o=n.open(ue.DB_NAME(),ue.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{w("creating db"),o.result.createObjectStore(ue.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([ue.DB_STORE_NAME],"readwrite"),i=n.objectStore(ue.DB_STORE_NAME),a=0,s=0,c=e.length;function u(){0==s?t():r()}e.forEach((e=>{var t=i.put(ue.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==c&&u()},t.onerror=()=>{s++,a+s==c&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=ue.indexedDB();try{var o=n.open(ue.DB_NAME(),ue.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([ue.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(ue.DB_STORE_NAME),s=0,c=0,u=e.length;function l(){0==c?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{ue.analyzePath(e).exists&&ue.unlink(e),ue.createDataFile(ne.dirname(e),ne.basename(e),t.result,!0,!0,!0),++s+c==u&&l()},t.onerror=()=>{c++,s+c==u&&l()}})),i.onerror=r},o.onerror=r}},le={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(ne.isAbs(t))return t;var n;if(-100===e)n=ue.cwd();else{var o=ue.getStream(e);if(!o)throw new ue.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new ue.ErrnoError(44);return n}return ne.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&ne.normalize(t)!==ne.normalize(ue.getPath(e.node)))return-54;throw e}return T[r>>2]=n.dev,T[r+4>>2]=0,T[r+8>>2]=n.ino,T[r+12>>2]=n.mode,T[r+16>>2]=n.nlink,T[r+20>>2]=n.uid,T[r+24>>2]=n.gid,T[r+28>>2]=n.rdev,T[r+32>>2]=0,q=[n.size>>>0,(X=n.size,+Math.abs(X)>=1?X>0?(0|Math.min(+Math.floor(X/4294967296),4294967295))>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],T[r+40>>2]=q[0],T[r+44>>2]=q[1],T[r+48>>2]=4096,T[r+52>>2]=n.blocks,T[r+56>>2]=n.atime.getTime()/1e3|0,T[r+60>>2]=0,T[r+64>>2]=n.mtime.getTime()/1e3|0,T[r+68>>2]=0,T[r+72>>2]=n.ctime.getTime()/1e3|0,T[r+76>>2]=0,q=[n.ino>>>0,(X=n.ino,+Math.abs(X)>=1?X>0?(0|Math.min(+Math.floor(X/4294967296),4294967295))>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],T[r+80>>2]=q[0],T[r+84>>2]=q[1],0},doMsync:function(e,t,r,n,o){var i=P.slice(e,e+r);ue.msync(t,i,o,r,n)},varargs:void 0,get:function(){return le.varargs+=4,T[le.varargs-4>>2]},getStr:function(e){return M(e)},getStreamFromFD:function(e){var t=ue.getStream(e);if(!t)throw new ue.ErrnoError(8);return t}},fe={};function he(){if(!he.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",_:d||"./this.program"};for(var t in fe)void 0===fe[t]?delete e[t]:e[t]=fe[t];var r=[];for(var t in e)r.push(t+"="+e[t]);he.strings=r}return he.strings}var pe=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ue.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},de=365,me=146;function ge(e,t,r){var n=r>0?r:j(e)+1,o=new Array(n),i=N(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(pe.prototype,{read:{get:function(){return(this.mode&de)===de},set:function(e){e?this.mode|=de:this.mode&=-366}},write:{get:function(){return(this.mode&me)===me},set:function(e){e?this.mode|=me:this.mode&=-147}},isFolder:{get:function(){return ue.isDir(this.mode)}},isDevice:{get:function(){return ue.isChrdev(this.mode)}}}),ue.FSNode=pe,ue.staticInit();var ve,ye={b:function(e,t,r,n){J("Assertion failed: "+M(e)+", at: "+[t?M(t):"unknown filename",r,n?M(n):"unknown function"])},k:function(e,t){try{return e=le.getStr(e),ue.chmod(e,t),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},D:function(e){try{var t=le.getStreamFromFD(e);return ue.createStream(t,0).fd}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},E:function(e,t,r,n){try{if(t=le.getStr(t),t=le.calculateAt(e,t),-8&r)return-28;var o=ue.lookupPath(t,{follow:!0}).node;if(!o)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&&ue.nodePermissions(o,i)?-2:0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},B:function(e,t){try{return ue.fchmod(e,t),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},d:function(e,t,r){le.varargs=r;try{var n=le.getStreamFromFD(e);switch(t){case 0:return(o=le.get())<0?-28:ue.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=le.get();return n.flags|=o,0;case 5:return o=le.get(),I[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,T[_e()>>2]=i,-1}}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}var i},z:function(e,t){try{var r=le.getStreamFromFD(e);return le.doStat(ue.stat,r.path,t)}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},v:function(e,t){try{if(0===t)return-28;var r=ue.cwd(),n=j(r)+1;return t<n?-68:(L(r,e,t),n)}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},l:function(e,t,r){le.varargs=r;try{var n=le.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=le.get();return T[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=le.get(),ue.ioctl(n,t,o);default:J("bad ioctl syscall "+t)}}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},x:function(e,t){try{return e=le.getStr(e),le.doStat(ue.lstat,e,t)}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},u:function(e,t,r){try{return t=le.getStr(t),t=le.calculateAt(e,t),"/"===(t=ne.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),ue.mkdir(t,r,0),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},w:function(e,t,r,n){try{t=le.getStr(t);var o=256&n,i=4096&n;return n&=-4353,t=le.calculateAt(e,t,i),le.doStat(o?ue.lstat:ue.stat,t,r)}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},i:function(e,t,r,n){le.varargs=n;try{t=le.getStr(t),t=le.calculateAt(e,t);var o=n?le.get():0;return ue.open(t,r,o).fd}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},t:function(e,t,r,n){try{if(t=le.getStr(t),t=le.calculateAt(e,t),n<=0)return-28;var o=ue.readlink(t),i=Math.min(n,j(o)),a=x[r+i];return L(o,r,n+1),x[r+i]=a,i}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},s:function(e){try{return e=le.getStr(e),ue.rmdir(e),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},y:function(e,t){try{return e=le.getStr(e),le.doStat(ue.stat,e,t)}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},r:function(e,t,r){try{return t=le.getStr(t),t=le.calculateAt(e,t),0===r?ue.unlink(t):512===r?ue.rmdir(t):J("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},q:function(e,t,r,n){try{if(t=le.getStr(t),t=le.calculateAt(e,t,!0),r){var o=T[r>>2],i=T[r+4>>2];a=1e3*o+i/1e6,s=1e3*(o=T[(r+=8)>>2])+(i=T[r+4>>2])/1e6}else var a=Date.now(),s=a;return ue.utime(t,a,s),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},j:function(){return Date.now()},C:function(){return!0},a:function(){J("")},A:function(e,t,r){P.copyWithin(e,t,t+r)},e:function(e){P.length,J("OOM")},m:function(e,t){var r=0;return he().forEach((function(n,o){var i=t+r;O[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)x[t++>>0]=e.charCodeAt(n);r||(x[t>>0]=0)}(n,i),r+=n.length+1})),0},o:function(e,t){var r=he();O[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),O[t>>2]=n,0},f:function(e){Ae(e)},c:function(e){try{var t=le.getStreamFromFD(e);return ue.close(t),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return e.errno}},p:function(e,t){try{var r=le.getStreamFromFD(e),n=r.tty?2:ue.isDir(r.mode)?3:ue.isLink(r.mode)?7:4;return x[t>>0]=n,0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return e.errno}},h:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=O[t>>2],s=O[t+4>>2];t+=8;var c=ue.read(e,x,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o}(le.getStreamFromFD(e),t,r);return T[n>>2]=o,0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return e.errno}},n:function(e,t,r,n,o){try{var i=(c=r)+2097152>>>0<4194305-!!(s=t)?(s>>>0)+4294967296*c:NaN;if(isNaN(i))return 61;var a=le.getStreamFromFD(e);return ue.llseek(a,i,n),q=[a.position>>>0,(X=a.position,+Math.abs(X)>=1?X>0?(0|Math.min(+Math.floor(X/4294967296),4294967295))>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],T[o>>2]=q[0],T[o+4>>2]=q[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return e.errno}var s,c},g:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=O[t>>2],s=O[t+4>>2];t+=8;var c=ue.write(e,x,a,s,n);if(c<0)return-1;o+=c}return o}(le.getStreamFromFD(e),t,r);return O[n>>2]=o,0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return e.errno}},F:function(e){Ce(e)}},_e=(function(){var e={a:ye};function t(e,t){var r,n,o=e.exports;i.asm=o,S=i.asm.G,r=S.buffer,k=r,i.HEAP8=x=new Int8Array(r),i.HEAP16=I=new Int16Array(r),i.HEAP32=T=new Int32Array(r),i.HEAPU8=P=new Uint8Array(r),i.HEAPU16=new Uint16Array(r),i.HEAPU32=O=new Uint32Array(r),i.HEAPF32=new Float32Array(r),i.HEAPF64=new Float64Array(r),i.asm.K,n=i.asm.H,B.unshift(n),Q()}function r(e){t(e.instance)}function n(t){return(b||!g&&!v||"function"!=typeof fetch?Promise.resolve().then((function(){return te(G)})):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 te(G)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){E("failed to asynchronously prepare wasm: "+e),J(e)}))}if(Z(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return E("Module.instantiateWasm callback failed with error: "+e),!1}(b||"function"!=typeof WebAssembly.instantiateStreaming||ee(G)||y||"function"!=typeof fetch?n(r):fetch(G,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return E("wasm streaming compile failed: "+e),E("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(_e=i.___errno_location=i.asm.J).apply(null,arguments)}),be=i.stackAlloc=function(){return(be=i.stackAlloc=i.asm.L).apply(null,arguments)};function we(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Ee(e){var t=i._main;(e=e||[]).unshift(d);var r=e.length,n=be(4*(r+1)),o=n>>2;e.forEach((e=>{T[o++]=function(e){var t=j(e)+1,r=be(t);return N(e,x,r,t),r}(e)})),T[o]=0;try{var a=t(r,n);return Ae(a),a}catch(e){return function(e){if(e instanceof we||"unwind"==e)return C;m(1,e)}(e)}}function Se(e){function r(){ve||(ve=!0,i.calledRun=!0,R||(i.noFSInit||ue.init.initialized||ue.init(),ue.ignorePermissions=!1,ie.init(),re(B),re(U),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),ke&&Ee(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),z.unshift(e);var e;re(z)}()))}e=e||p,K>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),H.unshift(e);var e;re(H)}(),K>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function Ae(e,t){C=e,Ce(e)}function Ce(e){C=e,V()||(i.onExit&&i.onExit(e),R=!0),m(e,new we(e))}if(i.FS=ue,Y=function e(){ve||Se(),ve||(Y=e)},i.run=Se,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),Se(),e.ready});e.exports=o},7757:(e,t,r)=>{e.exports=r(5666)},382:(e,t,r)=>{if("undefined"!=typeof SHARED_CONFIG)r.p=SHARED_CONFIG.url_base.cdn+"/";else{var n=r(1017).resolve;r.p=n(__dirname)+"/"}},9846:e=>{"use strict";e.exports=function(e){var t=e._SomePromiseArray;function r(e){var r=new t(e),n=r.promise();return r.setHowMany(1),r.setUnwrap(),r.init(),n}e.any=function(e){return r(e)},e.prototype.any=function(){return r(this)}}},4601:(e,t,r)=>{"use strict";var n;try{throw new Error}catch(e){n=e}var o=r(679),i=r(7824);function a(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new i(16),this._normalQueue=new i(16),this._haveDrainedQueues=!1;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=o}function s(e){for(;e.length()>0;)c(e)}function c(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var r=e.shift(),n=e.shift();t.call(r,n)}}a.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},a.prototype.hasCustomScheduler=function(){return this._customScheduler},a.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},a.prototype.fatalError=function(e,t){t?(process.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),process.exit(2)):this.throwLater(e)},a.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout((function(){e(t)}),0);else try{this._schedule((function(){e(t)}))}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},a.prototype.invokeLater=function(e,t,r){this._lateQueue.push(e,t,r),this._queueTick()},a.prototype.invoke=function(e,t,r){this._normalQueue.push(e,t,r),this._queueTick()},a.prototype.settlePromises=function(e){this._normalQueue._pushOne(e),this._queueTick()},a.prototype._drainQueues=function(){s(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,s(this._lateQueue)},a.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},a.prototype._reset=function(){this._isTickUsed=!1},e.exports=a,e.exports.firstLineError=n},3635:e=>{"use strict";e.exports=function(e,t,r,n){var o=!1,i=function(e,t){this._reject(t)},a=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(i,i,null,this,e)},s=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},c=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(i){o||(o=!0,e.prototype._propagateFrom=n.propagateFromFunction(),e.prototype._boundValue=n.boundValueFunction());var u=r(i),l=new e(t);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(u),u instanceof e){var h={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:u};f._then(t,a,void 0,l,h),u._then(s,c,void 0,l,h),l._setOnCancel(u)}else l._resolveCallback(f);return l},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,r){return e.resolve(r).bind(t)}}},3786:(e,t,r)=>{"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var o=r(7502)();o.noConflict=function(){try{Promise===o&&(Promise=n)}catch(e){}return o},e.exports=o},2293:(e,t,r)=>{"use strict";var n=Object.create;if(n){var o=n(null),i=n(null);o[" size"]=i[" size"]=0}e.exports=function(e){var t,n,a=r(5942),s=a.canEvaluate,c=a.isIdentifier,u=function(e){return new Function("ensureMethod"," \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g,e))(h)},l=function(e){return new Function("obj"," \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName",e))},f=function(e,t,r){var n=r[e];if("function"!=typeof n){if(!c(e))return null;if(n=t(e),r[e]=n,r[" size"]++,r[" size"]>512){for(var o=Object.keys(r),i=0;i<256;++i)delete r[o[i]];r[" size"]=o.length-256}}return n};function h(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var o="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(o)}return n}function p(e){return h(e,this.pop()).apply(e,this)}function d(e){return e[this]}function m(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}t=function(e){return f(e,u,o)},n=function(e){return f(e,l,i)},e.prototype.call=function(e){for(var r=arguments.length,n=new Array(Math.max(r-1,0)),o=1;o<r;++o)n[o-1]=arguments[o];if(s){var i=t(e);if(null!==i)return this._then(i,void 0,void 0,n,void 0)}return n.push(e),this._then(p,void 0,void 0,n,void 0)},e.prototype.get=function(e){var t;if("number"==typeof e)t=m;else if(s){var r=n(e);t=null!==r?r:d}else t=d;return this._then(t,void 0,void 0,e,void 0)}}},1735:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o){var i=r(5942),a=i.tryCatch,s=i.errorObj,c=e._async;e.prototype.break=e.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var r=e._cancellationParent;if(null==r||!r._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(e,t){if(i.isArray(e))for(var r=0;r<e.length;++r)this._doInvokeOnCancel(e[r],t);else if(void 0!==e)if("function"==typeof e){if(!t){var n=a(e).call(this._boundValue());n===s&&(this._attachExtraTrace(n.e),c.throwLater(n.e))}}else e._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,e)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},9976:(e,t,r)=>{"use strict";e.exports=function(e){var t=r(5942),n=r(9571).keys,o=t.tryCatch,i=t.errorObj;return function(r,a,s){return function(c){var u=s._boundValue();e:for(var l=0;l<r.length;++l){var f=r[l];if(f===Error||null!=f&&f.prototype instanceof Error){if(c instanceof f)return o(a).call(u,c)}else if("function"==typeof f){var h=o(f).call(u,c);if(h===i)return h;if(h)return o(a).call(u,c)}else if(t.isObject(c)){for(var p=n(f),d=0;d<p.length;++d){var m=p[d];if(f[m]!=c[m])continue e}return o(a).call(u,c)}}return e}}}},5910:e=>{"use strict";e.exports=function(e){var t=!1,r=[];function n(){this._trace=new n.CapturedTrace(o())}function o(){var e=r.length-1;if(e>=0)return r[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var e=r.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},n.CapturedTrace=null,n.create=function(){if(t)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=e.prototype._pushContext,i=e.prototype._popContext,a=e._peekContext,s=e.prototype._peekContext,c=e.prototype._promiseCreated;n.deactivateLongStackTraces=function(){e.prototype._pushContext=r,e.prototype._popContext=i,e._peekContext=a,e.prototype._peekContext=s,e.prototype._promiseCreated=c,t=!1},t=!0,e.prototype._pushContext=n.prototype._pushContext,e.prototype._popContext=n.prototype._popContext,e._peekContext=e.prototype._peekContext=o,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},n}},461:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o){var i,a,s,c,u=e._async,l=r(7621).Warning,f=r(5942),h=r(9571),p=f.canAttachTrace,d=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,m=/\((?:timers\.js):\d+:\d+\)/,g=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,v=null,y=null,_=!1,b=!(0==f.env("BLUEBIRD_DEBUG")||!f.env("BLUEBIRD_DEBUG")&&"development"!==f.env("NODE_ENV")),w=!(0==f.env("BLUEBIRD_WARNINGS")||!b&&!f.env("BLUEBIRD_WARNINGS")),E=!(0==f.env("BLUEBIRD_LONG_STACK_TRACES")||!b&&!f.env("BLUEBIRD_LONG_STACK_TRACES")),S=0!=f.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(w||!!f.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){var t=[];function r(){for(var e=0;e<t.length;++e)t[e]._notifyUnhandledRejection();n()}function n(){t.length=0}c=function(e){t.push(e),setTimeout(r,1)},h.defineProperty(e,"_unhandledRejectionCheck",{value:r}),h.defineProperty(e,"_unhandledRejectionClear",{value:n})}(),e.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0==(524288&this._bitField)&&(this._setRejectionIsUnhandled(),c(this))},e.prototype._notifyUnhandledRejectionIsHandled=function(){q("rejectionHandled",i,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),q("unhandledRejection",a,e,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(e,t,r){return V(e,t,r||this)},e.onPossiblyUnhandledRejection=function(t){var r=e._getContext();a=f.contextBind(r,t)},e.onUnhandledRejectionHandled=function(t){var r=e._getContext();i=f.contextBind(r,t)};var A=function(){};e.longStackTraces=function(){if(u.haveItemsQueued()&&!te.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!te.longStackTraces&&W()){var r=e.prototype._captureStackTrace,n=e.prototype._attachExtraTrace,o=e.prototype._dereferenceTrace;te.longStackTraces=!0,A=function(){if(u.haveItemsQueued()&&!te.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=r,e.prototype._attachExtraTrace=n,e.prototype._dereferenceTrace=o,t.deactivateLongStackTraces(),te.longStackTraces=!1},e.prototype._captureStackTrace=B,e.prototype._attachExtraTrace=U,e.prototype._dereferenceTrace=z,t.activateLongStackTraces()}},e.hasLongStackTraces=function(){return te.longStackTraces&&W()};var C={unhandledrejection:{before:function(){var e=f.global.onunhandledrejection;return f.global.onunhandledrejection=null,e},after:function(e){f.global.onunhandledrejection=e}},rejectionhandled:{before:function(){var e=f.global.onrejectionhandled;return f.global.onrejectionhandled=null,e},after:function(e){f.global.onrejectionhandled=e}}},k=function(){var e=function(e,t){if(!e)return!f.global.dispatchEvent(t);var r;try{return r=e.before(),!f.global.dispatchEvent(t)}finally{e.after(r)}};try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var n=new CustomEvent(t,{detail:r,cancelable:!0});return h.defineProperty(n,"promise",{value:r.promise}),h.defineProperty(n,"reason",{value:r.reason}),e(C[t],n)}}if("function"==typeof Event){t=new Event("CustomEvent");return f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var n=new Event(t,{cancelable:!0});return n.detail=r,h.defineProperty(n,"promise",{value:r.promise}),h.defineProperty(n,"reason",{value:r.reason}),e(C[t],n)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!0,r),e(C[t],n)}}catch(e){}return function(){return!1}}(),x=f.isNode?function(){return process.emit.apply(process,arguments)}:f.global?function(e){var t="on"+e.toLowerCase(),r=f.global[t];return!!r&&(r.apply(f.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function P(e,t){return{promise:t}}var I={promiseCreated:P,promiseFulfilled:P,promiseRejected:P,promiseResolved:P,promiseCancelled:P,promiseChained:function(e,t,r){return{promise:t,child:r}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,r){return{reason:t,promise:r}},rejectionHandled:P},T=function(e){var t=!1;try{t=x.apply(null,arguments)}catch(e){u.throwLater(e),t=!0}var r=!1;try{r=k(e,I[e].apply(null,arguments))}catch(e){u.throwLater(e),r=!0}return r||t};function O(){return!1}function R(e,t,r){var n=this;try{e(t,r,(function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+f.toString(e));n._attachCancellationCallback(e)}))}catch(e){return e}}function F(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?f.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function D(){return this._onCancelField}function M(e){this._onCancelField=e}function N(){this._cancellationParent=void 0,this._onCancelField=void 0}function L(e,t){if(0!=(1&t)){this._cancellationParent=e;var r=e._branchesRemainingToCancel;void 0===r&&(r=0),e._branchesRemainingToCancel=r+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}e.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&A()),"warnings"in t){var r=t.warnings;te.warnings=!!r,S=te.warnings,f.isObject(r)&&"wForgottenReturn"in r&&(S=!!r.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!te.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=N,e.prototype._propagateFrom=L,e.prototype._onCancel=D,e.prototype._setOnCancel=M,e.prototype._attachCancellationCallback=F,e.prototype._execute=R,j=L,te.cancellation=!0}if("monitoring"in t&&(t.monitoring&&!te.monitoring?(te.monitoring=!0,e.prototype._fireEvent=T):!t.monitoring&&te.monitoring&&(te.monitoring=!1,e.prototype._fireEvent=O)),"asyncHooks"in t&&f.nodeSupportsAsyncResource){var i=te.asyncHooks,a=!!t.asyncHooks;i!==a&&(te.asyncHooks=a,a?n():o())}return e},e.prototype._fireEvent=O,e.prototype._execute=function(e,t,r){try{e(t,r)}catch(e){return e}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(e){},e.prototype._attachCancellationCallback=function(e){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._dereferenceTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(e,t){};var j=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function H(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function B(){this._trace=new J(this._peekContext())}function U(e,t){if(p(e)){var r=this._trace;if(void 0!==r&&t&&(r=r._parent),void 0!==r)r.attachExtraTrace(e);else if(!e.__stackCleaned__){var n=$(e);f.notEnumerableProp(e,"stack",n.message+"\n"+n.stack.join("\n")),f.notEnumerableProp(e,"__stackCleaned__",!0)}}}function z(){this._trace=void 0}function V(t,r,n){if(te.warnings){var o,i=new l(t);if(r)n._attachExtraTrace(i);else if(te.longStackTraces&&(o=e._peekContext()))o.attachExtraTrace(i);else{var a=$(i);i.stack=a.message+"\n"+a.stack.join("\n")}T("warning",i)||X(i,"",!0)}}function G(e){for(var t=[],r=0;r<e.length;++r){var n=e[r],o=" (No stack trace)"===n||v.test(n),i=o&&Y(n);o&&!i&&(_&&" "!==n.charAt(0)&&(n=" "+n),t.push(n))}return t}function $(e){var t=e.stack,r=e.toString();return t="string"==typeof t&&t.length>0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),r=0;r<t.length;++r){var n=t[r];if(" (No stack trace)"===n||v.test(n))break}return r>0&&"SyntaxError"!=e.name&&(t=t.slice(r)),t}(e):[" (No stack trace)"],{message:r,stack:"SyntaxError"==e.name?t:G(t)}}function X(e,t,r){if("undefined"!=typeof console){var n;if(f.isObject(e)){var o=e.stack;n=t+y(o,e)}else n=t+String(e);"function"==typeof s?s(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function q(e,t,r,n){var o=!1;try{"function"==typeof t&&(o=!0,"rejectionHandled"===e?t(n):t(r,n))}catch(e){u.throwLater(e)}"unhandledRejection"===e?T(e,r,n)||o||X(r,"Unhandled rejection "):T(e,n)}function K(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():f.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){var t=41;if(e.length<t)return e;return e.substr(0,t-3)+"..."}(t)+">, no stack trace)"}function W(){return"function"==typeof ee}var Y=function(){return!1},Z=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Q(e){var t=e.match(Z);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function J(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);ee(this,J),t>32&&this.uncycle()}f.inherits(J,Error),t.CapturedTrace=J,J.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],r={},n=0,o=this;void 0!==o;++n)t.push(o),o=o._parent;for(n=(e=this._length=n)-1;n>=0;--n){var i=t[n].stack;void 0===r[i]&&(r[i]=n)}for(n=0;n<e;++n){var a=r[t[n].stack];if(void 0!==a&&a!==n){a>0&&(t[a-1]._parent=void 0,t[a-1]._length=1),t[n]._parent=void 0,t[n]._length=1;var s=n>0?t[n-1]:this;a<e-1?(s._parent=t[a+1],s._parent.uncycle(),s._length=s._parent._length+1):(s._parent=void 0,s._length=1);for(var c=s._length+1,u=n-2;u>=0;--u)t[u]._length=c,c++;return}}}},J.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=$(e),r=t.message,n=[t.stack],o=this;void 0!==o;)n.push(G(o.stack.split("\n"))),o=o._parent;!function(e){for(var t=e[0],r=1;r<e.length;++r){for(var n=e[r],o=t.length-1,i=t[o],a=-1,s=n.length-1;s>=0;--s)if(n[s]===i){a=s;break}for(s=a;s>=0;--s){var c=n[s];if(t[o]!==c)break;t.pop(),o--}t=n}}(n),function(e){for(var t=0;t<e.length;++t)(0===e[t].length||t+1<e.length&&e[t][0]===e[t+1][0])&&(e.splice(t,1),t--)}(n),f.notEnumerableProp(e,"stack",function(e,t){for(var r=0;r<t.length-1;++r)t[r].push("From previous event:"),t[r]=t[r].join("\n");return r<t.length&&(t[r]=t[r].join("\n")),e+"\n"+t.join("\n")}(r,n)),f.notEnumerableProp(e,"__stackCleaned__",!0)}};var ee=function(){var e=/^\s*at\s*/,t=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():K(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,v=e,y=t;var r=Error.captureStackTrace;return Y=function(e){return d.test(e)},function(e,t){Error.stackTraceLimit+=6,r(e,t),Error.stackTraceLimit-=6}}var n,o=new Error;if("string"==typeof o.stack&&o.stack.split("\n")[0].indexOf("stackDetection@")>=0)return v=/@/,y=t,_=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){n="stack"in e}return!("stack"in o)&&n&&"number"==typeof Error.stackTraceLimit?(v=e,y=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6}):(y=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?K(t):t.toString()},null)}();"undefined"!=typeof console&&void 0!==console.warn&&(s=function(e){console.warn(e)},f.isNode&&process.stderr.isTTY?s=function(e,t){var r=t?"":"";console.warn(r+e+"\n")}:f.isNode||"string"!=typeof(new Error).stack||(s=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var te={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return E&&e.longStackTraces(),{asyncHooks:function(){return te.asyncHooks},longStackTraces:function(){return te.longStackTraces},warnings:function(){return te.warnings},cancellation:function(){return te.cancellation},monitoring:function(){return te.monitoring},propagateFromFunction:function(){return j},boundValueFunction:function(){return H},checkForgottenReturns:function(e,t,r,n,o){if(void 0===e&&null!==t&&S){if(void 0!==o&&o._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var i="",a="";if(t._trace){for(var s=t._trace.stack.split("\n"),c=G(s),u=c.length-1;u>=0;--u){var l=c[u];if(!m.test(l)){var f=l.match(g);f&&(i="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(c.length>0){var h=c[0];for(u=0;u<s.length;++u)if(s[u]===h){u>0&&(a="\n"+s[u-1]);break}}}var p="a promise was created in a "+r+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(p,!0,t)}},setBounds:function(e,t){if(W()){for(var r,n,o=(e.stack||"").split("\n"),i=(t.stack||"").split("\n"),a=-1,s=-1,c=0;c<o.length;++c){if(u=Q(o[c])){r=u.fileName,a=u.line;break}}for(c=0;c<i.length;++c){var u;if(u=Q(i[c])){n=u.fileName,s=u.line;break}}a<0||s<0||!r||!n||r!==n||a>=s||(Y=function(e){if(d.test(e))return!0;var t=Q(e);return!!(t&&t.fileName===r&&a<=t.line&&t.line<=s)})}},warn:V,deprecated:function(e,t){var r=e+" is deprecated and will be removed in a future version.";return t&&(r+=" Use "+t+" instead."),V(r)},CapturedTrace:J,fireDomEvent:k,fireGlobalEvent:x}}},5632:e=>{"use strict";e.exports=function(e){function t(){return this.value}function r(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(r){return r instanceof e&&r.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:r},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(r,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:e},void 0);var t=arguments[1],n=function(){throw t};return this.caught(e,n)},e.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof e&&r.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:r},void 0);var n=arguments[1];n instanceof e&&n.suppressUnhandledRejections();var o=function(){return n};return this.caught(r,o)}}},6574:e=>{"use strict";e.exports=function(e,t){var r=e.reduce,n=e.all;function o(){return n(this)}e.prototype.each=function(e){return r(this,e,t,0)._then(o,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,n){return r(e,n,t,0)._then(o,void 0,void 0,e,void 0)},e.mapSeries=function(e,n){return r(e,n,t,t)}}},7621:(e,t,r)=>{"use strict";var n,o,i=r(9571),a=i.freeze,s=r(5942),c=s.inherits,u=s.notEnumerableProp;function l(e,t){function r(n){if(!(this instanceof r))return new r(n);u(this,"message","string"==typeof n?n:t),u(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return c(r,Error),r}var f=l("Warning","warning"),h=l("CancellationError","cancellation error"),p=l("TimeoutError","timeout error"),d=l("AggregateError","aggregate error");try{n=TypeError,o=RangeError}catch(e){n=l("TypeError","type error"),o=l("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g<m.length;++g)"function"==typeof Array.prototype[m[g]]&&(d.prototype[m[g]]=Array.prototype[m[g]]);i.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var v=0;function y(e){if(!(this instanceof y))return new y(e);u(this,"name","OperationalError"),u(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(u(this,"message",e.message),u(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}d.prototype.toString=function(){var e=Array(4*v+1).join(" "),t="\n"+e+"AggregateError of:\n";v++,e=Array(4*v+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",o=n.split("\n"),i=0;i<o.length;++i)o[i]=e+o[i];t+=(n=o.join("\n"))+"\n"}return v--,t},c(y,Error);var _=Error.__BluebirdErrorTypes__;_||(_=a({CancellationError:h,TimeoutError:p,OperationalError:y,RejectionError:y,AggregateError:d}),i.defineProperty(Error,"__BluebirdErrorTypes__",{value:_,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error,TypeError:n,RangeError:o,CancellationError:_.CancellationError,OperationalError:_.OperationalError,TimeoutError:_.TimeoutError,AggregateError:_.AggregateError,Warning:f}},9571:e=>{var t=function(){"use strict";return void 0===this}();if(t)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:t,propertyIsWritable:function(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!(r&&!r.writable&&!r.set)}};else{var r={}.hasOwnProperty,n={}.toString,o={}.constructor.prototype,i=function(e){var t=[];for(var n in e)r.call(e,n)&&t.push(n);return t};e.exports={isArray:function(e){try{return"[object Array]"===n.call(e)}catch(e){return!1}},keys:i,names:i,defineProperty:function(e,t,r){return e[t]=r.value,e},getDescriptor:function(e,t){return{value:e[t]}},freeze:function(e){return e},getPrototypeOf:function(e){try{return Object(e).constructor.prototype}catch(e){return o}},isES5:t,propertyIsWritable:function(){return!0}}}},6777:e=>{"use strict";e.exports=function(e,t){var r=e.map;e.prototype.filter=function(e,n){return r(this,e,n,t)},e.filter=function(e,n,o){return r(e,n,o,t)}}},7707:(e,t,r)=>{"use strict";e.exports=function(e,t,n){var o=r(5942),i=e.CancellationError,a=o.errorObj,s=r(9976)(n);function c(e,t,r){this.promise=e,this.type=t,this.handler=r,this.called=!1,this.cancelPromise=null}function u(e){this.finallyHandler=e}function l(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function f(){return p.call(this,this.promise._target()._settledValue())}function h(e){if(!l(this,e))return a.e=e,a}function p(r){var o=this.promise,s=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?s.call(o._boundValue()):s.call(o._boundValue(),r);if(c===n)return c;if(void 0!==c){o._setReturnedNonUndefined();var p=t(c,o);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new i("late cancellation observer");return o._attachExtraTrace(d),a.e=d,a}p.isPending()&&p._attachCancellationCallback(new u(this))}return p._then(f,h,void 0,this,void 0)}}}return o.isRejected()?(l(this),a.e=r,a):(l(this),r)}return c.prototype.isFinallyHandler=function(){return 0===this.type},u.prototype._resultCancelled=function(){l(this.finallyHandler)},e.prototype._passThrough=function(e,t,r,n){return"function"!=typeof e?this.then():this._then(r,n,void 0,new c(this,t,e),void 0)},e.prototype.lastly=e.prototype.finally=function(e){return this._passThrough(e,0,p,p)},e.prototype.tap=function(e){return this._passThrough(e,1,p)},e.prototype.tapCatch=function(t){var r=arguments.length;if(1===r)return this._passThrough(t,1,void 0,p);var n,i=new Array(r-1),a=0;for(n=0;n<r-1;++n){var c=arguments[n];if(!o.isObject(c))return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+o.classString(c)));i[a++]=c}i.length=a;var u=arguments[n];return this._passThrough(s(i,u,this),1,void 0,p)},c}},687:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i,a){var s=r(7621).TypeError,c=r(5942),u=c.errorObj,l=c.tryCatch,f=[];function h(t,r,o,i){if(a.cancellation()){var s=new e(n),c=this._finallyPromise=new e(n);this._promise=s.lastly((function(){return c})),s._captureStackTrace(),s._setOnCancel(this)}else{(this._promise=new e(n))._captureStackTrace()}this._stack=i,this._generatorFunction=t,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof o?[o].concat(f):f,this._yieldedPromise=null,this._cancellationPhase=!1}c.inherits(h,i),h.prototype._isResolved=function(){return null===this._promise},h.prototype._cleanup=function(){this._promise=this._generator=null,a.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},h.prototype._promiseCancelled=function(){if(!this._isResolved()){var t;if(void 0!==this._generator.return)this._promise._pushContext(),t=l(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),t=l(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(t)}},h.prototype._promiseFulfilled=function(e){this._yieldedPromise=null,this._promise._pushContext();var t=l(this._generator.next).call(this._generator,e);this._promise._popContext(),this._continue(t)},h.prototype._promiseRejected=function(e){this._yieldedPromise=null,this._promise._attachExtraTrace(e),this._promise._pushContext();var t=l(this._generator.throw).call(this._generator,e);this._promise._popContext(),this._continue(t)},h.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},h.prototype.promise=function(){return this._promise},h.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},h.prototype._continue=function(t){var r=this._promise;if(t===u)return this._cleanup(),this._cancellationPhase?r.cancel():r._rejectCallback(t.e,!1);var n=t.value;if(!0===t.done)return this._cleanup(),this._cancellationPhase?r.cancel():r._resolveCallback(n);var i=o(n,this._promise);if(i instanceof e||(i=function(t,r,n){for(var i=0;i<r.length;++i){n._pushContext();var a=l(r[i])(t);if(n._popContext(),a===u){n._pushContext();var s=e.reject(u.e);return n._popContext(),s}var c=o(a,n);if(c instanceof e)return c}return null}(i,this._yieldHandlers,this._promise),null!==i)){var a=(i=i._target())._bitField;0==(50397184&a)?(this._yieldedPromise=i,i._proxy(this,null)):0!=(33554432&a)?e._async.invoke(this._promiseFulfilled,this,i._value()):0!=(16777216&a)?e._async.invoke(this._promiseRejected,this,i._reason()):this._promiseCancelled()}else this._promiseRejected(new s("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(n))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},e.coroutine=function(e,t){if("function"!=typeof e)throw new s("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=Object(t).yieldHandler,n=h,o=(new Error).stack;return function(){var t=e.apply(this,arguments),i=new n(void 0,void 0,r,o),a=i.promise();return i._generator=t,i._promiseFulfilled(void 0),a}},e.coroutine.addYieldHandler=function(e){if("function"!=typeof e)throw new s("expecting a function but got "+c.classString(e));f.push(e)},e.spawn=function(r){if(a.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof r)return t("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=new h(r,this),o=n.promise();return n._run(e.spawn),o}}},7717:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i){var a,s=r(5942),c=s.canEvaluate,u=s.tryCatch,l=s.errorObj;if(c){for(var f=function(e){return new Function("value","holder"," \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g,e))},h=function(e){return new Function("promise","holder"," \n 'use strict'; \n holder.pIndex = promise; \n ".replace(/Index/g,e))},p=function(t){for(var r=new Array(t),n=0;n<r.length;++n)r[n]="this.p"+(n+1);var o=r.join(" = ")+" = null;",a="var promise;\n"+r.map((function(e){return" \n promise = "+e+"; \n if (promise instanceof Promise) { \n promise.cancel(); \n } \n "})).join("\n"),s=r.join(", "),c="Holder$"+t,f="return function(tryCatch, errorObj, Promise, async) { \n 'use strict'; \n function [TheName](fn) { \n [TheProperties] \n this.fn = fn; \n this.asyncNeeded = true; \n this.now = 0; \n } \n \n [TheName].prototype._callFunction = function(promise) { \n promise._pushContext(); \n var ret = tryCatch(this.fn)([ThePassedArguments]); \n promise._popContext(); \n if (ret === errorObj) { \n promise._rejectCallback(ret.e, false); \n } else { \n promise._resolveCallback(ret); \n } \n }; \n \n [TheName].prototype.checkFulfillment = function(promise) { \n var now = ++this.now; \n if (now === [TheTotal]) { \n if (this.asyncNeeded) { \n async.invoke(this._callFunction, this, promise); \n } else { \n this._callFunction(promise); \n } \n \n } \n }; \n \n [TheName].prototype._resultCancelled = function() { \n [CancellationCode] \n }; \n \n return [TheName]; \n }(tryCatch, errorObj, Promise, async); \n ";return f=f.replace(/\[TheName\]/g,c).replace(/\[TheTotal\]/g,t).replace(/\[ThePassedArguments\]/g,s).replace(/\[TheProperties\]/g,o).replace(/\[CancellationCode\]/g,a),new Function("tryCatch","errorObj","Promise","async",f)(u,l,e,i)},d=[],m=[],g=[],v=0;v<8;++v)d.push(p(v+1)),m.push(f(v+1)),g.push(h(v+1));a=function(e){this._reject(e)}}e.join=function(){var r,i=arguments.length-1;if(i>0&&"function"==typeof arguments[i]&&(r=arguments[i],i<=8&&c)){(E=new e(o))._captureStackTrace();for(var u=d[i-1],l=new u(r),f=m,h=0;h<i;++h){var p=n(arguments[h],E);if(p instanceof e){var v=(p=p._target())._bitField;0==(50397184&v)?(p._then(f[h],a,void 0,E,l),g[h](p,l),l.asyncNeeded=!1):0!=(33554432&v)?f[h].call(E,p._value(),l):0!=(16777216&v)?E._reject(p._reason()):E._cancel()}else f[h].call(E,p,l)}if(!E._isFateSealed()){if(l.asyncNeeded){var y=e._getContext();l.fn=s.contextBind(y,l.fn)}E._setAsyncGuaranteed(),E._setOnCancel(l)}return E}for(var _=arguments.length,b=new Array(_),w=0;w<_;++w)b[w]=arguments[w];r&&b.pop();var E=new t(b).promise();return void 0!==r?E.spread(r):E}}},6343:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i,a){var s=r(5942),c=s.tryCatch,u=s.errorObj,l=e._async;function f(t,r,n,o){this.constructor$(t),this._promise._captureStackTrace();var a=e._getContext();if(this._callback=s.contextBind(a,r),this._preservedValues=o===i?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],l.invoke(this._asyncInit,this,void 0),s.isArray(t))for(var c=0;c<t.length;++c){var u=t[c];u instanceof e&&u.suppressUnhandledRejections()}}function h(t,r,o,i){if("function"!=typeof r)return n("expecting a function but got "+s.classString(r));var a=0;if(void 0!==o){if("object"!=typeof o||null===o)return e.reject(new TypeError("options argument must be an object but it is "+s.classString(o)));if("number"!=typeof o.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+s.classString(o.concurrency)));a=o.concurrency}return new f(t,r,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,i).promise()}s.inherits(f,t),f.prototype._asyncInit=function(){this._init$(void 0,-2)},f.prototype._init=function(){},f.prototype._promiseFulfilled=function(t,r){var n=this._values,i=this.length(),s=this._preservedValues,l=this._limit;if(r<0){if(n[r=-1*r-1]=t,l>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(l>=1&&this._inFlight>=l)return n[r]=t,this._queue.push(r),!1;null!==s&&(s[r]=t);var f=this._promise,h=this._callback,p=f._boundValue();f._pushContext();var d=c(h).call(p,t,r,i),m=f._popContext();if(a.checkForgottenReturns(d,m,null!==s?"Promise.filter":"Promise.map",f),d===u)return this._reject(d.e),!0;var g=o(d,this._promise);if(g instanceof e){var v=(g=g._target())._bitField;if(0==(50397184&v))return l>=1&&this._inFlight++,n[r]=g,g._proxy(this,-1*(r+1)),!1;if(0==(33554432&v))return 0!=(16777216&v)?(this._reject(g._reason()),!0):(this._cancel(),!0);d=g._value()}n[r]=d}return++this._totalResolved>=i&&(null!==s?this._filter(n,s):this._resolve(n),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;e.length>0&&this._inFlight<t;){if(this._isResolved())return;var n=e.pop();this._promiseFulfilled(r[n],n)}},f.prototype._filter=function(e,t){for(var r=t.length,n=new Array(r),o=0,i=0;i<r;++i)e[i]&&(n[o++]=t[i]);n.length=o,this._resolve(n)},f.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(e,t){return h(this,e,t,null)},e.map=function(e,t,r,n){return h(e,t,r,n)}}},6926:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i){var a=r(5942),s=a.tryCatch;e.method=function(r){if("function"!=typeof r)throw new e.TypeError("expecting a function but got "+a.classString(r));return function(){var n=new e(t);n._captureStackTrace(),n._pushContext();var o=s(r).apply(this,arguments),a=n._popContext();return i.checkForgottenReturns(o,a,"Promise.method",n),n._resolveFromSyncValue(o),n}},e.attempt=e.try=function(r){if("function"!=typeof r)return o("expecting a function but got "+a.classString(r));var n,c=new e(t);if(c._captureStackTrace(),c._pushContext(),arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],l=arguments[2];n=a.isArray(u)?s(r).apply(l,u):s(r).call(l,u)}else n=s(r)();var f=c._popContext();return i.checkForgottenReturns(n,f,"Promise.try",c),c._resolveFromSyncValue(n),c},e.prototype._resolveFromSyncValue=function(e){e===a.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},1776:(e,t,r)=>{"use strict";var n=r(5942),o=n.maybeWrapAsError,i=r(7621).OperationalError,a=r(9571);var s=/^(?:name|message|stack|cause)$/;function c(e){var t;if(function(e){return e instanceof Error&&a.getPrototypeOf(e)===Error.prototype}(e)){(t=new i(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var r=a.keys(e),o=0;o<r.length;++o){var c=r[o];s.test(c)||(t[c]=e[c])}return t}return n.markAsOriginatingFromRejection(e),e}e.exports=function(e,t){return function(r,n){if(null!==e){if(r){var i=c(o(r));e._attachExtraTrace(i),e._reject(i)}else if(t){for(var a=arguments.length,s=new Array(Math.max(a-1,0)),u=1;u<a;++u)s[u-1]=arguments[u];e._fulfill(s)}else e._fulfill(n);e=null}}}},1941:(e,t,r)=>{"use strict";e.exports=function(e){var t=r(5942),n=e._async,o=t.tryCatch,i=t.errorObj;function a(e,r){if(!t.isArray(e))return s.call(this,e,r);var a=o(r).apply(this._boundValue(),[null].concat(e));a===i&&n.throwLater(a.e)}function s(e,t){var r=this._boundValue(),a=void 0===e?o(t).call(r,null):o(t).call(r,null,e);a===i&&n.throwLater(a.e)}function c(e,t){if(!e){var r=new Error(e+"");r.cause=e,e=r}var a=o(t).call(this._boundValue(),e);a===i&&n.throwLater(a.e)}e.prototype.asCallback=e.prototype.nodeify=function(e,t){if("function"==typeof e){var r=s;void 0!==t&&Object(t).spread&&(r=a),this._then(r,c,void 0,this,e)}return this}}},7502:(e,t,r)=>{"use strict";e.exports=function(){var t=function(){return new v("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},n=function(){return new R.PromiseInspection(this._target())},o=function(e){return R.reject(new v(e))};function i(){}var a={},s=r(5942);s.setReflectHandler(n);var c=function(){var e=process.domain;return void 0===e?null:e},u=function(){return{domain:c(),async:null}},l=s.isNode&&s.nodeSupportsAsyncResource?r(852).AsyncResource:null,f=function(){return{domain:c(),async:new l("Bluebird::Promise")}},h=s.isNode?u:function(){return null};s.notEnumerableProp(R,"_getContext",h);var p=r(9571),d=r(4601),m=new d;p.defineProperty(R,"_async",{value:m});var g=r(7621),v=R.TypeError=g.TypeError;R.RangeError=g.RangeError;var y=R.CancellationError=g.CancellationError;R.TimeoutError=g.TimeoutError,R.OperationalError=g.OperationalError,R.RejectionError=g.OperationalError,R.AggregateError=g.AggregateError;var _=function(){},b={},w={},E=r(1778)(R,_),S=r(1640)(R,_,E,o,i),A=r(5910)(R),C=A.create,k=r(461)(R,A,(function(){h=f,s.notEnumerableProp(R,"_getContext",f)}),(function(){h=u,s.notEnumerableProp(R,"_getContext",u)})),x=(k.CapturedTrace,r(7707)(R,E,w)),P=r(9976)(w),I=r(1776),T=s.errorObj,O=s.tryCatch;function R(e){e!==_&&function(e,t){if(null==e||e.constructor!==R)throw new v("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof t)throw new v("expecting a function but got "+s.classString(t))}(this,e),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(e),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function F(e){this.promise._resolveCallback(e)}function D(e){this.promise._rejectCallback(e,!1)}function M(e){var t=new R(_);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}return R.prototype.toString=function(){return"[object Promise]"},R.prototype.caught=R.prototype.catch=function(e){var t=arguments.length;if(t>1){var r,n=new Array(t-1),i=0;for(r=0;r<t-1;++r){var a=arguments[r];if(!s.isObject(a))return o("Catch statement predicate: expecting an object but got "+s.classString(a));n[i++]=a}if(n.length=i,"function"!=typeof(e=arguments[r]))throw new v("The last argument to .catch() must be a function, got "+s.toString(e));return this.then(void 0,P(n,e,this))}return this.then(void 0,e)},R.prototype.reflect=function(){return this._then(n,n,void 0,this,void 0)},R.prototype.then=function(e,t){if(k.warnings()&&arguments.length>0&&"function"!=typeof e&&"function"!=typeof t){var r=".then() only accepts functions but was passed: "+s.classString(e);arguments.length>1&&(r+=", "+s.classString(t)),this._warn(r)}return this._then(e,t,void 0,void 0,void 0)},R.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},R.prototype.spread=function(e){return"function"!=typeof e?o("expecting a function but got "+s.classString(e)):this.all()._then(e,void 0,void 0,b,void 0)},R.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},R.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new S(this).promise()},R.prototype.error=function(e){return this.caught(s.originatesFromRejection,e)},R.getNewLibraryCopy=e.exports,R.is=function(e){return e instanceof R},R.fromNode=R.fromCallback=function(e){var t=new R(_);t._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=O(e)(I(t,r));return n===T&&t._rejectCallback(n.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},R.all=function(e){return new S(e).promise()},R.cast=function(e){var t=E(e);return t instanceof R||((t=new R(_))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},R.resolve=R.fulfilled=R.cast,R.reject=R.rejected=function(e){var t=new R(_);return t._captureStackTrace(),t._rejectCallback(e,!0),t},R.setScheduler=function(e){if("function"!=typeof e)throw new v("expecting a function but got "+s.classString(e));return m.setScheduler(e)},R.prototype._then=function(e,t,r,n,o){var i=void 0!==o,a=i?o:new R(_),c=this._target(),u=c._bitField;i||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&u)?this._boundValue():c===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var l=h();if(0!=(50397184&u)){var f,p,d=c._settlePromiseCtx;0!=(33554432&u)?(p=c._rejectionHandler0,f=e):0!=(16777216&u)?(p=c._fulfillmentHandler0,f=t,c._unsetRejectionIsUnhandled()):(d=c._settlePromiseLateCancellationObserver,p=new y("late cancellation observer"),c._attachExtraTrace(p),f=t),m.invoke(d,c,{handler:s.contextBind(l,f),promise:a,receiver:n,value:p})}else c._addCallbacks(e,t,a,n,l);return a},R.prototype._length=function(){return 65535&this._bitField},R.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},R.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},R.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},R.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},R.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},R.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},R.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},R.prototype._isFinal=function(){return(4194304&this._bitField)>0},R.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},R.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},R.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},R.prototype._setAsyncGuaranteed=function(){if(!m.hasCustomScheduler()){var e=this._bitField;this._bitField=e|(536870912&e)>>2^134217728}},R.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},R.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==a)return void 0===t&&this._isBound()?this._boundValue():t},R.prototype._promiseAt=function(e){return this[4*e-4+2]},R.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},R.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},R.prototype._boundValue=function(){},R.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,r=e._rejectionHandler0,n=e._promise0,o=e._receiverAt(0);void 0===o&&(o=a),this._addCallbacks(t,r,n,o,null)},R.prototype._migrateCallbackAt=function(e,t){var r=e._fulfillmentHandlerAt(t),n=e._rejectionHandlerAt(t),o=e._promiseAt(t),i=e._receiverAt(t);void 0===i&&(i=a),this._addCallbacks(r,n,o,i,null)},R.prototype._addCallbacks=function(e,t,r,n,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=r,this._receiver0=n,"function"==typeof e&&(this._fulfillmentHandler0=s.contextBind(o,e)),"function"==typeof t&&(this._rejectionHandler0=s.contextBind(o,t));else{var a=4*i-4;this[a+2]=r,this[a+3]=n,"function"==typeof e&&(this[a+0]=s.contextBind(o,e)),"function"==typeof t&&(this[a+1]=s.contextBind(o,t))}return this._setLength(i+1),i},R.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},R.prototype._resolveCallback=function(e,r){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(t(),!1);var n=E(e,this);if(!(n instanceof R))return this._fulfill(e);r&&this._propagateFrom(n,2);var o=n._target();if(o!==this){var i=o._bitField;if(0==(50397184&i)){var a=this._length();a>0&&o._migrateCallback0(this);for(var s=1;s<a;++s)o._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(n)}else if(0!=(33554432&i))this._fulfill(o._value());else if(0!=(16777216&i))this._reject(o._reason());else{var c=new y("late cancellation observer");o._attachExtraTrace(c),this._reject(c)}}else this._reject(t())}},R.prototype._rejectCallback=function(e,t,r){var n=s.ensureErrorObject(e),o=n===e;if(!o&&!r&&k.warnings()){var i="a promise was rejected with a non-error: "+s.classString(e);this._warn(i,!0)}this._attachExtraTrace(n,!!t&&o),this._reject(e)},R.prototype._resolveFromExecutor=function(e){if(e!==_){var t=this;this._captureStackTrace(),this._pushContext();var r=!0,n=this._execute(e,(function(e){t._resolveCallback(e)}),(function(e){t._rejectCallback(e,r)}));r=!1,this._popContext(),void 0!==n&&t._rejectCallback(n,!0)}},R.prototype._settlePromiseFromHandler=function(e,t,r,n){var o=n._bitField;if(0==(65536&o)){var i;n._pushContext(),t===b?r&&"number"==typeof r.length?i=O(e).apply(this._boundValue(),r):(i=T).e=new v("cannot .spread() a non-array: "+s.classString(r)):i=O(e).call(t,r);var a=n._popContext();0==(65536&(o=n._bitField))&&(i===w?n._reject(r):i===T?n._rejectCallback(i.e,!1):(k.checkForgottenReturns(i,a,"",n,this),n._resolveCallback(i)))}},R.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},R.prototype._followee=function(){return this._rejectionHandler0},R.prototype._setFollowee=function(e){this._rejectionHandler0=e},R.prototype._settlePromise=function(e,t,r,o){var a=e instanceof R,s=this._bitField,c=0!=(134217728&s);0!=(65536&s)?(a&&e._invokeInternalOnCancel(),r instanceof x&&r.isFinallyHandler()?(r.cancelPromise=e,O(t).call(r,o)===T&&e._reject(T.e)):t===n?e._fulfill(n.call(r)):r instanceof i?r._promiseCancelled(e):a||e instanceof S?e._cancel():r.cancel()):"function"==typeof t?a?(c&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,r,o,e)):t.call(r,o,e):r instanceof i?r._isResolved()||(0!=(33554432&s)?r._promiseFulfilled(o,e):r._promiseRejected(o,e)):a&&(c&&e._setAsyncGuaranteed(),0!=(33554432&s)?e._fulfill(o):e._reject(o))},R.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,r=e.promise,n=e.receiver,o=e.value;"function"==typeof t?r instanceof R?this._settlePromiseFromHandler(t,n,o,r):t.call(n,o,r):r instanceof R&&r._reject(o)},R.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},R.prototype._settlePromise0=function(e,t,r){var n=this._promise0,o=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(n,e,o,t)},R.prototype._clearCallbackDataAtIndex=function(e){var t=4*e-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},R.prototype._fulfill=function(e){var r=this._bitField;if(!((117506048&r)>>>16)){if(e===this){var n=t();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=e,(65535&r)>0&&(0!=(134217728&r)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},R.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,s.isNode);(65535&t)>0?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},R.prototype._fulfillPromises=function(e,t){for(var r=1;r<e;r++){var n=this._fulfillmentHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,t)}},R.prototype._rejectPromises=function(e,t){for(var r=1;r<e;r++){var n=this._rejectionHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,t)}},R.prototype._settlePromises=function(){var e=this._bitField,t=65535&e;if(t>0){if(0!=(16842752&e)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,e),this._rejectPromises(t,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,e),this._fulfillPromises(t,n)}this._setLength(0)}this._clearCancellationData()},R.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&p.defineProperty(R.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),R.defer=R.pending=function(){return k.deprecated("Promise.defer","new Promise"),{promise:new R(_),resolve:F,reject:D}},s.notEnumerableProp(R,"_makeSelfResolutionError",t),r(6926)(R,_,E,o,k),r(3635)(R,_,E,k),r(1735)(R,S,o,k),r(5632)(R),r(1958)(R),r(7717)(R,S,E,_,m),R.Promise=R,R.version="3.7.2",r(2293)(R),r(687)(R,o,_,E,i,k),r(6343)(R,S,o,E,_,k),r(1941)(R),r(9346)(R,_),r(5733)(R,S,E,o),r(4648)(R,_,E,o),r(3609)(R,S,o,E,_,k),r(8615)(R,S,k),r(4488)(R,S,o),r(8418)(R,_,k),r(4525)(R,o,E,C,_,k),r(9846)(R),r(6574)(R,_),r(6777)(R,_),s.toFastProperties(R),s.toFastProperties(R.prototype),M({a:1}),M({b:2}),M({c:3}),M(1),M((function(){})),M(void 0),M(!1),M(new R(_)),k.setBounds(d.firstLineError,s.lastLineError),R}},1640:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i){var a=r(5942);a.isArray;function s(r){var n=this._promise=new e(t);r instanceof e&&(n._propagateFrom(r,3),r.suppressUnhandledRejections()),n._setOnCancel(this),this._values=r,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,i),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(r,i){var s=n(this._values,this._promise);if(s instanceof e){var c=(s=s._target())._bitField;if(this._values=s,0==(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,i);if(0==(33554432&c))return 0!=(16777216&c)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===i?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(i));else{var u=o("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(u,!1)}},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var o=this._promise,i=!1,a=null,s=0;s<r;++s){var c=n(t[s],o);a=c instanceof e?(c=c._target())._bitField:null,i?null!==a&&c.suppressUnhandledRejections():null!==a?0==(50397184&a)?(c._proxy(this,s),this._values[s]=c):i=0!=(33554432&a)?this._promiseFulfilled(c._value(),s):0!=(16777216&a)?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):i=this._promiseFulfilled(c,s)}i||o._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(e){this._values=null,this._promise._fulfill(e)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(e){this._values=null,this._promise._rejectCallback(e,!1)},s.prototype._promiseFulfilled=function(e,t){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r<t.length;++r)t[r]instanceof e&&t[r].cancel()}},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(e){return e},s}},9346:(e,t,r)=>{"use strict";e.exports=function(e,t){var n={},o=r(5942),i=r(1776),a=o.withAppended,s=o.maybeWrapAsError,c=o.canEvaluate,u=r(7621).TypeError,l={__isPromisified__:!0},f=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),h=function(e){return o.isIdentifier(e)&&"_"!==e.charAt(0)&&"constructor"!==e};function p(e){return!f.test(e)}function d(e){try{return!0===e.__isPromisified__}catch(e){return!1}}function m(e,t,r){var n=o.getDataPropertyOrDefault(e,t+r,l);return!!n&&d(n)}function g(e,t,r,n){for(var i=o.inheritedDataKeys(e),a=[],s=0;s<i.length;++s){var c=i[s],l=e[c],f=n===h||h(c);"function"!=typeof l||d(l)||m(e,c,t)||!n(c,l,e,f)||a.push(c,l)}return function(e,t,r){for(var n=0;n<e.length;n+=2){var o=e[n];if(r.test(o))for(var i=o.replace(r,""),a=0;a<e.length;a+=2)if(e[a]===i)throw new u("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",t))}}(a,t,r),a}var v;v=function(r,c,u,l,f,h){var p=Math.max(0,function(e){return"number"==typeof e.length?Math.max(Math.min(e.length,1024),0):0}(l)-1),d=function(e){for(var t=[e],r=Math.max(0,e-1-3),n=e-1;n>=r;--n)t.push(n);for(n=e+1;n<=3;++n)t.push(n);return t}(p),m="string"==typeof r||c===n;function g(e){var t,r=(t=e,o.filledRange(t,"_arg","")).join(", "),n=e>0?", ":"";return(m?"ret = callback.call(this, {{args}}, nodeback); break;\n":void 0===c?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n").replace("{{args}}",r).replace(", ",n)}var v="string"==typeof r?"this != null ? this['"+r+"'] : fn":"fn",y="'use strict'; \n var ret = function (Parameters) { \n 'use strict'; \n var len = arguments.length; \n var promise = new Promise(INTERNAL); \n promise._captureStackTrace(); \n var nodeback = nodebackForPromise(promise, "+h+"); \n var ret; \n var callback = tryCatch([GetFunctionCode]); \n switch(len) { \n [CodeForSwitchCase] \n } \n if (ret === errorObj) { \n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n } \n if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n return promise; \n }; \n notEnumerableProp(ret, '__isPromisified__', true); \n return ret; \n ".replace("[CodeForSwitchCase]",function(){for(var e="",t=0;t<d.length;++t)e+="case "+d[t]+":"+g(d[t]);return e+=" \n default: \n var args = new Array(len + 1); \n var i = 0; \n for (var i = 0; i < len; ++i) { \n args[i] = arguments[i]; \n } \n args[i] = nodeback; \n [CodeForCall] \n break; \n ".replace("[CodeForCall]",m?"ret = callback.apply(this, args);\n":"ret = callback.apply(receiver, args);\n")}()).replace("[GetFunctionCode]",v);return y=y.replace("Parameters",function(e){return o.filledRange(Math.max(e,3),"_arg","")}(p)),new Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",y)(e,l,c,a,s,i,o.tryCatch,o.errorObj,o.notEnumerableProp,t)};var y=c?v:function(r,c,u,l,f,h){var p=function(){return this}(),d=r;function m(){var o=c;c===n&&(o=this);var u=new e(t);u._captureStackTrace();var l="string"==typeof d&&this!==p?this[d]:r,f=i(u,h);try{l.apply(o,a(arguments,f))}catch(e){u._rejectCallback(s(e),!0,!0)}return u._isFateSealed()||u._setAsyncGuaranteed(),u}return"string"==typeof d&&(r=l),o.notEnumerableProp(m,"__isPromisified__",!0),m};function _(e,t,r,i,a){for(var s=new RegExp(t.replace(/([$])/,"\\$")+"$"),c=g(e,t,s,r),u=0,l=c.length;u<l;u+=2){var f=c[u],h=c[u+1],p=f+t;if(i===y)e[p]=y(f,n,f,h,t,a);else{var d=i(h,(function(){return y(f,n,f,h,t,a)}));o.notEnumerableProp(d,"__isPromisified__",!0),e[p]=d}}return o.toFastProperties(e),e}e.promisify=function(e,t){if("function"!=typeof e)throw new u("expecting a function but got "+o.classString(e));if(d(e))return e;var r=function(e,t,r){return y(e,t,void 0,e,null,r)}(e,void 0===(t=Object(t)).context?n:t.context,!!t.multiArgs);return o.copyDescriptors(e,r,p),r},e.promisifyAll=function(e,t){if("function"!=typeof e&&"object"!=typeof e)throw new u("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");var r=!!(t=Object(t)).multiArgs,n=t.suffix;"string"!=typeof n&&(n="Async");var i=t.filter;"function"!=typeof i&&(i=h);var a=t.promisifier;if("function"!=typeof a&&(a=y),!o.isIdentifier(n))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=o.inheritedDataKeys(e),c=0;c<s.length;++c){var l=e[s[c]];"constructor"!==s[c]&&o.isClass(l)&&(_(l.prototype,n,i,a,r),_(l,n,i,a,r))}return _(e,n,i,a,r)}}},5733:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o){var i,a=r(5942),s=a.isObject,c=r(9571);"function"==typeof Map&&(i=Map);var u=function(){var e=0,t=0;function r(r,n){this[e]=r,this[e+t]=n,e++}return function(n){t=n.size,e=0;var o=new Array(2*n.size);return n.forEach(r,o),o}}();function l(e){var t,r=!1;if(void 0!==i&&e instanceof i)t=u(e),r=!0;else{var n=c.keys(e),o=n.length;t=new Array(2*o);for(var a=0;a<o;++a){var s=n[a];t[a]=e[s],t[a+o]=s}}this.constructor$(t),this._isMap=r,this._init$(void 0,r?-6:-3)}function f(t){var r,i=n(t);return s(i)?(r=i instanceof e?i._then(e.props,void 0,void 0,void 0,void 0):new l(i).promise(),i instanceof e&&r._propagateFrom(i,2),r):o("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}a.inherits(l,t),l.prototype._init=function(){},l.prototype._promiseFulfilled=function(e,t){if(this._values[t]=e,++this._totalResolved>=this._length){var r;if(this._isMap)r=function(e){for(var t=new i,r=e.length/2|0,n=0;n<r;++n){var o=e[r+n],a=e[n];t.set(o,a)}return t}(this._values);else{r={};for(var n=this.length(),o=0,a=this.length();o<a;++o)r[this._values[o+n]]=this._values[o]}return this._resolve(r),!0}return!1},l.prototype.shouldCopyValues=function(){return!1},l.prototype.getActualLength=function(e){return e>>1},e.prototype.props=function(){return f(this)},e.props=function(e){return f(e)}}},7824:e=>{"use strict";function t(e){this._capacity=e,this._length=0,this._front=0}t.prototype._willBeOverCapacity=function(e){return this._capacity<e},t.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1),this[this._front+t&this._capacity-1]=e,this._length=t+1},t.prototype.push=function(e,t,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(e),this._pushOne(t),void this._pushOne(r);var o=this._front+n-3;this._checkCapacity(n);var i=this._capacity-1;this[o+0&i]=e,this[o+1&i]=t,this[o+2&i]=r,this._length=n},t.prototype.shift=function(){var e=this._front,t=this[e];return this[e]=void 0,this._front=e+1&this._capacity-1,this._length--,t},t.prototype.length=function(){return this._length},t.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)},t.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e,function(e,t,r,n,o){for(var i=0;i<o;++i)r[i+n]=e[i+t],e[i+t]=void 0}(this,0,this,t,this._front+this._length&t-1)},e.exports=t},4648:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o){var i=r(5942);function a(r,s){var c,u=n(r);if(u instanceof e)return(c=u).then((function(e){return a(e,c)}));if(null===(r=i.asArray(r)))return o("expecting an array or an iterable object but got "+i.classString(r));var l=new e(t);void 0!==s&&l._propagateFrom(s,3);for(var f=l._fulfill,h=l._reject,p=0,d=r.length;p<d;++p){var m=r[p];(void 0!==m||p in r)&&e.cast(m)._then(f,h,void 0,l,null)}return l}e.race=function(e){return a(e,void 0)},e.prototype.race=function(){return a(this,void 0)}}},3609:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i,a){var s=r(5942),c=s.tryCatch;function u(t,r,n,o){this.constructor$(t);var a=e._getContext();this._fn=s.contextBind(a,r),void 0!==n&&(n=e.resolve(n))._attachCancellationCallback(this),this._initialValue=n,this._currentCancellable=null,this._eachValues=o===i?Array(this._length):0===o?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function l(e,t){this.isFulfilled()?t._resolve(e):t._reject(e)}function f(e,t,r,o){return"function"!=typeof t?n("expecting a function but got "+s.classString(t)):new u(e,t,r,o).promise()}function h(t){this.accum=t,this.array._gotAccum(t);var r=o(this.value,this.array._promise);return r instanceof e?(this.array._currentCancellable=r,r._then(p,void 0,void 0,this,void 0)):p.call(this,r)}function p(t){var r,n=this.array,o=n._promise,i=c(n._fn);o._pushContext(),(r=void 0!==n._eachValues?i.call(o._boundValue(),t,this.index,this.length):i.call(o._boundValue(),this.accum,t,this.index,this.length))instanceof e&&(n._currentCancellable=r);var s=o._popContext();return a.checkForgottenReturns(r,s,void 0!==n._eachValues?"Promise.each":"Promise.reduce",o),r}s.inherits(u,t),u.prototype._gotAccum=function(e){void 0!==this._eachValues&&null!==this._eachValues&&e!==i&&this._eachValues.push(e)},u.prototype._eachComplete=function(e){return null!==this._eachValues&&this._eachValues.push(e),this._eachValues},u.prototype._init=function(){},u.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},u.prototype.shouldCopyValues=function(){return!1},u.prototype._resolve=function(e){this._promise._resolveCallback(e),this._values=null},u.prototype._resultCancelled=function(t){if(t===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel())},u.prototype._iterate=function(t){var r,n;this._values=t;var o=t.length;void 0!==this._initialValue?(r=this._initialValue,n=0):(r=e.resolve(t[0]),n=1),this._currentCancellable=r;for(var i=n;i<o;++i){var a=t[i];a instanceof e&&a.suppressUnhandledRejections()}if(!r.isRejected())for(;n<o;++n){var s={accum:null,value:t[n],index:n,length:o,array:this};r=r._then(h,void 0,void 0,s,void 0),0==(127&n)&&r._setNoAsyncGuarantee()}void 0!==this._eachValues&&(r=r._then(this._eachComplete,void 0,void 0,this,void 0)),r._then(l,l,void 0,r,this)},e.prototype.reduce=function(e,t){return f(this,e,t,null)},e.reduce=function(e,t,r,n){return f(e,t,r,n)}}},679:(e,t,r)=>{"use strict";var n,o=r(5942),i=o.getNativePromise();if(o.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,s=process.nextTick;n=o.isRecentNode?function(e){a.call(global,e)}:function(e){s.call(process,e)}}else if("function"==typeof i&&"function"==typeof i.resolve){var c=i.resolve();n=function(e){c.then(e)}}else n="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)||!("classList"in document.documentElement)?"undefined"!=typeof setImmediate?function(e){setImmediate(e)}:"undefined"!=typeof setTimeout?function(e){setTimeout(e,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}:function(){var e=document.createElement("div"),t={attributes:!0},r=!1,n=document.createElement("div");new MutationObserver((function(){e.classList.toggle("foo"),r=!1})).observe(n,t);return function(o){var i=new MutationObserver((function(){i.disconnect(),o()}));i.observe(e,t),r||(r=!0,n.classList.toggle("foo"))}}();e.exports=n},8615:(e,t,r)=>{"use strict";e.exports=function(e,t,n){var o=e.PromiseInspection;function i(e){this.constructor$(e)}r(5942).inherits(i,t),i.prototype._promiseResolved=function(e,t){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(e,t){var r=new o;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},i.prototype._promiseRejected=function(e,t){var r=new o;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return n.deprecated(".settle()",".reflect()"),new i(e).promise()},e.allSettled=function(e){return new i(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},4488:(e,t,r)=>{"use strict";e.exports=function(e,t,n){var o=r(5942),i=r(7621).RangeError,a=r(7621).AggregateError,s=o.isArray,c={};function u(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function l(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new u(e),o=r.promise();return r.setHowMany(t),r.init(),o}o.inherits(u,t),u.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=s(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},u.prototype.init=function(){this._initialized=!0,this._init()},u.prototype.setUnwrap=function(){this._unwrap=!0},u.prototype.howMany=function(){return this._howMany},u.prototype.setHowMany=function(e){this._howMany=e},u.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},u.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},u.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},u.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t<this._values.length;++t)this._values[t]!==c&&e.push(this._values[t]);return e.length>0?this._reject(e):this._cancel(),!0}return!1},u.prototype._fulfilled=function(){return this._totalResolved},u.prototype._rejected=function(){return this._values.length-this.length()},u.prototype._addRejected=function(e){this._values.push(e)},u.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},u.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},u.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new i(t)},u.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(e,t){return l(e,t)},e.prototype.some=function(e){return l(this,e)},e._SomePromiseArray=u}},1958:e=>{"use strict";e.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var r=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},o=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},i=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return a.call(this._target())},e.prototype.isRejected=function(){return i.call(this._target())},e.prototype.isFulfilled=function(){return o.call(this._target())},e.prototype.isResolved=function(){return s.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),n.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},1778:(e,t,r)=>{"use strict";e.exports=function(e,t){var n=r(5942),o=n.errorObj,i=n.isObject;var a={}.hasOwnProperty;return function(r,s){if(i(r)){if(r instanceof e)return r;var c=function(e){try{return function(e){return e.then}(e)}catch(e){return o.e=e,o}}(r);if(c===o){s&&s._pushContext();var u=e.reject(c.e);return s&&s._popContext(),u}if("function"==typeof c){if(function(e){try{return a.call(e,"_promise0")}catch(e){return!1}}(r)){u=new e(t);return r._then(u._fulfill,u._reject,void 0,u,null),u}return function(r,i,a){var s=new e(t),c=s;a&&a._pushContext();s._captureStackTrace(),a&&a._popContext();var u=!0,l=n.tryCatch(i).call(r,f,h);u=!1,s&&l===o&&(s._rejectCallback(l.e,!0,!0),s=null);function f(e){s&&(s._resolveCallback(e),s=null)}function h(e){s&&(s._rejectCallback(e,u,!0),s=null)}return c}(r,c,s)}}return r}}},8418:(e,t,r)=>{"use strict";e.exports=function(e,t,n){var o=r(5942),i=e.TimeoutError;function a(e){this.handle=e}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(e){return c(+this).thenReturn(e)},c=e.delay=function(r,o){var i,c;return void 0!==o?(i=e.resolve(o)._then(s,null,null,r,void 0),n.cancellation()&&o instanceof e&&i._setOnCancel(o)):(i=new e(t),c=setTimeout((function(){i._fulfill()}),+r),n.cancellation()&&i._setOnCancel(new a(c)),i._captureStackTrace()),i._setAsyncGuaranteed(),i};e.prototype.delay=function(e){return c(e,this)};function u(e){return clearTimeout(this.handle),e}function l(e){throw clearTimeout(this.handle),e}e.prototype.timeout=function(e,t){var r,s;e=+e;var c=new a(setTimeout((function(){r.isPending()&&function(e,t,r){var n;n="string"!=typeof t?t instanceof Error?t:new i("operation timed out"):new i(t),o.markAsOriginatingFromRejection(n),e._attachExtraTrace(n),e._reject(n),null!=r&&r.cancel()}(r,t,s)}),e));return n.cancellation()?(s=this.then(),(r=s._then(u,l,void 0,c,void 0))._setOnCancel(c)):r=this._then(u,l,void 0,c,void 0),r}}},4525:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i,a){var s=r(5942),c=r(7621).TypeError,u=r(5942).inherits,l=s.errorObj,f=s.tryCatch,h={};function p(e){setTimeout((function(){throw e}),0)}function d(t,r){var o=0,a=t.length,s=new e(i);return function i(){if(o>=a)return s._fulfill();var c=function(e){var t=n(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}(t[o++]);if(c instanceof e&&c._isDisposable()){try{c=n(c._getDisposer().tryDispose(r),t.promise)}catch(e){return p(e)}if(c instanceof e)return c._then(i,p,null,null,null)}i()}(),s}function m(e,t,r){this._data=e,this._promise=t,this._context=r}function g(e,t,r){this.constructor$(e,t,r)}function v(e){return m.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function y(e){this.length=e,this.promise=null,this[e-1]=null}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():h},m.prototype.tryDispose=function(e){var t=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=t!==h?this.doDispose(t,e):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},m.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},u(g,m),g.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},y.prototype._resultCancelled=function(){for(var t=this.length,r=0;r<t;++r){var n=this[r];n instanceof e&&n.cancel()}},e.using=function(){var r=arguments.length;if(r<2)return t("you must pass at least 2 arguments to Promise.using");var o,i=arguments[r-1];if("function"!=typeof i)return t("expecting a function but got "+s.classString(i));var c=!0;2===r&&Array.isArray(arguments[0])?(r=(o=arguments[0]).length,c=!1):(o=arguments,r--);for(var u=new y(r),h=0;h<r;++h){var p=o[h];if(m.isDisposer(p)){var g=p;(p=p.promise())._setDisposable(g)}else{var _=n(p);_ instanceof e&&(p=_._then(v,null,null,{resources:u,index:h},void 0))}u[h]=p}var b=new Array(u.length);for(h=0;h<b.length;++h)b[h]=e.resolve(u[h]).reflect();var w=e.all(b).then((function(e){for(var t=0;t<e.length;++t){var r=e[t];if(r.isRejected())return l.e=r.error(),l;if(!r.isFulfilled())return void w.cancel();e[t]=r.value()}E._pushContext(),i=f(i);var n=c?i.apply(void 0,e):i(e),o=E._popContext();return a.checkForgottenReturns(n,o,"Promise.using",E),n})),E=w.lastly((function(){var t=new e.PromiseInspection(w);return d(u,t)}));return u.promise=E,E._setOnCancel(u),E},e.prototype._setDisposable=function(e){this._bitField=131072|this._bitField,this._disposer=e},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(e){if("function"==typeof e)return new g(e,this,o());throw new c}}},5942:function(e,t,r){"use strict";var n=r(9571),o="undefined"==typeof navigator,i={e:{}},a,s="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==this?this:null;function c(){try{var e=a;return a=null,e.apply(this,arguments)}catch(e){return i.e=e,i}}function u(e){return a=e,c}var l=function(e,t){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=e,this.constructor$=t,t.prototype)r.call(t.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=t.prototype[n])}return n.prototype=t.prototype,e.prototype=new n,e.prototype};function f(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function h(e){return"function"==typeof e||"object"==typeof e&&null!==e}function p(e){return f(e)?new Error(C(e)):e}function d(e,t){var r,n=e.length,o=new Array(n+1);for(r=0;r<n;++r)o[r]=e[r];return o[r]=t,o}function m(e,t,r){if(!n.isES5)return{}.hasOwnProperty.call(e,t)?e[t]:void 0;var o=Object.getOwnPropertyDescriptor(e,t);return null!=o?null==o.get&&null==o.set?o.value:r:void 0}function g(e,t,r){if(f(e))return e;var o={value:r,configurable:!0,enumerable:!1,writable:!0};return n.defineProperty(e,t,o),e}function v(e){throw e}var y=function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1};if(n.isES5){var r=Object.getOwnPropertyNames;return function(e){for(var o=[],i=Object.create(null);null!=e&&!t(e);){var a;try{a=r(e)}catch(e){return o}for(var s=0;s<a.length;++s){var c=a[s];if(!i[c]){i[c]=!0;var u=Object.getOwnPropertyDescriptor(e,c);null!=u&&null==u.get&&null==u.set&&o.push(c)}}e=n.getPrototypeOf(e)}return o}}var o={}.hasOwnProperty;return function(r){if(t(r))return[];var n=[];e:for(var i in r)if(o.call(r,i))n.push(i);else{for(var a=0;a<e.length;++a)if(o.call(e[a],i))continue e;n.push(i)}return n}}(),_=/this\s*\.\s*\S+\s*=/;function b(e){try{if("function"==typeof e){var t=n.names(e.prototype),r=n.isES5&&t.length>1,o=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=_.test(e+"")&&n.names(e).length>0;if(r||o||i)return!0}return!1}catch(e){return!1}}function w(e){function t(){}t.prototype=e;var r=new t;function n(){return typeof r.foo}return n(),n(),e}var E=/^[a-z$_][a-z$_0-9]*$/i;function S(e){return E.test(e)}function A(e,t,r){for(var n=new Array(e),o=0;o<e;++o)n[o]=t+o+r;return n}function C(e){try{return e+""}catch(e){return"[no string representation]"}}function k(e){return e instanceof Error||null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name}function x(e){try{g(e,"isOperational",!0)}catch(e){}}function P(e){return null!=e&&(e instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===e.isOperational)}function I(e){return k(e)&&n.propertyIsWritable(e,"stack")}var T="stack"in new Error?function(e){return I(e)?e:new Error(C(e))}:function(e){if(I(e))return e;try{throw new Error(C(e))}catch(e){return e}};function O(e){return{}.toString.call(e)}function R(e,t,r){for(var o=n.names(e),i=0;i<o.length;++i){var a=o[i];if(r(a))try{n.defineProperty(t,a,n.getDescriptor(e,a))}catch(e){}}}var F=function(e){return n.isArray(e)?e:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var D="function"==typeof Array.from?function(e){return Array.from(e)}:function(e){for(var t,r=[],n=e[Symbol.iterator]();!(t=n.next()).done;)r.push(t.value);return r};F=function(e){return n.isArray(e)?e:null!=e&&"function"==typeof e[Symbol.iterator]?D(e):null}}var M="undefined"!=typeof process&&"[object process]"===O(process).toLowerCase(),N="undefined"!=typeof process&&void 0!==process.env,L;function j(e){return N?process.env[e]:void 0}function H(){if("function"==typeof Promise)try{if("[object Promise]"===O(new Promise((function(){}))))return Promise}catch(e){}}function B(e,t){if(null===e||"function"!=typeof t||t===L)return t;null!==e.domain&&(t=e.domain.bind(t));var r=e.async;if(null!==r){var n=t;t=function(){for(var e=arguments.length+2,t=new Array(e),o=2;o<e;++o)t[o]=arguments[o-2];return t[0]=n,t[1]=this,r.runInAsyncScope.apply(r,t)}}return t}var U={setReflectHandler:function(e){L=e},isClass:b,isIdentifier:S,inheritedDataKeys:y,getDataPropertyOrDefault:m,thrower:v,isArray:n.isArray,asArray:F,notEnumerableProp:g,isPrimitive:f,isObject:h,isError:k,canEvaluate:o,errorObj:i,tryCatch:u,inherits:l,withAppended:d,maybeWrapAsError:p,toFastProperties:w,filledRange:A,toString:C,canAttachTrace:I,ensureErrorObject:T,originatesFromRejection:P,markAsOriginatingFromRejection:x,classString:O,copyDescriptors:R,isNode:M,hasEnvVariables:N,env:j,global:s,getNativePromise:H,contextBind:B},z;U.isRecentNode=U.isNode&&(process.versions&&process.versions.node?z=process.versions.node.split(".").map(Number):process.version&&(z=process.version.split(".").map(Number)),0===z[0]&&z[1]>10||z[0]>0),U.nodeSupportsAsyncResource=U.isNode&&function(){var e=!1;try{e="function"==typeof r(852).AsyncResource.prototype.runInAsyncScope}catch(t){e=!1}return e}(),U.isNode&&U.toFastProperties(process);try{throw new Error}catch(e){U.lastLineError=e}e.exports=U},4435:(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")}},8411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debug=void 0;const n=r(2524);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}},2302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDisassembler=t.available=t.getCapstone=void 0;const n=r(9203),o=r(8744),i=Symbol.for("__capstone"),a=void 0!==typeof global?global:void 0!==typeof window?window:void 0;function s(){return a[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=s,t.available=function(){return a&&!!a[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=s();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(4435),o=r(2524),i=r(280),a=r(2302);function s(e,t,r){const i=(0,n.add)(t,r),a=[];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&&a.push(e);return a}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 f(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 h(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 p(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 d(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 s(e,r.addr,r.size)},t.getSymbolsInSegment=function(e,t){const r="number"==typeof t?e.segments[t]:t;return s(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=p(e,t);return r?l(e,r):[]},t.getSectionsAtVirtualMemoryLocation=f,t.getSectionsAtPhysicalMemoryLocation=function(e,t){const r=p(e,t);return r?f(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=h,t.physicalAddressToVirtual=p,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 d(e,t)[0]},t.getSectionsByName=d,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,a.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=h(e,o);if(i){const s=await r.view(t.size,i);if(s&&s.byteLength>0){const t=(0,a.getDisassembler)(e);if(t){const e="number"==typeof o?BigInt(o):o;return t.normal.disassemble(s,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[]}},5501:(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(1576),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))}},280: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},a=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 s=i(r(9091)),c=r(3366);t.open=function(e,t,r){let n;var o;return t||(t={}),e instanceof Uint8Array||e instanceof ArrayBuffer?n=(0,c.readElf)(s.buffer(e),t):e instanceof Array?n=(0,c.readElf)(s.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)(s.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)(s.asyncfile(e),t):function(e){return"object"==typeof e&&"number"==typeof e.size&&"function"==typeof e.arrayBuffer}(e)?(0,c.readElf)(s.blob(e),t):"string"==typeof e?(0,c.readElf)(s.file(e),t):new Promise((e=>{e({success:!1,errors:["unsupported input type"],warnings:[]})})),r&&n.then(r),n},a(r(9091),t),a(r(798),t),a(r(8744),t),a(r(8411),t)},3366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readElf=void 0;const n=r(1228),o=r(8744),i=r(8533),a=r(2524),s=r(798),c=r(4435);t.readElf=async function(e,t){var r,u;let l=!1;const f=[],h=[];let p,d;try{await e.open();const d=await e.size();if(d<=64)f.push("Not a valid ELF file. Too small.");else{const m=await e.view(16),g=1179403647;m.getInt32(0,!0)!==g&&h.push("Not a valid ELF file. The file does not start with 0x7f ELF.");const v=m.getUint8(4),y=m.getUint8(5),_=m.getUint8(6),b=m.getUint8(7),w=m.getUint8(8);if((v<1||v>2)&&f.push("Not a valid ELF file. Class is invalid"),(y<1||y>2)&&f.push("Not a valid ELF file. Endianness is invalid"),1!=_&&h.push("Not a valid ELF file. Version is invalid"),0==f.length){const h=1===v?32:64,m=1!==y,g=b,E=32==h?36:48,S=await e.view(E),A=e=>S.getUint16(e,!m),C=e=>S.getUint32(e,!m),k=e=>S.getBigUint64(e,!m);let x=0;const P=A(x);x+=2;const I=A(x);x+=2;const T=C(x);let O,R,F;x+=4,32===h?(O=C(x),x+=4,R=C(x),x+=4,F=C(x),x+=4):(O=k(x),x+=8,R=(0,c.toNumberSafe)(k(x)),x+=8,F=(0,c.toNumberSafe)(k(x)),x+=8);const D=C(x);x+=4;const M=A(x);x+=2;const N=A(x);x+=2;const L=A(x);x+=2;const j=A(x);x+=2;const H=A(x);x+=2;const B=A(x);if(x+=2,(32===h&&52!==M||64==h&&64!==M)&&f.push("Invalid ELF file. Unexpected header size"),(0!=L&&(R<M||R>d)||0!=H&&(F<M||F>d))&&f.push("Invalid ELF file. Invalid offsets"),0!=L&&(32==h&&N<32||64==h&&N<56||N>255)&&f.push("Invalid ELF file. Program header entry size invalid"),0!=H&&(32==h&&j<40||64==h&&j<64||N>255)&&f.push("Invalid ELF file. Section header entry size invalid"),0==f.length){const f=P,d=I,b=await(0,i.readProgramHeaderEntries)(e,R,N,L,h,m),E=await(0,a.readSectionHeaderEntries)(e,F,j,H,h,m,B,null!==(r=t.readSymbolData)&&void 0!==r&&r);p={path:e.path,class:v,classDescription:1==v?"ELF32":"ELF64",data:y,dataDescription:1==y?"Little endian":"Big endian",version:_,bits:h,abi:g,abiVersion:w,abiDescription:(0,n.abiToString)(g),isa:d,isaDescription:(0,n.isaToString)(d),isaVersion:T,type:f,typeDescription:(0,n.objectTypeToString)(f),flags:D,flagsDescription:(0,n.elfFlagsToString)(d,D),entryPoint:O,programHeaderOffset:R,programHeaderEntrySize:N,numProgramHeaderEntries:L,sectionHeaderOffset:F,sectionHeaderEntrySize:j,numSectionHeaderEntries:H,shstrIndex:B,segments:b,sections:E},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,a.isSymbolSection)(u))for(const a of u.symbols)if(i===o.ObjectType.Relocatable?a.shndx<e.sections.length?a.virtualAddress=(0,c.add)(a.value,e.sections[a.shndx].addr):65521==a.shndx&&(a.virtualAddress=a.value):a.virtualAddress=a.value,r&&a.virtualAddress&&(a.type===o.SymbolType.Function||a.type===o.SymbolType.Object)&&a.size){const r=(0,s.virtualAddressToFileOffset)(e,a.value);r&&r+a.size<=n&&(a.data=await t.read(a.size,r))}}(p,e,null!==(u=t.readSymbolData)&&void 0!==u&&u),l=!0}}}}catch(e){f.push(`Exception caught: ${e.toString()}`)}if(t.returnReader)d=e;else{d=void 0;try{e&&await e.close()}catch(e){f.push(`Exception caught: ${e.toString()}`)}}return{success:l,errors:f,warnings:h,elf:p,reader:d}}},9091: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 a=r(3292),s=i(r(7147)),c=i(r(1017));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 f(e,t,r){return new Promise(((n,o)=>{const i=new Uint8Array(t);s.read(e,i,0,t,null!=r?r:null,((e,r)=>{e?o(e):n(r<t?i.slice(0,r):i)}))}))}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function p(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 d(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(h)}}t.array=function(e){return d(Uint8Array.from(e))},t.buffer=d,t.asyncfile=function(e,t){if(!s)return p("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(h),size:()=>r.size,close:()=>r.ownshandle?r.fh.close():Promise.resolve()}},t.syncfile=function(e,t){if(!s)return p("No filesystem");const r={ownshandle:t,handle:e,size:0};return{open:()=>new Promise(((e,t)=>s.fstat(r.handle,((n,o)=>{n?t(n):(r.size=o.size,e())})))),read:(e,t)=>f(r.handle,e,t),view:(e,t)=>f(r.handle,e,t).then(h),size:()=>r.size,close:()=>new Promise(((e,t)=>{r.ownshandle?s.close(r.handle,(r=>{r?t(r):e()})):e()}))}},t.file=function(e){if(!s)return p("No filesystem");const t={path:e,fh:void 0,size:0};return{open:()=>(0,a.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(h),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(h)}}},2524:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRelocationSection=t.isSymbolSection=t.isStringSection=t.readSectionHeaderEntries=void 0;const n=r(8744),o=r(1228),i=r(4435),a=r(5501);function s(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,a.decode)(n,o,t)),o=e+1}return i}async function u(e,t,r,n,a,s){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,!a),f=e=>i.getUint32(e,!a),h=e=>i.getBigUint64(e,!a);let p,d,m,g,v,y,_=0;32==s?(p=f(_),_+=4,v=f(_),_+=4,y=f(_),_+=4,d=c(_),_+=1,m=c(_),_+=1,g=l(_),_+=2):(p=f(_),_+=4,d=c(_),_+=1,m=c(_),_+=1,g=l(_),_+=2,v=h(_),_+=8,y=Number(h(_)),_+=8);const b=15&d,w=d>>4,E=3&m;u[r]={nameix:p,name:"",info:d,other:m,shndx:g,value:v,size:y,type:b,binding:w,visibility:E,typeDescription:(0,o.symbolTypeToString)(b),bindingDescription:(0,o.symbolBindingToString)(w),visibilityDescription:(0,o.symbolVisibilityToString)(E)}}return u}async function l(e,t,r,n,o,a,s){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),f=e=>c.getBigUint64(e,!o),h=e=>c.getInt32(e,!o),p=e=>c.getBigInt64(e,!o);let d,m,g,v,y,_=0;32==a?(d=l(_),_+=4,m=l(_),_+=4,s&&(y=h(_),_+=4),g=m>>8,v=255&m):(d=f(_),_+=8,m=f(_),_+=8,s&&(y=p(_),_+=8),g=(0,i.toNumberSafe)(m>>BigInt(32)),v=(0,i.toNumberSafe)(m&BigInt(4294967295))),u[r]={addr:d,info:m,addend:y,symbolIndex:g,type:v}}return u}function f(e,t){if(t)for(let r=0;r<e.length;r++)e[r].name=s(t,e[r].nameix)||""}function h(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.StrTab}function p(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.DynSym||(null==e?void 0:e.type)===n.SectionHeaderEntryType.SymTab}function d(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,a,m,g,v,y){if(0==a)return[];const _=new Array(a);for(let n=0;n<a;n++){const a=await e.view(r,Number(t)+n*Number(r)),s=e=>a.getUint32(e,!g),c=e=>a.getBigUint64(e,!g),u=s(0),l=s(4);let f,h,p,d,v,y,b,w,E=8;32==m?(f=s(E),E+=4,h=s(E),E+=4,p=s(E),E+=4,d=s(E),E+=4,v=s(E),E+=4,y=s(E),E+=4,b=s(E),E+=4,w=s(E),E+=4):(f=(0,i.toNumberSafe)(c(E)),E+=8,h=c(E),E+=8,p=(0,i.toNumberSafe)(c(E)),E+=8,d=(0,i.toNumberSafe)(c(E)),E+=8,v=s(E),E+=4,y=s(E),E+=4,b=(0,i.toNumberSafe)(c(E)),E+=8,w=(0,i.toNumberSafe)(c(E)),E+=8);const S={index:n,name:"",nameix:u,type:l,typeDescription:(0,o.sectionHeaderEntryTypeToString)(l),flags:f,flagsDescription:(0,o.sectionFlagsToString)(f),addr:h,offset:p,size:d,link:v,info:y,addralign:b,entsize:w};_[n]=S}for(const t of _)if(h(t)){const{size:r,offset:n}=t;t.strings=await c(e,n,r)}for(const t of _){if(p(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<_.length){const e=_[i];h(e)&&f(t.symbols,e.strings)}}if(d(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(h(r)){const t=r.strings;t&&e.forEach((e=>{if(0==e.nameix)e.name="<null>";else{const r=s(t,e.nameix);r&&(e.name=r)}}))}}}(_,v),_},t.isStringSection=h,t.isSymbolSection=p,t.isRelocationSection=d},8533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readProgramHeaderEntries=void 0;const n=r(1228),o=r(4435);t.readProgramHeaderEntries=async function(e,t,r,i,a,s){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,!s),f=e=>i.getBigUint64(e,!s),h=l(0);let p,d,m,g,v,y,_,b=4;32==a?(d=l(b),b+=4,m=l(b),b+=4,g=l(b),b+=4,v=l(b),b+=4,y=l(b),b+=4,p=l(b),b+=4,_=l(b),b+=4):(p=l(b),b+=4,d=(0,o.toNumberSafe)(f(b)),b+=8,m=f(b),b+=8,g=f(b),b+=8,v=(0,o.toNumberSafe)(f(b)),b+=8,y=(0,o.toNumberSafe)(f(b)),b+=8,_=(0,o.toNumberSafe)(f(b)),b+=8),c[u]={index:u,type:h,typeDescription:(0,n.programHeaderEntryTypeToString)(h),flags:p,flagsDescription:(0,n.programHeaderFlagsToString)(p),offset:d,vaddr:m,paddr:g,filesz:v,memsz:y,align:_}}return c}},1228:(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(8744);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()}},8744:(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={}))},9397:(e,t)=>{!function(e){var t=/\S/,r=/\"/g,n=/\n/g,o=/\r/g,i=/\\/g,a=/\u2028/,s=/\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,a=null,s=null,f="",h=[],p=!1,d=0,m=0,g="{{",v="}}";function y(){f.length>0&&(h.push({tag:"_t",text:new String(f)}),f="")}function _(r,n){if(y(),r&&function(){for(var r=!0,n=m;n<h.length;n++)if(!(r=e.tags[h[n].tag]<e.tags._v||"_t"==h[n].tag&&null===h[n].text.match(t)))return!1;return r}())for(var o,i=m;i<h.length;i++)h[i].text&&((o=h[i+1])&&">"==o.tag&&(o.indent=h[i].text.toString()),h.splice(i,1));else n||h.push({tag:"\n"});p=!1,m=h.length}function b(e,t){var r="="+v,n=e.indexOf(r,t),o=u(e.substring(e.indexOf("=",t)+1,n)).split(" ");return g=o[0],v=o[o.length-1],n+r.length-1}for(n&&(n=n.split(" "),g=n[0],v=n[1]),d=0;d<o;d++)0==i?l(g,r,d)?(--d,y(),i=1):"\n"==r.charAt(d)?_(p):f+=r.charAt(d):1==i?(d+=g.length-1,"="==(a=(s=e.tags[r.charAt(d+1)])?r.charAt(d+1):"_v")?(d=b(r,d),i=0):(s&&d++,i=2),p=d):l(v,r,d)?(h.push({tag:a,n:u(f),otag:g,ctag:v,i:"/"==a?p-g.length:d+v.length}),f="",d+=v.length-1,i=0,"{"==a&&("}}"==v?d++:c(h[h.length-1]))):f+=r.charAt(d);return _(p,!0),h};var f={_t:!0,"\n":!0,$:!0,"/":!0};function h(t,r,n,o){var i,a=[],s=null,c=null;for(i=n[n.length-1];t.length>0;){if(c=t.shift(),i&&"<"==i.tag&&!(c.tag in f))throw new Error("Illegal content in < super tag.");if(e.tags[c.tag]<=e.tags.$||p(c,o))n.push(c),c.nodes=h(t,c.tag,n,o);else{if("/"==c.tag){if(0===n.length)throw new Error("Closing tag without opener: /"+c.n);if(s=n.pop(),c.n!=s.n&&!d(c.n,s.n,o))throw new Error("Nesting error: "+s.n+" vs. "+c.n);return s.end=c.i,a}"\n"==c.tag&&(c.last=0==t.length||"\n"==t[0].tag)}a.push(c)}if(n.length>0)throw new Error("missing closing tag: "+n.pop().n);return a}function p(e,t){for(var r=0,n=t.length;r<n;r++)if(t[r].o==e.n)return e.tag="#",!0}function d(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('"'+v(r)+'":{name:"'+v(e.partials[r].name)+'", '+m(e.partials[r])+"}");return"partials: {"+t.join(",")+"}, subs: "+function(e){var t=[];for(var r in e)t.push('"'+v(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 v(e){return e.replace(i,"\\\\").replace(r,'\\"').replace(n,"\\n").replace(o,"\\r").replace(a,"\\u2028").replace(s,"\\u2029")}function y(e){return~e.indexOf(".")?"d":"f"}function _(e,t){var r="<"+(t.prefix||"")+e.n+g++;return t.partials[r]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+v(r)+'",c,p,"'+(e.indent||"")+'"));',r}function b(e,t){t.code+="t.b(t.t(t."+y(e.n)+'("'+v(e.n)+'",c,p,0)));'}function w(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)+'("'+v(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)+'("'+v(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,r),r.code+="};"},">":_,"<":function(t,r){var n={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,n);var o=r.partials[_(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("'+v(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=w('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+y(e.n)+'("'+v(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=w('"'+v(e.text)+'"')},"{":b,"&":b},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 h(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 a in i)delete i[a].instance;return o}return o=this.generate(this.parse(this.scan(t,r.delimiters),t,r),t,r),this.cache[n]=o}}(t)},5485:(e,t,r)=>{var n=r(9397);n.Template=r(2882).Template,n.template=n.Template,e.exports=n},2882:(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),s.test(e)?e.replace(r,"&amp;").replace(n,"&lt;").replace(o,"&gt;").replace(i,"&#39;").replace(a,"&quot;"):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 a(){}function s(){}var c;a.prototype=e,s.prototype=e.subs;var u=new a;for(c in u.subs=new s,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,a){var s;return(!u(e)||0!==e.length)&&("function"==typeof e&&(e=this.ms(e,t,r,n,o,i,a)),s=!!e,!n&&s&&t&&t.push("object"==typeof e?e:t[t.length-1]),s)},d:function(e,r,n,o){var i,a=e.split("."),s=this.f(a[0],r,n,o),c=this.options.modelGet,l=null;if("."===e&&u(r[r.length-2]))s=r[r.length-1];else for(var f=1;f<a.length;f++)void 0!==(i=t(a[f],s,c))?(l=s,s=i):s="";return!(o&&!s)&&(o||"function"!=typeof s||(r.push(l),s=this.mv(s,r,n),r.pop()),s)},f:function(e,r,n,o){for(var i=!1,a=!1,s=this.options.modelGet,c=r.length-1;c>=0;c--)if(void 0!==(i=t(e,r[c],s))){a=!0;break}return a?(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,a){var s,c=t[t.length-1],u=e.call(c);return"function"==typeof u?!!n||(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(u,c,r,s.substring(o,i),a)):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,a=/\"/g,s=/[&<>\"\']/;function c(e){return String(null==e?"":e)}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}(t)},5405:(e,t,r)=>{var n=r(8887),o=r(6325),i=65536,a=15,s=h(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,f={4:65536,5:262144,6:1048576,7:4194304};function h(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 p(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,a=0;i<r;)o[a++]=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),a=e[t++]>>4&7;if(void 0===f[a])throw new Error("invalid block size "+a);var s=f[a];if(i)return o.readU64(e,t);t++;for(var c=0;;){var h=o.readU32(e,t);if(t+=4,c+=h&l?h&=2147483647:s,0===h)return c;n&&(t+=4),t+=h}},t.makeBuffer=h,t.decompressBlock=function(e,t,r,n,o){var i,a,s,c,u;for(s=r+n;r<s;){var l=e[r++],f=l>>4;if(f>0){if(15===f)for(;f+=e[r],255===e[r++];);for(c=r+f;r<c;)t[o++]=e[r++]}if(r>=s)break;if(i=15&l,a=e[r++]|e[r++]<<8,15===i)for(;i+=e[r],255===e[r++];);for(c=(u=o-a)+(i+=4);u<c;)t[o++]=0|t[u++]}return o},t.compressBlock=function(e,t,r,n,i){var s,c,u,l,f,h,p,d;if(h=0,p=n+r,c=r,n>=13)for(var m=67;r+4<p-5;){var g=o.readU32(e,r),v=o.hashU32(g)>>>0;if(s=i[v=(v>>16^v)>>>0&65535]-1,i[v]=r+1,s<0||r-s>>>16>0||o.readU32(e,s)!==g)r+=m++>>6;else{for(m=67,f=r-c,l=r-s,s+=4,u=r+=4;r<p-5&&e[r]===e[s];)r++,s++;var y=(u=r-u)<15?u:15;if(f>=a){for(t[h++]=240+y,d=f-a;d>=255;d-=255)t[h++]=255;t[h++]=d}else t[h++]=(f<<4)+y;for(var _=0;_<f;_++)t[h++]=e[c+_];if(t[h++]=l,t[h++]=l>>8,u>=15){for(d=u-15;d>=255;d-=255)t[h++]=255;t[h++]=d}c=r}}if(0===c)return 0;if((f=p-c)>=a){for(t[h++]=240,d=f-a;d>=255;d-=255)t[h++]=255;t[h++]=d}else t[h++]=f<<4;for(r=c;r<p;)t[h++]=e[r++];return h},t.decompressFrame=function(e,r){var n,i,a,s,c=0,h=0;if(o.readU32(e,c)!==u)throw new Error("invalid magic number");if(c+=4,64!=(192&(s=e[c++])))throw new Error("incompatible descriptor version");n=0!=(16&s),i=0!=(4&s),a=0!=(8&s);var p=e[c++]>>4&7;if(void 0===f[p])throw new Error("invalid block size");for(a&&(c+=8),c++;;){var d;if(d=o.readU32(e,c),c+=4,0===d)break;if(n&&(c+=4),0!=(d&l)){d&=2147483647;for(var m=0;m<d;m++)r[h++]=e[c++]}else h=t.decompressBlock(e,r,c,d,h),c+=d}return i&&(c+=4),h},t.compressFrame=function(e,r){var a=0;o.writeU32(r,a,u),a+=4,r[a++]=64,r[a++]=112,r[a]=n.hash(0,r,4,a-4)>>8,a++;var l=f[7],h=e.length,p=0;for(!function(e){for(var t=0;t<i;t++)c[t]=0}();h>0;){var d,m=h>l?l:h;if((d=t.compressBlock(e,s,p,m,c))>m||0===d){o.writeU32(r,a,2147483648|m),a+=4;for(var g=p+m;p<g;)r[a++]=e[p++];h-=m}else{o.writeU32(r,a,d),a+=4;for(var v=0;v<d;)r[a++]=s[v++];p+=m,h-=m}}return o.writeU32(r,a,0),a+=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=p(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=p(n,0,o)),n}},6325:(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}},8887:(e,t,r)=>{var n=r(6325),o=2654435761,i=2246822519,a=3266489917,s=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 f(e,t,r,o,i){return u(n.imul(t,r)+e,o,i)}function h(e,t,r){return u(e+n.imul(t[r],s),11,o)}function p(e,t,r){return f(e,n.readU32(t,r),a,17,668265263)}function d(e,t,r){return[f(e[0],n.readU32(t,r+0),i,13,o),f(e[1],n.readU32(t,r+4),i,13,o),f(e[2],n.readU32(t,r+8),i,13,o),f(e[3],n.readU32(t,r+12),i,13,o)]}t.hash=function(e,t,r,u){var f,m;if(m=u,u>=16){for(f=[e+o+i,e+i,e,e-o];u>=16;)f=d(f,t,r),r+=16,u-=16;f=c(f[0],1)+c(f[1],7)+c(f[2],12)+c(f[3],18)+m}else f=e+s+u>>>0;for(;u>=4;)f=p(f,t,r),r+=4,u-=4;for(;u>0;)f=h(f,t,r),r++,u--;return(f=l(n.imul(l(n.imul(l(f,15),i),13),a),16))>>>0}},7475:(e,t,r)=>{var n=r(5485);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("ENTRY(_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(" KEEP(*(.rodata.eadk_api_level))"),n.b("\n"+r),n.b(" LONG(ADDR(.rodata.eadk_app_name) - ORIGIN(FLASH));"),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(_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(" . = ALIGN(4);"),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.eadk_app_name : {"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_app_name))"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata.eadk_app_icon : {"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_app_icon))"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata : {"),n.b("\n"+r),n.b(" *(.rodata)"),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.*)"),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.*)"),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.b("\n"+r),n.b('ASSERT(SIZEOF(.eadk_app_info) == 32, "Missing api level. Please define a .rodata.eadk_api_level section.");'),n.b("\n"+r),n.b('ASSERT(SIZEOF(.rodata.eadk_app_name) > 0, "Missing app name. Please define a .rodata.eadk_app_name section.");'),n.b("\n"+r),n.b('ASSERT(SIZEOF(.rodata.eadk_app_icon) > 0, "Missing app icon. Please define a .rodata.eadk_app_icon section.");'),n.b("\n"),n.fl()},partials:{},subs:{}},'MEMORY {\n FLASH (rx) : ORIGIN = {{ flashStart }}, LENGTH = {{ flashLength }}\n RAM (rwx) : ORIGIN = {{ ramStart }}, LENGTH = {{ ramLength }}\n}\n\nENTRY(_start);\n\nSECTIONS {\n .eadk_app_info ORIGIN(FLASH) : {\n LONG(0xDEC0BEBA);\n KEEP(*(.rodata.eadk_api_level))\n LONG(ADDR(.rodata.eadk_app_name) - ORIGIN(FLASH));\n LONG(SIZEOF(.rodata.eadk_app_icon));\n LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));\n LONG(_start - ORIGIN(FLASH));\n LONG(_eadk_app_end - ORIGIN(FLASH));\n LONG(0xDEC0BEBA);\n } >FLASH\n\n .text : {\n . = ALIGN(4);\n *(.text)\n *(.text.*)\n } >FLASH\n\n .rodata.eadk_app_name : {\n KEEP(*(.rodata.eadk_app_name))\n } >FLASH\n\n .rodata.eadk_app_icon : {\n KEEP(*(.rodata.eadk_app_icon))\n } >FLASH\n\n .rodata : {\n *(.rodata)\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.*)\n _data_section_end_ram = .;\n } >RAM AT >FLASH\n\n .bss : {\n . = ALIGN(4);\n _bss_section_start_ram = .;\n *(.bss)\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\nASSERT(SIZEOF(.eadk_app_info) == 32, "Missing api level. Please define a .rodata.eadk_api_level section.");\nASSERT(SIZEOF(.rodata.eadk_app_name) > 0, "Missing app name. Please define a .rodata.eadk_app_name section.");\nASSERT(SIZEOF(.rodata.eadk_app_icon) > 0, "Missing app icon. Please define a .rodata.eadk_app_icon section.");\n',n);return e.render.apply(e,arguments)}},9983:(e,t,r)=>{"use strict";let n=r(7084),o=[function(){},function(e,t,r,n){if(n===t.length)throw new Error("Ran out of data");let o=t[n];e[r]=o,e[r+1]=o,e[r+2]=o,e[r+3]=255},function(e,t,r,n){if(n+1>=t.length)throw new Error("Ran out of data");let o=t[n];e[r]=o,e[r+1]=o,e[r+2]=o,e[r+3]=t[n+1]},function(e,t,r,n){if(n+2>=t.length)throw new Error("Ran out of data");e[r]=t[n],e[r+1]=t[n+1],e[r+2]=t[n+2],e[r+3]=255},function(e,t,r,n){if(n+3>=t.length)throw new Error("Ran out of data");e[r]=t[n],e[r+1]=t[n+1],e[r+2]=t[n+2],e[r+3]=t[n+3]}],i=[function(){},function(e,t,r,n){let o=t[0];e[r]=o,e[r+1]=o,e[r+2]=o,e[r+3]=n},function(e,t,r){let n=t[0];e[r]=n,e[r+1]=n,e[r+2]=n,e[r+3]=t[1]},function(e,t,r,n){e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2],e[r+3]=n},function(e,t,r){e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2],e[r+3]=t[3]}];function a(e,t,r,n,i,a){let s=e.width,c=e.height,u=e.index;for(let e=0;e<c;e++)for(let c=0;c<s;c++){let s=r(c,e,u);o[n](t,i,s,a),a+=n}return a}function s(e,t,r,n,o,a){let s=e.width,c=e.height,u=e.index;for(let e=0;e<c;e++){for(let c=0;c<s;c++){let s=o.get(n),l=r(c,e,u);i[n](t,s,l,a)}o.resetAfterLine()}}t.dataToBitMap=function(e,t){let r,o,i=t.width,c=t.height,u=t.depth,l=t.bpp,f=t.interlace;8!==u&&(r=function(e,t){let r=[],n=0;function o(){if(n===e.length)throw new Error("Ran out of data");let o,i,a,s,c,u,l,f,h=e[n];switch(n++,t){default:throw new Error("unrecognised depth");case 16:l=e[n],n++,r.push((h<<8)+l);break;case 4:l=15&h,f=h>>4,r.push(f,l);break;case 2:c=3&h,u=h>>2&3,l=h>>4&3,f=h>>6&3,r.push(f,l,u,c);break;case 1:o=1&h,i=h>>1&1,a=h>>2&1,s=h>>3&1,c=h>>4&1,u=h>>5&1,l=h>>6&1,f=h>>7&1,r.push(f,l,u,c,s,a,i,o)}}return{get:function(e){for(;r.length<e;)o();let t=r.slice(0,e);return r=r.slice(e),t},resetAfterLine:function(){r.length=0},end:function(){if(n!==e.length)throw new Error("extra data found")}}}(e,u)),o=u<=8?Buffer.alloc(i*c*4):new Uint16Array(i*c*4);let h,p,d=Math.pow(2,u)-1,m=0;if(f)h=n.getImagePasses(i,c),p=n.getInterlaceIterator(i,c);else{let e=0;p=function(){let t=e;return e+=4,t},h=[{width:i,height:c}]}for(let t=0;t<h.length;t++)8===u?m=a(h[t],o,p,l,e,m):s(h[t],o,p,l,r,d);if(8===u){if(m!==e.length)throw new Error("extra data found")}else r.end();return o}},9027:(e,t,r)=>{"use strict";let n=r(3482);e.exports=function(e,t,r,o){let i=-1!==[n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(o.colorType);if(o.colorType===o.inputColorType){let t=function(){let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256!==new Int16Array(e)[0]}();if(8===o.bitDepth||16===o.bitDepth&&t)return e}let a=16!==o.bitDepth?e:new Uint16Array(e.buffer),s=255,c=n.COLORTYPE_TO_BPP_MAP[o.inputColorType];4!==c||o.inputHasAlpha||(c=3);let u=n.COLORTYPE_TO_BPP_MAP[o.colorType];16===o.bitDepth&&(s=65535,u*=2);let l=Buffer.alloc(t*r*u),f=0,h=0,p=o.bgColor||{};function d(){let e,t,r,c=s;switch(o.inputColorType){case n.COLORTYPE_COLOR_ALPHA:c=a[f+3],e=a[f],t=a[f+1],r=a[f+2];break;case n.COLORTYPE_COLOR:e=a[f],t=a[f+1],r=a[f+2];break;case n.COLORTYPE_ALPHA:c=a[f+1],e=a[f],t=e,r=e;break;case n.COLORTYPE_GRAYSCALE:e=a[f],t=e,r=e;break;default:throw new Error("input color type:"+o.inputColorType+" is not supported at present")}return o.inputHasAlpha&&(i||(c/=s,e=Math.min(Math.max(Math.round((1-c)*p.red+c*e),0),s),t=Math.min(Math.max(Math.round((1-c)*p.green+c*t),0),s),r=Math.min(Math.max(Math.round((1-c)*p.blue+c*r),0),s))),{red:e,green:t,blue:r,alpha:c}}void 0===p.red&&(p.red=s),void 0===p.green&&(p.green=s),void 0===p.blue&&(p.blue=s);for(let e=0;e<r;e++)for(let e=0;e<t;e++){let e=d();switch(o.colorType){case n.COLORTYPE_COLOR_ALPHA:case n.COLORTYPE_COLOR:8===o.bitDepth?(l[h]=e.red,l[h+1]=e.green,l[h+2]=e.blue,i&&(l[h+3]=e.alpha)):(l.writeUInt16BE(e.red,h),l.writeUInt16BE(e.green,h+2),l.writeUInt16BE(e.blue,h+4),i&&l.writeUInt16BE(e.alpha,h+6));break;case n.COLORTYPE_ALPHA:case n.COLORTYPE_GRAYSCALE:{let t=(e.red+e.green+e.blue)/3;8===o.bitDepth?(l[h]=t,i&&(l[h+1]=e.alpha)):(l.writeUInt16BE(t,h),i&&l.writeUInt16BE(e.alpha,h+2));break}default:throw new Error("unrecognised color Type "+o.colorType)}f+=c,h+=u}return l}},8442:(e,t,r)=>{"use strict";let n=r(3837),o=r(2781),i=e.exports=function(){o.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};n.inherits(i,o),i.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},i.prototype.write=function(e,t){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let r;return r=Buffer.isBuffer(e)?e:Buffer.from(e,t||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused},i.prototype.end=function(e,t){e&&this.write(e,t),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},i.prototype.destroySoon=i.prototype.end,i.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},i.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},i.prototype._processReadAllowingLess=function(e){this._reads.shift();let t=this._buffers[0];t.length>e.length?(this._buffered-=e.length,this._buffers[0]=t.slice(e.length),e.func.call(this,t.slice(0,e.length))):(this._buffered-=t.length,this._buffers.shift(),e.func.call(this,t))},i.prototype._processRead=function(e){this._reads.shift();let t=0,r=0,n=Buffer.alloc(e.length);for(;t<e.length;){let o=this._buffers[r++],i=Math.min(o.length,e.length-t);o.copy(n,t,0,i),t+=i,i!==o.length&&(this._buffers[--r]=o.slice(i))}r>0&&this._buffers.splice(0,r),this._buffered-=e.length,e.func.call(this,n)},i.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let e=this._reads[0];if(e.allowLess)this._processReadAllowingLess(e);else{if(!(this._buffered>=e.length))break;this._processRead(e)}}this._buffers&&!this.writable&&this._end()}catch(e){this.emit("error",e)}}},3482:e=>{"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},3500:e=>{"use strict";let t=[];!function(){for(let e=0;e<256;e++){let r=e;for(let e=0;e<8;e++)1&r?r=3988292384^r>>>1:r>>>=1;t[e]=r}}();let r=e.exports=function(){this._crc=-1};r.prototype.write=function(e){for(let r=0;r<e.length;r++)this._crc=t[255&(this._crc^e[r])]^this._crc>>>8;return!0},r.prototype.crc32=function(){return-1^this._crc},r.crc32=function(e){let r=-1;for(let n=0;n<e.length;n++)r=t[255&(r^e[n])]^r>>>8;return-1^r}},8876:(e,t,r)=>{"use strict";let n=r(6744);let o={0:function(e,t,r,n,o){for(let i=0;i<r;i++)n[o+i]=e[t+i]},1:function(e,t,r,n,o,i){for(let a=0;a<r;a++){let r=a>=i?e[t+a-i]:0,s=e[t+a]-r;n[o+a]=s}},2:function(e,t,r,n,o){for(let i=0;i<r;i++){let a=t>0?e[t+i-r]:0,s=e[t+i]-a;n[o+i]=s}},3:function(e,t,r,n,o,i){for(let a=0;a<r;a++){let s=a>=i?e[t+a-i]:0,c=t>0?e[t+a-r]:0,u=e[t+a]-(s+c>>1);n[o+a]=u}},4:function(e,t,r,o,i,a){for(let s=0;s<r;s++){let c=s>=a?e[t+s-a]:0,u=t>0?e[t+s-r]:0,l=t>0&&s>=a?e[t+s-(r+a)]:0,f=e[t+s]-n(c,u,l);o[i+s]=f}}},i={0:function(e,t,r){let n=0,o=t+r;for(let r=t;r<o;r++)n+=Math.abs(e[r]);return n},1:function(e,t,r,n){let o=0;for(let i=0;i<r;i++){let r=i>=n?e[t+i-n]:0,a=e[t+i]-r;o+=Math.abs(a)}return o},2:function(e,t,r){let n=0,o=t+r;for(let i=t;i<o;i++){let o=t>0?e[i-r]:0,a=e[i]-o;n+=Math.abs(a)}return n},3:function(e,t,r,n){let o=0;for(let i=0;i<r;i++){let a=i>=n?e[t+i-n]:0,s=t>0?e[t+i-r]:0,c=e[t+i]-(a+s>>1);o+=Math.abs(c)}return o},4:function(e,t,r,o){let i=0;for(let a=0;a<r;a++){let s=a>=o?e[t+a-o]:0,c=t>0?e[t+a-r]:0,u=t>0&&a>=o?e[t+a-(r+o)]:0,l=e[t+a]-n(s,c,u);i+=Math.abs(l)}return i}};e.exports=function(e,t,r,n,a){let s;if("filterType"in n&&-1!==n.filterType){if("number"!=typeof n.filterType)throw new Error("unrecognised filter types");s=[n.filterType]}else s=[0,1,2,3,4];16===n.bitDepth&&(a*=2);let c=t*a,u=0,l=0,f=Buffer.alloc((c+1)*r),h=s[0];for(let t=0;t<r;t++){if(s.length>1){let t=1/0;for(let r=0;r<s.length;r++){let n=i[s[r]](e,l,c,a);n<t&&(h=s[r],t=n)}}f[u]=h,u++,o[h](e,l,c,f,u,a),u+=c,l+=c}return f}},4603:(e,t,r)=>{"use strict";let n=r(3837),o=r(8442),i=r(2769),a=e.exports=function(e){o.call(this);let t=[],r=this;this._filter=new i(e,{read:this.read.bind(this),write:function(e){t.push(e)},complete:function(){r.emit("complete",Buffer.concat(t))}}),this._filter.start()};n.inherits(a,o)},8692:(e,t,r)=>{"use strict";let n=r(33),o=r(2769);t.process=function(e,t){let r=[],i=new n(e);return new o(t,{read:i.read.bind(i),write:function(e){r.push(e)},complete:function(){}}).start(),i.process(),Buffer.concat(r)}},2769:(e,t,r)=>{"use strict";let n=r(7084),o=r(6744);function i(e,t,r){let n=e*t;return 8!==r&&(n=Math.ceil(n/(8/r))),n}let a=e.exports=function(e,t){let r=e.width,o=e.height,a=e.interlace,s=e.bpp,c=e.depth;if(this.read=t.read,this.write=t.write,this.complete=t.complete,this._imageIndex=0,this._images=[],a){let e=n.getImagePasses(r,o);for(let t=0;t<e.length;t++)this._images.push({byteWidth:i(e[t].width,s,c),height:e[t].height,lineIndex:0})}else this._images.push({byteWidth:i(r,s,c),height:o,lineIndex:0});this._xComparison=8===c?s:16===c?2*s:1};a.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},a.prototype._unFilterType1=function(e,t,r){let n=this._xComparison,o=n-1;for(let i=0;i<r;i++){let r=e[1+i],a=i>o?t[i-n]:0;t[i]=r+a}},a.prototype._unFilterType2=function(e,t,r){let n=this._lastLine;for(let o=0;o<r;o++){let r=e[1+o],i=n?n[o]:0;t[o]=r+i}},a.prototype._unFilterType3=function(e,t,r){let n=this._xComparison,o=n-1,i=this._lastLine;for(let a=0;a<r;a++){let r=e[1+a],s=i?i[a]:0,c=a>o?t[a-n]:0,u=Math.floor((c+s)/2);t[a]=r+u}},a.prototype._unFilterType4=function(e,t,r){let n=this._xComparison,i=n-1,a=this._lastLine;for(let s=0;s<r;s++){let r=e[1+s],c=a?a[s]:0,u=s>i?t[s-n]:0,l=s>i&&a?a[s-n]:0,f=o(u,c,l);t[s]=r+f}},a.prototype._reverseFilterLine=function(e){let t,r=e[0],n=this._images[this._imageIndex],o=n.byteWidth;if(0===r)t=e.slice(1,o+1);else switch(t=Buffer.alloc(o),r){case 1:this._unFilterType1(e,t,o);break;case 2:this._unFilterType2(e,t,o);break;case 3:this._unFilterType3(e,t,o);break;case 4:this._unFilterType4(e,t,o);break;default:throw new Error("Unrecognised filter type - "+r)}this.write(t),n.lineIndex++,n.lineIndex>=n.height?(this._lastLine=null,this._imageIndex++,n=this._images[this._imageIndex]):this._lastLine=t,n?this.read(n.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}},8417:e=>{"use strict";e.exports=function(e,t,r=!1){let n=t.depth,o=t.width,i=t.height,a=t.colorType,s=t.transColor,c=t.palette,u=e;return 3===a?function(e,t,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=o[e[i]];if(!r)throw new Error("index "+e[i]+" not in palette");for(let e=0;e<4;e++)t[i+e]=r[e];i+=4}}(e,u,o,i,c):(s&&function(e,t,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=!1;if(1===o.length?o[0]===e[i]&&(r=!0):o[0]===e[i]&&o[1]===e[i+1]&&o[2]===e[i+2]&&(r=!0),r)for(let e=0;e<4;e++)t[i+e]=0;i+=4}}(e,u,o,i,s),8===n||r||(16===n&&(u=Buffer.alloc(o*i*4)),function(e,t,r,n,o){let i=Math.pow(2,o)-1,a=0;for(let o=0;o<n;o++)for(let n=0;n<r;n++){for(let r=0;r<4;r++)t[a+r]=Math.floor(255*e[a+r]/i+.5);a+=4}}(e,u,o,i,n))),u}},7084:(e,t)=>{"use strict";let r=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];t.getImagePasses=function(e,t){let n=[],o=e%8,i=t%8,a=(e-o)/8,s=(t-i)/8;for(let e=0;e<r.length;e++){let t=r[e],c=a*t.x.length,u=s*t.y.length;for(let e=0;e<t.x.length&&t.x[e]<o;e++)c++;for(let e=0;e<t.y.length&&t.y[e]<i;e++)u++;c>0&&u>0&&n.push({width:c,height:u,index:e})}return n},t.getInterlaceIterator=function(e){return function(t,n,o){let i=t%r[o].x.length,a=(t-i)/r[o].x.length*8+r[o].x[i],s=n%r[o].y.length;return 4*a+((n-s)/r[o].y.length*8+r[o].y[s])*e*4}}},6838:(e,t,r)=>{"use strict";let n=r(3837),o=r(2781),i=r(3482),a=r(9432),s=e.exports=function(e){o.call(this);let t=e||{};this._packer=new a(t),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(s,o),s.prototype.pack=function(e,t,r,n){this.emit("data",Buffer.from(i.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(t,r)),n&&this.emit("data",this._packer.packGAMA(n));let o=this._packer.filterData(e,t,r);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(e){this.emit("data",this._packer.packIDAT(e))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(o)}},8360:(e,t,r)=>{"use strict";let n=!0,o=r(9796);o.deflateSync||(n=!1);let i=r(3482),a=r(9432);e.exports=function(e,t){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r=new a(t||{}),s=[];s.push(Buffer.from(i.PNG_SIGNATURE)),s.push(r.packIHDR(e.width,e.height)),e.gamma&&s.push(r.packGAMA(e.gamma));let c=r.filterData(e.data,e.width,e.height),u=o.deflateSync(c,r.getDeflateOptions());if(c=null,!u||!u.length)throw new Error("bad png - invalid compressed data response");return s.push(r.packIDAT(u)),s.push(r.packIEND()),Buffer.concat(s)}},9432:(e,t,r)=>{"use strict";let n=r(3482),o=r(3500),i=r(9027),a=r(8876),s=r(9796),c=e.exports=function(e){if(this._options=e,e.deflateChunkSize=e.deflateChunkSize||32768,e.deflateLevel=null!=e.deflateLevel?e.deflateLevel:9,e.deflateStrategy=null!=e.deflateStrategy?e.deflateStrategy:3,e.inputHasAlpha=null==e.inputHasAlpha||e.inputHasAlpha,e.deflateFactory=e.deflateFactory||s.createDeflate,e.bitDepth=e.bitDepth||8,e.colorType="number"==typeof e.colorType?e.colorType:n.COLORTYPE_COLOR_ALPHA,e.inputColorType="number"==typeof e.inputColorType?e.inputColorType:n.COLORTYPE_COLOR_ALPHA,-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(e.colorType))throw new Error("option color type:"+e.colorType+" is not supported at present");if(-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(e.inputColorType))throw new Error("option input color type:"+e.inputColorType+" is not supported at present");if(8!==e.bitDepth&&16!==e.bitDepth)throw new Error("option bit depth:"+e.bitDepth+" is not supported at present")};c.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},c.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},c.prototype.filterData=function(e,t,r){let o=i(e,t,r,this._options),s=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return a(o,t,r,this._options,s)},c.prototype._packChunk=function(e,t){let r=t?t.length:0,n=Buffer.alloc(r+12);return n.writeUInt32BE(r,0),n.writeUInt32BE(e,4),t&&t.copy(n,8),n.writeInt32BE(o.crc32(n.slice(4,n.length-4)),n.length-4),n},c.prototype.packGAMA=function(e){let t=Buffer.alloc(4);return t.writeUInt32BE(Math.floor(e*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,t)},c.prototype.packIHDR=function(e,t){let r=Buffer.alloc(13);return r.writeUInt32BE(e,0),r.writeUInt32BE(t,4),r[8]=this._options.bitDepth,r[9]=this._options.colorType,r[10]=0,r[11]=0,r[12]=0,this._packChunk(n.TYPE_IHDR,r)},c.prototype.packIDAT=function(e){return this._packChunk(n.TYPE_IDAT,e)},c.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}},6744:e=>{"use strict";e.exports=function(e,t,r){let n=e+t-r,o=Math.abs(n-e),i=Math.abs(n-t),a=Math.abs(n-r);return o<=i&&o<=a?e:i<=a?t:r}},7900:(e,t,r)=>{"use strict";let n=r(3837),o=r(9796),i=r(8442),a=r(4603),s=r(8550),c=r(9983),u=r(8417),l=e.exports=function(e){i.call(this),this._parser=new s(e,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=e,this.writable=!0,this._parser.start()};n.inherits(l,i),l.prototype._handleError=function(e){this.emit("error",e),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",(function(){}))),this.errord=!0},l.prototype._inflateData=function(e){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=o.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let e=(1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3))*this._bitmapInfo.height,t=Math.max(e,o.Z_MIN_CHUNK);this._inflate=o.createInflate({chunkSize:t});let r=e,n=this.emit.bind(this,"error");this._inflate.on("error",(function(e){r&&n(e)})),this._filter.on("complete",this._complete.bind(this));let i=this._filter.write.bind(this._filter);this._inflate.on("data",(function(e){r&&(e.length>r&&(e=e.slice(0,r)),r-=e.length,i(e))})),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(e)},l.prototype._handleMetaData=function(e){this._metaData=e,this._bitmapInfo=Object.create(e),this._filter=new a(this._bitmapInfo)},l.prototype._handleTransColor=function(e){this._bitmapInfo.transColor=e},l.prototype._handlePalette=function(e){this._bitmapInfo.palette=e},l.prototype._simpleTransparency=function(){this._metaData.alpha=!0},l.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},l.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},l.prototype._complete=function(e){if(this.errord)return;let t;try{let r=c.dataToBitMap(e,this._bitmapInfo);t=u(r,this._bitmapInfo,this._options.skipRescale),r=null}catch(e){return void this._handleError(e)}this.emit("parsed",t)}},2416:(e,t,r)=>{"use strict";let n=!0,o=r(9796),i=r(9653);o.deflateSync||(n=!1);let a=r(33),s=r(8692),c=r(8550),u=r(9983),l=r(8417);e.exports=function(e,t){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r,f,h;let p=[];let d=new a(e),m=new c(t,{read:d.read.bind(d),error:function(e){r=e},metadata:function(e){f=e},gamma:function(e){h=e},palette:function(e){f.palette=e},transColor:function(e){f.transColor=e},inflateData:function(e){p.push(e)},simpleTransparency:function(){f.alpha=!0}});if(m.start(),d.process(),r)throw r;let g,v=Buffer.concat(p);if(p.length=0,f.interlace)g=o.inflateSync(v);else{let e=(1+(f.width*f.bpp*f.depth+7>>3))*f.height;g=i(v,{chunkSize:e,maxLength:e})}if(v=null,!g||!g.length)throw new Error("bad png - invalid inflate data response");let y=s.process(g,f);v=null;let _=u.dataToBitMap(y,f);y=null;let b=l(_,f,t.skipRescale);return f.data=b,f.gamma=h||0,f}},8550:(e,t,r)=>{"use strict";let n=r(3482),o=r(3500),i=e.exports=function(e,t){this._options=e,e.checkCRC=!1!==e.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=t.read,this.error=t.error,this.metadata=t.metadata,this.gamma=t.gamma,this.transColor=t.transColor,this.palette=t.palette,this.parsed=t.parsed,this.inflateData=t.inflateData,this.finished=t.finished,this.simpleTransparency=t.simpleTransparency,this.headersFinished=t.headersFinished||function(){}};i.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},i.prototype._parseSignature=function(e){let t=n.PNG_SIGNATURE;for(let r=0;r<t.length;r++)if(e[r]!==t[r])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},i.prototype._parseChunkBegin=function(e){let t=e.readUInt32BE(0),r=e.readUInt32BE(4),i="";for(let t=4;t<8;t++)i+=String.fromCharCode(e[t]);let a=Boolean(32&e[4]);if(this._hasIHDR||r===n.TYPE_IHDR){if(this._crc=new o,this._crc.write(Buffer.from(i)),this._chunks[r])return this._chunks[r](t);a?this.read(t+4,this._skipChunk.bind(this)):this.error(new Error("Unsupported critical chunk type "+i))}else this.error(new Error("Expected IHDR on beggining"))},i.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},i.prototype._parseChunkEnd=function(e){let t=e.readInt32BE(0),r=this._crc.crc32();this._options.checkCRC&&r!==t?this.error(new Error("Crc error - "+t+" - "+r)):this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleIHDR=function(e){this.read(e,this._parseIHDR.bind(this))},i.prototype._parseIHDR=function(e){this._crc.write(e);let t=e.readUInt32BE(0),r=e.readUInt32BE(4),o=e[8],i=e[9],a=e[10],s=e[11],c=e[12];if(8!==o&&4!==o&&2!==o&&1!==o&&16!==o)return void this.error(new Error("Unsupported bit depth "+o));if(!(i in n.COLORTYPE_TO_BPP_MAP))return void this.error(new Error("Unsupported color type"));if(0!==a)return void this.error(new Error("Unsupported compression method"));if(0!==s)return void this.error(new Error("Unsupported filter method"));if(0!==c&&1!==c)return void this.error(new Error("Unsupported interlace method"));this._colorType=i;let u=n.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:t,height:r,depth:o,interlace:Boolean(c),palette:Boolean(i&n.COLORTYPE_PALETTE),color:Boolean(i&n.COLORTYPE_COLOR),alpha:Boolean(i&n.COLORTYPE_ALPHA),bpp:u,colorType:i}),this._handleChunkEnd()},i.prototype._handlePLTE=function(e){this.read(e,this._parsePLTE.bind(this))},i.prototype._parsePLTE=function(e){this._crc.write(e);let t=Math.floor(e.length/3);for(let r=0;r<t;r++)this._palette.push([e[3*r],e[3*r+1],e[3*r+2],255]);this.palette(this._palette),this._handleChunkEnd()},i.prototype._handleTRNS=function(e){this.simpleTransparency(),this.read(e,this._parseTRNS.bind(this))},i.prototype._parseTRNS=function(e){if(this._crc.write(e),this._colorType===n.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(e.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(let t=0;t<e.length;t++)this._palette[t][3]=e[t];this.palette(this._palette)}this._colorType===n.COLORTYPE_GRAYSCALE&&this.transColor([e.readUInt16BE(0)]),this._colorType===n.COLORTYPE_COLOR&&this.transColor([e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt16BE(4)]),this._handleChunkEnd()},i.prototype._handleGAMA=function(e){this.read(e,this._parseGAMA.bind(this))},i.prototype._parseGAMA=function(e){this._crc.write(e),this.gamma(e.readUInt32BE(0)/n.GAMMA_DIVISION),this._handleChunkEnd()},i.prototype._handleIDAT=function(e){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-e,this._parseIDAT.bind(this,e))},i.prototype._parseIDAT=function(e,t){if(this._crc.write(t),this._colorType===n.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(t);let r=e-t.length;r>0?this._handleIDAT(r):this._handleChunkEnd()},i.prototype._handleIEND=function(e){this.read(e,this._parseIEND.bind(this))},i.prototype._parseIEND=function(e){this._crc.write(e),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}},6117:(e,t,r)=>{"use strict";let n=r(2416),o=r(8360);t.read=function(e,t){return n(e,t||{})},t.write=function(e,t){return o(e,t)}},5477:(e,t,r)=>{"use strict";let n=r(3837),o=r(2781),i=r(7900),a=r(6838),s=r(6117),c=t.y=function(e){o.call(this),e=e||{},this.width=0|e.width,this.height=0|e.height,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,e.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new i(e),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new a(e),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};n.inherits(c,o),c.sync=s,c.prototype.pack=function(){return this.data&&this.data.length?(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},c.prototype.parse=function(e,t){if(t){let e,r;e=function(e){this.removeListener("error",r),this.data=e,t(null,this)}.bind(this),r=function(r){this.removeListener("parsed",e),t(r,null)}.bind(this),this.once("parsed",e),this.once("error",r)}return this.end(e),this},c.prototype.write=function(e){return this._parser.write(e),!0},c.prototype.end=function(e){this._parser.end(e)},c.prototype._metadata=function(e){this.width=e.width,this.height=e.height,this.emit("metadata",e)},c.prototype._gamma=function(e){this.gamma=e},c.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},c.bitblt=function(e,t,r,n,o,i,a,s){if(n|=0,o|=0,i|=0,a|=0,s|=0,(r|=0)>e.width||n>e.height||r+o>e.width||n+i>e.height)throw new Error("bitblt reading outside image");if(a>t.width||s>t.height||a+o>t.width||s+i>t.height)throw new Error("bitblt writing outside image");for(let c=0;c<i;c++)e.data.copy(t.data,(s+c)*t.width+a<<2,(n+c)*e.width+r<<2,(n+c)*e.width+r+o<<2)},c.prototype.bitblt=function(e,t,r,n,o,i,a){return c.bitblt(this,e,t,r,n,o,i,a),this},c.adjustGamma=function(e){if(e.gamma){for(let t=0;t<e.height;t++)for(let r=0;r<e.width;r++){let n=e.width*t+r<<2;for(let t=0;t<3;t++){let r=e.data[n+t]/255;r=Math.pow(r,1/2.2/e.gamma),e.data[n+t]=Math.round(255*r)}}e.gamma=0}},c.prototype.adjustGamma=function(){c.adjustGamma(this)}},9653:(e,t,r)=>{"use strict";let n=r(9491).ok,o=r(9796),i=r(3837),a=r(4300).kMaxLength;function s(e){if(!(this instanceof s))return new s(e);e&&e.chunkSize<o.Z_MIN_CHUNK&&(e.chunkSize=o.Z_MIN_CHUNK),o.Inflate.call(this,e),this._offset=void 0===this._offset?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,e&&null!=e.maxLength&&(this._maxLength=e.maxLength)}function c(e,t){t&&process.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function u(e,t){return function(e,t){if("string"==typeof t&&(t=Buffer.from(t)),!(t instanceof Buffer))throw new TypeError("Not a string or buffer");let r=e._finishFlushFlag;return null==r&&(r=o.Z_FINISH),e._processChunk(t,r)}(new s(t),e)}s.prototype._processChunk=function(e,t,r){if("function"==typeof r)return o.Inflate._processChunk.call(this,e,t,r);let i,s,u=this,l=e&&e.length,f=this._chunkSize-this._offset,h=this._maxLength,p=0,d=[],m=0;function g(e,t){if(u._hadError)return;let r=f-t;if(n(r>=0,"have should not go down"),r>0){let e=u._buffer.slice(u._offset,u._offset+r);if(u._offset+=r,e.length>h&&(e=e.slice(0,h)),d.push(e),m+=e.length,h-=e.length,0===h)return!1}return(0===t||u._offset>=u._chunkSize)&&(f=u._chunkSize,u._offset=0,u._buffer=Buffer.allocUnsafe(u._chunkSize)),0===t&&(p+=l-e,l=e,!0)}this.on("error",(function(e){i=e})),n(this._handle,"zlib binding closed");do{s=this._handle.writeSync(t,e,p,l,this._buffer,this._offset,f),s=s||this._writeState}while(!this._hadError&&g(s[0],s[1]));if(this._hadError)throw i;if(m>=a)throw c(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+a.toString(16)+" bytes");let v=Buffer.concat(d,m);return c(this),v},i.inherits(s,o.Inflate),e.exports=t=u,t.Inflate=s,t.createInflate=function(e){return new s(e)},t.inflateSync=u},33:e=>{"use strict";let t=e.exports=function(e){this._buffer=e,this._reads=[]};t.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t})},t.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let e=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=e.length||e.allowLess))break;{this._reads.shift();let t=this._buffer;this._buffer=t.slice(e.length),e.func.call(this,t.slice(0,e.length))}}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}},5666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,i=Object.create(o.prototype),a=new P(n||[]);return i._invoke=function(e,t,r){var n=f;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return T()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=C(a,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=l(e,t,r);if("normal"===c.type){if(n=r.done?d:h,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=d,r.method="throw",r.arg=c.arg)}}}(e,r,a),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f="suspendedStart",h="suspendedYield",p="executing",d="completed",m={};function g(){}function v(){}function y(){}var _={};c(_,i,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(I([])));w&&w!==r&&n.call(w,i)&&(_=w);var E=y.prototype=g.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=l(e[o],e,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function C(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=l(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function I(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:T}}function T(){return{value:t,done:!0}}return v.prototype=y,c(E,"constructor",y),c(y,"constructor",v),v.displayName=c(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},S(A.prototype),c(A.prototype,a,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new A(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(E),c(E,s,"Generator"),c(E,i,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},8006: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,64,12,0,0,0,0,0,5,52,0,0,0,0,0,40,0,40,0,39,0,6,73,10,104,16,68,8,96,5,73,136,66,33,191,12,34,4,75,26,96,79,240,255,50,16,70,112,71,0,0,0,0,0,0,0,0,0,0,0,0,0,32,112,71,1,32,112,71,79,240,255,48,112,71,0,32,112,71,0,32,112,71,79,240,255,48,112,71,79,246,255,115,19,181,8,70,0,147,5,73,0,35,20,70,9,104,26,70,255,247,254,255,32,70,2,176,16,189,0,191,0,0,0,0,11,74,12,75,12,73,155,26,1,59,9,210,11,74,0,33,11,75,155,26,1,59,8,210,0,33,8,70,255,247,254,191,17,248,1,11,2,248,1,11,238,231,2,248,1,27,241,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,223,112,71,16,181,1,223,4,70,224,178,16,189,16,181,45,223,4,70,32,70,16,189,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,130,176,2,171,3,233,3,0,18,223,2,176,112,71,16,181,21,223,4,70,224,178,16,189,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,33,223,32,96,97,96,212,233,0,1,2,176,16,189,50,223,112,71,49,223,112,71,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,0,0,119,180,13,77,1,145,41,104,189,248,24,96,17,240,1,15,10,76,8,209,121,70,137,13,137,5,1,245,128,49,48,49,33,96,1,33,41,96,33,104,6,150,12,104,1,153,164,70,3,176,112,188,96,71,0,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,46,51,45,50,48,50,49,46,49,48,41,32,49,48,46,51,46,49,32,50,48,50,49,48,56,50,52,32,40,114,101,108,101,97,115,101,41,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,46,51,45,50,48,50,49,46,49,48,41,32,49,48,46,51,46,49,32,50,48,50,49,48,56,50,52,32,40,114,101,108,101,97,115,101,41,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,46,51,45,50,48,50,49,46,49,48,41,32,49,48,46,51,46,49,32,50,48,50,49,48,56,50,52,32,40,114,101,108,101,97,115,101,41,0,65,51,0,0,0,97,101,97,98,105,0,1,41,0,0,0,5,55,69,45,77,0,6,13,7,77,9,2,10,8,18,4,20,1,21,1,23,3,24,1,25,1,26,1,27,1,28,1,30,4,34,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,34,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,4,0,0,0,28,0,0,0,0,0,0,0,0,0,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,4,0,0,0,32,0,0,0,0,0,0,0,0,0,10,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,4,0,0,0,48,0,0,0,0,0,0,0,0,0,12,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,4,0,0,0,56,0,0,0,0,0,0,0,0,0,26,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,7,0,0,0,1,0,0,0,14,0,0,0,18,0,17,0,30,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,36,0,0,0,1,0,0,0,14,0,0,0,18,0,18,0,67,0,0,0,1,0,0,0,4,0,0,0,18,0,4,0,74,0,0,0,1,0,0,0,26,0,0,0,18,0,22,0,103,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,137,0,0,0,1,0,0,0,4,0,0,0,18,0,5,0,145,0,0,0,1,0,0,0,6,0,0,0,18,0,6,0,151,0,0,0,1,0,0,0,64,0,0,0,18,0,26,0,176,0,0,0,1,0,0,0,40,0,0,0,18,0,2,0,182,0,0,0,1,0,0,0,4,0,0,0,18,0,24,0,201,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,213,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,206,0,0,0,1,0,0,0,68,0,0,0,18,0,12,0,234,0,0,0,1,0,0,0,4,0,0,0,18,0,8,0,241,0,0,0,1,0,0,0,10,0,0,0,18,0,16,0,253,0,0,0,1,0,0,0,14,0,0,0,18,0,19,0,20,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,42,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,47,1,0,0,1,0,0,0,4,0,0,0,18,0,23,0,66,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,89,1,0,0,1,0,0,0,26,0,0,0,18,0,21,0,108,1,0,0,1,0,0,0,36,0,0,0,18,0,10,0,115,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,141,1,0,0,1,0,0,0,26,0,0,0,18,0,25,0,160,1,0,0,1,0,0,0,4,0,0,0,18,0,7,0,166,1,0,0,1,0,0,0,10,0,0,0,18,0,20,0,195,1,0,0,1,0,0,0,4,0,0,0,18,0,14,0,225,1,0,0,1,0,0,0,10,0,0,0,18,0,15,0,251,1,0,0,1,0,0,0,6,0,0,0,18,0,9,0,0,36,116,0,36,100,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,114,114,110,111,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,95,102,115,116,97,116,0,95,90,50,51,101,97,100,107,95,107,101,121,98,111,97,114,100,95,112,111,112,95,115,116,97,116,101,118,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,95,104,101,97,112,95,101,110,100,0,95,105,115,97,116,116,121,0,95,111,112,101,110,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,95,115,98,114,107,0,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,95,104,101,97,112,95,115,116,97,114,116,0,95,98,115,115,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,95,108,115,101,101,107,0,101,97,100,107,95,114,97,110,100,111,109,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,109,97,105,110,0,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,95,98,115,115,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,95,119,114,105,116,101,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,102,108,97,115,104,0,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,95,114,101,97,100,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,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,99,107,108,105,103,104,116,95,98,114,105,103,104,116,110,101,115,115,0,95,99,108,111,115,101,0,0,0,28,0,0,0,2,2,0,0,32,0,0,0,2,41,0,0,36,0,0,0,2,36,0,0,20,0,0,0,10,44,0,0,32,0,0,0,2,1,0,0,28,0,0,0,30,54,0,0,48,0,0,0,2,40,0,0,52,0,0,0,2,53,0,0,56,0,0,0,2,59,0,0,60,0,0,0,2,56,0,0,64,0,0,0,2,48,0,0,56,0,0,0,2,3,0,0,60,0,0,0,2,4,0,0,0,0,0,0,2,47,0,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,114,101,108,46,116,101,120,116,46,95,115,98,114,107,0,46,116,101,120,116,46,95,102,115,116,97,116,0,46,116,101,120,116,46,95,105,115,97,116,116,121,0,46,116,101,120,116,46,95,111,112,101,110,0,46,116,101,120,116,46,95,114,101,97,100,0,46,116,101,120,116,46,95,108,115,101,101,107,0,46,116,101,120,116,46,95,99,108,111,115,101,0,46,114,101,108,46,116,101,120,116,46,95,119,114,105,116,101,0,46,114,101,108,46,116,101,120,116,46,95,115,116,97,114,116,0,46,116,101,120,116,46,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,46,116,101,120,116,46,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,46,116,101,120,116,46,101,97,100,107,95,114,97,110,100,111,109,0,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,0,46,116,101,120,116,46,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,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,46,116,101,120,116,46,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,46,116,101,120,116,46,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,46,116,101,120,116,46,95,90,50,51,101,97,100,107,95,107,101,121,98,111,97,114,100,95,112,111,112,95,115,116,97,116,101,118,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,46,114,101,108,46,116,101,120,116,46,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,46,114,111,100,97,116,97,46,108,111,99,97,116,105,111,110,46,48,0,46,100,97,116,97,0,46,114,101,108,46,100,97,116,97,46,104,101,97,112,95,101,110,100,46,49,0,46,98,115,115,0,46,98,115,115,46,95,90,71,86,90,76,50,53,116,114,97,109,112,111,108,105,110,101,70,117,110,99,116,105,111,110,65,100,100,114,101,115,115,105,69,54,111,114,105,103,105,110,0,46,98,115,115,46,95,90,90,76,50,53,116,114,97,109,112,111,108,105,110,101,70,117,110,99,116,105,111,110,65,100,100,114,101,115,115,105,69,54,111,114,105,103,105,110,0,46,99,111,109,109,101,110,116,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,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,37,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,52,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,33,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,4,9,0,0,24,0,0,0,37,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,49,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,92,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,62,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,96,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,76,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,100,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,106,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,100,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,110,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,113,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,114,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,130,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,120,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,126,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,28,9,0,0,16,0,0,0,37,0,0,0,10,0,0,0,4,0,0,0,8,0,0,0,147,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,156,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,143,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,44,9,0,0,48,0,0,0,37,0,0,0,12,0,0,0,4,0,0,0,8,0,0,0,160,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,224,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,196,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,228,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,228,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,238,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,246,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,248,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,19,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,6,1,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,56,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,20,1,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,85,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,34,1,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,120,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,44,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,145,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,70,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,180,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,96,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,205,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,100,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,230,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,104,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,2,0,0,1,0,0,0,6,0,0,0,0,0,0,0,132,1,0,0,64,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,255,1,0,0,9,0,0,0,64,0,0,0,0,0,0,0,92,9,0,0,16,0,0,0,37,0,0,0,26,0,0,0,4,0,0,0,8,0,0,0,34,2,0,0,1,0,0,0,2,0,0,0,0,0,0,0,196,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,53,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,200,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,63,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,200,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,59,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,108,9,0,0,8,0,0,0,37,0,0,0,30,0,0,0,4,0,0,0,8,0,0,0,80,2,0,0,8,0,0,0,3,0,0,0,0,0,0,0,204,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,85,2,0,0,8,0,0,0,3,0,0,0,0,0,0,0,204,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,133,2,0,0,8,0,0,0,3,0,0,0,0,0,0,0,204,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,179,2,0,0,1,0,0,0,48,0,0,0,0,0,0,0,204,1,0,0,222,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,188,2,0,0,3,0,0,112,0,0,0,0,0,0,0,0,170,2,0,0,52,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,224,2,0,0,32,4,0,0,38,0,0,0,35,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,0,7,0,0,2,2,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,116,9,0,0,204,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0]}},7573:(e,t,r)=>{"use strict";e.exports=r.p+"toolchain/ld.wasm"},3835:(e,t,r)=>{"use strict";e.exports=r.p+"toolchain/objcopy.wasm"},9491:e=>{"use strict";e.exports=require("assert")},852:e=>{"use strict";e.exports=require("async_hooks")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3292:e=>{"use strict";e.exports=require("fs/promises")},1017:e=>{"use strict";e.exports=require("path")},7282:e=>{"use strict";e.exports=require("process")},2781:e=>{"use strict";e.exports=require("stream")},1576:e=>{"use strict";e.exports=require("string_decoder")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")},9203:()=>{},7461:(e,t,r)=>{const{Argument:n}=r(8998),{Command:o}=r(5282),{CommanderError:i,InvalidArgumentError:a}=r(8056),{Help:s}=r(8917),{Option:c}=r(5790);(t=e.exports=new o).program=t,t.Argument=n,t.Command=o,t.CommanderError=i,t.Help=s,t.InvalidArgumentError=a,t.InvalidOptionArgumentError=a,t.Option=c},8998:(e,t,r)=>{const{InvalidArgumentError:n}=r(8056);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+"]"}},5282:(e,t,r)=>{const n=r(2361).EventEmitter,o=r(2081),i=r(1017),a=r(7147),s=r(7282),{Argument:c,humanReadableArgName:u}=r(8998),{CommanderError:l}=r(8056),{Help:f}=r(8917),{Option:h,splitOptionFlags:p,DualOptions:d}=r(5790),{suggestSimilar:m}=r(1812);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=>s.stdout.write(e),writeErr:e=>s.stderr.write(e),getOutHelpWidth:()=>s.stdout.isTTY?s.stdout.columns:void 0,getErrHelpWidth:()=>s.stderr.isTTY?s.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,a]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(i);return n&&(s.description(n),s._executableHandler=!0),o.isDefault&&(this._defaultCommandName=s._name),s._hidden=!(!o.noHelp&&!o.hidden),s._executableFile=o.executableFile||null,a&&s.arguments(a),this.commands.push(s),s.parent=this,s.copyInheritedSettings(this),n?this:s}createCommand(e){return new g(e)}createHelp(){return Object.assign(new f,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)),s.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 h(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 h)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=s.argv,s.versions&&s.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":s.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(a.existsSync(r))return r;if(n.includes(i.extname(t)))return;const o=n.find((e=>a.existsSync(`${r}${e}`)));return o?`${r}${o}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u,f=e._executableFile||`${this._name}-${e._name}`,h=this._executableDir||"";if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}h=i.resolve(i.dirname(e),h)}if(h){let t=c(h,f);if(!t&&!e._executableFile&&this._scriptPath){const r=i.basename(this._scriptPath,i.extname(this._scriptPath));r!==this._name&&(t=c(h,`${r}-${e._name}`))}f=t||f}if(r=n.includes(i.extname(f)),"win32"!==s.platform?r?(t.unshift(f),t=y(s.execArgv).concat(t),u=o.spawn(s.argv[0],t,{stdio:"inherit"})):u=o.spawn(f,t,{stdio:"inherit"}):(t.unshift(f),t=y(s.execArgv).concat(t),u=o.spawn(s.execPath,t,{stdio:"inherit"})),!u.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((e=>{s.on(e,(()=>{!1===u.killed&&null===u.exitCode&&u.kill(e)}))}))}const p=this._exitCallback;p?u.on("close",(()=>{p(new l(s.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):u.on("close",s.exit.bind(s)),u.on("error",(t=>{if("ENOENT"===t.code){const t=h?`searched for local subcommand relative to directory '${h}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",r=`'${f}' 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(`'${f}' not executable`);if(p){const e=new l(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,p(e)}else s.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 _(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 v(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),v(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 a=null;for(;o.length;){const e=o.shift();if("--"===e){n===r&&n.push(e),n.push(...o);break}if(!a||i(e)){if(a=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()}`);a=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:${a.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 _(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 s.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()}`,s.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}}))}_parseOptionsImplied(){const e=new d(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);_(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),_(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=p(this._helpFlags);return this._helpShortFlag=r.shortFlag,this._helpLongFlag=r.longFlag,this}help(e){this.outputHelp(e);let t=s.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 v(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 _(e){const t=[];for(let r=e;r;r=r.parent)t.push(r);return t}t.Command=g},8056:(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}}},8917:(e,t,r)=>{const{humanReadableArgName:n}=r(8998);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 a=[`Usage: ${t.commandUsage(e)}`,""];const s=t.commandDescription(e);s.length>0&&(a=a.concat([s,""]));const c=t.visibleArguments(e).map((e=>o(t.argumentTerm(e),t.argumentDescription(e))));c.length>0&&(a=a.concat(["Arguments:",i(c),""]));const u=t.visibleOptions(e).map((e=>o(t.optionTerm(e),t.optionDescription(e))));u.length>0&&(a=a.concat(["Options:",i(u),""]));const l=t.visibleCommands(e).map((e=>o(t.subcommandTerm(e),t.subcommandDescription(e))));return l.length>0&&(a=a.concat(["Commands:",i(l),""])),a.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),a=e.slice(r),s=" ".repeat(r),c=new RegExp(".{1,"+(o-1)+"}([\\s​]|$)|[^\\s​]+?([\\s​]|$)","g");return i+(a.match(c)||[]).map(((e,t)=>("\n"===e.slice(-1)&&(e=e.slice(0,e.length-1)),(t>0?s:"")+e.trimRight()))).join("\n")}}},5790:(e,t,r)=>{const{InvalidArgumentError:n}=r(8056);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)}}},1812:(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="";var n={};(()=>{"use strict";r.d(n,{default:()=>hr});var e=r(7757),t=r.n(e);const o=require("usb");function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function c(e){var t="function"==typeof Map?new Map:void 0;return c=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return u(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)},c(e)}function u(e,t,r){return u=l()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&f(o,r.prototype),o},u.apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}const p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(p,e);var t,r,n,o,c,u=(t=p,r=l(),function(){var e,n=h(t);if(r){var o=h(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return s(this,e)});function p(e){var t;a(this,p);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(t=u.call.apply(u,[this].concat(n))).name=e,t}return n=p,o&&i(n.prototype,o),c&&i(n,c),Object.defineProperty(n,"prototype",{writable:!1}),n}(c(Error));function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var m=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,n;return t=e,n=[{key:"append",value:function(t){for(var r="",n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];o.forEach((function(e){r+=e+","})),e.Content+=+new Date+","+t+","+r+"\n"}},{key:"info",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.append.apply(e,["info"].concat(r))}},{key:"warn",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.append.apply(e,["warn"].concat(r))}},{key:"error",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.append.apply(e,["error"].concat(r))}}],(r=null)&&d(t.prototype,r),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();m.Content="";const g=m;function v(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function b(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){_(i,n,o,a,s,"next",e)}function s(e){_(i,n,o,a,s,"throw",e)}a(void 0)}))}}function w(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function E(e,t,r){return t&&w(e.prototype,t),r&&w(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}function C(e,t){return C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},C(e,t)}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=P(e);if(t){var o=P(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return x(this,r)}}function x(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},P(e)}var I=6,T=8,O=10,R=2,F=3,D=4,M=1033;function N(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 L(e){var t=function(e){for(var t,r=e,n=[];r.byteLength>2;){var o=r.getUint8(0),i=r.getUint8(1),a=new DataView(r.buffer.slice(0,o));if(i==D)t=N(a),n.push(t);else{var s={bLength:o,bDescriptorType:i,data:a};t?t.endpoints.push(s):n.push(s)}r=new DataView(r.buffer.slice(o))}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}}function j(e){return g.info("DFU","getConfiguration"),new Promise((function(t,r){e.device.controlTransferIn({requestType:"standard",recipient:"device",request:T,value:0,index:0},1).then((function(e){"ok"==e.status?t(e.data.getInt8(0)):r(new Error("Wrong getConfiguration status: "+e.status))})).catch((function(e){r(new Error("Get configuration failed --\x3e "+e))}))}))}function H(e){return g.info("DFU","getInterface"),new Promise((function(t,r){e.device.controlTransferIn({requestType:"standard",recipient:"interface",request:O,value:0,index:e.settings.interface.interfaceNumber},1).then((function(e){"ok"==e.status?t(e.data.getInt8(0)):r(new Error("Wrong getInterface status: "+e.status))})).catch((function(e){r(new Error("Get interface failed --\x3e "+e))}))}))}function B(e,t){return g.info("DFU","getConfigurationDescriptor","index "+t),new Promise((function(r,n){e.device.controlTransferIn({requestType:"standard",recipient:"device",request:I,value:t|R<<8,index:0},4).then((function(o){if("ok"==o.status){var i=o.data.getUint16(2,!0);e.device.controlTransferIn({requestType:"standard",recipient:"device",request:I,value:t|R<<8,index:0},i).then((function(e){"ok"==e.status?r(L(e.data)):n(new Error("Wrong getConfigurationDescriptor status: "+e.status))})).catch((function(e){n(e)}))}else n(new Error("Wrong getConfigurationDescriptor status: "+o.status))})).catch((function(e){n(new Error("Get configuration descriptor failed --\x3e "+e))}))}))}function U(e,t){return g.info("DFU","getStringDescriptor","index "+t),new Promise((function(r,n){e.device.controlTransferIn({requestType:"standard",recipient:"device",request:I,value:t|F<<8,index:M},255).then((function(e){"ok"==e.status?(e.data.getInt8(1)!=F&&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((function(e){n(new Error("Get string descriptor failed --\x3e "+e))}))}))}var z={Offset:0,Size:11,Signature:{Offset:0,Size:5}},V={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}}},G=1,$=2,X=3,q=4,K=5,W=6,Y=0,Z=2,Q=4,J=5,ee=7,te=10,re=33,ne=65,oe=function(e){A(r,e);var t=k(r);function r(){S(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"DFUError"].concat(n))}return E(r)}(p),ie=function(e){A(r,e);var t=k(r);function r(){S(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"DFUInterfaceError"].concat(n))}return E(r)}(p);function ae(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return g.info("DFU","requestIn","bRequest: "+t,"data: "+r,"wValue: "+n),new Promise((function(o,i){e.device.controlTransferIn({requestType:"class",recipient:"interface",request:t,value:n,index:e.settings.interface.interfaceNumber},r).then((function(e){"ok"==e.status?o(e.data):i(new Error("Wrong requestIn status: "+e.status))})).catch((function(e){i(new Error("ControlTransferIn failed --\x3e "+e))}))}))}function se(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return g.info("DFU","requestOut","bRequest: "+t,"data: "+r,"wValue: "+n),new Promise((function(o,i){e.device.controlTransferOut({requestType:"class",recipient:"interface",request:t,value:n,index:e.settings.interface.interfaceNumber},r).then((function(e){"ok"==e.status?o(e.bytesWritten):i(new Error("Wrong requestOut status: "+e.status))})).catch((function(e){i(new Error("ControlTransferOut failed --\x3e "+e))}))}))}function ce(e){return g.info("DFU","getState"),new Promise((function(t,r){ae(e,K,1).then((function(e){t(e.getUint8(0))})).catch((function(e){r(new Error("Get state failed --\x3e "+e))}))}))}function ue(e){return g.info("DFU","getStatus"),new Promise((function(t,r){ae(e,X,6).then((function(e){t({status:e.getUint8(0),pollTimeout:16777215&e.getUint32(1,!0),state:e.getUint8(4)})})).catch((function(e){r(new Error("Get status failed --\x3e "+e))}))}))}function le(e){return fe.apply(this,arguments)}function fe(){return fe=b(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","abortToIdle"),e.prev=1,e.next=4,se(r,W);case 4:return e.next=6,ce(r);case 6:if((n=e.sent)!=te){e.next=13;break}return e.next=10,se(r,q);case 10:return e.next=12,ce(r);case 12:n=e.sent;case 13:if(n==Z){e.next=15;break}throw new Error("State is "+n.state+"instead of DFU IDLE (2).");case 15:e.next=20;break;case 17:throw e.prev=17,e.t0=e.catch(1),new Error("Abort to idle failed --\x3e "+e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,17]])}))),fe.apply(this,arguments)}function he(e,t){return pe.apply(this,arguments)}function pe(){return pe=b(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(e){return new Promise((function(t,r){setTimeout(t,e)}))},g.info("DFU","pollUntil",n),e.prev=2,e.next=5,ue(r);case 5:i=e.sent;case 6:if(n(i.state)||i.state==te){e.next=14;break}return e.next=9,o(i.pollTimeout);case 9:return e.next=11,ue(r);case 11:i=e.sent,e.next=6;break;case 14:return e.abrupt("return",i);case 17:throw e.prev=17,e.t0=e.catch(2),new Error("Poll until failed --\x3e "+e.t0);case 20:case"end":return e.stop()}}),e,null,[[2,17]])}))),pe.apply(this,arguments)}function de(e,t){return me.apply(this,arguments)}function me(){return me=b(t().mark((function e(r,n){var o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","setAddress",Number(n).toString(16)),o=new ArrayBuffer(5),(i=new DataView(o)).setUint8(0,re),i.setUint32(1,n,!0),e.prev=5,e.next=8,se(r,G,o,0);case 8:return e.next=10,he(r,(function(e){return e!=Q}));case 10:if((a=e.sent).status==Y){e.next=13;break}throw"Status is "+a.status+" instead of Status OK (0).";case 13:e.next=18;break;case 15:throw e.prev=15,e.t0=e.catch(5),"Set address to "+n+" failed --\x3e "+e.t0;case 18:case"end":return e.stop()}}),e,null,[[5,15]])}))),me.apply(this,arguments)}const ge=function(){function e(r,n){S(this,e),this.open=b(t().mark((function e(){var r,n,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","open"),e.prev=1,e.next=4,this.device.open();case 4:e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(1),new oe("OPEN failed --\x3e "+e.t0);case 9:if(r=this.settings.configuration.configurationValue,null!=this.device.configuration&&this.device.configuration.configurationValue==r){e.next=19;break}return e.prev=11,e.next=14,this.device.selectConfiguration(r);case 14:e.next=19;break;case 16:throw e.prev=16,e.t1=e.catch(11),new oe("OPEN failed: could not select configuration --\x3e "+e.t1);case 19:if(n=this.settings.interface.interfaceNumber,this.device.configuration.interfaces[n].claimed){e.next=29;break}return e.prev=21,e.next=24,this.device.claimInterface(n);case 24:e.next=29;break;case 26:throw e.prev=26,e.t2=e.catch(21),new ie("OPEN failed: could not claim interface --\x3e "+e.t2);case 29:if(o=this.settings.alternate.alternateSetting,null!=this.device.configuration.interfaces[n].alternate&&this.device.configuration.interfaces[n].alternate==o){e.next=39;break}return e.prev=31,e.next=34,this.device.selectAlternateInterface(n,o);case 34:e.next=39;break;case 36:throw e.prev=36,e.t3=e.catch(31),new oe("OPEN failed: could not select alternate interface --\x3e "+e.t3);case 39:case"end":return e.stop()}}),e,this,[[1,6],[11,16],[21,26],[31,36]])}))),this.close=b(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","close"),e.prev=1,e.next=4,this.device.close();case 4:e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(1),new oe("CLOSE failed --\x3e "+e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),this.getMemoryLayout=b(t().mark((function e(){var r,n=this;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","getMemoryLayout"),e.prev=1,e.delegateYield(t().mark((function e(){var r,o,i,a,s,c,u,l,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j(n);case 2:return r=e.sent,e.next=5,B(n,r-1);case 5:return o=e.sent,e.next=8,H(n);case 8:return i=e.sent,a=o.interfaces[i].iInterface,e.next=12,U(n,a);case 12:for(s=e.sent,c=s.split("/"),u=[],l=function(e){var t=parseInt(c[e]),r=c[e+1].split(","),n=/(\d+)\*(\d+)([K|M])g/;r.forEach((function(e){var r=e.match(n),o=parseInt(r[1]),i=parseInt(r[2]),a=r[3];"K"==a?i*=1024:"M"==a&&(i*=1048576);var s=o*i,c={address:t,lastAddress:t+s-1,size:s,nbPage:o,pageSize:i};u.push(c),t+=s}))},f=1;f<c.length;f+=2)l(f);return e.abrupt("return",{v:u});case 18:case"end":return e.stop()}}),e)}))(),"t0",3);case 3:if("object"!=typeof(r=e.t0)){e.next=6;break}return e.abrupt("return",r.v);case 6:e.next=11;break;case 8:throw e.prev=8,e.t1=e.catch(1),new oe("GET MEMORY LAYOUT failed --\x3e "+e.t1);case 11:case"end":return e.stop()}}),e,null,[[1,8]])}))),this.upload=function(){var e=b(t().mark((function e(r,n,o){var i,a,s,c,u,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","upload","address "+Number(r).toString(16),"Length "+Number(n).toString(16)),e.prev=1,e.next=4,ce(this);case 4:if(e.sent==Z){e.next=8;break}return e.next=8,le(this);case 8:return e.next=10,de(this,r);case 10:return e.next=12,le(this);case 12:i=2,a=new Uint8Array(n),s=0,o&&o(0);case 16:return u=Math.min(this.TransferSize,n-s),g.info("DFU","upload","block number "+i,"bytes to read "+u),e.next=20,ae(this,$,u,i++);case 20:(c=e.sent).byteLength>0&&(l=new Uint8Array(c.buffer),a.set(l,s),s+=c.byteLength),o&&o(s/n);case 23:if(s<n){e.next=16;break}case 24:return e.next=26,le(this);case 26:return e.abrupt("return",a);case 29:return e.prev=29,e.t0=e.catch(1),e.next=33,le(this);case 33:throw new oe("UPLOAD failed at address "+r+" of length "+n+" --\x3e "+e.t0);case 34:case"end":return e.stop()}}),e,this,[[1,29]])})));return function(t,r,n){return e.apply(this,arguments)}}(),this.download=function(){var e=b(t().mark((function e(r,n,o){var i,a,s,c,u,l,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g.info("DFU","download","address "+Number(r).toString(16)),e.prev=1,i=0,a=n.byteLength,s=r,o&&o(0);case 6:if(!(i<a)){e.next=27;break}return c=a-i,u=Math.min(c,this.TransferSize),g.info("DFU","download step, at address "+Number(r).toString(16)),l=0,f=void 0,e.next=14,de(this,s);case 14:return e.next=16,se(this,G,n.slice(i,i+u),2);case 16:return l=e.sent,e.next=19,he(this,(function(e){return e==J||e==Z}));case 19:if(f=e.sent,s+=u,f.status==Y){e.next=23;break}throw"state=".concat(f.state,", status=").concat(f.status);case 23:i+=l,o&&o(i/a),e.next=6;break;case 27:e.next=32;break;case 29:throw e.prev=29,e.t0=e.catch(1),new oe("DOWNLOAD failed at address "+Number(r).toString(16)+" --\x3e "+e.t0);case 32:case"end":return e.stop()}}),e,this,[[1,29]])})));return function(t,r,n){return e.apply(this,arguments)}}(),this.leave=function(){var e=b(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","leave","address "+Number(r).toString(16)),e.prev=1,e.next=4,de(this,r);case 4:return e.next=6,se(this,G,new ArrayBuffer,2);case 6:return e.next=8,he(this,(function(e){return e==ee}));case 8:e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(1),new oe("LEAVE failed at address "+Number(r).toString(16)+" --\x3e "+e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(t){return e.apply(this,arguments)}}(),this.eraseSegment=function(){var e=b(t().mark((function e(r){var n,o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","eraseSegment","address "+Number(r).toString(16)),e.prev=1,e.next=4,ce(this);case 4:if(e.sent==Z){e.next=8;break}return e.next=8,le(this);case 8:return n=new ArrayBuffer(5),(o=new DataView(n)).setUint8(0,ne),o.setUint32(1,r,!0),e.next=14,se(this,G,n,0);case 14:return e.next=16,ue(this);case 16:if((i=e.sent).state==Q){e.next=19;break}throw"wrong DFU state: "+i.state;case 19:return e.next=21,he(this,(function(e){return e!=Q}));case 21:if((i=e.sent).status==Y){e.next=24;break}throw"wrong DFU status: "+i.status;case 24:e.next=29;break;case 26:throw e.prev=26,e.t0=e.catch(1),new oe("ERASE SEGMENT failed at address "+r+" --\x3e "+e.t0);case 29:case"end":return e.stop()}}),e,this,[[1,26]])})));return function(t){return e.apply(this,arguments)}}(),this.TransferSize=n,this.device=r;var o,i=v(r.configurations);try{for(i.s();!(o=i.n()).done;){var a,s=o.value,c=v(s.interfaces);try{for(c.s();!(a=c.n()).done;){var u,l=a.value,f=v(l.alternates);try{for(f.s();!(u=f.n()).done;){var h=u.value;if(254==h.interfaceClass&&1==h.interfaceSubclass&&(1==h.interfaceProtocol||2==h.interfaceProtocol))return this.settings={configuration:s,interface:l,alternate:h},this}}catch(e){f.e(e)}finally{f.f()}}}catch(e){c.e(e)}finally{c.f()}}}catch(e){i.e(e)}finally{i.f()}return this.settings={configuration:{configurationValue:1},interface:{interfaceNumber:0},alternate:{alternateSetting:0}},this}return E(e,null,[{key:"Parse",value:function(e){new DataView(e);var t=new TextDecoder("utf-8").decode(new Uint8Array(e.slice(z.Signature.Offset,z.Signature.Offset+z.Signature.Size)));if("DfuSe"!=t)throw new oe("Parsed file is not a DFU file (invalid signature)");var r=e.slice(V.Offset);if("Target"!=(t=new TextDecoder("utf-8").decode(new Uint8Array(r.slice(V.TargetPrefix.Signature.Offset,V.TargetPrefix.Signature.Size)))))throw new oe("Corrupted DFU file (invalid target signature)");for(var n=[],o=new DataView(r,V.TargetPrefix.NbElements.Offset,V.TargetPrefix.NbElements.Offset+V.TargetPrefix.NbElements.Size).getUint32(0,!0),i=r.slice(V.Element.Offset),a=0;a<o;a++){var s=new DataView(i,V.Element.Address.Offset,V.Element.Address.Offset+V.Element.Address.Size).getUint32(0,!0),c=new DataView(i,V.Element.Size.Offset,V.Element.Address.Offset+V.Element.Size.Size).getUint32(0,!0),u=i.slice(V.Element.Data.Offset,V.Element.Data.Offset+c);i=i.slice(V.Element.Data.Offset+c),n.push({address:s,size:c,data:u})}return n}}]),e}();function ve(e){return new TextDecoder("utf-8").decode(e.subarray(0,e.indexOf(0)))}function ye(e){var 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 _e(e){for(var t=new Uint8Array(e.length/2),r=0;r<t.length;r++)t[r]=parseInt(e.substr(2*r,2),16);return t}function be(e){for(var t=atob(e),r="",n=0;n<t.length;n++){var o=t.charCodeAt(n).toString(16);r+=2===o.length?o:"0"+o}return r.toUpperCase()}function we(e){return btoa(e.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))}function Ee(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Se(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Se(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Se(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ae(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ce(e,t,r){return t&&Ae(e.prototype,t),r&&Ae(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xe(e,t){return xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xe(e,t)}function Pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Te(e);if(t){var o=Te(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ie(this,r)}}function Ie(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Te(e){return Te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Te(e)}var Oe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xe(e,t)}(r,e);var t=Pe(r);function r(){ke(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"StorageError"].concat(n))}return Ce(r)}(p);function Re(e){return new DataView(e.buffer,e.byteOffset).getUint16(0,!0)}function Fe(e){var t={size:0,name:"unknown",content:"unknown"};return t.size=Re(e),t.name=ve(e.subarray(2)),t.content=e.subarray(2+t.name.length+1,t.size),t}var De=function(e){function t(e){ke(this,t),this.records=e}return Ce(t,[{key:Symbol.iterator,value:function(){var e=this.records;return{next:function(){var t=Re(e);if(0===t)return{done:!0};var r=Fe(e);return e=e.subarray(t),{value:r,done:!1}}}}}]),t}();const Me=Ce((function e(t){ke(this,e),this.availableSize=function(){var e,t=0,r=Ee(new De(this.data));try{for(r.s();!(e=r.n()).done;){t+=e.value.size}}catch(e){r.e(e)}finally{r.f()}return this.totalSize()-t},this.totalSize=function(){return this.data.byteLength-2},this.recordsWithExtension=function(e){var t,r=[],n=Ee(new De(this.data));try{for(n.s();!(t=n.n()).done;){var o=t.value;o.name.endsWith(e)&&r.push(o.name)}}catch(e){n.e(e)}finally{n.f()}return r},this.size=function(e){var t,r=Ee(new De(this.data));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.name===e)return n.size}}catch(e){r.e(e)}finally{r.f()}},this.content=function(e){var t,r=Ee(new De(this.data));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.name===e)return n.content}}catch(e){r.e(e)}finally{r.f()}},this.setContent=function(e,t){var r,n=0,o=0,i=Ee(new De(this.data));try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.name===e){o=a.size;break}n+=a.size}}catch(e){i.e(e)}finally{i.f()}var s=this.data.slice(n+o),c=n,u=function(e,t){if(void 0!==t){var r=e.length+1+t.byteLength+2,n=new Uint8Array(r);return new DataView(n.buffer,n.byteOffset).setUint16(0,r,!0),n.set(ye(e),2),n.set(t,2+e.length+1),n}}(e,t);if(void 0!==u){if(Fe(u).size>this.availableSize()+o)throw new Oe("The storage on calculator is full");this.data.set(u,n),c+=u.length,s=s.slice(0,this.data.length-(n+u.length))}this.data.set(s,c),this.data.fill(0,c+s.length)},this.data=t}));function Ne(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Le(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Le(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Le(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function je(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function He(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){je(i,n,o,a,s,"next",e)}function s(e){je(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Be(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ue(e,t,r){return t&&Be(e.prototype,t),r&&Be(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ve(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ge(e,t)}function Ge(e,t){return Ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ge(e,t)}function $e(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=qe(e);if(t){var o=qe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Xe(this,r)}}function Xe(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function qe(e){return qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qe(e)}var Ke=r(3786),We=2048,Ye=_e("F00DC0DE"),Ze=_e("FEEDC0DE"),Qe=_e("BADBEEEF"),Je=function(e){Ve(r,e);var t=$e(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"CalculatorMemoryCorruption"].concat(n))}return Ue(r)}(p),et=function(e){Ve(r,e);var t=$e(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"BusyCalculatorError"].concat(n))}return Ue(r)}(p),tt=function(e){Ve(r,e);var t=$e(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"WebUSBError"].concat(n))}return Ue(r)}(p),rt=function(e){Ve(r,e);var t=$e(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"USBConnectionError"].concat(n))}return Ue(r)}(p),nt=function(e){Ve(r,e);var t=$e(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"ForbiddenMemoryAccessError"].concat(n))}return Ue(r)}(p),ot=function(e){Ve(r,e);var t=$e(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"DeviceDetectionError"].concat(n))}return Ue(r)}(p),it=function(e){Ve(r,e);var t=$e(r);function r(e){var n;ze(this,r);for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return(n=t.call.apply(t,[this,"BulkError"].concat(i))).errors=e,n}return Ue(r)}(p),at={N0100:{name:"N0100",ElectronicSignatureAddress:536836624,RAMAddressStart:536870912,RAMAddressEnd:537133056},N0110:{name:"N0110",ElectronicSignatureAddress:535853584,RAMAddressStart:536870912,RAMAddressEnd:537133056},N0120:{name:"N0120",ElectronicSignatureAddress:535947264,RAMAddressStart:603979776,RAMAddressEnd:604307456},N0120Prototype:{displayed_name:"N0120",ElectronicSignatureAddress:535947264,name:"N0120_PORTUGAL_PROTOTYPE_20210930",RAMAddressStart:603979776,RAMAddressEnd:604307456}},st=_e("BADD0BEE");function ct(e){for(var t="",r=0;r<e.byteLength;r++)t+=e[r].toString(16).padStart(2,"0").toUpperCase();return t}function ut(e,t){if(e.length<t.length)return!1;for(var r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}function lt(e,t){return!(e.length<t.length)&&ut(e.subarray(e.length-t.length),t)}function ft(e,t){if(!(e>=134217728&&e+t<=135266304||e>=2415919104&&e+t<=2424307712))throw new nt("Access to address: "+e+" (length "+t+") is out of flash range")}function ht(e,t,r){if(t<e.RAMAddressStart||t+r>=e.RAMAddressEnd)throw new nt("Access to address: "+t+" (length "+r+") is out of RAM range")}function pt(e){if(g.info("Calculator","parseSlotInfo","header info "+e),!ut(e,Qe)||!lt(e,Qe))return null;var t=new DataView(e.buffer,e.byteOffset);return{kernelHeaderAddress:t.getUint32(4,!0),userlandHeaderAddress:t.getUint32(8,!0)}}function dt(e,t){if(g.info("Calculator","parseFirmwareHeader","header "+e),!ut(e,Ye))return t;t.version=ve(e.subarray(4)),t.patch=ve(e.subarray(12));var r=e.subarray(20);if(ut(r,Ye))return t;var n=new DataView(e.buffer,e.byteOffset);return t.storageAddress=n.getUint32(20,!0),ut(r=e.subarray(24),Ye)||(t.storageSize=n.getUint32(24,!0)),t}function mt(e,t){if(g.info("Calculator","parseUserlandHeader","header "+e),!ut(e,Ze))return t;t.userlandVersion=ve(e.subarray(4));var 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}function gt(){return(gt=He(t().mark((function e(r,n,o){var i,a,s,c,u,l,f,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("Calculator","uploadHeader","address "+Number(n[0].address).toString(16)),i={version:"0.0.0",patch:"0000000",userlandVersion:"unknown",externalAppsFlashStart:"unknown",externalAppsFlashEnd:"unknown",externalAppsRamStart:"unknown",externalAppsRamEnd:"unknown",storageAddress:"unknown",storageSize:4096},e.prev=2,a=n[0].address+St.Header0.Offset,s=St.Header0.Size,ft(a,s),e.next=8,r.upload(a,s);case 8:if(!ut(c=e.sent,Ye)||!lt(c,Ye)){e.next=13;break}return e.abrupt("return",dt(c,i));case 13:return a=n[0].address+St.Header1.Offset,s=St.Header1.Size,ft(a,s),e.next=18,r.upload(a,s);case 18:if(!ut(c=e.sent,Ye)||!lt(c,Ye)){e.next=23;break}return e.abrupt("return",dt(c,i));case 23:return a=o.RAMAddressStart,s=St.Header2.SlotInfoSize,ht(o,a,s),e.prev=26,e.next=29,r.upload(a,s);case 29:if(u=e.sent,null!=(l=pt(u))){e.next=33;break}throw new Je("The slot info was corrupted");case 33:return a=l.kernelHeaderAddress,s=St.Header2.KernelHeaderSize,ft(a,s),e.next=38,r.upload(a,s);case 38:return f=e.sent,i=dt(f,i),a=l.userlandHeaderAddress,s=St.Header2.UserlandHeaderSize,ft(a,s),e.next=45,r.upload(a,s);case 45:return h=e.sent,i=mt(h,i),e.abrupt("return",i);case 50:return e.prev=50,e.t0=e.catch(26),e.abrupt("return",dt(c,i));case 53:e.next=59;break;case 55:throw e.prev=55,e.t1=e.catch(2),e.t1.message="Upload header failed --\x3e "+e.t1.message,e.t1;case 59:case"end":return e.stop()}}),e,null,[[2,55],[26,50]])})))).apply(this,arguments)}function vt(){return vt=He(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(16!=(o=r.device.serialNumber).length){e.next=3;break}return e.abrupt("return",o);case 3:return e.next=5,r.upload(n.ElectronicSignatureAddress-1,13);case 5:return i=e.sent,e.abrupt("return",we(ct(i.subarray(1,13))));case 7:case"end":return e.stop()}}),e)}))),vt.apply(this,arguments)}function yt(e,t){return _t.apply(this,arguments)}function _t(){return _t=He(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g.info("Calculator","calculatorGetStorage","address "+Number(n.firmware.storageAddress).toString(16)),"unknown"!==n.firmware.storageAddress){e.next=3;break}throw new Je("The Storage address could not be found in header");case 3:e.prev=3,ht(n.model,n.firmware.storageAddress,n.firmware.storageSize+2*st.length),e.next=10;break;case 7:throw e.prev=7,e.t0=e.catch(3),new Je("Calculator Get Storage failed --\x3e "+e.t0);case 10:if(!1===r.storage){e.next=12;break}return e.abrupt("return",r.storage);case 12:return e.prev=12,e.next=15,r.dfu.upload(n.firmware.storageAddress,n.firmware.storageSize+2*st.length);case 15:if(!ut(o=e.sent,st)||!lt(o,st)){e.next=22;break}return i=o.subarray(st.length,n.firmware.storageSize+st.length),r.storage=new Me(i),e.abrupt("return",r.storage);case 22:throw new Je("Memory is corrupted: could not find storage tags");case 23:e.next=29;break;case 25:throw e.prev=25,e.t1=e.catch(12),e.t1.message="CalculationGetStorage failed --\x3e "+e.t1.message,e.t1;case 29:case"end":return e.stop()}}),e,null,[[3,7],[12,25]])}))),_t.apply(this,arguments)}function bt(e,t,r){return wt.apply(this,arguments)}function wt(){return wt=He(t().mark((function e(r,n,o){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g.info("Calculator","calculatorSetStorage","address "+Number(n.firmware.storageAddress).toString(16)),e.prev=1,ht(n.model,n.firmware.storageAddress+st.length,o.data),e.next=8;break;case 5:throw e.prev=5,e.t0=e.catch(1),new Je("Calculator Set Storage failed --\x3e "+e.t0);case 8:return e.prev=8,e.next=11,r.dfu.download(n.firmware.storageAddress+st.length,o.data);case 11:e.next=17;break;case 13:throw e.prev=13,e.t1=e.catch(8),e.t1.message="CalculationSetStorage failed --\x3e "+e.t1.message,e.t1;case 17:case"end":return e.stop()}}),e,null,[[1,5],[8,13]])}))),wt.apply(this,arguments)}function Et(e){var t=ye(e),r=new Uint8Array(t.length+1);return r[0]=1,r.set(t,1),r}var St=function(){function e(t,r){ze(this,e),this.dfu=new ge(t,r),this.running=!1,this.storage=!1,this.infos=!1}return Ue(e,[{key:"process",value:function(e){var t,r=this;return g.info("Calculator","process"),new Ke((function(n,o){if(r.running)return o(new et("Calculator is already processing another request"));r.running=!0,r.dfu.open().then((function(){return e(r)})).then((function(e){if(t=e,r.dfu.device.opened)return r.dfu.close()})).then((function(){return r.running=!1,n(t)})).catch((function(e){return r.running=!1,o(e)}))}))}},{key:"reconnectAndProcess",value:function(t,r){var n=this;return new Ke((function(o,i){return g.info("Calculator","reconnect"),null==navigator.usb?i(new tt("Web usb unvailable")):e.StallUntilConnect(n.dfu.device.serialNumber,t).then((function(e){return e.process(r)})).then((function(e){o(e)})).catch((function(e){i(e)}))}))}},{key:"extractInfos",value:function(){var e=this;return g.info("Calculator","extractInfos"),new Ke((function(t,r){var n,o,i;return!1!==e.infos?t(e):e.dfu.getMemoryLayout().then((function(t){return n=t,o=function(e,t){if("NumWorks Calculator"==e.productName&&2==e.deviceVersionMinor)return"EAAbABVROTUxNDM4"==e.serialNumber?at.N0120Prototype:at.N0120;var r=t[t.length-1].lastAddress;return r>135135232&&r<2415919104?at.N0100:at.N0110}(e.dfu.device,n),function(e,t,r){return gt.apply(this,arguments)}(e.dfu,n,o)})).then((function(t){return i=t,function(e,t){return vt.apply(this,arguments)}(e.dfu,o)})).then((function(r){return e.infos={serialNumber:be(r),displayedSerialNumber:r,model:o,memoryLayout:n,firmware:i},t(e)})).catch((function(e){e.message="extractInfos failed --\x3e "+e.message,r(e)}))}))}},{key:"uploadFlash",value:function(e,t,r){var n=this;return g.info("Calculator","uploadFlash","address "+Number(e).toString(16),"length "+Number(t).toString(16)),new Ke((function(o,i){try{ft(e,t)}catch(e){e.message="uploadFlash failed --\x3e "+e.message,i(e)}n.dfu.upload(e,t,r).then((function(e){o(e)})).catch((function(e){e.message="uploadFlash failed --\x3e "+e.message,i(e)}))}))}},{key:"downloadFlash",value:function(e,r,n,o,i){var a=this;return g.info("Calculator","downloadFlash","address "+Number(e).toString(16)),new Ke((function(s,c){var u=function(){var e=He(t().mark((function e(r,n,o,i,a){var s,c,u,l,f,h,p,d,m,g,v,y,_;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=0,c=0,u=-1,l=-1,f=-1,h=-1,p=0;case 7:if(!(p<n.length)){e.next=33;break}if(!(u<0)){e.next=14;break}if(!(o>n[p].lastAddress)){e.next=13;break}return e.abrupt("continue",30);case 13:u=p;case 14:d=0;case 15:if(!(d<n[p].nbPage)){e.next=30;break}if(!(l<0)){e.next=22;break}if(o!=n[p].address+d*n[p].pageSize){e.next=21;break}l=d,e.next=22;break;case 21:return e.abrupt("continue",27);case 22:if(!((s+=n[p].pageSize)>=i.byteLength)){e.next=27;break}return f=p,h=d,e.abrupt("break",33);case 27:d++,e.next=15;break;case 30:p++,e.next=7;break;case 33:m=u;case 34:if(!(m<=f)){e.next=51;break}g=m==u?l:0,v=m==f?h+1:n[m].nbPage,y=g;case 38:if(!(y<v)){e.next=48;break}return _=n[m].address+y*n[m].pageSize,e.next=42,r.eraseSegment(_);case 42:c+=n[m].pageSize,a(c/s),_+=n[m].pageSize;case 45:y++,e.next=38;break;case 48:m++,e.next=34;break;case 51:case"end":return e.stop()}}),e)})));return function(t,r,n,o,i){return e.apply(this,arguments)}}();try{ft(e,r.byteLength)}catch(e){e.message="downloadFlash failed --\x3e "+e.message,c(e)}u(a.dfu,n.memoryLayout,e,r,(function(e){return o(e)})).then((function(){s(a.dfu.download(e,r,(function(e){return i(e)})))})).catch((function(e){e.message="downloadFlash failed --\x3e "+e.message,c(e)}))}))}},{key:"reset",value:function(e){var t=this;return g.info("Calculator","reset"),new Ke((function(r,n){try{ft(e.memoryLayout[0].address,0)}catch(e){e.message="reset failed --\x3e "+e.message,n(e)}return t.dfu.leave(134217728).then((function(){r(!0)})).catch((function(e){e.message="reset failed --\x3e "+e.message,n(e)}))}))}},{key:"getAvailableSpaceInfo",value:function(){var e=this;return g.info("Calculator","getAvailableSpaceInfo"),new Ke((function(t,r){var n={availableSize:!1,totalSize:!1};e.extractInfos().then((function(t){return yt(e,t.infos)})).then((function(e){n.availableSize=e.availableSize(),n.totalSize=e.totalSize(),t(n)})).catch((function(e){e.message="getAvailableSpaceInfo failed --\x3e "+e.message,r(e)}))}))}},{key:"getScripts",value:function(){var e=this;return g.info("Calculator","getScripts"),new Ke((function(t,r){e.extractInfos().then((function(t){return yt(e,t.infos)})).then((function(e){return e.recordsWithExtension(".py").map((function(t,r){return{name:t,size:e.size(t),content:ve(e.content(t).subarray(1))}}))})).then((function(e){t(e)})).catch((function(e){e.message="getScripts failed --\x3e "+e.message,r(e)}))}))}},{key:"removeScripts",value:function(){var e=this;return g.info("Calculator","removeScripts"),new Ke((function(t,r){e.extractInfos().then((function(t){return yt(e,t.infos)})).then((function(t){t.recordsWithExtension(".py").map((function(e,r){t.setContent(e)}));return bt(e,e.infos,t)})).then((function(){t(!0)})).catch((function(e){e.message="removeScripts failed --\x3e "+e.message,r(e)}))}))}},{key:"getSizeForRecord",value:function(e){var t=this;return g.info("Calculator","getSizeForRecord","name "+e),new Ke((function(r,n){var o;t.extractInfos().then((function(e){return yt(t,e.infos)})).then((function(t){o=t.size(e),r(o)})).catch((function(e){e.message="getSizeForRecord failed --\x3e "+e.message,n(e)}))}))}},{key:"setContentForRecord",value:function(e,t){var r=this;return g.info("Calculator","setContentForRecord","name "+e),new Ke((function(n,o){r.extractInfos().then((function(e){return yt(r,e.infos)})).then((function(n){try{n.setContent(e,t)}catch(e){o(e)}return bt(r,r.infos,n)})).then((function(){n(!0)})).catch((function(e){e.message="setContentForRecord failed --\x3e "+e.message,o(e)}))}))}},{key:"setContentForScript",value:function(e,t){var r=this;return g.info("Calculator","setContentForScript","name "+e),new Ke((function(n,o){r.setContentForRecord(e,Et(t)).then((function(){n(!0)})).catch((function(e){e.message="setContentForScript failed --\x3e "+e.message,o(e)}))}))}},{key:"setRecords",value:function(e){var t=this;return g.info("Calculator","setRecords",e),new Ke((function(r,n){t.extractInfos().then((function(e){return yt(t,e.infos)})).then((function(t){try{e.forEach((function(e,r){t.setContent(e.name,e.content)}))}catch(e){n(e)}return t})).then((function(e){return bt(t,t.infos,e)})).then((function(){r(!0)})).catch((function(e){e.message="setRecords failed --\x3e "+e.message,n(e)}))}))}},{key:"setScripts",value:function(e){var t=this;return g.info("Calculator","setScripts",e),new Ke((function(r,n){var o=[];e.forEach((function(e,t){o[t]={name:e.name,content:Et(e.content)}})),t.setRecords(o).then((function(){r(!0)})).catch((function(e){e.message="setScripts failed --\x3e "+e.message,n(e)}))}))}},{key:"removeRecord",value:function(e){var t=this;return g.info("Calculator","removeRecord","name "+e),new Ke((function(r,n){t.extractInfos().then((function(e){return yt(t,e.infos)})).then((function(r){return r.setContent(e),bt(t,t.infos,r)})).then((function(){r(!0)})).catch((function(e){e.memory="removeRecord failed --\x3e "+e.message,n(e)}))}))}}],[{key:"DisplayableFirmwarePatch",value:function(e){return"badbabe"==e?"unofficial":e}},{key:"CheckFirmware",value:function(e,t){for(var r=0;r<t.byteLength;r++)if(e[r]!=t[r])throw new Je("The uploaded firmware differs from the reference at byte "+r);return!0}},{key:"StallUntilConnect",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return g.info("Calculator","StallUntilConnect"),new Ke((function(o,i){return n>60?i(new ot("Device detection timed out")):navigator.usb.getDevices().then((function(a){var s,c=Ne(a);try{for(c.s();!(s=c.n()).done;){var u=s.value;if(u.serialNumber===t)return r(1),o(new e(u,We))}}catch(e){c.e(e)}finally{c.f()}return r((n-1)/n),setTimeout((function(){return e.StallUntilConnect(t,r,n+1).then((function(e){o(e)})).catch((function(e){i(e)}))}),1e3)})).catch((function(e){i(e)}))}))}}]),e}();St.Header0={Offset:428,Size:24},St.Header1={Offset:452,Size:32},St.Header2={SlotInfoSize:16,KernelHeaderSize:24,UserlandHeaderSize:40},St.Product={Numworks:"numworks",ST:"ST"};var At=function(){function e(){ze(this,e),this.calculators=[]}return Ue(e,[{key:"singleConnectAndExtractInfos",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return 1==this.calculators.length&&null!=this.calculators[0].info?this.calculators[0]:this.connectAndProcess((function(e){return e.extractInfos()}),!1,[St.Product.Numworks],e).then((function(e){return e[0]}))}},{key:"connectAndProcess",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[St.Product.Numworks],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];g.info("CalculatorBulk","connectAndProcess");var i=[];return new Ke((function(a,s){r.connect(n,t,o).then((function(t){return r.connected()?Ke.map(t,(function(t){return t.process(e).catch((function(e){i.push({serialNumber:t.infos.serialNumber,error:e})}))})).then((function(e){if(i.length>0){if(1==t.length)throw i[0].error;throw new it(i)}return a(e)})):s(new rt("No usb connection found"))})).catch((function(e){s(e)}))}))}},{key:"connected",value:function(){return this.calculators.length>0}},{key:"connect",value:function(t,r,n){var o=this;return new Ke((function(i,a){e.Connect(t,n).then((function(e){o.calculators=r||0==e.length?e:[e[0]],i(o.calculators)})).catch((function(e){e.memory="connect failed --\x3e "+e.message,a(e)}))}))}}],[{key:"Connect",value:function(e,t){g.info("CalculatorBulk","connect",e);var r=[],n=e.map((function(e){return e==St.Product.Numworks?41617:57105})),o=[];return n.forEach((function(e){return o.push({vendorId:1155,productId:e})})),new Ke((function(e,i){if(null==navigator.usb)return i(new tt("Web usb unvailable"));t?(g.info("CalculatorBulk","connect","request device"),navigator.usb.requestDevice({filters:o}).then((function(t){return r.push(new St(t,We)),e(r)})).catch((function(e){i(new rt("Usb device selection failure: "+e))}))):(g.info("Calculator","connect","get device"),navigator.usb.getDevices().then((function(t){var o,i=Ne(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;1155===a.vendorId&&n.includes(a.productId)&&r.push(new St(a,We))}}catch(e){i.e(e)}finally{i.f()}return e(r)})).catch((function(e){i(new rt("Usb device failed: "+e))})))}))}}]),e}();r(382);var Ct=r(280),kt=(r(8744),r(5405)),xt=r(5477);function Pt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function It(e,t){return Math.round(255/((1<<t)-1)*e)}var Tt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.rgba8888Data=t}var t,r,n;return t=e,n=[{key:"fromPNG",value:function(t){var r=xt.y.sync.read(t);if(r.width!=e.Width)throw"Icon has an invalid width";if(r.height!=e.Height)throw"Icon has an invalid height";return new e(r.data)}},{key:"fromNWI",value:function(t){console.log("Creating image from NWI",t);var r=new Uint8Array(e.Width*e.Height*2);kt.decompressBlock(t,r,0,t.length,0);var n=function(e){for(var t=e.length/2,r=new Uint8Array(4*t),n=0;n<t;n++){var o=e[2*n+1]<<8|e[2*n],i=o>>11&31,a=o>>5&63,s=31&o;r[4*n]=It(i,5),r[4*n+1]=It(a,6),r[4*n+2]=It(s,5),r[4*n+3]=255}return r}(r);return new e(n)}}],(r=[{key:"toPNG",value:function(){console.log("this.rgba8888Data",this.rgba8888Data);var t=new ImageData(new Uint8ClampedArray(this.rgba8888Data.buffer),e.Width,e.Height),r=document.createElement("canvas");return r.width=e.Width,r.height=e.Height,r.getContext("2d").putImageData(t,0,0),r.toDataURL()}},{key:"toNWI",value:function(){var e=function(e){for(var t=e.length/4,r=new Uint8Array(2*t),n=0;n<t;n++){var o=e[4*n]>>3<<11|e[4*n+1]>>2<<5|e[4*n+2]>>3;r[2*n]=255&o,r[2*n+1]=o>>8&255}return r}(this.rgba8888Data),t=kt.compressBlock(e,new Uint8Array(0),0,e.length,kt.makeBuffer(65536)),r=new Uint8Array(t);return kt.compressBlock(e,r,0,e.length,kt.makeBuffer(65536)),r}}])&&Pt(t.prototype,r),n&&Pt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();Tt.Width=55,Tt.Height=56;const Ot=Tt;var Rt=r(5827),Ft=r.n(Rt),Dt=r(2890),Mt=r.n(Dt);function Nt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Lt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jt(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Ht(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){jt(i,n,o,a,s,"next",e)}function s(e){jt(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Bt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Ut=r(7475),zt=r(8006),Vt=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.packedElfData=t,this.packedElfAnalysis=r,this.size=void 0,this.refreshNeedsExternalData(),this.refreshSize()}var n,o,i,a,s,c,u;return n=e,o=[{key:"name",value:function(){var e=this.dataForSymbolNamed("eadk_app_name");return(new TextDecoder).decode(e)}},{key:"refreshSize",value:(u=Ht(t().mark((function r(){var n,o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.needsExternalData){t.next=6;break}return t.next=3,this.flatBin({flashStart:2415919104,flashLength:8388608,ramStart:536870912,ramLength:262144});case 3:n=t.sent,o=n.byteLength+(e.AppSectorSize-n.byteLength%e.AppSectorSize),this.size=o;case 6:case"end":return t.stop()}}),r,this)}))),function(){return u.apply(this,arguments)})},{key:"icon",value:function(){var e=this.dataForSymbolNamed("eadk_app_icon"),t=Ot.fromNWI(e);return t.toPNG()}},{key:"flatElf",value:(c=Ht(t().mark((function e(r){var n,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={arguments:["--script","linker.ld","--gc-sections","--allow-multiple-definition","eadk.o","app-pack.elf"],inputs:{"linker.ld":Ut(r),"app-pack.elf":this.packedElfData,"eadk.o":new Uint8Array(zt.data)}},!this.externalData){e.next=7;break}return o="extra-data.o",n.arguments.push(o),e.next=6,this.externalObject();case 6:n.inputs[o]=e.sent;case 7:return e.next=9,this.ld(n);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"flatBin",value:(s=Ht(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.t1=["--output-target","binary"],e.next=4,this.flatElf(r);case 4:return e.t2=e.sent,e.t3={arguments:e.t1,input:e.t2},e.next=8,e.t0.objcopy.call(e.t0,e.t3);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"setExternalData",value:function(e){this.externalData=e,this.refreshNeedsExternalData(),this.refreshSize()}},{key:"symbols",value:function(){return Ct.getSymbols(this.packedElfAnalysis)}},{key:"symbolNamed",value:function(e){return this.symbols().find((function(t){return t.name==e}))}},{key:"dataForSymbol",value:function(e){var t=this.sectionForSymbol(e),r=t.offset+(e.virtualAddress-t.addr);return this.packedElfData.slice(r,r+e.size)}},{key:"dataForSymbolNamed",value:function(e){return this.dataForSymbol(this.symbolNamed(e))}},{key:"sectionForSymbol",value:function(e){return this.packedElfAnalysis.sections.find((function(t){return t.addr<=e.virtualAddress&&t.addr+t.size>=e.virtualAddress+e.size}))}},{key:"ld",value:function(e){return new Promise((function(t,n){var o={locateFile:function(e,t){return r(7573)},preRun:function(){for(var t=0,r=Object.entries(e.inputs);t<r.length;t++){var n=Nt(r[t],2),i=n[0],a=n[1];o.FS.writeFile(i,a)}},onAbort:n,arguments:e.arguments.concat(["--output","output.elf"]),postRun:function(){t(o.FS.readFile("output.elf"))}};Ft()(o)}))}},{key:"objcopy",value:function(e){return new Promise((function(t,n){var o={locateFile:function(e,t){return r(3835)},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"))}};Mt()(o)}))}},{key:"refreshNeedsExternalData",value:function(){var e=void 0!==this.symbolNamed("eadk_external_data"),t=void 0!==this.externalData;this.needsExternalData=e&&!t}},{key:"externalObject",value:function(){return this.objcopy({arguments:["--input-target","binary","--output-target","elf32-littlearm","--rename-section",".data=.rodata.eadk_external_data","--redefine-sym","_binary_input_dat_start=eadk_external_data"],input:this.externalData})}}],i=[{key:"from",value:(a=Ht(t().mark((function r(n){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ct.open(n,{readSymbolData:!0});case 2:return o=t.sent,t.abrupt("return",new e(n,o.elf));case 4:case"end":return t.stop()}}),r)}))),function(e){return a.apply(this,arguments)})}],o&&Bt(n.prototype,o),i&&Bt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}();Vt.AppSectorSize=65536;const Gt=Vt;function $t(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Xt(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){$t(i,n,o,a,s,"next",e)}function s(e){$t(i,n,o,a,s,"throw",e)}a(void 0)}))}}function qt(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Kt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kt(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Yt(e,t,r){return t&&Wt(e.prototype,t),r&&Wt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qt(e,t){return Qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qt(e,t)}function Jt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tr(e);if(t){var o=tr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return er(this,r)}}function er(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function tr(e){return tr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},tr(e)}var rr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qt(e,t)}(r,e);var t=Jt(r);function r(){Zt(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"CalculatorMemoryOverflow"].concat(n))}return Yt(r)}(p),nr=function(){function e(){Zt(this,e),this.apps=[]}var r,n;return Yt(e,[{key:"push",value:function(e){this.apps.push(e)}},{key:"isReadyToUpload",value:function(){var e,t=qt(this.apps);try{for(t.s();!(e=t.n()).done;){if(e.value.needsExternalData)return!1}}catch(e){t.e(e)}finally{t.f()}return this.apps.length>0}},{key:"upload",value:(n=Xt(t().mark((function e(r,n){var o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.infos.firmware,i={flashStart:o.externalAppsFlashStart,flashLength:o.externalAppsFlashEnd-o.externalAppsFlashStart,ramStart:o.externalAppsRamStart,ramLength:o.externalAppsRamEnd-o.externalAppsRamStart},e.next=4,this.flatBin(i);case 4:a=e.sent,r.process((function(e){return e.downloadFlash(i.flashStart,a,r.infos,(function(e){n(.2*e)}),(function(e){n(.2+.8*e)})).then((function(){return r.dfu.leave(i.flashStart)}))}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"concatenateU8A",value:function(e,t){var r=new Uint8Array(e.byteLength+t.byteLength);return r.set(e,0),r.set(t,e.byteLength),r}},{key:"flatBin",value:(r=Xt(t().mark((function e(r){var n,o,i,a,s,c,u,l,f,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new Uint8Array(0),o=r.flashStart+r.flashLength,i=r.flashStart,a=qt(this.apps),e.prev=4,a.s();case 6:if((s=a.n()).done){e.next=19;break}if(c=s.value,!(i>=o)){e.next=10;break}throw new rr("External app sector would be overflown");case 10:return e.next=12,c.flatBin({flashStart:i,flashLength:o-i,ramStart:r.ramStart,ramLength:r.ramLength});case 12:u=e.sent,n=this.concatenateU8A(n,u),i+=u.byteLength,(l=u.byteLength%Gt.AppSectorSize)>0&&(f=Gt.AppSectorSize-l,(h=new Uint8Array(f)).fill(255),n=this.concatenateU8A(n,h),i+=f);case 17:e.next=6;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(4),a.e(e.t0);case 24:return e.prev=24,a.f(),e.finish(24);case 27:return i<o&&((p=new Uint8Array(Gt.AppSectorSize)).fill(255),n=this.concatenateU8A(n,p)),e.abrupt("return",n);case 29:case"end":return e.stop()}}),e,this,[[4,21,24,27]])}))),function(e){return r.apply(this,arguments)})},{key:"totalSize",value:function(){var e,t=0,r=qt(this.apps);try{for(r.s();!(e=r.n()).done;){t+=e.value.size||0}}catch(e){r.e(e)}finally{r.f()}return t}},{key:"removeAppAtIndex",value:function(e){this.apps.splice(e,1)}}]),e}();const or=nr,ir=r.p+"eadk/eadk.h";function ar(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function sr(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ar(i,n,o,a,s,"next",e)}function s(e){ar(i,n,o,a,s,"throw",e)}a(void 0)}))}}var cr=r(1017),ur=cr.dirname,lr=(cr.resolve,r(7147)),fr=r(7461).Command;function hr(e){var r=new fr;function n(e,t){return o.apply(this,arguments)}function o(){return(o=sr(t().mark((function e(r,n){var o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=lr.readFileSync(r),e.next=3,Gt.from(o);case 3:return i=e.sent,n.externalData&&(a=lr.readFileSync(n.externalData),i.setExternalData(a)),e.abrupt("return",i);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function i(){return i=sr(t().mark((function e(r,o){var i,a,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("Installing",r,"with",o),e.next=3,n(r,o);case 3:return i=e.sent,(a=new or).push(i),s=new At,e.next=9,s.singleConnectAndExtractInfos(!0).then((function(e){return console.log("Got infos"),a.upload(e,(function(e){console.log("Upload progress",e)}))}));case 9:case"end":return e.stop()}}),e)}))),i.apply(this,arguments)}function a(){return(a=sr(t().mark((function e(r,o,i){var a,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(r,i);case 2:return a=e.sent,e.next=5,a.flatElf(i);case 5:s=e.sent,lr.writeFileSync(o,s);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function s(){return(s=sr(t().mark((function e(r,o,i){var a,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(r,i);case 2:return a=e.sent,e.next=5,a.flatBin(i);case 5:s=e.sent,lr.writeFileSync(o,s);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}r.name("nwlink").description("Command-line tool to interact with a NumWorks calculator").version(require("../package.json").version),r.command("install-nwa").description("Install a NWA app").argument("<input.nwa>","Input NWA file").option("-d, --external-data <file>","External data file").action((function(e,t){return i.apply(this,arguments)})),r.command("nwa-elf").description("Link a NWA app").argument("<input.nwa>","Input NWA file").argument("<output.elf>","Output ELF file").option("-d, --external-data <file>","External data file").option("-fs, --flash-start <flashStart>","Flash memory start address","0x90000000").option("-fl, --flash-length <flashLength>","Flash memory length","8M").option("-rs, --ram-start <flashStart>","RAM start address","0x20000000").option("-rl, --ram-length <flashLength>","RAM length","256K").action((function(e,t,r){return a.apply(this,arguments)})),r.command("nwa-bin").description("Link a NWA app and convert to binary format").argument("<input.nwa>","Input NWA file").argument("<output.bin>","Output BIN file").option("-d, --external-data <file>","External data file").option("-fs, --flash-start <flashStart>","Flash memory start address","0x90000000").option("-fl, --flash-length <flashLength>","Flash memory length","8M").option("-rs, --ram-start <flashStart>","RAM start address","0x20000000").option("-rl, --ram-length <flashLength>","RAM length","256K").action((function(e,t,r){return s.apply(this,arguments)})),r.command("png-nwi").description("Convert a PNG file to a NWI image (LZ4-compressed RGB565)").argument("<file.png>","Input PNG file").argument("<file.nwi>","Output NWI file").action((function(e,t){var r=lr.readFileSync(e),n=Ot.fromPNG(r);lr.writeFileSync(t,n.toNWI())})),r.command("eadk-cflags").description("Print EADK CFLAGS").action((function(){var e=["-mthumb","-mfloat-abi=hard","-mcpu=cortex-m7","-mfpu=fpv5-sp-d16","-I"+ur(ir)];console.log(e.join(" "))})),r.parseAsync(e)}global.navigator={usb:o.webusb}})(),module.exports=n.default})();
1
+ (()=>{var t={7481:(t,e,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(t){var e,o,i=void 0!==(t=t||{})?t:{};i.ready=new Promise((function(t,r){e=t,o=r}));var a,s,u,c,l,h,f=Object.assign({},i),p=[],d="./this.program",m=(t,e)=>{throw e},v="object"==typeof window,g="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,D="";_?(D=g?r(1017).dirname(D)+"/":__dirname+"/",h=()=>{l||(c=r(7147),l=r(1017))},a=function(t,e){return h(),t=l.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>{var e=a(t,!0);return e.buffer||(e=new Uint8Array(e)),e},s=(t,e,r)=>{h(),t=l.normalize(t),c.readFile(t,(function(t,n){t?r(t):e(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),p=process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof xt))throw t})),process.on("unhandledRejection",(function(t){throw t})),m=(t,e)=>{if($())throw process.exitCode=t,e;var r;(r=e)instanceof xt||b("exiting due to exception: "+r),process.exit(t)},i.inspect=function(){return"[Emscripten Module object]"}):(v||g)&&(g?D=self.location.href:"undefined"!=typeof document&&document.currentScript&&(D=document.currentScript.src),n&&(D=n),D=0!==D.indexOf("blob:")?D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},g&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});var y,w=i.print||console.log.bind(console),b=i.printErr||console.warn.bind(console);Object.assign(i,f),f=null,i.arguments&&(p=i.arguments),i.thisProgram&&(d=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(y=i.wasmBinary);var E,C=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&et("no native wasm support detected");var F,k=!1;function A(t,e){t||et(e)}var x,S,O,T,P,R,B="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function j(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&B)return B.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var u=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function I(t,e){return t?j(O,t,e):""}function L(t,e,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o}function N(t,e,r){return L(t,O,e,r)}function M(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&t.charCodeAt(++r)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function U(t){x=t,i.HEAP8=S=new Int8Array(t),i.HEAP16=T=new Int16Array(t),i.HEAP32=P=new Int32Array(t),i.HEAPU8=O=new Uint8Array(t),i.HEAPU16=new Uint16Array(t),i.HEAPU32=R=new Uint32Array(t),i.HEAPF32=new Float32Array(t),i.HEAPF64=new Float64Array(t)}i.INITIAL_MEMORY;var H=[],z=[],V=[],G=[];function $(){return C}var q,W,Y,K,X=0,Z=null,Q=null;function J(t){X++,i.monitorRunDependencies&&i.monitorRunDependencies(X)}function tt(t){if(X--,i.monitorRunDependencies&&i.monitorRunDependencies(X),0==X&&(null!==Z&&(clearInterval(Z),Z=null),Q)){var e=Q;Q=null,e()}}function et(t){i.onAbort&&i.onAbort(t),b(t="Aborted("+t+")"),k=!0,F=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}function rt(t){return t.startsWith("data:application/octet-stream;base64,")}function nt(t){try{if(t==q&&y)return new Uint8Array(y);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){et(t)}}function ot(t){for(;t.length>0;)t.shift()(i)}rt(q="ld.wasm")||(W=q,q=i.locateFile?i.locateFile(W,D):D+W);var it={isAbs:t=>"/"===t.charAt(0),splitPath:t=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1),normalizeArray:(t,e)=>{for(var r=0,n=t.length-1;n>=0;n--){var o=t[n];"."===o?t.splice(n,1):".."===o?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},normalize:t=>{var e=it.isAbs(t),r="/"===t.substr(-1);return(t=it.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},dirname:t=>{var e=it.splitPath(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:t=>{if("/"===t)return"/";var e=(t=(t=it.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},join:function(){var t=Array.prototype.slice.call(arguments,0);return it.normalize(t.join("/"))},join2:(t,e)=>it.normalize(t+"/"+e)},at={resolve:function(){for(var t="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:ht.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e=it.isAbs(n)}return(e?"/":"")+(t=it.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||"."},relative:(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=at.resolve(t).substr(1),e=at.resolve(e).substr(1);for(var n=r(t.split("/")),o=r(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},st={ttys:[],init:function(){},shutdown:function(){},register:function(t,e){st.ttys[t]={input:[],output:[],ops:e},ht.registerDevice(t,st.stream_ops)},stream_ops:{open:function(t){var e=st.ttys[t.node.rdev];if(!e)throw new ht.ErrnoError(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.ops.flush(t.tty)},flush:function(t){t.tty.ops.flush(t.tty)},read:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.get_char)throw new ht.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=t.tty.ops.get_char(t.tty)}catch(t){throw new ht.ErrnoError(29)}if(void 0===s&&0===i)throw new ht.ErrnoError(6);if(null==s)break;i++,e[r+a]=s}return i&&(t.node.timestamp=Date.now()),i},write:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.put_char)throw new ht.ErrnoError(60);try{for(var i=0;i<n;i++)t.tty.ops.put_char(t.tty,e[r+i])}catch(t){throw new ht.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(t){if(!t.input.length){var e=null;if(_){var r=Buffer.alloc(256),n=0;try{n=c.readSync(process.stdin.fd,r,0,256,-1)}catch(t){if(!t.toString().includes("EOF"))throw t;n=0}e=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;t.input=Et(e,!0)}return t.input.shift()},put_char:function(t,e){null===e||10===e?(w(j(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(w(j(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,e){null===e||10===e?(b(j(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(b(j(t.output,0)),t.output=[])}}};function ut(t){et()}var ct,lt={ops_table:null,mount:function(t){return lt.createNode(null,"/",16895,0)},createNode:function(t,e,r,n){if(ht.isBlkdev(r)||ht.isFIFO(r))throw new ht.ErrnoError(63);lt.ops_table||(lt.ops_table={dir:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr,lookup:lt.node_ops.lookup,mknod:lt.node_ops.mknod,rename:lt.node_ops.rename,unlink:lt.node_ops.unlink,rmdir:lt.node_ops.rmdir,readdir:lt.node_ops.readdir,symlink:lt.node_ops.symlink},stream:{llseek:lt.stream_ops.llseek}},file:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr},stream:{llseek:lt.stream_ops.llseek,read:lt.stream_ops.read,write:lt.stream_ops.write,allocate:lt.stream_ops.allocate,mmap:lt.stream_ops.mmap,msync:lt.stream_ops.msync}},link:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr,readlink:lt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:lt.node_ops.getattr,setattr:lt.node_ops.setattr},stream:ht.chrdev_stream_ops}});var o=ht.createNode(t,e,r,n);return ht.isDir(o.mode)?(o.node_ops=lt.ops_table.dir.node,o.stream_ops=lt.ops_table.dir.stream,o.contents={}):ht.isFile(o.mode)?(o.node_ops=lt.ops_table.file.node,o.stream_ops=lt.ops_table.file.stream,o.usedBytes=0,o.contents=null):ht.isLink(o.mode)?(o.node_ops=lt.ops_table.link.node,o.stream_ops=lt.ops_table.link.stream):ht.isChrdev(o.mode)&&(o.node_ops=lt.ops_table.chrdev.node,o.stream_ops=lt.ops_table.chrdev.stream),o.timestamp=Date.now(),t&&(t.contents[e]=o,t.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,e){var r=t.contents?t.contents.length:0;if(!(r>=e)){e=Math.max(e,r*(r<1048576?2:1.125)>>>0),0!=r&&(e=Math.max(e,256));var n=t.contents;t.contents=new Uint8Array(e),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage:function(t,e){if(t.usedBytes!=e)if(0==e)t.contents=null,t.usedBytes=0;else{var r=t.contents;t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e}},node_ops:{getattr:function(t){var e={};return e.dev=ht.isChrdev(t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,ht.isDir(t.mode)?e.size=4096:ht.isFile(t.mode)?e.size=t.usedBytes:ht.isLink(t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&lt.resizeFileStorage(t,e.size)},lookup:function(t,e){throw ht.genericErrors[44]},mknod:function(t,e,r,n){return lt.createNode(t,e,r,n)},rename:function(t,e,r){if(ht.isDir(t.mode)){var n;try{n=ht.lookupNode(e,r)}catch(t){}if(n)for(var o in n.contents)throw new ht.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=r,e.contents[r]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink:function(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir:function(t,e){var r=ht.lookupNode(t,e);for(var n in r.contents)throw new ht.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir:function(t){var e=[".",".."];for(var r in t.contents)t.contents.hasOwnProperty(r)&&e.push(r);return e},symlink:function(t,e,r){var n=lt.createNode(t,e,41471,0);return n.link=r,n},readlink:function(t){if(!ht.isLink(t.mode))throw new ht.ErrnoError(28);return t.link}},stream_ops:{read:function(t,e,r,n,o){var i=t.node.contents;if(o>=t.node.usedBytes)return 0;var a=Math.min(t.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)e[r+s]=i[o+s];return a},write:function(t,e,r,n,o,i){if(e.buffer===S.buffer&&(i=!1),!n)return 0;var a=t.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(r,r+n),o),n}if(lt.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(t,e,r){var n=e;if(1===r?n+=t.position:2===r&&ht.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new ht.ErrnoError(28);return n},allocate:function(t,e,r){lt.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap:function(t,e,r,n,o){if(!ht.isFile(t.node.mode))throw new ht.ErrnoError(43);var i,a,s=t.node.contents;if(2&o||s.buffer!==x){if((r>0||r+e<s.length)&&(s=s.subarray?s.subarray(r,r+e):Array.prototype.slice.call(s,r,r+e)),a=!0,!(i=ut()))throw new ht.ErrnoError(48);S.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(t,e,r,n,o){if(!ht.isFile(t.node.mode))throw new ht.ErrnoError(43);return 2&o||lt.stream_ops.write(t,e,0,n,r,!1),0}}},ht={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(t,e={})=>{if(!(t=at.resolve(ht.cwd(),t)))return{path:"",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new ht.ErrnoError(32);for(var r=it.normalizeArray(t.split("/").filter((t=>!!t)),!1),n=ht.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&e.parent)break;if(n=ht.lookupNode(n,r[i]),o=it.join2(o,r[i]),ht.isMountpoint(n)&&(!a||a&&e.follow_mount)&&(n=n.mounted.root),!a||e.follow)for(var s=0;ht.isLink(n.mode);){var u=ht.readlink(o);if(o=at.resolve(it.dirname(o),u),n=ht.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new ht.ErrnoError(32)}}return{path:o,node:n}},getPath:t=>{for(var e;;){if(ht.isRoot(t)){var r=t.mount.mountpoint;return e?"/"!==r[r.length-1]?r+"/"+e:r+e:r}e=e?t.name+"/"+e:t.name,t=t.parent}},hashName:(t,e)=>{for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%ht.nameTable.length},hashAddNode:t=>{var e=ht.hashName(t.parent.id,t.name);t.name_next=ht.nameTable[e],ht.nameTable[e]=t},hashRemoveNode:t=>{var e=ht.hashName(t.parent.id,t.name);if(ht.nameTable[e]===t)ht.nameTable[e]=t.name_next;else for(var r=ht.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode:(t,e)=>{var r=ht.mayLookup(t);if(r)throw new ht.ErrnoError(r,t);for(var n=ht.hashName(t.id,e),o=ht.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===t.id&&i===e)return o}return ht.lookup(t,e)},createNode:(t,e,r,n)=>{var o=new ht.FSNode(t,e,r,n);return ht.hashAddNode(o),o},destroyNode:t=>{ht.hashRemoveNode(t)},isRoot:t=>t===t.parent,isMountpoint:t=>!!t.mounted,isFile:t=>32768==(61440&t),isDir:t=>16384==(61440&t),isLink:t=>40960==(61440&t),isChrdev:t=>8192==(61440&t),isBlkdev:t=>24576==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>49152==(49152&t),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:t=>{var e=ht.flagModes[t];if(void 0===e)throw new Error("Unknown file open mode: "+t);return e},flagsToPermissionString:t=>{var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:(t,e)=>ht.ignorePermissions||(!e.includes("r")||292&t.mode)&&(!e.includes("w")||146&t.mode)&&(!e.includes("x")||73&t.mode)?0:2,mayLookup:t=>{var e=ht.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate:(t,e)=>{try{return ht.lookupNode(t,e),20}catch(t){}return ht.nodePermissions(t,"wx")},mayDelete:(t,e,r)=>{var n;try{n=ht.lookupNode(t,e)}catch(t){return t.errno}var o=ht.nodePermissions(t,"wx");if(o)return o;if(r){if(!ht.isDir(n.mode))return 54;if(ht.isRoot(n)||ht.getPath(n)===ht.cwd())return 10}else if(ht.isDir(n.mode))return 31;return 0},mayOpen:(t,e)=>t?ht.isLink(t.mode)?32:ht.isDir(t.mode)&&("r"!==ht.flagsToPermissionString(e)||512&e)?31:ht.nodePermissions(t,ht.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(t=0,e=ht.MAX_OPEN_FDS)=>{for(var r=t;r<=e;r++)if(!ht.streams[r])return r;throw new ht.ErrnoError(33)},getStream:t=>ht.streams[t],createStream:(t,e,r)=>{ht.FSStream||(ht.FSStream=function(){this.shared={}},ht.FSStream.prototype={},Object.defineProperties(ht.FSStream.prototype,{object:{get:function(){return this.node},set:function(t){this.node=t}},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(t){this.shared.flags=t}},position:{get:function(){return this.shared.position},set:function(t){this.shared.position=t}}})),t=Object.assign(new ht.FSStream,t);var n=ht.nextfd(e,r);return t.fd=n,ht.streams[n]=t,t},closeStream:t=>{ht.streams[t]=null},chrdev_stream_ops:{open:t=>{var e=ht.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:()=>{throw new ht.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,e)=>t<<8|e,registerDevice:(t,e)=>{ht.devices[t]={stream_ops:e}},getDevice:t=>ht.devices[t],getMounts:t=>{for(var e=[],r=[t];r.length;){var n=r.pop();e.push(n),r.push.apply(r,n.mounts)}return e},syncfs:(t,e)=>{"function"==typeof t&&(e=t,t=!1),ht.syncFSRequests++,ht.syncFSRequests>1&&b("warning: "+ht.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=ht.getMounts(ht.root.mount),n=0;function o(t){return ht.syncFSRequests--,e(t)}function i(t){if(t)return i.errored?void 0:(i.errored=!0,o(t));++n>=r.length&&o(null)}r.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,t,i)}))},mount:(t,e,r)=>{var n,o="/"===r,i=!r;if(o&&ht.root)throw new ht.ErrnoError(10);if(!o&&!i){var a=ht.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,ht.isMountpoint(n))throw new ht.ErrnoError(10);if(!ht.isDir(n.mode))throw new ht.ErrnoError(54)}var s={type:t,opts:e,mountpoint:r,mounts:[]},u=t.mount(s);return u.mount=s,s.root=u,o?ht.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:t=>{var e=ht.lookupPath(t,{follow_mount:!1});if(!ht.isMountpoint(e.node))throw new ht.ErrnoError(28);var r=e.node,n=r.mounted,o=ht.getMounts(n);Object.keys(ht.nameTable).forEach((t=>{for(var e=ht.nameTable[t];e;){var r=e.name_next;o.includes(e.mount)&&ht.destroyNode(e),e=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(t,e)=>t.node_ops.lookup(t,e),mknod:(t,e,r)=>{var n=ht.lookupPath(t,{parent:!0}).node,o=it.basename(t);if(!o||"."===o||".."===o)throw new ht.ErrnoError(28);var i=ht.mayCreate(n,o);if(i)throw new ht.ErrnoError(i);if(!n.node_ops.mknod)throw new ht.ErrnoError(63);return n.node_ops.mknod(n,o,e,r)},create:(t,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,ht.mknod(t,e,0)),mkdir:(t,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,ht.mknod(t,e,0)),mkdirTree:(t,e)=>{for(var r=t.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{ht.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:(t,e,r)=>(void 0===r&&(r=e,e=438),e|=8192,ht.mknod(t,e,r)),symlink:(t,e)=>{if(!at.resolve(t))throw new ht.ErrnoError(44);var r=ht.lookupPath(e,{parent:!0}).node;if(!r)throw new ht.ErrnoError(44);var n=it.basename(e),o=ht.mayCreate(r,n);if(o)throw new ht.ErrnoError(o);if(!r.node_ops.symlink)throw new ht.ErrnoError(63);return r.node_ops.symlink(r,n,t)},rename:(t,e)=>{var r,n,o=it.dirname(t),i=it.dirname(e),a=it.basename(t),s=it.basename(e);if(r=ht.lookupPath(t,{parent:!0}).node,n=ht.lookupPath(e,{parent:!0}).node,!r||!n)throw new ht.ErrnoError(44);if(r.mount!==n.mount)throw new ht.ErrnoError(75);var u,c=ht.lookupNode(r,a),l=at.relative(t,i);if("."!==l.charAt(0))throw new ht.ErrnoError(28);if("."!==(l=at.relative(e,o)).charAt(0))throw new ht.ErrnoError(55);try{u=ht.lookupNode(n,s)}catch(t){}if(c!==u){var h=ht.isDir(c.mode),f=ht.mayDelete(r,a,h);if(f)throw new ht.ErrnoError(f);if(f=u?ht.mayDelete(n,s,h):ht.mayCreate(n,s))throw new ht.ErrnoError(f);if(!r.node_ops.rename)throw new ht.ErrnoError(63);if(ht.isMountpoint(c)||u&&ht.isMountpoint(u))throw new ht.ErrnoError(10);if(n!==r&&(f=ht.nodePermissions(r,"w")))throw new ht.ErrnoError(f);ht.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(t){throw t}finally{ht.hashAddNode(c)}}},rmdir:t=>{var e=ht.lookupPath(t,{parent:!0}).node,r=it.basename(t),n=ht.lookupNode(e,r),o=ht.mayDelete(e,r,!0);if(o)throw new ht.ErrnoError(o);if(!e.node_ops.rmdir)throw new ht.ErrnoError(63);if(ht.isMountpoint(n))throw new ht.ErrnoError(10);e.node_ops.rmdir(e,r),ht.destroyNode(n)},readdir:t=>{var e=ht.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new ht.ErrnoError(54);return e.node_ops.readdir(e)},unlink:t=>{var e=ht.lookupPath(t,{parent:!0}).node;if(!e)throw new ht.ErrnoError(44);var r=it.basename(t),n=ht.lookupNode(e,r),o=ht.mayDelete(e,r,!1);if(o)throw new ht.ErrnoError(o);if(!e.node_ops.unlink)throw new ht.ErrnoError(63);if(ht.isMountpoint(n))throw new ht.ErrnoError(10);e.node_ops.unlink(e,r),ht.destroyNode(n)},readlink:t=>{var e=ht.lookupPath(t).node;if(!e)throw new ht.ErrnoError(44);if(!e.node_ops.readlink)throw new ht.ErrnoError(28);return at.resolve(ht.getPath(e.parent),e.node_ops.readlink(e))},stat:(t,e)=>{var r=ht.lookupPath(t,{follow:!e}).node;if(!r)throw new ht.ErrnoError(44);if(!r.node_ops.getattr)throw new ht.ErrnoError(63);return r.node_ops.getattr(r)},lstat:t=>ht.stat(t,!0),chmod:(t,e,r)=>{var n;if(!(n="string"==typeof t?ht.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new ht.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(t,e)=>{ht.chmod(t,e,!0)},fchmod:(t,e)=>{var r=ht.getStream(t);if(!r)throw new ht.ErrnoError(8);ht.chmod(r.node,e)},chown:(t,e,r,n)=>{var o;if(!(o="string"==typeof t?ht.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new ht.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(t,e,r)=>{ht.chown(t,e,r,!0)},fchown:(t,e,r)=>{var n=ht.getStream(t);if(!n)throw new ht.ErrnoError(8);ht.chown(n.node,e,r)},truncate:(t,e)=>{if(e<0)throw new ht.ErrnoError(28);var r;if(!(r="string"==typeof t?ht.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new ht.ErrnoError(63);if(ht.isDir(r.mode))throw new ht.ErrnoError(31);if(!ht.isFile(r.mode))throw new ht.ErrnoError(28);var n=ht.nodePermissions(r,"w");if(n)throw new ht.ErrnoError(n);r.node_ops.setattr(r,{size:e,timestamp:Date.now()})},ftruncate:(t,e)=>{var r=ht.getStream(t);if(!r)throw new ht.ErrnoError(8);if(0==(2097155&r.flags))throw new ht.ErrnoError(28);ht.truncate(r.node,e)},utime:(t,e,r)=>{var n=ht.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,r)})},open:(t,e,r)=>{if(""===t)throw new ht.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(e="string"==typeof e?ht.modeStringToFlags(e):e)?4095&r|32768:0,"object"==typeof t)n=t;else{t=it.normalize(t);try{n=ht.lookupPath(t,{follow:!(131072&e)}).node}catch(t){}}var o=!1;if(64&e)if(n){if(128&e)throw new ht.ErrnoError(20)}else n=ht.mknod(t,r,0),o=!0;if(!n)throw new ht.ErrnoError(44);if(ht.isChrdev(n.mode)&&(e&=-513),65536&e&&!ht.isDir(n.mode))throw new ht.ErrnoError(54);if(!o){var a=ht.mayOpen(n,e);if(a)throw new ht.ErrnoError(a)}512&e&&!o&&ht.truncate(n,0),e&=-131713;var s=ht.createStream({node:n,path:ht.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&e||(ht.readFiles||(ht.readFiles={}),t in ht.readFiles||(ht.readFiles[t]=1)),s},close:t=>{if(ht.isClosed(t))throw new ht.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{ht.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek:(t,e,r)=>{if(ht.isClosed(t))throw new ht.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new ht.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new ht.ErrnoError(28);return t.position=t.stream_ops.llseek(t,e,r),t.ungotten=[],t.position},read:(t,e,r,n,o)=>{if(n<0||o<0)throw new ht.ErrnoError(28);if(ht.isClosed(t))throw new ht.ErrnoError(8);if(1==(2097155&t.flags))throw new ht.ErrnoError(8);if(ht.isDir(t.node.mode))throw new ht.ErrnoError(31);if(!t.stream_ops.read)throw new ht.ErrnoError(28);var i=void 0!==o;if(i){if(!t.seekable)throw new ht.ErrnoError(70)}else o=t.position;var a=t.stream_ops.read(t,e,r,n,o);return i||(t.position+=a),a},write:(t,e,r,n,o,i)=>{if(n<0||o<0)throw new ht.ErrnoError(28);if(ht.isClosed(t))throw new ht.ErrnoError(8);if(0==(2097155&t.flags))throw new ht.ErrnoError(8);if(ht.isDir(t.node.mode))throw new ht.ErrnoError(31);if(!t.stream_ops.write)throw new ht.ErrnoError(28);t.seekable&&1024&t.flags&&ht.llseek(t,0,2);var a=void 0!==o;if(a){if(!t.seekable)throw new ht.ErrnoError(70)}else o=t.position;var s=t.stream_ops.write(t,e,r,n,o,i);return a||(t.position+=s),s},allocate:(t,e,r)=>{if(ht.isClosed(t))throw new ht.ErrnoError(8);if(e<0||r<=0)throw new ht.ErrnoError(28);if(0==(2097155&t.flags))throw new ht.ErrnoError(8);if(!ht.isFile(t.node.mode)&&!ht.isDir(t.node.mode))throw new ht.ErrnoError(43);if(!t.stream_ops.allocate)throw new ht.ErrnoError(138);t.stream_ops.allocate(t,e,r)},mmap:(t,e,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&t.flags))throw new ht.ErrnoError(2);if(1==(2097155&t.flags))throw new ht.ErrnoError(2);if(!t.stream_ops.mmap)throw new ht.ErrnoError(43);return t.stream_ops.mmap(t,e,r,n,o)},msync:(t,e,r,n,o)=>t&&t.stream_ops.msync?t.stream_ops.msync(t,e,r,n,o):0,munmap:t=>0,ioctl:(t,e,r)=>{if(!t.stream_ops.ioctl)throw new ht.ErrnoError(59);return t.stream_ops.ioctl(t,e,r)},readFile:(t,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var r,n=ht.open(t,e.flags),o=ht.stat(t).size,i=new Uint8Array(o);return ht.read(n,i,0,o,0),"utf8"===e.encoding?r=j(i,0):"binary"===e.encoding&&(r=i),ht.close(n),r},writeFile:(t,e,r={})=>{r.flags=r.flags||577;var n=ht.open(t,r.flags,r.mode);if("string"==typeof e){var o=new Uint8Array(M(e)+1),i=L(e,o,0,o.length);ht.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");ht.write(n,e,0,e.byteLength,void 0,r.canOwn)}ht.close(n)},cwd:()=>ht.currentPath,chdir:t=>{var e=ht.lookupPath(t,{follow:!0});if(null===e.node)throw new ht.ErrnoError(44);if(!ht.isDir(e.node.mode))throw new ht.ErrnoError(54);var r=ht.nodePermissions(e.node,"x");if(r)throw new ht.ErrnoError(r);ht.currentPath=e.path},createDefaultDirectories:()=>{ht.mkdir("/tmp"),ht.mkdir("/home"),ht.mkdir("/home/web_user")},createDefaultDevices:()=>{ht.mkdir("/dev"),ht.registerDevice(ht.makedev(1,3),{read:()=>0,write:(t,e,r,n,o)=>n}),ht.mkdev("/dev/null",ht.makedev(1,3)),st.register(ht.makedev(5,0),st.default_tty_ops),st.register(ht.makedev(6,0),st.default_tty1_ops),ht.mkdev("/dev/tty",ht.makedev(5,0)),ht.mkdev("/dev/tty1",ht.makedev(6,0));var t=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return function(){return crypto.getRandomValues(t),t[0]}}if(_)try{var e=r(6113);return function(){return e.randomBytes(1)[0]}}catch(t){}return function(){et("randomDevice")}}();ht.createDevice("/dev","random",t),ht.createDevice("/dev","urandom",t),ht.mkdir("/dev/shm"),ht.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{ht.mkdir("/proc");var t=ht.mkdir("/proc/self");ht.mkdir("/proc/self/fd"),ht.mount({mount:()=>{var e=ht.createNode(t,"fd",16895,73);return e.node_ops={lookup:(t,e)=>{var r=+e,n=ht.getStream(r);if(!n)throw new ht.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?ht.createDevice("/dev","stdin",i.stdin):ht.symlink("/dev/tty","/dev/stdin"),i.stdout?ht.createDevice("/dev","stdout",null,i.stdout):ht.symlink("/dev/tty","/dev/stdout"),i.stderr?ht.createDevice("/dev","stderr",null,i.stderr):ht.symlink("/dev/tty1","/dev/stderr"),ht.open("/dev/stdin",0),ht.open("/dev/stdout",1),ht.open("/dev/stderr",1)},ensureErrnoError:()=>{ht.ErrnoError||(ht.ErrnoError=function(t,e){this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},ht.ErrnoError.prototype=new Error,ht.ErrnoError.prototype.constructor=ht.ErrnoError,[44].forEach((t=>{ht.genericErrors[t]=new ht.ErrnoError(t),ht.genericErrors[t].stack="<generic error, no stack>"})))},staticInit:()=>{ht.ensureErrnoError(),ht.nameTable=new Array(4096),ht.mount(lt,{},"/"),ht.createDefaultDirectories(),ht.createDefaultDevices(),ht.createSpecialDirectories(),ht.filesystems={MEMFS:lt}},init:(t,e,r)=>{ht.init.initialized=!0,ht.ensureErrnoError(),i.stdin=t||i.stdin,i.stdout=e||i.stdout,i.stderr=r||i.stderr,ht.createStandardStreams()},quit:()=>{ht.init.initialized=!1;for(var t=0;t<ht.streams.length;t++){var e=ht.streams[t];e&&ht.close(e)}},getMode:(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},findObject:(t,e)=>{var r=ht.analyzePath(t,e);return r.exists?r.object:null},analyzePath:(t,e)=>{try{t=(n=ht.lookupPath(t,{follow:!e})).path}catch(t){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ht.lookupPath(t,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=it.basename(t),n=ht.lookupPath(t,{follow:!e}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(t){r.error=t.errno}return r},createPath:(t,e,r,n)=>{t="string"==typeof t?t:ht.getPath(t);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=it.join2(t,i);try{ht.mkdir(a)}catch(t){}t=a}}return a},createFile:(t,e,r,n,o)=>{var i=it.join2("string"==typeof t?t:ht.getPath(t),e),a=ht.getMode(n,o);return ht.create(i,a)},createDataFile:(t,e,r,n,o,i)=>{var a=e;t&&(t="string"==typeof t?t:ht.getPath(t),a=e?it.join2(t,e):t);var s=ht.getMode(n,o),u=ht.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,h=r.length;l<h;++l)c[l]=r.charCodeAt(l);r=c}ht.chmod(u,146|s);var f=ht.open(u,577);ht.write(f,r,0,r.length,0,i),ht.close(f),ht.chmod(u,s)}return u},createDevice:(t,e,r,n)=>{var o=it.join2("string"==typeof t?t:ht.getPath(t),e),i=ht.getMode(!!r,!!n);ht.createDevice.major||(ht.createDevice.major=64);var a=ht.makedev(ht.createDevice.major++,0);return ht.registerDevice(a,{open:t=>{t.seekable=!1},close:t=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(t,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(t){throw new ht.ErrnoError(29)}if(void 0===u&&0===a)throw new ht.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(t.node.timestamp=Date.now()),a},write:(t,e,r,o,i)=>{for(var a=0;a<o;a++)try{n(e[r+a])}catch(t){throw new ht.ErrnoError(29)}return o&&(t.node.timestamp=Date.now()),a}}),ht.mkdev(o,i,a)},forceLoadFile:t=>{if(t.isDevice||t.isFolder||t.link||t.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(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=Et(a(t.url),!0),t.usedBytes=t.contents.length}catch(t){throw new ht.ErrnoError(29)}},createLazyFile:(t,e,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(t){if(!(t>this.length-1||t<0)){var e=t%this.chunkSize,r=t/this.chunkSize|0;return this.getter(r)[e]}},i.prototype.setDataGetter=function(t){this.getter=t},i.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",r,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),o=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((t=>{var e=t*a,o=(t+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[t]&&(s.chunks[t]=((t,e)=>{if(t>e)throw new Error("invalid range ("+t+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+t+"-"+e),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||[]):Et(o.responseText||"",!0)})(e,o)),void 0===s.chunks[t])throw new Error("doXHR failed!");return s.chunks[t]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!g)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=ht.createFile(t,e,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(t,e,r,n,o){var i=t.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[r+s]=i[o+s];else for(s=0;s<a;s++)e[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((t=>{var e=u.stream_ops[t];c[t]=function(){return ht.forceLoadFile(u),e.apply(null,arguments)}})),c.read=(t,e,r,n,o)=>(ht.forceLoadFile(u),l(t,e,r,n,o)),c.mmap=(t,e,r,n,o)=>{ht.forceLoadFile(u);var i=ut();if(!i)throw new ht.ErrnoError(48);return l(t,S,i,e,r),{ptr:i,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(t,e,r,n,o,i,a,u,c,l)=>{var h=e?at.resolve(it.join2(t,e)):t;function f(r){function s(r){l&&l(),u||ht.createDataFile(t,e,r,n,o,c),i&&i(),tt()}Browser.handledByPreloadPlugin(r,h,s,(()=>{a&&a(),tt()}))||s(r)}J(),"string"==typeof r?function(t,e,r,n){var o=n?"":"al "+t;s(t,(function(r){A(r,'Loading data file "'+t+'" failed (no arrayBuffer).'),e(new Uint8Array(r)),o&&tt()}),(function(e){if(!r)throw'Loading data file "'+t+'" failed.';r()})),o&&J()}(r,(t=>f(t)),a):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:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=ht.indexedDB();try{var o=n.open(ht.DB_NAME(),ht.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=()=>{w("creating db"),o.result.createObjectStore(ht.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([ht.DB_STORE_NAME],"readwrite"),i=n.objectStore(ht.DB_STORE_NAME),a=0,s=0,u=t.length;function c(){0==s?e():r()}t.forEach((t=>{var e=i.put(ht.analyzePath(t).object.contents,t);e.onsuccess=()=>{++a+s==u&&c()},e.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=ht.indexedDB();try{var o=n.open(ht.DB_NAME(),ht.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([ht.DB_STORE_NAME],"readonly")}catch(t){return void r(t)}var a=i.objectStore(ht.DB_STORE_NAME),s=0,u=0,c=t.length;function l(){0==u?e():r()}t.forEach((t=>{var e=a.get(t);e.onsuccess=()=>{ht.analyzePath(t).exists&&ht.unlink(t),ht.createDataFile(it.dirname(t),it.basename(t),e.result,!0,!0,!0),++s+u==c&&l()},e.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=r},o.onerror=r}},ft={DEFAULT_POLLMASK:5,calculateAt:function(t,e,r){if(it.isAbs(e))return e;var n;if(-100===t)n=ht.cwd();else{var o=ht.getStream(t);if(!o)throw new ht.ErrnoError(8);n=o.path}if(0==e.length){if(!r)throw new ht.ErrnoError(44);return n}return it.join2(n,e)},doStat:function(t,e,r){try{var n=t(e)}catch(t){if(t&&t.node&&it.normalize(e)!==it.normalize(ht.getPath(t.node)))return-54;throw t}return P[r>>2]=n.dev,P[r+4>>2]=0,P[r+8>>2]=n.ino,P[r+12>>2]=n.mode,P[r+16>>2]=n.nlink,P[r+20>>2]=n.uid,P[r+24>>2]=n.gid,P[r+28>>2]=n.rdev,P[r+32>>2]=0,K=[n.size>>>0,(Y=n.size,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],P[r+40>>2]=K[0],P[r+44>>2]=K[1],P[r+48>>2]=4096,P[r+52>>2]=n.blocks,P[r+56>>2]=n.atime.getTime()/1e3|0,P[r+60>>2]=0,P[r+64>>2]=n.mtime.getTime()/1e3|0,P[r+68>>2]=0,P[r+72>>2]=n.ctime.getTime()/1e3|0,P[r+76>>2]=0,K=[n.ino>>>0,(Y=n.ino,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],P[r+80>>2]=K[0],P[r+84>>2]=K[1],0},doMsync:function(t,e,r,n,o){var i=O.slice(t,t+r);ht.msync(e,i,o,r,n)},varargs:void 0,get:function(){return ft.varargs+=4,P[ft.varargs-4>>2]},getStr:function(t){return I(t)},getStreamFromFD:function(t){var e=ht.getStream(t);if(!e)throw new ht.ErrnoError(8);return e}},pt={BUCKET_BUFFER_SIZE:8192,mount:function(t){return ht.createNode(null,"/",16895,0)},createPipe:function(){var t={buckets:[],refcnt:2};t.buckets.push({buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var e=pt.nextname(),r=pt.nextname(),n=ht.createNode(pt.root,e,4096,0),o=ht.createNode(pt.root,r,4096,0);n.pipe=t,o.pipe=t;var i=ht.createStream({path:e,node:n,flags:0,seekable:!1,stream_ops:pt.stream_ops});n.stream=i;var a=ht.createStream({path:r,node:o,flags:1,seekable:!1,stream_ops:pt.stream_ops});return o.stream=a,{readable_fd:i.fd,writable_fd:a.fd}},stream_ops:{poll:function(t){var e=t.node.pipe;if(1==(2097155&t.flags))return 260;if(e.buckets.length>0)for(var r=0;r<e.buckets.length;r++){var n=e.buckets[r];if(n.offset-n.roffset>0)return 65}return 0},ioctl:function(t,e,r){return 28},fsync:function(t){return 28},read:function(t,e,r,n,o){for(var i=t.node.pipe,a=0,s=0;s<i.buckets.length;s++){var u=i.buckets[s];a+=u.offset-u.roffset}A(e instanceof ArrayBuffer||ArrayBuffer.isView(e));var c=e.subarray(r,r+n);if(n<=0)return 0;if(0==a)throw new ht.ErrnoError(6);var l=Math.min(a,n),h=l,f=0;for(s=0;s<i.buckets.length;s++){var p=i.buckets[s],d=p.offset-p.roffset;if(l<=d){var m=p.buffer.subarray(p.roffset,p.offset);l<d?(m=m.subarray(0,l),p.roffset+=l):f++,c.set(m);break}m=p.buffer.subarray(p.roffset,p.offset),c.set(m),c=c.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),h},write:function(t,e,r,n,o){var i=t.node.pipe;A(e instanceof ArrayBuffer||ArrayBuffer.isView(e));var a=e.subarray(r,r+n),s=a.byteLength;if(s<=0)return 0;var u=null;0==i.buckets.length?(u={buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:0,roffset:0},i.buckets.push(u)):u=i.buckets[i.buckets.length-1],A(u.offset<=pt.BUCKET_BUFFER_SIZE);var c=pt.BUCKET_BUFFER_SIZE-u.offset;if(c>=s)return u.buffer.set(a,u.offset),u.offset+=s,s;c>0&&(u.buffer.set(a.subarray(0,c),u.offset),u.offset+=c,a=a.subarray(c,a.byteLength));for(var l=a.byteLength/pt.BUCKET_BUFFER_SIZE|0,h=a.byteLength%pt.BUCKET_BUFFER_SIZE,f=0;f<l;f++){var p={buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:pt.BUCKET_BUFFER_SIZE,roffset:0};i.buckets.push(p),p.buffer.set(a.subarray(0,pt.BUCKET_BUFFER_SIZE)),a=a.subarray(pt.BUCKET_BUFFER_SIZE,a.byteLength)}return h>0&&(p={buffer:new Uint8Array(pt.BUCKET_BUFFER_SIZE),offset:a.byteLength,roffset:0},i.buckets.push(p),p.buffer.set(a)),s},close:function(t){var e=t.node.pipe;e.refcnt--,0===e.refcnt&&(e.buckets=null)}},nextname:function(){return pt.nextname.current||(pt.nextname.current=0),"pipe["+pt.nextname.current+++"]"}},dt="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";function mt(t){try{return E.grow(t-x.byteLength+65535>>>16),U(E.buffer),1}catch(t){}}ct=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now();var vt={};function gt(){if(!gt.strings){var t={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",_:d||"./this.program"};for(var e in vt)void 0===vt[e]?delete t[e]:t[e]=vt[e];var r=[];for(var e in t)r.push(e+"="+t[e]);gt.strings=r}return gt.strings}function _t(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=R[e>>2],s=R[e+4>>2];e+=8;var u=ht.read(t,S,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}function Dt(t,e){return e+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*e:NaN}var yt=function(t,e,r,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=ht.nextInode++,this.name=e,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},wt=365,bt=146;function Et(t,e,r){var n=r>0?r:M(t)+1,o=new Array(n),i=L(t,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(yt.prototype,{read:{get:function(){return(this.mode&wt)===wt},set:function(t){t?this.mode|=wt:this.mode&=-366}},write:{get:function(){return(this.mode&bt)===bt},set:function(t){t?this.mode|=bt:this.mode&=-147}},isFolder:{get:function(){return ht.isDir(this.mode)}},isDevice:{get:function(){return ht.isChrdev(this.mode)}}}),ht.FSNode=yt,ht.staticInit();var Ct,Ft={a:function(t,e,r,n){et("Assertion failed: "+I(t)+", at: "+[e?I(e):"unknown filename",r,n?I(n):"unknown function"])},G:function(t,e){try{return t=ft.getStr(t),ht.chmod(t,e),0}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},F:function(t){try{var e=ft.getStreamFromFD(t);return ht.createStream(e,0).fd}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},H:function(t,e,r,n){try{if(e=ft.getStr(e),e=ft.calculateAt(t,e),-8&r)return-28;var o=ht.lookupPath(e,{follow:!0}).node;if(!o)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&&ht.nodePermissions(o,i)?-2:0}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},e:function(t,e,r){ft.varargs=r;try{var n=ft.getStreamFromFD(t);switch(e){case 0:return(o=ft.get())<0?-28:ht.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=ft.get();return n.flags|=o,0;case 5:return o=ft.get(),T[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,P[kt()>>2]=i,-1}}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}var i},z:function(t,e){try{var r=ft.getStreamFromFD(t);return ft.doStat(ht.stat,r.path,e)}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},v:function(t,e){try{if(0===e)return-28;var r=ht.cwd(),n=M(r)+1;return e<n?-68:(N(r,t,e),n)}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},m:function(t,e,r){ft.varargs=r;try{var n=ft.getStreamFromFD(t);switch(e){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=ft.get();return P[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=ft.get(),ht.ioctl(n,e,o);default:et("bad ioctl syscall "+e)}}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},x:function(t,e){try{return t=ft.getStr(t),ft.doStat(ht.lstat,t,e)}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},w:function(t,e,r,n){try{e=ft.getStr(e);var o=256&n,i=4096&n;return n&=-4353,e=ft.calculateAt(t,e,i),ft.doStat(o?ht.lstat:ht.stat,e,r)}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},h:function(t,e,r,n){ft.varargs=n;try{e=ft.getStr(e),e=ft.calculateAt(t,e);var o=n?ft.get():0;return ht.open(e,r,o).fd}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},t:function(t){try{if(0==t)throw new ht.ErrnoError(21);var e=pt.createPipe();return P[t>>2]=e.readable_fd,P[t+4>>2]=e.writable_fd,0}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},s:function(t,e,r,n){try{if(e=ft.getStr(e),e=ft.calculateAt(t,e),n<=0)return-28;var o=ht.readlink(e),i=Math.min(n,M(o)),a=S[r+i];return N(o,r,n+1),S[r+i]=a,i}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},q:function(t){try{return t=ft.getStr(t),ht.rmdir(t),0}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},y:function(t,e){try{return t=ft.getStr(t),ft.doStat(ht.stat,t,e)}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},g:function(t,e,r){try{return e=ft.getStr(e),e=ft.calculateAt(t,e),0===r?ht.unlink(e):512===r?ht.rmdir(e):et("Invalid flags passed to unlinkat"),0}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return-t.errno}},C:function(t){},E:function(t,e){et(dt)},D:function(t,e){et(dt)},l:function(){return Date.now()},B:function(){return!0},b:function(){et("")},k:ct,A:function(t,e,r){O.copyWithin(t,e,e+r)},f:function(t){var e,r,n=O.length,o=2147483648;if((t>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,t+100663296),mt(Math.min(o,(e=Math.max(t,a))+((r=65536)-e%r)%r)))return!0}return!1},n:function(t,e){var r=0;return gt().forEach((function(n,o){var i=e+r;R[t+4*o>>2]=i,function(t,e,r){for(var n=0;n<t.length;++n)S[e++>>0]=t.charCodeAt(n);r||(S[e>>0]=0)}(n,i),r+=n.length+1})),0},r:function(t,e){var r=gt();R[t>>2]=r.length;var n=0;return r.forEach((function(t){n+=t.length+1})),R[e>>2]=n,0},d:function(t){Tt(t)},c:function(t){try{var e=ft.getStreamFromFD(t);return ht.close(e),0}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return t.errno}},u:function(t,e){try{var r=ft.getStreamFromFD(t),n=r.tty?2:ht.isDir(r.mode)?3:ht.isLink(r.mode)?7:4;return S[e>>0]=n,0}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return t.errno}},o:function(t,e,r,n,o,i){try{var a=Dt(n,o);if(isNaN(a))return 61;var s=_t(ft.getStreamFromFD(t),e,r,a);return P[i>>2]=s,0}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return t.errno}},j:function(t,e,r,n){try{var o=_t(ft.getStreamFromFD(t),e,r);return P[n>>2]=o,0}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return t.errno}},p:function(t,e,r,n,o){try{var i=Dt(e,r);if(isNaN(i))return 61;var a=ft.getStreamFromFD(t);return ht.llseek(a,i,n),K=[a.position>>>0,(Y=a.position,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],P[o>>2]=K[0],P[o+4>>2]=K[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return t.errno}},i:function(t,e,r,n){try{var o=function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=R[e>>2],s=R[e+4>>2];e+=8;var u=ht.write(t,S,a,s,n);if(u<0)return-1;o+=u}return o}(ft.getStreamFromFD(t),e,r);return R[n>>2]=o,0}catch(t){if(void 0===ht||!(t instanceof ht.ErrnoError))throw t;return t.errno}},I:function(t){Pt(t)}},kt=(function(){var t={a:Ft};function e(t,e){var r,n=t.exports;i.asm=n,U((E=i.asm.J).buffer),i.asm.N,r=i.asm.K,z.unshift(r),tt()}function r(t){e(t.instance)}function n(e){return(y||!v&&!g||"function"!=typeof fetch?Promise.resolve().then((function(){return nt(q)})):fetch(q,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+q+"'";return t.arrayBuffer()})).catch((function(){return nt(q)}))).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(t){return t})).then(e,(function(t){b("failed to asynchronously prepare wasm: "+t),et(t)}))}if(J(),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(t){return b("Module.instantiateWasm callback failed with error: "+t),!1}(y||"function"!=typeof WebAssembly.instantiateStreaming||rt(q)||_||"function"!=typeof fetch?n(r):fetch(q,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(t){return b("wasm streaming compile failed: "+t),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(kt=i.___errno_location=i.asm.L).apply(null,arguments)}),At=(i._main=function(){return(i._main=i.asm.M).apply(null,arguments)},i.stackAlloc=function(){return(At=i.stackAlloc=i.asm.O).apply(null,arguments)});function xt(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function St(t){var e=i._main;(t=t||[]).unshift(d);var r=t.length,n=At(4*(r+1)),o=n>>2;t.forEach((t=>{P[o++]=function(t){var e=M(t)+1,r=At(e);return L(t,S,r,e),r}(t)})),P[o]=0;try{var a=e(r,n);return Tt(a),a}catch(t){return function(t){if(t instanceof xt||"unwind"==t)return F;m(1,t)}(t)}}function Ot(t){function r(){Ct||(Ct=!0,i.calledRun=!0,k||(i.noFSInit||ht.init.initialized||ht.init(),ht.ignorePermissions=!1,st.init(),pt.root=ht.mount(pt,{},null),ot(z),ot(V),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Rt&&St(t),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),G.unshift(t);var t;ot(G)}()))}t=t||p,X>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),H.unshift(t);var t;ot(H)}(),X>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function Tt(t,e){F=t,Pt(t)}function Pt(t){F=t,$()||(i.onExit&&i.onExit(t),k=!0),m(t,new xt(t))}if(i.FS=ht,Q=function t(){Ct||Ot(),Ct||(Q=t)},i.run=Ot,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Rt=!0;return i.noInitialRun&&(Rt=!1),Ot(),t.ready});t.exports=o},3825:(t,e,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(t){var e,o,i=void 0!==(t=t||{})?t:{};i.ready=new Promise((function(t,r){e=t,o=r}));var a,s,u,c,l,h,f=Object.assign({},i),p=[],d="./this.program",m=(t,e)=>{throw e},v="object"==typeof window,g="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,D="";_?(D=g?r(1017).dirname(D)+"/":__dirname+"/",h=()=>{l||(c=r(7147),l=r(1017))},a=function(t,e){return h(),t=l.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>{var e=a(t,!0);return e.buffer||(e=new Uint8Array(e)),e},s=(t,e,r)=>{h(),t=l.normalize(t),c.readFile(t,(function(t,n){t?r(t):e(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),p=process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof Et))throw t})),process.on("unhandledRejection",(function(t){throw t})),m=(t,e)=>{if(G())throw process.exitCode=t,e;var r;(r=e)instanceof Et||b("exiting due to exception: "+r),process.exit(t)},i.inspect=function(){return"[Emscripten Module object]"}):(v||g)&&(g?D=self.location.href:"undefined"!=typeof document&&document.currentScript&&(D=document.currentScript.src),n&&(D=n),D=0!==D.indexOf("blob:")?D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},g&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});var y,w=i.print||console.log.bind(console),b=i.printErr||console.warn.bind(console);Object.assign(i,f),f=null,i.arguments&&(p=i.arguments),i.thisProgram&&(d=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(y=i.wasmBinary);var E,C=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&tt("no native wasm support detected");var F,k,A,x,S,O,T,P=!1,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&R)return R.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var u=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function j(t,e){return t?B(x,t,e):""}function I(t,e,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o}function L(t,e,r){return I(t,x,e,r)}function N(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&t.charCodeAt(++r)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function M(t){k=t,i.HEAP8=A=new Int8Array(t),i.HEAP16=S=new Int16Array(t),i.HEAP32=O=new Int32Array(t),i.HEAPU8=x=new Uint8Array(t),i.HEAPU16=new Uint16Array(t),i.HEAPU32=T=new Uint32Array(t),i.HEAPF32=new Float32Array(t),i.HEAPF64=new Float64Array(t)}i.INITIAL_MEMORY;var U=[],H=[],z=[],V=[];function G(){return C}var $,q,W,Y,K=0,X=null,Z=null;function Q(t){K++,i.monitorRunDependencies&&i.monitorRunDependencies(K)}function J(t){if(K--,i.monitorRunDependencies&&i.monitorRunDependencies(K),0==K&&(null!==X&&(clearInterval(X),X=null),Z)){var e=Z;Z=null,e()}}function tt(t){i.onAbort&&i.onAbort(t),b(t="Aborted("+t+")"),P=!0,F=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}function et(t){return t.startsWith("data:application/octet-stream;base64,")}function rt(t){try{if(t==$&&y)return new Uint8Array(y);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){tt(t)}}function nt(t){for(;t.length>0;)t.shift()(i)}et($="objcopy.wasm")||(q=$,$=i.locateFile?i.locateFile(q,D):D+q);var ot={isAbs:t=>"/"===t.charAt(0),splitPath:t=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1),normalizeArray:(t,e)=>{for(var r=0,n=t.length-1;n>=0;n--){var o=t[n];"."===o?t.splice(n,1):".."===o?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},normalize:t=>{var e=ot.isAbs(t),r="/"===t.substr(-1);return(t=ot.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},dirname:t=>{var e=ot.splitPath(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:t=>{if("/"===t)return"/";var e=(t=(t=ot.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},join:function(){var t=Array.prototype.slice.call(arguments,0);return ot.normalize(t.join("/"))},join2:(t,e)=>ot.normalize(t+"/"+e)},it={resolve:function(){for(var t="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:lt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e=ot.isAbs(n)}return(e?"/":"")+(t=ot.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||"."},relative:(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=it.resolve(t).substr(1),e=it.resolve(e).substr(1);for(var n=r(t.split("/")),o=r(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},at={ttys:[],init:function(){},shutdown:function(){},register:function(t,e){at.ttys[t]={input:[],output:[],ops:e},lt.registerDevice(t,at.stream_ops)},stream_ops:{open:function(t){var e=at.ttys[t.node.rdev];if(!e)throw new lt.ErrnoError(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.ops.flush(t.tty)},flush:function(t){t.tty.ops.flush(t.tty)},read:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.get_char)throw new lt.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=t.tty.ops.get_char(t.tty)}catch(t){throw new lt.ErrnoError(29)}if(void 0===s&&0===i)throw new lt.ErrnoError(6);if(null==s)break;i++,e[r+a]=s}return i&&(t.node.timestamp=Date.now()),i},write:function(t,e,r,n,o){if(!t.tty||!t.tty.ops.put_char)throw new lt.ErrnoError(60);try{for(var i=0;i<n;i++)t.tty.ops.put_char(t.tty,e[r+i])}catch(t){throw new lt.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(t){if(!t.input.length){var e=null;if(_){var r=Buffer.alloc(256),n=0;try{n=c.readSync(process.stdin.fd,r,0,256,-1)}catch(t){if(!t.toString().includes("EOF"))throw t;n=0}e=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;t.input=_t(e,!0)}return t.input.shift()},put_char:function(t,e){null===e||10===e?(w(B(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(w(B(t.output,0)),t.output=[])}},default_tty1_ops:{put_char:function(t,e){null===e||10===e?(b(B(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&t.output.length>0&&(b(B(t.output,0)),t.output=[])}}};function st(t){tt()}var ut={ops_table:null,mount:function(t){return ut.createNode(null,"/",16895,0)},createNode:function(t,e,r,n){if(lt.isBlkdev(r)||lt.isFIFO(r))throw new lt.ErrnoError(63);ut.ops_table||(ut.ops_table={dir:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr,lookup:ut.node_ops.lookup,mknod:ut.node_ops.mknod,rename:ut.node_ops.rename,unlink:ut.node_ops.unlink,rmdir:ut.node_ops.rmdir,readdir:ut.node_ops.readdir,symlink:ut.node_ops.symlink},stream:{llseek:ut.stream_ops.llseek}},file:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr},stream:{llseek:ut.stream_ops.llseek,read:ut.stream_ops.read,write:ut.stream_ops.write,allocate:ut.stream_ops.allocate,mmap:ut.stream_ops.mmap,msync:ut.stream_ops.msync}},link:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr,readlink:ut.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr},stream:lt.chrdev_stream_ops}});var o=lt.createNode(t,e,r,n);return lt.isDir(o.mode)?(o.node_ops=ut.ops_table.dir.node,o.stream_ops=ut.ops_table.dir.stream,o.contents={}):lt.isFile(o.mode)?(o.node_ops=ut.ops_table.file.node,o.stream_ops=ut.ops_table.file.stream,o.usedBytes=0,o.contents=null):lt.isLink(o.mode)?(o.node_ops=ut.ops_table.link.node,o.stream_ops=ut.ops_table.link.stream):lt.isChrdev(o.mode)&&(o.node_ops=ut.ops_table.chrdev.node,o.stream_ops=ut.ops_table.chrdev.stream),o.timestamp=Date.now(),t&&(t.contents[e]=o,t.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(t){return t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0)},expandFileStorage:function(t,e){var r=t.contents?t.contents.length:0;if(!(r>=e)){e=Math.max(e,r*(r<1048576?2:1.125)>>>0),0!=r&&(e=Math.max(e,256));var n=t.contents;t.contents=new Uint8Array(e),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage:function(t,e){if(t.usedBytes!=e)if(0==e)t.contents=null,t.usedBytes=0;else{var r=t.contents;t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e}},node_ops:{getattr:function(t){var e={};return e.dev=lt.isChrdev(t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,lt.isDir(t.mode)?e.size=4096:lt.isFile(t.mode)?e.size=t.usedBytes:lt.isLink(t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&ut.resizeFileStorage(t,e.size)},lookup:function(t,e){throw lt.genericErrors[44]},mknod:function(t,e,r,n){return ut.createNode(t,e,r,n)},rename:function(t,e,r){if(lt.isDir(t.mode)){var n;try{n=lt.lookupNode(e,r)}catch(t){}if(n)for(var o in n.contents)throw new lt.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=r,e.contents[r]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink:function(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir:function(t,e){var r=lt.lookupNode(t,e);for(var n in r.contents)throw new lt.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir:function(t){var e=[".",".."];for(var r in t.contents)t.contents.hasOwnProperty(r)&&e.push(r);return e},symlink:function(t,e,r){var n=ut.createNode(t,e,41471,0);return n.link=r,n},readlink:function(t){if(!lt.isLink(t.mode))throw new lt.ErrnoError(28);return t.link}},stream_ops:{read:function(t,e,r,n,o){var i=t.node.contents;if(o>=t.node.usedBytes)return 0;var a=Math.min(t.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)e[r+s]=i[o+s];return a},write:function(t,e,r,n,o,i){if(e.buffer===A.buffer&&(i=!1),!n)return 0;var a=t.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(r,r+n),o),n}if(ut.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(t,e,r){var n=e;if(1===r?n+=t.position:2===r&&lt.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new lt.ErrnoError(28);return n},allocate:function(t,e,r){ut.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap:function(t,e,r,n,o){if(!lt.isFile(t.node.mode))throw new lt.ErrnoError(43);var i,a,s=t.node.contents;if(2&o||s.buffer!==k){if((r>0||r+e<s.length)&&(s=s.subarray?s.subarray(r,r+e):Array.prototype.slice.call(s,r,r+e)),a=!0,!(i=st()))throw new lt.ErrnoError(48);A.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(t,e,r,n,o){if(!lt.isFile(t.node.mode))throw new lt.ErrnoError(43);return 2&o||ut.stream_ops.write(t,e,0,n,r,!1),0}}};function ct(t,e,r,n){var o=n?"":"al "+t;s(t,(function(r){var n;n='Loading data file "'+t+'" failed (no arrayBuffer).',r||tt(n),e(new Uint8Array(r)),o&&J()}),(function(e){if(!r)throw'Loading data file "'+t+'" failed.';r()})),o&&Q()}var lt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(t,e={})=>{if(!(t=it.resolve(lt.cwd(),t)))return{path:"",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new lt.ErrnoError(32);for(var r=ot.normalizeArray(t.split("/").filter((t=>!!t)),!1),n=lt.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&e.parent)break;if(n=lt.lookupNode(n,r[i]),o=ot.join2(o,r[i]),lt.isMountpoint(n)&&(!a||a&&e.follow_mount)&&(n=n.mounted.root),!a||e.follow)for(var s=0;lt.isLink(n.mode);){var u=lt.readlink(o);if(o=it.resolve(ot.dirname(o),u),n=lt.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new lt.ErrnoError(32)}}return{path:o,node:n}},getPath:t=>{for(var e;;){if(lt.isRoot(t)){var r=t.mount.mountpoint;return e?"/"!==r[r.length-1]?r+"/"+e:r+e:r}e=e?t.name+"/"+e:t.name,t=t.parent}},hashName:(t,e)=>{for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%lt.nameTable.length},hashAddNode:t=>{var e=lt.hashName(t.parent.id,t.name);t.name_next=lt.nameTable[e],lt.nameTable[e]=t},hashRemoveNode:t=>{var e=lt.hashName(t.parent.id,t.name);if(lt.nameTable[e]===t)lt.nameTable[e]=t.name_next;else for(var r=lt.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode:(t,e)=>{var r=lt.mayLookup(t);if(r)throw new lt.ErrnoError(r,t);for(var n=lt.hashName(t.id,e),o=lt.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===t.id&&i===e)return o}return lt.lookup(t,e)},createNode:(t,e,r,n)=>{var o=new lt.FSNode(t,e,r,n);return lt.hashAddNode(o),o},destroyNode:t=>{lt.hashRemoveNode(t)},isRoot:t=>t===t.parent,isMountpoint:t=>!!t.mounted,isFile:t=>32768==(61440&t),isDir:t=>16384==(61440&t),isLink:t=>40960==(61440&t),isChrdev:t=>8192==(61440&t),isBlkdev:t=>24576==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>49152==(49152&t),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:t=>{var e=lt.flagModes[t];if(void 0===e)throw new Error("Unknown file open mode: "+t);return e},flagsToPermissionString:t=>{var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:(t,e)=>lt.ignorePermissions||(!e.includes("r")||292&t.mode)&&(!e.includes("w")||146&t.mode)&&(!e.includes("x")||73&t.mode)?0:2,mayLookup:t=>{var e=lt.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate:(t,e)=>{try{return lt.lookupNode(t,e),20}catch(t){}return lt.nodePermissions(t,"wx")},mayDelete:(t,e,r)=>{var n;try{n=lt.lookupNode(t,e)}catch(t){return t.errno}var o=lt.nodePermissions(t,"wx");if(o)return o;if(r){if(!lt.isDir(n.mode))return 54;if(lt.isRoot(n)||lt.getPath(n)===lt.cwd())return 10}else if(lt.isDir(n.mode))return 31;return 0},mayOpen:(t,e)=>t?lt.isLink(t.mode)?32:lt.isDir(t.mode)&&("r"!==lt.flagsToPermissionString(e)||512&e)?31:lt.nodePermissions(t,lt.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(t=0,e=lt.MAX_OPEN_FDS)=>{for(var r=t;r<=e;r++)if(!lt.streams[r])return r;throw new lt.ErrnoError(33)},getStream:t=>lt.streams[t],createStream:(t,e,r)=>{lt.FSStream||(lt.FSStream=function(){this.shared={}},lt.FSStream.prototype={},Object.defineProperties(lt.FSStream.prototype,{object:{get:function(){return this.node},set:function(t){this.node=t}},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(t){this.shared.flags=t}},position:{get:function(){return this.shared.position},set:function(t){this.shared.position=t}}})),t=Object.assign(new lt.FSStream,t);var n=lt.nextfd(e,r);return t.fd=n,lt.streams[n]=t,t},closeStream:t=>{lt.streams[t]=null},chrdev_stream_ops:{open:t=>{var e=lt.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek:()=>{throw new lt.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,e)=>t<<8|e,registerDevice:(t,e)=>{lt.devices[t]={stream_ops:e}},getDevice:t=>lt.devices[t],getMounts:t=>{for(var e=[],r=[t];r.length;){var n=r.pop();e.push(n),r.push.apply(r,n.mounts)}return e},syncfs:(t,e)=>{"function"==typeof t&&(e=t,t=!1),lt.syncFSRequests++,lt.syncFSRequests>1&&b("warning: "+lt.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=lt.getMounts(lt.root.mount),n=0;function o(t){return lt.syncFSRequests--,e(t)}function i(t){if(t)return i.errored?void 0:(i.errored=!0,o(t));++n>=r.length&&o(null)}r.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,t,i)}))},mount:(t,e,r)=>{var n,o="/"===r,i=!r;if(o&&lt.root)throw new lt.ErrnoError(10);if(!o&&!i){var a=lt.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,lt.isMountpoint(n))throw new lt.ErrnoError(10);if(!lt.isDir(n.mode))throw new lt.ErrnoError(54)}var s={type:t,opts:e,mountpoint:r,mounts:[]},u=t.mount(s);return u.mount=s,s.root=u,o?lt.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:t=>{var e=lt.lookupPath(t,{follow_mount:!1});if(!lt.isMountpoint(e.node))throw new lt.ErrnoError(28);var r=e.node,n=r.mounted,o=lt.getMounts(n);Object.keys(lt.nameTable).forEach((t=>{for(var e=lt.nameTable[t];e;){var r=e.name_next;o.includes(e.mount)&&lt.destroyNode(e),e=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(t,e)=>t.node_ops.lookup(t,e),mknod:(t,e,r)=>{var n=lt.lookupPath(t,{parent:!0}).node,o=ot.basename(t);if(!o||"."===o||".."===o)throw new lt.ErrnoError(28);var i=lt.mayCreate(n,o);if(i)throw new lt.ErrnoError(i);if(!n.node_ops.mknod)throw new lt.ErrnoError(63);return n.node_ops.mknod(n,o,e,r)},create:(t,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,lt.mknod(t,e,0)),mkdir:(t,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,lt.mknod(t,e,0)),mkdirTree:(t,e)=>{for(var r=t.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{lt.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:(t,e,r)=>(void 0===r&&(r=e,e=438),e|=8192,lt.mknod(t,e,r)),symlink:(t,e)=>{if(!it.resolve(t))throw new lt.ErrnoError(44);var r=lt.lookupPath(e,{parent:!0}).node;if(!r)throw new lt.ErrnoError(44);var n=ot.basename(e),o=lt.mayCreate(r,n);if(o)throw new lt.ErrnoError(o);if(!r.node_ops.symlink)throw new lt.ErrnoError(63);return r.node_ops.symlink(r,n,t)},rename:(t,e)=>{var r,n,o=ot.dirname(t),i=ot.dirname(e),a=ot.basename(t),s=ot.basename(e);if(r=lt.lookupPath(t,{parent:!0}).node,n=lt.lookupPath(e,{parent:!0}).node,!r||!n)throw new lt.ErrnoError(44);if(r.mount!==n.mount)throw new lt.ErrnoError(75);var u,c=lt.lookupNode(r,a),l=it.relative(t,i);if("."!==l.charAt(0))throw new lt.ErrnoError(28);if("."!==(l=it.relative(e,o)).charAt(0))throw new lt.ErrnoError(55);try{u=lt.lookupNode(n,s)}catch(t){}if(c!==u){var h=lt.isDir(c.mode),f=lt.mayDelete(r,a,h);if(f)throw new lt.ErrnoError(f);if(f=u?lt.mayDelete(n,s,h):lt.mayCreate(n,s))throw new lt.ErrnoError(f);if(!r.node_ops.rename)throw new lt.ErrnoError(63);if(lt.isMountpoint(c)||u&&lt.isMountpoint(u))throw new lt.ErrnoError(10);if(n!==r&&(f=lt.nodePermissions(r,"w")))throw new lt.ErrnoError(f);lt.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(t){throw t}finally{lt.hashAddNode(c)}}},rmdir:t=>{var e=lt.lookupPath(t,{parent:!0}).node,r=ot.basename(t),n=lt.lookupNode(e,r),o=lt.mayDelete(e,r,!0);if(o)throw new lt.ErrnoError(o);if(!e.node_ops.rmdir)throw new lt.ErrnoError(63);if(lt.isMountpoint(n))throw new lt.ErrnoError(10);e.node_ops.rmdir(e,r),lt.destroyNode(n)},readdir:t=>{var e=lt.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new lt.ErrnoError(54);return e.node_ops.readdir(e)},unlink:t=>{var e=lt.lookupPath(t,{parent:!0}).node;if(!e)throw new lt.ErrnoError(44);var r=ot.basename(t),n=lt.lookupNode(e,r),o=lt.mayDelete(e,r,!1);if(o)throw new lt.ErrnoError(o);if(!e.node_ops.unlink)throw new lt.ErrnoError(63);if(lt.isMountpoint(n))throw new lt.ErrnoError(10);e.node_ops.unlink(e,r),lt.destroyNode(n)},readlink:t=>{var e=lt.lookupPath(t).node;if(!e)throw new lt.ErrnoError(44);if(!e.node_ops.readlink)throw new lt.ErrnoError(28);return it.resolve(lt.getPath(e.parent),e.node_ops.readlink(e))},stat:(t,e)=>{var r=lt.lookupPath(t,{follow:!e}).node;if(!r)throw new lt.ErrnoError(44);if(!r.node_ops.getattr)throw new lt.ErrnoError(63);return r.node_ops.getattr(r)},lstat:t=>lt.stat(t,!0),chmod:(t,e,r)=>{var n;if(!(n="string"==typeof t?lt.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new lt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:(t,e)=>{lt.chmod(t,e,!0)},fchmod:(t,e)=>{var r=lt.getStream(t);if(!r)throw new lt.ErrnoError(8);lt.chmod(r.node,e)},chown:(t,e,r,n)=>{var o;if(!(o="string"==typeof t?lt.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new lt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(t,e,r)=>{lt.chown(t,e,r,!0)},fchown:(t,e,r)=>{var n=lt.getStream(t);if(!n)throw new lt.ErrnoError(8);lt.chown(n.node,e,r)},truncate:(t,e)=>{if(e<0)throw new lt.ErrnoError(28);var r;if(!(r="string"==typeof t?lt.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new lt.ErrnoError(63);if(lt.isDir(r.mode))throw new lt.ErrnoError(31);if(!lt.isFile(r.mode))throw new lt.ErrnoError(28);var n=lt.nodePermissions(r,"w");if(n)throw new lt.ErrnoError(n);r.node_ops.setattr(r,{size:e,timestamp:Date.now()})},ftruncate:(t,e)=>{var r=lt.getStream(t);if(!r)throw new lt.ErrnoError(8);if(0==(2097155&r.flags))throw new lt.ErrnoError(28);lt.truncate(r.node,e)},utime:(t,e,r)=>{var n=lt.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,r)})},open:(t,e,r)=>{if(""===t)throw new lt.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(e="string"==typeof e?lt.modeStringToFlags(e):e)?4095&r|32768:0,"object"==typeof t)n=t;else{t=ot.normalize(t);try{n=lt.lookupPath(t,{follow:!(131072&e)}).node}catch(t){}}var o=!1;if(64&e)if(n){if(128&e)throw new lt.ErrnoError(20)}else n=lt.mknod(t,r,0),o=!0;if(!n)throw new lt.ErrnoError(44);if(lt.isChrdev(n.mode)&&(e&=-513),65536&e&&!lt.isDir(n.mode))throw new lt.ErrnoError(54);if(!o){var a=lt.mayOpen(n,e);if(a)throw new lt.ErrnoError(a)}512&e&&!o&&lt.truncate(n,0),e&=-131713;var s=lt.createStream({node:n,path:lt.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&e||(lt.readFiles||(lt.readFiles={}),t in lt.readFiles||(lt.readFiles[t]=1)),s},close:t=>{if(lt.isClosed(t))throw new lt.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{lt.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek:(t,e,r)=>{if(lt.isClosed(t))throw new lt.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new lt.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new lt.ErrnoError(28);return t.position=t.stream_ops.llseek(t,e,r),t.ungotten=[],t.position},read:(t,e,r,n,o)=>{if(n<0||o<0)throw new lt.ErrnoError(28);if(lt.isClosed(t))throw new lt.ErrnoError(8);if(1==(2097155&t.flags))throw new lt.ErrnoError(8);if(lt.isDir(t.node.mode))throw new lt.ErrnoError(31);if(!t.stream_ops.read)throw new lt.ErrnoError(28);var i=void 0!==o;if(i){if(!t.seekable)throw new lt.ErrnoError(70)}else o=t.position;var a=t.stream_ops.read(t,e,r,n,o);return i||(t.position+=a),a},write:(t,e,r,n,o,i)=>{if(n<0||o<0)throw new lt.ErrnoError(28);if(lt.isClosed(t))throw new lt.ErrnoError(8);if(0==(2097155&t.flags))throw new lt.ErrnoError(8);if(lt.isDir(t.node.mode))throw new lt.ErrnoError(31);if(!t.stream_ops.write)throw new lt.ErrnoError(28);t.seekable&&1024&t.flags&&lt.llseek(t,0,2);var a=void 0!==o;if(a){if(!t.seekable)throw new lt.ErrnoError(70)}else o=t.position;var s=t.stream_ops.write(t,e,r,n,o,i);return a||(t.position+=s),s},allocate:(t,e,r)=>{if(lt.isClosed(t))throw new lt.ErrnoError(8);if(e<0||r<=0)throw new lt.ErrnoError(28);if(0==(2097155&t.flags))throw new lt.ErrnoError(8);if(!lt.isFile(t.node.mode)&&!lt.isDir(t.node.mode))throw new lt.ErrnoError(43);if(!t.stream_ops.allocate)throw new lt.ErrnoError(138);t.stream_ops.allocate(t,e,r)},mmap:(t,e,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&t.flags))throw new lt.ErrnoError(2);if(1==(2097155&t.flags))throw new lt.ErrnoError(2);if(!t.stream_ops.mmap)throw new lt.ErrnoError(43);return t.stream_ops.mmap(t,e,r,n,o)},msync:(t,e,r,n,o)=>t&&t.stream_ops.msync?t.stream_ops.msync(t,e,r,n,o):0,munmap:t=>0,ioctl:(t,e,r)=>{if(!t.stream_ops.ioctl)throw new lt.ErrnoError(59);return t.stream_ops.ioctl(t,e,r)},readFile:(t,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error('Invalid encoding type "'+e.encoding+'"');var r,n=lt.open(t,e.flags),o=lt.stat(t).size,i=new Uint8Array(o);return lt.read(n,i,0,o,0),"utf8"===e.encoding?r=B(i,0):"binary"===e.encoding&&(r=i),lt.close(n),r},writeFile:(t,e,r={})=>{r.flags=r.flags||577;var n=lt.open(t,r.flags,r.mode);if("string"==typeof e){var o=new Uint8Array(N(e)+1),i=I(e,o,0,o.length);lt.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");lt.write(n,e,0,e.byteLength,void 0,r.canOwn)}lt.close(n)},cwd:()=>lt.currentPath,chdir:t=>{var e=lt.lookupPath(t,{follow:!0});if(null===e.node)throw new lt.ErrnoError(44);if(!lt.isDir(e.node.mode))throw new lt.ErrnoError(54);var r=lt.nodePermissions(e.node,"x");if(r)throw new lt.ErrnoError(r);lt.currentPath=e.path},createDefaultDirectories:()=>{lt.mkdir("/tmp"),lt.mkdir("/home"),lt.mkdir("/home/web_user")},createDefaultDevices:()=>{lt.mkdir("/dev"),lt.registerDevice(lt.makedev(1,3),{read:()=>0,write:(t,e,r,n,o)=>n}),lt.mkdev("/dev/null",lt.makedev(1,3)),at.register(lt.makedev(5,0),at.default_tty_ops),at.register(lt.makedev(6,0),at.default_tty1_ops),lt.mkdev("/dev/tty",lt.makedev(5,0)),lt.mkdev("/dev/tty1",lt.makedev(6,0));var t=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return function(){return crypto.getRandomValues(t),t[0]}}if(_)try{var e=r(6113);return function(){return e.randomBytes(1)[0]}}catch(t){}return function(){tt("randomDevice")}}();lt.createDevice("/dev","random",t),lt.createDevice("/dev","urandom",t),lt.mkdir("/dev/shm"),lt.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{lt.mkdir("/proc");var t=lt.mkdir("/proc/self");lt.mkdir("/proc/self/fd"),lt.mount({mount:()=>{var e=lt.createNode(t,"fd",16895,73);return e.node_ops={lookup:(t,e)=>{var r=+e,n=lt.getStream(r);if(!n)throw new lt.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?lt.createDevice("/dev","stdin",i.stdin):lt.symlink("/dev/tty","/dev/stdin"),i.stdout?lt.createDevice("/dev","stdout",null,i.stdout):lt.symlink("/dev/tty","/dev/stdout"),i.stderr?lt.createDevice("/dev","stderr",null,i.stderr):lt.symlink("/dev/tty1","/dev/stderr"),lt.open("/dev/stdin",0),lt.open("/dev/stdout",1),lt.open("/dev/stderr",1)},ensureErrnoError:()=>{lt.ErrnoError||(lt.ErrnoError=function(t,e){this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},lt.ErrnoError.prototype=new Error,lt.ErrnoError.prototype.constructor=lt.ErrnoError,[44].forEach((t=>{lt.genericErrors[t]=new lt.ErrnoError(t),lt.genericErrors[t].stack="<generic error, no stack>"})))},staticInit:()=>{lt.ensureErrnoError(),lt.nameTable=new Array(4096),lt.mount(ut,{},"/"),lt.createDefaultDirectories(),lt.createDefaultDevices(),lt.createSpecialDirectories(),lt.filesystems={MEMFS:ut}},init:(t,e,r)=>{lt.init.initialized=!0,lt.ensureErrnoError(),i.stdin=t||i.stdin,i.stdout=e||i.stdout,i.stderr=r||i.stderr,lt.createStandardStreams()},quit:()=>{lt.init.initialized=!1;for(var t=0;t<lt.streams.length;t++){var e=lt.streams[t];e&&lt.close(e)}},getMode:(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},findObject:(t,e)=>{var r=lt.analyzePath(t,e);return r.exists?r.object:null},analyzePath:(t,e)=>{try{t=(n=lt.lookupPath(t,{follow:!e})).path}catch(t){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=lt.lookupPath(t,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ot.basename(t),n=lt.lookupPath(t,{follow:!e}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(t){r.error=t.errno}return r},createPath:(t,e,r,n)=>{t="string"==typeof t?t:lt.getPath(t);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ot.join2(t,i);try{lt.mkdir(a)}catch(t){}t=a}}return a},createFile:(t,e,r,n,o)=>{var i=ot.join2("string"==typeof t?t:lt.getPath(t),e),a=lt.getMode(n,o);return lt.create(i,a)},createDataFile:(t,e,r,n,o,i)=>{var a=e;t&&(t="string"==typeof t?t:lt.getPath(t),a=e?ot.join2(t,e):t);var s=lt.getMode(n,o),u=lt.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,h=r.length;l<h;++l)c[l]=r.charCodeAt(l);r=c}lt.chmod(u,146|s);var f=lt.open(u,577);lt.write(f,r,0,r.length,0,i),lt.close(f),lt.chmod(u,s)}return u},createDevice:(t,e,r,n)=>{var o=ot.join2("string"==typeof t?t:lt.getPath(t),e),i=lt.getMode(!!r,!!n);lt.createDevice.major||(lt.createDevice.major=64);var a=lt.makedev(lt.createDevice.major++,0);return lt.registerDevice(a,{open:t=>{t.seekable=!1},close:t=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(t,e,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(t){throw new lt.ErrnoError(29)}if(void 0===u&&0===a)throw new lt.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(t.node.timestamp=Date.now()),a},write:(t,e,r,o,i)=>{for(var a=0;a<o;a++)try{n(e[r+a])}catch(t){throw new lt.ErrnoError(29)}return o&&(t.node.timestamp=Date.now()),a}}),lt.mkdev(o,i,a)},forceLoadFile:t=>{if(t.isDevice||t.isFolder||t.link||t.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(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=_t(a(t.url),!0),t.usedBytes=t.contents.length}catch(t){throw new lt.ErrnoError(29)}},createLazyFile:(t,e,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(t){if(!(t>this.length-1||t<0)){var e=t%this.chunkSize,r=t/this.chunkSize|0;return this.getter(r)[e]}},i.prototype.setDataGetter=function(t){this.getter=t},i.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",r,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),o=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((t=>{var e=t*a,o=(t+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[t]&&(s.chunks[t]=((t,e)=>{if(t>e)throw new Error("invalid range ("+t+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+t+"-"+e),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||[]):_t(o.responseText||"",!0)})(e,o)),void 0===s.chunks[t])throw new Error("doXHR failed!");return s.chunks[t]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!g)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=lt.createFile(t,e,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(t,e,r,n,o){var i=t.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[r+s]=i[o+s];else for(s=0;s<a;s++)e[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((t=>{var e=u.stream_ops[t];c[t]=function(){return lt.forceLoadFile(u),e.apply(null,arguments)}})),c.read=(t,e,r,n,o)=>(lt.forceLoadFile(u),l(t,e,r,n,o)),c.mmap=(t,e,r,n,o)=>{lt.forceLoadFile(u);var i=st();if(!i)throw new lt.ErrnoError(48);return l(t,A,i,e,r),{ptr:i,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(t,e,r,n,o,i,a,s,u,c)=>{var l=e?it.resolve(ot.join2(t,e)):t;function h(r){function h(r){c&&c(),s||lt.createDataFile(t,e,r,n,o,u),i&&i(),J()}Browser.handledByPreloadPlugin(r,l,h,(()=>{a&&a(),J()}))||h(r)}Q(),"string"==typeof r?ct(r,(t=>h(t)),a):h(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:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=lt.indexedDB();try{var o=n.open(lt.DB_NAME(),lt.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=()=>{w("creating db"),o.result.createObjectStore(lt.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([lt.DB_STORE_NAME],"readwrite"),i=n.objectStore(lt.DB_STORE_NAME),a=0,s=0,u=t.length;function c(){0==s?e():r()}t.forEach((t=>{var e=i.put(lt.analyzePath(t).object.contents,t);e.onsuccess=()=>{++a+s==u&&c()},e.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(t,e,r)=>{e=e||(()=>{}),r=r||(()=>{});var n=lt.indexedDB();try{var o=n.open(lt.DB_NAME(),lt.DB_VERSION)}catch(t){return r(t)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([lt.DB_STORE_NAME],"readonly")}catch(t){return void r(t)}var a=i.objectStore(lt.DB_STORE_NAME),s=0,u=0,c=t.length;function l(){0==u?e():r()}t.forEach((t=>{var e=a.get(t);e.onsuccess=()=>{lt.analyzePath(t).exists&&lt.unlink(t),lt.createDataFile(ot.dirname(t),ot.basename(t),e.result,!0,!0,!0),++s+u==c&&l()},e.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=r},o.onerror=r}},ht={DEFAULT_POLLMASK:5,calculateAt:function(t,e,r){if(ot.isAbs(e))return e;var n;if(-100===t)n=lt.cwd();else{var o=lt.getStream(t);if(!o)throw new lt.ErrnoError(8);n=o.path}if(0==e.length){if(!r)throw new lt.ErrnoError(44);return n}return ot.join2(n,e)},doStat:function(t,e,r){try{var n=t(e)}catch(t){if(t&&t.node&&ot.normalize(e)!==ot.normalize(lt.getPath(t.node)))return-54;throw t}return O[r>>2]=n.dev,O[r+4>>2]=0,O[r+8>>2]=n.ino,O[r+12>>2]=n.mode,O[r+16>>2]=n.nlink,O[r+20>>2]=n.uid,O[r+24>>2]=n.gid,O[r+28>>2]=n.rdev,O[r+32>>2]=0,Y=[n.size>>>0,(W=n.size,+Math.abs(W)>=1?W>0?(0|Math.min(+Math.floor(W/4294967296),4294967295))>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],O[r+40>>2]=Y[0],O[r+44>>2]=Y[1],O[r+48>>2]=4096,O[r+52>>2]=n.blocks,O[r+56>>2]=n.atime.getTime()/1e3|0,O[r+60>>2]=0,O[r+64>>2]=n.mtime.getTime()/1e3|0,O[r+68>>2]=0,O[r+72>>2]=n.ctime.getTime()/1e3|0,O[r+76>>2]=0,Y=[n.ino>>>0,(W=n.ino,+Math.abs(W)>=1?W>0?(0|Math.min(+Math.floor(W/4294967296),4294967295))>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],O[r+80>>2]=Y[0],O[r+84>>2]=Y[1],0},doMsync:function(t,e,r,n,o){var i=x.slice(t,t+r);lt.msync(e,i,o,r,n)},varargs:void 0,get:function(){return ht.varargs+=4,O[ht.varargs-4>>2]},getStr:function(t){return j(t)},getStreamFromFD:function(t){var e=lt.getStream(t);if(!e)throw new lt.ErrnoError(8);return e}};function ft(t){try{return E.grow(t-k.byteLength+65535>>>16),M(E.buffer),1}catch(t){}}var pt={};function dt(){if(!dt.strings){var t={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",_:d||"./this.program"};for(var e in pt)void 0===pt[e]?delete t[e]:t[e]=pt[e];var r=[];for(var e in t)r.push(e+"="+t[e]);dt.strings=r}return dt.strings}var mt=function(t,e,r,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=lt.nextInode++,this.name=e,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},vt=365,gt=146;function _t(t,e,r){var n=r>0?r:N(t)+1,o=new Array(n),i=I(t,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(mt.prototype,{read:{get:function(){return(this.mode&vt)===vt},set:function(t){t?this.mode|=vt:this.mode&=-366}},write:{get:function(){return(this.mode&gt)===gt},set:function(t){t?this.mode|=gt:this.mode&=-147}},isFolder:{get:function(){return lt.isDir(this.mode)}},isDevice:{get:function(){return lt.isChrdev(this.mode)}}}),lt.FSNode=mt,lt.staticInit();var Dt,yt={b:function(t,e,r,n){tt("Assertion failed: "+j(t)+", at: "+[e?j(e):"unknown filename",r,n?j(n):"unknown function"])},k:function(t,e){try{return t=ht.getStr(t),lt.chmod(t,e),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},D:function(t){try{var e=ht.getStreamFromFD(t);return lt.createStream(e,0).fd}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},E:function(t,e,r,n){try{if(e=ht.getStr(e),e=ht.calculateAt(t,e),-8&r)return-28;var o=lt.lookupPath(e,{follow:!0}).node;if(!o)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&&lt.nodePermissions(o,i)?-2:0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},B:function(t,e){try{return lt.fchmod(t,e),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},d:function(t,e,r){ht.varargs=r;try{var n=ht.getStreamFromFD(t);switch(e){case 0:return(o=ht.get())<0?-28:lt.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=ht.get();return n.flags|=o,0;case 5:return o=ht.get(),S[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,O[wt()>>2]=i,-1}}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}var i},z:function(t,e){try{var r=ht.getStreamFromFD(t);return ht.doStat(lt.stat,r.path,e)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},v:function(t,e){try{if(0===e)return-28;var r=lt.cwd(),n=N(r)+1;return e<n?-68:(L(r,t,e),n)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},l:function(t,e,r){ht.varargs=r;try{var n=ht.getStreamFromFD(t);switch(e){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=ht.get();return O[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=ht.get(),lt.ioctl(n,e,o);default:tt("bad ioctl syscall "+e)}}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},x:function(t,e){try{return t=ht.getStr(t),ht.doStat(lt.lstat,t,e)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},u:function(t,e,r){try{return e=ht.getStr(e),e=ht.calculateAt(t,e),"/"===(e=ot.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),lt.mkdir(e,r,0),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},w:function(t,e,r,n){try{e=ht.getStr(e);var o=256&n,i=4096&n;return n&=-4353,e=ht.calculateAt(t,e,i),ht.doStat(o?lt.lstat:lt.stat,e,r)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},i:function(t,e,r,n){ht.varargs=n;try{e=ht.getStr(e),e=ht.calculateAt(t,e);var o=n?ht.get():0;return lt.open(e,r,o).fd}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},t:function(t,e,r,n){try{if(e=ht.getStr(e),e=ht.calculateAt(t,e),n<=0)return-28;var o=lt.readlink(e),i=Math.min(n,N(o)),a=A[r+i];return L(o,r,n+1),A[r+i]=a,i}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},s:function(t){try{return t=ht.getStr(t),lt.rmdir(t),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},y:function(t,e){try{return t=ht.getStr(t),ht.doStat(lt.stat,t,e)}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},r:function(t,e,r){try{return e=ht.getStr(e),e=ht.calculateAt(t,e),0===r?lt.unlink(e):512===r?lt.rmdir(e):tt("Invalid flags passed to unlinkat"),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},q:function(t,e,r,n){try{if(e=ht.getStr(e),e=ht.calculateAt(t,e,!0),r){var o=O[r>>2],i=O[r+4>>2];a=1e3*o+i/1e6,s=1e3*(o=O[(r+=8)>>2])+(i=O[r+4>>2])/1e6}else var a=Date.now(),s=a;return lt.utime(e,a,s),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return-t.errno}},j:function(){return Date.now()},C:function(){return!0},a:function(){tt("")},A:function(t,e,r){x.copyWithin(t,e,e+r)},e:function(t){var e,r,n=x.length,o=2147483648;if((t>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,t+100663296),ft(Math.min(o,(e=Math.max(t,a))+((r=65536)-e%r)%r)))return!0}return!1},m:function(t,e){var r=0;return dt().forEach((function(n,o){var i=e+r;T[t+4*o>>2]=i,function(t,e,r){for(var n=0;n<t.length;++n)A[e++>>0]=t.charCodeAt(n);r||(A[e>>0]=0)}(n,i),r+=n.length+1})),0},o:function(t,e){var r=dt();T[t>>2]=r.length;var n=0;return r.forEach((function(t){n+=t.length+1})),T[e>>2]=n,0},f:function(t){kt(t)},c:function(t){try{var e=ht.getStreamFromFD(t);return lt.close(e),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},p:function(t,e){try{var r=ht.getStreamFromFD(t),n=r.tty?2:lt.isDir(r.mode)?3:lt.isLink(r.mode)?7:4;return A[e>>0]=n,0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},h:function(t,e,r,n){try{var o=function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=T[e>>2],s=T[e+4>>2];e+=8;var u=lt.read(t,A,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(ht.getStreamFromFD(t),e,r);return O[n>>2]=o,0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},n:function(t,e,r,n,o){try{var i=(u=r)+2097152>>>0<4194305-!!(s=e)?(s>>>0)+4294967296*u:NaN;if(isNaN(i))return 61;var a=ht.getStreamFromFD(t);return lt.llseek(a,i,n),Y=[a.position>>>0,(W=a.position,+Math.abs(W)>=1?W>0?(0|Math.min(+Math.floor(W/4294967296),4294967295))>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],O[o>>2]=Y[0],O[o+4>>2]=Y[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}var s,u},g:function(t,e,r,n){try{var o=function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=T[e>>2],s=T[e+4>>2];e+=8;var u=lt.write(t,A,a,s,n);if(u<0)return-1;o+=u}return o}(ht.getStreamFromFD(t),e,r);return T[n>>2]=o,0}catch(t){if(void 0===lt||!(t instanceof lt.ErrnoError))throw t;return t.errno}},F:function(t){At(t)}},wt=(function(){var t={a:yt};function e(t,e){var r,n=t.exports;i.asm=n,M((E=i.asm.G).buffer),i.asm.K,r=i.asm.H,H.unshift(r),J()}function r(t){e(t.instance)}function n(e){return(y||!v&&!g||"function"!=typeof fetch?Promise.resolve().then((function(){return rt($)})):fetch($,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+$+"'";return t.arrayBuffer()})).catch((function(){return rt($)}))).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(t){return t})).then(e,(function(t){b("failed to asynchronously prepare wasm: "+t),tt(t)}))}if(Q(),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(t){return b("Module.instantiateWasm callback failed with error: "+t),!1}(y||"function"!=typeof WebAssembly.instantiateStreaming||et($)||_||"function"!=typeof fetch?n(r):fetch($,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(t){return b("wasm streaming compile failed: "+t),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(wt=i.___errno_location=i.asm.J).apply(null,arguments)}),bt=i.stackAlloc=function(){return(bt=i.stackAlloc=i.asm.L).apply(null,arguments)};function Et(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Ct(t){var e=i._main;(t=t||[]).unshift(d);var r=t.length,n=bt(4*(r+1)),o=n>>2;t.forEach((t=>{O[o++]=function(t){var e=N(t)+1,r=bt(e);return I(t,A,r,e),r}(t)})),O[o]=0;try{var a=e(r,n);return kt(a),a}catch(t){return function(t){if(t instanceof Et||"unwind"==t)return F;m(1,t)}(t)}}function Ft(t){function r(){Dt||(Dt=!0,i.calledRun=!0,P||(i.noFSInit||lt.init.initialized||lt.init(),lt.ignorePermissions=!1,at.init(),nt(H),nt(z),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),xt&&Ct(t),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),V.unshift(t);var t;nt(V)}()))}t=t||p,K>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),U.unshift(t);var t;nt(U)}(),K>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function kt(t,e){F=t,At(t)}function At(t){F=t,G()||(i.onExit&&i.onExit(t),P=!0),m(t,new Et(t))}if(i.FS=lt,Z=function t(){Dt||Ft(),Dt||(Z=t)},i.run=Ft,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var xt=!0;return i.noInitialRun&&(xt=!1),Ft(),t.ready});t.exports=o},7757:(t,e,r)=>{t.exports=r(5666)},4277:t=>{"use strict";t.exports=({onlyFirst:t=!1}={})=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}},382:(t,e,r)=>{if("undefined"!=typeof SHARED_CONFIG)r.p=SHARED_CONFIG.url_base.cdn+"/";else{var n=r(1017).resolve;r.p=n(__dirname)+"/"}},9846:t=>{"use strict";t.exports=function(t){var e=t._SomePromiseArray;function r(t){var r=new e(t),n=r.promise();return r.setHowMany(1),r.setUnwrap(),r.init(),n}t.any=function(t){return r(t)},t.prototype.any=function(){return r(this)}}},4601:(t,e,r)=>{"use strict";var n;try{throw new Error}catch(t){n=t}var o=r(679),i=r(7824);function a(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new i(16),this._normalQueue=new i(16),this._haveDrainedQueues=!1;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=o}function s(t){for(;t.length()>0;)u(t)}function u(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var r=t.shift(),n=t.shift();e.call(r,n)}}a.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},a.prototype.hasCustomScheduler=function(){return this._customScheduler},a.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},a.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),process.exit(2)):this.throwLater(t)},a.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout((function(){t(e)}),0);else try{this._schedule((function(){t(e)}))}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},a.prototype.invokeLater=function(t,e,r){this._lateQueue.push(t,e,r),this._queueTick()},a.prototype.invoke=function(t,e,r){this._normalQueue.push(t,e,r),this._queueTick()},a.prototype.settlePromises=function(t){this._normalQueue._pushOne(t),this._queueTick()},a.prototype._drainQueues=function(){s(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,s(this._lateQueue)},a.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},a.prototype._reset=function(){this._isTickUsed=!1},t.exports=a,t.exports.firstLineError=n},3635:t=>{"use strict";t.exports=function(t,e,r,n){var o=!1,i=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(i,i,null,this,t)},s=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(i){o||(o=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var c=r(i),l=new t(e);l._propagateFrom(this,1);var h=this._target();if(l._setBoundTo(c),c instanceof t){var f={promiseRejectionQueued:!1,promise:l,target:h,bindingPromise:c};h._then(e,a,void 0,l,f),c._then(s,u,void 0,l,f),l._setOnCancel(c)}else l._resolveCallback(h);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},3786:(t,e,r)=>{"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var o=r(7502)();o.noConflict=function(){try{Promise===o&&(Promise=n)}catch(t){}return o},t.exports=o},2293:(t,e,r)=>{"use strict";var n=Object.create;if(n){var o=n(null),i=n(null);o[" size"]=i[" size"]=0}t.exports=function(t){var e,n,a=r(5942),s=a.canEvaluate,u=a.isIdentifier,c=function(t){return new Function("ensureMethod"," \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g,t))(f)},l=function(t){return new Function("obj"," \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName",t))},h=function(t,e,r){var n=r[t];if("function"!=typeof n){if(!u(t))return null;if(n=e(t),r[t]=n,r[" size"]++,r[" size"]>512){for(var o=Object.keys(r),i=0;i<256;++i)delete r[o[i]];r[" size"]=o.length-256}}return n};function f(e,r){var n;if(null!=e&&(n=e[r]),"function"!=typeof n){var o="Object "+a.classString(e)+" has no method '"+a.toString(r)+"'";throw new t.TypeError(o)}return n}function p(t){return f(t,this.pop()).apply(t,this)}function d(t){return t[this]}function m(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}e=function(t){return h(t,c,o)},n=function(t){return h(t,l,i)},t.prototype.call=function(t){for(var r=arguments.length,n=new Array(Math.max(r-1,0)),o=1;o<r;++o)n[o-1]=arguments[o];if(s){var i=e(t);if(null!==i)return this._then(i,void 0,void 0,n,void 0)}return n.push(t),this._then(p,void 0,void 0,n,void 0)},t.prototype.get=function(t){var e;if("number"==typeof t)e=m;else if(s){var r=n(t);e=null!==r?r:d}else e=d;return this._then(e,void 0,void 0,t,void 0)}}},1735:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i=r(5942),a=i.tryCatch,s=i.errorObj,u=t._async;t.prototype.break=t.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(t,e){if(i.isArray(t))for(var r=0;r<t.length;++r)this._doInvokeOnCancel(t[r],e);else if(void 0!==t)if("function"==typeof t){if(!e){var n=a(t).call(this._boundValue());n===s&&(this._attachExtraTrace(n.e),u.throwLater(n.e))}}else t._resultCancelled(this)},t.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),u.invoke(this._doInvokeOnCancel,this,t)},t.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},t.prototype._resultCancelled=function(){this.cancel()}}},9976:(t,e,r)=>{"use strict";t.exports=function(t){var e=r(5942),n=r(9571).keys,o=e.tryCatch,i=e.errorObj;return function(r,a,s){return function(u){var c=s._boundValue();t:for(var l=0;l<r.length;++l){var h=r[l];if(h===Error||null!=h&&h.prototype instanceof Error){if(u instanceof h)return o(a).call(c,u)}else if("function"==typeof h){var f=o(h).call(c,u);if(f===i)return f;if(f)return o(a).call(c,u)}else if(e.isObject(u)){for(var p=n(h),d=0;d<p.length;++d){var m=p[d];if(h[m]!=u[m])continue t}return o(a).call(c,u)}}return t}}}},5910:t=>{"use strict";t.exports=function(t){var e=!1,r=[];function n(){this._trace=new n.CapturedTrace(o())}function o(){var t=r.length-1;if(t>=0)return r[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var t=r.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},n.CapturedTrace=null,n.create=function(){if(e)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=t.prototype._pushContext,i=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,u=t.prototype._promiseCreated;n.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=i,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=u,e=!1},e=!0,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,t._peekContext=t.prototype._peekContext=o,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},n}},461:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i,a,s,u,c=t._async,l=r(7621).Warning,h=r(5942),f=r(9571),p=h.canAttachTrace,d=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,m=/\((?:timers\.js):\d+:\d+\)/,v=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,g=null,_=null,D=!1,y=!(0==h.env("BLUEBIRD_DEBUG")||!h.env("BLUEBIRD_DEBUG")&&"development"!==h.env("NODE_ENV")),w=!(0==h.env("BLUEBIRD_WARNINGS")||!y&&!h.env("BLUEBIRD_WARNINGS")),b=!(0==h.env("BLUEBIRD_LONG_STACK_TRACES")||!y&&!h.env("BLUEBIRD_LONG_STACK_TRACES")),E=0!=h.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(w||!!h.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){var e=[];function r(){for(var t=0;t<e.length;++t)e[t]._notifyUnhandledRejection();n()}function n(){e.length=0}u=function(t){e.push(t),setTimeout(r,1)},f.defineProperty(t,"_unhandledRejectionCheck",{value:r}),f.defineProperty(t,"_unhandledRejectionClear",{value:n})}(),t.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},t.prototype._ensurePossibleRejectionHandled=function(){0==(524288&this._bitField)&&(this._setRejectionIsUnhandled(),u(this))},t.prototype._notifyUnhandledRejectionIsHandled=function(){W("rejectionHandled",i,void 0,this)},t.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},t.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),W("unhandledRejection",a,t,this)}},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},t.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},t.prototype._warn=function(t,e,r){return V(t,e,r||this)},t.onPossiblyUnhandledRejection=function(e){var r=t._getContext();a=h.contextBind(r,e)},t.onUnhandledRejectionHandled=function(e){var r=t._getContext();i=h.contextBind(r,e)};var C=function(){};t.longStackTraces=function(){if(c.haveItemsQueued()&&!et.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!et.longStackTraces&&K()){var r=t.prototype._captureStackTrace,n=t.prototype._attachExtraTrace,o=t.prototype._dereferenceTrace;et.longStackTraces=!0,C=function(){if(c.haveItemsQueued()&&!et.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");t.prototype._captureStackTrace=r,t.prototype._attachExtraTrace=n,t.prototype._dereferenceTrace=o,e.deactivateLongStackTraces(),et.longStackTraces=!1},t.prototype._captureStackTrace=U,t.prototype._attachExtraTrace=H,t.prototype._dereferenceTrace=z,e.activateLongStackTraces()}},t.hasLongStackTraces=function(){return et.longStackTraces&&K()};var F={unhandledrejection:{before:function(){var t=h.global.onunhandledrejection;return h.global.onunhandledrejection=null,t},after:function(t){h.global.onunhandledrejection=t}},rejectionhandled:{before:function(){var t=h.global.onrejectionhandled;return h.global.onrejectionhandled=null,t},after:function(t){h.global.onrejectionhandled=t}}},k=function(){var t=function(t,e){if(!t)return!h.global.dispatchEvent(e);var r;try{return r=t.before(),!h.global.dispatchEvent(e)}finally{t.after(r)}};try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return h.global.dispatchEvent(e),function(e,r){e=e.toLowerCase();var n=new CustomEvent(e,{detail:r,cancelable:!0});return f.defineProperty(n,"promise",{value:r.promise}),f.defineProperty(n,"reason",{value:r.reason}),t(F[e],n)}}if("function"==typeof Event){e=new Event("CustomEvent");return h.global.dispatchEvent(e),function(e,r){e=e.toLowerCase();var n=new Event(e,{cancelable:!0});return n.detail=r,f.defineProperty(n,"promise",{value:r.promise}),f.defineProperty(n,"reason",{value:r.reason}),t(F[e],n)}}return(e=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),h.global.dispatchEvent(e),function(e,r){e=e.toLowerCase();var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!0,r),t(F[e],n)}}catch(t){}return function(){return!1}}(),A=h.isNode?function(){return process.emit.apply(process,arguments)}:h.global?function(t){var e="on"+t.toLowerCase(),r=h.global[e];return!!r&&(r.apply(h.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function x(t,e){return{promise:e}}var S={promiseCreated:x,promiseFulfilled:x,promiseRejected:x,promiseResolved:x,promiseCancelled:x,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:x},O=function(t){var e=!1;try{e=A.apply(null,arguments)}catch(t){c.throwLater(t),e=!0}var r=!1;try{r=k(t,S[t].apply(null,arguments))}catch(t){c.throwLater(t),r=!0}return r||e};function T(){return!1}function P(t,e,r){var n=this;try{t(e,r,(function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+h.toString(t));n._attachCancellationCallback(t)}))}catch(t){return t}}function R(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?h.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function B(){return this._onCancelField}function j(t){this._onCancelField=t}function I(){this._cancellationParent=void 0,this._onCancelField=void 0}function L(t,e){if(0!=(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}t.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?t.longStackTraces():!e.longStackTraces&&t.hasLongStackTraces()&&C()),"warnings"in e){var r=e.warnings;et.warnings=!!r,E=et.warnings,h.isObject(r)&&"wForgottenReturn"in r&&(E=!!r.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!et.cancellation){if(c.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=I,t.prototype._propagateFrom=L,t.prototype._onCancel=B,t.prototype._setOnCancel=j,t.prototype._attachCancellationCallback=R,t.prototype._execute=P,N=L,et.cancellation=!0}if("monitoring"in e&&(e.monitoring&&!et.monitoring?(et.monitoring=!0,t.prototype._fireEvent=O):!e.monitoring&&et.monitoring&&(et.monitoring=!1,t.prototype._fireEvent=T)),"asyncHooks"in e&&h.nodeSupportsAsyncResource){var i=et.asyncHooks,a=!!e.asyncHooks;i!==a&&(et.asyncHooks=a,a?n():o())}return t},t.prototype._fireEvent=T,t.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(t){},t.prototype._attachCancellationCallback=function(t){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._dereferenceTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(t,e){};var N=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function M(){var e=this._boundTo;return void 0!==e&&e instanceof t?e.isFulfilled()?e.value():void 0:e}function U(){this._trace=new J(this._peekContext())}function H(t,e){if(p(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=$(t);h.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),h.notEnumerableProp(t,"__stackCleaned__",!0)}}}function z(){this._trace=void 0}function V(e,r,n){if(et.warnings){var o,i=new l(e);if(r)n._attachExtraTrace(i);else if(et.longStackTraces&&(o=t._peekContext()))o.attachExtraTrace(i);else{var a=$(i);i.stack=a.message+"\n"+a.stack.join("\n")}O("warning",i)||q(i,"",!0)}}function G(t){for(var e=[],r=0;r<t.length;++r){var n=t[r],o=" (No stack trace)"===n||g.test(n),i=o&&X(n);o&&!i&&(D&&" "!==n.charAt(0)&&(n=" "+n),e.push(n))}return e}function $(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r<e.length;++r){var n=e[r];if(" (No stack trace)"===n||g.test(n))break}return r>0&&"SyntaxError"!=t.name&&(e=e.slice(r)),e}(t):[" (No stack trace)"],{message:r,stack:"SyntaxError"==t.name?e:G(e)}}function q(t,e,r){if("undefined"!=typeof console){var n;if(h.isObject(t)){var o=t.stack;n=e+_(o,t)}else n=e+String(t);"function"==typeof s?s(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function W(t,e,r,n){var o=!1;try{"function"==typeof e&&(o=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){c.throwLater(t)}"unhandledRejection"===t?O(t,r,n)||o||q(r,"Unhandled rejection "):O(t,n)}function Y(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():h.toString(t);if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){var e=41;if(t.length<e)return t;return t.substr(0,e-3)+"..."}(e)+">, no stack trace)"}function K(){return"function"==typeof tt}var X=function(){return!1},Z=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Q(t){var e=t.match(Z);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function J(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);tt(this,J),e>32&&this.uncycle()}h.inherits(J,Error),e.CapturedTrace=J,J.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,o=this;void 0!==o;++n)e.push(o),o=o._parent;for(n=(t=this._length=n)-1;n>=0;--n){var i=e[n].stack;void 0===r[i]&&(r[i]=n)}for(n=0;n<t;++n){var a=r[e[n].stack];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var s=n>0?e[n-1]:this;a<t-1?(s._parent=e[a+1],s._parent.uncycle(),s._length=s._parent._length+1):(s._parent=void 0,s._length=1);for(var u=s._length+1,c=n-2;c>=0;--c)e[c]._length=u,u++;return}}}},J.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=$(t),r=e.message,n=[e.stack],o=this;void 0!==o;)n.push(G(o.stack.split("\n"))),o=o._parent;!function(t){for(var e=t[0],r=1;r<t.length;++r){for(var n=t[r],o=e.length-1,i=e[o],a=-1,s=n.length-1;s>=0;--s)if(n[s]===i){a=s;break}for(s=a;s>=0;--s){var u=n[s];if(e[o]!==u)break;e.pop(),o--}e=n}}(n),function(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}(n),h.notEnumerableProp(t,"stack",function(t,e){for(var r=0;r<e.length-1;++r)e[r].push("From previous event:"),e[r]=e[r].join("\n");return r<e.length&&(e[r]=e[r].join("\n")),t+"\n"+e.join("\n")}(r,n)),h.notEnumerableProp(t,"__stackCleaned__",!0)}};var tt=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():Y(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,g=t,_=e;var r=Error.captureStackTrace;return X=function(t){return d.test(t)},function(t,e){Error.stackTraceLimit+=6,r(t,e),Error.stackTraceLimit-=6}}var n,o=new Error;if("string"==typeof o.stack&&o.stack.split("\n")[0].indexOf("stackDetection@")>=0)return g=/@/,_=e,D=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){n="stack"in t}return!("stack"in o)&&n&&"number"==typeof Error.stackTraceLimit?(g=t,_=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6}):(_=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?Y(e):e.toString()},null)}();"undefined"!=typeof console&&void 0!==console.warn&&(s=function(t){console.warn(t)},h.isNode&&process.stderr.isTTY?s=function(t,e){var r=e?"":"";console.warn(r+t+"\n")}:h.isNode||"string"!=typeof(new Error).stack||(s=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var et={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return b&&t.longStackTraces(),{asyncHooks:function(){return et.asyncHooks},longStackTraces:function(){return et.longStackTraces},warnings:function(){return et.warnings},cancellation:function(){return et.cancellation},monitoring:function(){return et.monitoring},propagateFromFunction:function(){return N},boundValueFunction:function(){return M},checkForgottenReturns:function(t,e,r,n,o){if(void 0===t&&null!==e&&E){if(void 0!==o&&o._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var i="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),u=G(s),c=u.length-1;c>=0;--c){var l=u[c];if(!m.test(l)){var h=l.match(v);h&&(i="at "+h[1]+":"+h[2]+":"+h[3]+" ");break}}if(u.length>0){var f=u[0];for(c=0;c<s.length;++c)if(s[c]===f){c>0&&(a="\n"+s[c-1]);break}}}var p="a promise was created in a "+r+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(p,!0,e)}},setBounds:function(t,e){if(K()){for(var r,n,o=(t.stack||"").split("\n"),i=(e.stack||"").split("\n"),a=-1,s=-1,u=0;u<o.length;++u){if(c=Q(o[u])){r=c.fileName,a=c.line;break}}for(u=0;u<i.length;++u){var c;if(c=Q(i[u])){n=c.fileName,s=c.line;break}}a<0||s<0||!r||!n||r!==n||a>=s||(X=function(t){if(d.test(t))return!0;var e=Q(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}},warn:V,deprecated:function(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),V(r)},CapturedTrace:J,fireDomEvent:k,fireGlobalEvent:A}}},5632:t=>{"use strict";t.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1],n=function(){throw e};return this.caught(t,n)},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();var o=function(){return n};return this.caught(r,o)}}},6574:t=>{"use strict";t.exports=function(t,e){var r=t.reduce,n=t.all;function o(){return n(this)}t.prototype.each=function(t){return r(this,t,e,0)._then(o,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return r(this,t,e,e)},t.each=function(t,n){return r(t,n,e,0)._then(o,void 0,void 0,t,void 0)},t.mapSeries=function(t,n){return r(t,n,e,e)}}},7621:(t,e,r)=>{"use strict";var n,o,i=r(9571),a=i.freeze,s=r(5942),u=s.inherits,c=s.notEnumerableProp;function l(t,e){function r(n){if(!(this instanceof r))return new r(n);c(this,"message","string"==typeof n?n:e),c(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return u(r,Error),r}var h=l("Warning","warning"),f=l("CancellationError","cancellation error"),p=l("TimeoutError","timeout error"),d=l("AggregateError","aggregate error");try{n=TypeError,o=RangeError}catch(t){n=l("TypeError","type error"),o=l("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v<m.length;++v)"function"==typeof Array.prototype[m[v]]&&(d.prototype[m[v]]=Array.prototype[m[v]]);i.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var g=0;function _(t){if(!(this instanceof _))return new _(t);c(this,"name","OperationalError"),c(this,"message",t),this.cause=t,this.isOperational=!0,t instanceof Error?(c(this,"message",t.message),c(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}d.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",o=n.split("\n"),i=0;i<o.length;++i)o[i]=t+o[i];e+=(n=o.join("\n"))+"\n"}return g--,e},u(_,Error);var D=Error.__BluebirdErrorTypes__;D||(D=a({CancellationError:f,TimeoutError:p,OperationalError:_,RejectionError:_,AggregateError:d}),i.defineProperty(Error,"__BluebirdErrorTypes__",{value:D,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error,TypeError:n,RangeError:o,CancellationError:D.CancellationError,OperationalError:D.OperationalError,TimeoutError:D.TimeoutError,AggregateError:D.AggregateError,Warning:h}},9571:t=>{var e=function(){"use strict";return void 0===this}();if(e)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:e,propertyIsWritable:function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return!(r&&!r.writable&&!r.set)}};else{var r={}.hasOwnProperty,n={}.toString,o={}.constructor.prototype,i=function(t){var e=[];for(var n in t)r.call(t,n)&&e.push(n);return e};t.exports={isArray:function(t){try{return"[object Array]"===n.call(t)}catch(t){return!1}},keys:i,names:i,defineProperty:function(t,e,r){return t[e]=r.value,t},getDescriptor:function(t,e){return{value:t[e]}},freeze:function(t){return t},getPrototypeOf:function(t){try{return Object(t).constructor.prototype}catch(t){return o}},isES5:e,propertyIsWritable:function(){return!0}}}},6777:t=>{"use strict";t.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,o){return r(t,n,o,e)}}},7707:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=r(5942),i=t.CancellationError,a=o.errorObj,s=r(9976)(n);function u(t,e,r){this.promise=t,this.type=e,this.handler=r,this.called=!1,this.cancelPromise=null}function c(t){this.finallyHandler=t}function l(t,e){return null!=t.cancelPromise&&(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function h(){return p.call(this,this.promise._target()._settledValue())}function f(t){if(!l(this,t))return a.e=t,a}function p(r){var o=this.promise,s=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?s.call(o._boundValue()):s.call(o._boundValue(),r);if(u===n)return u;if(void 0!==u){o._setReturnedNonUndefined();var p=e(u,o);if(p instanceof t){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new i("late cancellation observer");return o._attachExtraTrace(d),a.e=d,a}p.isPending()&&p._attachCancellationCallback(new c(this))}return p._then(h,f,void 0,this,void 0)}}}return o.isRejected()?(l(this),a.e=r,a):(l(this),r)}return u.prototype.isFinallyHandler=function(){return 0===this.type},c.prototype._resultCancelled=function(){l(this.finallyHandler)},t.prototype._passThrough=function(t,e,r,n){return"function"!=typeof t?this.then():this._then(r,n,void 0,new u(this,e,t),void 0)},t.prototype.lastly=t.prototype.finally=function(t){return this._passThrough(t,0,p,p)},t.prototype.tap=function(t){return this._passThrough(t,1,p)},t.prototype.tapCatch=function(e){var r=arguments.length;if(1===r)return this._passThrough(e,1,void 0,p);var n,i=new Array(r-1),a=0;for(n=0;n<r-1;++n){var u=arguments[n];if(!o.isObject(u))return t.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+o.classString(u)));i[a++]=u}i.length=a;var c=arguments[n];return this._passThrough(s(i,c,this),1,void 0,p)},u}},687:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(7621).TypeError,u=r(5942),c=u.errorObj,l=u.tryCatch,h=[];function f(e,r,o,i){if(a.cancellation()){var s=new t(n),u=this._finallyPromise=new t(n);this._promise=s.lastly((function(){return u})),s._captureStackTrace(),s._setOnCancel(this)}else{(this._promise=new t(n))._captureStackTrace()}this._stack=i,this._generatorFunction=e,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof o?[o].concat(h):h,this._yieldedPromise=null,this._cancellationPhase=!1}u.inherits(f,i),f.prototype._isResolved=function(){return null===this._promise},f.prototype._cleanup=function(){this._promise=this._generator=null,a.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},f.prototype._promiseCancelled=function(){if(!this._isResolved()){var e;if(void 0!==this._generator.return)this._promise._pushContext(),e=l(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new t.CancellationError("generator .return() sentinel");t.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),e=l(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(e)}},f.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=l(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},f.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=l(this._generator.throw).call(this._generator,t);this._promise._popContext(),this._continue(e)},f.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof t){var e=this._yieldedPromise;this._yieldedPromise=null,e.cancel()}},f.prototype.promise=function(){return this._promise},f.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},f.prototype._continue=function(e){var r=this._promise;if(e===c)return this._cleanup(),this._cancellationPhase?r.cancel():r._rejectCallback(e.e,!1);var n=e.value;if(!0===e.done)return this._cleanup(),this._cancellationPhase?r.cancel():r._resolveCallback(n);var i=o(n,this._promise);if(i instanceof t||(i=function(e,r,n){for(var i=0;i<r.length;++i){n._pushContext();var a=l(r[i])(e);if(n._popContext(),a===c){n._pushContext();var s=t.reject(c.e);return n._popContext(),s}var u=o(a,n);if(u instanceof t)return u}return null}(i,this._yieldHandlers,this._promise),null!==i)){var a=(i=i._target())._bitField;0==(50397184&a)?(this._yieldedPromise=i,i._proxy(this,null)):0!=(33554432&a)?t._async.invoke(this._promiseFulfilled,this,i._value()):0!=(16777216&a)?t._async.invoke(this._promiseRejected,this,i._reason()):this._promiseCancelled()}else this._promiseRejected(new s("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(n))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},t.coroutine=function(t,e){if("function"!=typeof t)throw new s("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=Object(e).yieldHandler,n=f,o=(new Error).stack;return function(){var e=t.apply(this,arguments),i=new n(void 0,void 0,r,o),a=i.promise();return i._generator=e,i._promiseFulfilled(void 0),a}},t.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new s("expecting a function but got "+u.classString(t));h.push(t)},t.spawn=function(r){if(a.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof r)return e("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=new f(r,this),o=n.promise();return n._run(t.spawn),o}}},7717:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i){var a,s=r(5942),u=s.canEvaluate,c=s.tryCatch,l=s.errorObj;if(u){for(var h=function(t){return new Function("value","holder"," \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g,t))},f=function(t){return new Function("promise","holder"," \n 'use strict'; \n holder.pIndex = promise; \n ".replace(/Index/g,t))},p=function(e){for(var r=new Array(e),n=0;n<r.length;++n)r[n]="this.p"+(n+1);var o=r.join(" = ")+" = null;",a="var promise;\n"+r.map((function(t){return" \n promise = "+t+"; \n if (promise instanceof Promise) { \n promise.cancel(); \n } \n "})).join("\n"),s=r.join(", "),u="Holder$"+e,h="return function(tryCatch, errorObj, Promise, async) { \n 'use strict'; \n function [TheName](fn) { \n [TheProperties] \n this.fn = fn; \n this.asyncNeeded = true; \n this.now = 0; \n } \n \n [TheName].prototype._callFunction = function(promise) { \n promise._pushContext(); \n var ret = tryCatch(this.fn)([ThePassedArguments]); \n promise._popContext(); \n if (ret === errorObj) { \n promise._rejectCallback(ret.e, false); \n } else { \n promise._resolveCallback(ret); \n } \n }; \n \n [TheName].prototype.checkFulfillment = function(promise) { \n var now = ++this.now; \n if (now === [TheTotal]) { \n if (this.asyncNeeded) { \n async.invoke(this._callFunction, this, promise); \n } else { \n this._callFunction(promise); \n } \n \n } \n }; \n \n [TheName].prototype._resultCancelled = function() { \n [CancellationCode] \n }; \n \n return [TheName]; \n }(tryCatch, errorObj, Promise, async); \n ";return h=h.replace(/\[TheName\]/g,u).replace(/\[TheTotal\]/g,e).replace(/\[ThePassedArguments\]/g,s).replace(/\[TheProperties\]/g,o).replace(/\[CancellationCode\]/g,a),new Function("tryCatch","errorObj","Promise","async",h)(c,l,t,i)},d=[],m=[],v=[],g=0;g<8;++g)d.push(p(g+1)),m.push(h(g+1)),v.push(f(g+1));a=function(t){this._reject(t)}}t.join=function(){var r,i=arguments.length-1;if(i>0&&"function"==typeof arguments[i]&&(r=arguments[i],i<=8&&u)){(b=new t(o))._captureStackTrace();for(var c=d[i-1],l=new c(r),h=m,f=0;f<i;++f){var p=n(arguments[f],b);if(p instanceof t){var g=(p=p._target())._bitField;0==(50397184&g)?(p._then(h[f],a,void 0,b,l),v[f](p,l),l.asyncNeeded=!1):0!=(33554432&g)?h[f].call(b,p._value(),l):0!=(16777216&g)?b._reject(p._reason()):b._cancel()}else h[f].call(b,p,l)}if(!b._isFateSealed()){if(l.asyncNeeded){var _=t._getContext();l.fn=s.contextBind(_,l.fn)}b._setAsyncGuaranteed(),b._setOnCancel(l)}return b}for(var D=arguments.length,y=new Array(D),w=0;w<D;++w)y[w]=arguments[w];r&&y.pop();var b=new e(y).promise();return void 0!==r?b.spread(r):b}}},6343:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(5942),u=s.tryCatch,c=s.errorObj,l=t._async;function h(e,r,n,o){this.constructor$(e),this._promise._captureStackTrace();var a=t._getContext();if(this._callback=s.contextBind(a,r),this._preservedValues=o===i?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],l.invoke(this._asyncInit,this,void 0),s.isArray(e))for(var u=0;u<e.length;++u){var c=e[u];c instanceof t&&c.suppressUnhandledRejections()}}function f(e,r,o,i){if("function"!=typeof r)return n("expecting a function but got "+s.classString(r));var a=0;if(void 0!==o){if("object"!=typeof o||null===o)return t.reject(new TypeError("options argument must be an object but it is "+s.classString(o)));if("number"!=typeof o.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+s.classString(o.concurrency)));a=o.concurrency}return new h(e,r,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,i).promise()}s.inherits(h,e),h.prototype._asyncInit=function(){this._init$(void 0,-2)},h.prototype._init=function(){},h.prototype._promiseFulfilled=function(e,r){var n=this._values,i=this.length(),s=this._preservedValues,l=this._limit;if(r<0){if(n[r=-1*r-1]=e,l>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(l>=1&&this._inFlight>=l)return n[r]=e,this._queue.push(r),!1;null!==s&&(s[r]=e);var h=this._promise,f=this._callback,p=h._boundValue();h._pushContext();var d=u(f).call(p,e,r,i),m=h._popContext();if(a.checkForgottenReturns(d,m,null!==s?"Promise.filter":"Promise.map",h),d===c)return this._reject(d.e),!0;var v=o(d,this._promise);if(v instanceof t){var g=(v=v._target())._bitField;if(0==(50397184&g))return l>=1&&this._inFlight++,n[r]=v,v._proxy(this,-1*(r+1)),!1;if(0==(33554432&g))return 0!=(16777216&g)?(this._reject(v._reason()),!0):(this._cancel(),!0);d=v._value()}n[r]=d}return++this._totalResolved>=i&&(null!==s?this._filter(n,s):this._resolve(n),!0)},h.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var n=t.pop();this._promiseFulfilled(r[n],n)}},h.prototype._filter=function(t,e){for(var r=e.length,n=new Array(r),o=0,i=0;i<r;++i)t[i]&&(n[o++]=e[i]);n.length=o,this._resolve(n)},h.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(t,e){return f(this,t,e,null)},t.map=function(t,e,r,n){return f(t,e,r,n)}}},6926:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i){var a=r(5942),s=a.tryCatch;t.method=function(r){if("function"!=typeof r)throw new t.TypeError("expecting a function but got "+a.classString(r));return function(){var n=new t(e);n._captureStackTrace(),n._pushContext();var o=s(r).apply(this,arguments),a=n._popContext();return i.checkForgottenReturns(o,a,"Promise.method",n),n._resolveFromSyncValue(o),n}},t.attempt=t.try=function(r){if("function"!=typeof r)return o("expecting a function but got "+a.classString(r));var n,u=new t(e);if(u._captureStackTrace(),u._pushContext(),arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],l=arguments[2];n=a.isArray(c)?s(r).apply(l,c):s(r).call(l,c)}else n=s(r)();var h=u._popContext();return i.checkForgottenReturns(n,h,"Promise.try",u),u._resolveFromSyncValue(n),u},t.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},1776:(t,e,r)=>{"use strict";var n=r(5942),o=n.maybeWrapAsError,i=r(7621).OperationalError,a=r(9571);var s=/^(?:name|message|stack|cause)$/;function u(t){var e;if(function(t){return t instanceof Error&&a.getPrototypeOf(t)===Error.prototype}(t)){(e=new i(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var r=a.keys(t),o=0;o<r.length;++o){var u=r[o];s.test(u)||(e[u]=t[u])}return e}return n.markAsOriginatingFromRejection(t),t}t.exports=function(t,e){return function(r,n){if(null!==t){if(r){var i=u(o(r));t._attachExtraTrace(i),t._reject(i)}else if(e){for(var a=arguments.length,s=new Array(Math.max(a-1,0)),c=1;c<a;++c)s[c-1]=arguments[c];t._fulfill(s)}else t._fulfill(n);t=null}}}},1941:(t,e,r)=>{"use strict";t.exports=function(t){var e=r(5942),n=t._async,o=e.tryCatch,i=e.errorObj;function a(t,r){if(!e.isArray(t))return s.call(this,t,r);var a=o(r).apply(this._boundValue(),[null].concat(t));a===i&&n.throwLater(a.e)}function s(t,e){var r=this._boundValue(),a=void 0===t?o(e).call(r,null):o(e).call(r,null,t);a===i&&n.throwLater(a.e)}function u(t,e){if(!t){var r=new Error(t+"");r.cause=t,t=r}var a=o(e).call(this._boundValue(),t);a===i&&n.throwLater(a.e)}t.prototype.asCallback=t.prototype.nodeify=function(t,e){if("function"==typeof t){var r=s;void 0!==e&&Object(e).spread&&(r=a),this._then(r,u,void 0,this,t)}return this}}},7502:(t,e,r)=>{"use strict";t.exports=function(){var e=function(){return new g("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},n=function(){return new P.PromiseInspection(this._target())},o=function(t){return P.reject(new g(t))};function i(){}var a={},s=r(5942);s.setReflectHandler(n);var u=function(){var t=process.domain;return void 0===t?null:t},c=function(){return{domain:u(),async:null}},l=s.isNode&&s.nodeSupportsAsyncResource?r(852).AsyncResource:null,h=function(){return{domain:u(),async:new l("Bluebird::Promise")}},f=s.isNode?c:function(){return null};s.notEnumerableProp(P,"_getContext",f);var p=r(9571),d=r(4601),m=new d;p.defineProperty(P,"_async",{value:m});var v=r(7621),g=P.TypeError=v.TypeError;P.RangeError=v.RangeError;var _=P.CancellationError=v.CancellationError;P.TimeoutError=v.TimeoutError,P.OperationalError=v.OperationalError,P.RejectionError=v.OperationalError,P.AggregateError=v.AggregateError;var D=function(){},y={},w={},b=r(1778)(P,D),E=r(1640)(P,D,b,o,i),C=r(5910)(P),F=C.create,k=r(461)(P,C,(function(){f=h,s.notEnumerableProp(P,"_getContext",h)}),(function(){f=c,s.notEnumerableProp(P,"_getContext",c)})),A=(k.CapturedTrace,r(7707)(P,b,w)),x=r(9976)(w),S=r(1776),O=s.errorObj,T=s.tryCatch;function P(t){t!==D&&function(t,e){if(null==t||t.constructor!==P)throw new g("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof e)throw new g("expecting a function but got "+s.classString(e))}(this,t),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(t),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function R(t){this.promise._resolveCallback(t)}function B(t){this.promise._rejectCallback(t,!1)}function j(t){var e=new P(D);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}return P.prototype.toString=function(){return"[object Promise]"},P.prototype.caught=P.prototype.catch=function(t){var e=arguments.length;if(e>1){var r,n=new Array(e-1),i=0;for(r=0;r<e-1;++r){var a=arguments[r];if(!s.isObject(a))return o("Catch statement predicate: expecting an object but got "+s.classString(a));n[i++]=a}if(n.length=i,"function"!=typeof(t=arguments[r]))throw new g("The last argument to .catch() must be a function, got "+s.toString(t));return this.then(void 0,x(n,t,this))}return this.then(void 0,t)},P.prototype.reflect=function(){return this._then(n,n,void 0,this,void 0)},P.prototype.then=function(t,e){if(k.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+s.classString(t);arguments.length>1&&(r+=", "+s.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},P.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},P.prototype.spread=function(t){return"function"!=typeof t?o("expecting a function but got "+s.classString(t)):this.all()._then(t,void 0,void 0,y,void 0)},P.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},P.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},P.prototype.error=function(t){return this.caught(s.originatesFromRejection,t)},P.getNewLibraryCopy=t.exports,P.is=function(t){return t instanceof P},P.fromNode=P.fromCallback=function(t){var e=new P(D);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=T(t)(S(e,r));return n===O&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},P.all=function(t){return new E(t).promise()},P.cast=function(t){var e=b(t);return e instanceof P||((e=new P(D))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},P.resolve=P.fulfilled=P.cast,P.reject=P.rejected=function(t){var e=new P(D);return e._captureStackTrace(),e._rejectCallback(t,!0),e},P.setScheduler=function(t){if("function"!=typeof t)throw new g("expecting a function but got "+s.classString(t));return m.setScheduler(t)},P.prototype._then=function(t,e,r,n,o){var i=void 0!==o,a=i?o:new P(D),u=this._target(),c=u._bitField;i||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&c)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var l=f();if(0!=(50397184&c)){var h,p,d=u._settlePromiseCtx;0!=(33554432&c)?(p=u._rejectionHandler0,h=t):0!=(16777216&c)?(p=u._fulfillmentHandler0,h=e,u._unsetRejectionIsUnhandled()):(d=u._settlePromiseLateCancellationObserver,p=new _("late cancellation observer"),u._attachExtraTrace(p),h=e),m.invoke(d,u,{handler:s.contextBind(l,h),promise:a,receiver:n,value:p})}else u._addCallbacks(t,e,a,n,l);return a},P.prototype._length=function(){return 65535&this._bitField},P.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},P.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},P.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},P.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},P.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},P.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},P.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},P.prototype._isFinal=function(){return(4194304&this._bitField)>0},P.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},P.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},P.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},P.prototype._setAsyncGuaranteed=function(){if(!m.hasCustomScheduler()){var t=this._bitField;this._bitField=t|(536870912&t)>>2^134217728}},P.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},P.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==a)return void 0===e&&this._isBound()?this._boundValue():e},P.prototype._promiseAt=function(t){return this[4*t-4+2]},P.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},P.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},P.prototype._boundValue=function(){},P.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,r=t._rejectionHandler0,n=t._promise0,o=t._receiverAt(0);void 0===o&&(o=a),this._addCallbacks(e,r,n,o,null)},P.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),o=t._promiseAt(e),i=t._receiverAt(e);void 0===i&&(i=a),this._addCallbacks(r,n,o,i,null)},P.prototype._addCallbacks=function(t,e,r,n,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=s.contextBind(o,t)),"function"==typeof e&&(this._rejectionHandler0=s.contextBind(o,e));else{var a=4*i-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=s.contextBind(o,t)),"function"==typeof e&&(this[a+1]=s.contextBind(o,e))}return this._setLength(i+1),i},P.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},P.prototype._resolveCallback=function(t,r){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(e(),!1);var n=b(t,this);if(!(n instanceof P))return this._fulfill(t);r&&this._propagateFrom(n,2);var o=n._target();if(o!==this){var i=o._bitField;if(0==(50397184&i)){var a=this._length();a>0&&o._migrateCallback0(this);for(var s=1;s<a;++s)o._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(n)}else if(0!=(33554432&i))this._fulfill(o._value());else if(0!=(16777216&i))this._reject(o._reason());else{var u=new _("late cancellation observer");o._attachExtraTrace(u),this._reject(u)}}else this._reject(e())}},P.prototype._rejectCallback=function(t,e,r){var n=s.ensureErrorObject(t),o=n===t;if(!o&&!r&&k.warnings()){var i="a promise was rejected with a non-error: "+s.classString(t);this._warn(i,!0)}this._attachExtraTrace(n,!!e&&o),this._reject(t)},P.prototype._resolveFromExecutor=function(t){if(t!==D){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=this._execute(t,(function(t){e._resolveCallback(t)}),(function(t){e._rejectCallback(t,r)}));r=!1,this._popContext(),void 0!==n&&e._rejectCallback(n,!0)}},P.prototype._settlePromiseFromHandler=function(t,e,r,n){var o=n._bitField;if(0==(65536&o)){var i;n._pushContext(),e===y?r&&"number"==typeof r.length?i=T(t).apply(this._boundValue(),r):(i=O).e=new g("cannot .spread() a non-array: "+s.classString(r)):i=T(t).call(e,r);var a=n._popContext();0==(65536&(o=n._bitField))&&(i===w?n._reject(r):i===O?n._rejectCallback(i.e,!1):(k.checkForgottenReturns(i,a,"",n,this),n._resolveCallback(i)))}},P.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},P.prototype._followee=function(){return this._rejectionHandler0},P.prototype._setFollowee=function(t){this._rejectionHandler0=t},P.prototype._settlePromise=function(t,e,r,o){var a=t instanceof P,s=this._bitField,u=0!=(134217728&s);0!=(65536&s)?(a&&t._invokeInternalOnCancel(),r instanceof A&&r.isFinallyHandler()?(r.cancelPromise=t,T(e).call(r,o)===O&&t._reject(O.e)):e===n?t._fulfill(n.call(r)):r instanceof i?r._promiseCancelled(t):a||t instanceof E?t._cancel():r.cancel()):"function"==typeof e?a?(u&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof i?r._isResolved()||(0!=(33554432&s)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):a&&(u&&t._setAsyncGuaranteed(),0!=(33554432&s)?t._fulfill(o):t._reject(o))},P.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,r=t.promise,n=t.receiver,o=t.value;"function"==typeof e?r instanceof P?this._settlePromiseFromHandler(e,n,o,r):e.call(n,o,r):r instanceof P&&r._reject(o)},P.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},P.prototype._settlePromise0=function(t,e,r){var n=this._promise0,o=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(n,t,o,e)},P.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},P.prototype._fulfill=function(t){var r=this._bitField;if(!((117506048&r)>>>16)){if(t===this){var n=e();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&r)>0&&(0!=(134217728&r)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},P.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return m.fatalError(t,s.isNode);(65535&e)>0?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},P.prototype._fulfillPromises=function(t,e){for(var r=1;r<t;r++){var n=this._fulfillmentHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,e)}},P.prototype._rejectPromises=function(t,e){for(var r=1;r<t;r++){var n=this._rejectionHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,e)}},P.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!=(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},P.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&p.defineProperty(P.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),P.defer=P.pending=function(){return k.deprecated("Promise.defer","new Promise"),{promise:new P(D),resolve:R,reject:B}},s.notEnumerableProp(P,"_makeSelfResolutionError",e),r(6926)(P,D,b,o,k),r(3635)(P,D,b,k),r(1735)(P,E,o,k),r(5632)(P),r(1958)(P),r(7717)(P,E,b,D,m),P.Promise=P,P.version="3.7.2",r(2293)(P),r(687)(P,o,D,b,i,k),r(6343)(P,E,o,b,D,k),r(1941)(P),r(9346)(P,D),r(5733)(P,E,b,o),r(4648)(P,D,b,o),r(3609)(P,E,o,b,D,k),r(8615)(P,E,k),r(4488)(P,E,o),r(8418)(P,D,k),r(4525)(P,o,b,F,D,k),r(9846)(P),r(6574)(P,D),r(6777)(P,D),s.toFastProperties(P),s.toFastProperties(P.prototype),j({a:1}),j({b:2}),j({c:3}),j(1),j((function(){})),j(void 0),j(!1),j(new P(D)),k.setBounds(d.firstLineError,s.lastLineError),P}},1640:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i){var a=r(5942);a.isArray;function s(r){var n=this._promise=new t(e);r instanceof t&&(n._propagateFrom(r,3),r.suppressUnhandledRejections()),n._setOnCancel(this),this._values=r,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,i),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function e(r,i){var s=n(this._values,this._promise);if(s instanceof t){var u=(s=s._target())._bitField;if(this._values=s,0==(50397184&u))return this._promise._setAsyncGuaranteed(),s._then(e,this._reject,void 0,this,i);if(0==(33554432&u))return 0!=(16777216&u)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===i?this._resolveEmptyArray():this._resolve(function(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}(i));else{var c=o("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(c,!1)}},s.prototype._iterate=function(e){var r=this.getActualLength(e.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var o=this._promise,i=!1,a=null,s=0;s<r;++s){var u=n(e[s],o);a=u instanceof t?(u=u._target())._bitField:null,i?null!==a&&u.suppressUnhandledRejections():null!==a?0==(50397184&a)?(u._proxy(this,s),this._values[s]=u):i=0!=(33554432&a)?this._promiseFulfilled(u._value(),s):0!=(16777216&a)?this._promiseRejected(u._reason(),s):this._promiseCancelled(s):i=this._promiseFulfilled(u,s)}i||o._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},s.prototype._promiseFulfilled=function(t,e){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var r=0;r<e.length;++r)e[r]instanceof t&&e[r].cancel()}},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},9346:(t,e,r)=>{"use strict";t.exports=function(t,e){var n={},o=r(5942),i=r(1776),a=o.withAppended,s=o.maybeWrapAsError,u=o.canEvaluate,c=r(7621).TypeError,l={__isPromisified__:!0},h=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),f=function(t){return o.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t};function p(t){return!h.test(t)}function d(t){try{return!0===t.__isPromisified__}catch(t){return!1}}function m(t,e,r){var n=o.getDataPropertyOrDefault(t,e+r,l);return!!n&&d(n)}function v(t,e,r,n){for(var i=o.inheritedDataKeys(t),a=[],s=0;s<i.length;++s){var u=i[s],l=t[u],h=n===f||f(u);"function"!=typeof l||d(l)||m(t,u,e)||!n(u,l,t,h)||a.push(u,l)}return function(t,e,r){for(var n=0;n<t.length;n+=2){var o=t[n];if(r.test(o))for(var i=o.replace(r,""),a=0;a<t.length;a+=2)if(t[a]===i)throw new c("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",e))}}(a,e,r),a}var g;g=function(r,u,c,l,h,f){var p=Math.max(0,function(t){return"number"==typeof t.length?Math.max(Math.min(t.length,1024),0):0}(l)-1),d=function(t){for(var e=[t],r=Math.max(0,t-1-3),n=t-1;n>=r;--n)e.push(n);for(n=t+1;n<=3;++n)e.push(n);return e}(p),m="string"==typeof r||u===n;function v(t){var e,r=(e=t,o.filledRange(e,"_arg","")).join(", "),n=t>0?", ":"";return(m?"ret = callback.call(this, {{args}}, nodeback); break;\n":void 0===u?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n").replace("{{args}}",r).replace(", ",n)}var g="string"==typeof r?"this != null ? this['"+r+"'] : fn":"fn",_="'use strict'; \n var ret = function (Parameters) { \n 'use strict'; \n var len = arguments.length; \n var promise = new Promise(INTERNAL); \n promise._captureStackTrace(); \n var nodeback = nodebackForPromise(promise, "+f+"); \n var ret; \n var callback = tryCatch([GetFunctionCode]); \n switch(len) { \n [CodeForSwitchCase] \n } \n if (ret === errorObj) { \n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n } \n if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n return promise; \n }; \n notEnumerableProp(ret, '__isPromisified__', true); \n return ret; \n ".replace("[CodeForSwitchCase]",function(){for(var t="",e=0;e<d.length;++e)t+="case "+d[e]+":"+v(d[e]);return t+=" \n default: \n var args = new Array(len + 1); \n var i = 0; \n for (var i = 0; i < len; ++i) { \n args[i] = arguments[i]; \n } \n args[i] = nodeback; \n [CodeForCall] \n break; \n ".replace("[CodeForCall]",m?"ret = callback.apply(this, args);\n":"ret = callback.apply(receiver, args);\n")}()).replace("[GetFunctionCode]",g);return _=_.replace("Parameters",function(t){return o.filledRange(Math.max(t,3),"_arg","")}(p)),new Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",_)(t,l,u,a,s,i,o.tryCatch,o.errorObj,o.notEnumerableProp,e)};var _=u?g:function(r,u,c,l,h,f){var p=function(){return this}(),d=r;function m(){var o=u;u===n&&(o=this);var c=new t(e);c._captureStackTrace();var l="string"==typeof d&&this!==p?this[d]:r,h=i(c,f);try{l.apply(o,a(arguments,h))}catch(t){c._rejectCallback(s(t),!0,!0)}return c._isFateSealed()||c._setAsyncGuaranteed(),c}return"string"==typeof d&&(r=l),o.notEnumerableProp(m,"__isPromisified__",!0),m};function D(t,e,r,i,a){for(var s=new RegExp(e.replace(/([$])/,"\\$")+"$"),u=v(t,e,s,r),c=0,l=u.length;c<l;c+=2){var h=u[c],f=u[c+1],p=h+e;if(i===_)t[p]=_(h,n,h,f,e,a);else{var d=i(f,(function(){return _(h,n,h,f,e,a)}));o.notEnumerableProp(d,"__isPromisified__",!0),t[p]=d}}return o.toFastProperties(t),t}t.promisify=function(t,e){if("function"!=typeof t)throw new c("expecting a function but got "+o.classString(t));if(d(t))return t;var r=function(t,e,r){return _(t,e,void 0,t,null,r)}(t,void 0===(e=Object(e)).context?n:e.context,!!e.multiArgs);return o.copyDescriptors(t,r,p),r},t.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new c("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");var r=!!(e=Object(e)).multiArgs,n=e.suffix;"string"!=typeof n&&(n="Async");var i=e.filter;"function"!=typeof i&&(i=f);var a=e.promisifier;if("function"!=typeof a&&(a=_),!o.isIdentifier(n))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=o.inheritedDataKeys(t),u=0;u<s.length;++u){var l=t[s[u]];"constructor"!==s[u]&&o.isClass(l)&&(D(l.prototype,n,i,a,r),D(l,n,i,a,r))}return D(t,n,i,a,r)}}},5733:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i,a=r(5942),s=a.isObject,u=r(9571);"function"==typeof Map&&(i=Map);var c=function(){var t=0,e=0;function r(r,n){this[t]=r,this[t+e]=n,t++}return function(n){e=n.size,t=0;var o=new Array(2*n.size);return n.forEach(r,o),o}}();function l(t){var e,r=!1;if(void 0!==i&&t instanceof i)e=c(t),r=!0;else{var n=u.keys(t),o=n.length;e=new Array(2*o);for(var a=0;a<o;++a){var s=n[a];e[a]=t[s],e[a+o]=s}}this.constructor$(e),this._isMap=r,this._init$(void 0,r?-6:-3)}function h(e){var r,i=n(e);return s(i)?(r=i instanceof t?i._then(t.props,void 0,void 0,void 0,void 0):new l(i).promise(),i instanceof t&&r._propagateFrom(i,2),r):o("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}a.inherits(l,e),l.prototype._init=function(){},l.prototype._promiseFulfilled=function(t,e){if(this._values[e]=t,++this._totalResolved>=this._length){var r;if(this._isMap)r=function(t){for(var e=new i,r=t.length/2|0,n=0;n<r;++n){var o=t[r+n],a=t[n];e.set(o,a)}return e}(this._values);else{r={};for(var n=this.length(),o=0,a=this.length();o<a;++o)r[this._values[o+n]]=this._values[o]}return this._resolve(r),!0}return!1},l.prototype.shouldCopyValues=function(){return!1},l.prototype.getActualLength=function(t){return t>>1},t.prototype.props=function(){return h(this)},t.props=function(t){return h(t)}}},7824:t=>{"use strict";function e(t){this._capacity=t,this._length=0,this._front=0}e.prototype._willBeOverCapacity=function(t){return this._capacity<t},e.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1),this[this._front+e&this._capacity-1]=t,this._length=e+1},e.prototype.push=function(t,e,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(t),this._pushOne(e),void this._pushOne(r);var o=this._front+n-3;this._checkCapacity(n);var i=this._capacity-1;this[o+0&i]=t,this[o+1&i]=e,this[o+2&i]=r,this._length=n},e.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},e.prototype.length=function(){return this._length},e.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},e.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t,function(t,e,r,n,o){for(var i=0;i<o;++i)r[i+n]=t[i+e],t[i+e]=void 0}(this,0,this,e,this._front+this._length&e-1)},t.exports=e},4648:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o){var i=r(5942);function a(r,s){var u,c=n(r);if(c instanceof t)return(u=c).then((function(t){return a(t,u)}));if(null===(r=i.asArray(r)))return o("expecting an array or an iterable object but got "+i.classString(r));var l=new t(e);void 0!==s&&l._propagateFrom(s,3);for(var h=l._fulfill,f=l._reject,p=0,d=r.length;p<d;++p){var m=r[p];(void 0!==m||p in r)&&t.cast(m)._then(h,f,void 0,l,null)}return l}t.race=function(t){return a(t,void 0)},t.prototype.race=function(){return a(this,void 0)}}},3609:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(5942),u=s.tryCatch;function c(e,r,n,o){this.constructor$(e);var a=t._getContext();this._fn=s.contextBind(a,r),void 0!==n&&(n=t.resolve(n))._attachCancellationCallback(this),this._initialValue=n,this._currentCancellable=null,this._eachValues=o===i?Array(this._length):0===o?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function l(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function h(t,e,r,o){return"function"!=typeof e?n("expecting a function but got "+s.classString(e)):new c(t,e,r,o).promise()}function f(e){this.accum=e,this.array._gotAccum(e);var r=o(this.value,this.array._promise);return r instanceof t?(this.array._currentCancellable=r,r._then(p,void 0,void 0,this,void 0)):p.call(this,r)}function p(e){var r,n=this.array,o=n._promise,i=u(n._fn);o._pushContext(),(r=void 0!==n._eachValues?i.call(o._boundValue(),e,this.index,this.length):i.call(o._boundValue(),this.accum,e,this.index,this.length))instanceof t&&(n._currentCancellable=r);var s=o._popContext();return a.checkForgottenReturns(r,s,void 0!==n._eachValues?"Promise.each":"Promise.reduce",o),r}s.inherits(c,e),c.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==i&&this._eachValues.push(t)},c.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},c.prototype._init=function(){},c.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},c.prototype.shouldCopyValues=function(){return!1},c.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},c.prototype._resultCancelled=function(e){if(e===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof t&&this._currentCancellable.cancel(),this._initialValue instanceof t&&this._initialValue.cancel())},c.prototype._iterate=function(e){var r,n;this._values=e;var o=e.length;void 0!==this._initialValue?(r=this._initialValue,n=0):(r=t.resolve(e[0]),n=1),this._currentCancellable=r;for(var i=n;i<o;++i){var a=e[i];a instanceof t&&a.suppressUnhandledRejections()}if(!r.isRejected())for(;n<o;++n){var s={accum:null,value:e[n],index:n,length:o,array:this};r=r._then(f,void 0,void 0,s,void 0),0==(127&n)&&r._setNoAsyncGuarantee()}void 0!==this._eachValues&&(r=r._then(this._eachComplete,void 0,void 0,this,void 0)),r._then(l,l,void 0,r,this)},t.prototype.reduce=function(t,e){return h(this,t,e,null)},t.reduce=function(t,e,r,n){return h(t,e,r,n)}}},679:(t,e,r)=>{"use strict";var n,o=r(5942),i=o.getNativePromise();if(o.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,s=process.nextTick;n=o.isRecentNode?function(t){a.call(global,t)}:function(t){s.call(process,t)}}else if("function"==typeof i&&"function"==typeof i.resolve){var u=i.resolve();n=function(t){u.then(t)}}else n="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)||!("classList"in document.documentElement)?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}:function(){var t=document.createElement("div"),e={attributes:!0},r=!1,n=document.createElement("div");new MutationObserver((function(){t.classList.toggle("foo"),r=!1})).observe(n,e);return function(o){var i=new MutationObserver((function(){i.disconnect(),o()}));i.observe(t,e),r||(r=!0,n.classList.toggle("foo"))}}();t.exports=n},8615:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=t.PromiseInspection;function i(t){this.constructor$(t)}r(5942).inherits(i,e),i.prototype._promiseResolved=function(t,e){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(t,e){var r=new o;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},i.prototype._promiseRejected=function(t,e){var r=new o;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},t.settle=function(t){return n.deprecated(".settle()",".reflect()"),new i(t).promise()},t.allSettled=function(t){return new i(t).promise()},t.prototype.settle=function(){return t.settle(this)}}},4488:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=r(5942),i=r(7621).RangeError,a=r(7621).AggregateError,s=o.isArray,u={};function c(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function l(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new c(t),o=r.promise();return r.setHowMany(e),r.init(),o}o.inherits(c,e),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=s(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(t){this._howMany=t},c.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new a,e=this.length();e<this._values.length;++e)this._values[e]!==u&&t.push(this._values[e]);return t.length>0?this._reject(t):this._cancel(),!0}return!1},c.prototype._fulfilled=function(){return this._totalResolved},c.prototype._rejected=function(){return this._values.length-this.length()},c.prototype._addRejected=function(t){this._values.push(t)},c.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},c.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},c.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new i(e)},c.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(t,e){return l(t,e)},t.prototype.some=function(t){return l(this,t)},t._SomePromiseArray=c}},1958:t=>{"use strict";t.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},o=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},i=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return i.call(this._target())},t.prototype.isFulfilled=function(){return o.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},1778:(t,e,r)=>{"use strict";t.exports=function(t,e){var n=r(5942),o=n.errorObj,i=n.isObject;var a={}.hasOwnProperty;return function(r,s){if(i(r)){if(r instanceof t)return r;var u=function(t){try{return function(t){return t.then}(t)}catch(t){return o.e=t,o}}(r);if(u===o){s&&s._pushContext();var c=t.reject(u.e);return s&&s._popContext(),c}if("function"==typeof u){if(function(t){try{return a.call(t,"_promise0")}catch(t){return!1}}(r)){c=new t(e);return r._then(c._fulfill,c._reject,void 0,c,null),c}return function(r,i,a){var s=new t(e),u=s;a&&a._pushContext();s._captureStackTrace(),a&&a._popContext();var c=!0,l=n.tryCatch(i).call(r,h,f);c=!1,s&&l===o&&(s._rejectCallback(l.e,!0,!0),s=null);function h(t){s&&(s._resolveCallback(t),s=null)}function f(t){s&&(s._rejectCallback(t,c,!0),s=null)}return u}(r,u,s)}}return r}}},8418:(t,e,r)=>{"use strict";t.exports=function(t,e,n){var o=r(5942),i=t.TimeoutError;function a(t){this.handle=t}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(t){return u(+this).thenReturn(t)},u=t.delay=function(r,o){var i,u;return void 0!==o?(i=t.resolve(o)._then(s,null,null,r,void 0),n.cancellation()&&o instanceof t&&i._setOnCancel(o)):(i=new t(e),u=setTimeout((function(){i._fulfill()}),+r),n.cancellation()&&i._setOnCancel(new a(u)),i._captureStackTrace()),i._setAsyncGuaranteed(),i};t.prototype.delay=function(t){return u(t,this)};function c(t){return clearTimeout(this.handle),t}function l(t){throw clearTimeout(this.handle),t}t.prototype.timeout=function(t,e){var r,s;t=+t;var u=new a(setTimeout((function(){r.isPending()&&function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new i("operation timed out"):new i(e),o.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()}(r,e,s)}),t));return n.cancellation()?(s=this.then(),(r=s._then(c,l,void 0,u,void 0))._setOnCancel(u)):r=this._then(c,l,void 0,u,void 0),r}}},4525:(t,e,r)=>{"use strict";t.exports=function(t,e,n,o,i,a){var s=r(5942),u=r(7621).TypeError,c=r(5942).inherits,l=s.errorObj,h=s.tryCatch,f={};function p(t){setTimeout((function(){throw t}),0)}function d(e,r){var o=0,a=e.length,s=new t(i);return function i(){if(o>=a)return s._fulfill();var u=function(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(e[o++]);if(u instanceof t&&u._isDisposable()){try{u=n(u._getDisposer().tryDispose(r),e.promise)}catch(t){return p(t)}if(u instanceof t)return u._then(i,p,null,null,null)}i()}(),s}function m(t,e,r){this._data=t,this._promise=e,this._context=r}function v(t,e,r){this.constructor$(t,e,r)}function g(t){return m.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function _(t){this.length=t,this.promise=null,this[t-1]=null}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():f},m.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==f?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},m.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},c(v,m),v.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},_.prototype._resultCancelled=function(){for(var e=this.length,r=0;r<e;++r){var n=this[r];n instanceof t&&n.cancel()}},t.using=function(){var r=arguments.length;if(r<2)return e("you must pass at least 2 arguments to Promise.using");var o,i=arguments[r-1];if("function"!=typeof i)return e("expecting a function but got "+s.classString(i));var u=!0;2===r&&Array.isArray(arguments[0])?(r=(o=arguments[0]).length,u=!1):(o=arguments,r--);for(var c=new _(r),f=0;f<r;++f){var p=o[f];if(m.isDisposer(p)){var v=p;(p=p.promise())._setDisposable(v)}else{var D=n(p);D instanceof t&&(p=D._then(g,null,null,{resources:c,index:f},void 0))}c[f]=p}var y=new Array(c.length);for(f=0;f<y.length;++f)y[f]=t.resolve(c[f]).reflect();var w=t.all(y).then((function(t){for(var e=0;e<t.length;++e){var r=t[e];if(r.isRejected())return l.e=r.error(),l;if(!r.isFulfilled())return void w.cancel();t[e]=r.value()}b._pushContext(),i=h(i);var n=u?i.apply(void 0,t):i(t),o=b._popContext();return a.checkForgottenReturns(n,o,"Promise.using",b),n})),b=w.lastly((function(){var e=new t.PromiseInspection(w);return d(c,e)}));return c.promise=b,b._setOnCancel(c),b},t.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},t.prototype._isDisposable=function(){return(131072&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(t){if("function"==typeof t)return new v(t,this,o());throw new u}}},5942:function(t,e,r){"use strict";var n=r(9571),o="undefined"==typeof navigator,i={e:{}},a,s="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==this?this:null;function u(){try{var t=a;return a=null,t.apply(this,arguments)}catch(t){return i.e=t,i}}function c(t){return a=t,u}var l=function(t,e){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=t,this.constructor$=e,e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}return n.prototype=e.prototype,t.prototype=new n,t.prototype};function h(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function f(t){return"function"==typeof t||"object"==typeof t&&null!==t}function p(t){return h(t)?new Error(F(t)):t}function d(t,e){var r,n=t.length,o=new Array(n+1);for(r=0;r<n;++r)o[r]=t[r];return o[r]=e,o}function m(t,e,r){if(!n.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var o=Object.getOwnPropertyDescriptor(t,e);return null!=o?null==o.get&&null==o.set?o.value:r:void 0}function v(t,e,r){if(h(t))return t;var o={value:r,configurable:!0,enumerable:!1,writable:!0};return n.defineProperty(t,e,o),t}function g(t){throw t}var _=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var r=0;r<t.length;++r)if(t[r]===e)return!0;return!1};if(n.isES5){var r=Object.getOwnPropertyNames;return function(t){for(var o=[],i=Object.create(null);null!=t&&!e(t);){var a;try{a=r(t)}catch(t){return o}for(var s=0;s<a.length;++s){var u=a[s];if(!i[u]){i[u]=!0;var c=Object.getOwnPropertyDescriptor(t,u);null!=c&&null==c.get&&null==c.set&&o.push(u)}}t=n.getPrototypeOf(t)}return o}}var o={}.hasOwnProperty;return function(r){if(e(r))return[];var n=[];t:for(var i in r)if(o.call(r,i))n.push(i);else{for(var a=0;a<t.length;++a)if(o.call(t[a],i))continue t;n.push(i)}return n}}(),D=/this\s*\.\s*\S+\s*=/;function y(t){try{if("function"==typeof t){var e=n.names(t.prototype),r=n.isES5&&e.length>1,o=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=D.test(t+"")&&n.names(t).length>0;if(r||o||i)return!0}return!1}catch(t){return!1}}function w(t){function e(){}e.prototype=t;var r=new e;function n(){return typeof r.foo}return n(),n(),t}var b=/^[a-z$_][a-z$_0-9]*$/i;function E(t){return b.test(t)}function C(t,e,r){for(var n=new Array(t),o=0;o<t;++o)n[o]=e+o+r;return n}function F(t){try{return t+""}catch(t){return"[no string representation]"}}function k(t){return t instanceof Error||null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function A(t){try{v(t,"isOperational",!0)}catch(t){}}function x(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===t.isOperational)}function S(t){return k(t)&&n.propertyIsWritable(t,"stack")}var O="stack"in new Error?function(t){return S(t)?t:new Error(F(t))}:function(t){if(S(t))return t;try{throw new Error(F(t))}catch(t){return t}};function T(t){return{}.toString.call(t)}function P(t,e,r){for(var o=n.names(t),i=0;i<o.length;++i){var a=o[i];if(r(a))try{n.defineProperty(e,a,n.getDescriptor(t,a))}catch(t){}}}var R=function(t){return n.isArray(t)?t:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var B="function"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,r=[],n=t[Symbol.iterator]();!(e=n.next()).done;)r.push(e.value);return r};R=function(t){return n.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?B(t):null}}var j="undefined"!=typeof process&&"[object process]"===T(process).toLowerCase(),I="undefined"!=typeof process&&void 0!==process.env,L;function N(t){return I?process.env[t]:void 0}function M(){if("function"==typeof Promise)try{if("[object Promise]"===T(new Promise((function(){}))))return Promise}catch(t){}}function U(t,e){if(null===t||"function"!=typeof e||e===L)return e;null!==t.domain&&(e=t.domain.bind(e));var r=t.async;if(null!==r){var n=e;e=function(){for(var t=arguments.length+2,e=new Array(t),o=2;o<t;++o)e[o]=arguments[o-2];return e[0]=n,e[1]=this,r.runInAsyncScope.apply(r,e)}}return e}var H={setReflectHandler:function(t){L=t},isClass:y,isIdentifier:E,inheritedDataKeys:_,getDataPropertyOrDefault:m,thrower:g,isArray:n.isArray,asArray:R,notEnumerableProp:v,isPrimitive:h,isObject:f,isError:k,canEvaluate:o,errorObj:i,tryCatch:c,inherits:l,withAppended:d,maybeWrapAsError:p,toFastProperties:w,filledRange:C,toString:F,canAttachTrace:S,ensureErrorObject:O,originatesFromRejection:x,markAsOriginatingFromRejection:A,classString:T,copyDescriptors:P,isNode:j,hasEnvVariables:I,env:N,global:s,getNativePromise:M,contextBind:U},z;H.isRecentNode=H.isNode&&(process.versions&&process.versions.node?z=process.versions.node.split(".").map(Number):process.version&&(z=process.version.split(".").map(Number)),0===z[0]&&z[1]>10||z[0]>0),H.nodeSupportsAsyncResource=H.isNode&&function(){var t=!1;try{t="function"==typeof r(852).AsyncResource.prototype.runInAsyncScope}catch(e){t=!1}return t}(),H.isNode&&H.toFastProperties(process);try{throw new Error}catch(t){H.lastLineError=t}t.exports=H},6002:(t,e,r)=>{const n=r(8672),o=r(7056),i=r(8035),a=r(2138),s=r(5566),u=r(6835),c=r(1145);t.exports={Bar:n,SingleBar:n,MultiBar:o,Presets:i,Format:{Formatter:a,BarFormat:u,ValueFormat:s,TimeFormat:c}}},4958:t=>{t.exports=class{constructor(t,e,r){this.etaBufferLength=t||100,this.valueBuffer=[r],this.timeBuffer=[e],this.eta="0"}update(t,e,r){this.valueBuffer.push(e),this.timeBuffer.push(t),this.calculate(r-e)}getTime(){return this.eta}calculate(t){const e=this.valueBuffer.length,r=Math.min(this.etaBufferLength,e),n=(this.valueBuffer[e-1]-this.valueBuffer[e-r])/(this.timeBuffer[e-1]-this.timeBuffer[e-r]);this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);const o=Math.ceil(t/n/1e3);isNaN(o)?this.eta="NULL":isFinite(o)?this.eta=o>1e7?"INF":o<0?0:o:this.eta="INF"}}},6835:t=>{t.exports=function(t,e){const r=Math.round(t*e.barsize),n=e.barsize-r;return e.barCompleteString.substr(0,r)+e.barGlue+e.barIncompleteString.substr(0,n)}},1145:t=>{t.exports=function(t,e,r){function n(t){return r?r*Math.round(t/r):t}function o(t){return(e.autopaddingChar+t).slice(-2)}return t>3600?o(Math.floor(t/3600))+"h"+o(n(t%3600/60))+"m":t>60?o(Math.floor(t/60))+"m"+o(n(t%60))+"s":t>10?o(n(t))+"s":o(t)+"s"}},5566:t=>{t.exports=function(t,e,r){if(!0!==e.autopadding)return t;return"percentage"===r?(n=t,o=3,(e.autopaddingChar+n).slice(-o)):t;var n,o}},2138:(t,e,r)=>{const n=r(4223),o=r(5566),i=r(6835),a=r(1145);t.exports=function(t,e,r){let s=t.format;const u=t.formatTime||a,c=t.formatValue||o,l=t.formatBar||i,h=Math.floor(100*e.progress)+"",f=e.stopTime||Date.now(),p=Math.round((f-e.startTime)/1e3),d=Object.assign({},r,{bar:l(e.progress,t),percentage:c(h,t,"percentage"),total:c(e.total,t,"total"),value:c(e.value,t,"value"),eta:c(e.eta,t,"eta"),eta_formatted:u(e.eta,t,5),duration:c(p,t,"duration"),duration_formatted:u(p,t,1)});s=s.replace(/\{(\w+)\}/g,(function(t,e){return void 0!==d[e]?d[e]:t}));const m=Math.max(0,e.maxWidth-n(s)-2),v=Math.floor(m/2);switch(t.align){case"right":s=m>0?" ".repeat(m)+s:s;break;case"center":s=v>0?" ".repeat(v)+s:s}return s}},9251:(t,e,r)=>{const n=r(4958),o=r(3603),i=r(2138),a=r(2361);t.exports=class extends a{constructor(t){super(),this.options=t,this.terminal=this.options.terminal?this.options.terminal:new o(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new n(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter="function"==typeof this.options.format?this.options.format:i}render(t=!1){const e={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();const r=this.formatter(this.options,e,this.payload);(t||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=r)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(r),this.terminal.clearRight(),this.lastDrawnString=r,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(t,e,r){this.value=e||0,this.total=void 0!==t&&t>=0?t:100,this.startValue=e||0,this.payload=r||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new n(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",t,e)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(t,e={}){"number"==typeof t&&(this.value=t,this.eta.update(Date.now(),t,this.total));const r=("object"==typeof t?t:e)||{};this.emit("update",this.total,this.value);for(const t in r)this.payload[t]=r[t];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let t=this.value/this.total;return this.options.progressCalculationRelative&&(t=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(t)&&(t=this.options&&this.options.emptyOnZero?0:1),t=Math.min(Math.max(t,0),1),t}increment(t=1,e={}){"object"==typeof t?this.update(this.value+1,t):this.update(this.value+t,e)}getTotal(){return this.total}setTotal(t){void 0!==t&&t>=0&&(this.total=t)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}}},7056:(t,e,r)=>{const n=r(3603),o=r(9251),i=r(8020),a=r(2361);t.exports=class extends a{constructor(t,e){super(),this.bars=[],this.options=i.parse(t,e),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new n(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(t,e,r,n={}){const i=new o(Object.assign({},this.options,n));return this.bars.push(i),!1===this.options.noTTYOutput&&!1===this.terminal.isTTY()||(null===this.sigintCallback&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.isActive||(!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,i.start(t,e,r),this.emit("start")),i}remove(t){const e=this.bars.indexOf(t);return!(e<0)&&(this.bars.splice(e,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let t=0;t<this.bars.length;t++)t>0&&this.terminal.newline(),this.bars[t].render();this.emit("redraw-post"),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find((t=>t.isActive))&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let t=0;t<this.bars.length;t++)t>0&&this.terminal.newline(),this.bars[t].render(),this.bars[t].stop();this.terminal.newline()}this.emit("stop")}log(t){this.loggingBuffer.push(t)}}},8020:t=>{function e(t,e){return null==t?e:t}t.exports={parse:function(t,r){const n={},o=Object.assign({},r,t);return n.throttleTime=1e3/e(o.fps,10),n.stream=e(o.stream,process.stderr),n.terminal=e(o.terminal,null),n.clearOnComplete=e(o.clearOnComplete,!1),n.stopOnComplete=e(o.stopOnComplete,!1),n.barsize=e(o.barsize,40),n.align=e(o.align,"left"),n.hideCursor=e(o.hideCursor,!1),n.linewrap=e(o.linewrap,!1),n.barCompleteString=new Array(n.barsize+1).join(o.barCompleteChar||"="),n.barIncompleteString=new Array(n.barsize+1).join(o.barIncompleteChar||"-"),n.barGlue=e(o.barGlue,""),n.format=e(o.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),n.formatTime=e(o.formatTime,null),n.formatValue=e(o.formatValue,null),n.formatBar=e(o.formatBar,null),n.etaBufferLength=e(o.etaBuffer,10),n.etaAsynchronousUpdate=e(o.etaAsynchronousUpdate,!1),n.progressCalculationRelative=e(o.progressCalculationRelative,!1),n.synchronousUpdate=e(o.synchronousUpdate,!0),n.noTTYOutput=e(o.noTTYOutput,!1),n.notTTYSchedule=e(o.notTTYSchedule,2e3),n.emptyOnZero=e(o.emptyOnZero,!1),n.forceRedraw=e(o.forceRedraw,!1),n.autopadding=e(o.autopadding,!1),n.autopaddingChar=n.autopadding?e(o.autopaddingChar," "):"",n.gracefulExit=e(o.gracefulExit,!1),n}}},8672:(t,e,r)=>{const n=r(9251),o=r(8020);t.exports=class extends n{constructor(t,e){super(o.parse(t,e)),this.timer=null,this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(t,e){this.timer&&(super.update(t,e),this.options.synchronousUpdate&&this.lastRedraw+2*this.options.throttleTime<Date.now()&&this.render())}start(t,e,r){!1===this.options.noTTYOutput&&!1===this.terminal.isTTY()||(null===this.sigintCallback&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.terminal.cursorSave(),!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),super.start(t,e,r),this.render())}stop(){this.timer&&(this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRestore(),this.options.clearOnComplete?(this.terminal.cursorTo(0,null),this.terminal.clearLine()):this.terminal.newline())}}},3603:(t,e,r)=>{const n=r(4521);t.exports=class{constructor(t){this.stream=t,this.linewrap=!0,this.dy=0}cursorSave(){this.stream.isTTY&&this.stream.write("7")}cursorRestore(){this.stream.isTTY&&this.stream.write("8")}cursor(t){this.stream.isTTY&&(t?this.stream.write("[?25h"):this.stream.write("[?25l"))}cursorTo(t=null,e=null){this.stream.isTTY&&n.cursorTo(this.stream,t,e)}cursorRelative(t=null,e=null){this.stream.isTTY&&(this.dy=this.dy+e,n.moveCursor(this.stream,t,e))}cursorRelativeReset(){this.stream.isTTY&&(n.moveCursor(this.stream,0,-this.dy),n.cursorTo(this.stream,0,null),this.dy=0)}clearRight(){this.stream.isTTY&&n.clearLine(this.stream,1)}clearLine(){this.stream.isTTY&&n.clearLine(this.stream,0)}clearBottom(){this.stream.isTTY&&n.clearScreenDown(this.stream)}newline(){this.stream.write("\n"),this.dy++}write(t,e=!1){!0===this.linewrap&&!1===e?this.stream.write(t.substr(0,this.getWidth())):this.stream.write(t)}lineWrapping(t){this.stream.isTTY&&(this.linewrap=t,t?this.stream.write("[?7h"):this.stream.write("[?7l"))}isTTY(){return!0===this.stream.isTTY}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}}},8035:(t,e,r)=>{const n=r(1953),o=r(6787),i=r(1090),a=r(135);t.exports={legacy:n,shades_classic:o,shades_grey:i,rect:a}},1953:t=>{t.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}},135:t=>{t.exports={format:" {bar}■ {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"■",barIncompleteChar:" "}},6787:t=>{t.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"}},1090:t=>{t.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"}},809:t=>{"use strict";t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}},9397:(t,e)=>{!function(t){var e=/\S/,r=/\"/g,n=/\n/g,o=/\r/g,i=/\\/g,a=/\u2028/,s=/\u2029/;function u(t){"}"===t.n.substr(t.n.length-1)&&(t.n=t.n.substring(0,t.n.length-1))}function c(t){return t.trim?t.trim():t.replace(/^\s*|\s*$/g,"")}function l(t,e,r){if(e.charAt(r)!=t.charAt(0))return!1;for(var n=1,o=t.length;n<o;n++)if(e.charAt(r+n)!=t.charAt(n))return!1;return!0}t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(r,n){var o=r.length,i=0,a=null,s=null,h="",f=[],p=!1,d=0,m=0,v="{{",g="}}";function _(){h.length>0&&(f.push({tag:"_t",text:new String(h)}),h="")}function D(r,n){if(_(),r&&function(){for(var r=!0,n=m;n<f.length;n++)if(!(r=t.tags[f[n].tag]<t.tags._v||"_t"==f[n].tag&&null===f[n].text.match(e)))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"});p=!1,m=f.length}function y(t,e){var r="="+g,n=t.indexOf(r,e),o=c(t.substring(t.indexOf("=",e)+1,n)).split(" ");return v=o[0],g=o[o.length-1],n+r.length-1}for(n&&(n=n.split(" "),v=n[0],g=n[1]),d=0;d<o;d++)0==i?l(v,r,d)?(--d,_(),i=1):"\n"==r.charAt(d)?D(p):h+=r.charAt(d):1==i?(d+=v.length-1,"="==(a=(s=t.tags[r.charAt(d+1)])?r.charAt(d+1):"_v")?(d=y(r,d),i=0):(s&&d++,i=2),p=d):l(g,r,d)?(f.push({tag:a,n:c(h),otag:v,ctag:g,i:"/"==a?p-v.length:d+g.length}),h="",d+=g.length-1,i=0,"{"==a&&("}}"==g?d++:u(f[f.length-1]))):h+=r.charAt(d);return D(p,!0),f};var h={_t:!0,"\n":!0,$:!0,"/":!0};function f(e,r,n,o){var i,a=[],s=null,u=null;for(i=n[n.length-1];e.length>0;){if(u=e.shift(),i&&"<"==i.tag&&!(u.tag in h))throw new Error("Illegal content in < super tag.");if(t.tags[u.tag]<=t.tags.$||p(u,o))n.push(u),u.nodes=f(e,u.tag,n,o);else{if("/"==u.tag){if(0===n.length)throw new Error("Closing tag without opener: /"+u.n);if(s=n.pop(),u.n!=s.n&&!d(u.n,s.n,o))throw new Error("Nesting error: "+s.n+" vs. "+u.n);return s.end=u.i,a}"\n"==u.tag&&(u.last=0==e.length||"\n"==e[0].tag)}a.push(u)}if(n.length>0)throw new Error("missing closing tag: "+n.pop().n);return a}function p(t,e){for(var r=0,n=e.length;r<n;r++)if(e[r].o==t.n)return t.tag="#",!0}function d(t,e,r){for(var n=0,o=r.length;n<o;n++)if(r[n].c==t&&r[n].o==e)return!0}function m(t){var e=[];for(var r in t.partials)e.push('"'+g(r)+'":{name:"'+g(t.partials[r].name)+'", '+m(t.partials[r])+"}");return"partials: {"+e.join(",")+"}, subs: "+function(t){var e=[];for(var r in t)e.push('"'+g(r)+'": function(c,p,t,i) {'+t[r]+"}");return"{ "+e.join(",")+" }"}(t.subs)}t.stringify=function(e,r,n){return"{code: function (c,p,i) { "+t.wrapMain(e.code)+" },"+m(e)+"}"};var v=0;function g(t){return t.replace(i,"\\\\").replace(r,'\\"').replace(n,"\\n").replace(o,"\\r").replace(a,"\\u2028").replace(s,"\\u2029")}function _(t){return~t.indexOf(".")?"d":"f"}function D(t,e){var r="<"+(e.prefix||"")+t.n+v++;return e.partials[r]={name:t.n,partials:{}},e.code+='t.b(t.rp("'+g(r)+'",c,p,"'+(t.indent||"")+'"));',r}function y(t,e){e.code+="t.b(t.t(t."+_(t.n)+'("'+g(t.n)+'",c,p,0)));'}function w(t){return"t.b("+t+");"}t.generate=function(e,r,n){v=0;var o={code:"",subs:{},partials:{}};return t.walk(e,o),n.asString?this.stringify(o,r,n):this.makeTemplate(o,r,n)},t.wrapMain=function(t){return'var t=this;t.b(i=i||"");'+t+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(t,e,r){var n=this.makePartials(t);return n.code=new Function("c","p","i",this.wrapMain(t.code)),new this.template(n,e,this,r)},t.makePartials=function(t){var e,r={subs:{},partials:t.partials,name:t.name};for(e in r.partials)r.partials[e]=this.makePartials(r.partials[e]);for(e in t.subs)r.subs[e]=new Function("c","p","t","i",t.subs[e]);return r},t.codegen={"#":function(e,r){r.code+="if(t.s(t."+_(e.n)+'("'+g(e.n)+'",c,p,1),c,p,0,'+e.i+","+e.end+',"'+e.otag+" "+e.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(e.nodes,r),r.code+="});c.pop();}"},"^":function(e,r){r.code+="if(!t.s(t."+_(e.n)+'("'+g(e.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(e.nodes,r),r.code+="};"},">":D,"<":function(e,r){var n={partials:{},code:"",subs:{},inPartial:!0};t.walk(e.nodes,n);var o=r.partials[D(e,r)];o.subs=n.subs,o.partials=n.partials},$:function(e,r){var n={subs:{},code:"",partials:r.partials,prefix:e.n};t.walk(e.nodes,n),r.subs[e.n]=n.code,r.inPartial||(r.code+='t.sub("'+g(e.n)+'",c,p,i);')},"\n":function(t,e){e.code+=w('"\\n"'+(t.last?"":" + i"))},_v:function(t,e){e.code+="t.b(t.v(t."+_(t.n)+'("'+g(t.n)+'",c,p,0)));'},_t:function(t,e){e.code+=w('"'+g(t.text)+'"')},"{":y,"&":y},t.walk=function(e,r){for(var n,o=0,i=e.length;o<i;o++)(n=t.codegen[e[o].tag])&&n(e[o],r);return r},t.parse=function(t,e,r){return f(t,0,[],(r=r||{}).sectionTags||[])},t.cache={},t.cacheKey=function(t,e){return[t,!!e.asString,!!e.disableLambda,e.delimiters,!!e.modelGet].join("||")},t.compile=function(e,r){r=r||{};var n=t.cacheKey(e,r),o=this.cache[n];if(o){var i=o.partials;for(var a in i)delete i[a].instance;return o}return o=this.generate(this.parse(this.scan(e,r.delimiters),e,r),e,r),this.cache[n]=o}}(e)},5485:(t,e,r)=>{var n=r(9397);n.Template=r(2882).Template,n.template=n.Template,t.exports=n},2882:(t,e)=>{!function(t){function e(t,e,r){var n;return e&&"object"==typeof e&&(void 0!==e[t]?n=e[t]:r&&e.get&&"function"==typeof e.get&&(n=e.get(t))),n}t.Template=function(t,e,r,n){t=t||{},this.r=t.code||this.r,this.c=r,this.options=n||{},this.text=e||"",this.partials=t.partials||{},this.subs=t.subs||{},this.buf=""},t.Template.prototype={r:function(t,e,r){return""},v:function(t){return t=u(t),s.test(t)?t.replace(r,"&amp;").replace(n,"&lt;").replace(o,"&gt;").replace(i,"&#39;").replace(a,"&quot;"):t},t:u,render:function(t,e,r){return this.ri([t],e||{},r)},ri:function(t,e,r){return this.r(t,e,r)},ep:function(t,e){var r=this.partials[t],n=e[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[t].base=n,r.subs){for(key in e.stackText||(e.stackText={}),r.subs)e.stackText[key]||(e.stackText[key]=void 0!==this.activeSub&&e.stackText[this.activeSub]?e.stackText[this.activeSub]:this.text);n=function(t,e,r,n,o,i){function a(){}function s(){}var u;a.prototype=t,s.prototype=t.subs;var c=new a;for(u in c.subs=new s,c.subsText={},c.buf="",n=n||{},c.stackSubs=n,c.subsText=i,e)n[u]||(n[u]=e[u]);for(u in n)c.subs[u]=n[u];for(u in o=o||{},c.stackPartials=o,r)o[u]||(o[u]=r[u]);for(u in o)c.partials[u]=o[u];return c}(n,r.subs,r.partials,this.stackSubs,this.stackPartials,e.stackText)}return this.partials[t].instance=n,n},rp:function(t,e,r,n){var o=this.ep(t,r);return o?o.ri(e,r,n):""},rs:function(t,e,r){var n=t[t.length-1];if(c(n))for(var o=0;o<n.length;o++)t.push(n[o]),r(t,e,this),t.pop();else r(t,e,this)},s:function(t,e,r,n,o,i,a){var s;return(!c(t)||0!==t.length)&&("function"==typeof t&&(t=this.ms(t,e,r,n,o,i,a)),s=!!t,!n&&s&&e&&e.push("object"==typeof t?t:e[e.length-1]),s)},d:function(t,r,n,o){var i,a=t.split("."),s=this.f(a[0],r,n,o),u=this.options.modelGet,l=null;if("."===t&&c(r[r.length-2]))s=r[r.length-1];else for(var h=1;h<a.length;h++)void 0!==(i=e(a[h],s,u))?(l=s,s=i):s="";return!(o&&!s)&&(o||"function"!=typeof s||(r.push(l),s=this.mv(s,r,n),r.pop()),s)},f:function(t,r,n,o){for(var i=!1,a=!1,s=this.options.modelGet,u=r.length-1;u>=0;u--)if(void 0!==(i=e(t,r[u],s))){a=!0;break}return a?(o||"function"!=typeof i||(i=this.mv(i,r,n)),i):!o&&""},ls:function(t,e,r,n,o){var i=this.options.delimiters;return this.options.delimiters=o,this.b(this.ct(u(t.call(e,n)),e,r)),this.options.delimiters=i,!1},ct:function(t,e,r){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(t,this.options).render(e,r)},b:function(t){this.buf+=t},fl:function(){var t=this.buf;return this.buf="",t},ms:function(t,e,r,n,o,i,a){var s,u=e[e.length-1],c=t.call(u);return"function"==typeof c?!!n||(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(c,u,r,s.substring(o,i),a)):c},mv:function(t,e,r){var n=e[e.length-1],o=t.call(n);return"function"==typeof o?this.ct(u(o.call(n)),n,r):o},sub:function(t,e,r,n){var o=this.subs[t];o&&(this.activeSub=t,o(e,r,this,n),this.activeSub=!1)}};var r=/&/g,n=/</g,o=/>/g,i=/\'/g,a=/\"/g,s=/[&<>\"\']/;function u(t){return String(null==t?"":t)}var c=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}}(e)},1903:t=>{"use strict";const e=t=>!Number.isNaN(t)&&(t>=4352&&(t<=4447||9001===t||9002===t||11904<=t&&t<=12871&&12351!==t||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141));t.exports=e,t.exports.default=e},5405:(t,e,r)=>{var n=r(8887),o=r(6325),i=65536,a=15,s=f(5<<20),u=function(){try{return new Uint32Array(i)}catch(r){for(var t=new Array(i),e=0;e<i;e++)t[e]=0;return t}}(),c=407708164,l=2147483648,h={4:65536,5:262144,6:1048576,7:4194304};function f(t){try{return new Uint8Array(t)}catch(n){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e}}function p(t,e,r){if(void 0!==typeof t.buffer){if(Uint8Array.prototype.slice)return t.slice(e,r);var n=t.length;e=(e|=0)<0?Math.max(n+e,0):Math.min(e,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-e),i=e,a=0;i<r;)o[a++]=t[i++];return o}return t.slice(e,r)}e.compressBound=function(t){return t+t/255+16|0},e.decompressBound=function(t){var e=0;if(o.readU32(t,e)!==c)throw new Error("invalid magic number");e+=4;var r=t[e++];if(64!=(192&r))throw new Error("incompatible descriptor version "+(192&r));var n=0!=(16&r),i=0!=(8&r),a=t[e++]>>4&7;if(void 0===h[a])throw new Error("invalid block size "+a);var s=h[a];if(i)return o.readU64(t,e);e++;for(var u=0;;){var f=o.readU32(t,e);if(e+=4,u+=f&l?f&=2147483647:s,0===f)return u;n&&(e+=4),e+=f}},e.makeBuffer=f,e.decompressBlock=function(t,e,r,n,o){var i,a,s,u,c;for(s=r+n;r<s;){var l=t[r++],h=l>>4;if(h>0){if(15===h)for(;h+=t[r],255===t[r++];);for(u=r+h;r<u;)e[o++]=t[r++]}if(r>=s)break;if(i=15&l,a=t[r++]|t[r++]<<8,15===i)for(;i+=t[r],255===t[r++];);for(u=(c=o-a)+(i+=4);c<u;)e[o++]=0|e[c++]}return o},e.compressBlock=function(t,e,r,n,i){var s,u,c,l,h,f,p,d;if(f=0,p=n+r,u=r,n>=13)for(var m=67;r+4<p-5;){var v=o.readU32(t,r),g=o.hashU32(v)>>>0;if(s=i[g=(g>>16^g)>>>0&65535]-1,i[g]=r+1,s<0||r-s>>>16>0||o.readU32(t,s)!==v)r+=m++>>6;else{for(m=67,h=r-u,l=r-s,s+=4,c=r+=4;r<p-5&&t[r]===t[s];)r++,s++;var _=(c=r-c)<15?c:15;if(h>=a){for(e[f++]=240+_,d=h-a;d>=255;d-=255)e[f++]=255;e[f++]=d}else e[f++]=(h<<4)+_;for(var D=0;D<h;D++)e[f++]=t[u+D];if(e[f++]=l,e[f++]=l>>8,c>=15){for(d=c-15;d>=255;d-=255)e[f++]=255;e[f++]=d}u=r}}if(0===u)return 0;if((h=p-u)>=a){for(e[f++]=240,d=h-a;d>=255;d-=255)e[f++]=255;e[f++]=d}else e[f++]=h<<4;for(r=u;r<p;)e[f++]=t[r++];return f},e.decompressFrame=function(t,r){var n,i,a,s,u=0,f=0;if(o.readU32(t,u)!==c)throw new Error("invalid magic number");if(u+=4,64!=(192&(s=t[u++])))throw new Error("incompatible descriptor version");n=0!=(16&s),i=0!=(4&s),a=0!=(8&s);var p=t[u++]>>4&7;if(void 0===h[p])throw new Error("invalid block size");for(a&&(u+=8),u++;;){var d;if(d=o.readU32(t,u),u+=4,0===d)break;if(n&&(u+=4),0!=(d&l)){d&=2147483647;for(var m=0;m<d;m++)r[f++]=t[u++]}else f=e.decompressBlock(t,r,u,d,f),u+=d}return i&&(u+=4),f},e.compressFrame=function(t,r){var a=0;o.writeU32(r,a,c),a+=4,r[a++]=64,r[a++]=112,r[a]=n.hash(0,r,4,a-4)>>8,a++;var l=h[7],f=t.length,p=0;for(!function(t){for(var e=0;e<i;e++)u[e]=0}();f>0;){var d,m=f>l?l:f;if((d=e.compressBlock(t,s,p,m,u))>m||0===d){o.writeU32(r,a,2147483648|m),a+=4;for(var v=p+m;p<v;)r[a++]=t[p++];f-=m}else{o.writeU32(r,a,d),a+=4;for(var g=0;g<d;)r[a++]=s[g++];p+=m,f-=m}}return o.writeU32(r,a,0),a+=4},e.decompress=function(t,r){var n,o;return void 0===r&&(r=e.decompressBound(t)),n=e.makeBuffer(r),(o=e.decompressFrame(t,n))!==r&&(n=p(n,0,o)),n},e.compress=function(t,r){var n,o;return void 0===r&&(r=e.compressBound(t.length)),n=e.makeBuffer(r),(o=e.compressFrame(t,n))!==r&&(n=p(n,0,o)),n}},6325:(t,e)=>{e.hashU32=function(t){return-1252372727^(t=(t=(t=(t=-949894596^(t=(t|=0)+2127912214+(t<<12)|0)^t>>>19)+374761393+(t<<5)|0)+-744332180^t<<9)+-42973499+(t<<3)|0)^t>>>16|0},e.readU64=function(t,e){var r=0;return r|=t[e++]<<0,r|=t[e++]<<8,r|=t[e++]<<16,r|=t[e++]<<24,r|=t[e++]<<32,r|=t[e++]<<40,r|=t[e++]<<48,r|=t[e++]<<56},e.readU32=function(t,e){var r=0;return r|=t[e++]<<0,r|=t[e++]<<8,r|=t[e++]<<16,r|=t[e++]<<24},e.writeU32=function(t,e,r){t[e++]=r>>0&255,t[e++]=r>>8&255,t[e++]=r>>16&255,t[e++]=r>>24&255},e.imul=function(t,e){var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16)|0}},8887:(t,e,r)=>{var n=r(6325),o=2654435761,i=2246822519,a=3266489917,s=374761393;function u(t,e){return(t|=0)>>>(32-(e|=0)|0)|t<<e|0}function c(t,e,r){return t|=0,e|=0,r|=0,0|n.imul(t>>>(32-e|0)|t<<e,r)}function l(t,e){return(t|=0)>>>(e|=0)^t|0}function h(t,e,r,o,i){return c(n.imul(e,r)+t,o,i)}function f(t,e,r){return c(t+n.imul(e[r],s),11,o)}function p(t,e,r){return h(t,n.readU32(e,r),a,17,668265263)}function d(t,e,r){return[h(t[0],n.readU32(e,r+0),i,13,o),h(t[1],n.readU32(e,r+4),i,13,o),h(t[2],n.readU32(e,r+8),i,13,o),h(t[3],n.readU32(e,r+12),i,13,o)]}e.hash=function(t,e,r,c){var h,m;if(m=c,c>=16){for(h=[t+o+i,t+i,t,t-o];c>=16;)h=d(h,e,r),r+=16,c-=16;h=u(h[0],1)+u(h[1],7)+u(h[2],12)+u(h[3],18)+m}else h=t+s+c>>>0;for(;c>=4;)h=p(h,e,r),r+=4,c-=4;for(;c>0;)h=f(h,e,r),r++,c--;return(h=l(n.imul(l(n.imul(l(h,15),i),13),a),16))>>>0}},7475:(t,e,r)=>{var n=r(5485);t.exports=function(){var t=new n.Template({code:function(t,e,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",t,e,0))),n.b(", LENGTH = "),n.b(n.v(n.f("flashLength",t,e,0))),n.b("\n"+r),n.b(" RAM (rwx) : ORIGIN = "),n.b(n.v(n.f("ramStart",t,e,0))),n.b(", LENGTH = "),n.b(n.v(n.f("ramLength",t,e,0))),n.b("\n"+r),n.b("}"),n.b("\n"),n.b("\n"+r),n.b("ENTRY(_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(" KEEP(*(.rodata.eadk_api_level))"),n.b("\n"+r),n.b(" LONG(ADDR(.rodata.eadk_app_name) - ORIGIN(FLASH));"),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(_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(" . = ALIGN(4);"),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.eadk_app_name : {"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_app_name))"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata.eadk_app_icon : {"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_app_icon))"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata : {"),n.b("\n"+r),n.b(" *(.rodata)"),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.*)"),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.*)"),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.b("\n"+r),n.b('ASSERT(SIZEOF(.eadk_app_info) == 32, "Missing api level. Please define a .rodata.eadk_api_level section.");'),n.b("\n"+r),n.b('ASSERT(SIZEOF(.rodata.eadk_app_name) > 0, "Missing app name. Please define a .rodata.eadk_app_name section.");'),n.b("\n"+r),n.b('ASSERT(SIZEOF(.rodata.eadk_app_icon) > 0, "Missing app icon. Please define a .rodata.eadk_app_icon section.");'),n.b("\n"),n.fl()},partials:{},subs:{}},'MEMORY {\n FLASH (rx) : ORIGIN = {{ flashStart }}, LENGTH = {{ flashLength }}\n RAM (rwx) : ORIGIN = {{ ramStart }}, LENGTH = {{ ramLength }}\n}\n\nENTRY(_start);\n\nSECTIONS {\n .eadk_app_info ORIGIN(FLASH) : {\n LONG(0xDEC0BEBA);\n KEEP(*(.rodata.eadk_api_level))\n LONG(ADDR(.rodata.eadk_app_name) - ORIGIN(FLASH));\n LONG(SIZEOF(.rodata.eadk_app_icon));\n LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));\n LONG(_start - ORIGIN(FLASH));\n LONG(_eadk_app_end - ORIGIN(FLASH));\n LONG(0xDEC0BEBA);\n } >FLASH\n\n .text : {\n . = ALIGN(4);\n *(.text)\n *(.text.*)\n } >FLASH\n\n .rodata.eadk_app_name : {\n KEEP(*(.rodata.eadk_app_name))\n } >FLASH\n\n .rodata.eadk_app_icon : {\n KEEP(*(.rodata.eadk_app_icon))\n } >FLASH\n\n .rodata : {\n *(.rodata)\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.*)\n _data_section_end_ram = .;\n } >RAM AT >FLASH\n\n .bss : {\n . = ALIGN(4);\n _bss_section_start_ram = .;\n *(.bss)\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\nASSERT(SIZEOF(.eadk_app_info) == 32, "Missing api level. Please define a .rodata.eadk_api_level section.");\nASSERT(SIZEOF(.rodata.eadk_app_name) > 0, "Missing app name. Please define a .rodata.eadk_app_name section.");\nASSERT(SIZEOF(.rodata.eadk_app_icon) > 0, "Missing app icon. Please define a .rodata.eadk_app_icon section.");\n',n);return t.render.apply(t,arguments)}},9983:(t,e,r)=>{"use strict";let n=r(7084),o=[function(){},function(t,e,r,n){if(n===e.length)throw new Error("Ran out of data");let o=e[n];t[r]=o,t[r+1]=o,t[r+2]=o,t[r+3]=255},function(t,e,r,n){if(n+1>=e.length)throw new Error("Ran out of data");let o=e[n];t[r]=o,t[r+1]=o,t[r+2]=o,t[r+3]=e[n+1]},function(t,e,r,n){if(n+2>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=255},function(t,e,r,n){if(n+3>=e.length)throw new Error("Ran out of data");t[r]=e[n],t[r+1]=e[n+1],t[r+2]=e[n+2],t[r+3]=e[n+3]}],i=[function(){},function(t,e,r,n){let o=e[0];t[r]=o,t[r+1]=o,t[r+2]=o,t[r+3]=n},function(t,e,r){let n=e[0];t[r]=n,t[r+1]=n,t[r+2]=n,t[r+3]=e[1]},function(t,e,r,n){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=n},function(t,e,r){t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=e[3]}];function a(t,e,r,n,i,a){let s=t.width,u=t.height,c=t.index;for(let t=0;t<u;t++)for(let u=0;u<s;u++){let s=r(u,t,c);o[n](e,i,s,a),a+=n}return a}function s(t,e,r,n,o,a){let s=t.width,u=t.height,c=t.index;for(let t=0;t<u;t++){for(let u=0;u<s;u++){let s=o.get(n),l=r(u,t,c);i[n](e,s,l,a)}o.resetAfterLine()}}e.dataToBitMap=function(t,e){let r,o,i=e.width,u=e.height,c=e.depth,l=e.bpp,h=e.interlace;8!==c&&(r=function(t,e){let r=[],n=0;function o(){if(n===t.length)throw new Error("Ran out of data");let o,i,a,s,u,c,l,h,f=t[n];switch(n++,e){default:throw new Error("unrecognised depth");case 16:l=t[n],n++,r.push((f<<8)+l);break;case 4:l=15&f,h=f>>4,r.push(h,l);break;case 2:u=3&f,c=f>>2&3,l=f>>4&3,h=f>>6&3,r.push(h,l,c,u);break;case 1:o=1&f,i=f>>1&1,a=f>>2&1,s=f>>3&1,u=f>>4&1,c=f>>5&1,l=f>>6&1,h=f>>7&1,r.push(h,l,c,u,s,a,i,o)}}return{get:function(t){for(;r.length<t;)o();let e=r.slice(0,t);return r=r.slice(t),e},resetAfterLine:function(){r.length=0},end:function(){if(n!==t.length)throw new Error("extra data found")}}}(t,c)),o=c<=8?Buffer.alloc(i*u*4):new Uint16Array(i*u*4);let f,p,d=Math.pow(2,c)-1,m=0;if(h)f=n.getImagePasses(i,u),p=n.getInterlaceIterator(i,u);else{let t=0;p=function(){let e=t;return t+=4,e},f=[{width:i,height:u}]}for(let e=0;e<f.length;e++)8===c?m=a(f[e],o,p,l,t,m):s(f[e],o,p,l,r,d);if(8===c){if(m!==t.length)throw new Error("extra data found")}else r.end();return o}},9027:(t,e,r)=>{"use strict";let n=r(3482);t.exports=function(t,e,r,o){let i=-1!==[n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(o.colorType);if(o.colorType===o.inputColorType){let e=function(){let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256!==new Int16Array(t)[0]}();if(8===o.bitDepth||16===o.bitDepth&&e)return t}let a=16!==o.bitDepth?t:new Uint16Array(t.buffer),s=255,u=n.COLORTYPE_TO_BPP_MAP[o.inputColorType];4!==u||o.inputHasAlpha||(u=3);let c=n.COLORTYPE_TO_BPP_MAP[o.colorType];16===o.bitDepth&&(s=65535,c*=2);let l=Buffer.alloc(e*r*c),h=0,f=0,p=o.bgColor||{};function d(){let t,e,r,u=s;switch(o.inputColorType){case n.COLORTYPE_COLOR_ALPHA:u=a[h+3],t=a[h],e=a[h+1],r=a[h+2];break;case n.COLORTYPE_COLOR:t=a[h],e=a[h+1],r=a[h+2];break;case n.COLORTYPE_ALPHA:u=a[h+1],t=a[h],e=t,r=t;break;case n.COLORTYPE_GRAYSCALE:t=a[h],e=t,r=t;break;default:throw new Error("input color type:"+o.inputColorType+" is not supported at present")}return o.inputHasAlpha&&(i||(u/=s,t=Math.min(Math.max(Math.round((1-u)*p.red+u*t),0),s),e=Math.min(Math.max(Math.round((1-u)*p.green+u*e),0),s),r=Math.min(Math.max(Math.round((1-u)*p.blue+u*r),0),s))),{red:t,green:e,blue:r,alpha:u}}void 0===p.red&&(p.red=s),void 0===p.green&&(p.green=s),void 0===p.blue&&(p.blue=s);for(let t=0;t<r;t++)for(let t=0;t<e;t++){let t=d();switch(o.colorType){case n.COLORTYPE_COLOR_ALPHA:case n.COLORTYPE_COLOR:8===o.bitDepth?(l[f]=t.red,l[f+1]=t.green,l[f+2]=t.blue,i&&(l[f+3]=t.alpha)):(l.writeUInt16BE(t.red,f),l.writeUInt16BE(t.green,f+2),l.writeUInt16BE(t.blue,f+4),i&&l.writeUInt16BE(t.alpha,f+6));break;case n.COLORTYPE_ALPHA:case n.COLORTYPE_GRAYSCALE:{let e=(t.red+t.green+t.blue)/3;8===o.bitDepth?(l[f]=e,i&&(l[f+1]=t.alpha)):(l.writeUInt16BE(e,f),i&&l.writeUInt16BE(t.alpha,f+2));break}default:throw new Error("unrecognised color Type "+o.colorType)}h+=u,f+=c}return l}},8442:(t,e,r)=>{"use strict";let n=r(3837),o=r(2781),i=t.exports=function(){o.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};n.inherits(i,o),i.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},i.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let r;return r=Buffer.isBuffer(t)?t:Buffer.from(t,e||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused},i.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},i.prototype.destroySoon=i.prototype.end,i.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},i.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},i.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},i.prototype._processRead=function(t){this._reads.shift();let e=0,r=0,n=Buffer.alloc(t.length);for(;e<t.length;){let o=this._buffers[r++],i=Math.min(o.length,t.length-e);o.copy(n,e,0,i),e+=i,i!==o.length&&(this._buffers[--r]=o.slice(i))}r>0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,n)},i.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}}},3482:t=>{"use strict";t.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},3500:t=>{"use strict";let e=[];!function(){for(let t=0;t<256;t++){let r=t;for(let t=0;t<8;t++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}}();let r=t.exports=function(){this._crc=-1};r.prototype.write=function(t){for(let r=0;r<t.length;r++)this._crc=e[255&(this._crc^t[r])]^this._crc>>>8;return!0},r.prototype.crc32=function(){return-1^this._crc},r.crc32=function(t){let r=-1;for(let n=0;n<t.length;n++)r=e[255&(r^t[n])]^r>>>8;return-1^r}},8876:(t,e,r)=>{"use strict";let n=r(6744);let o={0:function(t,e,r,n,o){for(let i=0;i<r;i++)n[o+i]=t[e+i]},1:function(t,e,r,n,o,i){for(let a=0;a<r;a++){let r=a>=i?t[e+a-i]:0,s=t[e+a]-r;n[o+a]=s}},2:function(t,e,r,n,o){for(let i=0;i<r;i++){let a=e>0?t[e+i-r]:0,s=t[e+i]-a;n[o+i]=s}},3:function(t,e,r,n,o,i){for(let a=0;a<r;a++){let s=a>=i?t[e+a-i]:0,u=e>0?t[e+a-r]:0,c=t[e+a]-(s+u>>1);n[o+a]=c}},4:function(t,e,r,o,i,a){for(let s=0;s<r;s++){let u=s>=a?t[e+s-a]:0,c=e>0?t[e+s-r]:0,l=e>0&&s>=a?t[e+s-(r+a)]:0,h=t[e+s]-n(u,c,l);o[i+s]=h}}},i={0:function(t,e,r){let n=0,o=e+r;for(let r=e;r<o;r++)n+=Math.abs(t[r]);return n},1:function(t,e,r,n){let o=0;for(let i=0;i<r;i++){let r=i>=n?t[e+i-n]:0,a=t[e+i]-r;o+=Math.abs(a)}return o},2:function(t,e,r){let n=0,o=e+r;for(let i=e;i<o;i++){let o=e>0?t[i-r]:0,a=t[i]-o;n+=Math.abs(a)}return n},3:function(t,e,r,n){let o=0;for(let i=0;i<r;i++){let a=i>=n?t[e+i-n]:0,s=e>0?t[e+i-r]:0,u=t[e+i]-(a+s>>1);o+=Math.abs(u)}return o},4:function(t,e,r,o){let i=0;for(let a=0;a<r;a++){let s=a>=o?t[e+a-o]:0,u=e>0?t[e+a-r]:0,c=e>0&&a>=o?t[e+a-(r+o)]:0,l=t[e+a]-n(s,u,c);i+=Math.abs(l)}return i}};t.exports=function(t,e,r,n,a){let s;if("filterType"in n&&-1!==n.filterType){if("number"!=typeof n.filterType)throw new Error("unrecognised filter types");s=[n.filterType]}else s=[0,1,2,3,4];16===n.bitDepth&&(a*=2);let u=e*a,c=0,l=0,h=Buffer.alloc((u+1)*r),f=s[0];for(let e=0;e<r;e++){if(s.length>1){let e=1/0;for(let r=0;r<s.length;r++){let n=i[s[r]](t,l,u,a);n<e&&(f=s[r],e=n)}}h[c]=f,c++,o[f](t,l,u,h,c,a),c+=u,l+=u}return h}},4603:(t,e,r)=>{"use strict";let n=r(3837),o=r(8442),i=r(2769),a=t.exports=function(t){o.call(this);let e=[],r=this;this._filter=new i(t,{read:this.read.bind(this),write:function(t){e.push(t)},complete:function(){r.emit("complete",Buffer.concat(e))}}),this._filter.start()};n.inherits(a,o)},8692:(t,e,r)=>{"use strict";let n=r(33),o=r(2769);e.process=function(t,e){let r=[],i=new n(t);return new o(e,{read:i.read.bind(i),write:function(t){r.push(t)},complete:function(){}}).start(),i.process(),Buffer.concat(r)}},2769:(t,e,r)=>{"use strict";let n=r(7084),o=r(6744);function i(t,e,r){let n=t*e;return 8!==r&&(n=Math.ceil(n/(8/r))),n}let a=t.exports=function(t,e){let r=t.width,o=t.height,a=t.interlace,s=t.bpp,u=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],a){let t=n.getImagePasses(r,o);for(let e=0;e<t.length;e++)this._images.push({byteWidth:i(t[e].width,s,u),height:t[e].height,lineIndex:0})}else this._images.push({byteWidth:i(r,s,u),height:o,lineIndex:0});this._xComparison=8===u?s:16===u?2*s:1};a.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},a.prototype._unFilterType1=function(t,e,r){let n=this._xComparison,o=n-1;for(let i=0;i<r;i++){let r=t[1+i],a=i>o?e[i-n]:0;e[i]=r+a}},a.prototype._unFilterType2=function(t,e,r){let n=this._lastLine;for(let o=0;o<r;o++){let r=t[1+o],i=n?n[o]:0;e[o]=r+i}},a.prototype._unFilterType3=function(t,e,r){let n=this._xComparison,o=n-1,i=this._lastLine;for(let a=0;a<r;a++){let r=t[1+a],s=i?i[a]:0,u=a>o?e[a-n]:0,c=Math.floor((u+s)/2);e[a]=r+c}},a.prototype._unFilterType4=function(t,e,r){let n=this._xComparison,i=n-1,a=this._lastLine;for(let s=0;s<r;s++){let r=t[1+s],u=a?a[s]:0,c=s>i?e[s-n]:0,l=s>i&&a?a[s-n]:0,h=o(c,u,l);e[s]=r+h}},a.prototype._reverseFilterLine=function(t){let e,r=t[0],n=this._images[this._imageIndex],o=n.byteWidth;if(0===r)e=t.slice(1,o+1);else switch(e=Buffer.alloc(o),r){case 1:this._unFilterType1(t,e,o);break;case 2:this._unFilterType2(t,e,o);break;case 3:this._unFilterType3(t,e,o);break;case 4:this._unFilterType4(t,e,o);break;default:throw new Error("Unrecognised filter type - "+r)}this.write(e),n.lineIndex++,n.lineIndex>=n.height?(this._lastLine=null,this._imageIndex++,n=this._images[this._imageIndex]):this._lastLine=e,n?this.read(n.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}},8417:t=>{"use strict";t.exports=function(t,e,r=!1){let n=e.depth,o=e.width,i=e.height,a=e.colorType,s=e.transColor,u=e.palette,c=t;return 3===a?function(t,e,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=o[t[i]];if(!r)throw new Error("index "+t[i]+" not in palette");for(let t=0;t<4;t++)e[i+t]=r[t];i+=4}}(t,c,o,i,u):(s&&function(t,e,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=!1;if(1===o.length?o[0]===t[i]&&(r=!0):o[0]===t[i]&&o[1]===t[i+1]&&o[2]===t[i+2]&&(r=!0),r)for(let t=0;t<4;t++)e[i+t]=0;i+=4}}(t,c,o,i,s),8===n||r||(16===n&&(c=Buffer.alloc(o*i*4)),function(t,e,r,n,o){let i=Math.pow(2,o)-1,a=0;for(let o=0;o<n;o++)for(let n=0;n<r;n++){for(let r=0;r<4;r++)e[a+r]=Math.floor(255*t[a+r]/i+.5);a+=4}}(t,c,o,i,n))),c}},7084:(t,e)=>{"use strict";let r=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];e.getImagePasses=function(t,e){let n=[],o=t%8,i=e%8,a=(t-o)/8,s=(e-i)/8;for(let t=0;t<r.length;t++){let e=r[t],u=a*e.x.length,c=s*e.y.length;for(let t=0;t<e.x.length&&e.x[t]<o;t++)u++;for(let t=0;t<e.y.length&&e.y[t]<i;t++)c++;u>0&&c>0&&n.push({width:u,height:c,index:t})}return n},e.getInterlaceIterator=function(t){return function(e,n,o){let i=e%r[o].x.length,a=(e-i)/r[o].x.length*8+r[o].x[i],s=n%r[o].y.length;return 4*a+((n-s)/r[o].y.length*8+r[o].y[s])*t*4}}},6838:(t,e,r)=>{"use strict";let n=r(3837),o=r(2781),i=r(3482),a=r(9432),s=t.exports=function(t){o.call(this);let e=t||{};this._packer=new a(e),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(s,o),s.prototype.pack=function(t,e,r,n){this.emit("data",Buffer.from(i.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,r)),n&&this.emit("data",this._packer.packGAMA(n));let o=this._packer.filterData(t,e,r);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(o)}},8360:(t,e,r)=>{"use strict";let n=!0,o=r(9796);o.deflateSync||(n=!1);let i=r(3482),a=r(9432);t.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r=new a(e||{}),s=[];s.push(Buffer.from(i.PNG_SIGNATURE)),s.push(r.packIHDR(t.width,t.height)),t.gamma&&s.push(r.packGAMA(t.gamma));let u=r.filterData(t.data,t.width,t.height),c=o.deflateSync(u,r.getDeflateOptions());if(u=null,!c||!c.length)throw new Error("bad png - invalid compressed data response");return s.push(r.packIDAT(c)),s.push(r.packIEND()),Buffer.concat(s)}},9432:(t,e,r)=>{"use strict";let n=r(3482),o=r(3500),i=r(9027),a=r(8876),s=r(9796),u=t.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=null!=t.deflateLevel?t.deflateLevel:9,t.deflateStrategy=null!=t.deflateStrategy?t.deflateStrategy:3,t.inputHasAlpha=null==t.inputHasAlpha||t.inputHasAlpha,t.deflateFactory=t.deflateFactory||s.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType="number"==typeof t.colorType?t.colorType:n.COLORTYPE_COLOR_ALPHA,t.inputColorType="number"==typeof t.inputColorType?t.inputColorType:n.COLORTYPE_COLOR_ALPHA,-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(t.colorType))throw new Error("option color type:"+t.colorType+" is not supported at present");if(-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(t.inputColorType))throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(8!==t.bitDepth&&16!==t.bitDepth)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};u.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},u.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},u.prototype.filterData=function(t,e,r){let o=i(t,e,r,this._options),s=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return a(o,e,r,this._options,s)},u.prototype._packChunk=function(t,e){let r=e?e.length:0,n=Buffer.alloc(r+12);return n.writeUInt32BE(r,0),n.writeUInt32BE(t,4),e&&e.copy(n,8),n.writeInt32BE(o.crc32(n.slice(4,n.length-4)),n.length-4),n},u.prototype.packGAMA=function(t){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(t*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,e)},u.prototype.packIHDR=function(t,e){let r=Buffer.alloc(13);return r.writeUInt32BE(t,0),r.writeUInt32BE(e,4),r[8]=this._options.bitDepth,r[9]=this._options.colorType,r[10]=0,r[11]=0,r[12]=0,this._packChunk(n.TYPE_IHDR,r)},u.prototype.packIDAT=function(t){return this._packChunk(n.TYPE_IDAT,t)},u.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}},6744:t=>{"use strict";t.exports=function(t,e,r){let n=t+e-r,o=Math.abs(n-t),i=Math.abs(n-e),a=Math.abs(n-r);return o<=i&&o<=a?t:i<=a?e:r}},7900:(t,e,r)=>{"use strict";let n=r(3837),o=r(9796),i=r(8442),a=r(4603),s=r(8550),u=r(9983),c=r(8417),l=t.exports=function(t){i.call(this),this._parser=new s(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};n.inherits(l,i),l.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",(function(){}))),this.errord=!0},l.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=o.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let t=(1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3))*this._bitmapInfo.height,e=Math.max(t,o.Z_MIN_CHUNK);this._inflate=o.createInflate({chunkSize:e});let r=t,n=this.emit.bind(this,"error");this._inflate.on("error",(function(t){r&&n(t)})),this._filter.on("complete",this._complete.bind(this));let i=this._filter.write.bind(this._filter);this._inflate.on("data",(function(t){r&&(t.length>r&&(t=t.slice(0,r)),r-=t.length,i(t))})),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)},l.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new a(this._bitmapInfo)},l.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},l.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},l.prototype._simpleTransparency=function(){this._metaData.alpha=!0},l.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},l.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},l.prototype._complete=function(t){if(this.errord)return;let e;try{let r=u.dataToBitMap(t,this._bitmapInfo);e=c(r,this._bitmapInfo,this._options.skipRescale),r=null}catch(t){return void this._handleError(t)}this.emit("parsed",e)}},2416:(t,e,r)=>{"use strict";let n=!0,o=r(9796),i=r(9653);o.deflateSync||(n=!1);let a=r(33),s=r(8692),u=r(8550),c=r(9983),l=r(8417);t.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r,h,f;let p=[];let d=new a(t),m=new u(e,{read:d.read.bind(d),error:function(t){r=t},metadata:function(t){h=t},gamma:function(t){f=t},palette:function(t){h.palette=t},transColor:function(t){h.transColor=t},inflateData:function(t){p.push(t)},simpleTransparency:function(){h.alpha=!0}});if(m.start(),d.process(),r)throw r;let v,g=Buffer.concat(p);if(p.length=0,h.interlace)v=o.inflateSync(g);else{let t=(1+(h.width*h.bpp*h.depth+7>>3))*h.height;v=i(g,{chunkSize:t,maxLength:t})}if(g=null,!v||!v.length)throw new Error("bad png - invalid inflate data response");let _=s.process(v,h);g=null;let D=c.dataToBitMap(_,h);_=null;let y=l(D,h,e.skipRescale);return h.data=y,h.gamma=f||0,h}},8550:(t,e,r)=>{"use strict";let n=r(3482),o=r(3500),i=t.exports=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};i.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},i.prototype._parseSignature=function(t){let e=n.PNG_SIGNATURE;for(let r=0;r<e.length;r++)if(t[r]!==e[r])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},i.prototype._parseChunkBegin=function(t){let e=t.readUInt32BE(0),r=t.readUInt32BE(4),i="";for(let e=4;e<8;e++)i+=String.fromCharCode(t[e]);let a=Boolean(32&t[4]);if(this._hasIHDR||r===n.TYPE_IHDR){if(this._crc=new o,this._crc.write(Buffer.from(i)),this._chunks[r])return this._chunks[r](e);a?this.read(e+4,this._skipChunk.bind(this)):this.error(new Error("Unsupported critical chunk type "+i))}else this.error(new Error("Expected IHDR on beggining"))},i.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},i.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0),r=this._crc.crc32();this._options.checkCRC&&r!==e?this.error(new Error("Crc error - "+e+" - "+r)):this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))},i.prototype._parseIHDR=function(t){this._crc.write(t);let e=t.readUInt32BE(0),r=t.readUInt32BE(4),o=t[8],i=t[9],a=t[10],s=t[11],u=t[12];if(8!==o&&4!==o&&2!==o&&1!==o&&16!==o)return void this.error(new Error("Unsupported bit depth "+o));if(!(i in n.COLORTYPE_TO_BPP_MAP))return void this.error(new Error("Unsupported color type"));if(0!==a)return void this.error(new Error("Unsupported compression method"));if(0!==s)return void this.error(new Error("Unsupported filter method"));if(0!==u&&1!==u)return void this.error(new Error("Unsupported interlace method"));this._colorType=i;let c=n.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:r,depth:o,interlace:Boolean(u),palette:Boolean(i&n.COLORTYPE_PALETTE),color:Boolean(i&n.COLORTYPE_COLOR),alpha:Boolean(i&n.COLORTYPE_ALPHA),bpp:c,colorType:i}),this._handleChunkEnd()},i.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))},i.prototype._parsePLTE=function(t){this._crc.write(t);let e=Math.floor(t.length/3);for(let r=0;r<e;r++)this._palette.push([t[3*r],t[3*r+1],t[3*r+2],255]);this.palette(this._palette),this._handleChunkEnd()},i.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))},i.prototype._parseTRNS=function(t){if(this._crc.write(t),this._colorType===n.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(t.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(let e=0;e<t.length;e++)this._palette[e][3]=t[e];this.palette(this._palette)}this._colorType===n.COLORTYPE_GRAYSCALE&&this.transColor([t.readUInt16BE(0)]),this._colorType===n.COLORTYPE_COLOR&&this.transColor([t.readUInt16BE(0),t.readUInt16BE(2),t.readUInt16BE(4)]),this._handleChunkEnd()},i.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))},i.prototype._parseGAMA=function(t){this._crc.write(t),this.gamma(t.readUInt32BE(0)/n.GAMMA_DIVISION),this._handleChunkEnd()},i.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))},i.prototype._parseIDAT=function(t,e){if(this._crc.write(e),this._colorType===n.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(e);let r=t-e.length;r>0?this._handleIDAT(r):this._handleChunkEnd()},i.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},i.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}},6117:(t,e,r)=>{"use strict";let n=r(2416),o=r(8360);e.read=function(t,e){return n(t,e||{})},e.write=function(t,e){return o(t,e)}},5477:(t,e,r)=>{"use strict";let n=r(3837),o=r(2781),i=r(7900),a=r(6838),s=r(6117),u=e.y=function(t){o.call(this),t=t||{},this.width=0|t.width,this.height=0|t.height,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new i(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new a(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};n.inherits(u,o),u.sync=s,u.prototype.pack=function(){return this.data&&this.data.length?(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},u.prototype.parse=function(t,e){if(e){let t,r;t=function(t){this.removeListener("error",r),this.data=t,e(null,this)}.bind(this),r=function(r){this.removeListener("parsed",t),e(r,null)}.bind(this),this.once("parsed",t),this.once("error",r)}return this.end(t),this},u.prototype.write=function(t){return this._parser.write(t),!0},u.prototype.end=function(t){this._parser.end(t)},u.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},u.prototype._gamma=function(t){this.gamma=t},u.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},u.bitblt=function(t,e,r,n,o,i,a,s){if(n|=0,o|=0,i|=0,a|=0,s|=0,(r|=0)>t.width||n>t.height||r+o>t.width||n+i>t.height)throw new Error("bitblt reading outside image");if(a>e.width||s>e.height||a+o>e.width||s+i>e.height)throw new Error("bitblt writing outside image");for(let u=0;u<i;u++)t.data.copy(e.data,(s+u)*e.width+a<<2,(n+u)*t.width+r<<2,(n+u)*t.width+r+o<<2)},u.prototype.bitblt=function(t,e,r,n,o,i,a){return u.bitblt(this,t,e,r,n,o,i,a),this},u.adjustGamma=function(t){if(t.gamma){for(let e=0;e<t.height;e++)for(let r=0;r<t.width;r++){let n=t.width*e+r<<2;for(let e=0;e<3;e++){let r=t.data[n+e]/255;r=Math.pow(r,1/2.2/t.gamma),t.data[n+e]=Math.round(255*r)}}t.gamma=0}},u.prototype.adjustGamma=function(){u.adjustGamma(this)}},9653:(t,e,r)=>{"use strict";let n=r(9491).ok,o=r(9796),i=r(3837),a=r(4300).kMaxLength;function s(t){if(!(this instanceof s))return new s(t);t&&t.chunkSize<o.Z_MIN_CHUNK&&(t.chunkSize=o.Z_MIN_CHUNK),o.Inflate.call(this,t),this._offset=void 0===this._offset?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,t&&null!=t.maxLength&&(this._maxLength=t.maxLength)}function u(t,e){e&&process.nextTick(e),t._handle&&(t._handle.close(),t._handle=null)}function c(t,e){return function(t,e){if("string"==typeof e&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let r=t._finishFlushFlag;return null==r&&(r=o.Z_FINISH),t._processChunk(e,r)}(new s(e),t)}s.prototype._processChunk=function(t,e,r){if("function"==typeof r)return o.Inflate._processChunk.call(this,t,e,r);let i,s,c=this,l=t&&t.length,h=this._chunkSize-this._offset,f=this._maxLength,p=0,d=[],m=0;function v(t,e){if(c._hadError)return;let r=h-e;if(n(r>=0,"have should not go down"),r>0){let t=c._buffer.slice(c._offset,c._offset+r);if(c._offset+=r,t.length>f&&(t=t.slice(0,f)),d.push(t),m+=t.length,f-=t.length,0===f)return!1}return(0===e||c._offset>=c._chunkSize)&&(h=c._chunkSize,c._offset=0,c._buffer=Buffer.allocUnsafe(c._chunkSize)),0===e&&(p+=l-t,l=t,!0)}this.on("error",(function(t){i=t})),n(this._handle,"zlib binding closed");do{s=this._handle.writeSync(e,t,p,l,this._buffer,this._offset,h),s=s||this._writeState}while(!this._hadError&&v(s[0],s[1]));if(this._hadError)throw i;if(m>=a)throw u(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+a.toString(16)+" bytes");let g=Buffer.concat(d,m);return u(this),g},i.inherits(s,o.Inflate),t.exports=e=c,e.Inflate=s,e.createInflate=function(t){return new s(t)},e.inflateSync=c},33:t=>{"use strict";let e=t.exports=function(t){this._buffer=t,this._reads=[]};e.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})},e.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;{this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}},5666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),a=new x(n||[]);return i._invoke=function(t,e,r){var n=h;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=F(a,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?d:f,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var h="suspendedStart",f="suspendedYield",p="executing",d="completed",m={};function v(){}function g(){}function _(){}var D={};u(D,i,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(S([])));w&&w!==r&&n.call(w,i)&&(D=w);var b=_.prototype=v.prototype=Object.create(D);function E(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function r(o,i,a,s){var u=l(t[o],t,i);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function F(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,F(t,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:O}}function O(){return{value:e,done:!0}}return g.prototype=_,u(b,"constructor",_),u(_,"constructor",g),g.displayName=u(_,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,u(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},E(C.prototype),u(C.prototype,a,(function(){return this})),t.AsyncIterator=C,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new C(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(b),u(b,s,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:S(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},4223:(t,e,r)=>{"use strict";const n=r(6003),o=r(1903),i=r(809),a=t=>{if("string"!=typeof t||0===t.length)return 0;if(0===(t=n(t)).length)return 0;t=t.replace(i()," ");let e=0;for(let r=0;r<t.length;r++){const n=t.codePointAt(r);n<=31||n>=127&&n<=159||(n>=768&&n<=879||(n>65535&&r++,e+=o(n)?2:1))}return e};t.exports=a,t.exports.default=a},6003:(t,e,r)=>{"use strict";const n=r(4277);t.exports=t=>"string"==typeof t?t.replace(n(),""):t},8006:t=>{"use strict";t.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,136,13,0,0,0,0,0,5,52,0,0,0,0,0,40,0,45,0,44,0,6,73,10,104,16,68,8,96,5,73,136,66,33,191,12,34,4,75,26,96,79,240,255,50,16,70,112,71,0,0,0,0,0,0,0,0,0,0,0,0,0,32,112,71,1,32,112,71,79,240,255,48,112,71,0,32,112,71,0,32,112,71,79,240,255,48,112,71,79,246,255,115,19,181,8,70,0,147,5,73,0,35,20,70,9,104,26,70,255,247,254,255,32,70,2,176,16,189,0,191,0,0,0,0,11,74,12,75,12,73,155,26,1,59,9,210,11,74,0,33,11,75,155,26,1,59,8,210,0,33,8,70,255,247,254,191,17,248,1,11,2,248,1,11,238,231,2,248,1,27,241,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,223,112,71,16,181,1,223,4,70,224,178,16,189,16,181,45,223,4,70,32,70,16,189,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,130,176,2,171,3,233,3,0,18,223,2,176,112,71,16,181,21,223,4,70,224,178,16,189,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,33,223,32,96,97,96,212,233,0,1,2,176,16,189,16,181,23,223,4,70,160,178,16,189,50,223,112,71,49,223,112,71,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,119,180,13,77,1,145,41,104,189,248,24,96,17,240,1,15,10,76,8,209,121,70,137,13,137,5,1,245,128,49,48,49,33,96,1,33,41,96,33,104,6,150,12,104,1,153,164,70,3,176,112,188,96,71,0,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,46,51,45,50,48,50,49,46,49,48,41,32,49,48,46,51,46,49,32,50,48,50,49,48,56,50,52,32,40,114,101,108,101,97,115,101,41,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,46,51,45,50,48,50,49,46,49,48,41,32,49,48,46,51,46,49,32,50,48,50,49,48,56,50,52,32,40,114,101,108,101,97,115,101,41,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,46,51,45,50,48,50,49,46,49,48,41,32,49,48,46,51,46,49,32,50,48,50,49,48,56,50,52,32,40,114,101,108,101,97,115,101,41,0,65,51,0,0,0,97,101,97,98,105,0,1,41,0,0,0,5,55,69,45,77,0,6,13,7,77,9,2,10,8,18,4,20,1,21,1,23,3,24,1,25,1,26,1,27,1,28,1,30,4,34,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,39,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,4,0,0,0,28,0,0,0,0,0,0,0,0,0,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,4,0,0,0,32,0,0,0,0,0,0,0,0,0,10,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,4,0,0,0,48,0,0,0,0,0,0,0,0,0,12,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,4,0,0,0,56,0,0,0,0,0,0,0,0,0,27,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,39,0,7,0,0,0,1,0,0,0,10,0,0,0,18,0,23,0,22,0,0,0,1,0,0,0,14,0,0,0,18,0,17,0,45,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,51,0,0,0,1,0,0,0,14,0,0,0,18,0,18,0,250,0,0,0,0,0,0,0,4,0,0,0,17,0,33,0,82,0,0,0,1,0,0,0,4,0,0,0,18,0,4,0,89,0,0,0,1,0,0,0,26,0,0,0,18,0,22,0,118,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,142,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,152,0,0,0,1,0,0,0,4,0,0,0,18,0,5,0,160,0,0,0,1,0,0,0,6,0,0,0,18,0,6,0,166,0,0,0,1,0,0,0,64,0,0,0,18,0,27,0,191,0,0,0,1,0,0,0,40,0,0,0,18,0,2,0,197,0,0,0,1,0,0,0,4,0,0,0,18,0,25,0,216,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,228,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,249,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,18,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,37,1,0,0,1,0,0,0,68,0,0,0,18,0,12,0,44,1,0,0,1,0,0,0,4,0,0,0,18,0,8,0,51,1,0,0,1,0,0,0,10,0,0,0,18,0,16,0,63,1,0,0,1,0,0,0,14,0,0,0,18,0,19,0,86,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,108,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,113,1,0,0,1,0,0,0,4,0,0,0,18,0,24,0,132,1,0,0,0,0,0,0,4,0,0,0,17,0,31,0,151,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,174,1,0,0,1,0,0,0,26,0,0,0,18,0,21,0,193,1,0,0,1,0,0,0,36,0,0,0,18,0,10,0,200,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,226,1,0,0,1,0,0,0,26,0,0,0,18,0,26,0,245,1,0,0,1,0,0,0,4,0,0,0,18,0,7,0,251,1,0,0,1,0,0,0,10,0,0,0,18,0,20,0,24,2,0,0,1,0,0,0,4,0,0,0,18,0,14,0,54,2,0,0,1,0,0,0,10,0,0,0,18,0,15,0,80,2,0,0,1,0,0,0,6,0,0,0,18,0,9,0,0,36,116,0,36,100,0,101,97,100,107,95,101,118,101,110,116,95,103,101,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,114,114,110,111,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,95,102,115,116,97,116,0,95,90,50,51,101,97,100,107,95,107,101,121,98,111,97,114,100,95,112,111,112,95,115,116,97,116,101,118,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,95,104,101,97,112,95,101,110,100,0,95,105,115,97,116,116,121,0,95,111,112,101,110,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,95,115,98,114,107,0,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,95,104,101,97,112,95,115,116,97,114,116,0,95,98,115,115,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,95,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,95,115,105,122,101,0,95,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,95,115,116,97,114,116,0,95,108,115,101,101,107,0,101,97,100,107,95,114,97,110,100,111,109,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,109,97,105,110,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,101,120,116,101,114,110,97,108,95,100,97,116,97,0,95,98,115,115,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,95,119,114,105,116,101,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,102,108,97,115,104,0,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,95,114,101,97,100,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,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,99,107,108,105,103,104,116,95,98,114,105,103,104,116,110,101,115,115,0,95,99,108,111,115,101,0,0,28,0,0,0,2,2,0,0,32,0,0,0,2,46,0,0,36,0,0,0,2,40,0,0,20,0,0,0,10,49,0,0,32,0,0,0,2,1,0,0,28,0,0,0,30,61,0,0,48,0,0,0,2,45,0,0,52,0,0,0,2,60,0,0,56,0,0,0,2,67,0,0,60,0,0,0,2,64,0,0,64,0,0,0,2,53,0,0,56,0,0,0,2,3,0,0,60,0,0,0,2,4,0,0,0,0,0,0,2,55,0,0,0,0,0,0,2,54,0,0,0,0,0,0,2,52,0,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,114,101,108,46,116,101,120,116,46,95,115,98,114,107,0,46,116,101,120,116,46,95,102,115,116,97,116,0,46,116,101,120,116,46,95,105,115,97,116,116,121,0,46,116,101,120,116,46,95,111,112,101,110,0,46,116,101,120,116,46,95,114,101,97,100,0,46,116,101,120,116,46,95,108,115,101,101,107,0,46,116,101,120,116,46,95,99,108,111,115,101,0,46,114,101,108,46,116,101,120,116,46,95,119,114,105,116,101,0,46,114,101,108,46,116,101,120,116,46,95,115,116,97,114,116,0,46,116,101,120,116,46,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,46,116,101,120,116,46,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,46,116,101,120,116,46,101,97,100,107,95,114,97,110,100,111,109,0,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,0,46,116,101,120,116,46,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,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,46,116,101,120,116,46,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,46,116,101,120,116,46,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,46,116,101,120,116,46,95,90,50,51,101,97,100,107,95,107,101,121,98,111,97,114,100,95,112,111,112,95,115,116,97,116,101,118,0,46,116,101,120,116,46,101,97,100,107,95,101,118,101,110,116,95,103,101,116,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,46,114,101,108,46,116,101,120,116,46,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,46,114,111,100,97,116,97,46,108,111,99,97,116,105,111,110,46,48,0,46,100,97,116,97,0,46,114,101,108,46,100,97,116,97,46,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,0,46,114,101,108,46,100,97,116,97,46,101,97,100,107,95,101,120,116,101,114,110,97,108,95,100,97,116,97,95,115,105,122,101,0,46,114,101,108,46,100,97,116,97,46,104,101,97,112,95,101,110,100,46,49,0,46,98,115,115,0,46,98,115,115,46,95,90,71,86,90,76,50,53,116,114,97,109,112,111,108,105,110,101,70,117,110,99,116,105,111,110,65,100,100,114,101,115,115,105,69,54,111,114,105,103,105,110,0,46,98,115,115,46,95,90,90,76,50,53,116,114,97,109,112,111,108,105,110,101,70,117,110,99,116,105,111,110,65,100,100,114,101,115,115,105,69,54,111,114,105,103,105,110,0,46,99,111,109,109,101,110,116,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,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,37,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,52,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,33,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,232,9,0,0,24,0,0,0,42,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,49,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,92,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,62,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,96,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,76,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,100,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,106,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,100,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,110,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,113,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,114,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,130,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,120,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,126,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,0,10,0,0,16,0,0,0,42,0,0,0,10,0,0,0,4,0,0,0,8,0,0,0,147,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,156,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,143,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,16,10,0,0,48,0,0,0,42,0,0,0,12,0,0,0,4,0,0,0,8,0,0,0,160,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,224,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,196,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,228,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,228,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,238,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,246,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,248,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,19,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,6,1,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,56,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,20,1,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,85,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,34,1,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,120,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,44,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,145,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,70,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,180,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,96,1,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,201,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,106,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,226,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,110,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,251,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,114,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,24,2,0,0,1,0,0,0,6,0,0,0,0,0,0,0,140,1,0,0,64,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,20,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,64,10,0,0,16,0,0,0,42,0,0,0,27,0,0,0,4,0,0,0,8,0,0,0,55,2,0,0,1,0,0,0,2,0,0,0,0,0,0,0,204,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,74,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,208,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,84,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,208,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,80,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,80,10,0,0,8,0,0,0,42,0,0,0,31,0,0,0,4,0,0,0,8,0,0,0,113,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,212,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,109,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,88,10,0,0,8,0,0,0,42,0,0,0,33,0,0,0,4,0,0,0,8,0,0,0,147,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,216,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,143,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,96,10,0,0,8,0,0,0,42,0,0,0,35,0,0,0,4,0,0,0,8,0,0,0,164,2,0,0,8,0,0,0,3,0,0,0,0,0,0,0,220,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,169,2,0,0,8,0,0,0,3,0,0,0,0,0,0,0,220,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,217,2,0,0,8,0,0,0,3,0,0,0,0,0,0,0,220,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,7,3,0,0,1,0,0,0,48,0,0,0,0,0,0,0,220,1,0,0,222,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,16,3,0,0,3,0,0,112,0,0,0,0,0,0,0,0,186,2,0,0,52,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,240,2,0,0,160,4,0,0,43,0,0,0,38,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,144,7,0,0,87,2,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,104,10,0,0,32,3,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0]}},7573:(t,e,r)=>{"use strict";t.exports=r.p+"toolchain/ld.wasm"},3835:(t,e,r)=>{"use strict";t.exports=r.p+"toolchain/objcopy.wasm"},9491:t=>{"use strict";t.exports=require("assert")},852:t=>{"use strict";t.exports=require("async_hooks")},4300:t=>{"use strict";t.exports=require("buffer")},2081:t=>{"use strict";t.exports=require("child_process")},6113:t=>{"use strict";t.exports=require("crypto")},2361:t=>{"use strict";t.exports=require("events")},7147:t=>{"use strict";t.exports=require("fs")},1017:t=>{"use strict";t.exports=require("path")},7282:t=>{"use strict";t.exports=require("process")},4521:t=>{"use strict";t.exports=require("readline")},2781:t=>{"use strict";t.exports=require("stream")},3837:t=>{"use strict";t.exports=require("util")},9796:t=>{"use strict";t.exports=require("zlib")},7461:(t,e,r)=>{const{Argument:n}=r(8998),{Command:o}=r(5282),{CommanderError:i,InvalidArgumentError:a}=r(8056),{Help:s}=r(8917),{Option:u}=r(5790);(e=t.exports=new o).program=e,e.Argument=n,e.Command=o,e.CommanderError=i,e.Help=s,e.InvalidArgumentError=a,e.InvalidOptionArgumentError=a,e.Option=u},8998:(t,e,r)=>{const{InvalidArgumentError:n}=r(8056);e.Argument=class{constructor(t,e){switch(this.description=e||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?e.concat(t):[t]}default(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{if(!this.argChoices.includes(t))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,e):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},e.humanReadableArgName=function(t){const e=t.name()+(!0===t.variadic?"...":"");return t.required?"<"+e+">":"["+e+"]"}},5282:(t,e,r)=>{const n=r(2361).EventEmitter,o=r(2081),i=r(1017),a=r(7147),s=r(7282),{Argument:u,humanReadableArgName:c}=r(8998),{CommanderError:l}=r(8056),{Help:h}=r(8917),{Option:f,splitOptionFlags:p,DualOptions:d}=r(5790),{suggestSimilar:m}=r(1812);class v extends n{constructor(t){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=t||"",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:t=>s.stdout.write(t),writeErr:t=>s.stderr.write(t),getOutHelpWidth:()=>s.stdout.isTTY?s.stdout.columns:void 0,getErrHelpWidth:()=>s.stderr.isTTY?s.stderr.columns:void 0,outputError:(t,e)=>e(t)},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(t){return this._outputConfiguration=t._outputConfiguration,this._hasHelpOption=t._hasHelpOption,this._helpFlags=t._helpFlags,this._helpDescription=t._helpDescription,this._helpShortFlag=t._helpShortFlag,this._helpLongFlag=t._helpLongFlag,this._helpCommandName=t._helpCommandName,this._helpCommandnameAndArgs=t._helpCommandnameAndArgs,this._helpCommandDescription=t._helpCommandDescription,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}command(t,e,r){let n=e,o=r;"object"==typeof n&&null!==n&&(o=n,n=null),o=o||{};const[,i,a]=t.match(/([^ ]+) *(.*)/),s=this.createCommand(i);return n&&(s.description(n),s._executableHandler=!0),o.isDefault&&(this._defaultCommandName=s._name),s._hidden=!(!o.noHelp&&!o.hidden),s._executableFile=o.executableFile||null,a&&s.arguments(a),this.commands.push(s),s.parent=this,s.copyInheritedSettings(this),n?this:s}createCommand(t){return new v(t)}createHelp(){return Object.assign(new h,this.configureHelp())}configureHelp(t){return void 0===t?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return void 0===t?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return"string"!=typeof t&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,e){if(!t._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(e=e||{}).isDefault&&(this._defaultCommandName=t._name),(e.noHelp||e.hidden)&&(t._hidden=!0),this.commands.push(t),t.parent=this,this}createArgument(t,e){return new u(t,e)}argument(t,e,r,n){const o=this.createArgument(t,e);return"function"==typeof r?o.default(n).argParser(r):o.default(r),this.addArgument(o),this}arguments(t){return t.split(/ +/).forEach((t=>{this.argument(t)})),this}addArgument(t){const e=this._args.slice(-1)[0];if(e&&e.variadic)throw new Error(`only the last argument can be variadic '${e.name()}'`);if(t.required&&void 0!==t.defaultValue&&void 0===t.parseArg)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this._args.push(t),this}addHelpCommand(t,e){return!1===t?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof t&&(this._helpCommandName=t.split(" ")[0],this._helpCommandnameAndArgs=t),this._helpCommandDescription=e||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(t,e){const r=["preAction","postAction"];if(!r.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(e):this._lifeCycleHooks[t]=[e],this}exitOverride(t){return this._exitCallback=t||(t=>{if("commander.executeSubCommandAsync"!==t.code)throw t}),this}_exit(t,e,r){this._exitCallback&&this._exitCallback(new l(t,e,r)),s.exit(t)}action(t){return this._actionHandler=e=>{const r=this._args.length,n=e.slice(0,r);return this._storeOptionsAsProperties?n[r]=this:n[r]=this.opts(),n.push(this),t.apply(this,n)},this}createOption(t,e){return new f(t,e)}addOption(t){const e=t.name(),r=t.attributeName();if(t.negate){const e=t.long.replace(/^--no-/,"--");this._findOption(e)||this.setOptionValueWithSource(r,void 0===t.defaultValue||t.defaultValue,"default")}else void 0!==t.defaultValue&&this.setOptionValueWithSource(r,t.defaultValue,"default");this.options.push(t);const n=(e,n,o)=>{null==e&&void 0!==t.presetArg&&(e=t.presetArg);const i=this.getOptionValue(r);if(null!==e&&t.parseArg)try{e=t.parseArg(e,i)}catch(t){if("commander.invalidArgument"===t.code){const e=`${n} ${t.message}`;this.error(e,{exitCode:t.exitCode,code:t.code})}throw t}else null!==e&&t.variadic&&(e=t._concatValue(e,i));null==e&&(e=!t.negate&&(!(!t.isBoolean()&&!t.optional)||"")),this.setOptionValueWithSource(r,e,o)};return this.on("option:"+e,(e=>{const r=`error: option '${t.flags}' argument '${e}' is invalid.`;n(e,r,"cli")})),t.envVar&&this.on("optionEnv:"+e,(e=>{const r=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;n(e,r,"env")})),this}_optionEx(t,e,r,n,o){if("object"==typeof e&&e instanceof f)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const i=this.createOption(e,r);if(i.makeOptionMandatory(!!t.mandatory),"function"==typeof n)i.default(o).argParser(n);else if(n instanceof RegExp){const t=n;n=(e,r)=>{const n=t.exec(e);return n?n[0]:r},i.default(o).argParser(n)}else i.default(n);return this.addOption(i)}option(t,e,r,n){return this._optionEx({},t,e,r,n)}requiredOption(t,e,r,n){return this._optionEx({mandatory:!0},t,e,r,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){if(this._passThroughOptions=!!t,this.parent&&t&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(t=!0){if(this._storeOptionsAsProperties=!!t,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,e){return this._storeOptionsAsProperties?this[t]=e:this._optionValues[t]=e,this}setOptionValueWithSource(t,e,r){return this.setOptionValue(t,e),this._optionValueSources[t]=r,this}getOptionValueSource(t){return this._optionValueSources[t]}_prepareUserArgs(t,e){if(void 0!==t&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");let r;switch(e=e||{},void 0===t&&(t=s.argv,s.versions&&s.versions.electron&&(e.from="electron")),this.rawArgs=t.slice(),e.from){case void 0:case"node":this._scriptPath=t[1],r=t.slice(2);break;case"electron":s.defaultApp?(this._scriptPath=t[1],r=t.slice(2)):r=t.slice(1);break;case"user":r=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(t,e){const r=this._prepareUserArgs(t,e);return this._parseCommand([],r),this}async parseAsync(t,e){const r=this._prepareUserArgs(t,e);return await this._parseCommand([],r),this}_executeSubCommand(t,e){e=e.slice();let r=!1;const n=[".js",".ts",".tsx",".mjs",".cjs"];function u(t,e){const r=i.resolve(t,e);if(a.existsSync(r))return r;if(n.includes(i.extname(e)))return;const o=n.find((t=>a.existsSync(`${r}${t}`)));return o?`${r}${o}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let c,h=t._executableFile||`${this._name}-${t._name}`,f=this._executableDir||"";if(this._scriptPath){let t;try{t=a.realpathSync(this._scriptPath)}catch(e){t=this._scriptPath}f=i.resolve(i.dirname(t),f)}if(f){let e=u(f,h);if(!e&&!t._executableFile&&this._scriptPath){const r=i.basename(this._scriptPath,i.extname(this._scriptPath));r!==this._name&&(e=u(f,`${r}-${t._name}`))}h=e||h}if(r=n.includes(i.extname(h)),"win32"!==s.platform?r?(e.unshift(h),e=_(s.execArgv).concat(e),c=o.spawn(s.argv[0],e,{stdio:"inherit"})):c=o.spawn(h,e,{stdio:"inherit"}):(e.unshift(h),e=_(s.execArgv).concat(e),c=o.spawn(s.execPath,e,{stdio:"inherit"})),!c.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((t=>{s.on(t,(()=>{!1===c.killed&&null===c.exitCode&&c.kill(t)}))}))}const p=this._exitCallback;p?c.on("close",(()=>{p(new l(s.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):c.on("close",s.exit.bind(s)),c.on("error",(e=>{if("ENOENT"===e.code){const e=f?`searched for local subcommand relative to directory '${f}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",r=`'${h}' does not exist\n - if '${t._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 - ${e}`;throw new Error(r)}if("EACCES"===e.code)throw new Error(`'${h}' not executable`);if(p){const t=new l(1,"commander.executeSubCommandAsync","(error)");t.nestedError=e,p(t)}else s.exit(1)})),this.runningCommand=c}_dispatchSubcommand(t,e,r){const n=this._findCommand(t);if(n||this.help({error:!0}),!n._executableHandler)return n._parseCommand(e,r);this._executeSubCommand(n,e.concat(r))}_checkNumberOfArguments(){this._args.forEach(((t,e)=>{t.required&&null==this.args[e]&&this.missingArgument(t.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const t=(t,e,r)=>{let n=e;if(null!==e&&t.parseArg)try{n=t.parseArg(e,r)}catch(r){if("commander.invalidArgument"===r.code){const n=`error: command-argument value '${e}' is invalid for argument '${t.name()}'. ${r.message}`;this.error(n,{exitCode:r.exitCode,code:r.code})}throw r}return n};this._checkNumberOfArguments();const e=[];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(((e,n)=>t(r,n,e)),r.defaultValue))):void 0===o&&(o=[]):n<this.args.length&&(o=this.args[n],r.parseArg&&(o=t(r,o,r.defaultValue))),e[n]=o})),this.processedArgs=e}_chainOrCall(t,e){return t&&t.then&&"function"==typeof t.then?t.then((()=>e())):e()}_chainOrCallHooks(t,e){let r=t;const n=[];return D(this).reverse().filter((t=>void 0!==t._lifeCycleHooks[e])).forEach((t=>{t._lifeCycleHooks[e].forEach((e=>{n.push({hookedCommand:t,callback:e})}))})),"postAction"===e&&n.reverse(),n.forEach((t=>{r=this._chainOrCall(r,(()=>t.callback(t.hookedCommand,this)))})),r}_parseCommand(t,e){const r=this.parseOptions(e);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(r.operands),e=r.unknown,this.args=t.concat(e),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),e);if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName)return 1===t.length&&this.help(),this._dispatchSubcommand(t[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return g(this,e),this._dispatchSubcommand(this._defaultCommandName,t,e);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),g(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,t,e)}))),r=this._chainOrCallHooks(r,"postAction"),r}if(this.parent&&this.parent.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,t,e);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,e);this.listenerCount("command:*")?this.emit("command:*",t,e):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find((e=>e._name===t||e._aliases.includes(t)))}_findOption(t){return this.options.find((e=>e.is(t)))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent)t.options.forEach((e=>{e.mandatory&&void 0===t.getOptionValue(e.attributeName())&&t.missingMandatoryOptionValue(e)}))}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const e=t.attributeName();return void 0!==this.getOptionValue(e)&&"default"!==this.getOptionValueSource(e)}));t.filter((t=>t.conflictsWith.length>0)).forEach((e=>{const r=t.find((t=>e.conflictsWith.includes(t.attributeName())));r&&this._conflictingOption(e,r)}))}_checkForConflictingOptions(){for(let t=this;t;t=t.parent)t._checkForConflictingLocalOptions()}parseOptions(t){const e=[],r=[];let n=e;const o=t.slice();function i(t){return t.length>1&&"-"===t[0]}let a=null;for(;o.length;){const t=o.shift();if("--"===t){n===r&&n.push(t),n.push(...o);break}if(!a||i(t)){if(a=null,i(t)){const e=this._findOption(t);if(e){if(e.required){const t=o.shift();void 0===t&&this.optionMissingArgument(e),this.emit(`option:${e.name()}`,t)}else if(e.optional){let t=null;o.length>0&&!i(o[0])&&(t=o.shift()),this.emit(`option:${e.name()}`,t)}else this.emit(`option:${e.name()}`);a=e.variadic?e:null;continue}}if(t.length>2&&"-"===t[0]&&"-"!==t[1]){const e=this._findOption(`-${t[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,t.slice(2)):(this.emit(`option:${e.name()}`),o.unshift(`-${t.slice(2)}`));continue}}if(/^--[^=]+=/.test(t)){const e=t.indexOf("="),r=this._findOption(t.slice(0,e));if(r&&(r.required||r.optional)){this.emit(`option:${r.name()}`,t.slice(e+1));continue}}if(i(t)&&(n=r),(this._enablePositionalOptions||this._passThroughOptions)&&0===e.length&&0===r.length){if(this._findCommand(t)){e.push(t),o.length>0&&r.push(...o);break}if(t===this._helpCommandName&&this._hasImplicitHelpCommand()){e.push(t),o.length>0&&e.push(...o);break}if(this._defaultCommandName){r.push(t),o.length>0&&r.push(...o);break}}if(this._passThroughOptions){n.push(t),o.length>0&&n.push(...o);break}n.push(t)}else this.emit(`option:${a.name()}`,t)}return{operands:e,unknown:r}}opts(){if(this._storeOptionsAsProperties){const t={},e=this.options.length;for(let r=0;r<e;r++){const e=this.options[r].attributeName();t[e]=e===this._versionOptionName?this._version:this[e]}return t}return this._optionValues}optsWithGlobals(){return D(this).reduce(((t,e)=>Object.assign(t,e.opts())),{})}error(t,e){this._outputConfiguration.outputError(`${t}\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=e||{},n=r.exitCode||1,o=r.code||"commander.error";this._exit(n,o,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in s.env){const e=t.attributeName();(void 0===this.getOptionValue(e)||["default","config","env"].includes(this.getOptionValueSource(e)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,s.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}}))}_parseOptionsImplied(){const t=new d(this.options),e=t=>void 0!==this.getOptionValue(t)&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((r=>void 0!==r.implied&&e(r.attributeName())&&t.valueFromOption(this.getOptionValue(r.attributeName()),r))).forEach((t=>{Object.keys(t.implied).filter((t=>!e(t))).forEach((e=>{this.setOptionValueWithSource(e,t.implied[e],"implied")}))}))}missingArgument(t){const e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){const e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){const r=t=>{const e=t.attributeName(),r=this.getOptionValue(e),n=this.options.find((t=>t.negate&&e===t.attributeName())),o=this.options.find((t=>!t.negate&&e===t.attributeName()));return n&&(void 0===n.presetArg&&!1===r||void 0!==n.presetArg&&r===n.presetArg)?n:o||t},n=t=>{const e=r(t),n=e.attributeName();return"env"===this.getOptionValueSource(n)?`environment variable '${e.envVar}'`:`option '${e.flags}'`},o=`error: ${n(t)} cannot be used with ${n(e)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let r=[],n=this;do{const t=n.createHelp().visibleOptions(n).filter((t=>t.long)).map((t=>t.long));r=r.concat(t),n=n.parent}while(n&&!n._enablePositionalOptions);e=m(t,r)}const r=`error: unknown option '${t}'${e}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const e=this._args.length,r=1===e?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${e} argument${r} but got ${t.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let e="";if(this._showSuggestionAfterError){const r=[];this.createHelp().visibleCommands(this).forEach((t=>{r.push(t.name()),t.alias()&&r.push(t.alias())})),e=m(t,r)}const r=`error: unknown command '${t}'${e}`;this.error(r,{code:"commander.unknownCommand"})}version(t,e,r){if(void 0===t)return this._version;this._version=t,e=e||"-V, --version",r=r||"output the version number";const n=this.createOption(e,r);return this._versionOptionName=n.attributeName(),this.options.push(n),this.on("option:"+n.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`),this._exit(0,"commander.version",t)})),this}description(t,e){return void 0===t&&void 0===e?this._description:(this._description=t,e&&(this._argsDescription=e),this)}summary(t){return void 0===t?this._summary:(this._summary=t,this)}alias(t){if(void 0===t)return this._aliases[0];let e=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(e=this.commands[this.commands.length-1]),t===e._name)throw new Error("Command alias can't be the same as its name");return e._aliases.push(t),this}aliases(t){return void 0===t?this._aliases:(t.forEach((t=>this.alias(t))),this)}usage(t){if(void 0===t){if(this._usage)return this._usage;const t=this._args.map((t=>c(t)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}return this._usage=t,this}name(t){return void 0===t?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=i.basename(t,i.extname(t)),this}executableDir(t){return void 0===t?this._executableDir:(this._executableDir=t,this)}helpInformation(t){const e=this.createHelp();return void 0===e.helpWidth&&(e.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),e.formatHelp(this,e)}_getHelpContext(t){const e={error:!!(t=t||{}).error};let r;return r=e.error?t=>this._outputConfiguration.writeErr(t):t=>this._outputConfiguration.writeOut(t),e.write=t.write||r,e.command=this,e}outputHelp(t){let e;"function"==typeof t&&(e=t,t=void 0);const r=this._getHelpContext(t);D(this).reverse().forEach((t=>t.emit("beforeAllHelp",r))),this.emit("beforeHelp",r);let n=this.helpInformation(r);if(e&&(n=e(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),D(this).forEach((t=>t.emit("afterAllHelp",r)))}helpOption(t,e){if("boolean"==typeof t)return this._hasHelpOption=t,this;this._helpFlags=t||this._helpFlags,this._helpDescription=e||this._helpDescription;const r=p(this._helpFlags);return this._helpShortFlag=r.shortFlag,this._helpLongFlag=r.longFlag,this}help(t){this.outputHelp(t);let e=s.exitCode||0;0===e&&t&&"function"!=typeof t&&t.error&&(e=1),this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){const r=["beforeAll","before","after","afterAll"];if(!r.includes(t))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${r.join("', '")}'`);const n=`${t}Help`;return this.on(n,(t=>{let r;r="function"==typeof e?e({error:t.error,command:t.command}):e,r&&t.write(`${r}\n`)})),this}}function g(t,e){t._hasHelpOption&&e.find((e=>e===t._helpLongFlag||e===t._helpShortFlag))&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function _(t){return t.map((t=>{if(!t.startsWith("--inspect"))return t;let e,r,n="127.0.0.1",o="9229";return null!==(r=t.match(/^(--inspect(-brk)?)$/))?e=r[1]:null!==(r=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(e=r[1],/^\d+$/.test(r[3])?o=r[3]:n=r[3]):null!==(r=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(e=r[1],n=r[3],o=r[4]),e&&"0"!==o?`${e}=${n}:${parseInt(o)+1}`:t}))}function D(t){const e=[];for(let r=t;r;r=r.parent)e.push(r);return e}e.Command=v},8056:(t,e)=>{class r extends Error{constructor(t,e,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=e,this.exitCode=t,this.nestedError=void 0}}e.CommanderError=r,e.InvalidArgumentError=class extends r{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},8917:(t,e,r)=>{const{humanReadableArgName:n}=r(8998);e.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(t){const e=t.commands.filter((t=>!t._hidden));if(t._hasImplicitHelpCommand()){const[,r,n]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=t.createCommand(r).helpOption(!1);o.description(t._helpCommandDescription),n&&o.arguments(n),e.push(o)}return this.sortSubcommands&&e.sort(((t,e)=>t.name().localeCompare(e.name()))),e}visibleOptions(t){const e=t.options.filter((t=>!t.hidden)),r=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag),n=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(r||n){let o;o=r?n?t.createOption(t._helpFlags,t._helpDescription):t.createOption(t._helpShortFlag,t._helpDescription):t.createOption(t._helpLongFlag,t._helpDescription),e.push(o)}if(this.sortOptions){const t=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");e.sort(((e,r)=>t(e).localeCompare(t(r))))}return e}visibleArguments(t){return t._argsDescription&&t._args.forEach((e=>{e.description=e.description||t._argsDescription[e.name()]||""})),t._args.find((t=>t.description))?t._args:[]}subcommandTerm(t){const e=t._args.map((t=>n(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce(((t,r)=>Math.max(t,e.subcommandTerm(r).length)),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce(((t,r)=>Math.max(t,e.optionTerm(r).length)),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce(((t,r)=>Math.max(t,e.argumentTerm(r).length)),0)}commandUsage(t){let e=t._name;t._aliases[0]&&(e=e+"|"+t._aliases[0]);let r="";for(let e=t.parent;e;e=e.parent)r=e.name()+" "+r;return r+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`),void 0!==t.defaultValue){(t.required||t.optional||t.isBoolean()&&"boolean"==typeof t.defaultValue)&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}return void 0!==t.presetArg&&t.optional&&e.push(`preset: ${JSON.stringify(t.presetArg)}`),void 0!==t.envVar&&e.push(`env: ${t.envVar}`),e.length>0?`${t.description} (${e.join(", ")})`:t.description}argumentDescription(t){const e=[];if(t.argChoices&&e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`),void 0!==t.defaultValue&&e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),e.length>0){const r=`(${e.join(", ")})`;return t.description?`${t.description} ${r}`:r}return t.description}formatHelp(t,e){const r=e.padWidth(t,e),n=e.helpWidth||80;function o(t,o){if(o){const i=`${t.padEnd(r+2)}${o}`;return e.wrap(i,n-2,r+2)}return t}function i(t){return t.join("\n").replace(/^/gm," ".repeat(2))}let a=[`Usage: ${e.commandUsage(t)}`,""];const s=e.commandDescription(t);s.length>0&&(a=a.concat([s,""]));const u=e.visibleArguments(t).map((t=>o(e.argumentTerm(t),e.argumentDescription(t))));u.length>0&&(a=a.concat(["Arguments:",i(u),""]));const c=e.visibleOptions(t).map((t=>o(e.optionTerm(t),e.optionDescription(t))));c.length>0&&(a=a.concat(["Options:",i(c),""]));const l=e.visibleCommands(t).map((t=>o(e.subcommandTerm(t),e.subcommandDescription(t))));return l.length>0&&(a=a.concat(["Commands:",i(l),""])),a.join("\n")}padWidth(t,e){return Math.max(e.longestOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))}wrap(t,e,r,n=40){if(t.match(/[\n]\s+/))return t;const o=e-r;if(o<n)return t;const i=t.slice(0,r),a=t.slice(r),s=" ".repeat(r),u=new RegExp(".{1,"+(o-1)+"}([\\s​]|$)|[^\\s​]+?([\\s​]|$)","g");return i+(a.match(u)||[]).map(((t,e)=>("\n"===t.slice(-1)&&(t=t.slice(0,t.length-1)),(e>0?s:"")+t.trimRight()))).join("\n")}}},5790:(t,e,r)=>{const{InvalidArgumentError:n}=r(8056);function o(t){let e,r;const n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}e.Option=class{constructor(t,e){this.flags=t,this.description=e||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;const r=o(t);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(t,e){return this.defaultValue=t,this.defaultValueDescription=e,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){return this.implied=Object.assign(this.implied||{},t),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,e){return e!==this.defaultValue&&Array.isArray(e)?e.concat(t):[t]}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,e)=>{if(!this.argChoices.includes(t))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,e):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((t,e)=>t+e[0].toUpperCase()+e.slice(1)))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},e.splitOptionFlags=o,e.DualOptions=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach((t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)})),this.negativeOptions.forEach(((t,e)=>{this.positiveOptions.has(e)&&this.dualOptions.add(e)}))}valueFromOption(t,e){const r=e.attributeName();if(!this.dualOptions.has(r))return!0;const n=this.negativeOptions.get(r).presetArg,o=void 0!==n&&n;return e.negate===(o===t)}}},1812:(t,e)=>{e.suggestSimilar=function(t,e){if(!e||0===e.length)return"";e=Array.from(new Set(e));const r=t.startsWith("--");r&&(t=t.slice(2),e=e.map((t=>t.slice(2))));let n=[],o=3;return e.forEach((e=>{if(e.length<=1)return;const r=function(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);const r=[];for(let e=0;e<=t.length;e++)r[e]=[e];for(let t=0;t<=e.length;t++)r[0][t]=t;for(let n=1;n<=e.length;n++)for(let o=1;o<=t.length;o++){let i=1;i=t[o-1]===e[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&&t[o-1]===e[n-2]&&t[o-2]===e[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[t.length][e.length]}(t,e),i=Math.max(t.length,e.length);(i-r)/i>.4&&(r<o?(o=r,n=[e]):r===o&&n.push(e))})),n.sort(((t,e)=>t.localeCompare(e))),r&&(n=n.map((t=>`--${t}`))),n.length>1?`\n(Did you mean one of ${n.join(", ")}?)`:1===n.length?`\n(Did you mean ${n[0]}?)`:""}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.p="";var n={};(()=>{"use strict";r.d(n,{default:()=>Cr});var t=r(7757),e=r.n(t);const o=require("usb");function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){var e="function"==typeof Map?new Map:void 0;return u=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return c(t,arguments,f(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,t)},u(t)}function c(t,e,r){return c=l()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&h(o,r.prototype),o},c.apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function h(t,e){return h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},h(t,e)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}const p=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(p,t);var e,r,n,o,u,c=(e=p,r=l(),function(){var t,n=f(e);if(r){var o=f(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return s(this,t)});function p(t){var e;a(this,p);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(e=c.call.apply(c,[this].concat(n))).name=t,e}return n=p,o&&i(n.prototype,o),u&&i(n,u),Object.defineProperty(n,"prototype",{writable:!1}),n}(u(Error));function d(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var m=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,n;return e=t,n=[{key:"append",value:function(e){for(var r="",n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];o.forEach((function(t){r+=t+","})),t.Content+=+new Date+","+e+","+r+"\n"}},{key:"info",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.append.apply(t,["info"].concat(r))}},{key:"warn",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.append.apply(t,["warn"].concat(r))}},{key:"error",value:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.append.apply(t,["error"].concat(r))}}],(r=null)&&d(e.prototype,r),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();m.Content="";const v=m;function g(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return _(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function D(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function y(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){D(i,n,o,a,s,"next",t)}function s(t){D(i,n,o,a,s,"throw",t)}a(void 0)}))}}function w(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(t,e,r){return e&&w(t.prototype,e),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&F(t,e)}function F(t,e){return F=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},F(t,e)}function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=x(t);if(e){var o=x(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return A(this,r)}}function A(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}var S=6,O=8,T=10,P=2,R=3,B=4,j=1033;function I(t){return{bLength:t.getUint8(0),bDescriptorType:t.getUint8(1),bInterfaceNumber:t.getUint8(2),bAlternateSetting:t.getUint8(3),bNumEndpoints:t.getUint8(4),bInterfaceClass:t.getUint8(5),bInterfaceSubClass:t.getUint8(6),bInterfaceProtocol:t.getUint8(7),iInterface:t.getUint8(8),endpoints:[]}}function L(t){var e=function(t){for(var e,r=t,n=[];r.byteLength>2;){var o=r.getUint8(0),i=r.getUint8(1),a=new DataView(r.buffer.slice(0,o));if(i==B)e=I(a),n.push(e);else{var s={bLength:o,bDescriptorType:i,data:a};e?e.endpoints.push(s):n.push(s)}r=new DataView(r.buffer.slice(o))}return n}(new DataView(t.buffer.slice(9)));return{bLength:t.getUint8(0),bDescriptorType:t.getUint8(1),wTotalLength:t.getUint16(2,!0),bNumInterfaces:t.getUint8(4),bConfigurationValue:t.getUint8(5),iConfiguration:t.getUint8(6),bmAttributes:t.getUint8(7),bMaxPower:t.getUint8(8),interfaces:e}}function N(t){return v.info("DFU","getConfiguration"),new Promise((function(e,r){t.device.controlTransferIn({requestType:"standard",recipient:"device",request:O,value:0,index:0},1).then((function(t){"ok"==t.status?e(t.data.getInt8(0)):r(new Error("Wrong getConfiguration status: "+t.status))})).catch((function(t){r(new Error("Get configuration failed --\x3e "+t))}))}))}function M(t){return v.info("DFU","getInterface"),new Promise((function(e,r){t.device.controlTransferIn({requestType:"standard",recipient:"interface",request:T,value:0,index:t.settings.interface.interfaceNumber},1).then((function(t){"ok"==t.status?e(t.data.getInt8(0)):r(new Error("Wrong getInterface status: "+t.status))})).catch((function(t){r(new Error("Get interface failed --\x3e "+t))}))}))}function U(t,e){return v.info("DFU","getConfigurationDescriptor","index "+e),new Promise((function(r,n){t.device.controlTransferIn({requestType:"standard",recipient:"device",request:S,value:e|P<<8,index:0},4).then((function(o){if("ok"==o.status){var i=o.data.getUint16(2,!0);t.device.controlTransferIn({requestType:"standard",recipient:"device",request:S,value:e|P<<8,index:0},i).then((function(t){"ok"==t.status?r(L(t.data)):n(new Error("Wrong getConfigurationDescriptor status: "+t.status))})).catch((function(t){n(t)}))}else n(new Error("Wrong getConfigurationDescriptor status: "+o.status))})).catch((function(t){n(new Error("Get configuration descriptor failed --\x3e "+t))}))}))}function H(t,e){return v.info("DFU","getStringDescriptor","index "+e),new Promise((function(r,n){t.device.controlTransferIn({requestType:"standard",recipient:"device",request:S,value:e|R<<8,index:j},255).then((function(t){"ok"==t.status?(t.data.getInt8(1)!=R&&n(new Error("Wrong descriptor type: "+t.data.getInt8(1))),r(new TextDecoder("utf-16").decode(new Uint16Array(t.data.buffer,2)))):n(new Error("Wrong getStringDescriptor status: "+t.status))})).catch((function(t){n(new Error("Get string descriptor failed --\x3e "+t))}))}))}var z={Offset:0,Size:11,Signature:{Offset:0,Size:5}},V={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}}},G=1,$=2,q=3,W=4,Y=5,K=6,X=0,Z=2,Q=4,J=5,tt=7,et=10,rt=33,nt=65,ot=function(t){C(r,t);var e=k(r);function r(){E(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"DFUError"].concat(n))}return b(r)}(p),it=function(t){C(r,t);var e=k(r);function r(){E(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"DFUInterfaceError"].concat(n))}return b(r)}(p);function at(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return v.info("DFU","requestIn","bRequest: "+e,"data: "+r,"wValue: "+n),new Promise((function(o,i){t.device.controlTransferIn({requestType:"class",recipient:"interface",request:e,value:n,index:t.settings.interface.interfaceNumber},r).then((function(t){"ok"==t.status?o(t.data):i(new Error("Wrong requestIn status: "+t.status))})).catch((function(t){i(new Error("ControlTransferIn failed --\x3e "+t))}))}))}function st(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return v.info("DFU","requestOut","bRequest: "+e,"data: "+r,"wValue: "+n),new Promise((function(o,i){t.device.controlTransferOut({requestType:"class",recipient:"interface",request:e,value:n,index:t.settings.interface.interfaceNumber},r).then((function(t){"ok"==t.status?o(t.bytesWritten):i(new Error("Wrong requestOut status: "+t.status))})).catch((function(t){i(new Error("ControlTransferOut failed --\x3e "+t))}))}))}function ut(t){return v.info("DFU","getState"),new Promise((function(e,r){at(t,Y,1).then((function(t){e(t.getUint8(0))})).catch((function(t){r(new Error("Get state failed --\x3e "+t))}))}))}function ct(t){return v.info("DFU","getStatus"),new Promise((function(e,r){at(t,q,6).then((function(t){e({status:t.getUint8(0),pollTimeout:16777215&t.getUint32(1,!0),state:t.getUint8(4)})})).catch((function(t){r(new Error("Get status failed --\x3e "+t))}))}))}function lt(t){return ht.apply(this,arguments)}function ht(){return ht=y(e().mark((function t(r){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","abortToIdle"),t.prev=1,t.next=4,st(r,K);case 4:return t.next=6,ut(r);case 6:if((n=t.sent)!=et){t.next=13;break}return t.next=10,st(r,W);case 10:return t.next=12,ut(r);case 12:n=t.sent;case 13:if(n==Z){t.next=15;break}throw new Error("State is "+n.state+"instead of DFU IDLE (2).");case 15:t.next=20;break;case 17:throw t.prev=17,t.t0=t.catch(1),new Error("Abort to idle failed --\x3e "+t.t0);case 20:case"end":return t.stop()}}),t,null,[[1,17]])}))),ht.apply(this,arguments)}function ft(t,e){return pt.apply(this,arguments)}function pt(){return pt=y(e().mark((function t(r,n){var o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=function(t){return new Promise((function(e,r){setTimeout(e,t)}))},v.info("DFU","pollUntil",n),t.prev=2,t.next=5,ct(r);case 5:i=t.sent;case 6:if(n(i.state)||i.state==et){t.next=14;break}return t.next=9,o(i.pollTimeout);case 9:return t.next=11,ct(r);case 11:i=t.sent,t.next=6;break;case 14:return t.abrupt("return",i);case 17:throw t.prev=17,t.t0=t.catch(2),new Error("Poll until failed --\x3e "+t.t0);case 20:case"end":return t.stop()}}),t,null,[[2,17]])}))),pt.apply(this,arguments)}function dt(t,e){return mt.apply(this,arguments)}function mt(){return mt=y(e().mark((function t(r,n){var o,i,a;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","setAddress",Number(n).toString(16)),o=new ArrayBuffer(5),(i=new DataView(o)).setUint8(0,rt),i.setUint32(1,n,!0),t.prev=5,t.next=8,st(r,G,o,0);case 8:return t.next=10,ft(r,(function(t){return t!=Q}));case 10:if((a=t.sent).status==X){t.next=13;break}throw"Status is "+a.status+" instead of Status OK (0).";case 13:t.next=18;break;case 15:throw t.prev=15,t.t0=t.catch(5),"Set address to "+n+" failed --\x3e "+t.t0;case 18:case"end":return t.stop()}}),t,null,[[5,15]])}))),mt.apply(this,arguments)}const vt=function(){function t(r,n){E(this,t),this.open=y(e().mark((function t(){var r,n,o;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","open"),t.prev=1,t.next=4,this.device.open();case 4:t.next=9;break;case 6:throw t.prev=6,t.t0=t.catch(1),new ot("OPEN failed --\x3e "+t.t0);case 9:if(r=this.settings.configuration.configurationValue,null!=this.device.configuration&&this.device.configuration.configurationValue==r){t.next=19;break}return t.prev=11,t.next=14,this.device.selectConfiguration(r);case 14:t.next=19;break;case 16:throw t.prev=16,t.t1=t.catch(11),new ot("OPEN failed: could not select configuration --\x3e "+t.t1);case 19:if(n=this.settings.interface.interfaceNumber,this.device.configuration.interfaces[n].claimed){t.next=29;break}return t.prev=21,t.next=24,this.device.claimInterface(n);case 24:t.next=29;break;case 26:throw t.prev=26,t.t2=t.catch(21),new it("OPEN failed: could not claim interface --\x3e "+t.t2);case 29:if(o=this.settings.alternate.alternateSetting,null!=this.device.configuration.interfaces[n].alternate&&this.device.configuration.interfaces[n].alternate==o){t.next=39;break}return t.prev=31,t.next=34,this.device.selectAlternateInterface(n,o);case 34:t.next=39;break;case 36:throw t.prev=36,t.t3=t.catch(31),new ot("OPEN failed: could not select alternate interface --\x3e "+t.t3);case 39:case"end":return t.stop()}}),t,this,[[1,6],[11,16],[21,26],[31,36]])}))),this.close=y(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","close"),t.prev=1,t.next=4,this.device.close();case 4:t.next=9;break;case 6:throw t.prev=6,t.t0=t.catch(1),new ot("CLOSE failed --\x3e "+t.t0);case 9:case"end":return t.stop()}}),t,this,[[1,6]])}))),this.getMemoryLayout=y(e().mark((function t(){var r,n=this;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","getMemoryLayout"),t.prev=1,t.delegateYield(e().mark((function t(){var r,o,i,a,s,u,c,l,h;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,N(n);case 2:return r=t.sent,t.next=5,U(n,r-1);case 5:return o=t.sent,t.next=8,M(n);case 8:return i=t.sent,a=o.interfaces[i].iInterface,t.next=12,H(n,a);case 12:for(s=t.sent,u=s.split("/"),c=[],l=function(t){var e=parseInt(u[t]),r=u[t+1].split(","),n=/(\d+)\*(\d+)([K|M])g/;r.forEach((function(t){var r=t.match(n),o=parseInt(r[1]),i=parseInt(r[2]),a=r[3];"K"==a?i*=1024:"M"==a&&(i*=1048576);var s=o*i,u={address:e,lastAddress:e+s-1,size:s,nbPage:o,pageSize:i};c.push(u),e+=s}))},h=1;h<u.length;h+=2)l(h);return t.abrupt("return",{v:c});case 18:case"end":return t.stop()}}),t)}))(),"t0",3);case 3:if("object"!=typeof(r=t.t0)){t.next=6;break}return t.abrupt("return",r.v);case 6:t.next=11;break;case 8:throw t.prev=8,t.t1=t.catch(1),new ot("GET MEMORY LAYOUT failed --\x3e "+t.t1);case 11:case"end":return t.stop()}}),t,null,[[1,8]])}))),this.upload=function(){var t=y(e().mark((function t(r,n,o){var i,a,s,u,c,l;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","upload","address "+Number(r).toString(16),"Length "+Number(n).toString(16)),t.prev=1,t.next=4,ut(this);case 4:if(t.sent==Z){t.next=8;break}return t.next=8,lt(this);case 8:return t.next=10,dt(this,r);case 10:return t.next=12,lt(this);case 12:i=2,a=new Uint8Array(n),s=0,o&&o(0);case 16:return c=Math.min(this.TransferSize,n-s),v.info("DFU","upload","block number "+i,"bytes to read "+c),t.next=20,at(this,$,c,i++);case 20:(u=t.sent).byteLength>0&&(l=new Uint8Array(u.buffer),a.set(l,s),s+=u.byteLength),o&&o(s/n);case 23:if(s<n){t.next=16;break}case 24:return t.next=26,lt(this);case 26:return t.abrupt("return",a);case 29:return t.prev=29,t.t0=t.catch(1),t.next=33,lt(this);case 33:throw new ot("UPLOAD failed at address "+r+" of length "+n+" --\x3e "+t.t0);case 34:case"end":return t.stop()}}),t,this,[[1,29]])})));return function(e,r,n){return t.apply(this,arguments)}}(),this.download=function(){var t=y(e().mark((function t(r,n,o){var i,a,s,u,c,l,h;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:v.info("DFU","download","address "+Number(r).toString(16)),t.prev=1,i=0,a=n.byteLength,s=r,o&&o(0);case 6:if(!(i<a)){t.next=27;break}return u=a-i,c=Math.min(u,this.TransferSize),v.info("DFU","download step, at address "+Number(r).toString(16)),l=0,h=void 0,t.next=14,dt(this,s);case 14:return t.next=16,st(this,G,n.slice(i,i+c),2);case 16:return l=t.sent,t.next=19,ft(this,(function(t){return t==J||t==Z}));case 19:if(h=t.sent,s+=c,h.status==X){t.next=23;break}throw"state=".concat(h.state,", status=").concat(h.status);case 23:i+=l,o&&o(i/a),t.next=6;break;case 27:t.next=32;break;case 29:throw t.prev=29,t.t0=t.catch(1),new ot("DOWNLOAD failed at address "+Number(r).toString(16)+" --\x3e "+t.t0);case 32:case"end":return t.stop()}}),t,this,[[1,29]])})));return function(e,r,n){return t.apply(this,arguments)}}(),this.leave=function(){var t=y(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","leave","address "+Number(r).toString(16)),t.prev=1,t.next=4,dt(this,r);case 4:return t.next=6,st(this,G,new ArrayBuffer,2);case 6:return t.next=8,ft(this,(function(t){return t==tt}));case 8:t.next=13;break;case 10:throw t.prev=10,t.t0=t.catch(1),new ot("LEAVE failed at address "+Number(r).toString(16)+" --\x3e "+t.t0);case 13:case"end":return t.stop()}}),t,this,[[1,10]])})));return function(e){return t.apply(this,arguments)}}(),this.eraseSegment=function(){var t=y(e().mark((function t(r){var n,o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("DFU","eraseSegment","address "+Number(r).toString(16)),t.prev=1,t.next=4,ut(this);case 4:if(t.sent==Z){t.next=8;break}return t.next=8,lt(this);case 8:return n=new ArrayBuffer(5),(o=new DataView(n)).setUint8(0,nt),o.setUint32(1,r,!0),t.next=14,st(this,G,n,0);case 14:return t.next=16,ct(this);case 16:if((i=t.sent).state==Q){t.next=19;break}throw"wrong DFU state: "+i.state;case 19:return t.next=21,ft(this,(function(t){return t!=Q}));case 21:if((i=t.sent).status==X){t.next=24;break}throw"wrong DFU status: "+i.status;case 24:t.next=29;break;case 26:throw t.prev=26,t.t0=t.catch(1),new ot("ERASE SEGMENT failed at address "+r+" --\x3e "+t.t0);case 29:case"end":return t.stop()}}),t,this,[[1,26]])})));return function(e){return t.apply(this,arguments)}}(),this.TransferSize=n,this.device=r;var o,i=g(r.configurations);try{for(i.s();!(o=i.n()).done;){var a,s=o.value,u=g(s.interfaces);try{for(u.s();!(a=u.n()).done;){var c,l=a.value,h=g(l.alternates);try{for(h.s();!(c=h.n()).done;){var f=c.value;if(254==f.interfaceClass&&1==f.interfaceSubclass&&(1==f.interfaceProtocol||2==f.interfaceProtocol))return this.settings={configuration:s,interface:l,alternate:f},this}}catch(t){h.e(t)}finally{h.f()}}}catch(t){u.e(t)}finally{u.f()}}}catch(t){i.e(t)}finally{i.f()}return this.settings={configuration:{configurationValue:1},interface:{interfaceNumber:0},alternate:{alternateSetting:0}},this}return b(t,null,[{key:"Parse",value:function(t){new DataView(t);var e=new TextDecoder("utf-8").decode(new Uint8Array(t.slice(z.Signature.Offset,z.Signature.Offset+z.Signature.Size)));if("DfuSe"!=e)throw new ot("Parsed file is not a DFU file (invalid signature)");var r=t.slice(V.Offset);if("Target"!=(e=new TextDecoder("utf-8").decode(new Uint8Array(r.slice(V.TargetPrefix.Signature.Offset,V.TargetPrefix.Signature.Size)))))throw new ot("Corrupted DFU file (invalid target signature)");for(var n=[],o=new DataView(r,V.TargetPrefix.NbElements.Offset,V.TargetPrefix.NbElements.Offset+V.TargetPrefix.NbElements.Size).getUint32(0,!0),i=r.slice(V.Element.Offset),a=0;a<o;a++){var s=new DataView(i,V.Element.Address.Offset,V.Element.Address.Offset+V.Element.Address.Size).getUint32(0,!0),u=new DataView(i,V.Element.Size.Offset,V.Element.Address.Offset+V.Element.Size.Size).getUint32(0,!0),c=i.slice(V.Element.Data.Offset,V.Element.Data.Offset+u);i=i.slice(V.Element.Data.Offset+u),n.push({address:s,size:u,data:c})}return n}}]),t}();function gt(t){return new TextDecoder("utf-8").decode(t.subarray(0,t.indexOf(0)))}function _t(t){var e=new TextEncoder("utf-8").encode(t),r=new Uint8Array(e.length+1);return r.set(e,0),r.set([0],e.length),r}function Dt(t){for(var e=new Uint8Array(t.length/2),r=0;r<e.length;r++)e[r]=parseInt(t.substr(2*r,2),16);return e}function yt(t){for(var e=atob(t),r="",n=0;n<e.length;n++){var o=e.charCodeAt(n).toString(16);r+=2===o.length?o:"0"+o}return r.toUpperCase()}function wt(t){return btoa(t.match(/\w{2}/g).map((function(t){return String.fromCharCode(parseInt(t,16))})).join(""))}function bt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Et(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Et(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ct(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ft(t,e,r){return e&&Ct(t.prototype,e),r&&Ct(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function kt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function At(t,e){return At=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},At(t,e)}function xt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ot(t);if(e){var o=Ot(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return St(this,r)}}function St(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ot(t){return Ot=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ot(t)}var Tt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&At(t,e)}(r,t);var e=xt(r);function r(){kt(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"StorageError"].concat(n))}return Ft(r)}(p);function Pt(t){return new DataView(t.buffer,t.byteOffset).getUint16(0,!0)}function Rt(t){var e={size:0,name:"unknown",content:"unknown"};return e.size=Pt(t),e.name=gt(t.subarray(2)),e.content=t.subarray(2+e.name.length+1,e.size),e}var Bt=function(t){function e(t){kt(this,e),this.records=t}return Ft(e,[{key:Symbol.iterator,value:function(){var t=this.records;return{next:function(){var e=Pt(t);if(0===e)return{done:!0};var r=Rt(t);return t=t.subarray(e),{value:r,done:!1}}}}}]),e}();const jt=Ft((function t(e){kt(this,t),this.availableSize=function(){var t,e=0,r=bt(new Bt(this.data));try{for(r.s();!(t=r.n()).done;){e+=t.value.size}}catch(t){r.e(t)}finally{r.f()}return this.totalSize()-e},this.totalSize=function(){return this.data.byteLength-2},this.recordsWithExtension=function(t){var e,r=[],n=bt(new Bt(this.data));try{for(n.s();!(e=n.n()).done;){var o=e.value;o.name.endsWith(t)&&r.push(o.name)}}catch(t){n.e(t)}finally{n.f()}return r},this.size=function(t){var e,r=bt(new Bt(this.data));try{for(r.s();!(e=r.n()).done;){var n=e.value;if(n.name===t)return n.size}}catch(t){r.e(t)}finally{r.f()}},this.content=function(t){var e,r=bt(new Bt(this.data));try{for(r.s();!(e=r.n()).done;){var n=e.value;if(n.name===t)return n.content}}catch(t){r.e(t)}finally{r.f()}},this.setContent=function(t,e){var r,n=0,o=0,i=bt(new Bt(this.data));try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.name===t){o=a.size;break}n+=a.size}}catch(t){i.e(t)}finally{i.f()}var s=this.data.slice(n+o),u=n,c=function(t,e){if(void 0!==e){var r=t.length+1+e.byteLength+2,n=new Uint8Array(r);return new DataView(n.buffer,n.byteOffset).setUint16(0,r,!0),n.set(_t(t),2),n.set(e,2+t.length+1),n}}(t,e);if(void 0!==c){if(Rt(c).size>this.availableSize()+o)throw new Tt("The storage on calculator is full");this.data.set(c,n),u+=c.length,s=s.slice(0,this.data.length-(n+c.length))}this.data.set(s,u),this.data.fill(0,u+s.length)},this.data=e}));function It(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Lt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Nt(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function Mt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Nt(i,n,o,a,s,"next",t)}function s(t){Nt(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Ut(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ht(t,e,r){return e&&Ut(t.prototype,e),r&&Ut(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function zt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gt(t,e)}function Gt(t,e){return Gt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Gt(t,e)}function $t(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Wt(t);if(e){var o=Wt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qt(this,r)}}function qt(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Wt(t){return Wt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Wt(t)}var Yt=r(3786),Kt=2048,Xt=Dt("F00DC0DE"),Zt=Dt("FEEDC0DE"),Qt=Dt("BADBEEEF"),Jt=function(t){Vt(r,t);var e=$t(r);function r(){zt(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"CalculatorMemoryCorruption"].concat(n))}return Ht(r)}(p),te=function(t){Vt(r,t);var e=$t(r);function r(){zt(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"BusyCalculatorError"].concat(n))}return Ht(r)}(p),ee=function(t){Vt(r,t);var e=$t(r);function r(){zt(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"WebUSBError"].concat(n))}return Ht(r)}(p),re=function(t){Vt(r,t);var e=$t(r);function r(){zt(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"USBConnectionError"].concat(n))}return Ht(r)}(p),ne=function(t){Vt(r,t);var e=$t(r);function r(){zt(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"ForbiddenMemoryAccessError"].concat(n))}return Ht(r)}(p),oe=function(t){Vt(r,t);var e=$t(r);function r(){zt(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"DeviceDetectionError"].concat(n))}return Ht(r)}(p),ie=function(t){Vt(r,t);var e=$t(r);function r(t){var n;zt(this,r);for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return(n=e.call.apply(e,[this,"BulkError"].concat(i))).errors=t,n}return Ht(r)}(p),ae={N0100:{name:"N0100",ElectronicSignatureAddress:536836624,RAMAddressStart:536870912,RAMAddressEnd:537133056},N0110:{name:"N0110",ElectronicSignatureAddress:535853584,RAMAddressStart:536870912,RAMAddressEnd:537133056},N0120:{name:"N0120",ElectronicSignatureAddress:535947264,RAMAddressStart:603979776,RAMAddressEnd:604307456},N0120Prototype:{displayed_name:"N0120",ElectronicSignatureAddress:535947264,name:"N0120_PORTUGAL_PROTOTYPE_20210930",RAMAddressStart:603979776,RAMAddressEnd:604307456}},se=Dt("BADD0BEE");function ue(t){for(var e="",r=0;r<t.byteLength;r++)e+=t[r].toString(16).padStart(2,"0").toUpperCase();return e}function ce(t,e){if(t.length<e.length)return!1;for(var r=0;r<e.length;r++)if(t[r]!==e[r])return!1;return!0}function le(t,e){return!(t.length<e.length)&&ce(t.subarray(t.length-e.length),e)}function he(t,e){if(!(t>=134217728&&t+e<=135266304||t>=2415919104&&t+e<=2424307712))throw new ne("Access to address: "+t+" (length "+e+") is out of flash range")}function fe(t,e,r){if(e<t.RAMAddressStart||e+r>=t.RAMAddressEnd)throw new ne("Access to address: "+e+" (length "+r+") is out of RAM range")}function pe(t){if(v.info("Calculator","parseSlotInfo","header info "+t),!ce(t,Qt)||!le(t,Qt))return null;var e=new DataView(t.buffer,t.byteOffset);return{kernelHeaderAddress:e.getUint32(4,!0),userlandHeaderAddress:e.getUint32(8,!0)}}function de(t,e){if(v.info("Calculator","parseFirmwareHeader","header "+t),!ce(t,Xt))return e;e.version=gt(t.subarray(4)),e.patch=gt(t.subarray(12));var r=t.subarray(20);if(ce(r,Xt))return e;var n=new DataView(t.buffer,t.byteOffset);return e.storageAddress=n.getUint32(20,!0),ce(r=t.subarray(24),Xt)||(e.storageSize=n.getUint32(24,!0)),e}function me(t,e){if(v.info("Calculator","parseUserlandHeader","header "+t),!ce(t,Zt))return e;e.userlandVersion=gt(t.subarray(4));var r=new DataView(t.buffer,t.byteOffset),n=12;return e.storageAddress=r.getUint32(n,!0),n+=4,e.storageSize=r.getUint32(n,!0),n+=4,e.externalAppsFlashStart=r.getUint32(n,!0),n+=4,e.externalAppsFlashEnd=r.getUint32(n,!0),n+=4,e.externalAppsRamStart=r.getUint32(n,!0),n+=4,e.externalAppsRamEnd=r.getUint32(n,!0),e}function ve(){return(ve=Mt(e().mark((function t(r,n,o){var i,a,s,u,c,l,h,f;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v.info("Calculator","uploadHeader","address "+Number(n[0].address).toString(16)),i={version:"0.0.0",patch:"0000000",userlandVersion:"unknown",externalAppsFlashStart:"unknown",externalAppsFlashEnd:"unknown",externalAppsRamStart:"unknown",externalAppsRamEnd:"unknown",storageAddress:"unknown",storageSize:4096},t.prev=2,a=n[0].address+Ee.Header0.Offset,s=Ee.Header0.Size,he(a,s),t.next=8,r.upload(a,s);case 8:if(!ce(u=t.sent,Xt)||!le(u,Xt)){t.next=13;break}return t.abrupt("return",de(u,i));case 13:return a=n[0].address+Ee.Header1.Offset,s=Ee.Header1.Size,he(a,s),t.next=18,r.upload(a,s);case 18:if(!ce(u=t.sent,Xt)||!le(u,Xt)){t.next=23;break}return t.abrupt("return",de(u,i));case 23:return a=o.RAMAddressStart,s=Ee.Header2.SlotInfoSize,fe(o,a,s),t.prev=26,t.next=29,r.upload(a,s);case 29:if(c=t.sent,null!=(l=pe(c))){t.next=33;break}throw new Jt("The slot info was corrupted");case 33:return a=l.kernelHeaderAddress,s=Ee.Header2.KernelHeaderSize,he(a,s),t.next=38,r.upload(a,s);case 38:return h=t.sent,i=de(h,i),a=l.userlandHeaderAddress,s=Ee.Header2.UserlandHeaderSize,he(a,s),t.next=45,r.upload(a,s);case 45:return f=t.sent,i=me(f,i),t.abrupt("return",i);case 50:return t.prev=50,t.t0=t.catch(26),t.abrupt("return",de(u,i));case 53:t.next=59;break;case 55:throw t.prev=55,t.t1=t.catch(2),t.t1.message="Upload header failed --\x3e "+t.t1.message,t.t1;case 59:case"end":return t.stop()}}),t,null,[[2,55],[26,50]])})))).apply(this,arguments)}function ge(){return ge=Mt(e().mark((function t(r,n){var o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(16!=(o=r.device.serialNumber).length){t.next=3;break}return t.abrupt("return",o);case 3:return t.next=5,r.upload(n.ElectronicSignatureAddress-1,13);case 5:return i=t.sent,t.abrupt("return",wt(ue(i.subarray(1,13))));case 7:case"end":return t.stop()}}),t)}))),ge.apply(this,arguments)}function _e(t,e){return De.apply(this,arguments)}function De(){return De=Mt(e().mark((function t(r,n){var o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(v.info("Calculator","calculatorGetStorage","address "+Number(n.firmware.storageAddress).toString(16)),"unknown"!==n.firmware.storageAddress){t.next=3;break}throw new Jt("The Storage address could not be found in header");case 3:t.prev=3,fe(n.model,n.firmware.storageAddress,n.firmware.storageSize+2*se.length),t.next=10;break;case 7:throw t.prev=7,t.t0=t.catch(3),new Jt("Calculator Get Storage failed --\x3e "+t.t0);case 10:if(!1===r.storage){t.next=12;break}return t.abrupt("return",r.storage);case 12:return t.prev=12,t.next=15,r.dfu.upload(n.firmware.storageAddress,n.firmware.storageSize+2*se.length);case 15:if(!ce(o=t.sent,se)||!le(o,se)){t.next=22;break}return i=o.subarray(se.length,n.firmware.storageSize+se.length),r.storage=new jt(i),t.abrupt("return",r.storage);case 22:throw new Jt("Memory is corrupted: could not find storage tags");case 23:t.next=29;break;case 25:throw t.prev=25,t.t1=t.catch(12),t.t1.message="CalculationGetStorage failed --\x3e "+t.t1.message,t.t1;case 29:case"end":return t.stop()}}),t,null,[[3,7],[12,25]])}))),De.apply(this,arguments)}function ye(t,e,r){return we.apply(this,arguments)}function we(){return we=Mt(e().mark((function t(r,n,o){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:v.info("Calculator","calculatorSetStorage","address "+Number(n.firmware.storageAddress).toString(16)),t.prev=1,fe(n.model,n.firmware.storageAddress+se.length,o.data),t.next=8;break;case 5:throw t.prev=5,t.t0=t.catch(1),new Jt("Calculator Set Storage failed --\x3e "+t.t0);case 8:return t.prev=8,t.next=11,r.dfu.download(n.firmware.storageAddress+se.length,o.data);case 11:t.next=17;break;case 13:throw t.prev=13,t.t1=t.catch(8),t.t1.message="CalculationSetStorage failed --\x3e "+t.t1.message,t.t1;case 17:case"end":return t.stop()}}),t,null,[[1,5],[8,13]])}))),we.apply(this,arguments)}function be(t){var e=_t(t),r=new Uint8Array(e.length+1);return r[0]=1,r.set(e,1),r}var Ee=function(){function t(e,r){zt(this,t),this.dfu=new vt(e,r),this.running=!1,this.storage=!1,this.infos=!1}return Ht(t,[{key:"process",value:function(t){var e,r=this;return v.info("Calculator","process"),new Yt((function(n,o){if(r.running)return o(new te("Calculator is already processing another request"));r.running=!0,r.dfu.open().then((function(){return t(r)})).then((function(t){if(e=t,r.dfu.device.opened)return r.dfu.close()})).then((function(){return r.running=!1,n(e)})).catch((function(t){return r.running=!1,o(t)}))}))}},{key:"reconnectAndProcess",value:function(e,r){var n=this;return new Yt((function(o,i){return v.info("Calculator","reconnect"),null==navigator.usb?i(new ee("Web usb unvailable")):t.StallUntilConnect(n.dfu.device.serialNumber,e).then((function(t){return t.process(r)})).then((function(t){o(t)})).catch((function(t){i(t)}))}))}},{key:"extractInfos",value:function(){var t=this;return v.info("Calculator","extractInfos"),new Yt((function(e,r){var n,o,i;return!1!==t.infos?e(t):t.dfu.getMemoryLayout().then((function(e){return n=e,o=function(t,e){if("NumWorks Calculator"==t.productName&&2==t.deviceVersionMinor)return"EAAbABVROTUxNDM4"==t.serialNumber?ae.N0120Prototype:ae.N0120;var r=e[e.length-1].lastAddress;return r>135135232&&r<2415919104?ae.N0100:ae.N0110}(t.dfu.device,n),function(t,e,r){return ve.apply(this,arguments)}(t.dfu,n,o)})).then((function(e){return i=e,function(t,e){return ge.apply(this,arguments)}(t.dfu,o)})).then((function(r){return t.infos={serialNumber:yt(r),displayedSerialNumber:r,model:o,memoryLayout:n,firmware:i},e(t)})).catch((function(t){t.message="extractInfos failed --\x3e "+t.message,r(t)}))}))}},{key:"uploadFlash",value:function(t,e,r){var n=this;return v.info("Calculator","uploadFlash","address "+Number(t).toString(16),"length "+Number(e).toString(16)),new Yt((function(o,i){try{he(t,e)}catch(t){t.message="uploadFlash failed --\x3e "+t.message,i(t)}n.dfu.upload(t,e,r).then((function(t){o(t)})).catch((function(t){t.message="uploadFlash failed --\x3e "+t.message,i(t)}))}))}},{key:"downloadFlash",value:function(t,r,n,o,i){var a=this;return v.info("Calculator","downloadFlash","address "+Number(t).toString(16)),new Yt((function(s,u){var c=function(){var t=Mt(e().mark((function t(r,n,o,i,a){var s,u,c,l,h,f,p,d,m,v,g,_,D;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s=0,u=0,c=-1,l=-1,h=-1,f=-1,p=0;case 7:if(!(p<n.length)){t.next=33;break}if(!(c<0)){t.next=14;break}if(!(o>n[p].lastAddress)){t.next=13;break}return t.abrupt("continue",30);case 13:c=p;case 14:d=0;case 15:if(!(d<n[p].nbPage)){t.next=30;break}if(!(l<0)){t.next=22;break}if(o!=n[p].address+d*n[p].pageSize){t.next=21;break}l=d,t.next=22;break;case 21:return t.abrupt("continue",27);case 22:if(!((s+=n[p].pageSize)>=i.byteLength)){t.next=27;break}return h=p,f=d,t.abrupt("break",33);case 27:d++,t.next=15;break;case 30:p++,t.next=7;break;case 33:m=c;case 34:if(!(m<=h)){t.next=51;break}v=m==c?l:0,g=m==h?f+1:n[m].nbPage,_=v;case 38:if(!(_<g)){t.next=48;break}return D=n[m].address+_*n[m].pageSize,t.next=42,r.eraseSegment(D);case 42:u+=n[m].pageSize,a(u/s),D+=n[m].pageSize;case 45:_++,t.next=38;break;case 48:m++,t.next=34;break;case 51:case"end":return t.stop()}}),t)})));return function(e,r,n,o,i){return t.apply(this,arguments)}}();try{he(t,r.byteLength)}catch(t){t.message="downloadFlash failed --\x3e "+t.message,u(t)}c(a.dfu,n.memoryLayout,t,r,(function(t){return o(t)})).then((function(){s(a.dfu.download(t,r,(function(t){return i(t)})))})).catch((function(t){t.message="downloadFlash failed --\x3e "+t.message,u(t)}))}))}},{key:"reset",value:function(t){var e=this;return v.info("Calculator","reset"),new Yt((function(r,n){try{he(t.memoryLayout[0].address,0)}catch(t){t.message="reset failed --\x3e "+t.message,n(t)}return e.dfu.leave(134217728).then((function(){r(!0)})).catch((function(t){t.message="reset failed --\x3e "+t.message,n(t)}))}))}},{key:"getAvailableSpaceInfo",value:function(){var t=this;return v.info("Calculator","getAvailableSpaceInfo"),new Yt((function(e,r){var n={availableSize:!1,totalSize:!1};t.extractInfos().then((function(e){return _e(t,e.infos)})).then((function(t){n.availableSize=t.availableSize(),n.totalSize=t.totalSize(),e(n)})).catch((function(t){t.message="getAvailableSpaceInfo failed --\x3e "+t.message,r(t)}))}))}},{key:"getScripts",value:function(){var t=this;return v.info("Calculator","getScripts"),new Yt((function(e,r){t.extractInfos().then((function(e){return _e(t,e.infos)})).then((function(t){return t.recordsWithExtension(".py").map((function(e,r){return{name:e,size:t.size(e),content:gt(t.content(e).subarray(1))}}))})).then((function(t){e(t)})).catch((function(t){t.message="getScripts failed --\x3e "+t.message,r(t)}))}))}},{key:"removeScripts",value:function(){var t=this;return v.info("Calculator","removeScripts"),new Yt((function(e,r){t.extractInfos().then((function(e){return _e(t,e.infos)})).then((function(e){e.recordsWithExtension(".py").map((function(t,r){e.setContent(t)}));return ye(t,t.infos,e)})).then((function(){e(!0)})).catch((function(t){t.message="removeScripts failed --\x3e "+t.message,r(t)}))}))}},{key:"getSizeForRecord",value:function(t){var e=this;return v.info("Calculator","getSizeForRecord","name "+t),new Yt((function(r,n){var o;e.extractInfos().then((function(t){return _e(e,t.infos)})).then((function(e){o=e.size(t),r(o)})).catch((function(t){t.message="getSizeForRecord failed --\x3e "+t.message,n(t)}))}))}},{key:"setContentForRecord",value:function(t,e){var r=this;return v.info("Calculator","setContentForRecord","name "+t),new Yt((function(n,o){r.extractInfos().then((function(t){return _e(r,t.infos)})).then((function(n){try{n.setContent(t,e)}catch(t){o(t)}return ye(r,r.infos,n)})).then((function(){n(!0)})).catch((function(t){t.message="setContentForRecord failed --\x3e "+t.message,o(t)}))}))}},{key:"setContentForScript",value:function(t,e){var r=this;return v.info("Calculator","setContentForScript","name "+t),new Yt((function(n,o){r.setContentForRecord(t,be(e)).then((function(){n(!0)})).catch((function(t){t.message="setContentForScript failed --\x3e "+t.message,o(t)}))}))}},{key:"setRecords",value:function(t){var e=this;return v.info("Calculator","setRecords",t),new Yt((function(r,n){e.extractInfos().then((function(t){return _e(e,t.infos)})).then((function(e){try{t.forEach((function(t,r){e.setContent(t.name,t.content)}))}catch(t){n(t)}return e})).then((function(t){return ye(e,e.infos,t)})).then((function(){r(!0)})).catch((function(t){t.message="setRecords failed --\x3e "+t.message,n(t)}))}))}},{key:"setScripts",value:function(t){var e=this;return v.info("Calculator","setScripts",t),new Yt((function(r,n){var o=[];t.forEach((function(t,e){o[e]={name:t.name,content:be(t.content)}})),e.setRecords(o).then((function(){r(!0)})).catch((function(t){t.message="setScripts failed --\x3e "+t.message,n(t)}))}))}},{key:"removeRecord",value:function(t){var e=this;return v.info("Calculator","removeRecord","name "+t),new Yt((function(r,n){e.extractInfos().then((function(t){return _e(e,t.infos)})).then((function(r){return r.setContent(t),ye(e,e.infos,r)})).then((function(){r(!0)})).catch((function(t){t.memory="removeRecord failed --\x3e "+t.message,n(t)}))}))}}],[{key:"DisplayableFirmwarePatch",value:function(t){return"badbabe"==t?"unofficial":t}},{key:"CheckFirmware",value:function(t,e){for(var r=0;r<e.byteLength;r++)if(t[r]!=e[r])throw new Jt("The uploaded firmware differs from the reference at byte "+r);return!0}},{key:"StallUntilConnect",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return v.info("Calculator","StallUntilConnect"),new Yt((function(o,i){return n>60?i(new oe("Device detection timed out")):navigator.usb.getDevices().then((function(a){var s,u=It(a);try{for(u.s();!(s=u.n()).done;){var c=s.value;if(c.serialNumber===e)return r(1),o(new t(c,Kt))}}catch(t){u.e(t)}finally{u.f()}return r((n-1)/n),setTimeout((function(){return t.StallUntilConnect(e,r,n+1).then((function(t){o(t)})).catch((function(t){i(t)}))}),1e3)})).catch((function(t){i(t)}))}))}}]),t}();Ee.Header0={Offset:428,Size:24},Ee.Header1={Offset:452,Size:32},Ee.Header2={SlotInfoSize:16,KernelHeaderSize:24,UserlandHeaderSize:40},Ee.Product={Numworks:"numworks",ST:"ST"};var Ce=function(){function t(){zt(this,t),this.calculators=[]}return Ht(t,[{key:"singleConnectAndExtractInfos",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return 1==this.calculators.length&&null!=this.calculators[0].info?this.calculators[0]:this.connectAndProcess((function(t){return t.extractInfos()}),!1,[Ee.Product.Numworks],t).then((function(t){return t[0]}))}},{key:"connectAndProcess",value:function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Ee.Product.Numworks],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];v.info("CalculatorBulk","connectAndProcess");var i=[];return new Yt((function(a,s){r.connect(n,e,o).then((function(e){return r.connected()?Yt.map(e,(function(e){return e.process(t).catch((function(t){i.push({serialNumber:e.infos.serialNumber,error:t})}))})).then((function(t){if(i.length>0){if(1==e.length)throw i[0].error;throw new ie(i)}return a(t)})):s(new re("No usb connection found"))})).catch((function(t){s(t)}))}))}},{key:"connected",value:function(){return this.calculators.length>0}},{key:"connect",value:function(e,r,n){var o=this;return new Yt((function(i,a){t.Connect(e,n).then((function(t){o.calculators=r||0==t.length?t:[t[0]],i(o.calculators)})).catch((function(t){t.memory="connect failed --\x3e "+t.message,a(t)}))}))}}],[{key:"Connect",value:function(t,e){v.info("CalculatorBulk","connect",t);var r=[],n=t.map((function(t){return t==Ee.Product.Numworks?41617:57105})),o=[];return n.forEach((function(t){return o.push({vendorId:1155,productId:t})})),new Yt((function(t,i){if(null==navigator.usb)return i(new ee("Web usb unvailable"));e?(v.info("CalculatorBulk","connect","request device"),navigator.usb.requestDevice({filters:o}).then((function(e){return r.push(new Ee(e,Kt)),t(r)})).catch((function(t){i(new re("Usb device selection failure: "+t))}))):(v.info("Calculator","connect","get device"),navigator.usb.getDevices().then((function(e){var o,i=It(e);try{for(i.s();!(o=i.n()).done;){var a=o.value;1155===a.vendorId&&n.includes(a.productId)&&r.push(new Ee(a,Kt))}}catch(t){i.e(t)}finally{i.f()}return t(r)})).catch((function(t){i(new re("Usb device failed: "+t))})))}))}}]),t}();r(382);var Fe=r(5405),ke=r(5477),Ae=r(3825),xe=r.n(Ae);function Se(t){return new Promise(((e,n)=>{let o={locateFile:function(t,e){return r(3835)},preRun:function(){o.FS.writeFile("input.dat",t.input)},onAbort:n,arguments:t.arguments.concat(["input.dat","output.dat"]),postRun:function(){e(o.FS.readFile(t.output||"output.dat"))}};xe()(o)}))}function Oe(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function Te(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Pe(t,e){return Math.round(255/((1<<e)-1)*t)}var Re=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.rgba8888Data=e}var r,n,o,i,a;return r=t,n=[{key:"toPNG",value:function(){if("function"==typeof ImageData){var e=new ImageData(new Uint8ClampedArray(this.rgba8888Data.buffer),t.Width,t.Height),r=document.createElement("canvas");return r.width=t.Width,r.height=t.Height,r.getContext("2d").putImageData(e,0,0),r.toDataURL()}console.error("ImageData is unavailable")}},{key:"toNWI",value:function(){var t=function(t){for(var e=t.length/4,r=new Uint8Array(2*e),n=0;n<e;n++){var o=t[4*n]>>3<<11|t[4*n+1]>>2<<5|t[4*n+2]>>3;r[2*n]=255&o,r[2*n+1]=o>>8&255}return r}(this.rgba8888Data),e=Fe.compressBlock(t,new Uint8Array(0),0,t.length,Fe.makeBuffer(65536)),r=new Uint8Array(e);return Fe.compressBlock(t,r,0,t.length,Fe.makeBuffer(65536)),r}},{key:"toIconO",value:(i=e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Se({arguments:["--input-target","binary","--output-target","elf32-littlearm","--rename-section",".data=.rodata.eadk_app_icon","--redefine-sym","_binary_input_dat_start=eadk_app_icon","--strip-symbol","_binary_input_dat_end","--strip-symbol","_binary_input_dat_size"],input:this.toNWI()});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})),a=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=i.apply(t,e);function a(t){Oe(o,r,n,a,s,"next",t)}function s(t){Oe(o,r,n,a,s,"throw",t)}a(void 0)}))},function(){return a.apply(this,arguments)})}],o=[{key:"fromPNG",value:function(e){var r=ke.y.sync.read(e);if(r.width!=t.Width)throw"Icon has an invalid width";if(r.height!=t.Height)throw"Icon has an invalid height";return new t(r.data)}},{key:"fromNWI",value:function(e){var r=new Uint8Array(t.Width*t.Height*2);Fe.decompressBlock(e,r,0,e.length,0);var n=function(t){for(var e=t.length/2,r=new Uint8Array(4*e),n=0;n<e;n++){var o=t[2*n+1]<<8|t[2*n],i=o>>11&31,a=o>>5&63,s=31&o;r[4*n]=Pe(i,5),r[4*n+1]=Pe(a,6),r[4*n+2]=Pe(s,5),r[4*n+3]=255}return r}(r);return new t(n)}}],n&&Te(r.prototype,n),o&&Te(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}();Re.Width=55,Re.Height=56;const Be=Re;var je=r(7481),Ie=r.n(je);function Le(t){return new Promise(((e,n)=>{let o={locateFile:function(t,e){return r(7573)},preRun:function(){for(const[e,r]of Object.entries(t.inputs))o.FS.writeFile(e,r)},printErr:function(t){o.errorLog||="",o.errorLog=o.errorLog.concat(t).concat("\n")},onAbort:n,arguments:t.arguments.concat(["--output","output.elf"]),postRun:function(){o.errorLog?n(o.errorLog):e(o.FS.readFile("output.elf"))}};Ie()(o)}))}function Ne(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function Me(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ne(i,n,o,a,s,"next",t)}function s(t){Ne(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Ue(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function He(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var ze=0;function Ve(t){return"__private_"+ze+++"_"+t}var Ge=r(7475),$e=r(8006),qe=Ve("getSectionNamed"),We=Ve("refreshSizeAndNeedOfExternalData"),Ye=Ve("externalObject"),Ke=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.defineProperty(this,Ye,{value:Je}),Object.defineProperty(this,We,{value:Qe}),Object.defineProperty(this,qe,{value:Xe}),this.nwaData=e,this.size=void 0,this.name=void 0,this.icon=void 0,this.needsExternalData=void 0}var r,n,o,i,a;return r=t,n=[{key:"loadIcon",value:function(){var t=this;return He(this,qe)[qe](".rodata.eadk_app_icon").then((function(e){return t.icon=Be.fromNWI(e).toPNG()}))}},{key:"loadName",value:function(){var t=this;return He(this,qe)[qe](".rodata.eadk_app_name").then((function(e){return t.name=gt(e)}))}},{key:"load",value:function(){this.loadIcon(),this.loadName(),He(this,We)[We]()}},{key:"setExternalData",value:function(t){this.externalData=t,He(this,We)[We]()}},{key:"flatElf",value:(a=Me(e().mark((function t(r){var n,o;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n={arguments:["--script","linker.ld","--gc-sections","--allow-multiple-definition","eadk.o","app.nwa"],inputs:{"linker.ld":Ge(r),"app.nwa":this.nwaData,"eadk.o":new Uint8Array($e.data)}},!this.externalData){t.next=7;break}return o="extra-data.o",n.arguments.push(o),t.next=6,He(this,Ye)[Ye]();case 6:n.inputs[o]=t.sent;case 7:return t.next=9,Le(n);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"flatBin",value:(i=Me(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Se,t.t1=["--output-target","binary"],t.next=4,this.flatElf(r);case 4:return t.t2=t.sent,t.t3={arguments:t.t1,input:t.t2},t.next=8,(0,t.t0)(t.t3);case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})}],n&&Ue(r.prototype,n),o&&Ue(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}();function Xe(t){return Ze.apply(this,arguments)}function Ze(){return(Ze=Me(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Se({arguments:["--output-target","binary","--only-section",r],input:this.nwaData});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function Qe(){var t=this;this.flatBin({flashStart:2415919104,flashLength:8388608,ramStart:536870912,ramLength:262144}).then((function(e){var r=e.byteLength+(Ke.AppSectorSize-e.byteLength%Ke.AppSectorSize);t.size=r,t.needsExternalData=!1})).catch((function(e){if(!e.includes("_eadk_external_data"))throw e;t.size=void 0,t.needsExternalData=!0}))}function Je(){return Se({arguments:["--input-target","binary","--output-target","elf32-littlearm","--rename-section",".data=.rodata.eadk_external_data,alloc,load,readonly","--redefine-sym","_binary_input_dat_start=_eadk_external_data_start","--redefine-sym","_binary_input_dat_end=_eadk_external_data_end","--strip-symbol","_binary_input_dat_size"],input:this.externalData})}Ke.AppSectorSize=65536;const tr=Ke;function er(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function rr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){er(i,n,o,a,s,"next",t)}function s(t){er(i,n,o,a,s,"throw",t)}a(void 0)}))}}function nr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return or(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return or(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function or(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ar(t,e,r){return e&&ir(t.prototype,e),r&&ir(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function sr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ur(t,e){return ur=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ur(t,e)}function cr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=hr(t);if(e){var o=hr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return lr(this,r)}}function lr(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function hr(t){return hr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},hr(t)}var fr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ur(t,e)}(r,t);var e=cr(r);function r(){sr(this,r);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e.call.apply(e,[this,"CalculatorMemoryOverflow"].concat(n))}return ar(r)}(p),pr=function(){function t(){sr(this,t),this.apps=[]}var r,n;return ar(t,[{key:"push",value:function(t){this.apps.push(t)}},{key:"isReadyToUpload",value:function(){var t,e=nr(this.apps);try{for(e.s();!(t=e.n()).done;){if(t.value.needsExternalData)return!1}}catch(t){e.e(t)}finally{e.f()}return this.apps.length>0}},{key:"upload",value:(n=rr(e().mark((function t(r,n){var o,i,a;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=r.infos.firmware,i={flashStart:o.externalAppsFlashStart,flashLength:o.externalAppsFlashEnd-o.externalAppsFlashStart,ramStart:o.externalAppsRamStart,ramLength:o.externalAppsRamEnd-o.externalAppsRamStart},t.next=4,this.flatBin(i);case 4:a=t.sent,r.process((function(t){return t.downloadFlash(i.flashStart,a,r.infos,(function(t){n(.2*t)}),(function(t){n(.2+.8*t)})).then((function(){return r.dfu.leave(i.flashStart)}))}));case 7:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"concatenateU8A",value:function(t,e){var r=new Uint8Array(t.byteLength+e.byteLength);return r.set(t,0),r.set(e,t.byteLength),r}},{key:"flatBin",value:(r=rr(e().mark((function t(r){var n,o,i,a,s,u,c,l,h,f,p;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=new Uint8Array(0),o=r.flashStart+r.flashLength,i=r.flashStart,a=nr(this.apps),t.prev=4,a.s();case 6:if((s=a.n()).done){t.next=19;break}if(u=s.value,!(i>=o)){t.next=10;break}throw new fr("External app sector would be overflown");case 10:return t.next=12,u.flatBin({flashStart:i,flashLength:o-i,ramStart:r.ramStart,ramLength:r.ramLength});case 12:c=t.sent,n=this.concatenateU8A(n,c),i+=c.byteLength,(l=c.byteLength%tr.AppSectorSize)>0&&(h=tr.AppSectorSize-l,(f=new Uint8Array(h)).fill(255),n=this.concatenateU8A(n,f),i+=h);case 17:t.next=6;break;case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(4),a.e(t.t0);case 24:return t.prev=24,a.f(),t.finish(24);case 27:return i<o&&((p=new Uint8Array(tr.AppSectorSize)).fill(255),n=this.concatenateU8A(n,p)),t.abrupt("return",n);case 29:case"end":return t.stop()}}),t,this,[[4,21,24,27]])}))),function(t){return r.apply(this,arguments)})},{key:"totalSize",value:function(){var t,e=0,r=nr(this.apps);try{for(r.s();!(t=r.n()).done;){e+=t.value.size||0}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"removeAppAtIndex",value:function(t){this.apps.splice(t,1)}}]),t}();const dr=pr,mr=r.p+"eadk/eadk.h";var vr=r(2081);function gr(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function _r(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){gr(i,n,o,a,s,"next",t)}function s(t){gr(i,n,o,a,s,"throw",t)}a(void 0)}))}}var Dr=r(1017),yr=Dr.dirname,wr=(Dr.resolve,r(7147)),br=r(7461).Command,Er=r(6002);function Cr(t){var r=new br;function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=wr.readFileSync(t),n=new tr(r);if(e.externalData){var o=wr.readFileSync(e.externalData);n.setExternalData(o)}return n}function o(){return o=_r(e().mark((function t(r,o){var i,a,s,u,c;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=n(r,o),(a=new dr).push(i),s=new Ce,t.next=6,s.singleConnectAndExtractInfos(!0);case 6:return u=t.sent,(c=new Er.SingleBar({stopOnComplete:!0,format:"Upload [{bar}] {percentage}% | ETA: {eta}s"})).start(1,0),t.next=11,a.upload(u,(function(t){c.update(t)}));case 11:case"end":return t.stop()}}),t)}))),o.apply(this,arguments)}function i(){return(i=_r(e().mark((function t(r,o,i){var a,s;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=n(r,i),t.next=3,a.flatElf(i);case 3:s=t.sent,wr.writeFileSync(o,s);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function a(){return(a=_r(e().mark((function t(r,o,i){var a,s;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=n(r,i),t.next=3,a.flatBin(i);case 3:s=t.sent,wr.writeFileSync(o,s);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function s(){return(s=_r(e().mark((function t(r,n){var o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=wr.readFileSync(r),i=Be.fromPNG(o),t.t0=wr,t.t1=n,t.next=6,i.toIconO();case 6:t.t2=t.sent,t.t0.writeFileSync.call(t.t0,t.t1,t.t2);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r.name("nwlink").description("Command-line tool to interact with a NumWorks calculator").version(require("../package.json").version),r.command("install-nwa").description("Install a NWA app").argument("<input.nwa>","Input NWA file").option("-d, --external-data <file>","External data file").action((function(t,e){return o.apply(this,arguments)})),r.command("nwa-elf").description("Link a NWA app").argument("<input.nwa>","Input NWA file").argument("<output.elf>","Output ELF file").option("-d, --external-data <file>","External data file").option("-fs, --flash-start <flashStart>","Flash memory start address","0x90000000").option("-fl, --flash-length <flashLength>","Flash memory length","8M").option("-rs, --ram-start <flashStart>","RAM start address","0x20000000").option("-rl, --ram-length <flashLength>","RAM length","256K").action((function(t,e,r){return i.apply(this,arguments)})),r.command("nwa-bin").description("Link a NWA app and convert to binary format").argument("<input.nwa>","Input NWA file").argument("<output.bin>","Output BIN file").option("-d, --external-data <file>","External data file").option("-fs, --flash-start <flashStart>","Flash memory start address","0x90000000").option("-fl, --flash-length <flashLength>","Flash memory length","8M").option("-rs, --ram-start <flashStart>","RAM start address","0x20000000").option("-rl, --ram-length <flashLength>","RAM length","256K").action((function(t,e,r){return a.apply(this,arguments)})),r.command("nwa-name").description("Print the name of a NWA app").argument("<input.nwa>","Input NWA file").action((function(t){n(t).loadName().then((function(t){return console.log(t)}))})),r.command("png-nwi").description("Convert a PNG file to a NWI image (LZ4-compressed RGB565)").argument("<file.png>","Input PNG file").argument("<file.nwi>","Output NWI file").action((function(t,e){var r=wr.readFileSync(t),n=Be.fromPNG(r);wr.writeFileSync(e,n.toNWI())})),r.command("png-icon-o").description("Convert a PNG file to an ELF icon object (NWI data in a .rodata.eadk_app_icon ELF section)").argument("<file.png>","Input PNG file").argument("<file.o>","Output ELF object file").action((function(t,e){return s.apply(this,arguments)})),r.command("eadk-cflags").description("Print EADK CFLAGS").action((function(){var t=["-mthumb","-mfloat-abi=hard","-mcpu=cortex-m7","-mfpu=fpv5-sp-d16","-I"+yr(mr)];console.log(t.join(" "))})),r.command("view-eadk-h").description("Open eadk.h in $VISUAL or $EDITOR").action((function(){var t=process.env.VISUAL||process.env.EDITOR;t?(0,vr.execSync)("".concat(t," ").concat(mr),{stdio:"inherit"}):console.error("Please define $VISUAL or $EDITOR")})),r.parseAsync(t).catch((function(t){console.error(t.message||t),process.exit(1)}))}global.navigator={usb:o.webusb}})(),module.exports=n.default})();