forked from cryptool-org/wasm-webterm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebterm.bundle.js
3 lines (3 loc) · 567 KB
/
webterm.bundle.js
1
2
3
/*! For license information please see webterm.bundle.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.WasmWebTerm=e():t.WasmWebTerm=e()}(self,(function(){return(()=>{var t={311:(t,e,r)=>{"use strict";const n=r(963),i=r(986),o=r(470),s=r(946),a={hrtime:r(998).default(i.default),exit:t=>{throw new s.WASIExitError(t)},kill:t=>{throw new s.WASIKillError(t)},randomFillSync:n.randomFillSync,isTTY:()=>!0,path:o,fs:null};e.Z=a},55:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(642);e.WASI_ESUCCESS=0,e.WASI_E2BIG=1,e.WASI_EACCES=2,e.WASI_EADDRINUSE=3,e.WASI_EADDRNOTAVAIL=4,e.WASI_EAFNOSUPPORT=5,e.WASI_EAGAIN=6,e.WASI_EALREADY=7,e.WASI_EBADF=8,e.WASI_EBADMSG=9,e.WASI_EBUSY=10,e.WASI_ECANCELED=11,e.WASI_ECHILD=12,e.WASI_ECONNABORTED=13,e.WASI_ECONNREFUSED=14,e.WASI_ECONNRESET=15,e.WASI_EDEADLK=16,e.WASI_EDESTADDRREQ=17,e.WASI_EDOM=18,e.WASI_EDQUOT=19,e.WASI_EEXIST=20,e.WASI_EFAULT=21,e.WASI_EFBIG=22,e.WASI_EHOSTUNREACH=23,e.WASI_EIDRM=24,e.WASI_EILSEQ=25,e.WASI_EINPROGRESS=26,e.WASI_EINTR=27,e.WASI_EINVAL=28,e.WASI_EIO=29,e.WASI_EISCONN=30,e.WASI_EISDIR=31,e.WASI_ELOOP=32,e.WASI_EMFILE=33,e.WASI_EMLINK=34,e.WASI_EMSGSIZE=35,e.WASI_EMULTIHOP=36,e.WASI_ENAMETOOLONG=37,e.WASI_ENETDOWN=38,e.WASI_ENETRESET=39,e.WASI_ENETUNREACH=40,e.WASI_ENFILE=41,e.WASI_ENOBUFS=42,e.WASI_ENODEV=43,e.WASI_ENOENT=44,e.WASI_ENOEXEC=45,e.WASI_ENOLCK=46,e.WASI_ENOLINK=47,e.WASI_ENOMEM=48,e.WASI_ENOMSG=49,e.WASI_ENOPROTOOPT=50,e.WASI_ENOSPC=51,e.WASI_ENOSYS=52,e.WASI_ENOTCONN=53,e.WASI_ENOTDIR=54,e.WASI_ENOTEMPTY=55,e.WASI_ENOTRECOVERABLE=56,e.WASI_ENOTSOCK=57,e.WASI_ENOTSUP=58,e.WASI_ENOTTY=59,e.WASI_ENXIO=60,e.WASI_EOVERFLOW=61,e.WASI_EOWNERDEAD=62,e.WASI_EPERM=63,e.WASI_EPIPE=64,e.WASI_EPROTO=65,e.WASI_EPROTONOSUPPORT=66,e.WASI_EPROTOTYPE=67,e.WASI_ERANGE=68,e.WASI_EROFS=69,e.WASI_ESPIPE=70,e.WASI_ESRCH=71,e.WASI_ESTALE=72,e.WASI_ETIMEDOUT=73,e.WASI_ETXTBSY=74,e.WASI_EXDEV=75,e.WASI_ENOTCAPABLE=76,e.WASI_SIGABRT=0,e.WASI_SIGALRM=1,e.WASI_SIGBUS=2,e.WASI_SIGCHLD=3,e.WASI_SIGCONT=4,e.WASI_SIGFPE=5,e.WASI_SIGHUP=6,e.WASI_SIGILL=7,e.WASI_SIGINT=8,e.WASI_SIGKILL=9,e.WASI_SIGPIPE=10,e.WASI_SIGQUIT=11,e.WASI_SIGSEGV=12,e.WASI_SIGSTOP=13,e.WASI_SIGTERM=14,e.WASI_SIGTRAP=15,e.WASI_SIGTSTP=16,e.WASI_SIGTTIN=17,e.WASI_SIGTTOU=18,e.WASI_SIGURG=19,e.WASI_SIGUSR1=20,e.WASI_SIGUSR2=21,e.WASI_SIGVTALRM=22,e.WASI_SIGXCPU=23,e.WASI_SIGXFSZ=24,e.WASI_FILETYPE_UNKNOWN=0,e.WASI_FILETYPE_BLOCK_DEVICE=1,e.WASI_FILETYPE_CHARACTER_DEVICE=2,e.WASI_FILETYPE_DIRECTORY=3,e.WASI_FILETYPE_REGULAR_FILE=4,e.WASI_FILETYPE_SOCKET_DGRAM=5,e.WASI_FILETYPE_SOCKET_STREAM=6,e.WASI_FILETYPE_SYMBOLIC_LINK=7,e.WASI_FDFLAG_APPEND=1,e.WASI_FDFLAG_DSYNC=2,e.WASI_FDFLAG_NONBLOCK=4,e.WASI_FDFLAG_RSYNC=8,e.WASI_FDFLAG_SYNC=16,e.WASI_RIGHT_FD_DATASYNC=n.BigIntPolyfill(1),e.WASI_RIGHT_FD_READ=n.BigIntPolyfill(2),e.WASI_RIGHT_FD_SEEK=n.BigIntPolyfill(4),e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS=n.BigIntPolyfill(8),e.WASI_RIGHT_FD_SYNC=n.BigIntPolyfill(16),e.WASI_RIGHT_FD_TELL=n.BigIntPolyfill(32),e.WASI_RIGHT_FD_WRITE=n.BigIntPolyfill(64),e.WASI_RIGHT_FD_ADVISE=n.BigIntPolyfill(128),e.WASI_RIGHT_FD_ALLOCATE=n.BigIntPolyfill(256),e.WASI_RIGHT_PATH_CREATE_DIRECTORY=n.BigIntPolyfill(512),e.WASI_RIGHT_PATH_CREATE_FILE=n.BigIntPolyfill(1024),e.WASI_RIGHT_PATH_LINK_SOURCE=n.BigIntPolyfill(2048),e.WASI_RIGHT_PATH_LINK_TARGET=n.BigIntPolyfill(4096),e.WASI_RIGHT_PATH_OPEN=n.BigIntPolyfill(8192),e.WASI_RIGHT_FD_READDIR=n.BigIntPolyfill(16384),e.WASI_RIGHT_PATH_READLINK=n.BigIntPolyfill(32768),e.WASI_RIGHT_PATH_RENAME_SOURCE=n.BigIntPolyfill(65536),e.WASI_RIGHT_PATH_RENAME_TARGET=n.BigIntPolyfill(131072),e.WASI_RIGHT_PATH_FILESTAT_GET=n.BigIntPolyfill(262144),e.WASI_RIGHT_PATH_FILESTAT_SET_SIZE=n.BigIntPolyfill(524288),e.WASI_RIGHT_PATH_FILESTAT_SET_TIMES=n.BigIntPolyfill(1048576),e.WASI_RIGHT_FD_FILESTAT_GET=n.BigIntPolyfill(2097152),e.WASI_RIGHT_FD_FILESTAT_SET_SIZE=n.BigIntPolyfill(4194304),e.WASI_RIGHT_FD_FILESTAT_SET_TIMES=n.BigIntPolyfill(8388608),e.WASI_RIGHT_PATH_SYMLINK=n.BigIntPolyfill(16777216),e.WASI_RIGHT_PATH_REMOVE_DIRECTORY=n.BigIntPolyfill(33554432),e.WASI_RIGHT_PATH_UNLINK_FILE=n.BigIntPolyfill(67108864),e.WASI_RIGHT_POLL_FD_READWRITE=n.BigIntPolyfill(134217728),e.WASI_RIGHT_SOCK_SHUTDOWN=n.BigIntPolyfill(268435456),e.RIGHTS_ALL=e.WASI_RIGHT_FD_DATASYNC|e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_SEEK|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_SYNC|e.WASI_RIGHT_FD_TELL|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_ADVISE|e.WASI_RIGHT_FD_ALLOCATE|e.WASI_RIGHT_PATH_CREATE_DIRECTORY|e.WASI_RIGHT_PATH_CREATE_FILE|e.WASI_RIGHT_PATH_LINK_SOURCE|e.WASI_RIGHT_PATH_LINK_TARGET|e.WASI_RIGHT_PATH_OPEN|e.WASI_RIGHT_FD_READDIR|e.WASI_RIGHT_PATH_READLINK|e.WASI_RIGHT_PATH_RENAME_SOURCE|e.WASI_RIGHT_PATH_RENAME_TARGET|e.WASI_RIGHT_PATH_FILESTAT_GET|e.WASI_RIGHT_PATH_FILESTAT_SET_SIZE|e.WASI_RIGHT_PATH_FILESTAT_SET_TIMES|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_FD_FILESTAT_SET_TIMES|e.WASI_RIGHT_FD_FILESTAT_SET_SIZE|e.WASI_RIGHT_PATH_SYMLINK|e.WASI_RIGHT_PATH_UNLINK_FILE|e.WASI_RIGHT_PATH_REMOVE_DIRECTORY|e.WASI_RIGHT_POLL_FD_READWRITE|e.WASI_RIGHT_SOCK_SHUTDOWN,e.RIGHTS_BLOCK_DEVICE_BASE=e.RIGHTS_ALL,e.RIGHTS_BLOCK_DEVICE_INHERITING=e.RIGHTS_ALL,e.RIGHTS_CHARACTER_DEVICE_BASE=e.RIGHTS_ALL,e.RIGHTS_CHARACTER_DEVICE_INHERITING=e.RIGHTS_ALL,e.RIGHTS_REGULAR_FILE_BASE=e.WASI_RIGHT_FD_DATASYNC|e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_SEEK|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_SYNC|e.WASI_RIGHT_FD_TELL|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_ADVISE|e.WASI_RIGHT_FD_ALLOCATE|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_FD_FILESTAT_SET_SIZE|e.WASI_RIGHT_FD_FILESTAT_SET_TIMES|e.WASI_RIGHT_POLL_FD_READWRITE,e.RIGHTS_REGULAR_FILE_INHERITING=n.BigIntPolyfill(0),e.RIGHTS_DIRECTORY_BASE=e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_SYNC|e.WASI_RIGHT_FD_ADVISE|e.WASI_RIGHT_PATH_CREATE_DIRECTORY|e.WASI_RIGHT_PATH_CREATE_FILE|e.WASI_RIGHT_PATH_LINK_SOURCE|e.WASI_RIGHT_PATH_LINK_TARGET|e.WASI_RIGHT_PATH_OPEN|e.WASI_RIGHT_FD_READDIR|e.WASI_RIGHT_PATH_READLINK|e.WASI_RIGHT_PATH_RENAME_SOURCE|e.WASI_RIGHT_PATH_RENAME_TARGET|e.WASI_RIGHT_PATH_FILESTAT_GET|e.WASI_RIGHT_PATH_FILESTAT_SET_SIZE|e.WASI_RIGHT_PATH_FILESTAT_SET_TIMES|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_FD_FILESTAT_SET_TIMES|e.WASI_RIGHT_PATH_SYMLINK|e.WASI_RIGHT_PATH_UNLINK_FILE|e.WASI_RIGHT_PATH_REMOVE_DIRECTORY|e.WASI_RIGHT_POLL_FD_READWRITE,e.RIGHTS_DIRECTORY_INHERITING=e.RIGHTS_DIRECTORY_BASE|e.RIGHTS_REGULAR_FILE_BASE,e.RIGHTS_SOCKET_BASE=e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_POLL_FD_READWRITE|e.WASI_RIGHT_SOCK_SHUTDOWN,e.RIGHTS_SOCKET_INHERITING=e.RIGHTS_ALL,e.RIGHTS_TTY_BASE=e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_POLL_FD_READWRITE,e.RIGHTS_TTY_INHERITING=n.BigIntPolyfill(0),e.WASI_CLOCK_REALTIME=0,e.WASI_CLOCK_MONOTONIC=1,e.WASI_CLOCK_PROCESS_CPUTIME_ID=2,e.WASI_CLOCK_THREAD_CPUTIME_ID=3,e.WASI_EVENTTYPE_CLOCK=0,e.WASI_EVENTTYPE_FD_READ=1,e.WASI_EVENTTYPE_FD_WRITE=2,e.WASI_FILESTAT_SET_ATIM=1,e.WASI_FILESTAT_SET_ATIM_NOW=2,e.WASI_FILESTAT_SET_MTIM=4,e.WASI_FILESTAT_SET_MTIM_NOW=8,e.WASI_O_CREAT=1,e.WASI_O_DIRECTORY=2,e.WASI_O_EXCL=4,e.WASI_O_TRUNC=8,e.WASI_PREOPENTYPE_DIR=0,e.WASI_DIRCOOKIE_START=0,e.WASI_STDIN_FILENO=0,e.WASI_STDOUT_FILENO=1,e.WASI_STDERR_FILENO=2,e.WASI_WHENCE_SET=0,e.WASI_WHENCE_CUR=1,e.WASI_WHENCE_END=2,e.ERROR_MAP={E2BIG:e.WASI_E2BIG,EACCES:e.WASI_EACCES,EADDRINUSE:e.WASI_EADDRINUSE,EADDRNOTAVAIL:e.WASI_EADDRNOTAVAIL,EAFNOSUPPORT:e.WASI_EAFNOSUPPORT,EALREADY:e.WASI_EALREADY,EAGAIN:e.WASI_EAGAIN,EBADF:e.WASI_EBADF,EBADMSG:e.WASI_EBADMSG,EBUSY:e.WASI_EBUSY,ECANCELED:e.WASI_ECANCELED,ECHILD:e.WASI_ECHILD,ECONNABORTED:e.WASI_ECONNABORTED,ECONNREFUSED:e.WASI_ECONNREFUSED,ECONNRESET:e.WASI_ECONNRESET,EDEADLOCK:e.WASI_EDEADLK,EDESTADDRREQ:e.WASI_EDESTADDRREQ,EDOM:e.WASI_EDOM,EDQUOT:e.WASI_EDQUOT,EEXIST:e.WASI_EEXIST,EFAULT:e.WASI_EFAULT,EFBIG:e.WASI_EFBIG,EHOSTDOWN:e.WASI_EHOSTUNREACH,EHOSTUNREACH:e.WASI_EHOSTUNREACH,EIDRM:e.WASI_EIDRM,EILSEQ:e.WASI_EILSEQ,EINPROGRESS:e.WASI_EINPROGRESS,EINTR:e.WASI_EINTR,EINVAL:e.WASI_EINVAL,EIO:e.WASI_EIO,EISCONN:e.WASI_EISCONN,EISDIR:e.WASI_EISDIR,ELOOP:e.WASI_ELOOP,EMFILE:e.WASI_EMFILE,EMLINK:e.WASI_EMLINK,EMSGSIZE:e.WASI_EMSGSIZE,EMULTIHOP:e.WASI_EMULTIHOP,ENAMETOOLONG:e.WASI_ENAMETOOLONG,ENETDOWN:e.WASI_ENETDOWN,ENETRESET:e.WASI_ENETRESET,ENETUNREACH:e.WASI_ENETUNREACH,ENFILE:e.WASI_ENFILE,ENOBUFS:e.WASI_ENOBUFS,ENODEV:e.WASI_ENODEV,ENOENT:e.WASI_ENOENT,ENOEXEC:e.WASI_ENOEXEC,ENOLCK:e.WASI_ENOLCK,ENOLINK:e.WASI_ENOLINK,ENOMEM:e.WASI_ENOMEM,ENOMSG:e.WASI_ENOMSG,ENOPROTOOPT:e.WASI_ENOPROTOOPT,ENOSPC:e.WASI_ENOSPC,ENOSYS:e.WASI_ENOSYS,ENOTCONN:e.WASI_ENOTCONN,ENOTDIR:e.WASI_ENOTDIR,ENOTEMPTY:e.WASI_ENOTEMPTY,ENOTRECOVERABLE:e.WASI_ENOTRECOVERABLE,ENOTSOCK:e.WASI_ENOTSOCK,ENOTTY:e.WASI_ENOTTY,ENXIO:e.WASI_ENXIO,EOVERFLOW:e.WASI_EOVERFLOW,EOWNERDEAD:e.WASI_EOWNERDEAD,EPERM:e.WASI_EPERM,EPIPE:e.WASI_EPIPE,EPROTO:e.WASI_EPROTO,EPROTONOSUPPORT:e.WASI_EPROTONOSUPPORT,EPROTOTYPE:e.WASI_EPROTOTYPE,ERANGE:e.WASI_ERANGE,EROFS:e.WASI_EROFS,ESPIPE:e.WASI_ESPIPE,ESRCH:e.WASI_ESRCH,ESTALE:e.WASI_ESTALE,ETIMEDOUT:e.WASI_ETIMEDOUT,ETXTBSY:e.WASI_ETXTBSY,EXDEV:e.WASI_EXDEV},e.SIGNAL_MAP={[e.WASI_SIGHUP]:"SIGHUP",[e.WASI_SIGINT]:"SIGINT",[e.WASI_SIGQUIT]:"SIGQUIT",[e.WASI_SIGILL]:"SIGILL",[e.WASI_SIGTRAP]:"SIGTRAP",[e.WASI_SIGABRT]:"SIGABRT",[e.WASI_SIGBUS]:"SIGBUS",[e.WASI_SIGFPE]:"SIGFPE",[e.WASI_SIGKILL]:"SIGKILL",[e.WASI_SIGUSR1]:"SIGUSR1",[e.WASI_SIGSEGV]:"SIGSEGV",[e.WASI_SIGUSR2]:"SIGUSR2",[e.WASI_SIGPIPE]:"SIGPIPE",[e.WASI_SIGALRM]:"SIGALRM",[e.WASI_SIGTERM]:"SIGTERM",[e.WASI_SIGCHLD]:"SIGCHLD",[e.WASI_SIGCONT]:"SIGCONT",[e.WASI_SIGSTOP]:"SIGSTOP",[e.WASI_SIGTSTP]:"SIGTSTP",[e.WASI_SIGTTIN]:"SIGTTIN",[e.WASI_SIGTTOU]:"SIGTTOU",[e.WASI_SIGURG]:"SIGURG",[e.WASI_SIGXCPU]:"SIGXCPU",[e.WASI_SIGXFSZ]:"SIGXFSZ",[e.WASI_SIGVTALRM]:"SIGVTALRM"}},946:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(642),i=r(961),o=r(744);let s;const a=r(55),f=a.WASI_RIGHT_FD_DATASYNC|a.WASI_RIGHT_FD_READ|a.WASI_RIGHT_FD_SYNC|a.WASI_RIGHT_FD_ADVISE|a.WASI_RIGHT_FD_FILESTAT_GET|a.WASI_RIGHT_POLL_FD_READWRITE,u=a.WASI_RIGHT_FD_DATASYNC|a.WASI_RIGHT_FD_WRITE|a.WASI_RIGHT_FD_SYNC|a.WASI_RIGHT_FD_ADVISE|a.WASI_RIGHT_FD_FILESTAT_GET|a.WASI_RIGHT_POLL_FD_READWRITE,h=u,l=t=>{const e=Math.trunc(t),r=n.BigIntPolyfill(Math.round(1e6*(t-e)));return n.BigIntPolyfill(e)*n.BigIntPolyfill(1e6)+r},c=t=>{"number"==typeof t&&(t=Math.trunc(t));const e=n.BigIntPolyfill(t);return Number(e/n.BigIntPolyfill(1e6))},p=t=>(...e)=>{try{return t(...e)}catch(t){if(t&&t.code&&"string"==typeof t.code)return a.ERROR_MAP[t.code]||a.WASI_EINVAL;if(t instanceof g)return t.errno;throw t}},d=(t,e)=>{const r=t.FD_MAP.get(e);if(!r)throw new g(a.WASI_EBADF);if(void 0===r.filetype){const n=t.bindings.fs.fstatSync(r.real),{filetype:i,rightsBase:o,rightsInheriting:s}=_(t,e,n);r.filetype=i,r.rights||(r.rights={base:o,inheriting:s})}return r},_=(t,e,r)=>{switch(!0){case r.isBlockDevice():return{filetype:a.WASI_FILETYPE_BLOCK_DEVICE,rightsBase:a.RIGHTS_BLOCK_DEVICE_BASE,rightsInheriting:a.RIGHTS_BLOCK_DEVICE_INHERITING};case r.isCharacterDevice():{const r=a.WASI_FILETYPE_CHARACTER_DEVICE;return void 0!==e&&t.bindings.isTTY(e)?{filetype:r,rightsBase:a.RIGHTS_TTY_BASE,rightsInheriting:a.RIGHTS_TTY_INHERITING}:{filetype:r,rightsBase:a.RIGHTS_CHARACTER_DEVICE_BASE,rightsInheriting:a.RIGHTS_CHARACTER_DEVICE_INHERITING}}case r.isDirectory():return{filetype:a.WASI_FILETYPE_DIRECTORY,rightsBase:a.RIGHTS_DIRECTORY_BASE,rightsInheriting:a.RIGHTS_DIRECTORY_INHERITING};case r.isFIFO():return{filetype:a.WASI_FILETYPE_SOCKET_STREAM,rightsBase:a.RIGHTS_SOCKET_BASE,rightsInheriting:a.RIGHTS_SOCKET_INHERITING};case r.isFile():return{filetype:a.WASI_FILETYPE_REGULAR_FILE,rightsBase:a.RIGHTS_REGULAR_FILE_BASE,rightsInheriting:a.RIGHTS_REGULAR_FILE_INHERITING};case r.isSocket():return{filetype:a.WASI_FILETYPE_SOCKET_STREAM,rightsBase:a.RIGHTS_SOCKET_BASE,rightsInheriting:a.RIGHTS_SOCKET_INHERITING};case r.isSymbolicLink():return{filetype:a.WASI_FILETYPE_SYMBOLIC_LINK,rightsBase:n.BigIntPolyfill(0),rightsInheriting:n.BigIntPolyfill(0)};default:return{filetype:a.WASI_FILETYPE_UNKNOWN,rightsBase:n.BigIntPolyfill(0),rightsInheriting:n.BigIntPolyfill(0)}}};class g extends Error{constructor(t){super(),this.errno=t,Object.setPrototypeOf(this,g.prototype)}}e.WASIError=g;class y extends Error{constructor(t){super(`WASI Exit error: ${t}`),this.code=t,Object.setPrototypeOf(this,y.prototype)}}e.WASIExitError=y;class m extends Error{constructor(t){super(`WASI Kill signal: ${t}`),this.signal=t,Object.setPrototypeOf(this,m.prototype)}}e.WASIKillError=m;class E{constructor(t){let e={};t&&t.preopens?e=t.preopens:t&&t.preopenDirectories&&(e=t.preopenDirectories);let r={};t&&t.env&&(r=t.env);let i=[];t&&t.args&&(i=t.args);let y=s;t&&t.bindings&&(y=t.bindings),this.memory=void 0,this.view=void 0,this.bindings=y,this.FD_MAP=new Map([[a.WASI_STDIN_FILENO,{real:0,filetype:a.WASI_FILETYPE_CHARACTER_DEVICE,rights:{base:f,inheriting:n.BigIntPolyfill(0)},path:void 0}],[a.WASI_STDOUT_FILENO,{real:1,filetype:a.WASI_FILETYPE_CHARACTER_DEVICE,rights:{base:u,inheriting:n.BigIntPolyfill(0)},path:void 0}],[a.WASI_STDERR_FILENO,{real:2,filetype:a.WASI_FILETYPE_CHARACTER_DEVICE,rights:{base:h,inheriting:n.BigIntPolyfill(0)},path:void 0}]]);let m=this.bindings.fs,E=this.bindings.path;for(const[t,r]of Object.entries(e)){const e=m.openSync(r,m.constants.O_RDONLY),n=[...this.FD_MAP.keys()].reverse()[0]+1;this.FD_MAP.set(n,{real:e,filetype:a.WASI_FILETYPE_DIRECTORY,rights:{base:a.RIGHTS_DIRECTORY_BASE,inheriting:a.RIGHTS_DIRECTORY_INHERITING},fakePath:t,path:r})}const S=(t,e)=>(this.refreshMemory(),Array.from({length:e},((e,r)=>{const n=t+8*r,i=this.view.getUint32(n,!0),o=this.view.getUint32(n+4,!0);return new Uint8Array(this.memory.buffer,i,o)}))),I=(t,e)=>{const r=d(this,t);if(e!==n.BigIntPolyfill(0)&&(r.rights.base&e)===n.BigIntPolyfill(0))throw new g(a.WASI_EPERM);return r},w=y.hrtime(),A=t=>{switch(t){case a.WASI_CLOCK_MONOTONIC:return y.hrtime();case a.WASI_CLOCK_REALTIME:return l(Date.now());case a.WASI_CLOCK_PROCESS_CPUTIME_ID:case a.WASI_CLOCK_THREAD_CPUTIME_ID:return y.hrtime()-w;default:return null}};this.wasiImport={args_get:(t,e)=>{this.refreshMemory();let r=t,n=e;return i.forEach((t=>{this.view.setUint32(r,n,!0),r+=4,n+=o.default.from(this.memory.buffer).write(`${t}\0`,n)})),a.WASI_ESUCCESS},args_sizes_get:(t,e)=>{this.refreshMemory(),this.view.setUint32(t,i.length,!0);const r=i.reduce(((t,e)=>t+o.default.byteLength(e)+1),0);return this.view.setUint32(e,r,!0),a.WASI_ESUCCESS},environ_get:(t,e)=>{this.refreshMemory();let n=t,i=e;return Object.entries(r).forEach((([t,e])=>{this.view.setUint32(n,i,!0),n+=4,i+=o.default.from(this.memory.buffer).write(`${t}=${e}\0`,i)})),a.WASI_ESUCCESS},environ_sizes_get:(t,e)=>{this.refreshMemory();const n=Object.entries(r).map((([t,e])=>`${t}=${e}\0`)),i=n.reduce(((t,e)=>t+o.default.byteLength(e)),0);return this.view.setUint32(t,n.length,!0),this.view.setUint32(e,i,!0),a.WASI_ESUCCESS},clock_res_get:(t,e)=>{let r;switch(t){case a.WASI_CLOCK_MONOTONIC:case a.WASI_CLOCK_PROCESS_CPUTIME_ID:case a.WASI_CLOCK_THREAD_CPUTIME_ID:r=n.BigIntPolyfill(1);break;case a.WASI_CLOCK_REALTIME:r=n.BigIntPolyfill(1e3)}return this.view.setBigUint64(e,r),a.WASI_ESUCCESS},clock_time_get:(t,e,r)=>{this.refreshMemory();const i=A(t);return null===i?a.WASI_EINVAL:(this.view.setBigUint64(r,n.BigIntPolyfill(i),!0),a.WASI_ESUCCESS)},fd_advise:p(((t,e,r,n)=>(I(t,a.WASI_RIGHT_FD_ADVISE),a.WASI_ENOSYS))),fd_allocate:p(((t,e,r)=>(I(t,a.WASI_RIGHT_FD_ALLOCATE),a.WASI_ENOSYS))),fd_close:p((t=>{const e=I(t,n.BigIntPolyfill(0));return m.closeSync(e.real),this.FD_MAP.delete(t),a.WASI_ESUCCESS})),fd_datasync:p((t=>{const e=I(t,a.WASI_RIGHT_FD_DATASYNC);return m.fdatasyncSync(e.real),a.WASI_ESUCCESS})),fd_fdstat_get:p(((t,e)=>{const r=I(t,n.BigIntPolyfill(0));return this.refreshMemory(),this.view.setUint8(e,r.filetype),this.view.setUint16(e+2,0,!0),this.view.setUint16(e+4,0,!0),this.view.setBigUint64(e+8,n.BigIntPolyfill(r.rights.base),!0),this.view.setBigUint64(e+8+8,n.BigIntPolyfill(r.rights.inheriting),!0),a.WASI_ESUCCESS})),fd_fdstat_set_flags:p(((t,e)=>(I(t,a.WASI_RIGHT_FD_FDSTAT_SET_FLAGS),a.WASI_ENOSYS))),fd_fdstat_set_rights:p(((t,e,r)=>{const i=I(t,n.BigIntPolyfill(0));return(i.rights.base|e)>i.rights.base||(i.rights.inheriting|r)>i.rights.inheriting?a.WASI_EPERM:(i.rights.base=e,i.rights.inheriting=r,a.WASI_ESUCCESS)})),fd_filestat_get:p(((t,e)=>{const r=I(t,a.WASI_RIGHT_FD_FILESTAT_GET),i=m.fstatSync(r.real);return this.refreshMemory(),this.view.setBigUint64(e,n.BigIntPolyfill(i.dev),!0),e+=8,this.view.setBigUint64(e,n.BigIntPolyfill(i.ino),!0),e+=8,this.view.setUint8(e,r.filetype),e+=8,this.view.setBigUint64(e,n.BigIntPolyfill(i.nlink),!0),e+=8,this.view.setBigUint64(e,n.BigIntPolyfill(i.size),!0),e+=8,this.view.setBigUint64(e,l(i.atimeMs),!0),e+=8,this.view.setBigUint64(e,l(i.mtimeMs),!0),e+=8,this.view.setBigUint64(e,l(i.ctimeMs),!0),a.WASI_ESUCCESS})),fd_filestat_set_size:p(((t,e)=>{const r=I(t,a.WASI_RIGHT_FD_FILESTAT_SET_SIZE);return m.ftruncateSync(r.real,Number(e)),a.WASI_ESUCCESS})),fd_filestat_set_times:p(((t,e,r,n)=>{const i=I(t,a.WASI_RIGHT_FD_FILESTAT_SET_TIMES),o=m.fstatSync(i.real);let s=o.atime,f=o.mtime;const u=c(A(a.WASI_CLOCK_REALTIME)),h=a.WASI_FILESTAT_SET_ATIM|a.WASI_FILESTAT_SET_ATIM_NOW;if((n&h)===h)return a.WASI_EINVAL;const l=a.WASI_FILESTAT_SET_MTIM|a.WASI_FILESTAT_SET_MTIM_NOW;return(n&l)===l?a.WASI_EINVAL:((n&a.WASI_FILESTAT_SET_ATIM)===a.WASI_FILESTAT_SET_ATIM?s=c(e):(n&a.WASI_FILESTAT_SET_ATIM_NOW)===a.WASI_FILESTAT_SET_ATIM_NOW&&(s=u),(n&a.WASI_FILESTAT_SET_MTIM)===a.WASI_FILESTAT_SET_MTIM?f=c(r):(n&a.WASI_FILESTAT_SET_MTIM_NOW)===a.WASI_FILESTAT_SET_MTIM_NOW&&(f=u),m.futimesSync(i.real,new Date(s),new Date(f)),a.WASI_ESUCCESS)})),fd_prestat_get:p(((t,e)=>{const r=I(t,n.BigIntPolyfill(0));return r.path?(this.refreshMemory(),this.view.setUint8(e,a.WASI_PREOPENTYPE_DIR),this.view.setUint32(e+4,o.default.byteLength(r.fakePath),!0),a.WASI_ESUCCESS):a.WASI_EINVAL})),fd_prestat_dir_name:p(((t,e,r)=>{const i=I(t,n.BigIntPolyfill(0));return i.path?(this.refreshMemory(),o.default.from(this.memory.buffer).write(i.fakePath,e,r,"utf8"),a.WASI_ESUCCESS):a.WASI_EINVAL})),fd_pwrite:p(((t,e,r,n,i)=>{const o=I(t,a.WASI_RIGHT_FD_WRITE|a.WASI_RIGHT_FD_SEEK);let s=0;return S(e,r).forEach((t=>{let e=0;for(;e<t.byteLength;)e+=m.writeSync(o.real,t,e,t.byteLength-e,Number(n)+s+e);s+=e})),this.view.setUint32(i,s,!0),a.WASI_ESUCCESS})),fd_write:p(((t,e,r,i)=>{const o=I(t,a.WASI_RIGHT_FD_WRITE);let s=0;return S(e,r).forEach((t=>{let e=0;for(;e<t.byteLength;){const r=m.writeSync(o.real,t,e,t.byteLength-e,o.offset?Number(o.offset):null);o.offset&&(o.offset+=n.BigIntPolyfill(r)),e+=r}s+=e})),this.view.setUint32(i,s,!0),a.WASI_ESUCCESS})),fd_pread:p(((t,e,r,n,i)=>{const o=I(t,a.WASI_RIGHT_FD_READ|a.WASI_RIGHT_FD_SEEK);let s=0;t:for(const t of S(e,r)){let e=0;for(;e<t.byteLength;){const r=t.byteLength-e,i=m.readSync(o.real,t,e,t.byteLength-e,Number(n)+s+e);if(e+=i,s+=i,0===i||i<r)break t}s+=e}return this.view.setUint32(i,s,!0),a.WASI_ESUCCESS})),fd_read:p(((t,e,r,i)=>{const o=I(t,a.WASI_RIGHT_FD_READ),s=0===o.real;let f=0;t:for(const t of S(e,r)){let e=0;for(;e<t.byteLength;){let r=t.byteLength-e,i=s||void 0===o.offset?null:Number(o.offset),a=m.readSync(o.real,t,e,r,i);if(s||(o.offset=(o.offset?o.offset:n.BigIntPolyfill(0))+n.BigIntPolyfill(a)),e+=a,f+=a,0===a||a<r)break t}}return this.view.setUint32(i,f,!0),a.WASI_ESUCCESS})),fd_readdir:p(((t,e,r,i,s)=>{const f=I(t,a.WASI_RIGHT_FD_READDIR);this.refreshMemory();const u=m.readdirSync(f.path,{withFileTypes:!0}),h=e;for(let t=Number(i);t<u.length;t+=1){const i=u[t];let s=o.default.byteLength(i.name);if(e-h>r)break;if(this.view.setBigUint64(e,n.BigIntPolyfill(t+1),!0),(e+=8)-h>r)break;const l=m.statSync(E.resolve(f.path,i.name));if(this.view.setBigUint64(e,n.BigIntPolyfill(l.ino),!0),(e+=8)-h>r)break;if(this.view.setUint32(e,s,!0),(e+=4)-h>r)break;let c;switch(!0){case l.isBlockDevice():c=a.WASI_FILETYPE_BLOCK_DEVICE;break;case l.isCharacterDevice():c=a.WASI_FILETYPE_CHARACTER_DEVICE;break;case l.isDirectory():c=a.WASI_FILETYPE_DIRECTORY;break;case l.isFIFO():c=a.WASI_FILETYPE_SOCKET_STREAM;break;case l.isFile():c=a.WASI_FILETYPE_REGULAR_FILE;break;case l.isSocket():c=a.WASI_FILETYPE_SOCKET_STREAM;break;case l.isSymbolicLink():c=a.WASI_FILETYPE_SYMBOLIC_LINK;break;default:c=a.WASI_FILETYPE_UNKNOWN}if(this.view.setUint8(e,c),e+=1,(e+=3)+s>=h+r)break;o.default.from(this.memory.buffer).write(i.name,e),e+=s}const l=e-h;return this.view.setUint32(s,Math.min(l,r),!0),a.WASI_ESUCCESS})),fd_renumber:p(((t,e)=>(I(t,n.BigIntPolyfill(0)),I(e,n.BigIntPolyfill(0)),m.closeSync(this.FD_MAP.get(t).real),this.FD_MAP.set(t,this.FD_MAP.get(e)),this.FD_MAP.delete(e),a.WASI_ESUCCESS))),fd_seek:p(((t,e,r,i)=>{const o=I(t,a.WASI_RIGHT_FD_SEEK);switch(this.refreshMemory(),r){case a.WASI_WHENCE_CUR:o.offset=(o.offset?o.offset:n.BigIntPolyfill(0))+n.BigIntPolyfill(e);break;case a.WASI_WHENCE_END:const{size:t}=m.fstatSync(o.real);o.offset=n.BigIntPolyfill(t)+n.BigIntPolyfill(e);break;case a.WASI_WHENCE_SET:o.offset=n.BigIntPolyfill(e)}return this.view.setBigUint64(i,o.offset,!0),a.WASI_ESUCCESS})),fd_tell:p(((t,e)=>{const r=I(t,a.WASI_RIGHT_FD_TELL);return this.refreshMemory(),r.offset||(r.offset=n.BigIntPolyfill(0)),this.view.setBigUint64(e,r.offset,!0),a.WASI_ESUCCESS})),fd_sync:p((t=>{const e=I(t,a.WASI_RIGHT_FD_SYNC);return m.fsyncSync(e.real),a.WASI_ESUCCESS})),path_create_directory:p(((t,e,r)=>{const n=I(t,a.WASI_RIGHT_PATH_CREATE_DIRECTORY);if(!n.path)return a.WASI_EINVAL;this.refreshMemory();const i=o.default.from(this.memory.buffer,e,r).toString();return m.mkdirSync(E.resolve(n.path,i)),a.WASI_ESUCCESS})),path_filestat_get:p(((t,e,r,i,s)=>{const f=I(t,a.WASI_RIGHT_PATH_FILESTAT_GET);if(!f.path)return a.WASI_EINVAL;this.refreshMemory();const u=o.default.from(this.memory.buffer,r,i).toString(),h=m.statSync(E.resolve(f.path,u));return this.view.setBigUint64(s,n.BigIntPolyfill(h.dev),!0),s+=8,this.view.setBigUint64(s,n.BigIntPolyfill(h.ino),!0),s+=8,this.view.setUint8(s,_(this,void 0,h).filetype),s+=8,this.view.setBigUint64(s,n.BigIntPolyfill(h.nlink),!0),s+=8,this.view.setBigUint64(s,n.BigIntPolyfill(h.size),!0),s+=8,this.view.setBigUint64(s,l(h.atimeMs),!0),s+=8,this.view.setBigUint64(s,l(h.mtimeMs),!0),s+=8,this.view.setBigUint64(s,l(h.ctimeMs),!0),a.WASI_ESUCCESS})),path_filestat_set_times:p(((t,e,r,n,i,s,f)=>{const u=I(t,a.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);if(!u.path)return a.WASI_EINVAL;this.refreshMemory();const h=m.fstatSync(u.real);let l=h.atime,p=h.mtime;const d=c(A(a.WASI_CLOCK_REALTIME)),_=a.WASI_FILESTAT_SET_ATIM|a.WASI_FILESTAT_SET_ATIM_NOW;if((f&_)===_)return a.WASI_EINVAL;const g=a.WASI_FILESTAT_SET_MTIM|a.WASI_FILESTAT_SET_MTIM_NOW;if((f&g)===g)return a.WASI_EINVAL;(f&a.WASI_FILESTAT_SET_ATIM)===a.WASI_FILESTAT_SET_ATIM?l=c(i):(f&a.WASI_FILESTAT_SET_ATIM_NOW)===a.WASI_FILESTAT_SET_ATIM_NOW&&(l=d),(f&a.WASI_FILESTAT_SET_MTIM)===a.WASI_FILESTAT_SET_MTIM?p=c(s):(f&a.WASI_FILESTAT_SET_MTIM_NOW)===a.WASI_FILESTAT_SET_MTIM_NOW&&(p=d);const y=o.default.from(this.memory.buffer,r,n).toString();return m.utimesSync(E.resolve(u.path,y),new Date(l),new Date(p)),a.WASI_ESUCCESS})),path_link:p(((t,e,r,n,i,s,f)=>{const u=I(t,a.WASI_RIGHT_PATH_LINK_SOURCE),h=I(i,a.WASI_RIGHT_PATH_LINK_TARGET);if(!u.path||!h.path)return a.WASI_EINVAL;this.refreshMemory();const l=o.default.from(this.memory.buffer,r,n).toString(),c=o.default.from(this.memory.buffer,s,f).toString();return m.linkSync(E.resolve(u.path,l),E.resolve(h.path,c)),a.WASI_ESUCCESS})),path_open:p(((t,e,r,i,s,f,u,h,l)=>{const c=I(t,a.WASI_RIGHT_PATH_OPEN);f=n.BigIntPolyfill(f),u=n.BigIntPolyfill(u);const p=(f&(a.WASI_RIGHT_FD_READ|a.WASI_RIGHT_FD_READDIR))!==n.BigIntPolyfill(0),_=(f&(a.WASI_RIGHT_FD_DATASYNC|a.WASI_RIGHT_FD_WRITE|a.WASI_RIGHT_FD_ALLOCATE|a.WASI_RIGHT_FD_FILESTAT_SET_SIZE))!==n.BigIntPolyfill(0);let g;_&&p?g=m.constants.O_RDWR:p?g=m.constants.O_RDONLY:_&&(g=m.constants.O_WRONLY);let y=f|a.WASI_RIGHT_PATH_OPEN,S=f|u;0!=(s&a.WASI_O_CREAT)&&(g|=m.constants.O_CREAT,y|=a.WASI_RIGHT_PATH_CREATE_FILE),0!=(s&a.WASI_O_DIRECTORY)&&(g|=m.constants.O_DIRECTORY),0!=(s&a.WASI_O_EXCL)&&(g|=m.constants.O_EXCL),0!=(s&a.WASI_O_TRUNC)&&(g|=m.constants.O_TRUNC,y|=a.WASI_RIGHT_PATH_FILESTAT_SET_SIZE),0!=(h&a.WASI_FDFLAG_APPEND)&&(g|=m.constants.O_APPEND),0!=(h&a.WASI_FDFLAG_DSYNC)&&(m.constants.O_DSYNC?g|=m.constants.O_DSYNC:g|=m.constants.O_SYNC,S|=a.WASI_RIGHT_FD_DATASYNC),0!=(h&a.WASI_FDFLAG_NONBLOCK)&&(g|=m.constants.O_NONBLOCK),0!=(h&a.WASI_FDFLAG_RSYNC)&&(m.constants.O_RSYNC?g|=m.constants.O_RSYNC:g|=m.constants.O_SYNC,S|=a.WASI_RIGHT_FD_SYNC),0!=(h&a.WASI_FDFLAG_SYNC)&&(g|=m.constants.O_SYNC,S|=a.WASI_RIGHT_FD_SYNC),_&&0==(g&(m.constants.O_APPEND|m.constants.O_TRUNC))&&(S|=a.WASI_RIGHT_FD_SEEK),this.refreshMemory();const w=o.default.from(this.memory.buffer,r,i).toString(),A=E.resolve(c.path,w);if(E.relative(c.path,A).startsWith(".."))return a.WASI_ENOTCAPABLE;let v,T,b;try{if(v=m.realpathSync(A),E.relative(c.path,v).startsWith(".."))return a.WASI_ENOTCAPABLE}catch(t){if("ENOENT"!==t.code)throw t;v=A}try{T=m.statSync(v).isDirectory()}catch(t){}b=!_&&T?m.openSync(v,m.constants.O_RDONLY):m.openSync(v,g);const R=[...this.FD_MAP.keys()].reverse()[0]+1;return this.FD_MAP.set(R,{real:b,filetype:void 0,rights:{base:y,inheriting:S},path:v}),d(this,R),this.view.setUint32(l,R,!0),a.WASI_ESUCCESS})),path_readlink:p(((t,e,r,n,i,s)=>{const f=I(t,a.WASI_RIGHT_PATH_READLINK);if(!f.path)return a.WASI_EINVAL;this.refreshMemory();const u=o.default.from(this.memory.buffer,e,r).toString(),h=E.resolve(f.path,u),l=m.readlinkSync(h),c=o.default.from(this.memory.buffer).write(l,n,i);return this.view.setUint32(s,c,!0),a.WASI_ESUCCESS})),path_remove_directory:p(((t,e,r)=>{const n=I(t,a.WASI_RIGHT_PATH_REMOVE_DIRECTORY);if(!n.path)return a.WASI_EINVAL;this.refreshMemory();const i=o.default.from(this.memory.buffer,e,r).toString();return m.rmdirSync(E.resolve(n.path,i)),a.WASI_ESUCCESS})),path_rename:p(((t,e,r,n,i,s)=>{const f=I(t,a.WASI_RIGHT_PATH_RENAME_SOURCE),u=I(n,a.WASI_RIGHT_PATH_RENAME_TARGET);if(!f.path||!u.path)return a.WASI_EINVAL;this.refreshMemory();const h=o.default.from(this.memory.buffer,e,r).toString(),l=o.default.from(this.memory.buffer,i,s).toString();return m.renameSync(E.resolve(f.path,h),E.resolve(u.path,l)),a.WASI_ESUCCESS})),path_symlink:p(((t,e,r,n,i)=>{const s=I(r,a.WASI_RIGHT_PATH_SYMLINK);if(!s.path)return a.WASI_EINVAL;this.refreshMemory();const f=o.default.from(this.memory.buffer,t,e).toString(),u=o.default.from(this.memory.buffer,n,i).toString();return m.symlinkSync(f,E.resolve(s.path,u)),a.WASI_ESUCCESS})),path_unlink_file:p(((t,e,r)=>{const n=I(t,a.WASI_RIGHT_PATH_UNLINK_FILE);if(!n.path)return a.WASI_EINVAL;this.refreshMemory();const i=o.default.from(this.memory.buffer,e,r).toString();return m.unlinkSync(E.resolve(n.path,i)),a.WASI_ESUCCESS})),poll_oneoff:(t,e,r,i)=>{let o=0,s=0;this.refreshMemory();for(let i=0;i<r;i+=1){const r=this.view.getBigUint64(t,!0);t+=8;const i=this.view.getUint8(t);switch(t+=1,i){case a.WASI_EVENTTYPE_CLOCK:{t+=7,this.view.getBigUint64(t,!0),t+=8;const i=this.view.getUint32(t,!0);t+=4,t+=4;const f=this.view.getBigUint64(t,!0);t+=8,this.view.getBigUint64(t,!0),t+=8;const u=this.view.getUint16(t,!0);t+=2,t+=6;const h=1===u;let l=a.WASI_ESUCCESS;const c=n.BigIntPolyfill(A(i));if(null===c)l=a.WASI_EINVAL;else{const t=h?f:c+f;s=t>s?t:s}this.view.setBigUint64(e,r,!0),e+=8,this.view.setUint16(e,l,!0),e+=2,this.view.setUint8(e,a.WASI_EVENTTYPE_CLOCK),e+=1,e+=5,o+=1;break}case a.WASI_EVENTTYPE_FD_READ:case a.WASI_EVENTTYPE_FD_WRITE:t+=3,this.view.getUint32(t,!0),t+=4,this.view.setBigUint64(e,r,!0),e+=8,this.view.setUint16(e,a.WASI_ENOSYS,!0),e+=2,this.view.setUint8(e,i),e+=1,e+=5,o+=1;break;default:return a.WASI_EINVAL}}for(this.view.setUint32(i,o,!0);y.hrtime()<s;);return a.WASI_ESUCCESS},proc_exit:t=>(y.exit(t),a.WASI_ESUCCESS),proc_raise:t=>t in a.SIGNAL_MAP?(y.kill(a.SIGNAL_MAP[t]),a.WASI_ESUCCESS):a.WASI_EINVAL,random_get:(t,e)=>(this.refreshMemory(),y.randomFillSync(new Uint8Array(this.memory.buffer),t,e),a.WASI_ESUCCESS),sched_yield:()=>a.WASI_ESUCCESS,sock_recv:()=>a.WASI_ENOSYS,sock_send:()=>a.WASI_ENOSYS,sock_shutdown:()=>a.WASI_ENOSYS},t.traceSyscalls&&Object.keys(this.wasiImport).forEach((t=>{const e=this.wasiImport[t];this.wasiImport[t]=function(...r){console.log(`WASI: wasiImport called: ${t} (${r})`);try{let t=e(...r);return console.log(`WASI: => ${t}`),t}catch(t){throw console.log(`Catched error: ${t}`),t}}}))}refreshMemory(){this.view&&0!==this.view.buffer.byteLength||(this.view=new i.DataViewPolyfill(this.memory.buffer))}setMemory(t){this.memory=t}start(t){const e=t.exports;if(null===e||"object"!=typeof e)throw new Error(`instance.exports must be an Object. Received ${e}.`);const{memory:r}=e;if(!(r instanceof WebAssembly.Memory))throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${r}.`);this.setMemory(r),e._start&&e._start()}getImportNamespace(t){let e=null;for(let r of WebAssembly.Module.imports(t))if("function"===r.kind&&r.module.startsWith("wasi_"))if(e){if(e!==r.module)throw new Error("Multiple namespaces detected.")}else e=r.module;return e}getImports(t){switch(this.getImportNamespace(t)){case"wasi_unstable":return{wasi_unstable:this.wasiImport};case"wasi_snapshot_preview1":return{wasi_snapshot_preview1:this.wasiImport};default:throw new Error("Can't detect a WASI namespace for the WebAssembly Module")}}}e.default=E,E.defaultBindings=s,e.WASI=E},642:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n="undefined"!=typeof globalThis?globalThis:void 0!==r.g?r.g:{};e.BigIntPolyfill="undefined"!=typeof BigInt?BigInt:n.BigInt||Number},986:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=Math.floor(.001*(Date.now()-performance.now()));e.default=function(t){let e=.001*performance.now(),n=Math.floor(e)+r,i=Math.floor(e%1*1e9);return t&&(n-=t[0],i-=t[1],i<0&&(n--,i+=1e9)),[n,i]}},744:(t,e,r)=>{"use strict";var n=r(764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const i=n;e.default=i},961:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(642);let i=DataView;i.prototype.setBigUint64||(i.prototype.setBigUint64=function(t,e,r){let n,i;if(e<2**32)n=Number(e),i=0;else{for(var o=e.toString(2),s="",a=0;a<64-o.length;a++)s+="0";s+=o,i=parseInt(s.substring(0,32),2),n=parseInt(s.substring(32),2)}this.setUint32(t+(r?0:4),n,r),this.setUint32(t+(r?4:0),i,r)},i.prototype.getBigUint64=function(t,e){let r=this.getUint32(t+(e?0:4),e),i=this.getUint32(t+(e?4:0),e);for(var o=r.toString(2),s=i.toString(2),a="",f=0;f<32-o.length;f++)a+="0";return a+=o,n.BigIntPolyfill("0b"+s+a)}),e.DataViewPolyfill=i},998:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=t=>e=>{const r=t(e);return 1e9*r[0]+r[1]}},742:(t,e)=>{"use strict";e.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=f(t),s=o[0],a=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),h=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[h++]=e>>16&255,u[h++]=e>>8&255,u[h++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[h++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,f=n-i;a<f;a+=s)o.push(u(t,a,a+s>f?f:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function f(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(t,e,r)=>{"use strict";var n=r(742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},e.INSPECT_MAX_BYTES=50;var s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|_(t,e),n=a(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(G(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return f.from(n,e,r);var i=function(t){if(f.isBuffer(t)){var e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||H(t.length)?a(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return h(t),a(t<0?0:0|d(t))}function c(t){for(var e=t.length<0?0:0|d(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,f.prototype),n}function d(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function _(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return M(t).length;default:if(i)return n?-1:U(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:E(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):E(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function E(t,e,r,n,i){var o,s=1,a=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,f/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===f)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(r+f>a&&(r=a-f),o=r;o>=0;o--){for(var l=!0,c=0;c<f;c++)if(u(t,o+c)!==u(e,c)){l=!1;break}if(l)return o}return-1}function S(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(H(a))return s;t[r+s]=a}return s}function I(t,e,r,n){return x(U(e,t.length-r),t,r,n)}function w(t,e,r,n){return x(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function A(t,e,r,n){return x(M(e),t,r,n)}function v(t,e,r,n){return x(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function b(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,f,u=t[i],h=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(h=u);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&u)<<6|63&o)>127&&(h=f);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(f=(15&u)<<12|(63&o)<<6|63&s)>2047&&(f<55296||f>57343)&&(h=f);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(f=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&f<1114112&&(h=f)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(t){var e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=R));return r}(n)}e.kMaxLength=s,f.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},f.allocUnsafe=function(t){return l(t)},f.allocUnsafeSlow=function(t){return l(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if(G(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),G(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(G(o,Uint8Array))i+o.length>n.length?f.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!f.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},f.byteLength=_,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},f.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?b(this,0,t):g.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(f.prototype[o]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,i){if(G(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),h=t.slice(e,r),l=0;l<a;++l)if(u[l]!==h[l]){o=u[l],s=h[l];break}return o<s?-1:s<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return S(this,t,e,r);case"utf8":case"utf-8":return I(this,t,e,r);case"ascii":case"latin1":case"binary":return w(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function N(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function C(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=Y[t[o]];return i}function L(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function P(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function W(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||W(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||W(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);W(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);W(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=f.isBuffer(t)?t:f.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var k=/[^+/0-9A-Za-z-_]/g;function U(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function M(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function x(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function G(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function H(t){return t!=t}var Y=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,f=(1<<a)-1,u=f>>1,h=-7,l=r?i-1:0,c=r?-1:1,p=t[e+l];for(l+=c,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+l],l+=c,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+l],l+=c,h-=8);if(0===o)o=1-u;else{if(o===f)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,f,u=8*o-i-1,h=(1<<u)-1,l=h>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),(e+=s+l>=1?c/f:c*Math.pow(2,1-l))*f>=2&&(s++,f/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(e*f-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+p]=255&s,p+=d,s/=256,u-=8);t[r+p-d]|=128*_}},530:function(t,e){var r;void 0===(r=function(){"use strict";function t(t){function e(t){for(var e=0,i=r.length;e<i;++e)r[e](t);n.push(t)}if("function"!=typeof Promise)throw new Error("Promise implementation not available in this environment.");var r=[],n=[],i=new Promise((function(r,n){t(r,n,e)}));i.progress=function(t){if("function"!=typeof t)throw new Error("cb is not a function.");for(var e=0,o=n.length;e<o;++e)t(n[e]);return r.push(t),i};var o=i.then;return i.then=function(t,e,r){return o.call(i,t,e),void 0!==r&&i.progress(r),i},i}function e(t){return Object.defineProperties(t,o),t}var r,n=window||this,i=n.URL||n.webkitURL,o={blob:{get:function(){return this._blob||(this._blob=new Blob([this.buffer]))}},getBlobUrl:{value:function(){return this._blobUrl||(this._blobUrl=i.createObjectURL(this.blob))}},readAsString:{value:function(){for(var t=this.buffer,e=t.byteLength,r=new DataView(t),n=[],i=0;i<e;++i){var o=r.getUint8(1*i,!0);n.push(o)}return this._string=String.fromCharCode.apply(null,n)}},readAsJSON:{value:function(){return JSON.parse(this.readAsString())}}};return r=(window||this).URL.createObjectURL(new Blob(['"use strict";function UntarWorker(){}function decodeUTF8(e){for(var r="",t=0;t<e.length;){var a=e[t++];if(a>127){if(a>191&&a<224){if(t>=e.length)throw"UTF-8 decode: incomplete 2-byte sequence";a=(31&a)<<6|63&e[t]}else if(a>223&&a<240){if(t+1>=e.length)throw"UTF-8 decode: incomplete 3-byte sequence";a=(15&a)<<12|(63&e[t])<<6|63&e[++t]}else{if(!(a>239&&a<248))throw"UTF-8 decode: unknown multibyte start 0x"+a.toString(16)+" at index "+(t-1);if(t+2>=e.length)throw"UTF-8 decode: incomplete 4-byte sequence";a=(7&a)<<18|(63&e[t])<<12|(63&e[++t])<<6|63&e[++t]}++t}if(a<=65535)r+=String.fromCharCode(a);else{if(!(a<=1114111))throw"UTF-8 decode: code point 0x"+a.toString(16)+" exceeds UTF-16 reach";a-=65536,r+=String.fromCharCode(a>>10|55296),r+=String.fromCharCode(1023&a|56320)}}return r}function PaxHeader(e){this._fields=e}function TarFile(){}function UntarStream(e){this._bufferView=new DataView(e),this._position=0}function UntarFileStream(e){this._stream=new UntarStream(e),this._globalPaxHeader=null}if(UntarWorker.prototype={onmessage:function(e){try{if("extract"!==e.data.type)throw new Error("Unknown message type: "+e.data.type);this.untarBuffer(e.data.buffer)}catch(r){this.postError(r)}},postError:function(e){this.postMessage({type:"error",data:{message:e.message}})},postLog:function(e,r){this.postMessage({type:"log",data:{level:e,msg:r}})},untarBuffer:function(e){try{for(var r=new UntarFileStream(e);r.hasNext();){var t=r.next();this.postMessage({type:"extract",data:t},[t.buffer])}this.postMessage({type:"complete"})}catch(a){this.postError(a)}},postMessage:function(e,r){self.postMessage(e,r)}},"undefined"!=typeof self){var worker=new UntarWorker;self.onmessage=function(e){worker.onmessage(e)}}PaxHeader.parse=function(e){for(var r=new Uint8Array(e),t=[];r.length>0;){var a=parseInt(decodeUTF8(r.subarray(0,r.indexOf(32)))),n=decodeUTF8(r.subarray(0,a)),i=n.match(/^\\d+ ([^=]+)=(.*)\\n$/);if(null===i)throw new Error("Invalid PAX header data format.");var s=i[1],o=i[2];0===o.length?o=null:null!==o.match(/^\\d+$/)&&(o=parseInt(o));var f={name:s,value:o};t.push(f),r=r.subarray(a)}return new PaxHeader(t)},PaxHeader.prototype={applyHeader:function(e){this._fields.forEach(function(r){var t=r.name,a=r.value;"path"===t?(t="name",void 0!==e.prefix&&delete e.prefix):"linkpath"===t&&(t="linkname"),null===a?delete e[t]:e[t]=a})}},UntarStream.prototype={readString:function(e){for(var r=1,t=e*r,a=[],n=0;n<e;++n){var i=this._bufferView.getUint8(this.position()+n*r,!0);if(0===i)break;a.push(i)}return this.seek(t),String.fromCharCode.apply(null,a)},readBuffer:function(e){var r;if("function"==typeof ArrayBuffer.prototype.slice)r=this._bufferView.buffer.slice(this.position(),this.position()+e);else{r=new ArrayBuffer(e);var t=new Uint8Array(r),a=new Uint8Array(this._bufferView.buffer,this.position(),e);t.set(a)}return this.seek(e),r},seek:function(e){this._position+=e},peekUint32:function(){return this._bufferView.getUint32(this.position(),!0)},position:function(e){return void 0===e?this._position:void(this._position=e)},size:function(){return this._bufferView.byteLength}},UntarFileStream.prototype={hasNext:function(){return this._stream.position()+4<this._stream.size()&&0!==this._stream.peekUint32()},next:function(){return this._readNextFile()},_readNextFile:function(){var e=this._stream,r=new TarFile,t=!1,a=null,n=e.position(),i=n+512;switch(r.name=e.readString(100),r.mode=e.readString(8),r.uid=parseInt(e.readString(8)),r.gid=parseInt(e.readString(8)),r.size=parseInt(e.readString(12),8),r.mtime=parseInt(e.readString(12),8),r.checksum=parseInt(e.readString(8)),r.type=e.readString(1),r.linkname=e.readString(100),r.ustarFormat=e.readString(6),r.ustarFormat.indexOf("ustar")>-1&&(r.version=e.readString(2),r.uname=e.readString(32),r.gname=e.readString(32),r.devmajor=parseInt(e.readString(8)),r.devminor=parseInt(e.readString(8)),r.namePrefix=e.readString(155),r.namePrefix.length>0&&(r.name=r.namePrefix+"/"+r.name)),e.position(i),r.type){case"0":case"":r.buffer=e.readBuffer(r.size);break;case"1":break;case"2":break;case"3":break;case"4":break;case"5":break;case"6":break;case"7":break;case"g":t=!0,this._globalPaxHeader=PaxHeader.parse(e.readBuffer(r.size));break;case"x":t=!0,a=PaxHeader.parse(e.readBuffer(r.size))}void 0===r.buffer&&(r.buffer=new ArrayBuffer(0));var s=i+r.size;return r.size%512!==0&&(s+=512-r.size%512),e.position(s),t&&(r=this._readNextFile()),null!==this._globalPaxHeader&&this._globalPaxHeader.applyHeader(r),null!==a&&a.applyHeader(r),r}};'])),function(i){if(!(i instanceof ArrayBuffer))throw new TypeError("arrayBuffer is not an instance of ArrayBuffer.");if(!n.Worker)throw new Error("Worker implementation is not available in this environment.");return new t((function(t,n,o){var s=new Worker(r),a=[];s.onerror=function(t){n(t)},s.onmessage=function(r){switch((r=r.data).type){case"log":console[r.data.level]("Worker: "+r.data.msg);break;case"extract":var i=e(r.data);a.push(i),o(i);break;case"complete":s.terminate(),t(a);break;case"error":s.terminate(),n(new Error(r.data.message));break;default:s.terminate(),n(new Error("Unknown message from worker: "+r.type))}},s.postMessage({type:"extract",buffer:i},[i])}))}}.apply(e,[]))||(t.exports=r)},470:(t,e,r)=>{"use strict";var n=r(155);function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function o(t,e){for(var r,n="",i=0,o=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)r=t.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var f=n.lastIndexOf("/");if(f!==n.length-1){-1===f?(n="",i=0):i=(n=n.slice(0,f)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}e&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+t.slice(o+1,a):n=t.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var s={resolve:function(){for(var t,e="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var a;s>=0?a=arguments[s]:(void 0===t&&(t=n.cwd()),a=t),i(a),0!==a.length&&(e=a+"/"+e,r=47===a.charCodeAt(0))}return e=o(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),r=47===t.charCodeAt(t.length-1);return 0!==(t=o(t,!e)).length||e||(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];i(r),r.length>0&&(void 0===t?t=r:t+="/"+r)}return void 0===t?".":s.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=s.resolve(t))===(e=s.resolve(e)))return"";for(var r=1;r<t.length&&47===t.charCodeAt(r);++r);for(var n=t.length,o=n-r,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var f=e.length-a,u=o<f?o:f,h=-1,l=0;l<=u;++l){if(l===u){if(f>u){if(47===e.charCodeAt(a+l))return e.slice(a+l+1);if(0===l)return e.slice(a+l)}else o>u&&(47===t.charCodeAt(r+l)?h=l:0===l&&(h=0));break}var c=t.charCodeAt(r+l);if(c!==e.charCodeAt(a+l))break;47===c&&(h=l)}var p="";for(l=r+h+1;l<=n;++l)l!==n&&47!==t.charCodeAt(l)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(a+h):(a+=h,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,o=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!o){n=s;break}}else o=!1;return-1===n?r?"/":".":r&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var r,n=0,o=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,f=-1;for(r=t.length-1;r>=0;--r){var u=t.charCodeAt(r);if(47===u){if(!s){n=r+1;break}}else-1===f&&(s=!1,f=r+1),a>=0&&(u===e.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=f))}return n===o?o=f:-1===o&&(o=t.length),t.slice(n,o)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!s){n=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":t.slice(n,o)},extname:function(t){i(t);for(var e=-1,r=0,n=-1,o=!0,s=0,a=t.length-1;a>=0;--a){var f=t.charCodeAt(a);if(47!==f)-1===n&&(o=!1,n=a+1),46===f?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!o){r=a+1;break}}return-1===e||-1===n||0===s||1===s&&e===n-1&&e===r+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+"/"+n:n}(0,t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r,n=t.charCodeAt(0),o=47===n;o?(e.root="/",r=1):r=0;for(var s=-1,a=0,f=-1,u=!0,h=t.length-1,l=0;h>=r;--h)if(47!==(n=t.charCodeAt(h)))-1===f&&(u=!1,f=h+1),46===n?-1===s?s=h:1!==l&&(l=1):-1!==s&&(l=-1);else if(!u){a=h+1;break}return-1===s||-1===f||0===l||1===l&&s===f-1&&s===a+1?-1!==f&&(e.base=e.name=0===a&&o?t.slice(1,f):t.slice(a,f)):(0===a&&o?(e.name=t.slice(1,s),e.base=t.slice(1,f)):(e.name=t.slice(a,s),e.base=t.slice(a,f)),e.ext=t.slice(s,f)),a>0?e.dir=t.slice(0,a-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,t.exports=s},155:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,f=[],u=!1,h=-1;function l(){u&&a&&(u=!1,a.length?f=a.concat(f):h=-1,f.length&&c())}function c(){if(!u){var t=s(l);u=!0;for(var e=f.length;e;){for(a=f,f=[];++h<e;)a&&a[h].run();h=-1,e=f.length}a=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new p(t,e)),1!==f.length||u||s(c)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},798:(t,e,r)=>{"use strict";var n=r(155),i=65536,o=r(509).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(t);if(t>0)if(t>i)for(var a=0;a<t;a+=i)s.getRandomValues(r.slice(a,a+i));else s.getRandomValues(r);return"function"==typeof e?n.nextTick((function(){e(null,r)})):r}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},963:(t,e,r)=>{"use strict";var n=r(155);function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(509),s=r(798),a=o.Buffer,f=o.kMaxLength,u=r.g.crypto||r.g.msCrypto,h=Math.pow(2,32)-1;function l(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>h||t<0)throw new TypeError("offset must be a uint32");if(t>f||t>e)throw new RangeError("offset out of range")}function c(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>h||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>f)throw new RangeError("buffer too small")}function p(t,e,r,i){if(n.browser){var o=t.buffer,a=new Uint8Array(o,e,r);return u.getRandomValues(a),i?void n.nextTick((function(){i(null,t)})):t}if(!i)return s(r).copy(t,e),t;s(r,(function(r,n){if(r)return i(r);n.copy(t,e),i(null,t)}))}u&&u.getRandomValues||!n.browser?(e.randomFill=function(t,e,n,i){if(!(a.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return l(e,t.length),c(n,e,t.length),p(t,e,n,i)},e.randomFillSync=function(t,e,n){if(void 0===e&&(e=0),!(a.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return l(e,t.length),void 0===n&&(n=t.length-e),c(n,e,t.length),p(t,e,n)}):(e.randomFill=i,e.randomFillSync=i)},509:(t,e,r)=>{var n=r(764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},440:(t,e)=>{for(var r="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(",">>",">\\&","[&;()|<>]"].join("|")+")",n="",i=0;i<4;i++)n+=(Math.pow(16,8)*Math.random()).toString(16);e.Q=function(t,e,i){var o=function(t,e,i){var o=new RegExp(["("+r+")","((\\\\['\"|&;()<> \\t]|[^\\s'\"|&;()<> \\t])+|\"((\\\\\"|[^\"])*?)\"|'((\\\\'|[^'])*?)')*"].join("|"),"g"),s=t.match(o).filter(Boolean),a=!1;return s?(e||(e={}),i||(i={}),s.map((function(t,o){if(!a){if(RegExp("^"+r+"$").test(t))return{op:t};for(var f=i.escape||"\\",u=!1,h=!1,l="",c=!1,p=0,d=t.length;p<d;p++){var _=t.charAt(p);if(c=c||!u&&("*"===_||"?"===_),h)l+=_,h=!1;else if(u)_===u?u=!1:"'"==u?l+=_:_===f?(p+=1,l+='"'===(_=t.charAt(p))||_===f||"$"===_?_:f+_):l+="$"===_?g():_;else if('"'===_||"'"===_)u=_;else{if(RegExp("^"+r+"$").test(_))return{op:t};if(RegExp("^#$").test(_))return a=!0,l.length?[l,{comment:t.slice(p+1)+s.slice(o+1).join(" ")}]:[{comment:t.slice(p+1)+s.slice(o+1).join(" ")}];_===f?h=!0:l+="$"===_?g():_}}return c?{op:"glob",pattern:l}:l}function g(){var r,i,o,s,a;if(p+=1,"{"===t.charAt(p)){if(p+=1,"}"===t.charAt(p))throw new Error("Bad substitution: "+t.substr(p-2,3));if((r=t.indexOf("}",p))<0)throw new Error("Bad substitution: "+t.substr(p));i=t.substr(p,r-p),p=r}else/[*@#?$!_\-]/.test(t.charAt(p))?(i=t.charAt(p),p+=1):(r=t.substr(p).match(/[^\w\d_]/))?(i=t.substr(p,r.index),p+=r.index-1):(i=t.substr(p),p=t.length);return o="",s=i,void 0===(a="function"==typeof e?e(s):e[s])&&""!=s?a="":void 0===a&&(a="$"),"object"==typeof a?o+n+JSON.stringify(a)+n:o+a}})).reduce((function(t,e){return void 0===e?t:t.concat(e)}),[])):[]}(t,e,i);return"function"!=typeof e?o:o.reduce((function(t,e){if("object"==typeof e)return t.concat(e);var r=e.split(RegExp("("+n+".*?"+n+")","g"));return 1===r.length?t.concat(r[0]):t.concat(r.filter(Boolean).map((function(t){return RegExp("^"+n).test(t)?JSON.parse(t.split(n)[1]):t})))}),[])}},617:t=>{self,t.exports=(()=>{"use strict";var t={775:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FitAddon=void 0;var r=function(){function t(){}return t.prototype.activate=function(t){this._terminal=t},t.prototype.dispose=function(){},t.prototype.fit=function(){var t=this.proposeDimensions();if(t&&this._terminal){var e=this._terminal._core;this._terminal.rows===t.rows&&this._terminal.cols===t.cols||(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}},t.prototype.proposeDimensions=function(){if(this._terminal&&this._terminal.element&&this._terminal.element.parentElement){var t=this._terminal._core;if(0!==t._renderService.dimensions.actualCellWidth&&0!==t._renderService.dimensions.actualCellHeight){var e=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(e.getPropertyValue("height")),n=Math.max(0,parseInt(e.getPropertyValue("width"))),i=window.getComputedStyle(this._terminal.element),o=r-(parseInt(i.getPropertyValue("padding-top"))+parseInt(i.getPropertyValue("padding-bottom"))),s=n-(parseInt(i.getPropertyValue("padding-right"))+parseInt(i.getPropertyValue("padding-left")))-t.viewport.scrollBarWidth;return{cols:Math.max(2,Math.floor(s/t._renderService.dimensions.actualCellWidth)),rows:Math.max(1,Math.floor(o/t._renderService.dimensions.actualCellHeight))}}}},t}();e.FitAddon=r}},e={};return function r(n){if(e[n])return e[n].exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}(775)})()},498:t=>{"use strict";t.exports='/*! For license information please see worker.compiled.js.LICENSE.txt */\n!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.main=e():t.main=e()}(self,(function(){return(()=>{var t={311:(t,e,r)=>{"use strict";const n=r(963),i=r(986),o=r(470),s=r(946),a={hrtime:r(998).default(i.default),exit:t=>{throw new s.WASIExitError(t)},kill:t=>{throw new s.WASIKillError(t)},randomFillSync:n.randomFillSync,isTTY:()=>!0,path:o,fs:null};e.Z=a},55:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(642);e.WASI_ESUCCESS=0,e.WASI_E2BIG=1,e.WASI_EACCES=2,e.WASI_EADDRINUSE=3,e.WASI_EADDRNOTAVAIL=4,e.WASI_EAFNOSUPPORT=5,e.WASI_EAGAIN=6,e.WASI_EALREADY=7,e.WASI_EBADF=8,e.WASI_EBADMSG=9,e.WASI_EBUSY=10,e.WASI_ECANCELED=11,e.WASI_ECHILD=12,e.WASI_ECONNABORTED=13,e.WASI_ECONNREFUSED=14,e.WASI_ECONNRESET=15,e.WASI_EDEADLK=16,e.WASI_EDESTADDRREQ=17,e.WASI_EDOM=18,e.WASI_EDQUOT=19,e.WASI_EEXIST=20,e.WASI_EFAULT=21,e.WASI_EFBIG=22,e.WASI_EHOSTUNREACH=23,e.WASI_EIDRM=24,e.WASI_EILSEQ=25,e.WASI_EINPROGRESS=26,e.WASI_EINTR=27,e.WASI_EINVAL=28,e.WASI_EIO=29,e.WASI_EISCONN=30,e.WASI_EISDIR=31,e.WASI_ELOOP=32,e.WASI_EMFILE=33,e.WASI_EMLINK=34,e.WASI_EMSGSIZE=35,e.WASI_EMULTIHOP=36,e.WASI_ENAMETOOLONG=37,e.WASI_ENETDOWN=38,e.WASI_ENETRESET=39,e.WASI_ENETUNREACH=40,e.WASI_ENFILE=41,e.WASI_ENOBUFS=42,e.WASI_ENODEV=43,e.WASI_ENOENT=44,e.WASI_ENOEXEC=45,e.WASI_ENOLCK=46,e.WASI_ENOLINK=47,e.WASI_ENOMEM=48,e.WASI_ENOMSG=49,e.WASI_ENOPROTOOPT=50,e.WASI_ENOSPC=51,e.WASI_ENOSYS=52,e.WASI_ENOTCONN=53,e.WASI_ENOTDIR=54,e.WASI_ENOTEMPTY=55,e.WASI_ENOTRECOVERABLE=56,e.WASI_ENOTSOCK=57,e.WASI_ENOTSUP=58,e.WASI_ENOTTY=59,e.WASI_ENXIO=60,e.WASI_EOVERFLOW=61,e.WASI_EOWNERDEAD=62,e.WASI_EPERM=63,e.WASI_EPIPE=64,e.WASI_EPROTO=65,e.WASI_EPROTONOSUPPORT=66,e.WASI_EPROTOTYPE=67,e.WASI_ERANGE=68,e.WASI_EROFS=69,e.WASI_ESPIPE=70,e.WASI_ESRCH=71,e.WASI_ESTALE=72,e.WASI_ETIMEDOUT=73,e.WASI_ETXTBSY=74,e.WASI_EXDEV=75,e.WASI_ENOTCAPABLE=76,e.WASI_SIGABRT=0,e.WASI_SIGALRM=1,e.WASI_SIGBUS=2,e.WASI_SIGCHLD=3,e.WASI_SIGCONT=4,e.WASI_SIGFPE=5,e.WASI_SIGHUP=6,e.WASI_SIGILL=7,e.WASI_SIGINT=8,e.WASI_SIGKILL=9,e.WASI_SIGPIPE=10,e.WASI_SIGQUIT=11,e.WASI_SIGSEGV=12,e.WASI_SIGSTOP=13,e.WASI_SIGTERM=14,e.WASI_SIGTRAP=15,e.WASI_SIGTSTP=16,e.WASI_SIGTTIN=17,e.WASI_SIGTTOU=18,e.WASI_SIGURG=19,e.WASI_SIGUSR1=20,e.WASI_SIGUSR2=21,e.WASI_SIGVTALRM=22,e.WASI_SIGXCPU=23,e.WASI_SIGXFSZ=24,e.WASI_FILETYPE_UNKNOWN=0,e.WASI_FILETYPE_BLOCK_DEVICE=1,e.WASI_FILETYPE_CHARACTER_DEVICE=2,e.WASI_FILETYPE_DIRECTORY=3,e.WASI_FILETYPE_REGULAR_FILE=4,e.WASI_FILETYPE_SOCKET_DGRAM=5,e.WASI_FILETYPE_SOCKET_STREAM=6,e.WASI_FILETYPE_SYMBOLIC_LINK=7,e.WASI_FDFLAG_APPEND=1,e.WASI_FDFLAG_DSYNC=2,e.WASI_FDFLAG_NONBLOCK=4,e.WASI_FDFLAG_RSYNC=8,e.WASI_FDFLAG_SYNC=16,e.WASI_RIGHT_FD_DATASYNC=n.BigIntPolyfill(1),e.WASI_RIGHT_FD_READ=n.BigIntPolyfill(2),e.WASI_RIGHT_FD_SEEK=n.BigIntPolyfill(4),e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS=n.BigIntPolyfill(8),e.WASI_RIGHT_FD_SYNC=n.BigIntPolyfill(16),e.WASI_RIGHT_FD_TELL=n.BigIntPolyfill(32),e.WASI_RIGHT_FD_WRITE=n.BigIntPolyfill(64),e.WASI_RIGHT_FD_ADVISE=n.BigIntPolyfill(128),e.WASI_RIGHT_FD_ALLOCATE=n.BigIntPolyfill(256),e.WASI_RIGHT_PATH_CREATE_DIRECTORY=n.BigIntPolyfill(512),e.WASI_RIGHT_PATH_CREATE_FILE=n.BigIntPolyfill(1024),e.WASI_RIGHT_PATH_LINK_SOURCE=n.BigIntPolyfill(2048),e.WASI_RIGHT_PATH_LINK_TARGET=n.BigIntPolyfill(4096),e.WASI_RIGHT_PATH_OPEN=n.BigIntPolyfill(8192),e.WASI_RIGHT_FD_READDIR=n.BigIntPolyfill(16384),e.WASI_RIGHT_PATH_READLINK=n.BigIntPolyfill(32768),e.WASI_RIGHT_PATH_RENAME_SOURCE=n.BigIntPolyfill(65536),e.WASI_RIGHT_PATH_RENAME_TARGET=n.BigIntPolyfill(131072),e.WASI_RIGHT_PATH_FILESTAT_GET=n.BigIntPolyfill(262144),e.WASI_RIGHT_PATH_FILESTAT_SET_SIZE=n.BigIntPolyfill(524288),e.WASI_RIGHT_PATH_FILESTAT_SET_TIMES=n.BigIntPolyfill(1048576),e.WASI_RIGHT_FD_FILESTAT_GET=n.BigIntPolyfill(2097152),e.WASI_RIGHT_FD_FILESTAT_SET_SIZE=n.BigIntPolyfill(4194304),e.WASI_RIGHT_FD_FILESTAT_SET_TIMES=n.BigIntPolyfill(8388608),e.WASI_RIGHT_PATH_SYMLINK=n.BigIntPolyfill(16777216),e.WASI_RIGHT_PATH_REMOVE_DIRECTORY=n.BigIntPolyfill(33554432),e.WASI_RIGHT_PATH_UNLINK_FILE=n.BigIntPolyfill(67108864),e.WASI_RIGHT_POLL_FD_READWRITE=n.BigIntPolyfill(134217728),e.WASI_RIGHT_SOCK_SHUTDOWN=n.BigIntPolyfill(268435456),e.RIGHTS_ALL=e.WASI_RIGHT_FD_DATASYNC|e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_SEEK|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_SYNC|e.WASI_RIGHT_FD_TELL|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_ADVISE|e.WASI_RIGHT_FD_ALLOCATE|e.WASI_RIGHT_PATH_CREATE_DIRECTORY|e.WASI_RIGHT_PATH_CREATE_FILE|e.WASI_RIGHT_PATH_LINK_SOURCE|e.WASI_RIGHT_PATH_LINK_TARGET|e.WASI_RIGHT_PATH_OPEN|e.WASI_RIGHT_FD_READDIR|e.WASI_RIGHT_PATH_READLINK|e.WASI_RIGHT_PATH_RENAME_SOURCE|e.WASI_RIGHT_PATH_RENAME_TARGET|e.WASI_RIGHT_PATH_FILESTAT_GET|e.WASI_RIGHT_PATH_FILESTAT_SET_SIZE|e.WASI_RIGHT_PATH_FILESTAT_SET_TIMES|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_FD_FILESTAT_SET_TIMES|e.WASI_RIGHT_FD_FILESTAT_SET_SIZE|e.WASI_RIGHT_PATH_SYMLINK|e.WASI_RIGHT_PATH_UNLINK_FILE|e.WASI_RIGHT_PATH_REMOVE_DIRECTORY|e.WASI_RIGHT_POLL_FD_READWRITE|e.WASI_RIGHT_SOCK_SHUTDOWN,e.RIGHTS_BLOCK_DEVICE_BASE=e.RIGHTS_ALL,e.RIGHTS_BLOCK_DEVICE_INHERITING=e.RIGHTS_ALL,e.RIGHTS_CHARACTER_DEVICE_BASE=e.RIGHTS_ALL,e.RIGHTS_CHARACTER_DEVICE_INHERITING=e.RIGHTS_ALL,e.RIGHTS_REGULAR_FILE_BASE=e.WASI_RIGHT_FD_DATASYNC|e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_SEEK|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_SYNC|e.WASI_RIGHT_FD_TELL|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_ADVISE|e.WASI_RIGHT_FD_ALLOCATE|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_FD_FILESTAT_SET_SIZE|e.WASI_RIGHT_FD_FILESTAT_SET_TIMES|e.WASI_RIGHT_POLL_FD_READWRITE,e.RIGHTS_REGULAR_FILE_INHERITING=n.BigIntPolyfill(0),e.RIGHTS_DIRECTORY_BASE=e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_SYNC|e.WASI_RIGHT_FD_ADVISE|e.WASI_RIGHT_PATH_CREATE_DIRECTORY|e.WASI_RIGHT_PATH_CREATE_FILE|e.WASI_RIGHT_PATH_LINK_SOURCE|e.WASI_RIGHT_PATH_LINK_TARGET|e.WASI_RIGHT_PATH_OPEN|e.WASI_RIGHT_FD_READDIR|e.WASI_RIGHT_PATH_READLINK|e.WASI_RIGHT_PATH_RENAME_SOURCE|e.WASI_RIGHT_PATH_RENAME_TARGET|e.WASI_RIGHT_PATH_FILESTAT_GET|e.WASI_RIGHT_PATH_FILESTAT_SET_SIZE|e.WASI_RIGHT_PATH_FILESTAT_SET_TIMES|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_FD_FILESTAT_SET_TIMES|e.WASI_RIGHT_PATH_SYMLINK|e.WASI_RIGHT_PATH_UNLINK_FILE|e.WASI_RIGHT_PATH_REMOVE_DIRECTORY|e.WASI_RIGHT_POLL_FD_READWRITE,e.RIGHTS_DIRECTORY_INHERITING=e.RIGHTS_DIRECTORY_BASE|e.RIGHTS_REGULAR_FILE_BASE,e.RIGHTS_SOCKET_BASE=e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_POLL_FD_READWRITE|e.WASI_RIGHT_SOCK_SHUTDOWN,e.RIGHTS_SOCKET_INHERITING=e.RIGHTS_ALL,e.RIGHTS_TTY_BASE=e.WASI_RIGHT_FD_READ|e.WASI_RIGHT_FD_FDSTAT_SET_FLAGS|e.WASI_RIGHT_FD_WRITE|e.WASI_RIGHT_FD_FILESTAT_GET|e.WASI_RIGHT_POLL_FD_READWRITE,e.RIGHTS_TTY_INHERITING=n.BigIntPolyfill(0),e.WASI_CLOCK_REALTIME=0,e.WASI_CLOCK_MONOTONIC=1,e.WASI_CLOCK_PROCESS_CPUTIME_ID=2,e.WASI_CLOCK_THREAD_CPUTIME_ID=3,e.WASI_EVENTTYPE_CLOCK=0,e.WASI_EVENTTYPE_FD_READ=1,e.WASI_EVENTTYPE_FD_WRITE=2,e.WASI_FILESTAT_SET_ATIM=1,e.WASI_FILESTAT_SET_ATIM_NOW=2,e.WASI_FILESTAT_SET_MTIM=4,e.WASI_FILESTAT_SET_MTIM_NOW=8,e.WASI_O_CREAT=1,e.WASI_O_DIRECTORY=2,e.WASI_O_EXCL=4,e.WASI_O_TRUNC=8,e.WASI_PREOPENTYPE_DIR=0,e.WASI_DIRCOOKIE_START=0,e.WASI_STDIN_FILENO=0,e.WASI_STDOUT_FILENO=1,e.WASI_STDERR_FILENO=2,e.WASI_WHENCE_SET=0,e.WASI_WHENCE_CUR=1,e.WASI_WHENCE_END=2,e.ERROR_MAP={E2BIG:e.WASI_E2BIG,EACCES:e.WASI_EACCES,EADDRINUSE:e.WASI_EADDRINUSE,EADDRNOTAVAIL:e.WASI_EADDRNOTAVAIL,EAFNOSUPPORT:e.WASI_EAFNOSUPPORT,EALREADY:e.WASI_EALREADY,EAGAIN:e.WASI_EAGAIN,EBADF:e.WASI_EBADF,EBADMSG:e.WASI_EBADMSG,EBUSY:e.WASI_EBUSY,ECANCELED:e.WASI_ECANCELED,ECHILD:e.WASI_ECHILD,ECONNABORTED:e.WASI_ECONNABORTED,ECONNREFUSED:e.WASI_ECONNREFUSED,ECONNRESET:e.WASI_ECONNRESET,EDEADLOCK:e.WASI_EDEADLK,EDESTADDRREQ:e.WASI_EDESTADDRREQ,EDOM:e.WASI_EDOM,EDQUOT:e.WASI_EDQUOT,EEXIST:e.WASI_EEXIST,EFAULT:e.WASI_EFAULT,EFBIG:e.WASI_EFBIG,EHOSTDOWN:e.WASI_EHOSTUNREACH,EHOSTUNREACH:e.WASI_EHOSTUNREACH,EIDRM:e.WASI_EIDRM,EILSEQ:e.WASI_EILSEQ,EINPROGRESS:e.WASI_EINPROGRESS,EINTR:e.WASI_EINTR,EINVAL:e.WASI_EINVAL,EIO:e.WASI_EIO,EISCONN:e.WASI_EISCONN,EISDIR:e.WASI_EISDIR,ELOOP:e.WASI_ELOOP,EMFILE:e.WASI_EMFILE,EMLINK:e.WASI_EMLINK,EMSGSIZE:e.WASI_EMSGSIZE,EMULTIHOP:e.WASI_EMULTIHOP,ENAMETOOLONG:e.WASI_ENAMETOOLONG,ENETDOWN:e.WASI_ENETDOWN,ENETRESET:e.WASI_ENETRESET,ENETUNREACH:e.WASI_ENETUNREACH,ENFILE:e.WASI_ENFILE,ENOBUFS:e.WASI_ENOBUFS,ENODEV:e.WASI_ENODEV,ENOENT:e.WASI_ENOENT,ENOEXEC:e.WASI_ENOEXEC,ENOLCK:e.WASI_ENOLCK,ENOLINK:e.WASI_ENOLINK,ENOMEM:e.WASI_ENOMEM,ENOMSG:e.WASI_ENOMSG,ENOPROTOOPT:e.WASI_ENOPROTOOPT,ENOSPC:e.WASI_ENOSPC,ENOSYS:e.WASI_ENOSYS,ENOTCONN:e.WASI_ENOTCONN,ENOTDIR:e.WASI_ENOTDIR,ENOTEMPTY:e.WASI_ENOTEMPTY,ENOTRECOVERABLE:e.WASI_ENOTRECOVERABLE,ENOTSOCK:e.WASI_ENOTSOCK,ENOTTY:e.WASI_ENOTTY,ENXIO:e.WASI_ENXIO,EOVERFLOW:e.WASI_EOVERFLOW,EOWNERDEAD:e.WASI_EOWNERDEAD,EPERM:e.WASI_EPERM,EPIPE:e.WASI_EPIPE,EPROTO:e.WASI_EPROTO,EPROTONOSUPPORT:e.WASI_EPROTONOSUPPORT,EPROTOTYPE:e.WASI_EPROTOTYPE,ERANGE:e.WASI_ERANGE,EROFS:e.WASI_EROFS,ESPIPE:e.WASI_ESPIPE,ESRCH:e.WASI_ESRCH,ESTALE:e.WASI_ESTALE,ETIMEDOUT:e.WASI_ETIMEDOUT,ETXTBSY:e.WASI_ETXTBSY,EXDEV:e.WASI_EXDEV},e.SIGNAL_MAP={[e.WASI_SIGHUP]:"SIGHUP",[e.WASI_SIGINT]:"SIGINT",[e.WASI_SIGQUIT]:"SIGQUIT",[e.WASI_SIGILL]:"SIGILL",[e.WASI_SIGTRAP]:"SIGTRAP",[e.WASI_SIGABRT]:"SIGABRT",[e.WASI_SIGBUS]:"SIGBUS",[e.WASI_SIGFPE]:"SIGFPE",[e.WASI_SIGKILL]:"SIGKILL",[e.WASI_SIGUSR1]:"SIGUSR1",[e.WASI_SIGSEGV]:"SIGSEGV",[e.WASI_SIGUSR2]:"SIGUSR2",[e.WASI_SIGPIPE]:"SIGPIPE",[e.WASI_SIGALRM]:"SIGALRM",[e.WASI_SIGTERM]:"SIGTERM",[e.WASI_SIGCHLD]:"SIGCHLD",[e.WASI_SIGCONT]:"SIGCONT",[e.WASI_SIGSTOP]:"SIGSTOP",[e.WASI_SIGTSTP]:"SIGTSTP",[e.WASI_SIGTTIN]:"SIGTTIN",[e.WASI_SIGTTOU]:"SIGTTOU",[e.WASI_SIGURG]:"SIGURG",[e.WASI_SIGXCPU]:"SIGXCPU",[e.WASI_SIGXFSZ]:"SIGXFSZ",[e.WASI_SIGVTALRM]:"SIGVTALRM"}},946:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(642),i=r(961),o=r(744);let s;const a=r(55),f=a.WASI_RIGHT_FD_DATASYNC|a.WASI_RIGHT_FD_READ|a.WASI_RIGHT_FD_SYNC|a.WASI_RIGHT_FD_ADVISE|a.WASI_RIGHT_FD_FILESTAT_GET|a.WASI_RIGHT_POLL_FD_READWRITE,u=a.WASI_RIGHT_FD_DATASYNC|a.WASI_RIGHT_FD_WRITE|a.WASI_RIGHT_FD_SYNC|a.WASI_RIGHT_FD_ADVISE|a.WASI_RIGHT_FD_FILESTAT_GET|a.WASI_RIGHT_POLL_FD_READWRITE,h=u,c=t=>{const e=Math.trunc(t),r=n.BigIntPolyfill(Math.round(1e6*(t-e)));return n.BigIntPolyfill(e)*n.BigIntPolyfill(1e6)+r},l=t=>{"number"==typeof t&&(t=Math.trunc(t));const e=n.BigIntPolyfill(t);return Number(e/n.BigIntPolyfill(1e6))},p=t=>(...e)=>{try{return t(...e)}catch(t){if(t&&t.code&&"string"==typeof t.code)return a.ERROR_MAP[t.code]||a.WASI_EINVAL;if(t instanceof g)return t.errno;throw t}},d=(t,e)=>{const r=t.FD_MAP.get(e);if(!r)throw new g(a.WASI_EBADF);if(void 0===r.filetype){const n=t.bindings.fs.fstatSync(r.real),{filetype:i,rightsBase:o,rightsInheriting:s}=y(t,e,n);r.filetype=i,r.rights||(r.rights={base:o,inheriting:s})}return r},y=(t,e,r)=>{switch(!0){case r.isBlockDevice():return{filetype:a.WASI_FILETYPE_BLOCK_DEVICE,rightsBase:a.RIGHTS_BLOCK_DEVICE_BASE,rightsInheriting:a.RIGHTS_BLOCK_DEVICE_INHERITING};case r.isCharacterDevice():{const r=a.WASI_FILETYPE_CHARACTER_DEVICE;return void 0!==e&&t.bindings.isTTY(e)?{filetype:r,rightsBase:a.RIGHTS_TTY_BASE,rightsInheriting:a.RIGHTS_TTY_INHERITING}:{filetype:r,rightsBase:a.RIGHTS_CHARACTER_DEVICE_BASE,rightsInheriting:a.RIGHTS_CHARACTER_DEVICE_INHERITING}}case r.isDirectory():return{filetype:a.WASI_FILETYPE_DIRECTORY,rightsBase:a.RIGHTS_DIRECTORY_BASE,rightsInheriting:a.RIGHTS_DIRECTORY_INHERITING};case r.isFIFO():return{filetype:a.WASI_FILETYPE_SOCKET_STREAM,rightsBase:a.RIGHTS_SOCKET_BASE,rightsInheriting:a.RIGHTS_SOCKET_INHERITING};case r.isFile():return{filetype:a.WASI_FILETYPE_REGULAR_FILE,rightsBase:a.RIGHTS_REGULAR_FILE_BASE,rightsInheriting:a.RIGHTS_REGULAR_FILE_INHERITING};case r.isSocket():return{filetype:a.WASI_FILETYPE_SOCKET_STREAM,rightsBase:a.RIGHTS_SOCKET_BASE,rightsInheriting:a.RIGHTS_SOCKET_INHERITING};case r.isSymbolicLink():return{filetype:a.WASI_FILETYPE_SYMBOLIC_LINK,rightsBase:n.BigIntPolyfill(0),rightsInheriting:n.BigIntPolyfill(0)};default:return{filetype:a.WASI_FILETYPE_UNKNOWN,rightsBase:n.BigIntPolyfill(0),rightsInheriting:n.BigIntPolyfill(0)}}};class g extends Error{constructor(t){super(),this.errno=t,Object.setPrototypeOf(this,g.prototype)}}e.WASIError=g;class _ extends Error{constructor(t){super(`WASI Exit error: ${t}`),this.code=t,Object.setPrototypeOf(this,_.prototype)}}e.WASIExitError=_;class E extends Error{constructor(t){super(`WASI Kill signal: ${t}`),this.signal=t,Object.setPrototypeOf(this,E.prototype)}}e.WASIKillError=E;class S{constructor(t){let e={};t&&t.preopens?e=t.preopens:t&&t.preopenDirectories&&(e=t.preopenDirectories);let r={};t&&t.env&&(r=t.env);let i=[];t&&t.args&&(i=t.args);let _=s;t&&t.bindings&&(_=t.bindings),this.memory=void 0,this.view=void 0,this.bindings=_,this.FD_MAP=new Map([[a.WASI_STDIN_FILENO,{real:0,filetype:a.WASI_FILETYPE_CHARACTER_DEVICE,rights:{base:f,inheriting:n.BigIntPolyfill(0)},path:void 0}],[a.WASI_STDOUT_FILENO,{real:1,filetype:a.WASI_FILETYPE_CHARACTER_DEVICE,rights:{base:u,inheriting:n.BigIntPolyfill(0)},path:void 0}],[a.WASI_STDERR_FILENO,{real:2,filetype:a.WASI_FILETYPE_CHARACTER_DEVICE,rights:{base:h,inheriting:n.BigIntPolyfill(0)},path:void 0}]]);let E=this.bindings.fs,S=this.bindings.path;for(const[t,r]of Object.entries(e)){const e=E.openSync(r,E.constants.O_RDONLY),n=[...this.FD_MAP.keys()].reverse()[0]+1;this.FD_MAP.set(n,{real:e,filetype:a.WASI_FILETYPE_DIRECTORY,rights:{base:a.RIGHTS_DIRECTORY_BASE,inheriting:a.RIGHTS_DIRECTORY_INHERITING},fakePath:t,path:r})}const m=(t,e)=>(this.refreshMemory(),Array.from({length:e},((e,r)=>{const n=t+8*r,i=this.view.getUint32(n,!0),o=this.view.getUint32(n+4,!0);return new Uint8Array(this.memory.buffer,i,o)}))),I=(t,e)=>{const r=d(this,t);if(e!==n.BigIntPolyfill(0)&&(r.rights.base&e)===n.BigIntPolyfill(0))throw new g(a.WASI_EPERM);return r},A=_.hrtime(),v=t=>{switch(t){case a.WASI_CLOCK_MONOTONIC:return _.hrtime();case a.WASI_CLOCK_REALTIME:return c(Date.now());case a.WASI_CLOCK_PROCESS_CPUTIME_ID:case a.WASI_CLOCK_THREAD_CPUTIME_ID:return _.hrtime()-A;default:return null}};this.wasiImport={args_get:(t,e)=>{this.refreshMemory();let r=t,n=e;return i.forEach((t=>{this.view.setUint32(r,n,!0),r+=4,n+=o.default.from(this.memory.buffer).write(`${t}\\0`,n)})),a.WASI_ESUCCESS},args_sizes_get:(t,e)=>{this.refreshMemory(),this.view.setUint32(t,i.length,!0);const r=i.reduce(((t,e)=>t+o.default.byteLength(e)+1),0);return this.view.setUint32(e,r,!0),a.WASI_ESUCCESS},environ_get:(t,e)=>{this.refreshMemory();let n=t,i=e;return Object.entries(r).forEach((([t,e])=>{this.view.setUint32(n,i,!0),n+=4,i+=o.default.from(this.memory.buffer).write(`${t}=${e}\\0`,i)})),a.WASI_ESUCCESS},environ_sizes_get:(t,e)=>{this.refreshMemory();const n=Object.entries(r).map((([t,e])=>`${t}=${e}\\0`)),i=n.reduce(((t,e)=>t+o.default.byteLength(e)),0);return this.view.setUint32(t,n.length,!0),this.view.setUint32(e,i,!0),a.WASI_ESUCCESS},clock_res_get:(t,e)=>{let r;switch(t){case a.WASI_CLOCK_MONOTONIC:case a.WASI_CLOCK_PROCESS_CPUTIME_ID:case a.WASI_CLOCK_THREAD_CPUTIME_ID:r=n.BigIntPolyfill(1);break;case a.WASI_CLOCK_REALTIME:r=n.BigIntPolyfill(1e3)}return this.view.setBigUint64(e,r),a.WASI_ESUCCESS},clock_time_get:(t,e,r)=>{this.refreshMemory();const i=v(t);return null===i?a.WASI_EINVAL:(this.view.setBigUint64(r,n.BigIntPolyfill(i),!0),a.WASI_ESUCCESS)},fd_advise:p(((t,e,r,n)=>(I(t,a.WASI_RIGHT_FD_ADVISE),a.WASI_ENOSYS))),fd_allocate:p(((t,e,r)=>(I(t,a.WASI_RIGHT_FD_ALLOCATE),a.WASI_ENOSYS))),fd_close:p((t=>{const e=I(t,n.BigIntPolyfill(0));return E.closeSync(e.real),this.FD_MAP.delete(t),a.WASI_ESUCCESS})),fd_datasync:p((t=>{const e=I(t,a.WASI_RIGHT_FD_DATASYNC);return E.fdatasyncSync(e.real),a.WASI_ESUCCESS})),fd_fdstat_get:p(((t,e)=>{const r=I(t,n.BigIntPolyfill(0));return this.refreshMemory(),this.view.setUint8(e,r.filetype),this.view.setUint16(e+2,0,!0),this.view.setUint16(e+4,0,!0),this.view.setBigUint64(e+8,n.BigIntPolyfill(r.rights.base),!0),this.view.setBigUint64(e+8+8,n.BigIntPolyfill(r.rights.inheriting),!0),a.WASI_ESUCCESS})),fd_fdstat_set_flags:p(((t,e)=>(I(t,a.WASI_RIGHT_FD_FDSTAT_SET_FLAGS),a.WASI_ENOSYS))),fd_fdstat_set_rights:p(((t,e,r)=>{const i=I(t,n.BigIntPolyfill(0));return(i.rights.base|e)>i.rights.base||(i.rights.inheriting|r)>i.rights.inheriting?a.WASI_EPERM:(i.rights.base=e,i.rights.inheriting=r,a.WASI_ESUCCESS)})),fd_filestat_get:p(((t,e)=>{const r=I(t,a.WASI_RIGHT_FD_FILESTAT_GET),i=E.fstatSync(r.real);return this.refreshMemory(),this.view.setBigUint64(e,n.BigIntPolyfill(i.dev),!0),e+=8,this.view.setBigUint64(e,n.BigIntPolyfill(i.ino),!0),e+=8,this.view.setUint8(e,r.filetype),e+=8,this.view.setBigUint64(e,n.BigIntPolyfill(i.nlink),!0),e+=8,this.view.setBigUint64(e,n.BigIntPolyfill(i.size),!0),e+=8,this.view.setBigUint64(e,c(i.atimeMs),!0),e+=8,this.view.setBigUint64(e,c(i.mtimeMs),!0),e+=8,this.view.setBigUint64(e,c(i.ctimeMs),!0),a.WASI_ESUCCESS})),fd_filestat_set_size:p(((t,e)=>{const r=I(t,a.WASI_RIGHT_FD_FILESTAT_SET_SIZE);return E.ftruncateSync(r.real,Number(e)),a.WASI_ESUCCESS})),fd_filestat_set_times:p(((t,e,r,n)=>{const i=I(t,a.WASI_RIGHT_FD_FILESTAT_SET_TIMES),o=E.fstatSync(i.real);let s=o.atime,f=o.mtime;const u=l(v(a.WASI_CLOCK_REALTIME)),h=a.WASI_FILESTAT_SET_ATIM|a.WASI_FILESTAT_SET_ATIM_NOW;if((n&h)===h)return a.WASI_EINVAL;const c=a.WASI_FILESTAT_SET_MTIM|a.WASI_FILESTAT_SET_MTIM_NOW;return(n&c)===c?a.WASI_EINVAL:((n&a.WASI_FILESTAT_SET_ATIM)===a.WASI_FILESTAT_SET_ATIM?s=l(e):(n&a.WASI_FILESTAT_SET_ATIM_NOW)===a.WASI_FILESTAT_SET_ATIM_NOW&&(s=u),(n&a.WASI_FILESTAT_SET_MTIM)===a.WASI_FILESTAT_SET_MTIM?f=l(r):(n&a.WASI_FILESTAT_SET_MTIM_NOW)===a.WASI_FILESTAT_SET_MTIM_NOW&&(f=u),E.futimesSync(i.real,new Date(s),new Date(f)),a.WASI_ESUCCESS)})),fd_prestat_get:p(((t,e)=>{const r=I(t,n.BigIntPolyfill(0));return r.path?(this.refreshMemory(),this.view.setUint8(e,a.WASI_PREOPENTYPE_DIR),this.view.setUint32(e+4,o.default.byteLength(r.fakePath),!0),a.WASI_ESUCCESS):a.WASI_EINVAL})),fd_prestat_dir_name:p(((t,e,r)=>{const i=I(t,n.BigIntPolyfill(0));return i.path?(this.refreshMemory(),o.default.from(this.memory.buffer).write(i.fakePath,e,r,"utf8"),a.WASI_ESUCCESS):a.WASI_EINVAL})),fd_pwrite:p(((t,e,r,n,i)=>{const o=I(t,a.WASI_RIGHT_FD_WRITE|a.WASI_RIGHT_FD_SEEK);let s=0;return m(e,r).forEach((t=>{let e=0;for(;e<t.byteLength;)e+=E.writeSync(o.real,t,e,t.byteLength-e,Number(n)+s+e);s+=e})),this.view.setUint32(i,s,!0),a.WASI_ESUCCESS})),fd_write:p(((t,e,r,i)=>{const o=I(t,a.WASI_RIGHT_FD_WRITE);let s=0;return m(e,r).forEach((t=>{let e=0;for(;e<t.byteLength;){const r=E.writeSync(o.real,t,e,t.byteLength-e,o.offset?Number(o.offset):null);o.offset&&(o.offset+=n.BigIntPolyfill(r)),e+=r}s+=e})),this.view.setUint32(i,s,!0),a.WASI_ESUCCESS})),fd_pread:p(((t,e,r,n,i)=>{const o=I(t,a.WASI_RIGHT_FD_READ|a.WASI_RIGHT_FD_SEEK);let s=0;t:for(const t of m(e,r)){let e=0;for(;e<t.byteLength;){const r=t.byteLength-e,i=E.readSync(o.real,t,e,t.byteLength-e,Number(n)+s+e);if(e+=i,s+=i,0===i||i<r)break t}s+=e}return this.view.setUint32(i,s,!0),a.WASI_ESUCCESS})),fd_read:p(((t,e,r,i)=>{const o=I(t,a.WASI_RIGHT_FD_READ),s=0===o.real;let f=0;t:for(const t of m(e,r)){let e=0;for(;e<t.byteLength;){let r=t.byteLength-e,i=s||void 0===o.offset?null:Number(o.offset),a=E.readSync(o.real,t,e,r,i);if(s||(o.offset=(o.offset?o.offset:n.BigIntPolyfill(0))+n.BigIntPolyfill(a)),e+=a,f+=a,0===a||a<r)break t}}return this.view.setUint32(i,f,!0),a.WASI_ESUCCESS})),fd_readdir:p(((t,e,r,i,s)=>{const f=I(t,a.WASI_RIGHT_FD_READDIR);this.refreshMemory();const u=E.readdirSync(f.path,{withFileTypes:!0}),h=e;for(let t=Number(i);t<u.length;t+=1){const i=u[t];let s=o.default.byteLength(i.name);if(e-h>r)break;if(this.view.setBigUint64(e,n.BigIntPolyfill(t+1),!0),(e+=8)-h>r)break;const c=E.statSync(S.resolve(f.path,i.name));if(this.view.setBigUint64(e,n.BigIntPolyfill(c.ino),!0),(e+=8)-h>r)break;if(this.view.setUint32(e,s,!0),(e+=4)-h>r)break;let l;switch(!0){case c.isBlockDevice():l=a.WASI_FILETYPE_BLOCK_DEVICE;break;case c.isCharacterDevice():l=a.WASI_FILETYPE_CHARACTER_DEVICE;break;case c.isDirectory():l=a.WASI_FILETYPE_DIRECTORY;break;case c.isFIFO():l=a.WASI_FILETYPE_SOCKET_STREAM;break;case c.isFile():l=a.WASI_FILETYPE_REGULAR_FILE;break;case c.isSocket():l=a.WASI_FILETYPE_SOCKET_STREAM;break;case c.isSymbolicLink():l=a.WASI_FILETYPE_SYMBOLIC_LINK;break;default:l=a.WASI_FILETYPE_UNKNOWN}if(this.view.setUint8(e,l),e+=1,(e+=3)+s>=h+r)break;o.default.from(this.memory.buffer).write(i.name,e),e+=s}const c=e-h;return this.view.setUint32(s,Math.min(c,r),!0),a.WASI_ESUCCESS})),fd_renumber:p(((t,e)=>(I(t,n.BigIntPolyfill(0)),I(e,n.BigIntPolyfill(0)),E.closeSync(this.FD_MAP.get(t).real),this.FD_MAP.set(t,this.FD_MAP.get(e)),this.FD_MAP.delete(e),a.WASI_ESUCCESS))),fd_seek:p(((t,e,r,i)=>{const o=I(t,a.WASI_RIGHT_FD_SEEK);switch(this.refreshMemory(),r){case a.WASI_WHENCE_CUR:o.offset=(o.offset?o.offset:n.BigIntPolyfill(0))+n.BigIntPolyfill(e);break;case a.WASI_WHENCE_END:const{size:t}=E.fstatSync(o.real);o.offset=n.BigIntPolyfill(t)+n.BigIntPolyfill(e);break;case a.WASI_WHENCE_SET:o.offset=n.BigIntPolyfill(e)}return this.view.setBigUint64(i,o.offset,!0),a.WASI_ESUCCESS})),fd_tell:p(((t,e)=>{const r=I(t,a.WASI_RIGHT_FD_TELL);return this.refreshMemory(),r.offset||(r.offset=n.BigIntPolyfill(0)),this.view.setBigUint64(e,r.offset,!0),a.WASI_ESUCCESS})),fd_sync:p((t=>{const e=I(t,a.WASI_RIGHT_FD_SYNC);return E.fsyncSync(e.real),a.WASI_ESUCCESS})),path_create_directory:p(((t,e,r)=>{const n=I(t,a.WASI_RIGHT_PATH_CREATE_DIRECTORY);if(!n.path)return a.WASI_EINVAL;this.refreshMemory();const i=o.default.from(this.memory.buffer,e,r).toString();return E.mkdirSync(S.resolve(n.path,i)),a.WASI_ESUCCESS})),path_filestat_get:p(((t,e,r,i,s)=>{const f=I(t,a.WASI_RIGHT_PATH_FILESTAT_GET);if(!f.path)return a.WASI_EINVAL;this.refreshMemory();const u=o.default.from(this.memory.buffer,r,i).toString(),h=E.statSync(S.resolve(f.path,u));return this.view.setBigUint64(s,n.BigIntPolyfill(h.dev),!0),s+=8,this.view.setBigUint64(s,n.BigIntPolyfill(h.ino),!0),s+=8,this.view.setUint8(s,y(this,void 0,h).filetype),s+=8,this.view.setBigUint64(s,n.BigIntPolyfill(h.nlink),!0),s+=8,this.view.setBigUint64(s,n.BigIntPolyfill(h.size),!0),s+=8,this.view.setBigUint64(s,c(h.atimeMs),!0),s+=8,this.view.setBigUint64(s,c(h.mtimeMs),!0),s+=8,this.view.setBigUint64(s,c(h.ctimeMs),!0),a.WASI_ESUCCESS})),path_filestat_set_times:p(((t,e,r,n,i,s,f)=>{const u=I(t,a.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);if(!u.path)return a.WASI_EINVAL;this.refreshMemory();const h=E.fstatSync(u.real);let c=h.atime,p=h.mtime;const d=l(v(a.WASI_CLOCK_REALTIME)),y=a.WASI_FILESTAT_SET_ATIM|a.WASI_FILESTAT_SET_ATIM_NOW;if((f&y)===y)return a.WASI_EINVAL;const g=a.WASI_FILESTAT_SET_MTIM|a.WASI_FILESTAT_SET_MTIM_NOW;if((f&g)===g)return a.WASI_EINVAL;(f&a.WASI_FILESTAT_SET_ATIM)===a.WASI_FILESTAT_SET_ATIM?c=l(i):(f&a.WASI_FILESTAT_SET_ATIM_NOW)===a.WASI_FILESTAT_SET_ATIM_NOW&&(c=d),(f&a.WASI_FILESTAT_SET_MTIM)===a.WASI_FILESTAT_SET_MTIM?p=l(s):(f&a.WASI_FILESTAT_SET_MTIM_NOW)===a.WASI_FILESTAT_SET_MTIM_NOW&&(p=d);const _=o.default.from(this.memory.buffer,r,n).toString();return E.utimesSync(S.resolve(u.path,_),new Date(c),new Date(p)),a.WASI_ESUCCESS})),path_link:p(((t,e,r,n,i,s,f)=>{const u=I(t,a.WASI_RIGHT_PATH_LINK_SOURCE),h=I(i,a.WASI_RIGHT_PATH_LINK_TARGET);if(!u.path||!h.path)return a.WASI_EINVAL;this.refreshMemory();const c=o.default.from(this.memory.buffer,r,n).toString(),l=o.default.from(this.memory.buffer,s,f).toString();return E.linkSync(S.resolve(u.path,c),S.resolve(h.path,l)),a.WASI_ESUCCESS})),path_open:p(((t,e,r,i,s,f,u,h,c)=>{const l=I(t,a.WASI_RIGHT_PATH_OPEN);f=n.BigIntPolyfill(f),u=n.BigIntPolyfill(u);const p=(f&(a.WASI_RIGHT_FD_READ|a.WASI_RIGHT_FD_READDIR))!==n.BigIntPolyfill(0),y=(f&(a.WASI_RIGHT_FD_DATASYNC|a.WASI_RIGHT_FD_WRITE|a.WASI_RIGHT_FD_ALLOCATE|a.WASI_RIGHT_FD_FILESTAT_SET_SIZE))!==n.BigIntPolyfill(0);let g;y&&p?g=E.constants.O_RDWR:p?g=E.constants.O_RDONLY:y&&(g=E.constants.O_WRONLY);let _=f|a.WASI_RIGHT_PATH_OPEN,m=f|u;0!=(s&a.WASI_O_CREAT)&&(g|=E.constants.O_CREAT,_|=a.WASI_RIGHT_PATH_CREATE_FILE),0!=(s&a.WASI_O_DIRECTORY)&&(g|=E.constants.O_DIRECTORY),0!=(s&a.WASI_O_EXCL)&&(g|=E.constants.O_EXCL),0!=(s&a.WASI_O_TRUNC)&&(g|=E.constants.O_TRUNC,_|=a.WASI_RIGHT_PATH_FILESTAT_SET_SIZE),0!=(h&a.WASI_FDFLAG_APPEND)&&(g|=E.constants.O_APPEND),0!=(h&a.WASI_FDFLAG_DSYNC)&&(E.constants.O_DSYNC?g|=E.constants.O_DSYNC:g|=E.constants.O_SYNC,m|=a.WASI_RIGHT_FD_DATASYNC),0!=(h&a.WASI_FDFLAG_NONBLOCK)&&(g|=E.constants.O_NONBLOCK),0!=(h&a.WASI_FDFLAG_RSYNC)&&(E.constants.O_RSYNC?g|=E.constants.O_RSYNC:g|=E.constants.O_SYNC,m|=a.WASI_RIGHT_FD_SYNC),0!=(h&a.WASI_FDFLAG_SYNC)&&(g|=E.constants.O_SYNC,m|=a.WASI_RIGHT_FD_SYNC),y&&0==(g&(E.constants.O_APPEND|E.constants.O_TRUNC))&&(m|=a.WASI_RIGHT_FD_SEEK),this.refreshMemory();const A=o.default.from(this.memory.buffer,r,i).toString(),v=S.resolve(l.path,A);if(S.relative(l.path,v).startsWith(".."))return a.WASI_ENOTCAPABLE;let w,T,b;try{if(w=E.realpathSync(v),S.relative(l.path,w).startsWith(".."))return a.WASI_ENOTCAPABLE}catch(t){if("ENOENT"!==t.code)throw t;w=v}try{T=E.statSync(w).isDirectory()}catch(t){}b=!y&&T?E.openSync(w,E.constants.O_RDONLY):E.openSync(w,g);const R=[...this.FD_MAP.keys()].reverse()[0]+1;return this.FD_MAP.set(R,{real:b,filetype:void 0,rights:{base:_,inheriting:m},path:w}),d(this,R),this.view.setUint32(c,R,!0),a.WASI_ESUCCESS})),path_readlink:p(((t,e,r,n,i,s)=>{const f=I(t,a.WASI_RIGHT_PATH_READLINK);if(!f.path)return a.WASI_EINVAL;this.refreshMemory();const u=o.default.from(this.memory.buffer,e,r).toString(),h=S.resolve(f.path,u),c=E.readlinkSync(h),l=o.default.from(this.memory.buffer).write(c,n,i);return this.view.setUint32(s,l,!0),a.WASI_ESUCCESS})),path_remove_directory:p(((t,e,r)=>{const n=I(t,a.WASI_RIGHT_PATH_REMOVE_DIRECTORY);if(!n.path)return a.WASI_EINVAL;this.refreshMemory();const i=o.default.from(this.memory.buffer,e,r).toString();return E.rmdirSync(S.resolve(n.path,i)),a.WASI_ESUCCESS})),path_rename:p(((t,e,r,n,i,s)=>{const f=I(t,a.WASI_RIGHT_PATH_RENAME_SOURCE),u=I(n,a.WASI_RIGHT_PATH_RENAME_TARGET);if(!f.path||!u.path)return a.WASI_EINVAL;this.refreshMemory();const h=o.default.from(this.memory.buffer,e,r).toString(),c=o.default.from(this.memory.buffer,i,s).toString();return E.renameSync(S.resolve(f.path,h),S.resolve(u.path,c)),a.WASI_ESUCCESS})),path_symlink:p(((t,e,r,n,i)=>{const s=I(r,a.WASI_RIGHT_PATH_SYMLINK);if(!s.path)return a.WASI_EINVAL;this.refreshMemory();const f=o.default.from(this.memory.buffer,t,e).toString(),u=o.default.from(this.memory.buffer,n,i).toString();return E.symlinkSync(f,S.resolve(s.path,u)),a.WASI_ESUCCESS})),path_unlink_file:p(((t,e,r)=>{const n=I(t,a.WASI_RIGHT_PATH_UNLINK_FILE);if(!n.path)return a.WASI_EINVAL;this.refreshMemory();const i=o.default.from(this.memory.buffer,e,r).toString();return E.unlinkSync(S.resolve(n.path,i)),a.WASI_ESUCCESS})),poll_oneoff:(t,e,r,i)=>{let o=0,s=0;this.refreshMemory();for(let i=0;i<r;i+=1){const r=this.view.getBigUint64(t,!0);t+=8;const i=this.view.getUint8(t);switch(t+=1,i){case a.WASI_EVENTTYPE_CLOCK:{t+=7,this.view.getBigUint64(t,!0),t+=8;const i=this.view.getUint32(t,!0);t+=4,t+=4;const f=this.view.getBigUint64(t,!0);t+=8,this.view.getBigUint64(t,!0),t+=8;const u=this.view.getUint16(t,!0);t+=2,t+=6;const h=1===u;let c=a.WASI_ESUCCESS;const l=n.BigIntPolyfill(v(i));if(null===l)c=a.WASI_EINVAL;else{const t=h?f:l+f;s=t>s?t:s}this.view.setBigUint64(e,r,!0),e+=8,this.view.setUint16(e,c,!0),e+=2,this.view.setUint8(e,a.WASI_EVENTTYPE_CLOCK),e+=1,e+=5,o+=1;break}case a.WASI_EVENTTYPE_FD_READ:case a.WASI_EVENTTYPE_FD_WRITE:t+=3,this.view.getUint32(t,!0),t+=4,this.view.setBigUint64(e,r,!0),e+=8,this.view.setUint16(e,a.WASI_ENOSYS,!0),e+=2,this.view.setUint8(e,i),e+=1,e+=5,o+=1;break;default:return a.WASI_EINVAL}}for(this.view.setUint32(i,o,!0);_.hrtime()<s;);return a.WASI_ESUCCESS},proc_exit:t=>(_.exit(t),a.WASI_ESUCCESS),proc_raise:t=>t in a.SIGNAL_MAP?(_.kill(a.SIGNAL_MAP[t]),a.WASI_ESUCCESS):a.WASI_EINVAL,random_get:(t,e)=>(this.refreshMemory(),_.randomFillSync(new Uint8Array(this.memory.buffer),t,e),a.WASI_ESUCCESS),sched_yield:()=>a.WASI_ESUCCESS,sock_recv:()=>a.WASI_ENOSYS,sock_send:()=>a.WASI_ENOSYS,sock_shutdown:()=>a.WASI_ENOSYS},t.traceSyscalls&&Object.keys(this.wasiImport).forEach((t=>{const e=this.wasiImport[t];this.wasiImport[t]=function(...r){console.log(`WASI: wasiImport called: ${t} (${r})`);try{let t=e(...r);return console.log(`WASI: => ${t}`),t}catch(t){throw console.log(`Catched error: ${t}`),t}}}))}refreshMemory(){this.view&&0!==this.view.buffer.byteLength||(this.view=new i.DataViewPolyfill(this.memory.buffer))}setMemory(t){this.memory=t}start(t){const e=t.exports;if(null===e||"object"!=typeof e)throw new Error(`instance.exports must be an Object. Received ${e}.`);const{memory:r}=e;if(!(r instanceof WebAssembly.Memory))throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${r}.`);this.setMemory(r),e._start&&e._start()}getImportNamespace(t){let e=null;for(let r of WebAssembly.Module.imports(t))if("function"===r.kind&&r.module.startsWith("wasi_"))if(e){if(e!==r.module)throw new Error("Multiple namespaces detected.")}else e=r.module;return e}getImports(t){switch(this.getImportNamespace(t)){case"wasi_unstable":return{wasi_unstable:this.wasiImport};case"wasi_snapshot_preview1":return{wasi_snapshot_preview1:this.wasiImport};default:throw new Error("Can\'t detect a WASI namespace for the WebAssembly Module")}}}e.default=S,S.defaultBindings=s,e.WASI=S},642:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n="undefined"!=typeof globalThis?globalThis:void 0!==r.g?r.g:{};e.BigIntPolyfill="undefined"!=typeof BigInt?BigInt:n.BigInt||Number},986:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=Math.floor(.001*(Date.now()-performance.now()));e.default=function(t){let e=.001*performance.now(),n=Math.floor(e)+r,i=Math.floor(e%1*1e9);return t&&(n-=t[0],i-=t[1],i<0&&(n--,i+=1e9)),[n,i]}},744:(t,e,r)=>{"use strict";var n=r(764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const i=n;e.default=i},961:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(642);let i=DataView;i.prototype.setBigUint64||(i.prototype.setBigUint64=function(t,e,r){let n,i;if(e<2**32)n=Number(e),i=0;else{for(var o=e.toString(2),s="",a=0;a<64-o.length;a++)s+="0";s+=o,i=parseInt(s.substring(0,32),2),n=parseInt(s.substring(32),2)}this.setUint32(t+(r?0:4),n,r),this.setUint32(t+(r?4:0),i,r)},i.prototype.getBigUint64=function(t,e){let r=this.getUint32(t+(e?0:4),e),i=this.getUint32(t+(e?4:0),e);for(var o=r.toString(2),s=i.toString(2),a="",f=0;f<32-o.length;f++)a+="0";return a+=o,n.BigIntPolyfill("0b"+s+a)}),e.DataViewPolyfill=i},998:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=t=>e=>{const r=t(e);return 1e9*r[0]+r[1]}},742:(t,e)=>{"use strict";e.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=f(t),s=o[0],a=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),h=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[h++]=e>>16&255,u[h++]=e>>8&255,u[h++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[h++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,f=n-i;a<f;a+=s)o.push(u(t,a,a+s>f?f:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function f(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(t,e,r)=>{"use strict";var n=r(742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},e.INSPECT_MAX_BYTES=50;var s=2147483647;function a(t){if(t>s)throw new RangeError(\'The value "\'+t+\'" is invalid for option "size"\');var e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError(\'The "string" argument must be of type string. Received type number\');return c(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|y(t,e),n=a(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(H(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError(\'The "value" argument must not be of type number. Received type number\');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return f.from(n,e,r);var i=function(t){if(f.isBuffer(t)){var e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||x(t.length)?a(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError(\'"size" argument must be of type number\');if(t<0)throw new RangeError(\'The value "\'+t+\'" is invalid for option "size"\')}function c(t){return h(t),a(t<0?0:0|d(t))}function l(t){for(var e=t.length<0?0:0|d(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError(\'"offset" is outside of buffer bounds\');if(t.byteLength<e+(r||0))throw new RangeError(\'"length" is outside of buffer bounds\');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,f.prototype),n}function d(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError(\'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type \'+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(t).length;default:if(i)return n?-1:M(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function E(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),x(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:S(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):S(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function S(t,e,r,n,i){var o,s=1,a=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,f/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===f)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(r+f>a&&(r=a-f),o=r;o>=0;o--){for(var c=!0,l=0;l<f;l++)if(u(t,o+l)!==u(e,l)){c=!1;break}if(c)return o}return-1}function m(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(x(a))return s;t[r+s]=a}return s}function I(t,e,r,n){return G(M(e,t.length-r),t,r,n)}function A(t,e,r,n){return G(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function v(t,e,r,n){return G(k(e),t,r,n)}function w(t,e,r,n){return G(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function b(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,f,u=t[i],h=null,c=u>239?4:u>223?3:u>191?2:1;if(i+c<=r)switch(c){case 1:u<128&&(h=u);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&u)<<6|63&o)>127&&(h=f);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(f=(15&u)<<12|(63&o)<<6|63&s)>2047&&(f<55296||f>57343)&&(h=f);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(f=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&f<1114112&&(h=f)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=R));return r}(n)}e.kMaxLength=s,f.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},f.allocUnsafe=function(t){return c(t)},f.allocUnsafeSlow=function(t){return c(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if(H(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),H(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError(\'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array\');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError(\'"list" argument must be an Array of Buffers\');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(H(o,Uint8Array))i+o.length>n.length?f.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!f.isBuffer(o))throw new TypeError(\'"list" argument must be an Array of Buffers\');o.copy(n,i)}i+=o.length}return n},f.byteLength=y,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)_(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)_(this,e,e+3),_(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(this,e+3,e+4);return this},f.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?b(this,0,t):g.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(f.prototype[o]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,i){if(H(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError(\'The "target" argument must be one of type Buffer or Uint8Array. Received type \'+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),h=t.slice(e,r),c=0;c<a;++c)if(u[c]!==h[c]){o=u[c],s=h[c];break}return o<s?-1:s<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return E(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return E(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return I(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return v(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function N(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function C(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=Y[t[o]];return i}function L(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function P(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function W(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(e>i||e<o)throw new RangeError(\'"value" argument is out of bounds\');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||W(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||W(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);W(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);W(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||W(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=f.isBuffer(t)?t:f.from(t,n),a=s.length;if(0===a)throw new TypeError(\'The value "\'+t+\'" is invalid for argument "value"\');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var U=/[^+/0-9A-Za-z-_]/g;function M(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function k(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function x(t){return t!=t}var Y=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,f=(1<<a)-1,u=f>>1,h=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=l,h-=8);if(0===o)o=1-u;else{if(o===f)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,f,u=8*o-i-1,h=(1<<u)-1,c=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),(e+=s+c>=1?l/f:l*Math.pow(2,1-c))*f>=2&&(s++,f/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*f-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+p]=255&s,p+=d,s/=256,u-=8);t[r+p-d]|=128*y}},470:(t,e,r)=>{"use strict";var n=r(155);function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function o(t,e){for(var r,n="",i=0,o=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)r=t.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var f=n.lastIndexOf("/");if(f!==n.length-1){-1===f?(n="",i=0):i=(n=n.slice(0,f)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}e&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+t.slice(o+1,a):n=t.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var s={resolve:function(){for(var t,e="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var a;s>=0?a=arguments[s]:(void 0===t&&(t=n.cwd()),a=t),i(a),0!==a.length&&(e=a+"/"+e,r=47===a.charCodeAt(0))}return e=o(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),r=47===t.charCodeAt(t.length-1);return 0!==(t=o(t,!e)).length||e||(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];i(r),r.length>0&&(void 0===t?t=r:t+="/"+r)}return void 0===t?".":s.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=s.resolve(t))===(e=s.resolve(e)))return"";for(var r=1;r<t.length&&47===t.charCodeAt(r);++r);for(var n=t.length,o=n-r,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var f=e.length-a,u=o<f?o:f,h=-1,c=0;c<=u;++c){if(c===u){if(f>u){if(47===e.charCodeAt(a+c))return e.slice(a+c+1);if(0===c)return e.slice(a+c)}else o>u&&(47===t.charCodeAt(r+c)?h=c:0===c&&(h=0));break}var l=t.charCodeAt(r+c);if(l!==e.charCodeAt(a+c))break;47===l&&(h=c)}var p="";for(c=r+h+1;c<=n;++c)c!==n&&47!==t.charCodeAt(c)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(a+h):(a+=h,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,o=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!o){n=s;break}}else o=!1;return-1===n?r?"/":".":r&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError(\'"ext" argument must be a string\');i(t);var r,n=0,o=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,f=-1;for(r=t.length-1;r>=0;--r){var u=t.charCodeAt(r);if(47===u){if(!s){n=r+1;break}}else-1===f&&(s=!1,f=r+1),a>=0&&(u===e.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=f))}return n===o?o=f:-1===o&&(o=t.length),t.slice(n,o)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!s){n=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":t.slice(n,o)},extname:function(t){i(t);for(var e=-1,r=0,n=-1,o=!0,s=0,a=t.length-1;a>=0;--a){var f=t.charCodeAt(a);if(47!==f)-1===n&&(o=!1,n=a+1),46===f?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!o){r=a+1;break}}return-1===e||-1===n||0===s||1===s&&e===n-1&&e===r+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError(\'The "pathObject" argument must be of type Object. Received type \'+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+"/"+n:n}(0,t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r,n=t.charCodeAt(0),o=47===n;o?(e.root="/",r=1):r=0;for(var s=-1,a=0,f=-1,u=!0,h=t.length-1,c=0;h>=r;--h)if(47!==(n=t.charCodeAt(h)))-1===f&&(u=!1,f=h+1),46===n?-1===s?s=h:1!==c&&(c=1):-1!==s&&(c=-1);else if(!u){a=h+1;break}return-1===s||-1===f||0===c||1===c&&s===f-1&&s===a+1?-1!==f&&(e.base=e.name=0===a&&o?t.slice(1,f):t.slice(a,f)):(0===a&&o?(e.name=t.slice(1,s),e.base=t.slice(1,f)):(e.name=t.slice(a,s),e.base=t.slice(a,f)),e.ext=t.slice(s,f)),a>0?e.dir=t.slice(0,a-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,t.exports=s},155:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,f=[],u=!1,h=-1;function c(){u&&a&&(u=!1,a.length?f=a.concat(f):h=-1,f.length&&l())}function l(){if(!u){var t=s(c);u=!0;for(var e=f.length;e;){for(a=f,f=[];++h<e;)a&&a[h].run();h=-1,e=f.length}a=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new p(t,e)),1!==f.length||u||s(l)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},798:(t,e,r)=>{"use strict";var n=r(155),i=65536,o=r(509).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(t);if(t>0)if(t>i)for(var a=0;a<t;a+=i)s.getRandomValues(r.slice(a,a+i));else s.getRandomValues(r);return"function"==typeof e?n.nextTick((function(){e(null,r)})):r}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11")}},963:(t,e,r)=>{"use strict";var n=r(155);function i(){throw new Error("secure random number generation not supported by this browser\\nuse chrome, FireFox or Internet Explorer 11")}var o=r(509),s=r(798),a=o.Buffer,f=o.kMaxLength,u=r.g.crypto||r.g.msCrypto,h=Math.pow(2,32)-1;function c(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>h||t<0)throw new TypeError("offset must be a uint32");if(t>f||t>e)throw new RangeError("offset out of range")}function l(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>h||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>f)throw new RangeError("buffer too small")}function p(t,e,r,i){if(n.browser){var o=t.buffer,a=new Uint8Array(o,e,r);return u.getRandomValues(a),i?void n.nextTick((function(){i(null,t)})):t}if(!i)return s(r).copy(t,e),t;s(r,(function(r,n){if(r)return i(r);n.copy(t,e),i(null,t)}))}u&&u.getRandomValues||!n.browser?(e.randomFill=function(t,e,n,i){if(!(a.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError(\'"buf" argument must be a Buffer or Uint8Array\');if("function"==typeof e)i=e,e=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-e;else if("function"!=typeof i)throw new TypeError(\'"cb" argument must be a function\');return c(e,t.length),l(n,e,t.length),p(t,e,n,i)},e.randomFillSync=function(t,e,n){if(void 0===e&&(e=0),!(a.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError(\'"buf" argument must be a Buffer or Uint8Array\');return c(e,t.length),void 0===n&&(n=t.length-e),l(n,e,t.length),p(t,e,n)}):(e.randomFill=i,e.randomFillSync=i)},509:(t,e,r)=>{var n=r(764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{default:()=>Jo});var t={};r.r(t),r.d(t,{createEndpoint:()=>i,expose:()=>u,proxy:()=>_,proxyMarker:()=>e,releaseProxy:()=>o,transfer:()=>g,transferHandlers:()=>f,windowEndpoint:()=>E,wrap:()=>c});const e=Symbol("Comlink.proxy"),i=Symbol("Comlink.endpoint"),o=Symbol("Comlink.releaseProxy"),s=Symbol("Comlink.thrown"),a=t=>"object"==typeof t&&null!==t||"function"==typeof t,f=new Map([["proxy",{canHandle:t=>a(t)&&t[e],serialize(t){const{port1:e,port2:r}=new MessageChannel;return u(t,e),[r,[r]]},deserialize:t=>(t.start(),c(t))}],["throw",{canHandle:t=>a(t)&&s in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function u(t,e=self){e.addEventListener("message",(function r(n){if(!n||!n.data)return;const{id:i,type:o,path:a}=Object.assign({path:[]},n.data),f=(n.data.argumentList||[]).map(m);let c;try{const e=a.slice(0,-1).reduce(((t,e)=>t[e]),t),r=a.reduce(((t,e)=>t[e]),t);switch(o){case"GET":c=r;break;case"SET":e[a.slice(-1)[0]]=m(n.data.value),c=!0;break;case"APPLY":c=r.apply(e,f);break;case"CONSTRUCT":c=_(new r(...f));break;case"ENDPOINT":{const{port1:e,port2:r}=new MessageChannel;u(t,r),c=g(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(t){c={value:t,[s]:0}}Promise.resolve(c).catch((t=>({value:t,[s]:0}))).then((t=>{const[n,s]=S(t);e.postMessage(Object.assign(Object.assign({},n),{id:i}),s),"RELEASE"===o&&(e.removeEventListener("message",r),h(e))}))})),e.start&&e.start()}function h(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function c(t,e){return p(t,[],e)}function l(t){if(t)throw new Error("Proxy has been released and is not useable")}function p(t,e=[],r=function(){}){let n=!1;const s=new Proxy(r,{get(r,i){if(l(n),i===o)return()=>I(t,{type:"RELEASE",path:e.map((t=>t.toString()))}).then((()=>{h(t),n=!0}));if("then"===i){if(0===e.length)return{then:()=>s};const r=I(t,{type:"GET",path:e.map((t=>t.toString()))}).then(m);return r.then.bind(r)}return p(t,[...e,i])},set(r,i,o){l(n);const[s,a]=S(o);return I(t,{type:"SET",path:[...e,i].map((t=>t.toString())),value:s},a).then(m)},apply(r,o,s){l(n);const a=e[e.length-1];if(a===i)return I(t,{type:"ENDPOINT"}).then(m);if("bind"===a)return p(t,e.slice(0,-1));const[f,u]=d(s);return I(t,{type:"APPLY",path:e.map((t=>t.toString())),argumentList:f},u).then(m)},construct(r,i){l(n);const[o,s]=d(i);return I(t,{type:"CONSTRUCT",path:e.map((t=>t.toString())),argumentList:o},s).then(m)}});return s}function d(t){const e=t.map(S);return[e.map((t=>t[0])),(r=e.map((t=>t[1])),Array.prototype.concat.apply([],r))];var r}const y=new WeakMap;function g(t,e){return y.set(t,e),t}function _(t){return Object.assign(t,{[e]:!0})}function E(t,e=self,r="*"){return{postMessage:(e,n)=>t.postMessage(e,r,n),addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}function S(t){for(const[e,r]of f)if(r.canHandle(t)){const[n,i]=r.serialize(t);return[{type:"HANDLER",name:e,value:n},i]}return[{type:"RAW",value:t},y.get(t)||[]]}function m(t){switch(t.type){case"HANDLER":return f.get(t.name).deserialize(t.value);case"RAW":return t.value}}function I(t,e,r){return new Promise((n=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.addEventListener("message",(function e(r){r.data&&r.data.id&&r.data.id===i&&(t.removeEventListener("message",e),n(r.data))})),t.start&&t.start(),t.postMessage(Object.assign({id:i},e),r)}))}const A=class{programName;wasmModule;_emscrJsRuntime;constructor(t,e,r){this.programName=t,this.wasmModule=e,this._loadEmscrJsRuntime(r)}run(t,e,r,n,i,o,s,a,f){console.log("emscr runnable run:",this.programName,t),"function"!=typeof e&&(e=()=>{}),"function"!=typeof r&&(r=()=>{}),"function"!=typeof n&&(n=()=>{}),i instanceof Array||(i=[]),"function"!=typeof o&&(o=()=>{}),"function"!=typeof s&&(s=t=>{console.error(t)}),"function"!=typeof a&&(a=()=>{});let u,h={thisProgramm:this.programName,instantiateWasm:(t,e)=>(WebAssembly.instantiate(this.wasmModule,t).then((t=>e(t,this.wasmModule))),{}),preInit:[()=>{h.TTY.register(h.FS.makedev(5,0),{get_char:t=>e(t),put_char:(t,e)=>{t.output.push(e),r(e)},flush:t=>t.output=[],fsync:t=>console.log("fsynced stdout (EmscriptenRunnable does nothing in this case)")}),h.TTY.register(h.FS.makedev(6,0),{get_char:t=>e(t),put_char:(t,e)=>{t.output.push(e),n(e)},flush:t=>t.output=[],fsync:t=>console.log("fsynced stderr (EmscriptenRunnable does nothing in this case)")})}]};if(f){"string"!=typeof f&&(f=(f||"").toString()),f.endsWith("\\n")||(f+="\\n");let t=0;h.stdin=()=>t<f.length?f.charCodeAt(t++):null}this._emscrJsRuntime(h).then((e=>{this._writeFilesToFS(e,i),e.callMain(t),u=this._readFilesFromFS(e),a(u)})).catch((t=>s(t))).finally((()=>o(u||i)))}runHeadless(t,e,r,n,i,o){console.log("emscr runnable run headless:",this.programName,t),"function"!=typeof r&&(r=()=>{});let s="",a="",f="";this.run(t,(()=>{console.log("called runHeadless stdin")}),(t=>{s+=String.fromCharCode(t),a+=String.fromCharCode(t)}),(t=>{s+=String.fromCharCode(t),f+=String.fromCharCode(t)}),e,(()=>r({output:s,stdout:a,stderr:f})),n,i,o)}_readFilesFromFS(t,e="/",r=!0,n=[]){const i=t.FS.lookupPath(e),o=e=>{let n=[];return Object.values(e.contents).forEach((e=>{let i=t.FS.getPath(e);t.FS.isFile(e.mode)&&n.push({name:i,timestamp:e.timestamp,bytes:r?t.FS.readFile(i):new Uint8Array}),t.FS.isDir(e.mode)&&(n=[...n,...o(e)])})),n};let s=o(i.node);return n.length>0&&(s=s.filter((t=>n.some((e=>e.name!=t.name))))),s}_writeFilesToFS(t,e=[]){e.forEach((e=>{try{e.bytes instanceof Uint8Array&&t.FS.writeFile(e.name,e.bytes)}catch(t){console.error(t.name+": "+t.message)}}))}_loadEmscrJsRuntime(t){const e="EmscrJSR_"+this.programName;if(this._isWorkerScope()){let r=new Blob([t],{type:"application/javascript"});importScripts(URL.createObjectURL(r)),console.log(t,r),this._emscrJsRuntime=self[e]||self._createPyodideModule}else{if("undefined"==typeof document)throw new Error("can not load emscr js runtime environment");{const r=this.programName+"_emscrJSR";if(!document.getElementById(r)){let e=document.createElement("script");e.type="text/javascript",e.id=r,e.innerHTML=new TextDecoder("utf-8").decode(t),document.head.appendChild(e)}this._emscrJsRuntime=window[e]}}}_isWorkerScope(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}};function v(t,e){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},v(t,e)}function w(t,e){function r(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function T(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function b(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;t=r.call(t);var n,i=[];try{for(;(void 0===e||0<e--)&&!(n=t.next()).done;)i.push(n.value)}catch(t){var o={error:t}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return i}function R(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(b(arguments[e]));return t}var O="undefined"!=typeof globalThis?globalThis:void 0!==r.g?r.g:{},N="undefined"!=typeof BigInt?BigInt:O.BigInt||Number,C=DataView;C.prototype.setBigUint64||(C.prototype.setBigUint64=function(t,e,r){if(e<Math.pow(2,32)){e=Number(e);var n=0}else{n=e.toString(2),e="";for(var i=0;i<64-n.length;i++)e+="0";e+=n,n=parseInt(e.substring(0,32),2),e=parseInt(e.substring(32),2)}this.setUint32(t+(r?0:4),e,r),this.setUint32(t+(r?4:0),n,r)},C.prototype.getBigUint64=function(t,e){var r=this.getUint32(t+(e?0:4),e);t=this.getUint32(t+(e?4:0),e),r=r.toString(2),t=t.toString(2),e="";for(var n=0;n<32-r.length;n++)e+="0";return N("0b"+t+(e+r))});var L=void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},P=[],W=[],B="undefined"!=typeof Uint8Array?Uint8Array:Array,D=!1;function F(){D=!0;for(var t=0;64>t;++t)P[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t],W["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;W[45]=62,W[95]=63}function U(t,e,r){for(var n=[],i=e;i<r;i+=3)e=(t[i]<<16)+(t[i+1]<<8)+t[i+2],n.push(P[e>>18&63]+P[e>>12&63]+P[e>>6&63]+P[63&e]);return n.join("")}function M(t){D||F();for(var e=t.length,r=e%3,n="",i=[],o=0,s=e-r;o<s;o+=16383)i.push(U(t,o,o+16383>s?s:o+16383));return 1===r?(t=t[e-1],n+=P[t>>2],n+=P[t<<4&63],n+="=="):2===r&&(t=(t[e-2]<<8)+t[e-1],n+=P[t>>10],n+=P[t>>4&63],n+=P[t<<2&63],n+="="),i.push(n),i.join("")}function k(t,e,r,n,i){var o=8*i-n-1,s=(1<<o)-1,a=s>>1,f=-7,u=r?-1:1,h=t[e+(i=r?i-1:0)];for(i+=u,r=h&(1<<-f)-1,h>>=-f,f+=o;0<f;r=256*r+t[e+i],i+=u,f-=8);for(o=r&(1<<-f)-1,r>>=-f,f+=n;0<f;o=256*o+t[e+i],i+=u,f-=8);if(0===r)r=1-a;else{if(r===s)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),r-=a}return(h?-1:1)*o*Math.pow(2,r-n)}function G(t,e,r,n,i,o){var s,a=8*o-i-1,f=(1<<a)-1,u=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0;o=n?0:o-1;var c=n?1:-1,l=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(e=isNaN(e)?1:0,n=f):(n=Math.floor(Math.log(e)/Math.LN2),1>e*(s=Math.pow(2,-n))&&(n--,s*=2),2<=(e=1<=n+u?e+h/s:e+h*Math.pow(2,1-u))*s&&(n++,s/=2),n+u>=f?(e=0,n=f):1<=n+u?(e=(e*s-1)*Math.pow(2,i),n+=u):(e=e*Math.pow(2,u-1)*Math.pow(2,i),n=0));8<=i;t[r+o]=255&e,o+=c,e/=256,i-=8);for(n=n<<i|e,a+=i;0<a;t[r+o]=255&n,o+=c,n/=256,a-=8);t[r+o-c]|=128*l}var H={}.toString,x=Array.isArray||function(t){return"[object Array]"==H.call(t)};V.TYPED_ARRAY_SUPPORT=void 0===L.TYPED_ARRAY_SUPPORT||L.TYPED_ARRAY_SUPPORT;var Y=V.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function j(t,e){if((V.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<e)throw new RangeError("Invalid typed array length");return V.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=V.prototype:(null===t&&(t=new V(e)),t.length=e),t}function V(t,e,r){if(!(V.TYPED_ARRAY_SUPPORT||this instanceof V))return new V(t,e,r);if("number"==typeof t){if("string"==typeof e)throw Error("If encoding is specified then the first argument must be a string");return q(this,t)}return K(this,t,e,r)}function K(t,e,r,n){if("number"==typeof e)throw new TypeError(\'"value" argument must not be a number\');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){if(e.byteLength,0>r||e.byteLength<r)throw new RangeError("\'offset\' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("\'length\' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),V.TYPED_ARRAY_SUPPORT?(t=e).__proto__=V.prototype:t=X(t,e),t}if("string"==typeof e){if(n=t,"string"==typeof(t=r)&&""!==t||(t="utf8"),!V.isEncoding(t))throw new TypeError(\'"encoding" must be a valid string encoding\');return(e=(n=j(n,r=0|$(e,t))).write(e,t))!==r&&(n=n.slice(0,e)),n}return function(t,e){if(Z(e)){var r=0|J(e.length);return 0===(t=j(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return(r="number"!=typeof e.length)||(r=(r=e.length)!=r),r?j(t,0):X(t,e);if("Buffer"===e.type&&x(e.data))return X(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function z(t){if("number"!=typeof t)throw new TypeError(\'"size" argument must be a number\');if(0>t)throw new RangeError(\'"size" argument must not be negative\')}function q(t,e){if(z(e),t=j(t,0>e?0:0|J(e)),!V.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function X(t,e){var r=0>e.length?0:0|J(e.length);t=j(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function J(t){if(t>=(V.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(V.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return 0|t}function Z(t){return!(null==t||!t._isBuffer)}function $(t,e){if(Z(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ct(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return pt(t).length;default:if(n)return ct(t).length;e=(""+e).toLowerCase(),n=!0}}function Q(t,e,r){var n=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":for(t=e,e=r,r=this.length,(!t||0>t)&&(t=0),(!e||0>e||e>r)&&(e=r),n="",r=t;r<e;++r)n=(t=n)+(n=16>(n=this[r])?"0"+n.toString(16):n.toString(16));return n;case"utf8":case"utf-8":return nt(this,e,r);case"ascii":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(127&this[e]);return t;case"latin1":case"binary":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(this[e]);return t;case"base64":return 0===e&&r===this.length?M(this):M(this.slice(e,r));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(e=this.slice(e,r),r="",t=0;t<e.length;t+=2)r+=String.fromCharCode(e[t]+256*e[t+1]);return r;default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function tt(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function et(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:-2147483648>r&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),0>r&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(0>r){if(!i)return-1;r=0}if("string"==typeof e&&(e=V.from(e,n)),Z(e))return 0===e.length?-1:rt(t,e,r,n,i);if("number"==typeof e)return e&=255,V.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):rt(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function rt(t,e,r,n,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>e.length)return-1;s=2,a/=2,f/=2,r/=2}if(i)for(n=-1;r<a;r++)if(o(t,r)===o(e,-1===n?0:r-n)){if(-1===n&&(n=r),r-n+1===f)return n*s}else-1!==n&&(r-=r-n),n=-1;else for(r+f>a&&(r=a-f);0<=r;r--){for(a=!0,n=0;n<f;n++)if(o(t,r+n)!==o(e,n)){a=!1;break}if(a)return r}return-1}function nt(t,e,r){r=Math.min(t.length,r);for(var n=[];e<r;){var i=t[e],o=null,s=239<i?4:223<i?3:191<i?2:1;if(e+s<=r)switch(s){case 1:128>i&&(o=i);break;case 2:var a=t[e+1];128==(192&a)&&127<(i=(31&i)<<6|63&a)&&(o=i);break;case 3:a=t[e+1];var f=t[e+2];128==(192&a)&&128==(192&f)&&2047<(i=(15&i)<<12|(63&a)<<6|63&f)&&(55296>i||57343<i)&&(o=i);break;case 4:a=t[e+1],f=t[e+2];var u=t[e+3];128==(192&a)&&128==(192&f)&&128==(192&u)&&65535<(i=(15&i)<<18|(63&a)<<12|(63&f)<<6|63&u)&&1114112>i&&(o=i)}null===o?(o=65533,s=1):65535<o&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),e+=s}if((t=n.length)<=it)n=String.fromCharCode.apply(String,n);else{for(r="",e=0;e<t;)r+=String.fromCharCode.apply(String,n.slice(e,e+=it));n=r}return n}V.poolSize=8192,V._augment=function(t){return t.__proto__=V.prototype,t},V.from=function(t,e,r){return K(null,t,e,r)},V.TYPED_ARRAY_SUPPORT&&(V.prototype.__proto__=Uint8Array.prototype,V.__proto__=Uint8Array),V.alloc=function(t,e,r){return z(t),0>=t?j(null,t):void 0!==e?"string"==typeof r?j(null,t).fill(e,r):j(null,t).fill(e):j(null,t)},V.allocUnsafe=function(t){return q(null,t)},V.allocUnsafeSlow=function(t){return q(null,t)},V.isBuffer=yt,V.compare=function(t,e){if(!Z(t)||!Z(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},V.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},V.concat=function(t,e){if(!x(t))throw new TypeError(\'"list" argument must be an Array of Buffers\');if(0===t.length)return V.alloc(0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;e=V.allocUnsafe(e);var n=0;for(r=0;r<t.length;++r){var i=t[r];if(!Z(i))throw new TypeError(\'"list" argument must be an Array of Buffers\');i.copy(e,n),n+=i.length}return e},V.byteLength=$,V.prototype._isBuffer=!0,V.prototype.swap16=function(){var t=this.length;if(0!=t%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)tt(this,e,e+1);return this},V.prototype.swap32=function(){var t=this.length;if(0!=t%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)tt(this,e,e+3),tt(this,e+1,e+2);return this},V.prototype.swap64=function(){var t=this.length;if(0!=t%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)tt(this,e,e+7),tt(this,e+1,e+6),tt(this,e+2,e+5),tt(this,e+3,e+4);return this},V.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?nt(this,0,t):Q.apply(this,arguments)},V.prototype.equals=function(t){if(!Z(t))throw new TypeError("Argument must be a Buffer");return this===t||0===V.compare(this,t)},V.prototype.inspect=function(){var t="";return 0<this.length&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(t+=" ... ")),"<Buffer "+t+">"},V.prototype.compare=function(t,e,r,n,i){if(!Z(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),0>e||r>t.length||0>n||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s);for(n=this.slice(n,i),t=t.slice(e,r),e=0;e<a;++e)if(n[e]!==t[e]){o=n[e],s=t[e];break}return o<s?-1:s<o?1:0},V.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},V.prototype.indexOf=function(t,e,r){return et(this,t,e,r,!0)},V.prototype.lastIndexOf=function(t,e,r){return et(this,t,e,r,!1)},V.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),0<t.length&&(0>r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");for(n||(n="utf8"),i=!1;;)switch(n){case"hex":t:{if(e=Number(e)||0,n=this.length-e,r?(r=Number(r))>n&&(r=n):r=n,0!=(n=t.length)%2)throw new TypeError("Invalid hex string");for(r>n/2&&(r=n/2),n=0;n<r;++n){if(i=parseInt(t.substr(2*n,2),16),isNaN(i)){t=n;break t}this[e+n]=i}t=n}return t;case"utf8":case"utf-8":return dt(ct(t,this.length-e),this,e,r);case"ascii":case"latin1":case"binary":return dt(lt(t),this,e,r);case"base64":return dt(pt(t),this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=t,i=this.length-e;for(var o=[],s=0;s<n.length&&!(0>(i-=2));++s){var a=n.charCodeAt(s);t=a>>8,a%=256,o.push(a),o.push(t)}return dt(o,this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},V.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var it=4096;function ot(t,e,r){if(0!=t%1||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function st(t,e,r,n,i,o){if(!Z(t))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(e>i||e<o)throw new RangeError(\'"value" argument is out of bounds\');if(r+n>t.length)throw new RangeError("Index out of range")}function at(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function ft(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function ut(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}V.prototype.slice=function(t,e){var r=this.length;if(0>(t=~~t)?0>(t+=r)&&(t=0):t>r&&(t=r),0>(e=void 0===e?r:~~e)?0>(e+=r)&&(e=0):e>r&&(e=r),e<t&&(e=t),V.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,e)).__proto__=V.prototype;else{e=new V(r=e-t,void 0);for(var n=0;n<r;++n)e[n]=this[n+t]}return e},V.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||ot(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r},V.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||ot(t,e,this.length),r=this[t+--e];for(var n=1;0<e&&(n*=256);)r+=this[t+--e]*n;return r},V.prototype.readUInt8=function(t,e){return e||ot(t,1,this.length),this[t]},V.prototype.readUInt16LE=function(t,e){return e||ot(t,2,this.length),this[t]|this[t+1]<<8},V.prototype.readUInt16BE=function(t,e){return e||ot(t,2,this.length),this[t]<<8|this[t+1]},V.prototype.readUInt32LE=function(t,e){return e||ot(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},V.prototype.readUInt32BE=function(t,e){return e||ot(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},V.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||ot(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r>=128*n&&(r-=Math.pow(2,8*e)),r},V.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||ot(t,e,this.length),r=e;for(var n=1,i=this[t+--r];0<r&&(n*=256);)i+=this[t+--r]*n;return i>=128*n&&(i-=Math.pow(2,8*e)),i},V.prototype.readInt8=function(t,e){return e||ot(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},V.prototype.readInt16LE=function(t,e){return e||ot(t,2,this.length),32768&(t=this[t]|this[t+1]<<8)?4294901760|t:t},V.prototype.readInt16BE=function(t,e){return e||ot(t,2,this.length),32768&(t=this[t+1]|this[t]<<8)?4294901760|t:t},V.prototype.readInt32LE=function(t,e){return e||ot(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},V.prototype.readInt32BE=function(t,e){return e||ot(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},V.prototype.readFloatLE=function(t,e){return e||ot(t,4,this.length),k(this,t,!0,23,4)},V.prototype.readFloatBE=function(t,e){return e||ot(t,4,this.length),k(this,t,!1,23,4)},V.prototype.readDoubleLE=function(t,e){return e||ot(t,8,this.length),k(this,t,!0,52,8)},V.prototype.readDoubleBE=function(t,e){return e||ot(t,8,this.length),k(this,t,!1,52,8)},V.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||st(this,t,e,r,Math.pow(2,8*r)-1,0),n=1;var i=0;for(this[e]=255&t;++i<r&&(n*=256);)this[e+i]=t/n&255;return e+r},V.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||st(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)this[e+n]=t/i&255;return e+r},V.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||st(this,t,e,1,255,0),V.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},V.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||st(this,t,e,2,65535,0),V.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):at(this,t,e,!0),e+2},V.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||st(this,t,e,2,65535,0),V.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):at(this,t,e,!1),e+2},V.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||st(this,t,e,4,4294967295,0),V.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):ft(this,t,e,!0),e+4},V.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||st(this,t,e,4,4294967295,0),V.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):ft(this,t,e,!1),e+4},V.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||st(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n),n=0;var i=1,o=0;for(this[e]=255&t;++n<r&&(i*=256);)0>t&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},V.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||st(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=1,o=0;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)0>t&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},V.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||st(this,t,e,1,127,-128),V.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},V.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||st(this,t,e,2,32767,-32768),V.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):at(this,t,e,!0),e+2},V.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||st(this,t,e,2,32767,-32768),V.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):at(this,t,e,!1),e+2},V.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||st(this,t,e,4,2147483647,-2147483648),V.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):ft(this,t,e,!0),e+4},V.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||st(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),V.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):ft(this,t,e,!1),e+4},V.prototype.writeFloatLE=function(t,e,r){return r||ut(this,0,e,4),G(this,t,e,!0,23,4),e+4},V.prototype.writeFloatBE=function(t,e,r){return r||ut(this,0,e,4),G(this,t,e,!1,23,4),e+4},V.prototype.writeDoubleLE=function(t,e,r){return r||ut(this,0,e,8),G(this,t,e,!0,52,8),e+8},V.prototype.writeDoubleBE=function(t,e,r){return r||ut(this,0,e,8),G(this,t,e,!1,52,8),e+8},V.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0<n&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&r<e&&e<n)for(n=i-1;0<=n;--n)t[n+e]=this[n+r];else if(1e3>i||!V.TYPED_ARRAY_SUPPORT)for(n=0;n<i;++n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},V.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);256>i&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!V.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(0>e||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else for(i=(t=Z(t)?t:ct(new V(t,n).toString())).length,n=0;n<r-e;++n)this[n+e]=t[n%i];return this};var ht=/[^+\\/0-9A-Za-z-_]/g;function ct(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&57344>r){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(56320>r){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,128>r){if(0>--e)break;o.push(r)}else if(2048>r){if(0>(e-=2))break;o.push(r>>6|192,63&r|128)}else if(65536>r){if(0>(e-=3))break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw Error("Invalid code point");if(0>(e-=4))break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function lt(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function pt(t){if(2>(t=(t.trim?t.trim():t.replace(/^\\s+|\\s+$/g,"")).replace(ht,"")).length)t="";else for(;0!=t.length%4;)t+="=";D||F();var e=t.length;if(0<e%4)throw Error("Invalid string. Length must be a multiple of 4");var r="="===t[e-2]?2:"="===t[e-1]?1:0,n=new B(3*e/4-r),i=0<r?e-4:e,o=0;for(e=0;e<i;e+=4){var s=W[t.charCodeAt(e)]<<18|W[t.charCodeAt(e+1)]<<12|W[t.charCodeAt(e+2)]<<6|W[t.charCodeAt(e+3)];n[o++]=s>>16&255,n[o++]=s>>8&255,n[o++]=255&s}return 2===r?(s=W[t.charCodeAt(e)]<<2|W[t.charCodeAt(e+1)]>>4,n[o++]=255&s):1===r&&(s=W[t.charCodeAt(e)]<<10|W[t.charCodeAt(e+1)]<<4|W[t.charCodeAt(e+2)]>>2,n[o++]=s>>8&255,n[o++]=255&s),n}function dt(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function yt(t){return null!=t&&(!!t._isBuffer||gt(t)||"function"==typeof t.readFloatLE&&"function"==typeof t.slice&>(t.slice(0,0)))}function gt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var _t=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:Y,Buffer:V,SlowBuffer:function(t){return+t!=t&&(t=0),V.alloc(+t)},isBuffer:yt}),Et=V,St="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function mt(t,e){return t(e={exports:{}},e.exports),e.exports}function It(){throw Error("setTimeout has not been defined")}function At(){throw Error("clearTimeout has not been defined")}var vt=It,wt=At;function Tt(t){if(vt===setTimeout)return setTimeout(t,0);if((vt===It||!vt)&&setTimeout)return vt=setTimeout,setTimeout(t,0);try{return vt(t,0)}catch(e){try{return vt.call(null,t,0)}catch(e){return vt.call(this,t,0)}}}"function"==typeof L.setTimeout&&(vt=setTimeout),"function"==typeof L.clearTimeout&&(wt=clearTimeout);var bt,Rt=[],Ot=!1,Nt=-1;function Ct(){Ot&&bt&&(Ot=!1,bt.length?Rt=bt.concat(Rt):Nt=-1,Rt.length&&Lt())}function Lt(){if(!Ot){var t=Tt(Ct);Ot=!0;for(var e=Rt.length;e;){for(bt=Rt,Rt=[];++Nt<e;)bt&&bt[Nt].run();Nt=-1,e=Rt.length}bt=null,Ot=!1,function(t){if(wt===clearTimeout)return clearTimeout(t);if((wt===At||!wt)&&clearTimeout)return wt=clearTimeout,clearTimeout(t);try{wt(t)}catch(e){try{return wt.call(null,t)}catch(e){return wt.call(this,t)}}}(t)}}function Pt(t,e){this.fun=t,this.array=e}Pt.prototype.run=function(){this.fun.apply(null,this.array)};var Wt=L.performance||{},Bt=(Wt.now||Wt.mozNow||Wt.msNow||Wt.oNow||Wt.webkitNow,new Date,function(){return"/"}),Dt=mt((function(t,e){function r(t,e){for(var r in t)e[r]=t[r]}function n(t,e,r){return i(t,e,r)}var i=_t.Buffer;i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=_t:(r(_t,e),e.Buffer=n),n.prototype=Object.create(i.prototype),r(i,n),n.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},n.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");return t=i(t),void 0!==e?"string"==typeof r?t.fill(e,r):t.fill(e):t.fill(0),t},n.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},n.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return _t.SlowBuffer(t)}})),Ft=mt((function(t,e){function r(){throw Error("secure random number generation not supported by this browser\\nuse chrome, FireFox or Internet Explorer 11")}function n(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>u||0>t)throw new TypeError("offset must be a uint32");if(t>a||t>e)throw new RangeError("offset out of range")}function i(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>u||0>t)throw new TypeError("size must be a uint32");if(t+e>r||t>a)throw new RangeError("buffer too small")}function o(t,e,r,n){if(e=new Uint8Array(t.buffer,e,r),f.getRandomValues(e),!n)return t;!function(t){var e=Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Rt.push(new Pt(t,e)),1!==Rt.length||Ot||Tt(Lt)}((function(){n(null,t)}))}var s=Dt.Buffer,a=Dt.kMaxLength,f=St.crypto||St.msCrypto,u=Math.pow(2,32)-1;f&&f.getRandomValues?(e.randomFill=function(t,e,r,a){if(!(s.isBuffer(t)||t instanceof St.Uint8Array))throw new TypeError(\'"buf" argument must be a Buffer or Uint8Array\');if("function"==typeof e)a=e,e=0,r=t.length;else if("function"==typeof r)a=r,r=t.length-e;else if("function"!=typeof a)throw new TypeError(\'"cb" argument must be a function\');return n(e,t.length),i(r,e,t.length),o(t,e,r,a)},e.randomFillSync=function(t,e,r){if(void 0===e&&(e=0),!(s.isBuffer(t)||t instanceof St.Uint8Array))throw new TypeError(\'"buf" argument must be a Buffer or Uint8Array\');return n(e,t.length),void 0===r&&(r=t.length-e),i(r,e,t.length),o(t,e,r)}):(e.randomFill=r,e.randomFillSync=r)})),Ut=mt((function(t){t.exports=Ft})).randomFillSync,Mt=Math.floor(.001*(Date.now()-performance.now()));function kt(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function Gt(t,e){for(var r,n="",i=0,o=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)r=t.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o!==a-1&&1!==s)if(o!==a-1&&2===s){if(2>n.length||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(2<n.length){if((o=n.lastIndexOf("/"))!==n.length-1){-1===o?(n="",i=0):i=(n=n.slice(0,o)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}e&&(n=0<n.length?n+"/..":"..",i=2)}else n=0<n.length?n+"/"+t.slice(o+1,a):t.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var Ht,xt={resolve:function(){for(var t,e="",r=!1,n=arguments.length-1;-1<=n&&!r;n--){if(0<=n)var i=arguments[n];else void 0===t&&(t=Bt()),i=t;kt(i),0!==i.length&&(e=i+"/"+e,r=47===i.charCodeAt(0))}return e=Gt(e,!r),r?0<e.length?"/"+e:"/":0<e.length?e:"."},normalize:function(t){if(kt(t),0===t.length)return".";var e=47===t.charCodeAt(0),r=47===t.charCodeAt(t.length-1);return 0!==(t=Gt(t,!e)).length||e||(t="."),0<t.length&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return kt(t),0<t.length&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];kt(r),0<r.length&&(t=void 0===t?r:t+"/"+r)}return void 0===t?".":xt.normalize(t)},relative:function(t,e){if(kt(t),kt(e),t===e)return"";if((t=xt.resolve(t))===(e=xt.resolve(e)))return"";for(var r=1;r<t.length&&47===t.charCodeAt(r);++r);for(var n=t.length,i=n-r,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var s=e.length-o,a=i<s?i:s,f=-1,u=0;u<=a;++u){if(u===a){if(s>a){if(47===e.charCodeAt(o+u))return e.slice(o+u+1);if(0===u)return e.slice(o+u)}else i>a&&(47===t.charCodeAt(r+u)?f=u:0===u&&(f=0));break}var h=t.charCodeAt(r+u);if(h!==e.charCodeAt(o+u))break;47===h&&(f=u)}for(i="",u=r+f+1;u<=n;++u)u!==n&&47!==t.charCodeAt(u)||(i=0===i.length?i+"..":i+"/..");return 0<i.length?i+e.slice(o+f):(o+=f,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(kt(t),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,i=!0,o=t.length-1;1<=o;--o)if(47===(e=t.charCodeAt(o))){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError(\'"ext" argument must be a string\');kt(t);var r,n=0,i=-1,o=!0;if(void 0!==e&&0<e.length&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,a=-1;for(r=t.length-1;0<=r;--r){var f=t.charCodeAt(r);if(47===f){if(!o){n=r+1;break}}else-1===a&&(o=!1,a=r+1),0<=s&&(f===e.charCodeAt(s)?-1==--s&&(i=r):(s=-1,i=a))}return n===i?i=a:-1===i&&(i=t.length),t.slice(n,i)}for(r=t.length-1;0<=r;--r)if(47===t.charCodeAt(r)){if(!o){n=r+1;break}}else-1===i&&(o=!1,i=r+1);return-1===i?"":t.slice(n,i)},extname:function(t){kt(t);for(var e=-1,r=0,n=-1,i=!0,o=0,s=t.length-1;0<=s;--s){var a=t.charCodeAt(s);if(47===a){if(!i){r=s+1;break}}else-1===n&&(i=!1,n=s+1),46===a?-1===e?e=s:1!==o&&(o=1):-1!==e&&(o=-1)}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===r+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError(\'The "pathObject" argument must be of type Object. Received type \'+typeof t);var e=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return e?e===t.root?e+r:e+"/"+r:r},parse:function(t){kt(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r=t.charCodeAt(0),n=47===r;if(n){e.root="/";var i=1}else i=0;for(var o=-1,s=0,a=-1,f=!0,u=t.length-1,h=0;u>=i;--u)if(47===(r=t.charCodeAt(u))){if(!f){s=u+1;break}}else-1===a&&(f=!1,a=u+1),46===r?-1===o?o=u:1!==h&&(h=1):-1!==o&&(h=-1);return-1===o||-1===a||0===h||1===h&&o===a-1&&o===s+1?-1!==a&&(e.base=e.name=0===s&&n?t.slice(1,a):t.slice(s,a)):(0===s&&n?(e.name=t.slice(1,o),e.base=t.slice(1,a)):(e.name=t.slice(s,o),e.base=t.slice(s,a)),e.ext=t.slice(o,a)),0<s?e.dir=t.slice(0,s-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null},Yt=xt.posix=xt,jt={hrtime:function(t){return 1e9*(t=function(t){var e=.001*performance.now(),r=Math.floor(e)+Mt;return e=Math.floor(e%1*1e9),t&&(r-=t[0],0>(e-=t[1])&&(r--,e+=1e9)),[r,e]}(t))[0]+t[1]},exit:function(t){throw new Me(t)},kill:function(t){throw new ke(t)},randomFillSync:Ut,isTTY:function(){return!0},path:Object.freeze({__proto__:null,default:Yt,__moduleExports:Yt}),fs:null},Vt=N(1),Kt=N(2),zt=N(4),qt=N(8),Xt=N(16),Jt=N(32),Zt=N(64),$t=N(128),Qt=N(256),te=N(512),ee=N(1024),re=N(2048),ne=N(4096),ie=N(8192),oe=N(16384),se=N(32768),ae=N(65536),fe=N(131072),ue=N(262144),he=N(524288),ce=N(1048576),le=N(2097152),pe=N(4194304),de=N(8388608),ye=N(16777216),ge=N(33554432),_e=N(67108864),Ee=N(134217728),Se=N(268435456),me=Vt|Kt|zt|qt|Xt|Jt|Zt|$t|Qt|te|ee|re|ne|ie|oe|se|ae|fe|ue|he|ce|le|de|pe|ye|_e|ge|Ee|Se,Ie=Vt|Kt|zt|qt|Xt|Jt|Zt|$t|Qt|le|pe|de|Ee,Ae=N(0),ve=qt|Xt|$t|te|ee|re|ne|ie|oe|se|ae|fe|ue|he|ce|le|de|ye|_e|ge|Ee,we=ve|Ie,Te=Kt|qt|Zt|le|Ee|Se,be=Kt|qt|Zt|le|Ee,Re=N(0),Oe={E2BIG:1,EACCES:2,EADDRINUSE:3,EADDRNOTAVAIL:4,EAFNOSUPPORT:5,EALREADY:7,EAGAIN:6,EBADF:8,EBADMSG:9,EBUSY:10,ECANCELED:11,ECHILD:12,ECONNABORTED:13,ECONNREFUSED:14,ECONNRESET:15,EDEADLOCK:16,EDESTADDRREQ:17,EDOM:18,EDQUOT:19,EEXIST:20,EFAULT:21,EFBIG:22,EHOSTDOWN:23,EHOSTUNREACH:23,EIDRM:24,EILSEQ:25,EINPROGRESS:26,EINTR:27,EINVAL:28,EIO:29,EISCONN:30,EISDIR:31,ELOOP:32,EMFILE:33,EMLINK:34,EMSGSIZE:35,EMULTIHOP:36,ENAMETOOLONG:37,ENETDOWN:38,ENETRESET:39,ENETUNREACH:40,ENFILE:41,ENOBUFS:42,ENODEV:43,ENOENT:44,ENOEXEC:45,ENOLCK:46,ENOLINK:47,ENOMEM:48,ENOMSG:49,ENOPROTOOPT:50,ENOSPC:51,ENOSYS:52,ENOTCONN:53,ENOTDIR:54,ENOTEMPTY:55,ENOTRECOVERABLE:56,ENOTSOCK:57,ENOTTY:59,ENXIO:60,EOVERFLOW:61,EOWNERDEAD:62,EPERM:63,EPIPE:64,EPROTO:65,EPROTONOSUPPORT:66,EPROTOTYPE:67,ERANGE:68,EROFS:69,ESPIPE:70,ESRCH:71,ESTALE:72,ETIMEDOUT:73,ETXTBSY:74,EXDEV:75},Ne=((Ht={})[6]="SIGHUP",Ht[8]="SIGINT",Ht[11]="SIGQUIT",Ht[7]="SIGILL",Ht[15]="SIGTRAP",Ht[0]="SIGABRT",Ht[2]="SIGBUS",Ht[5]="SIGFPE",Ht[9]="SIGKILL",Ht[20]="SIGUSR1",Ht[12]="SIGSEGV",Ht[21]="SIGUSR2",Ht[10]="SIGPIPE",Ht[1]="SIGALRM",Ht[14]="SIGTERM",Ht[3]="SIGCHLD",Ht[4]="SIGCONT",Ht[13]="SIGSTOP",Ht[16]="SIGTSTP",Ht[17]="SIGTTIN",Ht[18]="SIGTTOU",Ht[19]="SIGURG",Ht[23]="SIGXCPU",Ht[24]="SIGXFSZ",Ht[22]="SIGVTALRM",Ht),Ce=Vt|Kt|Xt|$t|le|Ee,Le=Vt|Zt|Xt|$t|le|Ee;function Pe(t){var e=Math.trunc(t);return t=N(Math.round(1e6*(t-e))),N(e)*N(1e6)+t}function We(t){return"number"==typeof t&&(t=Math.trunc(t)),t=N(t),Number(t/N(1e6))}function Be(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];try{return t.apply(void 0,R(e))}catch(t){if(t&&t.code&&"string"==typeof t.code)return Oe[t.code]||28;if(t instanceof Ue)return t.errno;throw t}}}function De(t,e){var r=t.FD_MAP.get(e);if(!r)throw new Ue(8);if(void 0===r.filetype){var n=t.bindings.fs.fstatSync(r.real);e=(t=Fe(t,e,n)).rightsBase,n=t.rightsInheriting,r.filetype=t.filetype,r.rights||(r.rights={base:e,inheriting:n})}return r}function Fe(t,e,r){switch(!0){case r.isBlockDevice():return{filetype:1,rightsBase:me,rightsInheriting:me};case r.isCharacterDevice():return void 0!==e&&t.bindings.isTTY(e)?{filetype:2,rightsBase:be,rightsInheriting:Re}:{filetype:2,rightsBase:me,rightsInheriting:me};case r.isDirectory():return{filetype:3,rightsBase:ve,rightsInheriting:we};case r.isFIFO():return{filetype:6,rightsBase:Te,rightsInheriting:me};case r.isFile():return{filetype:4,rightsBase:Ie,rightsInheriting:Ae};case r.isSocket():return{filetype:6,rightsBase:Te,rightsInheriting:me};case r.isSymbolicLink():return{filetype:7,rightsBase:N(0),rightsInheriting:N(0)};default:return{filetype:0,rightsBase:N(0),rightsInheriting:N(0)}}}var Ue=function(t){function e(r){var n=t.call(this)||this;return n.errno=r,Object.setPrototypeOf(n,e.prototype),n}return w(e,t),e}(Error),Me=function(t){function e(r){var n=t.call(this,"WASI Exit error: "+r)||this;return n.code=r,Object.setPrototypeOf(n,e.prototype),n}return w(e,t),e}(Error),ke=function(t){function e(r){var n=t.call(this,"WASI Kill signal: "+r)||this;return n.signal=r,Object.setPrototypeOf(n,e.prototype),n}return w(e,t),e}(Error),Ge=function(){function t(t){function e(t){switch(t){case 1:return u.hrtime();case 0:return Pe(Date.now());case 2:case 3:return u.hrtime()-m;default:return null}}function r(t,e){if(t=De(o,t),e!==N(0)&&(t.rights.base&e)===N(0))throw new Ue(63);return t}function n(t,e){return o.refreshMemory(),Array.from({length:e},(function(e,r){return r=t+8*r,e=o.view.getUint32(r,!0),r=o.view.getUint32(r+4,!0),new Uint8Array(o.memory.buffer,e,r)}))}var i,o=this,s={};t&&t.preopens?s=t.preopens:t&&t.preopenDirectories&&(s=t.preopenDirectories);var a={};t&&t.env&&(a=t.env);var f=[];t&&t.args&&(f=t.args);var u=jt;t&&t.bindings&&(u=t.bindings),this.view=this.memory=void 0,this.bindings=u,this.FD_MAP=new Map([[0,{real:0,filetype:2,rights:{base:Ce,inheriting:N(0)},path:void 0}],[1,{real:1,filetype:2,rights:{base:Le,inheriting:N(0)},path:void 0}],[2,{real:2,filetype:2,rights:{base:Le,inheriting:N(0)},path:void 0}]]);var h=this.bindings.fs,c=this.bindings.path;try{for(var l=T(Object.entries(s)),p=l.next();!p.done;p=l.next()){var d=b(p.value,2),y=d[0],g=d[1],_=h.openSync(g,h.constants.O_RDONLY),E=R(this.FD_MAP.keys()).reverse()[0]+1;this.FD_MAP.set(E,{real:_,filetype:3,rights:{base:ve,inheriting:we},fakePath:y,path:g})}}catch(t){var S={error:t}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(S)throw S.error}}var m=u.hrtime();this.wasiImport={args_get:function(t,e){o.refreshMemory();var r=t,n=e;return f.forEach((function(t){o.view.setUint32(r,n,!0),r+=4,n+=Et.from(o.memory.buffer).write(t+"\\0",n)})),0},args_sizes_get:function(t,e){return o.refreshMemory(),o.view.setUint32(t,f.length,!0),t=f.reduce((function(t,e){return t+Et.byteLength(e)+1}),0),o.view.setUint32(e,t,!0),0},environ_get:function(t,e){o.refreshMemory();var r=t,n=e;return Object.entries(a).forEach((function(t){var e=b(t,2);t=e[0],e=e[1],o.view.setUint32(r,n,!0),r+=4,n+=Et.from(o.memory.buffer).write(t+"="+e+"\\0",n)})),0},environ_sizes_get:function(t,e){o.refreshMemory();var r=Object.entries(a).map((function(t){return(t=b(t,2))[0]+"="+t[1]+"\\0"})),n=r.reduce((function(t,e){return t+Et.byteLength(e)}),0);return o.view.setUint32(t,r.length,!0),o.view.setUint32(e,n,!0),0},clock_res_get:function(t,e){switch(t){case 1:case 2:case 3:var r=N(1);break;case 0:r=N(1e3)}return o.view.setBigUint64(e,r),0},clock_time_get:function(t,r,n){return o.refreshMemory(),null===(t=e(t))?28:(o.view.setBigUint64(n,N(t),!0),0)},fd_advise:Be((function(t){return r(t,$t),52})),fd_allocate:Be((function(t){return r(t,Qt),52})),fd_close:Be((function(t){var e=r(t,N(0));return h.closeSync(e.real),o.FD_MAP.delete(t),0})),fd_datasync:Be((function(t){return t=r(t,Vt),h.fdatasyncSync(t.real),0})),fd_fdstat_get:Be((function(t,e){return t=r(t,N(0)),o.refreshMemory(),o.view.setUint8(e,t.filetype),o.view.setUint16(e+2,0,!0),o.view.setUint16(e+4,0,!0),o.view.setBigUint64(e+8,N(t.rights.base),!0),o.view.setBigUint64(e+8+8,N(t.rights.inheriting),!0),0})),fd_fdstat_set_flags:Be((function(t){return r(t,qt),52})),fd_fdstat_set_rights:Be((function(t,e,n){return((t=r(t,N(0))).rights.base|e)>t.rights.base||(t.rights.inheriting|n)>t.rights.inheriting?63:(t.rights.base=e,t.rights.inheriting=n,0)})),fd_filestat_get:Be((function(t,e){t=r(t,le);var n=h.fstatSync(t.real);return o.refreshMemory(),o.view.setBigUint64(e,N(n.dev),!0),e+=8,o.view.setBigUint64(e,N(n.ino),!0),e+=8,o.view.setUint8(e,t.filetype),e+=8,o.view.setBigUint64(e,N(n.nlink),!0),e+=8,o.view.setBigUint64(e,N(n.size),!0),e+=8,o.view.setBigUint64(e,Pe(n.atimeMs),!0),e+=8,o.view.setBigUint64(e,Pe(n.mtimeMs),!0),o.view.setBigUint64(e+8,Pe(n.ctimeMs),!0),0})),fd_filestat_set_size:Be((function(t,e){return t=r(t,pe),h.ftruncateSync(t.real,Number(e)),0})),fd_filestat_set_times:Be((function(t,n,i,o){t=r(t,de);var s=h.fstatSync(t.real),a=s.atime;s=s.mtime;var f=We(e(0));return 3==(3&o)||12==(12&o)?28:(1==(1&o)?a=We(n):2==(2&o)&&(a=f),4==(4&o)?s=We(i):8==(8&o)&&(s=f),h.futimesSync(t.real,new Date(a),new Date(s)),0)})),fd_prestat_get:Be((function(t,e){return(t=r(t,N(0))).path?(o.refreshMemory(),o.view.setUint8(e,0),o.view.setUint32(e+4,Et.byteLength(t.fakePath),!0),0):28})),fd_prestat_dir_name:Be((function(t,e,n){return(t=r(t,N(0))).path?(o.refreshMemory(),Et.from(o.memory.buffer).write(t.fakePath,e,n,"utf8"),0):28})),fd_pwrite:Be((function(t,e,i,s,a){var f=r(t,Zt|zt),u=0;return n(e,i).forEach((function(t){for(var e=0;e<t.byteLength;)e+=h.writeSync(f.real,t,e,t.byteLength-e,Number(s)+u+e);u+=e})),o.view.setUint32(a,u,!0),0})),fd_write:Be((function(t,e,i,s){var a=r(t,Zt),f=0;return n(e,i).forEach((function(t){for(var e=0;e<t.byteLength;){var r=h.writeSync(a.real,t,e,t.byteLength-e,a.offset?Number(a.offset):null);a.offset&&(a.offset+=N(r)),e+=r}f+=e})),o.view.setUint32(s,f,!0),0})),fd_pread:Be((function(t,e,i,s,a){var f;t=r(t,Kt|zt);var u=0;try{var c=T(n(e,i)),l=c.next();t:for(;!l.done;l=c.next()){var p=l.value;for(e=0;e<p.byteLength;){var d=p.byteLength-e,y=h.readSync(t.real,p,e,p.byteLength-e,Number(s)+u+e);if(e+=y,u+=y,0===y||y<d)break t}u+=e}}catch(t){var g={error:t}}finally{try{l&&!l.done&&(f=c.return)&&f.call(c)}finally{if(g)throw g.error}}return o.view.setUint32(a,u,!0),0})),fd_read:Be((function(t,e,i,s){var a,f=0===(t=r(t,Kt)).real,u=0;try{var c=T(n(e,i)),l=c.next();t:for(;!l.done;l=c.next()){var p=l.value;for(e=0;e<p.byteLength;){var d=p.byteLength-e,y=h.readSync(t.real,p,e,d,f||void 0===t.offset?null:Number(t.offset));if(f||(t.offset=(t.offset?t.offset:N(0))+N(y)),e+=y,u+=y,0===y||y<d)break t}}}catch(t){var g={error:t}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(g)throw g.error}}return o.view.setUint32(s,u,!0),0})),fd_readdir:Be((function(t,e,n,i,s){t=r(t,oe),o.refreshMemory();var a=h.readdirSync(t.path,{withFileTypes:!0}),f=e;for(i=Number(i);i<a.length;i+=1){var u=a[i],l=Et.byteLength(u.name);if(e-f>n)break;if(o.view.setBigUint64(e,N(i+1),!0),(e+=8)-f>n)break;var p=h.statSync(c.resolve(t.path,u.name));if(o.view.setBigUint64(e,N(p.ino),!0),(e+=8)-f>n)break;if(o.view.setUint32(e,l,!0),(e+=4)-f>n)break;switch(!0){case p.isBlockDevice():p=1;break;case p.isCharacterDevice():p=2;break;case p.isDirectory():p=3;break;case p.isFIFO():p=6;break;case p.isFile():p=4;break;case p.isSocket():p=6;break;case p.isSymbolicLink():p=7;break;default:p=0}if(o.view.setUint8(e,p),e+=1,(e+=3)+l>=f+n)break;Et.from(o.memory.buffer).write(u.name,e),e+=l}return o.view.setUint32(s,Math.min(e-f,n),!0),0})),fd_renumber:Be((function(t,e){return r(t,N(0)),r(e,N(0)),h.closeSync(o.FD_MAP.get(t).real),o.FD_MAP.set(t,o.FD_MAP.get(e)),o.FD_MAP.delete(e),0})),fd_seek:Be((function(t,e,n,i){switch(t=r(t,zt),o.refreshMemory(),n){case 1:t.offset=(t.offset?t.offset:N(0))+N(e);break;case 2:n=h.fstatSync(t.real).size,t.offset=N(n)+N(e);break;case 0:t.offset=N(e)}return o.view.setBigUint64(i,t.offset,!0),0})),fd_tell:Be((function(t,e){return t=r(t,Jt),o.refreshMemory(),t.offset||(t.offset=N(0)),o.view.setBigUint64(e,t.offset,!0),0})),fd_sync:Be((function(t){return t=r(t,Xt),h.fsyncSync(t.real),0})),path_create_directory:Be((function(t,e,n){return(t=r(t,te)).path?(o.refreshMemory(),e=Et.from(o.memory.buffer,e,n).toString(),h.mkdirSync(c.resolve(t.path,e)),0):28})),path_filestat_get:Be((function(t,e,n,i,s){return(t=r(t,ue)).path?(o.refreshMemory(),n=Et.from(o.memory.buffer,n,i).toString(),n=h.statSync(c.resolve(t.path,n)),o.view.setBigUint64(s,N(n.dev),!0),s+=8,o.view.setBigUint64(s,N(n.ino),!0),s+=8,o.view.setUint8(s,Fe(o,void 0,n).filetype),s+=8,o.view.setBigUint64(s,N(n.nlink),!0),s+=8,o.view.setBigUint64(s,N(n.size),!0),s+=8,o.view.setBigUint64(s,Pe(n.atimeMs),!0),s+=8,o.view.setBigUint64(s,Pe(n.mtimeMs),!0),o.view.setBigUint64(s+8,Pe(n.ctimeMs),!0),0):28})),path_filestat_set_times:Be((function(t,n,i,s,a,f,u){if(!(t=r(t,ce)).path)return 28;o.refreshMemory();var l=h.fstatSync(t.real);n=l.atime,l=l.mtime;var p=We(e(0));return 3==(3&u)||12==(12&u)?28:(1==(1&u)?n=We(a):2==(2&u)&&(n=p),4==(4&u)?l=We(f):8==(8&u)&&(l=p),i=Et.from(o.memory.buffer,i,s).toString(),h.utimesSync(c.resolve(t.path,i),new Date(n),new Date(l)),0)})),path_link:Be((function(t,e,n,i,s,a,f){return t=r(t,re),s=r(s,ne),t.path&&s.path?(o.refreshMemory(),n=Et.from(o.memory.buffer,n,i).toString(),a=Et.from(o.memory.buffer,a,f).toString(),h.linkSync(c.resolve(t.path,n),c.resolve(s.path,a)),0):28})),path_open:Be((function(t,e,n,i,s,a,f,u,l){e=r(t,ie),a=N(a),f=N(f),t=(a&(Kt|oe))!==N(0);var p=(a&(Vt|Zt|Qt|pe))!==N(0);if(p&&t)var d=h.constants.O_RDWR;else t?d=h.constants.O_RDONLY:p&&(d=h.constants.O_WRONLY);if(t=a|ie,a|=f,0!=(1&s)&&(d|=h.constants.O_CREAT,t|=ee),0!=(2&s)&&(d|=h.constants.O_DIRECTORY),0!=(4&s)&&(d|=h.constants.O_EXCL),0!=(8&s)&&(d|=h.constants.O_TRUNC,t|=he),0!=(1&u)&&(d|=h.constants.O_APPEND),0!=(2&u)&&(d=h.constants.O_DSYNC?d|h.constants.O_DSYNC:d|h.constants.O_SYNC,a|=Vt),0!=(4&u)&&(d|=h.constants.O_NONBLOCK),0!=(8&u)&&(d=h.constants.O_RSYNC?d|h.constants.O_RSYNC:d|h.constants.O_SYNC,a|=Xt),0!=(16&u)&&(d|=h.constants.O_SYNC,a|=Xt),p&&0==(d&(h.constants.O_APPEND|h.constants.O_TRUNC))&&(a|=zt),o.refreshMemory(),n=Et.from(o.memory.buffer,n,i).toString(),n=c.resolve(e.path,n),c.relative(e.path,n).startsWith(".."))return 76;try{var y=h.realpathSync(n);if(c.relative(e.path,y).startsWith(".."))return 76}catch(t){if("ENOENT"!==t.code)throw t;y=n}try{var g=h.statSync(y).isDirectory()}catch(t){}return d=!p&&g?h.openSync(y,h.constants.O_RDONLY):h.openSync(y,d),g=R(o.FD_MAP.keys()).reverse()[0]+1,o.FD_MAP.set(g,{real:d,filetype:void 0,rights:{base:t,inheriting:a},path:y}),De(o,g),o.view.setUint32(l,g,!0),0})),path_readlink:Be((function(t,e,n,i,s,a){return(t=r(t,se)).path?(o.refreshMemory(),e=Et.from(o.memory.buffer,e,n).toString(),e=c.resolve(t.path,e),e=h.readlinkSync(e),i=Et.from(o.memory.buffer).write(e,i,s),o.view.setUint32(a,i,!0),0):28})),path_remove_directory:Be((function(t,e,n){return(t=r(t,ge)).path?(o.refreshMemory(),e=Et.from(o.memory.buffer,e,n).toString(),h.rmdirSync(c.resolve(t.path,e)),0):28})),path_rename:Be((function(t,e,n,i,s,a){return t=r(t,ae),i=r(i,fe),t.path&&i.path?(o.refreshMemory(),e=Et.from(o.memory.buffer,e,n).toString(),s=Et.from(o.memory.buffer,s,a).toString(),h.renameSync(c.resolve(t.path,e),c.resolve(i.path,s)),0):28})),path_symlink:Be((function(t,e,n,i,s){return(n=r(n,ye)).path?(o.refreshMemory(),t=Et.from(o.memory.buffer,t,e).toString(),i=Et.from(o.memory.buffer,i,s).toString(),h.symlinkSync(t,c.resolve(n.path,i)),0):28})),path_unlink_file:Be((function(t,e,n){return(t=r(t,_e)).path?(o.refreshMemory(),e=Et.from(o.memory.buffer,e,n).toString(),h.unlinkSync(c.resolve(t.path,e)),0):28})),poll_oneoff:function(t,r,n,i){var s=0,a=0;o.refreshMemory();for(var f=0;f<n;f+=1){var h=o.view.getBigUint64(t,!0);t+=8;var c=o.view.getUint8(t);switch(t+=1,c){case 0:t+=7,o.view.getBigUint64(t,!0),t+=8;var l=o.view.getUint32(t,!0);t+=4,t+=4,c=o.view.getBigUint64(t,!0),t+=8,o.view.getBigUint64(t,!0),t+=8;var p=o.view.getUint16(t,!0);t+=2,t+=6;var d=1===p;p=0,null===(l=N(e(l)))?p=28:a=(c=d?c:l+c)>a?c:a,o.view.setBigUint64(r,h,!0),r+=8,o.view.setUint16(r,p,!0),r+=2,o.view.setUint8(r,0),r+=1,r+=5,s+=1;break;case 1:case 2:t+=3,o.view.getUint32(t,!0),t+=4,o.view.setBigUint64(r,h,!0),r+=8,o.view.setUint16(r,52,!0),r+=2,o.view.setUint8(r,c),r+=1,r+=5,s+=1;break;default:return 28}}for(o.view.setUint32(i,s,!0);u.hrtime()<a;);return 0},proc_exit:function(t){return u.exit(t),0},proc_raise:function(t){return t in Ne?(u.kill(Ne[t]),0):28},random_get:function(t,e){return o.refreshMemory(),u.randomFillSync(new Uint8Array(o.memory.buffer),t,e),0},sched_yield:function(){return 0},sock_recv:function(){return 52},sock_send:function(){return 52},sock_shutdown:function(){return 52}},t.traceSyscalls&&Object.keys(this.wasiImport).forEach((function(t){var e=o.wasiImport[t];o.wasiImport[t]=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];console.log("WASI: wasiImport called: "+t+" ("+r+")");try{var i=e.apply(void 0,R(r));return console.log("WASI: => "+i),i}catch(t){throw console.log("Catched error: "+t),t}}}))}return t.prototype.refreshMemory=function(){this.view&&0!==this.view.buffer.byteLength||(this.view=new C(this.memory.buffer))},t.prototype.setMemory=function(t){this.memory=t},t.prototype.start=function(t){if(null===(t=t.exports)||"object"!=typeof t)throw Error("instance.exports must be an Object. Received "+t+".");var e=t.memory;if(!(e instanceof WebAssembly.Memory))throw Error("instance.exports.memory must be a WebAssembly.Memory. Recceived "+e+".");this.setMemory(e),t._start&&t._start()},t.prototype.getImportNamespace=function(t){var e,r=null;try{for(var n=T(WebAssembly.Module.imports(t)),i=n.next();!i.done;i=n.next()){var o=i.value;if("function"===o.kind&&o.module.startsWith("wasi_"))if(r){if(r!==o.module)throw Error("Multiple namespaces detected.")}else r=o.module}}catch(t){var s={error:t}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(s)throw s.error}}return r},t.prototype.getImports=function(t){switch(this.getImportNamespace(t)){case"wasi_unstable":return{wasi_unstable:this.wasiImport};case"wasi_snapshot_preview1":return{wasi_snapshot_preview1:this.wasiImport};default:throw Error("Can\'t detect a WASI namespace for the WebAssembly Module")}},t.defaultBindings=jt,t}(),He=r(311);function xe(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function Ye(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;t=r.call(t);var n,i=[];try{for(;(void 0===e||0<e--)&&!(n=t.next()).done;)i.push(n.value)}catch(t){var o={error:t}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return i}function je(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ye(arguments[e]));return t}var Ve="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function Ke(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ze(t,e){return t(e={exports:{}},e.exports),e.exports}var qe=ze((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}}));Ke(qe);var Xe=ze((function(t,e){e.default="function"==typeof BigInt?BigInt:function(){throw Error("BigInt is not supported in this environment.")}})),Je=ze((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=qe.constants.S_IFMT,n=qe.constants.S_IFDIR,i=qe.constants.S_IFREG,o=qe.constants.S_IFBLK,s=qe.constants.S_IFCHR,a=qe.constants.S_IFLNK,f=qe.constants.S_IFIFO,u=qe.constants.S_IFSOCK;t=function(){function t(){}return t.build=function(e,r){void 0===r&&(r=!1);var n=new t,i=e.gid,o=e.atime,s=e.mtime,a=e.ctime;return r=r?Xe.default:function(t){return t},n.uid=r(e.uid),n.gid=r(i),n.rdev=r(0),n.blksize=r(4096),n.ino=r(e.ino),n.size=r(e.getSize()),n.blocks=r(1),n.atime=o,n.mtime=s,n.ctime=a,n.birthtime=a,n.atimeMs=r(o.getTime()),n.mtimeMs=r(s.getTime()),i=r(a.getTime()),n.ctimeMs=i,n.birthtimeMs=i,n.dev=r(0),n.mode=r(e.mode),n.nlink=r(e.nlink),n},t.prototype._checkModeProperty=function(t){return(Number(this.mode)&r)===t},t.prototype.isDirectory=function(){return this._checkModeProperty(n)},t.prototype.isFile=function(){return this._checkModeProperty(i)},t.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},t.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},t.prototype.isSymbolicLink=function(){return this._checkModeProperty(a)},t.prototype.isFIFO=function(){return this._checkModeProperty(f)},t.prototype.isSocket=function(){return this._checkModeProperty(u)},t}(),e.Stats=t,e.default=t}));Ke(Je);var Ze=void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},$e=[],Qe=[],tr="undefined"!=typeof Uint8Array?Uint8Array:Array,er=!1;function rr(){er=!0;for(var t=0;64>t;++t)$e[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t],Qe["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;Qe[45]=62,Qe[95]=63}function nr(t,e,r){for(var n=[],i=e;i<r;i+=3)e=(t[i]<<16)+(t[i+1]<<8)+t[i+2],n.push($e[e>>18&63]+$e[e>>12&63]+$e[e>>6&63]+$e[63&e]);return n.join("")}function ir(t){er||rr();for(var e=t.length,r=e%3,n="",i=[],o=0,s=e-r;o<s;o+=16383)i.push(nr(t,o,o+16383>s?s:o+16383));return 1===r?(t=t[e-1],n+=$e[t>>2],n+=$e[t<<4&63],n+="=="):2===r&&(t=(t[e-2]<<8)+t[e-1],n+=$e[t>>10],n+=$e[t>>4&63],n+=$e[t<<2&63],n+="="),i.push(n),i.join("")}function or(t,e,r,n,i){var o=8*i-n-1,s=(1<<o)-1,a=s>>1,f=-7,u=r?-1:1,h=t[e+(i=r?i-1:0)];for(i+=u,r=h&(1<<-f)-1,h>>=-f,f+=o;0<f;r=256*r+t[e+i],i+=u,f-=8);for(o=r&(1<<-f)-1,r>>=-f,f+=n;0<f;o=256*o+t[e+i],i+=u,f-=8);if(0===r)r=1-a;else{if(r===s)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),r-=a}return(h?-1:1)*o*Math.pow(2,r-n)}function sr(t,e,r,n,i,o){var s,a=8*o-i-1,f=(1<<a)-1,u=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0;o=n?0:o-1;var c=n?1:-1,l=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(e=isNaN(e)?1:0,n=f):(n=Math.floor(Math.log(e)/Math.LN2),1>e*(s=Math.pow(2,-n))&&(n--,s*=2),2<=(e=1<=n+u?e+h/s:e+h*Math.pow(2,1-u))*s&&(n++,s/=2),n+u>=f?(e=0,n=f):1<=n+u?(e=(e*s-1)*Math.pow(2,i),n+=u):(e=e*Math.pow(2,u-1)*Math.pow(2,i),n=0));8<=i;t[r+o]=255&e,o+=c,e/=256,i-=8);for(n=n<<i|e,a+=i;0<a;t[r+o]=255&n,o+=c,n/=256,a-=8);t[r+o-c]|=128*l}var ar={}.toString,fr=Array.isArray||function(t){return"[object Array]"==ar.call(t)};cr.TYPED_ARRAY_SUPPORT=void 0===Ze.TYPED_ARRAY_SUPPORT||Ze.TYPED_ARRAY_SUPPORT;var ur=cr.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function hr(t,e){if((cr.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<e)throw new RangeError("Invalid typed array length");return cr.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=cr.prototype:(null===t&&(t=new cr(e)),t.length=e),t}function cr(t,e,r){if(!(cr.TYPED_ARRAY_SUPPORT||this instanceof cr))return new cr(t,e,r);if("number"==typeof t){if("string"==typeof e)throw Error("If encoding is specified then the first argument must be a string");return dr(this,t)}return lr(this,t,e,r)}function lr(t,e,r,n){if("number"==typeof e)throw new TypeError(\'"value" argument must not be a number\');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){if(e.byteLength,0>r||e.byteLength<r)throw new RangeError("\'offset\' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("\'length\' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),cr.TYPED_ARRAY_SUPPORT?(t=e).__proto__=cr.prototype:t=yr(t,e),t}if("string"==typeof e){if(n=t,"string"==typeof(t=r)&&""!==t||(t="utf8"),!cr.isEncoding(t))throw new TypeError(\'"encoding" must be a valid string encoding\');return(e=(n=hr(n,r=0|Er(e,t))).write(e,t))!==r&&(n=n.slice(0,e)),n}return function(t,e){if(_r(e)){var r=0|gr(e.length);return 0===(t=hr(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return(r="number"!=typeof e.length)||(r=(r=e.length)!=r),r?hr(t,0):yr(t,e);if("Buffer"===e.type&&fr(e.data))return yr(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function pr(t){if("number"!=typeof t)throw new TypeError(\'"size" argument must be a number\');if(0>t)throw new RangeError(\'"size" argument must not be negative\')}function dr(t,e){if(pr(e),t=hr(t,0>e?0:0|gr(e)),!cr.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function yr(t,e){var r=0>e.length?0:0|gr(e.length);t=hr(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function gr(t){if(t>=(cr.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(cr.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return 0|t}function _r(t){return!(null==t||!t._isBuffer)}function Er(t,e){if(_r(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Lr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Wr(t).length;default:if(n)return Lr(t).length;e=(""+e).toLowerCase(),n=!0}}function Sr(t,e,r){var n=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":for(t=e,e=r,r=this.length,(!t||0>t)&&(t=0),(!e||0>e||e>r)&&(e=r),n="",r=t;r<e;++r)n=(t=n)+(n=16>(n=this[r])?"0"+n.toString(16):n.toString(16));return n;case"utf8":case"utf-8":return vr(this,e,r);case"ascii":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(127&this[e]);return t;case"latin1":case"binary":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(this[e]);return t;case"base64":return 0===e&&r===this.length?ir(this):ir(this.slice(e,r));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(e=this.slice(e,r),r="",t=0;t<e.length;t+=2)r+=String.fromCharCode(e[t]+256*e[t+1]);return r;default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function mr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Ir(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:-2147483648>r&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),0>r&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(0>r){if(!i)return-1;r=0}if("string"==typeof e&&(e=cr.from(e,n)),_r(e))return 0===e.length?-1:Ar(t,e,r,n,i);if("number"==typeof e)return e&=255,cr.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Ar(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Ar(t,e,r,n,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>e.length)return-1;s=2,a/=2,f/=2,r/=2}if(i)for(n=-1;r<a;r++)if(o(t,r)===o(e,-1===n?0:r-n)){if(-1===n&&(n=r),r-n+1===f)return n*s}else-1!==n&&(r-=r-n),n=-1;else for(r+f>a&&(r=a-f);0<=r;r--){for(a=!0,n=0;n<f;n++)if(o(t,r+n)!==o(e,n)){a=!1;break}if(a)return r}return-1}function vr(t,e,r){r=Math.min(t.length,r);for(var n=[];e<r;){var i=t[e],o=null,s=239<i?4:223<i?3:191<i?2:1;if(e+s<=r)switch(s){case 1:128>i&&(o=i);break;case 2:var a=t[e+1];128==(192&a)&&127<(i=(31&i)<<6|63&a)&&(o=i);break;case 3:a=t[e+1];var f=t[e+2];128==(192&a)&&128==(192&f)&&2047<(i=(15&i)<<12|(63&a)<<6|63&f)&&(55296>i||57343<i)&&(o=i);break;case 4:a=t[e+1],f=t[e+2];var u=t[e+3];128==(192&a)&&128==(192&f)&&128==(192&u)&&65535<(i=(15&i)<<18|(63&a)<<12|(63&f)<<6|63&u)&&1114112>i&&(o=i)}null===o?(o=65533,s=1):65535<o&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),e+=s}if((t=n.length)<=wr)n=String.fromCharCode.apply(String,n);else{for(r="",e=0;e<t;)r+=String.fromCharCode.apply(String,n.slice(e,e+=wr));n=r}return n}cr.poolSize=8192,cr._augment=function(t){return t.__proto__=cr.prototype,t},cr.from=function(t,e,r){return lr(null,t,e,r)},cr.TYPED_ARRAY_SUPPORT&&(cr.prototype.__proto__=Uint8Array.prototype,cr.__proto__=Uint8Array),cr.alloc=function(t,e,r){return pr(t),0>=t?hr(null,t):void 0!==e?"string"==typeof r?hr(null,t).fill(e,r):hr(null,t).fill(e):hr(null,t)},cr.allocUnsafe=function(t){return dr(null,t)},cr.allocUnsafeSlow=function(t){return dr(null,t)},cr.isBuffer=Dr,cr.compare=function(t,e){if(!_r(t)||!_r(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},cr.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},cr.concat=function(t,e){if(!fr(t))throw new TypeError(\'"list" argument must be an Array of Buffers\');if(0===t.length)return cr.alloc(0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;e=cr.allocUnsafe(e);var n=0;for(r=0;r<t.length;++r){var i=t[r];if(!_r(i))throw new TypeError(\'"list" argument must be an Array of Buffers\');i.copy(e,n),n+=i.length}return e},cr.byteLength=Er,cr.prototype._isBuffer=!0,cr.prototype.swap16=function(){var t=this.length;if(0!=t%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)mr(this,e,e+1);return this},cr.prototype.swap32=function(){var t=this.length;if(0!=t%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)mr(this,e,e+3),mr(this,e+1,e+2);return this},cr.prototype.swap64=function(){var t=this.length;if(0!=t%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)mr(this,e,e+7),mr(this,e+1,e+6),mr(this,e+2,e+5),mr(this,e+3,e+4);return this},cr.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?vr(this,0,t):Sr.apply(this,arguments)},cr.prototype.equals=function(t){if(!_r(t))throw new TypeError("Argument must be a Buffer");return this===t||0===cr.compare(this,t)},cr.prototype.inspect=function(){var t="";return 0<this.length&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(t+=" ... ")),"<Buffer "+t+">"},cr.prototype.compare=function(t,e,r,n,i){if(!_r(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),0>e||r>t.length||0>n||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s);for(n=this.slice(n,i),t=t.slice(e,r),e=0;e<a;++e)if(n[e]!==t[e]){o=n[e],s=t[e];break}return o<s?-1:s<o?1:0},cr.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},cr.prototype.indexOf=function(t,e,r){return Ir(this,t,e,r,!0)},cr.prototype.lastIndexOf=function(t,e,r){return Ir(this,t,e,r,!1)},cr.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),0<t.length&&(0>r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");for(n||(n="utf8"),i=!1;;)switch(n){case"hex":t:{if(e=Number(e)||0,n=this.length-e,r?(r=Number(r))>n&&(r=n):r=n,0!=(n=t.length)%2)throw new TypeError("Invalid hex string");for(r>n/2&&(r=n/2),n=0;n<r;++n){if(i=parseInt(t.substr(2*n,2),16),isNaN(i)){t=n;break t}this[e+n]=i}t=n}return t;case"utf8":case"utf-8":return Br(Lr(t,this.length-e),this,e,r);case"ascii":case"latin1":case"binary":return Br(Pr(t),this,e,r);case"base64":return Br(Wr(t),this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=t,i=this.length-e;for(var o=[],s=0;s<n.length&&!(0>(i-=2));++s){var a=n.charCodeAt(s);t=a>>8,a%=256,o.push(a),o.push(t)}return Br(o,this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},cr.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var wr=4096;function Tr(t,e,r){if(0!=t%1||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function br(t,e,r,n,i,o){if(!_r(t))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(e>i||e<o)throw new RangeError(\'"value" argument is out of bounds\');if(r+n>t.length)throw new RangeError("Index out of range")}function Rr(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function Or(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function Nr(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}cr.prototype.slice=function(t,e){var r=this.length;if(0>(t=~~t)?0>(t+=r)&&(t=0):t>r&&(t=r),0>(e=void 0===e?r:~~e)?0>(e+=r)&&(e=0):e>r&&(e=r),e<t&&(e=t),cr.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,e)).__proto__=cr.prototype;else{e=new cr(r=e-t,void 0);for(var n=0;n<r;++n)e[n]=this[n+t]}return e},cr.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||Tr(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r},cr.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||Tr(t,e,this.length),r=this[t+--e];for(var n=1;0<e&&(n*=256);)r+=this[t+--e]*n;return r},cr.prototype.readUInt8=function(t,e){return e||Tr(t,1,this.length),this[t]},cr.prototype.readUInt16LE=function(t,e){return e||Tr(t,2,this.length),this[t]|this[t+1]<<8},cr.prototype.readUInt16BE=function(t,e){return e||Tr(t,2,this.length),this[t]<<8|this[t+1]},cr.prototype.readUInt32LE=function(t,e){return e||Tr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},cr.prototype.readUInt32BE=function(t,e){return e||Tr(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},cr.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||Tr(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r>=128*n&&(r-=Math.pow(2,8*e)),r},cr.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||Tr(t,e,this.length),r=e;for(var n=1,i=this[t+--r];0<r&&(n*=256);)i+=this[t+--r]*n;return i>=128*n&&(i-=Math.pow(2,8*e)),i},cr.prototype.readInt8=function(t,e){return e||Tr(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},cr.prototype.readInt16LE=function(t,e){return e||Tr(t,2,this.length),32768&(t=this[t]|this[t+1]<<8)?4294901760|t:t},cr.prototype.readInt16BE=function(t,e){return e||Tr(t,2,this.length),32768&(t=this[t+1]|this[t]<<8)?4294901760|t:t},cr.prototype.readInt32LE=function(t,e){return e||Tr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},cr.prototype.readInt32BE=function(t,e){return e||Tr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},cr.prototype.readFloatLE=function(t,e){return e||Tr(t,4,this.length),or(this,t,!0,23,4)},cr.prototype.readFloatBE=function(t,e){return e||Tr(t,4,this.length),or(this,t,!1,23,4)},cr.prototype.readDoubleLE=function(t,e){return e||Tr(t,8,this.length),or(this,t,!0,52,8)},cr.prototype.readDoubleBE=function(t,e){return e||Tr(t,8,this.length),or(this,t,!1,52,8)},cr.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||br(this,t,e,r,Math.pow(2,8*r)-1,0),n=1;var i=0;for(this[e]=255&t;++i<r&&(n*=256);)this[e+i]=t/n&255;return e+r},cr.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||br(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)this[e+n]=t/i&255;return e+r},cr.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||br(this,t,e,1,255,0),cr.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},cr.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||br(this,t,e,2,65535,0),cr.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Rr(this,t,e,!0),e+2},cr.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||br(this,t,e,2,65535,0),cr.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Rr(this,t,e,!1),e+2},cr.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||br(this,t,e,4,4294967295,0),cr.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Or(this,t,e,!0),e+4},cr.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||br(this,t,e,4,4294967295,0),cr.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Or(this,t,e,!1),e+4},cr.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||br(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n),n=0;var i=1,o=0;for(this[e]=255&t;++n<r&&(i*=256);)0>t&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},cr.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||br(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=1,o=0;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)0>t&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},cr.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||br(this,t,e,1,127,-128),cr.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},cr.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||br(this,t,e,2,32767,-32768),cr.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Rr(this,t,e,!0),e+2},cr.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||br(this,t,e,2,32767,-32768),cr.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Rr(this,t,e,!1),e+2},cr.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||br(this,t,e,4,2147483647,-2147483648),cr.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Or(this,t,e,!0),e+4},cr.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||br(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),cr.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Or(this,t,e,!1),e+4},cr.prototype.writeFloatLE=function(t,e,r){return r||Nr(this,0,e,4),sr(this,t,e,!0,23,4),e+4},cr.prototype.writeFloatBE=function(t,e,r){return r||Nr(this,0,e,4),sr(this,t,e,!1,23,4),e+4},cr.prototype.writeDoubleLE=function(t,e,r){return r||Nr(this,0,e,8),sr(this,t,e,!0,52,8),e+8},cr.prototype.writeDoubleBE=function(t,e,r){return r||Nr(this,0,e,8),sr(this,t,e,!1,52,8),e+8},cr.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0<n&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&r<e&&e<n)for(n=i-1;0<=n;--n)t[n+e]=this[n+r];else if(1e3>i||!cr.TYPED_ARRAY_SUPPORT)for(n=0;n<i;++n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},cr.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);256>i&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!cr.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(0>e||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else for(i=(t=_r(t)?t:Lr(new cr(t,n).toString())).length,n=0;n<r-e;++n)this[n+e]=t[n%i];return this};var Cr=/[^+\\/0-9A-Za-z-_]/g;function Lr(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&57344>r){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(56320>r){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,128>r){if(0>--e)break;o.push(r)}else if(2048>r){if(0>(e-=2))break;o.push(r>>6|192,63&r|128)}else if(65536>r){if(0>(e-=3))break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw Error("Invalid code point");if(0>(e-=4))break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Pr(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function Wr(t){if(2>(t=(t.trim?t.trim():t.replace(/^\\s+|\\s+$/g,"")).replace(Cr,"")).length)t="";else for(;0!=t.length%4;)t+="=";er||rr();var e=t.length;if(0<e%4)throw Error("Invalid string. Length must be a multiple of 4");var r="="===t[e-2]?2:"="===t[e-1]?1:0,n=new tr(3*e/4-r),i=0<r?e-4:e,o=0;for(e=0;e<i;e+=4){var s=Qe[t.charCodeAt(e)]<<18|Qe[t.charCodeAt(e+1)]<<12|Qe[t.charCodeAt(e+2)]<<6|Qe[t.charCodeAt(e+3)];n[o++]=s>>16&255,n[o++]=s>>8&255,n[o++]=255&s}return 2===r?(s=Qe[t.charCodeAt(e)]<<2|Qe[t.charCodeAt(e+1)]>>4,n[o++]=255&s):1===r&&(s=Qe[t.charCodeAt(e)]<<10|Qe[t.charCodeAt(e+1)]<<4|Qe[t.charCodeAt(e+2)]>>2,n[o++]=s>>8&255,n[o++]=255&s),n}function Br(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Dr(t){return null!=t&&(!!t._isBuffer||Fr(t)||"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Fr(t.slice(0,0)))}function Fr(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var Ur=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:ur,Buffer:cr,SlowBuffer:function(t){return+t!=t&&(t=0),cr.alloc(+t)},isBuffer:Dr}),Mr=ze((function(t,e){function r(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return new(Ur.Buffer.bind.apply(Ur.Buffer,n([void 0,t],e)))}var n=Ve&&Ve.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;t=Array(t);var n=0;for(e=0;e<r;e++)for(var i=arguments[e],o=0,s=i.length;o<s;o++,n++)t[n]=i[o];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Buffer=Ur.Buffer,e.bufferAllocUnsafe=Ur.Buffer.allocUnsafe||r,e.bufferFrom=Ur.Buffer.from||r}));function kr(){throw Error("setTimeout has not been defined")}function Gr(){throw Error("clearTimeout has not been defined")}Ke(Mr);var Hr=kr,xr=Gr;function Yr(t){if(Hr===setTimeout)return setTimeout(t,0);if((Hr===kr||!Hr)&&setTimeout)return Hr=setTimeout,setTimeout(t,0);try{return Hr(t,0)}catch(e){try{return Hr.call(null,t,0)}catch(e){return Hr.call(this,t,0)}}}"function"==typeof Ze.setTimeout&&(Hr=setTimeout),"function"==typeof Ze.clearTimeout&&(xr=clearTimeout);var jr,Vr=[],Kr=!1,zr=-1;function qr(){Kr&&jr&&(Kr=!1,jr.length?Vr=jr.concat(Vr):zr=-1,Vr.length&&Xr())}function Xr(){if(!Kr){var t=Yr(qr);Kr=!0;for(var e=Vr.length;e;){for(jr=Vr,Vr=[];++zr<e;)jr&&jr[zr].run();zr=-1,e=Vr.length}jr=null,Kr=!1,function(t){if(xr===clearTimeout)return clearTimeout(t);if((xr===Gr||!xr)&&clearTimeout)return xr=clearTimeout,clearTimeout(t);try{xr(t)}catch(e){try{return xr.call(null,t)}catch(e){return xr.call(this,t)}}}(t)}}function Jr(t){var e=Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Vr.push(new Zr(t,e)),1!==Vr.length||Kr||Yr(Xr)}function Zr(t,e){this.fun=t,this.array=e}function $r(){}Zr.prototype.run=function(){this.fun.apply(null,this.array)};var Qr=Ze.performance||{},tn=Qr.now||Qr.mozNow||Qr.msNow||Qr.oNow||Qr.webkitNow||function(){return(new Date).getTime()},en=new Date,rn={nextTick:Jr,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:$r,addListener:$r,once:$r,off:$r,removeListener:$r,removeAllListeners:$r,emit:$r,binding:function(){throw Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(){throw Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(t){var e=.001*tn.call(Qr),r=Math.floor(e);return e=Math.floor(e%1*1e9),t&&(r-=t[0],0>(e-=t[1])&&(r--,e+=1e9)),[r,e]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-en)/1e3}},nn="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){function r(){}t.super_=e,r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t},on=/%[sdj%]/g;function sn(t){if(!mn(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(cn(arguments[r]));return e.join(" ")}r=1;var n=arguments,i=n.length;e=String(t).replace(on,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}));for(var o=n[r];r<i;o=n[++r])e=null!==o&&vn(o)?e+" "+cn(o):e+" "+o;return e}function an(t,e){if(In(Ze.process))return function(){return an(t,e).apply(this,arguments)};if(!0===rn.noDeprecation)return t;var r=!1;return function(){if(!r){if(rn.throwDeprecation)throw Error(e);rn.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}}var fn,un={};function hn(t){return In(fn)&&(fn=rn.env.NODE_DEBUG||""),t=t.toUpperCase(),un[t]||(new RegExp("\\\\b"+t+"\\\\b","i").test(fn)?un[t]=function(){var e=sn.apply(null,arguments);console.error("%s %d: %s",t,0,e)}:un[t]=function(){}),un[t]}function cn(t,e){var r={seen:[],stylize:pn};return 3<=arguments.length&&(r.depth=arguments[2]),4<=arguments.length&&(r.colors=arguments[3]),En(e)?r.showHidden=e:e&&Ln(r,e),In(r.showHidden)&&(r.showHidden=!1),In(r.depth)&&(r.depth=2),In(r.colors)&&(r.colors=!1),In(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=ln),dn(r,t,r.depth)}function ln(t,e){return(e=cn.styles[e])?"["+cn.colors[e][0]+"m"+t+"["+cn.colors[e][1]+"m":t}function pn(t){return t}function dn(t,e,r){if(t.customInspect&&e&&bn(e.inspect)&&e.inspect!==cn&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(r,t);return mn(n)||(n=dn(t,n,r)),n}if(n=function(t,e){return In(e)?t.stylize("undefined","undefined"):mn(e)?(e="\'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/\'/g,"\\\\\'").replace(/\\\\"/g,\'"\')+"\'",t.stylize(e,"string")):Sn(e)?t.stylize(""+e,"number"):En(e)?t.stylize(""+e,"boolean"):null===e?t.stylize("null","null"):void 0}(t,e))return n;var i=Object.keys(e),o=function(t){var e={};return t.forEach((function(t){e[t]=!0})),e}(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(e)),Tn(e)&&(0<=i.indexOf("message")||0<=i.indexOf("description")))return yn(e);if(0===i.length){if(bn(e))return t.stylize("[Function"+(e.name?": "+e.name:"")+"]","special");if(An(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(wn(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Tn(e))return yn(e)}n="";var s=!1,a=["{","}"];return _n(e)&&(s=!0,a=["[","]"]),bn(e)&&(n=" [Function"+(e.name?": "+e.name:"")+"]"),An(e)&&(n=" "+RegExp.prototype.toString.call(e)),wn(e)&&(n=" "+Date.prototype.toUTCString.call(e)),Tn(e)&&(n=" "+yn(e)),0!==i.length||s&&0!=e.length?0>r?An(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),i=s?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)Object.prototype.hasOwnProperty.call(e,String(s))?o.push(gn(t,e,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\\d+$/)||o.push(gn(t,e,r,n,i,!0))})),o}(t,e,r,o,i):i.map((function(n){return gn(t,e,r,o,n,s)})),t.seen.pop(),function(t,e,r){return 60<t.reduce((function(t,e){return e.indexOf("\\n"),t+e.replace(/\\u001b\\[\\d\\d?m/g,"").length+1}),0)?r[0]+(""===e?"":e+"\\n ")+" "+t.join(",\\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(i,n,a)):a[0]+n+a[1]}function yn(t){return"["+Error.prototype.toString.call(t)+"]"}function gn(t,e,r,n,i,o){var s,a;if((e=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=e.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):e.set&&(a=t.stylize("[Setter]","special")),Object.prototype.hasOwnProperty.call(n,i)||(s="["+i+"]"),a||(0>t.seen.indexOf(e.value)?-1<(a=dn(t,e.value,null===r?null:r-1)).indexOf("\\n")&&(a=o?a.split("\\n").map((function(t){return" "+t})).join("\\n").substr(2):"\\n"+a.split("\\n").map((function(t){return" "+t})).join("\\n")):a=t.stylize("[Circular]","special")),In(s)){if(o&&i.match(/^\\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/\'/g,"\\\\\'").replace(/\\\\"/g,\'"\').replace(/(^"|"$)/g,"\'"),s=t.stylize(s,"string"))}return s+": "+a}function _n(t){return Array.isArray(t)}function En(t){return"boolean"==typeof t}function Sn(t){return"number"==typeof t}function mn(t){return"string"==typeof t}function In(t){return void 0===t}function An(t){return vn(t)&&"[object RegExp]"===Object.prototype.toString.call(t)}function vn(t){return"object"==typeof t&&null!==t}function wn(t){return vn(t)&&"[object Date]"===Object.prototype.toString.call(t)}function Tn(t){return vn(t)&&("[object Error]"===Object.prototype.toString.call(t)||t instanceof Error)}function bn(t){return"function"==typeof t}function Rn(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function On(t){return 10>t?"0"+t.toString(10):t.toString(10)}cn.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},cn.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var Nn="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");function Cn(){var t=new Date,e=[On(t.getHours()),On(t.getMinutes()),On(t.getSeconds())].join(":");return[t.getDate(),Nn[t.getMonth()],e].join(" ")}function Ln(t,e){if(!e||!vn(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}var Pn={inherits:nn,_extend:Ln,log:function(){console.log("%s - %s",Cn(),sn.apply(null,arguments))},isBuffer:function(t){return Dr(t)},isPrimitive:Rn,isFunction:bn,isError:Tn,isDate:wn,isObject:vn,isRegExp:An,isUndefined:In,isSymbol:function(t){return"symbol"==typeof t},isString:mn,isNumber:Sn,isNullOrUndefined:function(t){return null==t},isNull:function(t){return null===t},isBoolean:En,isArray:_n,inspect:cn,deprecate:an,format:sn,debuglog:hn};function Wn(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}var Bn,Dn=Object.prototype.hasOwnProperty,Fn=Object.keys||function(t){var e,r=[];for(e in t)Dn.call(t,e)&&r.push(e);return r},Un=Array.prototype.slice;function Mn(){return void 0!==Bn?Bn:Bn="foo"===function(){}.name}function kn(t){return!Dr(t)&&"function"==typeof Ze.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&!!(t instanceof DataView||t.buffer&&t.buffer instanceof ArrayBuffer))}function Gn(t,e){t||Kn(t,!0,e,"==",zn)}var Hn=/\\s*function\\s+([^\\(\\s]*)\\s*/;function xn(t){if(bn(t))return Mn()?t.name:(t=t.toString().match(Hn))&&t[1]}function Yn(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=jn(Vn(this.actual),128)+" "+this.operator+" "+jn(Vn(this.expected),128),this.generatedMessage=!0);var e=t.stackStartFunction||Kn;Error.captureStackTrace?Error.captureStackTrace(this,e):(t=Error()).stack&&(t=t.stack,e=xn(e),0<=(e=t.indexOf("\\n"+e))&&(e=t.indexOf("\\n",e+1),t=t.substring(e+1)),this.stack=t)}function jn(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function Vn(t){return Mn()||!bn(t)?cn(t):"[Function"+((t=xn(t))?": "+t:"")+"]"}function Kn(t,e,r,n,i){throw new Yn({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function zn(t,e){t||Kn(t,!0,e,"==",zn)}function qn(t,e,r,n){if(t===e)return!0;if(Dr(t)&&Dr(e))return 0===Wn(t,e);if(wn(t)&&wn(e))return t.getTime()===e.getTime();if(An(t)&&An(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(!kn(t)||!kn(e)||Object.prototype.toString.call(t)!==Object.prototype.toString.call(e)||t instanceof Float32Array||t instanceof Float64Array){if(Dr(t)!==Dr(e))return!1;var i=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==i&&i===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(Rn(t)||Rn(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=Xn(t),o=Xn(e);if(i&&!o||!i&&o)return!1;if(i)return qn(t=Un.call(t),e=Un.call(e),r);i=Fn(t);var s=Fn(e);if(i.length!==s.length)return!1;for(i.sort(),s.sort(),o=i.length-1;0<=o;o--)if(i[o]!==s[o])return!1;for(o=i.length-1;0<=o;o--)if(!qn(t[s=i[o]],e[s],r,n))return!1;return!0}(t,e,r,n))}return 0===Wn(new Uint8Array(t.buffer),new Uint8Array(e.buffer))}return r?t===e:t==e}function Xn(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function Jn(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function Zn(t,e,r,n){if("function"!=typeof e)throw new TypeError(\'"block" argument must be a function\');"string"==typeof r&&(n=r,r=null);try{e()}catch(t){var i=t}e=i,n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!e&&Kn(e,r,"Missing expected exception"+n),i="string"==typeof n;var o=!t&&e&&!r;if((!t&&Tn(e)&&i&&Jn(e,r)||o)&&Kn(e,r,"Got unwanted exception"+n),t&&e&&r&&!Jn(e,r)||!t&&e)throw e}Gn.AssertionError=Yn,nn(Yn,Error),Gn.fail=Kn,Gn.ok=zn,Gn.equal=function t(e,r,n){e!=r&&Kn(e,r,n,"==",t)},Gn.notEqual=function t(e,r,n){e==r&&Kn(e,r,n,"!=",t)},Gn.deepEqual=function t(e,r,n){qn(e,r,!1)||Kn(e,r,n,"deepEqual",t)},Gn.deepStrictEqual=function t(e,r,n){qn(e,r,!0)||Kn(e,r,n,"deepStrictEqual",t)},Gn.notDeepEqual=function t(e,r,n){qn(e,r,!1)&&Kn(e,r,n,"notDeepEqual",t)},Gn.notDeepStrictEqual=function t(e,r,n){qn(e,r,!0)&&Kn(e,r,n,"notDeepStrictEqual",t)},Gn.strictEqual=function t(e,r,n){e!==r&&Kn(e,r,n,"===",t)},Gn.notStrictEqual=function t(e,r,n){e===r&&Kn(e,r,n,"!==",t)},Gn.throws=function(t,e,r){Zn(!0,t,e,r)},Gn.doesNotThrow=function(t,e,r){Zn(!1,t,e,r)},Gn.ifError=function(t){if(t)throw t};var $n=ze((function(t,e){function r(t){return function(t){function e(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return(r=t.call(this,n(e,r))||this).code=e,r[a]=e,r.name=t.prototype.name+" ["+r[a]+"]",r}return s(e,t),e}(t)}function n(t,e){Gn.strictEqual(typeof t,"string");var r=f[t];if(Gn(r,"An invalid error message key was used: "+t+"."),"function"==typeof r)t=r;else{if(t=Pn.format,void 0===e||0===e.length)return r;e.unshift(r)}return String(t.apply(null,e))}function i(t,e){f[t]="function"==typeof e?e:String(e)}function o(t,e){if(Gn(t,"expected is required"),Gn("string"==typeof e,"thing is required"),Array.isArray(t)){var r=t.length;return Gn(0<r,"At least one expected value needs to be specified"),t=t.map((function(t){return String(t)})),2<r?"one of "+e+" "+t.slice(0,r-1).join(", ")+", or "+t[r-1]:2===r?"one of "+e+" "+t[0]+" or "+t[1]:"of "+e+" "+t[0]}return"of "+e+" "+String(t)}var s=Ve&&Ve.__extends||function(){function t(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)}return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var a="undefined"==typeof Symbol?"_kCode":Symbol("code"),f={};t=function(t){function r(r){if("object"!=typeof r||null===r)throw new e.TypeError("ERR_INVALID_ARG_TYPE","options","object");var n=r.message?t.call(this,r.message)||this:t.call(this,Pn.inspect(r.actual).slice(0,128)+" "+r.operator+" "+Pn.inspect(r.expected).slice(0,128))||this;return n.generatedMessage=!r.message,n.name="AssertionError [ERR_ASSERTION]",n.code="ERR_ASSERTION",n.actual=r.actual,n.expected=r.expected,n.operator=r.operator,e.Error.captureStackTrace(n,r.stackStartFunction),n}return s(r,t),r}(Ve.Error),e.AssertionError=t,e.message=n,e.E=i,e.Error=r(Ve.Error),e.TypeError=r(Ve.TypeError),e.RangeError=r(Ve.RangeError),i("ERR_ARG_NOT_ITERABLE","%s must be iterable"),i("ERR_ASSERTION","%s"),i("ERR_BUFFER_OUT_OF_BOUNDS",(function(t,e){return e?"Attempt to write outside buffer bounds":\'"\'+t+\'" is outside of buffer bounds\'})),i("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),i("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),i("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),i("ERR_DNS_SET_SERVERS_FAILED",(function(t,e){return\'c-ares failed to set servers: "\'+t+\'" [\'+e+"]"})),i("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),i("ERR_ENCODING_NOT_SUPPORTED",(function(t){return\'The "\'+t+\'" encoding is not supported\'})),i("ERR_ENCODING_INVALID_ENCODED_DATA",(function(t){return"The encoded data was not valid for encoding "+t})),i("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),i("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),i("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),i("ERR_INDEX_OUT_OF_RANGE","Index out of range"),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){if(Gn(t,"name is required"),e.includes("not ")){var n="must not be";e=e.split("not ")[1]}else n="must be";if(Array.isArray(t))n="The "+t.map((function(t){return\'"\'+t+\'"\'})).join(", ")+" arguments "+n+" "+o(e,"type");else if(t.includes(" argument"))n="The "+t+" "+n+" "+o(e,"type");else{var i=t.includes(".")?"property":"argument";n=\'The "\'+t+\'" \'+i+" "+n+" "+o(e,"type")}return 3<=arguments.length&&(n+=". Received type "+(null!==r?typeof r:"null")),n})),i("ERR_INVALID_ARRAY_LENGTH",(function(t,e,r){return Gn.strictEqual(typeof r,"number"),\'The array "\'+t+\'" (length \'+r+") must be of length "+e+"."})),i("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),i("ERR_INVALID_CALLBACK","Callback must be a function"),i("ERR_INVALID_CHAR","Invalid character in %s"),i("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),i("ERR_INVALID_FD",\'"fd" must be a positive integer: %s\'),i("ERR_INVALID_FILE_URL_HOST",\'File URL host must be "localhost" or empty on %s\'),i("ERR_INVALID_FILE_URL_PATH","File URL path %s"),i("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),i("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),i("ERR_INVALID_OPT_VALUE",(function(t,e){return\'The value "\'+String(e)+\'" is invalid for option "\'+t+\'"\'})),i("ERR_INVALID_OPT_VALUE_ENCODING",(function(t){return\'The value "\'+String(t)+\'" is invalid for option "encoding"\'})),i("ERR_INVALID_REPL_EVAL_CONFIG",\'Cannot specify both "breakEvalOnSigint" and "eval" for REPL\'),i("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),i("ERR_INVALID_THIS",\'Value of "this" must be of type %s\'),i("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),i("ERR_INVALID_URL","Invalid URL: %s"),i("ERR_INVALID_URL_SCHEME",(function(t){return"The URL must be "+o(t,"scheme")})),i("ERR_IPC_CHANNEL_CLOSED","Channel closed"),i("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),i("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),i("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),i("ERR_MISSING_ARGS",(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];Gn(0<t.length,"At least one arg needs to be specified"),e="The ";var r=t.length;switch(t=t.map((function(t){return\'"\'+t+\'"\'})),r){case 1:e+=t[0]+" argument";break;case 2:e+=t[0]+" and "+t[1]+" arguments";break;default:e+=t.slice(0,r-1).join(", "),e+=", and "+t[r-1]+" arguments"}return e+" must be specified"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),i("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),i("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),i("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),i("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),i("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),i("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),i("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),i("ERR_SOCKET_CANNOT_SEND","Unable to send data"),i("ERR_SOCKET_CLOSED","Socket is closed"),i("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),i("ERR_STDERR_CLOSE","process.stderr cannot be closed"),i("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),i("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),i("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate\'s altnames: %s"),i("ERR_TLS_DH_PARAM_SIZE",(function(t){return"DH parameter size "+t+" is less than 2048"})),i("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),i("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),i("ERR_TLS_REQUIRED_SERVER_NAME",\'"servername" is required parameter for Server.addContext\'),i("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),i("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),i("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),i("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),i("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),i("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),i("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),i("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl")}));Ke($n);var Qn=ze((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ENCODING_UTF8="utf8",e.assertEncoding=function(t){if(t&&!Mr.Buffer.isEncoding(t))throw new $n.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",t)},e.strToEncoding=function(t,r){return r&&r!==e.ENCODING_UTF8?"buffer"===r?new Mr.Buffer(t):new Mr.Buffer(t).toString(r):t}}));Ke(Qn);var ti=ze((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=qe.constants.S_IFMT,n=qe.constants.S_IFDIR,i=qe.constants.S_IFREG,o=qe.constants.S_IFBLK,s=qe.constants.S_IFCHR,a=qe.constants.S_IFLNK,f=qe.constants.S_IFIFO,u=qe.constants.S_IFSOCK;t=function(){function t(){this.name="",this.mode=0}return t.build=function(e,r){var n=new t,i=e.getNode().mode;return n.name=Qn.strToEncoding(e.getName(),r),n.mode=i,n},t.prototype._checkModeProperty=function(t){return(this.mode&r)===t},t.prototype.isDirectory=function(){return this._checkModeProperty(n)},t.prototype.isFile=function(){return this._checkModeProperty(i)},t.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},t.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},t.prototype.isSymbolicLink=function(){return this._checkModeProperty(a)},t.prototype.isFIFO=function(){return this._checkModeProperty(f)},t.prototype.isSocket=function(){return this._checkModeProperty(u)},t}(),e.Dirent=t,e.default=t}));function ei(t,e){for(var r=0,n=t.length-1;0<=n;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function ri(){for(var t="",e=!1,r=arguments.length-1;-1<=r&&!e;r--){var n=0<=r?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(t=n+"/"+t,e="/"===n.charAt(0))}return(e?"/":"")+(t=ei(si(t.split("/"),(function(t){return!!t})),!e).join("/"))||"."}function ni(t,e){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=ri(t).substr(1),e=ri(e).substr(1),t=r(t.split("/")),e=r(e.split("/"));for(var n=Math.min(t.length,e.length),i=n,o=0;o<n;o++)if(t[o]!==e[o]){i=o;break}for(n=[],o=i;o<t.length;o++)n.push("..");return(n=n.concat(e.slice(i))).join("/")}Ke(ti);var ii=ni,oi=ri;function si(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}var ai=ze((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),t="function"==typeof setImmediate?setImmediate.bind(Ve):setTimeout.bind(Ve),e.default=t}));Ke(ai);var fi=ze((function(t,e){function r(){var t=rn||{};return t.getuid||(t.getuid=function(){return 0}),t.getgid||(t.getgid=function(){return 0}),t.cwd||(t.cwd=function(){return"/"}),t.nextTick||(t.nextTick=ai.default),t.emitWarning||(t.emitWarning=function(t,e){console.warn(e+(e?": ":"")+t)}),t.env||(t.env={}),t}Object.defineProperty(e,"__esModule",{value:!0}),e.createProcess=r,e.default=r()}));function ui(){}function hi(){hi.init.call(this)}function ci(t,e,r,n){var i;if("function"!=typeof r)throw new TypeError(\'"listener" argument must be a function\');if(i=t._events){i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events);var o=i[e]}else i=t._events=new ui,t._eventsCount=0;return o?("function"==typeof o?o=i[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),o.warned||(r=void 0===t._maxListeners?hi.defaultMaxListeners:t._maxListeners)&&0<r&&o.length>r&&(o.warned=!0,(r=Error("Possible EventEmitter memory leak detected. "+o.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",r.emitter=t,r.type=e,r.count=o.length,"function"==typeof console.warn?console.warn(r):console.log(r))):(i[e]=r,++t._eventsCount),t}function li(t,e,r){function n(){t.removeListener(e,n),i||(i=!0,r.apply(t,arguments))}var i=!1;return n.listener=r,n}function pi(t){var e=this._events;if(e){if("function"==typeof(t=e[t]))return 1;if(t)return t.length}return 0}function di(t,e){for(var r=Array(e);e--;)r[e]=t[e];return r}Ke(fi),ui.prototype=Object.create(null),hi.EventEmitter=hi,hi.usingDomains=!1,hi.prototype.domain=void 0,hi.prototype._events=void 0,hi.prototype._maxListeners=void 0,hi.defaultMaxListeners=10,hi.init=function(){this.domain=null,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new ui,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},hi.prototype.setMaxListeners=function(t){if("number"!=typeof t||0>t||isNaN(t))throw new TypeError(\'"n" argument must be a positive number\');return this._maxListeners=t,this},hi.prototype.getMaxListeners=function(){return void 0===this._maxListeners?hi.defaultMaxListeners:this._maxListeners},hi.prototype.emit=function(t){var e,r,n="error"===t;if(e=this._events)n=n&&null==e.error;else if(!n)return!1;var i=this.domain;if(n){if(e=arguments[1],!i){if(e instanceof Error)throw e;throw(i=Error(\'Uncaught, unspecified "error" event. (\'+e+")")).context=e,i}return e||(e=Error(\'Uncaught, unspecified "error" event\')),e.domainEmitter=this,e.domain=i,e.domainThrown=!1,i.emit("error",e),!1}if(!(i=e[t]))return!1;e="function"==typeof i;var o=arguments.length;switch(o){case 1:if(e)i.call(this);else for(i=di(i,e=i.length),n=0;n<e;++n)i[n].call(this);break;case 2:if(n=arguments[1],e)i.call(this,n);else for(i=di(i,e=i.length),o=0;o<e;++o)i[o].call(this,n);break;case 3:if(n=arguments[1],o=arguments[2],e)i.call(this,n,o);else for(i=di(i,e=i.length),r=0;r<e;++r)i[r].call(this,n,o);break;case 4:if(n=arguments[1],o=arguments[2],r=arguments[3],e)i.call(this,n,o,r);else{i=di(i,e=i.length);for(var s=0;s<e;++s)i[s].call(this,n,o,r)}break;default:for(n=Array(o-1),r=1;r<o;r++)n[r-1]=arguments[r];if(e)i.apply(this,n);else for(i=di(i,e=i.length),o=0;o<e;++o)i[o].apply(this,n)}return!0},hi.prototype.addListener=function(t,e){return ci(this,t,e,!1)},hi.prototype.on=hi.prototype.addListener,hi.prototype.prependListener=function(t,e){return ci(this,t,e,!0)},hi.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError(\'"listener" argument must be a function\');return this.on(t,li(this,t,e)),this},hi.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError(\'"listener" argument must be a function\');return this.prependListener(t,li(this,t,e)),this},hi.prototype.removeListener=function(t,e){var r;if("function"!=typeof e)throw new TypeError(\'"listener" argument must be a function\');var n=this._events;if(!n)return this;var i=n[t];if(!i)return this;if(i===e||i.listener&&i.listener===e)0==--this._eventsCount?this._events=new ui:(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){var o=-1;for(r=i.length;0<r--;)if(i[r]===e||i[r].listener&&i[r].listener===e){var s=i[r].listener;o=r;break}if(0>o)return this;if(1===i.length){if(i[0]=void 0,0==--this._eventsCount)return this._events=new ui,this;delete n[t]}else{r=o+1;for(var a=i.length;r<a;o+=1,r+=1)i[o]=i[r];i.pop()}n.removeListener&&this.emit("removeListener",t,s||e)}return this},hi.prototype.removeAllListeners=function(t){var e=this._events;if(!e)return this;if(!e.removeListener)return 0===arguments.length?(this._events=new ui,this._eventsCount=0):e[t]&&(0==--this._eventsCount?this._events=new ui:delete e[t]),this;if(0===arguments.length){e=Object.keys(e);for(var r,n=0;n<e.length;++n)"removeListener"!==(r=e[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new ui,this._eventsCount=0,this}if("function"==typeof(e=e[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},hi.prototype.listeners=function(t){var e=this._events;if(e)if(t=e[t])if("function"==typeof t)t=[t.listener||t];else{e=Array(t.length);for(var r=0;r<e.length;++r)e[r]=t[r].listener||t[r];t=e}else t=[];else t=[];return t},hi.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):pi.call(t,e)},hi.prototype.listenerCount=pi,hi.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]};var yi=ze((function(t,e){var r=Ve&&Ve.__extends||function(){function t(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)}return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=qe.constants.S_IFMT,i=qe.constants.S_IFDIR,o=qe.constants.S_IFREG,s=qe.constants.S_IFLNK,a=qe.constants.O_APPEND;e.SEP="/",t=function(t){function e(e,r){void 0===r&&(r=438);var n=t.call(this)||this;return n.uid=fi.default.getuid(),n.gid=fi.default.getgid(),n.atime=new Date,n.mtime=new Date,n.ctime=new Date,n.perm=438,n.mode=o,n.nlink=1,n.perm=r,n.mode|=r,n.ino=e,n}return r(e,t),e.prototype.getString=function(t){return void 0===t&&(t="utf8"),this.getBuffer().toString(t)},e.prototype.setString=function(t){this.buf=Mr.bufferFrom(t,"utf8"),this.touch()},e.prototype.getBuffer=function(){return this.buf||this.setBuffer(Mr.bufferAllocUnsafe(0)),Mr.bufferFrom(this.buf)},e.prototype.setBuffer=function(t){this.buf=Mr.bufferFrom(t),this.touch()},e.prototype.getSize=function(){return this.buf?this.buf.length:0},e.prototype.setModeProperty=function(t){this.mode=this.mode&~n|t},e.prototype.setIsFile=function(){this.setModeProperty(o)},e.prototype.setIsDirectory=function(){this.setModeProperty(i)},e.prototype.setIsSymlink=function(){this.setModeProperty(s)},e.prototype.isFile=function(){return(this.mode&n)===o},e.prototype.isDirectory=function(){return(this.mode&n)===i},e.prototype.isSymlink=function(){return(this.mode&n)===s},e.prototype.makeSymlink=function(t){this.symlink=t,this.setIsSymlink()},e.prototype.write=function(t,e,r,n){if(void 0===e&&(e=0),void 0===r&&(r=t.length),void 0===n&&(n=0),this.buf||(this.buf=Mr.bufferAllocUnsafe(0)),n+r>this.buf.length){var i=Mr.bufferAllocUnsafe(n+r);this.buf.copy(i,0,0,this.buf.length),this.buf=i}return t.copy(this.buf,n,e,e+r),this.touch(),r},e.prototype.read=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.byteLength),void 0===n&&(n=0),this.buf||(this.buf=Mr.bufferAllocUnsafe(0)),r>t.byteLength&&(r=t.byteLength),r+n>this.buf.length&&(r=this.buf.length-n),this.buf.copy(t,e,n,n+r),r},e.prototype.truncate=function(t){if(void 0===t&&(t=0),t)if(this.buf||(this.buf=Mr.bufferAllocUnsafe(0)),t<=this.buf.length)this.buf=this.buf.slice(0,t);else{var e=Mr.bufferAllocUnsafe(0);this.buf.copy(e),e.fill(0,t)}else this.buf=Mr.bufferAllocUnsafe(0);this.touch()},e.prototype.chmod=function(t){this.perm=t,this.mode=-512&this.mode|t,this.touch()},e.prototype.chown=function(t,e){this.uid=t,this.gid=e,this.touch()},e.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},e.prototype.canRead=function(t,e){return void 0===t&&(t=fi.default.getuid()),void 0===e&&(e=fi.default.getgid()),!!(4&this.perm||e===this.gid&&32&this.perm||t===this.uid&&256&this.perm)},e.prototype.canWrite=function(t,e){return void 0===t&&(t=fi.default.getuid()),void 0===e&&(e=fi.default.getgid()),!!(2&this.perm||e===this.gid&&16&this.perm||t===this.uid&&128&this.perm)},e.prototype.del=function(){this.emit("delete",this)},e.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},e}(hi.EventEmitter),e.Node=t,t=function(t){function n(e,r,n){var i=t.call(this)||this;return i.children={},i.steps=[],i.ino=0,i.length=0,i.vol=e,i.parent=r,i.steps=r?r.steps.concat([n]):[n],i}return r(n,t),n.prototype.setNode=function(t){this.node=t,this.ino=t.ino},n.prototype.getNode=function(){return this.node},n.prototype.createChild=function(t,e){void 0===e&&(e=this.vol.createNode());var r=new n(this.vol,this,t);return r.setNode(e),e.isDirectory(),this.setChild(t,r),r},n.prototype.setChild=function(t,e){return void 0===e&&(e=new n(this.vol,this,t)),this.children[t]=e,e.parent=this,this.length++,this.emit("child:add",e,this),e},n.prototype.deleteChild=function(t){delete this.children[t.getName()],this.length--,this.emit("child:delete",t,this)},n.prototype.getChild=function(t){if(Object.hasOwnProperty.call(this.children,t))return this.children[t]},n.prototype.getPath=function(){return this.steps.join(e.SEP)},n.prototype.getName=function(){return this.steps[this.steps.length-1]},n.prototype.walk=function(t,e,r){if(void 0===e&&(e=t.length),void 0===r&&(r=0),r>=t.length||r>=e)return this;var n=this.getChild(t[r]);return n?n.walk(t,e,r+1):null},n.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},n}(hi.EventEmitter),e.Link=t,t=function(){function t(t,e,r,n){this.position=0,this.link=t,this.node=e,this.flags=r,this.fd=n}return t.prototype.getString=function(){return this.node.getString()},t.prototype.setString=function(t){this.node.setString(t)},t.prototype.getBuffer=function(){return this.node.getBuffer()},t.prototype.setBuffer=function(t){this.node.setBuffer(t)},t.prototype.getSize=function(){return this.node.getSize()},t.prototype.truncate=function(t){this.node.truncate(t)},t.prototype.seekTo=function(t){this.position=t},t.prototype.stats=function(){return Je.default.build(this.node)},t.prototype.write=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.length),"number"!=typeof n&&(n=this.position),this.flags&a&&(n=this.getSize()),t=this.node.write(t,e,r,n),this.position=n+t,t},t.prototype.read=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.byteLength),"number"!=typeof n&&(n=this.position),t=this.node.read(t,e,r,n),this.position=n+t,t},t.prototype.chmod=function(t){this.node.chmod(t)},t.prototype.chown=function(t,e){this.node.chown(t,e)},t}(),e.File=t}));Ke(yi);var gi=yi.Node,_i=ze((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){var n=setTimeout.apply(null,arguments);return n&&"object"==typeof n&&"function"==typeof n.unref&&n.unref(),n}}));function Ei(){this.tail=this.head=null,this.length=0}Ke(_i),Ei.prototype.push=function(t){t={data:t,next:null},0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length},Ei.prototype.unshift=function(t){t={data:t,next:this.head},0===this.length&&(this.tail=t),this.head=t,++this.length},Ei.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,t}},Ei.prototype.clear=function(){this.head=this.tail=null,this.length=0},Ei.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},Ei.prototype.concat=function(t){if(0===this.length)return cr.alloc(0);if(1===this.length)return this.head.data;t=cr.allocUnsafe(t>>>0);for(var e=this.head,r=0;e;)e.data.copy(t,r),r+=e.data.length,e=e.next;return t};var Si=cr.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function mi(t){if(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),t&&!Si(t))throw Error("Unknown encoding: "+t);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Ai;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=vi;break;default:return void(this.write=Ii)}this.charBuffer=new cr(6),this.charLength=this.charReceived=0}function Ii(t){return t.toString(this.encoding)}function Ai(t){this.charLength=(this.charReceived=t.length%2)?2:0}function vi(t){this.charLength=(this.charReceived=t.length%3)?3:0}mi.prototype.write=function(t){for(var e="";this.charLength;){if(e=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length,t.copy(this.charBuffer,this.charReceived,0,e),this.charReceived+=e,this.charReceived<this.charLength)return"";t=t.slice(e,t.length);var r=(e=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(e.length-1);if(!(55296<=r&&56319>=r)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;return this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),n=(e+=t.toString(this.encoding,0,n)).length-1,55296<=(r=e.charCodeAt(n))&&56319>=r?(r=this.surrogateSize,this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),t.copy(this.charBuffer,0,0,r),e.substring(0,n)):e},mi.prototype.detectIncompleteChar=function(t){for(var e=3<=t.length?3:t.length;0<e;e--){var r=t[t.length-e];if(1==e&&6==r>>5){this.charLength=2;break}if(2>=e&&14==r>>4){this.charLength=3;break}if(3>=e&&30==r>>3){this.charLength=4;break}}this.charReceived=e},mi.prototype.end=function(t){var e="";return t&&t.length&&(e=this.write(t)),this.charReceived&&(t=this.encoding,e+=this.charBuffer.slice(0,this.charReceived).toString(t)),e},bi.ReadableState=Ti;var wi=hn("stream");function Ti(t,e){t=t||{},this.objectMode=!!t.objectMode,e instanceof $i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),e=t.highWaterMark;var r=this.objectMode?16:16384;this.highWaterMark=e||0===e?e:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new Ei,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.reading=this.endEmitted=this.ended=!1,this.sync=!0,this.resumeScheduled=this.readableListening=this.emittedReadable=this.needReadable=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.encoding=this.decoder=null,t.encoding&&(this.decoder=new mi(t.encoding),this.encoding=t.encoding)}function bi(t){if(!(this instanceof bi))return new bi(t);this._readableState=new Ti(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),hi.call(this)}function Ri(t,e,r,n,i){var o=r,s=null;if(Dr(o)||"string"==typeof o||null==o||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),o=s)t.emit("error",o);else if(null===r)e.reading=!1,e.ended||(e.decoder&&(r=e.decoder.end())&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length),e.ended=!0,Ni(t));else if(e.objectMode||r&&0<r.length)if(e.ended&&!i)t.emit("error",Error("stream.push() after EOF"));else if(e.endEmitted&&i)t.emit("error",Error("stream.unshift() after end event"));else{if(e.decoder&&!i&&!n){r=e.decoder.write(r);var a=!e.objectMode&&0===r.length}i||(e.reading=!1),a||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Ni(t))),e.readingMore||(e.readingMore=!0,Jr(Li,t,e))}else i||(e.reading=!1);return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function Oi(t,e){if(0>=t||0===e.length&&e.ended)return 0;if(e.objectMode)return 1;if(t!=t)return e.flowing&&e.length?e.buffer.head.data.length:e.length;if(t>e.highWaterMark){var r=t;8388608<=r?r=8388608:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r}return t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0)}function Ni(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(wi("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?Jr(Ci,t):Ci(t))}function Ci(t){wi("emit readable"),t.emit("readable"),Bi(t)}function Li(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(wi("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function Pi(t){wi("readable nexttick read 0"),t.read(0)}function Wi(t,e){e.reading||(wi("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),Bi(t),e.flowing&&!e.reading&&t.read(0)}function Bi(t){var e=t._readableState;for(wi("flow",e.flowing);e.flowing&&null!==t.read(););}function Di(t,e){if(0===e.length)return null;if(e.objectMode)var r=e.buffer.shift();else if(!t||t>=e.length)r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear();else{if(r=e.buffer,e=e.decoder,t<r.head.data.length)e=r.head.data.slice(0,t),r.head.data=r.head.data.slice(t);else{if(t===r.head.data.length)r=r.shift();else if(e){var n=1,i=(e=r.head).data;for(t-=i.length;e=e.next;){var o=e.data,s=t>o.length?o.length:t;if(i=s===o.length?i+o:i+o.slice(0,t),0==(t-=s)){s===o.length?(++n,r.head=e.next?e.next:r.tail=null):(r.head=e,e.data=o.slice(s));break}++n}r.length-=n,r=i}else{for(e=cr.allocUnsafe(t),i=1,(n=r.head).data.copy(e),t-=n.data.length;n=n.next;){if(s=t>(o=n.data).length?o.length:t,o.copy(e,e.length-t,0,s),0==(t-=s)){s===o.length?(++i,r.head=n.next?n.next:r.tail=null):(r.head=n,n.data=o.slice(s));break}++i}r.length-=i,r=e}e=r}r=e}return r}function Fi(t){var e=t._readableState;if(0<e.length)throw Error(\'"endReadable()" called on non-empty stream\');e.endEmitted||(e.ended=!0,Jr(Ui,e,t))}function Ui(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function Mi(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function ki(){}function Gi(t,e,r){this.chunk=t,this.encoding=e,this.callback=r,this.next=null}function Hi(t,e){Object.defineProperty(this,"buffer",{get:an((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),t=t||{},this.objectMode=!!t.objectMode,e instanceof $i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.finished=this.ended=this.ending=this.needDrain=!1,this.decodeStrings=!1!==t.decodeStrings,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){var r=e._writableState,n=r.sync,i=r.writecb;r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(--r.pendingcb,n?Jr(i,t):i(t),e._writableState.errorEmitted=!0,e.emit("error",t)):((t=Ki(r))||r.corked||r.bufferProcessing||!r.bufferedRequest||Vi(e,r),n?Jr(ji,e,r,t,i):ji(e,r,t,i))},this.writecb=null,this.writelen=0,this.lastBufferedRequest=this.bufferedRequest=null,this.pendingcb=0,this.errorEmitted=this.prefinished=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new qi(this)}function xi(t){if(!(this instanceof xi||this instanceof $i))return new xi(t);this._writableState=new Hi(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),hi.call(this)}function Yi(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function ji(t,e,r,n){!r&&0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain")),e.pendingcb--,n(),zi(t,e)}function Vi(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=Array(e.bufferedRequestCount),i=e.corkedRequestsFree;i.entry=r;for(var o=0;r;)n[o]=r,r=r.next,o+=1;Yi(t,e,!0,e.length,n,"",i.finish),e.pendingcb++,e.lastBufferedRequest=null,i.next?(e.corkedRequestsFree=i.next,i.next=null):e.corkedRequestsFree=new qi(e)}else{for(;r&&(n=r.chunk,Yi(t,e,!1,e.objectMode?1:n.length,n,r.encoding,r.callback),r=r.next,!e.writing););null===r&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=r,e.bufferProcessing=!1}function Ki(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function zi(t,e){var r=Ki(e);return r&&(0===e.pendingcb?(e.prefinished||(e.prefinished=!0,t.emit("prefinish")),e.finished=!0,t.emit("finish")):e.prefinished||(e.prefinished=!0,t.emit("prefinish"))),r}function qi(t){var e=this;this.entry=this.next=null,this.finish=function(r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}nn(bi,hi),bi.prototype.push=function(t,e){var r=this._readableState;return r.objectMode||"string"!=typeof t||(e=e||r.defaultEncoding)!==r.encoding&&(t=cr.from(t,e),e=""),Ri(this,r,t,e,!1)},bi.prototype.unshift=function(t){return Ri(this,this._readableState,t,"",!0)},bi.prototype.isPaused=function(){return!1===this._readableState.flowing},bi.prototype.setEncoding=function(t){return this._readableState.decoder=new mi(t),this._readableState.encoding=t,this},bi.prototype.read=function(t){wi("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return wi("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?Fi(this):Ni(this),null;if(0===(t=Oi(t,e))&&e.ended)return 0===e.length&&Fi(this),null;var n=e.needReadable;return wi("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&wi("length less than watermark",n=!0),e.ended||e.reading?wi("reading or ended",!1):n&&(wi("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Oi(r,e))),null===(n=0<t?Di(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Fi(this)),null!==n&&this.emit("data",n),n},bi.prototype._read=function(){this.emit("error",Error("not implemented"))},bi.prototype.pipe=function(t,e){function r(t){wi("onunpipe"),t===h&&i()}function n(){wi("onend"),t.end()}function i(){wi("cleanup"),t.removeListener("close",a),t.removeListener("finish",f),t.removeListener("drain",l),t.removeListener("error",s),t.removeListener("unpipe",r),h.removeListener("end",n),h.removeListener("end",i),h.removeListener("data",o),p=!0,!c.awaitDrain||t._writableState&&!t._writableState.needDrain||l()}function o(e){wi("ondata"),d=!1,!1!==t.write(e)||d||((1===c.pipesCount&&c.pipes===t||1<c.pipesCount&&-1!==Mi(c.pipes,t))&&!p&&(wi("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,d=!0),h.pause())}function s(e){wi("onerror",e),u(),t.removeListener("error",s),0===t.listeners("error").length&&t.emit("error",e)}function a(){t.removeListener("finish",f),u()}function f(){wi("onfinish"),t.removeListener("close",a),u()}function u(){wi("unpipe"),h.unpipe(t)}var h=this,c=this._readableState;switch(c.pipesCount){case 0:c.pipes=t;break;case 1:c.pipes=[c.pipes,t];break;default:c.pipes.push(t)}c.pipesCount+=1,wi("pipe count=%d opts=%j",c.pipesCount,e),e=e&&!1===e.end?i:n,c.endEmitted?Jr(e):h.once("end",e),t.on("unpipe",r);var l=function(t){return function(){var e=t._readableState;wi("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&t.listeners("data").length&&(e.flowing=!0,Bi(t))}}(h);t.on("drain",l);var p=!1,d=!1;return h.on("data",o),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",s),t.once("close",a),t.once("finish",f),t.emit("pipe",h),c.flowing||(wi("pipe resume"),h.resume()),t},bi.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this)),this;if(!t){t=e.pipes;var r=e.pipesCount;for(e.pipes=null,e.pipesCount=0,e.flowing=!1,e=0;e<r;e++)t[e].emit("unpipe",this);return this}return-1===(r=Mi(e.pipes,t))||(e.pipes.splice(r,1),--e.pipesCount,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this)),this},bi.prototype.on=function(t,e){return e=hi.prototype.on.call(this,t,e),"data"===t?!1!==this._readableState.flowing&&this.resume():"readable"===t&&((t=this._readableState).endEmitted||t.readableListening||(t.readableListening=t.needReadable=!0,t.emittedReadable=!1,t.reading?t.length&&Ni(this):Jr(Pi,this))),e},bi.prototype.addListener=bi.prototype.on,bi.prototype.resume=function(){var t=this._readableState;return t.flowing||(wi("resume"),t.flowing=!0,t.resumeScheduled||(t.resumeScheduled=!0,Jr(Wi,this,t))),this},bi.prototype.pause=function(){return wi("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(wi("pause"),this._readableState.flowing=!1,this.emit("pause")),this},bi.prototype.wrap=function(t){var e=this._readableState,r=!1,n=this;for(var i in t.on("end",(function(){if(wi("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&n.push(t)}n.push(null)})),t.on("data",(function(i){wi("wrapped data"),e.decoder&&(i=e.decoder.write(i)),e.objectMode&&null==i||!(e.objectMode||i&&i.length)||n.push(i)||(r=!0,t.pause())})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));return function(t,e){for(var r=0,n=t.length;r<n;r++)e(t[r])}(["error","close","destroy","pause","resume"],(function(e){t.on(e,n.emit.bind(n,e))})),n._read=function(e){wi("wrapped _read",e),r&&(r=!1,t.resume())},n},bi._fromList=Di,xi.WritableState=Hi,nn(xi,hi),Hi.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},xi.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))},xi.prototype.write=function(t,e,r){var n=this._writableState,i=!1;if("function"==typeof e&&(r=e,e=null),cr.isBuffer(t)?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=ki),n.ended)n=r,t=Error("write after end"),this.emit("error",t),Jr(n,t);else{var o=r,s=!0,a=!1;null===t?a=new TypeError("May not write null values to stream"):cr.isBuffer(t)||"string"==typeof t||void 0===t||n.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(this.emit("error",a),Jr(o,a),s=!1),s&&(n.pendingcb++,i=e,n.objectMode||!1===n.decodeStrings||"string"!=typeof t||(t=cr.from(t,i)),cr.isBuffer(t)&&(i="buffer"),o=n.objectMode?1:t.length,n.length+=o,(e=n.length<n.highWaterMark)||(n.needDrain=!0),n.writing||n.corked?(o=n.lastBufferedRequest,n.lastBufferedRequest=new Gi(t,i,r),o?o.next=n.lastBufferedRequest:n.bufferedRequest=n.lastBufferedRequest,n.bufferedRequestCount+=1):Yi(this,n,!1,o,t,i,r),i=e)}return i},xi.prototype.cork=function(){this._writableState.corked++},xi.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||Vi(this,t))},xi.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(-1<"hex utf8 utf-8 ascii binary base64 ucs2 ucs-2 utf16le utf-16le raw".split(" ").indexOf((t+"").toLowerCase())))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},xi.prototype._write=function(t,e,r){r(Error("not implemented"))},xi.prototype._writev=null,xi.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,e=t=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||(t=r,n.ending=!0,zi(this,n),t&&(n.finished?Jr(t):this.once("finish",t)),n.ended=!0,this.writable=!1)},nn($i,bi);for(var Xi=Object.keys(xi.prototype),Ji=0;Ji<Xi.length;Ji++){var Zi=Xi[Ji];$i.prototype[Zi]||($i.prototype[Zi]=xi.prototype[Zi])}function $i(t){if(!(this instanceof $i))return new $i(t);bi.call(this,t),xi.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",Qi)}function Qi(){this.allowHalfOpen||this._writableState.ended||Jr(to,this)}function to(t){t.end()}function eo(t){this.afterTransform=function(e,r){var n=t._transformState;n.transforming=!1;var i=n.writecb;return i?(n.writechunk=null,n.writecb=null,null!=r&&t.push(r),i(e),(e=t._readableState).reading=!1,(e.needReadable||e.length<e.highWaterMark)&&t._read(e.highWaterMark),e=void 0):e=t.emit("error",Error("no writecb in Transform class")),e},this.transforming=this.needTransform=!1,this.writeencoding=this.writechunk=this.writecb=null}function ro(t){if(!(this instanceof ro))return new ro(t);$i.call(this,t),this._transformState=new eo(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(t){no(e,t)})):no(e)}))}function no(t,e){if(e)return t.emit("error",e);if(e=t._transformState,t._writableState.length)throw Error("Calling transform done when ws.length != 0");if(e.transforming)throw Error("Calling transform done when still transforming");return t.push(null)}function io(t){if(!(this instanceof io))return new io(t);ro.call(this,t)}function oo(){hi.call(this)}nn(ro,$i),ro.prototype.push=function(t,e){return this._transformState.needTransform=!1,$i.prototype.push.call(this,t,e)},ro.prototype._transform=function(){throw Error("Not implemented")},ro.prototype._write=function(t,e,r){var n=this._transformState;n.writecb=r,n.writechunk=t,n.writeencoding=e,n.transforming||(t=this._readableState,(n.needTransform||t.needReadable||t.length<t.highWaterMark)&&this._read(t.highWaterMark))},ro.prototype._read=function(){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},nn(io,ro),io.prototype._transform=function(t,e,r){r(null,t)},nn(oo,hi),oo.Readable=bi,oo.Writable=xi,oo.Duplex=$i,oo.Transform=ro,oo.PassThrough=io,oo.Stream=oo,oo.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&f.pause&&f.pause()}function n(){f.readable&&f.resume&&f.resume()}function i(){u||(u=!0,t.end())}function o(){u||(u=!0,"function"==typeof t.destroy&&t.destroy())}function s(t){if(a(),0===hi.listenerCount(this,"error"))throw t}function a(){f.removeListener("data",r),t.removeListener("drain",n),f.removeListener("end",i),f.removeListener("close",o),f.removeListener("error",s),t.removeListener("error",s),f.removeListener("end",a),f.removeListener("close",a),t.removeListener("close",a)}var f=this;f.on("data",r),t.on("drain",n),t._isStdio||e&&!1===e.end||(f.on("end",i),f.on("close",o));var u=!1;return f.on("error",s),t.on("error",s),f.on("end",a),f.on("close",a),t.on("close",a),t.emit("pipe",f),t};var so=Array.prototype.slice,ao=function t(e,r){for(var n in r)e[n]=r[n];return 3>arguments.length?e:t.apply(null,[e].concat(so.call(arguments,2)))},fo=ze((function(t,e){function r(t,e,r){return void 0===r&&(r=function(t){return t}),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return new Promise((function(o,s){t[e].bind(t).apply(void 0,n(i,[function(t,e){return t?s(t):o(r(e))}]))}))}}var n=Ve&&Ve.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;t=Array(t);var n=0;for(e=0;e<r;e++)for(var i=arguments[e],o=0,s=i.length;o<s;o++,n++)t[n]=i[o];return t};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){this.vol=t,this.fd=e}return t.prototype.appendFile=function(t,e){return r(this.vol,"appendFile")(this.fd,t,e)},t.prototype.chmod=function(t){return r(this.vol,"fchmod")(this.fd,t)},t.prototype.chown=function(t,e){return r(this.vol,"fchown")(this.fd,t,e)},t.prototype.close=function(){return r(this.vol,"close")(this.fd)},t.prototype.datasync=function(){return r(this.vol,"fdatasync")(this.fd)},t.prototype.read=function(t,e,n,i){return r(this.vol,"read",(function(e){return{bytesRead:e,buffer:t}}))(this.fd,t,e,n,i)},t.prototype.readFile=function(t){return r(this.vol,"readFile")(this.fd,t)},t.prototype.stat=function(t){return r(this.vol,"fstat")(this.fd,t)},t.prototype.sync=function(){return r(this.vol,"fsync")(this.fd)},t.prototype.truncate=function(t){return r(this.vol,"ftruncate")(this.fd,t)},t.prototype.utimes=function(t,e){return r(this.vol,"futimes")(this.fd,t,e)},t.prototype.write=function(t,e,n,i){return r(this.vol,"write",(function(e){return{bytesWritten:e,buffer:t}}))(this.fd,t,e,n,i)},t.prototype.writeFile=function(t,e){return r(this.vol,"writeFile")(this.fd,t,e)},t}();e.FileHandle=i,e.default=function(t){return"undefined"==typeof Promise?null:{FileHandle:i,access:function(e,n){return r(t,"access")(e,n)},appendFile:function(e,n,o){return r(t,"appendFile")(e instanceof i?e.fd:e,n,o)},chmod:function(e,n){return r(t,"chmod")(e,n)},chown:function(e,n,i){return r(t,"chown")(e,n,i)},copyFile:function(e,n,i){return r(t,"copyFile")(e,n,i)},lchmod:function(e,n){return r(t,"lchmod")(e,n)},lchown:function(e,n,i){return r(t,"lchown")(e,n,i)},link:function(e,n){return r(t,"link")(e,n)},lstat:function(e,n){return r(t,"lstat")(e,n)},mkdir:function(e,n){return r(t,"mkdir")(e,n)},mkdtemp:function(e,n){return r(t,"mkdtemp")(e,n)},open:function(e,n,o){return r(t,"open",(function(e){return new i(t,e)}))(e,n,o)},readdir:function(e,n){return r(t,"readdir")(e,n)},readFile:function(e,n){return r(t,"readFile")(e instanceof i?e.fd:e,n)},readlink:function(e,n){return r(t,"readlink")(e,n)},realpath:function(e,n){return r(t,"realpath")(e,n)},rename:function(e,n){return r(t,"rename")(e,n)},rmdir:function(e){return r(t,"rmdir")(e)},stat:function(e,n){return r(t,"stat")(e,n)},symlink:function(e,n,i){return r(t,"symlink")(e,n,i)},truncate:function(e,n){return r(t,"truncate")(e,n)},unlink:function(e){return r(t,"unlink")(e)},utimes:function(e,n,i){return r(t,"utimes")(e,n,i)},writeFile:function(e,n,o){return r(t,"writeFile")(e instanceof i?e.fd:e,n,o)}}}}));Ke(fo);var uo=/[^\\x20-\\x7E]/,ho=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,co="Overflow: input needs wider integers to process",lo=Math.floor,po=String.fromCharCode;function yo(t,e){return t+22+75*(26>t)-((0!=e)<<5)}var go=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function _o(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}function Eo(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var So=Object.keys||function(t){var e,r=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(e);return r};function mo(t,e,r,n){r=r||"=";var i={};if("string"!=typeof t||0===t.length)return i;var o=/\\+/g;for(t=t.split(e||"&"),e=1e3,n&&"number"==typeof n.maxKeys&&(e=n.maxKeys),n=t.length,0<e&&n>e&&(n=e),e=0;e<n;++e){var s=t[e].replace(o,"%20"),a=s.indexOf(r);if(0<=a){var f=s.substr(0,a);s=s.substr(a+1)}else f=s,s="";f=decodeURIComponent(f),s=decodeURIComponent(s),Object.prototype.hasOwnProperty.call(i,f)?go(i[f])?i[f].push(s):i[f]=[i[f],s]:i[f]=s}return i}var Io={parse:Do,resolve:function(t,e){return Do(t,!1,!0).resolve(e)},resolveObject:function(t,e){return t?Do(t,!1,!0).resolveObject(e):e},format:function(t){return mn(t)&&(t=Fo({},t)),Uo(t)},Url:Ao};function Ao(){this.href=this.path=this.pathname=this.query=this.search=this.hash=this.hostname=this.port=this.host=this.auth=this.slashes=this.protocol=null}var vo=/^([a-z0-9.+-]+:)/i,wo=/:[0-9]*$/,To=/^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,bo="{}|\\\\^`".split("").concat(\'<>"` \\r\\n\\t\'.split("")),Ro=["\'"].concat(bo),Oo=["%","/","?",";","#"].concat(Ro),No=["/","?","#"],Co=/^[+a-z0-9A-Z_-]{0,63}$/,Lo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Po={javascript:!0,"javascript:":!0},Wo={javascript:!0,"javascript:":!0},Bo={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Do(t,e,r){if(t&&vn(t)&&t instanceof Ao)return t;var n=new Ao;return n.parse(t,e,r),n}function Fo(t,e,r,n){if(!mn(e))throw new TypeError("Parameter \'url\' must be a string, not "+typeof e);var i=e.indexOf("?");if(i=-1!==i&&i<e.indexOf("#")?"?":"#",(e=e.split(i))[0]=e[0].replace(/\\\\/g,"/"),i=(e=e.join(i)).trim(),!n&&1===e.split("#").length&&(e=To.exec(i)))return t.path=i,t.href=i,t.pathname=e[1],e[2]?(t.search=e[2],t.query=r?mo(t.search.substr(1)):t.search.substr(1)):r&&(t.search="",t.query={}),t;if(e=vo.exec(i)){var o=(e=e[0]).toLowerCase();t.protocol=o,i=i.substr(e.length)}if(n||e||i.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)){var s="//"===i.substr(0,2);!s||e&&Wo[e]||(i=i.substr(2),t.slashes=!0)}if(!Wo[e]&&(s||e&&!Bo[e])){for(e=-1,n=0;n<No.length;n++)-1!==(s=i.indexOf(No[n]))&&(-1===e||s<e)&&(e=s);for(-1!==(s=-1===e?i.lastIndexOf("@"):i.lastIndexOf("@",e))&&(n=i.slice(0,s),i=i.slice(s+1),t.auth=decodeURIComponent(n)),e=-1,n=0;n<Oo.length;n++)-1!==(s=i.indexOf(Oo[n]))&&(-1===e||s<e)&&(e=s);if(-1===e&&(e=i.length),t.host=i.slice(0,e),i=i.slice(e),Mo(t),t.hostname=t.hostname||"",!(s="["===t.hostname[0]&&"]"===t.hostname[t.hostname.length-1])){var a=t.hostname.split(/\\./);for(n=0,e=a.length;n<e;n++){var f=a[n];if(f&&!f.match(Co)){for(var u="",h=0,c=f.length;h<c;h++)u=127<f.charCodeAt(h)?u+"x":u+f[h];if(!u.match(Co)){e=a.slice(0,n),n=a.slice(n+1),(f=f.match(Lo))&&(e.push(f[1]),n.unshift(f[2])),n.length&&(i="/"+n.join(".")+i),t.hostname=e.join(".");break}}}}t.hostname=t.hostname.length>255?"":t.hostname.toLowerCase(),s||(t.hostname=function(t){return function(t,e){var r=t.split("@"),n="";1<r.length&&(n=r[0]+"@",t=r[1]),r=(t=(t=t.replace(ho,".")).split(".")).length;for(var i=[];r--;)i[r]=e(t[r]);return n+i.join(".")}(t,(function(t){if(uo.test(t)){var e,r=[],n=[],i=0;for(e=t.length;i<e;){var o=t.charCodeAt(i++);if(55296<=o&&56319>=o&&i<e){var s=t.charCodeAt(i++);56320==(64512&s)?n.push(((1023&o)<<10)+(1023&s)+65536):(n.push(o),i--)}else n.push(o)}s=(t=n).length,n=128;var a=0,f=72;for(o=0;o<s;++o){var u=t[o];128>u&&r.push(po(u))}for((i=e=r.length)&&r.push("-");i<s;){var h=2147483647;for(o=0;o<s;++o)(u=t[o])>=n&&u<h&&(h=u);var c=i+1;if(h-n>lo((2147483647-a)/c))throw new RangeError(co);for(a+=(h-n)*c,n=h,o=0;o<s;++o){if((u=t[o])<n&&2147483647<++a)throw new RangeError(co);if(u==n){var l=a;for(h=36;!(l<(u=h<=f?1:h>=f+26?26:h-f));h+=36){var p=l-u;l=36-u,r.push(po(yo(u+p%l,0))),l=lo(p/l)}for(r.push(po(yo(l,0))),f=c,h=0,a=i==e?lo(a/700):a>>1,a+=lo(a/f);455<a;h+=36)a=lo(a/35);f=lo(h+36*a/(a+38)),a=0,++i}}++a,++n}r="xn--"+r.join("")}else r=t;return r}))}(t.hostname)),n=t.port?":"+t.port:"",t.host=(t.hostname||"")+n,t.href+=t.host,s&&(t.hostname=t.hostname.substr(1,t.hostname.length-2),"/"!==i[0]&&(i="/"+i))}if(!Po[o])for(n=0,e=Ro.length;n<e;n++)s=Ro[n],-1!==i.indexOf(s)&&((f=encodeURIComponent(s))===s&&(f=escape(s)),i=i.split(s).join(f));return-1!==(n=i.indexOf("#"))&&(t.hash=i.substr(n),i=i.slice(0,n)),-1!==(n=i.indexOf("?"))?(t.search=i.substr(n),t.query=i.substr(n+1),r&&(t.query=mo(t.query)),i=i.slice(0,n)):r&&(t.search="",t.query={}),i&&(t.pathname=i),Bo[o]&&t.hostname&&!t.pathname&&(t.pathname="/"),(t.pathname||t.search)&&(n=t.pathname||"",t.path=n+(t.search||"")),t.href=Uo(t),t}function Uo(t){var e=t.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var r=t.protocol||"",n=t.pathname||"",i=t.hash||"",o=!1,s="";return t.host?o=e+t.host:t.hostname&&(o=e+(-1===t.hostname.indexOf(":")?t.hostname:"["+this.hostname+"]"),t.port&&(o+=":"+t.port)),t.query&&vn(t.query)&&Object.keys(t.query).length&&(s=function(t,e,r,n){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Eo(So(t),(function(n){var i=encodeURIComponent(_o(n))+r;return go(t[n])?Eo(t[n],(function(t){return i+encodeURIComponent(_o(t))})).join(e):i+encodeURIComponent(_o(t[n]))})).join(e):""}(t.query)),e=t.search||s&&"?"+s||"",r&&":"!==r.substr(-1)&&(r+=":"),t.slashes||(!r||Bo[r])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),e&&"?"!==e.charAt(0)&&(e="?"+e),n=n.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})),r+o+n+(e=e.replace("#","%23"))+i}function Mo(t){var e=t.host,r=wo.exec(e);r&&(":"!==(r=r[0])&&(t.port=r.substr(1)),e=e.substr(0,e.length-r.length)),e&&(t.hostname=e)}Ao.prototype.parse=function(t,e,r){return Fo(this,t,e,r)},Ao.prototype.format=function(){return Uo(this)},Ao.prototype.resolve=function(t){return this.resolveObject(Do(t,!1,!0)).format()},Ao.prototype.resolveObject=function(t){if(mn(t)){var e=new Ao;e.parse(t,!1,!0),t=e}e=new Ao;for(var r=Object.keys(this),n=0;n<r.length;n++){var i=r[n];e[i]=this[i]}if(e.hash=t.hash,""===t.href)return e.href=e.format(),e;if(t.slashes&&!t.protocol){for(r=Object.keys(t),n=0;n<r.length;n++)"protocol"!==(i=r[n])&&(e[i]=t[i]);return Bo[e.protocol]&&e.hostname&&!e.pathname&&(e.path=e.pathname="/"),e.href=e.format(),e}var o;if(t.protocol&&t.protocol!==e.protocol){if(!Bo[t.protocol]){for(r=Object.keys(t),n=0;n<r.length;n++)e[i=r[n]]=t[i];return e.href=e.format(),e}if(e.protocol=t.protocol,t.host||Wo[t.protocol])e.pathname=t.pathname;else{for(o=(t.pathname||"").split("/");o.length&&!(t.host=o.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==o[0]&&o.unshift(""),2>o.length&&o.unshift(""),e.pathname=o.join("/")}return e.search=t.search,e.query=t.query,e.host=t.host||"",e.auth=t.auth,e.hostname=t.hostname||t.host,e.port=t.port,(e.pathname||e.search)&&(e.path=(e.pathname||"")+(e.search||"")),e.slashes=e.slashes||t.slashes,e.href=e.format(),e}r=e.pathname&&"/"===e.pathname.charAt(0);var s=t.host||t.pathname&&"/"===t.pathname.charAt(0),a=r=s||r||e.host&&t.pathname;if(n=e.pathname&&e.pathname.split("/")||[],i=e.protocol&&!Bo[e.protocol],o=t.pathname&&t.pathname.split("/")||[],i&&(e.hostname="",e.port=null,e.host&&(""===n[0]?n[0]=e.host:n.unshift(e.host)),e.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===o[0]?o[0]=t.host:o.unshift(t.host)),t.host=null),r=r&&(""===o[0]||""===n[0])),s)e.host=t.host||""===t.host?t.host:e.host,e.hostname=t.hostname||""===t.hostname?t.hostname:e.hostname,e.search=t.search,e.query=t.query,n=o;else if(o.length)n||(n=[]),n.pop(),n=n.concat(o),e.search=t.search,e.query=t.query;else if(null!=t.search)return i&&(e.hostname=e.host=n.shift(),i=!!(e.host&&0<e.host.indexOf("@"))&&e.host.split("@"))&&(e.auth=i.shift(),e.host=e.hostname=i.shift()),e.search=t.search,e.query=t.query,null===e.pathname&&null===e.search||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e;if(!n.length)return e.pathname=null,e.path=e.search?"/"+e.search:null,e.href=e.format(),e;s=n.slice(-1)[0],o=(e.host||t.host||1<n.length)&&("."===s||".."===s)||""===s;for(var f=0,u=n.length;0<=u;u--)"."===(s=n[u])?n.splice(u,1):".."===s?(n.splice(u,1),f++):f&&(n.splice(u,1),f--);if(!r&&!a)for(;f--;f)n.unshift("..");return!r||""===n[0]||n[0]&&"/"===n[0].charAt(0)||n.unshift(""),o&&"/"!==n.join("/").substr(-1)&&n.push(""),a=""===n[0]||n[0]&&"/"===n[0].charAt(0),i&&(e.hostname=e.host=a?"":n.length?n.shift():"",i=!!(e.host&&0<e.host.indexOf("@"))&&e.host.split("@"))&&(e.auth=i.shift(),e.host=e.hostname=i.shift()),(r=r||e.host&&n.length)&&!a&&n.unshift(""),n.length?e.pathname=n.join("/"):(e.pathname=null,e.path=null),null===e.pathname&&null===e.search||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=t.auth||e.auth,e.slashes=e.slashes||t.slashes,e.href=e.format(),e},Ao.prototype.parseHost=function(){return Mo(this)};var ko=ze((function(t,e){function r(t,e){return t=t[e],0<e&&("/"===t||i&&"\\\\"===t)}function n(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if(i){var n=t;if("string"!=typeof n)throw new TypeError("expected a string");if(n=n.replace(/[\\\\\\/]+/g,"/"),!1!==e)if(2>(n=(e=n).length-1))n=e;else{for(;r(e,n);)n--;n=e.substr(0,n+1)}return n.replace(/^([a-zA-Z]+:|\\.\\/)/,"")}return t}Object.defineProperty(e,"__esModule",{value:!0}),e.unixify=n,e.correctPath=function(t){return n(t.replace(/^\\\\\\\\\\?\\\\.:\\\\/,"\\\\"))};var i="win32"===rn.platform}));Ke(ko);var Go=ze((function(t,e){function r(t,e){return void 0===e&&(e=fi.default.cwd()),L(e,t)}function n(t,e){return"function"==typeof t?[i(),t]:[i(t),h(e)]}function i(t){return void 0===t&&(t={}),C({},ft,t)}function o(t){return C({},it,"number"==typeof t?{mode:t}:t)}function s(t,e,r,n,i){return void 0===e&&(e=""),void 0===r&&(r=""),void 0===n&&(n=""),void 0===i&&(i=Error),e=new i(function(t,e,r,n){void 0===e&&(e=""),void 0===r&&(r=""),void 0===n&&(n="");var i="";switch(r&&(i=" \'"+r+"\'"),n&&(i+=" -> \'"+n+"\'"),t){case"ENOENT":return"ENOENT: no such file or directory, "+e+i;case"EBADF":return"EBADF: bad file descriptor, "+e+i;case"EINVAL":return"EINVAL: invalid argument, "+e+i;case"EPERM":return"EPERM: operation not permitted, "+e+i;case"EPROTO":return"EPROTO: protocol error, "+e+i;case"EEXIST":return"EEXIST: file already exists, "+e+i;case"ENOTDIR":return"ENOTDIR: not a directory, "+e+i;case"EISDIR":return"EISDIR: illegal operation on a directory, "+e+i;case"EACCES":return"EACCES: permission denied, "+e+i;case"ENOTEMPTY":return"ENOTEMPTY: directory not empty, "+e+i;case"EMFILE":return"EMFILE: too many open files, "+e+i;case"ENOSYS":return"ENOSYS: function not implemented, "+e+i;default:return t+": error occurred, "+e+i}}(t,e,r,n)),e.code=t,e}function a(t){if("number"==typeof t)return t;if("string"==typeof t){var e=N[t];if(void 0!==e)return e}throw new $n.TypeError("ERR_INVALID_OPT_VALUE","flags",t)}function f(t,e){if(!e)return t;var r=typeof e;switch(r){case"string":t=C({},t,{encoding:e});break;case"object":t=C({},t,e);break;default:throw TypeError("Expected options to be either an object or a string, but got "+r+" instead")}return"buffer"!==t.encoding&&Qn.assertEncoding(t.encoding),t}function u(t){return function(e){return f(t,e)}}function h(t){if("function"!=typeof t)throw TypeError(z.CB);return t}function c(t){return function(e,r){return"function"==typeof e?[t(),e]:[t(e),h(r)]}}function l(t){if("string"!=typeof t&&!Mr.Buffer.isBuffer(t)){try{if(!(t instanceof Io.URL))throw new TypeError(z.PATH_STR)}catch(t){throw new TypeError(z.PATH_STR)}if(""!==t.hostname)throw new $n.TypeError("ERR_INVALID_FILE_URL_HOST",fi.default.platform);t=t.pathname;for(var e=0;e<t.length;e++)if("%"===t[e]){var r=32|t.codePointAt(e+2);if("2"===t[e+1]&&102===r)throw new $n.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}t=decodeURIComponent(t)}return _(t=String(t)),t}function p(t,e){return(t=r(t,e).substr(1))?t.split(j):[]}function d(t){return p(l(t))}function y(t,e){return void 0===e&&(e=Qn.ENCODING_UTF8),Mr.Buffer.isBuffer(t)?t:t instanceof Uint8Array?Mr.bufferFrom(t):Mr.bufferFrom(String(t),e)}function g(t,e){return e&&"buffer"!==e?t.toString(e):t}function _(t,e){if(-1!==(""+t).indexOf("\\0")){if((t=Error("Path must be a string without null bytes")).code="ENOENT","function"!=typeof e)throw t;return fi.default.nextTick(e,t),!1}return!0}function E(t,e){if("number"!=typeof(t="number"==typeof t?t:"string"==typeof t?parseInt(t,8):e?E(e):void 0)||isNaN(t))throw new TypeError(z.MODE_INT);return t}function S(t){if(t>>>0!==t)throw TypeError(z.FD)}function m(t){if("string"==typeof t&&+t==t)return+t;if(t instanceof Date)return t.getTime()/1e3;if(isFinite(t))return 0>t?Date.now()/1e3:t;throw Error("Cannot parse time: "+t)}function I(t){if("number"!=typeof t)throw TypeError(z.UID)}function A(t){if("number"!=typeof t)throw TypeError(z.GID)}function v(t){t.emit("stop")}function w(t,e,r){if(!(this instanceof w))return new w(t,e,r);if(this._vol=t,void 0===(r=C({},f(r,{}))).highWaterMark&&(r.highWaterMark=65536),oo.Readable.call(this,r),this.path=l(e),this.fd=void 0===r.fd?null:r.fd,this.flags=void 0===r.flags?"r":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=void 0===r.autoClose||r.autoClose,this.pos=void 0,this.bytesRead=0,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError(\'"start" option must be a Number\');if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw new TypeError(\'"end" option must be a Number\');if(this.start>this.end)throw Error(\'"start" option must be <= "end" option\');this.pos=this.start}"number"!=typeof this.fd&&this.open(),this.on("end",(function(){this.autoClose&&this.destroy&&this.destroy()}))}function T(){this.close()}function b(t,e,r){if(!(this instanceof b))return new b(t,e,r);if(this._vol=t,r=C({},f(r,{})),oo.Writable.call(this,r),this.path=l(e),this.fd=void 0===r.fd?null:r.fd,this.flags=void 0===r.flags?"w":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.autoClose=void 0===r.autoClose||!!r.autoClose,this.pos=void 0,this.bytesWritten=0,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError(\'"start" option must be a Number\');if(0>this.start)throw Error(\'"start" must be >= zero\');this.pos=this.start}r.encoding&&this.setDefaultEncoding(r.encoding),"number"!=typeof this.fd&&this.open(),this.once("finish",(function(){this.autoClose&&this.close()}))}var R=Ve&&Ve.__extends||function(){function t(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)}return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),O=Ve&&Ve.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;t=Array(t);var n=0;for(e=0;e<r;e++)for(var i=arguments[e],o=0,s=i.length;o<s;o++,n++)t[n]=i[o];return t};Object.defineProperty(e,"__esModule",{value:!0});var N,C=ao,L=oi,P=qe.constants.O_RDONLY,W=qe.constants.O_WRONLY,B=qe.constants.O_RDWR,D=qe.constants.O_CREAT,F=qe.constants.O_EXCL,U=qe.constants.O_TRUNC,M=qe.constants.O_APPEND,k=qe.constants.O_SYNC,G=qe.constants.O_DIRECTORY,H=qe.constants.F_OK,x=qe.constants.COPYFILE_EXCL,Y=qe.constants.COPYFILE_FICLONE_FORCE,j="/",V=ii,K="win32"===fi.default.platform,z={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"};!function(t){t[t.r=P]="r",t[t["r+"]=B]="r+",t[t.rs=P|k]="rs",t[t.sr=t.rs]="sr",t[t["rs+"]=B|k]="rs+",t[t["sr+"]=t["rs+"]]="sr+",t[t.w=W|D|U]="w",t[t.wx=W|D|U|F]="wx",t[t.xw=t.wx]="xw",t[t["w+"]=B|D|U]="w+",t[t["wx+"]=B|D|U|F]="wx+",t[t["xw+"]=t["wx+"]]="xw+",t[t.a=W|M|D]="a",t[t.ax=W|M|D|F]="ax",t[t.xa=t.ax]="xa",t[t["a+"]=B|M|D]="a+",t[t["ax+"]=B|M|D|F]="ax+",t[t["xa+"]=t["ax+"]]="xa+"}(N=e.FLAGS||(e.FLAGS={})),e.flagsToNumber=a;var q=u(t={encoding:"utf8"}),X=c(q),J=u({flag:"r"}),Z={encoding:"utf8",mode:438,flag:N[N.w]},$=u(Z),Q={encoding:"utf8",mode:438,flag:N[N.a]},tt=u(Q),et=c(tt),rt=u(t),nt=c(rt),it={mode:511,recursive:!1},ot={recursive:!1},st=u({encoding:"utf8",withFileTypes:!1}),at=c(st),ft={bigint:!1};if(e.pathToFilename=l,K){var ut=r,ht=ko.unixify;r=function(t,e){return ht(ut(t,e))}}e.filenameToSteps=p,e.pathToSteps=d,e.dataToStr=function(t,e){return void 0===e&&(e=Qn.ENCODING_UTF8),Mr.Buffer.isBuffer(t)?t.toString(e):t instanceof Uint8Array?Mr.bufferFrom(t).toString(e):String(t)},e.dataToBuffer=y,e.bufferToEncoding=g,e.toUnixTimestamp=m,t=function(){function t(t){void 0===t&&(t={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=fo.default(this),this.statWatchers={},this.props=C({Node:yi.Node,Link:yi.Link,File:yi.File},t),(t=this.createLink()).setNode(this.createNode(!0));var e=this;this.StatWatcher=function(t){function r(){return t.call(this,e)||this}return R(r,t),r}(lt),this.ReadStream=function(t){function r(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(this,O([e],r))||this}return R(r,t),r}(w),this.WriteStream=function(t){function r(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(this,O([e],r))||this}return R(r,t),r}(b),this.FSWatcher=function(t){function r(){return t.call(this,e)||this}return R(r,t),r}(pt),this.root=t}return t.fromJSON=function(e,r){var n=new t;return n.fromJSON(e,r),n},Object.defineProperty(t.prototype,"promises",{get:function(){if(null===this.promisesApi)throw Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!0,configurable:!0}),t.prototype.createLink=function(t,e,r,n){if(void 0===r&&(r=!1),!t)return new this.props.Link(this,null,"");if(!e)throw Error("createLink: name cannot be empty");return t.createChild(e,this.createNode(r,n))},t.prototype.deleteLink=function(t){var e=t.parent;return!!e&&(e.deleteChild(t),!0)},t.prototype.newInoNumber=function(){return this.releasedInos.pop()||(this.ino=(this.ino+1)%4294967295)},t.prototype.newFdNumber=function(){var e=this.releasedFds.pop();return"number"==typeof e?e:t.fd--},t.prototype.createNode=function(t,e){return void 0===t&&(t=!1),e=new this.props.Node(this.newInoNumber(),e),t&&e.setIsDirectory(),this.inodes[e.ino]=e},t.prototype.getNode=function(t){return this.inodes[t]},t.prototype.deleteNode=function(t){t.del(),delete this.inodes[t.ino],this.releasedInos.push(t.ino)},t.prototype.genRndStr=function(){var t=(Math.random()+1).toString(36).substr(2,6);return 6===t.length?t:this.genRndStr()},t.prototype.getLink=function(t){return this.root.walk(t)},t.prototype.getLinkOrThrow=function(t,e){var r=p(t);if(!(r=this.getLink(r)))throw s("ENOENT",e,t);return r},t.prototype.getResolvedLink=function(t){t="string"==typeof t?p(t):t;for(var e=this.root,r=0;r<t.length;){if(!(e=e.getChild(t[r])))return null;var n=e.getNode();n.isSymlink()?(t=n.symlink.concat(t.slice(r+1)),e=this.root,r=0):r++}return e},t.prototype.getResolvedLinkOrThrow=function(t,e){var r=this.getResolvedLink(t);if(!r)throw s("ENOENT",e,t);return r},t.prototype.resolveSymlinks=function(t){return this.getResolvedLink(t.steps.slice(1))},t.prototype.getLinkAsDirOrThrow=function(t,e){var r=this.getLinkOrThrow(t,e);if(!r.getNode().isDirectory())throw s("ENOTDIR",e,t);return r},t.prototype.getLinkParent=function(t){return this.root.walk(t,t.length-1)},t.prototype.getLinkParentAsDirOrThrow=function(t,e){t=t instanceof Array?t:p(t);var r=this.getLinkParent(t);if(!r)throw s("ENOENT",e,j+t.join(j));if(!r.getNode().isDirectory())throw s("ENOTDIR",e,j+t.join(j));return r},t.prototype.getFileByFd=function(t){return this.fds[String(t)]},t.prototype.getFileByFdOrThrow=function(t,e){if(t>>>0!==t)throw TypeError(z.FD);if(!(t=this.getFileByFd(t)))throw s("EBADF",e);return t},t.prototype.getNodeByIdOrCreate=function(t,e,r){if("number"==typeof t){if(!(t=this.getFileByFd(t)))throw Error("File nto found");return t.node}var n=d(t),i=this.getLink(n);if(i)return i.getNode();if(e&D&&(e=this.getLinkParent(n)))return(i=this.createLink(e,n[n.length-1],!1,r)).getNode();throw s("ENOENT","getNodeByIdOrCreate",l(t))},t.prototype.wrapAsync=function(t,e,r){var n=this;h(r),ai.default((function(){try{r(null,t.apply(n,e))}catch(t){r(t)}}))},t.prototype._toJSON=function(t,e,r){var n;void 0===t&&(t=this.root),void 0===e&&(e={});var i=!0,o=t.children;for(var s in t.getNode().isFile()&&((n={})[t.getName()]=t.parent.getChild(t.getName()),o=n,t=t.parent),o){if(i=!1,!(o=t.getChild(s)))throw Error("_toJSON: unexpected undefined");(n=o.getNode()).isFile()?(o=o.getPath(),r&&(o=V(r,o)),e[o]=n.getString()):n.isDirectory()&&this._toJSON(o,e,r)}return t=t.getPath(),r&&(t=V(r,t)),t&&i&&(e[t]=null),e},t.prototype.toJSON=function(t,e,r){void 0===e&&(e={}),void 0===r&&(r=!1);var n=[];if(t){t instanceof Array||(t=[t]);for(var i=0;i<t.length;i++){var o=l(t[i]);(o=this.getResolvedLink(o))&&n.push(o)}}else n.push(this.root);if(!n.length)return e;for(i=0;i<n.length;i++)o=n[i],this._toJSON(o,e,r?o.getPath():"");return e},t.prototype.fromJSON=function(t,e){for(var n in void 0===e&&(e=fi.default.cwd()),t){var i=t[n];if("string"==typeof i){var o=p(n=r(n,e));1<o.length&&(o=j+o.slice(0,o.length-1).join(j),this.mkdirpBase(o,511)),this.writeFileSync(n,i)}else this.mkdirpBase(n,511)}},t.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},t.prototype.mountSync=function(t,e){this.fromJSON(e,t)},t.prototype.openLink=function(t,e,r){if(void 0===r&&(r=!0),this.openFiles>=this.maxFiles)throw s("EMFILE","open",t.getPath());var n=t;if(r&&(n=this.resolveSymlinks(t)),!n)throw s("ENOENT","open",t.getPath());if((r=n.getNode()).isDirectory()){if((e&(P|B|W))!==P)throw s("EISDIR","open",t.getPath())}else if(e&G)throw s("ENOTDIR","open",t.getPath());if(!(e&W||r.canRead()))throw s("EACCES","open",t.getPath());return t=new this.props.File(t,r,e,this.newFdNumber()),this.fds[t.fd]=t,this.openFiles++,e&U&&t.truncate(),t},t.prototype.openFile=function(t,e,r,n){void 0===n&&(n=!0);var i=p(t),o=n?this.getResolvedLink(i):this.getLink(i);if(!o&&e&D){var a=this.getResolvedLink(i.slice(0,i.length-1));if(!a)throw s("ENOENT","open",j+i.join(j));e&D&&"number"==typeof r&&(o=this.createLink(a,i[i.length-1],!1,r))}if(o)return this.openLink(o,e,n);throw s("ENOENT","open",t)},t.prototype.openBase=function(t,e,r,n){if(void 0===n&&(n=!0),!(e=this.openFile(t,e,r,n)))throw s("ENOENT","open",t);return e.fd},t.prototype.openSync=function(t,e,r){return void 0===r&&(r=438),r=E(r),t=l(t),e=a(e),this.openBase(t,e,r)},t.prototype.open=function(t,e,r,n){var i=r;"function"==typeof r&&(i=438,n=r),r=E(i||438),t=l(t),e=a(e),this.wrapAsync(this.openBase,[t,e,r],n)},t.prototype.closeFile=function(t){this.fds[t.fd]&&(this.openFiles--,delete this.fds[t.fd],this.releasedFds.push(t.fd))},t.prototype.closeSync=function(t){S(t),t=this.getFileByFdOrThrow(t,"close"),this.closeFile(t)},t.prototype.close=function(t,e){S(t),this.wrapAsync(this.closeSync,[t],e)},t.prototype.openFileOrGetById=function(t,e,r){if("number"==typeof t){if(!(t=this.fds[t]))throw s("ENOENT");return t}return this.openFile(l(t),e,r)},t.prototype.readBase=function(t,e,r,n,i){return this.getFileByFdOrThrow(t).read(e,Number(r),Number(n),i)},t.prototype.readSync=function(t,e,r,n,i){return S(t),this.readBase(t,e,r,n,i)},t.prototype.read=function(t,e,r,n,i,o){var s=this;if(h(o),0===n)return fi.default.nextTick((function(){o&&o(null,0,e)}));ai.default((function(){try{var a=s.readBase(t,e,r,n,i);o(null,a,e)}catch(t){o(t)}}))},t.prototype.readFileBase=function(t,e,r){var n="number"==typeof t&&t>>>0===t;if(!n){var i=l(t);if(i=p(i),(i=this.getResolvedLink(i))&&i.getNode().isDirectory())throw s("EISDIR","open",i.getPath());t=this.openSync(t,e)}try{var o=g(this.getFileByFdOrThrow(t).getBuffer(),r)}finally{n||this.closeSync(t)}return o},t.prototype.readFileSync=function(t,e){var r=a((e=J(e)).flag);return this.readFileBase(t,r,e.encoding)},t.prototype.readFile=function(t,e,r){e=(r=c(J)(e,r))[0],r=r[1];var n=a(e.flag);this.wrapAsync(this.readFileBase,[t,n,e.encoding],r)},t.prototype.writeBase=function(t,e,r,n,i){return this.getFileByFdOrThrow(t,"write").write(e,r,n,i)},t.prototype.writeSync=function(t,e,r,n,i){S(t);var o="string"!=typeof e;if(o){var s=0|(r||0),a=n;r=i}else var f=n;return e=y(e,f),o?void 0===a&&(a=e.length):(s=0,a=e.length),this.writeBase(t,e,s,a,r)},t.prototype.write=function(t,e,r,n,i,o){var s=this;S(t);var a=typeof e,f=typeof r,u=typeof n,c=typeof i;if("string"!==a)if("function"===f)var l=r;else if("function"===u){var p=0|r;l=n}else if("function"===c){p=0|r;var d=n;l=i}else{p=0|r,d=n;var g=i;l=o}else if("function"===f)l=r;else if("function"===u)g=r,l=n;else if("function"===c){g=r;var _=n;l=i}var E=y(e,_);"string"!==a?void 0===d&&(d=E.length):(p=0,d=E.length);var m=h(l);ai.default((function(){try{var r=s.writeBase(t,E,p,d,g);m(null,r,"string"!==a?E:e)}catch(t){m(t)}}))},t.prototype.writeFileBase=function(t,e,r,n){var i="number"==typeof t;t=i?t:this.openBase(l(t),r,n),n=0;var o=e.length;r=r&M?void 0:0;try{for(;0<o;){var s=this.writeSync(t,e,n,o,r);n+=s,o-=s,void 0!==r&&(r+=s)}}finally{i||this.closeSync(t)}},t.prototype.writeFileSync=function(t,e,r){var n=$(r);r=a(n.flag);var i=E(n.mode);e=y(e,n.encoding),this.writeFileBase(t,e,r,i)},t.prototype.writeFile=function(t,e,r,n){var i=r;"function"==typeof r&&(i=Z,n=r),r=h(n);var o=$(i);i=a(o.flag),n=E(o.mode),e=y(e,o.encoding),this.wrapAsync(this.writeFileBase,[t,e,i,n],r)},t.prototype.linkBase=function(t,e){var r=p(t),n=this.getLink(r);if(!n)throw s("ENOENT","link",t,e);var i=p(e);if(!(r=this.getLinkParent(i)))throw s("ENOENT","link",t,e);if(i=i[i.length-1],r.getChild(i))throw s("EEXIST","link",t,e);(t=n.getNode()).nlink++,r.createChild(i,t)},t.prototype.copyFileBase=function(t,e,r){var n=this.readFileSync(t);if(r&x&&this.existsSync(e))throw s("EEXIST","copyFile",t,e);if(r&Y)throw s("ENOSYS","copyFile",t,e);this.writeFileBase(e,n,N.w,438)},t.prototype.copyFileSync=function(t,e,r){return t=l(t),e=l(e),this.copyFileBase(t,e,0|(r||0))},t.prototype.copyFile=function(t,e,r,n){if(t=l(t),e=l(e),"function"==typeof r)var i=0;else i=r,r=n;h(r),this.wrapAsync(this.copyFileBase,[t,e,i],r)},t.prototype.linkSync=function(t,e){t=l(t),e=l(e),this.linkBase(t,e)},t.prototype.link=function(t,e,r){t=l(t),e=l(e),this.wrapAsync(this.linkBase,[t,e],r)},t.prototype.unlinkBase=function(t){var e=p(t);if(!(e=this.getLink(e)))throw s("ENOENT","unlink",t);if(e.length)throw Error("Dir not empty...");this.deleteLink(e),(t=e.getNode()).nlink--,0>=t.nlink&&this.deleteNode(t)},t.prototype.unlinkSync=function(t){t=l(t),this.unlinkBase(t)},t.prototype.unlink=function(t,e){t=l(t),this.wrapAsync(this.unlinkBase,[t],e)},t.prototype.symlinkBase=function(t,e){var r=p(e),n=this.getLinkParent(r);if(!n)throw s("ENOENT","symlink",t,e);if(r=r[r.length-1],n.getChild(r))throw s("EEXIST","symlink",t,e);return(e=n.createChild(r)).getNode().makeSymlink(p(t)),e},t.prototype.symlinkSync=function(t,e){t=l(t),e=l(e),this.symlinkBase(t,e)},t.prototype.symlink=function(t,e,r,n){r=h("function"==typeof r?r:n),t=l(t),e=l(e),this.wrapAsync(this.symlinkBase,[t,e],r)},t.prototype.realpathBase=function(t,e){var r=p(t);if(!(r=this.getResolvedLink(r)))throw s("ENOENT","realpath",t);return Qn.strToEncoding(r.getPath(),e)},t.prototype.realpathSync=function(t,e){return this.realpathBase(l(t),rt(e).encoding)},t.prototype.realpath=function(t,e,r){e=(r=nt(e,r))[0],r=r[1],t=l(t),this.wrapAsync(this.realpathBase,[t,e.encoding],r)},t.prototype.lstatBase=function(t,e){void 0===e&&(e=!1);var r=this.getLink(p(t));if(!r)throw s("ENOENT","lstat",t);return Je.default.build(r.getNode(),e)},t.prototype.lstatSync=function(t,e){return this.lstatBase(l(t),i(e).bigint)},t.prototype.lstat=function(t,e,r){e=(r=n(e,r))[0],r=r[1],this.wrapAsync(this.lstatBase,[l(t),e.bigint],r)},t.prototype.statBase=function(t,e){void 0===e&&(e=!1);var r=this.getResolvedLink(p(t));if(!r)throw s("ENOENT","stat",t);return Je.default.build(r.getNode(),e)},t.prototype.statSync=function(t,e){return this.statBase(l(t),i(e).bigint)},t.prototype.stat=function(t,e,r){e=(r=n(e,r))[0],r=r[1],this.wrapAsync(this.statBase,[l(t),e.bigint],r)},t.prototype.fstatBase=function(t,e){if(void 0===e&&(e=!1),!(t=this.getFileByFd(t)))throw s("EBADF","fstat");return Je.default.build(t.node,e)},t.prototype.fstatSync=function(t,e){return this.fstatBase(t,i(e).bigint)},t.prototype.fstat=function(t,e,r){e=n(e,r),this.wrapAsync(this.fstatBase,[t,e[0].bigint],e[1])},t.prototype.renameBase=function(t,e){var r=this.getLink(p(t));if(!r)throw s("ENOENT","rename",t,e);var n=p(e),i=this.getLinkParent(n);if(!i)throw s("ENOENT","rename",t,e);(t=r.parent)&&t.deleteChild(r),r.steps=O(i.steps,[n[n.length-1]]),i.setChild(r.getName(),r)},t.prototype.renameSync=function(t,e){t=l(t),e=l(e),this.renameBase(t,e)},t.prototype.rename=function(t,e,r){t=l(t),e=l(e),this.wrapAsync(this.renameBase,[t,e],r)},t.prototype.existsBase=function(t){return!!this.statBase(t)},t.prototype.existsSync=function(t){try{return this.existsBase(l(t))}catch(t){return!1}},t.prototype.exists=function(t,e){var r=this,n=l(t);if("function"!=typeof e)throw Error(z.CB);ai.default((function(){try{e(r.existsBase(n))}catch(t){e(!1)}}))},t.prototype.accessBase=function(t){this.getLinkOrThrow(t,"access")},t.prototype.accessSync=function(t,e){void 0===e&&(e=H),t=l(t),this.accessBase(t,0|e)},t.prototype.access=function(t,e,r){var n=H;"function"!=typeof e&&(n=0|e,e=h(r)),t=l(t),this.wrapAsync(this.accessBase,[t,n],e)},t.prototype.appendFileSync=function(t,e,r){void 0===r&&(r=Q),(r=tt(r)).flag&&t>>>0!==t||(r.flag="a"),this.writeFileSync(t,e,r)},t.prototype.appendFile=function(t,e,r,n){r=(n=et(r,n))[0],n=n[1],r.flag&&t>>>0!==t||(r.flag="a"),this.writeFile(t,e,r,n)},t.prototype.readdirBase=function(t,e){var r=p(t);if(!(r=this.getResolvedLink(r)))throw s("ENOENT","readdir",t);if(!r.getNode().isDirectory())throw s("ENOTDIR","scandir",t);if(e.withFileTypes){var n=[];for(i in r.children)(t=r.getChild(i))&&n.push(ti.default.build(t,e.encoding));return K||"buffer"===e.encoding||n.sort((function(t,e){return t.name<e.name?-1:t.name>e.name?1:0})),n}var i=[];for(n in r.children)i.push(Qn.strToEncoding(n,e.encoding));return K||"buffer"===e.encoding||i.sort(),i},t.prototype.readdirSync=function(t,e){return e=st(e),t=l(t),this.readdirBase(t,e)},t.prototype.readdir=function(t,e,r){e=(r=at(e,r))[0],r=r[1],t=l(t),this.wrapAsync(this.readdirBase,[t,e],r)},t.prototype.readlinkBase=function(t,e){var r=this.getLinkOrThrow(t,"readlink").getNode();if(!r.isSymlink())throw s("EINVAL","readlink",t);return t=j+r.symlink.join(j),Qn.strToEncoding(t,e)},t.prototype.readlinkSync=function(t,e){return e=q(e),t=l(t),this.readlinkBase(t,e.encoding)},t.prototype.readlink=function(t,e,r){e=(r=X(e,r))[0],r=r[1],t=l(t),this.wrapAsync(this.readlinkBase,[t,e.encoding],r)},t.prototype.fsyncBase=function(t){this.getFileByFdOrThrow(t,"fsync")},t.prototype.fsyncSync=function(t){this.fsyncBase(t)},t.prototype.fsync=function(t,e){this.wrapAsync(this.fsyncBase,[t],e)},t.prototype.fdatasyncBase=function(t){this.getFileByFdOrThrow(t,"fdatasync")},t.prototype.fdatasyncSync=function(t){this.fdatasyncBase(t)},t.prototype.fdatasync=function(t,e){this.wrapAsync(this.fdatasyncBase,[t],e)},t.prototype.ftruncateBase=function(t,e){this.getFileByFdOrThrow(t,"ftruncate").truncate(e)},t.prototype.ftruncateSync=function(t,e){this.ftruncateBase(t,e)},t.prototype.ftruncate=function(t,e,r){var n="number"==typeof e?e:0;e=h("number"==typeof e?r:e),this.wrapAsync(this.ftruncateBase,[t,n],e)},t.prototype.truncateBase=function(t,e){t=this.openSync(t,"r+");try{this.ftruncateSync(t,e)}finally{this.closeSync(t)}},t.prototype.truncateSync=function(t,e){if(t>>>0===t)return this.ftruncateSync(t,e);this.truncateBase(t,e)},t.prototype.truncate=function(t,e,r){var n="number"==typeof e?e:0;if(e=h("number"==typeof e?r:e),t>>>0===t)return this.ftruncate(t,n,e);this.wrapAsync(this.truncateBase,[t,n],e)},t.prototype.futimesBase=function(t,e,r){(t=this.getFileByFdOrThrow(t,"futimes").node).atime=new Date(1e3*e),t.mtime=new Date(1e3*r)},t.prototype.futimesSync=function(t,e,r){this.futimesBase(t,m(e),m(r))},t.prototype.futimes=function(t,e,r,n){this.wrapAsync(this.futimesBase,[t,m(e),m(r)],n)},t.prototype.utimesBase=function(t,e,r){t=this.openSync(t,"r+");try{this.futimesBase(t,e,r)}finally{this.closeSync(t)}},t.prototype.utimesSync=function(t,e,r){this.utimesBase(l(t),m(e),m(r))},t.prototype.utimes=function(t,e,r,n){this.wrapAsync(this.utimesBase,[l(t),m(e),m(r)],n)},t.prototype.mkdirBase=function(t,e){var r=p(t);if(!r.length)throw s("EISDIR","mkdir",t);var n=this.getLinkParentAsDirOrThrow(t,"mkdir");if(r=r[r.length-1],n.getChild(r))throw s("EEXIST","mkdir",t);n.createChild(r,this.createNode(!0,e))},t.prototype.mkdirpBase=function(t,e){t=p(t);for(var r=this.root,n=0;n<t.length;n++){var i=t[n];if(!r.getNode().isDirectory())throw s("ENOTDIR","mkdir",r.getPath());var o=r.getChild(i);if(o){if(!o.getNode().isDirectory())throw s("ENOTDIR","mkdir",o.getPath());r=o}else r=r.createChild(i,this.createNode(!0,e))}},t.prototype.mkdirSync=function(t,e){var r=E((e=o(e)).mode,511);t=l(t),e.recursive?this.mkdirpBase(t,r):this.mkdirBase(t,r)},t.prototype.mkdir=function(t,e,r){var n=o(e);e=h("function"==typeof e?e:r),r=E(n.mode,511),t=l(t),n.recursive?this.wrapAsync(this.mkdirpBase,[t,r],e):this.wrapAsync(this.mkdirBase,[t,r],e)},t.prototype.mkdirpSync=function(t,e){this.mkdirSync(t,{mode:e,recursive:!0})},t.prototype.mkdirp=function(t,e,r){var n="function"==typeof e?void 0:e;e=h("function"==typeof e?e:r),this.mkdir(t,{mode:n,recursive:!0},e)},t.prototype.mkdtempBase=function(t,e,r){void 0===r&&(r=5);var n=t+this.genRndStr();try{return this.mkdirBase(n,511),Qn.strToEncoding(n,e)}catch(n){if("EEXIST"===n.code){if(1<r)return this.mkdtempBase(t,e,r-1);throw Error("Could not create temp dir.")}throw n}},t.prototype.mkdtempSync=function(t,e){if(e=q(e).encoding,!t||"string"!=typeof t)throw new TypeError("filename prefix is required");return _(t),this.mkdtempBase(t,e)},t.prototype.mkdtemp=function(t,e,r){if(e=(r=X(e,r))[0].encoding,r=r[1],!t||"string"!=typeof t)throw new TypeError("filename prefix is required");_(t)&&this.wrapAsync(this.mkdtempBase,[t,e],r)},t.prototype.rmdirBase=function(t,e){e=C({},ot,e);var r=this.getLinkAsDirOrThrow(t,"rmdir");if(r.length&&!e.recursive)throw s("ENOTEMPTY","rmdir",t);this.deleteLink(r)},t.prototype.rmdirSync=function(t,e){this.rmdirBase(l(t),e)},t.prototype.rmdir=function(t,e,r){var n=C({},ot,e);e=h("function"==typeof e?e:r),this.wrapAsync(this.rmdirBase,[l(t),n],e)},t.prototype.fchmodBase=function(t,e){this.getFileByFdOrThrow(t,"fchmod").chmod(e)},t.prototype.fchmodSync=function(t,e){this.fchmodBase(t,E(e))},t.prototype.fchmod=function(t,e,r){this.wrapAsync(this.fchmodBase,[t,E(e)],r)},t.prototype.chmodBase=function(t,e){t=this.openSync(t,"r+");try{this.fchmodBase(t,e)}finally{this.closeSync(t)}},t.prototype.chmodSync=function(t,e){e=E(e),t=l(t),this.chmodBase(t,e)},t.prototype.chmod=function(t,e,r){e=E(e),t=l(t),this.wrapAsync(this.chmodBase,[t,e],r)},t.prototype.lchmodBase=function(t,e){t=this.openBase(t,B,0,!1);try{this.fchmodBase(t,e)}finally{this.closeSync(t)}},t.prototype.lchmodSync=function(t,e){e=E(e),t=l(t),this.lchmodBase(t,e)},t.prototype.lchmod=function(t,e,r){e=E(e),t=l(t),this.wrapAsync(this.lchmodBase,[t,e],r)},t.prototype.fchownBase=function(t,e,r){this.getFileByFdOrThrow(t,"fchown").chown(e,r)},t.prototype.fchownSync=function(t,e,r){I(e),A(r),this.fchownBase(t,e,r)},t.prototype.fchown=function(t,e,r,n){I(e),A(r),this.wrapAsync(this.fchownBase,[t,e,r],n)},t.prototype.chownBase=function(t,e,r){this.getResolvedLinkOrThrow(t,"chown").getNode().chown(e,r)},t.prototype.chownSync=function(t,e,r){I(e),A(r),this.chownBase(l(t),e,r)},t.prototype.chown=function(t,e,r,n){I(e),A(r),this.wrapAsync(this.chownBase,[l(t),e,r],n)},t.prototype.lchownBase=function(t,e,r){this.getLinkOrThrow(t,"lchown").getNode().chown(e,r)},t.prototype.lchownSync=function(t,e,r){I(e),A(r),this.lchownBase(l(t),e,r)},t.prototype.lchown=function(t,e,r,n){I(e),A(r),this.wrapAsync(this.lchownBase,[l(t),e,r],n)},t.prototype.watchFile=function(t,e,r){t=l(t);var n=e;if("function"==typeof n&&(r=e,n=null),"function"!=typeof r)throw Error(\'"watchFile()" requires a listener function\');e=5007;var i=!0;return n&&"object"==typeof n&&("number"==typeof n.interval&&(e=n.interval),"boolean"==typeof n.persistent&&(i=n.persistent)),(n=this.statWatchers[t])||((n=new this.StatWatcher).start(t,i,e),this.statWatchers[t]=n),n.addListener("change",r),n},t.prototype.unwatchFile=function(t,e){t=l(t);var r=this.statWatchers[t];r&&("function"==typeof e?r.removeListener("change",e):r.removeAllListeners("change"),0===r.listenerCount("change")&&(r.stop(),delete this.statWatchers[t]))},t.prototype.createReadStream=function(t,e){return new this.ReadStream(t,e)},t.prototype.createWriteStream=function(t,e){return new this.WriteStream(t,e)},t.prototype.watch=function(t,e,r){t=l(t);var n=e;"function"==typeof e&&(r=e,n=null);var i=q(n);e=i.persistent,n=i.recursive,i=i.encoding,void 0===e&&(e=!0),void 0===n&&(n=!1);var o=new this.FSWatcher;return o.start(t,e,n,i),r&&o.addListener("change",r),o},t.fd=2147483647,t}(),e.Volume=t;var ct,lt=function(t){function e(e){var r=t.call(this)||this;return r.onInterval=function(){try{var t=r.vol.statSync(r.filename);r.hasChanged(t)&&(r.emit("change",t,r.prev),r.prev=t)}finally{r.loop()}},r.vol=e,r}return R(e,t),e.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},e.prototype.hasChanged=function(t){return t.mtimeMs>this.prev.mtimeMs||t.nlink!==this.prev.nlink},e.prototype.start=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=5007),this.filename=l(t),this.setTimeout=e?setTimeout:_i.default,this.interval=r,this.prev=this.vol.statSync(this.filename),this.loop()},e.prototype.stop=function(){clearTimeout(this.timeoutRef),fi.default.nextTick(v,this)},e}(hi.EventEmitter);e.StatWatcher=lt,Pn.inherits(w,oo.Readable),e.ReadStream=w,w.prototype.open=function(){var t=this;this._vol.open(this.path,this.flags,this.mode,(function(e,r){e?(t.autoClose&&t.destroy&&t.destroy(),t.emit("error",e)):(t.fd=r,t.emit("open",r),t.read())}))},w.prototype._read=function(t){if("number"!=typeof this.fd)return this.once("open",(function(){this._read(t)}));if(!this.destroyed){(!ct||128>ct.length-ct.used)&&((ct=Mr.bufferAllocUnsafe(this._readableState.highWaterMark)).used=0);var e=ct,r=Math.min(ct.length-ct.used,t),n=ct.used;if(void 0!==this.pos&&(r=Math.min(this.end-this.pos+1,r)),0>=r)return this.push(null);var i=this;this._vol.read(this.fd,ct,ct.used,r,this.pos,(function(t,r){t?(i.autoClose&&i.destroy&&i.destroy(),i.emit("error",t)):(t=null,0<r&&(i.bytesRead+=r,t=e.slice(n,n+r)),i.push(t))})),void 0!==this.pos&&(this.pos+=r),ct.used+=r}},w.prototype._destroy=function(t,e){this.close((function(r){e(t||r)}))},w.prototype.close=function(t){var e=this;if(t&&this.once("close",t),this.closed||"number"!=typeof this.fd)return"number"!=typeof this.fd?void this.once("open",T):fi.default.nextTick((function(){return e.emit("close")}));this.closed=!0,this._vol.close(this.fd,(function(t){t?e.emit("error",t):e.emit("close")})),this.fd=null},Pn.inherits(b,oo.Writable),e.WriteStream=b,b.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(t,e){t?(this.autoClose&&this.destroy&&this.destroy(),this.emit("error",t)):(this.fd=e,this.emit("open",e))}.bind(this))},b.prototype._write=function(t,e,r){if(!(t instanceof Mr.Buffer))return this.emit("error",Error("Invalid data"));if("number"!=typeof this.fd)return this.once("open",(function(){this._write(t,e,r)}));var n=this;this._vol.write(this.fd,t,0,t.length,this.pos,(function(t,e){if(t)return n.autoClose&&n.destroy&&n.destroy(),r(t);n.bytesWritten+=e,r()})),void 0!==this.pos&&(this.pos+=t.length)},b.prototype._writev=function(t,e){if("number"!=typeof this.fd)return this.once("open",(function(){this._writev(t,e)}));for(var r=this,n=t.length,i=Array(n),o=0,s=0;s<n;s++){var a=t[s].chunk;i[s]=a,o+=a.length}n=Mr.Buffer.concat(i),this._vol.write(this.fd,n,0,n.length,this.pos,(function(t,n){if(t)return r.destroy&&r.destroy(),e(t);r.bytesWritten+=n,e()})),void 0!==this.pos&&(this.pos+=o)},b.prototype._destroy=w.prototype._destroy,b.prototype.close=w.prototype.close,b.prototype.destroySoon=b.prototype.end;var pt=function(t){function e(e){var r=t.call(this)||this;return r._filename="",r._filenameEncoded="",r._recursive=!1,r._encoding=Qn.ENCODING_UTF8,r._onNodeChange=function(){r._emit("change")},r._onParentChild=function(t){t.getName()===r._getName()&&r._emit("rename")},r._emit=function(t){r.emit("change",t,r._filenameEncoded)},r._persist=function(){r._timer=setTimeout(r._persist,1e6)},r._vol=e,r}return R(e,t),e.prototype._getName=function(){return this._steps[this._steps.length-1]},e.prototype.start=function(t,e,r,n){void 0===e&&(e=!0),void 0===r&&(r=!1),void 0===n&&(n=Qn.ENCODING_UTF8),this._filename=l(t),this._steps=p(this._filename),this._filenameEncoded=Qn.strToEncoding(this._filename),this._recursive=r,this._encoding=n;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(t){throw e=Error("watch "+this._filename+" "+t.code),e.code=t.code,e.errno=t.code,e}this._link.getNode().on("change",this._onNodeChange),this._link.on("child:add",this._onNodeChange),this._link.on("child:delete",this._onNodeChange),(t=this._link.parent)&&(t.setMaxListeners(t.getMaxListeners()+1),t.on("child:delete",this._onParentChild)),e&&this._persist()},e.prototype.close=function(){clearTimeout(this._timer),this._link.getNode().removeListener("change",this._onNodeChange);var t=this._link.parent;t&&t.removeListener("child:delete",this._onParentChild)},e}(hi.EventEmitter);e.FSWatcher=pt}));Ke(Go);var Ho=Go.pathToFilename,xo=Go.filenameToSteps,Yo=Go.Volume,jo=ze((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.fsProps="constants F_OK R_OK W_OK X_OK Stats".split(" "),e.fsSyncMethods="renameSync ftruncateSync truncateSync chownSync fchownSync lchownSync chmodSync fchmodSync lchmodSync statSync lstatSync fstatSync linkSync symlinkSync readlinkSync realpathSync unlinkSync rmdirSync mkdirSync mkdirpSync readdirSync closeSync openSync utimesSync futimesSync fsyncSync writeSync readSync readFileSync writeFileSync appendFileSync existsSync accessSync fdatasyncSync mkdtempSync copyFileSync createReadStream createWriteStream".split(" "),e.fsAsyncMethods="rename ftruncate truncate chown fchown lchown chmod fchmod lchmod stat lstat fstat link symlink readlink realpath unlink rmdir mkdir mkdirp readdir close open utimes futimes fsync write read readFile writeFile appendFile exists access fdatasync mkdtemp copyFile watchFile unwatchFile watch".split(" ")}));Ke(jo);var Vo=ze((function(t,e){function r(t){for(var e={F_OK:s,R_OK:a,W_OK:f,X_OK:u,constants:qe.constants,Stats:Je.default,Dirent:ti.default},r=0,n=i;r<n.length;r++){var h=n[r];"function"==typeof t[h]&&(e[h]=t[h].bind(t))}for(r=0,n=o;r<n.length;r++)"function"==typeof t[h=n[r]]&&(e[h]=t[h].bind(t));return e.StatWatcher=t.StatWatcher,e.FSWatcher=t.FSWatcher,e.WriteStream=t.WriteStream,e.ReadStream=t.ReadStream,e.promises=t.promises,e._toUnixTimestamp=Go.toUnixTimestamp,e}var n=Ve&&Ve.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=jo.fsSyncMethods,o=jo.fsAsyncMethods,s=qe.constants.F_OK,a=qe.constants.R_OK,f=qe.constants.W_OK,u=qe.constants.X_OK;e.Volume=Go.Volume,e.vol=new Go.Volume,e.createFsFromVolume=r,e.fs=r(e.vol),t.exports=n(n({},t.exports),e.fs),t.exports.semantic=!0}));Ke(Vo);var Ko=Vo.createFsFromVolume;gi.prototype.emit=function(t){for(var e,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];i=this.listeners(t);try{for(var o=xe(i),s=o.next();!s.done;s=o.next()){var a=s.value;try{a.apply(void 0,je(n))}catch(t){console.error(t)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return 0<i.length};var zo=function(){function t(){this.volume=new Yo,this.fs=Ko(this.volume),this.fromJSON({"/dev/stdin":"","/dev/stdout":"","/dev/stderr":""})}return t.prototype._toJSON=function(t,e,r){void 0===e&&(e={});var n,i=!0;for(n in t.children){i=!1;var o=t.getChild(n);if(o){var s=o.getNode();s&&s.isFile()?(o=o.getPath(),r&&(o=ni(r,o)),e[o]=s.getBuffer()):s&&s.isDirectory()&&this._toJSON(o,e,r)}}return t=t.getPath(),r&&(t=ni(r,t)),t&&i&&(e[t]=null),e},t.prototype.toJSON=function(t,e,r){var n,i;void 0===e&&(e={}),void 0===r&&(r=!1);var o=[];if(t){t instanceof Array||(t=[t]);try{for(var s=xe(t),a=s.next();!a.done;a=s.next()){var f=Ho(a.value),u=this.volume.getResolvedLink(f);u&&o.push(u)}}catch(t){var h={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(h)throw h.error}}}else o.push(this.volume.root);if(!o.length)return e;try{for(var c=xe(o),l=c.next();!l.done;l=c.next())u=l.value,this._toJSON(u,e,r?u.getPath():"")}catch(t){var p={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(p)throw p.error}}return e},t.prototype.fromJSONFixed=function(t,e){for(var r in e){var n=e[r];if(n?null!==Object.getPrototypeOf(n):null!==n){var i=xo(r);1<i.length&&(i="/"+i.slice(0,i.length-1).join("/"),t.mkdirpBase(i,511)),t.writeFileSync(r,n||"")}else t.mkdirpBase(r,511)}},t.prototype.fromJSON=function(t){this.volume=new Yo,this.fromJSONFixed(this.volume,t),this.fs=Ko(this.volume),this.volume.releasedFds=[0,1,2],t=this.volume.openSync("/dev/stderr","w");var e=this.volume.openSync("/dev/stdout","w"),r=this.volume.openSync("/dev/stdin","r");if(2!==t)throw Error("invalid handle for stderr: "+t);if(1!==e)throw Error("invalid handle for stdout: "+e);if(0!==r)throw Error("invalid handle for stdin: "+r)},t.prototype.getStdOut=function(){return function(t,e,r,n){return new(r||(r=Promise))((function(e,i){function o(t){try{a(n.next(t))}catch(t){i(t)}}function s(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(o,s)}a((n=n.apply(t,[])).next())}))}(this,0,void 0,(function(){var t=this;return function(t,e){function r(t){return function(e){return n([t,e])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;f;)try{if(i=1,o&&(s=2&r[0]?o.return:r[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,r[1])).done)return s;switch(o=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return f.label++,{value:r[1],done:!1};case 5:f.label++,o=r[1],r=[0];continue;case 7:r=f.ops.pop(),f.trys.pop();continue;default:if(!((s=0<(s=f.trys).length&&s[s.length-1])||6!==r[0]&&2!==r[0])){f=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3]))f.label=r[1];else if(6===r[0]&&f.label<s[1])f.label=s[1],s=r;else{if(!(s&&f.label<s[2])){s[2]&&f.ops.pop(),f.trys.pop();continue}f.label=s[2],f.ops.push(r)}}r=e.call(t,f)}catch(t){r=[6,t],o=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,s,a,f={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a}(this,(function(){return[2,new Promise((function(e){e(t.fs.readFileSync("/dev/stdout","utf8"))}))]}))}))},t}();const qo=class{programName;wasmModule;constructor(t,e){this.programName=t,this.wasmModule=e}run(t,e,r,n,i,o,s,a,f){console.log("wasmer runnable run:",this.programName,t),"function"!=typeof e&&(e=()=>{}),"function"!=typeof r&&(r=()=>{}),"function"!=typeof n&&(n=()=>{}),i instanceof Array||(i=[]),"function"!=typeof o&&(o=()=>{}),"function"!=typeof s&&(s=t=>{console.error(t)}),"function"!=typeof a&&(a=()=>{});const u=new zo;if(this._writeFilesToFS(u,i),u.volume.fds[0].node.read=e,f){"string"!=typeof f&&(f=(f||"").toString()),f.endsWith("\\n")||(f+="\\n");let t=0;u.volume.fds[0].node.read=e=>{if(t%2!=0)return t++,0;for(let t=0;t<f.length;t++)e[t]=f.charCodeAt(t);return t++,f.length}}u.volume.fds[1].node.write=(t,e,n,i)=>(r(new TextDecoder("utf-8").decode(t)),t.length),u.volume.fds[2].node.write=(t,e,r,i)=>(n(new TextDecoder("utf-8").decode(t)),t.length);const h=u.volume.openSync("/dev/tty","w+");u.volume.fds[h].node.read=u.volume.fds[0].node.read,u.volume.fds[h].node.write=u.volume.fds[1].node.write;let c=new Ge({args:[this.programName,...t],env:{},bindings:{...He.Z,fs:u.fs},preopens:{".":".","/":"/"}});const l=c.getImports(this.wasmModule);WebAssembly.instantiate(this.wasmModule,{...l}).then((t=>{let e;try{this._writeFilesToFS(u,i);try{c.start(t)}catch(t){0!=t.code&&He.Z.exit(t.code)}e=this._readFilesFromFS(u),a(e)}catch(t){s(t.message)}finally{o(e||i)}}))}runHeadless(t,e,r,n,i,o){console.log("wasmer runnable run headless:",this.programName,t),"function"!=typeof r&&(r=()=>{});let s="",a="",f="";this.run(t,(()=>(console.log("called runHeadless stdin"),0)),(t=>(s+=t,a+=t,t.length)),(t=>(s+=t,f+=t,t.length)),e,(()=>r({output:s,stdout:a,stderr:f})),n,i,o)}_readFilesFromFS(t,e="/"){const r=t.volume.toJSON(e),n=["/dev/stdin","/dev/stdout","/dev/stderr","/dev/tty"];return Object.entries(r).filter((([t,e])=>!n.includes(t))).map((([t,e])=>({name:t,timestamp:Date.now(),bytes:(new TextEncoder).encode(e)})))}_writeFilesToFS(t,e=[]){e.forEach((e=>{try{if(e.bytes instanceof Uint8Array){const r=e.name.split("/").slice(0,-1).join("/");t.fs.mkdirSync(r,{recursive:!0}),t.fs.writeFileSync(e.name,e.bytes)}}catch(t){console.error(t.name+": "+t.message)}}))}};class Xo extends class{outputBuffer;constructor(){this.outputBuffer=""}runCommand(t,e,r,n,i,o,s,a,f,u,h,c,l){"function"!=typeof f&&(f=()=>{}),"function"!=typeof u&&(u=t=>{console.error(t)}),"function"!=typeof h&&(h=()=>{});const p=t=>{this.outputBuffer+="number"==typeof t?String.fromCharCode(t):t},d=t=>(p(t),o(t)),y=t=>(p(t),s(t));if("emscripten"==r){console.log("wasm runner creates new emscr runnable");const r=t=>this._onEmscrStdinCall(t,i,d,y);new A(t,e,l).run(n,r,d,y,a,f,u,h,c)}else{if("wasmer"!=r)throw new Error("Unknown wasm module type (can only handle emscripten or wasmer)");{console.log("wasm runner creates new wasmer runnable");const r=t=>this._onWasmerStdinCall(t,i,d,y);new qo(t,e).run(n,r,d,y,a,f,u,h,c)}}}runCommandHeadless(t,e,r,n,i,o,s,a,f,u){if("function"!=typeof o&&(o=()=>{}),"function"!=typeof s&&(s=t=>{console.error(t)}),"function"!=typeof a&&(a=()=>{}),"emscripten"==r)console.log("wasm runner creates new emscr runnable"),new A(t,e,u).runHeadless(n,i,o,s,a,f);else{if("wasmer"!=r)throw new Error("Unknown wasm module type (can only handle emscripten or wasmer)");new qo(t,e).runHeadless(n,i,o,s,a,f)}}_onEmscrStdinCall(t,e,r,n){if(0==t.input.length){const e=this.outputBuffer.split(/\\r?\\n/g).pop(),n=window.prompt(e);if(null==n)return null;r(n+"\\r\\n"),t.input=(n+"\\n").split("").map((t=>t.charCodeAt(0))),t.input.push(null)}return t.input.shift()}_wasmerStdinCallCounter=0;_onWasmerStdinCall(t,e,r,n){if(this._wasmerStdinCallCounter%2!=0)return this._wasmerStdinCallCounter++,0;const i=this.outputBuffer.split(/\\r?\\n/g).pop(),o=window.prompt(i);return null==o?0:(r(o+"\\r\\n"),o.forEach(((e,r)=>t[r]=e.charCodeAt(0))),this._wasmerStdinCallCounter++,o.length)}}{_pauseBuffer;_stdinBuffer;constructor(t,e){super(),this._pauseBuffer=t,this._stdinBuffer=e}pauseExecution(){console.log("pausing worker execution"),Atomics.store(this._pauseBuffer,0,1),Atomics.wait(this._pauseBuffer,0,1),console.log("resuming worker execution")}resumeExecution(){console.log("resuming worker execution"),Atomics.store(this._pauseBuffer,0,0)}_readStdinBuffer(t=null){if(null!=t)return Atomics.load(this._stdinBuffer,t);let e=[];for(let t=0;t<this._stdinBuffer.length;t++){const r=Atomics.load(this._stdinBuffer,t);if(0===r)break;e.push(r)}return e}_onEmscrStdinCall(t,e,r,n){if(0==t.input.length){if(e(this.outputBuffer.split(/\\r?\\n/g).pop()),this.pauseExecution(),t.input=this._readStdinBuffer(),this.outputBuffer+=t.input.map((t=>String.fromCharCode(t))).join(""),0==t.input.length)return null;t.input.push(null)}return t.input.shift()}_wasmerStdinCallCounter=0;_onWasmerStdinCall(t,e,r,n){if(this._wasmerStdinCallCounter%2!=0)return this._wasmerStdinCallCounter++,0;e(this.outputBuffer.split(/\\r?\\n/g).pop()),this.pauseExecution();const i=this._readStdinBuffer();return i.forEach(((e,r)=>t[r]=e)),this.outputBuffer+=i.map((t=>String.fromCharCode(t))).join(""),this._wasmerStdinCallCounter++,i.length}static expose(){void 0===t&&Xo.isWorkerScope()&&importScripts("https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/comlink.min.js"),u(Xo)}static isWorkerScope(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}}Xo.isWorkerScope()&&Xo.expose();const Jo=Xo})(),n})()}));'}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{default:()=>gu});const t=Symbol("Comlink.proxy"),e=Symbol("Comlink.endpoint"),i=Symbol("Comlink.releaseProxy"),o=Symbol("Comlink.thrown"),s=t=>"object"==typeof t&&null!==t||"function"==typeof t,a=new Map([["proxy",{canHandle:e=>s(e)&&e[t],serialize(t){const{port1:e,port2:r}=new MessageChannel;return f(t,e),[r,[r]]},deserialize:t=>(t.start(),h(t))}],["throw",{canHandle:t=>s(t)&&o in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function f(t,e=self){e.addEventListener("message",(function r(n){if(!n||!n.data)return;const{id:i,type:s,path:a}=Object.assign({path:[]},n.data),h=(n.data.argumentList||[]).map(y);let l;try{const e=a.slice(0,-1).reduce(((t,e)=>t[e]),t),r=a.reduce(((t,e)=>t[e]),t);switch(s){case"GET":l=r;break;case"SET":e[a.slice(-1)[0]]=y(n.data.value),l=!0;break;case"APPLY":l=r.apply(e,h);break;case"CONSTRUCT":l=_(new r(...h));break;case"ENDPOINT":{const{port1:e,port2:r}=new MessageChannel;f(t,r),l=function(t,e){return d.set(t,e),t}(e,[e])}break;case"RELEASE":l=void 0;break;default:return}}catch(t){l={value:t,[o]:0}}Promise.resolve(l).catch((t=>({value:t,[o]:0}))).then((t=>{const[n,o]=g(t);e.postMessage(Object.assign(Object.assign({},n),{id:i}),o),"RELEASE"===s&&(e.removeEventListener("message",r),u(e))}))})),e.start&&e.start()}function u(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function h(t,e){return c(t,[],e)}function l(t){if(t)throw new Error("Proxy has been released and is not useable")}function c(t,r=[],n=function(){}){let o=!1;const s=new Proxy(n,{get(e,n){if(l(o),n===i)return()=>m(t,{type:"RELEASE",path:r.map((t=>t.toString()))}).then((()=>{u(t),o=!0}));if("then"===n){if(0===r.length)return{then:()=>s};const e=m(t,{type:"GET",path:r.map((t=>t.toString()))}).then(y);return e.then.bind(e)}return c(t,[...r,n])},set(e,n,i){l(o);const[s,a]=g(i);return m(t,{type:"SET",path:[...r,n].map((t=>t.toString())),value:s},a).then(y)},apply(n,i,s){l(o);const a=r[r.length-1];if(a===e)return m(t,{type:"ENDPOINT"}).then(y);if("bind"===a)return c(t,r.slice(0,-1));const[f,u]=p(s);return m(t,{type:"APPLY",path:r.map((t=>t.toString())),argumentList:f},u).then(y)},construct(e,n){l(o);const[i,s]=p(n);return m(t,{type:"CONSTRUCT",path:r.map((t=>t.toString())),argumentList:i},s).then(y)}});return s}function p(t){const e=t.map(g);return[e.map((t=>t[0])),(r=e.map((t=>t[1])),Array.prototype.concat.apply([],r))];var r}const d=new WeakMap;function _(e){return Object.assign(e,{[t]:!0})}function g(t){for(const[e,r]of a)if(r.canHandle(t)){const[n,i]=r.serialize(t);return[{type:"HANDLER",name:e,value:n},i]}return[{type:"RAW",value:t},d.get(t)||[]]}function y(t){switch(t.type){case"HANDLER":return a.get(t.name).deserialize(t.value);case"RAW":return t.value}}function m(t,e,r){return new Promise((n=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.addEventListener("message",(function e(r){r.data&&r.data.id&&r.data.id===i&&(t.removeEventListener("message",e),n(r.data))})),t.start&&t.start(),t.postMessage(Object.assign({id:i},e),r)}))}var E=r(617);class S{constructor(t){this.size=t,this.entries=[],this.cursor=0}push(t){""!==t.trim()&&t!=this.entries[this.entries.length-1]&&(this.entries.push(t),this.entries.length>this.size&&this.entries.pop(0),this.cursor=this.entries.length)}rewind(){this.cursor=this.entries.length}getPrevious(){const t=Math.max(0,this.cursor-1);return this.cursor=t,this.entries[t]}getNext(){const t=Math.min(this.entries.length,this.cursor+1);return this.cursor=t,this.entries[t]}}var I=r(440);function w(t,e=!0){let r;const n=[],i=/\w+/g;for(;r=i.exec(t);)e?n.push(r.index):n.push(r.index+r[0].length);return n}function A(t,e){const r=w(t,!0).reverse().find((t=>t<e));return null==r?0:r}function v(t,e,r){let n=0,i=0;for(let o=0;o<e;++o)"\n"==t.charAt(o)?(i=0,n+=1):(i+=1,i>r&&(i=0,n+=1));return{row:n,col:i}}function T(t,e){return v(t,t.length,e).row+1}function b(t){return null!=t.match(/[^\\][ \t]$/m)}function R(t){return""===t.trim()||b(t)?"":(0,I.Q)(t).pop()||""}function O(t,e){if(t.length>=e[0].length)return t;const r=t;t+=e[0].slice(t.length,t.length+1);for(let n=0;n<e.length;n++){if(!e[n].startsWith(r))return null;if(!e[n].startsWith(t))return r}return O(t,e)}var N=r(498);const C=class{programName;wasmModule;_emscrJsRuntime;constructor(t,e,r){this.programName=t,this.wasmModule=e,this._loadEmscrJsRuntime(r)}run(t,e,r,n,i,o,s,a,f){console.log("emscr runnable run:",this.programName,t),"function"!=typeof e&&(e=()=>{}),"function"!=typeof r&&(r=()=>{}),"function"!=typeof n&&(n=()=>{}),i instanceof Array||(i=[]),"function"!=typeof o&&(o=()=>{}),"function"!=typeof s&&(s=t=>{console.error(t)}),"function"!=typeof a&&(a=()=>{});let u,h={thisProgramm:this.programName,instantiateWasm:(t,e)=>(WebAssembly.instantiate(this.wasmModule,t).then((t=>e(t,this.wasmModule))),{}),preInit:[()=>{h.TTY.register(h.FS.makedev(5,0),{get_char:t=>e(t),put_char:(t,e)=>{t.output.push(e),r(e)},flush:t=>t.output=[],fsync:t=>console.log("fsynced stdout (EmscriptenRunnable does nothing in this case)")}),h.TTY.register(h.FS.makedev(6,0),{get_char:t=>e(t),put_char:(t,e)=>{t.output.push(e),n(e)},flush:t=>t.output=[],fsync:t=>console.log("fsynced stderr (EmscriptenRunnable does nothing in this case)")})}]};if(f){"string"!=typeof f&&(f=(f||"").toString()),f.endsWith("\n")||(f+="\n");let t=0;h.stdin=()=>t<f.length?f.charCodeAt(t++):null}this._emscrJsRuntime(h).then((e=>{this._writeFilesToFS(e,i),e.callMain(t),u=this._readFilesFromFS(e),a(u)})).catch((t=>s(t))).finally((()=>o(u||i)))}runHeadless(t,e,r,n,i,o){console.log("emscr runnable run headless:",this.programName,t),"function"!=typeof r&&(r=()=>{});let s="",a="",f="";this.run(t,(()=>{console.log("called runHeadless stdin")}),(t=>{s+=String.fromCharCode(t),a+=String.fromCharCode(t)}),(t=>{s+=String.fromCharCode(t),f+=String.fromCharCode(t)}),e,(()=>r({output:s,stdout:a,stderr:f})),n,i,o)}_readFilesFromFS(t,e="/",r=!0,n=[]){const i=t.FS.lookupPath(e),o=e=>{let n=[];return Object.values(e.contents).forEach((e=>{let i=t.FS.getPath(e);t.FS.isFile(e.mode)&&n.push({name:i,timestamp:e.timestamp,bytes:r?t.FS.readFile(i):new Uint8Array}),t.FS.isDir(e.mode)&&(n=[...n,...o(e)])})),n};let s=o(i.node);return n.length>0&&(s=s.filter((t=>n.some((e=>e.name!=t.name))))),s}_writeFilesToFS(t,e=[]){e.forEach((e=>{try{e.bytes instanceof Uint8Array&&t.FS.writeFile(e.name,e.bytes)}catch(t){console.error(t.name+": "+t.message)}}))}_loadEmscrJsRuntime(t){const e="EmscrJSR_"+this.programName;if(this._isWorkerScope()){let r=new Blob([t],{type:"application/javascript"});importScripts(URL.createObjectURL(r)),console.log(t,r),this._emscrJsRuntime=self[e]||self._createPyodideModule}else{if("undefined"==typeof document)throw new Error("can not load emscr js runtime environment");{const r=this.programName+"_emscrJSR";if(!document.getElementById(r)){let e=document.createElement("script");e.type="text/javascript",e.id=r,e.innerHTML=new TextDecoder("utf-8").decode(t),document.head.appendChild(e)}this._emscrJsRuntime=window[e]}}}_isWorkerScope(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}};function L(t,e){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},L(t,e)}function P(t,e){function r(){this.constructor=t}L(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function W(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function B(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;t=r.call(t);var n,i=[];try{for(;(void 0===e||0<e--)&&!(n=t.next()).done;)i.push(n.value)}catch(t){var o={error:t}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return i}function F(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(B(arguments[e]));return t}var D="undefined"!=typeof globalThis?globalThis:void 0!==r.g?r.g:{},k="undefined"!=typeof BigInt?BigInt:D.BigInt||Number,U=DataView;U.prototype.setBigUint64||(U.prototype.setBigUint64=function(t,e,r){if(e<Math.pow(2,32)){e=Number(e);var n=0}else{n=e.toString(2),e="";for(var i=0;i<64-n.length;i++)e+="0";e+=n,n=parseInt(e.substring(0,32),2),e=parseInt(e.substring(32),2)}this.setUint32(t+(r?0:4),e,r),this.setUint32(t+(r?4:0),n,r)},U.prototype.getBigUint64=function(t,e){var r=this.getUint32(t+(e?0:4),e);t=this.getUint32(t+(e?4:0),e),r=r.toString(2),t=t.toString(2),e="";for(var n=0;n<32-r.length;n++)e+="0";return k("0b"+t+(e+r))});var M=void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},x=[],G=[],H="undefined"!=typeof Uint8Array?Uint8Array:Array,Y=!1;function j(){Y=!0;for(var t=0;64>t;++t)x[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t],G["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;G[45]=62,G[95]=63}function V(t,e,r){for(var n=[],i=e;i<r;i+=3)e=(t[i]<<16)+(t[i+1]<<8)+t[i+2],n.push(x[e>>18&63]+x[e>>12&63]+x[e>>6&63]+x[63&e]);return n.join("")}function z(t){Y||j();for(var e=t.length,r=e%3,n="",i=[],o=0,s=e-r;o<s;o+=16383)i.push(V(t,o,o+16383>s?s:o+16383));return 1===r?(t=t[e-1],n+=x[t>>2],n+=x[t<<4&63],n+="=="):2===r&&(t=(t[e-2]<<8)+t[e-1],n+=x[t>>10],n+=x[t>>4&63],n+=x[t<<2&63],n+="="),i.push(n),i.join("")}function K(t,e,r,n,i){var o=8*i-n-1,s=(1<<o)-1,a=s>>1,f=-7,u=r?-1:1,h=t[e+(i=r?i-1:0)];for(i+=u,r=h&(1<<-f)-1,h>>=-f,f+=o;0<f;r=256*r+t[e+i],i+=u,f-=8);for(o=r&(1<<-f)-1,r>>=-f,f+=n;0<f;o=256*o+t[e+i],i+=u,f-=8);if(0===r)r=1-a;else{if(r===s)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),r-=a}return(h?-1:1)*o*Math.pow(2,r-n)}function q(t,e,r,n,i,o){var s,a=8*o-i-1,f=(1<<a)-1,u=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0;o=n?0:o-1;var l=n?1:-1,c=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(e=isNaN(e)?1:0,n=f):(n=Math.floor(Math.log(e)/Math.LN2),1>e*(s=Math.pow(2,-n))&&(n--,s*=2),2<=(e=1<=n+u?e+h/s:e+h*Math.pow(2,1-u))*s&&(n++,s/=2),n+u>=f?(e=0,n=f):1<=n+u?(e=(e*s-1)*Math.pow(2,i),n+=u):(e=e*Math.pow(2,u-1)*Math.pow(2,i),n=0));8<=i;t[r+o]=255&e,o+=l,e/=256,i-=8);for(n=n<<i|e,a+=i;0<a;t[r+o]=255&n,o+=l,n/=256,a-=8);t[r+o-l]|=128*c}var Z={}.toString,X=Array.isArray||function(t){return"[object Array]"==Z.call(t)};Q.TYPED_ARRAY_SUPPORT=void 0===M.TYPED_ARRAY_SUPPORT||M.TYPED_ARRAY_SUPPORT;var J=Q.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function $(t,e){if((Q.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<e)throw new RangeError("Invalid typed array length");return Q.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=Q.prototype:(null===t&&(t=new Q(e)),t.length=e),t}function Q(t,e,r){if(!(Q.TYPED_ARRAY_SUPPORT||this instanceof Q))return new Q(t,e,r);if("number"==typeof t){if("string"==typeof e)throw Error("If encoding is specified then the first argument must be a string");return rt(this,t)}return tt(this,t,e,r)}function tt(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){if(e.byteLength,0>r||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),Q.TYPED_ARRAY_SUPPORT?(t=e).__proto__=Q.prototype:t=nt(t,e),t}if("string"==typeof e){if(n=t,"string"==typeof(t=r)&&""!==t||(t="utf8"),!Q.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return(e=(n=$(n,r=0|st(e,t))).write(e,t))!==r&&(n=n.slice(0,e)),n}return function(t,e){if(ot(e)){var r=0|it(e.length);return 0===(t=$(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return(r="number"!=typeof e.length)||(r=(r=e.length)!=r),r?$(t,0):nt(t,e);if("Buffer"===e.type&&X(e.data))return nt(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function et(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(0>t)throw new RangeError('"size" argument must not be negative')}function rt(t,e){if(et(e),t=$(t,0>e?0:0|it(e)),!Q.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function nt(t,e){var r=0>e.length?0:0|it(e.length);t=$(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function it(t){if(t>=(Q.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(Q.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return 0|t}function ot(t){return!(null==t||!t._isBuffer)}function st(t,e){if(ot(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Et(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return It(t).length;default:if(n)return Et(t).length;e=(""+e).toLowerCase(),n=!0}}function at(t,e,r){var n=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":for(t=e,e=r,r=this.length,(!t||0>t)&&(t=0),(!e||0>e||e>r)&&(e=r),n="",r=t;r<e;++r)n=(t=n)+(n=16>(n=this[r])?"0"+n.toString(16):n.toString(16));return n;case"utf8":case"utf-8":return lt(this,e,r);case"ascii":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(127&this[e]);return t;case"latin1":case"binary":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(this[e]);return t;case"base64":return 0===e&&r===this.length?z(this):z(this.slice(e,r));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(e=this.slice(e,r),r="",t=0;t<e.length;t+=2)r+=String.fromCharCode(e[t]+256*e[t+1]);return r;default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function ft(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function ut(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:-2147483648>r&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),0>r&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(0>r){if(!i)return-1;r=0}if("string"==typeof e&&(e=Q.from(e,n)),ot(e))return 0===e.length?-1:ht(t,e,r,n,i);if("number"==typeof e)return e&=255,Q.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):ht(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ht(t,e,r,n,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>e.length)return-1;s=2,a/=2,f/=2,r/=2}if(i)for(n=-1;r<a;r++)if(o(t,r)===o(e,-1===n?0:r-n)){if(-1===n&&(n=r),r-n+1===f)return n*s}else-1!==n&&(r-=r-n),n=-1;else for(r+f>a&&(r=a-f);0<=r;r--){for(a=!0,n=0;n<f;n++)if(o(t,r+n)!==o(e,n)){a=!1;break}if(a)return r}return-1}function lt(t,e,r){r=Math.min(t.length,r);for(var n=[];e<r;){var i=t[e],o=null,s=239<i?4:223<i?3:191<i?2:1;if(e+s<=r)switch(s){case 1:128>i&&(o=i);break;case 2:var a=t[e+1];128==(192&a)&&127<(i=(31&i)<<6|63&a)&&(o=i);break;case 3:a=t[e+1];var f=t[e+2];128==(192&a)&&128==(192&f)&&2047<(i=(15&i)<<12|(63&a)<<6|63&f)&&(55296>i||57343<i)&&(o=i);break;case 4:a=t[e+1],f=t[e+2];var u=t[e+3];128==(192&a)&&128==(192&f)&&128==(192&u)&&65535<(i=(15&i)<<18|(63&a)<<12|(63&f)<<6|63&u)&&1114112>i&&(o=i)}null===o?(o=65533,s=1):65535<o&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),e+=s}if((t=n.length)<=ct)n=String.fromCharCode.apply(String,n);else{for(r="",e=0;e<t;)r+=String.fromCharCode.apply(String,n.slice(e,e+=ct));n=r}return n}Q.poolSize=8192,Q._augment=function(t){return t.__proto__=Q.prototype,t},Q.from=function(t,e,r){return tt(null,t,e,r)},Q.TYPED_ARRAY_SUPPORT&&(Q.prototype.__proto__=Uint8Array.prototype,Q.__proto__=Uint8Array),Q.alloc=function(t,e,r){return et(t),0>=t?$(null,t):void 0!==e?"string"==typeof r?$(null,t).fill(e,r):$(null,t).fill(e):$(null,t)},Q.allocUnsafe=function(t){return rt(null,t)},Q.allocUnsafeSlow=function(t){return rt(null,t)},Q.isBuffer=At,Q.compare=function(t,e){if(!ot(t)||!ot(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},Q.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Q.concat=function(t,e){if(!X(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Q.alloc(0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;e=Q.allocUnsafe(e);var n=0;for(r=0;r<t.length;++r){var i=t[r];if(!ot(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(e,n),n+=i.length}return e},Q.byteLength=st,Q.prototype._isBuffer=!0,Q.prototype.swap16=function(){var t=this.length;if(0!=t%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)ft(this,e,e+1);return this},Q.prototype.swap32=function(){var t=this.length;if(0!=t%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)ft(this,e,e+3),ft(this,e+1,e+2);return this},Q.prototype.swap64=function(){var t=this.length;if(0!=t%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)ft(this,e,e+7),ft(this,e+1,e+6),ft(this,e+2,e+5),ft(this,e+3,e+4);return this},Q.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?lt(this,0,t):at.apply(this,arguments)},Q.prototype.equals=function(t){if(!ot(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Q.compare(this,t)},Q.prototype.inspect=function(){var t="";return 0<this.length&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(t+=" ... ")),"<Buffer "+t+">"},Q.prototype.compare=function(t,e,r,n,i){if(!ot(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),0>e||r>t.length||0>n||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s);for(n=this.slice(n,i),t=t.slice(e,r),e=0;e<a;++e)if(n[e]!==t[e]){o=n[e],s=t[e];break}return o<s?-1:s<o?1:0},Q.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},Q.prototype.indexOf=function(t,e,r){return ut(this,t,e,r,!0)},Q.prototype.lastIndexOf=function(t,e,r){return ut(this,t,e,r,!1)},Q.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),0<t.length&&(0>r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");for(n||(n="utf8"),i=!1;;)switch(n){case"hex":t:{if(e=Number(e)||0,n=this.length-e,r?(r=Number(r))>n&&(r=n):r=n,0!=(n=t.length)%2)throw new TypeError("Invalid hex string");for(r>n/2&&(r=n/2),n=0;n<r;++n){if(i=parseInt(t.substr(2*n,2),16),isNaN(i)){t=n;break t}this[e+n]=i}t=n}return t;case"utf8":case"utf-8":return wt(Et(t,this.length-e),this,e,r);case"ascii":case"latin1":case"binary":return wt(St(t),this,e,r);case"base64":return wt(It(t),this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=t,i=this.length-e;for(var o=[],s=0;s<n.length&&!(0>(i-=2));++s){var a=n.charCodeAt(s);t=a>>8,a%=256,o.push(a),o.push(t)}return wt(o,this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Q.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ct=4096;function pt(t,e,r){if(0!=t%1||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function dt(t,e,r,n,i,o){if(!ot(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function _t(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function gt(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function yt(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}Q.prototype.slice=function(t,e){var r=this.length;if(0>(t=~~t)?0>(t+=r)&&(t=0):t>r&&(t=r),0>(e=void 0===e?r:~~e)?0>(e+=r)&&(e=0):e>r&&(e=r),e<t&&(e=t),Q.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,e)).__proto__=Q.prototype;else{e=new Q(r=e-t,void 0);for(var n=0;n<r;++n)e[n]=this[n+t]}return e},Q.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||pt(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r},Q.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||pt(t,e,this.length),r=this[t+--e];for(var n=1;0<e&&(n*=256);)r+=this[t+--e]*n;return r},Q.prototype.readUInt8=function(t,e){return e||pt(t,1,this.length),this[t]},Q.prototype.readUInt16LE=function(t,e){return e||pt(t,2,this.length),this[t]|this[t+1]<<8},Q.prototype.readUInt16BE=function(t,e){return e||pt(t,2,this.length),this[t]<<8|this[t+1]},Q.prototype.readUInt32LE=function(t,e){return e||pt(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Q.prototype.readUInt32BE=function(t,e){return e||pt(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Q.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||pt(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r>=128*n&&(r-=Math.pow(2,8*e)),r},Q.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||pt(t,e,this.length),r=e;for(var n=1,i=this[t+--r];0<r&&(n*=256);)i+=this[t+--r]*n;return i>=128*n&&(i-=Math.pow(2,8*e)),i},Q.prototype.readInt8=function(t,e){return e||pt(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Q.prototype.readInt16LE=function(t,e){return e||pt(t,2,this.length),32768&(t=this[t]|this[t+1]<<8)?4294901760|t:t},Q.prototype.readInt16BE=function(t,e){return e||pt(t,2,this.length),32768&(t=this[t+1]|this[t]<<8)?4294901760|t:t},Q.prototype.readInt32LE=function(t,e){return e||pt(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Q.prototype.readInt32BE=function(t,e){return e||pt(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Q.prototype.readFloatLE=function(t,e){return e||pt(t,4,this.length),K(this,t,!0,23,4)},Q.prototype.readFloatBE=function(t,e){return e||pt(t,4,this.length),K(this,t,!1,23,4)},Q.prototype.readDoubleLE=function(t,e){return e||pt(t,8,this.length),K(this,t,!0,52,8)},Q.prototype.readDoubleBE=function(t,e){return e||pt(t,8,this.length),K(this,t,!1,52,8)},Q.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||dt(this,t,e,r,Math.pow(2,8*r)-1,0),n=1;var i=0;for(this[e]=255&t;++i<r&&(n*=256);)this[e+i]=t/n&255;return e+r},Q.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||dt(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)this[e+n]=t/i&255;return e+r},Q.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||dt(this,t,e,1,255,0),Q.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Q.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||dt(this,t,e,2,65535,0),Q.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_t(this,t,e,!0),e+2},Q.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||dt(this,t,e,2,65535,0),Q.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_t(this,t,e,!1),e+2},Q.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||dt(this,t,e,4,4294967295,0),Q.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):gt(this,t,e,!0),e+4},Q.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||dt(this,t,e,4,4294967295,0),Q.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):gt(this,t,e,!1),e+4},Q.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||dt(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n),n=0;var i=1,o=0;for(this[e]=255&t;++n<r&&(i*=256);)0>t&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},Q.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||dt(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=1,o=0;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)0>t&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},Q.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||dt(this,t,e,1,127,-128),Q.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},Q.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||dt(this,t,e,2,32767,-32768),Q.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):_t(this,t,e,!0),e+2},Q.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||dt(this,t,e,2,32767,-32768),Q.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):_t(this,t,e,!1),e+2},Q.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||dt(this,t,e,4,2147483647,-2147483648),Q.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):gt(this,t,e,!0),e+4},Q.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||dt(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),Q.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):gt(this,t,e,!1),e+4},Q.prototype.writeFloatLE=function(t,e,r){return r||yt(this,0,e,4),q(this,t,e,!0,23,4),e+4},Q.prototype.writeFloatBE=function(t,e,r){return r||yt(this,0,e,4),q(this,t,e,!1,23,4),e+4},Q.prototype.writeDoubleLE=function(t,e,r){return r||yt(this,0,e,8),q(this,t,e,!0,52,8),e+8},Q.prototype.writeDoubleBE=function(t,e,r){return r||yt(this,0,e,8),q(this,t,e,!1,52,8),e+8},Q.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0<n&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&r<e&&e<n)for(n=i-1;0<=n;--n)t[n+e]=this[n+r];else if(1e3>i||!Q.TYPED_ARRAY_SUPPORT)for(n=0;n<i;++n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},Q.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);256>i&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Q.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(0>e||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else for(i=(t=ot(t)?t:Et(new Q(t,n).toString())).length,n=0;n<r-e;++n)this[n+e]=t[n%i];return this};var mt=/[^+\/0-9A-Za-z-_]/g;function Et(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&57344>r){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(56320>r){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,128>r){if(0>--e)break;o.push(r)}else if(2048>r){if(0>(e-=2))break;o.push(r>>6|192,63&r|128)}else if(65536>r){if(0>(e-=3))break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw Error("Invalid code point");if(0>(e-=4))break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function St(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function It(t){if(2>(t=(t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(mt,"")).length)t="";else for(;0!=t.length%4;)t+="=";Y||j();var e=t.length;if(0<e%4)throw Error("Invalid string. Length must be a multiple of 4");var r="="===t[e-2]?2:"="===t[e-1]?1:0,n=new H(3*e/4-r),i=0<r?e-4:e,o=0;for(e=0;e<i;e+=4){var s=G[t.charCodeAt(e)]<<18|G[t.charCodeAt(e+1)]<<12|G[t.charCodeAt(e+2)]<<6|G[t.charCodeAt(e+3)];n[o++]=s>>16&255,n[o++]=s>>8&255,n[o++]=255&s}return 2===r?(s=G[t.charCodeAt(e)]<<2|G[t.charCodeAt(e+1)]>>4,n[o++]=255&s):1===r&&(s=G[t.charCodeAt(e)]<<10|G[t.charCodeAt(e+1)]<<4|G[t.charCodeAt(e+2)]>>2,n[o++]=s>>8&255,n[o++]=255&s),n}function wt(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function At(t){return null!=t&&(!!t._isBuffer||vt(t)||"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&vt(t.slice(0,0)))}function vt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var Tt=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:J,Buffer:Q,SlowBuffer:function(t){return+t!=t&&(t=0),Q.alloc(+t)},isBuffer:At}),bt=Q,Rt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function Ot(t,e){return t(e={exports:{}},e.exports),e.exports}function Nt(){throw Error("setTimeout has not been defined")}function Ct(){throw Error("clearTimeout has not been defined")}var Lt=Nt,Pt=Ct;function Wt(t){if(Lt===setTimeout)return setTimeout(t,0);if((Lt===Nt||!Lt)&&setTimeout)return Lt=setTimeout,setTimeout(t,0);try{return Lt(t,0)}catch(e){try{return Lt.call(null,t,0)}catch(e){return Lt.call(this,t,0)}}}"function"==typeof M.setTimeout&&(Lt=setTimeout),"function"==typeof M.clearTimeout&&(Pt=clearTimeout);var Bt,Ft=[],Dt=!1,kt=-1;function Ut(){Dt&&Bt&&(Dt=!1,Bt.length?Ft=Bt.concat(Ft):kt=-1,Ft.length&&Mt())}function Mt(){if(!Dt){var t=Wt(Ut);Dt=!0;for(var e=Ft.length;e;){for(Bt=Ft,Ft=[];++kt<e;)Bt&&Bt[kt].run();kt=-1,e=Ft.length}Bt=null,Dt=!1,function(t){if(Pt===clearTimeout)return clearTimeout(t);if((Pt===Ct||!Pt)&&clearTimeout)return Pt=clearTimeout,clearTimeout(t);try{Pt(t)}catch(e){try{return Pt.call(null,t)}catch(e){return Pt.call(this,t)}}}(t)}}function xt(t,e){this.fun=t,this.array=e}xt.prototype.run=function(){this.fun.apply(null,this.array)};var Gt=M.performance||{},Ht=(Gt.now||Gt.mozNow||Gt.msNow||Gt.oNow||Gt.webkitNow,new Date,function(){return"/"}),Yt=Ot((function(t,e){function r(t,e){for(var r in t)e[r]=t[r]}function n(t,e,r){return i(t,e,r)}var i=Tt.Buffer;i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=Tt:(r(Tt,e),e.Buffer=n),n.prototype=Object.create(i.prototype),r(i,n),n.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},n.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");return t=i(t),void 0!==e?"string"==typeof r?t.fill(e,r):t.fill(e):t.fill(0),t},n.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},n.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return Tt.SlowBuffer(t)}})),jt=Ot((function(t,e){function r(){throw Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}function n(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>u||0>t)throw new TypeError("offset must be a uint32");if(t>a||t>e)throw new RangeError("offset out of range")}function i(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>u||0>t)throw new TypeError("size must be a uint32");if(t+e>r||t>a)throw new RangeError("buffer too small")}function o(t,e,r,n){if(e=new Uint8Array(t.buffer,e,r),f.getRandomValues(e),!n)return t;!function(t){var e=Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Ft.push(new xt(t,e)),1!==Ft.length||Dt||Wt(Mt)}((function(){n(null,t)}))}var s=Yt.Buffer,a=Yt.kMaxLength,f=Rt.crypto||Rt.msCrypto,u=Math.pow(2,32)-1;f&&f.getRandomValues?(e.randomFill=function(t,e,r,a){if(!(s.isBuffer(t)||t instanceof Rt.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)a=e,e=0,r=t.length;else if("function"==typeof r)a=r,r=t.length-e;else if("function"!=typeof a)throw new TypeError('"cb" argument must be a function');return n(e,t.length),i(r,e,t.length),o(t,e,r,a)},e.randomFillSync=function(t,e,r){if(void 0===e&&(e=0),!(s.isBuffer(t)||t instanceof Rt.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return n(e,t.length),void 0===r&&(r=t.length-e),i(r,e,t.length),o(t,e,r)}):(e.randomFill=r,e.randomFillSync=r)})),Vt=Ot((function(t){t.exports=jt})).randomFillSync,zt=Math.floor(.001*(Date.now()-performance.now()));function Kt(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function qt(t,e){for(var r,n="",i=0,o=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)r=t.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o!==a-1&&1!==s)if(o!==a-1&&2===s){if(2>n.length||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(2<n.length){if((o=n.lastIndexOf("/"))!==n.length-1){-1===o?(n="",i=0):i=(n=n.slice(0,o)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}e&&(n=0<n.length?n+"/..":"..",i=2)}else n=0<n.length?n+"/"+t.slice(o+1,a):t.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var Zt,Xt={resolve:function(){for(var t,e="",r=!1,n=arguments.length-1;-1<=n&&!r;n--){if(0<=n)var i=arguments[n];else void 0===t&&(t=Ht()),i=t;Kt(i),0!==i.length&&(e=i+"/"+e,r=47===i.charCodeAt(0))}return e=qt(e,!r),r?0<e.length?"/"+e:"/":0<e.length?e:"."},normalize:function(t){if(Kt(t),0===t.length)return".";var e=47===t.charCodeAt(0),r=47===t.charCodeAt(t.length-1);return 0!==(t=qt(t,!e)).length||e||(t="."),0<t.length&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return Kt(t),0<t.length&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];Kt(r),0<r.length&&(t=void 0===t?r:t+"/"+r)}return void 0===t?".":Xt.normalize(t)},relative:function(t,e){if(Kt(t),Kt(e),t===e)return"";if((t=Xt.resolve(t))===(e=Xt.resolve(e)))return"";for(var r=1;r<t.length&&47===t.charCodeAt(r);++r);for(var n=t.length,i=n-r,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var s=e.length-o,a=i<s?i:s,f=-1,u=0;u<=a;++u){if(u===a){if(s>a){if(47===e.charCodeAt(o+u))return e.slice(o+u+1);if(0===u)return e.slice(o+u)}else i>a&&(47===t.charCodeAt(r+u)?f=u:0===u&&(f=0));break}var h=t.charCodeAt(r+u);if(h!==e.charCodeAt(o+u))break;47===h&&(f=u)}for(i="",u=r+f+1;u<=n;++u)u!==n&&47!==t.charCodeAt(u)||(i=0===i.length?i+"..":i+"/..");return 0<i.length?i+e.slice(o+f):(o+=f,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(Kt(t),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,i=!0,o=t.length-1;1<=o;--o)if(47===(e=t.charCodeAt(o))){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');Kt(t);var r,n=0,i=-1,o=!0;if(void 0!==e&&0<e.length&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,a=-1;for(r=t.length-1;0<=r;--r){var f=t.charCodeAt(r);if(47===f){if(!o){n=r+1;break}}else-1===a&&(o=!1,a=r+1),0<=s&&(f===e.charCodeAt(s)?-1==--s&&(i=r):(s=-1,i=a))}return n===i?i=a:-1===i&&(i=t.length),t.slice(n,i)}for(r=t.length-1;0<=r;--r)if(47===t.charCodeAt(r)){if(!o){n=r+1;break}}else-1===i&&(o=!1,i=r+1);return-1===i?"":t.slice(n,i)},extname:function(t){Kt(t);for(var e=-1,r=0,n=-1,i=!0,o=0,s=t.length-1;0<=s;--s){var a=t.charCodeAt(s);if(47===a){if(!i){r=s+1;break}}else-1===n&&(i=!1,n=s+1),46===a?-1===e?e=s:1!==o&&(o=1):-1!==e&&(o=-1)}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===r+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);var e=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return e?e===t.root?e+r:e+"/"+r:r},parse:function(t){Kt(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r=t.charCodeAt(0),n=47===r;if(n){e.root="/";var i=1}else i=0;for(var o=-1,s=0,a=-1,f=!0,u=t.length-1,h=0;u>=i;--u)if(47===(r=t.charCodeAt(u))){if(!f){s=u+1;break}}else-1===a&&(f=!1,a=u+1),46===r?-1===o?o=u:1!==h&&(h=1):-1!==o&&(h=-1);return-1===o||-1===a||0===h||1===h&&o===a-1&&o===s+1?-1!==a&&(e.base=e.name=0===s&&n?t.slice(1,a):t.slice(s,a)):(0===s&&n?(e.name=t.slice(1,o),e.base=t.slice(1,a)):(e.name=t.slice(s,o),e.base=t.slice(s,a)),e.ext=t.slice(o,a)),0<s?e.dir=t.slice(0,s-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null},Jt=Xt.posix=Xt,$t={hrtime:function(t){return 1e9*(t=function(t){var e=.001*performance.now(),r=Math.floor(e)+zt;return e=Math.floor(e%1*1e9),t&&(r-=t[0],0>(e-=t[1])&&(r--,e+=1e9)),[r,e]}(t))[0]+t[1]},exit:function(t){throw new ze(t)},kill:function(t){throw new Ke(t)},randomFillSync:Vt,isTTY:function(){return!0},path:Object.freeze({__proto__:null,default:Jt,__moduleExports:Jt}),fs:null},Qt=k(1),te=k(2),ee=k(4),re=k(8),ne=k(16),ie=k(32),oe=k(64),se=k(128),ae=k(256),fe=k(512),ue=k(1024),he=k(2048),le=k(4096),ce=k(8192),pe=k(16384),de=k(32768),_e=k(65536),ge=k(131072),ye=k(262144),me=k(524288),Ee=k(1048576),Se=k(2097152),Ie=k(4194304),we=k(8388608),Ae=k(16777216),ve=k(33554432),Te=k(67108864),be=k(134217728),Re=k(268435456),Oe=Qt|te|ee|re|ne|ie|oe|se|ae|fe|ue|he|le|ce|pe|de|_e|ge|ye|me|Ee|Se|we|Ie|Ae|Te|ve|be|Re,Ne=Qt|te|ee|re|ne|ie|oe|se|ae|Se|Ie|we|be,Ce=k(0),Le=re|ne|se|fe|ue|he|le|ce|pe|de|_e|ge|ye|me|Ee|Se|we|Ae|Te|ve|be,Pe=Le|Ne,We=te|re|oe|Se|be|Re,Be=te|re|oe|Se|be,Fe=k(0),De={E2BIG:1,EACCES:2,EADDRINUSE:3,EADDRNOTAVAIL:4,EAFNOSUPPORT:5,EALREADY:7,EAGAIN:6,EBADF:8,EBADMSG:9,EBUSY:10,ECANCELED:11,ECHILD:12,ECONNABORTED:13,ECONNREFUSED:14,ECONNRESET:15,EDEADLOCK:16,EDESTADDRREQ:17,EDOM:18,EDQUOT:19,EEXIST:20,EFAULT:21,EFBIG:22,EHOSTDOWN:23,EHOSTUNREACH:23,EIDRM:24,EILSEQ:25,EINPROGRESS:26,EINTR:27,EINVAL:28,EIO:29,EISCONN:30,EISDIR:31,ELOOP:32,EMFILE:33,EMLINK:34,EMSGSIZE:35,EMULTIHOP:36,ENAMETOOLONG:37,ENETDOWN:38,ENETRESET:39,ENETUNREACH:40,ENFILE:41,ENOBUFS:42,ENODEV:43,ENOENT:44,ENOEXEC:45,ENOLCK:46,ENOLINK:47,ENOMEM:48,ENOMSG:49,ENOPROTOOPT:50,ENOSPC:51,ENOSYS:52,ENOTCONN:53,ENOTDIR:54,ENOTEMPTY:55,ENOTRECOVERABLE:56,ENOTSOCK:57,ENOTTY:59,ENXIO:60,EOVERFLOW:61,EOWNERDEAD:62,EPERM:63,EPIPE:64,EPROTO:65,EPROTONOSUPPORT:66,EPROTOTYPE:67,ERANGE:68,EROFS:69,ESPIPE:70,ESRCH:71,ESTALE:72,ETIMEDOUT:73,ETXTBSY:74,EXDEV:75},ke=((Zt={})[6]="SIGHUP",Zt[8]="SIGINT",Zt[11]="SIGQUIT",Zt[7]="SIGILL",Zt[15]="SIGTRAP",Zt[0]="SIGABRT",Zt[2]="SIGBUS",Zt[5]="SIGFPE",Zt[9]="SIGKILL",Zt[20]="SIGUSR1",Zt[12]="SIGSEGV",Zt[21]="SIGUSR2",Zt[10]="SIGPIPE",Zt[1]="SIGALRM",Zt[14]="SIGTERM",Zt[3]="SIGCHLD",Zt[4]="SIGCONT",Zt[13]="SIGSTOP",Zt[16]="SIGTSTP",Zt[17]="SIGTTIN",Zt[18]="SIGTTOU",Zt[19]="SIGURG",Zt[23]="SIGXCPU",Zt[24]="SIGXFSZ",Zt[22]="SIGVTALRM",Zt),Ue=Qt|te|ne|se|Se|be,Me=Qt|oe|ne|se|Se|be;function xe(t){var e=Math.trunc(t);return t=k(Math.round(1e6*(t-e))),k(e)*k(1e6)+t}function Ge(t){return"number"==typeof t&&(t=Math.trunc(t)),t=k(t),Number(t/k(1e6))}function He(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];try{return t.apply(void 0,F(e))}catch(t){if(t&&t.code&&"string"==typeof t.code)return De[t.code]||28;if(t instanceof Ve)return t.errno;throw t}}}function Ye(t,e){var r=t.FD_MAP.get(e);if(!r)throw new Ve(8);if(void 0===r.filetype){var n=t.bindings.fs.fstatSync(r.real);e=(t=je(t,e,n)).rightsBase,n=t.rightsInheriting,r.filetype=t.filetype,r.rights||(r.rights={base:e,inheriting:n})}return r}function je(t,e,r){switch(!0){case r.isBlockDevice():return{filetype:1,rightsBase:Oe,rightsInheriting:Oe};case r.isCharacterDevice():return void 0!==e&&t.bindings.isTTY(e)?{filetype:2,rightsBase:Be,rightsInheriting:Fe}:{filetype:2,rightsBase:Oe,rightsInheriting:Oe};case r.isDirectory():return{filetype:3,rightsBase:Le,rightsInheriting:Pe};case r.isFIFO():return{filetype:6,rightsBase:We,rightsInheriting:Oe};case r.isFile():return{filetype:4,rightsBase:Ne,rightsInheriting:Ce};case r.isSocket():return{filetype:6,rightsBase:We,rightsInheriting:Oe};case r.isSymbolicLink():return{filetype:7,rightsBase:k(0),rightsInheriting:k(0)};default:return{filetype:0,rightsBase:k(0),rightsInheriting:k(0)}}}var Ve=function(t){function e(r){var n=t.call(this)||this;return n.errno=r,Object.setPrototypeOf(n,e.prototype),n}return P(e,t),e}(Error),ze=function(t){function e(r){var n=t.call(this,"WASI Exit error: "+r)||this;return n.code=r,Object.setPrototypeOf(n,e.prototype),n}return P(e,t),e}(Error),Ke=function(t){function e(r){var n=t.call(this,"WASI Kill signal: "+r)||this;return n.signal=r,Object.setPrototypeOf(n,e.prototype),n}return P(e,t),e}(Error),qe=function(){function t(t){function e(t){switch(t){case 1:return u.hrtime();case 0:return xe(Date.now());case 2:case 3:return u.hrtime()-S;default:return null}}function r(t,e){if(t=Ye(o,t),e!==k(0)&&(t.rights.base&e)===k(0))throw new Ve(63);return t}function n(t,e){return o.refreshMemory(),Array.from({length:e},(function(e,r){return r=t+8*r,e=o.view.getUint32(r,!0),r=o.view.getUint32(r+4,!0),new Uint8Array(o.memory.buffer,e,r)}))}var i,o=this,s={};t&&t.preopens?s=t.preopens:t&&t.preopenDirectories&&(s=t.preopenDirectories);var a={};t&&t.env&&(a=t.env);var f=[];t&&t.args&&(f=t.args);var u=$t;t&&t.bindings&&(u=t.bindings),this.view=this.memory=void 0,this.bindings=u,this.FD_MAP=new Map([[0,{real:0,filetype:2,rights:{base:Ue,inheriting:k(0)},path:void 0}],[1,{real:1,filetype:2,rights:{base:Me,inheriting:k(0)},path:void 0}],[2,{real:2,filetype:2,rights:{base:Me,inheriting:k(0)},path:void 0}]]);var h=this.bindings.fs,l=this.bindings.path;try{for(var c=W(Object.entries(s)),p=c.next();!p.done;p=c.next()){var d=B(p.value,2),_=d[0],g=d[1],y=h.openSync(g,h.constants.O_RDONLY),m=F(this.FD_MAP.keys()).reverse()[0]+1;this.FD_MAP.set(m,{real:y,filetype:3,rights:{base:Le,inheriting:Pe},fakePath:_,path:g})}}catch(t){var E={error:t}}finally{try{p&&!p.done&&(i=c.return)&&i.call(c)}finally{if(E)throw E.error}}var S=u.hrtime();this.wasiImport={args_get:function(t,e){o.refreshMemory();var r=t,n=e;return f.forEach((function(t){o.view.setUint32(r,n,!0),r+=4,n+=bt.from(o.memory.buffer).write(t+"\0",n)})),0},args_sizes_get:function(t,e){return o.refreshMemory(),o.view.setUint32(t,f.length,!0),t=f.reduce((function(t,e){return t+bt.byteLength(e)+1}),0),o.view.setUint32(e,t,!0),0},environ_get:function(t,e){o.refreshMemory();var r=t,n=e;return Object.entries(a).forEach((function(t){var e=B(t,2);t=e[0],e=e[1],o.view.setUint32(r,n,!0),r+=4,n+=bt.from(o.memory.buffer).write(t+"="+e+"\0",n)})),0},environ_sizes_get:function(t,e){o.refreshMemory();var r=Object.entries(a).map((function(t){return(t=B(t,2))[0]+"="+t[1]+"\0"})),n=r.reduce((function(t,e){return t+bt.byteLength(e)}),0);return o.view.setUint32(t,r.length,!0),o.view.setUint32(e,n,!0),0},clock_res_get:function(t,e){switch(t){case 1:case 2:case 3:var r=k(1);break;case 0:r=k(1e3)}return o.view.setBigUint64(e,r),0},clock_time_get:function(t,r,n){return o.refreshMemory(),null===(t=e(t))?28:(o.view.setBigUint64(n,k(t),!0),0)},fd_advise:He((function(t){return r(t,se),52})),fd_allocate:He((function(t){return r(t,ae),52})),fd_close:He((function(t){var e=r(t,k(0));return h.closeSync(e.real),o.FD_MAP.delete(t),0})),fd_datasync:He((function(t){return t=r(t,Qt),h.fdatasyncSync(t.real),0})),fd_fdstat_get:He((function(t,e){return t=r(t,k(0)),o.refreshMemory(),o.view.setUint8(e,t.filetype),o.view.setUint16(e+2,0,!0),o.view.setUint16(e+4,0,!0),o.view.setBigUint64(e+8,k(t.rights.base),!0),o.view.setBigUint64(e+8+8,k(t.rights.inheriting),!0),0})),fd_fdstat_set_flags:He((function(t){return r(t,re),52})),fd_fdstat_set_rights:He((function(t,e,n){return((t=r(t,k(0))).rights.base|e)>t.rights.base||(t.rights.inheriting|n)>t.rights.inheriting?63:(t.rights.base=e,t.rights.inheriting=n,0)})),fd_filestat_get:He((function(t,e){t=r(t,Se);var n=h.fstatSync(t.real);return o.refreshMemory(),o.view.setBigUint64(e,k(n.dev),!0),e+=8,o.view.setBigUint64(e,k(n.ino),!0),e+=8,o.view.setUint8(e,t.filetype),e+=8,o.view.setBigUint64(e,k(n.nlink),!0),e+=8,o.view.setBigUint64(e,k(n.size),!0),e+=8,o.view.setBigUint64(e,xe(n.atimeMs),!0),e+=8,o.view.setBigUint64(e,xe(n.mtimeMs),!0),o.view.setBigUint64(e+8,xe(n.ctimeMs),!0),0})),fd_filestat_set_size:He((function(t,e){return t=r(t,Ie),h.ftruncateSync(t.real,Number(e)),0})),fd_filestat_set_times:He((function(t,n,i,o){t=r(t,we);var s=h.fstatSync(t.real),a=s.atime;s=s.mtime;var f=Ge(e(0));return 3==(3&o)||12==(12&o)?28:(1==(1&o)?a=Ge(n):2==(2&o)&&(a=f),4==(4&o)?s=Ge(i):8==(8&o)&&(s=f),h.futimesSync(t.real,new Date(a),new Date(s)),0)})),fd_prestat_get:He((function(t,e){return(t=r(t,k(0))).path?(o.refreshMemory(),o.view.setUint8(e,0),o.view.setUint32(e+4,bt.byteLength(t.fakePath),!0),0):28})),fd_prestat_dir_name:He((function(t,e,n){return(t=r(t,k(0))).path?(o.refreshMemory(),bt.from(o.memory.buffer).write(t.fakePath,e,n,"utf8"),0):28})),fd_pwrite:He((function(t,e,i,s,a){var f=r(t,oe|ee),u=0;return n(e,i).forEach((function(t){for(var e=0;e<t.byteLength;)e+=h.writeSync(f.real,t,e,t.byteLength-e,Number(s)+u+e);u+=e})),o.view.setUint32(a,u,!0),0})),fd_write:He((function(t,e,i,s){var a=r(t,oe),f=0;return n(e,i).forEach((function(t){for(var e=0;e<t.byteLength;){var r=h.writeSync(a.real,t,e,t.byteLength-e,a.offset?Number(a.offset):null);a.offset&&(a.offset+=k(r)),e+=r}f+=e})),o.view.setUint32(s,f,!0),0})),fd_pread:He((function(t,e,i,s,a){var f;t=r(t,te|ee);var u=0;try{var l=W(n(e,i)),c=l.next();t:for(;!c.done;c=l.next()){var p=c.value;for(e=0;e<p.byteLength;){var d=p.byteLength-e,_=h.readSync(t.real,p,e,p.byteLength-e,Number(s)+u+e);if(e+=_,u+=_,0===_||_<d)break t}u+=e}}catch(t){var g={error:t}}finally{try{c&&!c.done&&(f=l.return)&&f.call(l)}finally{if(g)throw g.error}}return o.view.setUint32(a,u,!0),0})),fd_read:He((function(t,e,i,s){var a,f=0===(t=r(t,te)).real,u=0;try{var l=W(n(e,i)),c=l.next();t:for(;!c.done;c=l.next()){var p=c.value;for(e=0;e<p.byteLength;){var d=p.byteLength-e,_=h.readSync(t.real,p,e,d,f||void 0===t.offset?null:Number(t.offset));if(f||(t.offset=(t.offset?t.offset:k(0))+k(_)),e+=_,u+=_,0===_||_<d)break t}}}catch(t){var g={error:t}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(g)throw g.error}}return o.view.setUint32(s,u,!0),0})),fd_readdir:He((function(t,e,n,i,s){t=r(t,pe),o.refreshMemory();var a=h.readdirSync(t.path,{withFileTypes:!0}),f=e;for(i=Number(i);i<a.length;i+=1){var u=a[i],c=bt.byteLength(u.name);if(e-f>n)break;if(o.view.setBigUint64(e,k(i+1),!0),(e+=8)-f>n)break;var p=h.statSync(l.resolve(t.path,u.name));if(o.view.setBigUint64(e,k(p.ino),!0),(e+=8)-f>n)break;if(o.view.setUint32(e,c,!0),(e+=4)-f>n)break;switch(!0){case p.isBlockDevice():p=1;break;case p.isCharacterDevice():p=2;break;case p.isDirectory():p=3;break;case p.isFIFO():p=6;break;case p.isFile():p=4;break;case p.isSocket():p=6;break;case p.isSymbolicLink():p=7;break;default:p=0}if(o.view.setUint8(e,p),e+=1,(e+=3)+c>=f+n)break;bt.from(o.memory.buffer).write(u.name,e),e+=c}return o.view.setUint32(s,Math.min(e-f,n),!0),0})),fd_renumber:He((function(t,e){return r(t,k(0)),r(e,k(0)),h.closeSync(o.FD_MAP.get(t).real),o.FD_MAP.set(t,o.FD_MAP.get(e)),o.FD_MAP.delete(e),0})),fd_seek:He((function(t,e,n,i){switch(t=r(t,ee),o.refreshMemory(),n){case 1:t.offset=(t.offset?t.offset:k(0))+k(e);break;case 2:n=h.fstatSync(t.real).size,t.offset=k(n)+k(e);break;case 0:t.offset=k(e)}return o.view.setBigUint64(i,t.offset,!0),0})),fd_tell:He((function(t,e){return t=r(t,ie),o.refreshMemory(),t.offset||(t.offset=k(0)),o.view.setBigUint64(e,t.offset,!0),0})),fd_sync:He((function(t){return t=r(t,ne),h.fsyncSync(t.real),0})),path_create_directory:He((function(t,e,n){return(t=r(t,fe)).path?(o.refreshMemory(),e=bt.from(o.memory.buffer,e,n).toString(),h.mkdirSync(l.resolve(t.path,e)),0):28})),path_filestat_get:He((function(t,e,n,i,s){return(t=r(t,ye)).path?(o.refreshMemory(),n=bt.from(o.memory.buffer,n,i).toString(),n=h.statSync(l.resolve(t.path,n)),o.view.setBigUint64(s,k(n.dev),!0),s+=8,o.view.setBigUint64(s,k(n.ino),!0),s+=8,o.view.setUint8(s,je(o,void 0,n).filetype),s+=8,o.view.setBigUint64(s,k(n.nlink),!0),s+=8,o.view.setBigUint64(s,k(n.size),!0),s+=8,o.view.setBigUint64(s,xe(n.atimeMs),!0),s+=8,o.view.setBigUint64(s,xe(n.mtimeMs),!0),o.view.setBigUint64(s+8,xe(n.ctimeMs),!0),0):28})),path_filestat_set_times:He((function(t,n,i,s,a,f,u){if(!(t=r(t,Ee)).path)return 28;o.refreshMemory();var c=h.fstatSync(t.real);n=c.atime,c=c.mtime;var p=Ge(e(0));return 3==(3&u)||12==(12&u)?28:(1==(1&u)?n=Ge(a):2==(2&u)&&(n=p),4==(4&u)?c=Ge(f):8==(8&u)&&(c=p),i=bt.from(o.memory.buffer,i,s).toString(),h.utimesSync(l.resolve(t.path,i),new Date(n),new Date(c)),0)})),path_link:He((function(t,e,n,i,s,a,f){return t=r(t,he),s=r(s,le),t.path&&s.path?(o.refreshMemory(),n=bt.from(o.memory.buffer,n,i).toString(),a=bt.from(o.memory.buffer,a,f).toString(),h.linkSync(l.resolve(t.path,n),l.resolve(s.path,a)),0):28})),path_open:He((function(t,e,n,i,s,a,f,u,c){e=r(t,ce),a=k(a),f=k(f),t=(a&(te|pe))!==k(0);var p=(a&(Qt|oe|ae|Ie))!==k(0);if(p&&t)var d=h.constants.O_RDWR;else t?d=h.constants.O_RDONLY:p&&(d=h.constants.O_WRONLY);if(t=a|ce,a|=f,0!=(1&s)&&(d|=h.constants.O_CREAT,t|=ue),0!=(2&s)&&(d|=h.constants.O_DIRECTORY),0!=(4&s)&&(d|=h.constants.O_EXCL),0!=(8&s)&&(d|=h.constants.O_TRUNC,t|=me),0!=(1&u)&&(d|=h.constants.O_APPEND),0!=(2&u)&&(d=h.constants.O_DSYNC?d|h.constants.O_DSYNC:d|h.constants.O_SYNC,a|=Qt),0!=(4&u)&&(d|=h.constants.O_NONBLOCK),0!=(8&u)&&(d=h.constants.O_RSYNC?d|h.constants.O_RSYNC:d|h.constants.O_SYNC,a|=ne),0!=(16&u)&&(d|=h.constants.O_SYNC,a|=ne),p&&0==(d&(h.constants.O_APPEND|h.constants.O_TRUNC))&&(a|=ee),o.refreshMemory(),n=bt.from(o.memory.buffer,n,i).toString(),n=l.resolve(e.path,n),l.relative(e.path,n).startsWith(".."))return 76;try{var _=h.realpathSync(n);if(l.relative(e.path,_).startsWith(".."))return 76}catch(t){if("ENOENT"!==t.code)throw t;_=n}try{var g=h.statSync(_).isDirectory()}catch(t){}return d=!p&&g?h.openSync(_,h.constants.O_RDONLY):h.openSync(_,d),g=F(o.FD_MAP.keys()).reverse()[0]+1,o.FD_MAP.set(g,{real:d,filetype:void 0,rights:{base:t,inheriting:a},path:_}),Ye(o,g),o.view.setUint32(c,g,!0),0})),path_readlink:He((function(t,e,n,i,s,a){return(t=r(t,de)).path?(o.refreshMemory(),e=bt.from(o.memory.buffer,e,n).toString(),e=l.resolve(t.path,e),e=h.readlinkSync(e),i=bt.from(o.memory.buffer).write(e,i,s),o.view.setUint32(a,i,!0),0):28})),path_remove_directory:He((function(t,e,n){return(t=r(t,ve)).path?(o.refreshMemory(),e=bt.from(o.memory.buffer,e,n).toString(),h.rmdirSync(l.resolve(t.path,e)),0):28})),path_rename:He((function(t,e,n,i,s,a){return t=r(t,_e),i=r(i,ge),t.path&&i.path?(o.refreshMemory(),e=bt.from(o.memory.buffer,e,n).toString(),s=bt.from(o.memory.buffer,s,a).toString(),h.renameSync(l.resolve(t.path,e),l.resolve(i.path,s)),0):28})),path_symlink:He((function(t,e,n,i,s){return(n=r(n,Ae)).path?(o.refreshMemory(),t=bt.from(o.memory.buffer,t,e).toString(),i=bt.from(o.memory.buffer,i,s).toString(),h.symlinkSync(t,l.resolve(n.path,i)),0):28})),path_unlink_file:He((function(t,e,n){return(t=r(t,Te)).path?(o.refreshMemory(),e=bt.from(o.memory.buffer,e,n).toString(),h.unlinkSync(l.resolve(t.path,e)),0):28})),poll_oneoff:function(t,r,n,i){var s=0,a=0;o.refreshMemory();for(var f=0;f<n;f+=1){var h=o.view.getBigUint64(t,!0);t+=8;var l=o.view.getUint8(t);switch(t+=1,l){case 0:t+=7,o.view.getBigUint64(t,!0),t+=8;var c=o.view.getUint32(t,!0);t+=4,t+=4,l=o.view.getBigUint64(t,!0),t+=8,o.view.getBigUint64(t,!0),t+=8;var p=o.view.getUint16(t,!0);t+=2,t+=6;var d=1===p;p=0,null===(c=k(e(c)))?p=28:a=(l=d?l:c+l)>a?l:a,o.view.setBigUint64(r,h,!0),r+=8,o.view.setUint16(r,p,!0),r+=2,o.view.setUint8(r,0),r+=1,r+=5,s+=1;break;case 1:case 2:t+=3,o.view.getUint32(t,!0),t+=4,o.view.setBigUint64(r,h,!0),r+=8,o.view.setUint16(r,52,!0),r+=2,o.view.setUint8(r,l),r+=1,r+=5,s+=1;break;default:return 28}}for(o.view.setUint32(i,s,!0);u.hrtime()<a;);return 0},proc_exit:function(t){return u.exit(t),0},proc_raise:function(t){return t in ke?(u.kill(ke[t]),0):28},random_get:function(t,e){return o.refreshMemory(),u.randomFillSync(new Uint8Array(o.memory.buffer),t,e),0},sched_yield:function(){return 0},sock_recv:function(){return 52},sock_send:function(){return 52},sock_shutdown:function(){return 52}},t.traceSyscalls&&Object.keys(this.wasiImport).forEach((function(t){var e=o.wasiImport[t];o.wasiImport[t]=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];console.log("WASI: wasiImport called: "+t+" ("+r+")");try{var i=e.apply(void 0,F(r));return console.log("WASI: => "+i),i}catch(t){throw console.log("Catched error: "+t),t}}}))}return t.prototype.refreshMemory=function(){this.view&&0!==this.view.buffer.byteLength||(this.view=new U(this.memory.buffer))},t.prototype.setMemory=function(t){this.memory=t},t.prototype.start=function(t){if(null===(t=t.exports)||"object"!=typeof t)throw Error("instance.exports must be an Object. Received "+t+".");var e=t.memory;if(!(e instanceof WebAssembly.Memory))throw Error("instance.exports.memory must be a WebAssembly.Memory. Recceived "+e+".");this.setMemory(e),t._start&&t._start()},t.prototype.getImportNamespace=function(t){var e,r=null;try{for(var n=W(WebAssembly.Module.imports(t)),i=n.next();!i.done;i=n.next()){var o=i.value;if("function"===o.kind&&o.module.startsWith("wasi_"))if(r){if(r!==o.module)throw Error("Multiple namespaces detected.")}else r=o.module}}catch(t){var s={error:t}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(s)throw s.error}}return r},t.prototype.getImports=function(t){switch(this.getImportNamespace(t)){case"wasi_unstable":return{wasi_unstable:this.wasiImport};case"wasi_snapshot_preview1":return{wasi_snapshot_preview1:this.wasiImport};default:throw Error("Can't detect a WASI namespace for the WebAssembly Module")}},t.defaultBindings=$t,t}(),Ze=r(311);function Xe(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function Je(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;t=r.call(t);var n,i=[];try{for(;(void 0===e||0<e--)&&!(n=t.next()).done;)i.push(n.value)}catch(t){var o={error:t}}finally{try{n&&!n.done&&(r=t.return)&&r.call(t)}finally{if(o)throw o.error}}return i}function $e(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Je(arguments[e]));return t}var Qe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function tr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function er(t,e){return t(e={exports:{}},e.exports),e.exports}var rr=er((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}}));tr(rr);var nr=er((function(t,e){e.default="function"==typeof BigInt?BigInt:function(){throw Error("BigInt is not supported in this environment.")}})),ir=er((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=rr.constants.S_IFMT,n=rr.constants.S_IFDIR,i=rr.constants.S_IFREG,o=rr.constants.S_IFBLK,s=rr.constants.S_IFCHR,a=rr.constants.S_IFLNK,f=rr.constants.S_IFIFO,u=rr.constants.S_IFSOCK;t=function(){function t(){}return t.build=function(e,r){void 0===r&&(r=!1);var n=new t,i=e.gid,o=e.atime,s=e.mtime,a=e.ctime;return r=r?nr.default:function(t){return t},n.uid=r(e.uid),n.gid=r(i),n.rdev=r(0),n.blksize=r(4096),n.ino=r(e.ino),n.size=r(e.getSize()),n.blocks=r(1),n.atime=o,n.mtime=s,n.ctime=a,n.birthtime=a,n.atimeMs=r(o.getTime()),n.mtimeMs=r(s.getTime()),i=r(a.getTime()),n.ctimeMs=i,n.birthtimeMs=i,n.dev=r(0),n.mode=r(e.mode),n.nlink=r(e.nlink),n},t.prototype._checkModeProperty=function(t){return(Number(this.mode)&r)===t},t.prototype.isDirectory=function(){return this._checkModeProperty(n)},t.prototype.isFile=function(){return this._checkModeProperty(i)},t.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},t.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},t.prototype.isSymbolicLink=function(){return this._checkModeProperty(a)},t.prototype.isFIFO=function(){return this._checkModeProperty(f)},t.prototype.isSocket=function(){return this._checkModeProperty(u)},t}(),e.Stats=t,e.default=t}));tr(ir);var or=void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},sr=[],ar=[],fr="undefined"!=typeof Uint8Array?Uint8Array:Array,ur=!1;function hr(){ur=!0;for(var t=0;64>t;++t)sr[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t],ar["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;ar[45]=62,ar[95]=63}function lr(t,e,r){for(var n=[],i=e;i<r;i+=3)e=(t[i]<<16)+(t[i+1]<<8)+t[i+2],n.push(sr[e>>18&63]+sr[e>>12&63]+sr[e>>6&63]+sr[63&e]);return n.join("")}function cr(t){ur||hr();for(var e=t.length,r=e%3,n="",i=[],o=0,s=e-r;o<s;o+=16383)i.push(lr(t,o,o+16383>s?s:o+16383));return 1===r?(t=t[e-1],n+=sr[t>>2],n+=sr[t<<4&63],n+="=="):2===r&&(t=(t[e-2]<<8)+t[e-1],n+=sr[t>>10],n+=sr[t>>4&63],n+=sr[t<<2&63],n+="="),i.push(n),i.join("")}function pr(t,e,r,n,i){var o=8*i-n-1,s=(1<<o)-1,a=s>>1,f=-7,u=r?-1:1,h=t[e+(i=r?i-1:0)];for(i+=u,r=h&(1<<-f)-1,h>>=-f,f+=o;0<f;r=256*r+t[e+i],i+=u,f-=8);for(o=r&(1<<-f)-1,r>>=-f,f+=n;0<f;o=256*o+t[e+i],i+=u,f-=8);if(0===r)r=1-a;else{if(r===s)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),r-=a}return(h?-1:1)*o*Math.pow(2,r-n)}function dr(t,e,r,n,i,o){var s,a=8*o-i-1,f=(1<<a)-1,u=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0;o=n?0:o-1;var l=n?1:-1,c=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(e=isNaN(e)?1:0,n=f):(n=Math.floor(Math.log(e)/Math.LN2),1>e*(s=Math.pow(2,-n))&&(n--,s*=2),2<=(e=1<=n+u?e+h/s:e+h*Math.pow(2,1-u))*s&&(n++,s/=2),n+u>=f?(e=0,n=f):1<=n+u?(e=(e*s-1)*Math.pow(2,i),n+=u):(e=e*Math.pow(2,u-1)*Math.pow(2,i),n=0));8<=i;t[r+o]=255&e,o+=l,e/=256,i-=8);for(n=n<<i|e,a+=i;0<a;t[r+o]=255&n,o+=l,n/=256,a-=8);t[r+o-l]|=128*c}var _r={}.toString,gr=Array.isArray||function(t){return"[object Array]"==_r.call(t)};Er.TYPED_ARRAY_SUPPORT=void 0===or.TYPED_ARRAY_SUPPORT||or.TYPED_ARRAY_SUPPORT;var yr=Er.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function mr(t,e){if((Er.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<e)throw new RangeError("Invalid typed array length");return Er.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=Er.prototype:(null===t&&(t=new Er(e)),t.length=e),t}function Er(t,e,r){if(!(Er.TYPED_ARRAY_SUPPORT||this instanceof Er))return new Er(t,e,r);if("number"==typeof t){if("string"==typeof e)throw Error("If encoding is specified then the first argument must be a string");return wr(this,t)}return Sr(this,t,e,r)}function Sr(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){if(e.byteLength,0>r||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),Er.TYPED_ARRAY_SUPPORT?(t=e).__proto__=Er.prototype:t=Ar(t,e),t}if("string"==typeof e){if(n=t,"string"==typeof(t=r)&&""!==t||(t="utf8"),!Er.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return(e=(n=mr(n,r=0|br(e,t))).write(e,t))!==r&&(n=n.slice(0,e)),n}return function(t,e){if(Tr(e)){var r=0|vr(e.length);return 0===(t=mr(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return(r="number"!=typeof e.length)||(r=(r=e.length)!=r),r?mr(t,0):Ar(t,e);if("Buffer"===e.type&&gr(e.data))return Ar(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function Ir(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(0>t)throw new RangeError('"size" argument must not be negative')}function wr(t,e){if(Ir(e),t=mr(t,0>e?0:0|vr(e)),!Er.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function Ar(t,e){var r=0>e.length?0:0|vr(e.length);t=mr(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function vr(t){if(t>=(Er.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(Er.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return 0|t}function Tr(t){return!(null==t||!t._isBuffer)}function br(t,e){if(Tr(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Mr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Gr(t).length;default:if(n)return Mr(t).length;e=(""+e).toLowerCase(),n=!0}}function Rr(t,e,r){var n=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":for(t=e,e=r,r=this.length,(!t||0>t)&&(t=0),(!e||0>e||e>r)&&(e=r),n="",r=t;r<e;++r)n=(t=n)+(n=16>(n=this[r])?"0"+n.toString(16):n.toString(16));return n;case"utf8":case"utf-8":return Lr(this,e,r);case"ascii":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(127&this[e]);return t;case"latin1":case"binary":for(t="",r=Math.min(this.length,r);e<r;++e)t+=String.fromCharCode(this[e]);return t;case"base64":return 0===e&&r===this.length?cr(this):cr(this.slice(e,r));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(e=this.slice(e,r),r="",t=0;t<e.length;t+=2)r+=String.fromCharCode(e[t]+256*e[t+1]);return r;default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function Or(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Nr(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:-2147483648>r&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),0>r&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(0>r){if(!i)return-1;r=0}if("string"==typeof e&&(e=Er.from(e,n)),Tr(e))return 0===e.length?-1:Cr(t,e,r,n,i);if("number"==typeof e)return e&=255,Er.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Cr(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Cr(t,e,r,n,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>e.length)return-1;s=2,a/=2,f/=2,r/=2}if(i)for(n=-1;r<a;r++)if(o(t,r)===o(e,-1===n?0:r-n)){if(-1===n&&(n=r),r-n+1===f)return n*s}else-1!==n&&(r-=r-n),n=-1;else for(r+f>a&&(r=a-f);0<=r;r--){for(a=!0,n=0;n<f;n++)if(o(t,r+n)!==o(e,n)){a=!1;break}if(a)return r}return-1}function Lr(t,e,r){r=Math.min(t.length,r);for(var n=[];e<r;){var i=t[e],o=null,s=239<i?4:223<i?3:191<i?2:1;if(e+s<=r)switch(s){case 1:128>i&&(o=i);break;case 2:var a=t[e+1];128==(192&a)&&127<(i=(31&i)<<6|63&a)&&(o=i);break;case 3:a=t[e+1];var f=t[e+2];128==(192&a)&&128==(192&f)&&2047<(i=(15&i)<<12|(63&a)<<6|63&f)&&(55296>i||57343<i)&&(o=i);break;case 4:a=t[e+1],f=t[e+2];var u=t[e+3];128==(192&a)&&128==(192&f)&&128==(192&u)&&65535<(i=(15&i)<<18|(63&a)<<12|(63&f)<<6|63&u)&&1114112>i&&(o=i)}null===o?(o=65533,s=1):65535<o&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),e+=s}if((t=n.length)<=Pr)n=String.fromCharCode.apply(String,n);else{for(r="",e=0;e<t;)r+=String.fromCharCode.apply(String,n.slice(e,e+=Pr));n=r}return n}Er.poolSize=8192,Er._augment=function(t){return t.__proto__=Er.prototype,t},Er.from=function(t,e,r){return Sr(null,t,e,r)},Er.TYPED_ARRAY_SUPPORT&&(Er.prototype.__proto__=Uint8Array.prototype,Er.__proto__=Uint8Array),Er.alloc=function(t,e,r){return Ir(t),0>=t?mr(null,t):void 0!==e?"string"==typeof r?mr(null,t).fill(e,r):mr(null,t).fill(e):mr(null,t)},Er.allocUnsafe=function(t){return wr(null,t)},Er.allocUnsafeSlow=function(t){return wr(null,t)},Er.isBuffer=Yr,Er.compare=function(t,e){if(!Tr(t)||!Tr(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},Er.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Er.concat=function(t,e){if(!gr(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Er.alloc(0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;e=Er.allocUnsafe(e);var n=0;for(r=0;r<t.length;++r){var i=t[r];if(!Tr(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(e,n),n+=i.length}return e},Er.byteLength=br,Er.prototype._isBuffer=!0,Er.prototype.swap16=function(){var t=this.length;if(0!=t%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)Or(this,e,e+1);return this},Er.prototype.swap32=function(){var t=this.length;if(0!=t%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)Or(this,e,e+3),Or(this,e+1,e+2);return this},Er.prototype.swap64=function(){var t=this.length;if(0!=t%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)Or(this,e,e+7),Or(this,e+1,e+6),Or(this,e+2,e+5),Or(this,e+3,e+4);return this},Er.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Lr(this,0,t):Rr.apply(this,arguments)},Er.prototype.equals=function(t){if(!Tr(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Er.compare(this,t)},Er.prototype.inspect=function(){var t="";return 0<this.length&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(t+=" ... ")),"<Buffer "+t+">"},Er.prototype.compare=function(t,e,r,n,i){if(!Tr(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),0>e||r>t.length||0>n||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s);for(n=this.slice(n,i),t=t.slice(e,r),e=0;e<a;++e)if(n[e]!==t[e]){o=n[e],s=t[e];break}return o<s?-1:s<o?1:0},Er.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},Er.prototype.indexOf=function(t,e,r){return Nr(this,t,e,r,!0)},Er.prototype.lastIndexOf=function(t,e,r){return Nr(this,t,e,r,!1)},Er.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),0<t.length&&(0>r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");for(n||(n="utf8"),i=!1;;)switch(n){case"hex":t:{if(e=Number(e)||0,n=this.length-e,r?(r=Number(r))>n&&(r=n):r=n,0!=(n=t.length)%2)throw new TypeError("Invalid hex string");for(r>n/2&&(r=n/2),n=0;n<r;++n){if(i=parseInt(t.substr(2*n,2),16),isNaN(i)){t=n;break t}this[e+n]=i}t=n}return t;case"utf8":case"utf-8":return Hr(Mr(t,this.length-e),this,e,r);case"ascii":case"latin1":case"binary":return Hr(xr(t),this,e,r);case"base64":return Hr(Gr(t),this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=t,i=this.length-e;for(var o=[],s=0;s<n.length&&!(0>(i-=2));++s){var a=n.charCodeAt(s);t=a>>8,a%=256,o.push(a),o.push(t)}return Hr(o,this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Er.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Pr=4096;function Wr(t,e,r){if(0!=t%1||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function Br(t,e,r,n,i,o){if(!Tr(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function Fr(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function Dr(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function kr(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}Er.prototype.slice=function(t,e){var r=this.length;if(0>(t=~~t)?0>(t+=r)&&(t=0):t>r&&(t=r),0>(e=void 0===e?r:~~e)?0>(e+=r)&&(e=0):e>r&&(e=r),e<t&&(e=t),Er.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,e)).__proto__=Er.prototype;else{e=new Er(r=e-t,void 0);for(var n=0;n<r;++n)e[n]=this[n+t]}return e},Er.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||Wr(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r},Er.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||Wr(t,e,this.length),r=this[t+--e];for(var n=1;0<e&&(n*=256);)r+=this[t+--e]*n;return r},Er.prototype.readUInt8=function(t,e){return e||Wr(t,1,this.length),this[t]},Er.prototype.readUInt16LE=function(t,e){return e||Wr(t,2,this.length),this[t]|this[t+1]<<8},Er.prototype.readUInt16BE=function(t,e){return e||Wr(t,2,this.length),this[t]<<8|this[t+1]},Er.prototype.readUInt32LE=function(t,e){return e||Wr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Er.prototype.readUInt32BE=function(t,e){return e||Wr(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Er.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||Wr(t,e,this.length),r=this[t];for(var n=1,i=0;++i<e&&(n*=256);)r+=this[t+i]*n;return r>=128*n&&(r-=Math.pow(2,8*e)),r},Er.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||Wr(t,e,this.length),r=e;for(var n=1,i=this[t+--r];0<r&&(n*=256);)i+=this[t+--r]*n;return i>=128*n&&(i-=Math.pow(2,8*e)),i},Er.prototype.readInt8=function(t,e){return e||Wr(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Er.prototype.readInt16LE=function(t,e){return e||Wr(t,2,this.length),32768&(t=this[t]|this[t+1]<<8)?4294901760|t:t},Er.prototype.readInt16BE=function(t,e){return e||Wr(t,2,this.length),32768&(t=this[t+1]|this[t]<<8)?4294901760|t:t},Er.prototype.readInt32LE=function(t,e){return e||Wr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Er.prototype.readInt32BE=function(t,e){return e||Wr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Er.prototype.readFloatLE=function(t,e){return e||Wr(t,4,this.length),pr(this,t,!0,23,4)},Er.prototype.readFloatBE=function(t,e){return e||Wr(t,4,this.length),pr(this,t,!1,23,4)},Er.prototype.readDoubleLE=function(t,e){return e||Wr(t,8,this.length),pr(this,t,!0,52,8)},Er.prototype.readDoubleBE=function(t,e){return e||Wr(t,8,this.length),pr(this,t,!1,52,8)},Er.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||Br(this,t,e,r,Math.pow(2,8*r)-1,0),n=1;var i=0;for(this[e]=255&t;++i<r&&(n*=256);)this[e+i]=t/n&255;return e+r},Er.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||Br(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)this[e+n]=t/i&255;return e+r},Er.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||Br(this,t,e,1,255,0),Er.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Er.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||Br(this,t,e,2,65535,0),Er.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Fr(this,t,e,!0),e+2},Er.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||Br(this,t,e,2,65535,0),Er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Fr(this,t,e,!1),e+2},Er.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||Br(this,t,e,4,4294967295,0),Er.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Dr(this,t,e,!0),e+4},Er.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||Br(this,t,e,4,4294967295,0),Er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Dr(this,t,e,!1),e+4},Er.prototype.writeIntLE=function(t,e,r,n){t=+t,e|=0,n||Br(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n),n=0;var i=1,o=0;for(this[e]=255&t;++n<r&&(i*=256);)0>t&&0===o&&0!==this[e+n-1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},Er.prototype.writeIntBE=function(t,e,r,n){t=+t,e|=0,n||Br(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var i=1,o=0;for(this[e+(n=r-1)]=255&t;0<=--n&&(i*=256);)0>t&&0===o&&0!==this[e+n+1]&&(o=1),this[e+n]=(t/i>>0)-o&255;return e+r},Er.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||Br(this,t,e,1,127,-128),Er.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},Er.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||Br(this,t,e,2,32767,-32768),Er.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Fr(this,t,e,!0),e+2},Er.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||Br(this,t,e,2,32767,-32768),Er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Fr(this,t,e,!1),e+2},Er.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||Br(this,t,e,4,2147483647,-2147483648),Er.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Dr(this,t,e,!0),e+4},Er.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||Br(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),Er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Dr(this,t,e,!1),e+4},Er.prototype.writeFloatLE=function(t,e,r){return r||kr(this,0,e,4),dr(this,t,e,!0,23,4),e+4},Er.prototype.writeFloatBE=function(t,e,r){return r||kr(this,0,e,4),dr(this,t,e,!1,23,4),e+4},Er.prototype.writeDoubleLE=function(t,e,r){return r||kr(this,0,e,8),dr(this,t,e,!0,52,8),e+8},Er.prototype.writeDoubleBE=function(t,e,r){return r||kr(this,0,e,8),dr(this,t,e,!1,52,8),e+8},Er.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0<n&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&r<e&&e<n)for(n=i-1;0<=n;--n)t[n+e]=this[n+r];else if(1e3>i||!Er.TYPED_ARRAY_SUPPORT)for(n=0;n<i;++n)t[n+e]=this[n+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},Er.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);256>i&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Er.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(0>e||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(n=e;n<r;++n)this[n]=t;else for(i=(t=Tr(t)?t:Mr(new Er(t,n).toString())).length,n=0;n<r-e;++n)this[n+e]=t[n%i];return this};var Ur=/[^+\/0-9A-Za-z-_]/g;function Mr(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&57344>r){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(56320>r){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,128>r){if(0>--e)break;o.push(r)}else if(2048>r){if(0>(e-=2))break;o.push(r>>6|192,63&r|128)}else if(65536>r){if(0>(e-=3))break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw Error("Invalid code point");if(0>(e-=4))break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function xr(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function Gr(t){if(2>(t=(t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(Ur,"")).length)t="";else for(;0!=t.length%4;)t+="=";ur||hr();var e=t.length;if(0<e%4)throw Error("Invalid string. Length must be a multiple of 4");var r="="===t[e-2]?2:"="===t[e-1]?1:0,n=new fr(3*e/4-r),i=0<r?e-4:e,o=0;for(e=0;e<i;e+=4){var s=ar[t.charCodeAt(e)]<<18|ar[t.charCodeAt(e+1)]<<12|ar[t.charCodeAt(e+2)]<<6|ar[t.charCodeAt(e+3)];n[o++]=s>>16&255,n[o++]=s>>8&255,n[o++]=255&s}return 2===r?(s=ar[t.charCodeAt(e)]<<2|ar[t.charCodeAt(e+1)]>>4,n[o++]=255&s):1===r&&(s=ar[t.charCodeAt(e)]<<10|ar[t.charCodeAt(e+1)]<<4|ar[t.charCodeAt(e+2)]>>2,n[o++]=s>>8&255,n[o++]=255&s),n}function Hr(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Yr(t){return null!=t&&(!!t._isBuffer||jr(t)||"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&jr(t.slice(0,0)))}function jr(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var Vr=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:yr,Buffer:Er,SlowBuffer:function(t){return+t!=t&&(t=0),Er.alloc(+t)},isBuffer:Yr}),zr=er((function(t,e){function r(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return new(Vr.Buffer.bind.apply(Vr.Buffer,n([void 0,t],e)))}var n=Qe&&Qe.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;t=Array(t);var n=0;for(e=0;e<r;e++)for(var i=arguments[e],o=0,s=i.length;o<s;o++,n++)t[n]=i[o];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Buffer=Vr.Buffer,e.bufferAllocUnsafe=Vr.Buffer.allocUnsafe||r,e.bufferFrom=Vr.Buffer.from||r}));function Kr(){throw Error("setTimeout has not been defined")}function qr(){throw Error("clearTimeout has not been defined")}tr(zr);var Zr=Kr,Xr=qr;function Jr(t){if(Zr===setTimeout)return setTimeout(t,0);if((Zr===Kr||!Zr)&&setTimeout)return Zr=setTimeout,setTimeout(t,0);try{return Zr(t,0)}catch(e){try{return Zr.call(null,t,0)}catch(e){return Zr.call(this,t,0)}}}"function"==typeof or.setTimeout&&(Zr=setTimeout),"function"==typeof or.clearTimeout&&(Xr=clearTimeout);var $r,Qr=[],tn=!1,en=-1;function rn(){tn&&$r&&(tn=!1,$r.length?Qr=$r.concat(Qr):en=-1,Qr.length&&nn())}function nn(){if(!tn){var t=Jr(rn);tn=!0;for(var e=Qr.length;e;){for($r=Qr,Qr=[];++en<e;)$r&&$r[en].run();en=-1,e=Qr.length}$r=null,tn=!1,function(t){if(Xr===clearTimeout)return clearTimeout(t);if((Xr===qr||!Xr)&&clearTimeout)return Xr=clearTimeout,clearTimeout(t);try{Xr(t)}catch(e){try{return Xr.call(null,t)}catch(e){return Xr.call(this,t)}}}(t)}}function on(t){var e=Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Qr.push(new sn(t,e)),1!==Qr.length||tn||Jr(nn)}function sn(t,e){this.fun=t,this.array=e}function an(){}sn.prototype.run=function(){this.fun.apply(null,this.array)};var fn=or.performance||{},un=fn.now||fn.mozNow||fn.msNow||fn.oNow||fn.webkitNow||function(){return(new Date).getTime()},hn=new Date,ln={nextTick:on,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:an,addListener:an,once:an,off:an,removeListener:an,removeAllListeners:an,emit:an,binding:function(){throw Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(){throw Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(t){var e=.001*un.call(fn),r=Math.floor(e);return e=Math.floor(e%1*1e9),t&&(r-=t[0],0>(e-=t[1])&&(r--,e+=1e9)),[r,e]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-hn)/1e3}},cn="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){function r(){}t.super_=e,r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t},pn=/%[sdj%]/g;function dn(t){if(!On(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(En(arguments[r]));return e.join(" ")}r=1;var n=arguments,i=n.length;e=String(t).replace(pn,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}));for(var o=n[r];r<i;o=n[++r])e=null!==o&&Ln(o)?e+" "+En(o):e+" "+o;return e}function _n(t,e){if(Nn(or.process))return function(){return _n(t,e).apply(this,arguments)};if(!0===ln.noDeprecation)return t;var r=!1;return function(){if(!r){if(ln.throwDeprecation)throw Error(e);ln.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}}var gn,yn={};function mn(t){return Nn(gn)&&(gn=ln.env.NODE_DEBUG||""),t=t.toUpperCase(),yn[t]||(new RegExp("\\b"+t+"\\b","i").test(gn)?yn[t]=function(){var e=dn.apply(null,arguments);console.error("%s %d: %s",t,0,e)}:yn[t]=function(){}),yn[t]}function En(t,e){var r={seen:[],stylize:In};return 3<=arguments.length&&(r.depth=arguments[2]),4<=arguments.length&&(r.colors=arguments[3]),bn(e)?r.showHidden=e:e&&Mn(r,e),Nn(r.showHidden)&&(r.showHidden=!1),Nn(r.depth)&&(r.depth=2),Nn(r.colors)&&(r.colors=!1),Nn(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Sn),wn(r,t,r.depth)}function Sn(t,e){return(e=En.styles[e])?"["+En.colors[e][0]+"m"+t+"["+En.colors[e][1]+"m":t}function In(t){return t}function wn(t,e,r){if(t.customInspect&&e&&Bn(e.inspect)&&e.inspect!==En&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(r,t);return On(n)||(n=wn(t,n,r)),n}if(n=function(t,e){return Nn(e)?t.stylize("undefined","undefined"):On(e)?(e="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'",t.stylize(e,"string")):Rn(e)?t.stylize(""+e,"number"):bn(e)?t.stylize(""+e,"boolean"):null===e?t.stylize("null","null"):void 0}(t,e))return n;var i=Object.keys(e),o=function(t){var e={};return t.forEach((function(t){e[t]=!0})),e}(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(e)),Wn(e)&&(0<=i.indexOf("message")||0<=i.indexOf("description")))return An(e);if(0===i.length){if(Bn(e))return t.stylize("[Function"+(e.name?": "+e.name:"")+"]","special");if(Cn(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Pn(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Wn(e))return An(e)}n="";var s=!1,a=["{","}"];return Tn(e)&&(s=!0,a=["[","]"]),Bn(e)&&(n=" [Function"+(e.name?": "+e.name:"")+"]"),Cn(e)&&(n=" "+RegExp.prototype.toString.call(e)),Pn(e)&&(n=" "+Date.prototype.toUTCString.call(e)),Wn(e)&&(n=" "+An(e)),0!==i.length||s&&0!=e.length?0>r?Cn(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),i=s?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)Object.prototype.hasOwnProperty.call(e,String(s))?o.push(vn(t,e,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(vn(t,e,r,n,i,!0))})),o}(t,e,r,o,i):i.map((function(n){return vn(t,e,r,o,n,s)})),t.seen.pop(),function(t,e,r){return 60<t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(i,n,a)):a[0]+n+a[1]}function An(t){return"["+Error.prototype.toString.call(t)+"]"}function vn(t,e,r,n,i,o){var s,a;if((e=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=e.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):e.set&&(a=t.stylize("[Setter]","special")),Object.prototype.hasOwnProperty.call(n,i)||(s="["+i+"]"),a||(0>t.seen.indexOf(e.value)?-1<(a=wn(t,e.value,null===r?null:r-1)).indexOf("\n")&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),Nn(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function Tn(t){return Array.isArray(t)}function bn(t){return"boolean"==typeof t}function Rn(t){return"number"==typeof t}function On(t){return"string"==typeof t}function Nn(t){return void 0===t}function Cn(t){return Ln(t)&&"[object RegExp]"===Object.prototype.toString.call(t)}function Ln(t){return"object"==typeof t&&null!==t}function Pn(t){return Ln(t)&&"[object Date]"===Object.prototype.toString.call(t)}function Wn(t){return Ln(t)&&("[object Error]"===Object.prototype.toString.call(t)||t instanceof Error)}function Bn(t){return"function"==typeof t}function Fn(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function Dn(t){return 10>t?"0"+t.toString(10):t.toString(10)}En.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},En.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var kn="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");function Un(){var t=new Date,e=[Dn(t.getHours()),Dn(t.getMinutes()),Dn(t.getSeconds())].join(":");return[t.getDate(),kn[t.getMonth()],e].join(" ")}function Mn(t,e){if(!e||!Ln(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}var xn={inherits:cn,_extend:Mn,log:function(){console.log("%s - %s",Un(),dn.apply(null,arguments))},isBuffer:function(t){return Yr(t)},isPrimitive:Fn,isFunction:Bn,isError:Wn,isDate:Pn,isObject:Ln,isRegExp:Cn,isUndefined:Nn,isSymbol:function(t){return"symbol"==typeof t},isString:On,isNumber:Rn,isNullOrUndefined:function(t){return null==t},isNull:function(t){return null===t},isBoolean:bn,isArray:Tn,inspect:En,deprecate:_n,format:dn,debuglog:mn};function Gn(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}var Hn,Yn=Object.prototype.hasOwnProperty,jn=Object.keys||function(t){var e,r=[];for(e in t)Yn.call(t,e)&&r.push(e);return r},Vn=Array.prototype.slice;function zn(){return void 0!==Hn?Hn:Hn="foo"===function(){}.name}function Kn(t){return!Yr(t)&&"function"==typeof or.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&!!(t instanceof DataView||t.buffer&&t.buffer instanceof ArrayBuffer))}function qn(t,e){t||ti(t,!0,e,"==",ei)}var Zn=/\s*function\s+([^\(\s]*)\s*/;function Xn(t){if(Bn(t))return zn()?t.name:(t=t.toString().match(Zn))&&t[1]}function Jn(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=$n(Qn(this.actual),128)+" "+this.operator+" "+$n(Qn(this.expected),128),this.generatedMessage=!0);var e=t.stackStartFunction||ti;Error.captureStackTrace?Error.captureStackTrace(this,e):(t=Error()).stack&&(t=t.stack,e=Xn(e),0<=(e=t.indexOf("\n"+e))&&(e=t.indexOf("\n",e+1),t=t.substring(e+1)),this.stack=t)}function $n(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function Qn(t){return zn()||!Bn(t)?En(t):"[Function"+((t=Xn(t))?": "+t:"")+"]"}function ti(t,e,r,n,i){throw new Jn({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function ei(t,e){t||ti(t,!0,e,"==",ei)}function ri(t,e,r,n){if(t===e)return!0;if(Yr(t)&&Yr(e))return 0===Gn(t,e);if(Pn(t)&&Pn(e))return t.getTime()===e.getTime();if(Cn(t)&&Cn(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(!Kn(t)||!Kn(e)||Object.prototype.toString.call(t)!==Object.prototype.toString.call(e)||t instanceof Float32Array||t instanceof Float64Array){if(Yr(t)!==Yr(e))return!1;var i=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==i&&i===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(Fn(t)||Fn(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=ni(t),o=ni(e);if(i&&!o||!i&&o)return!1;if(i)return ri(t=Vn.call(t),e=Vn.call(e),r);i=jn(t);var s=jn(e);if(i.length!==s.length)return!1;for(i.sort(),s.sort(),o=i.length-1;0<=o;o--)if(i[o]!==s[o])return!1;for(o=i.length-1;0<=o;o--)if(!ri(t[s=i[o]],e[s],r,n))return!1;return!0}(t,e,r,n))}return 0===Gn(new Uint8Array(t.buffer),new Uint8Array(e.buffer))}return r?t===e:t==e}function ni(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function ii(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function oi(t,e,r,n){if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null);try{e()}catch(t){var i=t}e=i,n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!e&&ti(e,r,"Missing expected exception"+n),i="string"==typeof n;var o=!t&&e&&!r;if((!t&&Wn(e)&&i&&ii(e,r)||o)&&ti(e,r,"Got unwanted exception"+n),t&&e&&r&&!ii(e,r)||!t&&e)throw e}qn.AssertionError=Jn,cn(Jn,Error),qn.fail=ti,qn.ok=ei,qn.equal=function t(e,r,n){e!=r&&ti(e,r,n,"==",t)},qn.notEqual=function t(e,r,n){e==r&&ti(e,r,n,"!=",t)},qn.deepEqual=function t(e,r,n){ri(e,r,!1)||ti(e,r,n,"deepEqual",t)},qn.deepStrictEqual=function t(e,r,n){ri(e,r,!0)||ti(e,r,n,"deepStrictEqual",t)},qn.notDeepEqual=function t(e,r,n){ri(e,r,!1)&&ti(e,r,n,"notDeepEqual",t)},qn.notDeepStrictEqual=function t(e,r,n){ri(e,r,!0)&&ti(e,r,n,"notDeepStrictEqual",t)},qn.strictEqual=function t(e,r,n){e!==r&&ti(e,r,n,"===",t)},qn.notStrictEqual=function t(e,r,n){e===r&&ti(e,r,n,"!==",t)},qn.throws=function(t,e,r){oi(!0,t,e,r)},qn.doesNotThrow=function(t,e,r){oi(!1,t,e,r)},qn.ifError=function(t){if(t)throw t};var si=er((function(t,e){function r(t){return function(t){function e(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return(r=t.call(this,n(e,r))||this).code=e,r[a]=e,r.name=t.prototype.name+" ["+r[a]+"]",r}return s(e,t),e}(t)}function n(t,e){qn.strictEqual(typeof t,"string");var r=f[t];if(qn(r,"An invalid error message key was used: "+t+"."),"function"==typeof r)t=r;else{if(t=xn.format,void 0===e||0===e.length)return r;e.unshift(r)}return String(t.apply(null,e))}function i(t,e){f[t]="function"==typeof e?e:String(e)}function o(t,e){if(qn(t,"expected is required"),qn("string"==typeof e,"thing is required"),Array.isArray(t)){var r=t.length;return qn(0<r,"At least one expected value needs to be specified"),t=t.map((function(t){return String(t)})),2<r?"one of "+e+" "+t.slice(0,r-1).join(", ")+", or "+t[r-1]:2===r?"one of "+e+" "+t[0]+" or "+t[1]:"of "+e+" "+t[0]}return"of "+e+" "+String(t)}var s=Qe&&Qe.__extends||function(){function t(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)}return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var a="undefined"==typeof Symbol?"_kCode":Symbol("code"),f={};t=function(t){function r(r){if("object"!=typeof r||null===r)throw new e.TypeError("ERR_INVALID_ARG_TYPE","options","object");var n=r.message?t.call(this,r.message)||this:t.call(this,xn.inspect(r.actual).slice(0,128)+" "+r.operator+" "+xn.inspect(r.expected).slice(0,128))||this;return n.generatedMessage=!r.message,n.name="AssertionError [ERR_ASSERTION]",n.code="ERR_ASSERTION",n.actual=r.actual,n.expected=r.expected,n.operator=r.operator,e.Error.captureStackTrace(n,r.stackStartFunction),n}return s(r,t),r}(Qe.Error),e.AssertionError=t,e.message=n,e.E=i,e.Error=r(Qe.Error),e.TypeError=r(Qe.TypeError),e.RangeError=r(Qe.RangeError),i("ERR_ARG_NOT_ITERABLE","%s must be iterable"),i("ERR_ASSERTION","%s"),i("ERR_BUFFER_OUT_OF_BOUNDS",(function(t,e){return e?"Attempt to write outside buffer bounds":'"'+t+'" is outside of buffer bounds'})),i("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),i("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),i("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),i("ERR_DNS_SET_SERVERS_FAILED",(function(t,e){return'c-ares failed to set servers: "'+t+'" ['+e+"]"})),i("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),i("ERR_ENCODING_NOT_SUPPORTED",(function(t){return'The "'+t+'" encoding is not supported'})),i("ERR_ENCODING_INVALID_ENCODED_DATA",(function(t){return"The encoded data was not valid for encoding "+t})),i("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),i("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),i("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),i("ERR_INDEX_OUT_OF_RANGE","Index out of range"),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){if(qn(t,"name is required"),e.includes("not ")){var n="must not be";e=e.split("not ")[1]}else n="must be";if(Array.isArray(t))n="The "+t.map((function(t){return'"'+t+'"'})).join(", ")+" arguments "+n+" "+o(e,"type");else if(t.includes(" argument"))n="The "+t+" "+n+" "+o(e,"type");else{var i=t.includes(".")?"property":"argument";n='The "'+t+'" '+i+" "+n+" "+o(e,"type")}return 3<=arguments.length&&(n+=". Received type "+(null!==r?typeof r:"null")),n})),i("ERR_INVALID_ARRAY_LENGTH",(function(t,e,r){return qn.strictEqual(typeof r,"number"),'The array "'+t+'" (length '+r+") must be of length "+e+"."})),i("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),i("ERR_INVALID_CALLBACK","Callback must be a function"),i("ERR_INVALID_CHAR","Invalid character in %s"),i("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),i("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),i("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),i("ERR_INVALID_FILE_URL_PATH","File URL path %s"),i("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),i("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+String(e)+'" is invalid for option "'+t+'"'})),i("ERR_INVALID_OPT_VALUE_ENCODING",(function(t){return'The value "'+String(t)+'" is invalid for option "encoding"'})),i("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),i("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),i("ERR_INVALID_THIS",'Value of "this" must be of type %s'),i("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),i("ERR_INVALID_URL","Invalid URL: %s"),i("ERR_INVALID_URL_SCHEME",(function(t){return"The URL must be "+o(t,"scheme")})),i("ERR_IPC_CHANNEL_CLOSED","Channel closed"),i("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),i("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),i("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),i("ERR_MISSING_ARGS",(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];qn(0<t.length,"At least one arg needs to be specified"),e="The ";var r=t.length;switch(t=t.map((function(t){return'"'+t+'"'})),r){case 1:e+=t[0]+" argument";break;case 2:e+=t[0]+" and "+t[1]+" arguments";break;default:e+=t.slice(0,r-1).join(", "),e+=", and "+t[r-1]+" arguments"}return e+" must be specified"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),i("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),i("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),i("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),i("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),i("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),i("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),i("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),i("ERR_SOCKET_CANNOT_SEND","Unable to send data"),i("ERR_SOCKET_CLOSED","Socket is closed"),i("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),i("ERR_STDERR_CLOSE","process.stderr cannot be closed"),i("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),i("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),i("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),i("ERR_TLS_DH_PARAM_SIZE",(function(t){return"DH parameter size "+t+" is less than 2048"})),i("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),i("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),i("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),i("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),i("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),i("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),i("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),i("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),i("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),i("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),i("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl")}));tr(si);var ai=er((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ENCODING_UTF8="utf8",e.assertEncoding=function(t){if(t&&!zr.Buffer.isEncoding(t))throw new si.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",t)},e.strToEncoding=function(t,r){return r&&r!==e.ENCODING_UTF8?"buffer"===r?new zr.Buffer(t):new zr.Buffer(t).toString(r):t}}));tr(ai);var fi=er((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=rr.constants.S_IFMT,n=rr.constants.S_IFDIR,i=rr.constants.S_IFREG,o=rr.constants.S_IFBLK,s=rr.constants.S_IFCHR,a=rr.constants.S_IFLNK,f=rr.constants.S_IFIFO,u=rr.constants.S_IFSOCK;t=function(){function t(){this.name="",this.mode=0}return t.build=function(e,r){var n=new t,i=e.getNode().mode;return n.name=ai.strToEncoding(e.getName(),r),n.mode=i,n},t.prototype._checkModeProperty=function(t){return(this.mode&r)===t},t.prototype.isDirectory=function(){return this._checkModeProperty(n)},t.prototype.isFile=function(){return this._checkModeProperty(i)},t.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},t.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},t.prototype.isSymbolicLink=function(){return this._checkModeProperty(a)},t.prototype.isFIFO=function(){return this._checkModeProperty(f)},t.prototype.isSocket=function(){return this._checkModeProperty(u)},t}(),e.Dirent=t,e.default=t}));function ui(t,e){for(var r=0,n=t.length-1;0<=n;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function hi(){for(var t="",e=!1,r=arguments.length-1;-1<=r&&!e;r--){var n=0<=r?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(t=n+"/"+t,e="/"===n.charAt(0))}return(e?"/":"")+(t=ui(di(t.split("/"),(function(t){return!!t})),!e).join("/"))||"."}function li(t,e){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=hi(t).substr(1),e=hi(e).substr(1),t=r(t.split("/")),e=r(e.split("/"));for(var n=Math.min(t.length,e.length),i=n,o=0;o<n;o++)if(t[o]!==e[o]){i=o;break}for(n=[],o=i;o<t.length;o++)n.push("..");return(n=n.concat(e.slice(i))).join("/")}tr(fi);var ci=li,pi=hi;function di(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}var _i=er((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),t="function"==typeof setImmediate?setImmediate.bind(Qe):setTimeout.bind(Qe),e.default=t}));tr(_i);var gi=er((function(t,e){function r(){var t=ln||{};return t.getuid||(t.getuid=function(){return 0}),t.getgid||(t.getgid=function(){return 0}),t.cwd||(t.cwd=function(){return"/"}),t.nextTick||(t.nextTick=_i.default),t.emitWarning||(t.emitWarning=function(t,e){console.warn(e+(e?": ":"")+t)}),t.env||(t.env={}),t}Object.defineProperty(e,"__esModule",{value:!0}),e.createProcess=r,e.default=r()}));function yi(){}function mi(){mi.init.call(this)}function Ei(t,e,r,n){var i;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if(i=t._events){i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events);var o=i[e]}else i=t._events=new yi,t._eventsCount=0;return o?("function"==typeof o?o=i[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),o.warned||(r=void 0===t._maxListeners?mi.defaultMaxListeners:t._maxListeners)&&0<r&&o.length>r&&(o.warned=!0,(r=Error("Possible EventEmitter memory leak detected. "+o.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",r.emitter=t,r.type=e,r.count=o.length,"function"==typeof console.warn?console.warn(r):console.log(r))):(i[e]=r,++t._eventsCount),t}function Si(t,e,r){function n(){t.removeListener(e,n),i||(i=!0,r.apply(t,arguments))}var i=!1;return n.listener=r,n}function Ii(t){var e=this._events;if(e){if("function"==typeof(t=e[t]))return 1;if(t)return t.length}return 0}function wi(t,e){for(var r=Array(e);e--;)r[e]=t[e];return r}tr(gi),yi.prototype=Object.create(null),mi.EventEmitter=mi,mi.usingDomains=!1,mi.prototype.domain=void 0,mi.prototype._events=void 0,mi.prototype._maxListeners=void 0,mi.defaultMaxListeners=10,mi.init=function(){this.domain=null,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new yi,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},mi.prototype.setMaxListeners=function(t){if("number"!=typeof t||0>t||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},mi.prototype.getMaxListeners=function(){return void 0===this._maxListeners?mi.defaultMaxListeners:this._maxListeners},mi.prototype.emit=function(t){var e,r,n="error"===t;if(e=this._events)n=n&&null==e.error;else if(!n)return!1;var i=this.domain;if(n){if(e=arguments[1],!i){if(e instanceof Error)throw e;throw(i=Error('Uncaught, unspecified "error" event. ('+e+")")).context=e,i}return e||(e=Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=i,e.domainThrown=!1,i.emit("error",e),!1}if(!(i=e[t]))return!1;e="function"==typeof i;var o=arguments.length;switch(o){case 1:if(e)i.call(this);else for(i=wi(i,e=i.length),n=0;n<e;++n)i[n].call(this);break;case 2:if(n=arguments[1],e)i.call(this,n);else for(i=wi(i,e=i.length),o=0;o<e;++o)i[o].call(this,n);break;case 3:if(n=arguments[1],o=arguments[2],e)i.call(this,n,o);else for(i=wi(i,e=i.length),r=0;r<e;++r)i[r].call(this,n,o);break;case 4:if(n=arguments[1],o=arguments[2],r=arguments[3],e)i.call(this,n,o,r);else{i=wi(i,e=i.length);for(var s=0;s<e;++s)i[s].call(this,n,o,r)}break;default:for(n=Array(o-1),r=1;r<o;r++)n[r-1]=arguments[r];if(e)i.apply(this,n);else for(i=wi(i,e=i.length),o=0;o<e;++o)i[o].apply(this,n)}return!0},mi.prototype.addListener=function(t,e){return Ei(this,t,e,!1)},mi.prototype.on=mi.prototype.addListener,mi.prototype.prependListener=function(t,e){return Ei(this,t,e,!0)},mi.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,Si(this,t,e)),this},mi.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,Si(this,t,e)),this},mi.prototype.removeListener=function(t,e){var r;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');var n=this._events;if(!n)return this;var i=n[t];if(!i)return this;if(i===e||i.listener&&i.listener===e)0==--this._eventsCount?this._events=new yi:(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){var o=-1;for(r=i.length;0<r--;)if(i[r]===e||i[r].listener&&i[r].listener===e){var s=i[r].listener;o=r;break}if(0>o)return this;if(1===i.length){if(i[0]=void 0,0==--this._eventsCount)return this._events=new yi,this;delete n[t]}else{r=o+1;for(var a=i.length;r<a;o+=1,r+=1)i[o]=i[r];i.pop()}n.removeListener&&this.emit("removeListener",t,s||e)}return this},mi.prototype.removeAllListeners=function(t){var e=this._events;if(!e)return this;if(!e.removeListener)return 0===arguments.length?(this._events=new yi,this._eventsCount=0):e[t]&&(0==--this._eventsCount?this._events=new yi:delete e[t]),this;if(0===arguments.length){e=Object.keys(e);for(var r,n=0;n<e.length;++n)"removeListener"!==(r=e[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new yi,this._eventsCount=0,this}if("function"==typeof(e=e[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},mi.prototype.listeners=function(t){var e=this._events;if(e)if(t=e[t])if("function"==typeof t)t=[t.listener||t];else{e=Array(t.length);for(var r=0;r<e.length;++r)e[r]=t[r].listener||t[r];t=e}else t=[];else t=[];return t},mi.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):Ii.call(t,e)},mi.prototype.listenerCount=Ii,mi.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]};var Ai=er((function(t,e){var r=Qe&&Qe.__extends||function(){function t(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)}return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=rr.constants.S_IFMT,i=rr.constants.S_IFDIR,o=rr.constants.S_IFREG,s=rr.constants.S_IFLNK,a=rr.constants.O_APPEND;e.SEP="/",t=function(t){function e(e,r){void 0===r&&(r=438);var n=t.call(this)||this;return n.uid=gi.default.getuid(),n.gid=gi.default.getgid(),n.atime=new Date,n.mtime=new Date,n.ctime=new Date,n.perm=438,n.mode=o,n.nlink=1,n.perm=r,n.mode|=r,n.ino=e,n}return r(e,t),e.prototype.getString=function(t){return void 0===t&&(t="utf8"),this.getBuffer().toString(t)},e.prototype.setString=function(t){this.buf=zr.bufferFrom(t,"utf8"),this.touch()},e.prototype.getBuffer=function(){return this.buf||this.setBuffer(zr.bufferAllocUnsafe(0)),zr.bufferFrom(this.buf)},e.prototype.setBuffer=function(t){this.buf=zr.bufferFrom(t),this.touch()},e.prototype.getSize=function(){return this.buf?this.buf.length:0},e.prototype.setModeProperty=function(t){this.mode=this.mode&~n|t},e.prototype.setIsFile=function(){this.setModeProperty(o)},e.prototype.setIsDirectory=function(){this.setModeProperty(i)},e.prototype.setIsSymlink=function(){this.setModeProperty(s)},e.prototype.isFile=function(){return(this.mode&n)===o},e.prototype.isDirectory=function(){return(this.mode&n)===i},e.prototype.isSymlink=function(){return(this.mode&n)===s},e.prototype.makeSymlink=function(t){this.symlink=t,this.setIsSymlink()},e.prototype.write=function(t,e,r,n){if(void 0===e&&(e=0),void 0===r&&(r=t.length),void 0===n&&(n=0),this.buf||(this.buf=zr.bufferAllocUnsafe(0)),n+r>this.buf.length){var i=zr.bufferAllocUnsafe(n+r);this.buf.copy(i,0,0,this.buf.length),this.buf=i}return t.copy(this.buf,n,e,e+r),this.touch(),r},e.prototype.read=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.byteLength),void 0===n&&(n=0),this.buf||(this.buf=zr.bufferAllocUnsafe(0)),r>t.byteLength&&(r=t.byteLength),r+n>this.buf.length&&(r=this.buf.length-n),this.buf.copy(t,e,n,n+r),r},e.prototype.truncate=function(t){if(void 0===t&&(t=0),t)if(this.buf||(this.buf=zr.bufferAllocUnsafe(0)),t<=this.buf.length)this.buf=this.buf.slice(0,t);else{var e=zr.bufferAllocUnsafe(0);this.buf.copy(e),e.fill(0,t)}else this.buf=zr.bufferAllocUnsafe(0);this.touch()},e.prototype.chmod=function(t){this.perm=t,this.mode=-512&this.mode|t,this.touch()},e.prototype.chown=function(t,e){this.uid=t,this.gid=e,this.touch()},e.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},e.prototype.canRead=function(t,e){return void 0===t&&(t=gi.default.getuid()),void 0===e&&(e=gi.default.getgid()),!!(4&this.perm||e===this.gid&&32&this.perm||t===this.uid&&256&this.perm)},e.prototype.canWrite=function(t,e){return void 0===t&&(t=gi.default.getuid()),void 0===e&&(e=gi.default.getgid()),!!(2&this.perm||e===this.gid&&16&this.perm||t===this.uid&&128&this.perm)},e.prototype.del=function(){this.emit("delete",this)},e.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},e}(mi.EventEmitter),e.Node=t,t=function(t){function n(e,r,n){var i=t.call(this)||this;return i.children={},i.steps=[],i.ino=0,i.length=0,i.vol=e,i.parent=r,i.steps=r?r.steps.concat([n]):[n],i}return r(n,t),n.prototype.setNode=function(t){this.node=t,this.ino=t.ino},n.prototype.getNode=function(){return this.node},n.prototype.createChild=function(t,e){void 0===e&&(e=this.vol.createNode());var r=new n(this.vol,this,t);return r.setNode(e),e.isDirectory(),this.setChild(t,r),r},n.prototype.setChild=function(t,e){return void 0===e&&(e=new n(this.vol,this,t)),this.children[t]=e,e.parent=this,this.length++,this.emit("child:add",e,this),e},n.prototype.deleteChild=function(t){delete this.children[t.getName()],this.length--,this.emit("child:delete",t,this)},n.prototype.getChild=function(t){if(Object.hasOwnProperty.call(this.children,t))return this.children[t]},n.prototype.getPath=function(){return this.steps.join(e.SEP)},n.prototype.getName=function(){return this.steps[this.steps.length-1]},n.prototype.walk=function(t,e,r){if(void 0===e&&(e=t.length),void 0===r&&(r=0),r>=t.length||r>=e)return this;var n=this.getChild(t[r]);return n?n.walk(t,e,r+1):null},n.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},n}(mi.EventEmitter),e.Link=t,t=function(){function t(t,e,r,n){this.position=0,this.link=t,this.node=e,this.flags=r,this.fd=n}return t.prototype.getString=function(){return this.node.getString()},t.prototype.setString=function(t){this.node.setString(t)},t.prototype.getBuffer=function(){return this.node.getBuffer()},t.prototype.setBuffer=function(t){this.node.setBuffer(t)},t.prototype.getSize=function(){return this.node.getSize()},t.prototype.truncate=function(t){this.node.truncate(t)},t.prototype.seekTo=function(t){this.position=t},t.prototype.stats=function(){return ir.default.build(this.node)},t.prototype.write=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.length),"number"!=typeof n&&(n=this.position),this.flags&a&&(n=this.getSize()),t=this.node.write(t,e,r,n),this.position=n+t,t},t.prototype.read=function(t,e,r,n){return void 0===e&&(e=0),void 0===r&&(r=t.byteLength),"number"!=typeof n&&(n=this.position),t=this.node.read(t,e,r,n),this.position=n+t,t},t.prototype.chmod=function(t){this.node.chmod(t)},t.prototype.chown=function(t,e){this.node.chown(t,e)},t}(),e.File=t}));tr(Ai);var vi=Ai.Node,Ti=er((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){var n=setTimeout.apply(null,arguments);return n&&"object"==typeof n&&"function"==typeof n.unref&&n.unref(),n}}));function bi(){this.tail=this.head=null,this.length=0}tr(Ti),bi.prototype.push=function(t){t={data:t,next:null},0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length},bi.prototype.unshift=function(t){t={data:t,next:this.head},0===this.length&&(this.tail=t),this.head=t,++this.length},bi.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,t}},bi.prototype.clear=function(){this.head=this.tail=null,this.length=0},bi.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},bi.prototype.concat=function(t){if(0===this.length)return Er.alloc(0);if(1===this.length)return this.head.data;t=Er.allocUnsafe(t>>>0);for(var e=this.head,r=0;e;)e.data.copy(t,r),r+=e.data.length,e=e.next;return t};var Ri=Er.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Oi(t){if(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),t&&!Ri(t))throw Error("Unknown encoding: "+t);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Ci;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=Li;break;default:return void(this.write=Ni)}this.charBuffer=new Er(6),this.charLength=this.charReceived=0}function Ni(t){return t.toString(this.encoding)}function Ci(t){this.charLength=(this.charReceived=t.length%2)?2:0}function Li(t){this.charLength=(this.charReceived=t.length%3)?3:0}Oi.prototype.write=function(t){for(var e="";this.charLength;){if(e=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length,t.copy(this.charBuffer,this.charReceived,0,e),this.charReceived+=e,this.charReceived<this.charLength)return"";t=t.slice(e,t.length);var r=(e=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(e.length-1);if(!(55296<=r&&56319>=r)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;return this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),n=(e+=t.toString(this.encoding,0,n)).length-1,55296<=(r=e.charCodeAt(n))&&56319>=r?(r=this.surrogateSize,this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),t.copy(this.charBuffer,0,0,r),e.substring(0,n)):e},Oi.prototype.detectIncompleteChar=function(t){for(var e=3<=t.length?3:t.length;0<e;e--){var r=t[t.length-e];if(1==e&&6==r>>5){this.charLength=2;break}if(2>=e&&14==r>>4){this.charLength=3;break}if(3>=e&&30==r>>3){this.charLength=4;break}}this.charReceived=e},Oi.prototype.end=function(t){var e="";return t&&t.length&&(e=this.write(t)),this.charReceived&&(t=this.encoding,e+=this.charBuffer.slice(0,this.charReceived).toString(t)),e},Bi.ReadableState=Wi;var Pi=mn("stream");function Wi(t,e){t=t||{},this.objectMode=!!t.objectMode,e instanceof so&&(this.objectMode=this.objectMode||!!t.readableObjectMode),e=t.highWaterMark;var r=this.objectMode?16:16384;this.highWaterMark=e||0===e?e:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new bi,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.reading=this.endEmitted=this.ended=!1,this.sync=!0,this.resumeScheduled=this.readableListening=this.emittedReadable=this.needReadable=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.encoding=this.decoder=null,t.encoding&&(this.decoder=new Oi(t.encoding),this.encoding=t.encoding)}function Bi(t){if(!(this instanceof Bi))return new Bi(t);this._readableState=new Wi(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),mi.call(this)}function Fi(t,e,r,n,i){var o=r,s=null;if(Yr(o)||"string"==typeof o||null==o||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),o=s)t.emit("error",o);else if(null===r)e.reading=!1,e.ended||(e.decoder&&(r=e.decoder.end())&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length),e.ended=!0,ki(t));else if(e.objectMode||r&&0<r.length)if(e.ended&&!i)t.emit("error",Error("stream.push() after EOF"));else if(e.endEmitted&&i)t.emit("error",Error("stream.unshift() after end event"));else{if(e.decoder&&!i&&!n){r=e.decoder.write(r);var a=!e.objectMode&&0===r.length}i||(e.reading=!1),a||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&ki(t))),e.readingMore||(e.readingMore=!0,on(Mi,t,e))}else i||(e.reading=!1);return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function Di(t,e){if(0>=t||0===e.length&&e.ended)return 0;if(e.objectMode)return 1;if(t!=t)return e.flowing&&e.length?e.buffer.head.data.length:e.length;if(t>e.highWaterMark){var r=t;8388608<=r?r=8388608:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),e.highWaterMark=r}return t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0)}function ki(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(Pi("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?on(Ui,t):Ui(t))}function Ui(t){Pi("emit readable"),t.emit("readable"),Hi(t)}function Mi(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(Pi("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function xi(t){Pi("readable nexttick read 0"),t.read(0)}function Gi(t,e){e.reading||(Pi("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),Hi(t),e.flowing&&!e.reading&&t.read(0)}function Hi(t){var e=t._readableState;for(Pi("flow",e.flowing);e.flowing&&null!==t.read(););}function Yi(t,e){if(0===e.length)return null;if(e.objectMode)var r=e.buffer.shift();else if(!t||t>=e.length)r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear();else{if(r=e.buffer,e=e.decoder,t<r.head.data.length)e=r.head.data.slice(0,t),r.head.data=r.head.data.slice(t);else{if(t===r.head.data.length)r=r.shift();else if(e){var n=1,i=(e=r.head).data;for(t-=i.length;e=e.next;){var o=e.data,s=t>o.length?o.length:t;if(i=s===o.length?i+o:i+o.slice(0,t),0==(t-=s)){s===o.length?(++n,r.head=e.next?e.next:r.tail=null):(r.head=e,e.data=o.slice(s));break}++n}r.length-=n,r=i}else{for(e=Er.allocUnsafe(t),i=1,(n=r.head).data.copy(e),t-=n.data.length;n=n.next;){if(s=t>(o=n.data).length?o.length:t,o.copy(e,e.length-t,0,s),0==(t-=s)){s===o.length?(++i,r.head=n.next?n.next:r.tail=null):(r.head=n,n.data=o.slice(s));break}++i}r.length-=i,r=e}e=r}r=e}return r}function ji(t){var e=t._readableState;if(0<e.length)throw Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,on(Vi,e,t))}function Vi(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function zi(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function Ki(){}function qi(t,e,r){this.chunk=t,this.encoding=e,this.callback=r,this.next=null}function Zi(t,e){Object.defineProperty(this,"buffer",{get:_n((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),t=t||{},this.objectMode=!!t.objectMode,e instanceof so&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.finished=this.ended=this.ending=this.needDrain=!1,this.decodeStrings=!1!==t.decodeStrings,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){var r=e._writableState,n=r.sync,i=r.writecb;r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(--r.pendingcb,n?on(i,t):i(t),e._writableState.errorEmitted=!0,e.emit("error",t)):((t=to(r))||r.corked||r.bufferProcessing||!r.bufferedRequest||Qi(e,r),n?on($i,e,r,t,i):$i(e,r,t,i))},this.writecb=null,this.writelen=0,this.lastBufferedRequest=this.bufferedRequest=null,this.pendingcb=0,this.errorEmitted=this.prefinished=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new ro(this)}function Xi(t){if(!(this instanceof Xi||this instanceof so))return new Xi(t);this._writableState=new Zi(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),mi.call(this)}function Ji(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function $i(t,e,r,n){!r&&0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain")),e.pendingcb--,n(),eo(t,e)}function Qi(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=Array(e.bufferedRequestCount),i=e.corkedRequestsFree;i.entry=r;for(var o=0;r;)n[o]=r,r=r.next,o+=1;Ji(t,e,!0,e.length,n,"",i.finish),e.pendingcb++,e.lastBufferedRequest=null,i.next?(e.corkedRequestsFree=i.next,i.next=null):e.corkedRequestsFree=new ro(e)}else{for(;r&&(n=r.chunk,Ji(t,e,!1,e.objectMode?1:n.length,n,r.encoding,r.callback),r=r.next,!e.writing););null===r&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=r,e.bufferProcessing=!1}function to(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function eo(t,e){var r=to(e);return r&&(0===e.pendingcb?(e.prefinished||(e.prefinished=!0,t.emit("prefinish")),e.finished=!0,t.emit("finish")):e.prefinished||(e.prefinished=!0,t.emit("prefinish"))),r}function ro(t){var e=this;this.entry=this.next=null,this.finish=function(r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}cn(Bi,mi),Bi.prototype.push=function(t,e){var r=this._readableState;return r.objectMode||"string"!=typeof t||(e=e||r.defaultEncoding)!==r.encoding&&(t=Er.from(t,e),e=""),Fi(this,r,t,e,!1)},Bi.prototype.unshift=function(t){return Fi(this,this._readableState,t,"",!0)},Bi.prototype.isPaused=function(){return!1===this._readableState.flowing},Bi.prototype.setEncoding=function(t){return this._readableState.decoder=new Oi(t),this._readableState.encoding=t,this},Bi.prototype.read=function(t){Pi("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return Pi("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?ji(this):ki(this),null;if(0===(t=Di(t,e))&&e.ended)return 0===e.length&&ji(this),null;var n=e.needReadable;return Pi("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&Pi("length less than watermark",n=!0),e.ended||e.reading?Pi("reading or ended",!1):n&&(Pi("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Di(r,e))),null===(n=0<t?Yi(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&ji(this)),null!==n&&this.emit("data",n),n},Bi.prototype._read=function(){this.emit("error",Error("not implemented"))},Bi.prototype.pipe=function(t,e){function r(t){Pi("onunpipe"),t===h&&i()}function n(){Pi("onend"),t.end()}function i(){Pi("cleanup"),t.removeListener("close",a),t.removeListener("finish",f),t.removeListener("drain",c),t.removeListener("error",s),t.removeListener("unpipe",r),h.removeListener("end",n),h.removeListener("end",i),h.removeListener("data",o),p=!0,!l.awaitDrain||t._writableState&&!t._writableState.needDrain||c()}function o(e){Pi("ondata"),d=!1,!1!==t.write(e)||d||((1===l.pipesCount&&l.pipes===t||1<l.pipesCount&&-1!==zi(l.pipes,t))&&!p&&(Pi("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,d=!0),h.pause())}function s(e){Pi("onerror",e),u(),t.removeListener("error",s),0===t.listeners("error").length&&t.emit("error",e)}function a(){t.removeListener("finish",f),u()}function f(){Pi("onfinish"),t.removeListener("close",a),u()}function u(){Pi("unpipe"),h.unpipe(t)}var h=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=t;break;case 1:l.pipes=[l.pipes,t];break;default:l.pipes.push(t)}l.pipesCount+=1,Pi("pipe count=%d opts=%j",l.pipesCount,e),e=e&&!1===e.end?i:n,l.endEmitted?on(e):h.once("end",e),t.on("unpipe",r);var c=function(t){return function(){var e=t._readableState;Pi("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&t.listeners("data").length&&(e.flowing=!0,Hi(t))}}(h);t.on("drain",c);var p=!1,d=!1;return h.on("data",o),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",s),t.once("close",a),t.once("finish",f),t.emit("pipe",h),l.flowing||(Pi("pipe resume"),h.resume()),t},Bi.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this)),this;if(!t){t=e.pipes;var r=e.pipesCount;for(e.pipes=null,e.pipesCount=0,e.flowing=!1,e=0;e<r;e++)t[e].emit("unpipe",this);return this}return-1===(r=zi(e.pipes,t))||(e.pipes.splice(r,1),--e.pipesCount,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this)),this},Bi.prototype.on=function(t,e){return e=mi.prototype.on.call(this,t,e),"data"===t?!1!==this._readableState.flowing&&this.resume():"readable"===t&&((t=this._readableState).endEmitted||t.readableListening||(t.readableListening=t.needReadable=!0,t.emittedReadable=!1,t.reading?t.length&&ki(this):on(xi,this))),e},Bi.prototype.addListener=Bi.prototype.on,Bi.prototype.resume=function(){var t=this._readableState;return t.flowing||(Pi("resume"),t.flowing=!0,t.resumeScheduled||(t.resumeScheduled=!0,on(Gi,this,t))),this},Bi.prototype.pause=function(){return Pi("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(Pi("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Bi.prototype.wrap=function(t){var e=this._readableState,r=!1,n=this;for(var i in t.on("end",(function(){if(Pi("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&n.push(t)}n.push(null)})),t.on("data",(function(i){Pi("wrapped data"),e.decoder&&(i=e.decoder.write(i)),e.objectMode&&null==i||!(e.objectMode||i&&i.length)||n.push(i)||(r=!0,t.pause())})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));return function(t,e){for(var r=0,n=t.length;r<n;r++)e(t[r])}(["error","close","destroy","pause","resume"],(function(e){t.on(e,n.emit.bind(n,e))})),n._read=function(e){Pi("wrapped _read",e),r&&(r=!1,t.resume())},n},Bi._fromList=Yi,Xi.WritableState=Zi,cn(Xi,mi),Zi.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},Xi.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))},Xi.prototype.write=function(t,e,r){var n=this._writableState,i=!1;if("function"==typeof e&&(r=e,e=null),Er.isBuffer(t)?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=Ki),n.ended)n=r,t=Error("write after end"),this.emit("error",t),on(n,t);else{var o=r,s=!0,a=!1;null===t?a=new TypeError("May not write null values to stream"):Er.isBuffer(t)||"string"==typeof t||void 0===t||n.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(this.emit("error",a),on(o,a),s=!1),s&&(n.pendingcb++,i=e,n.objectMode||!1===n.decodeStrings||"string"!=typeof t||(t=Er.from(t,i)),Er.isBuffer(t)&&(i="buffer"),o=n.objectMode?1:t.length,n.length+=o,(e=n.length<n.highWaterMark)||(n.needDrain=!0),n.writing||n.corked?(o=n.lastBufferedRequest,n.lastBufferedRequest=new qi(t,i,r),o?o.next=n.lastBufferedRequest:n.bufferedRequest=n.lastBufferedRequest,n.bufferedRequestCount+=1):Ji(this,n,!1,o,t,i,r),i=e)}return i},Xi.prototype.cork=function(){this._writableState.corked++},Xi.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||Qi(this,t))},Xi.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(-1<"hex utf8 utf-8 ascii binary base64 ucs2 ucs-2 utf16le utf-16le raw".split(" ").indexOf((t+"").toLowerCase())))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Xi.prototype._write=function(t,e,r){r(Error("not implemented"))},Xi.prototype._writev=null,Xi.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,e=t=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||(t=r,n.ending=!0,eo(this,n),t&&(n.finished?on(t):this.once("finish",t)),n.ended=!0,this.writable=!1)},cn(so,Bi);for(var no=Object.keys(Xi.prototype),io=0;io<no.length;io++){var oo=no[io];so.prototype[oo]||(so.prototype[oo]=Xi.prototype[oo])}function so(t){if(!(this instanceof so))return new so(t);Bi.call(this,t),Xi.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",ao)}function ao(){this.allowHalfOpen||this._writableState.ended||on(fo,this)}function fo(t){t.end()}function uo(t){this.afterTransform=function(e,r){var n=t._transformState;n.transforming=!1;var i=n.writecb;return i?(n.writechunk=null,n.writecb=null,null!=r&&t.push(r),i(e),(e=t._readableState).reading=!1,(e.needReadable||e.length<e.highWaterMark)&&t._read(e.highWaterMark),e=void 0):e=t.emit("error",Error("no writecb in Transform class")),e},this.transforming=this.needTransform=!1,this.writeencoding=this.writechunk=this.writecb=null}function ho(t){if(!(this instanceof ho))return new ho(t);so.call(this,t),this._transformState=new uo(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(t){lo(e,t)})):lo(e)}))}function lo(t,e){if(e)return t.emit("error",e);if(e=t._transformState,t._writableState.length)throw Error("Calling transform done when ws.length != 0");if(e.transforming)throw Error("Calling transform done when still transforming");return t.push(null)}function co(t){if(!(this instanceof co))return new co(t);ho.call(this,t)}function po(){mi.call(this)}cn(ho,so),ho.prototype.push=function(t,e){return this._transformState.needTransform=!1,so.prototype.push.call(this,t,e)},ho.prototype._transform=function(){throw Error("Not implemented")},ho.prototype._write=function(t,e,r){var n=this._transformState;n.writecb=r,n.writechunk=t,n.writeencoding=e,n.transforming||(t=this._readableState,(n.needTransform||t.needReadable||t.length<t.highWaterMark)&&this._read(t.highWaterMark))},ho.prototype._read=function(){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},cn(co,ho),co.prototype._transform=function(t,e,r){r(null,t)},cn(po,mi),po.Readable=Bi,po.Writable=Xi,po.Duplex=so,po.Transform=ho,po.PassThrough=co,po.Stream=po,po.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&f.pause&&f.pause()}function n(){f.readable&&f.resume&&f.resume()}function i(){u||(u=!0,t.end())}function o(){u||(u=!0,"function"==typeof t.destroy&&t.destroy())}function s(t){if(a(),0===mi.listenerCount(this,"error"))throw t}function a(){f.removeListener("data",r),t.removeListener("drain",n),f.removeListener("end",i),f.removeListener("close",o),f.removeListener("error",s),t.removeListener("error",s),f.removeListener("end",a),f.removeListener("close",a),t.removeListener("close",a)}var f=this;f.on("data",r),t.on("drain",n),t._isStdio||e&&!1===e.end||(f.on("end",i),f.on("close",o));var u=!1;return f.on("error",s),t.on("error",s),f.on("end",a),f.on("close",a),t.on("close",a),t.emit("pipe",f),t};var _o=Array.prototype.slice,go=function t(e,r){for(var n in r)e[n]=r[n];return 3>arguments.length?e:t.apply(null,[e].concat(_o.call(arguments,2)))},yo=er((function(t,e){function r(t,e,r){return void 0===r&&(r=function(t){return t}),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return new Promise((function(o,s){t[e].bind(t).apply(void 0,n(i,[function(t,e){return t?s(t):o(r(e))}]))}))}}var n=Qe&&Qe.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;t=Array(t);var n=0;for(e=0;e<r;e++)for(var i=arguments[e],o=0,s=i.length;o<s;o++,n++)t[n]=i[o];return t};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){this.vol=t,this.fd=e}return t.prototype.appendFile=function(t,e){return r(this.vol,"appendFile")(this.fd,t,e)},t.prototype.chmod=function(t){return r(this.vol,"fchmod")(this.fd,t)},t.prototype.chown=function(t,e){return r(this.vol,"fchown")(this.fd,t,e)},t.prototype.close=function(){return r(this.vol,"close")(this.fd)},t.prototype.datasync=function(){return r(this.vol,"fdatasync")(this.fd)},t.prototype.read=function(t,e,n,i){return r(this.vol,"read",(function(e){return{bytesRead:e,buffer:t}}))(this.fd,t,e,n,i)},t.prototype.readFile=function(t){return r(this.vol,"readFile")(this.fd,t)},t.prototype.stat=function(t){return r(this.vol,"fstat")(this.fd,t)},t.prototype.sync=function(){return r(this.vol,"fsync")(this.fd)},t.prototype.truncate=function(t){return r(this.vol,"ftruncate")(this.fd,t)},t.prototype.utimes=function(t,e){return r(this.vol,"futimes")(this.fd,t,e)},t.prototype.write=function(t,e,n,i){return r(this.vol,"write",(function(e){return{bytesWritten:e,buffer:t}}))(this.fd,t,e,n,i)},t.prototype.writeFile=function(t,e){return r(this.vol,"writeFile")(this.fd,t,e)},t}();e.FileHandle=i,e.default=function(t){return"undefined"==typeof Promise?null:{FileHandle:i,access:function(e,n){return r(t,"access")(e,n)},appendFile:function(e,n,o){return r(t,"appendFile")(e instanceof i?e.fd:e,n,o)},chmod:function(e,n){return r(t,"chmod")(e,n)},chown:function(e,n,i){return r(t,"chown")(e,n,i)},copyFile:function(e,n,i){return r(t,"copyFile")(e,n,i)},lchmod:function(e,n){return r(t,"lchmod")(e,n)},lchown:function(e,n,i){return r(t,"lchown")(e,n,i)},link:function(e,n){return r(t,"link")(e,n)},lstat:function(e,n){return r(t,"lstat")(e,n)},mkdir:function(e,n){return r(t,"mkdir")(e,n)},mkdtemp:function(e,n){return r(t,"mkdtemp")(e,n)},open:function(e,n,o){return r(t,"open",(function(e){return new i(t,e)}))(e,n,o)},readdir:function(e,n){return r(t,"readdir")(e,n)},readFile:function(e,n){return r(t,"readFile")(e instanceof i?e.fd:e,n)},readlink:function(e,n){return r(t,"readlink")(e,n)},realpath:function(e,n){return r(t,"realpath")(e,n)},rename:function(e,n){return r(t,"rename")(e,n)},rmdir:function(e){return r(t,"rmdir")(e)},stat:function(e,n){return r(t,"stat")(e,n)},symlink:function(e,n,i){return r(t,"symlink")(e,n,i)},truncate:function(e,n){return r(t,"truncate")(e,n)},unlink:function(e){return r(t,"unlink")(e)},utimes:function(e,n,i){return r(t,"utimes")(e,n,i)},writeFile:function(e,n,o){return r(t,"writeFile")(e instanceof i?e.fd:e,n,o)}}}}));tr(yo);var mo=/[^\x20-\x7E]/,Eo=/[\x2E\u3002\uFF0E\uFF61]/g,So="Overflow: input needs wider integers to process",Io=Math.floor,wo=String.fromCharCode;function Ao(t,e){return t+22+75*(26>t)-((0!=e)<<5)}var vo=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function To(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}function bo(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var Ro=Object.keys||function(t){var e,r=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.push(e);return r};function Oo(t,e,r,n){r=r||"=";var i={};if("string"!=typeof t||0===t.length)return i;var o=/\+/g;for(t=t.split(e||"&"),e=1e3,n&&"number"==typeof n.maxKeys&&(e=n.maxKeys),n=t.length,0<e&&n>e&&(n=e),e=0;e<n;++e){var s=t[e].replace(o,"%20"),a=s.indexOf(r);if(0<=a){var f=s.substr(0,a);s=s.substr(a+1)}else f=s,s="";f=decodeURIComponent(f),s=decodeURIComponent(s),Object.prototype.hasOwnProperty.call(i,f)?vo(i[f])?i[f].push(s):i[f]=[i[f],s]:i[f]=s}return i}var No={parse:Yo,resolve:function(t,e){return Yo(t,!1,!0).resolve(e)},resolveObject:function(t,e){return t?Yo(t,!1,!0).resolveObject(e):e},format:function(t){return On(t)&&(t=jo({},t)),Vo(t)},Url:Co};function Co(){this.href=this.path=this.pathname=this.query=this.search=this.hash=this.hostname=this.port=this.host=this.auth=this.slashes=this.protocol=null}var Lo=/^([a-z0-9.+-]+:)/i,Po=/:[0-9]*$/,Wo=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Bo="{}|\\^`".split("").concat('<>"` \r\n\t'.split("")),Fo=["'"].concat(Bo),Do=["%","/","?",";","#"].concat(Fo),ko=["/","?","#"],Uo=/^[+a-z0-9A-Z_-]{0,63}$/,Mo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,xo={javascript:!0,"javascript:":!0},Go={javascript:!0,"javascript:":!0},Ho={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Yo(t,e,r){if(t&&Ln(t)&&t instanceof Co)return t;var n=new Co;return n.parse(t,e,r),n}function jo(t,e,r,n){if(!On(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?");if(i=-1!==i&&i<e.indexOf("#")?"?":"#",(e=e.split(i))[0]=e[0].replace(/\\/g,"/"),i=(e=e.join(i)).trim(),!n&&1===e.split("#").length&&(e=Wo.exec(i)))return t.path=i,t.href=i,t.pathname=e[1],e[2]?(t.search=e[2],t.query=r?Oo(t.search.substr(1)):t.search.substr(1)):r&&(t.search="",t.query={}),t;if(e=Lo.exec(i)){var o=(e=e[0]).toLowerCase();t.protocol=o,i=i.substr(e.length)}if(n||e||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===i.substr(0,2);!s||e&&Go[e]||(i=i.substr(2),t.slashes=!0)}if(!Go[e]&&(s||e&&!Ho[e])){for(e=-1,n=0;n<ko.length;n++)-1!==(s=i.indexOf(ko[n]))&&(-1===e||s<e)&&(e=s);for(-1!==(s=-1===e?i.lastIndexOf("@"):i.lastIndexOf("@",e))&&(n=i.slice(0,s),i=i.slice(s+1),t.auth=decodeURIComponent(n)),e=-1,n=0;n<Do.length;n++)-1!==(s=i.indexOf(Do[n]))&&(-1===e||s<e)&&(e=s);if(-1===e&&(e=i.length),t.host=i.slice(0,e),i=i.slice(e),zo(t),t.hostname=t.hostname||"",!(s="["===t.hostname[0]&&"]"===t.hostname[t.hostname.length-1])){var a=t.hostname.split(/\./);for(n=0,e=a.length;n<e;n++){var f=a[n];if(f&&!f.match(Uo)){for(var u="",h=0,l=f.length;h<l;h++)u=127<f.charCodeAt(h)?u+"x":u+f[h];if(!u.match(Uo)){e=a.slice(0,n),n=a.slice(n+1),(f=f.match(Mo))&&(e.push(f[1]),n.unshift(f[2])),n.length&&(i="/"+n.join(".")+i),t.hostname=e.join(".");break}}}}t.hostname=t.hostname.length>255?"":t.hostname.toLowerCase(),s||(t.hostname=function(t){return function(t,e){var r=t.split("@"),n="";1<r.length&&(n=r[0]+"@",t=r[1]),r=(t=(t=t.replace(Eo,".")).split(".")).length;for(var i=[];r--;)i[r]=e(t[r]);return n+i.join(".")}(t,(function(t){if(mo.test(t)){var e,r=[],n=[],i=0;for(e=t.length;i<e;){var o=t.charCodeAt(i++);if(55296<=o&&56319>=o&&i<e){var s=t.charCodeAt(i++);56320==(64512&s)?n.push(((1023&o)<<10)+(1023&s)+65536):(n.push(o),i--)}else n.push(o)}s=(t=n).length,n=128;var a=0,f=72;for(o=0;o<s;++o){var u=t[o];128>u&&r.push(wo(u))}for((i=e=r.length)&&r.push("-");i<s;){var h=2147483647;for(o=0;o<s;++o)(u=t[o])>=n&&u<h&&(h=u);var l=i+1;if(h-n>Io((2147483647-a)/l))throw new RangeError(So);for(a+=(h-n)*l,n=h,o=0;o<s;++o){if((u=t[o])<n&&2147483647<++a)throw new RangeError(So);if(u==n){var c=a;for(h=36;!(c<(u=h<=f?1:h>=f+26?26:h-f));h+=36){var p=c-u;c=36-u,r.push(wo(Ao(u+p%c,0))),c=Io(p/c)}for(r.push(wo(Ao(c,0))),f=l,h=0,a=i==e?Io(a/700):a>>1,a+=Io(a/f);455<a;h+=36)a=Io(a/35);f=Io(h+36*a/(a+38)),a=0,++i}}++a,++n}r="xn--"+r.join("")}else r=t;return r}))}(t.hostname)),n=t.port?":"+t.port:"",t.host=(t.hostname||"")+n,t.href+=t.host,s&&(t.hostname=t.hostname.substr(1,t.hostname.length-2),"/"!==i[0]&&(i="/"+i))}if(!xo[o])for(n=0,e=Fo.length;n<e;n++)s=Fo[n],-1!==i.indexOf(s)&&((f=encodeURIComponent(s))===s&&(f=escape(s)),i=i.split(s).join(f));return-1!==(n=i.indexOf("#"))&&(t.hash=i.substr(n),i=i.slice(0,n)),-1!==(n=i.indexOf("?"))?(t.search=i.substr(n),t.query=i.substr(n+1),r&&(t.query=Oo(t.query)),i=i.slice(0,n)):r&&(t.search="",t.query={}),i&&(t.pathname=i),Ho[o]&&t.hostname&&!t.pathname&&(t.pathname="/"),(t.pathname||t.search)&&(n=t.pathname||"",t.path=n+(t.search||"")),t.href=Vo(t),t}function Vo(t){var e=t.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var r=t.protocol||"",n=t.pathname||"",i=t.hash||"",o=!1,s="";return t.host?o=e+t.host:t.hostname&&(o=e+(-1===t.hostname.indexOf(":")?t.hostname:"["+this.hostname+"]"),t.port&&(o+=":"+t.port)),t.query&&Ln(t.query)&&Object.keys(t.query).length&&(s=function(t,e,r,n){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?bo(Ro(t),(function(n){var i=encodeURIComponent(To(n))+r;return vo(t[n])?bo(t[n],(function(t){return i+encodeURIComponent(To(t))})).join(e):i+encodeURIComponent(To(t[n]))})).join(e):""}(t.query)),e=t.search||s&&"?"+s||"",r&&":"!==r.substr(-1)&&(r+=":"),t.slashes||(!r||Ho[r])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),e&&"?"!==e.charAt(0)&&(e="?"+e),n=n.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})),r+o+n+(e=e.replace("#","%23"))+i}function zo(t){var e=t.host,r=Po.exec(e);r&&(":"!==(r=r[0])&&(t.port=r.substr(1)),e=e.substr(0,e.length-r.length)),e&&(t.hostname=e)}Co.prototype.parse=function(t,e,r){return jo(this,t,e,r)},Co.prototype.format=function(){return Vo(this)},Co.prototype.resolve=function(t){return this.resolveObject(Yo(t,!1,!0)).format()},Co.prototype.resolveObject=function(t){if(On(t)){var e=new Co;e.parse(t,!1,!0),t=e}e=new Co;for(var r=Object.keys(this),n=0;n<r.length;n++){var i=r[n];e[i]=this[i]}if(e.hash=t.hash,""===t.href)return e.href=e.format(),e;if(t.slashes&&!t.protocol){for(r=Object.keys(t),n=0;n<r.length;n++)"protocol"!==(i=r[n])&&(e[i]=t[i]);return Ho[e.protocol]&&e.hostname&&!e.pathname&&(e.path=e.pathname="/"),e.href=e.format(),e}var o;if(t.protocol&&t.protocol!==e.protocol){if(!Ho[t.protocol]){for(r=Object.keys(t),n=0;n<r.length;n++)e[i=r[n]]=t[i];return e.href=e.format(),e}if(e.protocol=t.protocol,t.host||Go[t.protocol])e.pathname=t.pathname;else{for(o=(t.pathname||"").split("/");o.length&&!(t.host=o.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==o[0]&&o.unshift(""),2>o.length&&o.unshift(""),e.pathname=o.join("/")}return e.search=t.search,e.query=t.query,e.host=t.host||"",e.auth=t.auth,e.hostname=t.hostname||t.host,e.port=t.port,(e.pathname||e.search)&&(e.path=(e.pathname||"")+(e.search||"")),e.slashes=e.slashes||t.slashes,e.href=e.format(),e}r=e.pathname&&"/"===e.pathname.charAt(0);var s=t.host||t.pathname&&"/"===t.pathname.charAt(0),a=r=s||r||e.host&&t.pathname;if(n=e.pathname&&e.pathname.split("/")||[],i=e.protocol&&!Ho[e.protocol],o=t.pathname&&t.pathname.split("/")||[],i&&(e.hostname="",e.port=null,e.host&&(""===n[0]?n[0]=e.host:n.unshift(e.host)),e.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===o[0]?o[0]=t.host:o.unshift(t.host)),t.host=null),r=r&&(""===o[0]||""===n[0])),s)e.host=t.host||""===t.host?t.host:e.host,e.hostname=t.hostname||""===t.hostname?t.hostname:e.hostname,e.search=t.search,e.query=t.query,n=o;else if(o.length)n||(n=[]),n.pop(),n=n.concat(o),e.search=t.search,e.query=t.query;else if(null!=t.search)return i&&(e.hostname=e.host=n.shift(),i=!!(e.host&&0<e.host.indexOf("@"))&&e.host.split("@"))&&(e.auth=i.shift(),e.host=e.hostname=i.shift()),e.search=t.search,e.query=t.query,null===e.pathname&&null===e.search||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e;if(!n.length)return e.pathname=null,e.path=e.search?"/"+e.search:null,e.href=e.format(),e;s=n.slice(-1)[0],o=(e.host||t.host||1<n.length)&&("."===s||".."===s)||""===s;for(var f=0,u=n.length;0<=u;u--)"."===(s=n[u])?n.splice(u,1):".."===s?(n.splice(u,1),f++):f&&(n.splice(u,1),f--);if(!r&&!a)for(;f--;f)n.unshift("..");return!r||""===n[0]||n[0]&&"/"===n[0].charAt(0)||n.unshift(""),o&&"/"!==n.join("/").substr(-1)&&n.push(""),a=""===n[0]||n[0]&&"/"===n[0].charAt(0),i&&(e.hostname=e.host=a?"":n.length?n.shift():"",i=!!(e.host&&0<e.host.indexOf("@"))&&e.host.split("@"))&&(e.auth=i.shift(),e.host=e.hostname=i.shift()),(r=r||e.host&&n.length)&&!a&&n.unshift(""),n.length?e.pathname=n.join("/"):(e.pathname=null,e.path=null),null===e.pathname&&null===e.search||(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=t.auth||e.auth,e.slashes=e.slashes||t.slashes,e.href=e.format(),e},Co.prototype.parseHost=function(){return zo(this)};var Ko=er((function(t,e){function r(t,e){return t=t[e],0<e&&("/"===t||i&&"\\"===t)}function n(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if(i){var n=t;if("string"!=typeof n)throw new TypeError("expected a string");if(n=n.replace(/[\\\/]+/g,"/"),!1!==e)if(2>(n=(e=n).length-1))n=e;else{for(;r(e,n);)n--;n=e.substr(0,n+1)}return n.replace(/^([a-zA-Z]+:|\.\/)/,"")}return t}Object.defineProperty(e,"__esModule",{value:!0}),e.unixify=n,e.correctPath=function(t){return n(t.replace(/^\\\\\?\\.:\\/,"\\"))};var i="win32"===ln.platform}));tr(Ko);var qo=er((function(t,e){function r(t,e){return void 0===e&&(e=gi.default.cwd()),L(e,t)}function n(t,e){return"function"==typeof t?[i(),t]:[i(t),h(e)]}function i(t){return void 0===t&&(t={}),C({},ft,t)}function o(t){return C({},it,"number"==typeof t?{mode:t}:t)}function s(t,e,r,n,i){return void 0===e&&(e=""),void 0===r&&(r=""),void 0===n&&(n=""),void 0===i&&(i=Error),e=new i(function(t,e,r,n){void 0===e&&(e=""),void 0===r&&(r=""),void 0===n&&(n="");var i="";switch(r&&(i=" '"+r+"'"),n&&(i+=" -> '"+n+"'"),t){case"ENOENT":return"ENOENT: no such file or directory, "+e+i;case"EBADF":return"EBADF: bad file descriptor, "+e+i;case"EINVAL":return"EINVAL: invalid argument, "+e+i;case"EPERM":return"EPERM: operation not permitted, "+e+i;case"EPROTO":return"EPROTO: protocol error, "+e+i;case"EEXIST":return"EEXIST: file already exists, "+e+i;case"ENOTDIR":return"ENOTDIR: not a directory, "+e+i;case"EISDIR":return"EISDIR: illegal operation on a directory, "+e+i;case"EACCES":return"EACCES: permission denied, "+e+i;case"ENOTEMPTY":return"ENOTEMPTY: directory not empty, "+e+i;case"EMFILE":return"EMFILE: too many open files, "+e+i;case"ENOSYS":return"ENOSYS: function not implemented, "+e+i;default:return t+": error occurred, "+e+i}}(t,e,r,n)),e.code=t,e}function a(t){if("number"==typeof t)return t;if("string"==typeof t){var e=N[t];if(void 0!==e)return e}throw new si.TypeError("ERR_INVALID_OPT_VALUE","flags",t)}function f(t,e){if(!e)return t;var r=typeof e;switch(r){case"string":t=C({},t,{encoding:e});break;case"object":t=C({},t,e);break;default:throw TypeError("Expected options to be either an object or a string, but got "+r+" instead")}return"buffer"!==t.encoding&&ai.assertEncoding(t.encoding),t}function u(t){return function(e){return f(t,e)}}function h(t){if("function"!=typeof t)throw TypeError(K.CB);return t}function l(t){return function(e,r){return"function"==typeof e?[t(),e]:[t(e),h(r)]}}function c(t){if("string"!=typeof t&&!zr.Buffer.isBuffer(t)){try{if(!(t instanceof No.URL))throw new TypeError(K.PATH_STR)}catch(t){throw new TypeError(K.PATH_STR)}if(""!==t.hostname)throw new si.TypeError("ERR_INVALID_FILE_URL_HOST",gi.default.platform);t=t.pathname;for(var e=0;e<t.length;e++)if("%"===t[e]){var r=32|t.codePointAt(e+2);if("2"===t[e+1]&&102===r)throw new si.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}t=decodeURIComponent(t)}return y(t=String(t)),t}function p(t,e){return(t=r(t,e).substr(1))?t.split(j):[]}function d(t){return p(c(t))}function _(t,e){return void 0===e&&(e=ai.ENCODING_UTF8),zr.Buffer.isBuffer(t)?t:t instanceof Uint8Array?zr.bufferFrom(t):zr.bufferFrom(String(t),e)}function g(t,e){return e&&"buffer"!==e?t.toString(e):t}function y(t,e){if(-1!==(""+t).indexOf("\0")){if((t=Error("Path must be a string without null bytes")).code="ENOENT","function"!=typeof e)throw t;return gi.default.nextTick(e,t),!1}return!0}function m(t,e){if("number"!=typeof(t="number"==typeof t?t:"string"==typeof t?parseInt(t,8):e?m(e):void 0)||isNaN(t))throw new TypeError(K.MODE_INT);return t}function E(t){if(t>>>0!==t)throw TypeError(K.FD)}function S(t){if("string"==typeof t&&+t==t)return+t;if(t instanceof Date)return t.getTime()/1e3;if(isFinite(t))return 0>t?Date.now()/1e3:t;throw Error("Cannot parse time: "+t)}function I(t){if("number"!=typeof t)throw TypeError(K.UID)}function w(t){if("number"!=typeof t)throw TypeError(K.GID)}function A(t){t.emit("stop")}function v(t,e,r){if(!(this instanceof v))return new v(t,e,r);if(this._vol=t,void 0===(r=C({},f(r,{}))).highWaterMark&&(r.highWaterMark=65536),po.Readable.call(this,r),this.path=c(e),this.fd=void 0===r.fd?null:r.fd,this.flags=void 0===r.flags?"r":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=void 0===r.autoClose||r.autoClose,this.pos=void 0,this.bytesRead=0,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError('"start" option must be a Number');if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw Error('"start" option must be <= "end" option');this.pos=this.start}"number"!=typeof this.fd&&this.open(),this.on("end",(function(){this.autoClose&&this.destroy&&this.destroy()}))}function T(){this.close()}function b(t,e,r){if(!(this instanceof b))return new b(t,e,r);if(this._vol=t,r=C({},f(r,{})),po.Writable.call(this,r),this.path=c(e),this.fd=void 0===r.fd?null:r.fd,this.flags=void 0===r.flags?"w":r.flags,this.mode=void 0===r.mode?438:r.mode,this.start=r.start,this.autoClose=void 0===r.autoClose||!!r.autoClose,this.pos=void 0,this.bytesWritten=0,void 0!==this.start){if("number"!=typeof this.start)throw new TypeError('"start" option must be a Number');if(0>this.start)throw Error('"start" must be >= zero');this.pos=this.start}r.encoding&&this.setDefaultEncoding(r.encoding),"number"!=typeof this.fd&&this.open(),this.once("finish",(function(){this.autoClose&&this.close()}))}var R=Qe&&Qe.__extends||function(){function t(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)}return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),O=Qe&&Qe.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;t=Array(t);var n=0;for(e=0;e<r;e++)for(var i=arguments[e],o=0,s=i.length;o<s;o++,n++)t[n]=i[o];return t};Object.defineProperty(e,"__esModule",{value:!0});var N,C=go,L=pi,P=rr.constants.O_RDONLY,W=rr.constants.O_WRONLY,B=rr.constants.O_RDWR,F=rr.constants.O_CREAT,D=rr.constants.O_EXCL,k=rr.constants.O_TRUNC,U=rr.constants.O_APPEND,M=rr.constants.O_SYNC,x=rr.constants.O_DIRECTORY,G=rr.constants.F_OK,H=rr.constants.COPYFILE_EXCL,Y=rr.constants.COPYFILE_FICLONE_FORCE,j="/",V=ci,z="win32"===gi.default.platform,K={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"};!function(t){t[t.r=P]="r",t[t["r+"]=B]="r+",t[t.rs=P|M]="rs",t[t.sr=t.rs]="sr",t[t["rs+"]=B|M]="rs+",t[t["sr+"]=t["rs+"]]="sr+",t[t.w=W|F|k]="w",t[t.wx=W|F|k|D]="wx",t[t.xw=t.wx]="xw",t[t["w+"]=B|F|k]="w+",t[t["wx+"]=B|F|k|D]="wx+",t[t["xw+"]=t["wx+"]]="xw+",t[t.a=W|U|F]="a",t[t.ax=W|U|F|D]="ax",t[t.xa=t.ax]="xa",t[t["a+"]=B|U|F]="a+",t[t["ax+"]=B|U|F|D]="ax+",t[t["xa+"]=t["ax+"]]="xa+"}(N=e.FLAGS||(e.FLAGS={})),e.flagsToNumber=a;var q=u(t={encoding:"utf8"}),Z=l(q),X=u({flag:"r"}),J={encoding:"utf8",mode:438,flag:N[N.w]},$=u(J),Q={encoding:"utf8",mode:438,flag:N[N.a]},tt=u(Q),et=l(tt),rt=u(t),nt=l(rt),it={mode:511,recursive:!1},ot={recursive:!1},st=u({encoding:"utf8",withFileTypes:!1}),at=l(st),ft={bigint:!1};if(e.pathToFilename=c,z){var ut=r,ht=Ko.unixify;r=function(t,e){return ht(ut(t,e))}}e.filenameToSteps=p,e.pathToSteps=d,e.dataToStr=function(t,e){return void 0===e&&(e=ai.ENCODING_UTF8),zr.Buffer.isBuffer(t)?t.toString(e):t instanceof Uint8Array?zr.bufferFrom(t).toString(e):String(t)},e.dataToBuffer=_,e.bufferToEncoding=g,e.toUnixTimestamp=S,t=function(){function t(t){void 0===t&&(t={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=yo.default(this),this.statWatchers={},this.props=C({Node:Ai.Node,Link:Ai.Link,File:Ai.File},t),(t=this.createLink()).setNode(this.createNode(!0));var e=this;this.StatWatcher=function(t){function r(){return t.call(this,e)||this}return R(r,t),r}(ct),this.ReadStream=function(t){function r(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(this,O([e],r))||this}return R(r,t),r}(v),this.WriteStream=function(t){function r(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(this,O([e],r))||this}return R(r,t),r}(b),this.FSWatcher=function(t){function r(){return t.call(this,e)||this}return R(r,t),r}(pt),this.root=t}return t.fromJSON=function(e,r){var n=new t;return n.fromJSON(e,r),n},Object.defineProperty(t.prototype,"promises",{get:function(){if(null===this.promisesApi)throw Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!0,configurable:!0}),t.prototype.createLink=function(t,e,r,n){if(void 0===r&&(r=!1),!t)return new this.props.Link(this,null,"");if(!e)throw Error("createLink: name cannot be empty");return t.createChild(e,this.createNode(r,n))},t.prototype.deleteLink=function(t){var e=t.parent;return!!e&&(e.deleteChild(t),!0)},t.prototype.newInoNumber=function(){return this.releasedInos.pop()||(this.ino=(this.ino+1)%4294967295)},t.prototype.newFdNumber=function(){var e=this.releasedFds.pop();return"number"==typeof e?e:t.fd--},t.prototype.createNode=function(t,e){return void 0===t&&(t=!1),e=new this.props.Node(this.newInoNumber(),e),t&&e.setIsDirectory(),this.inodes[e.ino]=e},t.prototype.getNode=function(t){return this.inodes[t]},t.prototype.deleteNode=function(t){t.del(),delete this.inodes[t.ino],this.releasedInos.push(t.ino)},t.prototype.genRndStr=function(){var t=(Math.random()+1).toString(36).substr(2,6);return 6===t.length?t:this.genRndStr()},t.prototype.getLink=function(t){return this.root.walk(t)},t.prototype.getLinkOrThrow=function(t,e){var r=p(t);if(!(r=this.getLink(r)))throw s("ENOENT",e,t);return r},t.prototype.getResolvedLink=function(t){t="string"==typeof t?p(t):t;for(var e=this.root,r=0;r<t.length;){if(!(e=e.getChild(t[r])))return null;var n=e.getNode();n.isSymlink()?(t=n.symlink.concat(t.slice(r+1)),e=this.root,r=0):r++}return e},t.prototype.getResolvedLinkOrThrow=function(t,e){var r=this.getResolvedLink(t);if(!r)throw s("ENOENT",e,t);return r},t.prototype.resolveSymlinks=function(t){return this.getResolvedLink(t.steps.slice(1))},t.prototype.getLinkAsDirOrThrow=function(t,e){var r=this.getLinkOrThrow(t,e);if(!r.getNode().isDirectory())throw s("ENOTDIR",e,t);return r},t.prototype.getLinkParent=function(t){return this.root.walk(t,t.length-1)},t.prototype.getLinkParentAsDirOrThrow=function(t,e){t=t instanceof Array?t:p(t);var r=this.getLinkParent(t);if(!r)throw s("ENOENT",e,j+t.join(j));if(!r.getNode().isDirectory())throw s("ENOTDIR",e,j+t.join(j));return r},t.prototype.getFileByFd=function(t){return this.fds[String(t)]},t.prototype.getFileByFdOrThrow=function(t,e){if(t>>>0!==t)throw TypeError(K.FD);if(!(t=this.getFileByFd(t)))throw s("EBADF",e);return t},t.prototype.getNodeByIdOrCreate=function(t,e,r){if("number"==typeof t){if(!(t=this.getFileByFd(t)))throw Error("File nto found");return t.node}var n=d(t),i=this.getLink(n);if(i)return i.getNode();if(e&F&&(e=this.getLinkParent(n)))return(i=this.createLink(e,n[n.length-1],!1,r)).getNode();throw s("ENOENT","getNodeByIdOrCreate",c(t))},t.prototype.wrapAsync=function(t,e,r){var n=this;h(r),_i.default((function(){try{r(null,t.apply(n,e))}catch(t){r(t)}}))},t.prototype._toJSON=function(t,e,r){var n;void 0===t&&(t=this.root),void 0===e&&(e={});var i=!0,o=t.children;for(var s in t.getNode().isFile()&&((n={})[t.getName()]=t.parent.getChild(t.getName()),o=n,t=t.parent),o){if(i=!1,!(o=t.getChild(s)))throw Error("_toJSON: unexpected undefined");(n=o.getNode()).isFile()?(o=o.getPath(),r&&(o=V(r,o)),e[o]=n.getString()):n.isDirectory()&&this._toJSON(o,e,r)}return t=t.getPath(),r&&(t=V(r,t)),t&&i&&(e[t]=null),e},t.prototype.toJSON=function(t,e,r){void 0===e&&(e={}),void 0===r&&(r=!1);var n=[];if(t){t instanceof Array||(t=[t]);for(var i=0;i<t.length;i++){var o=c(t[i]);(o=this.getResolvedLink(o))&&n.push(o)}}else n.push(this.root);if(!n.length)return e;for(i=0;i<n.length;i++)o=n[i],this._toJSON(o,e,r?o.getPath():"");return e},t.prototype.fromJSON=function(t,e){for(var n in void 0===e&&(e=gi.default.cwd()),t){var i=t[n];if("string"==typeof i){var o=p(n=r(n,e));1<o.length&&(o=j+o.slice(0,o.length-1).join(j),this.mkdirpBase(o,511)),this.writeFileSync(n,i)}else this.mkdirpBase(n,511)}},t.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},t.prototype.mountSync=function(t,e){this.fromJSON(e,t)},t.prototype.openLink=function(t,e,r){if(void 0===r&&(r=!0),this.openFiles>=this.maxFiles)throw s("EMFILE","open",t.getPath());var n=t;if(r&&(n=this.resolveSymlinks(t)),!n)throw s("ENOENT","open",t.getPath());if((r=n.getNode()).isDirectory()){if((e&(P|B|W))!==P)throw s("EISDIR","open",t.getPath())}else if(e&x)throw s("ENOTDIR","open",t.getPath());if(!(e&W||r.canRead()))throw s("EACCES","open",t.getPath());return t=new this.props.File(t,r,e,this.newFdNumber()),this.fds[t.fd]=t,this.openFiles++,e&k&&t.truncate(),t},t.prototype.openFile=function(t,e,r,n){void 0===n&&(n=!0);var i=p(t),o=n?this.getResolvedLink(i):this.getLink(i);if(!o&&e&F){var a=this.getResolvedLink(i.slice(0,i.length-1));if(!a)throw s("ENOENT","open",j+i.join(j));e&F&&"number"==typeof r&&(o=this.createLink(a,i[i.length-1],!1,r))}if(o)return this.openLink(o,e,n);throw s("ENOENT","open",t)},t.prototype.openBase=function(t,e,r,n){if(void 0===n&&(n=!0),!(e=this.openFile(t,e,r,n)))throw s("ENOENT","open",t);return e.fd},t.prototype.openSync=function(t,e,r){return void 0===r&&(r=438),r=m(r),t=c(t),e=a(e),this.openBase(t,e,r)},t.prototype.open=function(t,e,r,n){var i=r;"function"==typeof r&&(i=438,n=r),r=m(i||438),t=c(t),e=a(e),this.wrapAsync(this.openBase,[t,e,r],n)},t.prototype.closeFile=function(t){this.fds[t.fd]&&(this.openFiles--,delete this.fds[t.fd],this.releasedFds.push(t.fd))},t.prototype.closeSync=function(t){E(t),t=this.getFileByFdOrThrow(t,"close"),this.closeFile(t)},t.prototype.close=function(t,e){E(t),this.wrapAsync(this.closeSync,[t],e)},t.prototype.openFileOrGetById=function(t,e,r){if("number"==typeof t){if(!(t=this.fds[t]))throw s("ENOENT");return t}return this.openFile(c(t),e,r)},t.prototype.readBase=function(t,e,r,n,i){return this.getFileByFdOrThrow(t).read(e,Number(r),Number(n),i)},t.prototype.readSync=function(t,e,r,n,i){return E(t),this.readBase(t,e,r,n,i)},t.prototype.read=function(t,e,r,n,i,o){var s=this;if(h(o),0===n)return gi.default.nextTick((function(){o&&o(null,0,e)}));_i.default((function(){try{var a=s.readBase(t,e,r,n,i);o(null,a,e)}catch(t){o(t)}}))},t.prototype.readFileBase=function(t,e,r){var n="number"==typeof t&&t>>>0===t;if(!n){var i=c(t);if(i=p(i),(i=this.getResolvedLink(i))&&i.getNode().isDirectory())throw s("EISDIR","open",i.getPath());t=this.openSync(t,e)}try{var o=g(this.getFileByFdOrThrow(t).getBuffer(),r)}finally{n||this.closeSync(t)}return o},t.prototype.readFileSync=function(t,e){var r=a((e=X(e)).flag);return this.readFileBase(t,r,e.encoding)},t.prototype.readFile=function(t,e,r){e=(r=l(X)(e,r))[0],r=r[1];var n=a(e.flag);this.wrapAsync(this.readFileBase,[t,n,e.encoding],r)},t.prototype.writeBase=function(t,e,r,n,i){return this.getFileByFdOrThrow(t,"write").write(e,r,n,i)},t.prototype.writeSync=function(t,e,r,n,i){E(t);var o="string"!=typeof e;if(o){var s=0|(r||0),a=n;r=i}else var f=n;return e=_(e,f),o?void 0===a&&(a=e.length):(s=0,a=e.length),this.writeBase(t,e,s,a,r)},t.prototype.write=function(t,e,r,n,i,o){var s=this;E(t);var a=typeof e,f=typeof r,u=typeof n,l=typeof i;if("string"!==a)if("function"===f)var c=r;else if("function"===u){var p=0|r;c=n}else if("function"===l){p=0|r;var d=n;c=i}else{p=0|r,d=n;var g=i;c=o}else if("function"===f)c=r;else if("function"===u)g=r,c=n;else if("function"===l){g=r;var y=n;c=i}var m=_(e,y);"string"!==a?void 0===d&&(d=m.length):(p=0,d=m.length);var S=h(c);_i.default((function(){try{var r=s.writeBase(t,m,p,d,g);S(null,r,"string"!==a?m:e)}catch(t){S(t)}}))},t.prototype.writeFileBase=function(t,e,r,n){var i="number"==typeof t;t=i?t:this.openBase(c(t),r,n),n=0;var o=e.length;r=r&U?void 0:0;try{for(;0<o;){var s=this.writeSync(t,e,n,o,r);n+=s,o-=s,void 0!==r&&(r+=s)}}finally{i||this.closeSync(t)}},t.prototype.writeFileSync=function(t,e,r){var n=$(r);r=a(n.flag);var i=m(n.mode);e=_(e,n.encoding),this.writeFileBase(t,e,r,i)},t.prototype.writeFile=function(t,e,r,n){var i=r;"function"==typeof r&&(i=J,n=r),r=h(n);var o=$(i);i=a(o.flag),n=m(o.mode),e=_(e,o.encoding),this.wrapAsync(this.writeFileBase,[t,e,i,n],r)},t.prototype.linkBase=function(t,e){var r=p(t),n=this.getLink(r);if(!n)throw s("ENOENT","link",t,e);var i=p(e);if(!(r=this.getLinkParent(i)))throw s("ENOENT","link",t,e);if(i=i[i.length-1],r.getChild(i))throw s("EEXIST","link",t,e);(t=n.getNode()).nlink++,r.createChild(i,t)},t.prototype.copyFileBase=function(t,e,r){var n=this.readFileSync(t);if(r&H&&this.existsSync(e))throw s("EEXIST","copyFile",t,e);if(r&Y)throw s("ENOSYS","copyFile",t,e);this.writeFileBase(e,n,N.w,438)},t.prototype.copyFileSync=function(t,e,r){return t=c(t),e=c(e),this.copyFileBase(t,e,0|(r||0))},t.prototype.copyFile=function(t,e,r,n){if(t=c(t),e=c(e),"function"==typeof r)var i=0;else i=r,r=n;h(r),this.wrapAsync(this.copyFileBase,[t,e,i],r)},t.prototype.linkSync=function(t,e){t=c(t),e=c(e),this.linkBase(t,e)},t.prototype.link=function(t,e,r){t=c(t),e=c(e),this.wrapAsync(this.linkBase,[t,e],r)},t.prototype.unlinkBase=function(t){var e=p(t);if(!(e=this.getLink(e)))throw s("ENOENT","unlink",t);if(e.length)throw Error("Dir not empty...");this.deleteLink(e),(t=e.getNode()).nlink--,0>=t.nlink&&this.deleteNode(t)},t.prototype.unlinkSync=function(t){t=c(t),this.unlinkBase(t)},t.prototype.unlink=function(t,e){t=c(t),this.wrapAsync(this.unlinkBase,[t],e)},t.prototype.symlinkBase=function(t,e){var r=p(e),n=this.getLinkParent(r);if(!n)throw s("ENOENT","symlink",t,e);if(r=r[r.length-1],n.getChild(r))throw s("EEXIST","symlink",t,e);return(e=n.createChild(r)).getNode().makeSymlink(p(t)),e},t.prototype.symlinkSync=function(t,e){t=c(t),e=c(e),this.symlinkBase(t,e)},t.prototype.symlink=function(t,e,r,n){r=h("function"==typeof r?r:n),t=c(t),e=c(e),this.wrapAsync(this.symlinkBase,[t,e],r)},t.prototype.realpathBase=function(t,e){var r=p(t);if(!(r=this.getResolvedLink(r)))throw s("ENOENT","realpath",t);return ai.strToEncoding(r.getPath(),e)},t.prototype.realpathSync=function(t,e){return this.realpathBase(c(t),rt(e).encoding)},t.prototype.realpath=function(t,e,r){e=(r=nt(e,r))[0],r=r[1],t=c(t),this.wrapAsync(this.realpathBase,[t,e.encoding],r)},t.prototype.lstatBase=function(t,e){void 0===e&&(e=!1);var r=this.getLink(p(t));if(!r)throw s("ENOENT","lstat",t);return ir.default.build(r.getNode(),e)},t.prototype.lstatSync=function(t,e){return this.lstatBase(c(t),i(e).bigint)},t.prototype.lstat=function(t,e,r){e=(r=n(e,r))[0],r=r[1],this.wrapAsync(this.lstatBase,[c(t),e.bigint],r)},t.prototype.statBase=function(t,e){void 0===e&&(e=!1);var r=this.getResolvedLink(p(t));if(!r)throw s("ENOENT","stat",t);return ir.default.build(r.getNode(),e)},t.prototype.statSync=function(t,e){return this.statBase(c(t),i(e).bigint)},t.prototype.stat=function(t,e,r){e=(r=n(e,r))[0],r=r[1],this.wrapAsync(this.statBase,[c(t),e.bigint],r)},t.prototype.fstatBase=function(t,e){if(void 0===e&&(e=!1),!(t=this.getFileByFd(t)))throw s("EBADF","fstat");return ir.default.build(t.node,e)},t.prototype.fstatSync=function(t,e){return this.fstatBase(t,i(e).bigint)},t.prototype.fstat=function(t,e,r){e=n(e,r),this.wrapAsync(this.fstatBase,[t,e[0].bigint],e[1])},t.prototype.renameBase=function(t,e){var r=this.getLink(p(t));if(!r)throw s("ENOENT","rename",t,e);var n=p(e),i=this.getLinkParent(n);if(!i)throw s("ENOENT","rename",t,e);(t=r.parent)&&t.deleteChild(r),r.steps=O(i.steps,[n[n.length-1]]),i.setChild(r.getName(),r)},t.prototype.renameSync=function(t,e){t=c(t),e=c(e),this.renameBase(t,e)},t.prototype.rename=function(t,e,r){t=c(t),e=c(e),this.wrapAsync(this.renameBase,[t,e],r)},t.prototype.existsBase=function(t){return!!this.statBase(t)},t.prototype.existsSync=function(t){try{return this.existsBase(c(t))}catch(t){return!1}},t.prototype.exists=function(t,e){var r=this,n=c(t);if("function"!=typeof e)throw Error(K.CB);_i.default((function(){try{e(r.existsBase(n))}catch(t){e(!1)}}))},t.prototype.accessBase=function(t){this.getLinkOrThrow(t,"access")},t.prototype.accessSync=function(t,e){void 0===e&&(e=G),t=c(t),this.accessBase(t,0|e)},t.prototype.access=function(t,e,r){var n=G;"function"!=typeof e&&(n=0|e,e=h(r)),t=c(t),this.wrapAsync(this.accessBase,[t,n],e)},t.prototype.appendFileSync=function(t,e,r){void 0===r&&(r=Q),(r=tt(r)).flag&&t>>>0!==t||(r.flag="a"),this.writeFileSync(t,e,r)},t.prototype.appendFile=function(t,e,r,n){r=(n=et(r,n))[0],n=n[1],r.flag&&t>>>0!==t||(r.flag="a"),this.writeFile(t,e,r,n)},t.prototype.readdirBase=function(t,e){var r=p(t);if(!(r=this.getResolvedLink(r)))throw s("ENOENT","readdir",t);if(!r.getNode().isDirectory())throw s("ENOTDIR","scandir",t);if(e.withFileTypes){var n=[];for(i in r.children)(t=r.getChild(i))&&n.push(fi.default.build(t,e.encoding));return z||"buffer"===e.encoding||n.sort((function(t,e){return t.name<e.name?-1:t.name>e.name?1:0})),n}var i=[];for(n in r.children)i.push(ai.strToEncoding(n,e.encoding));return z||"buffer"===e.encoding||i.sort(),i},t.prototype.readdirSync=function(t,e){return e=st(e),t=c(t),this.readdirBase(t,e)},t.prototype.readdir=function(t,e,r){e=(r=at(e,r))[0],r=r[1],t=c(t),this.wrapAsync(this.readdirBase,[t,e],r)},t.prototype.readlinkBase=function(t,e){var r=this.getLinkOrThrow(t,"readlink").getNode();if(!r.isSymlink())throw s("EINVAL","readlink",t);return t=j+r.symlink.join(j),ai.strToEncoding(t,e)},t.prototype.readlinkSync=function(t,e){return e=q(e),t=c(t),this.readlinkBase(t,e.encoding)},t.prototype.readlink=function(t,e,r){e=(r=Z(e,r))[0],r=r[1],t=c(t),this.wrapAsync(this.readlinkBase,[t,e.encoding],r)},t.prototype.fsyncBase=function(t){this.getFileByFdOrThrow(t,"fsync")},t.prototype.fsyncSync=function(t){this.fsyncBase(t)},t.prototype.fsync=function(t,e){this.wrapAsync(this.fsyncBase,[t],e)},t.prototype.fdatasyncBase=function(t){this.getFileByFdOrThrow(t,"fdatasync")},t.prototype.fdatasyncSync=function(t){this.fdatasyncBase(t)},t.prototype.fdatasync=function(t,e){this.wrapAsync(this.fdatasyncBase,[t],e)},t.prototype.ftruncateBase=function(t,e){this.getFileByFdOrThrow(t,"ftruncate").truncate(e)},t.prototype.ftruncateSync=function(t,e){this.ftruncateBase(t,e)},t.prototype.ftruncate=function(t,e,r){var n="number"==typeof e?e:0;e=h("number"==typeof e?r:e),this.wrapAsync(this.ftruncateBase,[t,n],e)},t.prototype.truncateBase=function(t,e){t=this.openSync(t,"r+");try{this.ftruncateSync(t,e)}finally{this.closeSync(t)}},t.prototype.truncateSync=function(t,e){if(t>>>0===t)return this.ftruncateSync(t,e);this.truncateBase(t,e)},t.prototype.truncate=function(t,e,r){var n="number"==typeof e?e:0;if(e=h("number"==typeof e?r:e),t>>>0===t)return this.ftruncate(t,n,e);this.wrapAsync(this.truncateBase,[t,n],e)},t.prototype.futimesBase=function(t,e,r){(t=this.getFileByFdOrThrow(t,"futimes").node).atime=new Date(1e3*e),t.mtime=new Date(1e3*r)},t.prototype.futimesSync=function(t,e,r){this.futimesBase(t,S(e),S(r))},t.prototype.futimes=function(t,e,r,n){this.wrapAsync(this.futimesBase,[t,S(e),S(r)],n)},t.prototype.utimesBase=function(t,e,r){t=this.openSync(t,"r+");try{this.futimesBase(t,e,r)}finally{this.closeSync(t)}},t.prototype.utimesSync=function(t,e,r){this.utimesBase(c(t),S(e),S(r))},t.prototype.utimes=function(t,e,r,n){this.wrapAsync(this.utimesBase,[c(t),S(e),S(r)],n)},t.prototype.mkdirBase=function(t,e){var r=p(t);if(!r.length)throw s("EISDIR","mkdir",t);var n=this.getLinkParentAsDirOrThrow(t,"mkdir");if(r=r[r.length-1],n.getChild(r))throw s("EEXIST","mkdir",t);n.createChild(r,this.createNode(!0,e))},t.prototype.mkdirpBase=function(t,e){t=p(t);for(var r=this.root,n=0;n<t.length;n++){var i=t[n];if(!r.getNode().isDirectory())throw s("ENOTDIR","mkdir",r.getPath());var o=r.getChild(i);if(o){if(!o.getNode().isDirectory())throw s("ENOTDIR","mkdir",o.getPath());r=o}else r=r.createChild(i,this.createNode(!0,e))}},t.prototype.mkdirSync=function(t,e){var r=m((e=o(e)).mode,511);t=c(t),e.recursive?this.mkdirpBase(t,r):this.mkdirBase(t,r)},t.prototype.mkdir=function(t,e,r){var n=o(e);e=h("function"==typeof e?e:r),r=m(n.mode,511),t=c(t),n.recursive?this.wrapAsync(this.mkdirpBase,[t,r],e):this.wrapAsync(this.mkdirBase,[t,r],e)},t.prototype.mkdirpSync=function(t,e){this.mkdirSync(t,{mode:e,recursive:!0})},t.prototype.mkdirp=function(t,e,r){var n="function"==typeof e?void 0:e;e=h("function"==typeof e?e:r),this.mkdir(t,{mode:n,recursive:!0},e)},t.prototype.mkdtempBase=function(t,e,r){void 0===r&&(r=5);var n=t+this.genRndStr();try{return this.mkdirBase(n,511),ai.strToEncoding(n,e)}catch(n){if("EEXIST"===n.code){if(1<r)return this.mkdtempBase(t,e,r-1);throw Error("Could not create temp dir.")}throw n}},t.prototype.mkdtempSync=function(t,e){if(e=q(e).encoding,!t||"string"!=typeof t)throw new TypeError("filename prefix is required");return y(t),this.mkdtempBase(t,e)},t.prototype.mkdtemp=function(t,e,r){if(e=(r=Z(e,r))[0].encoding,r=r[1],!t||"string"!=typeof t)throw new TypeError("filename prefix is required");y(t)&&this.wrapAsync(this.mkdtempBase,[t,e],r)},t.prototype.rmdirBase=function(t,e){e=C({},ot,e);var r=this.getLinkAsDirOrThrow(t,"rmdir");if(r.length&&!e.recursive)throw s("ENOTEMPTY","rmdir",t);this.deleteLink(r)},t.prototype.rmdirSync=function(t,e){this.rmdirBase(c(t),e)},t.prototype.rmdir=function(t,e,r){var n=C({},ot,e);e=h("function"==typeof e?e:r),this.wrapAsync(this.rmdirBase,[c(t),n],e)},t.prototype.fchmodBase=function(t,e){this.getFileByFdOrThrow(t,"fchmod").chmod(e)},t.prototype.fchmodSync=function(t,e){this.fchmodBase(t,m(e))},t.prototype.fchmod=function(t,e,r){this.wrapAsync(this.fchmodBase,[t,m(e)],r)},t.prototype.chmodBase=function(t,e){t=this.openSync(t,"r+");try{this.fchmodBase(t,e)}finally{this.closeSync(t)}},t.prototype.chmodSync=function(t,e){e=m(e),t=c(t),this.chmodBase(t,e)},t.prototype.chmod=function(t,e,r){e=m(e),t=c(t),this.wrapAsync(this.chmodBase,[t,e],r)},t.prototype.lchmodBase=function(t,e){t=this.openBase(t,B,0,!1);try{this.fchmodBase(t,e)}finally{this.closeSync(t)}},t.prototype.lchmodSync=function(t,e){e=m(e),t=c(t),this.lchmodBase(t,e)},t.prototype.lchmod=function(t,e,r){e=m(e),t=c(t),this.wrapAsync(this.lchmodBase,[t,e],r)},t.prototype.fchownBase=function(t,e,r){this.getFileByFdOrThrow(t,"fchown").chown(e,r)},t.prototype.fchownSync=function(t,e,r){I(e),w(r),this.fchownBase(t,e,r)},t.prototype.fchown=function(t,e,r,n){I(e),w(r),this.wrapAsync(this.fchownBase,[t,e,r],n)},t.prototype.chownBase=function(t,e,r){this.getResolvedLinkOrThrow(t,"chown").getNode().chown(e,r)},t.prototype.chownSync=function(t,e,r){I(e),w(r),this.chownBase(c(t),e,r)},t.prototype.chown=function(t,e,r,n){I(e),w(r),this.wrapAsync(this.chownBase,[c(t),e,r],n)},t.prototype.lchownBase=function(t,e,r){this.getLinkOrThrow(t,"lchown").getNode().chown(e,r)},t.prototype.lchownSync=function(t,e,r){I(e),w(r),this.lchownBase(c(t),e,r)},t.prototype.lchown=function(t,e,r,n){I(e),w(r),this.wrapAsync(this.lchownBase,[c(t),e,r],n)},t.prototype.watchFile=function(t,e,r){t=c(t);var n=e;if("function"==typeof n&&(r=e,n=null),"function"!=typeof r)throw Error('"watchFile()" requires a listener function');e=5007;var i=!0;return n&&"object"==typeof n&&("number"==typeof n.interval&&(e=n.interval),"boolean"==typeof n.persistent&&(i=n.persistent)),(n=this.statWatchers[t])||((n=new this.StatWatcher).start(t,i,e),this.statWatchers[t]=n),n.addListener("change",r),n},t.prototype.unwatchFile=function(t,e){t=c(t);var r=this.statWatchers[t];r&&("function"==typeof e?r.removeListener("change",e):r.removeAllListeners("change"),0===r.listenerCount("change")&&(r.stop(),delete this.statWatchers[t]))},t.prototype.createReadStream=function(t,e){return new this.ReadStream(t,e)},t.prototype.createWriteStream=function(t,e){return new this.WriteStream(t,e)},t.prototype.watch=function(t,e,r){t=c(t);var n=e;"function"==typeof e&&(r=e,n=null);var i=q(n);e=i.persistent,n=i.recursive,i=i.encoding,void 0===e&&(e=!0),void 0===n&&(n=!1);var o=new this.FSWatcher;return o.start(t,e,n,i),r&&o.addListener("change",r),o},t.fd=2147483647,t}(),e.Volume=t;var lt,ct=function(t){function e(e){var r=t.call(this)||this;return r.onInterval=function(){try{var t=r.vol.statSync(r.filename);r.hasChanged(t)&&(r.emit("change",t,r.prev),r.prev=t)}finally{r.loop()}},r.vol=e,r}return R(e,t),e.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},e.prototype.hasChanged=function(t){return t.mtimeMs>this.prev.mtimeMs||t.nlink!==this.prev.nlink},e.prototype.start=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=5007),this.filename=c(t),this.setTimeout=e?setTimeout:Ti.default,this.interval=r,this.prev=this.vol.statSync(this.filename),this.loop()},e.prototype.stop=function(){clearTimeout(this.timeoutRef),gi.default.nextTick(A,this)},e}(mi.EventEmitter);e.StatWatcher=ct,xn.inherits(v,po.Readable),e.ReadStream=v,v.prototype.open=function(){var t=this;this._vol.open(this.path,this.flags,this.mode,(function(e,r){e?(t.autoClose&&t.destroy&&t.destroy(),t.emit("error",e)):(t.fd=r,t.emit("open",r),t.read())}))},v.prototype._read=function(t){if("number"!=typeof this.fd)return this.once("open",(function(){this._read(t)}));if(!this.destroyed){(!lt||128>lt.length-lt.used)&&((lt=zr.bufferAllocUnsafe(this._readableState.highWaterMark)).used=0);var e=lt,r=Math.min(lt.length-lt.used,t),n=lt.used;if(void 0!==this.pos&&(r=Math.min(this.end-this.pos+1,r)),0>=r)return this.push(null);var i=this;this._vol.read(this.fd,lt,lt.used,r,this.pos,(function(t,r){t?(i.autoClose&&i.destroy&&i.destroy(),i.emit("error",t)):(t=null,0<r&&(i.bytesRead+=r,t=e.slice(n,n+r)),i.push(t))})),void 0!==this.pos&&(this.pos+=r),lt.used+=r}},v.prototype._destroy=function(t,e){this.close((function(r){e(t||r)}))},v.prototype.close=function(t){var e=this;if(t&&this.once("close",t),this.closed||"number"!=typeof this.fd)return"number"!=typeof this.fd?void this.once("open",T):gi.default.nextTick((function(){return e.emit("close")}));this.closed=!0,this._vol.close(this.fd,(function(t){t?e.emit("error",t):e.emit("close")})),this.fd=null},xn.inherits(b,po.Writable),e.WriteStream=b,b.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(t,e){t?(this.autoClose&&this.destroy&&this.destroy(),this.emit("error",t)):(this.fd=e,this.emit("open",e))}.bind(this))},b.prototype._write=function(t,e,r){if(!(t instanceof zr.Buffer))return this.emit("error",Error("Invalid data"));if("number"!=typeof this.fd)return this.once("open",(function(){this._write(t,e,r)}));var n=this;this._vol.write(this.fd,t,0,t.length,this.pos,(function(t,e){if(t)return n.autoClose&&n.destroy&&n.destroy(),r(t);n.bytesWritten+=e,r()})),void 0!==this.pos&&(this.pos+=t.length)},b.prototype._writev=function(t,e){if("number"!=typeof this.fd)return this.once("open",(function(){this._writev(t,e)}));for(var r=this,n=t.length,i=Array(n),o=0,s=0;s<n;s++){var a=t[s].chunk;i[s]=a,o+=a.length}n=zr.Buffer.concat(i),this._vol.write(this.fd,n,0,n.length,this.pos,(function(t,n){if(t)return r.destroy&&r.destroy(),e(t);r.bytesWritten+=n,e()})),void 0!==this.pos&&(this.pos+=o)},b.prototype._destroy=v.prototype._destroy,b.prototype.close=v.prototype.close,b.prototype.destroySoon=b.prototype.end;var pt=function(t){function e(e){var r=t.call(this)||this;return r._filename="",r._filenameEncoded="",r._recursive=!1,r._encoding=ai.ENCODING_UTF8,r._onNodeChange=function(){r._emit("change")},r._onParentChild=function(t){t.getName()===r._getName()&&r._emit("rename")},r._emit=function(t){r.emit("change",t,r._filenameEncoded)},r._persist=function(){r._timer=setTimeout(r._persist,1e6)},r._vol=e,r}return R(e,t),e.prototype._getName=function(){return this._steps[this._steps.length-1]},e.prototype.start=function(t,e,r,n){void 0===e&&(e=!0),void 0===r&&(r=!1),void 0===n&&(n=ai.ENCODING_UTF8),this._filename=c(t),this._steps=p(this._filename),this._filenameEncoded=ai.strToEncoding(this._filename),this._recursive=r,this._encoding=n;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(t){throw e=Error("watch "+this._filename+" "+t.code),e.code=t.code,e.errno=t.code,e}this._link.getNode().on("change",this._onNodeChange),this._link.on("child:add",this._onNodeChange),this._link.on("child:delete",this._onNodeChange),(t=this._link.parent)&&(t.setMaxListeners(t.getMaxListeners()+1),t.on("child:delete",this._onParentChild)),e&&this._persist()},e.prototype.close=function(){clearTimeout(this._timer),this._link.getNode().removeListener("change",this._onNodeChange);var t=this._link.parent;t&&t.removeListener("child:delete",this._onParentChild)},e}(mi.EventEmitter);e.FSWatcher=pt}));tr(qo);var Zo=qo.pathToFilename,Xo=qo.filenameToSteps,Jo=qo.Volume,$o=er((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.fsProps="constants F_OK R_OK W_OK X_OK Stats".split(" "),e.fsSyncMethods="renameSync ftruncateSync truncateSync chownSync fchownSync lchownSync chmodSync fchmodSync lchmodSync statSync lstatSync fstatSync linkSync symlinkSync readlinkSync realpathSync unlinkSync rmdirSync mkdirSync mkdirpSync readdirSync closeSync openSync utimesSync futimesSync fsyncSync writeSync readSync readFileSync writeFileSync appendFileSync existsSync accessSync fdatasyncSync mkdtempSync copyFileSync createReadStream createWriteStream".split(" "),e.fsAsyncMethods="rename ftruncate truncate chown fchown lchown chmod fchmod lchmod stat lstat fstat link symlink readlink realpath unlink rmdir mkdir mkdirp readdir close open utimes futimes fsync write read readFile writeFile appendFile exists access fdatasync mkdtemp copyFile watchFile unwatchFile watch".split(" ")}));tr($o);var Qo=er((function(t,e){function r(t){for(var e={F_OK:s,R_OK:a,W_OK:f,X_OK:u,constants:rr.constants,Stats:ir.default,Dirent:fi.default},r=0,n=i;r<n.length;r++){var h=n[r];"function"==typeof t[h]&&(e[h]=t[h].bind(t))}for(r=0,n=o;r<n.length;r++)"function"==typeof t[h=n[r]]&&(e[h]=t[h].bind(t));return e.StatWatcher=t.StatWatcher,e.FSWatcher=t.FSWatcher,e.WriteStream=t.WriteStream,e.ReadStream=t.ReadStream,e.promises=t.promises,e._toUnixTimestamp=qo.toUnixTimestamp,e}var n=Qe&&Qe.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=$o.fsSyncMethods,o=$o.fsAsyncMethods,s=rr.constants.F_OK,a=rr.constants.R_OK,f=rr.constants.W_OK,u=rr.constants.X_OK;e.Volume=qo.Volume,e.vol=new qo.Volume,e.createFsFromVolume=r,e.fs=r(e.vol),t.exports=n(n({},t.exports),e.fs),t.exports.semantic=!0}));tr(Qo);var ts=Qo.createFsFromVolume;vi.prototype.emit=function(t){for(var e,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];i=this.listeners(t);try{for(var o=Xe(i),s=o.next();!s.done;s=o.next()){var a=s.value;try{a.apply(void 0,$e(n))}catch(t){console.error(t)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return 0<i.length};var es=function(){function t(){this.volume=new Jo,this.fs=ts(this.volume),this.fromJSON({"/dev/stdin":"","/dev/stdout":"","/dev/stderr":""})}return t.prototype._toJSON=function(t,e,r){void 0===e&&(e={});var n,i=!0;for(n in t.children){i=!1;var o=t.getChild(n);if(o){var s=o.getNode();s&&s.isFile()?(o=o.getPath(),r&&(o=li(r,o)),e[o]=s.getBuffer()):s&&s.isDirectory()&&this._toJSON(o,e,r)}}return t=t.getPath(),r&&(t=li(r,t)),t&&i&&(e[t]=null),e},t.prototype.toJSON=function(t,e,r){var n,i;void 0===e&&(e={}),void 0===r&&(r=!1);var o=[];if(t){t instanceof Array||(t=[t]);try{for(var s=Xe(t),a=s.next();!a.done;a=s.next()){var f=Zo(a.value),u=this.volume.getResolvedLink(f);u&&o.push(u)}}catch(t){var h={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(h)throw h.error}}}else o.push(this.volume.root);if(!o.length)return e;try{for(var l=Xe(o),c=l.next();!c.done;c=l.next())u=c.value,this._toJSON(u,e,r?u.getPath():"")}catch(t){var p={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(p)throw p.error}}return e},t.prototype.fromJSONFixed=function(t,e){for(var r in e){var n=e[r];if(n?null!==Object.getPrototypeOf(n):null!==n){var i=Xo(r);1<i.length&&(i="/"+i.slice(0,i.length-1).join("/"),t.mkdirpBase(i,511)),t.writeFileSync(r,n||"")}else t.mkdirpBase(r,511)}},t.prototype.fromJSON=function(t){this.volume=new Jo,this.fromJSONFixed(this.volume,t),this.fs=ts(this.volume),this.volume.releasedFds=[0,1,2],t=this.volume.openSync("/dev/stderr","w");var e=this.volume.openSync("/dev/stdout","w"),r=this.volume.openSync("/dev/stdin","r");if(2!==t)throw Error("invalid handle for stderr: "+t);if(1!==e)throw Error("invalid handle for stdout: "+e);if(0!==r)throw Error("invalid handle for stdin: "+r)},t.prototype.getStdOut=function(){return function(t,e,r,n){return new(r||(r=Promise))((function(e,i){function o(t){try{a(n.next(t))}catch(t){i(t)}}function s(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(o,s)}a((n=n.apply(t,[])).next())}))}(this,0,void 0,(function(){var t=this;return function(t,e){function r(t){return function(e){return n([t,e])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;f;)try{if(i=1,o&&(s=2&r[0]?o.return:r[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,r[1])).done)return s;switch(o=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return f.label++,{value:r[1],done:!1};case 5:f.label++,o=r[1],r=[0];continue;case 7:r=f.ops.pop(),f.trys.pop();continue;default:if(!((s=0<(s=f.trys).length&&s[s.length-1])||6!==r[0]&&2!==r[0])){f=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3]))f.label=r[1];else if(6===r[0]&&f.label<s[1])f.label=s[1],s=r;else{if(!(s&&f.label<s[2])){s[2]&&f.ops.pop(),f.trys.pop();continue}f.label=s[2],f.ops.push(r)}}r=e.call(t,f)}catch(t){r=[6,t],o=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,s,a,f={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a}(this,(function(){return[2,new Promise((function(e){e(t.fs.readFileSync("/dev/stdout","utf8"))}))]}))}))},t}();const rs=class{programName;wasmModule;constructor(t,e){this.programName=t,this.wasmModule=e}run(t,e,r,n,i,o,s,a,f){console.log("wasmer runnable run:",this.programName,t),"function"!=typeof e&&(e=()=>{}),"function"!=typeof r&&(r=()=>{}),"function"!=typeof n&&(n=()=>{}),i instanceof Array||(i=[]),"function"!=typeof o&&(o=()=>{}),"function"!=typeof s&&(s=t=>{console.error(t)}),"function"!=typeof a&&(a=()=>{});const u=new es;if(this._writeFilesToFS(u,i),u.volume.fds[0].node.read=e,f){"string"!=typeof f&&(f=(f||"").toString()),f.endsWith("\n")||(f+="\n");let t=0;u.volume.fds[0].node.read=e=>{if(t%2!=0)return t++,0;for(let t=0;t<f.length;t++)e[t]=f.charCodeAt(t);return t++,f.length}}u.volume.fds[1].node.write=(t,e,n,i)=>(r(new TextDecoder("utf-8").decode(t)),t.length),u.volume.fds[2].node.write=(t,e,r,i)=>(n(new TextDecoder("utf-8").decode(t)),t.length);const h=u.volume.openSync("/dev/tty","w+");u.volume.fds[h].node.read=u.volume.fds[0].node.read,u.volume.fds[h].node.write=u.volume.fds[1].node.write;let l=new qe({args:[this.programName,...t],env:{},bindings:{...Ze.Z,fs:u.fs},preopens:{".":".","/":"/"}});const c=l.getImports(this.wasmModule);WebAssembly.instantiate(this.wasmModule,{...c}).then((t=>{let e;try{this._writeFilesToFS(u,i);try{l.start(t)}catch(t){0!=t.code&&Ze.Z.exit(t.code)}e=this._readFilesFromFS(u),a(e)}catch(t){s(t.message)}finally{o(e||i)}}))}runHeadless(t,e,r,n,i,o){console.log("wasmer runnable run headless:",this.programName,t),"function"!=typeof r&&(r=()=>{});let s="",a="",f="";this.run(t,(()=>(console.log("called runHeadless stdin"),0)),(t=>(s+=t,a+=t,t.length)),(t=>(s+=t,f+=t,t.length)),e,(()=>r({output:s,stdout:a,stderr:f})),n,i,o)}_readFilesFromFS(t,e="/"){const r=t.volume.toJSON(e),n=["/dev/stdin","/dev/stdout","/dev/stderr","/dev/tty"];return Object.entries(r).filter((([t,e])=>!n.includes(t))).map((([t,e])=>({name:t,timestamp:Date.now(),bytes:(new TextEncoder).encode(e)})))}_writeFilesToFS(t,e=[]){e.forEach((e=>{try{if(e.bytes instanceof Uint8Array){const r=e.name.split("/").slice(0,-1).join("/");t.fs.mkdirSync(r,{recursive:!0}),t.fs.writeFileSync(e.name,e.bytes)}}catch(t){console.error(t.name+": "+t.message)}}))}};function ns(t){let e=t.length;for(;--e>=0;)t[e]=0}const is=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),os=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),ss=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),as=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fs=new Array(576);ns(fs);const us=new Array(60);ns(us);const hs=new Array(512);ns(hs);const ls=new Array(256);ns(ls);const cs=new Array(29);ns(cs);const ps=new Array(30);function ds(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}let _s,gs,ys;function ms(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}ns(ps);const Es=t=>t<256?hs[t]:hs[256+(t>>>7)],Ss=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},Is=(t,e,r)=>{t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,Ss(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},ws=(t,e,r)=>{Is(t,r[2*e],r[2*e+1])},As=(t,e)=>{let r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},vs=(t,e,r)=>{const n=new Array(16);let i,o,s=0;for(i=1;i<=15;i++)n[i]=s=s+r[i-1]<<1;for(o=0;o<=e;o++){let e=t[2*o+1];0!==e&&(t[2*o]=As(n[e]++,e))}},Ts=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},bs=t=>{t.bi_valid>8?Ss(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Rs=(t,e,r,n)=>{const i=2*e,o=2*r;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]},Os=(t,e,r)=>{const n=t.heap[r];let i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&Rs(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Rs(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},Ns=(t,e,r)=>{let n,i,o,s,a=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*a]<<8|t.pending_buf[t.d_buf+2*a+1],i=t.pending_buf[t.l_buf+a],a++,0===n?ws(t,i,e):(o=ls[i],ws(t,o+256+1,e),s=is[o],0!==s&&(i-=cs[o],Is(t,i,s)),n--,o=Es(n),ws(t,o,r),s=os[o],0!==s&&(n-=ps[o],Is(t,n,s)))}while(a<t.last_lit);ws(t,256,e)},Cs=(t,e)=>{const r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,o=e.stat_desc.elems;let s,a,f,u=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<o;s++)0!==r[2*s]?(t.heap[++t.heap_len]=u=s,t.depth[s]=0):r[2*s+1]=0;for(;t.heap_len<2;)f=t.heap[++t.heap_len]=u<2?++u:0,r[2*f]=1,t.depth[f]=0,t.opt_len--,i&&(t.static_len-=n[2*f+1]);for(e.max_code=u,s=t.heap_len>>1;s>=1;s--)Os(t,r,s);f=o;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Os(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,r[2*f]=r[2*s]+r[2*a],t.depth[f]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,r[2*s+1]=r[2*a+1]=f,t.heap[1]=f++,Os(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,f=e.stat_desc.max_length;let u,h,l,c,p,d,_=0;for(c=0;c<=15;c++)t.bl_count[c]=0;for(r[2*t.heap[t.heap_max]+1]=0,u=t.heap_max+1;u<573;u++)h=t.heap[u],c=r[2*r[2*h+1]+1]+1,c>f&&(c=f,_++),r[2*h+1]=c,h>n||(t.bl_count[c]++,p=0,h>=a&&(p=s[h-a]),d=r[2*h],t.opt_len+=d*(c+p),o&&(t.static_len+=d*(i[2*h+1]+p)));if(0!==_){do{for(c=f-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[f]--,_-=2}while(_>0);for(c=f;0!==c;c--)for(h=t.bl_count[c];0!==h;)l=t.heap[--u],l>n||(r[2*l+1]!==c&&(t.opt_len+=(c-r[2*l+1])*r[2*l],r[2*l+1]=c),h--)}})(t,e),vs(r,u,t.bl_count)},Ls=(t,e,r)=>{let n,i,o=-1,s=e[1],a=0,f=7,u=4;for(0===s&&(f=138,u=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=e[2*(n+1)+1],++a<f&&i===s||(a<u?t.bl_tree[2*i]+=a:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,o=i,0===s?(f=138,u=3):i===s?(f=6,u=3):(f=7,u=4))},Ps=(t,e,r)=>{let n,i,o=-1,s=e[1],a=0,f=7,u=4;for(0===s&&(f=138,u=3),n=0;n<=r;n++)if(i=s,s=e[2*(n+1)+1],!(++a<f&&i===s)){if(a<u)do{ws(t,i,t.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(ws(t,i,t.bl_tree),a--),ws(t,16,t.bl_tree),Is(t,a-3,2)):a<=10?(ws(t,17,t.bl_tree),Is(t,a-3,3)):(ws(t,18,t.bl_tree),Is(t,a-11,7));a=0,o=i,0===s?(f=138,u=3):i===s?(f=6,u=3):(f=7,u=4)}};let Ws=!1;const Bs=(t,e,r,n)=>{Is(t,0+(n?1:0),3),((t,e,r,n)=>{bs(t),Ss(t,r),Ss(t,~r),t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r})(t,e,r)};var Fs={_tr_init:t=>{Ws||((()=>{let t,e,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for(cs[n]=r,t=0;t<1<<is[n];t++)ls[r++]=n;for(ls[r-1]=n,i=0,n=0;n<16;n++)for(ps[n]=i,t=0;t<1<<os[n];t++)hs[i++]=n;for(i>>=7;n<30;n++)for(ps[n]=i<<7,t=0;t<1<<os[n]-7;t++)hs[256+i++]=n;for(e=0;e<=15;e++)o[e]=0;for(t=0;t<=143;)fs[2*t+1]=8,t++,o[8]++;for(;t<=255;)fs[2*t+1]=9,t++,o[9]++;for(;t<=279;)fs[2*t+1]=7,t++,o[7]++;for(;t<=287;)fs[2*t+1]=8,t++,o[8]++;for(vs(fs,287,o),t=0;t<30;t++)us[2*t+1]=5,us[2*t]=As(t,5);_s=new ds(fs,is,257,286,15),gs=new ds(us,os,0,30,15),ys=new ds(new Array(0),ss,0,19,7)})(),Ws=!0),t.l_desc=new ms(t.dyn_ltree,_s),t.d_desc=new ms(t.dyn_dtree,gs),t.bl_desc=new ms(t.bl_tree,ys),t.bi_buf=0,t.bi_valid=0,Ts(t)},_tr_stored_block:Bs,_tr_flush_block:(t,e,r,n)=>{let i,o,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),Cs(t,t.l_desc),Cs(t,t.d_desc),s=(t=>{let e;for(Ls(t,t.dyn_ltree,t.l_desc.max_code),Ls(t,t.dyn_dtree,t.d_desc.max_code),Cs(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*as[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?Bs(t,e,r,n):4===t.strategy||o===i?(Is(t,2+(n?1:0),3),Ns(t,fs,us)):(Is(t,4+(n?1:0),3),((t,e,r,n)=>{let i;for(Is(t,e-257,5),Is(t,r-1,5),Is(t,n-4,4),i=0;i<n;i++)Is(t,t.bl_tree[2*as[i]+1],3);Ps(t,t.dyn_ltree,e-1),Ps(t,t.dyn_dtree,r-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),Ns(t,t.dyn_ltree,t.dyn_dtree)),Ts(t),n&&bs(t)},_tr_tally:(t,e,r)=>(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(ls[r]+256+1)]++,t.dyn_dtree[2*Es(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{Is(t,2,3),ws(t,256,fs),(t=>{16===t.bi_valid?(Ss(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}},Ds=(t,e,r,n)=>{let i=65535&t|0,o=t>>>16&65535|0,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{i=i+e[n++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16|0};const ks=new Uint32Array((()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e})());var Us=(t,e,r,n)=>{const i=ks,o=n+r;t^=-1;for(let r=n;r<o;r++)t=t>>>8^i[255&(t^e[r])];return-1^t},Ms={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},xs={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Gs,_tr_stored_block:Hs,_tr_flush_block:Ys,_tr_tally:js,_tr_align:Vs}=Fs,{Z_NO_FLUSH:zs,Z_PARTIAL_FLUSH:Ks,Z_FULL_FLUSH:qs,Z_FINISH:Zs,Z_BLOCK:Xs,Z_OK:Js,Z_STREAM_END:$s,Z_STREAM_ERROR:Qs,Z_DATA_ERROR:ta,Z_BUF_ERROR:ea,Z_DEFAULT_COMPRESSION:ra,Z_FILTERED:na,Z_HUFFMAN_ONLY:ia,Z_RLE:oa,Z_FIXED:sa,Z_DEFAULT_STRATEGY:aa,Z_UNKNOWN:fa,Z_DEFLATED:ua}=xs,ha=258,la=262,ca=103,pa=113,da=666,_a=(t,e)=>(t.msg=Ms[e],e),ga=t=>(t<<1)-(t>4?9:0),ya=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let ma=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask;const Ea=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},Sa=(t,e)=>{Ys(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Ea(t.strm)},Ia=(t,e)=>{t.pending_buf[t.pending++]=e},wa=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Aa=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),1===t.state.wrap?t.adler=Ds(t.adler,e,i,r):2===t.state.wrap&&(t.adler=Us(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},va=(t,e)=>{let r,n,i=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match;const f=t.strstart>t.w_size-la?t.strstart-(t.w_size-la):0,u=t.window,h=t.w_mask,l=t.prev,c=t.strstart+ha;let p=u[o+s-1],d=u[o+s];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(r=e,u[r+s]===d&&u[r+s-1]===p&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&o<c);if(n=ha-(c-o),o=c-ha,n>s){if(t.match_start=e,s=n,n>=a)break;p=u[o+s-1],d=u[o+s]}}}while((e=l[e&h])>f&&0!=--i);return s<=t.lookahead?s:t.lookahead},Ta=t=>{const e=t.w_size;let r,n,i,o,s;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-la)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do{i=t.head[--r],t.head[r]=i>=e?i-e:0}while(--n);n=e,r=n;do{i=t.prev[--r],t.prev[r]=i>=e?i-e:0}while(--n);o+=e}if(0===t.strm.avail_in)break;if(n=Aa(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=n,t.lookahead+t.insert>=3)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=ma(t,t.ins_h,t.window[s+1]);t.insert&&(t.ins_h=ma(t,t.ins_h,t.window[s+3-1]),t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<la&&0!==t.strm.avail_in)},ba=(t,e)=>{let r,n;for(;;){if(t.lookahead<la){if(Ta(t),t.lookahead<la&&e===zs)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=ma(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-la&&(t.match_length=va(t,r)),t.match_length>=3)if(n=js(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=ma(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ma(t,t.ins_h,t.window[t.strstart+1]);else n=js(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Sa(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Zs?(Sa(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Sa(t,!1),0===t.strm.avail_out)?1:2},Ra=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<la){if(Ta(t),t.lookahead<la&&e===zs)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=ma(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-la&&(t.match_length=va(t,r),t.match_length<=5&&(t.strategy===na||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=js(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=ma(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Sa(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=js(t,0,t.window[t.strstart-1]),n&&Sa(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=js(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Zs?(Sa(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Sa(t,!1),0===t.strm.avail_out)?1:2};function Oa(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}const Na=[new Oa(0,0,0,0,((t,e)=>{let r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ta(t),0===t.lookahead&&e===zs)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Sa(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-la&&(Sa(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Zs?(Sa(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Sa(t,!1),t.strm.avail_out),1)})),new Oa(4,4,8,4,ba),new Oa(4,5,16,8,ba),new Oa(4,6,32,32,ba),new Oa(4,4,16,16,Ra),new Oa(8,16,32,32,Ra),new Oa(8,16,128,128,Ra),new Oa(8,32,128,256,Ra),new Oa(32,128,258,1024,Ra),new Oa(32,258,258,4096,Ra)];function Ca(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ua,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ya(this.dyn_ltree),ya(this.dyn_dtree),ya(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ya(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ya(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const La=t=>{if(!t||!t.state)return _a(t,Qs);t.total_in=t.total_out=0,t.data_type=fa;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:pa,t.adler=2===e.wrap?0:1,e.last_flush=zs,Gs(e),Js},Pa=t=>{const e=La(t);var r;return e===Js&&((r=t.state).window_size=2*r.w_size,ya(r.head),r.max_lazy_match=Na[r.level].max_lazy,r.good_match=Na[r.level].good_length,r.nice_match=Na[r.level].nice_length,r.max_chain_length=Na[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),e},Wa=(t,e,r,n,i,o)=>{if(!t)return Qs;let s=1;if(e===ra&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==ua||n<8||n>15||e<0||e>9||o<0||o>sa)return _a(t,Qs);8===n&&(n=9);const a=new Ca;return t.state=a,a.strm=t,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=3*a.lit_bufsize,a.level=e,a.strategy=o,a.method=r,Pa(t)};var Ba=Wa,Fa=(t,e)=>t&&t.state?2!==t.state.wrap?Qs:(t.state.gzhead=e,Js):Qs,Da=(t,e)=>{let r,n;if(!t||!t.state||e>Xs||e<0)return t?_a(t,Qs):Qs;const i=t.state;if(!t.output||!t.input&&0!==t.avail_in||i.status===da&&e!==Zs)return _a(t,0===t.avail_out?ea:Qs);i.strm=t;const o=i.last_flush;if(i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,Ia(i,31),Ia(i,139),Ia(i,8),i.gzhead?(Ia(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Ia(i,255&i.gzhead.time),Ia(i,i.gzhead.time>>8&255),Ia(i,i.gzhead.time>>16&255),Ia(i,i.gzhead.time>>24&255),Ia(i,9===i.level?2:i.strategy>=ia||i.level<2?4:0),Ia(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(Ia(i,255&i.gzhead.extra.length),Ia(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=Us(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(Ia(i,0),Ia(i,0),Ia(i,0),Ia(i,0),Ia(i,0),Ia(i,9===i.level?2:i.strategy>=ia||i.level<2?4:0),Ia(i,3),i.status=pa);else{let e=ua+(i.w_bits-8<<4)<<8,r=-1;r=i.strategy>=ia||i.level<2?0:i.level<6?1:6===i.level?2:3,e|=r<<6,0!==i.strstart&&(e|=32),e+=31-e%31,i.status=pa,wa(i,e),0!==i.strstart&&(wa(i,t.adler>>>16),wa(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(r=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>r&&(t.adler=Us(t.adler,i.pending_buf,i.pending-r,r)),Ea(t),r=i.pending,i.pending!==i.pending_buf_size));)Ia(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(t.adler=Us(t.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=Us(t.adler,i.pending_buf,i.pending-r,r)),Ea(t),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,Ia(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(t.adler=Us(t.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=Us(t.adler,i.pending_buf,i.pending-r,r)),Ea(t),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,Ia(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(t.adler=Us(t.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.status=ca)}else i.status=ca;if(i.status===ca&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Ea(t),i.pending+2<=i.pending_buf_size&&(Ia(i,255&t.adler),Ia(i,t.adler>>8&255),t.adler=0,i.status=pa)):i.status=pa),0!==i.pending){if(Ea(t),0===t.avail_out)return i.last_flush=-1,Js}else if(0===t.avail_in&&ga(e)<=ga(o)&&e!==Zs)return _a(t,ea);if(i.status===da&&0!==t.avail_in)return _a(t,ea);if(0!==t.avail_in||0!==i.lookahead||e!==zs&&i.status!==da){let r=i.strategy===ia?((t,e)=>{let r;for(;;){if(0===t.lookahead&&(Ta(t),0===t.lookahead)){if(e===zs)return 1;break}if(t.match_length=0,r=js(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Sa(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Zs?(Sa(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Sa(t,!1),0===t.strm.avail_out)?1:2})(i,e):i.strategy===oa?((t,e)=>{let r,n,i,o;const s=t.window;for(;;){if(t.lookahead<=ha){if(Ta(t),t.lookahead<=ha&&e===zs)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){o=t.strstart+ha;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);t.match_length=ha-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=js(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=js(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Sa(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Zs?(Sa(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Sa(t,!1),0===t.strm.avail_out)?1:2})(i,e):Na[i.level].func(i,e);if(3!==r&&4!==r||(i.status=da),1===r||3===r)return 0===t.avail_out&&(i.last_flush=-1),Js;if(2===r&&(e===Ks?Vs(i):e!==Xs&&(Hs(i,0,0,!1),e===qs&&(ya(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),Ea(t),0===t.avail_out))return i.last_flush=-1,Js}return e!==Zs?Js:i.wrap<=0?$s:(2===i.wrap?(Ia(i,255&t.adler),Ia(i,t.adler>>8&255),Ia(i,t.adler>>16&255),Ia(i,t.adler>>24&255),Ia(i,255&t.total_in),Ia(i,t.total_in>>8&255),Ia(i,t.total_in>>16&255),Ia(i,t.total_in>>24&255)):(wa(i,t.adler>>>16),wa(i,65535&t.adler)),Ea(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?Js:$s)},ka=t=>{if(!t||!t.state)return Qs;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ca&&e!==pa&&e!==da?_a(t,Qs):(t.state=null,e===pa?_a(t,ta):Js)},Ua=(t,e)=>{let r=e.length;if(!t||!t.state)return Qs;const n=t.state,i=n.wrap;if(2===i||1===i&&42!==n.status||n.lookahead)return Qs;if(1===i&&(t.adler=Ds(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){0===i&&(ya(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(r-n.w_size,r),0),e=t,r=n.w_size}const o=t.avail_in,s=t.next_in,a=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Ta(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=ma(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,Ta(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=s,t.input=a,t.avail_in=o,n.wrap=i,Js};const Ma=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var xa=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const e in r)Ma(r,e)&&(t[e]=r[e])}}return t},Ga=t=>{let e=0;for(let r=0,n=t.length;r<n;r++)e+=t[r].length;const r=new Uint8Array(e);for(let e=0,n=0,i=t.length;e<i;e++){let i=t[e];r.set(i,n),n+=i.length}return r};let Ha=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Ha=!1}const Ya=new Uint8Array(256);for(let t=0;t<256;t++)Ya[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ya[254]=Ya[254]=1;var ja=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,r,n,i,o,s=t.length,a=0;for(i=0;i<s;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(a),o=0,i=0;o<a;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e},Va=(t,e)=>{const r=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let e=t[n++];if(e<128){o[i++]=e;continue}let s=Ya[e];if(s>4)o[i++]=65533,n+=s-1;else{for(e&=2===s?31:3===s?15:7;s>1&&n<r;)e=e<<6|63&t[n++],s--;s>1?o[i++]=65533:e<65536?o[i++]=e:(e-=65536,o[i++]=55296|e>>10&1023,o[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Ha)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r})(o,i)},za=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let r=e-1;for(;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+Ya[t[r]]>e?r:e},Ka=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const qa=Object.prototype.toString,{Z_NO_FLUSH:Za,Z_SYNC_FLUSH:Xa,Z_FULL_FLUSH:Ja,Z_FINISH:$a,Z_OK:Qa,Z_STREAM_END:tf,Z_DEFAULT_COMPRESSION:ef,Z_DEFAULT_STRATEGY:rf,Z_DEFLATED:nf}=xs;function of(t){this.options=xa({level:ef,method:nf,chunkSize:16384,windowBits:15,memLevel:8,strategy:rf},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ka,this.strm.avail_out=0;let r=Ba(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Qa)throw new Error(Ms[r]);if(e.header&&Fa(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?ja(e.dictionary):"[object ArrayBuffer]"===qa.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=Ua(this.strm,t),r!==Qa)throw new Error(Ms[r]);this._dict_set=!0}}function sf(t,e){const r=new of(e);if(r.push(t,!0),r.err)throw r.msg||Ms[r.err];return r.result}of.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=e===~~e?e:!0===e?$a:Za,"string"==typeof t?r.input=ja(t):"[object ArrayBuffer]"===qa.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===Xa||o===Ja)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Da(r,o),i===tf)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=ka(this.strm),this.onEnd(i),this.ended=!0,i===Qa;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},of.prototype.onData=function(t){this.chunks.push(t)},of.prototype.onEnd=function(t){t===Qa&&(this.result=Ga(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var af={Deflate:of,deflate:sf,deflateRaw:function(t,e){return(e=e||{}).raw=!0,sf(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,sf(t,e)},constants:xs},ff=function(t,e){let r,n,i,o,s,a,f,u,h,l,c,p,d,_,g,y,m,E,S,I,w,A,v,T;const b=t.state;r=t.next_in,v=t.input,n=r+(t.avail_in-5),i=t.next_out,T=t.output,o=i-(e-t.avail_out),s=i+(t.avail_out-257),a=b.dmax,f=b.wsize,u=b.whave,h=b.wnext,l=b.window,c=b.hold,p=b.bits,d=b.lencode,_=b.distcode,g=(1<<b.lenbits)-1,y=(1<<b.distbits)-1;t:do{p<15&&(c+=v[r++]<<p,p+=8,c+=v[r++]<<p,p+=8),m=d[c&g];e:for(;;){if(E=m>>>24,c>>>=E,p-=E,E=m>>>16&255,0===E)T[i++]=65535&m;else{if(!(16&E)){if(0==(64&E)){m=d[(65535&m)+(c&(1<<E)-1)];continue e}if(32&E){b.mode=12;break t}t.msg="invalid literal/length code",b.mode=30;break t}S=65535&m,E&=15,E&&(p<E&&(c+=v[r++]<<p,p+=8),S+=c&(1<<E)-1,c>>>=E,p-=E),p<15&&(c+=v[r++]<<p,p+=8,c+=v[r++]<<p,p+=8),m=_[c&y];r:for(;;){if(E=m>>>24,c>>>=E,p-=E,E=m>>>16&255,!(16&E)){if(0==(64&E)){m=_[(65535&m)+(c&(1<<E)-1)];continue r}t.msg="invalid distance code",b.mode=30;break t}if(I=65535&m,E&=15,p<E&&(c+=v[r++]<<p,p+=8,p<E&&(c+=v[r++]<<p,p+=8)),I+=c&(1<<E)-1,I>a){t.msg="invalid distance too far back",b.mode=30;break t}if(c>>>=E,p-=E,E=i-o,I>E){if(E=I-E,E>u&&b.sane){t.msg="invalid distance too far back",b.mode=30;break t}if(w=0,A=l,0===h){if(w+=f-E,E<S){S-=E;do{T[i++]=l[w++]}while(--E);w=i-I,A=T}}else if(h<E){if(w+=f+h-E,E-=h,E<S){S-=E;do{T[i++]=l[w++]}while(--E);if(w=0,h<S){E=h,S-=E;do{T[i++]=l[w++]}while(--E);w=i-I,A=T}}}else if(w+=h-E,E<S){S-=E;do{T[i++]=l[w++]}while(--E);w=i-I,A=T}for(;S>2;)T[i++]=A[w++],T[i++]=A[w++],T[i++]=A[w++],S-=3;S&&(T[i++]=A[w++],S>1&&(T[i++]=A[w++]))}else{w=i-I;do{T[i++]=T[w++],T[i++]=T[w++],T[i++]=T[w++],S-=3}while(S>2);S&&(T[i++]=T[w++],S>1&&(T[i++]=T[w++]))}break}}break}}while(r<n&&i<s);S=p>>3,r-=S,p-=S<<3,c&=(1<<p)-1,t.next_in=r,t.next_out=i,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=i<s?s-i+257:257-(i-s),b.hold=c,b.bits=p};const uf=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),hf=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),lf=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),cf=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var pf=(t,e,r,n,i,o,s,a)=>{const f=a.bits;let u,h,l,c,p,d,_=0,g=0,y=0,m=0,E=0,S=0,I=0,w=0,A=0,v=0,T=null,b=0;const R=new Uint16Array(16),O=new Uint16Array(16);let N,C,L,P=null,W=0;for(_=0;_<=15;_++)R[_]=0;for(g=0;g<n;g++)R[e[r+g]]++;for(E=f,m=15;m>=1&&0===R[m];m--);if(E>m&&(E=m),0===m)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(y=1;y<m&&0===R[y];y++);for(E<y&&(E=y),w=1,_=1;_<=15;_++)if(w<<=1,w-=R[_],w<0)return-1;if(w>0&&(0===t||1!==m))return-1;for(O[1]=0,_=1;_<15;_++)O[_+1]=O[_]+R[_];for(g=0;g<n;g++)0!==e[r+g]&&(s[O[e[r+g]]++]=g);if(0===t?(T=P=s,d=19):1===t?(T=uf,b-=257,P=hf,W-=257,d=256):(T=lf,P=cf,d=-1),v=0,g=0,_=y,p=o,S=E,I=0,l=-1,A=1<<E,c=A-1,1===t&&A>852||2===t&&A>592)return 1;for(;;){N=_-I,s[g]<d?(C=0,L=s[g]):s[g]>d?(C=P[W+s[g]],L=T[b+s[g]]):(C=96,L=0),u=1<<_-I,h=1<<S,y=h;do{h-=u,i[p+(v>>I)+h]=N<<24|C<<16|L|0}while(0!==h);for(u=1<<_-1;v&u;)u>>=1;if(0!==u?(v&=u-1,v+=u):v=0,g++,0==--R[_]){if(_===m)break;_=e[r+s[g]]}if(_>E&&(v&c)!==l){for(0===I&&(I=E),p+=y,S=_-I,w=1<<S;S+I<m&&(w-=R[S+I],!(w<=0));)S++,w<<=1;if(A+=1<<S,1===t&&A>852||2===t&&A>592)return 1;l=v&c,i[l]=E<<24|S<<16|p-o|0}}return 0!==v&&(i[p+v]=_-I<<24|64<<16|0),a.bits=E,0};const{Z_FINISH:df,Z_BLOCK:_f,Z_TREES:gf,Z_OK:yf,Z_STREAM_END:mf,Z_NEED_DICT:Ef,Z_STREAM_ERROR:Sf,Z_DATA_ERROR:If,Z_MEM_ERROR:wf,Z_BUF_ERROR:Af,Z_DEFLATED:vf}=xs,Tf=12,bf=30,Rf=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Of(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Nf=t=>{if(!t||!t.state)return Sf;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,yf},Cf=t=>{if(!t||!t.state)return Sf;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Nf(t)},Lf=(t,e)=>{let r;if(!t||!t.state)return Sf;const n=t.state;return e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Sf:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Cf(t))},Pf=(t,e)=>{if(!t)return Sf;const r=new Of;t.state=r,r.window=null;const n=Lf(t,e);return n!==yf&&(t.state=null),n};let Wf,Bf,Ff=!0;const Df=t=>{if(Ff){Wf=new Int32Array(512),Bf=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(pf(1,t.lens,0,288,Wf,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;pf(2,t.lens,0,32,Bf,0,t.work,{bits:5}),Ff=!1}t.lencode=Wf,t.lenbits=9,t.distcode=Bf,t.distbits=5},kf=(t,e,r,n)=>{let i;const o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(e.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(e.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(e.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var Uf=Cf,Mf=Pf,xf=(t,e)=>{let r,n,i,o,s,a,f,u,h,l,c,p,d,_,g,y,m,E,S,I,w,A,v=0;const T=new Uint8Array(4);let b,R;const O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return Sf;r=t.state,r.mode===Tf&&(r.mode=13),s=t.next_out,i=t.output,f=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,u=r.hold,h=r.bits,l=a,c=f,A=yf;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(2&r.wrap&&35615===u){r.check=0,T[0]=255&u,T[1]=u>>>8&255,r.check=Us(r.check,T,2,0),u=0,h=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",r.mode=bf;break}if((15&u)!==vf){t.msg="unknown compression method",r.mode=bf;break}if(u>>>=4,h-=4,w=8+(15&u),0===r.wbits)r.wbits=w;else if(w>r.wbits){t.msg="invalid window size",r.mode=bf;break}r.dmax=1<<r.wbits,t.adler=r.check=1,r.mode=512&u?10:Tf,u=0,h=0;break;case 2:for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(r.flags=u,(255&r.flags)!==vf){t.msg="unknown compression method",r.mode=bf;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=bf;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&(T[0]=255&u,T[1]=u>>>8&255,r.check=Us(r.check,T,2,0)),u=0,h=0,r.mode=3;case 3:for(;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.head&&(r.head.time=u),512&r.flags&&(T[0]=255&u,T[1]=u>>>8&255,T[2]=u>>>16&255,T[3]=u>>>24&255,r.check=Us(r.check,T,4,0)),u=0,h=0,r.mode=4;case 4:for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&(T[0]=255&u,T[1]=u>>>8&255,r.check=Us(r.check,T,2,0)),u=0,h=0,r.mode=5;case 5:if(1024&r.flags){for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&(T[0]=255&u,T[1]=u>>>8&255,r.check=Us(r.check,T,2,0)),u=0,h=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(p=r.length,p>a&&(p=a),p&&(r.head&&(w=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+p),w)),512&r.flags&&(r.check=Us(r.check,n,p,o)),a-=p,o+=p,r.length-=p),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===a)break t;p=0;do{w=n[o+p++],r.head&&w&&r.length<65536&&(r.head.name+=String.fromCharCode(w))}while(w&&p<a);if(512&r.flags&&(r.check=Us(r.check,n,p,o)),a-=p,o+=p,w)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===a)break t;p=0;do{w=n[o+p++],r.head&&w&&r.length<65536&&(r.head.comment+=String.fromCharCode(w))}while(w&&p<a);if(512&r.flags&&(r.check=Us(r.check,n,p,o)),a-=p,o+=p,w)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(u!==(65535&r.check)){t.msg="header crc mismatch",r.mode=bf;break}u=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Tf;break;case 10:for(;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}t.adler=r.check=Rf(u),u=0,h=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=h,Ef;t.adler=r.check=1,r.mode=Tf;case Tf:if(e===_f||e===gf)break t;case 13:if(r.last){u>>>=7&h,h-=7&h,r.mode=27;break}for(;h<3;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}switch(r.last=1&u,u>>>=1,h-=1,3&u){case 0:r.mode=14;break;case 1:if(Df(r),r.mode=20,e===gf){u>>>=2,h-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=bf}u>>>=2,h-=2;break;case 14:for(u>>>=7&h,h-=7&h;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if((65535&u)!=(u>>>16^65535)){t.msg="invalid stored block lengths",r.mode=bf;break}if(r.length=65535&u,u=0,h=0,r.mode=15,e===gf)break t;case 15:r.mode=16;case 16:if(p=r.length,p){if(p>a&&(p=a),p>f&&(p=f),0===p)break t;i.set(n.subarray(o,o+p),s),a-=p,o+=p,f-=p,s+=p,r.length-=p;break}r.mode=Tf;break;case 17:for(;h<14;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(r.nlen=257+(31&u),u>>>=5,h-=5,r.ndist=1+(31&u),u>>>=5,h-=5,r.ncode=4+(15&u),u>>>=4,h-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=bf;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;h<3;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.lens[O[r.have++]]=7&u,u>>>=3,h-=3}for(;r.have<19;)r.lens[O[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,b={bits:r.lenbits},A=pf(0,r.lens,0,19,r.lencode,0,r.work,b),r.lenbits=b.bits,A){t.msg="invalid code lengths set",r.mode=bf;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;v=r.lencode[u&(1<<r.lenbits)-1],g=v>>>24,y=v>>>16&255,m=65535&v,!(g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(m<16)u>>>=g,h-=g,r.lens[r.have++]=m;else{if(16===m){for(R=g+2;h<R;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(u>>>=g,h-=g,0===r.have){t.msg="invalid bit length repeat",r.mode=bf;break}w=r.lens[r.have-1],p=3+(3&u),u>>>=2,h-=2}else if(17===m){for(R=g+3;h<R;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=g,h-=g,w=0,p=3+(7&u),u>>>=3,h-=3}else{for(R=g+7;h<R;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=g,h-=g,w=0,p=11+(127&u),u>>>=7,h-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=bf;break}for(;p--;)r.lens[r.have++]=w}}if(r.mode===bf)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=bf;break}if(r.lenbits=9,b={bits:r.lenbits},A=pf(1,r.lens,0,r.nlen,r.lencode,0,r.work,b),r.lenbits=b.bits,A){t.msg="invalid literal/lengths set",r.mode=bf;break}if(r.distbits=6,r.distcode=r.distdyn,b={bits:r.distbits},A=pf(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,b),r.distbits=b.bits,A){t.msg="invalid distances set",r.mode=bf;break}if(r.mode=20,e===gf)break t;case 20:r.mode=21;case 21:if(a>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=h,ff(t,c),s=t.next_out,i=t.output,f=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,u=r.hold,h=r.bits,r.mode===Tf&&(r.back=-1);break}for(r.back=0;v=r.lencode[u&(1<<r.lenbits)-1],g=v>>>24,y=v>>>16&255,m=65535&v,!(g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(y&&0==(240&y)){for(E=g,S=y,I=m;v=r.lencode[I+((u&(1<<E+S)-1)>>E)],g=v>>>24,y=v>>>16&255,m=65535&v,!(E+g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=E,h-=E,r.back+=E}if(u>>>=g,h-=g,r.back+=g,r.length=m,0===y){r.mode=26;break}if(32&y){r.back=-1,r.mode=Tf;break}if(64&y){t.msg="invalid literal/length code",r.mode=bf;break}r.extra=15&y,r.mode=22;case 22:if(r.extra){for(R=r.extra;h<R;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=r.distcode[u&(1<<r.distbits)-1],g=v>>>24,y=v>>>16&255,m=65535&v,!(g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(0==(240&y)){for(E=g,S=y,I=m;v=r.distcode[I+((u&(1<<E+S)-1)>>E)],g=v>>>24,y=v>>>16&255,m=65535&v,!(E+g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=E,h-=E,r.back+=E}if(u>>>=g,h-=g,r.back+=g,64&y){t.msg="invalid distance code",r.mode=bf;break}r.offset=m,r.extra=15&y,r.mode=24;case 24:if(r.extra){for(R=r.extra;h<R;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=bf;break}r.mode=25;case 25:if(0===f)break t;if(p=c-f,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=bf;break}p>r.wnext?(p-=r.wnext,d=r.wsize-p):d=r.wnext-p,p>r.length&&(p=r.length),_=r.window}else _=i,d=s-r.offset,p=r.length;p>f&&(p=f),f-=p,r.length-=p;do{i[s++]=_[d++]}while(--p);0===r.length&&(r.mode=21);break;case 26:if(0===f)break t;i[s++]=r.length,f--,r.mode=21;break;case 27:if(r.wrap){for(;h<32;){if(0===a)break t;a--,u|=n[o++]<<h,h+=8}if(c-=f,t.total_out+=c,r.total+=c,c&&(t.adler=r.check=r.flags?Us(r.check,i,c,s-c):Ds(r.check,i,c,s-c)),c=f,(r.flags?u:Rf(u))!==r.check){t.msg="incorrect data check",r.mode=bf;break}u=0,h=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(u!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=bf;break}u=0,h=0}r.mode=29;case 29:A=mf;break t;case bf:A=If;break t;case 31:return wf;default:return Sf}return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=h,(r.wsize||c!==t.avail_out&&r.mode<bf&&(r.mode<27||e!==df))&&kf(t,t.output,t.next_out,c-t.avail_out),l-=t.avail_in,c-=t.avail_out,t.total_in+=l,t.total_out+=c,r.total+=c,r.wrap&&c&&(t.adler=r.check=r.flags?Us(r.check,i,c,t.next_out-c):Ds(r.check,i,c,t.next_out-c)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Tf?128:0)+(20===r.mode||15===r.mode?256:0),(0===l&&0===c||e===df)&&A===yf&&(A=Af),A},Gf=t=>{if(!t||!t.state)return Sf;let e=t.state;return e.window&&(e.window=null),t.state=null,yf},Hf=(t,e)=>{if(!t||!t.state)return Sf;const r=t.state;return 0==(2&r.wrap)?Sf:(r.head=e,e.done=!1,yf)},Yf=(t,e)=>{const r=e.length;let n,i,o;return t&&t.state?(n=t.state,0!==n.wrap&&11!==n.mode?Sf:11===n.mode&&(i=1,i=Ds(i,e,r,0),i!==n.check)?If:(o=kf(t,e,r,r),o?(n.mode=31,wf):(n.havedict=1,yf))):Sf},jf=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Vf=Object.prototype.toString,{Z_NO_FLUSH:zf,Z_FINISH:Kf,Z_OK:qf,Z_STREAM_END:Zf,Z_NEED_DICT:Xf,Z_STREAM_ERROR:Jf,Z_DATA_ERROR:$f,Z_MEM_ERROR:Qf}=xs;function tu(t){this.options=xa({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ka,this.strm.avail_out=0;let r=Mf(this.strm,e.windowBits);if(r!==qf)throw new Error(Ms[r]);if(this.header=new jf,Hf(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=ja(e.dictionary):"[object ArrayBuffer]"===Vf.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Yf(this.strm,e.dictionary),r!==qf)))throw new Error(Ms[r])}function eu(t,e){const r=new tu(e);if(r.push(t),r.err)throw r.msg||Ms[r.err];return r.result}tu.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Kf:zf,"[object ArrayBuffer]"===Vf.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=xf(r,s),o===Xf&&i&&(o=Yf(r,i),o===qf?o=xf(r,s):o===$f&&(o=Xf));r.avail_in>0&&o===Zf&&r.state.wrap>0&&0!==t[r.next_in];)Uf(r),o=xf(r,s);switch(o){case Jf:case $f:case Xf:case Qf:return this.onEnd(o),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||o===Zf))if("string"===this.options.to){let t=za(r.output,r.next_out),e=r.next_out-t,i=Va(r.output,t);r.next_out=e,r.avail_out=n-e,e&&r.output.set(r.output.subarray(t,t+e),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==qf||0!==a){if(o===Zf)return o=Gf(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},tu.prototype.onData=function(t){this.chunks.push(t)},tu.prototype.onEnd=function(t){t===qf&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ga(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ru={Inflate:tu,inflate:eu,inflateRaw:function(t,e){return(e=e||{}).raw=!0,eu(t,e)},ungzip:eu,constants:xs};const{Deflate:nu,deflate:iu,deflateRaw:ou,gzip:su}=af,{Inflate:au,inflate:fu,inflateRaw:uu,ungzip:hu}=ru;var lu={Deflate:nu,deflate:iu,deflateRaw:ou,gzip:su,Inflate:au,inflate:fu,inflateRaw:uu,ungzip:hu,constants:xs},cu=r(530),pu=r.n(cu);class du{static WAPM_GRAPHQL_QUERY="query shellGetCommandQuery($command: String!) {\n command: getCommand(name: $command) {\n command\n module {\n name\n abi\n source\n }\n packageVersion {\n version\n package {\n name\n displayName\n }\n filesystem {\n wasm\n host\n }\n distribution {\n downloadUrl\n }\n modules {\n name\n publicUrl\n abi\n }\n commands {\n command\n module {\n name\n abi\n source\n }\n }\n }\n }\n }";static getCommandFromWAPM=async t=>{const e=await fetch("https://registry.wapm.io/graphql",{method:"POST",mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({operationName:"shellGetCommandQuery",query:du.WAPM_GRAPHQL_QUERY,variables:{command:t}})}),r=await e.json();if(r&&r.data&&r.data.command)return r.data.command;throw new Error(`command not found ${t}`)};static fetchCommandFromWAPM=async({args:t,env:e})=>{const r=t[0],n=await du.getCommandFromWAPM(r);if("wasi"!==n.module.abi)throw new Error(`Only WASI modules are supported. The "${r}" command is using the "${n.module.abi}" ABI.`);return n};static WAPM_PACKAGE_QUERY="query shellGetPackageQuery($name: String!, $version: String) {\n packageVersion: getPackageVersion(name: $name, version: $version) {\n version\n package {\n name\n displayName\n }\n filesystem {\n wasm\n host\n }\n distribution {\n downloadUrl\n }\n modules {\n name\n publicUrl\n abi\n }\n commands {\n command\n module {\n name\n abi\n source\n }\n }\n }\n }";static execWapmQuery=async(t,e)=>{const r=await fetch("https://registry.wapm.io/graphql",{method:"POST",mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({query:t,variables:e})}),n=await r.json();if(n&&n.data)return n.data};static getBinaryFromUrl=async t=>{const e=await fetch(t),r=await e.arrayBuffer();return new Uint8Array(r)};static getWAPMPackageFromPackageName=async t=>{let e;if(t.indexOf("@")>-1){const r=t.split("@");t=r[0],e=r[1]}let r=await du.execWapmQuery(du.WAPM_PACKAGE_QUERY,{name:t,version:e});if(r&&r.packageVersion)return r.packageVersion;throw new Error(`Package not found in the registry ${t}`)};static getWasmBinaryFromUrl=async t=>{const e=await fetch(t),r=await e.arrayBuffer();return new Uint8Array(r)};static getWasmBinaryFromCommand=async t=>{const e=await du.fetchCommandFromWAPM({args:[t]}),r=await du.getBinaryFromUrl(e.packageVersion.distribution.downloadUrl),n=lu.inflate(r),i=(await pu()(n.buffer)).filter((t=>t.name.split("/").pop().endsWith(".wasm")));if(i.length>1)throw Error("more than 1 wasm file, don't know what to do :D");return i[0].buffer}}const _u=du,gu=class{isRunningCommand;onActivated;onDisposed;onFileSystemUpdate;onBeforeCommandRun;onCommandRunFinish;_xterm;_xtermEcho;_xtermPrompt;_worker;_wasmRunner;_jsCommands;_wasmModules;_wasmFsFiles;_outputBuffer;_lastOutputTime;constructor(t){this.wasmBinaryPath=t,this._jsCommands=new Map,this.isRunningCommand=!1,this._worker=!1,this._wasmModules=[],this._wasmFsFiles=[],this._outputBuffer="",this._lastOutputTime=0,this.onActivated=()=>{},this.onDisposed=()=>{},this.onFileSystemUpdate=()=>{},this.onBeforeCommandRun=()=>{},this.onCommandRunFinish=()=>{},[typeof Worker,typeof SharedArrayBuffer,typeof Atomics].includes("undefined")?this._wasmRunner=new class{outputBuffer;constructor(){this.outputBuffer=""}runCommand(t,e,r,n,i,o,s,a,f,u,h,l,c){"function"!=typeof f&&(f=()=>{}),"function"!=typeof u&&(u=t=>{console.error(t)}),"function"!=typeof h&&(h=()=>{});const p=t=>{this.outputBuffer+="number"==typeof t?String.fromCharCode(t):t},d=t=>(p(t),o(t)),_=t=>(p(t),s(t));if("emscripten"==r){console.log("wasm runner creates new emscr runnable");const r=t=>this._onEmscrStdinCall(t,i,d,_);new C(t,e,c).run(n,r,d,_,a,f,u,h,l)}else{if("wasmer"!=r)throw new Error("Unknown wasm module type (can only handle emscripten or wasmer)");{console.log("wasm runner creates new wasmer runnable");const r=t=>this._onWasmerStdinCall(t,i,d,_);new rs(t,e).run(n,r,d,_,a,f,u,h,l)}}}runCommandHeadless(t,e,r,n,i,o,s,a,f,u){if("function"!=typeof o&&(o=()=>{}),"function"!=typeof s&&(s=t=>{console.error(t)}),"function"!=typeof a&&(a=()=>{}),"emscripten"==r)console.log("wasm runner creates new emscr runnable"),new C(t,e,u).runHeadless(n,i,o,s,a,f);else{if("wasmer"!=r)throw new Error("Unknown wasm module type (can only handle emscripten or wasmer)");new rs(t,e).runHeadless(n,i,o,s,a,f)}}_onEmscrStdinCall(t,e,r,n){if(0==t.input.length){const e=this.outputBuffer.split(/\r?\n/g).pop(),n=window.prompt(e);if(null==n)return null;r(n+"\r\n"),t.input=(n+"\n").split("").map((t=>t.charCodeAt(0))),t.input.push(null)}return t.input.shift()}_wasmerStdinCallCounter=0;_onWasmerStdinCall(t,e,r,n){if(this._wasmerStdinCallCounter%2!=0)return this._wasmerStdinCallCounter++,0;const i=this.outputBuffer.split(/\r?\n/g).pop(),o=window.prompt(i);return null==o?0:(r(o+"\r\n"),o.forEach(((e,r)=>t[r]=e.charCodeAt(0))),this._wasmerStdinCallCounter++,o.length)}}:this._initWorker(),this._suppressOutputs=!1,window.term=this}async activate(t){this._xterm=t,this._xtermFitAddon=new E.FitAddon,this._xtermFitAddon.activate(this._xterm),setTimeout((()=>this._xtermFitAddon.fit()),1),window.addEventListener("resize",(()=>{this._xtermFitAddon.fit()})),setTimeout((()=>this._initWasmModuleDragAndDrop()),1),this._xtermPrompt=async()=>"$ ",this._xtermEcho=new class{constructor(t=null,e={}){this.term=t,this._handleTermData=this.handleTermData.bind(this),this._handleTermResize=this.handleTermResize.bind(this),this.history=new S(e.historySize||10),this.maxAutocompleteEntries=e.maxAutocompleteEntries||100,this._autocompleteHandlers=[],this._active=!1,this._input="",this._cursor=0,this._activePrompt=null,this._activeCharPrompt=null,this._termSize={cols:0,rows:0},this._disposables=[],t&&(t.loadAddon?t.loadAddon(this):this.attach())}activate(t){this.term=t,this.attach()}dispose(){this.detach()}detach(){this.term.off?(this.term.off("data",this._handleTermData),this.term.off("resize",this._handleTermResize)):(this._disposables.forEach((t=>t.dispose())),this._disposables=[])}attach(){this.term.on?(this.term.on("data",this._handleTermData),this.term.on("resize",this._handleTermResize)):(this._disposables.push(this.term.onData(this._handleTermData)),this._disposables.push(this.term.onResize(this._handleTermResize))),this._termSize={cols:this.term.cols,rows:this.term.rows}}addAutocompleteHandler(t,...e){this._autocompleteHandlers.push({fn:t,args:e})}removeAutocompleteHandler(t){const e=this._autocompleteHandlers.findIndex((e=>e.fn===t));-1!==e&&this._autocompleteHandlers.splice(e,1)}read(t,e="> "){return new Promise(((r,n)=>{this.term.write(t),this._activePrompt={prompt:t,continuationPrompt:e,resolve:r,reject:n},this._input="",this._cursor=0,this._active=!0}))}readChar(t){return new Promise(((e,r)=>{this.term.write(t),this._activeCharPrompt={prompt:t,resolve:e,reject:r}}))}abortRead(t="aborted"){null==this._activePrompt&&null==this._activeCharPrompt||this.term.write("\r\n"),null!=this._activePrompt&&(this._activePrompt.reject(t),this._activePrompt=null),null!=this._activeCharPrompt&&(this._activeCharPrompt.reject(t),this._activeCharPrompt=null),this._active=!1}println(t){this.print(t+"\n")}print(t){const e=t.replace(/[\r\n]+/g,"\n");this.term.write(e.replace(/\n/g,"\r\n"))}printWide(t,e=2){if(0==t.length)return println("");const r=t.reduce(((t,e)=>Math.max(t,e.length)),0)+e,n=Math.floor(this._termSize.cols/r),i=Math.ceil(t.length/n);let o=0;for(let e=0;e<i;++e){let e="";for(let i=0;i<n;++i)if(o<t.length){let n=t[o++];n+=" ".repeat(r-n.length),e+=n}this.println(e)}}applyPrompts(t){const e=(this._activePrompt||{}).prompt||"",r=(this._activePrompt||{}).continuationPrompt||"";return e+t.replace(/\n/g,"\n"+r)}applyPromptOffset(t,e){return this.applyPrompts(t.substr(0,e)).length}clearInput(){const t=this.applyPrompts(this._input),e=T(t,this._termSize.cols),r=this.applyPromptOffset(this._input,this._cursor),{col:n,row:i}=v(t,r,this._termSize.cols),o=e-i-1;for(var s=0;s<o;++s)this.term.write("[E");for(this.term.write("\r[K"),s=1;s<e;++s)this.term.write("[F[K")}setInput(t,e=!0){e&&this.clearInput();const r=this.applyPrompts(t);this.print(r),this._cursor>t.length&&(this._cursor=t.length);const n=this.applyPromptOffset(t,this._cursor),i=T(r,this._termSize.cols),{col:o,row:s}=v(r,n,this._termSize.cols),a=i-s-1;this.term.write("\r");for(var f=0;f<a;++f)this.term.write("[F");for(f=0;f<o;++f)this.term.write("[C");this._input=t}printAndRestartPrompt(t){const e=this._cursor;this.setCursor(this._input.length),this.term.write("\r\n");const r=()=>{this._cursor=e,this.setInput(this._input)},n=t();null==n?r():n.then(r)}setCursor(t){t<0&&(t=0),t>this._input.length&&(t=this._input.length);const e=this.applyPrompts(this._input),r=(T(e,this._termSize.cols),this.applyPromptOffset(this._input,this._cursor)),{col:n,row:i}=v(e,r,this._termSize.cols),o=this.applyPromptOffset(this._input,t),{col:s,row:a}=v(e,o,this._termSize.cols);if(a>i)for(let t=i;t<a;++t)this.term.write("[B");else for(let t=a;t<i;++t)this.term.write("[A");if(s>n)for(let t=n;t<s;++t)this.term.write("[C");else for(let t=s;t<n;++t)this.term.write("[D");this._cursor=t}handleCursorMove(t){if(t>0){const e=Math.min(t,this._input.length-this._cursor);this.setCursor(this._cursor+e)}else if(t<0){const e=Math.max(t,-this._cursor);this.setCursor(this._cursor+e)}}handleCursorErase(t){const{_cursor:e,_input:r}=this;if(t){if(e<=0)return;const t=r.substr(0,e-1)+r.substr(e);this.clearInput(),this._cursor-=1,this.setInput(t,!1)}else{const t=r.substr(0,e)+r.substr(e+1);this.setInput(t)}}handleCursorInsert(t){const{_cursor:e,_input:r}=this,n=r.substr(0,e)+t+r.substr(e);this._cursor+=t.length,this.setInput(n)}handleReadComplete(){this.history&&this.history.push(this._input),this._activePrompt&&(this._activePrompt.resolve(this._input),this._activePrompt=null),this.term.write("\r\n"),this._active=!1}handleTermResize(t){const{rows:e,cols:r}=t;this.clearInput(),this._termSize={cols:r,rows:e},this.setInput(this._input,!1)}handleTermData(t){if(this._active){if(null!=this._activeCharPrompt)return this._activeCharPrompt.resolve(t),this._activeCharPrompt=null,void this.term.write("\r\n");if(t.length>3&&27!==t.charCodeAt(0)){const e=t.replace(/[\r\n]+/g,"\r");Array.from(e).forEach((t=>this.handleData(t)))}else this.handleData(t)}}handleData(t){if(!this._active)return;const e=t.charCodeAt(0);let r;if(27==e)switch(t.substr(1)){case"[A":if(this.history){let t=this.history.getPrevious();t&&(this.setInput(t),this.setCursor(t.length))}break;case"[B":if(this.history){let t=this.history.getNext();t||(t=""),this.setInput(t),this.setCursor(t.length)}break;case"[D":this.handleCursorMove(-1);break;case"[C":this.handleCursorMove(1);break;case"[3~":this.handleCursorErase(!1);break;case"[F":this.setCursor(this._input.length);break;case"[H":this.setCursor(0);break;case"b":r=A(this._input,this._cursor),null!=r&&this.setCursor(r);break;case"f":r=function(t,e){const r=w(t,!1).find((t=>t>e));return null==r?t.length:r}(this._input,this._cursor),null!=r&&this.setCursor(r);break;case"":r=A(this._input,this._cursor),null!=r&&(this.setInput(this._input.substr(0,r)+this._input.substr(this._cursor)),this.setCursor(r))}else if(e<32||127===e)switch(t){case"\r":""!=(n=this._input).trim()&&((n.match(/'/g)||[]).length%2!=0||(n.match(/"/g)||[]).length%2!=0||""==n.split(/(\|\||\||&&)/g).pop().trim()||n.endsWith("\\")&&!n.endsWith("\\\\"))?this.handleCursorInsert("\n"):this.handleReadComplete();break;case"":this.handleCursorErase(!0);break;case"\t":if(this._autocompleteHandlers.length>0){const t=this._input.substr(0,this._cursor),e=b(t),r=function(t,e){const r=(0,I.Q)(e);let n=r.length-1,i=r[n]||"";return""===e.trim()?(n=0,i=""):b(e)&&(n+=1,i=""),t.reduce(((t,{fn:e,args:i})=>{try{return t.concat(e(n,r,...i))}catch(e){return console.error("Auto-complete error:",e),t}}),[]).filter((t=>t.startsWith(i)))}(this._autocompleteHandlers,t);if(r.sort(),0===r.length)e||this.handleCursorInsert(" ");else if(1===r.length){const e=R(t);this.handleCursorInsert(r[0].substr(e.length)+" ")}else if(r.length<=this.maxAutocompleteEntries){const e=O(t,r);if(e){const r=R(t);this.handleCursorInsert(e.substr(r.length))}this.printAndRestartPrompt((()=>{this.printWide(r)}))}else this.printAndRestartPrompt((()=>this.readChar(`Display all ${r.length} possibilities? (y or n)`).then((t=>{"y"!=t&&"Y"!=t||this.printWide(r)}))))}else this.handleCursorInsert(" ");break;case"":this.setCursor(this._input.length),this.term.write("^C\r\n"+((this._activePrompt||{}).prompt||"")),this._input="",this._cursor=0,this.history&&this.history.rewind()}else this.handleCursorInsert(t);var n}},this._xtermEcho.activate(this._xterm),this.registerJsCommand("help",(async function*(t){yield"todo: show helping things"})),this.registerJsCommand("clear",(async t=>"[2J[0;0H"+await this.printWelcomeMessage()+"[A[A")),this._worker instanceof Promise&&await this._worker,this._xterm.onData((t=>this._onXtermData(t))),await this.onActivated(),this._xterm.write(await this.printWelcomeMessage()),this.repl(),setTimeout((()=>this._xterm.focus()),1)}async dispose(){await this._xtermEcho.dispose(),await this._xtermFitAddon.dispose(),this._worker&&this._workerRAW.terminate(),await this.onDisposed()}registerJsCommand(t,e,r){return this._jsCommands.set(t,{name:t,callback:e,autocomplete:r}),this}unregisterJsCommand(t){return this._jsCommands.delete(t)}get jsCommands(){return this._jsCommands}async repl(){try{const t=await this._xtermPrompt(),e=await this._xtermEcho.read(t);if(""==e.trim())return this.repl();await this.onBeforeCommandRun(),this._xterm.write("\r\n"),await this.runLine(e),this._xterm.write("\r\n"),"\n"!=this._outputBuffer.slice(-1)&&this._xterm.write("\r\n"),await this.onCommandRunFinish(),this.repl()}catch(t){}}async runLine(t){try{let e=null;this._suppressOutputs=!1;const r=t.split("|");for(const[t,n]of r.entries()){const i=n.split(/[\s]{1,}/g).filter(Boolean),o=i.shift(),s=this._jsCommands.get(o);if("function"==typeof s?.callback){const n=s.callback(i,e);let o;if(n.then)o=(await n||"").toString();else if(n.next)for await(let t of n)o=null==o?t:o+t;else o=n.toString();t==r.length-1?this._stdout(o):e=o||null}else null==s?t<r.length-1?e=(await this.runWasmCommandHeadless(o,i,e)).stdout:(await this.runWasmCommand(o,i,e),e=null):console.error("command is defined but has no function:",o)}}catch(t){this._xterm.write(t),console.error("Error running line:",t)}}runWasmCommand(t,e,r,n){if(console.log("called runWasmCommand:",t,e),this.isRunningCommand)throw"WasmWebTerm is already running a command";this.isRunningCommand=!0,this._suppressOutputs=!1,this._outputBuffer="";const i=_((async r=>{console.log("command finished:",t,e),this.isRunningCommand=!1,this._wasmFsFiles=r,await this.onFileSystemUpdate(this._wasmFsFiles),this._waitForOutputPause().then((()=>{"function"==typeof n&&n(),this._runWasmCommandPromise?.resolve()}))})),o=_((t=>this._stderr(t)));return this._stdout("loading web assembly ..."),this._getOrFetchWasmModule(t).then((n=>{this._xterm.write("[2K\r"),this._worker?this._worker.runCommand(t,n.module,n.type,e,this._stdinProxy,this._stdoutProxy,this._stderrProxy,this._wasmFsFiles,i,o,null,r,n.runtime):this._wasmRunner.runCommand(t,n.module,n.type,e,null,this._stdoutProxy,this._stderrProxy,this._wasmFsFiles,i,o,null,r,n.runtime)})).catch((t=>{this.isRunningCommand=!1,this._runWasmCommandPromise?.reject("\r\n"+t)})),new Promise(((t,e)=>this._runWasmCommandPromise={resolve:t,reject:e}))}runWasmCommandHeadless(t,e,r,n){if(this.isRunningCommand)throw"WasmWebTerm is already running a command";this.isRunningCommand=!0;let i={resolve:()=>{},reject:()=>{}};const o=_((t=>{this.isRunningCommand=!1,"function"==typeof n&&n(t),i.resolve(t)})),s=_((t=>this._stderr(t))),a=_((()=>{}));return this._getOrFetchWasmModule(t).then((n=>{this._worker?this._worker.runCommandHeadless(t,n.module,n.type,e,this._wasmFsFiles,o,s,a,r,n.runtime):this._wasmRunner.runCommandHeadless(t,n.module,n.type,e,this._wasmFsFiles,o,s,a,r,n.runtime)})).catch((t=>{this.isRunningCommand=!1,i.reject(t)})),new Promise(((t,e)=>i={resolve:t,reject:e}))}_getOrFetchWasmModule(t){return new Promise((async(e,r)=>{let n,i,o=!1;if(this._wasmModules.forEach((e=>{e.name==t&&(n=e)})),n?.module instanceof WebAssembly.Module)e(n);else try{if(n={name:t,type:"emscripten",module:void 0},null!=this.wasmBinaryPath){const e=await fetch(this.wasmBinaryPath+"/"+t+".wasm");if(i=await e.arrayBuffer(),e?.ok&&WebAssembly.validate(i)){const e=await fetch(this.wasmBinaryPath+"/"+t+".js");if(e?.ok){const t=await e.arrayBuffer();"<"!=String.fromCharCode(new Uint8Array(t).subarray(0,1).toString())&&(n.runtime=t)}n.runtime||(n.type="wasmer"),o=!0}else{const e=await fetch(this.wasmBinaryPath+"/"+t+".lnk");if(e?.ok){const t=await e.text(),r=this.wasmBinaryPath+"/"+t+".wasm",s=await fetch(r);if(s?.ok&&(i=await s.arrayBuffer(),WebAssembly.validate(i))){const e=await fetch(this.wasmBinaryPath+"/"+t+".js");if(e?.ok){const t=await e.arrayBuffer();"<"!=String.fromCharCode(new Uint8Array(t).subarray(0,1).toString())&&(n.runtime=t)}n.runtime||(n.type="wasmer"),o=!0}}}}o||(i=await _u.getWasmBinaryFromCommand(t),n.type="wasmer"),n.module=await WebAssembly.compile(i),this._wasmModules.push(n),e(n)}catch(t){r(t)}}))}_initWasmModuleDragAndDrop(){this._xterm.element.addEventListener("dragenter",(t=>{this._xterm.element.style.opacity="0.8"})),this._xterm.element.addEventListener("dragover",(t=>{t.preventDefault(),this._xterm.element.style.opacity="0.8"})),this._xterm.element.addEventListener("dragleave",(t=>{this._xterm.element.style.opacity=""})),this._xterm.element.addEventListener("drop",(async t=>{t.preventDefault();let e=[];if(t.dataTransfer.items)for(let r=0;r<t.dataTransfer.items.length;r++)if("file"==t.dataTransfer.items[r].kind)e.push(t.dataTransfer.items[r].getAsFile());else for(let r=0;r<t.dataTransfer.files.length;r++)e.push(t.dataTransfer.files[r]);for(let t=0;t<e.length;t++){const r=e[t];if(r.name.endsWith(".wasm")){const t=r.name.replace(/\.wasm$/,"");if(this._wasmModules=this._wasmModules.filter((e=>e.name!=t)),e.some((e=>e.name==t+".js"))){const n=e.find((e=>e.name==t+".js")),i=await WebAssembly.compile(await r.arrayBuffer());this._wasmModules.push({name:t,type:"emscripten",runtime:await n.arrayBuffer(),module:i}),alert("Emscripten Wasm Module added: "+t)}else{const e=await WebAssembly.compile(await r.arrayBuffer());this._wasmModules.push({name:t,type:"wasmer",module:e}),alert("WASI Module added: "+t)}}}this._xterm.element.style.opacity=""}),!1)}_initWorker(){this._worker=new Promise((async t=>{this._pauseBuffer=new Int32Array(new SharedArrayBuffer(1*Int32Array.BYTES_PER_ELEMENT)),this._stdinBuffer=new Int32Array(new SharedArrayBuffer(1e3*Int32Array.BYTES_PER_ELEMENT));let e=new Blob([N],{type:"application/javascript"});this._workerRAW=new Worker(URL.createObjectURL(e));const r=h(this._workerRAW);this._worker=await new r(this._pauseBuffer,this._stdinBuffer),t(this._worker)}))}_resumeWorker(){console.log("resuming worker (request)"),Atomics.store(this._pauseBuffer,0,0),Atomics.notify(this._pauseBuffer,0)}_terminateWorker(){console.log("called terminate worker"),this._workerRAW.terminate()}_waitForOutputPause(t=80,e=20){return new Promise((r=>{const n=()=>{setTimeout((()=>{this._lastOutputTime>Date.now()-t?n():r()}),e)};n()}))}_setStdinBuffer(t){for(let e=0;e<this._stdinBuffer.length;e++)this._stdinBuffer[e]=t[e]?t[e].charCodeAt(0):0}_stdinProxy=_((t=>{this._waitForOutputPause().then((async()=>{console.log("called _stdinProxy",t),this._xterm.write("\r[K");const e=await this._xtermEcho.read(t);this._xtermEcho.history.entries.pop(),this._xtermEcho.history.cursor--,this._setStdinBuffer(e+"\n"),this._resumeWorker()}))}));_stdoutProxy=_((t=>this._stdout(t)));_stderrProxy=_((t=>this._stderr(t)));_stdout(t){this._suppressOutputs||("number"==typeof t&&(t=String.fromCharCode(t)),t=t.replace(/\n/g,"\r\n"),this._outputBuffer+=t,this._lastOutputTime=Date.now(),this._xterm.write(t))}_stderr(t){t instanceof Error&&(console.error("stderr error:",t),t=t.toString()+"\n"),this._stdout(t)}async printWelcomeMessage(){let t="[1;32m\n _ _ _ _ _ _ _ _____ \r\n| | | |___ ___ _____ | | | |___| |_ |_ _|___ ___ _____ \r\n| | | | .'|_ -| | | | | | -_| . | | | | -_| _| |\r\n|_____|__,|___|_|_|_| |_____|___|___| |_| |___|_| |_|_|_|\r\n [37m\r\n";return t+="Run WebAssembly binaries compiled with Emscripten or Wasmer.\r\n",t+="You can also define and run custom JavaScript functions.\r\n\r\n",t+="Commands: "+[...this._jsCommands].map((t=>t[0])).sort().join(", ")+". ",t+="Backend: "+(this._worker?"WebWorker":"Prompts Fallback")+".\r\n\r\n",t}_onXtermData(t){""==t&&this._worker&&(this._suppressOutputs=!0,this._terminateWorker(),this._initWorker(),this._runWasmCommandPromise?.reject("Ctrl + C"),this.isRunningCommand=!1)}}})(),n})()}));
//# sourceMappingURL=webterm.bundle.js.map