PageSourceSearch

https://cdn.aihumanizer.work/aihumanizer/pages/public/_nuxt/TEwPbt93.js

js aihumanizer.work collected 2026-10-02 15:15:06 UTC 200,238 bytes, 3 lines download raw bytes

1var ir=Object.defineProperty;var Rt=le=>{throw TypeError(le)};var or=(le,Y,ae)=>Y in le?ir(le,Y,{enumerable:!0,configurable:!0,writable:!0,value:ae}):le[Y]=ae;var Nt=(le,Y,ae)=>or(le,typeof Y!="symbol"?Y+"":Y,ae),ht=(le,Y,ae)=>Y.has(le)||Rt("Cannot "+ae);var J=(le,Y,ae)=>(ht(le,Y,"read from private field"),ae?ae.call(le):Y.get(le)),Ae=(le,Y,ae)=>Y.has(le)?Rt("Cannot add the same private member more than once"):Y instanceof WeakSet?Y.add(le):Y.set(le,ae),Ie=(le,Y,ae,i)=>(ht(le,Y,"write to private field"),i?i.call(le,ae):Y.set(le,ae),ae),it=(le,Y,ae)=>(ht(le,Y,"access private method"),ae);import"./Bjf7FriF.js";import"./yJw5QaD-.js";var jt=(()=>{var le=import.meta.url;return function(Y={}){var ae,i=Y,ye,ve,Ue=new Promise((e,t)=>{ye=e,ve=t}),Ze=typeof window=="object",Re=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";const Ce=globalThis.sqlite3InitModuleState||Object.assign(Object.create(null),{debugModule:()=>{}});delete globalThis.sqlite3InitModuleState,Ce.debugModule("globalThis.location =",globalThis.location);var Ge=Object.assign({},i),re="./this.program",qe="";function Te(e){return i.locateFile?i.locateFile(e,qe):qe+e}var Ne,ze;(Ze||Re)&&(Re?qe=self.location.href:typeof document<"u"&&document.currentScript&&(qe=document.currentScript.src),le&&(qe=le),qe.startsWith("blob:")?qe="":qe=qe.substr(0,qe.replace(/[?#].*/,"").lastIndexOf("/")+1),Re&&(ze=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Ne=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(new Error(t.status+" : "+t.url))));var $e=i.print||console.log.bind(console),De=i.printErr||console.error.bind(console);Object.assign(i,Ge),Ge=null,i.arguments&&i.arguments,i.thisProgram&&(re=i.thisProgram);var et=i.wasmBinary,je,gt=!1,Se,We,Ke,de,we,Fe;function qt(){var e=je.buffer;i.HEAP8=Se=new Int8Array(e),i.HEAP16=Ke=new Int16Array(e),i.HEAPU8=We=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAP32=de=new Int32Array(e),i.HEAPU32=we=new Uint32Array(e),i.HEAPF32=new Float32Array(e),i.HEAPF64=new Float64Array(e),i.HEAP64=Fe=new BigInt64Array(e),i.HEAPU64=new BigUint64Array(e)}if(i.wasmMemory)je=i.wasmMemory;else{var Mt=i.INITIAL_MEMORY||16777216;je=new WebAssembly.Memory({initial:Mt/65536,maximum:32768})}qt();var bt=[],yt=[],wt=[];function Bt(){var e=i.preRun;e&&(typeof e=="function"&&(e=[e]),e.forEach(Wt)),_t(bt)}function Ut(){!i.noFSInit&&!a.initialized&&a.init(),a.ignorePermissions=!1,_t(yt)}function zt(){var e=i.postRun;e&&(typeof e=="function"&&(e=[e]),e.forEach(Ht)),_t(wt)}function Wt(e){bt.unshift(e)}function Qt(e){yt.unshift(e)}function Ht(e){wt.unshift(e)}var Me=0,Je=null;function ar(e){return e}function lt(e){Me++,i.monitorRunDependencies?.(Me)}function tt(e){if(Me--,i.monitorRunDependencies?.(Me),Me==0&&Je){var t=Je;Je=null,t()}}function at(e){i.onAbort?.(e),e="Aborted("+e+")",De(e),gt=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw ve(t),t}var Vt="data:application/octet-stream;base64,",Et=e=>e.startsWith(Vt);function Gt(){if(i.locateFile){var e="sqlite3.wasm";return Et(e)?e:Te(e)}return new URL(""+new URL("sqlite3.WT1HU0S9.wasm",import.meta.url).href,import.meta.url).href}var ct;function vt(e){if(e==ct&&et)return new Uint8Array(et);if(ze)return ze(e);throw"both async and sync fetching of the wasm failed"}function $t(e){return et?Promise.resolve().then(()=>vt(e)):Ne(e).then(t=>new Uint8Array(t),()=>vt(e))}function xt(e,t,n){return $t(e).then(r=>WebAssembly.instantiate(r,t)).then(n,r=>{De(`failed to asynchronously prepare wasm: ${r}`),at(r)})}function Kt(e,t,n,r){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Et(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(s=>{var o=WebAssembly.instantiateStreaming(s,n);return o.then(r,function(h){return De(`wasm streaming compile failed: ${h}`),De("falling back to ArrayBuffer instantiation"),xt(t,n,r)})}):xt(t,n,r)}function Jt(){return{env:Ot,wasi_snapshot_preview1:Ot}}function Xt(){var e=Jt();function t(r,s){return g=r.exports,Qt(g.__wasm_call_ctors),tt(),g}lt();function n(r){t(r.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(r){De(`Module.instantiateWasm callback failed with error: ${r}`),ve(r)}
vendor: 4,587 bytes, lines 1-2
1return ct??(ct=Gt()),Kt(et,ct,e,n).catch(ve),{}}var _t=e=>{e.forEach(t=>t(i))};i.noExitRuntime;var ge={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return t.exec(e).slice(1)},normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var s=e[r];s==="."?e.splice(r,1):s===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:e=>{var t=ge.isAbs(e),n=e.substr(-1)==="/";return e=ge.normalizeArray(e.split("/").filter(r=>!!r),!t).join("/"),!e&&!t&&(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=ge.splitPath(e),n=t[0],r=t[1];return!n&&!r?".":(r&&(r=r.substr(0,r.length-1)),n+r)},basename:e=>{if(e==="/")return"/";e=ge.normalize(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},join:(...e)=>ge.normalize(e.join("/")),join2:(e,t)=>ge.normalize(e+"/"+t)},Yt=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);at("initRandomDevice")},St=e=>(St=Yt())(e),Oe={resolve:(...e)=>{for(var t="",n=!1,r=e.length-1;r>=-1&&!n;r--){var s=r>=0?e[r]:a.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!s)return"";t=s+"/"+t,n=ge.isAbs(s)}return t=ge.normalizeArray(t.split("/").filter(o=>!!o),!n).join("/"),(n?"/":"")+t||"."},relative:(e,t)=>{e=Oe.resolve(e).substr(1),t=Oe.resolve(t).substr(1);function n(N){for(var W=0;W<N.length&&N[W]==="";W++);for(var H=N.length-1;H>=0&&N[H]==="";H--);return W>H?[]:N.slice(W,H-W+1)}for(var r=n(e.split("/")),s=n(t.split("/")),o=Math.min(r.length,s.length),h=o,q=0;q<o;q++)if(r[q]!==s[q]){h=q;break}for(var O=[],q=h;q<r.length;q++)O.push("..");return O=O.concat(s.slice(h)),O.join("/")}},At=typeof TextDecoder<"u"?new TextDecoder:void 0,Qe=(e,t=0,n=NaN)=>{for(var r=t+n,s=t;e[s]&&!(s>=r);)++s;if(s-t>16&&e.buffer&&At)return At.decode(e.subarray(t,s));for(var o="";t<s;){var h=e[t++];if(!(h&128)){o+=String.fromCharCode(h);continue}var q=e[t++]&63;if((h&224)==192){o+=String.fromCharCode((h&31)<<6|q);continue}var O=e[t++]&63;if((h&240)==224?h=(h&15)<<12|q<<6|O:h=(h&7)<<18|q<<12|O<<6|e[t++]&63,h<65536)o+=String.fromCharCode(h);else{var N=h-65536;o+=String.fromCharCode(55296|N>>10,56320|N&1023)}}return o},ut=[],nt=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},ft=(e,t,n,r)=>{if(!(r>0))return 0;for(var s=n,o=n+r-1,h=0;h<e.length;++h){var q=e.charCodeAt(h);if(q>=55296&&q<=57343){var O=e.charCodeAt(++h);q=65536+((q&1023)<<10)|O&1023}if(q<=127){if(n>=o)break;t[n++]=q}else if(q<=2047){if(n+1>=o)break;t[n++]=192|q>>6,t[n++]=128|q&63}else if(q<=65535){if(n+2>=o)break;t[n++]=224|q>>12,t[n++]=128|q>>6&63,t[n++]=128|q&63}else{if(n+3>=o)break;t[n++]=240|q>>18,t[n++]=128|q>>12&63,t[n++]=128|q>>6&63,t[n++]=128|q&63}}return t[n]=0,n-s};function It(e,t,n){var r=nt(e)+1,s=new Array(r),o=ft(e,s,0,s.length);return s.length=o,s}var Zt=()=>{if(!ut.length){var e=null;if(typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
2`)),!e)return null;ut=It(e)}return ut.shift()},Be={ttys:[],init(){},shutdown(){},register(e,t){Be.ttys[e]={input:[],output:[],ops:t},a.registerDevice(e,Be.stream_ops)},stream_ops:{open(e){var t=Be.ttys[e.node.rdev];if(!t)throw new a.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,s){if(!e.tty||!e.tty.ops.get_char)throw new a.ErrnoError(60);for(var o=0,h=0;h<r;h++){var q;try{q=e.tty.ops.get_char(e.tty)}catch{throw new a.ErrnoError(29)}if(q===void 0&&o===0)throw new a.ErrnoError(6);if(q==null)break;o++,t[n+h]=q}return o&&(e.node.timestamp=Date.now()),o},write(e,t,n,r,s){if(!e.tty||!e.tty.ops.put_char)throw new a.ErrnoError(60);try{for(var o=0;o<r;o++)e.tty.ops.put_char(e.tty,t[n+o])}catch{throw new a.ErrnoError(29)}return r&&(e.node.timestamp=Date.now()),o}},default_tty_ops:{get_char(e){return Zt()},put_char(e,t){t===null||t===10?($e(Qe(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&($e(Qe(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,t,n){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(De(Qe(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(De(Qe(e.output)),e.output=[])}}},en=(e,t)=>{We.fill(0,e,e+t)},kt=(e,t)=>
vendor: 4,364 bytes, line 2
2Math.ceil(e/t)*t,Tt=e=>{e=kt(e,65536);var t=Pt(65536,e);return t&&en(t,e),t},ce={ops_table:null,mount(e){return ce.createNode(null,"/",16895,0)},createNode(e,t,n,r){if(a.isBlkdev(n)||a.isFIFO(n))throw new a.ErrnoError(63);ce.ops_table||(ce.ops_table={dir:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,lookup:ce.node_ops.lookup,mknod:ce.node_ops.mknod,rename:ce.node_ops.rename,unlink:ce.node_ops.unlink,rmdir:ce.node_ops.rmdir,readdir:ce.node_ops.readdir,symlink:ce.node_ops.symlink},stream:{llseek:ce.stream_ops.llseek}},file:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:{llseek:ce.stream_ops.llseek,read:ce.stream_ops.read,write:ce.stream_ops.write,allocate:ce.stream_ops.allocate,mmap:ce.stream_ops.mmap,msync:ce.stream_ops.msync}},link:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,readlink:ce.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:a.chrdev_stream_ops}});var s=a.createNode(e,t,n,r);return a.isDir(s.mode)?(s.node_ops=ce.ops_table.dir.node,s.stream_ops=ce.ops_table.dir.stream,s.contents={}):a.isFile(s.mode)?(s.node_ops=ce.ops_table.file.node,s.stream_ops=ce.ops_table.file.stream,s.usedBytes=0,s.contents=null):a.isLink(s.mode)?(s.node_ops=ce.ops_table.link.node,s.stream_ops=ce.ops_table.link.stream):a.isChrdev(s.mode)&&(s.node_ops=ce.ops_table.chrdev.node,s.stream_ops=ce.ops_table.chrdev.stream),s.timestamp=Date.now(),e&&(e.contents[t]=s,e.timestamp=s.timestamp),s},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){var r=1024*1024;t=Math.max(t,n*(n<r?2:1.125)>>>0),n!=0&&(t=Math.max(t,256));var s=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(s.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=a.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,a.isDir(e.mode)?t.size=4096:a.isFile(e.mode)?t.size=e.usedBytes:a.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&ce.resizeFileStorage(e,t.size)},lookup(e,t){throw a.genericErrors[44]},mknod(e,t,n,r){return ce.createNode(e,t,n,r)},rename(e,t,n){if(a.isDir(e.mode)){var r;try{r=a.lookupNode(t,n)}catch{}if(r)for(var s in r.contents)throw new a.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var n=a.lookupNode(e,t);for(var r in n.contents)throw new a.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var n of Object.keys(e.contents))t.push(n);return t},symlink(e,t,n){var r=ce.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!a.isLink(e.mode))throw new a.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,s){var o=e.node.contents;if(s>=e.node.usedBytes)return 0;var h=Math.min(e.node.usedBytes-s,r);if(h>8&&o.subarray)t.set(o.subarray(s,s+h),n);else for(var q=0;q<h;q++)t[n+q]=o[s+q];return h},write(e,t,n,r,s,o){if(t.buffer===Se.buffer&&(o=!1),!r)return 0;var h=e.node;if(h.timestamp=Date.now(),t.subarray&&(!h.contents||h.contents.subarray)){if(o)return h.contents=t.subarray(n,n+r),h.usedBytes=r,r;if(h.usedBytes===0&&s===0)return h.contents=t.slice(n,n+r),h.usedBytes=r,r;if(s+r<=h.usedBytes)return h.contents.set(t.subarray(n,n+r),s),r}if(ce.expandFileStorage(h,s+r),h.contents.subarray&&t.subarray)h.contents.set(t.subarray(n,n+r),s);else for(var q=0;q<r;q++)h.contents[s+q]=t[n+q];return h.usedBytes=Math.max(h.usedBytes,s+r),r},llseek(e,t,n){var r=t;if(n===1?r+=e.position:n===2&&a.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new a.ErrnoError(28);return r},allocate(e,t,n){ce.expandFileStorage(e.node,t+n),e.node.usedBytes=Math.max(e.n
2ode.usedBytes,t+n)},mmap(e,t,n,r,s){if(!a.isFile(e.node.mode))throw new a.ErrnoError(43);var o,h,q=e.node.contents;if(!(s&2)&&q&&q.buffer===Se.buffer)h=!1,o=q.byteOffset;else{if(h=!0,o=Tt(t),!o)throw new a.ErrnoError(48);q&&((n>0||n+t<q.length)&&(q.subarray?q=q.subarray(n,n+t):q=Array.prototype.slice.call(q,n,n+t)),Se.set(q,o))}return{ptr:o,allocated:h}},msync(e,t,n,r,s){return ce.stream_ops.write(e,t,0,r,n,!1),0}}},tn=(e,t,n,r)=>{var s=`al ${e}`;Ne(e).then(o=>{t(new Uint8Array(o)),s&&tt()},o=>{if(n)n();else throw`Loading data file "${e}" failed.`}),s&&lt()},nn=(e,t,n,r,s,o)=>{a.createDataFile(e,t,n,r,s,o)},rn=i.preloadPlugins||[],sn=(e,t,n,r)=>{typeof Browser<"u"&&Browser.init();var s=!1;return rn.forEach(o=>{s||o.canHandle(t)&&(o.handle(e,t,n,r),s=!0)}),s},on=(e,t,n,r,s,o,h,q,O,N)=>{var W=t?Oe.resolve(ge.join2(e,t)):e;function H(P){function x(j){N?.(),q||nn(e,t,j,r,s,O),o?.(),tt()}sn(P,W,x,()=>{h?.(),tt()})||x(P)}lt(),typeof n=="string"?tn(n,H,h):H(n)},ln=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},n=t[e];if(typeof n>"u")throw new Error(`Unknown file open mode: ${e}`);return n},dt=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},a={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}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{constructor(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=a.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r,this.readMode=365,this.writeMode=146}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 a.isDir(this.mode)}get isDevice(){return a.isChrdev(this.mode)}},lookupPath(e,t={}){if(e=Oe.resolve(e),!e)return{path:"",node:null};var n={follow_mount:!0,recurse_count:0};if(t=Object.assign(n,t),t.recurse_count>8)throw new a.ErrnoError(32);for(var r=e.split("/").filter(H=>!!H),s=a.root,o="/",h=0;h<r.length;h++){var q=h===r.length-1;if(q&&t.parent)break;if(s=a.lookupNode(s,r[h]),o=ge.join2(o,r[h]),a.isMountpoint(s)&&(!q||q&&t.follow_mount)&&(s=s.mounted.root),!q||t.follow)for(var O=0;a.isLink(s.mode);){var N=a.readlink(o);o=Oe.resolve(ge.dirname(o),N);var W=a.lookupPath(o,{recurse_count:t.recurse_count+1});if(s=W.node,O++>40)throw new a.ErrnoError(32)}}return{path:o,node:s}},getPath(e){for(var t;;){if(a.isRoot(e)){var n=e.mount.mountpoint;return t?n[n.length-1]!=="/"?`${n}/${t}`:n+t:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%a.nameTable.length},hashAddNode(e){var t=a.hashName(e.parent.id,e.name);e.name_next=a.nameTable[t],a.nameTable[t]=e},hashRemoveNode(e){var t=a.hashName(e.parent.id,e.name);if(a.nameTable[t]===e)a.nameTable[t]=e.name_next;else for(var n=a.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=a.mayLookup(e);if(n)throw new a.ErrnoError(n);for(var r=a.hashName(e.id,t),s=a.nameTable[r];s;s=s.name_next){var o=s.name;if(s.parent.id===e.id&&o===t)return s}return a.lookup(e,t)},createNode(e,t,n,r){var s=new a.FSNode(e,t,n,r);return a.hashAddNode(s),s},destroyNode(e){a.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var t=["r","w","rw"][e&3];return e&512&&(t+="w"),t},nodePermissions(e,t){return a.ignorePermissions?0:t.includes("r")&&!(e.mode&292)||t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!a.isDir(e.mode))return 54;var t=a.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{var n=a.lookupNode(e,t);return 20}catch{}return a.nodePermissions(e,"wx")},mayDelete(e,t,n){var r;try{r=a.lookupNode(e,t)}catch(o){return o.errno}var s=a.nodePermissions(e,"wx");if(s)return s;if(n){if(!a.isDir(r.mode))return 54;if(a.isRoot(r)||a.getPath(r)===a.cwd())return 10}else if(a.isDir(r.mode))return 31;return 0},mayOpen(e,t){return e?a.isLink(e.mode)?32:a.isDir(e.mode)&&(a.flagsToPermissionString(t)!=="r"||t&512)?31:a.nodePermissions(e,a.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=a.MAX_OPEN_FDS;e++)if(!a.streams[e])return e;throw new a.ErrnoError(33)},getStreamChecked(e){var t=a.getStream(e);if(!t)throw new a.ErrnoError(8);return t}
vendor: 4,726 bytes, line 2
2,getStream:e=>a.streams[e],createStream(e,t=-1){return e=Object.assign(new a.FSStream,e),t==-1&&(t=a.nextfd()),e.fd=t,a.streams[t]=e,e},closeStream(e){a.streams[e]=null},dupStream(e,t=-1){var n=a.createStream(e,t);return n.stream_ops?.dup?.(n),n},chrdev_stream_ops:{open(e){var t=a.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new a.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){a.devices[e]={stream_ops:t}},getDevice:e=>a.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push(...r.mounts)}return t},syncfs(e,t){typeof e=="function"&&(t=e,e=!1),a.syncFSRequests++,a.syncFSRequests>1&&De(`warning: ${a.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=a.getMounts(a.root.mount),r=0;function s(h){return a.syncFSRequests--,t(h)}function o(h){if(h)return o.errored?void 0:(o.errored=!0,s(h));++r>=n.length&&s(null)}n.forEach(h=>{if(!h.type.syncfs)return o(null);h.type.syncfs(h,e,o)})},mount(e,t,n){var r=n==="/",s=!n,o;if(r&&a.root)throw new a.ErrnoError(10);if(!r&&!s){var h=a.lookupPath(n,{follow_mount:!1});if(n=h.path,o=h.node,a.isMountpoint(o))throw new a.ErrnoError(10);if(!a.isDir(o.mode))throw new a.ErrnoError(54)}var q={type:e,opts:t,mountpoint:n,mounts:[]},O=e.mount(q);return O.mount=q,q.root=O,r?a.root=O:o&&(o.mounted=q,o.mount&&o.mount.mounts.push(q)),O},unmount(e){var t=a.lookupPath(e,{follow_mount:!1});if(!a.isMountpoint(t.node))throw new a.ErrnoError(28);var n=t.node,r=n.mounted,s=a.getMounts(r);Object.keys(a.nameTable).forEach(h=>{for(var q=a.nameTable[h];q;){var O=q.name_next;s.includes(q.mount)&&a.destroyNode(q),q=O}}),n.mounted=null;var o=n.mount.mounts.indexOf(r);n.mount.mounts.splice(o,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,n){var r=a.lookupPath(e,{parent:!0}),s=r.node,o=ge.basename(e);if(!o||o==="."||o==="..")throw new a.ErrnoError(28);var h=a.mayCreate(s,o);if(h)throw new a.ErrnoError(h);if(!s.node_ops.mknod)throw new a.ErrnoError(63);return s.node_ops.mknod(s,o,t,n)},create(e,t){return t=t!==void 0?t:438,t&=4095,t|=32768,a.mknod(e,t,0)},mkdir(e,t){return t=t!==void 0?t:511,t&=1023,t|=16384,a.mknod(e,t,0)},mkdirTree(e,t){for(var n=e.split("/"),r="",s=0;s<n.length;++s)if(n[s]){r+="/"+n[s];try{a.mkdir(r,t)}catch(o){if(o.errno!=20)throw o}}},mkdev(e,t,n){return typeof n>"u"&&(n=t,t=438),t|=8192,a.mknod(e,t,n)},symlink(e,t){if(!Oe.resolve(e))throw new a.ErrnoError(44);var n=a.lookupPath(t,{parent:!0}),r=n.node;if(!r)throw new a.ErrnoError(44);var s=ge.basename(t),o=a.mayCreate(r,s);if(o)throw new a.ErrnoError(o);if(!r.node_ops.symlink)throw new a.ErrnoError(63);return r.node_ops.symlink(r,s,e)},rename(e,t){var n=ge.dirname(e),r=ge.dirname(t),s=ge.basename(e),o=ge.basename(t),h,q,O;if(h=a.lookupPath(e,{parent:!0}),q=h.node,h=a.lookupPath(t,{parent:!0}),O=h.node,!q||!O)throw new a.ErrnoError(44);if(q.mount!==O.mount)throw new a.ErrnoError(75);var N=a.lookupNode(q,s),W=Oe.relative(e,r);if(W.charAt(0)!==".")throw new a.ErrnoError(28);if(W=Oe.relative(t,n),W.charAt(0)!==".")throw new a.ErrnoError(55);var H;try{H=a.lookupNode(O,o)}catch{}if(N!==H){var P=a.isDir(N.mode),x=a.mayDelete(q,s,P);if(x)throw new a.ErrnoError(x);if(x=H?a.mayDelete(O,o,P):a.mayCreate(O,o),x)throw new a.ErrnoError(x);if(!q.node_ops.rename)throw new a.ErrnoError(63);if(a.isMountpoint(N)||H&&a.isMountpoint(H))throw new a.ErrnoError(10);if(O!==q&&(x=a.nodePermissions(q,"w"),x))throw new a.ErrnoError(x);a.hashRemoveNode(N);try{q.node_ops.rename(N,O,o),N.parent=O}catch(j){throw j}finally{a.hashAddNode(N)}}},rmdir(e){var t=a.lookupPath(e,{parent:!0}),n=t.node,r=ge.basename(e),s=a.lookupNode(n,r),o=a.mayDelete(n,r,!0);if(o)throw new a.ErrnoError(o);if(!n.node_ops.rmdir)throw new a.ErrnoError(63);if(a.isMountpoint(s))throw new a.ErrnoError(10);n.node_ops.rmdir(n,r),a.destroyNode(s)},readdir(e){var t=a.lookupPath(e,{follow:!0}),n=t.node;if(!n.node_ops.readdir)throw new a.ErrnoError(54);return n.node_ops.readdir(n)},unlink(e){var t=a.lookupPath(e,{parent:!0}),n=t.node;if(!n)throw new a.ErrnoError(44);var r=ge.basename(e),s=a.lookupNode(n,r),o=a.mayDelete(n,r,!1);if(o)throw new a.ErrnoError(o);if(!n.node_ops.unlink)throw new a.ErrnoError(63);if(a.isMountpoint(s))throw new a.ErrnoError(10);n.node_ops.unlink(n,r),a.destroyNode(s)},readlink(e){var t=a.lookupPath(e),n=t.node;if(!n)throw new a.ErrnoError(44);if(!n.node_ops.readlink)throw new a.ErrnoError(28);return Oe.resolve(a.getPath(n.parent),n.node_ops.readlink(n))},stat(e,t){var n=a.lookupPath(e,{follow:!t}),r=n.node;if(!r)throw new a.ErrnoError(44);if(!r.node_ops.getattr)throw new a.ErrnoError(63);return r.node_ops.getattr(r)},lstat(e){return a.stat(e,!0)}
vendor: 9,737 bytes, line 2
2,chmod(e,t,n){var r;if(typeof e=="string"){var s=a.lookupPath(e,{follow:!n});r=s.node}else r=e;if(!r.node_ops.setattr)throw new a.ErrnoError(63);r.node_ops.setattr(r,{mode:t&4095|r.mode&-4096,timestamp:Date.now()})},lchmod(e,t){a.chmod(e,t,!0)},fchmod(e,t){var n=a.getStreamChecked(e);a.chmod(n.node,t)},chown(e,t,n,r){var s;if(typeof e=="string"){var o=a.lookupPath(e,{follow:!r});s=o.node}else s=e;if(!s.node_ops.setattr)throw new a.ErrnoError(63);s.node_ops.setattr(s,{timestamp:Date.now()})},lchown(e,t,n){a.chown(e,t,n,!0)},fchown(e,t,n){var r=a.getStreamChecked(e);a.chown(r.node,t,n)},truncate(e,t){if(t<0)throw new a.ErrnoError(28);var n;if(typeof e=="string"){var r=a.lookupPath(e,{follow:!0});n=r.node}else n=e;if(!n.node_ops.setattr)throw new a.ErrnoError(63);if(a.isDir(n.mode))throw new a.ErrnoError(31);if(!a.isFile(n.mode))throw new a.ErrnoError(28);var s=a.nodePermissions(n,"w");if(s)throw new a.ErrnoError(s);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate(e,t){var n=a.getStreamChecked(e);if((n.flags&2097155)===0)throw new a.ErrnoError(28);a.truncate(n.node,t)},utime(e,t,n){var r=a.lookupPath(e,{follow:!0}),s=r.node;s.node_ops.setattr(s,{timestamp:Math.max(t,n)})},open(e,t,n){if(e==="")throw new a.ErrnoError(44);t=typeof t=="string"?ln(t):t,t&64?(n=typeof n>"u"?438:n,n=n&4095|32768):n=0;var r;if(typeof e=="object")r=e;else{e=ge.normalize(e);try{var s=a.lookupPath(e,{follow:!(t&131072)});r=s.node}catch{}}var o=!1;if(t&64)if(r){if(t&128)throw new a.ErrnoError(20)}else r=a.mknod(e,n,0),o=!0;if(!r)throw new a.ErrnoError(44);if(a.isChrdev(r.mode)&&(t&=-513),t&65536&&!a.isDir(r.mode))throw new a.ErrnoError(54);if(!o){var h=a.mayOpen(r,t);if(h)throw new a.ErrnoError(h)}t&512&&!o&&a.truncate(r,0),t&=-131713;var q=a.createStream({node:r,path:a.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return q.stream_ops.open&&q.stream_ops.open(q),i.logReadFiles&&!(t&1)&&(e in a.readFiles||(a.readFiles[e]=1)),q},close(e){if(a.isClosed(e))throw new a.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(t){throw t}finally{a.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,n){if(a.isClosed(e))throw new a.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new a.ErrnoError(70);if(n!=0&&n!=1&&n!=2)throw new a.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,s){if(r<0||s<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if((e.flags&2097155)===1)throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.read)throw new a.ErrnoError(28);var o=typeof s<"u";if(!o)s=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var h=e.stream_ops.read(e,t,n,r,s);return o||(e.position+=h),h},write(e,t,n,r,s,o){if(r<0||s<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if((e.flags&2097155)===0)throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.write)throw new a.ErrnoError(28);e.seekable&&e.flags&1024&&a.llseek(e,0,2);var h=typeof s<"u";if(!h)s=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var q=e.stream_ops.write(e,t,n,r,s,o);return h||(e.position+=q),q},allocate(e,t,n){if(a.isClosed(e))throw new a.ErrnoError(8);if(t<0||n<=0)throw new a.ErrnoError(28);if((e.flags&2097155)===0)throw new a.ErrnoError(8);if(!a.isFile(e.node.mode)&&!a.isDir(e.node.mode))throw new a.ErrnoError(43);if(!e.stream_ops.allocate)throw new a.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap(e,t,n,r,s){if((r&2)!==0&&(s&2)===0&&(e.flags&2097155)!==2)throw new a.ErrnoError(2);if((e.flags&2097155)===1)throw new a.ErrnoError(2);if(!e.stream_ops.mmap)throw new a.ErrnoError(43);if(!t)throw new a.ErrnoError(28);return e.stream_ops.mmap(e,t,n,r,s)},msync(e,t,n,r,s){return e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,s):0},ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new a.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary",t.encoding!=="utf8"&&t.encoding!=="binary")throw new Error(`Invalid encoding type "${t.encoding}"`);var n,r=a.open(e,t.flags),s=a.stat(e),o=s.size,h=new Uint8Array(o);return a.read(r,h,0,o,0),t.encoding==="utf8"?n=Qe(h):t.encoding==="binary"&&(n=h),a.close(r),n},writeFile(e,t,n={}){n.flags=n.flags||577;var r=a.open(e,n.flags,n.mode);if(typeof t=="string"){var s=new Uint8Array(nt(t)+1),o=ft(t,s,0,s.length);a.write(r,s,0,o,void 0,n.canOwn)}else if(ArrayBuffer.isView(t))a.write(r,t,0,t.byteLength,void 0,n.canOwn);else throw new Error("Unsupported data type");a.close(r)},cwd:()=>a.currentPath,chdir(e){var t=a.lookupPath(e,{follow:!0});if(t.node===null)throw new a.ErrnoError(44);if(!a.isDir(t.node.mode))throw new a.ErrnoError(54);var n=a.nodePermissions(t.node,"x");if(n)throw new a.ErrnoError(n);a.currentPath=t.path},createDefaultDirectories(){a.mkdir("/tmp"),a.mkdir("/home"),a.mkdir("/home/web_user")},createDefaultDevices(){a.mkdir("/dev"),a.registerDevice(a.makedev(1,3),{read:()=>0,write:(r,s,o,h,q)=>h}),a.mkdev("/dev/null",a.makedev(1,3)),Be.register(a.makedev(5,0),Be.default_tty_ops),Be.register(a.makedev(6,0),Be.default_tty1_ops),a.mkdev("/dev/tty",a.makedev(5,0)),a.mkdev("/dev/tty1",a.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(t===0&&(t=St(e).byteLength),e[--t]);a.createDevice("/dev","random",n),a.createDevice("/dev","urandom",n),a.mkdir("/dev/shm"),a.mkdir("/dev/shm/tmp")},createSpecialDirectories(){a.mkdir("/proc");var e=a.mkdir("/proc/self");a.mkdir("/proc/self/fd"),a.mount({mount(){var t=a.createNode(e,"fd",16895,73);return t.node_ops={lookup(n,r){var s=+r,o=a.getStreamChecked(s),h={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>o.path}};return h.parent=h,h}},t}},{},"/proc/self/fd")},createStandardStreams(e,t,n){e?a.createDevice("/dev","stdin",e):a.symlink("/dev/tty","/dev/stdin"),t?a.createDevice("/dev","stdout",null,t):a.symlink("/dev/tty","/dev/stdout"),n?a.createDevice("/dev","stderr",null,n):a.symlink("/dev/tty1","/dev/stderr"),a.open("/dev/stdin",0),a.open("/dev/stdout",1),a.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{a.genericErrors[e]=new a.ErrnoError(e),a.genericErrors[e].stack="<generic error, no stack>"}),a.nameTable=new Array(4096),a.mount(ce,{},"/"),a.createDefaultDirectories(),a.createDefaultDevices(),a.createSpecialDirectories(),a.filesystems={MEMFS:ce}},init(e,t,n){a.initialized=!0,e??(e=i.stdin),t??(t=i.stdout),n??(n=i.stderr),a.createStandardStreams(e,t,n)},quit(){a.initialized=!1;for(var e=0;e<a.streams.length;e++){var t=a.streams[e];t&&a.close(t)}},findObject(e,t){var n=a.analyzePath(e,t);return n.exists?n.object:null},analyzePath(e,t){try{var n=a.lookupPath(e,{follow:!t});e=n.path}catch{}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=a.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ge.basename(e),n=a.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot=n.path==="/"}catch(s){r.error=s.errno}return r},createPath(e,t,n,r){e=typeof e=="string"?e:a.getPath(e);for(var s=t.split("/").reverse();s.length;){var o=s.pop();if(o){var h=ge.join2(e,o);try{a.mkdir(h)}catch{}e=h}}return h},createFile(e,t,n,r,s){var o=ge.join2(typeof e=="string"?e:a.getPath(e),t),h=dt(r,s);return a.create(o,h)},createDataFile(e,t,n,r,s,o){var h=t;e&&(e=typeof e=="string"?e:a.getPath(e),h=t?ge.join2(e,t):e);var q=dt(r,s),O=a.create(h,q);if(n){if(typeof n=="string"){for(var N=new Array(n.length),W=0,H=n.length;W<H;++W)N[W]=n.charCodeAt(W);n=N}a.chmod(O,q|146);var P=a.open(O,577);a.write(P,n,0,n.length,0,o),a.close(P),a.chmod(O,q)}},createDevice(e,t,n,r){var q;var s=ge.join2(typeof e=="string"?e:a.getPath(e),t),o=dt(!!n,!!r);(q=a.createDevice).major??(q.major=64);var h=a.makedev(a.createDevice.major++,0);return a.registerDevice(h,{open(O){O.seekable=!1},close(O){r?.buffer?.length&&r(10)},read(O,N,W,H,P){for(var x=0,j=0;j<H;j++){var b;try{b=n()}catch{throw new a.ErrnoError(29)}if(b===void 0&&x===0)throw new a.ErrnoError(6);if(b==null)break;x++,N[W+j]=b}return x&&(O.node.timestamp=Date.now()),x},write(O,N,W,H,P){for(var x=0;x<H;x++)try{r(N[W+x])}catch{throw new a.ErrnoError(29)}return H&&(O.node.timestamp=Date.now()),x}}),a.mkdev(s,o,h)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=ze(e.url),e.usedBytes=e.contents.length}catch{throw new a.ErrnoError(29)}},createLazyFile(e,t,n,r,s){class o{constructor(){this.lengthKnown=!1,this.chunks=[]}get(x){if(!(x>this.length-1||x<0)){var j=x%this.chunkSize,b=x/this.chunkSize|0;return this.getter(b)[j]}}setDataGetter(x){this.getter=x}cacheLength(){var x=new XMLHttpRequest;if(x.open("HEAD",n,!1),x.send(null),!(x.status>=200&&x.status<300||x.status===304))throw new Error("Couldn't load "+n+". Status: "+x.status);var j=Number(x.getResponseHeader("Content-length")),b,w=(b=x.getResponseHeader("Accept-Ranges"))&&b==="bytes",S=(b=x.getResponseHeader("Content-Encoding"))&&b==="gzip",M=1024*1024;w||(M=j);var D=(L,K)=>{if(L>K)throw new Error("invalid range ("+L+", "+K+") or no bytes requested!");if(K>j-1)throw new Error("only "+j+" bytes available! programmer error!");var c=new XMLHttpRequest;if(c.open("GET",n,!1),j!==M&&c.setRequestHeader("Range","bytes="+L+"-"+K),c.responseType="arraybuffer",c.overrideMimeType&&c.overrideMimeType("text/plain;
2 charset=x-user-defined"),c.send(null),!(c.status>=200&&c.status<300||c.status===304))throw new Error("Couldn't load "+n+". Status: "+c.status);return c.response!==void 0?new Uint8Array(c.response||[]):It(c.responseText||"")},A=this;A.setDataGetter(L=>{var K=L*M,c=(L+1)*M-1;if(c=Math.min(c,j-1),typeof A.chunks[L]>"u"&&(A.chunks[L]=D(K,c)),typeof A.chunks[L]>"u")throw new Error("doXHR failed!");return A.chunks[L]}),(S||!j)&&(M=j=1,j=this.getter(0).length,M=j,$e("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=j,this._chunkSize=M,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!Re)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var h=new o,q={isDevice:!1,contents:h}}else var q={isDevice:!1,url:n};var O=a.createFile(e,t,q,r,s);q.contents?O.contents=q.contents:q.url&&(O.contents=null,O.url=q.url),Object.defineProperties(O,{usedBytes:{get:function(){return this.contents.length}}});var N={},W=Object.keys(O.stream_ops);W.forEach(P=>{var x=O.stream_ops[P];N[P]=(...j)=>(a.forceLoadFile(O),x(...j))});function H(P,x,j,b,w){var S=P.node.contents;if(w>=S.length)return 0;var M=Math.min(S.length-w,b);if(S.slice)for(var D=0;D<M;D++)x[j+D]=S[w+D];else for(var D=0;D<M;D++)x[j+D]=S.get(w+D);return M}return N.read=(P,x,j,b,w)=>(a.forceLoadFile(O),H(P,x,j,b,w)),N.mmap=(P,x,j,b,w)=>{a.forceLoadFile(O);var S=Tt(x);if(!S)throw new a.ErrnoError(48);return H(P,Se,S,x,j),{ptr:S,allocated:!0}},O.stream_ops=N,O}},an=(e,t)=>e?Qe(We,e,t):"",fe={DEFAULT_POLLMASK:5,calculateAt(e,t,n){if(ge.isAbs(t))return t;var r;if(e===-100)r=a.cwd();else{var s=fe.getStreamFromFD(e);r=s.path}if(t.length==0){if(!n)throw new a.ErrnoError(44);return r}return ge.join2(r,t)},doStat(e,t,n){var r=e(t);de[n>>2]=r.dev,de[n+4>>2]=r.mode,we[n+8>>2]=r.nlink,de[n+12>>2]=r.uid,de[n+16>>2]=r.gid,de[n+20>>2]=r.rdev,Fe[n+24>>3]=BigInt(r.size),de[n+32>>2]=4096,de[n+36>>2]=r.blocks;var s=r.atime.getTime(),o=r.mtime.getTime(),h=r.ctime.getTime();return Fe[n+40>>3]=BigInt(Math.floor(s/1e3)),we[n+48>>2]=s%1e3*1e3*1e3,Fe[n+56>>3]=BigInt(Math.floor(o/1e3)),we[n+64>>2]=o%1e3*1e3*1e3,Fe[n+72>>3]=BigInt(Math.floor(h/1e3)),we[n+80>>2]=h%1e3*1e3*1e3,Fe[n+88>>3]=BigInt(r.ino),0},doMsync(e,t,n,r,s){if(!a.isFile(t.node.mode))throw new a.ErrnoError(43);if(r&2)return 0;var o=We.slice(e,e+n);a.msync(t,o,s,n,r)},getStreamFromFD(e){var t=a.getStreamChecked(e);return t},varargs:void 0,getStr(e){var t=an(e);return t}};function cn(e,t){try{return e=fe.getStr(e),a.chmod(e,t),0}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}function _n(e,t,n,r){try{if(t=fe.getStr(t),t=fe.calculateAt(e,t),n&-8)return-28;var s=a.lookupPath(t,{follow:!0}),o=s.node;if(!o)return-44;var h="";return n&4&&(h+="r"),n&2&&(h+="w"),n&1&&(h+="x"),h&&a.nodePermissions(o,h)?-2:0}catch(q){if(typeof a>"u"||q.name!=="ErrnoError")throw q;return-q.errno}}function un(e,t){try{return a.fchmod(e,t),0}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}function fn(e,t,n){try{return a.fchown(e,t,n),0}catch(r){if(typeof a>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function rt(){var e=de[+fe.varargs>>2];return fe.varargs+=4,e}var He=rt;function dn(e,t,n){fe.varargs=n;try{var r=fe.getStreamFromFD(e);switch(t){case 0:{var s=rt();if(s<0)return-28;for(;a.streams[s];)s++;var o;return o=a.dupStream(r,s),o.fd}case 1:case 2:return 0;case 3:return r.flags;case 4:{var s=rt();return r.flags|=s,0}case 12:{var s=He(),h=0;return Ke[s+h>>1]=2,0}case 13:case 14:return 0}return-28}catch(q){if(typeof a>"u"||q.name!=="ErrnoError")throw q;return-q.errno}}function pn(e,t){try{var n=fe.getStreamFromFD(e);return fe.doStat(a.stat,n.path,t)}catch(r){if(typeof a>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}var mn=9007199254740992,hn=-9007199254740992,Xe=e=>e<hn||e>mn?NaN:Number(e);function gn(e,t){t=Xe(t);try{return isNaN(t)?61:(a.ftruncate(e,t),0)}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}var Ve=(e,t,n)=>ft(e,We,t,n);function qn(e,t){try{if(t===0)return-28;var n=a.cwd(),r=nt(n)+1;return t<r?-68:(Ve(n,e,t),r)}catch(s){if(typeof a>"u"||s.name!=="ErrnoError")throw s;return-s.errno}}function bn(e,t,n){fe.varargs=n;try{var r=fe.getStreamFromFD(e);switch(t){case 21509:return r.tty?0:-59;case 21505:{if(!r.tty)return-59;if(r.tty.ops.ioctl_tcgets){var s=r.tty.ops.ioctl_tcgets(r),o=He();de[o>>2]=s.c_iflag||0,de[o+4>>2]=s.c_oflag||0,de[o+8>>2]=s.c_cflag||0,de[o+12>>2]=s.c_lflag||0;for(var h=0;h<32;h++)Se[o+h+17]=s.c_cc[h]||0;return 0}return 0}case 21510:case 21511:case 21512:return r.tty?0:-59;case 21506:case 21507:case 21508:{if(!r.tty)return-59;if(r.tty.ops.ioctl_tcsets){for(var o=He(),q=de[o>>2],O=de[o+4>>2],N=de[o+8>>2],W=de[o+12>>2],H=[],h=0;h<32;h++)H.push(Se[o+h+17]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:q,c_oflag:O,c_cflag:N,c_lflag:W,c_cc:H})}return 0}case 21519:{if(!r.tty)return-59;var o=He();return de[o>>2]=0,0}case 21520:return r.tty?-28:-59;case 21531:{var o=He();return a.ioctl(r,t,o)}case 21523:{if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var P=r.tty.ops.ioctl_tiocgwinsz(r.tty),o=He();Ke[o>>1]=P[0],Ke[o+2>>1]=P[1]}return 0}case 21524:return r.tty?0:-59;case 21515:return r.tty?0:-59;default:return-28}}
2catch(x){if(typeof a>"u"||x.name!=="ErrnoError")throw x;return-x.errno}}function yn(e,t){try{return e=fe.getStr(e),fe.doStat(a.lstat,e,t)}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}function wn(e,t,n){try{return t=fe.getStr(t),t=fe.calculateAt(e,t),t=ge.normalize(t),t[t.length-1]==="/"&&(t=t.substr(0,t.length-1)),a.mkdir(t,n,0),0}catch(r){if(typeof a>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function En(e,t,n,r){try{t=fe.getStr(t);var s=r&256,o=r&4096;return r=r&-6401,t=fe.calculateAt(e,t,o),fe.doStat(s?a.lstat:a.stat,t,n)}catch(h){if(typeof a>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}function vn(e,t,n,r){fe.varargs=r;try{t=fe.getStr(t),t=fe.calculateAt(e,t);var s=r?rt():0;return a.open(t,n,s).fd}catch(o){if(typeof a>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}function xn(e,t,n,r){try{if(t=fe.getStr(t),t=fe.calculateAt(e,t),r<=0)return-28;var s=a.readlink(t),o=Math.min(r,nt(s)),h=Se[n+o];return Ve(s,n,r+1),Se[n+o]=h,o}catch(q){if(typeof a>"u"||q.name!=="ErrnoError")throw q;return-q.errno}}function Sn(e){try{return e=fe.getStr(e),a.rmdir(e),0}catch(t){if(typeof a>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function An(e,t){try{return e=fe.getStr(e),fe.doStat(a.stat,e,t)}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}function In(e,t,n){try{return t=fe.getStr(t),t=fe.calculateAt(e,t),n===0?a.unlink(t):n===512?a.rmdir(t):at("Invalid flags passed to unlinkat"),0}catch(r){if(typeof a>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}var Ft=e=>we[e>>2]+de[e+4>>2]*4294967296;function kn(e,t,n,r){try{t=fe.getStr(t),t=fe.calculateAt(e,t,!0);var s=Date.now(),o,h;if(!n)o=s,h=s;else{var q=Ft(n),O=de[n+8>>2];O==1073741823?o=s:O==1073741822?o=-1:o=q*1e3+O/(1e3*1e3),n+=16,q=Ft(n),O=de[n+8>>2],O==1073741823?h=s:O==1073741822?h=-1:h=q*1e3+O/(1e3*1e3)}return(h!=-1||o!=-1)&&a.utime(t,o,h),0}catch(N){if(typeof a>"u"||N.name!=="ErrnoError")throw N;return-N.errno}}var Tn=1,Fn=()=>Tn,On=e=>e%4===0&&(e%100!==0||e%400===0),Pn=[0,31,60,91,121,152,182,213,244,274,305,335],Ln=[0,31,59,90,120,151,181,212,243,273,304,334],Cn=e=>{var t=On(e.getFullYear()),n=t?Pn:Ln,r=n[e.getMonth()]+e.getDate()-1;return r};function Dn(e,t){e=Xe(e);var n=new Date(e*1e3);de[t>>2]=n.getSeconds(),de[t+4>>2]=n.getMinutes(),de[t+8>>2]=n.getHours(),de[t+12>>2]=n.getDate(),de[t+16>>2]=n.getMonth(),de[t+20>>2]=n.getFullYear()-1900,de[t+24>>2]=n.getDay();var r=Cn(n)|0;de[t+28>>2]=r,de[t+36>>2]=-(n.getTimezoneOffset()*60);var s=new Date(n.getFullYear(),0,1),o=new Date(n.getFullYear(),6,1).getTimezoneOffset(),h=s.getTimezoneOffset(),q=(o!=h&&n.getTimezoneOffset()==Math.min(h,o))|0;de[t+32>>2]=q}function Rn(e,t,n,r,s,o,h){s=Xe(s);try{if(isNaN(s))return 61;var q=fe.getStreamFromFD(r),O=a.mmap(q,e,s,t,n),N=O.ptr;return de[o>>2]=O.allocated,we[h>>2]=N,0}catch(W){if(typeof a>"u"||W.name!=="ErrnoError")throw W;return-W.errno}}function Nn(e,t,n,r,s,o){o=Xe(o);try{var h=fe.getStreamFromFD(s);n&2&&fe.doMsync(e,h,t,r,o)}catch(q){if(typeof a>"u"||q.name!=="ErrnoError")throw q;return-q.errno}}var jn=(e,t,n,r)=>{var s=new Date().getFullYear(),o=new Date(s,0,1),h=new Date(s,6,1),q=o.getTimezoneOffset(),O=h.getTimezoneOffset(),N=Math.max(q,O);we[e>>2]=N*60,de[t>>2]=+(q!=O);var W=x=>{var j=x>=0?"-":"+",b=Math.abs(x),w=String(Math.floor(b/60)).padStart(2,"0"),S=String(b%60).padStart(2,"0");return`UTC${j}${w}${S}`},H=W(q),P=W(O);O<q?(Ve(H,n,17),Ve(P,r,17)):(Ve(H,r,17),Ve(P,n,17))},Mn=()=>Date.now(),Bn=()=>performance.now(),Un=()=>2147483648,zn=e=>{var t=je.buffer,n=(e-t.byteLength+65535)/65536|0;try{return je.grow(n),qt(),1}catch{}},Wn=e=>{var t=We.length;e>>>=0;var n=Un();if(e>n)return!1;for(var r=1;r<=4;r*=2){var s=t*(1+.2/r);s=Math.min(s,e+100663296);var o=Math.min(n,kt(Math.max(e,s),65536)),h=zn(o);if(h)return!0}return!1},pt={},Qn=()=>re||"./this.program",Ye=()=>{if(!Ye.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Qn()};for(var n in pt)pt[n]===void 0?delete t[n]:t[n]=pt[n];var r=[];for(var n in t)r.push(`${n}=${t[n]}`);Ye.strings=r}return Ye.strings},Hn=(e,t)=>{for(var n=0;n<e.length;++n)Se[t++]=e.charCodeAt(n);Se[t]=0},Vn=(e,t)=>{var n=0;
2return Ye().forEach((r,s)=>{var o=t+n;we[e+s*4>>2]=o,Hn(r,o),n+=r.length+1}),0},Gn=(e,t)=>{var n=Ye();we[e>>2]=n.length;var r=0;return n.forEach(s=>r+=s.length+1),we[t>>2]=r,0};function $n(e){try{var t=fe.getStreamFromFD(e);return a.close(t),0}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return n.errno}}function Kn(e,t){try{var n=0,r=0,s=0,o=fe.getStreamFromFD(e),h=o.tty?2:a.isDir(o.mode)?3:a.isLink(o.mode)?7:4;return Se[t]=h,Ke[t+2>>1]=s,Fe[t+8>>3]=BigInt(n),Fe[t+16>>3]=BigInt(r),0}catch(q){if(typeof a>"u"||q.name!=="ErrnoError")throw q;return q.errno}}var Jn=(e,t,n,r)=>{for(var s=0,o=0;o<n;o++){var h=we[t>>2],q=we[t+4>>2];t+=8;var O=a.read(e,Se,h,q,r);if(O<0)return-1;if(s+=O,O<q)break}return s};function Xn(e,t,n,r){try{var s=fe.getStreamFromFD(e),o=Jn(s,t,n);return we[r>>2]=o,0}catch(h){if(typeof a>"u"||h.name!=="ErrnoError")throw h;return h.errno}}function Yn(e,t,n,r){t=Xe(t);try{if(isNaN(t))return 61;var s=fe.getStreamFromFD(e);return a.llseek(s,t,n),Fe[r>>3]=BigInt(s.position),s.getdents&&t===0&&n===0&&(s.getdents=null),0}catch(o){if(typeof a>"u"||o.name!=="ErrnoError")throw o;return o.errno}}function Zn(e){try{var t=fe.getStreamFromFD(e);return t.stream_ops?.fsync?t.stream_ops.fsync(t):0}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return n.errno}}var er=(e,t,n,r)=>{for(var s=0,o=0;o<n;o++){var h=we[t>>2],q=we[t+4>>2];t+=8;var O=a.write(e,Se,h,q,r);if(O<0)return-1;if(s+=O,O<q)break}return s};function tr(e,t,n,r){try{var s=fe.getStreamFromFD(e),o=er(s,t,n);return we[r>>2]=o,0}catch(h){if(typeof a>"u"||h.name!=="ErrnoError")throw h;return h.errno}}a.createPreloadedFile=on,a.staticInit();var Ot={__syscall_chmod:cn,__syscall_faccessat:_n,__syscall_fchmod:un,__syscall_fchown32:fn,__syscall_fcntl64:dn,__syscall_fstat64:pn,__syscall_ftruncate64:gn,__syscall_getcwd:qn,__syscall_ioctl:bn,__syscall_lstat64:yn,__syscall_mkdirat:wn,__syscall_newfstatat:En,__syscall_open
vendor: 19,770 bytes, line 2
2at:vn,__syscall_readlinkat:xn,__syscall_rmdir:Sn,__syscall_stat64:An,__syscall_unlinkat:In,__syscall_utimensat:kn,_emscripten_get_now_is_monotonic:Fn,_localtime_js:Dn,_mmap_js:Rn,_munmap_js:Nn,_tzset_js:jn,emscripten_date_now:Mn,emscripten_get_now:Bn,emscripten_resize_heap:Wn,environ_get:Vn,environ_sizes_get:Gn,fd_close:$n,fd_fdstat_get:Kn,fd_read:Xn,fd_seek:Yn,fd_sync:Zn,fd_write:tr,memory:je},g=Xt();i._sqlite3_status64=(e,t,n,r)=>(i._sqlite3_status64=g.sqlite3_status64)(e,t,n,r),i._sqlite3_status=(e,t,n,r)=>(i._sqlite3_status=g.sqlite3_status)(e,t,n,r),i._sqlite3_db_status=(e,t,n,r,s)=>(i._sqlite3_db_status=g.sqlite3_db_status)(e,t,n,r,s),i._sqlite3_msize=e=>(i._sqlite3_msize=g.sqlite3_msize)(e),i._sqlite3_vfs_find=e=>(i._sqlite3_vfs_find=g.sqlite3_vfs_find)(e),i._sqlite3_initialize=()=>(i._sqlite3_initialize=g.sqlite3_initialize)(),i._sqlite3_malloc=e=>(i._sqlite3_malloc=g.sqlite3_malloc)(e),i._sqlite3_free=e=>(i._sqlite3_free=g.sqlite3_free)(e),i._sqlite3_vfs_register=(e,t)=>(i._sqlite3_vfs_register=g.sqlite3_vfs_register)(e,t),i._sqlite3_vfs_unregister=e=>(i._sqlite3_vfs_unregister=g.sqlite3_vfs_unregister)(e),i._sqlite3_malloc64=e=>(i._sqlite3_malloc64=g.sqlite3_malloc64)(e),i._sqlite3_realloc=(e,t)=>(i._sqlite3_realloc=g.sqlite3_realloc)(e,t),i._sqlite3_realloc64=(e,t)=>(i._sqlite3_realloc64=g.sqlite3_realloc64)(e,t),i._sqlite3_value_text=e=>(i._sqlite3_value_text=g.sqlite3_value_text)(e),i._sqlite3_randomness=(e,t)=>(i._sqlite3_randomness=g.sqlite3_randomness)(e,t),i._sqlite3_stricmp=(e,t)=>(i._sqlite3_stricmp=g.sqlite3_stricmp)(e,t),i._sqlite3_strnicmp=(e,t,n)=>(i._sqlite3_strnicmp=g.sqlite3_strnicmp)(e,t,n),i._sqlite3_uri_parameter=(e,t)=>(i._sqlite3_uri_parameter=g.sqlite3_uri_parameter)(e,t),i._sqlite3_uri_boolean=(e,t,n)=>(i._sqlite3_uri_boolean=g.sqlite3_uri_boolean)(e,t,n),i._sqlite3_serialize=(e,t,n,r)=>(i._sqlite3_serialize=g.sqlite3_serialize)(e,t,n,r),i._sqlite3_prepare_v2=(e,t,n,r,s)=>(i._sqlite3_prepare_v2=g.sqlite3_prepare_v2)(e,t,n,r,s),i._sqlite3_step=e=>(i._sqlite3_step=g.sqlite3_step)(e),i._sqlite3_column_int64=(e,t)=>(i._sqlite3_column_int64=g.sqlite3_column_int64)(e,t),i._sqlite3_reset=e=>(i._sqlite3_reset=g.sqlite3_reset)(e),i._sqlite3_exec=(e,t,n,r,s)=>(i._sqlite3_exec=g.sqlite3_exec)(e,t,n,r,s),i._sqlite3_column_int=(e,t)=>(i._sqlite3_column_int=g.sqlite3_column_int)(e,t),i._sqlite3_finalize=e=>(i._sqlite3_finalize=g.sqlite3_finalize)(e),i._sqlite3_file_control=(e,t,n,r)=>(i._sqlite3_file_control=g.sqlite3_file_control)(e,t,n,r),i._sqlite3_column_name=(e,t)=>(i._sqlite3_column_name=g.sqlite3_column_name)(e,t),i._sqlite3_column_text=(e,t)=>(i._sqlite3_column_text=g.sqlite3_column_text)(e,t),i._sqlite3_column_type=(e,t)=>(i._sqlite3_column_type=g.sqlite3_column_type)(e,t),i._sqlite3_errmsg=e=>(i._sqlite3_errmsg=g.sqlite3_errmsg)(e),i._sqlite3_deserialize=(e,t,n,r,s,o)=>(i._sqlite3_deserialize=g.sqlite3_deserialize)(e,t,n,r,s,o),i._sqlite3_clear_bindings=e=>(i._sqlite3_clear_bindings=g.sqlite3_clear_bindings)(e),i._sqlite3_value_blob=e=>(i._sqlite3_value_blob=g.sqlite3_value_blob)(e),i._sqlite3_value_bytes=e=>(i._sqlite3_value_bytes=g.sqlite3_value_bytes)(e),i._sqlite3_value_double=e=>(i._sqlite3_value_double=g.sqlite3_value_double)(e),i._sqlite3_value_int=e=>(i._sqlite3_value_int=g.sqlite3_value_int)(e),i._sqlite3_value_int64=e=>(i._sqlite3_value_int64=g.sqlite3_value_int64)(e),i._sqlite3_value_subtype=e=>(i._sqlite3_value_subtype=g.sqlite3_value_subtype)(e),i._sqlite3_value_pointer=(e,t)=>(i._sqlite3_value_pointer=g.sqlite3_value_pointer)(e,t),i._sqlite3_value_type=e=>(i._sqlite3_value_type=g.sqlite3_value_type)(e),i._sqlite3_value_nochange=e=>(i._sqlite3_value_nochange=g.sqlite3_value_nochange)(e),i._sqlite3_value_frombind=e=>(i._sqlite3_value_frombind=g.sqlite3_value_frombind)(e),i._sqlite3_value_dup=e=>(i._sqlite3_value_dup=g.sqlite3_value_dup)(e),i._sqlite3_value_free=e=>(i._sqlite3_value_free=g.sqlite3_value_free)(e),i._sqlite3_result_blob=(e,t,n,r)=>(i._sqlite3_result_blob=g.sqlite3_result_blob)(e,t,n,r),i._sqlite3_result_error_toobig=e=>(i._sqlite3_result_error_toobig=g.sqlite3_result_error_toobig)(e),i._sqlite3_result_error_nomem=e=>(i._sqlite3_result_error_nomem=g.sqlite3_result_error_nomem)(e),i._sqlite3_result_double=(e,t)=>(i._sqlite3_result_double=g.sqlite3_result_double)(e,t),i._sqlite3_result_error=(e,t,n)=>(i._sqlite3_result_error=g.sqlite3_result_error)(e,t,n),i._sqlite3_result_int=(e,t)=>(i._sqlite3_result_int=g.sqlite3_result_int)(e,t),i._sqlite3_result_int64=(e,t)=>(i._sqlite3_result_int64=g.sqlite3_result_int64)(e,t),i._sqlite3_result_null=e=>(i._sqlite3_result_null=g.sqlite3_result_null)(e),i._sqlite3_result_pointer=(e,t,n,r)=>(i._sqlite3_result_pointer=g.sqlite3_result_pointer)(e,t,n,r),i._sqlite3_result_subtype=(e,t)=>(i._sqlite3_result_subtype=g.sqlite3_result_subtype)(e,t),i._sqlite3_result_text=(e,t,n,r)=>(i._sqlite3_result_text=g.sqlite3_result_text)(e,t,n,r),i._sqlite3_result_zeroblob=(e,t)=>(i._sqlite3_result_zeroblob=g.sqlite3_result_zeroblob)(e,t),i._sqlite3_result_zeroblob64=(e,t)=>(i._sqlite3_result_zeroblob64=g.sqlite3_result_zeroblob64)(e,t),i._sqlite3_result_error_code=(e,t)=>(i._sqlite3_result_error_code=g.sqlite3_result_error_code)(e,t),i._sqlite3_user_data=e=>(i._sqlite3_user_data=g.sqlite3_user_data)(e),i._sqlite3_context_db_handle=e=>(i._sqlite3_context_db_handle=g.sqlite3_context_db_handle)(e),i._sqlite3_vtab_nochange=e=>(i._sqlite3_vtab_nochange=g.sqlite3_vtab_nochange)(e),i._sqlite3_vtab_in_first=(e,t)=>(i._sqlite3_vtab_in_first=g.sqlite3_vtab_in_first)(e,t),i._sqlite3_vtab_in_next=(e,t)=>(i._sqlite3_vtab_in_next=g.sqlite3_vtab_in_next)(e,t),i._sqlite3_aggregate_context=(e,t)=>(i._sqlite3_aggregate_context=g.sqlite3_aggregate_context)(e,t),i._sqlite3_get_auxdata=(e,t)=>(i._sqlite3_get_auxdata=g.sqlite3_get_auxdata)(e,t),i._sqlite3_set_auxdata=(e,t,n,r)=>(i._sqlite3_set_auxdata=g.sqlite3_set_auxdata)(e,t,n,r),i._sqlite3_column_count=e=>(i._sqlite3_column_count=g.sqlite3_column_count)(e),i._sqlite3_data_count=e=>(i._sqlite3_data_count=g.sqlite3_data_count)(e),i._sqlite3_column_blob=(e,t)=>(i._sqlite3_column_blob=g.sqlite3_column_blob)(e,t),i._sqlite3_column_bytes=(e,t)=>(i._sqlite3_column_bytes=g.sqlite3_column_bytes)(e,t),i._sqlite3_column_double=(e,t)=>(i._sqlite3_column_double=g.sqlite3_column_double)(e,t),i._sqlite3_column_value=(e,t)=>(i._sqlite3_column_value=g.sqlite3_column_value)(e,t),i._sqlite3_column_decltype=(e,t)=>(i._sqlite3_column_decltype=g.sqlite3_column_decltype)(e,t),i._sqlite3_bind_blob=(e,t,n,r,s)=>(i._sqlite3_bind_blob=g.sqlite3_bind_blob)(e,t,n,r,s),i._sqlite3_bind_double=(e,t,n)=>(i._sqlite3_bind_double=g.sqlite3_bind_double)(e,t,n),i._sqlite3_bind_int=(e,t,n)=>(i._sqlite3_bind_int=g.sqlite3_bind_int)(e,t,n),i._sqlite3_bind_int64=(e,t,n)=>(i._sqlite3_bind_int64=g.sqlite3_bind_int64)(e,t,n),i._sqlite3_bind_null=(e,t)=>(i._sqlite3_bind_null=g.sqlite3_bind_null)(e,t),i._sqlite3_bind_pointer=(e,t,n,r,s)=>(i._sqlite3_bind_pointer=g.sqlite3_bind_pointer)(e,t,n,r,s),i._sqlite3_bind_text=(e,t,n,r,s)=>(i._sqlite3_bind_text=g.sqlite3_bind_text)(e,t,n,r,s),i._sqlite3_bind_parameter_count=e=>(i._sqlite3_bind_parameter_count=g.sqlite3_bind_parameter_count)(e),i._sqlite3_bind_parameter_name=(e,t)=>(i._sqlite3_bind_parameter_name=g.sqlite3_bind_parameter_name)(e,t),i._sqlite3_bind_parameter_index=(e,t)=>(i._sqlite3_bind_parameter_index=g.sqlite3_bind_parameter_index)(e,t),i._sqlite3_db_handle=e=>(i._sqlite3_db_handle=g.sqlite3_db_handle)(e),i._sqlite3_stmt_readonly=e=>(i._sqlite3_stmt_readonly=g.sqlite3_stmt_readonly)(e),i._sqlite3_stmt_isexplain=e=>(i._sqlite3_stmt_isexplain=g.sqlite3_stmt_isexplain)(e),i._sqlite3_stmt_explain=(e,t)=>(i._sqlite3_stmt_explain=g.sqlite3_stmt_explain)(e,t),i._sqlite3_stmt_busy=e=>(i._sqlite3_stmt_busy=g.sqlite3_stmt_busy)(e),i._sqlite3_stmt_status=(e,t,n)=>(i._sqlite3_stmt_status=g.sqlite3_stmt_status)(e,t,n),i._sqlite3_sql=e=>(i._sqlite3_sql=g.sqlite3_sql)(e),i._sqlite3_expanded_sql=e=>(i._sqlite3_expanded_sql=g.sqlite3_expanded_sql)(e),i._sqlite3_preupdate_old=(e,t,n)=>(i._sqlite3_preupdate_old=g.sqlite3_preupdate_old)(e,t,n),i._sqlite3_preupdate_count=e=>(i._sqlite3_preupdate_count=g.sqlite3_preupdate_count)(e),i._sqlite3_preupdate_depth=e=>(i._sqlite3_preupdate_depth=g.sqlite3_preupdate_depth)(e),i._sqlite3_preupdate_blobwrite=e=>(i._sqlite3_preupdate_blobwrite=g.sqlite3_preupdate_blobwrite)(e),i._sqlite3_preupdate_new=(e,t,n)=>(i._sqlite3_preupdate_new=g.sqlite3_preupdate_new)(e,t,n),i._sqlite3_value_numeric_type=e=>(i._sqlite3_value_numeric_type=g.sqlite3_value_numeric_type)(e),i._sqlite3_set_authorizer=(e,t,n)=>(i._sqlite3_set_authorizer=g.sqlite3_set_authorizer)(e,t,n),i._sqlite3_strglob=(e,t)=>(i._sqlite3_strglob=g.sqlite3_strglob)(e,t),i._sqlite3_strlike=(e,t,n)=>(i._sqlite3_strlike=g.sqlite3_strlike)(e,t,n),i._sqlite3_auto_extension=e=>(i._sqlite3_auto_extension=g.sqlite3_auto_extension)(e),i._sqlite3_cancel_auto_extension=e=>(i._sqlite3_cancel_auto_extension=g.sqlite3_cancel_auto_extension)(e),i._sqlite3_reset_auto_extension=()=>(i._sqlite3_reset_auto_extension=g.sqlite3_reset_auto_extension)(),i._sqlite3_prepare_v3=(e,t,n,r,s,o)=>(i._sqlite3_prepare_v3=g.sqlite3_prepare_v3)(e,t,n,r,s,o),i._sqlite3_create_module=(e,t,n,r)=>(i._sqlite3_create_module=g.sqlite3_create_module)(e,t,n,r),i._sqlite3_create_module_v2=(e,t,n,r,s)=>(i._sqlite3_create_module_v2=g.sqlite3_create_module_v2)(e,t,n,r,s),i._sqlite3_drop_modules=(e,t)=>(i._sqlite3_drop_modules=g.sqlite3_drop_modules)(e,t),i._sqlite3_declare_vtab=(e,t)=>(i._sqlite3_declare_vtab=g.sqlite3_declare_vtab)(e,t),i._sqlite3_vtab_on_conflict=e=>(i._sqlite3_vtab_on_conflict=g.sqlite3_vtab_on_conflict)(e),i._sqlite3_vtab_collation=(e,t)=>(i._sqlite3_vtab_collation=g.sqlite3_vtab_collation)(e,t),i._sqlite3_vtab_in=(e,t,n)=>(i._sqlite3_vtab_in=g.sqlite3_vtab_in)(e,t,n),i._sqlite3_vtab_rhs_value=(e,t,n)=>(i._sqlite3_vtab_rhs_value=g.sqlite3_vtab_rhs_value)(e,t,n),i._sqlite3_vtab_distinct=e=>(i._sqlite3_vtab_distinct=g.sqlite3_vtab_distinct)(e),i._sqlite3_keyword_name=(e,t,n)=>(i._sqlite3_keyword_name=g.sqlite3_keyword_name)(e,t,n),i._sqlite3_keyword_count=()=>(i._sqlite3_keyword_count=g.sqlite3_keyword_count)(),i._sqlite3_keyword_check=(e,t)=>(i._sqlite3_keyword_check=g.sqlite3_keyword_check)(e,t),i._sqlite3_complete=e=>(i._sqlite3_complete=g.sqlite3_complete)(e),i._sqlite3_libversion=()=>(i._sqlite3_libversion=g.sqlite3_libversion)(),i._sqlite3_libversion_number=()=>(i._sqlite3_libversion_number=g.sqlite3_libversion_number)(),i._sqlite3_shutdown=()=>(i._sqlite3_shutdown=g.sqlite3_shutdown)(),i._sqlite3_last_insert_rowid=e=>(i._sqlite3_last_insert_rowid=g.sqlite3_last_insert_rowid)(e),i._sqlite3_set_last_insert_rowid=(e,t)=>(i._sqlite3_set_last_insert_rowid=g.sqlite3_set_last_insert_rowid)(e,t),i._sqlite3_changes64=e=>(i._sqlite3_changes64=g.sqlite3_changes64)(e),i._sqlite3_changes=e=>(i._sqlite3_changes=g.sqlite3_changes)(e),i._sqlite3_total_changes64=e=>(i._sqlite3_total_changes64=g.sqlite3_total_changes64)(e),i._sqlite3_total_changes=e=>(i._sqlite3_total_changes=g.sqlite3_total_changes)(e),i._sqlite3_txn_state=(e,t)=>(i._sqlite3_txn_state=g.sqlite3_txn_state)(e,t),i._sqlite3_close_v2=e=>(i._sqlite3_close_v2=g.sqlite3_close_v2)(e),i._sqlite3_busy_handler=(e,t,n)=>(i._sqlite3_busy_handler=g.sqlite3_busy_handler)(e,t,n),i._sqlite3_progress_handler=(e,t,n,r)=>(i._sqlite3_progress_handler=g.sqlite3_progress_handler)(e,t,n,r),i._sqlite3_busy_timeout=(e,t)=>(i._sqlite3_busy_timeout=g.sqlite3_busy_timeout)(e,t),i._sqlite3_interrupt=e=>(i._sqlite3_interrupt=g.sqlite3_interrupt)(e),i._sqlite3_is_interrupted=e=>(i._sqlite3_is_interrupted=g.sqlite3_is_interrupted)(e),i._sqlite3_create_function=(e,t,n,r,s,o,h,q)=>(i._sqlite3_create_function=g.sqlite3_create_function)(e,t,n,r,s,o,h,q),i._sqlite3_create_function_v2=(e,t,n,r,s,o,h,q,O)=>(i._sqlite3_create_function_v2=g.sqlite3_create_function_v2)(e,t,n,r,s,o,h,q,O),i._sqlite3_create_window_function=(e,t,n,r,s,o,h,q,O,N)=>(i._sqlite3_create_window_function=g.sqlite3_create_window_function)(e,t,n,r,s,o,h,q,O,N),i._sqlite3_overload_function=(e,t,n)=>(i._sqlite3_overload_function=g.sqlite3_overload_function)(e,t,n),i._sqlite3_trace_v2=(e,t,n,r)=>(i._sqlite3_trace_v2=g.sqlite3_trace_v2)(e,t,n,r),i._sqlite3_commit_hook=(e,t,n)=>(i._sqlite3_commit_hook=g.sqlite3_commit_hook)(e,t,n),i._sqlite3_update_hook=(e,t,n)=>(i._sqlite3_update_hook=g.sqlite3_update_hook)(e,t,n),i._sqlite3_rollback_hook=(e,t,n)=>(i._sqlite3_rollback_hook=g.sqlite3_rollback_hook)(e,t,n),i._sqlite3_preupdate_hook=(e,t,n)=>(i._sqlite3_preupdate_hook=g.sqlite3_preupdate_hook)(e,t,n),i._sqlite3_error_offset=e=>(i._sqlite3_error_offset=g.sqlite3_error_offset)(e),i._sqlite3_errcode=e=>(i._sqlite3_errcode=g.sqlite3_errcode)(e),i._sqlite3_extended_errcode=e=>(i._sqlite3_extended_errcode=g.sqlite3_extended_errcode)(e),i._sqlite3_errstr=e=>(i._sqlite3_errstr=g.sqlite3_errstr)(e),i._sqlite3_limit=(e,t,n)=>(i._sqlite3_limit=g.sqlite3_limit)(e,t,n),i._sqlite3_open=(e,t)=>(i._sqlite3_open=g.sqlite3_open)(e,t),i._sqlite3_open_v2=(e,t,n,r)=>(i._sqlite3_open_v2=g.sqlite3_open_v2)(e,t,n,r),i._sqlite3_create_collation=(e,t,n,r,s)=>(i._sqlite3_create_collation=g.sqlite3_create_collation)(e,t,n,r,s),i._sqlite3_create_collation_v2=(e,t,n,r,s,o)=>(i._sqlite3_create_collation_v2=g.sqlite3_create_collation_v2)(e,t,n,r,s,o),i._sqlite3_collation_needed=(e,t,n)=>(i._sqlite3_collation_needed=g.sqlite3_collation_needed)(e,t,n),i._sqlite3_get_autocommit=e=>(i._sqlite3_get_autocommit=g.sqlite3_get_autocommit)(e),i._sqlite3_table_column_metadata=(e,t,n,r,s,o,h,q,O)=>(i._sqlite3_table_column_metadata=g.sqlite3_table_column_metadata)(e,t,n,r,s,o,h,q,O),i._sqlite3_extended_result_codes=(e,t)=>(i._sqlite3_extended_result_codes=g.sqlite3_extended_result_codes)(e,t),i._sqlite3_uri_key=(e,t)=>(i._sqlite3_uri_key=g.sqlite3_uri_key)(e,t),i._sqlite3_uri_int64=(e,t,n)=>(i._sqlite3_uri_int64=g.sqlite3_uri_int64)(e,t,n),i._sqlite3_db_name=(e,t)=>(i._sqlite3_db_name=g.sqlite3_db_name)(e,t),i._sqlite3_db_filename=(e,t)=>(i._sqlite3_db_filename=g.sqlite3_db_filename)(e,t),i._sqlite3_db_readonly=(e,t)=>(i._sqlite3_db_readonly=g.sqlite3_db_readonly)(e,t),i._sqlite3_compileoption_used=e=>(i._sqlite3_compileoption_used=g.sqlite3_compileoption_used)(e),i._sqlite3_compileoption_get=e=>(i._sqlite3_compileoption_get=g.sqlite3_compileoption_get)(e),i._sqlite3session_diff=(e,t,n,r)=>(i._sqlite3session_diff=g.sqlite3session_diff)(e,t,n,r),i._sqlite3session_attach=(e,t)=>(i._sqlite3session_attach=g.sqlite3session_attach)(e,t),i._sqlite3session_create=(e,t,n)=>(i._sqlite3session_create=g.sqlite3session_create)(e,t,n),i._sqlite3session_delete=e=>(i._sqlite3session_delete=g.sqlite3session_delete)(e),i._sqlite3session_table_filter=(e,t,n)=>(i._sqlite3session_table_filter=g.sqlite3session_table_filter)(e,t,n),i._sqlite3session_changeset=(e,t,n)=>(i._sqlite3session_changeset=g.sqlite3session_changeset)(e,t,n),i._sqlite3session_changeset_strm=(e,t,n)=>(i._sqlite3session_changeset_strm=g.sqlite3session_changeset_strm)(e,t,n),i._sqlite3session_patchset_strm=(e,t,n)=>(i._sqlite3session_patchset_strm=g.sqlite3session_patchset_strm)(e,t,n),i._sqlite3session_patchset=(e,t,n)=>(i._sqlite3session_patchset=g.sqlite3session_patchset)(e,t,n),i._sqlite3session_enable=(e,t)=>(i._sqlite3session_enable=g.sqlite3session_enable)(e,t),i._sqlite3session_indirect=(e,t)=>(i._sqlite3session_indirect=g.sqlite3session_indirect)(e,t),i._sqlite3session_isempty=e=>(i._sqlite3session_isempty=g.sqlite3session_isempty)(e),i._sqlite3session_memory_used=e=>(i._sqlite3session_memory_used=g.sqlite3session_memory_used)(e),i._sqlite3session_object_config=(e,t,n)=>(i._sqlite3session_object_config=g.sqlite3session_object_config)(e,t,n),i._sqlite3session_changeset_size=e=>(i._sqlite3session_changeset_size=g.sqlite3session_changeset_size)(e),i._sqlite3changeset_start=(e,t,n)=>(i._sqlite3changeset_start=g.sqlite3changeset_start)(e,t,n),i._sqlite3changeset_start_v2=(e,t,n,r)=>(i._sqlite3changeset_start_v2=g.sqlite3changeset_start_v2)(e,t,n,r),i._sqlite3changeset_start_strm=(e,t,n)=>(i._sqlite3changeset_start_strm=g.sqlite3changeset_start_strm)(e,t,n),i._sqlite3changeset_start_v2_strm=(e,t,n,r)=>(i._sqlite3changeset_start_v2_strm=g.sqlite3changeset_start_v2_strm)(e,t,n,r),i._sqlite3changeset_next=e=>(i._sqlite3changeset_next=g.sqlite3changeset_next)(e),i._sqlite3changeset_op=(e,t,n,r,s)=>(i._sqlite3changeset_op=g.sqlite3changeset_op)(e,t,n,r,s),i._sqlite3changeset_pk=(e,t,n)=>(i._sqlite3changeset_pk=g.sqlite3changeset_pk)(e,t,n),i._sqlite3changeset_old=(e,t,n)=>(i._sqlite3changeset_old=g.sqlite3changeset_old)(e,t,n),i._sqlite3changeset_new=(e,t,n)=>(i._sqlite3changeset_new=g.sqlite3changeset_new)(e,t,n),i._sqlite3changeset_conflict=(e,t,n)=>(i._sqlite3changeset_conflict=g.sqlite3changeset_conflict)(e,t,n),i._sqlite3changeset_fk_conflicts=(e,t)=>(i._sqlite3changeset_fk_conflicts=g.sqlite3changeset_fk_conflicts)(e,t),i._sqlite3changeset_finalize=e=>(i._sqlite3changeset_finalize=g.sqlite3changeset_finalize)(e),i._sqlite3changeset_invert=(e,t,n,r)=>(i._sqlite3changeset_invert=g.sqlite3changeset_invert)(e,t,n,r),i._sqlite3changeset_invert_strm=(e,t,n,r)=>(i._sqlite3changeset_invert_strm=g.sqlite3changeset_invert_strm)(e,t,n,r),i._sqlite3changeset_apply_v2=(e,t,n,r,s,o,h,q,O)=>(i._sqlite3changeset_apply_v2=g.sqlite3changeset_apply_v2)(e,t,n,r,s,o,h,q,O),i._sqlite3changeset_apply=(e,t,n,r,s,o)=>(i._sqlite3changeset_apply=g.sqlite3changeset_apply)(e,t,n,r,s,o),i._sqlite3changeset_apply_v2_strm=(e,t,n,r,s,o,h,q,O)=>(i._sqlite3changeset_apply_v2_strm=g.sqlite3changeset_apply_v2_strm)(e,t,n,r,s,o,h,q,O),i._sqlite3changeset_apply_strm=(e,t,n,r,s,o)=>(i._sqlite3changeset_apply_strm=g.sqlite3changeset_apply_strm)(e,t,n,r,s,o),i._sqlite3changegroup_new=e=>(i._sqlite3changegroup_new=g.sqlite3changegroup_new)(e),i._sqlite3changegroup_add=(e,t,n)=>(i._sqlite3changegroup_add=g.sqlite3changegroup_add)(e,t,n),i._sqlite3changegroup_output=(e,t,n)=>(i._sqlite3changegroup_output=g.sqlite3changegroup_output)(e,t,n),i._sqlite3changegroup_add_strm=(e,t,n)=>(i._sqlite3changegroup_add_strm=g.sqlite3changegroup_add_strm)(e,t,n),i._sqlite3changegroup_output_strm=(e,t,n)=>(i._sqlite3changegroup_output_strm=g.sqlite3changegroup_output_strm)(e,t,n),i._sqlite3changegroup_delete=e=>(i._sqlite3changegroup_delete=g.sqlite3changegroup_delete)(e),i._sqlite3changeset_concat=(e,t,n,r,s,o)=>(i._sqlite3changeset_concat=g.sqlite3changeset_concat)(e,t,n,r,s,o),i._sqlite3changeset_concat_strm=(e,t,n,r,s,o)=>(i._sqlite3changeset_concat_strm=g.sqlite3changeset_concat_strm)(e,t,n,r,s,o),i._sqlite3session_config=(e,t)=>(i._sqlite3session_config=g.sqlite3session_config)(e,t),i._sqlite3_sourceid=()=>(i._sqlite3_sourceid=g.sqlite3_sourceid)(),i._sqlite3__wasm_pstack_ptr=()=>(i._sqlite3__wasm_pstack_ptr=g.sqlite3__wasm_pstack_ptr)(),i._sqlite3__wasm_pstack_restore=e=>(i._sqlite3__wasm_pstack_restore=g.sqlite3__wasm_pstack_restore)(e),i._sqlite3__wasm_pstack_alloc=e=>(i._sqlite3__wasm_pstack_alloc=g.sqlite3__wasm_pstack_alloc)(e),i._sqlite3__wasm_pstack_remaining=()=>(i._sqlite3__wasm_pstack_remaining=g.sqlite3__wasm_pstack_remaining)(),i._sqlite3__wasm_pstack_quota=()=>(i._sqlite3__wasm_pstack_quota=g.sqlite3__wasm_pstack_quota)(),i._sqlite3__wasm_db_error=(e,t,n)=>(i._sqlite3__wasm_db_error=g.sqlite3__wasm_db_error)(e,t,n),i._sqlite3__wasm_test_struct=e=>(i._sqlite3__wasm_test_struct=g.sqlite3__wasm_test_struct)(e),i._sqlite3__wasm_enum_json=()=>(i._sqlite3__wasm_enum_json=g.sqlite3__wasm_enum_json)(),i._sqlite3__wasm_vfs_unlink=(e,t)=>(i._sqlite3__wasm_vfs_unlink=g.sqlite3__wasm_vfs_unlink)(e,t),i._sqlite3__wasm_db_vfs=(e,t)=>(i._sqlite3__wasm_db_vfs=g.sqlite3__wasm_db_vfs)(e,t),i._sqlite3__wasm_db_reset=e=>(i._sqlite3__wasm_db_reset=g.sqlite3__wasm_db_reset)(e),i._sqlite3__wasm_db_export_
2chunked=(e,t)=>(i._sqlite3__wasm_db_export_chunked=g.sqlite3__wasm_db_export_chunked)(e,t),i._sqlite3__wasm_db_serialize=(e,t,n,r,s)=>(i._sqlite3__wasm_db_serialize=g.sqlite3__wasm_db_serialize)(e,t,n,r,s),i._sqlite3__wasm_vfs_create_file=(e,t,n,r)=>(i._sqlite3__wasm_vfs_create_file=g.sqlite3__wasm_vfs_create_file)(e,t,n,r),i._sqlite3__wasm_posix_create_file=(e,t,n)=>(i._sqlite3__wasm_posix_create_file=g.sqlite3__wasm_posix_create_file)(e,t,n),i._sqlite3__wasm_kvvfsMakeKeyOnPstack=(e,t)=>(i._sqlite3__wasm_kvvfsMakeKeyOnPstack=g.sqlite3__wasm_kvvfsMakeKeyOnPstack)(e,t),i._sqlite3__wasm_kvvfs_methods=()=>(i._sqlite3__wasm_kvvfs_methods=g.sqlite3__wasm_kvvfs_methods)(),i._sqlite3__wasm_vtab_config=(e,t,n)=>(i._sqlite3__wasm_vtab_config=g.sqlite3__wasm_vtab_config)(e,t,n),i._sqlite3__wasm_db_config_ip=(e,t,n,r)=>(i._sqlite3__wasm_db_config_ip=g.sqlite3__wasm_db_config_ip)(e,t,n,r),i._sqlite3__wasm_db_config_pii=(e,t,n,r,s)=>(i._sqlite3__wasm_db_config_pii=g.sqlite3__wasm_db_config_pii)(e,t,n,r,s),i._sqlite3__wasm_db_config_s=(e,t,n)=>(i._sqlite3__wasm_db_config_s=g.sqlite3__wasm_db_config_s)(e,t,n),i._sqlite3__wasm_config_i=(e,t)=>(i._sqlite3__wasm_config_i=g.sqlite3__wasm_config_i)(e,t),i._sqlite3__wasm_config_ii=(e,t,n)=>(i._sqlite3__wasm_config_ii=g.sqlite3__wasm_config_ii)(e,t,n),i._sqlite3__wasm_config_j=(e,t)=>(i._sqlite3__wasm_config_j=g.sqlite3__wasm_config_j)(e,t),i._sqlite3__wasm_qfmt_token=(e,t)=>(i._sqlite3__wasm_qfmt_token=g.sqlite3__wasm_qfmt_token)(e,t),i._sqlite3__wasm_init_wasmfs=e=>(i._sqlite3__wasm_init_wasmfs=g.sqlite3__wasm_init_wasmfs)(e),i._sqlite3__wasm_test_intptr=e=>(i._sqlite3__wasm_test_intptr=g.sqlite3__wasm_test_intptr)(e),i._sqlite3__wasm_test_voidptr=e=>(i._sqlite3__wasm_test_voidptr=g.sqlite3__wasm_test_voidptr)(e),i._sqlite3__wasm_test_int64_max=()=>(i._sqlite3__wasm_test_int64_max=g.sqlite3__wasm_test_int64_max)(),i._sqlite3__wasm_test_int64_min=()=>(i._sqlite3__wasm_test_int64_min=g.sqlite3__wasm_test_int64_min)(),i._sqlite3__wasm_test_int64_times2=e=>(i._sqlite3__wasm_test_int64_times2=g.sqlite3__wasm_test_int64_times2)(e),i._sqlite3__wasm_test_int64_minmax=(e,t)=>(i._sqlite3__wasm_test_int64_minmax=g.sqlite3__wasm_test_int64_minmax)(e,t),i._sqlite3__wasm_test_int64ptr=e=>(i._sqlite3__wasm_test_int64ptr=g.sqlite3__wasm_test_int64ptr)(e),i._sqlite3__wasm_test_stack_overflow=e=>(i._sqlite3__wasm_test_stack_overflow=g.sqlite3__wasm_test_stack_overflow)(e),i._sqlite3__wasm_test_str_hello=e=>(i._sqlite3__wasm_test_str_hello=g.sqlite3__wasm_test_str_hello)(e),i._sqlite3__wasm_SQLTester_strglob=(e,t)=>(i._sqlite3__wasm_SQLTester_strglob=g.sqlite3__wasm_SQLTester_strglob)(e,t),i._malloc=e=>(i._malloc=g.malloc)(e),i._free=e=>(i._free=g.free)(e),i._realloc=(e,t)=>(i._realloc=g.realloc)(e,t);var Pt=(e,t)=>(Pt=g.emscripten_builtin_memalign)(e,t);i.wasmMemory=je;var st,Lt;Je=function e(){st||Ct(),st||(Je=e)};function Ct(){if(Me>0||!Lt&&(Lt=1,Bt(),Me>0))return;function e(){st||(st=1,i.calledRun=1,!gt&&(Ut(),ye(i),i.onRuntimeInitialized?.(),zt()))}i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),e()},1)):e()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Ct(),i.runSQLite3PostLoadInit=function(e){if(globalThis.sqlite3ApiBootstrap=function t(n=globalThis.sqlite3ApiConfig||t.defaultConfig){if(t.sqlite3)return(t.sqlite3.config||console).warn("sqlite3ApiBootstrap() called multiple times.","Config and external initializers are ignored on calls after the first."),t.sqlite3;const r=Object.assign(Object.create(null),{exports:void 0,memory:void 0,bigIntEnabled:typeof i<"u"&&i.HEAPU64?!0:!!globalThis.BigInt64Array,debug:console.debug.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),log:console.log.bind(console),wasmfsOpfsDir:"/opfs",useStdAlloc:!1},n||{});Object.assign(r,{allocExportName:r.useStdAlloc?"malloc":"sqlite3_malloc",deallocExportName:r.useStdAlloc?"free":"sqlite3_free",reallocExportName:r.useStdAlloc?"realloc":"sqlite3_realloc"},r),["exports","memory","wasmfsOpfsDir"].forEach(l=>{typeof r[l]=="function"&&(r[l]=r[l]())}),delete globalThis.sqlite3ApiConfig,delete t.defaultConfig;const s=Object.create(null),o=Object.create(null),h=l=>s.sqlite3_js_rc_str&&s.sqlite3_js_rc_str(l)||"Unknown result code #"+l,q=l=>typeof l=="number"&&l===(l|0);
2class O extends Error{constructor(..._){let u;if(_.length)if(q(_[0]))if(u=_[0],_.length===1)super(h(_[0]));else{const k=h(u);typeof _[1]=="object"?super(k,_[1]):(_[0]=k+":",super(_.join(" ")))}else _.length===2&&typeof _[1]=="object"?super(..._):super(_.join(" "));this.resultCode=u||s.SQLITE_ERROR,this.name="SQLite3Error"}}O.toss=(...l)=>{throw new O(...l)};const N=O.toss;r.wasmfsOpfsDir&&!/^\/[^/]+$/.test(r.wasmfsOpfsDir)&&N("config.wasmfsOpfsDir must be falsy or in the form '/dir-name'.");const W=l=>typeof l!="bigint"&&l===(l|0)&&l<=2147483647&&l>=-2147483648,H=function l(_){return l._max||(l._max=BigInt("0x7fffffffffffffff"),l._min=~l._max),_>=l._min&&_<=l._max},P=l=>l>=-0x7fffffffn-1n&&l<=0x7fffffffn,x=function l(_){return l._min||(l._min=Number.MIN_SAFE_INTEGER,l._max=Number.MAX_SAFE_INTEGER),_>=l._min&&_<=l._max},j=l=>l&&l.constructor&&W(l.constructor.BYTES_PER_ELEMENT)?l:!1,b=typeof SharedArrayBuffer>"u"?function(){}:SharedArrayBuffer,w=l=>l.buffer instanceof b,S=(l,_,u)=>w(l)?l.slice(_,u):l.subarray(_,u),M=l=>l&&(l instanceof Uint8Array||l instanceof Int8Array||l instanceof ArrayBuffer),D=l=>l&&(l instanceof Uint8Array||l instanceof Int8Array||l instanceof ArrayBuffer),A=l=>M(l)||N("Value is not of a supported TypedArray type."),L=new TextDecoder("utf-8"),K=function(l,_,u){return L.decode(S(l,_,u))},c=function(l){return D(l)?K(l instanceof ArrayBuffer?new Uint8Array(l):l):Array.isArray(l)?l.join(""):(o.isPtr(l)&&(l=o.cstrToJs(l)),l)};
2class p extends Error{constructor(..._){_.length===2&&typeof _[1]=="object"?super(..._):_.length?super(_.join(" ")):super("Allocation failed."),this.resultCode=s.SQLITE_NOMEM,this.name="WasmAllocError"}}p.toss=(...l)=>{throw new p(...l)},Object.assign(s,{sqlite3_bind_blob:void 0,sqlite3_bind_text:void 0,sqlite3_create_function_v2:(l,_,u,k,Q,X,te,oe,se)=>{},sqlite3_create_function:(l,_,u,k,Q,X,te,oe)=>{},sqlite3_create_window_function:(l,_,u,k,Q,X,te,oe,se,ne)=>{},sqlite3_prepare_v3:(l,_,u,k,Q,X)=>{},sqlite3_prepare_v2:(l,_,u,k,Q)=>{},sqlite3_exec:(l,_,u,k,Q)=>{},sqlite3_randomness:(l,_)=>{}});const y={affirmBindableTypedArray:A,flexibleString:c,bigIntFits32:P,bigIntFits64:H,bigIntFitsDouble:x,isBindableTypedArray:M,isInt32:W,isSQLableTypedArray:D,isTypedArray:j,typedArrayToString:K,isUIThread:()=>globalThis.window===globalThis&&!!globalThis.document,isSharedTypedArray:w,toss:function(...l){throw new Error(l.join(" "))},toss3:N,typedArrayPart:S,affirmDbHeader:function(l){l instanceof ArrayBuffer&&(l=new Uint8Array(l));const _="SQLite format 3";_.length>l.byteLength&&N("Input does not contain an SQLite3 database header.");for(let u=0;u<_.length;++u)_.charCodeAt(u)!==l[u]&&N("Input does not contain an SQLite3 database header.")},affirmIsDb:function(l){l instanceof ArrayBuffer&&(l=new Uint8Array(l));const _=l.byteLength;(_<512||_%512!==0)&&N("Byte array size",_,"is invalid for an SQLite3 db."),y.affirmDbHeader(l)}};Object.assign(o,{ptrSizeof:r.wasmPtrSizeof||4,ptrIR:r.wasmPtrIR||"i32",bigIntEnabled:!!r.bigIntEnabled,exports:r.exports||N("Missing API config.exports (WASM module exports)."),memory:r.memory||r.exports.memory||N("API config object requires a WebAssembly.Memory object","in either config.exports.memory (exported)","or config.memory (imported)."),alloc:void 0,realloc:void 0,dealloc:void 0}),o.allocFromTypedArray=function(l){l instanceof ArrayBuffer&&(l=new Uint8Array(l)),A(l);const _=o.alloc(l.byteLength||1);return o.heapForSize(l.constructor).set(l.byteLength?l:[0],_),_};{const l=r.allocExportName,_=r.deallocExportName,u=r.reallocExportName;for(const k of[l,_,u])o.exports[k]instanceof Function||N("Missing required exports[",k,"] function.");o.alloc=function k(Q){return k.impl(Q)||p.toss("Failed to allocate",Q," bytes.")},o.alloc.impl=o.exports[l],o.realloc=function k(Q,X){const te=k.impl(Q,X);return X?te||p.toss("Failed to reallocate",X," bytes."):0},o.realloc.impl=o.exports[u],o.dealloc=o.exports[_]}o.compileOptionUsed=function l(_){if(arguments.length){if(Array.isArray(_)){const u={};return _.forEach(k=>{u[k]=s.sqlite3_compileoption_used(k)}),u}else if(typeof _=="object")return Object.keys(_).forEach(u=>{_[u]=s.sqlite3_compileoption_used(u)}),_}else{if(l._result)return l._result;
2l._opt||(l._rx=/^([^=]+)=(.+)/,l._rxInt=/^-?\d+$/,l._opt=function(te,oe){const se=l._rx.exec(te);oe[0]=se?se[1]:te,oe[1]=se?l._rxInt.test(se[2])?+se[2]:se[2]:!0});const u={},k=[0,0];let Q=0,X;for(;X=s.sqlite3_compileoption_get(Q++);)l._opt(X,k),u[k[0]]=k[1];return l._result=u}return typeof _=="string"?!!s.sqlite3_compileoption_used(_):!1},o.pstack=Object.assign(Object.create(null),{restore:o.exports.sqlite3__wasm_pstack_restore,alloc:function(l){return typeof l=="string"&&!(l=o.sizeofIR(l))&&p.toss("Invalid value for pstack.alloc(",arguments[0],")"),o.exports.sqlite3__wasm_pstack_alloc(l)||p.toss("Could not allocate",l,"bytes from the pstack.")},allocChunks:function(l,_){typeof _=="string"&&!(_=o.sizeofIR(_))&&p.toss("Invalid size value for allocChunks(",arguments[1],")");const u=o.pstack.alloc(l*_),k=[];let Q=0,X=0;for(;Q<l;++Q,X+=_)k.push(u+X);return k},allocPtr:(l=1,_=!0)=>l===1?o.pstack.alloc(_?8:o.ptrSizeof):o.pstack.allocChunks(l,_?8:o.ptrSizeof),call:function(l){const _=o.pstack.pointer;try{return l(m)}finally{o.pstack.restore(_)}}}),Object.defineProperties(o.pstack,{pointer:{configurable:!1,iterable:!0,writeable:!1,get:o.exports.sqlite3__wasm_pstack_ptr},quota:{configurable:!1,iterable:!0,writeable:!1,get:o.exports.sqlite3__wasm_pstack_quota},remaining:{configurable:!1,iterable:!0,writeable:!1,get:o.exports.sqlite3__wasm_pstack_remaining}}),s.sqlite3_randomness=(...l)=>{if(l.length===1&&y.isTypedArray(l[0])&&l[0].BYTES_PER_ELEMENT===1){const _=l[0];if(_.byteLength===0)return o.exports.sqlite3_randomness(0,0),_;const u=o.pstack.pointer;try{let k=_.byteLength,Q=0;const X=o.exports.sqlite3_randomness,te=o.heap8u(),oe=k<512?k:512,se=o.pstack.alloc(oe);do{const ne=k>oe?oe:k;X(ne,se),_.set(S(te,se,se+ne),Q),k-=ne,Q+=ne}while(k>0)}catch(k){console.error("Highly unexpected (and ignored!) exception in sqlite3_randomness():",k)}finally{o.pstack.restore(u)}return _}o.exports.sqlite3_randomness(...l)};let z;if(s.sqlite3_wasmfs_opfs_dir=function(){if(z!==void 0)return z;const l=r.wasmfsOpfsDir;if(!l||!globalThis.FileSystemHandle||!globalThis.FileSystemDirectoryHandle||!globalThis.FileSystemFileHandle)return z="";try{return l&&o.xCallWrapped("sqlite3__wasm_init_wasmfs","i32",["string"],l)===0?z=l:z=""}catch{return z=""}},s.sqlite3_wasmfs_filename_is_persistent=function(l){const _=s.sqlite3_wasmfs_opfs_dir();return _&&l?l.startsWith(_+"/"):!1},s.sqlite3_js_db_uses_vfs=function(l,_,u=0){try{const k=s.sqlite3_vfs_find(_);return k?l?k===s.sqlite3_js_db_vfs(l,u)?k:!1:k===s.sqlite3_vfs_find(0)?k:!1:!1}catch{return!1}},s.sqlite3_js_vfs_list=function(){const l=[];let _=s.sqlite3_vfs_find(0);for(;_;){const u=new s.sqlite3_vfs(_);l.push(o.cstrToJs(u.$zName)),_=u.$pNext,u.dispose()}return l},s.sqlite3_js_db_export=function(l,_=0){l=o.xWrap.testConvertArg("sqlite3*",l),l||N("Invalid sqlite3* argument."),o.bigIntEnabled||N("BigInt64 support is not enabled.");const u=o.scopedAllocPush();let k;try{const Q=o.scopedAlloc(8+o.ptrSizeof),X=Q+8,te=_?o.isPtr(_)?_:o.scopedAllocCString(""+_):0;let oe=o.exports.sqlite3__wasm_db_serialize(l,te,X,Q,0);oe&&N("Database serialization failed with code",m.capi.sqlite3_js_rc_str(oe)),k=o.peekPtr(X);const se=o.peek(Q,"i64");return oe=se?o.heap8u().slice(k,k+Number(se)):new Uint8Array,oe}finally{k&&o.exports.sqlite3_free(k),o.scopedAllocPop(u)}},s.sqlite3_js_db_vfs=(l,_=0)=>y.sqlite3__wasm_db_vfs(l,_),s.sqlite3_js_aggregate_context=(l,_)=>s.sqlite3_aggregate_context(l,_)||(_?p.toss("Cannot allocate",_,"bytes for sqlite3_aggregate_context()"):0),s.sqlite3_js_posix_create_file=function(l,_,u){let k;_&&o.isPtr(_)?k=_:_ instanceof ArrayBuffer||_ instanceof Uint8Array?(k=o.allocFromTypedArray(_),(arguments.length<3||!y.isInt32(u)||u<0)&&(u=_.byteLength)):O.toss("Invalid 2nd argument for sqlite3_js_posix_create_file().");try{(!y.isInt32(u)||u<0)&&O.toss("Invalid 3rd argument for sqlite3_js_posix_create_file().");const Q=y.sqlite3__wasm_posix_create_file(l,k,u);Q&&O.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(Q))}finally{o.dealloc(k)}},s.sqlite3_js_vfs_create_file=function(l,_,u,k){r.warn("sqlite3_js_vfs_create_file() is deprecated and","should be avoided because it can lead to C-level crashes.","See its documentation for alternative options.");let Q;u?(o.isPtr(u)?Q=u:u instanceof ArrayBuffer&&(u=new Uint8Array(u)),u instanceof Uint8Array?(Q=o.allocFromTypedArray(u),(arguments.length<4||!y.isInt32(k)||k<0)&&(k=u.byteLength)):O.toss("Invalid 3rd argument type for sqlite3_js_vfs_create_file().")):Q=0,(!y.isInt32(k)||k<0)&&(o.dealloc(Q),O.toss("Invalid 4th argument for sqlite3_js_vfs_create_file()."));try{const X=y.sqlite3__wasm_vfs_create_file(l,_,Q,k);X&&O.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(X))}finally{o.dealloc(Q)}},s.sqlite3_js_sql_to_string=l=>{if(typeof l=="string")return l;const _=c(v);return _===v?void 0:_},y.isUIThread()){const l=function(_){const u=Object.create(null);return u.prefix="kvvfs-"+_,u.stores=[],(_==="session"||_==="")&&u.stores.push(globalThis.sessionStorage),(_==="local"||_==="")&&u.stores.push(globalThis.localStorage),u};s.sqlite3_js_kvvfs_clear=function(_=""){let u=0;const k=l(_);
2return k.stores.forEach(Q=>{const X=[];let te;for(te=0;te<Q.length;++te){const oe=Q.key(te);oe.startsWith(k.prefix)&&X.push(oe)}X.forEach(oe=>Q.removeItem(oe)),u+=X.length}),u},s.sqlite3_js_kvvfs_size=function(_=""){let u=0;const k=l(_);return k.stores.forEach(Q=>{let X;for(X=0;X<Q.length;++X){const te=Q.key(X);te.startsWith(k.prefix)&&(u+=te.length,u+=Q.getItem(te).length)}}),u*2}}s.sqlite3_db_config=function(l,_,...u){switch(_){case s.SQLITE_DBCONFIG_ENABLE_FKEY:case s.SQLITE_DBCONFIG_ENABLE_TRIGGER:case s.SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER:case s.SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION:case s.SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE:case s.SQLITE_DBCONFIG_ENABLE_QPSG:case s.SQLITE_DBCONFIG_TRIGGER_EQP:case s.SQLITE_DBCONFIG_RESET_DATABASE:case s.SQLITE_DBCONFIG_DEFENSIVE:case s.SQLITE_DBCONFIG_WRITABLE_SCHEMA:case s.SQLITE_DBCONFIG_LEGACY_ALTER_TABLE:case s.SQLITE_DBCONFIG_DQS_DML:case s.SQLITE_DBCONFIG_DQS_DDL:case s.SQLITE_DBCONFIG_ENABLE_VIEW:case s.SQLITE_DBCONFIG_LEGACY_FILE_FORMAT:case s.SQLITE_DBCONFIG_TRUSTED_SCHEMA:case s.SQLITE_DBCONFIG_STMT_SCANSTATUS:case s.SQLITE_DBCONFIG_REVERSE_SCANORDER:case s.SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE:case s.SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE:case s.SQLITE_DBCONFIG_ENABLE_COMMENTS:return this.ip||(this.ip=o.xWrap("sqlite3__wasm_db_config_ip","int",["sqlite3*","int","int","*"])),this.ip(l,_,u[0],u[1]||0);case s.SQLITE_DBCONFIG_LOOKASIDE:return this.pii||(this.pii=o.xWrap("sqlite3__wasm_db_config_pii","int",["sqlite3*","int","*","int","int"])),this.pii(l,_,u[0],u[1],u[2]);case s.SQLITE_DBCONFIG_MAINDBNAME:return this.s||(this.s=o.xWrap("sqlite3__wasm_db_config_s","int",["sqlite3*","int","string:static"])),this.s(l,_,u[0]);default:return s.SQLITE_MISUSE}}.bind(Object.create(null)),s.sqlite3_value_to_js=function(l,_=!0){let u;const k=s.sqlite3_value_type(l);switch(k){case s.SQLITE_INTEGER:o.bigIntEnabled?(u=s.sqlite3_value_int64(l),y.bigIntFitsDouble(u)&&(u=Number(u))):u=s.sqlite3_value_double(l);break;case s.SQLITE_FLOAT:u=s.sqlite3_value_double(l);break;case s.SQLITE_TEXT:u=s.sqlite3_value_text(l);break;case s.SQLITE_BLOB:{const Q=s.sqlite3_value_bytes(l),X=s.sqlite3_value_blob(l);Q&&!X&&m.WasmAllocError.toss("Cannot allocate memory for blob argument of",Q,"byte(s)"),u=Q?o.heap8u().slice(X,X+Number(Q)):null;break}case s.SQLITE_NULL:u=null;break;default:_&&N(s.SQLITE_MISMATCH,"Unhandled sqlite3_value_type():",k),u=void 0}return u},s.sqlite3_values_to_js=function(l,_,u=!0){let k;const Q=[];for(k=0;k<l;++k)Q.push(s.sqlite3_value_to_js(o.peekPtr(_+o.ptrSizeof*k),u));return Q},s.sqlite3_result_error_js=function(l,_){_ instanceof p?s.sqlite3_result_error_nomem(l):s.sqlite3_result_error(l,""+_,-1)},s.sqlite3_result_js=function(l,_){if(_ instanceof Error){s.sqlite3_result_error_js(l,_);return}try{switch(typeof _){case"undefined":break;case"boolean":s.sqlite3_result_int(l,_?1:0);break;case"bigint":y.bigIntFits32(_)?s.sqlite3_result_int(l,Number(_)):y.bigIntFitsDouble(_)?s.sqlite3_result_double(l,Number(_)):o.bigIntEnabled?y.bigIntFits64(_)?s.sqlite3_result_int64(l,_):N("BigInt value",_.toString(),"is too BigInt for int64."):N("BigInt value",_.toString(),"is too BigInt.");break;case"number":{let u;y.isInt32(_)?u=s.sqlite3_result_int:o.bigIntEnabled&&Number.isInteger(_)&&y.bigIntFits64(BigInt(_))?u=s.sqlite3_result_int64:u=s.sqlite3_result_double,u(l,_);break}case"string":{const[u,k]=o.allocCString(_,!0);s.sqlite3_result_text(l,u,k,s.SQLITE_WASM_DEALLOC);break}case"object":if(_===null){s.sqlite3_result_null(l);break}else if(y.isBindableTypedArray(_)){const u=o.allocFromTypedArray(_);s.sqlite3_result_blob(l,u,_.byteLength,s.SQLITE_WASM_DEALLOC);break}default:N("Don't not how to handle this UDF result value:",typeof _,_)}}catch(u){s.sqlite3_result_error_js(l,u)}},s.sqlite3_column_js=function(l,_,u=!0){const k=s.sqlite3_column_value(l,_);return k===0?void 0:s.sqlite3_value_to_js(k,u)};const f=function(l,_,u){u=s[u],this.ptr?o.pokePtr(this.ptr,0):this.ptr=o.allocPtr();const k=u(l,_,this.ptr);if(k)return O.toss(k,arguments[2]+"() failed with code "+k);const Q=o.peekPtr(this.ptr);return Q?s.sqlite3_value_to_js(Q,!0):void 0}.bind(Object.create(null));s.sqlite3_preupdate_new_js=(l,_)=>f(l,_,"sqlite3_preupdate_new"),s.sqlite3_preupdate_old_js=(l,_)=>f(l,_,"sqlite3_preupdate_old"),s.sqlite3changeset_new_js=(l,_)=>f(l,_,"sqlite3changeset_new"),s.sqlite3changeset_old_js=(l,_)=>f(l,_,"sqlite3changeset_old");const m={WasmAllocError:p,SQLite3Error:O,capi:s,util:y,wasm:o,config:r,version:Object.create(null),client:void 0,asyncPostInit:async function l(){if(l.isReady instanceof Promise)return l.isReady;
2let _=t.initializersAsync;delete t.initializersAsync;const u=async()=>(m.__isUnderTest||(delete m.util,delete m.StructBinder),m),k=X=>{throw r.error("an async sqlite3 initializer failed:",X),X};if(!_||!_.length)return l.isReady=u().catch(k);_=_.map(X=>X instanceof Function?async te=>X(m):X),_.push(u);let Q=Promise.resolve(m);for(;_.length;)Q=Q.then(_.shift());return l.isReady=Q.catch(k)},scriptInfo:void 0};try{t.initializers.forEach(l=>{l(m)})}catch(l){throw console.error("sqlite3 bootstrap initializer threw:",l),l}return delete t.initializers,t.sqlite3=m,m},globalThis.sqlite3ApiBootstrap.initializers=[],globalThis.sqlite3ApiBootstrap.initializersAsync=[],globalThis.sqlite3ApiBootstrap.defaultConfig=Object.create(null),globalThis.sqlite3ApiBootstrap.sqlite3=void 0,globalThis.WhWasmUtilInstaller=function(t){t.bigIntEnabled===void 0&&(t.bigIntEnabled=!!globalThis.BigInt64Array);const n=(...c)=>{throw new Error(c.join(" "))};t.exports||Object.defineProperty(t,"exports",{enumerable:!0,configurable:!0,get:()=>t.instance&&t.instance.exports});const r=t.pointerIR||"i32",s=t.ptrSizeof=r==="i32"?4:r==="i64"?8:n("Unhandled ptrSizeof:",r),o=Object.create(null);o.heapSize=0,o.memory=null,o.freeFuncIndexes=[],o.scopedAlloc=[],o.utf8Decoder=new TextDecoder,o.utf8Encoder=new TextEncoder("utf-8"),t.sizeofIR=c=>{switch(c){case"i8":return 1;case"i16":return 2;case"i32":case"f32":case"float":return 4;case"i64":case"f64":case"double":return 8;case"*":return s;default:return(""+c).endsWith("*")?s:void 0}};const h=function(){if(!o.memory)o.memory=t.memory instanceof WebAssembly.Memory?t.memory:t.exports.memory;else if(o.heapSize===o.memory.buffer.byteLength)return o;const c=o.memory.buffer;return o.HEAP8=new Int8Array(c),o.HEAP8U=new Uint8Array(c),o.HEAP16=new Int16Array(c),o.HEAP16U=new Uint16Array(c),o.HEAP32=new Int32Array(c),o.HEAP32U=new Uint32Array(c),t.bigIntEnabled&&(o.HEAP64=new BigInt64Array(c),o.HEAP64U=new BigUint64Array(c)),o.HEAP32F=new Float32Array(c),o.HEAP64F=new Float64Array(c),o.heapSize=c.byteLength,o};t.heap8=()=>h().HEAP8,t.heap8u=()=>h().HEAP8U,t.heap16=()=>h().HEAP16,t.heap16u=()=>h().HEAP16U,t.heap32=()=>h().HEAP32,t.heap32u=()=>h().HEAP32U,t.heapForSize=function(c,p=!0){const y=o.memory&&o.heapSize===o.memory.buffer.byteLength?o:h();switch(c){case Int8Array:return y.HEAP8;case Uint8Array:return y.HEAP8U;case Int16Array:return y.HEAP16;case Uint16Array:return y.HEAP16U;case Int32Array:return y.HEAP32;case Uint32Array:return y.HEAP32U;case 8:return p?y.HEAP8U:y.HEAP8;case 16:return p?y.HEAP16U:y.HEAP16;case 32:return p?y.HEAP32U:y.HEAP32;case 64:if(y.HEAP64)return p?y.HEAP64U:y.HEAP64;break;default:if(t.bigIntEnabled){if(c===globalThis.BigUint64Array)return y.HEAP64U;if(c===globalThis.BigInt64Array)return y.HEAP64;break}}n("Invalid heapForSize() size: expecting 8, 16, 32,","or (if BigInt is enabled) 64.")},t.functionTable=function(){return t.exports.__indirect_function_table},t.functionEntry=function(c){const p=t.functionTable();return c<p.length?p.get(c):void 0},t.jsFuncToWasm=function c(p,y){if(c._||(c._={sigTypes:Object.assign(Object.create(null),{i:"i32",p:"i32",P:"i32",s:"i32",j:"i64",f:"f32",d:"f64"}),typeCodes:Object.assign(Object.create(null),{f64:124,f32:125,i64:126,i32:127}),uleb128Encode:function(m,l,_){_<128?m[l](_):m[l](_%128|128,_>>7)},rxJSig:/^(\w)\((\w*)\)$/,sigParams:function(m){const l=c._.rxJSig.exec(m);return l?l[2]:m.substr(1)},letterType:m=>c._.sigTypes[m]||n("Invalid signature letter:",m),pushSigType:(m,l)=>m.push(c._.typeCodes[c._.letterType(l)])}),typeof p=="string"){const m=y;y=p,p=m}const z=c._.sigParams(y),f=[1,96];c._.uleb128Encode(f,"push",z.length);for(const m of z)c._.pushSigType(f,m);return y[0]==="v"?f.push(0):(f.push(1),c._.pushSigType(f,y[0])),c._.uleb128Encode(f,"unshift",f.length),f.unshift(0,97,115,109,1,0,0,0,1),f.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array(f)),{e:{f:p}}).exports.f};const q=function(p,y,z){if(z&&!o.scopedAlloc.length&&n("No scopedAllocPush() scope is active."),typeof p=="string"){const _=y;y=p,p=_}
2(typeof y!="string"||!(p instanceof Function))&&n("Invalid arguments: expecting (function,signature) or (signature,function).");const f=t.functionTable(),m=f.length;let l;for(;o.freeFuncIndexes.length&&(l=o.freeFuncIndexes.pop(),f.get(l));){l=null;continue}l||(l=m,f.grow(1));try{return f.set(l,p),z&&o.scopedAlloc[o.scopedAlloc.length-1].push(l),l}catch(_){if(!(_ instanceof TypeError))throw l===m&&o.freeFuncIndexes.push(m),_}try{const _=t.jsFuncToWasm(p,y);f.set(l,_),z&&o.scopedAlloc[o.scopedAlloc.length-1].push(l)}catch(_){throw l===m&&o.freeFuncIndexes.push(m),_}return l};t.installFunction=(c,p)=>q(c,p,!1),t.scopedInstallFunction=(c,p)=>q(c,p,!0),t.uninstallFunction=function(c){if(!c&&c!==0)return;const p=o.freeFuncIndexes,y=t.functionTable();p.push(c);const z=y.get(c);return y.set(c,null),z},t.peek=function(p,y="i8"){y.endsWith("*")&&(y=r);const z=o.memory&&o.heapSize===o.memory.buffer.byteLength?o:h(),f=Array.isArray(p)?[]:void 0;let m;do{switch(f&&(p=arguments[0].shift()),y){case"i1":case"i8":m=z.HEAP8[p>>0];break;case"i16":m=z.HEAP16[p>>1];break;case"i32":m=z.HEAP32[p>>2];break;case"float":case"f32":m=z.HEAP32F[p>>2];break;case"double":case"f64":m=Number(z.HEAP64F[p>>3]);break;case"i64":if(t.bigIntEnabled){m=BigInt(z.HEAP64[p>>3]);break}default:n("Invalid type for peek():",y)}f&&f.push(m)}while(f&&arguments[0].length);return f||m},t.poke=function(c,p,y="i8"){y.endsWith("*")&&(y=r);const z=o.memory&&o.heapSize===o.memory.buffer.byteLength?o:h();for(const f of Array.isArray(c)?c:[c])switch(y){case"i1":case"i8":z.HEAP8[f>>0]=p;continue;case"i16":z.HEAP16[f>>1]=p;continue;case"i32":z.HEAP32[f>>2]=p;continue;case"float":case"f32":z.HEAP32F[f>>2]=p;continue;case"double":case"f64":z.HEAP64F[f>>3]=p;continue;case"i64":if(z.HEAP64){z.HEAP64[f>>3]=BigInt(p);continue}default:n("Invalid type for poke(): "+y)}return this},t.peekPtr=(...c)=>t.peek(c.length===1?c[0]:c,r),t.pokePtr=(c,p=0)=>t.poke(c,p,r),t.peek8=(...c)=>t.peek(c.length===1?c[0]:c,"i8"),t.poke8=(c,p)=>t.poke(c,p,"i8"),t.peek16=(...c)=>t.peek(c.length===1?c[0]:c,"i16"),t.poke16=(c,p)=>t.poke(c,p,"i16"),t.peek32=(...c)=>t.peek(c.length===1?c[0]:c,"i32"),t.poke32=(c,p)=>t.poke(c,p,"i32"),t.peek64=(...c)=>t.peek(c.length===1?c[0]:c,"i64"),t.poke64=(c,p)=>t.poke(c,p,"i64"),t.peek32f=(...c)=>t.peek(c.length===1?c[0]:c,"f32"),t.poke32f=(c,p)=>t.poke(c,p,"f32"),t.peek64f=(...c)=>t.peek(c.length===1?c[0]:c,"f64"),t.poke64f=(c,p)=>t.poke(c,p,"f64"),t.getMemValue=t.peek,t.getPtrValue=t.peekPtr,t.setMemValue=t.poke,t.setPtrValue=t.pokePtr,t.isPtr32=c=>typeof c=="number"&&c===(c|0)&&c>=0,t.isPtr=t.isPtr32,t.cstrlen=function(c){if(!c||!t.isPtr(c))return null;const p=h().HEAP8U;let y=c;for(;p[y]!==0;++y);return y-c};const O=typeof SharedArrayBuffer>"u"?function(){}:SharedArrayBuffer,N=function(c,p,y){return o.utf8Decoder.decode(c.buffer instanceof O?c.slice(p,y):c.subarray(p,y))};t.cstrToJs=function(c){const p=t.cstrlen(c);return p?N(h().HEAP8U,c,c+p):p===null?p:""},t.jstrlen=function(c){if(typeof c!="string")return null;const p=c.length;let y=0;for(let z=0;z<p;++z){let f=c.charCodeAt(z);f>=55296&&f<=57343&&(f=65536+((f&1023)<<10)|c.charCodeAt(++z)&1023),f<=127?++y:f<=2047?y+=2:f<=65535?y+=3:y+=4}return y},t.jstrcpy=function(c,p,y=0,z=-1,f=!0){if((!p||!(p instanceof Int8Array)&&!(p instanceof Uint8Array))&&n("jstrcpy() target must be an Int8Array or Uint8Array."),z<0&&(z=p.length-y),!(z>0)||!(y>=0))return 0;let m=0,l=c.length;const _=y,u=y+z-(f?1:0);for(;m<l&&y<u;++m){let k=c.charCodeAt(m);if(k>=55296&&k<=57343&&(k=65536+((k&1023)<<10)|c.charCodeAt(++m)&1023),k<=127){if(y>=u)break;p[y++]=k}else if(k<=2047){if(y+1>=u)break;p[y++]=192|k>>6,p[y++]=128|k&63}else if(k<=65535){if(y+2>=u)break;p[y++]=224|k>>12,p[y++]=128|k>>6&63,p[y++]=128|k&63}else{if(y+3>=u)break;p[y++]=240|k>>18,p[y++]=128|k>>12&63,p[y++]=128|k>>6&63,p[y++]=128|k&63}}return f&&(p[y++]=0),y-_},t.cstrncpy=function(c,p,y){if((!c||!p)&&n("cstrncpy() does not accept NULL strings."),y<0)y=t.cstrlen(strPtr)+1;else if(!(y>0))return 0;const z=t.heap8u();let f=0,m;for(;f<y&&(m=z[p+f]);++f)z[c+f]=m;return f<y&&(z[c+f++]=0),f},t.jstrToUintArray=(c,p=!1)=>o.utf8Encoder.encode(p?c+"\0":c);const W=(c,p)=>{(!(c.alloc instanceof Function)||!(c.dealloc instanceof Function))&&n("Object is missing alloc() and/or dealloc() function(s)","required by",p+"().")},H=function(c,p,y,z){if(W(t,z),typeof c!="string")return null;{const f=o.utf8Encoder.encode(c),m=y(f.length+1),l=h().HEAP8U;return l.set(f,m),l[m+f.length]=0,p?[m,f.length]:m}};t.allocCString=(c,p=!1)=>H(c,p,t.alloc,"allocCString()"),t.scopedAllocPush=function(){W(t,"scopedAllocPush");const c=[];return o.scopedAlloc.push(c),c},t.scopedAllocPop=function(c){W(t,"scopedAllocPop");const p=arguments.length?o.scopedAlloc.indexOf(c):o.scopedAlloc.length-1;p<0&&n("Invalid state object for scopedAllocPop()."),arguments.length===0&&(c=o.scopedAlloc[p]),o.scopedAlloc.splice(p,1);for(let y;y=c.pop();)t.functionEntry(y)?t.uninstallFunction(y):t.dealloc(y)},t.scopedAlloc=function(c){o.scopedAlloc.length||n("No scopedAllocPush() scope is active.");const p=t.alloc(c);return o.scopedAlloc[o.scopedAlloc.length-1].push(p),p},Object.defineProperty(t.scopedAlloc,"level",{configurable:!1,enumerable:!1,get:()=>o.scopedAlloc.length,set:()=>n("The 'active' property is read-only.")}),t.scopedAllocCString=(c,p=!1)=>H(c,p,t.scopedAlloc,"scopedAllocCString()");const P=function(c,p){const y=t[c?"scopedAlloc":"alloc"]((p.length+1)*t.ptrSizeof);let z=0;return p.forEach(f=>{t.pokePtr(y+t.ptrSizeof*z++,t[c?"scopedAllocCString":"allocCString"](""+f))}),t.pokePtr(y+t.ptrSizeof*z,0),y};t.scopedAllocMainArgv=c=>P(!0,c),t.allocMainArgv=c=>P(!1,c),t.cArgvToJs=(c,p)=>{const y=[];for(let z=0;z<c;++z){const f=t.peekPtr(p+t.ptrSizeof*z);y.push(f?t.cstrToJs(f):null)}return y},t.scopedAllocCall=function(c){t.scopedAllocPush();try{return c()}finally{t.scopedAllocPop()}};const x=function(c,p,y){W(t,y);const z=p?"i64":r;let f=t[y](c*(p?8:s));if(t.poke(f,0,z),c===1)return f;const m=[f];for(let l=1;l<c;++l)f+=p?8:s,m[l]=f,t.poke(f,0,z);return m};t.allocPtr=(c=1,p=!0)=>x(c,p,"alloc"),t.scopedAllocPtr=(c=1,p=!0)=>x(c,p,"scopedAlloc"),t.xGet=function(c){return t.exports[c]||n("Cannot find exported symbol:",c)};const j=(c,p)=>n(c+"() requires",p,"argument(s).");t.xCall=function(c,...p){const y=c instanceof Function?c:t.xGet(c);return y instanceof Function||n("Exported symbol",c,"is not a function."),y.length!==p.length&&j(y===c?y.name:c,y.length),arguments.length===2&&Array.isArray(arguments[1])?y.apply(null,arguments[1]):y.apply(null,p)},o.xWrap=Object.create(null),o.xWrap.convert=Object.create(null),o.xWrap.convert.arg=new Map,o.xWrap.convert.result=new Map;const b=o.xWrap.convert.arg,w=o.xWrap.convert.result;t.bigIntEnabled&&b.set("i64",c=>BigInt(c));const S=r==="i32"?c=>c|0:c=>BigInt(c)|BigInt(0);b.set("i32",S).set("i16",c=>(c|0)&65535).set("i8",c=>(c|0)&255).set("f32",c=>Number(c).valueOf()).set("float",b.get("f32")).set("f64",b.get("f32")).set("double",b.get("f64")).set("int",b.get("i32")).set("null",c=>c).set(null,b.get("null")).set("**",S).set("*",S),w.set("*",S).set("pointer",S).set("number",c=>Number(c)).set("void",c=>{}).set("null",c=>c).set(null,w.get("null"));{const c=["i8","i16","i32","int","f32","float","f64","double"];t.bigIntEnabled&&c.push("i64");const p=b.get(r);for(const y of c)b.set(y+"*",p),w.set(y+"*",p),w.set(y,b.get(y)||n("Missing arg converter:",y))}const M=function(c){return typeof c=="string"?t.scopedAllocCString(c):c?S(c):null};b.set("string",M).set("utf8",M).set("pointer",M),w.set("string",c=>t.cstrToJs(c)).set("utf8",w.get("string")).set("string:dealloc",c=>{try{return c?t.cstrToJs(c):null}finally{t.dealloc(c)}}).set("utf8:dealloc",w.get("string:dealloc")).set("json",c=>JSON.parse(t.cstrToJs(c))).set("json:dealloc",c=>{try{return c?JSON.parse(t.cstrToJs(c)):null}finally{t.dealloc(c)}});const D=class{constructor(c){this.name=c.name||"unnamed adapter"}convertArg(c,p,y){n("AbstractArgAdapter must be subclassed.")}};b.FuncPtrAdapter=class Le extends D{constructor(p){super(p),b.FuncPtrAdapter.warnOnUse&&console.warn("xArg.FuncPtrAdapter is an internal-only API","and is not intended to be invoked from","client-level code. Invoked with:",p),this.name=p.name||"unnamed",this.signature=p.signature,p.contextKey instanceof Function&&(this.contextKey=p.contextKey,p.bindScope||(p.bindScope="context")),this.bindScope=p.bindScope||n("FuncPtrAdapter options requires a bindScope (explicit or implied)."),Le.bindScopes.indexOf(p.bindScope)<0&&n("Invalid options.bindScope ("+p.bindMod+") for FuncPtrAdapter. Expecting one of: ("+Le.bindScopes.join(", ")+")"),this.isTransient=this.bindScope==="transient",this.isContext=this.bindScope==="context",this.isPermanent=this.bindScope==="permanent",this.singleton=this.bindScope==="singleton"?[]:void 0,this.callProxy=p.callProxy instanceof Function?p.callProxy:void 0}contextKey(p,y){return this}contextMap(p){const y=this.__cmap||(this.__cmap=new Map);let z=y.get(p);return z===void 0&&y.set(p,z=[]),z}convertArg(p,y,z){let f=this.singleton;if(!f&&this.isContext&&(f=this.contextMap(this.contextKey(y,z))),f&&f[0]===p)return f[1];if(p instanceof Function){this.callProxy&&(p=this.callProxy(p));const m=q(p,this.signature,this.isTransient);if(Le.debugFuncInstall&&Le.debugOut("FuncPtrAdapter installed",this,this.contextKey(y,z),"@"+m,p),f){if(f[1]){Le.debugFuncInstall&&Le.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(y,z),"@"+f[1],p);try{o.scopedAlloc[o.scopedAlloc.length-1].push(f[1])}catch{}}f[0]=p,f[1]=m}return m}else if(t.isPtr(p)||p===null||p===void 0){if(f&&f[1]&&f[1]!==p){Le.debugFuncInstall&&Le.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(y,z),"@"+f[1],p);try{o.scopedAlloc[o.scopedAlloc.length-1].push(f[1])}catch{}f[0]=f[1]=p|0}return p||0}else throw new TypeError("Invalid FuncPtrAdapter argument type. Expecting a function pointer or a "+(this.name?this.name+" ":"")+"function matching signature "+this.signature+".")}},b.FuncPtrAdapter.warnOnUse=!1,b.FuncPtrAdapter.debugFuncInstall=!1,b.FuncPtrAdapter.debugOut=console.debug.bind(console),b.FuncPtrAdapter.bindScopes=["transient","context","singleton","permanent"];const A=c=>b.get(c)||n("Argument adapter not found:",c),L=c=>w.get(c)||n("Result adapter not found:",c);o.xWrap.convertArg=(c,...p)=>A(c)(...p),o.xWrap.convertArgNoCheck=(c,...p)=>b.get(c)(...p),o.xWrap.convertResult=(c,p)=>c===null?p:c?L(c)(p):void 0,o.xWrap.convertResultNoCheck=(c,p)=>c===null?p:c?w.get(c)(p):void 0,t.xWrap=function(c,p,...y){arguments.length===3&&Array.isArray(arguments[2])&&(y=arguments[2]),t.isPtr(c)&&(c=t.functionEntry(c)||n("Function pointer not found in WASM function table."));const z=c instanceof Function,f=z?c:t.xGet(c);if(z&&(c=f.name||"unnamed function"),y.length!==f.length&&j(c,f.length),p===null&&f.length===0)return f;p!=null&&L(p);for(const l of y)l instanceof D?b.set(l,(..._)=>l.convertArg(..._)):A(l);const m=o.xWrap;return f.length===0?(...l)=>l.length?j(c,f.length):m.convertResult(p,f.call(null)):function(...l){l.length!==f.length&&j(c,f.length);const _=t.scopedAllocPush();try{let u=0;for(;u<l.length;++u)l[u]=m.convertArgNoCheck(y[u],l[u],l,u);return m.convertResultNoCheck(p,f.apply(null,l))}finally{t.scopedAllocPop(_)}}};const K=function(c,p,y,z,f,m){if(typeof y=="string"){if(p===1)return m.get(y);if(p===2){if(z)z instanceof Function||n(f,"requires a function argument.");else return m.delete(y),c;return m.set(y,z),c}}n("Invalid arguments to",f)};return t.xWrap.resultAdapter=function c(p,y){return K(c,arguments.length,p,y,"resultAdapter()",
2w)},t.xWrap.argAdapter=function c(p,y){return K(c,arguments.length,p,y,"argAdapter()",b)},t.xWrap.FuncPtrAdapter=b.FuncPtrAdapter,t.xCallWrapped=function(c,p,y,...z){return Array.isArray(arguments[3])&&(z=arguments[3]),t.xWrap(c,p,y||[]).apply(null,z||[])},t.xWrap.testConvertArg=o.xWrap.convertArg,t.xWrap.testConvertResult=o.xWrap.convertResult,t},globalThis.WhWasmUtilInstaller.yawl=function(t){const n=()=>fetch(t.uri,{credentials:"same-origin"}),r=this,s=function(h){if(t.wasmUtilTarget){const q=(...N)=>{throw new Error(N.join(" "))},O=t.wasmUtilTarget;if(O.module=h.module,O.instance=h.instance,O.instance.exports.memory||(O.memory=t.imports&&t.imports.env&&t.imports.env.memory||q("Missing 'memory' object!")),!O.alloc&&h.instance.exports.malloc){const N=h.instance.exports;O.alloc=function(W){return N.malloc(W)||q("Allocation of",W,"bytes failed.")},O.dealloc=function(W){N.free(W)}}r(O)}return t.onload&&t.onload(h,t),h};return WebAssembly.instantiateStreaming?function(){return WebAssembly.instantiateStreaming(n(),t.imports||{}).then(s)}:function(){return n().then(q=>q.arrayBuffer()).then(q=>WebAssembly.instantiate(q,t.imports||{})).then(s)}}.bind(globalThis.WhWasmUtilInstaller),globalThis.Jaccwabyt=function t(n){const r=(...d)=>{throw new Error(d.join(" "))};!(n.heap instanceof WebAssembly.Memory)&&!(n.heap instanceof Function)&&r("config.heap must be WebAssembly.Memory instance or a function."),["alloc","dealloc"].forEach(function(d){n[d]instanceof Function||r("Config option '"+d+"' must be a function.")});const s=t,o=n.heap instanceof Function?n.heap:()=>new Uint8Array(n.heap.buffer),h=n.alloc,q=n.dealloc,O=n.log||console.log.bind(console),N=n.memberPrefix||"",W=n.memberSuffix||"",H=n.bigIntEnabled===void 0?!!globalThis.BigInt64Array:!!n.bigIntEnabled,P=globalThis.BigInt,x=globalThis.BigInt64Array,j=n.ptrSizeof||4,b=n.ptrIR||"i32";s.debugFlags||(s.__makeDebugFlags=function(d=null){d&&d.__flags&&(d=d.__flags);const I=function F(R){return arguments.length===0?F.__flags:(R<0?(delete F.__flags.getter,delete F.__flags.setter,delete F.__flags.alloc,delete F.__flags.dealloc):(F.__flags.getter=(1&R)!==0,F.__flags.setter=(2&R)!==0,F.__flags.alloc=(4&R)!==0,F.__flags.dealloc=(8&R)!==0),F._flags)};return Object.defineProperty(I,"__flags",{iterable:!1,writable:!1,value:Object.create(d)}),d||I(0),I},s.debugFlags=s.__makeDebugFlags());const w=(function(){const d=new ArrayBuffer(2);return new DataView(d).setInt16(0,256,!0),new Int16Array(d)[0]===256})(),S=d=>d[1]==="(",M=d=>d==="P",D=d=>S(d)?"p":d[0],A=function(d){switch(D(d)){case"c":case"C":return"i8";case"i":return"i32";case"p":case"P":case"s":return b;case"j":return"i64";case"f":return"float";case"d":return"double"}r("Unhandled signature IR:",d)},L=x?()=>!0:()=>r("BigInt64Array is not available."),K=function(d){switch(D(d)){case"p":case"P":case"s":{switch(j){case 4:return"getInt32";case 8:return L()&&"getBigInt64"}break}case"i":return"getInt32";case"c":return"getInt8";case"C":return"getUint8";case"j":return L()&&"getBigInt64";case"f":return"getFloat32";case"d":return"getFloat64"}r("Unhandled DataView getter for signature:",d)},c=function(d){switch(D(d)){case"p":case"P":case"s":{switch(j){case 4:return"setInt32";case 8:return L()&&"setBigInt64"}break}case"i":return"setInt32";case"c":return"setInt8";case"C":return"setUint8";case"j":return L()&&"setBigInt64";case"f":return"setFloat32";case"d":return"setFloat64"}r("Unhandled DataView setter for signature:",d)},p=function(d){switch(D(d)){case"i":case"f":case"c":case"C":case"d":return Number;case"j":return L()&&P;case"p":case"P":case"s":switch(j){case 4:return Number;case 8:return L()&&P}break}r("Unhandled DataView set wrapper for signature:",d)},y=(d,I)=>d+"::"+I,z=function(d,I){return()=>r(y(d,I),"is read-only.")},f=new WeakMap,m="(pointer-is-external)",l=function(d,I,F){if(F||(F=f.get(I)),F){if(f.delete(I),Array.isArray(I.ondispose)){let R;for(;R=I.ondispose.shift();)try{R instanceof Function?R.call(I):R instanceof Z?R.dispose():typeof R=="number"&&q(R)}catch($){console.warn("ondispose() for",d.structName,"@",F,"threw. NOT propagating it.",$)}}else if(I.ondispose instanceof Function)try{I.ondispose()}catch(R){console.warn("ondispose() for",d.structName,"@",F,"threw. NOT propagating it.",R)}delete I.ondispose,d.debugFlags.__flags.dealloc&&O("debug.dealloc:",I[m]?"EXTERNAL":"",d.structName,"instance:",d.structInfo.sizeof,"bytes @"+F),I[m]||q(F)}},_=d=>({configurable:!1,writable:!1,iterable:!1,value:d}),u=function(d,I,F){let R=!F;F?Object.defineProperty(I,m,_(F)):(F=h(d.structInfo.sizeof),F||r("Allocation of",d.structName,"structure failed."));try{d.debugFlags.__flags.alloc&&O("debug.alloc:",R?"":"EXTERNAL",d.structName,"instance:",d.structInfo.sizeof,"bytes @"+F),R&&o().fill(0,F,F+d.structInfo.sizeof),f.set(I,F)}catch($){throw l(d,I,F),$}},k=function(){const d=this.pointer;return d?new Uint8Array(o().slice(d,d+this.structInfo.sizeof)):null},X=_(d=>N+d+W),te=function(d,I,F=!0){let R=d.members[I];if(!R&&(N||W)){for(const $ of Object.values(d.members))if($.key===I){R=$;break}!R&&F&&r(y(d.name,I),"is not a mapped struct member.")}return R},oe=function d(I,F,R=!1){d._||(d._=ie=>ie.replace(/[^vipPsjrdcC]/g,"").replace(/[pPscC]/g,"i"));const $=te(I.structInfo,F,!0);return R?d._($.signature):$.signature},se={configurable:!1,enumerable:!1,get:function(){return f.get(this)},set:()=>r("Cannot assign the 'pointer' property of a struct.")},ne=_(function(){const d=[];for(const I of Object.keys(this.structInfo.members))d.push(this.memberKey(I));return d}),ue=new TextDecoder("utf-8"),pe=new TextEncoder,me=typeof SharedArrayBuffer>"u"?function(){}:SharedArrayBuffer,be=function(d,I,F){return ue.decode(d.buffer instanceof me?d.slice(I,F):d.subarray(I,F))},Ee=function(d,I,F=!1){const R=te(d.structInfo,I,F);return R&&R.signature.length===1&&R.signature[0]==="s"?R:!1},T=function(d){d.signature!=="s"&&r("Invalid member type signature for C-string value:",JSON.stringify(d))},B=function(I,F){const R=te(I.structInfo,F,!0);T(R);const $=I[R.key];if(!$)return null;let ie=$;const _e=o();for(;_e[ie]!==0;++ie);return $===ie?"":be(_e,$,ie)},U=function(d,...I){d.ondispose?Array.isArray(d.ondispose)||(d.ondispose=[d.ondispose]):d.ondispose=[],d.ondispose.push(...I)},G=function(d){const I=pe.encode(d),F=h(I.length+1);F||r("Allocation error while duplicating string:",d);const R=o();return R.set(I,F),R[F+I.length]=0,F},V=function(d,I,F){const R=te(d.structInfo,I,!0);T(R);const $=G(F);return d[R.key]=$,U(d,$),d},Z=function(I,F){arguments[2]!==_&&r("Do not call the StructType constructor","from client-level code."),Object.defineProperties(this,{structName:_(I),structInfo:_(F)})};Z.prototype=Object.create(null,{dispose:_(function(){l(this.constructor,this)}),lookupMember:_(function(d,I=!0){return te(this.structInfo,d,I)}),memberToJsString:_(function(d){return B(this,d)}),memberIsString:_(function(d,I=!0){return Ee(this,d,I)}),memberKey:X,memberKeys:ne,memberSignature:_(function(d,I=!1){return oe(this,d,I)}),memoryDump:_(k),pointer:se,setMemberCString:_(function(d,I){return V(this,d,I)})}),Object.assign(Z.prototype,{addOnDispose:function(...d){return U(this,...d),this}}),Object.defineProperties(Z,{allocCString:_(G),isA:_(d=>d instanceof Z),hasExternalPointer:_(d=>d instanceof Z&&!!d[m]),memberKey:X});const ee=d=>Number.isFinite(d)||d instanceof(P||Number),C=function d(I,F,R){if(!d._){d._={getters:{},setters:{},sw:{}};const xe=["i","c","C","p","P","s","f","d","v()"];H&&xe.push("j"),xe.forEach(function(ke){d._.getters[ke]=K(ke),d._.setters[ke]=c(ke),d._.sw[ke]=p(ke)});const nr=/^[ipPsjfdcC]$/,rr=/^[vipPsjfdcC]\([ipPsjfdcC]*\)$/;d.sigCheck=function(ke,sr,Dt,mt){Object.prototype.hasOwnProperty.call(ke,Dt)&&r(ke.structName,"already has a property named",Dt+"."),nr.test(mt)||rr.test(mt)||r("Malformed signature for",y(ke.structName,sr)+":",mt)}}const $=I.memberKey(F);d.sigCheck(I.prototype,F,$,R.signature),R.key=$,R.name=F;const ie=D(R.signature),_e=y(I.prototype.structName,$),he=I.prototype.debugFlags.__flags,Pe=Object.create(null);Pe.configurable=!1,Pe.enumerable=!1,Pe.get=function(){he.getter&&O("debug.getter:",d._.getters[ie],"for",A(ie),_e,"@",this.pointer,"+",R.offset,"sz",R.sizeof);let xe=new DataView(o().buffer,this.pointer+R.offset,R.sizeof)[d._.getters[ie]](0,w);return he.getter&&O("debug.getter:",_e,"result =",xe),xe},R.readOnly?Pe.set=z(I.prototype.structName,$):Pe.set=function(xe){if(he.setter&&O("debug.setter:",d._.setters[ie],"for",A(ie),_e,"@",this.pointer,"+",R.offset,"sz",R.sizeof,xe),this.pointer||r("Cannot set struct property on disposed instance."),xe===null)xe=0;else for(;!ee(xe);){if(M(R.signature)&&xe instanceof Z){xe=xe.pointer||0,he.setter&&O("debug.setter:",_e,"resolved to",xe);break}r("Invalid value for pointer-type",_e+".")}new DataView(o().buffer,this.pointer+R.offset,R.sizeof)[d._.setters[ie]](0,d._.sw[ie](xe),w)}
2,Object.defineProperty(I.prototype,$,Pe)},E=function d(I,F){arguments.length===1?(F=I,I=F.name):F.name||(F.name=I),I||r("Struct name is required.");let R=!1;Object.keys(F.members).forEach(_e=>{const he=F.members[_e];he.sizeof?he.sizeof===1?he.signature==="c"||he.signature==="C"||r("Unexpected sizeof==1 member",y(F.name,_e),"with signature",he.signature):(he.sizeof%4!==0&&(console.warn("Invalid struct member description =",he,"from",F),r(I,"member",_e,"sizeof is not aligned. sizeof="+he.sizeof)),he.offset%4!==0&&(console.warn("Invalid struct member description =",he,"from",F),r(I,"member",_e,"offset is not aligned. offset="+he.offset))):r(I,"member",_e,"is missing sizeof."),(!R||R.offset<he.offset)&&(R=he)}),R?F.sizeof<R.offset+R.sizeof&&r("Invalid struct config:",I,"max member offset ("+R.offset+") ","extends past end of struct (sizeof="+F.sizeof+")."):r("No member property descriptions found.");const $=_(s.__makeDebugFlags(d.debugFlags)),ie=function _e(he){this instanceof _e?arguments.length?((he!==(he|0)||he<=0)&&r("Invalid pointer value for",I,"constructor."),u(_e,this,he)):u(_e,this):r("The",I,"constructor may only be called via 'new'.")};return Object.defineProperties(ie,{debugFlags:$,isA:_(_e=>_e instanceof ie),memberKey:X,memberKeys:ne,methodInfoForKey:_(function(_e){}),structInfo:_(F),structName:_(I)}),ie.prototype=new Z(I,F,_),Object.defineProperties(ie.prototype,{debugFlags:$,constructor:_(ie)}),Object.keys(F.members).forEach(_e=>C(ie,_e,F.members[_e])),ie};return E.StructType=Z,E.config=n,E.allocCString=G,E.debugFlags||(E.debugFlags=s.__makeDebugFlags(s.debugFlags)),E},globalThis.sqlite3ApiBootstrap.initializers.push(function(t){const n=(...b)=>{throw new Error(b.join(" "))};t.SQLite3Error.toss;const r=t.capi,s=t.wasm,o=t.util;if(globalThis.WhWasmUtilInstaller(s),delete globalThis.WhWasmUtilInstaller,s.bindingSignatures=[["sqlite3_aggregate_context","void*","sqlite3_context*","int"],["sqlite3_bind_double","int","sqlite3_stmt*","int","f64"],["sqlite3_bind_int","int","sqlite3_stmt*","int","int"],["sqlite3_bind_null",void 0,"sqlite3_stmt*","int"],["sqlite3_bind_parameter_count","int","sqlite3_stmt*"],["sqlite3_bind_parameter_index","int","sqlite3_stmt*","string"],["sqlite3_bind_parameter_name","string","sqlite3_stmt*","int"],["sqlite3_bind_pointer","int","sqlite3_stmt*","int","*","string:static","*"],["sqlite3_busy_handler","int",["sqlite3*",new s.xWrap.FuncPtrAdapter({signature:"i(pi)",contextKey:(b,w)=>b[0]}),"*"]],["sqlite3_busy_timeout","int","sqlite3*","int"],["sqlite3_changes","int","sqlite3*"],["sqlite3_clear_bindings","int","sqlite3_stmt*"],["sqlite3_collation_needed","int","sqlite3*","*","*"],["sqlite3_column_blob","*","sqlite3_stmt*","int"],["sqlite3_column_bytes","int","sqlite3_stmt*","int"],["sqlite3_column_count","int","sqlite3_stmt*"],["sqlite3_column_decltype","string","sqlite3_stmt*","int"],["sqlite3_column_double","f64","sqlite3_stmt*","int"],["sqlite3_column_int","int","sqlite3_stmt*","int"],["sqlite3_column_name","string","sqlite3_stmt*","int"],["sqlite3_column_text","string","sqlite3_stmt*","int"],["sqlite3_column_type","int","sqlite3_stmt*","int"],["sqlite3_column_value","sqlite3_value*","sqlite3_stmt*","int"],["sqlite3_commit_hook","void*",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"sqlite3_commit_hook",signature:"i(p)",contextKey:b=>b[0]}),"*"]],["sqlite3_compileoption_get","string","int"],["sqlite3_compileoption_used","int","string"],["sqlite3_complete","int","string:flexible"],["sqlite3_context_db_handle","sqlite3*","sqlite3_context*"],["sqlite3_data_count","int","sqlite3_stmt*"],["sqlite3_db_filename","string","sqlite3*","string"],["sqlite3_db_handle","sqlite3*","sqlite3_stmt*"],["sqlite3_db_name","string","sqlite3*","int"],["sqlite3_db_readonly","int","sqlite3*","string"],["sqlite3_db_status","int","sqlite3*","int","*","*","int"],["sqlite3_errcode","int","sqlite3*"],["sqlite3_errmsg","string","sqlite3*"],["sqlite3_error_offset","int","sqlite3*"],["sqlite3_errstr","string","int"],["sqlite3_exec","int",["sqlite3*","string:flexible",new s.xWrap.FuncPtrAdapter({signature:"i(pipp)",bindScope:"transient",callProxy:b=>{let w;return(S,M,D,A)=>{try{const L=s.cArgvToJs(M,D);return w||(w=s.cArgvToJs(M,A)),b(L,w)|0}catch(L){return L.resultCode||r.SQLITE_ERROR}}}}),"*","**"]],["sqlite3_expanded_sql","string","sqlite3_stmt*"],["sqlite3_extended_errcode","int","sqlite3*"],["sqlite3_extended_result_co
2des","int","sqlite3*","int"],["sqlite3_file_control","int","sqlite3*","string","int","*"],["sqlite3_finalize","int","sqlite3_stmt*"],["sqlite3_free",void 0,"*"],["sqlite3_get_autocommit","int","sqlite3*"],["sqlite3_get_auxdata","*","sqlite3_context*","int"],["sqlite3_initialize",void 0],["sqlite3_interrupt",void 0,"sqlite3*"],["sqlite3_is_interrupted","int","sqlite3*"],["sqlite3_keyword_count","int"],["sqlite3_keyword_name","int",["int","**","*"]],["sqlite3_keyword_check","int",["string","int"]],["sqlite3_libversion","string"],["sqlite3_libversion_number","int"],["sqlite3_limit","int",["sqlite3*","int","int"]],["sqlite3_malloc","*","int"],["sqlite3_open","int","string","*"],["sqlite3_open_v2","int","string","*","int","string"],["sqlite3_realloc","*","*","int"],["sqlite3_reset","int","sqlite3_stmt*"],["sqlite3_result_blob",void 0,"sqlite3_context*","*","int","*"],["sqlite3_result_double",void 0,"sqlite3_context*","f64"],["sqlite3_result_error",void 0,"sqlite3_context*","string","int"],["sqlite3_result_error_code",void 0,"sqlite3_context*","int"],["sqlite3_result_error_nomem",void 0,"sqlite3_context*"],["sqlite3_result_error_toobig",void 0,"sqlite3_context*"],["sqlite3_result_int",void 0,"sqlite3_context*","int"],["sqlite3_result_null",void 0,"sqlite3_context*"],["sqlite3_result_pointer",void 0,"sqlite3_context*","*","string:static","*"],["sqlite3_result_subtype",void 0,"sqlite3_value*","int"],["sqlite3_result_text",void 0,"sqlite3_context*","string","int","*"],["sqlite3_result_zeroblob",void 0,"sqlite3_context*","int"],["sqlite3_rollback_hook","void*",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"sqlite3_rollback_hook",signature:"v(p)",contextKey:b=>b[0]}),"*"]],["sqlite3_set_auxdata",void 0,["sqlite3_context*","int","*","*"]],["sqlite3_shutdown",void 0],["sqlite3_sourceid","string"],["sqlite3_sql","string","sqlite3_stmt*"],["sqlite3_status","int","int","*","*","int"],["sqlite3_step","int","sqlite3_stmt*"],["sqlite3_stmt_busy","int","sqlite3_stmt*"],["sqlite3_stmt_readonly","int","sqlite3_stmt*"],["sqlite3_stmt_status","int","sqlite3_stmt*","int","int"],["sqlite3_strglob","int","string","string"],["sqlite3_stricmp","int","string","string"],["sqlite3_strlike","int","string","string","int"],["sqlite3_strnicmp","int","string","string","int"],["sqlite3_table_column_metadata","int","sqlite3*","string","string","string","**","**","*","*","*"],["sqlite3_total_changes","int","sqlite3*"],["sqlite3_trace_v2","int",["sqlite3*","int",new s.xWrap.FuncPtrAdapter({name:"sqlite3_trace_v2::callback",signature:"i(ippp)",contextKey:(b,w)=>b[0]}),"*"]],["sqlite3_txn_state","int",["sqlite3*","string"]],["sqlite3_uri_boolean","int","sqlite3_filename","string","int"],["sqlite3_uri_key","string","sqlite3_filename","int"],["sqlite3_uri_parameter","string","sqlite3_filename","string"],["sqlite3_user_data","void*","sqlite3_context*"],["sqlite3_value_blob","*","sqlite3_value*"],["sqlite3_value_bytes","int","sqlite3_value*"],["sqlite3_value_double","f64","sqlite3_value*"],["sqlite3_value_dup","sqlite3_value*","sqlite3_value*"],["sqlite3_value_free",void 0,"sqlite3_value*"],["sqlite3_value_frombind","int","sqlite3_value*"],["sqlite3_value_int","int","sqlite3_value*"],["sqlite3_value_nochange","int","sqlite3_value*"],["sqlite3_value_numeric_type","int","sqlite3_value*"],["sqlite3_value_pointer","*","sqlite3_value*","string:static"],["sqlite3_value_subtype","int","sqlite3_value*"],["sqlite3_value_text","string","sqlite3_value*"],["sqlite3_value_type","int","sqlite3_value*"],["sqlite3_vfs_find","*","string"],["sqlite3_vfs_register","int","sqlite3_vfs*","int"],["sqlite3_vfs_unregister","int","sqlite3_vfs*"]],s.exports.sqlite3_progress_handler&&s.bindingSignatures.push(["sqlite3_progress_handler",void 0,["sqlite3*","int",new s.xWrap.FuncPtrAdapter({name:"xProgressHandler",signature:"i(p)",bindScope:"context",contextKey:(b,w)=>b[0]}),"*"]]),s.exports.sqlite3_stmt_explain&&s.bindingSignatures.push(["sqlite3_stmt_explain","int","sqlite3_stmt*","int"],["sqlite3_stmt_isexplain","int","sqlite3_stmt*"]),s.exports.sqlite3_set_authorizer&&s.bindingSignatures.push(["sqlite3_set_authorizer","int",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"sqlite3_set_authorizer::xAuth",signature:"i(pissss)",contextKey:(b,w)=>b[0],callProxy:b=>(w,S,M,D,A,L)=>{try{return M=M&&s.cstrToJs(M),D=D&&s.cstrToJs(D),A=A&&s.cstrToJs(A),L=L&&s.cstrToJs(L),b(w,S,M,D,A,L)||0}catch(K){return K.resultCode||r.SQLITE_ERROR}}}),"*"]]),s.bindingSignatures.int64=[["sqlite3_bind_int64","int",["sqlite3_stmt*","int","i64"]],["sqlite3_changes64","
2i64",["sqlite3*"]],["sqlite3_column_int64","i64",["sqlite3_stmt*","int"]],["sqlite3_deserialize","int","sqlite3*","string","*","i64","i64","int"],["sqlite3_last_insert_rowid","i64",["sqlite3*"]],["sqlite3_malloc64","*","i64"],["sqlite3_msize","i64","*"],["sqlite3_overload_function","int",["sqlite3*","string","int"]],["sqlite3_realloc64","*","*","i64"],["sqlite3_result_int64",void 0,"*","i64"],["sqlite3_result_zeroblob64","int","*","i64"],["sqlite3_serialize","*","sqlite3*","string","*","int"],["sqlite3_set_last_insert_rowid",void 0,["sqlite3*","i64"]],["sqlite3_status64","int","int","*","*","int"],["sqlite3_total_changes64","i64",["sqlite3*"]],["sqlite3_update_hook","*",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"sqlite3_update_hook",signature:"v(iippj)",contextKey:b=>b[0],callProxy:b=>(w,S,M,D,A)=>{b(w,S,s.cstrToJs(M),s.cstrToJs(D),A)}}),"*"]],["sqlite3_uri_int64","i64",["sqlite3_filename","string","i64"]],["sqlite3_value_int64","i64","sqlite3_value*"]],s.bigIntEnabled&&s.exports.sqlite3_declare_vtab&&s.bindingSignatures.int64.push(["sqlite3_create_module","int",["sqlite3*","string","sqlite3_module*","*"]],["sqlite3_create_module_v2","int",["sqlite3*","string","sqlite3_module*","*","*"]],["sqlite3_declare_vtab","int",["sqlite3*","string:flexible"]],["sqlite3_drop_modules","int",["sqlite3*","**"]],["sqlite3_vtab_collation","string","sqlite3_index_info*","int"],["sqlite3_vtab_distinct","int","sqlite3_index_info*"],["sqlite3_vtab_in","int","sqlite3_index_info*","int","int"],["sqlite3_vtab_in_first","int","sqlite3_value*","**"],["sqlite3_vtab_in_next","int","sqlite3_value*","**"],["sqlite3_vtab_nochange","int","sqlite3_context*"],["sqlite3_vtab_on_conflict","int","sqlite3*"],["sqlite3_vtab_rhs_value","int","sqlite3_index_info*","int","**"]),s.bigIntEnabled&&s.exports.sqlite3_preupdate_hook&&s.bindingSignatures.int64.push(["sqlite3_preupdate_blobwrite","int","sqlite3*"],["sqlite3_preupdate_count","int","sqlite3*"],["sqlite3_preupdate_depth","int","sqlite3*"],["sqlite3_preupdate_hook","*",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"sqlite3_preupdate_hook",signature:"v(ppippjj)",contextKey:b=>b[0],callProxy:b=>(w,S,M,D,A,L,K)=>{b(w,S,M,s.cstrToJs(D),s.cstrToJs(A),L,K)}}),"*"]],["sqlite3_preupdate_new","int",["sqlite3*","int","**"]],["sqlite3_preupdate_old","int",["sqlite3*","int","**"]]),s.bigIntEnabled&&s.exports.sqlite3changegroup_add&&s.exports.sqlite3session_create&&s.exports.sqlite3_preupdate_hook){const b={signature:"i(ps)",callProxy:w=>(S,M)=>{try{return w(S,s.cstrToJs(M))|0}catch(D){return D.resultCode||r.SQLITE_ERROR}}};s.bindingSignatures.int64.push(["sqlite3changegroup_add","int",["sqlite3_changegroup*","int","void*"]],["sqlite3changegroup_add_strm","int",["sqlite3_changegroup*",new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changegroup_delete",void 0,["sqlite3_changegroup*"]],["sqlite3changegroup_new","int",["**"]],["sqlite3changegroup_output","int",["sqlite3_changegroup*","int*","**"]],["sqlite3changegroup_output_strm","int",["sqlite3_changegroup*",new s.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply","int",["sqlite3*","int","void*",new s.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...b}),new s.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_strm","int",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new s.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...b}),new s.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_v2","int",["sqlite3*","int","void*",new s.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...b}),new s.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_apply_v2_strm","int",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new s.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...b}
2),new s.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_concat","int",["int","void*","int","void*","int*","**"]],["sqlite3changeset_concat_strm","int",[new s.xWrap.FuncPtrAdapter({name:"xInputA",signature:"i(ppp)",bindScope:"transient"}),"void*",new s.xWrap.FuncPtrAdapter({name:"xInputB",signature:"i(ppp)",bindScope:"transient"}),"void*",new s.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_conflict","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_finalize","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_fk_conflicts","int",["sqlite3_changeset_iter*","int*"]],["sqlite3changeset_invert","int",["int","void*","int*","**"]],["sqlite3changeset_invert_strm","int",[new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new s.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_new","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_next","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_old","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_op","int",["sqlite3_changeset_iter*","**","int*","int*","int*"]],["sqlite3changeset_pk","int",["sqlite3_changeset_iter*","**","int*"]],["sqlite3changeset_start","int",["**","int","*"]],["sqlite3changeset_start_strm","int",["**",new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changeset_start_v2","int",["**","int","*","int"]],["sqlite3changeset_start_v2_strm","int",["**",new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*","int"]],["sqlite3session_attach","int",["sqlite3_session*","string"]],["sqlite3session_changeset","int",["sqlite3_session*","int*","**"]],["sqlite3session_changeset_size","i64",["sqlite3_session*"]],["sqlite3session_changeset_strm","int",["sqlite3_session*",new s.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_config","int",["int","void*"]],["sqlite3session_create","int",["sqlite3*","string","**"]],["sqlite3session_diff","int",["sqlite3_session*","string","string","**"]],["sqlite3session_enable","int",["sqlite3_session*","int"]],["sqlite3session_indirect","int",["sqlite3_session*","int"]],["sqlite3session_isempty","int",["sqlite3_session*"]],["sqlite3session_memory_used","i64",["sqlite3_session*"]],["sqlite3session_object_config","int",["sqlite3_session*","int","void*"]],["sqlite3session_patchset","int",["sqlite3_session*","*","**"]],["sqlite3session_patchset_strm","int",["sqlite3_session*",new s.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_table_filter",void 0,["sqlite3_session*",new s.xWrap.FuncPtrAdapter({name:"xFilter",...b,contextKey:(w,S)=>w[0]}),"*"]])}s.bindingSignatures.wasmInternal=[["sqlite3__wasm_db_reset","int","sqlite3*"],["sqlite3__wasm_db_vfs","sqlite3_vfs*","sqlite3*","string"],["sqlite3__wasm_vfs_create_file","int","sqlite3_vfs*","string","*","int"],["sqlite3__wasm_posix_create_file","int","string","*","int"],["sqlite3__wasm_vfs_unlink","int","sqlite3_vfs*","string"],["sqlite3__wasm_qfmt_token","string:dealloc","string","int"]],t.StructBinder=globalThis.Jaccwabyt({heap:s.heap8u,alloc:s.alloc,dealloc:s.dealloc,bigIntEnabled:s.bigIntEnabled,memberPrefix:"$"}),delete globalThis.Jaccwabyt;{const b=s.xWrap.argAdapter("string");s.xWrap.argAdapter("string:flexible",A=>b(o.flexibleString(A))),s.xWrap.argAdapter("string:static",function(A){return s.isPtr(A)?A:(A=""+A,this[A]||(this[A]=s.allocCString(A)))}.bind(Object.create(null)));const w=s.xWrap.argAdapter("*"),S=function(){};s.xWrap.argAdapter("sqlite3_filename",w)("sqlite3_context*",w)("sqlite3_value*",w)("void*",w)("sqlite3_changegroup*",w)("sqlite3_changeset_iter*",w)("sqlite3_session*",w)("sqlite3_stmt*",A=>w(A instanceof(t?.oo1?.Stmt||S)?A.pointer:A))("sqlite3*",A=>w(A instanceof(t?.oo1?.DB||S)?A.pointer:A))("sqlite3_vfs*",A=>typeof A=="string"?r.sqlite3_vfs_find(A)||t.SQLite3Error.toss(r.SQLITE_NOTFOUND,"Unknown sqlite3_vfs name:",A):w(A instanceof(r.sqlite3_vfs||S)?A.pointer:A)),s.exports.sqlite3_declare_vtab&&s.xWrap.argAdapter("sqlite3_index_info*",A=>w(A instanceof(r.sqlite3_index_info||S)?A.pointer:A))("sqlite3_module*",A=>w(A instanceof(r.sqlite3_module||S)?A.pointer:A));const M=s.xWrap.resultAdapter("*");s.xWrap.resultAdapter("sqlite3*",M)("sqlite3_context*",M)("sqlite3_stmt*",M)("sqlite3_value*",M)("sqlite3_vfs*",M)("void*",M),s.exports.sqlite3_step.length===0&&(s.xWrap.doArgcCheck=!1,t.config.warn("Disabling sqlite3.wasm.xWrap.doArgcCheck due to environmental quirks."));for(const A of s.bindingSignatures)r[A[0]]=s.xWrap.apply(null,A);for(const A of s.bindingSignatures.wasmInternal)o[A[0]]=s.xWrap.apply(null,A);const D=function(A){return()=>n(A+"() is unavailable due to lack","of BigInt support in this build.")};for(const A of s.bindingSignatures.int64)r[A[0]]=s.bigIntEnabled?s.xWrap.apply(null,A):D(A[0]);if(delete s.bindingSignatures,s.exports.sqlite3__wasm_db_error){const A=s.xWrap("sqlite3__wasm_db_error","int","sqlite3*","int","string");o.sqlite3__wasm_db_error=function(L,K,c){return K instanceof t.WasmAllocError?(K=r.SQLITE_NOMEM,c=0):K instanceof Error&&(c=c||""+K,K=K.resultCode||r.SQLITE_ERROR),L?A(L,K,c):K}}else o.sqlite3__wasm_db_error=function(A,L,K){return console.warn("sqlite3__wasm_db_error() is not exported.",arguments),L}}{const b=s.xCall("sqlite3__wasm_enum_json");b||n("Maintenance required: increase sqlite3__wasm_enum_json()'s","static buffer size!"),s.ctype=JSON.parse(s.cstrToJs(b));const w=["access","authorizer","blobFinalizers","changeset","config","dataTypes","dbConfig","dbStatus","encodings","fcntl","flock","ioCap","limits","openFlags","prepareFlags","resultCodes","sqlite3Status","stmtStatus","syncFlags","trace","txnState","udfFlags","version"];s.bigIntEnabled&&w.push("serialize","session","vtab");
2for(const D of w)for(const A of Object.entries(s.ctype[D]))r[A[0]]=A[1];s.functionEntry(r.SQLITE_WASM_DEALLOC)||n("Internal error: cannot resolve exported function","entry SQLITE_WASM_DEALLOC (=="+r.SQLITE_WASM_DEALLOC+").");const S=Object.create(null);for(const D of["resultCodes"])for(const A of Object.entries(s.ctype[D]))S[A[1]]=A[0];r.sqlite3_js_rc_str=D=>S[D];const M=Object.assign(Object.create(null),{WasmTestStruct:!0,sqlite3_kvvfs_methods:!o.isUIThread(),sqlite3_index_info:!s.bigIntEnabled,sqlite3_index_constraint:!s.bigIntEnabled,sqlite3_index_orderby:!s.bigIntEnabled,sqlite3_index_constraint_usage:!s.bigIntEnabled});for(const D of s.ctype.structs)M[D.name]||(r[D.name]=t.StructBinder(D));if(r.sqlite3_index_info){for(const D of["sqlite3_index_constraint","sqlite3_index_orderby","sqlite3_index_constraint_usage"])r.sqlite3_index_info[D]=r[D],delete r[D];r.sqlite3_vtab_config=s.xWrap("sqlite3__wasm_vtab_config","int",["sqlite3*","int","int"])}}const h=(b,w,S)=>o.sqlite3__wasm_db_error(b,r.SQLITE_MISUSE,w+"() requires "+S+" argument"+(S===1?"":"s")+"."),q=b=>o.sqlite3__wasm_db_error(b,r.SQLITE_FORMAT,"SQLITE_UTF8 is the only supported encoding."),O=b=>s.xWrap.argAdapter("sqlite3*")(b),N=b=>s.isPtr(b)?s.cstrToJs(b):b,W=function(b,w){b=O(b);let S=this.dbMap.get(b);if(w)!S&&w>0&&this.dbMap.set(b,S=Object.create(null));else return this.dbMap.delete(b),S;return S}.bind(Object.assign(Object.create(null),{dbMap:new Map}));W.addCollation=function(b,w){const S=W(b,1);S.collation||(S.collation=new Set),S.collation.add(N(w).toLowerCase())},W._addUDF=function(b,w,S,M){w=N(w).toLowerCase();let D=M.get(w);D||M.set(w,D=new Set),D.add(S<0?-1:S)},W.addFunction=function(b,w,S){const M=W(b,1);M.udf||(M.udf=new Map),this._addUDF(b,w,S,M.udf)},s.exports.sqlite3_create_window_function&&(W.addWindowFunc=function(b,w,S){const M=W(b,1);M.wudf||(M.wudf=new Map),this._addUDF(b,w,S,M.wudf)}),W.cleanup=function(b){b=O(b);const w=[b];for(const D of["sqlite3_busy_handler","sqlite3_commit_hook","sqlite3_preupdate_hook","sqlite3_progress_handler","sqlite3_rollback_hook","sqlite3_set_authorizer","sqlite3_trace_v2","sqlite3_update_hook"]){const A=s.exports[D];if(A){w.length=A.length;try{r[D](...w)}catch(L){t.config.warn("close-time call of",D+"(",w,") threw:",L)}}}const S=W(b,0);if(!S)return;if(S.collation){for(const D of S.collation)try{r.sqlite3_create_collation_v2(b,D,r.SQLITE_UTF8,0,0,0)}catch{}delete S.collation}let M;for(M=0;M<2;++M){const D=M?S.wudf:S.udf;if(!D)continue;const A=M?r.sqlite3_create_window_function:r.sqlite3_create_function_v2;for(const L of D){const K=L[0],c=L[1],p=[b,K,0,r.SQLITE_UTF8,0,0,0,0,0];M&&p.push(0);for(const y of c)try{p[2]=y,A.apply(null,p)}catch{}c.clear()}D.clear()}delete S.udf,delete S.wudf};{const b=s.xWrap("sqlite3_close_v2","int","sqlite3*");r.sqlite3_close_v2=function(w){if(arguments.length!==1)return h(w,"sqlite3_close_v2",1);if(w)try{W.cleanup(w)}catch{}return b(w)}}if(r.sqlite3session_create){const b=s.xWrap("sqlite3session_delete",void 0,["sqlite3_session*"]);r.sqlite3session_delete=function(w){if(arguments.length!==1)return h(pDb,"sqlite3session_delete",1);w&&r.sqlite3session_table_filter(w,0,0),b(w)}}{const b=(S,M)=>"argv["+M+"]:"+S[0]+":"+s.cstrToJs(S[1]).toLowerCase(),w=s.xWrap("sqlite3_create_collation_v2","int",["sqlite3*","string","int","*",new s.xWrap.FuncPtrAdapter({name:"xCompare",signature:"i(pipip)",contextKey:b}),new s.xWrap.FuncPtrAdapter({name:"xDestroy",signature:"v(p)",contextKey:b})]);r.sqlite3_create_collation_v2=function(S,M,D,A,L,K){if(arguments.length!==6)return h(S,"sqlite3_create_collation_v2",6);if((D&15)===0)D|=r.SQLITE_UTF8;else if(r.SQLITE_UTF8!==(D&15))return q(S);try{const c=w(S,M,D,A,L,K);return c===0&&L instanceof Function&&W.addCollation(S,M),c}catch(c){return o.sqlite3__wasm_db_error(S,c)}},r.sqlite3_create_collation=(S,M,D,A,L)=>arguments.length===5?r.sqlite3_create_collation_v2(S,M,D,A,L,0):h(S,"sqlite3_create_collation",5)}{const b=function(D,A){return D[0]+":"+(D[2]<0?-1:D[2])+":"+A+":"+s.cstrToJs(D[1]).toLowerCase()},w=Object.assign(Object.create(null),{xInverseAndStep:{signature:"v(pip)",contextKey:b,callProxy:D=>(A,L,K)=>
2{try{D(A,...r.sqlite3_values_to_js(L,K))}catch(c){r.sqlite3_result_error_js(A,c)}}},xFinalAndValue:{signature:"v(p)",contextKey:b,callProxy:D=>A=>{try{r.sqlite3_result_js(A,D(A))}catch(L){r.sqlite3_result_error_js(A,L)}}},xFunc:{signature:"v(pip)",contextKey:b,callProxy:D=>(A,L,K)=>{try{r.sqlite3_result_js(A,D(A,...r.sqlite3_values_to_js(L,K)))}catch(c){r.sqlite3_result_error_js(A,c)}}},xDestroy:{signature:"v(p)",contextKey:b,callProxy:D=>A=>{try{D(A)}catch(L){console.error("UDF xDestroy method threw:",L)}}}}),S=s.xWrap("sqlite3_create_function_v2","int",["sqlite3*","string","int","int","*",new s.xWrap.FuncPtrAdapter({name:"xFunc",...w.xFunc}),new s.xWrap.FuncPtrAdapter({name:"xStep",...w.xInverseAndStep}),new s.xWrap.FuncPtrAdapter({name:"xFinal",...w.xFinalAndValue}),new s.xWrap.FuncPtrAdapter({name:"xDestroy",...w.xDestroy})]),M=s.exports.sqlite3_create_window_function?s.xWrap("sqlite3_create_window_function","int",["sqlite3*","string","int","int","*",new s.xWrap.FuncPtrAdapter({name:"xStep",...w.xInverseAndStep}),new s.xWrap.FuncPtrAdapter({name:"xFinal",...w.xFinalAndValue}),new s.xWrap.FuncPtrAdapter({name:"xValue",...w.xFinalAndValue}),new s.xWrap.FuncPtrAdapter({name:"xInverse",...w.xInverseAndStep}),new s.xWrap.FuncPtrAdapter({name:"xDestroy",...w.xDestroy})]):void 0;r.sqlite3_create_function_v2=function D(A,L,K,c,p,y,z,f,m){if(D.length!==arguments.length)return h(A,"sqlite3_create_function_v2",D.length);if((c&15)===0)c|=r.SQLITE_UTF8;else if(r.SQLITE_UTF8!==(c&15))return q(A);try{const l=S(A,L,K,c,p,y,z,f,m);return l===0&&(y instanceof Function||z instanceof Function||f instanceof Function||m instanceof Function)&&W.addFunction(A,L,K),l}catch(l){return console.error("sqlite3_create_function_v2() setup threw:",l),o.sqlite3__wasm_db_error(A,l,"Creation of UDF threw: "+l)}},r.sqlite3_create_function=function D(A,L,K,c,p,y,z,f){return D.length===arguments.length?r.sqlite3_create_function_v2(A,L,K,c,p,y,z,f,0):h(A,"sqlite3_create_function",D.length)},M?r.sqlite3_create_window_function=function D(A,L,K,c,p,y,z,f,m,l){if(D.length!==arguments.length)return h(A,"sqlite3_create_window_function",D.length);if((c&15)===0)c|=r.SQLITE_UTF8;else if(r.SQLITE_UTF8!==(c&15))return q(A);try{const _=M(A,L,K,c,p,y,z,f,m,l);return _===0&&(y instanceof Function||z instanceof Function||f instanceof Function||m instanceof Function||l instanceof Function)&&W.addWindowFunc(A,L,K),_}catch(_){return console.error("sqlite3_create_window_function() setup threw:",_),o.sqlite3__wasm_db_error(A,_,"Creation of UDF threw: "+_)}}:delete r.sqlite3_create_window_function,r.sqlite3_create_function_v2.udfSetResult=r.sqlite3_create_function.udfSetResult=r.sqlite3_result_js,r.sqlite3_create_window_function&&(r.sqlite3_create_window_function.udfSetResult=r.sqlite3_result_js),r.sqlite3_create_function_v2.udfConvertArgs=r.sqlite3_create_function.udfConvertArgs=r.sqlite3_values_to_js,r.sqlite3_create_window_function&&(r.sqlite3_create_window_function.udfConvertArgs=r.sqlite3_values_to_js),r.sqlite3_create_function_v2.udfSetError=r.sqlite3_create_function.udfSetError=r.sqlite3_result_error_js,r.sqlite3_create_window_function&&(r.sqlite3_create_window_function.udfSetError=r.sqlite3_result_error_js)}{const b=(S,M)=>(typeof S=="string"?M=-1:o.isSQLableTypedArray(S)?(M=S.byteLength,S=o.typedArrayToString(S instanceof ArrayBuffer?new Uint8Array(S):S)):Array.isArray(S)&&(S=S.join(""),M=-1),[S,M]),w={basic:s.xWrap("sqlite3_prepare_v3","int",["sqlite3*","string","int","int","**","**"]),full:s.xWrap("sqlite3_prepare_v3","int",["sqlite3*","*","int","int","**","**"])};r.sqlite3_prepare_v3=function S(M,D,A,L,K,c){if(S.length!==arguments.length)return h(M,"sqlite3_prepare_v3",S.length);const[p,y]=b(D,A);switch(typeof p){case"string":return w.basic(M,p,y,L,K,null);case"number":return w.full(M,p,y,L,K,c);default:return o.sqlite3__wasm_db_error(M,r.SQLITE_MISUSE,"Invalid SQL argument type for sqlite3_prepare_v2/v3().")}},r.sqlite3_prepare_v2=function S(M,D,A,L,K){return S.length===arguments.length?r.sqlite3_prepare_v3(M,D,A,0,L,K):h(M,"sqlite3_prepare_v2",S.length)}}{const b=s.xWrap("sqlite3_bind_text","int",["sqlite3_stmt*","int","string","int","*"]),w=s.xWrap("sqlite3_bind_blob","int",["sqlite3_stmt*","int","*","int","*"]);r.sqlite3_bind_text=function S(M,D,A,L,K){if(S.length!==arguments.length)return h(r.sqlite3_db_handle(M),"sqlite3_bind_text",S.length);if(s.isPtr(A)||A===null)return b(M,D,A,L,K);A instanceof ArrayBuffer?A=new Uint8Array(A):Array.isArray(pMem)&&(A=pMem.join(""));let c,p;try{if(o.isSQLableTypedArray(A))c=s.allocFromTypedArray(A),p=A.byteLength;else if(typeof A=="string")[c,p]=s.allocCString(A);else return o.sqlite3__wasm_db_error(r.sqlite3_db_handle(M),r.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_text().");return b(M,D,c,p,r.SQLITE_WASM_DEALLOC)}catch(y){return s.dealloc(c),o.sqlite3__wasm_db_error(r.sqlite3_db_handle(M),y)}},r.sqlite3_bind_blob=function S(M,D,A,L,K){if(S.length!==arguments.length)return h(r.sqlite3_db_handle(M),"sqlite3_bind_blob",S.length);if(s.isPtr(A)||A===null)return w(M,D,A,L,K);A instanceof ArrayBuffer?A=new Uint8Array(A):Array.isArray(A)&&(A=A.join(""));let c,p;try{if(o.isBindableTypedArray(A))c=s.allocFromTypedArray(A),p=L>=0?L:A.byteLength;else if(typeof A=="string")[c,p]=s.allocCString(A);else return o.sqlite3__wasm_db_error(r.sqlite3_db_handle(M),r.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_blob().");return w(M,D,c,p,r.SQLITE_WASM_DEALLOC)}catch(y){return s.dealloc(c),o.sqlite3__wasm_db_error(r.sqlite3_db_handle(M),y)}}}r.sqlite3_config=function(b,...w){if(arguments.length<2)return r.SQLITE_MISUSE;
2switch(b){case r.SQLITE_CONFIG_COVERING_INDEX_SCAN:case r.SQLITE_CONFIG_MEMSTATUS:case r.SQLITE_CONFIG_SMALL_MALLOC:case r.SQLITE_CONFIG_SORTERREF_SIZE:case r.SQLITE_CONFIG_STMTJRNL_SPILL:case r.SQLITE_CONFIG_URI:return s.exports.sqlite3__wasm_config_i(b,w[0]);case r.SQLITE_CONFIG_LOOKASIDE:return s.exports.sqlite3__wasm_config_ii(b,w[0],w[1]);case r.SQLITE_CONFIG_MEMDB_MAXSIZE:return s.exports.sqlite3__wasm_config_j(b,w[0]);case r.SQLITE_CONFIG_GETMALLOC:case r.SQLITE_CONFIG_GETMUTEX:case r.SQLITE_CONFIG_GETPCACHE2:case r.SQLITE_CONFIG_GETPCACHE:case r.SQLITE_CONFIG_HEAP:case r.SQLITE_CONFIG_LOG:case r.SQLITE_CONFIG_MALLOC:case r.SQLITE_CONFIG_MMAP_SIZE:case r.SQLITE_CONFIG_MULTITHREAD:case r.SQLITE_CONFIG_MUTEX:case r.SQLITE_CONFIG_PAGECACHE:case r.SQLITE_CONFIG_PCACHE2:case r.SQLITE_CONFIG_PCACHE:case r.SQLITE_CONFIG_PCACHE_HDRSZ:case r.SQLITE_CONFIG_PMASZ:case r.SQLITE_CONFIG_SERIALIZED:case r.SQLITE_CONFIG_SINGLETHREAD:case r.SQLITE_CONFIG_SQLLOG:case r.SQLITE_CONFIG_WIN32_HEAPSIZE:default:return r.SQLITE_NOTFOUND}};{const b=new Set;r.sqlite3_auto_extension=function(w){if(w instanceof Function)w=s.installFunction("i(ppp)",w);else if(arguments.length!==1||!s.isPtr(w))return r.SQLITE_MISUSE;const S=s.exports.sqlite3_auto_extension(w);return w!==arguments[0]&&(S===0?b.add(w):s.uninstallFunction(w)),S},r.sqlite3_cancel_auto_extension=function(w){return!w||arguments.length!==1||!s.isPtr(w)?0:s.exports.sqlite3_cancel_auto_extension(w)},r.sqlite3_reset_auto_extension=function(){s.exports.sqlite3_reset_auto_extension();for(const w of b)s.uninstallFunction(w);b.clear()}}const H=r.sqlite3_vfs_find("kvvfs");if(H)if(o.isUIThread()){const b=new r.sqlite3_kvvfs_methods(s.exports.sqlite3__wasm_kvvfs_methods());delete r.sqlite3_kvvfs_methods;const w=s.exports.sqlite3__wasm_kvvfsMakeKeyOnPstack,S=s.pstack,M=A=>s.peek(A)===115?sessionStorage:localStorage,D={xRead:(A,L,K,c)=>{const p=S.pointer,y=s.scopedAllocPush();try{const z=w(A,L);if(!z)return-3;const f=s.cstrToJs(z),m=M(A).getItem(f);if(!m)return-1;const l=m.length;if(c<=0)return l;if(c===1)return s.poke(K,0),l;const _=s.scopedAllocCString(m);return c>l+1&&(c=l+1),s.heap8u().copyWithin(K,_,_+c-1),s.poke(K+c-1,0),c-1}catch(z){return console.error("kvstorageRead()",z),-2}finally{S.restore(p),s.scopedAllocPop(y)}},xWrite:(A,L,K)=>{const c=S.pointer;try{const p=w(A,L);if(!p)return 1;const y=s.cstrToJs(p);return M(A).setItem(y,s.cstrToJs(K)),0}catch(p){return console.error("kvstorageWrite()",p),r.SQLITE_IOERR}finally{S.restore(c)}},xDelete:(A,L)=>{const K=S.pointer;try{const c=w(A,L);return c?(M(A).removeItem(s.cstrToJs(c)),0):1}catch(c){return console.error("kvstorageDelete()",c),r.SQLITE_IOERR}finally{S.restore(K)}}};for(const A of Object.keys(D))b[b.memberKey(A)]=s.installFunction(b.memberSignature(A),D[A])}else r.sqlite3_vfs_unregister(H);s.xWrap.FuncPtrAdapter.warnOnUse=!0;const P=t.StructBinder,x=function b(w,S,M,D=b.installMethodArgcCheck){if(w instanceof P.StructType?!(M instanceof Function)&&!s.isPtr(M)&&n("Usage errror: expecting a Function or WASM pointer to one."):n("Usage error: target object is-not-a StructType."),arguments.length===1)return(c,p)=>b(w,c,p,D);b.argcProxy||(b.argcProxy=function(c,p,y,z){return function(...f){return y.length!==arguments.length&&n("Argument mismatch for",c.structInfo.name+"::"+p+": Native signature is:",z),y.apply(this,f)}},b.removeFuncList=function(){this.ondispose.__removeFuncList&&(this.ondispose.__removeFuncList.forEach((c,p)=>{if(typeof c=="number")try{s.uninstallFunction(c)}catch{}}),delete this.ondispose.__removeFuncList)});const A=w.memberSignature(S);A.length<2&&n("Member",S,"does not have a function pointer signature:",A);const L=w.memberKey(S),K=D&&!s.isPtr(M)?b.argcProxy(w,L,M,A):M;if(s.isPtr(K))K&&!s.functionEntry(K)&&n("Pointer",K,"is not a WASM function table entry."),w[L]=K;else{const c=s.installFunction(K,w.memberSignature(S,!0));w[L]=c,(!w.ondispose||!w.ondispose.__removeFuncList)&&(w.addOnDispose("ondispose.__removeFuncList handler",b.removeFuncList),w.ondispose.__removeFuncList=[]),w.ondispose.__removeFuncList.push(L,c)}return(c,p)=>b(w,c,p,D)};x.installMethodArgcCheck=!1;const j=function(b,w,S=x.installMethodArgcCheck){const M=new Map;for(const D of Object.keys(w)){const A=w[D],L=M.get(A);if(L){const K=b.memberKey(D);b[K]=b[b.memberKey(L)]}else x(b,D,A,S),M.set(A,D)}return b};P.StructType.prototype.installMethod=function(w,S,M=x.installMethodArgcCheck){return arguments.length<3&&w&&typeof w=="object"?j(this,...arguments):x(this,...arguments)},P.StructType.prototype.installMethods=function(b,w=x.installMethodArgcCheck){return j(this,b,w)}}
2),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){t.version={libVersion:"3.49.1",libVersionNumber:3049001,sourceId:"2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70",downloadVersion:3490100}}),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){const n=(...f)=>{throw new t.SQLite3Error(...f)},r=t.capi,s=t.wasm,o=t.util,h=new WeakMap,q=new WeakMap,O=(f,m,l)=>{const _=Object.getOwnPropertyDescriptor(f,m);return _?_.value:l},N=function(f,m){return m&&(f instanceof x&&(f=f.pointer),n(m,"sqlite3 result code",m+":",f?r.sqlite3_errmsg(f):r.sqlite3_errstr(m))),arguments[0]},W=s.installFunction("i(ippp)",function(f,m,l,_){r.SQLITE_TRACE_STMT===f&&console.log("SQL TRACE #"+ ++this.counter+" via sqlite3@"+m+":",s.cstrToJs(_))}.bind({counter:0})),H=Object.create(null),P=function f(...m){if(!f._name2vfs){f._name2vfs=Object.create(null);const ne=typeof importScripts=="function"?ue=>n("The VFS for",ue,"is only available in the main window thread."):!1;f._name2vfs[":localStorage:"]={vfs:"kvvfs",filename:ne||(()=>"local")},f._name2vfs[":sessionStorage:"]={vfs:"kvvfs",filename:ne||(()=>"session")}}const l=f.normalizeArgs(...m);let _=l.filename,u=l.vfs,k=l.flags;(typeof _!="string"&&typeof _!="number"||typeof k!="string"||u&&typeof u!="string"&&typeof u!="number")&&(t.config.error("Invalid DB ctor args",l,arguments),n("Invalid arguments for DB constructor."));let Q=typeof _=="number"?s.cstrToJs(_):_;const X=f._name2vfs[Q];X&&(u=X.vfs,_=Q=X.filename(Q));let te,oe=0;k.indexOf("c")>=0&&(oe|=r.SQLITE_OPEN_CREATE|r.SQLITE_OPEN_READWRITE),k.indexOf("w")>=0&&(oe|=r.SQLITE_OPEN_READWRITE),oe===0&&(oe|=r.SQLITE_OPEN_READONLY),oe|=r.SQLITE_OPEN_EXRESCODE;const se=s.pstack.pointer;try{const ne=s.pstack.allocPtr();let ue=r.sqlite3_open_v2(_,ne,oe,u||0);te=s.peekPtr(ne),N(te,ue),r.sqlite3_extended_result_codes(te,1),k.indexOf("t")>=0&&r.sqlite3_trace_v2(te,r.SQLITE_TRACE_STMT,W,te)}catch(ne){throw te&&r.sqlite3_close_v2(te),ne}finally{s.pstack.restore(se)}this.filename=Q,h.set(this,te),q.set(this,Object.create(null));try{const ne=r.sqlite3_js_db_vfs(te)||n("Internal error: cannot get VFS for new db handle."),ue=H[ne];ue&&(ue instanceof Function?ue(this,t):N(te,r.sqlite3_exec(te,ue,0,0,0)))}catch(ne){throw this.close(),ne}};P.setVfsPostOpenCallback=function(f,m){m instanceof Function||n("dbCtorHelper.setVfsPostOpenCallback() should not be used with a non-function argument.",arguments),H[f]=m},P.normalizeArgs=function(f=":memory:",m="c",l=null){const _={};return arguments.length===1&&arguments[0]&&typeof arguments[0]=="object"?(Object.assign(_,arguments[0]),_.flags===void 0&&(_.flags="c"),_.vfs===void 0&&(_.vfs=null),_.filename===void 0&&(_.filename=":memory:")):(_.filename=f,_.flags=m,_.vfs=l),_};const x=function(...f){P.apply(this,f)};x.dbCtorHelper=P;const j={null:1,number:2,string:3,boolean:4,blob:5};j.undefined==j.null,s.bigIntEnabled&&(j.bigint=j.number);const b=function(){j!==arguments[2]&&n(r.SQLITE_MISUSE,"Do not call the Stmt constructor directly. Use DB.prepare()."),this.db=arguments[0],h.set(this,arguments[1]),this.parameterCount=r.sqlite3_bind_parameter_count(this.pointer)},w=function(f){return f.pointer||n("DB has been closed."),f},S=function(f,m){return(m!==(m|0)||m<0||m>=f.columnCount)&&n("Column index",m,"is out of range."),f},M=function(f,m){const l=Object.create(null);switch(l.opt=Object.create(null),m.length){case 1:typeof m[0]=="string"||o.isSQLableTypedArray(m[0])||Array.isArray(m[0])?l.sql=m[0]:m[0]&&typeof m[0]=="object"&&(l.opt=m[0],l.sql=l.opt.sql);break;case 2:l.sql=m[0],l.opt=m[1];break;default:n("Invalid argument count for exec().")}l.sql=o.flexibleString(l.sql),typeof l.sql!="string"&&n("Missing SQL argument or unsupported SQL value type.");const _=l.opt;switch(_.returnValue){case"resultRows":_.resultRows||(_.resultRows=[]),l.returnVal=()=>_.resultRows;break;case"saveSql":_.saveSql||(_.saveSql=[]),l.returnVal=()=>_.saveSql;break;case void 0:case"this":l.returnVal=()=>f;break;default:n("Invalid returnValue value:",_.returnValue)}if(!_.callback&&!_.returnValue&&_.rowMode!==void 0&&(_.resultRows||(_.resultRows=[]),l.returnVal=()=>_.resultRows),_.callback||_.resultRows)switch(_.rowMode===void 0?"array":_.rowMode){case"object":l.cbArg=(u,k)=>{k.columnNames||(k.columnNames=u.getColumnNames([]));const Q=u.get([]),X=Object.create(null);for(const te in k.columnNames)X[k.columnNames[te]]=Q[te];return X};break;case"array":l.cbArg=u=>u.get([]);break;
2case"stmt":Array.isArray(_.resultRows)&&n("exec(): invalid rowMode for a resultRows array: must","be one of 'array', 'object',","a result column number, or column name reference."),l.cbArg=u=>u;break;default:if(o.isInt32(_.rowMode)){l.cbArg=u=>u.get(_.rowMode);break}else if(typeof _.rowMode=="string"&&_.rowMode.length>1&&_.rowMode[0]==="$"){const u=_.rowMode.substr(1);l.cbArg=k=>{const Q=k.get(Object.create(null))[u];return Q===void 0?n(r.SQLITE_NOTFOUND,"exec(): unknown result column:",u):Q};break}n("Invalid rowMode:",_.rowMode)}return l},D=(f,m,l,..._)=>{const u=f.prepare(m);try{const k=u.bind(l).step()?u.get(..._):void 0;return u.reset(),k}finally{u.finalize()}},A=(f,m,l,_)=>f.exec({sql:m,bind:l,rowMode:_,returnValue:"resultRows"});x.checkRc=(f,m)=>N(f,m),x.prototype={isOpen:function(){return!!this.pointer},affirmOpen:function(){return w(this)},close:function(){if(this.pointer){if(this.onclose&&this.onclose.before instanceof Function)try{this.onclose.before(this)}catch{}const f=this.pointer;if(Object.keys(q.get(this)).forEach((m,l)=>{if(l&&l.pointer)try{l.finalize()}catch{}}),h.delete(this),q.delete(this),r.sqlite3_close_v2(f),this.onclose&&this.onclose.after instanceof Function)try{this.onclose.after(this)}catch{}delete this.filename}},changes:function(f=!1,m=!1){const l=w(this).pointer;return f?m?r.sqlite3_total_changes64(l):r.sqlite3_total_changes(l):m?r.sqlite3_changes64(l):r.sqlite3_changes(l)},dbFilename:function(f="main"){return r.sqlite3_db_filename(w(this).pointer,f)},dbName:function(f=0){return r.sqlite3_db_name(w(this).pointer,f)},dbVfsName:function(f=0){let m;const l=r.sqlite3_js_db_vfs(w(this).pointer,f);if(l){const _=new r.sqlite3_vfs(l);try{m=s.cstrToJs(_.$zName)}finally{_.dispose()}}return m},prepare:function(f){w(this);const m=s.pstack.pointer;let l,_;try{l=s.pstack.alloc(8),x.checkRc(this,r.sqlite3_prepare_v2(this.pointer,f,-1,l,null)),_=s.peekPtr(l)}finally{s.pstack.restore(m)}_||n("Cannot prepare empty SQL.");const u=new b(this,_,j);return q.get(this)[_]=u,u},exec:function(){w(this);const f=M(this,arguments);if(!f.sql)return n("exec() requires an SQL string.");const m=f.opt,l=m.callback,_=Array.isArray(m.resultRows)?m.resultRows:void 0;let u,k=m.bind,Q=!!(f.cbArg||m.columnNames||_);const X=s.scopedAllocPush(),te=Array.isArray(m.saveSql)?m.saveSql:void 0;try{const oe=o.isSQLableTypedArray(f.sql);let se=oe?f.sql.byteLength:s.jstrlen(f.sql);const ne=s.scopedAlloc(2*s.ptrSizeof+(se+1)),ue=ne+s.ptrSizeof;let pe=ue+s.ptrSizeof;const me=pe+se;for(oe?s.heap8().set(f.sql,pe):s.jstrcpy(f.sql,s.heap8(),pe,se,!1),s.poke(pe+se,0);pe&&s.peek(pe,"i8");){s.pokePtr([ne,ue],0),x.checkRc(this,r.sqlite3_prepare_v3(this.pointer,pe,se,0,ne,ue));const be=s.peekPtr(ne);if(pe=s.peekPtr(ue),se=me-pe,!!be){if(te&&te.push(r.sqlite3_sql(be).trim()),u=new b(this,be,j),k&&u.parameterCount&&(u.bind(k),k=null),Q&&u.columnCount){let Ee=Array.isArray(m.columnNames)?0:1;if(Q=!1,f.cbArg||_){const T=Object.create(null);for(;u.step();u._lockedByExec=!1){Ee++===0&&u.getColumnNames(T.columnNames=m.columnNames||[]),u._lockedByExec=!0;const B=f.cbArg(u,T);if(_&&_.push(B),l&&l.call(m,B,u)===!1)break}u._lockedByExec=!1}Ee===0&&u.getColumnNames(m.columnNames)}else u.step();u.reset().finalize(),u=null}}}finally{s.scopedAllocPop(X),u&&(delete u._lockedByExec,u.finalize())}return f.returnVal()},createFunction:function(m,l,_){const u=T=>T instanceof Function;switch(arguments.length){case 1:_=m,m=_.name,l=_.xFunc||0;break;case 2:u(l)||(_=l,l=_.xFunc||0);break}_||(_={}),typeof m!="string"&&n("Invalid arguments: missing function name.");let k=_.xStep||0,Q=_.xFinal||0;const X=_.xValue||0,te=_.xInverse||0;let oe;u(l)?(oe=!1,(u(k)||u(Q))&&n("Ambiguous arguments: scalar or aggregate?"),k=Q=null):u(k)?(u(Q)||n("Missing xFinal() callback for aggregate or window UDF."),l=null):u(Q)?n("Missing xStep() callback for aggregate or window UDF."):n("Missing function-type properties."),oe===!1?(u(X)||u(te))&&n("xValue and xInverse are not permitted for non-window UDFs."):u(X)?(u(te)||n("xInverse must be provided if xValue is."),oe=!0):u(te)&&n("xValue must be provided if xInverse is.");const se=_.pApp;se!=null&&(typeof se!="number"||!o.isInt32(se))&&n("Invalid value for pApp property. Must be a legal WASM pointer value.");const ne=_.xDestroy||0;ne&&!u(ne)&&n("xDestroy property must be a function.");let ue=0;O(_,"deterministic")&&(ue|=r.SQLITE_DETERMINISTIC),O(_,"directOnly")&&(ue|=r.SQLITE_DIRECTONLY),O(_,"innocuous")&&(ue|=r.SQLITE_INNOCUOUS),m=m.toLowerCase();const pe=l||k,me=O(_,"arity"),be=typeof me=="number"?me:pe.length?pe.length-1:0;let Ee;return oe?Ee=r.sqlite3_create_window_function(this.pointer,m,be,r.SQLITE_UTF8|ue,se||0,k,Q,X,te,ne):Ee=r.sqlite3_create_function_v2(this.pointer,m,be,r.SQLITE_UTF8|ue,se||0,l,k,Q,ne),x.checkRc(this,Ee),this},selectValue:function(f,m,l){return D(this,f,m,0,l)},selectValues:function(f,m,l){const _=this.prepare(f),u=[];try{for(_.bind(m);_.step();)u.push(_.get(0,l));_.reset()}finally{_.finalize()}return u},selectArray:function(f,m){return D(this,f,m,[])},selectObject:function(f,m){return D(this,f,m,{})},selectArrays:function(f,m){return A(this,f,m,"array")},selectObjects:function(f,m){return A(this,f,m,"object")},openStatementCount:function(){return this.pointer?Object.keys(q.get(this)).length:0},transaction:function(f){let m="BEGIN";arguments.length>1&&(/[^a-zA-Z]/.test(arguments[0])&&n(r.SQLITE_MISUSE,"Invalid argument for BEGIN qualifier."),m+=" "+arguments[0],f=arguments[1]),w(this).exec(m);try{const l=f(this);return this.exec("COMMIT"),l}catch(l){throw this.exec("ROLLBACK"),l}},savepoint:function(f){w(this).exec("SAVEPOINT oo1");try{const m=f(this);return this.exec("RELEASE oo1"),m}catch(m){throw this.exec("ROLLBACK to SAVEPOINT oo1; RELEASE SAVEPOINT oo1"),m}},checkRc:function(f){return N(this,f)}};const L=function(f){return f.pointer||n("Stmt has been closed."),f},K=function(f){let m=j[f==null?"null":typeof f];switch(m){case j.boolean:case j.null:case j.number:case j.string:return m;case j.bigint:if(s.bigIntEnabled)return m;default:return o.isBindableTypedArray(f)?j.blob:void 0}},c=function(f){return K(f)||n("Unsupported bind() argument type:",typeof f)},p=function(f,m){const l=typeof m=="number"?m:r.sqlite3_bind_parameter_index(f.pointer,m);return l===0||!o.isInt32(l)?n("Invalid bind() parameter name: "+m):(l<1||l>f.parameterCount)&&n("Bind index",m,"is out of range."),l},y=function(f,m){return f._lockedByExec&&n("Operation is illegal when statement is locked:",m),f},z=function f(m,l,_,u){y(L(m),"bind()"),f._||(f._tooBigInt=Q=>n("BigInt value is too big to store without precision loss:",Q),f._={string:function(Q,X,te,oe){const[se,ne]=s.allocCString(te,!0);return(oe?r.sqlite3_bind_blob:r.sqlite3_bind_text)(Q.pointer,X,se,ne,r.SQLITE_WASM_DEALLOC)}}),c(u),l=p(m,l);let k=0;
2switch(u==null?j.null:_){case j.null:k=r.sqlite3_bind_null(m.pointer,l);break;case j.string:k=f._.string(m,l,u,!1);break;case j.number:{let Q;o.isInt32(u)?Q=r.sqlite3_bind_int:typeof u=="bigint"?o.bigIntFits64(u)?s.bigIntEnabled?Q=r.sqlite3_bind_int64:o.bigIntFitsDouble(u)?(u=Number(u),Q=r.sqlite3_bind_double):f._tooBigInt(u):f._tooBigInt(u):(u=Number(u),s.bigIntEnabled&&Number.isInteger(u)?Q=r.sqlite3_bind_int64:Q=r.sqlite3_bind_double),k=Q(m.pointer,l,u);break}case j.boolean:k=r.sqlite3_bind_int(m.pointer,l,u?1:0);break;case j.blob:{if(typeof u=="string"){k=f._.string(m,l,u,!0);break}else u instanceof ArrayBuffer?u=new Uint8Array(u):o.isBindableTypedArray(u)||n("Binding a value as a blob requires","that it be a string, Uint8Array, Int8Array, or ArrayBuffer.");const Q=s.alloc(u.byteLength||1);s.heap8().set(u.byteLength?u:[0],Q),k=r.sqlite3_bind_blob(m.pointer,l,Q,u.byteLength,r.SQLITE_WASM_DEALLOC);break}default:t.config.warn("Unsupported bind() argument type:",u),n("Unsupported bind() argument type: "+typeof u)}return k&&x.checkRc(m.db.pointer,k),m._mayGet=!1,m};b.prototype={finalize:function(){if(this.pointer){y(this,"finalize()");const f=r.sqlite3_finalize(this.pointer);return delete q.get(this.db)[this.pointer],h.delete(this),delete this._mayGet,delete this.parameterCount,delete this._lockedByExec,delete this.db,f}},clearBindings:function(){return y(L(this),"clearBindings()"),r.sqlite3_clear_bindings(this.pointer),this._mayGet=!1,this},reset:function(f){y(this,"reset()"),f&&this.clearBindings();const m=r.sqlite3_reset(L(this).pointer);return this._mayGet=!1,N(this.db,m),this},bind:function(){L(this);let f,m;switch(arguments.length){case 1:f=1,m=arguments[0];break;case 2:f=arguments[0],m=arguments[1];break;default:n("Invalid bind() arguments.")}return m===void 0?this:(this.parameterCount||n("This statement has no bindable parameters."),this._mayGet=!1,m===null?z(this,f,j.null,m):Array.isArray(m)?(arguments.length!==1&&n("When binding an array, an index argument is not permitted."),m.forEach((l,_)=>z(this,_+1,c(l),l)),this):(m instanceof ArrayBuffer&&(m=new Uint8Array(m)),typeof m=="object"&&!o.isBindableTypedArray(m)?(arguments.length!==1&&n("When binding an object, an index argument is not permitted."),Object.keys(m).forEach(l=>z(this,l,c(m[l]),m[l])),this):z(this,f,c(m),m)))},bindAsBlob:function(f,m){L(this),arguments.length===1&&(m=f,f=1);const l=c(m);return j.string!==l&&j.blob!==l&&j.null!==l&&n("Invalid value type for bindAsBlob()"),z(this,f,j.blob,m)},step:function(){y(this,"step()");const f=r.sqlite3_step(L(this).pointer);switch(f){case r.SQLITE_DONE:return this._mayGet=!1;case r.SQLITE_ROW:return this._mayGet=!0;default:this._mayGet=!1,t.config.warn("sqlite3_step() rc=",f,r.sqlite3_js_rc_str(f),"SQL =",r.sqlite3_sql(this.pointer)),x.checkRc(this.db.pointer,f)}},stepReset:function(){return this.step(),this.reset()},stepFinalize:function(){try{const f=this.step();return this.reset(),f}finally{try{this.finalize()}catch{}}},get:function(f,m){if(L(this)._mayGet||n("Stmt.step() has not (recently) returned true."),Array.isArray(f)){let l=0;const _=this.columnCount;for(;l<_;)f[l]=this.get(l++);return f}else if(f&&typeof f=="object"){let l=0;const _=this.columnCount;for(;l<_;)f[r.sqlite3_column_name(this.pointer,l)]=this.get(l++);return f}switch(S(this,f),m===void 0?r.sqlite3_column_type(this.pointer,f):m){case r.SQLITE_NULL:return null;case r.SQLITE_INTEGER:if(s.bigIntEnabled){const l=r.sqlite3_column_int64(this.pointer,f);return l>=Number.MIN_SAFE_INTEGER&&l<=Number.MAX_SAFE_INTEGER?Number(l).valueOf():l}else{const l=r.sqlite3_column_double(this.pointer,f);return(l>Number.MAX_SAFE_INTEGER||l<Number.MIN_SAFE_INTEGER)&&n("Integer is out of range for JS integer range: "+l),o.isInt32(l)?l|0:l}case r.SQLITE_FLOAT:return r.sqlite3_column_double(this.pointer,f);case r.SQLITE_TEXT:return r.sqlite3_column_text(this.pointer,f);case r.SQLITE_BLOB:{const l=r.sqlite3_column_bytes(this.pointer,f),_=r.sqlite3_column_blob(this.pointer,f),u=new Uint8Array(l);return l&&u.set(s.heap8u().slice(_,_+l),0),l&&this.db._blobXfer instanceof Array&&this.db._blobXfer.push(u.buffer),u}default:n("Don't know how to translate","type of result column #"+f+".")}n("Not reached.")},getInt:function(f){return this.get(f,r.SQLITE_INTEGER)},getFloat:function(f){return this.get(f,r.SQLITE_FLOAT)},getString:function(f){return this.get(f,r.SQLITE_TEXT)},getBlob:function(f){return this.get(f,r.SQLITE_BLOB)},getJSON:function(f){const m=this.get(f,r.SQLITE_STRING);return m===null?m:JSON.parse(m)},getColumnName:function(f){return r.sqlite3_column_name(S(L(this),f).pointer,f)},getColumnNames:function(f=[]){S(L(this),0);const m=this.columnCount;for(let l=0;l<m;++l)f.push(r.sqlite3_column_name(this.pointer,l));return f},getParamIndex:function(f){return L(this).parameterCount?r.sqlite3_bind_parameter_index(this.pointer,f):void 0},getParamName:function(f){return L(this).parameterCount?r.sqlite3_bind_parameter_name(this.pointer,f):void 0},isBusy:function(){return r.sqlite3_stmt_busy(L(this))!==0},isReadOnly:function(){return r.sqlite3_stmt_readonly(L(this))!==0}};{const f={enumerable:!0,get:function(){return h.get(this)},set:()=>n("The pointer property is read-only.")};Object.defineProperty(b.prototype,"pointer",f),Object.defineProperty(x.prototype,"pointer",f)}if(Object.defineProperty(b.prototype,"columnCount",{enumerable:!1,get:function(){return r.sqlite3_column_count(this.pointer)},set:()=>n("The columnCount property is read-only.")}),t.oo1={DB:x,Stmt:b},o.isUIThread()){t.oo1.JsStorageDb=function(m="session"){const l=P.normalizeArgs(...arguments);m=l.filename,m!=="session"&&m!=="local"&&n("JsStorageDb db name must be one of 'session' or 'local'."),l.vfs="kvvfs",P.call(this,l)};const f=t.oo1.JsStorageDb;f.prototype=Object.create(x.prototype),f.clearStorage=r.sqlite3_js_kvvfs_clear,f.prototype.clearStorage=function(){return f.clearStorage(w(this).filename)},f.storageSize=r.sqlite3_js_kvvfs_size,f.prototype.storageSize=function(){return f.storageSize(w(this).filename)}}}
2),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){const n=t.util;t.initWorker1API=function(){const r=(...P)=>{throw new Error(P.join(" "))};globalThis.WorkerGlobalScope instanceof Function||r("initWorker1API() must be run from a Worker thread.");const s=this.sqlite3||r("Missing this.sqlite3 object."),o=s.oo1.DB,h=function(P){let x=q.idMap.get(P);return x||(x="db#"+ ++q.idSeq+"@"+P.pointer,q.idMap.set(P,x),x)},q={dbList:[],idSeq:0,idMap:new WeakMap,xfer:[],open:function(P){const x=new o(P);return this.dbs[h(x)]=x,this.dbList.indexOf(x)<0&&this.dbList.push(x),x},close:function(P,x){if(P){delete this.dbs[h(P)];const j=P.filename,b=n.sqlite3__wasm_db_vfs(P.pointer,0);P.close();const w=this.dbList.indexOf(P);w>=0&&this.dbList.splice(w,1),x&&j&&b&&n.sqlite3__wasm_vfs_unlink(b,j)}},post:function(P,x){x&&x.length?(globalThis.postMessage(P,Array.from(x)),x.length=0):globalThis.postMessage(P)},dbs:Object.create(null),getDb:function(P,x=!0){return this.dbs[P]||(x?r("Unknown (or closed) DB ID:",P):void 0)}},O=function(P=q.dbList[0]){return P&&P.pointer?P:r("DB is not opened.")},N=function(P,x=!0){const j=q.getDb(P.dbId,!1)||q.dbList[0];return x?O(j):j},W=function(){return q.dbList[0]&&h(q.dbList[0])},H={open:function(P){const x=Object.create(null),j=P.args||Object.create(null);j.simulateError&&r("Throwing because of simulateError flag.");const b=Object.create(null);x.vfs=j.vfs,x.filename=j.filename||"";const w=q.open(x);return b.filename=w.filename,b.persistent=!!s.capi.sqlite3_js_db_uses_vfs(w.pointer,"opfs"),b.dbId=h(w),b.vfs=w.dbVfsName(),b},close:function(P){const x=N(P,!1),j={filename:x&&x.filename};if(x){const b=P.args&&typeof P.args=="object"?!!P.args.unlink:!1;q.close(x,b)}return j},exec:function(P){const x=typeof P.args=="string"?{sql:P.args}:P.args||Object.create(null);x.rowMode==="stmt"?r("Invalid rowMode for 'exec': stmt mode","does not work in the Worker API."):x.sql||r("'exec' requires input SQL.");const j=N(P);(x.callback||Array.isArray(x.resultRows))&&(j._blobXfer=q.xfer);const b=x.callback;let w=0;const S=!!x.columnNames;typeof b=="string"&&(S||(x.columnNames=[]),x.callback=function(M,D){q.post({type:b,columnNames:x.columnNames,rowNumber:++w,row:M},q.xfer)});try{const M=x.countChanges?j.changes(!0,x.countChanges===64):void 0;j.exec(x),M!==void 0&&(x.changeCount=j.changes(!0,x.countChanges===64)-M),x.callback instanceof Function&&(x.callback=b,q.post({type:b,columnNames:x.columnNames,rowNumber:null,row:void 0}))}finally{delete j._blobXfer,x.callback&&(x.callback=b)}return x},"config-get":function(){const P=Object.create(null),x=s.config;return["bigIntEnabled"].forEach(function(j){Object.getOwnPropertyDescriptor(x,j)&&(P[j]=x[j])}),P.version=s.version,P.vfsList=s.capi.sqlite3_js_vfs_list(),P},export:function(P){const x=N(P),j={byteArray:s.capi.sqlite3_js_db_export(x.pointer),filename:x.filename,mimetype:"application/x-sqlite3"};return q.xfer.push(j.byteArray.buffer),j},toss:function(P){r("Testing worker exception")}};globalThis.onmessage=async function(P){P=P.data;let x,j=P.dbId,b=P.type;const w=performance.now();try{H.hasOwnProperty(b)&&H[b]instanceof Function?x=await H[b](P):r("Unknown db worker message type:",P.type)}catch(S){b="error",x={operation:P.type,message:S.message,errorClass:S.name,input:P},S.stack&&(x.stack=typeof S.stack=="string"?S.stack.split(/\n\s*/):S.stack)}j||(j=x.dbId||W()),q.post({type:b,dbId:j,messageId:P.messageId,workerReceivedTime:w,workerRespondTime:performance.now(),departureTime:P.departureTime,result:x},q.xfer)},globalThis.postMessage({type:"sqlite3-api",result:"worker1-ready"})}.bind({sqlite3:t})}),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){const n=t.wasm,r=t.capi,s=t.util.toss3,o=Object.create(null);t.vfs=o,r.sqlite3_vfs.prototype.registerVfs=function(h=!1){this instanceof t.capi.sqlite3_vfs||s("Expecting a sqlite3_vfs-type argument.");const q=r.sqlite3_vfs_register(this,h?1:0);return q&&s("sqlite3_vfs_register(",this,") failed with rc",q),this.pointer!==r.sqlite3_vfs_find(this.$zName)&&s("BUG: sqlite3_vfs_find(vfs.$zName) failed for just-installed VFS",this),this},o.installVfs=function(h){let q=0;const O=["io","vfs"];for(const N of O){const W=h[N];W&&(++q,W.struct.installMethods(W.methods,!!W.applyArgcCheck),N==="vfs"&&(!W.struct.$zName&&typeof W.name=="string"&&W.struct.addOnDispose(W.struct.$zName=n.allocCString(W.name)),W.struct.registerVfs(!!W.asDefault)))}return q||s("Misuse: installVfs() options object requires at least","one of:",O),this}}
2),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){if(!t.wasm.exports.sqlite3_declare_vtab)return;const n=t.wasm,r=t.capi,s=t.util.toss3,o=Object.create(null);t.vtab=o;const h=r.sqlite3_index_info;h.prototype.nthConstraint=function(N,W=!1){if(N<0||N>=this.$nConstraint)return!1;const H=this.$aConstraint+h.sqlite3_index_constraint.structInfo.sizeof*N;return W?H:new h.sqlite3_index_constraint(H)},h.prototype.nthConstraintUsage=function(N,W=!1){if(N<0||N>=this.$nConstraint)return!1;const H=this.$aConstraintUsage+h.sqlite3_index_constraint_usage.structInfo.sizeof*N;return W?H:new h.sqlite3_index_constraint_usage(H)},h.prototype.nthOrderBy=function(N,W=!1){if(N<0||N>=this.$nOrderBy)return!1;const H=this.$aOrderBy+h.sqlite3_index_orderby.structInfo.sizeof*N;return W?H:new h.sqlite3_index_orderby(H)};const q=function(N,W){return function(H,P=!1){if(arguments.length===0&&(H=new W),H instanceof W)return this.set(H.pointer,H),H;n.isPtr(H)||t.SQLite3Error.toss("Invalid argument to",N+"()");let x=this.get(H);return P&&this.delete(H),x}.bind(new Map)},O=function(N,W){const H=q(N,W);return Object.assign(Object.create(null),{StructType:W,create:P=>{const x=H();return n.pokePtr(P,x.pointer),x},get:P=>H(P),unget:P=>H(P,!0),dispose:P=>{const x=H(P,!0);x&&x.dispose()}})};o.xVtab=O("xVtab",r.sqlite3_vtab),o.xCursor=O("xCursor",r.sqlite3_vtab_cursor),o.xIndexInfo=N=>new r.sqlite3_index_info(N),o.xError=function N(W,H,P){if(N.errorReporter instanceof Function)try{N.errorReporter("sqlite3_module::"+W+"(): "+H.message)}catch{}let x;return H instanceof t.WasmAllocError?x=r.SQLITE_NOMEM:arguments.length>2?x=P:H instanceof t.SQLite3Error&&(x=H.resultCode),x||r.SQLITE_ERROR},o.xError.errorReporter=console.error.bind(console),o.xRowid=(N,W)=>n.poke(N,W,"i64"),o.setupModule=function(N){let W=!1;const H=this instanceof r.sqlite3_module?this:N.struct||(W=new r.sqlite3_module);try{const P=N.methods||s("Missing 'methods' object.");for(const x of Object.entries({xConnect:"xCreate",xDisconnect:"xDestroy"})){const j=x[0],b=x[1];P[j]===!0?P[j]=P[b]:P[b]===!0&&(P[b]=P[j])}if(N.catchExceptions){const x=function(w,S){return["xConnect","xCreate"].indexOf(w)>=0?function(M,D,A,L,K,c){try{return S(...arguments)||0}catch(p){return p instanceof t.WasmAllocError||(n.dealloc(n.peekPtr(c)),n.pokePtr(c,n.allocCString(p.message))),o.xError(w,p)}}:function(...M){try{return S(...M)||0}catch(D){return o.xError(w,D)}}},j=["xCreate","xConnect","xBestIndex","xDisconnect","xDestroy","xOpen","xClose","xFilter","xNext","xEof","xColumn","xRowid","xUpdate","xBegin","xSync","xCommit","xRollback","xFindFunction","xRename","xSavepoint","xRelease","xRollbackTo","xShadowName"],b=Object.create(null);for(const w of j){const S=P[w];if(S instanceof Function)w==="xConnect"&&P.xCreate===S?b[w]=P.xCreate:w==="xCreate"&&P.xConnect===S?b[w]=P.xConnect:b[w]=x(w,S);else continue}H.installMethods(b,!1)}else H.installMethods(P,!!N.applyArgcCheck);if(H.$iVersion===0){let x;typeof N.iVersion=="number"?x=N.iVersion:H.$xShadowName?x=3:H.$xSavePoint||H.$xRelease||H.$xRollbackTo?x=2:x=1,H.$iVersion=x}}catch(P){throw W&&W.dispose(),P}return H},r.sqlite3_module.prototype.setupModule=function(N){return o.setupModule.call(this,N)}}),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){const n=function r(s){if(!globalThis.SharedArrayBuffer||!globalThis.Atomics)return Promise.reject(new Error("Cannot install OPFS: Missing SharedArrayBuffer and/or Atomics. The server must emit the COOP/COEP response headers to enable those. See https://sqlite.org/wasm/doc/trunk/persistence.md#coop-coep"));if(typeof WorkerGlobalScope>"u")return Promise.reject(new Error("The OPFS sqlite3_vfs cannot run in the main thread because it requires Atomics.wait()."));if(!globalThis.FileSystemHandle||!globalThis.FileSystemDirectoryHandle||!globalThis.FileSystemFileHandle||!globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle||!navigator?.storage?.getDirectory)return Promise.reject(new Error("Missing required OPFS APIs."));(!s||typeof s!="object")&&(s=Object.create(null));const o=new URL(globalThis.location.href).searchParams;return o.has("opfs-disable")?Promise.resolve(t):(s.verbose===void 0&&(s.verbose=o.has("opfs-verbose")?+o.get("opfs-verbose")||2:1),s.sanityChecks===void 0&&(s.sanityChecks=o.has("opfs-sanity-check")),s.proxyUri===void 0&&(s.proxyUri=r.defaultProxyUri),typeof s.proxyUri=="function"&&(s.proxyUri=s.proxyUri()),new Promise(function(q,O){const N=[t.config.error,t.config.warn,t.config.log],W=(T,...B)=>{s.verbose>T&&N[T]("OPFS syncer:",...B)},H=(...T)=>W(2,...T),P=(...T)=>W(1,...T),x=(...T)=>W(0,...T),j=t.util.toss,b=t.capi,w=t.util,S=t.wasm,M=b.sqlite3_vfs,D=b.sqlite3_file,A=b.sqlite3_io_methods,L=Object.create(null),K=()=>globalThis.FileSystemHandle&&globalThis.FileSystemDirectoryHandle&&globalThis.FileSystemFileHandle&&globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle&&navigator?.storage?.getDirectory;L.metrics={dump:function(){let T,B=0,U=0,G=0;for(T in u.opIds){const V=k[T];B+=V.count,U+=V.time,G+=V.wait,V.avgTime=V.count&&V.time?V.time/V.count:0,V.avgWait=V.count&&V.wait?V.wait/V.count:0}t.config.log(globalThis.location.href,"metrics for",globalThis.location.href,":",k,`
3Total of`,B,"op(s) for",U,"ms (incl. "+G+" ms of waiting on the async side)"),t.config.log("Serialization metrics:",k.s11n),m.postMessage({type:"opfs-async-metrics"})},reset:function(){let T;const B=G=>G.count=G.time=G.wait=0;for(T in u.opIds)B(k[T]=Object.create(null));let U=k.s11n=Object.create(null);U=U.serialize=Object.create(null),U.count=U.time=0,U=k.s11n.deserialize=Object.create(null),U.count=U.time=0}};const c=new A,p=new M().addOnDispose(()=>c.dispose());let y;const z=T=>(y=!0,p.dispose(),O(T)),f=()=>(y=!1,q(t)),m=new Worker(new URL(""+new URL("sqlite3-opfs-async-proxy-C_otN2ZJ.js",import.meta.url).href,import.meta.url));setTimeout(()=>{y===void 0&&z(new Error("Timeout while waiting for OPFS async proxy worker."))},4e3),m._originalOnError=m.onerror,m.onerror=function(T){x("Error initializing OPFS asyncer:",T),z(new Error("Loading OPFS async Worker failed for unknown reasons."))};const l=b.sqlite3_vfs_find(null),_=l?new M(l):null;c.$iVersion=1,p.$iVersion=2,p.$szOsFile=b.sqlite3_file.structInfo.sizeof,p.$mxPathname=1024,p.$zName=S.allocCString("opfs"),p.$xDlOpen=p.$xDlError=p.$xDlSym=p.$xDlClose=null,p.addOnDispose("$zName",p.$zName,"cleanup default VFS wrapper",()=>_?_.dispose():null);const u=Object.create(null);u.verbose=s.verbose,u.littleEndian=(()=>{const T=new ArrayBuffer(2);return new DataView(T).setInt16(0,256,!0),new Int16Array(T)[0]===256})(),u.asyncIdleWaitTime=150,u.asyncS11nExceptions=1,u.fileBufferSize=1024*64,u.sabS11nOffset=u.fileBufferSize,u.sabS11nSize=p.$mxPathname*2,u.sabIO=new SharedArrayBuffer(u.fileBufferSize+u.sabS11nSize),u.opIds=Object.create(null);const k=Object.create(null);{let T=0;u.opIds.whichOp=T++,u.opIds.rc=T++,u.opIds.xAccess=T++,u.opIds.xClose=T++,u.opIds.xDelete=T++,u.opIds.xDeleteNoWait=T++,u.opIds.xFileSize=T++,u.opIds.xLock=T++,u.opIds.xOpen=T++,u.opIds.xRead=T++,u.opIds.xSleep=T++,u.opIds.xSync=T++,u.opIds.xTruncate=T++,u.opIds.xUnlock=T++,u.opIds.xWrite=T++,u.opIds.mkdir=T++,u.opIds["opfs-async-metrics"]=T++,u.opIds["opfs-async-shutdown"]=T++,u.opIds.retry=T++,u.sabOP=new SharedArrayBuffer(T*4),L.metrics.reset()}u.sq3Codes=Object.create(null),["SQLITE_ACCESS_EXISTS","SQLITE_ACCESS_READWRITE","SQLITE_BUSY","SQLITE_CANTOPEN","SQLITE_ERROR","SQLITE_IOERR","SQLITE_IOERR_ACCESS","SQLITE_IOERR_CLOSE","SQLITE_IOERR_DELETE","SQLITE_IOERR_FSYNC","SQLITE_IOERR_LOCK","SQLITE_IOERR_READ","SQLITE_IOERR_SHORT_READ","SQLITE_IOERR_TRUNCATE","SQLITE_IOERR_UNLOCK","SQLITE_IOERR_WRITE","SQLITE_LOCK_EXCLUSIVE","SQLITE_LOCK_NONE","SQLITE_LOCK_P
3ENDING","SQLITE_LOCK_RESERVED","SQLITE_LOCK_SHARED","SQLITE_LOCKED","SQLITE_MISUSE","SQLITE_NOTFOUND","SQLITE_OPEN_CREATE","SQLITE_OPEN_DELETEONCLOSE","SQLITE_OPEN_MAIN_DB","SQLITE_OPEN_READONLY"].forEach(T=>{(u.sq3Codes[T]=b[T])===void 0&&j("Maintenance required: not found:",T)}),u.opfsFlags=Object.assign(Object.create(null),{OPFS_UNLOCK_ASAP:1,OPFS_UNLINK_BEFORE_OPEN:2,defaultUnlockAsap:!1});const Q=(T,...B)=>{const U=u.opIds[T]||j("Invalid op ID:",T);u.s11n.serialize(...B),Atomics.store(u.sabOPView,u.opIds.rc,-1),Atomics.store(u.sabOPView,u.opIds.whichOp,U),Atomics.notify(u.sabOPView,u.opIds.whichOp);const G=performance.now();for(;Atomics.wait(u.sabOPView,u.opIds.rc,-1)!=="not-equal";);const V=Atomics.load(u.sabOPView,u.opIds.rc);if(k[T].wait+=performance.now()-G,V&&u.asyncS11nExceptions){const Z=u.s11n.deserialize();Z&&x(T+"() async error:",...Z)}return V};L.debug={asyncShutdown:()=>{P("Shutting down OPFS async listener. The OPFS VFS will no longer work."),Q("opfs-async-shutdown")},asyncRestart:()=>{P("Attempting to restart OPFS VFS async listener. Might work, might not."),m.postMessage({type:"opfs-async-restart"})}};const X=()=>{if(u.s11n)return u.s11n;const T=new TextDecoder,B=new TextEncoder("utf-8"),U=new Uint8Array(u.sabIO,u.sabS11nOffset,u.sabS11nSize),G=new DataView(u.sabIO,u.sabS11nOffset,u.sabS11nSize);u.s11n=Object.create(null);const V=Object.create(null);V.number={id:1,size:8,getter:"getFloat64",setter:"setFloat64"},V.bigint={id:2,size:8,getter:"getBigInt64",setter:"setBigInt64"},V.boolean={id:3,size:4,getter:"getInt32",setter:"setInt32"},V.string={id:4};const Z=C=>V[typeof C]||j("Maintenance required: this value type cannot be serialized.",C),ee=C=>{switch(C){case V.number.id:return V.number;case V.bigint.id:return V.bigint;case V.boolean.id:return V.boolean;case V.string.id:return V.string;default:j("Invalid type ID:",C)}};return u.s11n.deserialize=function(C=!1){++k.s11n.deserialize.count;const E=performance.now(),d=U[0],I=d?[]:null;if(d){const F=[];let R=1,$,ie,_e;for($=0;$<d;++$,++R)F.push(ee(U[R]));for($=0;$<d;++$){const he=F[$];he.getter?(_e=G[he.getter](R,u.littleEndian),R+=he.size):(ie=G.getInt32(R,u.littleEndian),R+=4,_e=T.decode(U.slice(R,R+ie)),R+=ie),I.push(_e)}}return C&&(U[0]=0),k.s11n.deserialize.time+=performance.now()-E,I},u.s11n.serialize=function(...C){const E=performance.now();if(++k.s11n.serialize.count,C.length){const d=[];let I=0,F=1;for(U[0]=C.length&255;I<C.length;++I,++F)d.push(Z(C[I])),U[F]=d[I].id;for(I=0;I<C.length;++I){const R=d[I];if(R.setter)G[R.setter](F,C[I],u.littleEndian),F+=R.size;else{const $=B.encode(C[I]);G.setInt32(F,$.byteLength,u.littleEndian),F+=4,U.set($,F),F+=$.byteLength}}}else U[0]=0;k.s11n.serialize.time+=performance.now()-E},u.s11n},te=function T(B=16){T._chars||(T._chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012346789",T._n=T._chars.length);const U=[];let G=0;for(;G<B;++G){const V=Math.random()*(T._n*64)%T._n|0;U[G]=T._chars[V]}return U.join("")},oe=Object.create(null),se=Object.create(null);se.op=void 0,se.start=void 0;const ne=T=>{se.start=performance.now(),se.op=T,++k[T].count},ue=()=>k[se.op].time+=performance.now()-se.start,pe={xCheckReservedLock:function(T,B){return S.poke(B,0,"i32"),0},xClose:function(T){ne("xClose");let B=0;const U=oe[T];return U&&(delete oe[T],B=Q("xClose",T),U.sq3File&&U.sq3File.dispose()),ue(),B},xDeviceCharacteristics:function(T){return b.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(T,B,U){return b.SQLITE_NOTFOUND},xFileSize:function(T,B){ne("xFileSize");let U=Q("xFileSize",T);if(U==0)try{const G=u.s11n.deserialize()[0];S.poke(B,G,"i64")}catch(G){x("Unexpected error reading xFileSize() result:",G),U=u.sq3Codes.SQLITE_IOERR}return ue(),U},xLock:function(T,B){ne("xLock");const U=oe[T];let G=0;return U.lockType?U.lockType=B:(G=Q("xLock",T,B),G===0&&(U.lockType=B)),ue(),G},xRead:function(T,B,U,G){ne("xRead");const V=oe[T];let Z;try{Z=Q("xRead",T,U,Number(G)),(Z===0||b.SQLITE_IOERR_SHORT_READ===Z)&&S.heap8u().set(V.sabView.subarray(0,U),B)}catch(ee){x("xRead(",arguments,") failed:",ee,V),Z=b.SQLITE_IOERR_READ}return ue(),Z},xSync:function(T,B){ne("xSync"),++k.xSync.count;const U=Q("xSync",T,B);return ue(),U},xTruncate:function(T,B){ne("xTruncate");const U=Q("xTruncate",T,Number(B));return ue(),U},xUnlock:function(T,B){ne("xUnlock");const U=oe[T];let G=0;return b.SQLITE_LOCK_NONE===B&&U.lockType&&(G=Q("xUnlock",T,B)),G===0&&(U.lockType=B),ue(),G},xWrite:function(T,B,U,G){ne("xWrite");const V=oe[T];let Z;try{V.sabView.set(S.heap8u().subarray(B,B+U)),Z=Q("xWrite",T,U,Number(G))}catch(ee){x("xWrite(",arguments,") failed:",ee,V),Z=b.SQLITE_IOERR_WRITE}return ue(),Z}},me={xAccess:function(T,B,U,G){ne("xAccess");const V=Q("xAccess",S.cstrToJs(B));return S.poke(G,V?0:1,"i32"),ue(),0},xCurrentTime:function(T,B){return S.poke(B,24405875e-1+new Date().getTime()/864e5,"double"),0},xCurrentTimeInt64:function(T,B){return S.poke(B,24405875e-1*864e5+new Date().getTime(),"i64"),0},xDelete:function(T,B,U){ne("xDelete");const G=Q("xDelete",S.cstrToJs(B),U,!1);return ue(),G},xFullPathname:function(T,B,U,G){return S.cstrncpy(G,B,U)<U?0:b.SQLITE_CANTOPEN},xGetLastError:function(T,B,U){return P("OPFS xGetLastError() has nothing sensible to return."),0},xOpen:function(B,U,G,V,Z){ne("xOpen");let ee=0;U===0?U=te():S.isPtr(U)&&(b.sqlite3_uri_boolean(U,"opfs-unlock-asap",0)&&(ee|=u.opfsFlags.OPFS_UNLOCK_ASAP),b.sqlite3_uri_boolean(U,"delete-before-open",0)&&(ee|=u.opfsFlags.OPFS_UNLINK_BEFORE_OPEN),U=S.cstrToJs(U));const C=Object.create(null);
3C.fid=G,C.filename=U,C.sab=new SharedArrayBuffer(u.fileBufferSize),C.flags=V,C.readOnly=!(t.SQLITE_OPEN_CREATE&V)&&!!(V&b.SQLITE_OPEN_READONLY);const E=Q("xOpen",G,U,V,ee);return E||(C.readOnly&&S.poke(Z,b.SQLITE_OPEN_READONLY,"i32"),oe[G]=C,C.sabView=u.sabFileBufView,C.sq3File=new D(G),C.sq3File.$pMethods=c.pointer,C.lockType=b.SQLITE_LOCK_NONE),ue(),E}};_&&(p.$xRandomness=_.$xRandomness,p.$xSleep=_.$xSleep),p.$xRandomness||(me.xRandomness=function(T,B,U){const G=S.heap8u();let V=0;for(;V<B;++V)G[U+V]=Math.random()*255e3&255;return V}),p.$xSleep||(me.xSleep=function(T,B){return Atomics.wait(u.sabOPView,u.opIds.xSleep,0,B),0}),L.getResolvedPath=function(T,B){const U=new URL(T,"file://irrelevant").pathname;return B?U.split("/").filter(G=>!!G):U},L.getDirForFilename=async function(B,U=!1){const G=L.getResolvedPath(B,!0),V=G.pop();let Z=L.rootDirectory;for(const ee of G)ee&&(Z=await Z.getDirectoryHandle(ee,{create:!!U}));return[Z,V]},L.mkdir=async function(T){try{return await L.getDirForFilename(T+"/filepart",!0),!0}catch{return!1}},L.entryExists=async function(T){try{const[B,U]=await L.getDirForFilename(T);return await B.getFileHandle(U),!0}catch{return!1}},L.randomFilename=te,L.treeList=async function(){const T=async function U(G,V){V.name=G.name,V.dirs=[],V.files=[];for await(const Z of G.values())if(Z.kind==="directory"){const ee=Object.create(null);V.dirs.push(ee),await U(Z,ee)}else V.files.push(Z.name)},B=Object.create(null);return await T(L.rootDirectory,B),B},L.rmfr=async function(){const T=L.rootDirectory,B={recurse:!0};for await(const U of T.values())T.removeEntry(U.name,B)},L.unlink=async function(T,B=!1,U=!1){try{const[G,V]=await L.getDirForFilename(T,!1);return await G.removeEntry(V,{recursive:B}),!0}catch(G){if(U)throw new Error("unlink(",arguments[0],") failed: "+G.message,{cause:G});return!1}},L.traverse=async function(T){const B={recursive:!0,directory:L.rootDirectory};typeof T=="function"&&(T={callback:T}),T=Object.assign(B,T||{}),async function G(V,Z){for await(const ee of V.values()){if(T.callback(ee,V,Z)===!1)return!1;if(T.recursive&&ee.kind==="directory"&&await G(ee,Z+1)===!1)break}}(T.directory,0)};const be=async function(T,B){const[U,G]=await L.getDirForFilename(T,!0);let Z=await(await U.getFileHandle(G,{create:!0})).createSyncAccessHandle(),ee=0,C,E=!1;try{for(Z.truncate(0);(C=await B())!==void 0;)C instanceof ArrayBuffer&&(C=new Uint8Array(C)),ee===0&&C.byteLength>=15&&(w.affirmDbHeader(C),E=!0),Z.write(C,{at:ee}),ee+=C.byteLength;if((ee<512||ee%512!==0)&&j("Input size",ee,"is not correct for an SQLite database."),!E){const d=new Uint8Array(20);Z.read(d,{at:0}),w.affirmDbHeader(d)}return Z.write(new Uint8Array([1,1]),{at:18}),ee}catch(d){throw await Z.close(),Z=void 0,await U.removeEntry(G).catch(()=>{}),d}finally{Z&&await Z.close()}};if(L.importDb=async function(T,B){if(B instanceof Function)return be(T,B);B instanceof ArrayBuffer&&(B=new Uint8Array(B)),w.affirmIsDb(B);const U=B.byteLength,[G,V]=await L.getDirForFilename(T,!0);let Z,ee=0;try{return Z=await(await G.getFileHandle(V,{create:!0})).createSyncAccessHandle(),Z.truncate(0),ee=Z.write(B,{at:0}),ee!=U&&j("Expected to write "+U+" bytes but wrote "+ee+"."),Z.write(new Uint8Array([1,1]),{at:18}),ee}catch(C){throw Z&&(await Z.close(),Z=void 0),await G.removeEntry(V).catch(()=>{}),C}finally{Z&&await Z.close()}},t.oo1){const T=function(...B){const U=t.oo1.DB.dbCtorHelper.normalizeArgs(...B);U.vfs=p.$zName,t.oo1.DB.dbCtorHelper.call(this,U)};T.prototype=Object.create(t.oo1.DB.prototype),t.oo1.OpfsDb=T,T.importDb=L.importDb,t.oo1.DB.dbCtorHelper.setVfsPostOpenCallback(p.pointer,function(B,U){U.capi.sqlite3_busy_timeout(B,1e4)})}const Ee=function(){const T=S.scopedAllocPush(),B=new D;try{const U=B.pointer,G=b.SQLITE_OPEN_CREATE|b.SQLITE_OPEN_READWRITE|b.SQLITE_OPEN_MAIN_DB,V=S.scopedAlloc(8),Z="/sanity/check/file"+te(8),ee=S.scopedAllocCString(Z);let C;if(u.s11n.serialize("This is ä string."),C=u.s11n.deserialize(),H("deserialize() says:",C),C[0]!=="This is ä string."&&j("String d13n error."),me.xAccess(p.pointer,ee,0,V),C=S.peek(V,"i32"),H("xAccess(",Z,") exists ?=",C),C=me.xOpen(p.pointer,ee,U,G,V),H("open rc =",C,"state.sabOPView[xOpen] =",u.sabOPView[u.opIds.xOpen]),C!==0){x("open failed with code",C);return}me.xAccess(p.pointer,ee,0,V),C=S.peek(V,"i32"),C||j("xAccess() failed to detect file."),C=pe.xSync(B.pointer,0),C&&j("sync failed w/ rc",C),C=pe.xTruncate(B.pointer,1024),C&&j("truncate failed w/ rc",C),S.poke(V,0,"i64"),C=pe.xFileSize(B.pointer,V),C&&j("xFileSize failed w/ rc",C),H("xFileSize says:",S.peek(V,"i64")),C=pe.xWrite(B.pointer,ee,10,1),
3C&&j("xWrite() failed!");const E=S.scopedAlloc(16);C=pe.xRead(B.pointer,E,6,2),S.poke(E+6,0);let d=S.cstrToJs(E);H("xRead() got:",d),d!=="sanity"&&j("Unexpected xRead() value."),me.xSleep&&(H("xSleep()ing before close()ing..."),me.xSleep(p.pointer,2e3),H("waking up from xSleep()")),C=pe.xClose(U),H("xClose rc =",C,"sabOPView =",u.sabOPView),H("Deleting file:",Z),me.xDelete(p.pointer,ee,4660),me.xAccess(p.pointer,ee,0,V),C=S.peek(V,"i32"),C&&j("Expecting 0 from xAccess(",Z,") after xDelete()."),P("End of OPFS sanity checks.")}finally{B.dispose(),S.scopedAllocPop(T)}};m.onmessage=function({data:T}){switch(T.type){case"opfs-unavailable":z(new Error(T.payload.join(" ")));break;case"opfs-async-loaded":m.postMessage({type:"opfs-async-init",args:u});break;case"opfs-async-inited":{if(y===!0)break;try{t.vfs.installVfs({io:{struct:c,methods:pe},vfs:{struct:p,methods:me}}),u.sabOPView=new Int32Array(u.sabOP),u.sabFileBufView=new Uint8Array(u.sabIO,0,u.fileBufferSize),u.sabS11nView=new Uint8Array(u.sabIO,u.sabS11nOffset,u.sabS11nSize),X(),s.sanityChecks&&(P("Running sanity checks because of opfs-sanity-check URL arg..."),Ee()),K()?navigator.storage.getDirectory().then(B=>{m.onerror=m._originalOnError,delete m._originalOnError,t.opfs=L,L.rootDirectory=B,H("End of OPFS sqlite3_vfs setup.",p),f()}).catch(z):f()}catch(B){x(B),z(B)}break}default:{const B="Unexpected message from the OPFS async worker: "+JSON.stringify(T);x(B),z(new Error(B));break}}}}))};n.defaultProxyUri="sqlite3-opfs-async-proxy.js",globalThis.sqlite3ApiBootstrap.initializersAsync.push(async r=>{try{let s=n.defaultProxyUri;return r.scriptInfo.sqlite3Dir&&(n.defaultProxyUri=r.scriptInfo.sqlite3Dir+s),n().catch(o=>{r.config.warn("Ignoring inability to install OPFS sqlite3_vfs:",o.message)})}catch(s){return r.config.error("installOpfsVfs() exception:",s),Promise.reject(s)}})}),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){var se,ne,ue,pe,me,be,Ee,T,B,U,G,V,ot,ee;const n=t.util.toss,r=t.util.toss3,s=Object.create(null),o=t.capi,h=t.util,q=t.wasm,O=4096,N=512,W=4,H=8,P=N+W,x=N,j=P,b=O,w=o.SQLITE_OPEN_MAIN_DB|o.SQLITE_OPEN_MAIN_JOURNAL|o.SQLITE_OPEN_SUPER_JOURNAL|o.SQLITE_OPEN_WAL,S=".opaque",M=()=>Math.random().toString(36).slice(2),D=new TextDecoder,A=new TextEncoder,L=Object.assign(Object.create(null),{name:"opfs-sahpool",directory:void 0,initialCapacity:6,clearOnInit:!1,verbosity:2,forceReinitIfPreviouslyFailed:!1}),K=[t.config.error,t.config.warn,t.config.log];t.config.log;const c=t.config.warn;t.config.error;const p=new Map,y=C=>p.get(C),z=(C,E)=>{E?p.set(C,E):p.delete(C)},f=new Map,m=C=>f.get(C),l=(C,E)=>{E?f.set(C,E):f.delete(C)},_={xCheckReservedLock:function(C,E){const d=m(C);return d.log("xCheckReservedLock"),d.storeErr(),q.poke32(E,1),0},xClose:function(C){const E=m(C);E.storeErr();const d=E.getOFileForS3File(C);if(d)try{E.log(`xClose ${d.path}`),E.mapS3FileToOFile(C,!1),d.sah.flush(),d.flags&o.SQLITE_OPEN_DELETEONCLOSE&&E.deletePath(d.path)}catch(I){return E.storeErr(I,o.SQLITE_IOERR)}return 0},xDeviceCharacteristics:function(C){return o.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(C,E,d){return o.SQLITE_NOTFOUND},xFileSize:function(C,E){const d=m(C);d.log("xFileSize");const F=d.getOFileForS3File(C).sah.getSize()-b;return q.poke64(E,BigInt(F)),0},xLock:function(C,E){const d=m(C);d.log(`xLock ${E}`),d.storeErr();const I=d.getOFileForS3File(C);return I.lockType=E,0},xRead:function(C,E,d,I){const F=m(C);F.storeErr();const R=F.getOFileForS3File(C);F.log(`xRead ${R.path} ${d} @ ${I}`);try{const $=R.sah.read(q.heap8u().subarray(E,E+d),{at:b+Number(I)});return $<d?(q.heap8u().fill(0,E+$,E+d),o.SQLITE_IOERR_SHORT_READ):0}catch($){return F.storeErr($,o.SQLITE_IOERR)}},xSectorSize:function(C){return O},xSync:function(C,E){const d=m(C);d.log(`xSync ${E}`),d.storeErr();const I=d.getOFileForS3File(C);try{return I.sah.flush(),0}catch(F){return d.storeErr(F,o.SQLITE_IOERR)}},xTruncate:function(C,E){const d=m(C);d.log(`xTruncate ${E}`),d.storeErr();const I=d.getOFileForS3File(C);try{return I.sah.truncate(b+Number(E)),0}catch(F){return d.storeErr(F,o.SQLITE_IOERR)}},xUnlock:function(C,E){const d=m(C);d.log("xUnlock");const I=d.getOFileForS3File(C);return I.lockType=E,0},xWrite:function(C,E,d,I){const F=m(C);F.storeErr();const R=F.getOFileForS3File(C);F.log(`xWrite ${R.path} ${d} ${I}`);try{const $=R.sah.write(q.heap8u().subarray(E,E+d),{at:b+Number(I)});return d===$?0:n("Unknown write() failure.")}catch($){return F.storeErr($,o.SQLITE_IOERR)}}},u=new o.sqlite3_io_methods;u.$iVersion=1,t.vfs.installVfs({io:{struct:u,methods:_}});const k={xAccess:function(C,E,d,I){const F=y(C);F.storeErr();try{const R=F.getPath(E);q.poke32(I,F.hasFilename(R)?1:0)}catch{q.poke32(I,0)}return 0},xCurrentTime:function(C,E){return q.poke(E,24405875e-1+new Date().getTime()/864e5,"double"),0},xCurrentTimeInt64:function(C,E){return q.poke(E,24405875e-1*864e5+new Date().getTime(),"i64"),0},xDelete:function(C,E,d){const I=y(C);I.log(`xDelete ${q.cstrToJs(E)}`),I.storeErr();try{return I.deletePath(I.getPath(E)),0}catch(F){return I.storeErr(F),o.SQLITE_IOERR_DELETE}},xFullPathname:function(C,E,d,I){return q.cstrncpy(I,E,d)<d?0:o.SQLITE_CANTOPEN},xGetLastError:function(C,E,d){const I=y(C),F=I.popErr();if(I.log(`xGetLastError ${E} e =`,F),F){const R=q.scopedAllocPush();try{const[$,ie]=q.scopedAllocCString(F.message,!0);q.cstrncpy(d,$,E),ie>E&&q.poke8(d+E-1,0)}catch{return o.SQLITE_NOMEM}finally{q.scopedAllocPop(R)}}return F?F.sqlite3Rc||o.SQLITE_IOERR:0},xOpen:function(E,d,I,F,R){const $=y(E);try{$.log(`xOpen ${q.cstrToJs(d)} ${F}`);const ie=d&&q.peek8(d)?$.getPath(d):M();let _e=$.getSAHForPath(ie);!_e&&F&o.SQLITE_OPEN_CREATE&&($.getFileCount()<$.getCapacity()?(_e=$.nextAvailableSAH(),$.setAssociatedPath(_e,ie,F)):n("SAH pool is full. Cannot create file",ie)),_e||n("file not found:",ie);const he={path:ie,flags:F,sah:_e};$.mapS3FileToOFile(I,he),he.lockType=o.SQLITE_LOCK_NONE;const Pe=new o.sqlite3_file(I);return Pe.$pMethods=u.pointer,Pe.dispose(),q.poke32(R,F),0}catch(ie){return $.storeErr(ie),o.SQLITE_CANTOPEN}}},Q=function(C){t.capi.sqlite3_vfs_find(C)&&r("VFS name is already registered:",C);const E=new o.sqlite3_vfs,d=o.sqlite3_vfs_find(null),I=d?new o.sqlite3_vfs(d):null;return E.$iVersion=2,E.$szOsFile=o.sqlite3_file.structInfo.sizeof,E.$mxPathname=N,E.addOnDispose(E.$zName=q.allocCString(C),()=>z(E.pointer,0)),I&&(E.$xRandomness=I.$xRandomness,E.$xSleep=I.$xSleep,I.dispose()),!E.$xRandomness&&!k.xRandomness&&(k.xRandomness=function(F,R,$){const ie=q.heap8u();let _e=0;for(;_e<R;++_e)ie[$+_e]=Math.random()*255e3&255;return _e}),!E.$xSleep&&!k.xSleep&&(k.xSleep=(F,R)=>0),t.vfs.installVfs({vfs:{struct:E,methods:k}}),E};class X{constructor(E=Object.create(null)){Ae(this,V);Nt(this,"vfsDir");Ae(this,se);Ae(this,ne);Ae(this,ue);Ae(this,pe,new Map);Ae(this,me,new Map);Ae(this,be,new Set);Ae(this,Ee,new Map);Ae(this,T,new Uint8Array(P));Ae(this,B);Ae(this,U);Ae(this,G);Ie(this,G,E.verbosity??L.verbosity),this.vfsName=E.name||L.name,Ie(this,U,Q(this.vfsName)),z(J(this,U).pointer,this),this.vfsDir=E.directory||"."+this.vfsName,Ie(this,B,new DataView(J(this,T).buffer,J(this,T).byteOffset)),this.isReady=this.reset(!!(E.clearOnInit??L.clearOnInit)).then(()=>
3{if(this.$error)throw this.$error;return this.getCapacity()?Promise.resolve(void 0):this.addCapacity(E.initialCapacity||L.initialCapacity)})}log(...E){it(this,V,ot).call(this,2,...E)}warn(...E){it(this,V,ot).call(this,1,...E)}error(...E){it(this,V,ot).call(this,0,...E)}getVfs(){return J(this,U)}getCapacity(){return J(this,pe).size}getFileCount(){return J(this,me).size}getFileNames(){const E=[],d=J(this,me).keys();for(const I of d)E.push(I);return E}async addCapacity(E){for(let d=0;d<E;++d){const I=M(),R=await(await J(this,ne).getFileHandle(I,{create:!0})).createSyncAccessHandle();J(this,pe).set(R,I),this.setAssociatedPath(R,"",0)}return this.getCapacity()}async reduceCapacity(E){let d=0;for(const I of Array.from(J(this,be))){if(d===E||this.getFileCount()===this.getCapacity())break;const F=J(this,pe).get(I);I.close(),await J(this,ne).removeEntry(F),J(this,pe).delete(I),J(this,be).delete(I),++d}return d}releaseAccessHandles(){for(const E of J(this,pe).keys())E.close();J(this,pe).clear(),J(this,me).clear(),J(this,be).clear()}async acquireAccessHandles(E){const d=[];for await(const[I,F]of J(this,ne))F.kind==="file"&&d.push([I,F]);return Promise.all(d.map(async([I,F])=>{try{const R=await F.createSyncAccessHandle();if(J(this,pe).set(R,I),E)R.truncate(b),this.setAssociatedPath(R,"",0);else{const $=this.getAssociatedPath(R);$?J(this,me).set($,R):J(this,be).add(R)}}catch(R){throw this.storeErr(R),this.releaseAccessHandles(),R}}))}getAssociatedPath(E){E.read(J(this,T),{at:0});const d=J(this,B).getUint32(x);if(J(this,T)[0]&&(d&o.SQLITE_OPEN_DELETEONCLOSE||(d&w)===0))return c(`Removing file with unexpected flags ${d.toString(16)}`,J(this,T)),this.setAssociatedPath(E,"",0),"";const I=new Uint32Array(H/4);E.read(I,{at:j});const F=this.computeDigest(J(this,T));if(I.every((R,$)=>R===F[$])){const R=J(this,T).findIndex($=>$===0);return R===0&&E.truncate(b),R?D.decode(J(this,T).subarray(0,R)):""}else return c("Disassociating file with bad digest."),this.setAssociatedPath(E,"",0),""}setAssociatedPath(E,d,I){const F=A.encodeInto(d,J(this,T));N<=F.written+1&&n("Path too long:",d),J(this,T).fill(0,F.written,N),J(this,B).setUint32(x,I);const R=this.computeDigest(J(this,T));E.write(J(this,T),{at:0}),E.write(R,{at:j}),E.flush(),d?(J(this,me).set(d,E),J(this,be).delete(E)):(E.truncate(b),J(this,be).add(E))}computeDigest(E){let d=3735928559,I=1103547991;for(const F of E)d=31*d+F*307,I=31*I+F*307;return new Uint32Array([d>>>0,I>>>0])}async reset(E){await this.isReady;let d=await navigator.storage.getDirectory(),I;for(const F of this.vfsDir.split("/"))F&&(I=d,d=await d.getDirectoryHandle(F,{create:!0}));return Ie(this,se,d),Ie(this,ue,I),Ie(this,ne,await J(this,se).getDirectoryHandle(S,{create:!0})),this.releaseAccessHandles(),this.acquireAccessHandles(E)}getPath(E){return q.isPtr(E)&&(E=q.cstrToJs(E)),(E instanceof URL?E:new URL(E,"file://localhost/")).pathname}deletePath(E){const d=J(this,me).get(E);return d&&(J(this,me).delete(E),this.setAssociatedPath(d,"",0)),!!d}storeErr(E,d){return E&&(E.sqlite3Rc=d||o.SQLITE_IOERR,this.error(E)),this.$error=E,d}popErr(){const E=this.$error;return this.$error=void 0,E}nextAvailableSAH(){const[E]=J(this,be).keys();return E}getOFileForS3File(E){return J(this,Ee).get(E)}mapS3FileToOFile(E,d){d?(J(this,Ee).set(E,d),l(E,this)):(J(this,Ee).delete(E),l(E,!1))}hasFilename(E){return J(this,me).has(E)}getSAHForPath(E){return J(this,me).get(E)}async removeVfs(){if(!J(this,U).pointer||!J(this,ne))return!1;o.sqlite3_vfs_unregister(J(this,U).pointer),J(this,U).dispose(),delete s[this.vfsName];try{this.releaseAccessHandles(),await J(this,se).removeEntry(S,{recursive:!0}),Ie(this,ne,void 0),await J(this,ue).removeEntry(J(this,se).name,{recursive:!0}),Ie(this,se,Ie(this,ue,void 0))}catch(E){t.config.error(this.vfsName,"removeVfs() failed:",E)}return!0}exportFile(E){const d=J(this,me).get(E)||n("File not found:",E),I=d.getSize()-b,F=new Uint8Array(I>0?I:0);if(I>0){const R=d.read(F,{at:b});R!=I&&n("Expected to read "+I+" bytes but read "+R+".")}return F}async importDbChunked(E,d){const I=J(this,me).get(E)||this.nextAvailableSAH()||n("No available handles to import to.");I.truncate(0);let F=0,R,$=!1;try{for(;(R=await d())!==void 0;)R instanceof ArrayBuffer&&(R=new Uint8Array(R)),F===0&&R.byteLength>
3=15&&(h.affirmDbHeader(R),$=!0),I.write(R,{at:b+F}),F+=R.byteLength;if((F<512||F%512!==0)&&n("Input size",F,"is not correct for an SQLite database."),!$){const ie=new Uint8Array(20);I.read(ie,{at:0}),h.affirmDbHeader(ie)}I.write(new Uint8Array([1,1]),{at:b+18})}catch(ie){throw this.setAssociatedPath(I,"",0),ie}return this.setAssociatedPath(I,E,o.SQLITE_OPEN_MAIN_DB),F}importDb(E,d){if(d instanceof ArrayBuffer)d=new Uint8Array(d);else if(d instanceof Function)return this.importDbChunked(E,d);const I=J(this,me).get(E)||this.nextAvailableSAH()||n("No available handles to import to."),F=d.byteLength;(F<512||F%512!=0)&&n("Byte array size is invalid for an SQLite db.");const R="SQLite format 3";for(let ie=0;ie<R.length;++ie)R.charCodeAt(ie)!==d[ie]&&n("Input does not contain an SQLite database header.");const $=I.write(d,{at:b});return $!=F?(this.setAssociatedPath(I,"",0),n("Expected to write "+F+" bytes but wrote "+$+".")):(I.write(new Uint8Array([1,1]),{at:b+18}),this.setAssociatedPath(I,E,o.SQLITE_OPEN_MAIN_DB)),$}}se=new WeakMap,ne=new WeakMap,ue=new WeakMap,pe=new WeakMap,me=new WeakMap,be=new WeakMap,Ee=new WeakMap,T=new WeakMap,B=new WeakMap,U=new WeakMap,G=new WeakMap,V=new WeakSet,ot=function(E,...d){J(this,G)>E&&K[E](this.vfsName+":",...d)};class te{constructor(E){Ae(this,ee);Ie(this,ee,E),this.vfsName=E.vfsName}async addCapacity(E){return J(this,ee).addCapacity(E)}async reduceCapacity(E){return J(this,ee).reduceCapacity(E)}getCapacity(){return J(this,ee).getCapacity(J(this,ee))}getFileCount(){return J(this,ee).getFileCount()}getFileNames(){return J(this,ee).getFileNames()}async reserveMinimumCapacity(E){const d=J(this,ee).getCapacity();return d<E?J(this,ee).addCapacity(E-d):d}exportFile(E){return J(this,ee).exportFile(E)}importDb(E,d){return J(this,ee).importDb(E,d)}async wipeFiles(){return J(this,ee).reset(!0)}unlink(E){return J(this,ee).deletePath(E)}async removeVfs(){return J(this,ee).removeVfs()}}ee=new WeakMap;const oe=async()=>{const C=await navigator.storage.getDirectory(),E=".opfs-sahpool-sync-check-"+M(),F=(await(await C.getFileHandle(E,{create:!0})).createSyncAccessHandle()).close();return await F,await C.removeEntry(E),F?.then&&n("The local OPFS API is too old for opfs-sahpool:","it has an async FileSystemSyncAccessHandle.close() method."),!0};t.installOpfsSAHPoolVfs=async function(C=Object.create(null)){C=Object.assign(Object.create(null),L,C||{});const E=C.name;if(C.$testThrowPhase1)throw C.$testThrowPhase1;if(s[E])try{return await s[E]}catch(d){if(C.forceReinitIfPreviouslyFailed)delete s[E];else throw d}return!globalThis.FileSystemHandle||!globalThis.FileSystemDirectoryHandle||!globalThis.FileSystemFileHandle||!globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle||!navigator?.storage?.getDirectory?s[E]=Promise.reject(new Error("Missing required OPFS APIs.")):s[E]=oe().then(async function(){if(C.$testThrowPhase2)throw C.$testThrowPhase2;const d=new X(C);return d.isReady.then(async()=>{const I=new te(d);if(t.oo1){const F=t.oo1,R=d.getVfs(),$=function(...ie){const _e=F.DB.dbCtorHelper.normalizeArgs(...ie);_e.vfs=R.$zName,F.DB.dbCtorHelper.call(this,_e)};$.prototype=Object.create(F.DB.prototype),I.OpfsSAHPoolDb=$}return d.log("VFS initialized."),I}).catch(async I=>{throw await d.removeVfs().catch(()=>{}),I})}).catch(d=>s[E]=Promise.reject(d))}}),typeof i<"u"){const t=Object.assign(Object.create(null),{exports:typeof g>"u"?i.asm:g,memory:i.wasmMemory},globalThis.sqlite3ApiConfig||{});globalThis.sqlite3ApiConfig=t;let n;try{n=globalThis.sqlite3ApiBootstrap()}catch(r){throw console.error("sqlite3ApiBootstrap() error:",r),r}finally{delete globalThis.sqlite3ApiBootstrap,delete globalThis.sqlite3ApiConfig}i.sqlite3=n}else console.warn("This is not running in an Emscripten module context, so","globalThis.sqlite3ApiBootstrap() is _not_ being called due to lack","of config info for the WASM environment.","It must be called manually.")},ae=Ue,ae}})();const lr=(function(){const le=jt;if(!le)throw new Error("Expecting globalThis.sqlite3InitModule to be defined by the Emscripten build.");const Y=globalThis.sqlite3InitModuleState=Object.assign(Object.create(null),{moduleScript:globalThis?.document?.currentScript,isWorker:typeof WorkerGlobalScope<"u",location:globalThis.location,urlParam
3s:globalThis?.location?.href?new URL(globalThis.location.href).searchParams:new URLSearchParams});if(Y.debugModule=Y.urlParams.has("sqlite3.debugModule")?(...ae)=>console.warn("sqlite3.debugModule:",...ae):()=>{},Y.urlParams.has("sqlite3.dir"))Y.sqlite3Dir=Y.urlParams.get("sqlite3.dir")+"/";else if(Y.moduleScript){const ae=Y.moduleScript.src.split("/");ae.pop(),Y.sqlite3Dir=ae.join("/")+"/"}if(globalThis.sqlite3InitModule=function ae(...i){return le(...i).then(ye=>{ye.runSQLite3PostLoadInit(ye);const ve=ye.sqlite3;ve.scriptInfo=Y,ae.__isUnderTest&&(ve.__isUnderTest=!0);const Ue=ve.asyncPostInit;return delete ve.asyncPostInit,Ue()}).catch(ye=>{throw console.error("Exception loading sqlite3 module:",ye),ye})},globalThis.sqlite3InitModule.ready=le.ready,globalThis.sqlite3InitModuleState.moduleScript){const ae=globalThis.sqlite3InitModuleState;let i=ae.moduleScript.src.split("/");i.pop(),ae.scriptDir=i.join("/")+"/"}return Y.debugModule("sqlite3InitModuleState =",Y),globalThis.sqlite3InitModule})();jt=lr;globalThis.sqlite3Worker1Promiser=function le(Y=le.defaultConfig){if(arguments.length===1&&typeof arguments[0]=="function"){const re=Y;Y=Object.assign(Object.create(null),le.defaultConfig),Y.onready=re}else Y=Object.assign(Object.create(null),le.defaultConfig,Y);const ae=Object.create(null),i=function(){},ye=Y.onerror||i,ve=Y.debug||i,Ue=Y.generateMessageId?void 0:Object.create(null),Ze=Y.generateMessageId||function(re){return re.type+"#"+(Ue[re.type]=(Ue[re.type]||0)+1)},Re=(...re)=>{throw new Error(re.join(" "))};Y.worker||(Y.worker=le.defaultConfig.worker),typeof Y.worker=="function"&&(Y.worker=Y.worker());let Ce,Ge;return Y.worker.onmessage=function(re){re=re.data,ve("worker1.onmessage",re);let qe=ae[re.messageId];if(!qe){if(re&&re.type==="sqlite3-api"&&re.result==="worker1-ready"){Y.onready&&Y.onready(Ge);return}if(qe=ae[re.type],qe&&qe.onrow){qe.onrow(re);return}Y.onunhandled?Y.onunhandled(arguments[0]):ye("sqlite3Worker1Promiser() unhandled worker message:",re);return}switch(delete ae[re.messageId],re.type){case"error":qe.reject(re);return;case"open":Ce||(Ce=re.dbId);break;case"close":re.dbId===Ce&&(Ce=void 0);break}try{qe.resolve(re)}catch(Te){qe.reject(Te)}},Ge=function(){let re;arguments.length===1?re=arguments[0]:arguments.length===2?(re=Object.create(null),re.type=arguments[0],re.args=arguments[1],re.dbId=re.args.dbId):Re("Invalid arguments for sqlite3Worker1Promiser()-created factory."),!re.dbId&&re.type!=="open"&&(re.dbId=Ce),re.messageId=Ze(re),re.departureTime=performance.now();const qe=Object.create(null);qe.message=re;let Te;re.type==="exec"&&re.args&&(typeof re.args.callback=="function"?(Te=re.messageId+":row",qe.onrow=re.args.callback,re.args.callback=Te,ae[Te]=qe):typeof re.args.callback=="string"&&Re("exec callback may not be a string when using the Promise interface."));let Ne=new Promise(function(ze,$e){qe.resolve=ze,qe.reject=$e,ae[re.messageId]=qe,ve("Posting",re.type,"message to Worker dbId="+(Ce||"default")+":",re),Y.worker.postMessage(re)});return Te&&(Ne=Ne.finally(()=>delete ae[Te])),Ne}};globalThis.sqlite3Worker1Promiser.defaultConfig={worker:function(){return new Worker(new URL(""+new URL("sqlite3-worker1-bundler-friendly-CD5RwdXq.js",import.meta.url).href,import.meta.url),{type:"module"})},onerror:(...le)=>console.error("worker1 promiser error",...le)};sqlite3Worker1Promiser.v2=function(le){let Y;typeof le=="function"?(Y=le,le={}):typeof le?.onready=="function"&&(Y=le.onready,delete le.onready);const ae=Object.create(null);le=Object.assign(le||Object.create(null),{onready:async function(ye){try{Y&&await Y(ye),ae.resolve(ye)}catch(ve){ae.reject(ve)}}});const i=new Promise(function(ye,ve){ae.resolve=ye,ae.reject=ve});try{this.original(le)}catch(ye){ae.reject(ye)}return i}.bind({original:sqlite3Worker1Promiser});sqlite3Worker1Promiser.v2;const fr=globalThis.sqlite3Worker1Promiser;export{jt as default,fr as sqlite3Worker1Promiser};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.