/*!
 * Nutrient Web SDK 1.16.0-2012f75 (https://www.nutrient.io/sdk/web)
 * 
 * Copyright (c) 2016-2026 PSPDFKit GmbH. All rights reserved.
 * 
 * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
 * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
 * This notice may not be removed from this file.
 * 
 * PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/
 */
var PSPDFModuleInit=(()=>{var e=globalThis.document?.currentScript?.src;return async function(r={}){var t=r,n=!!globalThis.window,o=!!globalThis.WorkerGlobalScope,a=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type,s=!n&&!a&&!o,i="./this.program",l=(e,r)=>{throw r};"undefined"!=typeof __filename?e=__filename:o&&(e=self.location.href);var u,d,c="";if(a){var f=require("node:fs");c=__dirname+"/",d=e=>(e=M(e)?new URL(e):e,f.readFileSync(e)),u=async(e,r=!0)=>(e=M(e)?new URL(e):e,f.readFileSync(e,r?void 0:"utf8")),process.argv.length>1&&(i=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),l=(e,r)=>{throw process.exitCode=e,r}}else if(s)d=e=>{if(globalThis.readbuffer)return new Uint8Array(readbuffer(e));let r=read(e,"binary");return y("object"==typeof r),r},u=async e=>d(e),globalThis.clearTimeout??=e=>{},globalThis.setTimeout??=e=>e(),globalThis.arguments||globalThis.scriptArgs,globalThis.quit&&(l=(e,r)=>{throw setTimeout(()=>{if(!(r instanceof j)){let e=r;r&&"object"==typeof r&&r.stack&&(e=[r,r.stack]),v(`exiting due to exception: ${e}`)}quit(e)}),r}),"undefined"!=typeof print&&(globalThis.console??={},console.log=print,console.warn=console.error=globalThis.printErr??print);else if(n||o){try{c=new URL(".",e).href}catch{}o&&(d=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),u=async e=>{if(M(e))return new Promise((r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t(n.status)},n.onerror=t,n.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)}}var m,h,p=console.log.bind(console),v=console.error.bind(console),g=!1;function y(e,r){e||x(r)}var w,E,b,_,k,$,T,D,C,P,S,F,A,M=e=>e.startsWith("file://"),O=!1;function N(){var e=ut.buffer;b=new Int8Array(e),k=new Int16Array(e),_=new Uint8Array(e),$=new Uint16Array(e),T=new Int32Array(e),D=new Uint32Array(e),C=new Float32Array(e),P=new Float64Array(e),S=new BigInt64Array(e),F=new BigUint64Array(e)}function x(e){t.onAbort?.(e),v(e="Aborted("+e+")"),g=!0,e+=". Build with -sASSERTIONS for more info.",O&&lt();var r=new WebAssembly.RuntimeError(e);throw E?.(r),r}function R(){return e="nutrient-viewer.wasm.wasm",t.locateFile?t.locateFile(e,c):c+e;var e}async function z(e){if(!m)try{var r=await u(e);return new Uint8Array(r)}catch{}return function(e){if(e==A&&m)return new Uint8Array(m);if(d)return d(e);throw"both async and sync fetching of the wasm failed"}(e)}async function I(e,r,t){if(!(e||M(r)||a||s))try{var n=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(e){v(`wasm streaming compile failed: ${e}`),v("falling back to ArrayBuffer instantiation")}return async function(e,r){try{var t=await z(e);return await WebAssembly.instantiate(t,r)}catch(e){v(`failed to asynchronously prepare wasm: ${e}`),x(e)}}(r,t)}class j{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var U=e=>{for(;e.length>0;)e.shift()(t)},B=[],W=e=>B.push(e),L=[],H=e=>L.push(e),Y=!0,q={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=q.isAbs(e),t="/"===e.slice(-1);return(e=q.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=q.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.slice(0,-1)),t+n):"."},basename:e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],join:(...e)=>q.normalize(e.join("/")),join2:(e,r)=>q.normalize(e+"/"+r)},V=()=>{if(a){var e=require("node:crypto");return r=>e.randomFillSync(r)}return s?e=>{if(!os.system)throw new Error("randomFill not supported on d8 unless --enable-os-system is passed");const r=os.system("sh",["-c",`head -c${e.byteLength} /dev/urandom | base64 --wrap=0`]);e.set((e=>{if(a){var r=Buffer.from(e,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.length)}for(var t,n,o=0,s=0,i=e.length,l=new Uint8Array((3*i>>2)-("="==e[i-2])-("="==e[i-1]));o<i;o+=4,s+=3)t=pt[e.charCodeAt(o+1)],n=pt[e.charCodeAt(o+2)],l[s]=pt[e.charCodeAt(o)]<<2|t>>4,l[s+1]=t<<4|n>>2,l[s+2]=n<<6|pt[e.charCodeAt(o+3)];return l})(r))}:e=>crypto.getRandomValues(e)},G=e=>{(G=V())(e)},X={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:ve.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=q.isAbs(o)}return(t?"/":"")+(r=q.normalizeArray(r.split("/").filter(e=>!!e),!t).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=X.resolve(e).slice(1),r=X.resolve(r).slice(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),s=a,i=0;i<a;i++)if(n[i]!==o[i]){s=i;break}var l=[];for(i=s;i<n.length;i++)l.push("..");return(l=l.concat(o.slice(s))).join("/")}},J=globalThis.TextDecoder&&new TextDecoder,K=(e,r,t,n)=>{var o=r+t;if(n)return o;for(;e[r]&&!(r>=o);)++r;return r},Z=(e,r=0,t,n)=>{var o=K(e,r,t,n);if(o-r>16&&e.buffer&&J)return J.decode(e.subarray(r,o));for(var a="";r<o;){var s=e[r++];if(128&s){var i=63&e[r++];if(192!=(224&s)){var l=63&e[r++];if((s=224==(240&s)?(15&s)<<12|i<<6|l:(7&s)<<18|i<<12|l<<6|63&e[r++])<65536)a+=String.fromCharCode(s);else{var u=s-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&s)<<6|i)}else a+=String.fromCharCode(s)}return a},Q=[],ee=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},re=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,s=0;s<e.length;++s){var i=e.codePointAt(s);if(i<=127){if(t>=a)break;r[t++]=i}else if(i<=2047){if(t+1>=a)break;r[t++]=192|i>>6,r[t++]=128|63&i}else if(i<=65535){if(t+2>=a)break;r[t++]=224|i>>12,r[t++]=128|i>>6&63,r[t++]=128|63&i}else{if(t+3>=a)break;r[t++]=240|i>>18,r[t++]=128|i>>12&63,r[t++]=128|i>>6&63,r[t++]=128|63&i,s++}}return r[t]=0,t-o},te=(e,r,t)=>{var n=t>0?t:ee(e)+1,o=new Array(n),a=re(e,o,0,o.length);return r&&(o.length=a),o},ne={ttys:[],init(){},shutdown(){},register(e,r){ne.ttys[e]={input:[],output:[],ops:r},ve.registerDevice(e,ne.stream_ops)},stream_ops:{open(e){var r=ne.ttys[e.node.rdev];if(!r)throw new ve.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new ve.ErrnoError(60);for(var a=0,s=0;s<n;s++){var i;try{i=e.tty.ops.get_char(e.tty)}catch(e){throw new ve.ErrnoError(29)}if(void 0===i&&0===a)throw new ve.ErrnoError(6);if(null==i)break;a++,r[t+s]=i}return a&&(e.node.atime=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new ve.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new ve.ErrnoError(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!Q.length){var e=null;if(a){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=f.readSync(n,r,0,256)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}t>0&&(e=r.slice(0,t).toString("utf-8"))}else globalThis.window?.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):globalThis.readline&&(e=readline())&&(e+="\n");if(!e)return null;Q=te(e,!0)}return Q.shift()})(),put_char(e,r){null===r||10===r?(p(Z(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output?.length>0&&(p(Z(e.output)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(v(Z(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output?.length>0&&(v(Z(e.output)),e.output=[])}}},oe=(e,r)=>Math.ceil(e/r)*r,ae=e=>{e=oe(e,65536);var r=st(65536,e);return r&&((e,r)=>{_.fill(0,e,e+r)})(r,e),r},se={ops_table:null,mount:e=>se.createNode(null,"/",16895,0),createNode(e,r,t,n){if(ve.isBlkdev(t)||ve.isFIFO(t))throw new ve.ErrnoError(63);se.ops_table||={dir:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr,lookup:se.node_ops.lookup,mknod:se.node_ops.mknod,rename:se.node_ops.rename,unlink:se.node_ops.unlink,rmdir:se.node_ops.rmdir,readdir:se.node_ops.readdir,symlink:se.node_ops.symlink},stream:{llseek:se.stream_ops.llseek}},file:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr},stream:{llseek:se.stream_ops.llseek,read:se.stream_ops.read,write:se.stream_ops.write,mmap:se.stream_ops.mmap,msync:se.stream_ops.msync}},link:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr,readlink:se.node_ops.readlink},stream:{}},chrdev:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr},stream:ve.chrdev_stream_ops}};var o=ve.createNode(e,r,t,n);return ve.isDir(o.mode)?(o.node_ops=se.ops_table.dir.node,o.stream_ops=se.ops_table.dir.stream,o.contents={}):ve.isFile(o.mode)?(o.node_ops=se.ops_table.file.node,o.stream_ops=se.ops_table.file.stream,o.usedBytes=0,o.contents=null):ve.isLink(o.mode)?(o.node_ops=se.ops_table.link.node,o.stream_ops=se.ops_table.link.stream):ve.isChrdev(o.mode)&&(o.node_ops=se.ops_table.chrdev.node,o.stream_ops=se.ops_table.chrdev.stream),o.atime=o.mtime=o.ctime=Date.now(),e&&(e.contents[r]=o,e.atime=e.mtime=e.ctime=o.atime),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=ve.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,ve.isDir(e.mode)?r.size=4096:ve.isFile(e.mode)?r.size=e.usedBytes:ve.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of["mode","atime","mtime","ctime"])null!=r[t]&&(e[t]=r[t]);void 0!==r.size&&se.resizeFileStorage(e,r.size)},lookup(e,r){throw se.doesNotExistError||(se.doesNotExistError=new ve.ErrnoError(44),se.doesNotExistError.stack="<generic error, no stack>"),se.doesNotExistError},mknod:(e,r,t,n)=>se.createNode(e,r,t,n),rename(e,r,t){var n;try{n=ve.lookupNode(r,t)}catch(e){}if(n){if(ve.isDir(e.mode))for(var o in n.contents)throw new ve.ErrnoError(55);ve.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=ve.lookupNode(e,r);for(var n in t.contents)throw new ve.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.contents)],symlink(e,r,t){var n=se.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!ve.isLink(e.mode))throw new ve.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&a.subarray)r.set(a.subarray(o,o+s),t);else for(var i=0;i<s;i++)r[t+i]=a[o+i];return s},write(e,r,t,n,o,a){if(r.buffer===b.buffer&&(a=!1),!n)return 0;var s=e.node;if(s.mtime=s.ctime=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(a)return s.contents=r.subarray(t,t+n),s.usedBytes=n,n;if(0===s.usedBytes&&0===o)return s.contents=r.slice(t,t+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(r.subarray(t,t+n),o),n}if(se.expandFileStorage(s,o+n),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(t,t+n),o);else for(var i=0;i<n;i++)s.contents[o+i]=r[t+i];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&ve.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ve.ErrnoError(28);return n},mmap(e,r,t,n,o){if(!ve.isFile(e.node.mode))throw new ve.ErrnoError(43);var a,s,i=e.node.contents;if(2&o||!i||i.buffer!==b.buffer){if(s=!0,!(a=ae(r)))throw new ve.ErrnoError(48);i&&((t>0||t+r<i.length)&&(i=i.subarray?i.subarray(t,t+r):Array.prototype.slice.call(i,t,t+r)),b.set(i,a))}else s=!1,a=i.byteOffset;return{ptr:a,allocated:s}},msync:(e,r,t,n,o)=>(se.stream_ops.write(e,r,0,n,t,!1),0)}},ie=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},le={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount(e){y(o),le.reader??=new FileReaderSync;var r=le.createNode(null,"/",le.DIR_MODE,0),t={};function n(e){for(var n=e.split("/"),o=r,a=0;a<n.length-1;a++){var s=n.slice(0,a+1).join("/");t[s]||=le.createNode(o,n[a],le.DIR_MODE,0),o=t[s]}return o}function a(e){var r=e.split("/");return r[r.length-1]}for(var s of e.opts.files||[])le.createNode(n(s.name),a(s.name),le.FILE_MODE,0,s,s.lastModifiedDate);for(var i of e.opts.blobs||[])le.createNode(n(i.name),a(i.name),le.FILE_MODE,0,i.data);for(var l of e.opts.packages||[])for(var s of l.metadata.files){var u=s.filename.slice(1);le.createNode(n(u),a(u),le.FILE_MODE,0,l.blob.slice(s.start,s.end))}return r},createNode(e,r,t,n,o,a){var s=ve.createNode(e,r,t);return s.mode=t,s.node_ops=le.node_ops,s.stream_ops=le.stream_ops,s.atime=s.mtime=s.ctime=(a||new Date).getTime(),y(le.FILE_MODE!==le.DIR_MODE),t===le.FILE_MODE?(s.size=o.size,s.contents=o):(s.size=4096,s.contents={}),e&&(e.contents[r]=s),s},node_ops:{getattr:e=>({dev:1,ino:e.id,mode:e.mode,nlink:1,uid:0,gid:0,rdev:0,size:e.size,atime:new Date(e.atime),mtime:new Date(e.mtime),ctime:new Date(e.ctime),blksize:4096,blocks:Math.ceil(e.size/4096)}),setattr(e,r){for(const t of["mode","atime","mtime","ctime"])null!=r[t]&&(e[t]=r[t])},lookup(e,r){throw new ve.ErrnoError(44)},mknod(e,r,t,n){throw new ve.ErrnoError(63)},rename(e,r,t){throw new ve.ErrnoError(63)},unlink(e,r){throw new ve.ErrnoError(63)},rmdir(e,r){throw new ve.ErrnoError(63)},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){throw new ve.ErrnoError(63)}},stream_ops:{read(e,r,t,n,o){if(o>=e.node.size)return 0;var a=e.node.contents.slice(o,o+n),s=le.reader.readAsArrayBuffer(a);return r.set(new Uint8Array(s),t),a.size},write(e,r,t,n,o){throw new ve.ErrnoError(29)},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&ve.isFile(e.node.mode)&&(n+=e.node.size),n<0)throw new ve.ErrnoError(28);return n}}},ue=(...e)=>ve.createDataFile(...e),de=0,ce=null,fe=e=>{if(de--,t.monitorRunDependencies?.(de),0==de&&ce){var r=ce;ce=null,r()}},me=e=>{de++,t.monitorRunDependencies?.(de)},he=[],pe=async(e,r,t,n,o,a,s,i)=>{var l=r?X.resolve(q.join2(e,r)):e;me();try{var d=t;"string"==typeof t&&(d=await(async e=>{var r=await u(e);return new Uint8Array(r)})(t)),d=await(async(e,r)=>{for(var t of("undefined"!=typeof Browser&&Browser.init(),he))if(t.canHandle(r))return t.handle(e,r);return e})(d,l),i?.(),a||ue(e,r,d,n,o,s)}finally{fe()}},ve={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,ErrnoError:class{name="ErrnoError";constructor(e){this.errno=e}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.id=ve.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return ve.isDir(this.mode)}get isDevice(){return ve.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)throw new ve.ErrnoError(44);r.follow_mount??=!0,q.isAbs(e)||(e=ve.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var n=e.split("/").filter(e=>!!e),o=ve.root,a="/",s=0;s<n.length;s++){var i=s===n.length-1;if(i&&r.parent)break;if("."!==n[s])if(".."!==n[s]){a=q.join2(a,n[s]);try{o=ve.lookupNode(o,n[s])}catch(e){if(44===e?.errno&&i&&r.noent_okay)return{path:a};throw e}if(!ve.isMountpoint(o)||i&&!r.follow_mount||(o=o.mounted.root),ve.isLink(o.mode)&&(!i||r.follow)){if(!o.node_ops.readlink)throw new ve.ErrnoError(52);var l=o.node_ops.readlink(o);q.isAbs(l)||(l=q.dirname(a)+"/"+l),e=l+"/"+n.slice(s+1).join("/");continue e}}else{if(a=q.dirname(a),ve.isRoot(o)){e=a+"/"+n.slice(s+1).join("/"),t--;continue e}o=o.parent}}return{path:a,node:o}}throw new ve.ErrnoError(32)},getPath(e){for(var r;;){if(ve.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%ve.nameTable.length},hashAddNode(e){var r=ve.hashName(e.parent.id,e.name);e.name_next=ve.nameTable[r],ve.nameTable[r]=e},hashRemoveNode(e){var r=ve.hashName(e.parent.id,e.name);if(ve.nameTable[r]===e)ve.nameTable[r]=e.name_next;else for(var t=ve.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=ve.mayLookup(e);if(t)throw new ve.ErrnoError(t);for(var n=ve.hashName(e.id,r),o=ve.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return ve.lookup(e,r)},createNode(e,r,t,n){var o=new ve.FSNode(e,r,t,n);return ve.hashAddNode(o),o},destroyNode(e){ve.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>ve.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!ve.isDir(e.mode))return 54;var r=ve.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){if(!ve.isDir(e.mode))return 54;try{ve.lookupNode(e,r);return 20}catch(e){}return ve.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=ve.lookupNode(e,r)}catch(e){return e.errno}var o=ve.nodePermissions(e,"wx");if(o)return o;if(t){if(!ve.isDir(n.mode))return 54;if(ve.isRoot(n)||ve.getPath(n)===ve.cwd())return 10}else if(ve.isDir(n.mode))return 31;return 0},mayOpen(e,r){if(!e)return 44;if(ve.isLink(e.mode))return 32;var t=ve.flagsToPermissionString(r);return ve.isDir(e.mode)&&("r"!==t||576&r)?31:ve.nodePermissions(e,t)},checkOpExists(e,r){if(!e)throw new ve.ErrnoError(r);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=ve.MAX_OPEN_FDS;e++)if(!ve.streams[e])return e;throw new ve.ErrnoError(33)},getStreamChecked(e){var r=ve.getStream(e);if(!r)throw new ve.ErrnoError(8);return r},getStream:e=>ve.streams[e],createStream:(e,r=-1)=>(e=Object.assign(new ve.FSStream,e),-1==r&&(r=ve.nextfd()),e.fd=r,ve.streams[r]=e,e),closeStream(e){ve.streams[e]=null},dupStream(e,r=-1){var t=ve.createStream(e,r);return t.stream_ops?.dup?.(t),t},doSetAttr(e,r,t){var n=e?.stream_ops.setattr,o=n?e:r;n??=r.node_ops.setattr,ve.checkOpExists(n,63),n(o,t)},chrdev_stream_ops:{open(e){var r=ve.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new ve.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){ve.devices[e]={stream_ops:r}},getDevice:e=>ve.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),ve.syncFSRequests++,ve.syncFSRequests>1&&v(`warning: ${ve.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ve.getMounts(ve.root.mount),n=0;function o(e){return ve.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}for(var s of t)s.type.syncfs?s.type.syncfs(s,e,a):a(null)},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&ve.root)throw new ve.ErrnoError(10);if(!o&&!a){var s=ve.lookupPath(t,{follow_mount:!1});if(t=s.path,n=s.node,ve.isMountpoint(n))throw new ve.ErrnoError(10);if(!ve.isDir(n.mode))throw new ve.ErrnoError(54)}var i={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(i);return l.mount=i,i.root=l,o?ve.root=l:n&&(n.mounted=i,n.mount&&n.mount.mounts.push(i)),l},unmount(e){var r=ve.lookupPath(e,{follow_mount:!1});if(!ve.isMountpoint(r.node))throw new ve.ErrnoError(28);var t=r.node,n=t.mounted,o=ve.getMounts(n);for(var[a,s]of Object.entries(ve.nameTable))for(;s;){var i=s.name_next;o.includes(s.mount)&&ve.destroyNode(s),s=i}t.mounted=null;var l=t.mount.mounts.indexOf(n);t.mount.mounts.splice(l,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=ve.lookupPath(e,{parent:!0}).node,o=q.basename(e);if(!o)throw new ve.ErrnoError(28);if("."===o||".."===o)throw new ve.ErrnoError(20);var a=ve.mayCreate(n,o);if(a)throw new ve.ErrnoError(a);if(!n.node_ops.mknod)throw new ve.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},statfs:e=>ve.statfsNode(ve.lookupPath(e,{follow:!0}).node),statfsStream:e=>ve.statfsNode(e.node),statfsNode(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:ve.nextInode,ffree:ve.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(r,e.node_ops.statfs(e.mount.opts.root)),r},create:(e,r=438)=>(r&=4095,r|=32768,ve.mknod(e,r,0)),mkdir:(e,r=511)=>(r&=1023,r|=16384,ve.mknod(e,r,0)),mkdirTree(e,r){var t=e.split("/"),n="";for(var o of t)if(o){(n||q.isAbs(e))&&(n+="/"),n+=o;try{ve.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,ve.mknod(e,r,t)),symlink(e,r){if(!X.resolve(e))throw new ve.ErrnoError(44);var t=ve.lookupPath(r,{parent:!0}).node;if(!t)throw new ve.ErrnoError(44);var n=q.basename(r),o=ve.mayCreate(t,n);if(o)throw new ve.ErrnoError(o);if(!t.node_ops.symlink)throw new ve.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=q.dirname(e),a=q.dirname(r),s=q.basename(e),i=q.basename(r);if(t=ve.lookupPath(e,{parent:!0}).node,n=ve.lookupPath(r,{parent:!0}).node,!t||!n)throw new ve.ErrnoError(44);if(t.mount!==n.mount)throw new ve.ErrnoError(75);var l,u=ve.lookupNode(t,s),d=X.relative(e,a);if("."!==d.charAt(0))throw new ve.ErrnoError(28);if("."!==(d=X.relative(r,o)).charAt(0))throw new ve.ErrnoError(55);try{l=ve.lookupNode(n,i)}catch(e){}if(u!==l){var c=ve.isDir(u.mode),f=ve.mayDelete(t,s,c);if(f)throw new ve.ErrnoError(f);if(f=l?ve.mayDelete(n,i,c):ve.mayCreate(n,i))throw new ve.ErrnoError(f);if(!t.node_ops.rename)throw new ve.ErrnoError(63);if(ve.isMountpoint(u)||l&&ve.isMountpoint(l))throw new ve.ErrnoError(10);if(n!==t&&(f=ve.nodePermissions(t,"w")))throw new ve.ErrnoError(f);ve.hashRemoveNode(u);try{t.node_ops.rename(u,n,i),u.parent=n}catch(e){throw e}finally{ve.hashAddNode(u)}}},rmdir(e){var r=ve.lookupPath(e,{parent:!0}).node,t=q.basename(e),n=ve.lookupNode(r,t),o=ve.mayDelete(r,t,!0);if(o)throw new ve.ErrnoError(o);if(!r.node_ops.rmdir)throw new ve.ErrnoError(63);if(ve.isMountpoint(n))throw new ve.ErrnoError(10);r.node_ops.rmdir(r,t),ve.destroyNode(n)},readdir(e){var r=ve.lookupPath(e,{follow:!0}).node;return ve.checkOpExists(r.node_ops.readdir,54)(r)},unlink(e){var r=ve.lookupPath(e,{parent:!0}).node;if(!r)throw new ve.ErrnoError(44);var t=q.basename(e),n=ve.lookupNode(r,t),o=ve.mayDelete(r,t,!1);if(o)throw new ve.ErrnoError(o);if(!r.node_ops.unlink)throw new ve.ErrnoError(63);if(ve.isMountpoint(n))throw new ve.ErrnoError(10);r.node_ops.unlink(r,t),ve.destroyNode(n)},readlink(e){var r=ve.lookupPath(e).node;if(!r)throw new ve.ErrnoError(44);if(!r.node_ops.readlink)throw new ve.ErrnoError(28);return r.node_ops.readlink(r)},stat(e,r){var t=ve.lookupPath(e,{follow:!r}).node;return ve.checkOpExists(t.node_ops.getattr,63)(t)},fstat(e){var r=ve.getStreamChecked(e),t=r.node,n=r.stream_ops.getattr,o=n?r:t;return n??=t.node_ops.getattr,ve.checkOpExists(n,63),n(o)},lstat:e=>ve.stat(e,!0),doChmod(e,r,t,n){ve.doSetAttr(e,r,{mode:4095&t|-4096&r.mode,ctime:Date.now(),dontFollow:n})},chmod(e,r,t){var n;"string"==typeof e?n=ve.lookupPath(e,{follow:!t}).node:n=e;ve.doChmod(null,n,r,t)},lchmod(e,r){ve.chmod(e,r,!0)},fchmod(e,r){var t=ve.getStreamChecked(e);ve.doChmod(t,t.node,r,!1)},doChown(e,r,t){ve.doSetAttr(e,r,{timestamp:Date.now(),dontFollow:t})},chown(e,r,t,n){var o;"string"==typeof e?o=ve.lookupPath(e,{follow:!n}).node:o=e;ve.doChown(null,o,n)},lchown(e,r,t){ve.chown(e,r,t,!0)},fchown(e,r,t){var n=ve.getStreamChecked(e);ve.doChown(n,n.node,!1)},doTruncate(e,r,t){if(ve.isDir(r.mode))throw new ve.ErrnoError(31);if(!ve.isFile(r.mode))throw new ve.ErrnoError(28);var n=ve.nodePermissions(r,"w");if(n)throw new ve.ErrnoError(n);ve.doSetAttr(e,r,{size:t,timestamp:Date.now()})},truncate(e,r){if(r<0)throw new ve.ErrnoError(28);var t;"string"==typeof e?t=ve.lookupPath(e,{follow:!0}).node:t=e;ve.doTruncate(null,t,r)},ftruncate(e,r){var t=ve.getStreamChecked(e);if(r<0||!(2097155&t.flags))throw new ve.ErrnoError(28);ve.doTruncate(t,t.node,r)},utime(e,r,t){var n=ve.lookupPath(e,{follow:!0}).node;ve.checkOpExists(n.node_ops.setattr,63)(n,{atime:r,mtime:t})},open(e,r,t=438){if(""===e)throw new ve.ErrnoError(44);var n,o;if(t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{o=e.endsWith("/");var a=ve.lookupPath(e,{follow:!(131072&r),noent_okay:!0});n=a.node,e=a.path}var s=!1;if(64&r)if(n){if(128&r)throw new ve.ErrnoError(20)}else{if(o)throw new ve.ErrnoError(31);n=ve.mknod(e,511|t,0),s=!0}if(!n)throw new ve.ErrnoError(44);if(ve.isChrdev(n.mode)&&(r&=-513),65536&r&&!ve.isDir(n.mode))throw new ve.ErrnoError(54);if(!s){var i=ve.mayOpen(n,r);if(i)throw new ve.ErrnoError(i)}512&r&&!s&&ve.truncate(n,0),r&=-131713;var l=ve.createStream({node:n,path:ve.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),s&&ve.chmod(n,511&t),l},close(e){if(ve.isClosed(e))throw new ve.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ve.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(ve.isClosed(e))throw new ve.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ve.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ve.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new ve.ErrnoError(28);if(ve.isClosed(e))throw new ve.ErrnoError(8);if(1==(2097155&e.flags))throw new ve.ErrnoError(8);if(ve.isDir(e.node.mode))throw new ve.ErrnoError(31);if(!e.stream_ops.read)throw new ve.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new ve.ErrnoError(70)}else o=e.position;var s=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=s),s},write(e,r,t,n,o,a){if(n<0||o<0)throw new ve.ErrnoError(28);if(ve.isClosed(e))throw new ve.ErrnoError(8);if(!(2097155&e.flags))throw new ve.ErrnoError(8);if(ve.isDir(e.node.mode))throw new ve.ErrnoError(31);if(!e.stream_ops.write)throw new ve.ErrnoError(28);e.seekable&&1024&e.flags&&ve.llseek(e,0,2);var s=void 0!==o;if(s){if(!e.seekable)throw new ve.ErrnoError(70)}else o=e.position;var i=e.stream_ops.write(e,r,t,n,o,a);return s||(e.position+=i),i},mmap(e,r,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new ve.ErrnoError(2);if(1==(2097155&e.flags))throw new ve.ErrnoError(2);if(!e.stream_ops.mmap)throw new ve.ErrnoError(43);if(!r)throw new ve.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new ve.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding&&x(`Invalid encoding type "${r.encoding}"`);var t=ve.open(e,r.flags),n=ve.stat(e).size,o=new Uint8Array(n);return ve.read(t,o,0,n,0),"utf8"===r.encoding&&(o=Z(o)),ve.close(t),o},writeFile(e,r,t={}){t.flags=t.flags||577;var n=ve.open(e,t.flags,t.mode);"string"==typeof r&&(r=new Uint8Array(te(r,!0))),ArrayBuffer.isView(r)?ve.write(n,r,0,r.byteLength,void 0,t.canOwn):x("Unsupported data type"),ve.close(n)},cwd:()=>ve.currentPath,chdir(e){var r=ve.lookupPath(e,{follow:!0});if(null===r.node)throw new ve.ErrnoError(44);if(!ve.isDir(r.node.mode))throw new ve.ErrnoError(54);var t=ve.nodePermissions(r.node,"x");if(t)throw new ve.ErrnoError(t);ve.currentPath=r.path},createDefaultDirectories(){ve.mkdir("/tmp"),ve.mkdir("/home"),ve.mkdir("/home/web_user")},createDefaultDevices(){ve.mkdir("/dev"),ve.registerDevice(ve.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n,llseek:()=>0}),ve.mkdev("/dev/null",ve.makedev(1,3)),ne.register(ve.makedev(5,0),ne.default_tty_ops),ne.register(ve.makedev(6,0),ne.default_tty1_ops),ve.mkdev("/dev/tty",ve.makedev(5,0)),ve.mkdev("/dev/tty1",ve.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(G(e),r=e.byteLength),e[--r]);ve.createDevice("/dev","random",t),ve.createDevice("/dev","urandom",t),ve.mkdir("/dev/shm"),ve.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ve.mkdir("/proc");var e=ve.mkdir("/proc/self");ve.mkdir("/proc/self/fd"),ve.mount({mount(){var r=ve.createNode(e,"fd",16895,73);return r.stream_ops={llseek:se.stream_ops.llseek},r.node_ops={lookup(e,r){var t=+r,n=ve.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path},id:t+1};return o.parent=o,o},readdir:()=>Array.from(ve.streams.entries()).filter(([e,r])=>r).map(([e,r])=>e.toString())},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?ve.createDevice("/dev","stdin",e):ve.symlink("/dev/tty","/dev/stdin"),r?ve.createDevice("/dev","stdout",null,r):ve.symlink("/dev/tty","/dev/stdout"),t?ve.createDevice("/dev","stderr",null,t):ve.symlink("/dev/tty1","/dev/stderr");ve.open("/dev/stdin",0),ve.open("/dev/stdout",1),ve.open("/dev/stderr",1)},staticInit(){ve.nameTable=new Array(4096),ve.mount(se,{},"/"),ve.createDefaultDirectories(),ve.createDefaultDevices(),ve.createSpecialDirectories(),ve.filesystems={MEMFS:se,WORKERFS:le}},init(e,r,n){ve.initialized=!0,e??=t.stdin,r??=t.stdout,n??=t.stderr,ve.createStandardStreams(e,r,n)},quit(){for(var e of(ve.initialized=!1,ve.streams))e&&ve.close(e)},findObject(e,r){var t=ve.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=ve.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=ve.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=q.basename(e),n=ve.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:ve.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var s=q.join2(e,a);try{ve.mkdir(s)}catch(e){if(20!=e.errno)throw e}e=s}}return s},createFile(e,r,t,n,o){var a=q.join2("string"==typeof e?e:ve.getPath(e),r),s=ie(n,o);return ve.create(a,s)},createDataFile(e,r,t,n,o,a){var s=r;e&&(e="string"==typeof e?e:ve.getPath(e),s=r?q.join2(e,r):e);var i=ie(n,o),l=ve.create(s,i);if(t){if("string"==typeof t){for(var u=new Array(t.length),d=0,c=t.length;d<c;++d)u[d]=t.charCodeAt(d);t=u}ve.chmod(l,146|i);var f=ve.open(l,577);ve.write(f,t,0,t.length,0,a),ve.close(f),ve.chmod(l,i)}},createDevice(e,r,t,n){var o=q.join2("string"==typeof e?e:ve.getPath(e),r),a=ie(!!t,!!n);ve.createDevice.major??=64;var s=ve.makedev(ve.createDevice.major++,0);return ve.registerDevice(s,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,r,n,o,a){for(var s=0,i=0;i<o;i++){var l;try{l=t()}catch(e){throw new ve.ErrnoError(29)}if(void 0===l&&0===s)throw new ve.ErrnoError(6);if(null==l)break;s++,r[n+i]=l}return s&&(e.node.atime=Date.now()),s},write(e,r,t,o,a){for(var s=0;s<o;s++)try{n(r[t+s])}catch(e){throw new ve.ErrnoError(29)}return o&&(e.node.mtime=e.node.ctime=Date.now()),s}}),ve.mkdev(o,a,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(globalThis.XMLHttpRequest)x("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{e.contents=d(e.url)}catch(e){throw new ve.ErrnoError(29)}},createLazyFile(e,r,t,n,a){class s{lengthKnown=!1;chunks=[];get(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;e.open("HEAD",t,!1),e.send(null),e.status>=200&&e.status<300||304===e.status||x("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,s=1048576;o||(s=n);var i=this;i.setDataGetter(e=>{var r=e*s,o=(e+1)*s-1;return o=Math.min(o,n-1),void 0===i.chunks[e]&&(i.chunks[e]=((e,r)=>{e>r&&x("invalid range ("+e+", "+r+") or no bytes requested!"),r>n-1&&x("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;return o.open("GET",t,!1),n!==s&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),o.status>=200&&o.status<300||304===o.status||x("Couldn't load "+t+". Status: "+o.status),void 0!==o.response?new Uint8Array(o.response||[]):te(o.responseText||"",!0)})(r,o)),void 0===i.chunks[e]&&x("doXHR failed!"),i.chunks[e]}),!a&&n||(s=n=1,n=this.getter(0).length,s=n,p("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=s,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(globalThis.XMLHttpRequest){o||x("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var i={isDevice:!1,contents:new s}}else i={isDevice:!1,url:t};var l=ve.createFile(e,r,i,n,a);i.contents?l.contents=i.contents:i.url&&(l.contents=null,l.url=i.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var u={};for(const[e,r]of Object.entries(l.stream_ops))u[e]=(...e)=>(ve.forceLoadFile(l),r(...e));function d(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var s=Math.min(a.length-o,n);if(a.slice)for(var i=0;i<s;i++)r[t+i]=a[o+i];else for(i=0;i<s;i++)r[t+i]=a.get(o+i);return s}return u.read=(e,r,t,n,o)=>(ve.forceLoadFile(l),d(e,r,t,n,o)),u.mmap=(e,r,t,n,o)=>{ve.forceLoadFile(l);var a=ae(r);if(!a)throw new ve.ErrnoError(48);return d(e,b,a,r,t),{ptr:a,allocated:!0}},l.stream_ops=u,l}},ge=(e,r,t)=>e?Z(_,e,r,t):"",ye={calculateAt(e,r,t){if(q.isAbs(r))return r;var n;-100===e?n=ve.cwd():n=ye.getStreamFromFD(e).path;if(0==r.length){if(!t)throw new ve.ErrnoError(44);return n}return n+"/"+r},writeStat(e,r){D[e>>2]=r.dev,D[e+4>>2]=r.mode,D[e+8>>2]=r.nlink,D[e+12>>2]=r.uid,D[e+16>>2]=r.gid,D[e+20>>2]=r.rdev,S[e+24>>3]=BigInt(r.size),T[e+32>>2]=4096,T[e+36>>2]=r.blocks;var t=r.atime.getTime(),n=r.mtime.getTime(),o=r.ctime.getTime();return S[e+40>>3]=BigInt(Math.floor(t/1e3)),D[e+48>>2]=t%1e3*1e3*1e3,S[e+56>>3]=BigInt(Math.floor(n/1e3)),D[e+64>>2]=n%1e3*1e3*1e3,S[e+72>>3]=BigInt(Math.floor(o/1e3)),D[e+80>>2]=o%1e3*1e3*1e3,S[e+88>>3]=BigInt(r.ino),0},writeStatFs(e,r){D[e+4>>2]=r.bsize,D[e+60>>2]=r.bsize,S[e+8>>3]=BigInt(r.blocks),S[e+16>>3]=BigInt(r.bfree),S[e+24>>3]=BigInt(r.bavail),S[e+32>>3]=BigInt(r.files),S[e+40>>3]=BigInt(r.ffree),D[e+48>>2]=r.fsid,D[e+64>>2]=r.flags,D[e+56>>2]=r.namelen},doMsync(e,r,t,n,o){if(!ve.isFile(r.node.mode))throw new ve.ErrnoError(43);if(2&n)return 0;var a=_.slice(e,e+t);ve.msync(r,a,o,t,n)},getStreamFromFD:e=>ve.getStreamChecked(e),varargs:void 0,getStr:e=>ge(e)};var we=()=>{var e=T[+ye.varargs>>2];return ye.varargs+=4,e},Ee=we;var be=e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e);var _e=(e,r,t)=>re(e,_,r,t);var ke=e=>D[e>>2]+4294967296*T[e+4>>2];var $e=(e,r)=>Object.defineProperty(r,"name",{value:e}),Te=[],De=[0,1,,1,null,1,!0,1,!1,1],Ce=class extends Error{constructor(e){super(e),this.name="BindingError"}},Pe=e=>{throw new Ce(e)},Se=e=>(e||Pe(`Cannot use deleted val. handle = ${e}`),De[e]),Fe=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=Te.pop()||De.length;return De[r]=e,De[r+1]=1,r}}};class Ae extends Error{}var Me=e=>{for(var r="";;){var t=_[e++];if(!t)return r;r+=String.fromCharCode(t)}},Oe={},Ne=(e,r)=>{for(void 0===r&&Pe("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},xe={},Re=e=>{var r=nt(e),t=Me(r);return at(r),t},ze=(e,r)=>{var t=xe[e];return void 0===t&&Pe(`${r} has unknown type ${Re(e)}`),t},Ie=e=>{},je=!1,Ue=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Be=e=>globalThis.FinalizationRegistry?(je=new FinalizationRegistry(e=>{Ue(e.$$)}),Be=e=>{var r=e.$$;if(!!r.smartPtr){var t={$$:r};je.register(e,t,e)}return e},Ie=e=>je.unregister(e),Be(e)):(Be=e=>e,e),We={},Le=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function He(e){return this.fromWireType(D[e>>2])}var Ye={},qe={},Ve=class extends Error{constructor(e){super(e),this.name="InternalError"}},Ge=e=>{throw new Ve(e)},Xe=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&Ge("Mismatched type converter count");for(var o=0;o<e.length;++o)Je(e[o],n[o])}e.forEach(e=>qe[e]=r);var o=new Array(r.length),a=[],s=0;for(let[e,t]of r.entries())xe.hasOwnProperty(t)?o[e]=xe[t]:(a.push(t),Ye.hasOwnProperty(t)||(Ye[t]=[]),Ye[t].push(()=>{o[e]=xe[t],++s===a.length&&n(o)}));0===a.length&&n(o)};function Je(e,r,t={}){return function(e,r,t={}){var n=r.name;if(e||Pe(`type "${n}" must have a positive integer typeid pointer`),xe.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Pe(`Cannot register type '${n}' twice`)}if(xe[e]=r,delete qe[e],Ye.hasOwnProperty(e)){var o=Ye[e];delete Ye[e],o.forEach(e=>e())}}(e,r,t)}var Ke=(e,r,t)=>{switch(r){case 1:return t?e=>b[e]:e=>_[e];case 2:return t?e=>k[e>>1]:e=>$[e>>1];case 4:return t?e=>T[e>>2]:e=>D[e>>2];case 8:return t?e=>S[e>>3]:e=>F[e>>3];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Ze=e=>{Pe(e.$$.ptrType.registeredClass.name+" instance already deleted")},Qe=[];function er(){}var rr={},tr=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(...n){return e[r].overloadTable.hasOwnProperty(n.length)||Pe(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[n.length].apply(this,n)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},nr=(e,r,n)=>{t.hasOwnProperty(e)?((void 0===n||void 0!==t[e].overloadTable&&void 0!==t[e].overloadTable[n])&&Pe(`Cannot register public name '${e}' twice`),tr(t,e,e),t[e].overloadTable.hasOwnProperty(n)&&Pe(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),t[e].overloadTable[n]=r):(t[e]=r,t[e].argCount=n)};function or(e,r,t,n,o,a,s,i){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=s,this.downcast=i,this.pureVirtualFunctions=[]}var ar=(e,r,t)=>{for(;r!==t;)r.upcast||Pe(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e},sr=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e};function ir(e,r){if(null===r)return this.isReference&&Pe(`null is not a valid ${this.name}`),0;r.$$||Pe(`Cannot pass "${sr(r)}" as a ${this.name}`),r.$$.ptr||Pe(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return ar(r.$$.ptr,t,this.registeredClass)}function lr(e,r){var t;if(null===r)return this.isReference&&Pe(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r&&r.$$||Pe(`Cannot pass "${sr(r)}" as a ${this.name}`),r.$$.ptr||Pe(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Pe(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=ar(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&Pe("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Pe(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,Fe(()=>o.delete())),null!==e&&e.push(this.rawDestructor,t)}break;default:Pe("Unsupported sharing policy")}return t}function ur(e,r){if(null===r)return this.isReference&&Pe(`null is not a valid ${this.name}`),0;r.$$||Pe(`Cannot pass "${sr(r)}" as a ${this.name}`),r.$$.ptr||Pe(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Pe(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return ar(r.$$.ptr,t,this.registeredClass)}var dr=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=dr(e,r,t.baseClass);return null===n?null:t.downcast(n)},cr=(e,r)=>(r.ptrType&&r.ptr||Ge("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!==!!r.smartPtr&&Ge("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Be(Object.create(e,{$$:{value:r,writable:!0}})));function fr(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=Ne(e,r),Oe[r]))(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?cr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):cr(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,s=this.registeredClass.getActualType(r),i=rr[s];if(!i)return o.call(this);a=this.isConst?i.constPointerType:i.pointerType;var l=dr(r,this.registeredClass,a.registeredClass);return null===l?o.call(this):this.isSmartPointer?cr(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):cr(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}function mr(e,r,t,n,o,a,s,i,l,u,d){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=s,this.rawGetPointee=i,this.rawConstructor=l,this.rawShare=u,this.rawDestructor=d,o||void 0!==r.baseClass?this.toWireType=lr:n?(this.toWireType=ir,this.destructorFunction=null):(this.toWireType=ur,this.destructorFunction=null)}var hr=(e,r,n)=>{t.hasOwnProperty(e)||Ge("Replacing nonexistent public symbol"),void 0!==t[e].overloadTable&&void 0!==n?t[e].overloadTable[n]=r:(t[e]=r,t[e].argCount=n)},pr=(e,r,t=!1)=>{e=Me(e);var n,o=(n=r,dt.get(n));return"function"!=typeof o&&Pe(`unknown function pointer with signature ${e}: ${r}`),o};class vr extends Error{}var gr=(e,r)=>{var t=[],n={};throw r.forEach(function e(r){n[r]||xe[r]||(qe[r]?qe[r].forEach(e):(t.push(r),n[r]=!0))}),new vr(`${e}: `+t.map(Re).join([", "]))};function yr(e,r,t,n,o,a){var s=r.length;s<2&&Pe("argTypes array size mismatch! Must at least get return value and 'this' types!");var i=null!==r[1]&&null!==t,l=function(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}(r),u=!r[0].isVoid,d=s-2,c=new Array(d),f=[],m=[];return $e(e,function(...e){var t;m.length=0,f.length=i?2:1,f[0]=o,i&&(t=r[1].toWireType(m,this),f[1]=t);for(var a=0;a<d;++a)c[a]=r[a+2].toWireType(m,e[a]),f.push(c[a]);return function(e){if(l)Le(m);else for(var n=i?1:2;n<r.length;n++){var o=1===n?t:c[n-2];null!==r[n].destructorFunction&&r[n].destructorFunction(o)}if(u)return r[0].fromWireType(e)}(n(...f))})}var wr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(D[r+4*n>>2]);return t},Er=e=>{const r=(e=e.trim()).indexOf("(");return-1===r?e:e.slice(0,r)},br=(e,r,t)=>(e instanceof Object||Pe(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||Pe(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||Pe(`cannot call emscripten binding method ${t} on deleted object`),ar(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),_r=e=>{e>9&&0===--De[e+1]&&(De[e]=void 0,Te.push(e))},kr={name:"emscripten::val",fromWireType:e=>{var r=Se(e);return _r(e),r},toWireType:(e,r)=>Fe(r),readValueFromPointer:He,destructorFunction:null},$r=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(C[e>>2])};case 8:return function(e){return this.fromWireType(P[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Tr=(e,r,t)=>{const n=(e,r)=>{let t=0;return{next(){if(t>=e)return{done:!0};const n=t;t++;return{value:r(n),done:!1}},[Symbol.iterator](){return this}}};e[Symbol.iterator]||(e[Symbol.iterator]=function(){const e=this[r]();return n(e,e=>this[t](e))})},Dr=Object.assign({optional:!0},kr),Cr=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,Pr=(e,r,t)=>{var n=e>>1,o=K($,n,r/2,t);if(o-n>16&&Cr)return Cr.decode($.subarray(n,o));for(var a="",s=n;s<o;++s){var i=$[s];a+=String.fromCharCode(i)}return a},Sr=(e,r,t)=>{if(t??=2147483647,t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a<o;++a){var s=e.charCodeAt(a);k[r>>1]=s,r+=2}return k[r>>1]=0,r-n},Fr=e=>2*e.length,Ar=(e,r,t)=>{for(var n="",o=e>>2,a=0;!(a>=r/4);a++){var s=D[o+a];if(!s&&!t)break;n+=String.fromCodePoint(s)}return n},Mr=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var s=e.codePointAt(a);if(s>65535&&a++,T[r>>2]=s,(r+=4)+4>o)break}return T[r>>2]=0,r-n},Or=e=>{for(var r=0,t=0;t<e.length;++t){e.codePointAt(t)>65535&&t++,r+=4}return r},Nr=0,xr=[],Rr={},zr=e=>{var r=Rr[e];return void 0===r?Me(e):r};var Ir=e=>e%4==0&&(e%100!=0||e%400==0),jr=[0,31,60,91,121,152,182,213,244,274,305,335],Ur=[0,31,59,90,120,151,181,212,243,273,304,334],Br=e=>(Ir(e.getFullYear())?jr:Ur)[e.getMonth()]+e.getDate()-1;var Wr={},Lr=e=>{if(e instanceof j||"unwind"==e)return h;l(1,e)},Hr=()=>Y||Nr>0,Yr=e=>{h=e,Hr()||(t.onExit?.(e),g=!0),l(e,new j(e))},qr=(e,r)=>{h=e,Yr(e)},Vr=e=>{if(!g)try{return e()}catch(e){Lr(e)}finally{(()=>{if(!Hr())try{qr(h)}catch(e){Lr(e)}})()}},Gr=()=>performance.now(),Xr=()=>Date.now();var Jr=e=>{var r=(e-ut.buffer.byteLength+65535)/65536|0;try{return ut.grow(r),N(),1}catch(e){}},Kr=e=>{var r;return(r=/\bwasm-function\[\d+\]:(0x[0-9a-f]+)/.exec(e))?+r[1]:(r=/:(\d+):\d+(?:\)|$)/.exec(e))?2147483648|+r[1]:0},Zr={},Qr=e=>{for(var r of e){var t=Kr(r);t&&(Zr[t]=r)}},et=()=>(new Error).stack.toString(),rt={},tt=()=>{if(!tt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:i||"./this.program"};for(var r in rt)void 0===rt[r]?delete e[r]:e[r]=rt[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);tt.strings=t}return tt.strings};var nt,ot,at,st,it,lt,ut,dt,ct=(e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t},ft=[31,29,31,30,31,30,31,31,30,31,30,31],mt=[31,28,31,30,31,30,31,31,30,31,30,31],ht=(e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=Ir(t.getFullYear()),o=t.getMonth(),a=(n?ft:mt)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t};ve.createPreloadedFile=(e,r,t,n,o,a,s,i,l,u)=>{pe(e,r,t,n,o,i,l,u).then(a).catch(s)},ve.preloadFile=pe,ve.staticInit();for(var pt=new Uint8Array(123),vt=25;vt>=0;--vt)pt[48+vt]=52+vt,pt[65+vt]=vt,pt[97+vt]=26+vt;if(pt[43]=62,pt[47]=63,(()=>{let e=er.prototype;Object.assign(e,{isAliasOf(e){if(!(this instanceof er))return!1;if(!(e instanceof er))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||Ze(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=Be(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Pe("Object already scheduled for deletion"),Ie(this),Ue(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ze(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Pe("Object already scheduled for deletion"),Qe.push(this),Qe.length,this.$$.deleteScheduled=!0,this}});const r=Symbol.dispose;r&&(e[r]=e.delete)})(),Object.assign(mr.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},readValueFromPointer:He,fromWireType:fr}),t.noExitRuntime&&(Y=t.noExitRuntime),t.preloadPlugins&&(he=t.preloadPlugins),t.print&&(p=t.print),t.printErr&&(v=t.printErr),t.wasmBinary&&(m=t.wasmBinary),t.arguments&&t.arguments,t.thisProgram&&(i=t.thisProgram),t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.shift()();t.addRunDependency=me,t.removeRunDependency=fe,t.FS_preloadFile=pe,t.FS_unlink=(...e)=>ve.unlink(...e),t.FS_createPath=(...e)=>ve.createPath(...e),t.FS_createDevice=(...e)=>ve.createDevice(...e),t.FS=ve,t.FS_createDataFile=ue,t.FS_createLazyFile=(...e)=>ve.createLazyFile(...e);var gt,yt={ha:function(e,r){try{return e=ye.getStr(e),ve.chmod(e,r),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},ka:function(e,r,t,n){try{if(r=ye.getStr(r),r=ye.calculateAt(e,r),-8&t)return-28;var o=ve.lookupPath(r,{follow:!0}).node;if(!o)return-44;var a="";return 4&t&&(a+="r"),2&t&&(a+="w"),1&t&&(a+="x"),a&&ve.nodePermissions(o,a)?-2:0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},ia:function(e,r){try{return ve.fchmod(e,r),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},ga:function(e,r,t){try{return ve.fchown(e,r,t),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},f:function(e,r,t){ye.varargs=t;try{var n=ye.getStreamFromFD(e);switch(r){case 0:if((o=we())<0)return-28;for(;ve.streams[o];)o++;return ve.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=we();return n.flags|=o,0;case 12:o=Ee();return k[o+0>>1]=2,0}return-28}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},ea:function(e,r){try{return ye.writeStat(r,ve.fstat(e))}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},$:function(e,r){r=be(r);try{return isNaN(r)?-61:(ve.ftruncate(e,r),0)}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},_:function(e,r){try{if(0===r)return-28;var t=ve.cwd(),n=ee(t)+1;return r<n?-68:(_e(t,e,r),n)}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},N:function(e,r,t){try{var n=ye.getStreamFromFD(e);n.getdents||=ve.readdir(n.path);for(var o=280,a=0,s=ve.llseek(n,0,1),i=Math.floor(s/o),l=Math.min(n.getdents.length,i+Math.floor(t/o)),u=i;u<l;u++){var d,c,f=n.getdents[u];if("."===f)d=n.node.id,c=4;else if(".."===f){d=ve.lookupPath(n.path,{parent:!0}).node.id,c=4}else{var m;try{m=ve.lookupNode(n.node,f)}catch(e){if(28===e?.errno)continue;throw e}d=m.id,c=ve.isChrdev(m.mode)?2:ve.isDir(m.mode)?4:ve.isLink(m.mode)?10:8}S[r+a>>3]=BigInt(d),S[r+a+8>>3]=BigInt((u+1)*o),k[r+a+16>>1]=280,b[r+a+18]=c,_e(f,r+a+19,256),a+=o}return ve.llseek(n,u*o,0),a}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},fa:function(e,r,t){ye.varargs=t;try{var n=ye.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=Ee();T[a>>2]=o.c_iflag||0,T[a+4>>2]=o.c_oflag||0,T[a+8>>2]=o.c_cflag||0,T[a+12>>2]=o.c_lflag||0;for(var s=0;s<32;s++)b[a+s+17]=o.c_cc[s]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=Ee();var i=T[a>>2],l=T[a+4>>2],u=T[a+8>>2],d=T[a+12>>2],c=[];for(s=0;s<32;s++)c.push(b[a+s+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:i,c_oflag:l,c_cflag:u,c_lflag:d,c_cc:c})}return 0;case 21519:if(!n.tty)return-59;a=Ee();return T[a>>2]=0,0;case 21520:return n.tty?-28:-59;case 21537:case 21531:a=Ee();return ve.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=Ee();k[a>>1]=f[0],k[a+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},ca:function(e,r){try{return e=ye.getStr(e),ye.writeStat(r,ve.lstat(e))}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},U:function(e,r,t){try{return r=ye.getStr(r),r=ye.calculateAt(e,r),ve.mkdir(r,t,0),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},ba:function(e,r,t,n){try{r=ye.getStr(r);var o=256&n,a=4096&n;return n&=-6401,r=ye.calculateAt(e,r,a),ye.writeStat(t,o?ve.lstat(r):ve.stat(r))}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},m:function(e,r,t,n){ye.varargs=n;try{r=ye.getStr(r),r=ye.calculateAt(e,r);var o=n?we():0;return ve.open(r,t,o).fd}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},L:function(e,r,t,n){try{if(r=ye.getStr(r),r=ye.calculateAt(e,r),n<=0)return-28;var o=ve.readlink(r),a=Math.min(n,ee(o)),s=b[t+a];return _e(o,t,n+1),b[t+a]=s,a}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},K:function(e,r,t,n){try{return r=ye.getStr(r),n=ye.getStr(n),r=ye.calculateAt(e,r),n=ye.calculateAt(t,n),ve.rename(r,n),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},q:function(e){try{return e=ye.getStr(e),ve.rmdir(e),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},da:function(e,r){try{return e=ye.getStr(e),ye.writeStat(r,ve.stat(e))}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},r:function(e,r,t){try{if(r=ye.getStr(r),r=ye.calculateAt(e,r),t){if(512!==t)return-28;ve.rmdir(r)}else ve.unlink(r);return 0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},I:function(e,r,t,n){try{r=ye.getStr(r),r=ye.calculateAt(e,r,!0);var o,a,s=Date.now();if(t){var i=ke(t),l=T[t+8>>2];o=1073741823==l?s:1073741822==l?null:1e3*i+l/1e6,i=ke(t+=16),a=1073741823==(l=T[t+8>>2])?s:1073741822==l?null:1e3*i+l/1e6}else o=s,a=s;return null!==(a??o)&&ve.utime(r,o,a),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},la:()=>x(""),ua:(e,r,t)=>{e=Me(e),r=ze(r,"wrapper"),t=Se(t);var n=r.registeredClass,o=n.instancePrototype,a=n.baseClass.instancePrototype,s=n.baseClass.constructor,i=$e(e,function(...e){for(var r of n.baseClass.pureVirtualFunctions)if(this[r]===a[r])throw new Ae(`Pure virtual function ${r} must be implemented in JavaScript`);Object.defineProperty(this,"__parent",{value:o}),this.__construct(...e)});return o.__construct=function(...e){this===o&&Pe("Pass correct 'this' to __construct");var r=s.implement(this,...e);Ie(r);var t,a,i,l=r.$$;r.notifyOnDestruction(),l.preservePointerOnDelete=!0,Object.defineProperties(this,{$$:{value:l}}),Be(this),t=n,a=l.ptr,i=this,a=Ne(t,a),Oe.hasOwnProperty(a)?Pe(`Tried to register registered instance: ${a}`):Oe[a]=i},o.__destruct=function(){var e,r;this===o&&Pe("Pass correct 'this' to __destruct"),Ie(this),e=n,r=this.$$.ptr,r=Ne(e,r),Oe.hasOwnProperty(r)?delete Oe[r]:Pe(`Tried to unregister unregistered instance: ${r}`)},i.prototype=Object.create(o),Object.assign(i.prototype,t),Fe(i)},wa:e=>{var r=We[e];delete We[e];var t=r.rawConstructor,n=r.rawDestructor,o=r.fields,a=o.map(e=>e.getterReturnType).concat(o.map(e=>e.setterArgumentType));Xe([e],a,e=>{var a={};for(var[s,i]of o.entries()){const r=e[s],t=i.getter,n=i.getterContext,l=e[s+o.length],u=i.setter,d=i.setterContext;a[i.fieldName]={read:e=>r.fromWireType(t(n,e)),write:(e,r)=>{var t=[];u(d,e,l.toWireType(t,r)),Le(t)},optional:r.optional}}return[{name:r.name,fromWireType:e=>{var r={};for(var t in a)r[t]=a[t].read(e);return n(e),r},toWireType:(e,r)=>{for(var o in a)if(!(o in r)&&!a[o].optional)throw new TypeError(`Missing field: "${o}"`);var s=t();for(o in a)a[o].write(s,r[o]);return null!==e&&e.push(n,s),s},readValueFromPointer:He,destructorFunction:n}]})},y:(e,r,t,n,o)=>{r=Me(r);const a=0n===n;let s=e=>e;if(a){const e=8*t;s=r=>BigInt.asUintN(e,r),o=s(o)}Je(e,{name:r,fromWireType:s,toWireType:(e,r)=>("number"==typeof r&&(r=BigInt(r)),r),readValueFromPointer:Ke(r,t,!a),destructorFunction:null})},za:(e,r,t,n)=>{Je(e,{name:r=Me(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},readValueFromPointer:function(e){return this.fromWireType(_[e])},destructorFunction:null})},l:(e,r,t,n,o,a,s,i,l,u,d,c,f)=>{d=Me(d),a=pr(o,a),i&&=pr(s,i),u&&=pr(l,u),f=pr(c,f);var m=(e=>{var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(d);nr(m,function(){gr(`Cannot construct ${d} due to unbound types`,[n])}),Xe([e,r,t],n?[n]:[],r=>{var t,o;r=r[0],o=n?(t=r.registeredClass).instancePrototype:er.prototype;var s=$e(d,function(...e){if(Object.getPrototypeOf(this)!==l)throw new Ce(`Use 'new' to construct ${d}`);if(void 0===c.constructor_body)throw new Ce(`${d} has no accessible constructor`);var r=c.constructor_body[e.length];if(void 0===r)throw new Ce(`Tried to invoke ctor of ${d} with invalid number of parameters (${e.length}) - expected (${Object.keys(c.constructor_body).toString()}) parameters instead!`);return r.apply(this,e)}),l=Object.create(o,{constructor:{value:s}});s.prototype=l;var c=new or(d,s,l,f,t,a,i,u);c.baseClass&&(c.baseClass.__derivedClasses??=[],c.baseClass.__derivedClasses.push(c));var h=new mr(d,c,!0,!1,!1),p=new mr(d+"*",c,!1,!1,!1),v=new mr(d+" const*",c,!1,!0,!1);return rr[e]={pointerType:p,constPointerType:v},hr(m,s),[h,p,v]})},v:(e,r,t,n,o,a,s,i,l)=>{var u=wr(t,n);r=Me(r),r=Er(r),a=pr(o,a,i),Xe([],[e],e=>{var n=`${(e=e[0]).name}.${r}`;function o(){gr(`Cannot call ${n} due to unbound types`,u)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var i=e.registeredClass.constructor;return void 0===i[r]?(o.argCount=t-1,i[r]=o):(tr(i,r,n),i[r].overloadTable[t-1]=o),Xe([],u,o=>{var l=[o[0],null].concat(o.slice(1)),u=yr(n,l,null,a,s);if(void 0===i[r].overloadTable?(u.argCount=t-1,i[r]=u):i[r].overloadTable[t-1]=u,e.registeredClass.__derivedClasses)for(const t of e.registeredClass.__derivedClasses)t.constructor.hasOwnProperty(r)||(t.constructor[r]=u);return[]}),[]})},x:(e,r,t,n,o,a)=>{var s=wr(r,t);o=pr(n,o),Xe([],[e],e=>{var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new Ce(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{gr(`Cannot construct ${e.name} due to unbound types`,s)},Xe([],s,n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=yr(t,n,null,o,a),[])),[]})},a:(e,r,t,n,o,a,s,i,l,u)=>{var d=wr(t,n);r=Me(r),r=Er(r),a=pr(o,a,l),Xe([],[e],e=>{var n=`${(e=e[0]).name}.${r}`;function o(){gr(`Cannot call ${n} due to unbound types`,d)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),i&&e.registeredClass.pureVirtualFunctions.push(r);var l=e.registeredClass.instancePrototype,u=l[r];return void 0===u||void 0===u.overloadTable&&u.className!==e.name&&u.argCount===t-2?(o.argCount=t-2,o.className=e.name,l[r]=o):(tr(l,r,n),l[r].overloadTable[t-2]=o),Xe([],d,o=>{var i=yr(n,o,e,a,s);return void 0===l[r].overloadTable?(i.argCount=t-2,l[r]=i):l[r].overloadTable[t-2]=i,[]}),[]})},z:(e,r,t,n,o,a,s,i,l,u)=>{r=Me(r),o=pr(n,o),Xe([],[e],e=>{var n=`${(e=e[0]).name}.${r}`,d={get(){gr(`Cannot access ${n} due to unbound types`,[t,s])},enumerable:!0,configurable:!0};return d.set=l?()=>gr(`Cannot access ${n} due to unbound types`,[t,s]):e=>Pe(n+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,r,d),Xe([],l?[t,s]:[t],t=>{var s=t[0],d={get(){var r=br(this,e,n+" getter");return s.fromWireType(o(a,r))},enumerable:!0};if(l){l=pr(i,l);var c=t[1];d.set=function(r){var t=br(this,e,n+" setter"),o=[];l(u,t,c.toWireType(o,r)),Le(o)}}return Object.defineProperty(e.registeredClass.instancePrototype,r,d),[]}),[]})},xa:e=>Je(e,kr),w:(e,r,t)=>{Je(e,{name:r=Me(r),fromWireType:e=>e,toWireType:(e,r)=>r,readValueFromPointer:$r(r,t),destructorFunction:null})},e:(e,r,t,n,o,a,s,i)=>{var l=wr(r,t);e=Me(e),e=Er(e),o=pr(n,o,s),nr(e,function(){gr(`Cannot call ${e} due to unbound types`,l)},r-1),Xe([],l,t=>{var n=[t[0],null].concat(t.slice(1));return hr(e,yr(e,n,null,o,a),r-1),[]})},g:(e,r,t,n,o)=>{r=Me(r);let a=e=>e;if(0===n){var s=32-8*t;a=e=>e<<s>>>s,o=a(o)}Je(e,{name:r,fromWireType:a,toWireType:(e,r)=>r,readValueFromPointer:Ke(r,t,0!==n),destructorFunction:null})},p:(e,r,t,n)=>{t=Me(t),n=Me(n),Xe([],[e,r],e=>{const r=e[0];return Tr(r.registeredClass.instancePrototype,t,n),[]})},d:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][r];function o(e){var r=D[e>>2],t=D[e+4>>2];return new n(b.buffer,t,r)}Je(e,{name:t=Me(t),fromWireType:o,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},B:(e,r)=>{Je(e,Dr)},C:(e,r,t,n,o,a,s,i,l,u,d,c)=>{t=Me(t),a=pr(o,a),i=pr(s,i),u=pr(l,u),c=pr(d,c),Xe([e],[r],e=>(e=e[0],[new mr(t,e.registeredClass,!1,!1,!0,e,n,a,i,u,c)]))},ya:(e,r)=>{r=Me(r);Je(e,{name:r,fromWireType(e){var r,t=D[e>>2],n=e+4;return r=ge(n,t,!0),at(e),r},toWireType(e,r){var t;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var n="string"==typeof r;n||ArrayBuffer.isView(r)&&1==r.BYTES_PER_ELEMENT||Pe("Cannot pass non-string to std::string"),t=n?ee(r):r.length;var o=ot(4+t+1),a=o+4;(D[o>>2]=t,n)?_e(r,a,t+1):_.set(r,a);return null!==e&&e.push(at,o),o},readValueFromPointer:He,destructorFunction(e){at(e)}})},o:(e,r,t)=>{var n,o,a;t=Me(t),2===r?(n=Pr,o=Sr,a=Fr):(n=Ar,o=Mr,a=Or),Je(e,{name:t,fromWireType:e=>{var t=D[e>>2],o=n(e+4,t*r,!0);return at(e),o},toWireType:(e,n)=>{"string"!=typeof n&&Pe(`Cannot pass non-string to C++ string type ${t}`);var s=a(n),i=ot(4+s+r);return D[i>>2]=s/r,o(n,i+4,s+r),null!==e&&e.push(at,i),i},readValueFromPointer:He,destructorFunction(e){at(e)}})},n:(e,r,t,n,o,a)=>{We[e]={name:Me(r),rawConstructor:pr(t,n),rawDestructor:pr(o,a),fields:[]}},j:(e,r,t,n,o,a,s,i,l,u)=>{We[e].fields.push({fieldName:Me(r),getterReturnType:t,getter:pr(n,o),getterContext:a,setterArgumentType:s,setter:pr(i,l),setterContext:u})},Aa:(e,r)=>{Je(e,{isVoid:!0,name:r=Me(r),fromWireType:()=>{},toWireType:(e,r)=>{}})},ma:e=>{do{var r=D[e>>2],t=D[(e+=4)>>2],n=D[(e+=4)>>2];e+=4;var o=ge(r);ve.createPath("/",q.dirname(o),!0,!0),ve.createDataFile(o,null,b.subarray(n,n+t),!0,!0,!0)}while(D[e>>2])},E:()=>{Y=!1,Nr=0},c:(e,r,t)=>{var[n,...o]=((e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=ze(D[r+4*n>>2],`parameter ${n}`);return t})(e,r),a=n.toWireType.bind(n),s=o.map(e=>e.readValueFromPointer.bind(e));e--;var i,l,u=new Array(e),d=`methodCaller<(${o.map(e=>e.name)}) => ${n.name}>`;return i=$e(d,(r,n,o,i)=>{for(var l,d=0,c=0;c<e;++c)u[c]=s[c](i+d),d+=8;switch(t){case 0:l=Se(r).apply(null,u);break;case 2:l=Reflect.construct(Se(r),u);break;case 3:l=u[0];break;case 1:l=Se(r)[zr(n)](...u)}return((e,r,t)=>{var n=[],o=e(n,t);return n.length&&(D[r>>2]=Fe(n)),o})(a,o,l)}),l=xr.length,xr.push(i),l},M:_r,sa:e=>e?(e=zr(e),Fe(globalThis[e])):Fe(globalThis),na:e=>(e=zr(e),Fe(t[e])),i:(e,r)=>(e=Se(e),r=Se(r),Fe(e[r])),A:e=>{e>9&&(De[e+1]+=1)},b:(e,r,t,n,o)=>xr[e](r,t,n,o),va:e=>Fe(zr(e)),X:e=>{var r=Se(e);Le(r),_r(e)},ta:e=>(e=Se(e),Fe(typeof e)),Q:function(e,r){e=be(e);var t=new Date(1e3*e);T[r>>2]=t.getUTCSeconds(),T[r+4>>2]=t.getUTCMinutes(),T[r+8>>2]=t.getUTCHours(),T[r+12>>2]=t.getUTCDate(),T[r+16>>2]=t.getUTCMonth(),T[r+20>>2]=t.getUTCFullYear()-1900,T[r+24>>2]=t.getUTCDay();var n=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),o=(t.getTime()-n)/864e5|0;T[r+28>>2]=o},R:function(e,r){e=be(e);var t=new Date(1e3*e);T[r>>2]=t.getSeconds(),T[r+4>>2]=t.getMinutes(),T[r+8>>2]=t.getHours(),T[r+12>>2]=t.getDate(),T[r+16>>2]=t.getMonth(),T[r+20>>2]=t.getFullYear()-1900,T[r+24>>2]=t.getDay();var n=0|Br(t);T[r+28>>2]=n,T[r+36>>2]=-60*t.getTimezoneOffset();var o=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),i=0|(a!=s&&t.getTimezoneOffset()==Math.min(s,a));T[r+32>>2]=i},S:function(e){var r=(()=>{var r=new Date(T[e+20>>2]+1900,T[e+16>>2],T[e+12>>2],T[e+8>>2],T[e+4>>2],T[e>>2],0),t=T[e+32>>2],n=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),i=Math.min(s,a);if(t<0)T[e+32>>2]=Number(a!=s&&i==n);else if(t>0!=(i==n)){var l=Math.max(s,a),u=t>0?i:l;r.setTime(r.getTime()+6e4*(u-n))}T[e+24>>2]=r.getDay();var d=0|Br(r);T[e+28>>2]=d,T[e>>2]=r.getSeconds(),T[e+4>>2]=r.getMinutes(),T[e+8>>2]=r.getHours(),T[e+12>>2]=r.getDate(),T[e+16>>2]=r.getMonth(),T[e+20>>2]=r.getYear();var c=r.getTime();return isNaN(c)?-1:c/1e3})();return BigInt(r)},O:function(e,r,t,n,o,a,s){o=be(o);try{var i=ye.getStreamFromFD(n),l=ve.mmap(i,e,o,r,t),u=l.ptr;return T[a>>2]=l.allocated,D[s>>2]=u,0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},P:function(e,r,t,n,o,a){a=be(a);try{var s=ye.getStreamFromFD(o);2&t&&ye.doMsync(e,s,r,n,a)}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},F:(e,r)=>{if(Wr[e]&&(clearTimeout(Wr[e].id),delete Wr[e]),!r)return 0;var t=setTimeout(()=>{delete Wr[e],Vr(()=>it(e,Gr()))},r);return Wr[e]={id:t,timeout_ms:r},0},T:function(e){var r=(()=>{var r=Date.UTC(T[e+20>>2]+1900,T[e+16>>2],T[e+12>>2],T[e+8>>2],T[e+4>>2],T[e>>2],0),t=new Date(r);T[e+24>>2]=t.getUTCDay();var n=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),o=(t.getTime()-n)/864e5|0;return T[e+28>>2]=o,t.getTime()/1e3})();return BigInt(r)},ja:function(e,r,t){if(r=be(r),!((n=e)>=0&&n<=3))return 28;var n,o;o=0===e?Xr():Gr();var a=Math.round(1e3*o*1e3);return S[t>>3]=BigInt(a),0},u:Xr,J:()=>2147483648,h:Gr,G:e=>{var r=_.length,t=2147483648;if((e>>>=0)>t)return!1;for(var n=1;n<=4;n*=2){var o=r*(1+.2/n);o=Math.min(o,e+100663296);var a=Math.min(t,oe(Math.max(e,o),65536));if(Jr(a))return!0}return!1},qa:()=>{var e=et().split("\n");return"Error"==e[0]&&e.shift(),Qr(e),Zr.last_addr=Kr(e[3]),Zr.last_stack=e,Zr.last_addr},pa:(e,r,t)=>{var n;Zr.last_addr==e?n=Zr.last_stack:("Error"==(n=et().split("\n"))[0]&&n.shift(),Qr(n));for(var o=3;n[o]&&Kr(n[o])!=e;)++o;for(var a=0;a<t&&n[a+o];++a)T[r+4*a>>2]=Kr(n[a+o]);return a},W:(e,r)=>{var t=0,n=0;for(var o of tt()){var a=r+t;D[e+n>>2]=a,t+=_e(o,a,1/0)+1,n+=4}return 0},Y:(e,r)=>{var t=tt();D[e>>2]=t.length;var n=0;for(var o of t)n+=ee(o)+1;return D[r>>2]=n,0},ra:qr,k:function(e){try{var r=ye.getStreamFromFD(e);return ve.close(r),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},H:function(e,r){try{var t=ye.getStreamFromFD(e),n=t.tty?2:ve.isDir(t.mode)?3:ve.isLink(t.mode)?7:4;return b[r]=n,k[r+2>>1]=0,S[r+8>>3]=BigInt(0),S[r+16>>3]=BigInt(0),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},t:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a<t;a++){var s=D[r>>2],i=D[r+4>>2];r+=8;var l=ve.read(e,b,s,i,n);if(l<0)return-1;if(o+=l,l<i)break;void 0!==n&&(n+=l)}return o})(ye.getStreamFromFD(e),r,t);return D[n>>2]=o,0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},V:function(e,r,t,n){r=be(r);try{if(isNaN(r))return 61;var o=ye.getStreamFromFD(e);return ve.llseek(o,r,t),S[n>>3]=BigInt(o.position),o.getdents&&0===r&&0===t&&(o.getdents=null),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},aa:function(e){try{var r=ye.getStreamFromFD(e),t=r.stream_ops?.fsync?.(r);return t}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},s:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a<t;a++){var s=D[r>>2],i=D[r+4>>2];r+=8;var l=ve.write(e,b,s,i,n);if(l<0)return-1;if(o+=l,l<i)break;void 0!==n&&(n+=l)}return o})(ye.getStreamFromFD(e),r,t);return D[n>>2]=o,0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},D:Yr,Z:function(e,r){try{return G(_.subarray(e,e+r)),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},oa:(e,r,t)=>{for(var n=ge(r),o="\\!@#$^&*()+=-[]/{}|:<>?,.",a=0;a<25;++a)n=n.replace(new RegExp("\\"+o[a],"g"),"\\"+o[a]);var s={A:"%a",B:"%b",c:"%a %b %d %H:%M:%S %Y",D:"%m\\/%d\\/%y",e:"%d",F:"%Y-%m-%d",h:"%b",R:"%H\\:%M",r:"%I\\:%M\\:%S\\s%p",T:"%H\\:%M\\:%S",x:"%m\\/%d\\/(?:%y|%Y)",X:"%H\\:%M\\:%S"},i={a:"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)",b:"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)",C:"\\d\\d",d:"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31",H:"\\d(?!\\d)|[0,1]\\d|20|21|22|23",I:"\\d(?!\\d)|0\\d|10|11|12",j:"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d",m:"0[1-9]|[1-9](?!\\d)|10|11|12",M:"0\\d|\\d(?!\\d)|[1-5]\\d",n:" ",p:"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.",S:"0\\d|\\d(?!\\d)|[1-5]\\d|60",U:"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53",W:"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53",w:"[0-6]",y:"\\d\\d",Y:"\\d\\d\\d\\d",t:" ",z:"Z|(?:[\\+\\-]\\d\\d:?(?:\\d\\d)?)"},l=[],u=n.replace(/%(.)/g,(e,r)=>s[r]||e).replace(/%(.)/g,(e,r)=>{let t=i[r];return t?(l.push(r),`(${t})`):r}).replace(/\s+/g,"\\s*"),d=new RegExp("^"+u,"i").exec(ge(e));if(d){var c,f=function(){function e(e,r,t){return"number"!=typeof e||isNaN(e)?r:e>=r?e<=t?e:t:r}return{year:e(T[t+20>>2]+1900,1970,9999),month:e(T[t+16>>2],0,11),day:e(T[t+12>>2],1,31),hour:e(T[t+8>>2],0,23),min:e(T[t+4>>2],0,59),sec:e(T[t>>2],0,59),gmtoff:0}}(),m=e=>{var r=l.indexOf(e);if(r>=0)return d[r+1]};if((c=m("S"))&&(f.sec=Number(c)),(c=m("M"))&&(f.min=Number(c)),c=m("H"))f.hour=Number(c);else if(c=m("I")){var h=Number(c);(c=m("p"))&&(h+="P"===c.toUpperCase()[0]?12:0),f.hour=h}if(c=m("Y"))f.year=Number(c);else if(c=m("y")){var p=Number(c);(c=m("C"))?p+=100*Number(c):p+=p<69?2e3:1900,f.year=p}if((c=m("m"))?f.month=Number(c)-1:(c=m("b"))&&(f.month={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11}[c.substring(0,3).toUpperCase()]||0),c=m("d"))f.day=Number(c);else if(c=m("j"))for(var v=Number(c),g=Ir(f.year),y=0;y<12;++y){var w=ct(g?ft:mt,y-1);v<=w+(g?ft:mt)[y]&&(f.day=v-w)}else if(c=m("a")){var E=c.substring(0,3).toUpperCase();if(c=m("U")){var b={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6}[E],_=Number(c);$=0===(k=new Date(f.year,0,1)).getDay()?ht(k,b+7*(_-1)):ht(k,7-k.getDay()+b+7*(_-1)),f.day=$.getDate(),f.month=$.getMonth()}else if(c=m("W")){var k,$;b={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6}[E],_=Number(c);$=1===(k=new Date(f.year,0,1)).getDay()?ht(k,b+7*(_-1)):ht(k,7-k.getDay()+1+b+7*(_-1)),f.day=$.getDate(),f.month=$.getMonth()}}if(c=m("z"))if("z"===c.toLowerCase())f.gmtoff=0;else{var D=c.match(/^((?:\-|\+)\d\d):?(\d\d)?/);f.gmtoff=3600*D[1],D[2]&&(f.gmtoff+=f.gmtoff>0?60*D[2]:60*-D[2])}var C=new Date(f.year,f.month,f.day,f.hour,f.min,f.sec,0);return T[t>>2]=C.getSeconds(),T[t+4>>2]=C.getMinutes(),T[t+8>>2]=C.getHours(),T[t+12>>2]=C.getDate(),T[t+16>>2]=C.getMonth(),T[t+20>>2]=C.getFullYear()-1900,T[t+24>>2]=C.getDay(),T[t+28>>2]=ct(Ir(C.getFullYear())?ft:mt,C.getMonth()-1)+C.getDate()-1,T[t+32>>2]=0,T[t+36>>2]=f.gmtoff,e+ee(d[0])}return 0}};return gt=await async function(){function e(e,r){return function(e){nt=e.Da,ot=e.Ea,at=e.Fa,st=e.Ha,it=e.Ia,lt=e.Ja,ut=e.Ba,dt=e.Ga}(gt=e.exports),N(),gt}var r={a:yt};return t.instantiateWasm?new Promise((n,o)=>{t.instantiateWasm(r,(r,t)=>{n(e(r))})}):(A??=R(),function(r){return e(r.instance)}(await I(m,A,r)))}(),function e(){function r(){t.calledRun=!0,g||(O=!0,t.noFSInit||ve.initialized||ve.init(),ne.init(),gt.Ca(),ve.ignorePermissions=!1,w?.(t),t.onRuntimeInitialized?.(),function(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)W(t.postRun.shift());U(B)}())}de>0?ce=e:(!function(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)H(t.preRun.shift());U(L)}(),de>0?ce=e:t.setStatus?(t.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>t.setStatus(""),1),r()},1)):r())}(),O?t:new Promise((e,r)=>{w=e,E=r})}})();"object"==typeof exports&&"object"==typeof module?(module.exports=PSPDFModuleInit,module.exports.default=PSPDFModuleInit):"function"==typeof define&&define.amd&&define([],()=>PSPDFModuleInit);