(function(){"use strict";var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(()=>{var Lw=Object.create,fs=Object.defineProperty,Pw=Object.getOwnPropertyDescriptor,Vw=Object.getOwnPropertyNames,Hw=Object.getPrototypeOf,zw=Object.prototype.hasOwnProperty,na=(e,t)=>{if(t=Symbol[e])return t;throw Error("Symbol."+e+" is not defined")},Ww=(e=>typeof commonjsRequire<"u"?commonjsRequire:typeof Proxy<"u"?new Proxy(e,{get:(t,i)=>(typeof commonjsRequire<"u"?commonjsRequire:t)[i]}):e)(function(e){if(typeof commonjsRequire<"u")return commonjsRequire.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),hs=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zi=(e,t)=>{for(var i in t)fs(e,i,{get:t[i],enumerable:!0})},Hf=(e,t,i,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of Vw(t))!zw.call(e,d)&&d!==i&&fs(e,d,{get:()=>t[d],enumerable:!(a=Pw(t,d))||a.enumerable});return e},zf=(e,t,i)=>(i=e!=null?Lw(Hw(e)):{},Hf(!e||!e.__esModule?fs(i,"default",{value:e,enumerable:!0}):i,e)),$w=e=>Hf(fs({},"__esModule",{value:!0}),e),Yw=function(e,t){this[0]=e,this[1]=t},Qi=e=>{var t=e[na("asyncIterator")],i=!1,a,d={};return t==null?(t=e[na("iterator")](),a=s=>d[s]=b=>t[s](b)):(t=t.call(e),a=s=>d[s]=b=>{if(i){if(i=!1,s==="throw")throw b;return b}return i=!0,{done:!1,value:new Yw(new Promise(_=>{var g=t[s](b);if(!(g instanceof Object))throw TypeError("Object expected");_(g)}),1)}}),d[na("iterator")]=()=>d,a("next"),"throw"in t?a("throw"):d.throw=s=>{throw s},"return"in t&&a("return"),d},xp=hs(()=>{}),Tp=hs(()=>{}),kp=hs((e,t)=>{var i=(()=>{var a=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(a=a||__filename),function(d={}){var s=d,b,_;s.ready=new Promise((r,n)=>{b=r,_=n});var g=Object.assign({},s),A="./this.program",T=(r,n)=>{throw n},M=typeof window=="object",U=typeof importScripts=="function",x=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",W="";function Ot(r){return s.locateFile?s.locateFile(r,W):W+r}var mt,Ut;if(x){var oi=xp(),Jt=Tp();U?W=Jt.dirname(W)+"/":W=__dirname+"/",mt=(r,n)=>(r=ky(r)?new URL(r):Jt.normalize(r),oi.readFileSync(r,n?void 0:"utf8")),Ut=r=>{var n=mt(r,!0);return n.buffer||(n=new Uint8Array(n)),n},!s.thisProgram&&process.argv.length>1&&(A=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),T=(r,n)=>{throw process.exitCode=r,n},s.inspect=()=>"[Emscripten Module object]"}else(M||U)&&(U?W=self.location.href:typeof document<"u"&&document.currentScript&&(W=document.currentScript.src),a&&(W=a),W.indexOf("blob:")!==0?W=W.substr(0,W.replace(/[?#].*/,"").lastIndexOf("/")+1):W="",mt=r=>{var n=new XMLHttpRequest;return n.open("GET",r,!1),n.send(null),n.responseText},U&&(Ut=r=>{var n=new XMLHttpRequest;return n.open("GET",r,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}));var ds=s.print||console.log.bind(console),le=s.printErr||console.error.bind(console);Object.assign(s,g),g=null,s.arguments&&s.arguments,s.thisProgram&&(A=s.thisProgram),s.quit&&(T=s.quit);var qi;s.wasmBinary&&(qi=s.wasmBinary),typeof WebAssembly!="object"&&Ai("no native wasm support detected");var br,vr=!1,nt;function be(r,n){r||Ai(n)}var vt,Tt,Ft,Dt,D,ut;function Qn(){var r=br.buffer;s.HEAP8=vt=new Int8Array(r),s.HEAP16=Ft=new Int16Array(r),s.HEAPU8=Tt=new Uint8Array(r),s.HEAPU16=Dt=new Uint16Array(r),s.HEAP32=D=new Int32Array(r),s.HEAPU32=ut=new Uint32Array(r),s.HEAPF32=new Float32Array(r),s.HEAPF64=new Float64Array(r)}var El=[],Ol=[],Ty=[],Dl=[];function Fy(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)Ry(s.preRun.shift());ia(El)}function Ey(){ia(Ol)}function Oy(){ia(Ty)}function Dy(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)Uy(s.postRun.shift());ia(Dl)}function Ry(r){El.unshift(r)}function My(r){Ol.unshift(r)}function Uy(r){Dl.unshift(r)}var gr=0,ws=null;function xy(r){gr++,s.monitorRunDependencies&&s.monitorRunDependencies(gr)}function Ny(r){if(gr--,s.monitorRunDependencies&&s.monitorRunDependencies(gr),gr==0&&ws){var n=ws;ws=null,n()}}function Ai(r){s.onAbort&&s.onAbort(r),r="Aborted("+r+")",le(r),vr=!0,nt=1,r+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(r);throw _(n),n}var Ly="data:application/octet-stream;base64,",Rl=r=>r.startsWith(Ly),ky=r=>r.startsWith("file://"),ts;ts="./duckdb-mvp.wasm",Rl(ts)||(ts=Ot(ts));function Ml(r){if(r==ts&&qi)return new Uint8Array(qi);if(Ut)return Ut(r);throw"both async and sync fetching of the wasm failed"}function Py(r){return!qi&&(M||U)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw"failed to load wasm binary file at '"+r+"'";return n.arrayBuffer()}).catch(()=>Ml(r)):Promise.resolve().then(()=>Ml(r))}function Ul(r,n,o){return Py(r).then(l=>WebAssembly.instantiate(l,n)).then(l=>l).then(o,l=>{le("failed to asynchronously prepare wasm: ".concat(l)),Ai(l)})}function Hy(r,n,o,l){return!r&&typeof WebAssembly.instantiateStreaming=="function"&&!Rl(n)&&!x&&typeof fetch=="function"?fetch(n,{credentials:"same-origin"}).then(c=>{var h=WebAssembly.instantiateStreaming(c,o);return h.then(l,function(u){return le("wasm streaming compile failed: ".concat(u)),le("falling back to ArrayBuffer instantiation"),Ul(n,o,l)})}):Ul(n,o,l)}function Vy(){var r={a:f_};function n(l,c){return w=l.exports,w=pw(w),br=w.uf,Qn(),$l=w.xf,My(w.vf),Ny(),w}xy();function o(l){n(l.instance)}if(s.instantiateWasm)try{return s.instantiateWasm(r,n)}catch(l){le("Module.instantiateWasm callback failed with error: ".concat(l)),_(l)}return Hy(qi,ts,r,o).catch(_),{}}var Ht,es;function xl(r){this.name="ExitStatus",this.message="Program terminated with exit(".concat(r,")"),this.status=r}var ia=r=>{for(;r.length>0;)r.shift()(s)},zy=s.noExitRuntime||!0,ra=[],eo=0;function qy(r){r>>>=0;var n=new yl(r);return n.get_caught()||(n.set_caught(!0),eo--),n.set_rethrown(!1),ra.push(n),tc(n.excPtr),n.get_exception_ptr()}var me=0,Yy=()=>{S(0,0);var r=ra.pop();ec(r.excPtr),me=0};function yl(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(n){ut[this.ptr+4>>>2>>>0]=n},this.get_type=function(){return ut[this.ptr+4>>>2>>>0]},this.set_destructor=function(n){ut[this.ptr+8>>>2>>>0]=n},this.get_destructor=function(){return ut[this.ptr+8>>>2>>>0]},this.set_caught=function(n){n=n?1:0,vt[this.ptr+12>>>0>>>0]=n},this.get_caught=function(){return vt[this.ptr+12>>>0>>>0]!=0},this.set_rethrown=function(n){n=n?1:0,vt[this.ptr+13>>>0>>>0]=n},this.get_rethrown=function(){return vt[this.ptr+13>>>0>>>0]!=0},this.init=function(n,o){this.set_adjusted_ptr(0),this.set_type(n),this.set_destructor(o)},this.set_adjusted_ptr=function(n){ut[this.ptr+16>>>2>>>0]=n},this.get_adjusted_ptr=function(){return ut[this.ptr+16>>>2>>>0]},this.get_exception_ptr=function(){var n=rc(this.get_type());if(n)return ut[this.excPtr>>>2>>>0];var o=this.get_adjusted_ptr();return o!==0?o:this.excPtr}}function Wy(r){throw r>>>=0,me||(me=r),me}var is=r=>{var n=me;if(!n)return Ss(0),0;var o=new yl(n);o.set_adjusted_ptr(n);var l=o.get_type();if(!l)return Ss(0),n;for(var c in r){var h=r[c];if(h===0||h===l)break;var u=o.ptr+16;if(ic(h,l,u))return Ss(h),n}return Ss(l),n};function Xy(){return is([])}function Gy(r){return r>>>=0,is([r])}function Ky(r,n){return r>>>=0,n>>>=0,is([r,n])}function Jy(r,n,o){return r>>>=0,n>>>=0,o>>>=0,is([r,n,o])}function Qy(r,n,o,l){return r>>>=0,n>>>=0,o>>>=0,l>>>=0,is([r,n,o,l])}function $y(r,n,o,l,c){return r>>>=0,n>>>=0,o>>>=0,l>>>=0,c>>>=0,is([r,n,o,l,c])}var Zy=()=>{var r=ra.pop();r||Ai("no exception to throw");var n=r.excPtr;throw r.get_rethrown()||(ra.push(r),r.set_rethrown(!0),r.set_caught(!1),eo++),me=n,me};function Ap(r,n,o){r>>>=0,n>>>=0,o>>>=0;var l=new yl(r);throw l.init(n,o),me=r,eo++,me}var Ep=()=>eo,Nl=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Ll=(r,n,o)=>{n>>>=0;for(var l=n+o,c=n;r[c]&&!(c>=l);)++c;if(c-n>16&&r.buffer&&Nl)return Nl.decode(r.subarray(n,c));for(var h="";n>10,56320|p&1023)}}return h},rs=(r,n)=>(r>>>=0,r?Ll(Tt,r,n):""),Ti={varargs:void 0,get(){var r=D[+Ti.varargs>>>2>>>0];return Ti.varargs+=4,r},getp(){return Ti.get()},getStr(r){var n=rs(r);return n}};function Dp(r,n,o,l,c){n>>>=0,o>>>=0,l>>>=0,c>>>=0;for(var h=0,u=n?D[n>>>2>>>0]:0,f=n?D[n+4>>>2>>>0]:0,y=o?D[o>>>2>>>0]:0,p=o?D[o+4>>>2>>>0]:0,v=l?D[l>>>2>>>0]:0,m=l?D[l+4>>>2>>>0]:0,C=0,F=0,O=0,k=0,P=0,z=0,E=(n?D[n>>>2>>>0]:0)|(o?D[o>>>2>>>0]:0)|(l?D[l>>>2>>>0]:0),N=(n?D[n+4>>>2>>>0]:0)|(o?D[o+4>>>2>>>0]:0)|(l?D[l+4>>>2>>>0]:0),dt=function(gw,mw,ww,vy){return gw<32?mw&vy:ww&vy},pt=0;pt>>2>>>0]:0,vw=n?D[c+8>>>2>>>0]:0;_y=(_w+vw/1e6)*1e3}hl=Cs.stream_ops.poll(Cs,_y)}hl&1&&dt(pt,u,f,Mt)&&(pt<32?C=C|Mt:F=F|Mt,h++),hl&4&&dt(pt,y,p,Mt)&&(pt<32?O=O|Mt:k=k|Mt,h++),hl&2&&dt(pt,v,m,Mt)&&(pt<32?P=P|Mt:z=z|Mt,h++)}}return n&&(D[n>>>2>>>0]=C,D[n+4>>>2>>>0]=F),o&&(D[o>>>2>>>0]=O,D[o+4>>>2>>>0]=k),l&&(D[l>>>2>>>0]=P,D[l+4>>>2>>>0]=z),h}function kl(){Ai("missing function: $SOCKFS")}kl.stub=!0;function pl(){Ai("missing function: $FS")}pl.stub=!0;var js=r=>{var n=kl.getSocket(r);if(!n)throw new pl.ErrnoError(8);return n},bl=r=>(r&255)+"."+(r>>8&255)+"."+(r>>16&255)+"."+(r>>24&255),Pl=r=>{var n="",o=0,l=0,c=0,h=0,u=0,f=0,y=[r[0]&65535,r[0]>>16,r[1]&65535,r[1]>>16,r[2]&65535,r[2]>>16,r[3]&65535,r[3]>>16],p=!0,v="";for(f=0;f<5;f++)if(y[f]!==0){p=!1;break}if(p){if(v=bl(y[6]|y[7]<<16),y[5]===-1)return n="::ffff:",n+=v,n;if(y[5]===0)return n="::",v==="0.0.0.0"&&(v=""),v==="0.0.0.1"&&(v="1"),n+=v,n}for(o=0;o<8;o++)y[o]===0&&(o-c>1&&(u=0),c=o,u++),u>l&&(l=u,h=o-l+1);for(o=0;o<8;o++){if(l>1&&y[o]===0&&o>=h&&o{var o=Ft[r>>>1>>>0],l=wl(Dt[r+2>>>1>>>0]),c;switch(o){case 2:if(n!==16)return{errno:28};c=D[r+4>>>2>>>0],c=bl(c);break;case 10:if(n!==28)return{errno:28};c=[D[r+8>>>2>>>0],D[r+12>>>2>>>0],D[r+16>>>2>>>0],D[r+20>>>2>>>0]],c=Pl(c);break;default:return{errno:5}}return{family:o,addr:c,port:l}},qo=r=>{for(var n=r.split("."),o=0;o<4;o++){var l=Number(n[o]);if(isNaN(l))return null;n[o]=l}return(n[0]|n[1]<<8|n[2]<<16|n[3]<<24)>>>0},Go=r=>parseInt(r),_l=r=>{var n,o,l,c,h=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,u=[];if(!h.test(r))return null;if(r==="::")return[0,0,0,0,0,0,0,0];for(r.startsWith("::")?r=r.replace("::","Z:"):r=r.replace("::",":Z:"),r.indexOf(".")>0?(r=r.replace(new RegExp("[.]","g"),":"),n=r.split(":"),n[n.length-4]=Go(n[n.length-4])+Go(n[n.length-3])*256,n[n.length-3]=Go(n[n.length-2])+Go(n[n.length-1])*256,n=n.slice(0,n.length-2)):n=r.split(":"),l=0,c=0,o=0;o{var l=Hl(r,n);if(l.errno)throw new pl.ErrnoError(l.errno);return l.addr=Kt.lookup_addr(l.addr)||l.addr,l};function qp(r,n,o,l,c,h){n>>>=0,o>>>=0;var u=js(r),f=Vl(n,o);return u.sock_ops.bind(u,f.addr,f.port),0}function Yp(r,n,o,l,c,h){n>>>=0,o>>>=0;var u=js(r),f=Vl(n,o);return u.sock_ops.connect(u,f.addr,f.port),0}function Wp(r,n,o,l){}function Xp(r,n,o){return o>>>=0,Ti.varargs=o,0}function Gp(r,n){}function Kp(r,n,o){}var zl=(r,n,o,l)=>{if(o>>>=0,!(l>0))return 0;for(var c=o,h=o+l-1,u=0;u=55296&&f<=57343){var y=r.charCodeAt(++u);f=65536+((f&1023)<<10)|y&1023}if(f<=127){if(o>=h)break;n[o++>>>0]=f}else if(f<=2047){if(o+1>=h)break;n[o++>>>0]=192|f>>6,n[o++>>>0]=128|f&63}else if(f<=65535){if(o+2>=h)break;n[o++>>>0]=224|f>>12,n[o++>>>0]=128|f>>6&63,n[o++>>>0]=128|f&63}else{if(o+3>=h)break;n[o++>>>0]=240|f>>18,n[o++>>>0]=128|f>>12&63,n[o++>>>0]=128|f>>6&63,n[o++>>>0]=128|f&63}}return n[o>>>0]=0,o-c},vl=(r,n,o)=>zl(r,Tt,n,o);function Jp(r,n,o){}var ql=(r,n)=>(Tt.fill(0,r,r+n),r),gl=(r,n,o,l,c)=>{switch(n){case 2:o=qo(o),ql(r,16),c&&(D[c>>>2>>>0]=16),Ft[r>>>1>>>0]=n,D[r+4>>>2>>>0]=o,Ft[r+2>>>1>>>0]=Zo(l);break;case 10:o=_l(o),ql(r,28),c&&(D[c>>>2>>>0]=28),D[r>>>2>>>0]=n,D[r+8>>>2>>>0]=o[0],D[r+12>>>2>>>0]=o[1],D[r+16>>>2>>>0]=o[2],D[r+20>>>2>>>0]=o[3],Ft[r+2>>>1>>>0]=Zo(l);break;default:return 5}return 0};function Qp(r,n,o,l,c,h){n>>>=0,o>>>=0;var u=js(r);return u.daddr?(gl(n,u.family,Kt.lookup_name(u.daddr),u.dport,o),0):-53}function $p(r,n,o,l,c,h){l>>>=0,c>>>=0;var u=js(r);return n===1&&o===4?(D[l>>>2>>>0]=u.error,D[c>>>2>>>0]=4,u.error=null,0):-50}function Zp(r,n,o){return o>>>=0,Ti.varargs=o,0}function tb(r,n){}function eb(r,n,o){}function ib(r,n,o,l){}function rb(r,n,o,l){l>>>=0,Ti.varargs=l}function nb(r,n,o,l,c,h){n>>>=0,o>>>=0,c>>>=0,h>>>=0;var u=js(r),f=u.sock_ops.recvmsg(u,o);if(!f)return 0;if(c)var y=gl(c,u.family,Kt.lookup_name(f.addr),f.port,h);return Tt.set(f.buffer,n>>>0),f.buffer.byteLength}function sb(r,n,o,l){}function ab(r){}function ob(r,n,o,l,c,h){}var lb=(r,n,o)=>{};function cb(r,n){}function hb(r,n,o){}var ub=!0,db=()=>ub,fb=()=>{Ai("")};function yb(r,n){return globalThis.DUCKDB_RUNTIME.createDirectory(s,r,n)}function pb(r,n){return globalThis.DUCKDB_RUNTIME.checkDirectory(s,r,n)}function bb(r,n){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(s,r,n)}function _b(r,n){return globalThis.DUCKDB_RUNTIME.removeDirectory(s,r,n)}function vb(r){return globalThis.DUCKDB_RUNTIME.closeFile(s,r)}function gb(r,n){return globalThis.DUCKDB_RUNTIME.checkFile(s,r,n)}function mb(r){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(s,r)}function wb(r,n,o,l){return globalThis.DUCKDB_RUNTIME.moveFile(s,r,n,o,l)}function jb(r,n){return globalThis.DUCKDB_RUNTIME.openFile(s,r,n)}function Ib(r,n,o,l){return globalThis.DUCKDB_RUNTIME.readFile(s,r,n,o,l)}function Sb(r,n){return globalThis.DUCKDB_RUNTIME.truncateFile(s,r,n)}function Cb(r,n,o,l){return globalThis.DUCKDB_RUNTIME.writeFile(s,r,n,o,l)}function Ab(r){return globalThis.DUCKDB_RUNTIME.getDefaultDataProtocol(r)}function Bb(r,n){return globalThis.DUCKDB_RUNTIME.glob(s,r,n)}function Tb(r){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(s,r)}function Fb(r,n,o,l,c,h){return globalThis.DUCKDB_RUNTIME.callScalarUDF(s,r,n,o,l,c,h)}var Eb=()=>Date.now(),Yl=()=>4294901760;function Ob(){return Yl()}var Wl;Wl=()=>performance.now();function Db(r,n,o){return r>>>=0,n>>>=0,o>>>=0,Tt.copyWithin(r>>>0,n>>>0,n+o>>>0)}var Rb=r=>{var n=br.buffer,o=(r-n.byteLength+65535)/65536;try{return br.grow(o),Qn(),1}catch{}};function Mb(r){r>>>=0;var n=Tt.length,o=Yl();if(r>o)return!1;for(var l=(y,p)=>y+(p-y%p)%p,c=1;c<=4;c*=2){var h=n*(1+.2/c);h=Math.min(h,r+100663296);var u=Math.min(o,l(Math.max(r,h),65536)),f=Rb(u);if(f)return!0}return!1}var ml={},Ub=()=>A||"./this.program",Is=()=>{if(!Is.strings){var r=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:r,_:Ub()};for(var o in ml)ml[o]===void 0?delete n[o]:n[o]=ml[o];var l=[];for(var o in n)l.push("".concat(o,"=").concat(n[o]));Is.strings=l}return Is.strings},xb=(r,n)=>{for(var o=0;o>>0>>>0]=r.charCodeAt(o);vt[n>>>0>>>0]=0},Nb=function(r,n){r>>>=0,n>>>=0;var o=0;return Is().forEach((l,c)=>{var h=n+o;ut[r+c*4>>>2>>>0]=h,xb(l,h),o+=l.length+1}),0},Lb=function(r,n){r>>>=0,n>>>=0;var o=Is();ut[r>>>2>>>0]=o.length;var l=0;return o.forEach(c=>l+=c.length+1),ut[n>>>2>>>0]=l,0},kb=r=>52;function Pb(r,n){n>>>=0;var o=0,l=0,c=0;{var h=2;r==0?o=2:(r==1||r==2)&&(o=64),c=1}return vt[n>>>0>>>0]=h,Ft[n+2>>>1>>>0]=c,es=[o>>>0,(Ht=o,+Math.abs(Ht)>=1?Ht>0?+Math.floor(Ht/4294967296)>>>0:~~+Math.ceil((Ht-+(~~Ht>>>0))/4294967296)>>>0:0)],D[n+8>>>2>>>0]=es[0],D[n+12>>>2>>>0]=es[1],es=[l>>>0,(Ht=l,+Math.abs(Ht)>=1?Ht>0?+Math.floor(Ht/4294967296)>>>0:~~+Math.ceil((Ht-+(~~Ht>>>0))/4294967296)>>>0:0)],D[n+16>>>2>>>0]=es[0],D[n+20>>>2>>>0]=es[1],0}function Hb(r,n,o,l,c,h){return 52}function Vb(r,n,o,l,c,h){return 52}function zb(r,n,o,l){return 52}function qb(r,n,o,l,c){return 70}var Yb=r=>52,Wb=[null,[],[]],Xb=(r,n)=>{var o=Wb[r];n===0||n===10?((r===1?ds:le)(Ll(o,0)),o.length=0):o.push(n)};function Gb(r,n,o,l){n>>>=0,o>>>=0,l>>>=0;for(var c=0,h=0;h>>2>>>0],f=ut[n+4>>>2>>>0];n+=8;for(var y=0;y>>0]);c+=f}return ut[l>>>2>>>0]=c,0}function Kb(r,n,o,l){r>>>=0,n>>>=0,o>>>=0,l>>>=0;var c=0,h=0,u=0,f=0,y=0,p=0,v;function m(C,F,O,k,P,z){var E,N,dt,pt;return N=C===10?28:16,P=C===10?Pl(P):bl(P),E=jl(N),pt=gl(E,C,P,z),be(!pt),dt=jl(32),D[dt+4>>>2>>>0]=C,D[dt+8>>>2>>>0]=F,D[dt+12>>>2>>>0]=O,ut[dt+24>>>2>>>0]=k,ut[dt+20>>>2>>>0]=E,C===10?D[dt+16>>>2>>>0]=28:D[dt+16>>>2>>>0]=16,D[dt+28>>>2>>>0]=0,dt}if(o&&(u=D[o>>>2>>>0],f=D[o+4>>>2>>>0],y=D[o+8>>>2>>>0],p=D[o+12>>>2>>>0]),y&&!p&&(p=y===2?17:6),!y&&p&&(y=p===17?2:1),p===0&&(p=6),y===0&&(y=1),!r&&!n)return-2;if(u&-1088||o!==0&&D[o>>>2>>>0]&2&&!r)return-1;if(u&32)return-2;if(y!==0&&y!==1&&y!==2)return-7;if(f!==0&&f!==2&&f!==10)return-6;if(n&&(n=rs(n),h=parseInt(n,10),isNaN(h)))return u&1024?-2:-8;if(!r)return f===0&&(f=2),u&1||(f===2?c=Qo(2130706433):c=[0,0,0,1]),v=m(f,y,p,null,c,h),ut[l>>>2>>>0]=v,0;if(r=rs(r),c=qo(r),c!==null)if(f===0||f===2)f=2;else if(f===10&&u&8)c=[0,0,Qo(65535),c],f=10;else return-2;else if(c=_l(r),c!==null)if(f===0||f===10)f=10;else return-2;return c!=null?(v=m(f,y,p,r,c,h),ut[l>>>2>>>0]=v,0):u&4?-2:(r=Kt.lookup_name(r),c=qo(r),f===0?f=2:f===10&&(c=[0,0,Qo(65535),c]),v=m(f,y,p,null,c,h),ut[l>>>2>>>0]=v,0)}var Jb=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return l=>crypto.getRandomValues(l);if(x)try{var r=Ww("crypto"),n=r.randomFillSync;if(n)return l=>r.randomFillSync(l);var o=r.randomBytes;return l=>(l.set(o(l.byteLength)),l)}catch{}Ai("initRandomDevice")},Xl=r=>(Xl=Jb())(r);function Qb(r,n){return r>>>=0,n>>>=0,Xl(Tt.subarray(r>>>0,r+n>>>0)),0}function $b(r,n,o,l,c,h,u){r>>>=0,o>>>=0,c>>>=0;var f=Hl(r,n);if(f.errno)return-6;var y=f.port,p=f.addr,v=!1;if(o&&l){var m;if(u&1||!(m=Kt.lookup_addr(p))){if(u&8)return-2}else p=m;var C=vl(p,o,l);C+1>=l&&(v=!0)}if(c&&h){y=""+y;var C=vl(y,c,h);C+1>=h&&(v=!0)}return v?-12:0}function Zb(r){return r>>>=0,r}var Ko=r=>r%4===0&&(r%100!==0||r%400===0),t_=(r,n)=>{for(var o=0,l=0;l<=n;o+=r[l++]);return o},Gl=[31,29,31,30,31,30,31,31,30,31,30,31],Kl=[31,28,31,30,31,30,31,31,30,31,30,31],e_=(r,n)=>{for(var o=new Date(r.getTime());n>0;){var l=Ko(o.getFullYear()),c=o.getMonth(),h=(l?Gl:Kl)[c];if(n>h-o.getDate())n-=h-o.getDate()+1,o.setDate(1),c<11?o.setMonth(c+1):(o.setMonth(0),o.setFullYear(o.getFullYear()+1));else return o.setDate(o.getDate()+n),o}return o},Jl=r=>{for(var n=0,o=0;o=55296&&l<=57343?(n+=4,++o):n+=3}return n};function i_(r,n,o){var l=Jl(r)+1,c=new Array(l);return zl(r,c,0,c.length),c}var Ql=(r,n)=>{vt.set(r,n>>>0)};function r_(r,n,o,l){r>>>=0,n>>>=0,o>>>=0,l>>>=0;var c=ut[l+40>>>2>>>0],h={tm_sec:D[l>>>2>>>0],tm_min:D[l+4>>>2>>>0],tm_hour:D[l+8>>>2>>>0],tm_mday:D[l+12>>>2>>>0],tm_mon:D[l+16>>>2>>>0],tm_year:D[l+20>>>2>>>0],tm_wday:D[l+24>>>2>>>0],tm_yday:D[l+28>>>2>>>0],tm_isdst:D[l+32>>>2>>>0],tm_gmtoff:D[l+36>>>2>>>0],tm_zone:c?rs(c):""},u=rs(o),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var y in f)u=u.replace(new RegExp(y,"g"),f[y]);var p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],v=["January","February","March","April","May","June","July","August","September","October","November","December"];function m(E,N,dt){for(var pt=typeof E=="number"?E.toString():E||"";pt.length0?1:0}var pt;return(pt=dt(E.getFullYear()-N.getFullYear()))===0&&(pt=dt(E.getMonth()-N.getMonth()))===0&&(pt=dt(E.getDate()-N.getDate())),pt}function O(E){switch(E.getDay()){case 0:return new Date(E.getFullYear()-1,11,29);case 1:return E;case 2:return new Date(E.getFullYear(),0,3);case 3:return new Date(E.getFullYear(),0,2);case 4:return new Date(E.getFullYear(),0,1);case 5:return new Date(E.getFullYear()-1,11,31);case 6:return new Date(E.getFullYear()-1,11,30)}}function k(E){var N=e_(new Date(E.tm_year+1900,0,1),E.tm_yday),dt=new Date(N.getFullYear(),0,4),pt=new Date(N.getFullYear()+1,0,4),Mt=O(dt),Cs=O(pt);return F(Mt,N)<=0?F(Cs,N)<=0?N.getFullYear()+1:N.getFullYear():N.getFullYear()-1}var P={"%a":E=>p[E.tm_wday].substring(0,3),"%A":E=>p[E.tm_wday],"%b":E=>v[E.tm_mon].substring(0,3),"%B":E=>v[E.tm_mon],"%C":E=>{var N=E.tm_year+1900;return C(N/100|0,2)},"%d":E=>C(E.tm_mday,2),"%e":E=>m(E.tm_mday,2," "),"%g":E=>k(E).toString().substring(2),"%G":E=>k(E),"%H":E=>C(E.tm_hour,2),"%I":E=>{var N=E.tm_hour;return N==0?N=12:N>12&&(N-=12),C(N,2)},"%j":E=>C(E.tm_mday+t_(Ko(E.tm_year+1900)?Gl:Kl,E.tm_mon-1),3),"%m":E=>C(E.tm_mon+1,2),"%M":E=>C(E.tm_min,2),"%n":()=>` `,"%p":E=>E.tm_hour>=0&&E.tm_hour<12?"AM":"PM","%S":E=>C(E.tm_sec,2),"%t":()=>" ","%u":E=>E.tm_wday||7,"%U":E=>{var N=E.tm_yday+7-E.tm_wday;return C(Math.floor(N/7),2)},"%V":E=>{var N=Math.floor((E.tm_yday+7-(E.tm_wday+6)%7)/7);if((E.tm_wday+371-E.tm_yday-2)%7<=2&&N++,N){if(N==53){var dt=(E.tm_wday+371-E.tm_yday)%7;dt!=4&&(dt!=3||!Ko(E.tm_year))&&(N=1)}}else{N=52;var pt=(E.tm_wday+7-E.tm_yday-1)%7;(pt==4||pt==5&&Ko(E.tm_year%400-1))&&N++}return C(N,2)},"%w":E=>E.tm_wday,"%W":E=>{var N=E.tm_yday+7-(E.tm_wday+6)%7;return C(Math.floor(N/7),2)},"%y":E=>(E.tm_year+1900).toString().substring(2),"%Y":E=>E.tm_year+1900,"%z":E=>{var N=E.tm_gmtoff,dt=N>=0;return N=Math.abs(N)/60,N=N/60*100+N%60,(dt?"+":"-")+("0000"+N).slice(-4)},"%Z":E=>E.tm_zone,"%%":()=>"%"};u=u.replace(/%%/g,"\0\0");for(var y in P)u.includes(y)&&(u=u.replace(new RegExp(y,"g"),P[y](h)));u=u.replace(/\0\0/g,"%");var z=i_(u);return z.length>n?0:(Ql(z,r),z.length-1)}function n_(r,n,o,l,c){return r>>>=0,n>>>=0,o>>>=0,l>>>=0,r_(r,n,o,l)}var s_=0,a_=()=>zy||s_>0,o_=r=>{nt=r,a_()||(s.onExit&&s.onExit(r),vr=!0),T(r,new xl(r))},l_=(r,n)=>{nt=r,o_(r)},c_=r=>{if(r instanceof xl||r=="unwind")return nt;T(1,r)},Jo=[],$l,L=r=>{var n=Jo[r];return n||(r>=Jo.length&&(Jo.length=r+1),Jo[r]=n=$l.get(r)),n},h_=r=>{var n=s["_"+r];return n},u_=r=>{var n=Jl(r)+1,o=rl(n);return vl(r,o,n),o},d_=(r,n,o,l,c)=>{var h={string:O=>{var k=0;return O!=null&&O!==0&&(k=u_(O)),k},array:O=>{var k=rl(O.length);return Ql(O,k),k}};function u(O){return n==="string"?rs(O):n==="boolean"?!!O:O}var f=h_(r),y=[],p=0;if(l)for(var v=0;v(Zl=s._main=w.wf)(r,n);s._duckdb_web_fs_glob_add_path=r=>(s._duckdb_web_fs_glob_add_path=w.yf)(r),s._duckdb_web_clear_response=()=>(s._duckdb_web_clear_response=w.zf)(),s._duckdb_web_fail_with=r=>(s._duckdb_web_fail_with=w.Af)(r),s._duckdb_web_reset=r=>(s._duckdb_web_reset=w.Bf)(r),s._duckdb_web_connect=()=>(s._duckdb_web_connect=w.Cf)(),s._duckdb_web_disconnect=r=>(s._duckdb_web_disconnect=w.Df)(r),s._duckdb_web_flush_files=()=>(s._duckdb_web_flush_files=w.Ef)(),s._duckdb_web_flush_file=r=>(s._duckdb_web_flush_file=w.Ff)(r),s._duckdb_web_open=(r,n)=>(s._duckdb_web_open=w.Gf)(r,n),s._duckdb_web_get_global_file_info=(r,n)=>(s._duckdb_web_get_global_file_info=w.Hf)(r,n),s._duckdb_web_collect_file_stats=(r,n,o)=>(s._duckdb_web_collect_file_stats=w.If)(r,n,o),s._duckdb_web_export_file_stats=(r,n)=>(s._duckdb_web_export_file_stats=w.Jf)(r,n),s._duckdb_web_fs_drop_file=(r,n)=>(s._duckdb_web_fs_drop_file=w.Kf)(r,n),s._duckdb_web_fs_drop_files=r=>(s._duckdb_web_fs_drop_files=w.Lf)(r),s._duckdb_web_fs_glob_file_infos=(r,n)=>(s._duckdb_web_fs_glob_file_infos=w.Mf)(r,n),s._duckdb_web_fs_get_file_info_by_id=(r,n,o)=>(s._duckdb_web_fs_get_file_info_by_id=w.Nf)(r,n,o),s._duckdb_web_fs_get_file_info_by_name=(r,n,o)=>(s._duckdb_web_fs_get_file_info_by_name=w.Of)(r,n,o),s._duckdb_web_fs_register_file_url=(r,n,o,l,c)=>(s._duckdb_web_fs_register_file_url=w.Pf)(r,n,o,l,c),s._duckdb_web_fs_register_file_buffer=(r,n,o,l)=>(s._duckdb_web_fs_register_file_buffer=w.Qf)(r,n,o,l),s._duckdb_web_copy_file_to_buffer=(r,n)=>(s._duckdb_web_copy_file_to_buffer=w.Rf)(r,n),s._duckdb_web_copy_file_to_path=(r,n,o)=>(s._duckdb_web_copy_file_to_path=w.Sf)(r,n,o),s._duckdb_web_get_version=r=>(s._duckdb_web_get_version=w.Tf)(r),s._duckdb_web_get_feature_flags=()=>(s._duckdb_web_get_feature_flags=w.Uf)(),s._duckdb_web_tokenize=(r,n)=>(s._duckdb_web_tokenize=w.Vf)(r,n),s._duckdb_web_udf_scalar_create=(r,n,o)=>(s._duckdb_web_udf_scalar_create=w.Wf)(r,n,o),s._duckdb_web_prepared_create=(r,n,o)=>(s._duckdb_web_prepared_create=w.Xf)(r,n,o),s._duckdb_web_prepared_close=(r,n,o)=>(s._duckdb_web_prepared_close=w.Yf)(r,n,o),s._duckdb_web_prepared_run=(r,n,o,l)=>(s._duckdb_web_prepared_run=w.Zf)(r,n,o,l),s._duckdb_web_prepared_send=(r,n,o,l)=>(s._duckdb_web_prepared_send=w._f)(r,n,o,l),s._duckdb_web_query_run=(r,n,o)=>(s._duckdb_web_query_run=w.$f)(r,n,o),s._duckdb_web_pending_query_start=(r,n,o)=>(s._duckdb_web_pending_query_start=w.ag)(r,n,o),s._duckdb_web_pending_query_poll=(r,n,o)=>(s._duckdb_web_pending_query_poll=w.bg)(r,n,o),s._duckdb_web_pending_query_cancel=(r,n)=>(s._duckdb_web_pending_query_cancel=w.cg)(r,n),s._duckdb_web_query_fetch_results=(r,n)=>(s._duckdb_web_query_fetch_results=w.dg)(r,n),s._duckdb_web_get_tablenames=(r,n,o)=>(s._duckdb_web_get_tablenames=w.eg)(r,n,o),s._duckdb_web_insert_arrow_from_ipc_stream=(r,n,o,l,c)=>(s._duckdb_web_insert_arrow_from_ipc_stream=w.fg)(r,n,o,l,c),s._duckdb_web_insert_csv_from_path=(r,n,o,l)=>(s._duckdb_web_insert_csv_from_path=w.gg)(r,n,o,l),s._duckdb_web_insert_json_from_path=(r,n,o,l)=>(s._duckdb_web_insert_json_from_path=w.hg)(r,n,o,l);var Qo=r=>(Qo=w.ig)(r),Zo=r=>(Zo=w.jg)(r),wl=r=>(wl=w.kg)(r),jl=s._malloc=r=>(jl=s._malloc=w.lg)(r);s._free=r=>(s._free=w.mg)(r);var S=(r,n)=>(S=w.ng)(r,n),Ss=r=>(Ss=w.og)(r),j=()=>(j=w.pg)(),I=r=>(I=w.qg)(r),rl=r=>(rl=w.rg)(r),tc=r=>(tc=w.sg)(r),ec=r=>(ec=w.tg)(r),ic=(r,n,o)=>(ic=w.ug)(r,n,o),rc=r=>(rc=w.vg)(r),nc=s.dynCall_jiiii=(r,n,o,l,c)=>(nc=s.dynCall_jiiii=w.wg)(r,n,o,l,c),sc=s.dynCall_iiiiij=(r,n,o,l,c,h,u)=>(sc=s.dynCall_iiiiij=w.xg)(r,n,o,l,c,h,u),ac=s.dynCall_iiiiijj=(r,n,o,l,c,h,u,f,y)=>(ac=s.dynCall_iiiiijj=w.yg)(r,n,o,l,c,h,u,f,y),oc=s.dynCall_viijii=(r,n,o,l,c,h,u)=>(oc=s.dynCall_viijii=w.zg)(r,n,o,l,c,h,u),lc=s.dynCall_viiiij=(r,n,o,l,c,h,u)=>(lc=s.dynCall_viiiij=w.Ag)(r,n,o,l,c,h,u),cc=s.dynCall_iij=(r,n,o,l)=>(cc=s.dynCall_iij=w.Bg)(r,n,o,l),hc=s.dynCall_iiji=(r,n,o,l,c)=>(hc=s.dynCall_iiji=w.Cg)(r,n,o,l,c),uc=s.dynCall_vijji=(r,n,o,l,c,h,u)=>(uc=s.dynCall_vijji=w.Dg)(r,n,o,l,c,h,u),dc=s.dynCall_ji=(r,n)=>(dc=s.dynCall_ji=w.Eg)(r,n),fc=s.dynCall_viji=(r,n,o,l,c)=>(fc=s.dynCall_viji=w.Fg)(r,n,o,l,c),yc=s.dynCall_iiiji=(r,n,o,l,c,h)=>(yc=s.dynCall_iiiji=w.Gg)(r,n,o,l,c,h),pc=s.dynCall_viiij=(r,n,o,l,c,h)=>(pc=s.dynCall_viiij=w.Hg)(r,n,o,l,c,h),bc=s.dynCall_iiiij=(r,n,o,l,c,h)=>(bc=s.dynCall_iiiij=w.Ig)(r,n,o,l,c,h),_c=s.dynCall_iiijj=(r,n,o,l,c,h,u)=>(_c=s.dynCall_iiijj=w.Jg)(r,n,o,l,c,h,u),vc=s.dynCall_iiij=(r,n,o,l,c)=>(vc=s.dynCall_iiij=w.Kg)(r,n,o,l,c),gc=s.dynCall_viijiiiii=(r,n,o,l,c,h,u,f,y,p)=>(gc=s.dynCall_viijiiiii=w.Lg)(r,n,o,l,c,h,u,f,y,p),mc=s.dynCall_viij=(r,n,o,l,c)=>(mc=s.dynCall_viij=w.Mg)(r,n,o,l,c),wc=s.dynCall_vij=(r,n,o,l)=>(wc=s.dynCall_vij=w.Ng)(r,n,o,l),jc=s.dynCall_jiiijii=(r,n,o,l,c,h,u,f)=>(jc=s.dynCall_jiiijii=w.Og)(r,n,o,l,c,h,u,f),Ic=s.dynCall_jiijiii=(r,n,o,l,c,h,u,f)=>(Ic=s.dynCall_jiijiii=w.Pg)(r,n,o,l,c,h,u,f),Sc=s.dynCall_jiijii=(r,n,o,l,c,h,u)=>(Sc=s.dynCall_jiijii=w.Qg)(r,n,o,l,c,h,u),Cc=s.dynCall_j=r=>(Cc=s.dynCall_j=w.Rg)(r),Ac=s.dynCall_viiiiji=(r,n,o,l,c,h,u,f)=>(Ac=s.dynCall_viiiiji=w.Sg)(r,n,o,l,c,h,u,f),Bc=s.dynCall_jiiiijii=(r,n,o,l,c,h,u,f,y)=>(Bc=s.dynCall_jiiiijii=w.Tg)(r,n,o,l,c,h,u,f,y),Tc=s.dynCall_jiiijiii=(r,n,o,l,c,h,u,f,y)=>(Tc=s.dynCall_jiiijiii=w.Ug)(r,n,o,l,c,h,u,f,y),Fc=s.dynCall_jiiiiijiiii=(r,n,o,l,c,h,u,f,y,p,v,m)=>(Fc=s.dynCall_jiiiiijiiii=w.Vg)(r,n,o,l,c,h,u,f,y,p,v,m),Ec=s.dynCall_viiiiijiiii=(r,n,o,l,c,h,u,f,y,p,v,m)=>(Ec=s.dynCall_viiiiijiiii=w.Wg)(r,n,o,l,c,h,u,f,y,p,v,m),Oc=s.dynCall_iiijij=(r,n,o,l,c,h,u,f)=>(Oc=s.dynCall_iiijij=w.Xg)(r,n,o,l,c,h,u,f),Dc=s.dynCall_viiji=(r,n,o,l,c,h)=>(Dc=s.dynCall_viiji=w.Yg)(r,n,o,l,c,h),Rc=s.dynCall_viiiji=(r,n,o,l,c,h,u)=>(Rc=s.dynCall_viiiji=w.Zg)(r,n,o,l,c,h,u),Mc=s.dynCall_viijji=(r,n,o,l,c,h,u,f)=>(Mc=s.dynCall_viijji=w._g)(r,n,o,l,c,h,u,f),Uc=s.dynCall_vijijj=(r,n,o,l,c,h,u,f,y)=>(Uc=s.dynCall_vijijj=w.$g)(r,n,o,l,c,h,u,f,y),xc=s.dynCall_viiijjj=(r,n,o,l,c,h,u,f,y,p)=>(xc=s.dynCall_viiijjj=w.ah)(r,n,o,l,c,h,u,f,y,p),Nc=s.dynCall_iji=(r,n,o,l)=>(Nc=s.dynCall_iji=w.bh)(r,n,o,l),Lc=s.dynCall_viijjji=(r,n,o,l,c,h,u,f,y,p)=>(Lc=s.dynCall_viijjji=w.ch)(r,n,o,l,c,h,u,f,y,p),kc=s.dynCall_viijj=(r,n,o,l,c,h,u)=>(kc=s.dynCall_viijj=w.dh)(r,n,o,l,c,h,u),Pc=s.dynCall_viiijj=(r,n,o,l,c,h,u,f)=>(Pc=s.dynCall_viiijj=w.eh)(r,n,o,l,c,h,u,f),Hc=s.dynCall_viijjj=(r,n,o,l,c,h,u,f,y)=>(Hc=s.dynCall_viijjj=w.fh)(r,n,o,l,c,h,u,f,y),Vc=s.dynCall_vijj=(r,n,o,l,c,h)=>(Vc=s.dynCall_vijj=w.gh)(r,n,o,l,c,h),zc=s.dynCall_viiijjij=(r,n,o,l,c,h,u,f,y,p,v)=>(zc=s.dynCall_viiijjij=w.hh)(r,n,o,l,c,h,u,f,y,p,v),qc=s.dynCall_viijiii=(r,n,o,l,c,h,u,f)=>(qc=s.dynCall_viijiii=w.ih)(r,n,o,l,c,h,u,f),Yc=s.dynCall_vijijjiij=(r,n,o,l,c,h,u,f,y,p,v,m,C)=>(Yc=s.dynCall_vijijjiij=w.jh)(r,n,o,l,c,h,u,f,y,p,v,m,C),Wc=s.dynCall_viiijjiij=(r,n,o,l,c,h,u,f,y,p,v,m)=>(Wc=s.dynCall_viiijjiij=w.kh)(r,n,o,l,c,h,u,f,y,p,v,m),Xc=s.dynCall_jiiijiijiii=(r,n,o,l,c,h,u,f,y,p,v,m,C)=>(Xc=s.dynCall_jiiijiijiii=w.lh)(r,n,o,l,c,h,u,f,y,p,v,m,C),Gc=s.dynCall_viijiiiij=(r,n,o,l,c,h,u,f,y,p,v)=>(Gc=s.dynCall_viijiiiij=w.mh)(r,n,o,l,c,h,u,f,y,p,v),Kc=s.dynCall_viiijiiiijjj=(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k)=>(Kc=s.dynCall_viiijiiiijjj=w.nh)(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k),Jc=s.dynCall_viijijiiiijjj=(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z)=>(Jc=s.dynCall_viijijiiiijjj=w.oh)(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z),Qc=s.dynCall_viiiijjij=(r,n,o,l,c,h,u,f,y,p,v,m)=>(Qc=s.dynCall_viiiijjij=w.ph)(r,n,o,l,c,h,u,f,y,p,v,m),$c=s.dynCall_viiijiiii=(r,n,o,l,c,h,u,f,y,p)=>($c=s.dynCall_viiijiiii=w.qh)(r,n,o,l,c,h,u,f,y,p),Zc=s.dynCall_jiiiiji=(r,n,o,l,c,h,u,f)=>(Zc=s.dynCall_jiiiiji=w.rh)(r,n,o,l,c,h,u,f),tu=s.dynCall_viiiijijji=(r,n,o,l,c,h,u,f,y,p,v,m,C)=>(tu=s.dynCall_viiiijijji=w.sh)(r,n,o,l,c,h,u,f,y,p,v,m,C),eu=s.dynCall_viiijiiijii=(r,n,o,l,c,h,u,f,y,p,v,m,C)=>(eu=s.dynCall_viiijiiijii=w.th)(r,n,o,l,c,h,u,f,y,p,v,m,C),iu=s.dynCall_viijijiiii=(r,n,o,l,c,h,u,f,y,p,v,m)=>(iu=s.dynCall_viijijiiii=w.uh)(r,n,o,l,c,h,u,f,y,p,v,m),ru=s.dynCall_jj=(r,n,o)=>(ru=s.dynCall_jj=w.vh)(r,n,o),nu=s.dynCall_jd=(r,n)=>(nu=s.dynCall_jd=w.wh)(r,n),su=s.dynCall_jf=(r,n)=>(su=s.dynCall_jf=w.xh)(r,n),au=s.dynCall_iijjj=(r,n,o,l,c,h,u,f)=>(au=s.dynCall_iijjj=w.yh)(r,n,o,l,c,h,u,f),ou=s.dynCall_iiiijj=(r,n,o,l,c,h,u,f)=>(ou=s.dynCall_iiiijj=w.zh)(r,n,o,l,c,h,u,f),lu=s.dynCall_iiijji=(r,n,o,l,c,h,u,f)=>(lu=s.dynCall_iiijji=w.Ah)(r,n,o,l,c,h,u,f),cu=s.dynCall_vijijiiiijjj=(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P)=>(cu=s.dynCall_vijijiiiijjj=w.Bh)(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P),hu=s.dynCall_viiiiiij=(r,n,o,l,c,h,u,f,y)=>(hu=s.dynCall_viiiiiij=w.Ch)(r,n,o,l,c,h,u,f,y),uu=s.dynCall_jii=(r,n,o)=>(uu=s.dynCall_jii=w.Dh)(r,n,o),du=s.dynCall_iiiijjiii=(r,n,o,l,c,h,u,f,y,p,v)=>(du=s.dynCall_iiiijjiii=w.Eh)(r,n,o,l,c,h,u,f,y,p,v),fu=s.dynCall_iiiiiij=(r,n,o,l,c,h,u,f)=>(fu=s.dynCall_iiiiiij=w.Fh)(r,n,o,l,c,h,u,f),yu=s.dynCall_iiiiiiiij=(r,n,o,l,c,h,u,f,y,p)=>(yu=s.dynCall_iiiiiiiij=w.Gh)(r,n,o,l,c,h,u,f,y,p),pu=s.dynCall_jiii=(r,n,o,l)=>(pu=s.dynCall_jiii=w.Hh)(r,n,o,l),bu=s.dynCall_iiiiiiij=(r,n,o,l,c,h,u,f,y)=>(bu=s.dynCall_iiiiiiij=w.Ih)(r,n,o,l,c,h,u,f,y),_u=s.dynCall_iiiiiiji=(r,n,o,l,c,h,u,f,y)=>(_u=s.dynCall_iiiiiiji=w.Jh)(r,n,o,l,c,h,u,f,y),vu=s.dynCall_iiiijiii=(r,n,o,l,c,h,u,f,y)=>(vu=s.dynCall_iiiijiii=w.Kh)(r,n,o,l,c,h,u,f,y),gu=s.dynCall_iiiijii=(r,n,o,l,c,h,u,f)=>(gu=s.dynCall_iiiijii=w.Lh)(r,n,o,l,c,h,u,f),mu=s.dynCall_jiiiii=(r,n,o,l,c,h)=>(mu=s.dynCall_jiiiii=w.Mh)(r,n,o,l,c,h),wu=s.dynCall_iiiiji=(r,n,o,l,c,h,u)=>(wu=s.dynCall_iiiiji=w.Nh)(r,n,o,l,c,h,u),ju=s.dynCall_iiiiiji=(r,n,o,l,c,h,u,f)=>(ju=s.dynCall_iiiiiji=w.Oh)(r,n,o,l,c,h,u,f),Iu=s.dynCall_iiijii=(r,n,o,l,c,h,u)=>(Iu=s.dynCall_iiijii=w.Ph)(r,n,o,l,c,h,u),Su=s.dynCall_iijj=(r,n,o,l,c,h)=>(Su=s.dynCall_iijj=w.Qh)(r,n,o,l,c,h),Cu=s.dynCall_iiijjj=(r,n,o,l,c,h,u,f,y)=>(Cu=s.dynCall_iiijjj=w.Rh)(r,n,o,l,c,h,u,f,y),Au=s.dynCall_viiiiij=(r,n,o,l,c,h,u,f)=>(Au=s.dynCall_viiiiij=w.Sh)(r,n,o,l,c,h,u,f),Bu=s.dynCall_iijiji=(r,n,o,l,c,h,u,f)=>(Bu=s.dynCall_iijiji=w.Th)(r,n,o,l,c,h,u,f),Tu=s.dynCall_viiiijiiiiiiii=(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O)=>(Tu=s.dynCall_viiiijiiiiiiii=w.Uh)(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O),Fu=s.dynCall_jiij=(r,n,o,l,c)=>(Fu=s.dynCall_jiij=w.Vh)(r,n,o,l,c),Eu=s.dynCall_jiiiji=(r,n,o,l,c,h,u)=>(Eu=s.dynCall_jiiiji=w.Wh)(r,n,o,l,c,h,u),Ou=s.dynCall_viijiiji=(r,n,o,l,c,h,u,f,y,p)=>(Ou=s.dynCall_viijiiji=w.Xh)(r,n,o,l,c,h,u,f,y,p),Du=s.dynCall_iiiiiijjiijjji=(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z,E)=>(Du=s.dynCall_iiiiiijjiijjji=w.Yh)(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z,E),Ru=s.dynCall_iiijjijjiii=(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O)=>(Ru=s.dynCall_iiijjijjiii=w.Zh)(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O),Mu=s.dynCall_iiiijjii=(r,n,o,l,c,h,u,f,y,p)=>(Mu=s.dynCall_iiiijjii=w._h)(r,n,o,l,c,h,u,f,y,p),Uu=s.dynCall_iiiijji=(r,n,o,l,c,h,u,f,y)=>(Uu=s.dynCall_iiiijji=w.$h)(r,n,o,l,c,h,u,f,y),xu=s.dynCall_iiijjii=(r,n,o,l,c,h,u,f,y)=>(xu=s.dynCall_iiijjii=w.ai)(r,n,o,l,c,h,u,f,y),Nu=s.dynCall_vijii=(r,n,o,l,c,h)=>(Nu=s.dynCall_vijii=w.bi)(r,n,o,l,c,h),Lu=s.dynCall_vjjijij=(r,n,o,l,c,h,u,f,y,p,v)=>(Lu=s.dynCall_vjjijij=w.ci)(r,n,o,l,c,h,u,f,y,p,v),ku=s.dynCall_vijjji=(r,n,o,l,c,h,u,f,y)=>(ku=s.dynCall_vijjji=w.di)(r,n,o,l,c,h,u,f,y),Pu=s.dynCall_vjjii=(r,n,o,l,c,h,u)=>(Pu=s.dynCall_vjjii=w.ei)(r,n,o,l,c,h,u),Hu=s.dynCall_viiiiiji=(r,n,o,l,c,h,u,f,y)=>(Hu=s.dynCall_viiiiiji=w.fi)(r,n,o,l,c,h,u,f,y),Vu=s.dynCall_viiijjiii=(r,n,o,l,c,h,u,f,y,p,v)=>(Vu=s.dynCall_viiijjiii=w.gi)(r,n,o,l,c,h,u,f,y,p,v),zu=s.dynCall_iiijjjj=(r,n,o,l,c,h,u,f,y,p,v)=>(zu=s.dynCall_iiijjjj=w.hi)(r,n,o,l,c,h,u,f,y,p,v),qu=s.dynCall_viiijjjj=(r,n,o,l,c,h,u,f,y,p,v,m)=>(qu=s.dynCall_viiijjjj=w.ii)(r,n,o,l,c,h,u,f,y,p,v,m),Yu=s.dynCall_vijjj=(r,n,o,l,c,h,u,f)=>(Yu=s.dynCall_vijjj=w.ji)(r,n,o,l,c,h,u,f),Wu=s.dynCall_jijij=(r,n,o,l,c,h,u)=>(Wu=s.dynCall_jijij=w.ki)(r,n,o,l,c,h,u),Xu=s.dynCall_jiiij=(r,n,o,l,c,h)=>(Xu=s.dynCall_jiiij=w.li)(r,n,o,l,c,h),Gu=s.dynCall_jijjij=(r,n,o,l,c,h,u,f,y)=>(Gu=s.dynCall_jijjij=w.mi)(r,n,o,l,c,h,u,f,y),Ku=s.dynCall_jij=(r,n,o,l)=>(Ku=s.dynCall_jij=w.ni)(r,n,o,l),Ju=s.dynCall_jijiii=(r,n,o,l,c,h,u)=>(Ju=s.dynCall_jijiii=w.oi)(r,n,o,l,c,h,u),Qu=s.dynCall_viijiiij=(r,n,o,l,c,h,u,f,y,p)=>(Qu=s.dynCall_viijiiij=w.pi)(r,n,o,l,c,h,u,f,y,p),$u=s.dynCall_vijiiiji=(r,n,o,l,c,h,u,f,y,p)=>($u=s.dynCall_vijiiiji=w.qi)(r,n,o,l,c,h,u,f,y,p),Zu=s.dynCall_jiiji=(r,n,o,l,c,h)=>(Zu=s.dynCall_jiiji=w.ri)(r,n,o,l,c,h),td=s.dynCall_viiijij=(r,n,o,l,c,h,u,f,y)=>(td=s.dynCall_viiijij=w.si)(r,n,o,l,c,h,u,f,y),ed=s.dynCall_viijiij=(r,n,o,l,c,h,u,f,y)=>(ed=s.dynCall_viijiij=w.ti)(r,n,o,l,c,h,u,f,y),id=s.dynCall_viiiiijj=(r,n,o,l,c,h,u,f,y,p)=>(id=s.dynCall_viiiiijj=w.ui)(r,n,o,l,c,h,u,f,y,p),rd=s.dynCall_viiijji=(r,n,o,l,c,h,u,f,y)=>(rd=s.dynCall_viiijji=w.vi)(r,n,o,l,c,h,u,f,y),nd=s.dynCall_vijjij=(r,n,o,l,c,h,u,f,y)=>(nd=s.dynCall_vijjij=w.wi)(r,n,o,l,c,h,u,f,y),sd=s.dynCall_vijiji=(r,n,o,l,c,h,u,f)=>(sd=s.dynCall_vijiji=w.xi)(r,n,o,l,c,h,u,f),ad=s.dynCall_jiiiij=(r,n,o,l,c,h,u)=>(ad=s.dynCall_jiiiij=w.yi)(r,n,o,l,c,h,u),od=s.dynCall_ij=(r,n,o)=>(od=s.dynCall_ij=w.zi)(r,n,o),ld=s.dynCall_jjj=(r,n,o,l,c)=>(ld=s.dynCall_jjj=w.Ai)(r,n,o,l,c),cd=s.dynCall_jjiji=(r,n,o,l,c,h,u)=>(cd=s.dynCall_jjiji=w.Bi)(r,n,o,l,c,h,u),hd=s.dynCall_jjjd=(r,n,o,l,c,h)=>(hd=s.dynCall_jjjd=w.Ci)(r,n,o,l,c,h),ud=s.dynCall_jijj=(r,n,o,l,c,h)=>(ud=s.dynCall_jijj=w.Di)(r,n,o,l,c,h),dd=s.dynCall_ijii=(r,n,o,l,c)=>(dd=s.dynCall_ijii=w.Ei)(r,n,o,l,c),fd=s.dynCall_vjii=(r,n,o,l,c)=>(fd=s.dynCall_vjii=w.Fi)(r,n,o,l,c),yd=s.dynCall_vjiiii=(r,n,o,l,c,h,u)=>(yd=s.dynCall_vjiiii=w.Gi)(r,n,o,l,c,h,u),pd=s.dynCall_viiiiijiii=(r,n,o,l,c,h,u,f,y,p,v)=>(pd=s.dynCall_viiiiijiii=w.Hi)(r,n,o,l,c,h,u,f,y,p,v),bd=s.dynCall_ijji=(r,n,o,l,c,h)=>(bd=s.dynCall_ijji=w.Ii)(r,n,o,l,c,h),_d=s.dynCall_iiiiijii=(r,n,o,l,c,h,u,f,y)=>(_d=s.dynCall_iiiiijii=w.Ji)(r,n,o,l,c,h,u,f,y),vd=s.dynCall_viiijiii=(r,n,o,l,c,h,u,f,y)=>(vd=s.dynCall_viiijiii=w.Ki)(r,n,o,l,c,h,u,f,y),gd=s.dynCall_viijij=(r,n,o,l,c,h,u,f)=>(gd=s.dynCall_viijij=w.Li)(r,n,o,l,c,h,u,f),md=s.dynCall_viiiiiiji=(r,n,o,l,c,h,u,f,y,p)=>(md=s.dynCall_viiiiiiji=w.Mi)(r,n,o,l,c,h,u,f,y,p),wd=s.dynCall_viiijii=(r,n,o,l,c,h,u,f)=>(wd=s.dynCall_viiijii=w.Ni)(r,n,o,l,c,h,u,f),jd=s.dynCall_viiiijiii=(r,n,o,l,c,h,u,f,y,p)=>(jd=s.dynCall_viiiijiii=w.Oi)(r,n,o,l,c,h,u,f,y,p),Id=s.dynCall_viiiijii=(r,n,o,l,c,h,u,f,y)=>(Id=s.dynCall_viiiijii=w.Pi)(r,n,o,l,c,h,u,f,y),Sd=s.dynCall_iiijiij=(r,n,o,l,c,h,u,f,y)=>(Sd=s.dynCall_iiijiij=w.Qi)(r,n,o,l,c,h,u,f,y),Cd=s.dynCall_iiiijjj=(r,n,o,l,c,h,u,f,y,p)=>(Cd=s.dynCall_iiiijjj=w.Ri)(r,n,o,l,c,h,u,f,y,p),Ad=s.dynCall_jijji=(r,n,o,l,c,h,u)=>(Ad=s.dynCall_jijji=w.Si)(r,n,o,l,c,h,u),Bd=s.dynCall_viiijijij=(r,n,o,l,c,h,u,f,y,p,v,m)=>(Bd=s.dynCall_viiijijij=w.Ti)(r,n,o,l,c,h,u,f,y,p,v,m),Td=s.dynCall_jijjjjii=(r,n,o,l,c,h,u,f,y,p,v,m)=>(Td=s.dynCall_jijjjjii=w.Ui)(r,n,o,l,c,h,u,f,y,p,v,m),Fd=s.dynCall_iiiiijij=(r,n,o,l,c,h,u,f,y,p)=>(Fd=s.dynCall_iiiiijij=w.Vi)(r,n,o,l,c,h,u,f,y,p),Ed=s.dynCall_iiiiijiii=(r,n,o,l,c,h,u,f,y,p)=>(Ed=s.dynCall_iiiiijiii=w.Wi)(r,n,o,l,c,h,u,f,y,p),Od=s.dynCall_viijjii=(r,n,o,l,c,h,u,f,y)=>(Od=s.dynCall_viijjii=w.Xi)(r,n,o,l,c,h,u,f,y),Dd=s.dynCall_iiiiiiiiiiji=(r,n,o,l,c,h,u,f,y,p,v,m,C)=>(Dd=s.dynCall_iiiiiiiiiiji=w.Yi)(r,n,o,l,c,h,u,f,y,p,v,m,C),Rd=s.dynCall_iiiiiiijj=(r,n,o,l,c,h,u,f,y,p,v)=>(Rd=s.dynCall_iiiiiiijj=w.Zi)(r,n,o,l,c,h,u,f,y,p,v),Md=s.dynCall_viiijjii=(r,n,o,l,c,h,u,f,y,p)=>(Md=s.dynCall_viiijjii=w._i)(r,n,o,l,c,h,u,f,y,p),Ud=s.dynCall_jiiijjj=(r,n,o,l,c,h,u,f,y,p)=>(Ud=s.dynCall_jiiijjj=w.$i)(r,n,o,l,c,h,u,f,y,p),xd=s.dynCall_viiijijj=(r,n,o,l,c,h,u,f,y,p,v)=>(xd=s.dynCall_viiijijj=w.aj)(r,n,o,l,c,h,u,f,y,p,v),Nd=s.dynCall_jiiiiiii=(r,n,o,l,c,h,u,f)=>(Nd=s.dynCall_jiiiiiii=w.bj)(r,n,o,l,c,h,u,f),Ld=s.dynCall_jiijj=(r,n,o,l,c,h,u)=>(Ld=s.dynCall_jiijj=w.cj)(r,n,o,l,c,h,u),kd=s.dynCall_jiiijj=(r,n,o,l,c,h,u,f)=>(kd=s.dynCall_jiiijj=w.dj)(r,n,o,l,c,h,u,f),Pd=s.dynCall_iijii=(r,n,o,l,c,h)=>(Pd=s.dynCall_iijii=w.ej)(r,n,o,l,c,h),Hd=s.dynCall_iiidj=(r,n,o,l,c,h)=>(Hd=s.dynCall_iiidj=w.fj)(r,n,o,l,c,h),Vd=s.dynCall_iiiiiiiji=(r,n,o,l,c,h,u,f,y,p)=>(Vd=s.dynCall_iiiiiiiji=w.gj)(r,n,o,l,c,h,u,f,y,p),zd=s.dynCall_iiiiiiiiijiiiiiii=(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z)=>(zd=s.dynCall_iiiiiiiiijiiiiiii=w.hj)(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z),qd=s.dynCall_iiijjiij=(r,n,o,l,c,h,u,f,y,p,v)=>(qd=s.dynCall_iiijjiij=w.ij)(r,n,o,l,c,h,u,f,y,p,v),Yd=s.dynCall_iiijjiiji=(r,n,o,l,c,h,u,f,y,p,v,m)=>(Yd=s.dynCall_iiijjiiji=w.jj)(r,n,o,l,c,h,u,f,y,p,v,m),Wd=s.dynCall_iiiidjj=(r,n,o,l,c,h,u,f,y)=>(Wd=s.dynCall_iiiidjj=w.kj)(r,n,o,l,c,h,u,f,y),Xd=s.dynCall_iiiiiiiiji=(r,n,o,l,c,h,u,f,y,p,v)=>(Xd=s.dynCall_iiiiiiiiji=w.lj)(r,n,o,l,c,h,u,f,y,p,v),Gd=s.dynCall_iiijiiiij=(r,n,o,l,c,h,u,f,y,p,v)=>(Gd=s.dynCall_iiijiiiij=w.mj)(r,n,o,l,c,h,u,f,y,p,v),Kd=s.dynCall_iiijiiij=(r,n,o,l,c,h,u,f,y,p)=>(Kd=s.dynCall_iiijiiij=w.nj)(r,n,o,l,c,h,u,f,y,p),Jd=s.dynCall_iiiiiiiiiiiij=(r,n,o,l,c,h,u,f,y,p,v,m,C,F)=>(Jd=s.dynCall_iiiiiiiiiiiij=w.oj)(r,n,o,l,c,h,u,f,y,p,v,m,C,F),Qd=s.dynCall_viiiijji=(r,n,o,l,c,h,u,f,y,p)=>(Qd=s.dynCall_viiiijji=w.pj)(r,n,o,l,c,h,u,f,y,p),$d=s.dynCall_jiiiiii=(r,n,o,l,c,h,u)=>($d=s.dynCall_jiiiiii=w.qj)(r,n,o,l,c,h,u),Zd=s.dynCall_jiiiijiiii=(r,n,o,l,c,h,u,f,y,p,v)=>(Zd=s.dynCall_jiiiijiiii=w.rj)(r,n,o,l,c,h,u,f,y,p,v),tf=s.dynCall_jiijjjii=(r,n,o,l,c,h,u,f,y,p,v)=>(tf=s.dynCall_jiijjjii=w.sj)(r,n,o,l,c,h,u,f,y,p,v),ef=s.dynCall_vjiiiji=(r,n,o,l,c,h,u,f,y)=>(ef=s.dynCall_vjiiiji=w.tj)(r,n,o,l,c,h,u,f,y),rf=s.dynCall_fiijii=(r,n,o,l,c,h,u)=>(rf=s.dynCall_fiijii=w.uj)(r,n,o,l,c,h,u),nf=s.dynCall_diijii=(r,n,o,l,c,h,u)=>(nf=s.dynCall_diijii=w.vj)(r,n,o,l,c,h,u),sf=s.dynCall_iiiiiiijii=(r,n,o,l,c,h,u,f,y,p,v)=>(sf=s.dynCall_iiiiiiijii=w.wj)(r,n,o,l,c,h,u,f,y,p,v),af=s.dynCall_iiijiii=(r,n,o,l,c,h,u,f)=>(af=s.dynCall_iiijiii=w.xj)(r,n,o,l,c,h,u,f),of=s.dynCall_viijiiii=(r,n,o,l,c,h,u,f,y)=>(of=s.dynCall_viijiiii=w.yj)(r,n,o,l,c,h,u,f,y),lf=s.dynCall_vijiii=(r,n,o,l,c,h,u)=>(lf=s.dynCall_vijiii=w.zj)(r,n,o,l,c,h,u),cf=s.dynCall_iijjii=(r,n,o,l,c,h,u,f)=>(cf=s.dynCall_iijjii=w.Aj)(r,n,o,l,c,h,u,f),hf=s.dynCall_iijjiii=(r,n,o,l,c,h,u,f,y)=>(hf=s.dynCall_iijjiii=w.Bj)(r,n,o,l,c,h,u,f,y),uf=s.dynCall_iiijjiii=(r,n,o,l,c,h,u,f,y,p)=>(uf=s.dynCall_iiijjiii=w.Cj)(r,n,o,l,c,h,u,f,y,p),df=s.dynCall_iijji=(r,n,o,l,c,h,u)=>(df=s.dynCall_iijji=w.Dj)(r,n,o,l,c,h,u),ff=s.dynCall_vijiiiiii=(r,n,o,l,c,h,u,f,y,p)=>(ff=s.dynCall_vijiiiiii=w.Ej)(r,n,o,l,c,h,u,f,y,p),yf=s.dynCall_vijiiii=(r,n,o,l,c,h,u,f)=>(yf=s.dynCall_vijiiii=w.Fj)(r,n,o,l,c,h,u,f),pf=s.dynCall_iijiiii=(r,n,o,l,c,h,u,f)=>(pf=s.dynCall_iijiiii=w.Gj)(r,n,o,l,c,h,u,f),bf=s.dynCall_vijiiiii=(r,n,o,l,c,h,u,f,y)=>(bf=s.dynCall_vijiiiii=w.Hj)(r,n,o,l,c,h,u,f,y),_f=s.dynCall_viiiiijii=(r,n,o,l,c,h,u,f,y,p)=>(_f=s.dynCall_viiiiijii=w.Ij)(r,n,o,l,c,h,u,f,y,p),vf=s.dynCall_ijjji=(r,n,o,l,c,h,u,f)=>(vf=s.dynCall_ijjji=w.Jj)(r,n,o,l,c,h,u,f),gf=s.dynCall_viijiiiiii=(r,n,o,l,c,h,u,f,y,p,v)=>(gf=s.dynCall_viijiiiiii=w.Kj)(r,n,o,l,c,h,u,f,y,p,v),mf=s.dynCall_jjjji=(r,n,o,l,c,h,u,f)=>(mf=s.dynCall_jjjji=w.Lj)(r,n,o,l,c,h,u,f),wf=s.dynCall_jjjii=(r,n,o,l,c,h,u)=>(wf=s.dynCall_jjjii=w.Mj)(r,n,o,l,c,h,u),jf=s.dynCall_jji=(r,n,o,l)=>(jf=s.dynCall_jji=w.Nj)(r,n,o,l),If=s.dynCall_viiiijiiiii=(r,n,o,l,c,h,u,f,y,p,v,m)=>(If=s.dynCall_viiiijiiiii=w.Oj)(r,n,o,l,c,h,u,f,y,p,v,m),Sf=s.dynCall_viiiijiiii=(r,n,o,l,c,h,u,f,y,p,v)=>(Sf=s.dynCall_viiiijiiii=w.Pj)(r,n,o,l,c,h,u,f,y,p,v),Cf=s.dynCall_iijjijj=(r,n,o,l,c,h,u,f,y,p,v)=>(Cf=s.dynCall_iijjijj=w.Qj)(r,n,o,l,c,h,u,f,y,p,v),Af=s.dynCall_vj=(r,n,o)=>(Af=s.dynCall_vj=w.Rj)(r,n,o),Bf=s.dynCall_viiiijj=(r,n,o,l,c,h,u,f,y)=>(Bf=s.dynCall_viiiijj=w.Sj)(r,n,o,l,c,h,u,f,y),Tf=s.dynCall_viiiiijjii=(r,n,o,l,c,h,u,f,y,p,v,m)=>(Tf=s.dynCall_viiiiijjii=w.Tj)(r,n,o,l,c,h,u,f,y,p,v,m),Ff=s.dynCall_viiiiiijii=(r,n,o,l,c,h,u,f,y,p,v)=>(Ff=s.dynCall_viiiiiijii=w.Uj)(r,n,o,l,c,h,u,f,y,p,v),Ef=s.dynCall_viiiiiiijjjji=(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P)=>(Ef=s.dynCall_viiiiiiijjjji=w.Vj)(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P),Of=s.dynCall_vjiii=(r,n,o,l,c,h)=>(Of=s.dynCall_vjiii=w.Wj)(r,n,o,l,c,h),Df=s.dynCall_ijjiii=(r,n,o,l,c,h,u,f)=>(Df=s.dynCall_ijjiii=w.Xj)(r,n,o,l,c,h,u,f),Rf=s.dynCall_iiijiiji=(r,n,o,l,c,h,u,f,y,p)=>(Rf=s.dynCall_iiijiiji=w.Yj)(r,n,o,l,c,h,u,f,y,p),Mf=s.dynCall_iijiij=(r,n,o,l,c,h,u,f)=>(Mf=s.dynCall_iijiij=w.Zj)(r,n,o,l,c,h,u,f),Uf=s.dynCall_iijiii=(r,n,o,l,c,h,u)=>(Uf=s.dynCall_iijiii=w._j)(r,n,o,l,c,h,u),xf=s.dynCall_vijijjji=(r,n,o,l,c,h,u,f,y,p,v,m)=>(xf=s.dynCall_vijijjji=w.$j)(r,n,o,l,c,h,u,f,y,p,v,m),Nf=s.dynCall_viijiijj=(r,n,o,l,c,h,u,f,y,p,v)=>(Nf=s.dynCall_viijiijj=w.ak)(r,n,o,l,c,h,u,f,y,p,v),Lf=s.dynCall_viijijj=(r,n,o,l,c,h,u,f,y,p)=>(Lf=s.dynCall_viijijj=w.bk)(r,n,o,l,c,h,u,f,y,p),kf=s.dynCall_vijiij=(r,n,o,l,c,h,u,f)=>(kf=s.dynCall_vijiij=w.ck)(r,n,o,l,c,h,u,f),Pf=s.dynCall_viiiiijjji=(r,n,o,l,c,h,u,f,y,p,v,m,C)=>(Pf=s.dynCall_viiiiijjji=w.dk)(r,n,o,l,c,h,u,f,y,p,v,m,C),Vf=s.dynCall_iiijiijj=(r,n,o,l,c,h,u,f,y,p,v)=>(Vf=s.dynCall_iiijiijj=w.ek)(r,n,o,l,c,h,u,f,y,p,v),ty=s.dynCall_viiijijjj=(r,n,o,l,c,h,u,f,y,p,v,m,C)=>(ty=s.dynCall_viiijijjj=w.fk)(r,n,o,l,c,h,u,f,y,p,v,m,C),ey=s.dynCall_iijiijj=(r,n,o,l,c,h,u,f,y,p)=>(ey=s.dynCall_iijiijj=w.gk)(r,n,o,l,c,h,u,f,y,p),iy=s.dynCall_iijiiijj=(r,n,o,l,c,h,u,f,y,p,v)=>(iy=s.dynCall_iijiiijj=w.hk)(r,n,o,l,c,h,u,f,y,p,v),ry=s.dynCall_iiijiiijj=(r,n,o,l,c,h,u,f,y,p,v,m)=>(ry=s.dynCall_iiijiiijj=w.ik)(r,n,o,l,c,h,u,f,y,p,v,m),ny=s.dynCall_iiijiiiijj=(r,n,o,l,c,h,u,f,y,p,v,m,C)=>(ny=s.dynCall_iiijiiiijj=w.jk)(r,n,o,l,c,h,u,f,y,p,v,m,C),sy=s.dynCall_viiijjjji=(r,n,o,l,c,h,u,f,y,p,v,m,C)=>(sy=s.dynCall_viiijjjji=w.kk)(r,n,o,l,c,h,u,f,y,p,v,m,C),ay=s.dynCall_vijjiii=(r,n,o,l,c,h,u,f,y)=>(ay=s.dynCall_vijjiii=w.lk)(r,n,o,l,c,h,u,f,y),oy=s.dynCall_iiijjji=(r,n,o,l,c,h,u,f,y,p)=>(oy=s.dynCall_iiijjji=w.mk)(r,n,o,l,c,h,u,f,y,p),ly=s.dynCall_iiiiiiijji=(r,n,o,l,c,h,u,f,y,p,v,m)=>(ly=s.dynCall_iiiiiiijji=w.nk)(r,n,o,l,c,h,u,f,y,p,v,m),cy=s.dynCall_iijjjii=(r,n,o,l,c,h,u,f,y,p)=>(cy=s.dynCall_iijjjii=w.ok)(r,n,o,l,c,h,u,f,y,p),hy=s.dynCall_iiiiijjji=(r,n,o,l,c,h,u,f,y,p,v,m)=>(hy=s.dynCall_iiiiijjji=w.pk)(r,n,o,l,c,h,u,f,y,p,v,m),uy=s.dynCall_iiiiijjj=(r,n,o,l,c,h,u,f,y,p,v)=>(uy=s.dynCall_iiiiijjj=w.qk)(r,n,o,l,c,h,u,f,y,p,v),dy=s.dynCall_viiijiji=(r,n,o,l,c,h,u,f,y,p)=>(dy=s.dynCall_viiijiji=w.rk)(r,n,o,l,c,h,u,f,y,p),fy=s.dynCall_jijiiii=(r,n,o,l,c,h,u,f)=>(fy=s.dynCall_jijiiii=w.sk)(r,n,o,l,c,h,u,f),yy=s.dynCall_viijiji=(r,n,o,l,c,h,u,f,y)=>(yy=s.dynCall_viijiji=w.tk)(r,n,o,l,c,h,u,f,y);function y_(r,n){var o=j();try{return L(r)(n)}catch(l){if(I(o),l!==l+0)throw l;S(1,0)}}function p_(r){var n=j();try{L(r)()}catch(o){if(I(n),o!==o+0)throw o;S(1,0)}}function b_(r,n,o){var l=j();try{L(r)(n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function __(r,n){var o=j();try{L(r)(n)}catch(l){if(I(o),l!==l+0)throw l;S(1,0)}}function v_(r,n,o){var l=j();try{return L(r)(n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function g_(r,n,o,l){var c=j();try{return L(r)(n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function m_(r,n,o,l,c,h){var u=j();try{return L(r)(n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function w_(r,n,o,l){var c=j();try{L(r)(n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function j_(r,n,o,l,c){var h=j();try{return L(r)(n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function I_(r,n,o,l){var c=j();try{return L(r)(n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function S_(r,n,o,l){var c=j();try{return L(r)(n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function C_(r,n,o,l,c){var h=j();try{L(r)(n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function A_(r,n,o,l){var c=j();try{L(r)(n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function B_(r,n,o,l,c,h,u){var f=j();try{return L(r)(n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function T_(r,n,o,l,c,h,u){var f=j();try{L(r)(n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function F_(r,n,o,l,c,h){var u=j();try{L(r)(n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function E_(r,n,o,l,c,h,u,f){var y=j();try{return L(r)(n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function O_(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return L(r)(n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function D_(r,n,o,l,c,h,u,f,y,p,v,m,C){var F=j();try{return L(r)(n,o,l,c,h,u,f,y,p,v,m,C)}catch(O){if(I(F),O!==O+0)throw O;S(1,0)}}function R_(r){var n=j();try{return L(r)()}catch(o){if(I(n),o!==o+0)throw o;S(1,0)}}function M_(r,n,o,l,c,h,u,f){var y=j();try{L(r)(n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function U_(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{return L(r)(n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function x_(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{L(r)(n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function N_(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k){var P=j();try{L(r)(n,o,l,c,h,u,f,y,p,v,m,C,F,O,k)}catch(z){if(I(P),z!==z+0)throw z;S(1,0)}}function L_(r,n,o,l,c,h){var u=j();try{return L(r)(n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function k_(r,n,o,l,c,h,u,f,y){var p=j();try{return L(r)(n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function P_(r,n,o,l,c){var h=j();try{return L(r)(n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function H_(r,n,o){var l=j();try{L(r)(n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function V_(r,n,o,l,c,h,u,f,y,p){var v=j();try{L(r)(n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function z_(r,n){var o=j();try{return L(r)(n)}catch(l){if(I(o),l!==l+0)throw l;S(1,0)}}function q_(r,n){var o=j();try{return L(r)(n)}catch(l){if(I(o),l!==l+0)throw l;S(1,0)}}function Y_(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P){var z=j();try{return L(r)(n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P)}catch(E){if(I(z),E!==E+0)throw E;S(1,0)}}function W_(r,n,o){var l=j();try{return L(r)(n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function X_(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{L(r)(n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function G_(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z){var E=j();try{return L(r)(n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z)}catch(N){if(I(E),N!==N+0)throw N;S(1,0)}}function K_(r,n,o,l){var c=j();try{L(r)(n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function J_(r,n,o,l){var c=j();try{L(r)(n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function Q_(r,n){var o=j();try{return L(r)(n)}catch(l){if(I(o),l!==l+0)throw l;S(1,0)}}function $_(r,n){var o=j();try{return L(r)(n)}catch(l){if(I(o),l!==l+0)throw l;S(1,0)}}function Z_(r,n,o,l){var c=j();try{return L(r)(n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function t0(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k){var P=j();try{return L(r)(n,o,l,c,h,u,f,y,p,v,m,C,F,O,k)}catch(z){if(I(P),z!==z+0)throw z;S(1,0)}}function e0(r,n,o,l,c){var h=j();try{return L(r)(n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function i0(r,n,o,l,c,h){var u=j();try{L(r)(n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function r0(r,n,o){var l=j();try{L(r)(n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function n0(r,n,o,l,c,h,u,f,y){var p=j();try{L(r)(n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function s0(r,n,o,l,c,h,u,f,y,p){var v=j();try{return L(r)(n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function a0(r,n,o,l,c){var h=j();try{return L(r)(n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function o0(r,n,o,l,c){var h=j();try{return L(r)(n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function l0(r,n,o,l,c,h,u){var f=j();try{L(r)(n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function c0(r,n,o){var l=j();try{return L(r)(n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function h0(r,n,o,l,c,h,u){var f=j();try{return L(r)(n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function u0(r,n,o,l,c){var h=j();try{return L(r)(n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function d0(r,n,o,l,c,h,u){var f=j();try{return L(r)(n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function f0(r,n,o){var l=j();try{return L(r)(n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function y0(r,n,o){var l=j();try{return L(r)(n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function p0(r,n,o,l,c,h,u,f,y,p){var v=j();try{L(r)(n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function b0(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{L(r)(n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function _0(r,n,o,l,c){var h=j();try{return nc(r,n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function v0(r,n,o,l,c,h,u){var f=j();try{kc(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function g0(r,n,o,l,c){var h=j();try{mc(r,n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function m0(r,n,o,l,c,h,u){var f=j();try{return _c(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function w0(r,n,o,l,c){var h=j();try{return vc(r,n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function j0(r,n,o,l,c,h,u,f){var y=j();try{Pc(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function I0(r,n){var o=j();try{return dc(r,n)}catch(l){if(I(o),l!==l+0)throw l;S(1,0)}}function S0(r,n,o){var l=j();try{return uu(r,n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function C0(r,n,o,l,c,h,u){var f=j();try{oc(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function A0(r,n,o,l,c,h,u){var f=j();try{return sc(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function B0(r,n,o,l,c,h,u,f,y){var p=j();try{return ac(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function T0(r,n,o,l){var c=j();try{wc(r,n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function F0(r,n,o,l,c,h,u,f,y){var p=j();try{Bf(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function E0(r,n,o,l,c,h,u,f,y){var p=j();try{hu(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function O0(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{Tf(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function D0(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{Ff(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function R0(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P){var z=j();try{Ef(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P)}catch(E){if(I(z),E!==E+0)throw E;S(1,0)}}function M0(r,n,o,l,c,h,u){var f=j();try{lc(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function U0(r,n,o,l,c){var h=j();try{fc(r,n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function x0(r,n,o,l){var c=j();try{return cc(r,n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function N0(r,n,o,l,c,h){var u=j();try{pc(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function L0(r,n,o,l,c){var h=j();try{return hc(r,n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function k0(r,n,o,l,c,h,u){var f=j();try{lf(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function P0(r,n,o,l,c,h,u){var f=j();try{uc(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function H0(r,n,o,l,c){var h=j();try{return Fu(r,n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function V0(r,n,o,l,c,h){var u=j();try{return yc(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function z0(r,n,o,l,c,h,u,f){var y=j();try{wd(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function q0(r,n,o,l,c,h,u,f,y){var p=j();try{return _d(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Y0(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return sf(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function W0(r,n,o,l,c,h,u){var f=j();try{return Iu(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function X0(r,n,o,l,c,h,u,f){var y=j();try{return Df(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function G0(r){var n=j();try{return Cc(r)}catch(o){if(I(n),o!==o+0)throw o;S(1,0)}}function K0(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return du(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function J0(r,n,o,l,c,h,u,f){var y=j();try{return fu(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Q0(r,n,o,l,c,h,u,f,y,p){var v=j();try{return yu(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function $0(r,n,o,l,c,h){var u=j();try{Of(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function Z0(r,n,o,l,c,h){var u=j();try{return bc(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function tv(r,n,o,l){var c=j();try{return pu(r,n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function ev(r,n,o,l,c,h,u,f){var y=j();try{gd(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function iv(r,n,o,l,c,h,u,f,y,p){var v=j();try{gc(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function rv(r,n,o,l,c,h,u,f){var y=j();try{Ac(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function nv(r,n,o,l,c,h,u,f,y){var p=j();try{return Bc(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function sv(r,n,o,l,c,h,u,f){var y=j();try{return jc(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function av(r,n,o,l,c,h,u){var f=j();try{return Sc(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function ov(r,n,o,l,c,h,u,f){var y=j();try{return Ic(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function lv(r,n,o,l,c,h,u,f,y){var p=j();try{return Tc(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function cv(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{return Fc(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function hv(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{Ec(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function uv(r,n,o,l,c,h,u,f){var y=j();try{return Oc(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function dv(r,n,o,l,c,h){var u=j();try{Dc(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function fv(r,n,o,l,c,h,u,f){var y=j();try{Mc(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function yv(r,n,o,l,c,h,u){var f=j();try{Rc(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function pv(r,n,o,l,c,h,u,f){var y=j();try{return au(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function bv(r,n,o,l,c,h,u,f,y){var p=j();try{Hc(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function _v(r,n,o,l,c,h,u,f){var y=j();try{return Zc(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function vv(r,n,o,l,c,h,u,f,y){var p=j();try{Uc(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function gv(r,n,o,l,c,h,u,f,y,p){var v=j();try{xc(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function mv(r,n,o,l){var c=j();try{return Nc(r,n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function wv(r,n,o,l,c,h,u,f,y,p){var v=j();try{Lc(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function jv(r,n,o,l,c,h){var u=j();try{Vc(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function Iv(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{zc(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function Sv(r,n,o,l,c,h,u,f){var y=j();try{qc(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Cv(r,n,o,l,c,h,u,f,y,p,v,m,C){var F=j();try{Yc(r,n,o,l,c,h,u,f,y,p,v,m,C)}catch(O){if(I(F),O!==O+0)throw O;S(1,0)}}function Av(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{Gc(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function Bv(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k){var P=j();try{Kc(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k)}catch(z){if(I(P),z!==z+0)throw z;S(1,0)}}function Tv(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z){var E=j();try{Jc(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z)}catch(N){if(I(E),N!==N+0)throw N;S(1,0)}}function Fv(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{Wc(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function Ev(r,n,o,l,c,h,u,f,y,p,v,m,C){var F=j();try{return Xc(r,n,o,l,c,h,u,f,y,p,v,m,C)}catch(O){if(I(F),O!==O+0)throw O;S(1,0)}}function Ov(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{iu(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function Dv(r,n,o,l,c,h,u,f,y,p,v,m,C){var F=j();try{tu(r,n,o,l,c,h,u,f,y,p,v,m,C)}catch(O){if(I(F),O!==O+0)throw O;S(1,0)}}function Rv(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{Qc(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function Mv(r,n,o,l,c,h,u,f,y,p){var v=j();try{$c(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Uv(r,n,o,l,c,h,u,f){var y=j();try{Au(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function xv(r,n,o,l,c,h,u,f,y,p,v,m,C){var F=j();try{eu(r,n,o,l,c,h,u,f,y,p,v,m,C)}catch(O){if(I(F),O!==O+0)throw O;S(1,0)}}function Nv(r,n,o){var l=j();try{return ru(r,n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function Lv(r,n,o,l,c,h,u,f){var y=j();try{return ou(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function kv(r,n,o,l,c,h,u,f){var y=j();try{return lu(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Pv(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P){var z=j();try{cu(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P)}catch(E){if(I(z),E!==E+0)throw E;S(1,0)}}function Hv(r,n){var o=j();try{return nu(r,n)}catch(l){if(I(o),l!==l+0)throw l;S(1,0)}}function Vv(r,n){var o=j();try{return su(r,n)}catch(l){if(I(o),l!==l+0)throw l;S(1,0)}}function zv(r,n,o,l,c,h,u,f,y){var p=j();try{return _u(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function qv(r,n,o,l,c,h,u,f,y){var p=j();try{return vu(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Yv(r,n,o,l,c,h,u,f){var y=j();try{return gu(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Wv(r,n,o,l,c,h,u,f,y){var p=j();try{return bu(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Xv(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return Rd(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function Gv(r,n,o,l,c,h){var u=j();try{return mu(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function Kv(r,n,o,l,c,h,u,f,y,p){var v=j();try{Md(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Jv(r,n,o,l,c,h,u){var f=j();try{return wu(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function Qv(r,n,o,l,c,h,u,f){var y=j();try{return ju(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function $v(r,n,o,l,c,h){var u=j();try{return Su(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function Zv(r,n,o,l){var c=j();try{return Ku(r,n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function tg(r,n,o,l,c,h,u,f){var y=j();try{return af(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function eg(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{Bd(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function ig(r,n,o,l,c,h,u,f,y){var p=j();try{td(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function rg(r,n,o,l,c,h,u,f,y){var p=j();try{return Cu(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function ng(r,n,o,l,c,h,u,f){var y=j();try{return Bu(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function sg(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O){var k=j();try{Tu(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O)}catch(P){if(I(k),P!==P+0)throw P;S(1,0)}}function ag(r,n,o){var l=j();try{return od(r,n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function og(r,n,o,l,c,h,u){var f=j();try{yd(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function lg(r,n,o,l,c,h,u,f){var y=j();try{sd(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function cg(r,n,o,l,c,h,u,f,y){var p=j();try{nd(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function hg(r,n,o,l,c,h,u,f,y){var p=j();try{rd(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function ug(r,n,o,l,c,h,u){var f=j();try{Pu(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function dg(r,n,o,l,c,h,u){var f=j();try{return Eu(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function fg(r,n,o,l,c,h,u,f,y){var p=j();try{ku(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function yg(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{Lu(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function pg(r,n,o,l,c,h){var u=j();try{return Zu(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function bg(r,n,o,l,c,h,u,f,y,p){var v=j();try{Ou(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function _g(r,n,o,l,c,h,u,f,y){var p=j();try{Hu(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function vg(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O){var k=j();try{return Ru(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O)}catch(P){if(I(k),P!==P+0)throw P;S(1,0)}}function gg(r,n,o,l,c,h,u,f,y,p){var v=j();try{return Mu(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function mg(r,n,o,l,c,h,u,f,y){var p=j();try{return Uu(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function wg(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z,E){var N=j();try{return Du(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z,E)}catch(dt){if(I(N),dt!==dt+0)throw dt;S(1,0)}}function jg(r,n,o,l,c,h,u,f,y){var p=j();try{return xu(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Ig(r,n,o,l,c,h){var u=j();try{return Xu(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function Sg(r,n,o,l,c,h){var u=j();try{Nu(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function Cg(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{Vu(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function Ag(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return zu(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function Bg(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{qu(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function Tg(r,n,o,l,c,h,u,f){var y=j();try{Yu(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Fg(r,n,o,l,c,h,u,f,y,p){var v=j();try{Qu(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Eg(r,n,o,l,c,h,u,f,y,p){var v=j();try{$u(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Og(r,n,o,l,c,h,u){var f=j();try{return Ju(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function Dg(r,n,o,l,c,h,u,f,y){var p=j();try{return Gu(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Rg(r,n,o,l,c,h,u,f,y){var p=j();try{ed(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Mg(r,n,o,l,c,h,u){var f=j();try{return Wu(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function Ug(r,n,o,l,c,h,u){var f=j();try{return cd(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function xg(r,n,o,l,c,h){var u=j();try{return hd(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function Ng(r,n,o,l,c){var h=j();try{return dd(r,n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function Lg(r,n,o,l,c){var h=j();try{fd(r,n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function kg(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{pd(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function Pg(r,n,o,l,c){var h=j();try{return ld(r,n,o,l,c)}catch(u){if(I(h),u!==u+0)throw u;S(1,0)}}function Hg(r,n,o,l,c,h){var u=j();try{return bd(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function Vg(r,n,o,l,c,h,u){var f=j();try{return Ad(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function zg(r,n,o,l,c,h,u){var f=j();try{return ad(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function qg(r,n,o,l,c,h,u,f,y){var p=j();try{vd(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Yg(r,n,o,l,c,h,u,f,y,p){var v=j();try{return Cd(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Wg(r,n,o,l,c,h,u,f,y){var p=j();try{return Sd(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Xg(r,n,o,l,c,h,u,f,y,p){var v=j();try{md(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Gg(r,n,o,l,c,h,u,f,y,p){var v=j();try{jd(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Kg(r,n,o,l,c,h,u,f,y){var p=j();try{Id(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Jg(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{return Td(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function Qg(r,n,o,l,c,h,u,f,y,p){var v=j();try{return Fd(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function $g(r,n,o,l,c,h,u,f,y,p){var v=j();try{return Ed(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Zg(r,n,o,l,c,h,u){var f=j();try{return $d(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function tm(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return Zd(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function em(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return tf(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function im(r,n,o,l,c,h,u,f,y,p,v,m,C){var F=j();try{return Dd(r,n,o,l,c,h,u,f,y,p,v,m,C)}catch(O){if(I(F),O!==O+0)throw O;S(1,0)}}function rm(r,n,o,l,c,h,u,f,y,p){var v=j();try{return Ud(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function nm(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{xd(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function sm(r,n,o,l,c,h,u,f,y){var p=j();try{Od(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function am(r,n,o,l,c,h,u,f){var y=j();try{return Nd(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function om(r,n,o,l,c,h,u){var f=j();try{return Ld(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function lm(r,n,o,l,c,h){var u=j();try{return Pd(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function cm(r,n,o,l,c,h,u,f){var y=j();try{return kd(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function hm(r,n,o,l,c,h,u,f,y,p){var v=j();try{return Vd(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function um(r,n,o,l,c,h){var u=j();try{return Hd(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function dm(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z){var E=j();try{return zd(r,n,o,l,c,h,u,f,y,p,v,m,C,F,O,k,P,z)}catch(N){if(I(E),N!==N+0)throw N;S(1,0)}}function fm(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return qd(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function ym(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{return Yd(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function pm(r,n,o,l,c,h,u,f,y){var p=j();try{return Wd(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function bm(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return Xd(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function _m(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return Gd(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function vm(r,n,o,l,c,h,u,f,y,p){var v=j();try{return Kd(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function gm(r,n,o,l,c,h,u,f,y,p,v,m,C,F){var O=j();try{return Jd(r,n,o,l,c,h,u,f,y,p,v,m,C,F)}catch(k){if(I(O),k!==k+0)throw k;S(1,0)}}function mm(r,n,o,l,c,h,u,f,y,p){var v=j();try{Qd(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function wm(r,n,o,l,c,h,u,f,y){var p=j();try{ef(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function jm(r,n,o,l,c,h,u){var f=j();try{return rf(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function Im(r,n,o,l,c,h,u){var f=j();try{return nf(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function Sm(r,n,o,l,c,h,u,f,y,p){var v=j();try{ff(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Cm(r,n,o,l,c,h,u,f){var y=j();try{yf(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Am(r,n,o,l,c,h,u,f){var y=j();try{return pf(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Bm(r,n,o,l,c,h,u,f,y){var p=j();try{of(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Tm(r,n,o,l,c,h,u,f){var y=j();try{return cf(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Fm(r,n,o,l,c,h,u,f,y){var p=j();try{return hf(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Em(r,n,o,l,c,h,u,f,y,p){var v=j();try{return uf(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Om(r,n,o,l,c,h,u){var f=j();try{return df(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function Dm(r,n,o,l,c,h,u,f,y){var p=j();try{bf(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function Rm(r,n,o,l,c,h,u,f,y,p){var v=j();try{_f(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Mm(r,n,o,l,c,h,u,f){var y=j();try{return vf(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Um(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{gf(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function xm(r,n,o,l,c,h,u,f){var y=j();try{return mf(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Nm(r,n,o,l,c,h,u){var f=j();try{return wf(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function Lm(r,n,o,l){var c=j();try{return jf(r,n,o,l)}catch(h){if(I(c),h!==h+0)throw h;S(1,0)}}function km(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{If(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function Pm(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{Sf(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function Hm(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return Cf(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function Vm(r,n,o){var l=j();try{Af(r,n,o)}catch(c){if(I(l),c!==c+0)throw c;S(1,0)}}function zm(r,n,o,l,c,h,u,f,y,p){var v=j();try{return Rf(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function qm(r,n,o,l,c,h,u,f){var y=j();try{return Mf(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Ym(r,n,o,l,c,h,u,f,y,p){var v=j();try{id(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Wm(r,n,o,l,c,h,u){var f=j();try{return Uf(r,n,o,l,c,h,u)}catch(y){if(I(f),y!==y+0)throw y;S(1,0)}}function Xm(r,n,o,l,c,h){var u=j();try{return ud(r,n,o,l,c,h)}catch(f){if(I(u),f!==f+0)throw f;S(1,0)}}function Gm(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{xf(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function Km(r,n,o,l,c,h,u,f,y,p){var v=j();try{Lf(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function Jm(r,n,o,l,c,h,u,f,y,p,v,m,C){var F=j();try{Pf(r,n,o,l,c,h,u,f,y,p,v,m,C)}catch(O){if(I(F),O!==O+0)throw O;S(1,0)}}function Qm(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{Nf(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function $m(r,n,o,l,c,h,u,f){var y=j();try{kf(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function Zm(r,n,o,l,c,h,u,f,y,p,v,m,C){var F=j();try{return ny(r,n,o,l,c,h,u,f,y,p,v,m,C)}catch(O){if(I(F),O!==O+0)throw O;S(1,0)}}function tw(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return Vf(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function ew(r,n,o,l,c,h,u,f,y,p,v,m,C){var F=j();try{ty(r,n,o,l,c,h,u,f,y,p,v,m,C)}catch(O){if(I(F),O!==O+0)throw O;S(1,0)}}function iw(r,n,o,l,c,h,u,f,y,p){var v=j();try{return ey(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function rw(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return iy(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function nw(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{return ry(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function sw(r,n,o,l,c,h,u,f,y,p){var v=j();try{return oy(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function aw(r,n,o,l,c,h,u,f,y,p,v,m,C){var F=j();try{sy(r,n,o,l,c,h,u,f,y,p,v,m,C)}catch(O){if(I(F),O!==O+0)throw O;S(1,0)}}function ow(r,n,o,l,c,h,u,f,y){var p=j();try{yy(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function lw(r,n,o,l,c,h,u,f,y){var p=j();try{ay(r,n,o,l,c,h,u,f,y)}catch(v){if(I(p),v!==v+0)throw v;S(1,0)}}function cw(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{return ly(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function hw(r,n,o,l,c,h,u,f,y,p){var v=j();try{dy(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function uw(r,n,o,l,c,h,u,f){var y=j();try{return fy(r,n,o,l,c,h,u,f)}catch(p){if(I(y),p!==p+0)throw p;S(1,0)}}function dw(r,n,o,l,c,h,u,f,y,p,v){var m=j();try{return uy(r,n,o,l,c,h,u,f,y,p,v)}catch(C){if(I(m),C!==C+0)throw C;S(1,0)}}function fw(r,n,o,l,c,h,u,f,y,p){var v=j();try{return cy(r,n,o,l,c,h,u,f,y,p)}catch(m){if(I(v),m!==m+0)throw m;S(1,0)}}function yw(r,n,o,l,c,h,u,f,y,p,v,m){var C=j();try{return hy(r,n,o,l,c,h,u,f,y,p,v,m)}catch(F){if(I(C),F!==F+0)throw F;S(1,0)}}function pw(r){r=Object.assign({},r);var n=l=>()=>l()>>>0,o=l=>c=>l(c)>>>0;return r.__errno_location=n(r.__errno_location),r.lg=o(r.lg),r.pg=n(r.pg),r.rg=o(r.rg),r}s.stackAlloc=rl,s.stackSave=j,s.stackRestore=I,s.ccall=d_;var cl;ws=function r(){cl||py(),cl||(ws=r)};function bw(){var r=Zl,n=0,o=0;try{var l=r(n,o);return l_(l,!0),l}catch(c){return c_(c)}}function py(){if(gr>0||(Fy(),gr>0))return;function r(){cl||(cl=!0,s.calledRun=!0,!vr&&(Ey(),Oy(),b(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),by&&bw(),Dy()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),r()},1)):r()}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();var by=!0;return s.noInitialRun&&(by=!1),py(),d.ready}})();typeof e=="object"&&typeof t=="object"&&(t.exports=i)}),Lp=hs((exports,module)=>{(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=!1,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return typeof e=="object"&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(i){return new Sha256(t,!0).update(i)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(d){return t.create().update(d)};for(var i=0;i>2]|=e[d]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|a&63)<=57344?(_[s>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|a&63)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|a&63)<=64?(this.block=_[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[t&3],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e=this.h0,t=this.h1,i=this.h2,a=this.h3,d=this.h4,s=this.h5,b=this.h6,_=this.h7,g=this.blocks,A,T,M,U,x,W,Ot,mt,Ut,oi,Jt;for(A=16;A<64;++A)x=g[A-15],T=(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3,x=g[A-2],M=(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10,g[A]=g[A-16]+T+g[A-7]+M<<0;for(Jt=t&i,A=0;A<64;A+=4)this.first?(this.is224?(mt=300032,x=g[0]-1413257819,_=x-150054599<<0,a=x+24177077<<0):(mt=704751109,x=g[0]-210244248,_=x-1521486534<<0,a=x+143694565<<0),this.first=!1):(T=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),M=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7),mt=e&t,U=mt^e&i^Jt,Ot=d&s^~d&b,x=_+M+Ot+K[A]+g[A],W=T+U,_=a+x<<0,a=x+W<<0),T=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),M=(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7),Ut=a&e,U=Ut^a&t^mt,Ot=_&d^~_&s,x=b+M+Ot+K[A+1]+g[A+1],W=T+U,b=i+x<<0,i=x+W<<0,T=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),M=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7),oi=i&a,U=oi^i&e^Ut,Ot=b&_^~b&d,x=s+M+Ot+K[A+2]+g[A+2],W=T+U,s=t+x<<0,t=x+W<<0,T=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),M=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),Jt=t&i,U=Jt^t&a^oi,Ot=s&b^~s&_,x=d+M+Ot+K[A+3]+g[A+3],W=T+U,d=e+x<<0,e=x+W<<0;this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+i<<0,this.h3=this.h3+a<<0,this.h4=this.h4+d<<0,this.h5=this.h5+s<<0,this.h6=this.h6+b<<0,this.h7=this.h7+_<<0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,a=this.h3,d=this.h4,s=this.h5,b=this.h6,_=this.h7,g=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]+HEX_CHARS[d>>28&15]+HEX_CHARS[d>>24&15]+HEX_CHARS[d>>20&15]+HEX_CHARS[d>>16&15]+HEX_CHARS[d>>12&15]+HEX_CHARS[d>>8&15]+HEX_CHARS[d>>4&15]+HEX_CHARS[d&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[b>>28&15]+HEX_CHARS[b>>24&15]+HEX_CHARS[b>>20&15]+HEX_CHARS[b>>16&15]+HEX_CHARS[b>>12&15]+HEX_CHARS[b>>8&15]+HEX_CHARS[b>>4&15]+HEX_CHARS[b&15];return this.is224||(g+=HEX_CHARS[_>>28&15]+HEX_CHARS[_>>24&15]+HEX_CHARS[_>>20&15]+HEX_CHARS[_>>16&15]+HEX_CHARS[_>>12&15]+HEX_CHARS[_>>8&15]+HEX_CHARS[_>>4&15]+HEX_CHARS[_&15]),g},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,a=this.h3,d=this.h4,s=this.h5,b=this.h6,_=this.h7,g=[e>>24&255,e>>16&255,e>>8&255,e&255,t>>24&255,t>>16&255,t>>8&255,t&255,i>>24&255,i>>16&255,i>>8&255,i&255,a>>24&255,a>>16&255,a>>8&255,a&255,d>>24&255,d>>16&255,d>>8&255,d&255,s>>24&255,s>>16&255,s>>8&255,s&255,b>>24&255,b>>16&255,b>>8&255,b&255];return this.is224||g.push(_>>24&255,_>>16&255,_>>8&255,_&255),g},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e};function HmacSha256(e,t,i){var a,d=typeof e;if(d==="string"){var s=[],b=e.length,_=0,g;for(a=0;a>6,s[_++]=128|g&63):g<55296||g>=57344?(s[_++]=224|g>>12,s[_++]=128|g>>6&63,s[_++]=128|g&63):(g=65536+((g&1023)<<10|e.charCodeAt(++a)&1023),s[_++]=240|g>>18,s[_++]=128|g>>12&63,s[_++]=128|g>>6&63,s[_++]=128|g&63);e=s}else if(d==="object"){if(e===null)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw new Error(ERROR)}else throw new Error(ERROR);e.length>64&&(e=new Sha256(t,!0).update(e).array());var A=[],T=[];for(a=0;a<64;++a){var M=e[a]||0;A[a]=92^M,T[a]=54^M}Sha256.call(this,t,i),this.update(T),this.oKeyPad=A,this.inner=!0,this.sharedMemory=i}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()}),RI={};Zi(RI,{registerWorker:()=>zp});function $f(e,t){var i={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(i[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,a=Object.getOwnPropertySymbols(e);d=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Z(e){return this instanceof Z?(this.v=e,this):new Z(e)}function ce(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i.apply(e,t||[]),d,s=[];return d={},b("next"),b("throw"),b("return"),d[Symbol.asyncIterator]=function(){return this},d;function b(U){a[U]&&(d[U]=function(x){return new Promise(function(W,Ot){s.push([U,x,W,Ot])>1||_(U,x)})})}function _(U,x){try{g(a[U](x))}catch(W){M(s[0][3],W)}}function g(U){U.value instanceof Z?Promise.resolve(U.value.v).then(A,T):M(s[0][2],U)}function A(U){_("next",U)}function T(U){_("throw",U)}function M(U,x){U(x),s.shift(),s.length&&_(s[0][0],s[0][1])}}function Ir(e){var t,i;return t={},a("next"),a("throw",function(d){throw d}),a("return"),t[Symbol.iterator]=function(){return this},t;function a(d,s){t[d]=e[d]?function(b){return(i=!i)?{value:Z(e[d](b)),done:!1}:s?s(b):b}:s}}function Be(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],i;return t?t.call(e):(e=typeof Wf=="function"?Wf(e):e[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(s){i[s]=e[s]&&function(b){return new Promise(function(_,g){b=e[s](b),d(_,g,b.done,b.value)})}}function d(s,b,_,g){Promise.resolve(g).then(function(A){s({value:A,done:_})},b)}}var ua={};Zi(ua,{compareArrayLike:()=>ca,joinUint8Arrays:()=>ue,memcpy:()=>Cr,rebaseValueOffsets:()=>sn,toArrayBufferView:()=>st,toArrayBufferViewAsyncIterator:()=>Te,toArrayBufferViewIterator:()=>$e,toBigInt64Array:()=>Qw,toBigUint64Array:()=>ij,toFloat32Array:()=>rj,toFloat32ArrayAsyncIterator:()=>vj,toFloat32ArrayIterator:()=>dj,toFloat64Array:()=>nj,toFloat64ArrayAsyncIterator:()=>gj,toFloat64ArrayIterator:()=>fj,toInt16Array:()=>Zw,toInt16ArrayAsyncIterator:()=>_j,toInt16ArrayIterator:()=>aj,toInt32Array:()=>tr,toInt32ArrayAsyncIterator:()=>yj,toInt32ArrayIterator:()=>lj,toInt8Array:()=>qw,toInt8ArrayAsyncIterator:()=>pj,toInt8ArrayIterator:()=>oj,toUint16Array:()=>tj,toUint16ArrayAsyncIterator:()=>mj,toUint16ArrayIterator:()=>cj,toUint32Array:()=>ej,toUint32ArrayAsyncIterator:()=>bj,toUint32ArrayIterator:()=>uj,toUint8Array:()=>J,toUint8ArrayAsyncIterator:()=>la,toUint8ArrayIterator:()=>aa,toUint8ClampedArray:()=>sj,toUint8ClampedArrayAsyncIterator:()=>wj,toUint8ClampedArrayIterator:()=>hj});var Xw=new TextDecoder("utf-8"),rn=e=>Xw.decode(e),Gw=new TextEncoder,Di=e=>Gw.encode(e),Kw=e=>typeof e=="number",Yf=e=>typeof e=="boolean",Nt=e=>typeof e=="function",qt=e=>e!=null&&Object(e)===e,Ae=e=>qt(e)&&Nt(e.then),xe=e=>qt(e)&&Nt(e[Symbol.iterator]),ge=e=>qt(e)&&Nt(e[Symbol.asyncIterator]),ps=e=>qt(e)&&qt(e.schema),_s=e=>qt(e)&&"done"in e&&"value"in e,ys=e=>qt(e)&&Nt(e.stat)&&Kw(e.fd),ms=e=>qt(e)&&nn(e.body),bs=e=>"_getDOMStream"in e&&"_getNodeStream"in e,Xf=e=>qt(e)&&Nt(e.abort)&&Nt(e.getWriter)&&!bs(e),nn=e=>qt(e)&&Nt(e.cancel)&&Nt(e.getReader)&&!bs(e),Gf=e=>qt(e)&&Nt(e.end)&&Nt(e.write)&&Yf(e.writable)&&!bs(e),vs=e=>qt(e)&&Nt(e.read)&&Nt(e.pipe)&&Yf(e.readable)&&!bs(e),Kf=e=>qt(e)&&Nt(e.clear)&&Nt(e.bytes)&&Nt(e.position)&&Nt(e.setPosition)&&Nt(e.capacity)&&Nt(e.getBufferIdentifier)&&Nt(e.createLong),oa=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Jw(e){let t=e[0]?[e[0]]:[],i,a,d,s;for(let b,_,g=0,A=0,T=e.length;++gT+M.byteLength,0),d,s,b,_=0,g=-1,A=Math.min(t||Number.POSITIVE_INFINITY,a);for(let T=i.length;++gst(Int8Array,e),Zw=e=>st(Int16Array,e),tr=e=>st(Int32Array,e),Qw=e=>st(BigInt64Array,e),J=e=>st(Uint8Array,e),tj=e=>st(Uint16Array,e),ej=e=>st(Uint32Array,e),ij=e=>st(BigUint64Array,e),rj=e=>st(Float32Array,e),nj=e=>st(Float64Array,e),sj=e=>st(Uint8ClampedArray,e),sa=e=>(e.next(),e);function*$e(e,t){let i=function*(d){yield d},a=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof oa?i(t):xe(t)?t:i(t);return yield*Qi(sa(function*(d){let s=null;do s=d.next(yield st(e,s));while(!s.done)}(a[Symbol.iterator]()))),new e}var oj=e=>$e(Int8Array,e),aj=e=>$e(Int16Array,e),lj=e=>$e(Int32Array,e),aa=e=>$e(Uint8Array,e),cj=e=>$e(Uint16Array,e),uj=e=>$e(Uint32Array,e),dj=e=>$e(Float32Array,e),fj=e=>$e(Float64Array,e),hj=e=>$e(Uint8ClampedArray,e);function Te(e,t){return ce(this,arguments,function*(){if(Ae(t))return yield Z(yield Z(yield*Qi(Ir(Be(Te(e,yield Z(t)))))));let i=function(s){return ce(this,arguments,function*(){yield yield Z(yield Z(s))})},a=function(s){return ce(this,arguments,function*(){yield Z(yield*Qi(Ir(Be(sa(function*(b){let _=null;do _=b.next(yield _==null?void 0:_.value);while(!_.done)}(s[Symbol.iterator]()))))))})},d=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof oa?i(t):xe(t)?a(t):ge(t)?t:i(t);return yield Z(yield*Qi(Ir(Be(sa(function(s){return ce(this,arguments,function*(){let b=null;do b=yield Z(s.next(yield yield Z(st(e,b))));while(!b.done)})}(d[Symbol.asyncIterator]())))))),yield Z(new e)})}var pj=e=>Te(Int8Array,e),_j=e=>Te(Int16Array,e),yj=e=>Te(Int32Array,e),la=e=>Te(Uint8Array,e),mj=e=>Te(Uint16Array,e),bj=e=>Te(Uint32Array,e),vj=e=>Te(Float32Array,e),gj=e=>Te(Float64Array,e),wj=e=>Te(Uint8ClampedArray,e);function sn(e,t,i){if(e!==0){i=i.slice(0,t+1);for(let a=-1;++a<=t;)i[a]+=e}return i}function ca(e,t){let i=0,a=e.length;if(a!==t.length)return!1;if(a>0)do if(e[i]!==t[i])return!1;while(++i(e.next(),e);function*jj(e){let t,i=!1,a=[],d,s,b,_=0;function g(){return s==="peek"?ue(a,b)[0]:([d,a,_]=ue(a,b),d)}({cmd:s,size:b}=yield null);let A=aa(e)[Symbol.iterator]();try{do if({done:t,value:d}=Number.isNaN(b-_)?A.next():A.next(b-_),!t&&d.byteLength>0&&(a.push(d),_+=d.byteLength),t||b<=_)do({cmd:s,size:b}=yield g());while(b<_);while(!t)}catch(T){(i=!0)&&typeof A.throw=="function"&&A.throw(T)}finally{i===!1&&typeof A.return=="function"&&A.return(null)}return null}function Sj(e){return ce(this,arguments,function*(){let t,i=!1,a=[],d,s,b,_=0;function g(){return s==="peek"?ue(a,b)[0]:([d,a,_]=ue(a,b),d)}({cmd:s,size:b}=yield yield Z(null));let A=la(e)[Symbol.asyncIterator]();try{do if({done:t,value:d}=Number.isNaN(b-_)?yield Z(A.next()):yield Z(A.next(b-_)),!t&&d.byteLength>0&&(a.push(d),_+=d.byteLength),t||b<=_)do({cmd:s,size:b}=yield yield Z(g()));while(b<_);while(!t)}catch(T){(i=!0)&&typeof A.throw=="function"&&(yield Z(A.throw(T)))}finally{i===!1&&typeof A.return=="function"&&(yield Z(A.return(new Uint8Array(0))))}return yield Z(null)})}function Ij(e){return ce(this,arguments,function*(){let t=!1,i=!1,a=[],d,s,b,_=0;function g(){return s==="peek"?ue(a,b)[0]:([d,a,_]=ue(a,b),d)}({cmd:s,size:b}=yield yield Z(null));let A=new fa(e);try{do if({done:t,value:d}=Number.isNaN(b-_)?yield Z(A.read()):yield Z(A.read(b-_)),!t&&d.byteLength>0&&(a.push(J(d)),_+=d.byteLength),t||b<=_)do({cmd:s,size:b}=yield yield Z(g()));while(b<_);while(!t)}catch(T){(i=!0)&&(yield Z(A.cancel(T)))}finally{i===!1?yield Z(A.cancel()):e.locked&&A.releaseLock()}return yield Z(null)})}var fa=class{constructor(e){this.source=e,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return R(this,void 0,void 0,function*(){let{reader:t,source:i}=this;t&&(yield t.cancel(e).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(e){return R(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=yield this.reader.read();return!t.done&&(t.value=J(t)),t})}},da=(e,t)=>{let i=d=>a([t,d]),a;return[t,i,new Promise(d=>(a=d)&&e.once(t,i))]};function Cj(e){return ce(this,arguments,function*(){let t=[],i="error",a=!1,d=null,s,b,_=0,g=[],A;function T(){return s==="peek"?ue(g,b)[0]:([A,g,_]=ue(g,b),A)}if({cmd:s,size:b}=yield yield Z(null),e.isTTY)return yield yield Z(new Uint8Array(0)),yield Z(null);try{t[0]=da(e,"end"),t[1]=da(e,"error");do{if(t[2]=da(e,"readable"),[i,d]=yield Z(Promise.race(t.map(U=>U[2]))),i==="error")break;if((a=i==="end")||(Number.isFinite(b-_)?(A=J(e.read(b-_)),A.byteLength0&&(g.push(A),_+=A.byteLength)),a||b<=_)do({cmd:s,size:b}=yield yield Z(T()));while(b<_)}while(!a)}finally{yield Z(M(t,i==="error"?d:null))}return yield Z(null);function M(U,x){return A=g=null,new Promise((W,Ot)=>{for(let[mt,Ut]of U)e.off(mt,Ut);try{let mt=e.destroy;mt&&mt.call(e,x),x=void 0}catch(mt){x=mt||x}finally{x!=null?Ot(x):W()}})}})}var Pt;(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(Pt||(Pt={}));var Bt;(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(Bt||(Bt={}));var St;(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(St||(St={}));var Wt;(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(Wt||(Wt={}));var lt;(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(lt||(lt={}));var Zt;(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Zt||(Zt={}));var ft;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(ft||(ft={}));var B;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"})(B||(B={}));var we;(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(we||(we={}));var xa={};Zi(xa,{clampIndex:()=>_S,clampRange:()=>cn,createElementComparator:()=>Oi});function Ye(e){if(e===null)return"null";if(e===void 0)return"undefined";switch(typeof e){case"number":return"".concat(e);case"bigint":return"".concat(e);case"string":return'"'.concat(e,'"')}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?"[".concat([...e].map(t=>Ye(t)),"]"):"[".concat(e,"]"):ArrayBuffer.isView(e)?"[".concat(e,"]"):JSON.stringify(e,(t,i)=>typeof i=="bigint"?"".concat(i):i)}var pa={};Zi(pa,{BN:()=>an,bigNumToBigInt:()=>Zf,bigNumToString:()=>Ar,isArrowBigNumSymbol:()=>Jf});var Jf=Symbol.for("isArrowBigNum");function De(e,...t){return t.length===0?Object.setPrototypeOf(st(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}De.prototype[Jf]=!0,De.prototype.toJSON=function(){return'"'.concat(Ar(this),'"')},De.prototype.valueOf=function(){return qf(this)},De.prototype.toString=function(){return Ar(this)},De.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return qf(this);case"string":return Ar(this);case"default":return Zf(this)}return Ar(this)};function Fr(...e){return De.apply(this,e)}function Br(...e){return De.apply(this,e)}function on(...e){return De.apply(this,e)}Object.setPrototypeOf(Fr.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(Br.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(on.prototype,Object.create(Uint32Array.prototype)),Object.assign(Fr.prototype,De.prototype,{constructor:Fr,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(Br.prototype,De.prototype,{constructor:Br,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(on.prototype,De.prototype,{constructor:on,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});function qf(e){let{buffer:t,byteOffset:i,length:a,signed:d}=e,s=new BigUint64Array(t,i,a),b=d&&s.at(-1)&BigInt(1)<{if(e.byteLength===8){let d=new e.BigIntArray(e.buffer,e.byteOffset,1);return"".concat(d[0])}if(!e.signed)return ha(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return ha(e);t=t.slice();let i=1;for(let d=0;de.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:Ar(e);function ha(e){let t="",i=new Uint32Array(2),a=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),d=new Uint32Array((a=new Uint16Array(a).reverse()).buffer),s=-1,b=a.length-1;do{for(i[0]=a[s=0];sNumber.MAX_SAFE_INTEGER))throw new TypeError("".concat(e," is not safe to convert to a number."));return Number(e)}var Qf,th,eh,ih,rh,nh,sh,oh,ah,lh,ch,uh,dh,fh,hh,ph,_h,yh,mh,V=class Il{static isNull(t){return(t==null?void 0:t.typeId)===B.Null}static isInt(t){return(t==null?void 0:t.typeId)===B.Int}static isFloat(t){return(t==null?void 0:t.typeId)===B.Float}static isBinary(t){return(t==null?void 0:t.typeId)===B.Binary}static isUtf8(t){return(t==null?void 0:t.typeId)===B.Utf8}static isBool(t){return(t==null?void 0:t.typeId)===B.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===B.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===B.Date}static isTime(t){return(t==null?void 0:t.typeId)===B.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===B.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===B.Interval}static isList(t){return(t==null?void 0:t.typeId)===B.List}static isStruct(t){return(t==null?void 0:t.typeId)===B.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===B.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===B.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===B.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===B.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===B.Dictionary}static isDenseUnion(t){return Il.isUnion(t)&&t.mode===Bt.Dense}static isSparseUnion(t){return Il.isUnion(t)&&t.mode===Bt.Sparse}get typeId(){return B.NONE}};Qf=Symbol.toStringTag,V[Qf]=(e=>(e.children=null,e.ArrayType=Array,e[Symbol.toStringTag]="DataType"))(V.prototype);var Qt=class extends V{toString(){return"Null"}get typeId(){return B.Null}};th=Symbol.toStringTag,Qt[th]=(e=>e[Symbol.toStringTag]="Null")(Qt.prototype);var Et=class extends V{constructor(e,t){super(),this.isSigned=e,this.bitWidth=t}get typeId(){return B.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}};eh=Symbol.toStringTag,Et[eh]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(Et.prototype);var Xe=class extends Et{constructor(){super(!0,32)}get ArrayType(){return Int32Array}};Object.defineProperty(Xe.prototype,"ArrayType",{value:Int32Array});var ie=class extends V{constructor(e){super(),this.precision=e}get typeId(){return B.Float}get ArrayType(){switch(this.precision){case St.HALF:return Uint16Array;case St.SINGLE:return Float32Array;case St.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"Float".concat(this.precision<<5||16)}};ih=Symbol.toStringTag,ie[ih]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(ie.prototype);var li=class extends V{constructor(){super()}get typeId(){return B.Binary}toString(){return"Binary"}};rh=Symbol.toStringTag,li[rh]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(li.prototype);var ci=class extends V{constructor(){super()}get typeId(){return B.Utf8}toString(){return"Utf8"}};nh=Symbol.toStringTag,ci[nh]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(ci.prototype);var ui=class extends V{constructor(){super()}get typeId(){return B.Bool}toString(){return"Bool"}};sh=Symbol.toStringTag,ui[sh]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(ui.prototype);var di=class extends V{constructor(e,t,i=128){super(),this.scale=e,this.precision=t,this.bitWidth=i}get typeId(){return B.Decimal}toString(){return"Decimal[".concat(this.precision,"e").concat(this.scale>0?"+":"").concat(this.scale,"]")}};oh=Symbol.toStringTag,di[oh]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(di.prototype);var fi=class extends V{constructor(e){super(),this.unit=e}get typeId(){return B.Date}toString(){return"Date".concat((this.unit+1)*32,"<").concat(Wt[this.unit],">")}};ah=Symbol.toStringTag,fi[ah]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Date"))(fi.prototype);var Ee=class extends V{constructor(e,t){super(),this.unit=e,this.bitWidth=t}get typeId(){return B.Time}toString(){return"Time".concat(this.bitWidth,"<").concat(lt[this.unit],">")}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}};lh=Symbol.toStringTag,Ee[lh]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Ee.prototype);var hi=class extends V{constructor(e,t){super(),this.unit=e,this.timezone=t}get typeId(){return B.Timestamp}toString(){return"Timestamp<".concat(lt[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}};ch=Symbol.toStringTag,hi[ch]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Timestamp"))(hi.prototype);var pi=class extends V{constructor(e){super(),this.unit=e}get typeId(){return B.Interval}toString(){return"Interval<".concat(Zt[this.unit],">")}};uh=Symbol.toStringTag,pi[uh]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(pi.prototype);var ke=class extends V{constructor(e){super(),this.children=[e]}get typeId(){return B.List}toString(){return"List<".concat(this.valueType,">")}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};dh=Symbol.toStringTag,ke[dh]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(ke.prototype);var gt=class extends V{constructor(e){super(),this.children=e}get typeId(){return B.Struct}toString(){return"Struct<{".concat(this.children.map(e=>"".concat(e.name,":").concat(e.type)).join(", "),"}>")}};fh=Symbol.toStringTag,gt[fh]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(gt.prototype);var Oe=class extends V{constructor(e,t,i){super(),this.mode=e,this.children=i,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((a,d,s)=>(a[d]=s)&&a||a,Object.create(null))}get typeId(){return B.Union}toString(){return"".concat(this[Symbol.toStringTag],"<").concat(this.children.map(e=>"".concat(e.type)).join(" | "),">")}};hh=Symbol.toStringTag,Oe[hh]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(Oe.prototype);var _i=class extends V{constructor(e){super(),this.byteWidth=e}get typeId(){return B.FixedSizeBinary}toString(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}};ph=Symbol.toStringTag,_i[ph]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(_i.prototype);var Re=class extends V{constructor(e,t){super(),this.listSize=e,this.children=[t]}get typeId(){return B.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}};_h=Symbol.toStringTag,Re[_h]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(Re.prototype);var Me=class extends V{constructor(e,t=!1){super(),this.children=[e],this.keysSorted=t}get typeId(){return B.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return"Map<{".concat(this.children[0].type.children.map(e=>"".concat(e.name,":").concat(e.type)).join(", "),"}>")}};yh=Symbol.toStringTag,Me[yh]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(Me.prototype);var Fj=(e=>()=>++e)(-1),de=class extends V{constructor(e,t,i,a){super(),this.indices=t,this.dictionary=e,this.isOrdered=a||!1,this.id=i==null?Fj():ee(i)}get typeId(){return B.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return"Dictionary<".concat(this.indices,", ").concat(this.dictionary,">")}};mh=Symbol.toStringTag,de[mh]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(de.prototype);function fe(e){let t=e;switch(e.typeId){case B.Decimal:return e.bitWidth/32;case B.Timestamp:return 2;case B.Date:return 1+t.unit;case B.Interval:return 1+t.unit;case B.FixedSizeList:return t.listSize;case B.FixedSizeBinary:return t.byteWidth;default:return 1}}var H=class{visitMany(e,...t){return e.map((i,a)=>this.visit(i,...t.map(d=>d[a])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Bj(this,e,t)}getVisitFnByTypeId(e,t=!0){return xr(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function Bj(e,t,i=!0){return typeof t=="number"?xr(e,t,i):typeof t=="string"&&t in B?xr(e,B[t],i):t&&t instanceof V?xr(e,bh(t),i):t!=null&&t.type&&t.type instanceof V?xr(e,bh(t.type),i):xr(e,B.NONE,i)}function xr(e,t,i=!0){let a=null;switch(t){case B.Null:a=e.visitNull;break;case B.Bool:a=e.visitBool;break;case B.Int:a=e.visitInt;break;case B.Int8:a=e.visitInt8||e.visitInt;break;case B.Int16:a=e.visitInt16||e.visitInt;break;case B.Int32:a=e.visitInt32||e.visitInt;break;case B.Int64:a=e.visitInt64||e.visitInt;break;case B.Uint8:a=e.visitUint8||e.visitInt;break;case B.Uint16:a=e.visitUint16||e.visitInt;break;case B.Uint32:a=e.visitUint32||e.visitInt;break;case B.Uint64:a=e.visitUint64||e.visitInt;break;case B.Float:a=e.visitFloat;break;case B.Float16:a=e.visitFloat16||e.visitFloat;break;case B.Float32:a=e.visitFloat32||e.visitFloat;break;case B.Float64:a=e.visitFloat64||e.visitFloat;break;case B.Utf8:a=e.visitUtf8;break;case B.Binary:a=e.visitBinary;break;case B.FixedSizeBinary:a=e.visitFixedSizeBinary;break;case B.Date:a=e.visitDate;break;case B.DateDay:a=e.visitDateDay||e.visitDate;break;case B.DateMillisecond:a=e.visitDateMillisecond||e.visitDate;break;case B.Timestamp:a=e.visitTimestamp;break;case B.TimestampSecond:a=e.visitTimestampSecond||e.visitTimestamp;break;case B.TimestampMillisecond:a=e.visitTimestampMillisecond||e.visitTimestamp;break;case B.TimestampMicrosecond:a=e.visitTimestampMicrosecond||e.visitTimestamp;break;case B.TimestampNanosecond:a=e.visitTimestampNanosecond||e.visitTimestamp;break;case B.Time:a=e.visitTime;break;case B.TimeSecond:a=e.visitTimeSecond||e.visitTime;break;case B.TimeMillisecond:a=e.visitTimeMillisecond||e.visitTime;break;case B.TimeMicrosecond:a=e.visitTimeMicrosecond||e.visitTime;break;case B.TimeNanosecond:a=e.visitTimeNanosecond||e.visitTime;break;case B.Decimal:a=e.visitDecimal;break;case B.List:a=e.visitList;break;case B.Struct:a=e.visitStruct;break;case B.Union:a=e.visitUnion;break;case B.DenseUnion:a=e.visitDenseUnion||e.visitUnion;break;case B.SparseUnion:a=e.visitSparseUnion||e.visitUnion;break;case B.Dictionary:a=e.visitDictionary;break;case B.Interval:a=e.visitInterval;break;case B.IntervalDayTime:a=e.visitIntervalDayTime||e.visitInterval;break;case B.IntervalYearMonth:a=e.visitIntervalYearMonth||e.visitInterval;break;case B.FixedSizeList:a=e.visitFixedSizeList;break;case B.Map:a=e.visitMap;break}if(typeof a=="function")return a;if(!i)return()=>null;throw new Error("Unrecognized type '".concat(B[t],"'"))}function bh(e){switch(e.typeId){case B.Null:return B.Null;case B.Int:{let{bitWidth:t,isSigned:i}=e;switch(t){case 8:return i?B.Int8:B.Uint8;case 16:return i?B.Int16:B.Uint16;case 32:return i?B.Int32:B.Uint32;case 64:return i?B.Int64:B.Uint64}return B.Int}case B.Float:switch(e.precision){case St.HALF:return B.Float16;case St.SINGLE:return B.Float32;case St.DOUBLE:return B.Float64}return B.Float;case B.Binary:return B.Binary;case B.Utf8:return B.Utf8;case B.Bool:return B.Bool;case B.Decimal:return B.Decimal;case B.Time:switch(e.unit){case lt.SECOND:return B.TimeSecond;case lt.MILLISECOND:return B.TimeMillisecond;case lt.MICROSECOND:return B.TimeMicrosecond;case lt.NANOSECOND:return B.TimeNanosecond}return B.Time;case B.Timestamp:switch(e.unit){case lt.SECOND:return B.TimestampSecond;case lt.MILLISECOND:return B.TimestampMillisecond;case lt.MICROSECOND:return B.TimestampMicrosecond;case lt.NANOSECOND:return B.TimestampNanosecond}return B.Timestamp;case B.Date:switch(e.unit){case Wt.DAY:return B.DateDay;case Wt.MILLISECOND:return B.DateMillisecond}return B.Date;case B.Interval:switch(e.unit){case Zt.DAY_TIME:return B.IntervalDayTime;case Zt.YEAR_MONTH:return B.IntervalYearMonth}return B.Interval;case B.Map:return B.Map;case B.List:return B.List;case B.Struct:return B.Struct;case B.Union:switch(e.mode){case Bt.Dense:return B.DenseUnion;case Bt.Sparse:return B.SparseUnion}return B.Union;case B.FixedSizeBinary:return B.FixedSizeBinary;case B.FixedSizeList:return B.FixedSizeList;case B.Dictionary:return B.Dictionary}throw new Error("Unrecognized type '".concat(B[e.typeId],"'"))}H.prototype.visitInt8=null,H.prototype.visitInt16=null,H.prototype.visitInt32=null,H.prototype.visitInt64=null,H.prototype.visitUint8=null,H.prototype.visitUint16=null,H.prototype.visitUint32=null,H.prototype.visitUint64=null,H.prototype.visitFloat16=null,H.prototype.visitFloat32=null,H.prototype.visitFloat64=null,H.prototype.visitDateDay=null,H.prototype.visitDateMillisecond=null,H.prototype.visitTimestampSecond=null,H.prototype.visitTimestampMillisecond=null,H.prototype.visitTimestampMicrosecond=null,H.prototype.visitTimestampNanosecond=null,H.prototype.visitTimeSecond=null,H.prototype.visitTimeMillisecond=null,H.prototype.visitTimeMicrosecond=null,H.prototype.visitTimeNanosecond=null,H.prototype.visitDenseUnion=null,H.prototype.visitSparseUnion=null,H.prototype.visitIntervalDayTime=null,H.prototype.visitIntervalYearMonth=null;var _a={};Zi(_a,{float64ToUint16:()=>ln,uint16ToFloat64:()=>Ds});var vh=new Float64Array(1),Tr=new Uint32Array(vh.buffer);function Ds(e){let t=(e&31744)>>10,i=(e&1023)/1024,a=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return a*(i?Number.NaN:1/0);case 0:return a*(i?6103515625e-14*i:0)}return a*Math.pow(2,t-15)*(1+i)}function ln(e){if(e!==e)return 32256;vh[0]=e;let t=(Tr[1]&2147483648)>>16&65535,i=Tr[1]&2146435072,a=0;return i>=1089470464?Tr[0]>0?i=31744:(i=(i&2080374784)>>16,a=(Tr[1]&1048575)>>10):i<=1056964608?(a=1048576+(Tr[1]&1048575),a=1048576+(a<<(i>>20)-998)>>21,i=0):(i=i-1056964608>>10,a=(Tr[1]&1048575)+512>>10),t|i|a&65535}var q=class extends H{};function rt(e){return(t,i,a)=>{if(t.setValid(i,a!=null))return e(t,i,a)}}var Aj=(e,t,i)=>{e[t]=Math.trunc(i/864e5)},ya=(e,t,i)=>{e[t]=Math.trunc(i%4294967296),e[t+1]=Math.trunc(i/4294967296)},xj=(e,t,i)=>{e[t]=Math.trunc(i*1e3%4294967296),e[t+1]=Math.trunc(i*1e3/4294967296)},Tj=(e,t,i)=>{e[t]=Math.trunc(i*1e6%4294967296),e[t+1]=Math.trunc(i*1e6/4294967296)},gh=(e,t,i,a)=>{if(i+1{let d=e+i;a?t[d>>3]|=1<>3]&=~(1<{e[t]=i},ma=({values:e},t,i)=>{e[t]=i},wh=({values:e},t,i)=>{e[t]=ln(i)},Ej=(e,t,i)=>{switch(e.type.precision){case St.HALF:return wh(e,t,i);case St.SINGLE:case St.DOUBLE:return ma(e,t,i)}},Es=({values:e},t,i)=>{Aj(e,t,i.valueOf())},ks=({values:e},t,i)=>{ya(e,t*2,i.valueOf())},ba=({stride:e,values:t},i,a)=>{t.set(a.subarray(0,e),e*i)},kj=({values:e,valueOffsets:t},i,a)=>gh(e,t,i,a),Oj=({values:e,valueOffsets:t},i,a)=>{gh(e,t,i,Di(a))},va=(e,t,i)=>{e.type.unit===Wt.DAY?Es(e,t,i):ks(e,t,i)},Os=({values:e},t,i)=>ya(e,t*2,i/1e3),Rs=({values:e},t,i)=>ya(e,t*2,i),Ms=({values:e},t,i)=>xj(e,t*2,i),Us=({values:e},t,i)=>Tj(e,t*2,i),ga=(e,t,i)=>{switch(e.type.unit){case lt.SECOND:return Os(e,t,i);case lt.MILLISECOND:return Rs(e,t,i);case lt.MICROSECOND:return Ms(e,t,i);case lt.NANOSECOND:return Us(e,t,i)}},Ns=({values:e},t,i)=>{e[t]=i},Ls=({values:e},t,i)=>{e[t]=i},Ps=({values:e},t,i)=>{e[t]=i},Vs=({values:e},t,i)=>{e[t]=i},wa=(e,t,i)=>{switch(e.type.unit){case lt.SECOND:return Ns(e,t,i);case lt.MILLISECOND:return Ls(e,t,i);case lt.MICROSECOND:return Ps(e,t,i);case lt.NANOSECOND:return Vs(e,t,i)}},ja=({values:e,stride:t},i,a)=>{e.set(a.subarray(0,t),t*i)},Rj=(e,t,i)=>{let a=e.children[0],d=e.valueOffsets,s=$t.getVisitFn(a);if(Array.isArray(i))for(let b=-1,_=d[t],g=d[t+1];_{let a=e.children[0],{valueOffsets:d}=e,s=$t.getVisitFn(a),{[t]:b,[t+1]:_}=d,g=i instanceof Map?i.entries():Object.entries(i);for(let A of g)if(s(a,b,A),++b>=_)break},Uj=(e,t)=>(i,a,d,s)=>a&&i(a,e,t[s]),Nj=(e,t)=>(i,a,d,s)=>a&&i(a,e,t.get(s)),Lj=(e,t)=>(i,a,d,s)=>a&&i(a,e,t.get(d.name)),Pj=(e,t)=>(i,a,d,s)=>a&&i(a,e,t[d.name]),Vj=(e,t,i)=>{let a=e.type.children.map(s=>$t.getVisitFn(s.type)),d=i instanceof Map?Lj(t,i):i instanceof ct?Nj(t,i):Array.isArray(i)?Uj(t,i):Pj(t,i);e.type.children.forEach((s,b)=>d(a[b],e.children[b],s,b))},Hj=(e,t,i)=>{e.type.mode===Bt.Dense?jh(e,t,i):Sh(e,t,i)},jh=(e,t,i)=>{let a=e.type.typeIdToChildIndex[e.typeIds[t]],d=e.children[a];$t.visit(d,e.valueOffsets[t],i)},Sh=(e,t,i)=>{let a=e.type.typeIdToChildIndex[e.typeIds[t]],d=e.children[a];$t.visit(d,t,i)},zj=(e,t,i)=>{var a;(a=e.dictionary)===null||a===void 0||a.set(e.values[t],i)},Sa=(e,t,i)=>{e.type.unit===Zt.DAY_TIME?Hs(e,t,i):zs(e,t,i)},Hs=({values:e},t,i)=>{e.set(i.subarray(0,2),2*t)},zs=({values:e},t,i)=>{e[t]=i[0]*12+i[1]%12},Wj=(e,t,i)=>{let{stride:a}=e,d=e.children[0],s=$t.getVisitFn(d);if(Array.isArray(i))for(let b=-1,_=t*a;++b"".concat(Ye(e),": ").concat(Ye(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Ia(this[Ue],this[Dr])}},Ia=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return et.name)}has(e,t){return e[Ue].type.children.findIndex(i=>i.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[Ue].type.children.findIndex(i=>i.name===t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let i=e[Ue].type.children.findIndex(a=>a.name===t);if(i!==-1){let a=Rt.visit(e[Ue].children[i],e[Dr]);return Reflect.set(e,t,a),a}}set(e,t,i){let a=e[Ue].type.children.findIndex(d=>d.name===t);return a!==-1?($t.visit(e[Ue].children[a],e[Dr],i),Reflect.set(e,t,i)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,i):!1}},$=class extends H{};function tt(e){return(t,i)=>t.getValid(i)?e(t,i):null}var $j=(e,t)=>864e5*e[t],Fa=(e,t)=>4294967296*e[t+1]+(e[t]>>>0),Yj=(e,t)=>4294967296*(e[t+1]/1e3)+(e[t]>>>0)/1e3,Xj=(e,t)=>4294967296*(e[t+1]/1e6)+(e[t]>>>0)/1e6,Ih=e=>new Date(e),Gj=(e,t)=>Ih($j(e,t)),Kj=(e,t)=>Ih(Fa(e,t)),Jj=(e,t)=>null,Ch=(e,t,i)=>{if(i+1>=t.length)return null;let a=t[i],d=t[i+1];return e.subarray(a,d)},qj=({offset:e,values:t},i)=>{let a=e+i;return(t[a>>3]&1<Gj(e,t),Bh=({values:e},t)=>Kj(e,t*2),ki=({stride:e,values:t},i)=>t[e*i],Zj=({stride:e,values:t},i)=>Ds(t[e*i]),Ah=({values:e},t)=>e[t],Qj=({stride:e,values:t},i)=>t.subarray(e*i,e*(i+1)),tS=({values:e,valueOffsets:t},i)=>Ch(e,t,i),eS=({values:e,valueOffsets:t},i)=>{let a=Ch(e,t,i);return a!==null?rn(a):null},iS=({values:e},t)=>e[t],rS=({type:e,values:t},i)=>e.precision!==St.HALF?t[i]:Ds(t[i]),nS=(e,t)=>e.type.unit===Wt.DAY?Fh(e,t):Bh(e,t),xh=({values:e},t)=>1e3*Fa(e,t*2),Th=({values:e},t)=>Fa(e,t*2),Dh=({values:e},t)=>Yj(e,t*2),Eh=({values:e},t)=>Xj(e,t*2),sS=(e,t)=>{switch(e.type.unit){case lt.SECOND:return xh(e,t);case lt.MILLISECOND:return Th(e,t);case lt.MICROSECOND:return Dh(e,t);case lt.NANOSECOND:return Eh(e,t)}},kh=({values:e},t)=>e[t],Oh=({values:e},t)=>e[t],Rh=({values:e},t)=>e[t],Mh=({values:e},t)=>e[t],oS=(e,t)=>{switch(e.type.unit){case lt.SECOND:return kh(e,t);case lt.MILLISECOND:return Oh(e,t);case lt.MICROSECOND:return Rh(e,t);case lt.NANOSECOND:return Mh(e,t)}},aS=({values:e,stride:t},i)=>an.decimal(e.subarray(t*i,t*(i+1))),lS=(e,t)=>{let{valueOffsets:i,stride:a,children:d}=e,{[t*a]:s,[t*a+1]:b}=i,_=d[0].slice(s,b-s);return new ct([_])},cS=(e,t)=>{let{valueOffsets:i,children:a}=e,{[t]:d,[t+1]:s}=i,b=a[0];return new Ge(b.slice(d,s-d))},uS=(e,t)=>new Ei(e,t),dS=(e,t)=>e.type.mode===Bt.Dense?Uh(e,t):Nh(e,t),Uh=(e,t)=>{let i=e.type.typeIdToChildIndex[e.typeIds[t]],a=e.children[i];return Rt.visit(a,e.valueOffsets[t])},Nh=(e,t)=>{let i=e.type.typeIdToChildIndex[e.typeIds[t]],a=e.children[i];return Rt.visit(a,t)},fS=(e,t)=>{var i;return(i=e.dictionary)===null||i===void 0?void 0:i.get(e.values[t])},hS=(e,t)=>e.type.unit===Zt.DAY_TIME?Lh(e,t):Ph(e,t),Lh=({values:e},t)=>e.subarray(2*t,2*(t+1)),Ph=({values:e},t)=>{let i=e[t],a=new Int32Array(2);return a[0]=Math.trunc(i/12),a[1]=Math.trunc(i%12),a},pS=(e,t)=>{let{stride:i,children:a}=e,d=a[0].slice(t*i,i);return new ct([d])};$.prototype.visitNull=tt(Jj),$.prototype.visitBool=tt(qj),$.prototype.visitInt=tt(iS),$.prototype.visitInt8=tt(ki),$.prototype.visitInt16=tt(ki),$.prototype.visitInt32=tt(ki),$.prototype.visitInt64=tt(Ah),$.prototype.visitUint8=tt(ki),$.prototype.visitUint16=tt(ki),$.prototype.visitUint32=tt(ki),$.prototype.visitUint64=tt(Ah),$.prototype.visitFloat=tt(rS),$.prototype.visitFloat16=tt(Zj),$.prototype.visitFloat32=tt(ki),$.prototype.visitFloat64=tt(ki),$.prototype.visitUtf8=tt(eS),$.prototype.visitBinary=tt(tS),$.prototype.visitFixedSizeBinary=tt(Qj),$.prototype.visitDate=tt(nS),$.prototype.visitDateDay=tt(Fh),$.prototype.visitDateMillisecond=tt(Bh),$.prototype.visitTimestamp=tt(sS),$.prototype.visitTimestampSecond=tt(xh),$.prototype.visitTimestampMillisecond=tt(Th),$.prototype.visitTimestampMicrosecond=tt(Dh),$.prototype.visitTimestampNanosecond=tt(Eh),$.prototype.visitTime=tt(oS),$.prototype.visitTimeSecond=tt(kh),$.prototype.visitTimeMillisecond=tt(Oh),$.prototype.visitTimeMicrosecond=tt(Rh),$.prototype.visitTimeNanosecond=tt(Mh),$.prototype.visitDecimal=tt(aS),$.prototype.visitList=tt(lS),$.prototype.visitStruct=tt(uS),$.prototype.visitUnion=tt(dS),$.prototype.visitDenseUnion=tt(Uh),$.prototype.visitSparseUnion=tt(Nh),$.prototype.visitDictionary=tt(fS),$.prototype.visitInterval=tt(hS),$.prototype.visitIntervalDayTime=tt(Lh),$.prototype.visitIntervalYearMonth=tt(Ph),$.prototype.visitFixedSizeList=tt(pS),$.prototype.visitMap=tt(cS);var Rt=new $,je=Symbol.for("keys"),Er=Symbol.for("vals"),Ge=class{constructor(e){return this[je]=new ct([e.children[0]]).memoize(),this[Er]=e.children[1],new Proxy(this,new Aa)}[Symbol.iterator](){return new Ba(this[je],this[Er])}get size(){return this[je].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[je],t=this[Er],i={};for(let a=-1,d=e.length;++a"".concat(Ye(e),": ").concat(Ye(t))).join(", "),"}")}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Ba=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),Rt.visit(this.vals,e)]})}},Aa=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[je].toArray().map(String)}has(e,t){return e[je].includes(t)}getOwnPropertyDescriptor(e,t){if(e[je].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let i=e[je].indexOf(t);if(i!==-1){let a=Rt.visit(Reflect.get(e,Er),i);return Reflect.set(e,t,a),a}}set(e,t,i){let a=e[je].indexOf(t);return a!==-1?($t.visit(Reflect.get(e,Er),a,i),Reflect.set(e,t,i)):Reflect.has(e,t)?Reflect.set(e,t,i):!1}};Object.defineProperties(Ge.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[je]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Er]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function _S(e,t,i){let a=e.length,d=t>-1?t:a+t%a;return i?i(e,d):d}var Vh;function cn(e,t,i,a){let{length:d=0}=e,s=typeof t!="number"?0:t,b=typeof i!="number"?d:i;return s<0&&(s=(s%d+d)%d),b<0&&(b=(b%d+d)%d),bd&&(b=d),a?a(e,s,b):[s,b]}var Hh=e=>e!==e;function Oi(e){if(typeof e!="object"||e===null)return Hh(e)?Hh:t=>t===e;if(e instanceof Date){let t=e.valueOf();return i=>i instanceof Date?i.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?ca(e,t):!1:e instanceof Map?mS(e):Array.isArray(e)?yS(e):e instanceof ct?bS(e):vS(e,!0)}function yS(e){let t=[];for(let i=-1,a=e.length;++i!1;let a=[];for(let d=-1,s=i.length;++d{if(!i||typeof i!="object")return!1;switch(i.constructor){case Array:return gS(e,i);case Map:return zh(e,i,i.keys());case Ge:case Ei:case Object:case void 0:return zh(e,i,t||Object.keys(i))}return i instanceof ct?wS(e,i):!1}}function gS(e,t){let i=e.length;if(t.length!==i)return!1;for(let a=-1;++aer,getBit:()=>Wh,getBool:()=>Ys,packBools:()=>ir,popcnt_array:()=>$h,popcnt_bit_range:()=>un,popcnt_uint32:()=>$s,setBool:()=>jS,truncateBitmap:()=>kr});function Ys(e,t,i,a){return(i&1<>a}function jS(e,t,i){return i?!!(e[t>>3]|=1<>3]&=~(1<0||i.byteLength>3):ir(new er(i,e,t,null,Ys)).subarray(0,a)),d}return i}function ir(e){let t=[],i=0,a=0,d=0;for(let b of e)b&&(d|=1<0)&&(t[i++]=d);let s=new Uint8Array(t.length+7&-8);return s.set(t),s}var er=class{constructor(e,t,i,a,d){this.bytes=e,this.length=i,this.context=a,this.get=d,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,d=t+(t%8===0?0:8-t%8);return un(e,t,d)+un(e,a,i)+$h(e,d>>3,a-d>>3)}function $h(e,t,i){let a=0,d=Math.trunc(t),s=new DataView(e.buffer,e.byteOffset,e.byteLength),b=i===void 0?e.byteLength:d+i;for(;b-d>=4;)a+=$s(s.getUint32(d)),d+=4;for(;b-d>=2;)a+=$s(s.getUint16(d)),d+=2;for(;b-d>=1;)a+=$s(s.getUint8(d)),d+=1;return a}function $s(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var SS=-1,bt=class Sl{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0,{valueOffsets:i,values:a,nullBitmap:d,typeIds:s}=this;return i&&(t+=i.byteLength),a&&(t+=a.byteLength),d&&(t+=d.byteLength),s&&(t+=s.byteLength),this.children.reduce((b,_)=>b+_.byteLength,t)}get nullCount(){let t=this._nullCount,i;return t<=SS&&(i=this.nullBitmap)&&(this._nullCount=t=this.length-un(i,this.offset,this.offset+this.length)),t}constructor(t,i,a,d,s,b=[],_){this.type=t,this.children=b,this.dictionary=_,this.offset=Math.floor(Math.max(i||0,0)),this.length=Math.floor(Math.max(a||0,0)),this._nullCount=Math.floor(Math.max(d||0,-1));let g;s instanceof Sl?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=fe(t),s&&((g=s[0])&&(this.valueOffsets=g),(g=s[1])&&(this.values=g),(g=s[2])&&(this.nullBitmap=g),(g=s[3])&&(this.typeIds=g))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}getValid(t){if(this.nullable&&this.nullCount>0){let i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3){let{nullBitmap:g}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:g,_nullCount:0})}let{nullBitmap:a,offset:d}=this,s=d+t>>3,b=(d+t)%8,_=a[s]>>b&1;return i?_===0&&(a[s]|=1<>3).fill(255,0,i>>3);d[i>>3]=(1<0&&d.set(kr(this.offset,i,this.nullBitmap),0);let s=this.buffers;return s[we.VALIDITY]=d,this.clone(this.type,0,t,a+(t-i),s)}_sliceBuffers(t,i,a,d){let s,{buffers:b}=this;return(s=b[we.TYPE])&&(b[we.TYPE]=s.subarray(t,t+i)),(s=b[we.OFFSET])&&(b[we.OFFSET]=s.subarray(t,t+i+1))||(s=b[we.DATA])&&(b[we.DATA]=d===6?s:s.subarray(a*t,a*(t+i))),b}_sliceChildren(t,i,a){return t.map(d=>d.slice(i,a))}};bt.prototype.children=Object.freeze([]);var Da=class ul extends H{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:i,["offset"]:a=0,["length"]:d=0}=t;return new bt(i,a,d,0)}visitBool(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.nullBitmap),s=st(i.ArrayType,t.data),{["length"]:b=s.length>>3,["nullCount"]:_=t.nullBitmap?-1:0}=t;return new bt(i,a,b,_,[void 0,s,d])}visitInt(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.nullBitmap),s=st(i.ArrayType,t.data),{["length"]:b=s.length,["nullCount"]:_=t.nullBitmap?-1:0}=t;return new bt(i,a,b,_,[void 0,s,d])}visitFloat(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.nullBitmap),s=st(i.ArrayType,t.data),{["length"]:b=s.length,["nullCount"]:_=t.nullBitmap?-1:0}=t;return new bt(i,a,b,_,[void 0,s,d])}visitUtf8(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.data),s=J(t.nullBitmap),b=tr(t.valueOffsets),{["length"]:_=b.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new bt(i,a,_,g,[b,d,s])}visitBinary(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.data),s=J(t.nullBitmap),b=tr(t.valueOffsets),{["length"]:_=b.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new bt(i,a,_,g,[b,d,s])}visitFixedSizeBinary(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.nullBitmap),s=st(i.ArrayType,t.data),{["length"]:b=s.length/fe(i),["nullCount"]:_=t.nullBitmap?-1:0}=t;return new bt(i,a,b,_,[void 0,s,d])}visitDate(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.nullBitmap),s=st(i.ArrayType,t.data),{["length"]:b=s.length/fe(i),["nullCount"]:_=t.nullBitmap?-1:0}=t;return new bt(i,a,b,_,[void 0,s,d])}visitTimestamp(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.nullBitmap),s=st(i.ArrayType,t.data),{["length"]:b=s.length/fe(i),["nullCount"]:_=t.nullBitmap?-1:0}=t;return new bt(i,a,b,_,[void 0,s,d])}visitTime(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.nullBitmap),s=st(i.ArrayType,t.data),{["length"]:b=s.length/fe(i),["nullCount"]:_=t.nullBitmap?-1:0}=t;return new bt(i,a,b,_,[void 0,s,d])}visitDecimal(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.nullBitmap),s=st(i.ArrayType,t.data),{["length"]:b=s.length/fe(i),["nullCount"]:_=t.nullBitmap?-1:0}=t;return new bt(i,a,b,_,[void 0,s,d])}visitList(t){let{["type"]:i,["offset"]:a=0,["child"]:d}=t,s=J(t.nullBitmap),b=tr(t.valueOffsets),{["length"]:_=b.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new bt(i,a,_,g,[b,void 0,s],[d])}visitStruct(t){let{["type"]:i,["offset"]:a=0,["children"]:d=[]}=t,s=J(t.nullBitmap),{length:b=d.reduce((g,{length:A})=>Math.max(g,A),0),nullCount:_=t.nullBitmap?-1:0}=t;return new bt(i,a,b,_,[void 0,void 0,s],d)}visitUnion(t){let{["type"]:i,["offset"]:a=0,["children"]:d=[]}=t,s=J(t.nullBitmap),b=st(i.ArrayType,t.typeIds),{["length"]:_=b.length,["nullCount"]:g=t.nullBitmap?-1:0}=t;if(V.isSparseUnion(i))return new bt(i,a,_,g,[void 0,void 0,s,b],d);let A=tr(t.valueOffsets);return new bt(i,a,_,g,[A,void 0,s,b],d)}visitDictionary(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.nullBitmap),s=st(i.indices.ArrayType,t.data),{["dictionary"]:b=new ct([new ul().visit({type:i.dictionary})])}=t,{["length"]:_=s.length,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new bt(i,a,_,g,[void 0,s,d],[],b)}visitInterval(t){let{["type"]:i,["offset"]:a=0}=t,d=J(t.nullBitmap),s=st(i.ArrayType,t.data),{["length"]:b=s.length/fe(i),["nullCount"]:_=t.nullBitmap?-1:0}=t;return new bt(i,a,b,_,[void 0,s,d])}visitFixedSizeList(t){let{["type"]:i,["offset"]:a=0,["child"]:d=new ul().visit({type:i.valueType})}=t,s=J(t.nullBitmap),{["length"]:b=d.length/fe(i),["nullCount"]:_=t.nullBitmap?-1:0}=t;return new bt(i,a,b,_,[void 0,void 0,s],[d])}visitMap(t){let{["type"]:i,["offset"]:a=0,["child"]:d=new ul().visit({type:i.childType})}=t,s=J(t.nullBitmap),b=tr(t.valueOffsets),{["length"]:_=b.length-1,["nullCount"]:g=t.nullBitmap?-1:0}=t;return new bt(i,a,_,g,[b,void 0,s],[d])}};function Q(e){return new Da().visit(e)}var dn=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext+i.nullCount,0)}function Gs(e){return e.reduce((t,i,a)=>(t[a+1]=t[a]+i.length,t),new Uint32Array(e.length+1))}function Ks(e,t,i,a){let d=[];for(let s=-1,b=e.length;++s=a)break;if(i>=g+A)continue;if(g>=i&&g+A<=a){d.push(_);continue}let T=Math.max(0,i-g),M=Math.min(a-g,A);d.push(_.slice(T,M-T))}return d.length===0&&d.push(e[0].slice(0,0)),d}function Ea(e,t,i,a){let d=0,s=0,b=t.length-1;do{if(d>=b-1)return i0?0:-1}function CS(e,t){let{nullBitmap:i}=e;if(!i||e.nullCount<=0)return-1;let a=0;for(let d of new er(i,e.offset+(t||0),e.length,i,Ys)){if(!d)return a;++a}return-1}function ot(e,t,i){if(t===void 0)return-1;if(t===null)return CS(e,i);let a=Rt.getVisitFn(e),d=Oi(t);for(let s=(i||0)-1,b=e.length;++s{let d=e.data[a];return d.values.subarray(0,d.length)[Symbol.iterator]()});let i=0;return new dn(e.data.length,a=>{let d=e.data[a].length,s=e.slice(i,i+d);return i+=d,new ka(s)})}var ka=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe+t,Ke=class extends H{visitNull(e,t){return 0}visitInt(e,t){return e.type.bitWidth/8}visitFloat(e,t){return e.type.ArrayType.BYTES_PER_ELEMENT}visitBool(e,t){return 1/8}visitDecimal(e,t){return e.type.bitWidth/8}visitDate(e,t){return(e.type.unit+1)*4}visitTime(e,t){return e.type.bitWidth/8}visitTimestamp(e,t){return e.type.unit===lt.SECOND?4:8}visitInterval(e,t){return(e.type.unit+1)*4}visitStruct(e,t){return e.children.reduce((i,a)=>i+he.visit(a,t),0)}visitFixedSizeBinary(e,t){return e.type.byteWidth}visitMap(e,t){return 8+e.children.reduce((i,a)=>i+he.visit(a,t),0)}visitDictionary(e,t){var i;return e.type.indices.bitWidth/8+(((i=e.dictionary)===null||i===void 0?void 0:i.getByteLength(e.values[t]))||0)}},BS=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),AS=({valueOffsets:e},t)=>8+(e[t+1]-e[t]),xS=({valueOffsets:e,stride:t,children:i},a)=>{let d=i[0],{[a*t]:s}=e,{[a*t+1]:b}=e,_=he.getVisitFn(d.type),g=d.slice(s,b-s),A=8;for(let T=-1,M=b-s;++T{let a=t[0],d=a.slice(i*e,e),s=he.getVisitFn(a.type),b=0;for(let _=-1,g=d.length;++_e.type.mode===Bt.Dense?Xh(e,t):Gh(e,t),Xh=({type:e,children:t,typeIds:i,valueOffsets:a},d)=>{let s=e.typeIdToChildIndex[i[d]];return 8+he.visit(t[s],a[d])},Gh=({children:e},t)=>4+he.visitMany(e,e.map(()=>t)).reduce(FS,0);Ke.prototype.visitUtf8=BS,Ke.prototype.visitBinary=AS,Ke.prototype.visitList=xS,Ke.prototype.visitFixedSizeList=TS,Ke.prototype.visitUnion=DS,Ke.prototype.visitDenseUnion=Xh,Ke.prototype.visitSparseUnion=Gh;var he=new Ke,Kh,Jh={},qh={},ct=class mr{constructor(t){var i,a,d;let s=t[0]instanceof mr?t.flatMap(_=>_.data):t;if(s.length===0||s.some(_=>!(_ instanceof bt)))throw new TypeError("Vector constructor expects an Array of Data instances.");let b=(i=s[0])===null||i===void 0?void 0:i.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{let{get:_,set:g,indexOf:A,byteLength:T}=Jh[b.typeId],M=s[0];this.isValid=U=>fn(M,U),this.get=U=>_(M,U),this.set=(U,x)=>g(M,U,x),this.indexOf=U=>A(M,U),this.getByteLength=U=>T(M,U),this._offsets=[0,M.length];break}default:Object.setPrototypeOf(this,qh[b.typeId]),this._offsets=Gs(s);break}this.data=s,this.type=b,this.stride=fe(b),this.numChildren=(d=(a=b.children)===null||a===void 0?void 0:a.length)!==null&&d!==void 0?d:0,this.length=this._offsets.at(-1)}get byteLength(){return this._byteLength===-1&&(this._byteLength=this.data.reduce((t,i)=>t+i.byteLength,0)),this._byteLength}get nullCount(){return this._nullCount===-1&&(this._nullCount=Xs(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return"".concat(this.VectorName,"<").concat(this.type[Symbol.toStringTag],">")}get VectorName(){return"".concat(B[this.type.typeId],"Vector")}isValid(t){return!1}get(t){return null}set(t,i){}indexOf(t,i){return-1}includes(t,i){return this.indexOf(t,i)>0}getByteLength(t){return 0}[Symbol.iterator](){return Or.visit(this)}concat(...t){return new mr(this.data.concat(t.flatMap(i=>i.data).flat(Number.POSITIVE_INFINITY)))}slice(t,i){return new mr(cn(this,t,i,({data:a,_offsets:d},s,b)=>Ks(a,d,s,b)))}toJSON(){return[...this]}toArray(){let{type:t,data:i,length:a,stride:d,ArrayType:s}=this;switch(t.typeId){case B.Int:case B.Float:case B.Decimal:case B.Time:case B.Timestamp:switch(i.length){case 0:return new s;case 1:return i[0].values.subarray(0,a*d);default:return i.reduce((b,{values:_,length:g})=>(b.array.set(_.subarray(0,g*d),b.offset),b.offset+=g*d,b),{array:new s(a*d),offset:0}).array}}return[...this]}toString(){return"[".concat([...this].join(","),"]")}getChild(t){var i;return this.getChildAt((i=this.type.children)===null||i===void 0?void 0:i.findIndex(a=>a.name===t))}getChildAt(t){return t>-1&&ti[t])):null}get isMemoized(){return V.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(V.isDictionary(this.type)){let t=new Zs(this.data[0].dictionary),i=this.data.map(a=>{let d=a.clone();return d.dictionary=t,d});return new mr(i)}return new Zs(this)}unmemoize(){if(V.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),i=this.data.map(a=>{let d=a.clone();return d.dictionary=t,d});return new mr(i)}return this}};Kh=Symbol.toStringTag,ct[Kh]=(e=>{e.type=V.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._nullCount=-1,e._byteLength=-1,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(B).map(i=>B[i]).filter(i=>typeof i=="number"&&i!==B.NONE);for(let i of t){let a=Rt.getVisitFnByTypeId(i),d=$t.getVisitFnByTypeId(i),s=rr.getVisitFnByTypeId(i),b=he.getVisitFnByTypeId(i);Jh[i]={get:a,set:d,indexOf:s,byteLength:b},qh[i]=Object.create(e,{isValid:{value:Ri(fn)},get:{value:Ri(Rt.getVisitFnByTypeId(i))},set:{value:Js($t.getVisitFnByTypeId(i))},indexOf:{value:qs(rr.getVisitFnByTypeId(i))},getByteLength:{value:Ri(he.getVisitFnByTypeId(i))}})}return"Vector"})(ct.prototype);var Zs=class my extends ct{constructor(t){super(t.data);let i=this.get,a=this.set,d=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(b){let _=s[b];if(_!==void 0)return _;let g=i.call(this,b);return s[b]=g,g}}),Object.defineProperty(this,"set",{value(b,_){a.call(this,b,_),s[b]=_}}),Object.defineProperty(this,"slice",{value:(b,_)=>new my(d.call(this,b,_))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new ct(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};function Zh(e){if(!e||e.length<=0)return function(a){return!0};let t="",i=e.filter(a=>a===a);return i.length>0&&(t=` switch (x) {`.concat(i.map(a=>` case `.concat(ES(a),":")).join(""),` return false; }`)),e.length!==i.length&&(t=`if (x !== x) return false; `.concat(t)),new Function("x","".concat(t,` return true;`))}function ES(e){return typeof e!="bigint"?Ye(e):"".concat(Ye(e),"n")}var Oa=(e,t)=>(Math.ceil(e)*t+63&-64||64)/t,kS=(e,t=0)=>e.length>=t?e.subarray(0,t):Cr(new e.constructor(t),e,0),Mi=class{constructor(e,t=1){this.buffer=e,this.stride=t,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e.constructor,this._resize(this.length=Math.ceil(e.length/t))}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,t){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let t=this.stride,i=this.length*t,a=this.buffer.length;i>=a&&this._resize(a===0?Oa(i*1,this.BYTES_PER_ELEMENT):Oa(i*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=Oa(e*this.stride,this.BYTES_PER_ELEMENT);let t=kS(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this._resize(0),this}_resize(e){return this.buffer=Cr(new this.ArrayType(e),this.buffer)}};Mi.prototype.offset=0;var mi=class extends Mi{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,t){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=t,this}},Rr=class extends mi{constructor(e=new Uint8Array(0)){super(e,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,t){let{buffer:i}=this.reserve(e-this.length+1),a=e>>3,d=e%8,s=i[a]>>d&1;return t?s===0&&(i[a]|=1<this.length&&this.set(e-1,0),super.flush(e+1)}},It=class{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=fe(e),this._nulls=new Rr,t&&t.length>0&&(this._isValid=Zh(t))}toVector(){return new ct([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0,{_offsets:t,_values:i,_nulls:a,_typeIds:d,children:s}=this;return t&&(e+=t.byteLength),i&&(e+=i.byteLength),a&&(e+=a.byteLength),d&&(e+=d.byteLength),s.reduce((b,_)=>b+_.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((t,i)=>t+i.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,t){return this.setValid(e,this.isValid(t))&&this.setValue(e,t),this}setValue(e,t){this._setValue(this,e,t)}setValid(e,t){return this.length=this._nulls.set(e,+t).length,t}addChild(e,t="".concat(this.numChildren)){throw new Error('Cannot append children to non-nested type "'.concat(this.type,'"'))}getChildAt(e){return this.children[e]||null}flush(){let e,t,i,a,{type:d,length:s,nullCount:b,_typeIds:_,_offsets:g,_values:A,_nulls:T}=this;(t=_==null?void 0:_.flush(s))?a=g==null?void 0:g.flush(s):(a=g==null?void 0:g.flush(s))?e=A==null?void 0:A.flush(g.last()):e=A==null?void 0:A.flush(s),b>0&&(i=T==null?void 0:T.flush(s));let M=this.children.map(U=>U.flush());return this.clear(),Q({type:d,length:s,nullCount:b,children:M,child:M[0],data:e,typeIds:t,nullBitmap:i,valueOffsets:a})}finish(){this.finished=!0;for(let e of this.children)e.finish();return this}clear(){var e,t,i,a;this.length=0,(e=this._nulls)===null||e===void 0||e.clear(),(t=this._values)===null||t===void 0||t.clear(),(i=this._offsets)===null||i===void 0||i.clear(),(a=this._typeIds)===null||a===void 0||a.clear();for(let d of this.children)d.clear();return this}};It.prototype.length=1,It.prototype.stride=1,It.prototype.children=null,It.prototype.finished=!1,It.prototype.nullValues=null,It.prototype._isValid=()=>!0;var Vt=class extends It{constructor(e){super(e),this._values=new mi(new this.ArrayType(0),this.stride)}setValue(e,t){let i=this._values;return i.reserve(e-i.length+1),super.setValue(e,t)}},Je=class extends It{constructor(e){super(e),this._pendingLength=0,this._offsets=new Mr}setValue(e,t){let i=this._pending||(this._pending=new Map),a=i.get(e);a&&(this._pendingLength-=a.length),this._pendingLength+=t instanceof Ge?t[je].length:t.length,i.set(e,t)}setValid(e,t){return super.setValid(e,t)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,t=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,t),this}},nr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,i,a){return e.prep(8,24),e.writeInt64(BigInt(a??0)),e.pad(4),e.writeInt32(i),e.writeInt64(BigInt(t??0)),e.offset()}},qe=new Int32Array(2),Qs=new Float32Array(qe.buffer),to=new Float64Array(qe.buffer),Ur=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,hn;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(hn||(hn={}));var pe=class wy{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new wy(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}writeUint16(t,i){this.bytes_[t]=i,this.bytes_[t+1]=i>>8}writeInt32(t,i){this.bytes_[t]=i,this.bytes_[t+1]=i>>8,this.bytes_[t+2]=i>>16,this.bytes_[t+3]=i>>24}writeUint32(t,i){this.bytes_[t]=i,this.bytes_[t+1]=i>>8,this.bytes_[t+2]=i>>16,this.bytes_[t+3]=i>>24}writeInt64(t,i){this.writeInt32(t,Number(BigInt.asIntN(32,i))),this.writeInt32(t+4,Number(BigInt.asIntN(32,i>>BigInt(32))))}writeUint64(t,i){this.writeUint32(t,Number(BigInt.asUintN(32,i))),this.writeUint32(t+4,Number(BigInt.asUintN(32,i>>BigInt(32))))}writeFloat32(t,i){Qs[0]=i,this.writeInt32(t,qe[0])}writeFloat64(t,i){to[0]=i,this.writeInt32(t,qe[Ur?0:1]),this.writeInt32(t+4,qe[Ur?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);let a=~(this.bb.capacity()-this.space+i)+1&t-1;for(;this.space=0&&this.vtable[i]==0;i--);let a=i+1;for(;i>=0;i--)this.addInt16(this.vtable[i]!=0?t-this.vtable[i]:0);let d=2;this.addInt16(t-this.object_start);let s=(a+d)*2;this.addInt16(s);let b=0,_=this.space;t:for(i=0;i=0;b--)this.writeInt8(s.charCodeAt(b))}this.prep(this.minalign,4+d),this.addOffset(t),d&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,i){this.finish(t,i,!0)}requiredField(t,i){let a=this.bb.capacity()-t,d=a-this.bb.readInt32(a);if(!(i=0;a--)t.addInt32(i[a]);return t.endVector()}static startTypeIdsVector(t,i){t.startVector(4,i,4)}static endUnion(t){return t.endObject()}static createUnion(t,i,a){return Qr.startUnion(t),Qr.addMode(t,i),Qr.addTypeIds(t,a),Qr.endUnion(t)}},In=class ta{constructor(){this.bb=null,this.bb_pos=0}__init(t,i){return this.bb_pos=t,this.bb=i,this}static getRootAsUtf8(t,i){return(i||new ta).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,i){return t.setPosition(t.position()+4),(i||new ta).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return ta.startUtf8(t),ta.endUtf8(t)}},Ct;(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.RunEndEncoded=22]="RunEndEncoded"})(Ct||(Ct={}));var Gt=class dl{constructor(){this.bb=null,this.bb_pos=0}__init(t,i){return this.bb_pos=t,this.bb=i,this}static getRootAsField(t,i){return(i||new dl).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,i){return t.setPosition(t.position()+4),(i||new dl).__init(t.readInt32(t.position())+t.position(),t)}name(t){let i=this.bb.__offset(this.bb_pos,4);return i?this.bb.__string(this.bb_pos+i,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):Ct.NONE}type(t){let i=this.bb.__offset(this.bb_pos,10);return i?this.bb.__union(t,this.bb_pos+i):null}dictionary(t){let i=this.bb.__offset(this.bb_pos,12);return i?(t||new Ze).__init(this.bb.__indirect(this.bb_pos+i),this.bb):null}children(t,i){let a=this.bb.__offset(this.bb_pos,14);return a?(i||new dl).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+a)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,i){let a=this.bb.__offset(this.bb_pos,16);return a?(i||new Lt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+a)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,i){t.addFieldOffset(0,i,0)}static addNullable(t,i){t.addFieldInt8(1,+i,0)}static addTypeType(t,i){t.addFieldInt8(2,i,Ct.NONE)}static addType(t,i){t.addFieldOffset(3,i,0)}static addDictionary(t,i){t.addFieldOffset(4,i,0)}static addChildren(t,i){t.addFieldOffset(5,i,0)}static createChildrenVector(t,i){t.startVector(4,i.length,4);for(let a=i.length-1;a>=0;a--)t.addOffset(i[a]);return t.endVector()}static startChildrenVector(t,i){t.startVector(4,i,4)}static addCustomMetadata(t,i){t.addFieldOffset(6,i,0)}static createCustomMetadataVector(t,i){t.startVector(4,i.length,4);for(let a=i.length-1;a>=0;a--)t.addOffset(i[a]);return t.endVector()}static startCustomMetadataVector(t,i){t.startVector(4,i,4)}static endField(t){return t.endObject()}},re=class Se{constructor(){this.bb=null,this.bb_pos=0}__init(t,i){return this.bb_pos=t,this.bb=i,this}static getRootAsSchema(t,i){return(i||new Se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,i){return t.setPosition(t.position()+4),(i||new Se).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ni.Little}fields(t,i){let a=this.bb.__offset(this.bb_pos,6);return a?(i||new Gt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+a)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,i){let a=this.bb.__offset(this.bb_pos,8);return a?(i||new Lt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+a)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let i=this.bb.__offset(this.bb_pos,10);return i?this.bb.readInt64(this.bb.__vector(this.bb_pos+i)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,i){t.addFieldInt16(0,i,Ni.Little)}static addFields(t,i){t.addFieldOffset(1,i,0)}static createFieldsVector(t,i){t.startVector(4,i.length,4);for(let a=i.length-1;a>=0;a--)t.addOffset(i[a]);return t.endVector()}static startFieldsVector(t,i){t.startVector(4,i,4)}static addCustomMetadata(t,i){t.addFieldOffset(2,i,0)}static createCustomMetadataVector(t,i){t.startVector(4,i.length,4);for(let a=i.length-1;a>=0;a--)t.addOffset(i[a]);return t.endVector()}static startCustomMetadataVector(t,i){t.startVector(4,i,4)}static addFeatures(t,i){t.addFieldOffset(3,i,0)}static createFeaturesVector(t,i){t.startVector(8,i.length,8);for(let a=i.length-1;a>=0;a--)t.addInt64(i[a]);return t.endVector()}static startFeaturesVector(t,i){t.startVector(8,i,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,i){t.finish(i)}static finishSizePrefixedSchemaBuffer(t,i){t.finish(i,void 0,!0)}static createSchema(t,i,a,d,s){return Se.startSchema(t),Se.addEndianness(t,i),Se.addFields(t,a),Se.addCustomMetadata(t,d),Se.addFeatures(t,s),Se.endSchema(t)}},_e=class Al{constructor(){this.bb=null,this.bb_pos=0}__init(t,i){return this.bb_pos=t,this.bb=i,this}static getRootAsFooter(t,i){return(i||new Al).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,i){return t.setPosition(t.position()+4),(i||new Al).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ui.V1}schema(t){let i=this.bb.__offset(this.bb_pos,6);return i?(t||new re).__init(this.bb.__indirect(this.bb_pos+i),this.bb):null}dictionaries(t,i){let a=this.bb.__offset(this.bb_pos,8);return a?(i||new nr).__init(this.bb.__vector(this.bb_pos+a)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,i){let a=this.bb.__offset(this.bb_pos,10);return a?(i||new nr).__init(this.bb.__vector(this.bb_pos+a)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,i){let a=this.bb.__offset(this.bb_pos,12);return a?(i||new Lt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+a)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,i){t.addFieldInt16(0,i,Ui.V1)}static addSchema(t,i){t.addFieldOffset(1,i,0)}static addDictionaries(t,i){t.addFieldOffset(2,i,0)}static startDictionariesVector(t,i){t.startVector(24,i,8)}static addRecordBatches(t,i){t.addFieldOffset(3,i,0)}static startRecordBatchesVector(t,i){t.startVector(24,i,8)}static addCustomMetadata(t,i){t.addFieldOffset(4,i,0)}static createCustomMetadataVector(t,i){t.startVector(4,i.length,4);for(let a=i.length-1;a>=0;a--)t.addOffset(i[a]);return t.endVector()}static startCustomMetadataVector(t,i){t.startVector(4,i,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,i){t.finish(i)}static finishSizePrefixedFooterBuffer(t,i){t.finish(i,void 0,!0)}},_t=class Zr{constructor(t=[],i,a){this.fields=t||[],this.metadata=i||new Map,a||(a=Ra(t)),this.dictionaries=a}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return"Schema<{ ".concat(this.fields.map((t,i)=>"".concat(i,": ").concat(t)).join(", ")," }>")}select(t){let i=new Set(t),a=this.fields.filter(d=>i.has(d.name));return new Zr(a,this.metadata)}selectAt(t){let i=t.map(a=>this.fields[a]).filter(Boolean);return new Zr(i,this.metadata)}assign(...t){let i=t[0]instanceof Zr?t[0]:Array.isArray(t[0])?new Zr(t[0]):new Zr(t),a=[...this.fields],d=io(io(new Map,this.metadata),i.metadata),s=i.fields.filter(_=>{let g=a.findIndex(A=>A.name===_.name);return~g?(a[g]=_.clone({metadata:io(io(new Map,a[g].metadata),_.metadata)}))&&!1:!0}),b=Ra(s,new Map);return new Zr([...a,...s],d,new Map([...this.dictionaries,...b]))}};_t.prototype.fields=null,_t.prototype.metadata=null,_t.prototype.dictionaries=null;var at=class Bl{static new(...t){let[i,a,d,s]=t;return t[0]&&typeof t[0]=="object"&&({name:i}=t[0],a===void 0&&(a=t[0].type),d===void 0&&(d=t[0].nullable),s===void 0&&(s=t[0].metadata)),new Bl("".concat(i),a,d,s)}constructor(t,i,a=!1,d){this.name=t,this.type=i,this.nullable=a,this.metadata=d||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return"".concat(this.name,": ").concat(this.type)}clone(...t){let[i,a,d,s]=t;return!t[0]||typeof t[0]!="object"?[i=this.name,a=this.type,d=this.nullable,s=this.metadata]=t:{name:i=this.name,type:a=this.type,nullable:d=this.nullable,metadata:s=this.metadata}=t[0],Bl.new(i,a,d,s)}};at.prototype.type=null,at.prototype.name=null,at.prototype.nullable=null,at.prototype.metadata=null;function io(e,t){return new Map([...e||new Map,...t||new Map])}function Ra(e,t=new Map){for(let i=-1,a=e.length;++i0&&Ra(d.children,t)}return t}var OS=sr,RS=pe,gi=class{static decode(e){e=new RS(J(e));let t=_e.getRootAsFooter(e),i=_t.decode(t.schema());return new Ma(i,t)}static encode(e){let t=new OS,i=_t.encode(t,e.schema);_e.startRecordBatchesVector(t,e.numRecordBatches);for(let s of[...e.recordBatches()].slice().reverse())wi.encode(t,s);let a=t.endVector();_e.startDictionariesVector(t,e.numDictionaries);for(let s of[...e.dictionaryBatches()].slice().reverse())wi.encode(t,s);let d=t.endVector();return _e.startFooter(t),_e.addSchema(t,i),_e.addVersion(t,Pt.V4),_e.addRecordBatches(t,a),_e.addDictionaries(t,d),_e.finishFooterBuffer(t,_e.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=Pt.V4,i,a){this.schema=e,this.version=t,i&&(this._recordBatches=i),a&&(this._dictionaryBatches=a)}*recordBatches(){for(let e,t=-1,i=this.numRecordBatches;++t=0&&e=0&&e=0&&e=0&&ethis._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return R(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(wt);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return zt.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return zt.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return R(this,void 0,void 0,function*(){return yield this.abort(e),wt})}return(e){return R(this,void 0,void 0,function*(){return yield this.close(),wt})}read(e){return R(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return R(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,i)=>{this.resolvers.push({resolve:t,reject:i})}):Promise.resolve(wt)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}},ti=class extends ro{write(e){if((e=J(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?rn(this.toUint8Array(!0)):this.toUint8Array(!1).then(rn)}toUint8Array(e=!1){return e?ue(this._values)[0]:R(this,void 0,void 0,function*(){var t,i,a,d;let s=[],b=0;try{for(var _=!0,g=Be(this),A;A=yield g.next(),t=A.done,!t;_=!0){d=A.value,_=!1;let T=d;s.push(T),b+=T.byteLength}}catch(T){i={error:T}}finally{try{!_&&!t&&(a=g.return)&&(yield a.call(g))}finally{if(i)throw i.error}}return ue(s,b)[0]})}},ei=class{constructor(e){e&&(this.source=new Ua(zt.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Ie=class Sy{constructor(t){t instanceof Sy?this.source=t.source:t instanceof ti?this.source=new ji(zt.fromAsyncIterable(t)):vs(t)?this.source=new ji(zt.fromNodeStream(t)):nn(t)?this.source=new ji(zt.fromDOMStream(t)):ms(t)?this.source=new ji(zt.fromDOMStream(t.body)):xe(t)?this.source=new ji(zt.fromIterable(t)):Ae(t)?this.source=new ji(zt.fromAsyncIterable(t)):ge(t)&&(this.source=new ji(zt.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},Ua=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||wt)}return(e){return Object.create(this.source.return&&this.source.return(e)||wt)}},ji=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return R(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return R(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return R(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e,t="read"){return R(this,void 0,void 0,function*(){return yield this.source.next({cmd:t,size:e})})}throw(e){return R(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||wt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return R(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||wt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}},Fn=class extends ei{constructor(e,t){super(),this.position=0,this.buffer=J(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:i}=this.readAt(e,4);return new DataView(t,i).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),eBn,Int128:()=>An,Int64:()=>Si,Uint64:()=>At});function Nr(e){return e<0&&(e=4294967295+e+1),"0x".concat(e.toString(16))}var Lr=8,Na=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Bn=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),i=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),a=t[3]*i[3];this.buffer[0]=a&65535;let d=a>>>16;return a=t[2]*i[3],d+=a,a=t[3]*i[2]>>>0,d+=a,this.buffer[0]+=d<<16,this.buffer[1]=d>>>0>>16,this.buffer[1]+=t[1]*i[3]+t[2]*i[2]+t[3]*i[1],this.buffer[1]+=t[0]*i[3]+t[1]*i[2]+t[2]*i[1]+t[3]*i[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,i[2]=this.buffer[2]+t.buffer[2]>>>0,i[1]=this.buffer[1]+t.buffer[1]>>>0,i[0]=this.buffer[0]+t.buffer[0]>>>0,i[0]>>0&&++i[1],i[1]>>0&&++i[2],i[2]>>0&&++i[3],this.buffer[3]=i[3],this.buffer[2]=i[2],this.buffer[1]=i[1],this.buffer[0]=i[0],this}hex(){return"".concat(Nr(this.buffer[3])," ").concat(Nr(this.buffer[2])," ").concat(Nr(this.buffer[1])," ").concat(Nr(this.buffer[0]))}static multiply(t,i){return new ai(new Uint32Array(t.buffer)).times(i)}static add(t,i){return new ai(new Uint32Array(t.buffer)).plus(i)}static from(t,i=new Uint32Array(4)){return ai.fromString(typeof t=="string"?t:t.toString(),i)}static fromNumber(t,i=new Uint32Array(4)){return ai.fromString(t.toString(),i)}static fromString(t,i=new Uint32Array(4)){let a=t.startsWith("-"),d=t.length,s=new ai(i);for(let b=a?1:0;b0&&this.readData(e,i)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:i}=this.nextBufferRange()){return this.bytes.subarray(i,i+t)}readDictionary(e){return this.dictionaries.get(e.id)}},no=class extends xn{constructor(e,t,i,a){super(new Uint8Array(0),t,i,a),this.sources=e}readNullBitmap(e,t,{offset:i}=this.nextBufferRange()){return t<=0?new Uint8Array(0):ir(this.sources[i])}readOffsets(e,{offset:t}=this.nextBufferRange()){return st(Uint8Array,st(Int32Array,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return st(Uint8Array,st(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:i}=this;return V.isTimestamp(e)||(V.isInt(e)||V.isTime(e))&&e.bitWidth===64||V.isDate(e)&&e.unit===Wt.MILLISECOND?st(Uint8Array,Si.convertArray(i[t])):V.isDecimal(e)?st(Uint8Array,An.convertArray(i[t])):V.isBinary(e)||V.isFixedSizeBinary(e)?MS(i[t]):V.isBool(e)?ir(i[t]):V.isUtf8(e)?Di(i[t].join("")):st(Uint8Array,st(e.ArrayType,i[t].map(a=>+a)))}};function MS(e){let t=e.join(""),i=new Uint8Array(t.length/2);for(let a=0;a>1]=Number.parseInt(t.slice(a,a+2),16);return i}var Pr=class extends Je{constructor(e){super(e),this._values=new Mi(new Uint8Array(0))}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,J(t))}_flushPending(e,t){let i=this._offsets,a=this._values.reserve(t).buffer,d=0;for(let[s,b]of e)if(b===void 0)i.set(s,0);else{let _=b.length;a.set(b,d),i.set(s,_),d+=_}}},so=class extends It{constructor(e){super(e),this._values=new Rr}setValue(e,t){this._values.set(e,+t)}},ar=class extends Vt{};ar.prototype._setValue=va;var Tn=class extends ar{};Tn.prototype._setValue=Es;var Dn=class extends ar{};Dn.prototype._setValue=ks;var En=class extends Vt{};En.prototype._setValue=ja;var oo=class extends It{constructor({type:e,nullValues:t,dictionaryHashFunction:i}){super({type:new de(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=lr({type:this.type.indices,nullValues:t}),this.dictionary=lr({type:this.type.dictionary,nullValues:null}),typeof i=="function"&&(this.valueToKey=i)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,t){let i=this.indices;return t=i.setValid(e,t),this.length=i.length,t}setValue(e,t){let i=this._keysToIndices,a=this.valueToKey(t),d=i[a];return d===void 0&&(i[a]=d=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,d)}flush(){let e=this.type,t=this._dictionary,i=this.dictionary.toVector(),a=this.indices.flush().clone(e);return a.dictionary=t?t.concat(i):i,this.finished||(this._dictionaryOffset+=i.length),this._dictionary=a.dictionary,this.clear(),a}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:"".concat(e)}},kn=class extends Vt{};kn.prototype._setValue=ba;var ao=class extends It{setValue(e,t){let[i]=this.children,a=e*this.stride;for(let d=-1,s=t.length;++d0)throw new Error("FixedSizeListBuilder can only have one child.");let i=this.children.push(e);return this.type=new Re(this.type.listSize,new at(t,e.type,!0)),i}},cr=class extends Vt{setValue(e,t){this._values.set(e,t)}},lo=class extends cr{setValue(e,t){super.setValue(e,ln(t))}},co=class extends cr{},uo=class extends cr{},ur=class extends Vt{};ur.prototype._setValue=Sa;var On=class extends ur{};On.prototype._setValue=Hs;var Rn=class extends ur{};Rn.prototype._setValue=zs;var Ce=class extends Vt{setValue(e,t){this._values.set(e,t)}},fo=class extends Ce{},ho=class extends Ce{},po=class extends Ce{},_o=class extends Ce{},yo=class extends Ce{},mo=class extends Ce{},bo=class extends Ce{},vo=class extends Ce{},go=class extends Je{constructor(e){super(e),this._offsets=new Mr}addChild(e,t="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new ke(new at(t,e.type,!0)),this.numChildren-1}_flushPending(e){let t=this._offsets,[i]=this.children;for(let[a,d]of e)if(typeof d>"u")t.set(a,0);else{let s=d,b=s.length,_=t.set(a,b).buffer[a];for(let g=-1;++g0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new Me(new at(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,[i]=this.children;for(let[a,d]of e)if(d===void 0)t.set(a,0);else{let{[a]:s,[a+1]:b}=t.set(a,d.size).buffer;for(let _ of d.entries())if(i.set(s,_),++s>=b)break}}},jo=class extends It{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}},So=class extends It{setValue(e,t){let{children:i,type:a}=this;switch(Array.isArray(t)||t.constructor){case!0:return a.children.forEach((d,s)=>i[s].set(e,t[s]));case Map:return a.children.forEach((d,s)=>i[s].set(e,t.get(d.name)));default:return a.children.forEach((d,s)=>i[s].set(e,t[d.name]))}}setValid(e,t){return super.setValid(e,t)||this.children.forEach(i=>i.setValid(e,t)),t}addChild(e,t="".concat(this.numChildren)){let i=this.children.push(e);return this.type=new gt([...this.type.children,new at(t,e.type,!0)]),i}},Ii=class extends Vt{};Ii.prototype._setValue=ga;var Mn=class extends Ii{};Mn.prototype._setValue=Os;var Un=class extends Ii{};Un.prototype._setValue=Rs;var Nn=class extends Ii{};Nn.prototype._setValue=Ms;var Ln=class extends Ii{};Ln.prototype._setValue=Us;var Ci=class extends Vt{};Ci.prototype._setValue=wa;var Pn=class extends Ci{};Pn.prototype._setValue=Ns;var Vn=class extends Ci{};Vn.prototype._setValue=Ls;var Hn=class extends Ci{};Hn.prototype._setValue=Ps;var zn=class extends Ci{};zn.prototype._setValue=Vs;var Vr=class extends It{constructor(e){super(e),this._typeIds=new mi(new Int8Array(0),1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,t){return this.set(this.length,e,t)}set(e,t,i){return i===void 0&&(i=this._valueToChildTypeId(this,t,e)),this.setValid(e,this.isValid(t))&&this.setValue(e,t,i),this}setValue(e,t,i){this._typeIds.set(e,i);let a=this.type.typeIdToChildIndex[i],d=this.children[a];d==null||d.set(e,t)}addChild(e,t="".concat(this.children.length)){let i=this.children.push(e),{type:{children:a,mode:d,typeIds:s}}=this,b=[...a,new at(t,e.type)];return this.type=new Oe(d,[...s,i],b),i}_valueToChildTypeId(e,t,i){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},Io=class extends Vr{},Co=class extends Vr{constructor(e){super(e),this._offsets=new mi(new Int32Array(0))}setValue(e,t,i){let a=this._typeIds.set(e,i).buffer[e],d=this.getChildAt(this.type.typeIdToChildIndex[a]),s=this._offsets.set(e,d.length).buffer[e];d==null||d.set(s,t)}},Wn=class extends Je{constructor(e){super(e),this._values=new Mi(new Uint8Array(0))}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Di(t))}_flushPending(e,t){}};Wn.prototype._flushPending=Pr.prototype._flushPending;var Pa=class extends H{visitNull(){return jo}visitBool(){return so}visitInt(){return Ce}visitInt8(){return fo}visitInt16(){return ho}visitInt32(){return po}visitInt64(){return _o}visitUint8(){return yo}visitUint16(){return mo}visitUint32(){return bo}visitUint64(){return vo}visitFloat(){return cr}visitFloat16(){return lo}visitFloat32(){return co}visitFloat64(){return uo}visitUtf8(){return Wn}visitBinary(){return Pr}visitFixedSizeBinary(){return kn}visitDate(){return ar}visitDateDay(){return Tn}visitDateMillisecond(){return Dn}visitTimestamp(){return Ii}visitTimestampSecond(){return Mn}visitTimestampMillisecond(){return Un}visitTimestampMicrosecond(){return Nn}visitTimestampNanosecond(){return Ln}visitTime(){return Ci}visitTimeSecond(){return Pn}visitTimeMillisecond(){return Vn}visitTimeMicrosecond(){return Hn}visitTimeNanosecond(){return zn}visitDecimal(){return En}visitList(){return go}visitStruct(){return So}visitUnion(){return Vr}visitDenseUnion(){return Co}visitSparseUnion(){return Io}visitDictionary(){return oo}visitInterval(){return ur}visitIntervalDayTime(){return On}visitIntervalYearMonth(){return Rn}visitFixedSizeList(){return ao}visitMap(){return wo}},Qh=new Pa,G=class extends H{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((i,a)=>this.compareFields(i,t[a]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function ne(e,t){return t instanceof e.constructor}function $n(e,t){return e===t||ne(e,t)}function Fi(e,t){return e===t||ne(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Fo(e,t){return e===t||ne(e,t)&&e.precision===t.precision}function US(e,t){return e===t||ne(e,t)&&e.byteWidth===t.byteWidth}function Va(e,t){return e===t||ne(e,t)&&e.unit===t.unit}function Yn(e,t){return e===t||ne(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Xn(e,t){return e===t||ne(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function NS(e,t){return e===t||ne(e,t)&&e.children.length===t.children.length&&ii.compareManyFields(e.children,t.children)}function LS(e,t){return e===t||ne(e,t)&&e.children.length===t.children.length&&ii.compareManyFields(e.children,t.children)}function Ha(e,t){return e===t||ne(e,t)&&e.mode===t.mode&&e.typeIds.every((i,a)=>i===t.typeIds[a])&&ii.compareManyFields(e.children,t.children)}function PS(e,t){return e===t||ne(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&ii.visit(e.indices,t.indices)&&ii.visit(e.dictionary,t.dictionary)}function za(e,t){return e===t||ne(e,t)&&e.unit===t.unit}function VS(e,t){return e===t||ne(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&ii.compareManyFields(e.children,t.children)}function HS(e,t){return e===t||ne(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&ii.compareManyFields(e.children,t.children)}G.prototype.visitNull=$n,G.prototype.visitBool=$n,G.prototype.visitInt=Fi,G.prototype.visitInt8=Fi,G.prototype.visitInt16=Fi,G.prototype.visitInt32=Fi,G.prototype.visitInt64=Fi,G.prototype.visitUint8=Fi,G.prototype.visitUint16=Fi,G.prototype.visitUint32=Fi,G.prototype.visitUint64=Fi,G.prototype.visitFloat=Fo,G.prototype.visitFloat16=Fo,G.prototype.visitFloat32=Fo,G.prototype.visitFloat64=Fo,G.prototype.visitUtf8=$n,G.prototype.visitBinary=$n,G.prototype.visitFixedSizeBinary=US,G.prototype.visitDate=Va,G.prototype.visitDateDay=Va,G.prototype.visitDateMillisecond=Va,G.prototype.visitTimestamp=Yn,G.prototype.visitTimestampSecond=Yn,G.prototype.visitTimestampMillisecond=Yn,G.prototype.visitTimestampMicrosecond=Yn,G.prototype.visitTimestampNanosecond=Yn,G.prototype.visitTime=Xn,G.prototype.visitTimeSecond=Xn,G.prototype.visitTimeMillisecond=Xn,G.prototype.visitTimeMicrosecond=Xn,G.prototype.visitTimeNanosecond=Xn,G.prototype.visitDecimal=$n,G.prototype.visitList=NS,G.prototype.visitStruct=LS,G.prototype.visitUnion=Ha,G.prototype.visitDenseUnion=Ha,G.prototype.visitSparseUnion=Ha,G.prototype.visitDictionary=PS,G.prototype.visitInterval=za,G.prototype.visitIntervalDayTime=za,G.prototype.visitIntervalYearMonth=za,G.prototype.visitFixedSizeList=VS,G.prototype.visitMap=HS;var ii=new G;function dr(e,t){return ii.compareSchemas(e,t)}function tp(e,t){return ii.compareFields(e,t)}function ep(e,t){return ii.visit(e,t)}function lr(e){let t=e.type,i=new(Qh.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let a=e.children||[],d={nullValues:e.nullValues},s=Array.isArray(a)?(b,_)=>a[_]||d:({name:b})=>a[b]||d;for(let[b,_]of t.children.entries()){let{type:g}=_,A=s(_,b);i.children.push(lr(Object.assign(Object.assign({},A),{type:g})))}}return i}function Bo(e,t){return zS(e,t.map(i=>i.data.concat()))}function zS(e,t){let i=[...e.fields],a=[],d={numBatches:t.reduce((M,U)=>Math.max(M,U.length),0)},s=0,b=0,_=-1,g=t.length,A,T=[];for(;d.numBatches-- >0;){for(b=Number.POSITIVE_INFINITY,_=-1;++_0&&(a[s++]=Q({type:new gt(i),length:b,nullCount:0,children:T.slice()})))}return[e=e.assign(i),a.map(M=>new xt(e,M))]}function WS(e,t,i,a,d){var s;let b=(t+63&-64)>>3;for(let _=-1,g=a.length;++_=t)T===t?i[_]=A:(i[_]=A.slice(0,t),d.numBatches=Math.max(d.numBatches,a[_].unshift(A.slice(t,T-t))));else{let M=e[_];e[_]=M.clone({nullable:!0}),i[_]=(s=A==null?void 0:A._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:Q({type:M.type,length:t,nullCount:t,nullBitmap:new Uint8Array(b)})}}return i}var ip,te=class tn{constructor(...t){var i,a;if(t.length===0)return this.batches=[],this.schema=new _t([]),this._offsets=[0],this;let d,s;t[0]instanceof _t&&(d=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());let b=g=>{if(g){if(g instanceof xt)return[g];if(g instanceof tn)return g.batches;if(g instanceof bt){if(g.type instanceof gt)return[new xt(new _t(g.type.children),g)]}else{if(Array.isArray(g))return g.flatMap(A=>b(A));if(typeof g[Symbol.iterator]=="function")return[...g].flatMap(A=>b(A));if(typeof g=="object"){let A=Object.keys(g),T=A.map(x=>new ct([g[x]])),M=new _t(A.map((x,W)=>new at(String(x),T[W].type))),[,U]=Bo(M,T);return U.length===0?[new xt(g)]:U}}}return[]},_=t.flatMap(g=>b(g));if(d=(a=d??((i=_[0])===null||i===void 0?void 0:i.schema))!==null&&a!==void 0?a:new _t([]),!(d instanceof _t))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let g of _){if(!(g instanceof xt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!dr(d,g.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=d,this.batches=_,this._offsets=s??Gs(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,i)=>t+i.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Xs(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,i){}indexOf(t,i){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?Or.visit(new ct(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ `.concat(this.toArray().join(`, `),` ]`)}concat(...t){let i=this.schema,a=this.data.concat(t.flatMap(({data:d})=>d));return new tn(i,a.map(d=>new xt(i,d)))}slice(t,i){let a=this.schema;[t,i]=cn({length:this.numRows},t,i);let d=Ks(this.data,this._offsets,t,i);return new tn(a,d.map(s=>new xt(a,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(i=>i.name===t))}getChildAt(t){if(t>-1&&ta.children[t]);if(i.length===0){let{type:a}=this.schema.fields[t],d=Q({type:a,length:0,nullCount:0});i.push(d._changeLengthAndBackfillNullBitmap(this.numRows))}return new ct(i)}return null}setChild(t,i){var a;return this.setChildAt((a=this.schema.fields)===null||a===void 0?void 0:a.findIndex(d=>d.name===t),i)}setChildAt(t,i){let a=this.schema,d=[...this.batches];if(t>-1&&tthis.getChildAt(A));[s[t],_[t]]=[b,i],[a,d]=Bo(a,_)}return new tn(a,d)}select(t){let i=this.schema.fields.reduce((a,d,s)=>a.set(d.name,s),new Map);return this.selectAt(t.map(a=>i.get(a)).filter(a=>a>-1))}selectAt(t){let i=this.schema.selectAt(t),a=this.batches.map(d=>d.selectAt(t));return new tn(i,a)}assign(t){let i=this.schema.fields,[a,d]=t.schema.fields.reduce((_,g,A)=>{let[T,M]=_,U=i.findIndex(x=>x.name===g.name);return~U?M[U]=A:T.push(A),_},[[],[]]),s=this.schema.assign(t.schema),b=[...i.map((_,g)=>[g,d[g]]).map(([_,g])=>g===void 0?this.getChildAt(_):t.getChildAt(g)),...a.map(_=>t.getChildAt(_))].filter(Boolean);return new tn(...Bo(s,b))}};ip=Symbol.toStringTag,te[ip]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=Ri(fn),e.get=Ri(Rt.getVisitFn(B.Struct)),e.set=Js($t.getVisitFn(B.Struct)),e.indexOf=qs(rr.getVisitFn(B.Struct)),e.getByteLength=Ri(he.getVisitFn(B.Struct)),"Table"))(te.prototype);var np,xt=class ea{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof _t))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=Q({nullCount:0,type:new gt(this.schema.fields),children:this.schema.fields.map(i=>Q({type:i.type,nullCount:0}))})]=t,!(this.data instanceof bt))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=rp(this.schema,this.data.children);break}case 1:{let[i]=t,{fields:a,children:d,length:s}=Object.keys(i).reduce((g,A,T)=>(g.children[T]=i[A],g.length=Math.max(g.length,i[A].length),g.fields[T]=at.new({name:A,type:i[A].type,nullable:!0}),g),{length:0,fields:new Array,children:new Array}),b=new _t(a),_=Q({type:new gt(a),length:s,children:d,nullCount:0});[this.schema,this.data]=rp(b,_.children,s);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=sp(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return Rt.visit(this.data,t)}set(t,i){return $t.visit(this.data,t,i)}indexOf(t,i){return rr.visit(this.data,t,i)}getByteLength(t){return he.visit(this.data,t)}[Symbol.iterator](){return Or.visit(new ct([this.data]))}toArray(){return[...this]}concat(...t){return new te(this.schema,[this,...t])}slice(t,i){let[a]=new ct([this.data]).slice(t,i).data;return new ea(this.schema,a)}getChild(t){var i;return this.getChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(a=>a.name===t))}getChildAt(t){return t>-1&&td.name===t),i)}setChildAt(t,i){let a=this.schema,d=this.data;if(t>-1&&t_.name===s);~b&&(d[b]=this.data.children[b])}return new ea(i,Q({type:a,length:this.numRows,children:d}))}selectAt(t){let i=this.schema.selectAt(t),a=t.map(s=>this.data.children[s]).filter(Boolean),d=Q({type:new gt(i.fields),length:this.numRows,children:a});return new ea(i,d)}};np=Symbol.toStringTag,xt[np]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(xt.prototype);function rp(e,t,i=t.reduce((a,d)=>Math.max(a,d.length),0)){var a;let d=[...e.fields],s=[...t],b=(i+63&-64)>>3;for(let[_,g]of e.fields.entries()){let A=t[_];(!A||A.length!==i)&&(d[_]=g.clone({nullable:!0}),s[_]=(a=A==null?void 0:A._changeLengthAndBackfillNullBitmap(i))!==null&&a!==void 0?a:Q({type:g.type,length:i,nullCount:i,nullBitmap:new Uint8Array(b)}))}return[e.assign(d),Q({type:new gt(d),length:i,children:s})]}function sp(e,t,i=new Map){for(let a=-1,d=e.length;++a0&&sp(s.children,b.children,i)}return i}var fr=class extends xt{constructor(e){let t=e.fields.map(a=>Q({type:a.type})),i=Q({type:new gt(e.fields),nullCount:0,children:t});super(e,i)}},Gn;(function(e){e[e.BUFFER=0]="BUFFER"})(Gn||(Gn={}));var Kn;(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(Kn||(Kn={}));var Ao=class en{constructor(){this.bb=null,this.bb_pos=0}__init(t,i){return this.bb_pos=t,this.bb=i,this}static getRootAsBodyCompression(t,i){return(i||new en).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,i){return t.setPosition(t.position()+4),(i||new en).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):Kn.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Gn.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,i){t.addFieldInt8(0,i,Kn.LZ4_FRAME)}static addMethod(t,i){t.addFieldInt8(1,i,Gn.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,i,a){return en.startBodyCompression(t),en.addCodec(t,i),en.addMethod(t,a),en.endBodyCompression(t)}},Hr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,t,i){return e.prep(8,16),e.writeInt64(BigInt(i??0)),e.writeInt64(BigInt(t??0)),e.offset()}},zr=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,t,i){return e.prep(8,16),e.writeInt64(BigInt(i??0)),e.writeInt64(BigInt(t??0)),e.offset()}},ye=class Tl{constructor(){this.bb=null,this.bb_pos=0}__init(t,i){return this.bb_pos=t,this.bb=i,this}static getRootAsRecordBatch(t,i){return(i||new Tl).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,i){return t.setPosition(t.position()+4),(i||new Tl).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,i){let a=this.bb.__offset(this.bb_pos,6);return a?(i||new zr).__init(this.bb.__vector(this.bb_pos+a)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,i){let a=this.bb.__offset(this.bb_pos,8);return a?(i||new Hr).__init(this.bb.__vector(this.bb_pos+a)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let i=this.bb.__offset(this.bb_pos,10);return i?(t||new Ao).__init(this.bb.__indirect(this.bb_pos+i),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,i){t.addFieldInt64(0,i,BigInt("0"))}static addNodes(t,i){t.addFieldOffset(1,i,0)}static startNodesVector(t,i){t.startVector(16,i,8)}static addBuffers(t,i){t.addFieldOffset(2,i,0)}static startBuffersVector(t,i){t.startVector(16,i,8)}static addCompression(t,i){t.addFieldOffset(3,i,0)}static endRecordBatch(t){return t.endObject()}},Bi=class Fl{constructor(){this.bb=null,this.bb_pos=0}__init(t,i){return this.bb_pos=t,this.bb=i,this}static getRootAsDictionaryBatch(t,i){return(i||new Fl).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,i){return t.setPosition(t.position()+4),(i||new Fl).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let i=this.bb.__offset(this.bb_pos,6);return i?(t||new ye).__init(this.bb.__indirect(this.bb_pos+i),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,i){t.addFieldInt64(0,i,BigInt("0"))}static addData(t,i){t.addFieldOffset(1,i,0)}static addIsDelta(t,i){t.addFieldInt8(2,+i,0)}static endDictionaryBatch(t){return t.endObject()}},Wr;(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(Wr||(Wr={}));var Ve=class ve{constructor(){this.bb=null,this.bb_pos=0}__init(t,i){return this.bb_pos=t,this.bb=i,this}static getRootAsMessage(t,i){return(i||new ve).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,i){return t.setPosition(t.position()+4),(i||new ve).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ui.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Wr.NONE}header(t){let i=this.bb.__offset(this.bb_pos,8);return i?this.bb.__union(t,this.bb_pos+i):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,i){let a=this.bb.__offset(this.bb_pos,12);return a?(i||new Lt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+a)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,i){t.addFieldInt16(0,i,Ui.V1)}static addHeaderType(t,i){t.addFieldInt8(1,i,Wr.NONE)}static addHeader(t,i){t.addFieldOffset(2,i,0)}static addBodyLength(t,i){t.addFieldInt64(3,i,BigInt("0"))}static addCustomMetadata(t,i){t.addFieldOffset(4,i,0)}static createCustomMetadataVector(t,i){t.startVector(4,i.length,4);for(let a=i.length-1;a>=0;a--)t.addOffset(i[a]);return t.endVector()}static startCustomMetadataVector(t,i){t.startVector(4,i,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,i){t.finish(i)}static finishSizePrefixedMessageBuffer(t,i){t.finish(i,void 0,!0)}static createMessage(t,i,a,d,s,b){return ve.startMessage(t),ve.addVersion(t,i),ve.addHeaderType(t,a),ve.addHeader(t,d),ve.addBodyLength(t,s),ve.addCustomMetadata(t,b),ve.endMessage(t)}},Wa=class extends H{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return wn.startNull(t),wn.endNull(t)}visitInt(e,t){return Le.startInt(t),Le.addBitWidth(t,e.bitWidth),Le.addIsSigned(t,e.isSigned),Le.endInt(t)}visitFloat(e,t){return zi.startFloatingPoint(t),zi.addPrecision(t,e.precision),zi.endFloatingPoint(t)}visitBinary(e,t){return _n.startBinary(t),_n.endBinary(t)}visitBool(e,t){return yn.startBool(t),yn.endBool(t)}visitUtf8(e,t){return In.startUtf8(t),In.endUtf8(t)}visitDecimal(e,t){return Qe.startDecimal(t),Qe.addScale(t,e.scale),Qe.addPrecision(t,e.precision),Qe.addBitWidth(t,e.bitWidth),Qe.endDecimal(t)}visitDate(e,t){return Li.startDate(t),Li.addUnit(t,e.unit),Li.endDate(t)}visitTime(e,t){return bi.startTime(t),bi.addUnit(t,e.unit),bi.addBitWidth(t,e.bitWidth),bi.endTime(t)}visitTimestamp(e,t){let i=e.timezone&&t.createString(e.timezone)||void 0;return vi.startTimestamp(t),vi.addUnit(t,e.unit),i!==void 0&&vi.addTimezone(t,i),vi.endTimestamp(t)}visitInterval(e,t){return Wi.startInterval(t),Wi.addUnit(t,e.unit),Wi.endInterval(t)}visitList(e,t){return gn.startList(t),gn.endList(t)}visitStruct(e,t){return jn.startStruct_(t),jn.endStruct_(t)}visitUnion(e,t){Pe.startTypeIdsVector(t,e.typeIds.length);let i=Pe.createTypeIdsVector(t,e.typeIds);return Pe.startUnion(t),Pe.addMode(t,e.mode),Pe.addTypeIds(t,i),Pe.endUnion(t)}visitDictionary(e,t){let i=this.visit(e.indices,t);return Ze.startDictionaryEncoding(t),Ze.addId(t,BigInt(e.id)),Ze.addIsOrdered(t,e.isOrdered),i!==void 0&&Ze.addIndexType(t,i),Ze.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return Vi.startFixedSizeBinary(t),Vi.addByteWidth(t,e.byteWidth),Vi.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return Hi.startFixedSizeList(t),Hi.addListSize(t,e.listSize),Hi.endFixedSizeList(t)}visitMap(e,t){return $i.startMap(t),$i.addKeysSorted(t,e.keysSorted),$i.endMap(t)}},xo=new Wa;function cp(e,t=new Map){return new _t(YS(e,t),To(e.customMetadata),t)}function $a(e){return new Yt(e.count,dp(e.columns),fp(e.columns))}function up(e){return new oe($a(e.data),e.id,e.isDelta)}function YS(e,t){return(e.fields||[]).filter(Boolean).map(i=>at.fromJSON(i,t))}function op(e,t){return(e.children||[]).filter(Boolean).map(i=>at.fromJSON(i,t))}function dp(e){return(e||[]).reduce((t,i)=>[...t,new He(i.count,XS(i.VALIDITY)),...dp(i.children)],[])}function fp(e,t=[]){for(let i=-1,a=(e||[]).length;++it+ +(i===0),0)}function hp(e,t){let i,a,d,s,b,_;return!t||!(s=e.dictionary)?(b=lp(e,op(e,t)),d=new at(e.name,b,e.nullable,To(e.customMetadata))):t.has(i=s.id)?(a=(a=s.indexType)?ap(a):new Xe,_=new de(t.get(i),a,i,s.isOrdered),d=new at(e.name,_,e.nullable,To(e.customMetadata))):(a=(a=s.indexType)?ap(a):new Xe,t.set(i,b=lp(e,op(e,t))),_=new de(b,a,i,s.isOrdered),d=new at(e.name,_,e.nullable,To(e.customMetadata))),d||null}function To(e){return new Map(Object.entries(e||{}))}function ap(e){return new Et(e.isSigned,e.bitWidth)}function lp(e,t){let i=e.type.name;switch(i){case"NONE":return new Qt;case"null":return new Qt;case"binary":return new li;case"utf8":return new ci;case"bool":return new ui;case"list":return new ke((t||[])[0]);case"struct":return new gt(t||[]);case"struct_":return new gt(t||[])}switch(i){case"int":{let a=e.type;return new Et(a.isSigned,a.bitWidth)}case"floatingpoint":{let a=e.type;return new ie(St[a.precision])}case"decimal":{let a=e.type;return new di(a.scale,a.precision,a.bitWidth)}case"date":{let a=e.type;return new fi(Wt[a.unit])}case"time":{let a=e.type;return new Ee(lt[a.unit],a.bitWidth)}case"timestamp":{let a=e.type;return new hi(lt[a.unit],a.timezone)}case"interval":{let a=e.type;return new pi(Zt[a.unit])}case"union":{let a=e.type;return new Oe(Bt[a.mode],a.typeIds||[],t||[])}case"fixedsizebinary":{let a=e.type;return new _i(a.byteWidth)}case"fixedsizelist":{let a=e.type;return new Re(a.listSize,(t||[])[0])}case"map":{let a=e.type;return new Me((t||[])[0],a.keysSorted)}}throw new Error('Unrecognized type: "'.concat(i,'"'))}var GS=sr,KS=pe,ae=class us{static fromJSON(t,i){let a=new us(0,Pt.V4,i);return a._createHeader=JS(t,i),a}static decode(t){t=new KS(J(t));let i=Ve.getRootAsMessage(t),a=i.bodyLength(),d=i.version(),s=i.headerType(),b=new us(a,d,s);return b._createHeader=qS(i,s),b}static encode(t){let i=new GS,a=-1;return t.isSchema()?a=_t.encode(i,t.header()):t.isRecordBatch()?a=Yt.encode(i,t.header()):t.isDictionaryBatch()&&(a=oe.encode(i,t.header())),Ve.startMessage(i),Ve.addVersion(i,Pt.V4),Ve.addHeader(i,a),Ve.addHeaderType(i,t.headerType),Ve.addBodyLength(i,BigInt(t.bodyLength)),Ve.finishMessageBuffer(i,Ve.endMessage(i)),i.asUint8Array()}static from(t,i=0){if(t instanceof _t)return new us(0,Pt.V4,ft.Schema,t);if(t instanceof Yt)return new us(i,Pt.V4,ft.RecordBatch,t);if(t instanceof oe)return new us(i,Pt.V4,ft.DictionaryBatch,t);throw new Error("Unrecognized Message header: ".concat(t))}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===ft.Schema}isRecordBatch(){return this.headerType===ft.RecordBatch}isDictionaryBatch(){return this.headerType===ft.DictionaryBatch}constructor(t,i,a,d){this._version=i,this._headerType=a,this.body=new Uint8Array(0),d&&(this._createHeader=()=>d),this._bodyLength=ee(t)}},Yt=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,i){this._nodes=t,this._buffers=i,this._length=ee(e)}},oe=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,i=!1){this._data=e,this._isDelta=i,this._id=ee(t)}},se=class{constructor(e,t){this.offset=ee(e),this.length=ee(t)}},He=class{constructor(e,t){this.length=ee(e),this.nullCount=ee(t)}};function JS(e,t){return()=>{switch(t){case ft.Schema:return _t.fromJSON(e);case ft.RecordBatch:return Yt.fromJSON(e);case ft.DictionaryBatch:return oe.fromJSON(e)}throw new Error("Unrecognized Message type: { name: ".concat(ft[t],", type: ").concat(t," }"))}}function qS(e,t){return()=>{switch(t){case ft.Schema:return _t.decode(e.header(new re));case ft.RecordBatch:return Yt.decode(e.header(new ye),e.version());case ft.DictionaryBatch:return oe.decode(e.header(new Bi),e.version())}throw new Error("Unrecognized Message type: { name: ".concat(ft[t],", type: ").concat(t," }"))}}at.encode=lI,at.decode=oI,at.fromJSON=hp,_t.encode=aI,_t.decode=ZS,_t.fromJSON=cp,Yt.encode=cI,Yt.decode=QS,Yt.fromJSON=$a,oe.encode=uI,oe.decode=tI,oe.fromJSON=up,He.encode=dI,He.decode=iI,se.encode=fI,se.decode=eI;function ZS(e,t=new Map){let i=sI(e,t);return new _t(i,Do(e),t)}function QS(e,t=Pt.V4){if(e.compression()!==null)throw new Error("Record batch compression not implemented");return new Yt(e.length(),rI(e),nI(e,t))}function tI(e,t=Pt.V4){return new oe(Yt.decode(e.data(),t),e.id(),e.isDelta())}function eI(e){return new se(e.offset(),e.length())}function iI(e){return new He(e.length(),e.nullCount())}function rI(e){let t=[];for(let i,a=-1,d=-1,s=e.nodesLength();++aat.encode(e,s));re.startFieldsVector(e,i.length);let a=re.createFieldsVector(e,i),d=t.metadata&&t.metadata.size>0?re.createCustomMetadataVector(e,[...t.metadata].map(([s,b])=>{let _=e.createString("".concat(s)),g=e.createString("".concat(b));return Lt.startKeyValue(e),Lt.addKey(e,_),Lt.addValue(e,g),Lt.endKeyValue(e)})):-1;return re.startSchema(e),re.addFields(e,a),re.addEndianness(e,hI?Ni.Little:Ni.Big),d!==-1&&re.addCustomMetadata(e,d),re.endSchema(e)}function lI(e,t){let i=-1,a=-1,d=-1,s=t.type,b=t.typeId;V.isDictionary(s)?(b=s.dictionary.typeId,d=xo.visit(s,e),a=xo.visit(s.dictionary,e)):a=xo.visit(s,e);let _=(s.children||[]).map(T=>at.encode(e,T)),g=Gt.createChildrenVector(e,_),A=t.metadata&&t.metadata.size>0?Gt.createCustomMetadataVector(e,[...t.metadata].map(([T,M])=>{let U=e.createString("".concat(T)),x=e.createString("".concat(M));return Lt.startKeyValue(e),Lt.addKey(e,U),Lt.addValue(e,x),Lt.endKeyValue(e)})):-1;return t.name&&(i=e.createString(t.name)),Gt.startField(e),Gt.addType(e,a),Gt.addTypeType(e,b),Gt.addChildren(e,g),Gt.addNullable(e,!!t.nullable),i!==-1&&Gt.addName(e,i),d!==-1&&Gt.addDictionary(e,d),A!==-1&&Gt.addCustomMetadata(e,A),Gt.endField(e)}function cI(e,t){let i=t.nodes||[],a=t.buffers||[];ye.startNodesVector(e,i.length);for(let b of i.slice().reverse())He.encode(e,b);let d=e.endVector();ye.startBuffersVector(e,a.length);for(let b of a.slice().reverse())se.encode(e,b);let s=e.endVector();return ye.startRecordBatch(e),ye.addLength(e,BigInt(t.length)),ye.addNodes(e,d),ye.addBuffers(e,s),ye.endRecordBatch(e)}function uI(e,t){let i=Yt.encode(e,t.data);return Bi.startDictionaryBatch(e),Bi.addId(e,BigInt(t.id)),Bi.addIsDelta(e,t.isDelta),Bi.addData(e,i),Bi.endDictionaryBatch(e)}function dI(e,t){return zr.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function fI(e,t){return Hr.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var hI=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),Xa=e=>"Expected ".concat(ft[e]," Message in stream, but was null or length 0."),Ga=e=>"Header pointer of flatbuffer-encoded ".concat(ft[e]," Message is null or length 0."),mp=(e,t)=>"Expected to read ".concat(e," metadata bytes, but only read ").concat(t,"."),bp=(e,t)=>"Expected to read ".concat(e," bytes for message body, but only read ").concat(t,"."),$r=class{constructor(e){this.source=e instanceof ei?e:new ei(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?wt:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Xa(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=J(this.source.read(e));if(t.byteLength[...a,...d.VALIDITY&&[d.VALIDITY]||[],...d.TYPE&&[d.TYPE]||[],...d.OFFSET&&[d.OFFSET]||[],...d.DATA&&[d.DATA]||[],...t(d.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Xa(e));return t.value}readSchema(){let e=ft.Schema,t=this.readMessage(e),i=t==null?void 0:t.header();if(!t||!i)throw new Error(Ga(e));return i}},Eo=4,Ya="ARROW1",Yr=new Uint8Array(Ya.length);for(let e=0;ethis):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return zt.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return zt.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,i){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof fl?t:ps(t)?_I(t):ys(t)?bI(t):Ae(t)?R(this,void 0,void 0,function*(){return yield fl.from(yield t)}):ms(t)||nn(t)||vs(t)||ge(t)?mI(new Ie(t)):yI(new ei(t))}static readAll(t){return t instanceof fl?t.isSync()?gp(t):wp(t):ps(t)||ArrayBuffer.isView(t)||xe(t)||_s(t)?gp(t):wp(t)}},ri=class extends Xt{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return ce(this,arguments,function*(){yield Z(yield*Qi(Ir(Be(this[Symbol.iterator]()))))})}},Xi=class extends Xt{constructor(e){super(e),this._impl=e}readAll(){var e,t,i,a;return R(this,void 0,void 0,function*(){let d=new Array;try{for(var s=!0,b=Be(this),_;_=yield b.next(),e=_.done,!e;s=!0){a=_.value,s=!1;let g=a;d.push(g)}}catch(g){t={error:g}}finally{try{!s&&!e&&(i=b.return)&&(yield i.call(b))}finally{if(t)throw t.error}}return d})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Gi=class extends ri{constructor(e){super(e),this._impl=e}},Zn=class extends Xi{constructor(e){super(e),this._impl=e}},Oo=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){let i=this._loadVectors(e,t,this.schema.fields),a=Q({type:new gt(this.schema.fields),length:e.length,children:i});return new xt(this.schema,a)}_loadDictionaryBatch(e,t){let{id:i,isDelta:a}=e,{dictionaries:d,schema:s}=this,b=d.get(i);if(a||!b){let _=s.dictionaries.get(i),g=this._loadVectors(e.data,t,[_]);return(b&&a?b.concat(new ct(g)):new ct(g)).memoize()}return b.memoize()}_loadVectors(e,t,i){return new xn(t,e.nodes,e.buffers,this.dictionaries).visitMany(i)}},Gr=class extends Oo{constructor(e,t){super(t),this._reader=ps(e)?new qn(this._handle=e):new $r(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=jp(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):wt}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):wt}next(){if(this.closed)return wt;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let i=e.header(),a=t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(i,a)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let i=e.header(),a=t.readMessageBody(e.bodyLength),d=this._loadDictionaryBatch(i,a);this.dictionaries.set(i.id,d)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new fr(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Kr=class extends Oo{constructor(e,t){super(t),this._reader=new Jn(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return R(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return R(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=jp(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return R(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):wt})}return(e){return R(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):wt})}next(){return R(this,void 0,void 0,function*(){if(this.closed)return wt;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let i=e.header(),a=yield t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(i,a)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let i=e.header(),a=yield t.readMessageBody(e.bodyLength),d=this._loadDictionaryBatch(i,a);this.dictionaries.set(i.id,d)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new fr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return R(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},Ro=class extends Gr{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof Fn?e:new Fn(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let i=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(i&&this._handle.seek(i.offset)){let a=this._reader.readMessage(ft.RecordBatch);if(a!=null&&a.isRecordBatch()){let d=a.header(),s=this._reader.readMessageBody(a.bodyLength);return this._loadRecordBatch(d,s)}}return null}_readDictionaryBatch(e){var t;let i=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(i&&this._handle.seek(i.offset)){let a=this._reader.readMessage(ft.DictionaryBatch);if(a!=null&&a.isDictionaryBatch()){let d=a.header(),s=this._reader.readMessageBody(a.bodyLength),b=this._loadDictionaryBatch(d,s);this.dictionaries.set(d.id,b)}}}_readFooter(){let{_handle:e}=this,t=e.size-Ka,i=e.readInt32(t),a=e.readAt(t-i,i);return gi.decode(a)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return R(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){var t;return R(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());let i=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(i&&(yield this._handle.seek(i.offset))){let a=yield this._reader.readMessage(ft.RecordBatch);if(a!=null&&a.isRecordBatch()){let d=a.header(),s=yield this._reader.readMessageBody(a.bodyLength);return this._loadRecordBatch(d,s)}}return null})}_readDictionaryBatch(e){var t;return R(this,void 0,void 0,function*(){let i=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(i&&(yield this._handle.seek(i.offset))){let a=yield this._reader.readMessage(ft.DictionaryBatch);if(a!=null&&a.isDictionaryBatch()){let d=a.header(),s=yield this._reader.readMessageBody(a.bodyLength),b=this._loadDictionaryBatch(d,s);this.dictionaries.set(d.id,b)}}})}_readFooter(){return R(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Ka,i=yield e.readInt32(t),a=yield e.readAt(t-i,i);return gi.decode(a)})}_readNextMessageAndValidate(e){return R(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?ko(t)?new Gi(new Ro(e.read())):new ri(new Gr(e)):new ri(new Gr(function*(){}()))}function mI(e){return R(this,void 0,void 0,function*(){let t=yield e.peek(Xr+7&-8);return t&&t.byteLength>=4?ko(t)?new Gi(new Ro(yield e.read())):new Xi(new Kr(e)):new Xi(new Kr(function(){return ce(this,arguments,function*(){})}()))})}function bI(e){return R(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),i=new Yi(e,t);return t>=vp&&ko(yield i.readAt(0,Xr+7&-8))?new Zn(new Ja(i)):new Xi(new Kr(i))})}var kt=class Cy extends H{static assemble(...t){let i=d=>d.flatMap(s=>Array.isArray(s)?i(s):s instanceof xt?s.data.children:s.data),a=new Cy;return a.visitMany(i(t)),a}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof ct)return this.visitMany(t.data),this;let{type:i}=t;if(!V.isDictionary(i)){let{length:a,nullCount:d}=t;if(a>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");V.isNull(i)||ze.call(this,d<=0?new Uint8Array(0):kr(t.offset,a,t.nullBitmap)),this.nodes.push(new He(a,d))}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function ze(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new se(this._byteLength,t)),this._byteLength+=t,this}function vI(e){let{type:t,length:i,typeIds:a,valueOffsets:d}=e;if(ze.call(this,a),t.mode===Bt.Sparse)return Za.call(this,e);if(t.mode===Bt.Dense){if(e.offset<=0)return ze.call(this,d),Za.call(this,e);{let s=a.reduce((T,M)=>Math.max(T,M),a[0]),b=new Int32Array(s+1),_=new Int32Array(s+1).fill(-1),g=new Int32Array(i),A=sn(-d[0],i,d);for(let T,M,U=-1;++U=e.length?ze.call(this,new Uint8Array(0)):(t=e.values)instanceof Uint8Array?ze.call(this,kr(e.offset,e.length,t)):ze.call(this,ir(e.values))}function Ki(e){return ze.call(this,e.values.subarray(0,e.length*e.stride))}function Sp(e){let{length:t,values:i,valueOffsets:a}=e,d=a[0],s=a[t],b=Math.min(s-d,i.byteLength-d);return ze.call(this,sn(-a[0],t,a)),ze.call(this,i.subarray(d,d+b)),this}function Qa(e){let{length:t,valueOffsets:i}=e;return i&&ze.call(this,sn(i[0],t,i)),this.visit(e.children[0])}function Za(e){return this.visitMany(e.type.children.map((t,i)=>e.children[i]).filter(Boolean))[0]}kt.prototype.visitBool=gI,kt.prototype.visitInt=Ki,kt.prototype.visitFloat=Ki,kt.prototype.visitUtf8=Sp,kt.prototype.visitBinary=Sp,kt.prototype.visitFixedSizeBinary=Ki,kt.prototype.visitDate=Ki,kt.prototype.visitTimestamp=Ki,kt.prototype.visitTime=Ki,kt.prototype.visitDecimal=Ki,kt.prototype.visitList=Qa,kt.prototype.visitStruct=Za,kt.prototype.visitUnion=vI,kt.prototype.visitInterval=Ki,kt.prototype.visitFixedSizeList=Qa,kt.prototype.visitMap=Qa;var hr=class extends or{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}constructor(e){super(),this._position=0,this._started=!1,this._sink=new ti,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,qt(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return Ae(e)?e.then(t=>this.writeAll(t)):ge(e)?el(this,e):tl(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof ti?this._sink=e:(this._sink=new ti,e&&Xf(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&Gf(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!t||!dr(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof te&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof xt&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!dr(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof xt?e instanceof fr||this._writeRecordBatch(e):e instanceof te?this.writeAll(e.batches):xe(e)&&this.writeAll(e)}_writeMessage(e,t=8){let i=t-1,a=ae.encode(e),d=a.byteLength,s=this._writeLegacyIpcFormat?4:8,b=d+s+i&~i,_=b-d-s;return e.headerType===ft.RecordBatch?this._recordBatchBlocks.push(new wi(b,e.bodyLength,this._position)):e.headerType===ft.DictionaryBatch&&this._dictionaryBlocks.push(new wi(b,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(b-s)),d>0&&this._write(a),this._writePadding(_)}_write(e){if(this._started){let t=J(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(ae.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Yr)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:i,bufferRegions:a,buffers:d}=kt.assemble(e),s=new Yt(e.numRows,i,a),b=ae.from(s,t);return this._writeDictionaries(e)._writeMessage(b)._writeBodyBuffers(d)}_writeDictionaryBatch(e,t,i=!1){this._dictionaryDeltaOffsets.set(t,e.length+(this._dictionaryDeltaOffsets.get(t)||0));let{byteLength:a,nodes:d,bufferRegions:s,buffers:b}=kt.assemble(new ct([e])),_=new Yt(e.length,d,s),g=new oe(_,t,i),A=ae.from(g,a);return this._writeMessage(A)._writeBodyBuffers(b)}_writeBodyBuffers(e){let t,i,a;for(let d=-1,s=e.length;++d0&&(this._write(t),(a=(i+7&-8)-i)>0&&this._writePadding(a));return this}_writeDictionaries(e){for(let[t,i]of e.dictionaries){let a=this._dictionaryDeltaOffsets.get(t)||0;if(a===0||(i=i==null?void 0:i.slice(a)).length>0)for(let d of i.data)this._writeDictionaryBatch(d,t,a>0),a+=d.length}return this}},pr=class Ay extends hr{static writeAll(t,i){let a=new Ay(i);return Ae(t)?t.then(d=>a.writeAll(d)):ge(t)?el(a,t):tl(a,t)}},_r=class By extends hr{static writeAll(t){let i=new By;return Ae(t)?t.then(a=>i.writeAll(a)):ge(t)?el(i,t):tl(i,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){let i=gi.encode(new gi(t,Pt.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(i)._write(Int32Array.of(i.byteLength))._writeMagic()}};function tl(e,t){let i=t;t instanceof te&&(i=t.batches,e.reset(void 0,t.schema));for(let a of i)e.write(a);return e.finish()}function el(e,t){var i,a,d,s,b,_,g;return R(this,void 0,void 0,function*(){try{for(i=!0,a=Be(t);d=yield a.next(),s=d.done,!s;i=!0){g=d.value,i=!1;let A=g;e.write(A)}}catch(A){b={error:A}}finally{try{!i&&!s&&(_=a.return)&&(yield _.call(a))}finally{if(b)throw b.error}}return e.finish()})}function Ip(e,t){if(ge(e))return jI(e,t);if(xe(e))return wI(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function wI(e,t){let i=null,a=(t==null?void 0:t.type)==="bytes"||!1,d=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(b){s(b,i||(i=e[Symbol.iterator]()))},pull(b){i?s(b,i):b.close()},cancel(){(i!=null&&i.return&&i.return()||!0)&&(i=null)}}),Object.assign({highWaterMark:a?d:void 0},t));function s(b,_){let g,A=null,T=b.desiredSize||null;for(;!(A=_.next(a?T:null)).done;)if(ArrayBuffer.isView(A.value)&&(g=J(A.value))&&(T!=null&&a&&(T=T-g.byteLength+1),A.value=g),b.enqueue(A.value),T!=null&&--T<=0)return;b.close()}}function jI(e,t){let i=null,a=(t==null?void 0:t.type)==="bytes"||!1,d=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(b){return R(this,void 0,void 0,function*(){yield s(b,i||(i=e[Symbol.asyncIterator]()))})},pull(b){return R(this,void 0,void 0,function*(){i?yield s(b,i):b.close()})},cancel(){return R(this,void 0,void 0,function*(){(i!=null&&i.return&&(yield i.return())||!0)&&(i=null)})}}),Object.assign({highWaterMark:a?d:void 0},t));function s(b,_){return R(this,void 0,void 0,function*(){let g,A=null,T=b.desiredSize||null;for(;!(A=yield _.next(a?T:null)).done;)if(ArrayBuffer.isView(A.value)&&(g=J(A.value))&&(T!=null&&a&&(T=T-g.byteLength+1),A.value=g),b.enqueue(A.value),T!=null&&--T<=0)return;b.close()})}}function Bp(e){return new il(e)}var il=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:i,["queueingStrategy"]:a="count"}=e,d=$f(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=lr(d),this._getSize=a!=="bytes"?Cp:Fp;let{["highWaterMark"]:s=a==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:b=a==="bytes"?Math.pow(2,14):1e3}=Object.assign({},i);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:_=>{this._maybeFlush(this._builder,this._controller=_)},start:_=>{this._maybeFlush(this._builder,this._controller=_)}},{highWaterMark:s,size:a!=="bytes"?Cp:Fp}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:b,size:_=>this._writeValueAndReturnChunkSize(_)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!=null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t==null?e.close():e.enqueue(t)}},Cp=e=>{var t;return(t=e==null?void 0:e.length)!==null&&t!==void 0?t:0},Fp=e=>{var t;return(t=e==null?void 0:e.byteLength)!==null&&t!==void 0?t:0};function Mo(e,t){let i=new ti,a=null,d=new ReadableStream({cancel(){return R(this,void 0,void 0,function*(){yield i.close()})},start(_){return R(this,void 0,void 0,function*(){yield b(_,a||(a=yield s()))})},pull(_){return R(this,void 0,void 0,function*(){a?yield b(_,a):_.close()})}});return{writable:new WritableStream(i,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:d};function s(){return R(this,void 0,void 0,function*(){return yield(yield Xt.from(i)).open(t)})}function b(_,g){return R(this,void 0,void 0,function*(){let A=_.desiredSize,T=null;for(;!(T=yield g.next()).done;)if(_.enqueue(T.value),A!=null&&--A<=0)return;_.close()})}}function Uo(e,t){let i=new this(e),a=new Ie(i),d=new ReadableStream({cancel(){return R(this,void 0,void 0,function*(){yield a.cancel()})},pull(b){return R(this,void 0,void 0,function*(){yield s(b)})},start(b){return R(this,void 0,void 0,function*(){yield s(b)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(i,e),readable:d};function s(b){return R(this,void 0,void 0,function*(){let _=null,g=b.desiredSize;for(;_=yield a.read(g||null);)if(b.enqueue(_),g!=null&&(g-=_.byteLength)<=0)return;b.close()})}}function No(e,t="stream"){return(t==="stream"?pr:_r).writeAll(e).toUint8Array(!0)}Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},pa),La),Ta),_a),ua),xa),{compareSchemas:dr,compareFields:tp,compareTypes:ep}),zt.toDOMStream=Ip,It.throughDOM=Bp,Xt.throughDOM=Mo,Gi.throughDOM=Mo,ri.throughDOM=Mo,hr.throughDOM=Uo,_r.throughDOM=Uo,pr.throughDOM=Uo;function Jr(e){switch(e.typeId){case B.Binary:return{sqlType:"binary"};case B.Bool:return{sqlType:"bool"};case B.Date:return{sqlType:"date"};case B.DateDay:return{sqlType:"date32[d]"};case B.DateMillisecond:return{sqlType:"date64[ms]"};case B.Decimal:{let t=e;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case B.Float:return{sqlType:"float"};case B.Float16:return{sqlType:"float16"};case B.Float32:return{sqlType:"float32"};case B.Float64:return{sqlType:"float64"};case B.Int:return{sqlType:"int32"};case B.Int16:return{sqlType:"int16"};case B.Int32:return{sqlType:"int32"};case B.Int64:return{sqlType:"int64"};case B.Uint16:return{sqlType:"uint16"};case B.Uint32:return{sqlType:"uint32"};case B.Uint64:return{sqlType:"uint64"};case B.Uint8:return{sqlType:"uint8"};case B.IntervalDayTime:return{sqlType:"interval[dt]"};case B.IntervalYearMonth:return{sqlType:"interval[m]"};case B.List:return{sqlType:"list",valueType:Jr(e.valueType)};case B.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:e.byteWidth};case B.Null:return{sqlType:"null"};case B.Utf8:return{sqlType:"utf8"};case B.Struct:return{sqlType:"struct",fields:e.children.map(t=>Lo(t.name,t.type))};case B.Map:{let t=e;return{sqlType:"map",keyType:Jr(t.keyType),valueType:Jr(t.valueType)}}case B.Time:return{sqlType:"time[s]"};case B.TimeMicrosecond:return{sqlType:"time[us]"};case B.TimeMillisecond:return{sqlType:"time[ms]"};case B.TimeNanosecond:return{sqlType:"time[ns]"};case B.TimeSecond:return{sqlType:"time[s]"};case B.Timestamp:return{sqlType:"timestamp",timezone:e.timezone||void 0};case B.TimestampSecond:return{sqlType:"timestamp[s]",timezone:e.timezone||void 0};case B.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:e.timezone||void 0};case B.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:e.timezone||void 0};case B.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:e.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(e.toString()))}function Lo(e,t){let i=Jr(t);return i.name=e,i}var Po=class{constructor(){this._bindings=null,this._nextMessageId=0}log(e){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:"LOG",data:e},[])}sendOK(e){this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"OK",data:null},[])}failWith(e,t){let i={name:t.name,message:t.message,stack:t.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"ERROR",data:i},[])}async onMessage(e){switch(e.type){case"PING":this.sendOK(e);return;case"INSTANTIATE":this._bindings!=null&&this.failWith(e,new Error("duckdb already initialized"));try{this._bindings=await this.instantiate(e.data[0],e.data[1],t=>{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"INSTANTIATE_PROGRESS",data:t},[])}),this.sendOK(e)}catch(t){console.log(t),this._bindings=null,this.failWith(e,t)}return}if(!this._bindings)return this.failWith(e,new Error("duckdb is not initialized"));try{switch(e.type){case"GET_VERSION":this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"VERSION_STRING",data:this._bindings.getVersion()},[]);break;case"GET_FEATURE_FLAGS":this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FEATURE_FLAGS",data:this._bindings.getFeatureFlags()},[]);break;case"RESET":this._bindings.reset(),this.sendOK(e);break;case"OPEN":this._bindings.open(e.data),this.sendOK(e);break;case"DROP_FILE":this._bindings.dropFile(e.data),this.sendOK(e);break;case"DROP_FILES":this._bindings.dropFiles(),this.sendOK(e);break;case"FLUSH_FILES":this._bindings.flushFiles(),this.sendOK(e);break;case"CONNECT":{let t=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"CONNECTION_INFO",data:t.useUnsafe((i,a)=>a)},[]);break}case"DISCONNECT":this._bindings.disconnect(e.data),this.sendOK(e);break;case"CREATE_PREPARED":{let t=this._bindings.createPrepared(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"PREPARED_STATEMENT_ID",data:t},[]);break}case"CLOSE_PREPARED":{this._bindings.closePrepared(e.data[0],e.data[1]),this.sendOK(e);break}case"RUN_PREPARED":{let t=this._bindings.runPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"RUN_QUERY":{let t=this._bindings.runQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT",data:t},[t.buffer]);break}case"SEND_PREPARED":{let t=this._bindings.sendPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER",data:t},[t.buffer]);break}case"START_PENDING_QUERY":{let t=this._bindings.startPendingQuery(e.data[0],e.data[1]),i=[];t&&i.push(t.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:t},i);break}case"POLL_PENDING_QUERY":{let t=this._bindings.pollPendingQuery(e.data),i=[];t&&i.push(t.buffer),this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_HEADER_OR_NULL",data:t},i);break}case"CANCEL_PENDING_QUERY":{let t=this._bindings.cancelPendingQuery(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"SUCCESS",data:t},[]);break}case"FETCH_QUERY_RESULTS":{let t=this._bindings.fetchQueryResults(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_RESULT_CHUNK",data:t},[t.buffer]);break}case"GET_TABLE_NAMES":{let t=this._bindings.getTableNames(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"TABLE_NAMES",data:t},[]);break}case"GLOB_FILE_INFOS":{let t=this._bindings.globFiles(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_INFOS",data:t},[]);break}case"REGISTER_FILE_URL":this._bindings.registerFileURL(e.data[0],e.data[1],e.data[2],e.data[3]),this.sendOK(e);break;case"REGISTER_FILE_BUFFER":this._bindings.registerFileBuffer(e.data[0],e.data[1]),this.sendOK(e);break;case"REGISTER_FILE_HANDLE":this._bindings.registerFileHandle(e.data[0],e.data[1],e.data[2],e.data[3]),this.sendOK(e);break;case"COPY_FILE_TO_PATH":this._bindings.copyFileToPath(e.data[0],e.data[1]),this.sendOK(e);break;case"COPY_FILE_TO_BUFFER":{let t=this._bindings.copyFileToBuffer(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_BUFFER",data:t},[]);break}case"COLLECT_FILE_STATISTICS":this._bindings.collectFileStatistics(e.data[0],e.data[1]),this.sendOK(e);break;case"EXPORT_FILE_STATISTICS":{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"FILE_STATISTICS",data:this._bindings.exportFileStatistics(e.data)},[]);break}case"INSERT_ARROW_FROM_IPC_STREAM":{this._bindings.insertArrowFromIPCStream(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"IMPORT_CSV_FROM_PATH":{this._bindings.insertCSVFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"IMPORT_JSON_FROM_PATH":{this._bindings.insertJSONFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case"TOKENIZE":{let t=this._bindings.tokenize(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"SCRIPT_TOKENS",data:t},[]);break}}}catch(t){return console.log(t),this.failWith(e,t)}}},Np=zf(kp()),Vo=class{constructor(e,t){this._bindings=e,this._conn=t}close(){this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}query(e){let t=this._bindings.runQuery(this._conn,e),i=Xt.from(t);return console.assert(i.isSync()),console.assert(i.isFile()),new te(i)}async send(e){let t=this._bindings.startPendingQuery(this._conn,e);for(;t==null;)t=await new Promise((d,s)=>{try{d(this._bindings.pollPendingQuery(this._conn))}catch(b){console.log(b),s(b)}});let i=new Ho(this._bindings,this._conn,t),a=Xt.from(i);return console.assert(a.isSync()),console.assert(a.isStream()),a}cancelSent(){return this._bindings.cancelPendingQuery(this._conn)}getTableNames(e){return this._bindings.getTableNames(this._conn,e)}prepare(e){let t=this._bindings.createPrepared(this._conn,e);return new nl(this._bindings,this._conn,t)}createScalarFunction(e,t,i){this._bindings.createScalarFunction(this._conn,e,t,i)}insertArrowTable(e,t){let i=No(e,"stream");this.insertArrowFromIPCStream(i,t)}insertArrowFromIPCStream(e,t){this._bindings.insertArrowFromIPCStream(this._conn,e,t)}insertCSVFromPath(e,t){this._bindings.insertCSVFromPath(this._conn,e,t)}insertJSONFromPath(e,t){this._bindings.insertJSONFromPath(this._conn,e,t)}},Ho=class{constructor(e,t,i){this.bindings=e,this.conn=t,this.header=i,this._first=!0,this._depleted=!1}next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e=this.bindings.fetchQueryResults(this.conn);return this._depleted=e.length==0,{done:this._depleted,value:e}}[Symbol.iterator](){return this}},nl=class{constructor(e,t,i){this.bindings=e,this.connectionId=t,this.statementId=i}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...e){let t=this.bindings.runPrepared(this.connectionId,this.statementId,e),i=Xt.from(t);return console.assert(i.isSync()),console.assert(i.isFile()),new te(i)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),i=new Ho(this.bindings,this.connectionId,t),a=Xt.from(i);return console.assert(a.isSync()),console.assert(a.isStream()),a}},Mp=new TextEncoder,Op=new TextDecoder("utf-8");function sl(e,t,i){let a=Mp.encode(i),d=e._malloc(a.byteLength),s=e.HEAPU8.subarray(d,d+a.byteLength);s.set(a),e.HEAPF64[(t>>3)+0]=1,e.HEAPF64[(t>>3)+1]=d,e.HEAPF64[(t>>3)+2]=s.byteLength}function al(e){switch(e){case"UINT8":case"INT8":return 1;case"INT32":case"FLOAT":return 4;case"INT64":case"UINT64":case"DOUBLE":case"VARCHAR":return 8;default:return 0}}function ol(e,t,i,a){let d=e.HEAPU8.subarray(t,t+a*al(i));switch(i){case"UINT8":return new Uint8Array(d.buffer,d.byteOffset,a);case"INT8":return new Int8Array(d.buffer,d.byteOffset,a);case"INT32":return new Int32Array(d.buffer,d.byteOffset,a);case"FLOAT":return new Float32Array(d.buffer,d.byteOffset,a);case"DOUBLE":return new Float64Array(d.buffer,d.byteOffset,a);case"VARCHAR":return new Float64Array(d.buffer,d.byteOffset,a);default:return new Array(0)}}function Rp(e,t,i){let a=e.HEAPU8.subarray(t,t+i);return new Uint8Array(a.buffer,a.byteOffset,i)}function zo(e,t,i){let a=e.HEAPU8.subarray(t,t+i*8);return new Float64Array(a.buffer,a.byteOffset,i)}function Up(e,t,i,a,d,s,b,_){try{let g=e._udfFunctions.get(a);if(!g){sl(t,i,"Unknown UDF with id: "+a);return}let A=Op.decode(t.HEAPU8.subarray(d,d+s)),T=JSON.parse(A),M=zo(t,b,_/8),U=nt=>{var be;let vt=null;switch(nt.validityBuffer!==void 0&&(vt=Rp(t,M[nt.validityBuffer],T.rows)),nt.physicalType){case"VARCHAR":{if(nt.dataBuffer===null||nt.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for VARCHAR argument");if(nt.lengthBuffer===null||nt.lengthBuffer===void 0)throw new Error("malformed data view, expected data length buffer for VARCHAR argument");let Tt=ol(t,M[nt.dataBuffer],nt.physicalType,T.rows),Ft=[],Dt=zo(t,M[nt.lengthBuffer],T.rows);for(let D=0;DFt[D]}case"STRUCT":{let Tt={},Ft=[];for(let Dt=0;Dt<(((be=nt.children)==null?void 0:be.length)||0);++Dt){let D=nt.children[Dt],ut=U(D);Ft.push(Qn=>{Tt[D.name]=ut(Qn)})}return vt!=null?Dt=>{if(!vt[Dt])return null;for(let D of Ft)D(Dt);return Tt}:Dt=>{for(let D of Ft)D(Dt);return Tt}}default:{if(nt.dataBuffer===void 0)throw new Error("malformed data view, expected data buffer for argument of type: "+nt.physicalType);let Tt=ol(t,M[nt.dataBuffer],nt.physicalType,T.rows);return vt!=null?Ft=>vt[Ft]?Tt[Ft]:null:Ft=>Tt[Ft]}}},x=[];for(let nt=0;nt>3)+0]=0,t.HEAPF64[(i>>3)+1]=br,t.HEAPF64[(i>>3)+2]=0}catch(g){sl(t,i,g.toString())}}function AI(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}var xI=AI();function Fe(e,t){console.error("FAIL WITH: ".concat(t)),e.ccall("duckdb_web_fail_with",null,["string"],[t])}function yr(e,t,i){let a=e.HEAPU8.subarray(t,t+i),d=new Uint8Array(new ArrayBuffer(a.byteLength));return d.set(a),d}function it(e,t,i){return xI(e.HEAPU8.subarray(t,t+i))}function yt(e,t,i,a){let d=e.stackSave(),s=e.stackAlloc(3*8);i.unshift("number"),a.unshift(s),e.ccall(t,null,i,a);let b=e.HEAPF64[(s>>3)+0],_=e.HEAPF64[(s>>3)+1],g=e.HEAPF64[(s>>3)+2];return e.stackRestore(d),[b,_,g]}function jt(e){e.ccall("duckdb_web_clear_response",null,[],[])}var Wo=class{constructor(e){let t=new Float64Array(e.buffer,e.byteOffset,e.byteLength/8),i=new Uint8Array(new ArrayBuffer(e.byteLength));i.set(e.subarray(7*8)),this.totalFileReadsCold=t[0],this.totalFileReadsAhead=t[1],this.totalFileReadsCached=t[2],this.totalFileWrites=t[3],this.totalPageAccesses=t[4],this.totalPageLoads=t[5],this.blockSize=t[6],this.blockStats=i}getBlockStats(e,t){return t=t||{file_reads_cold:0,file_reads_ahead:0,file_reads_cached:0,file_writes:0,page_accesses:0,page_loads:0},t.file_writes=this.blockStats[e*3+0]&15,t.file_reads_cold=this.blockStats[e*3+0]>>4,t.file_reads_ahead=this.blockStats[e*3+1]&15,t.file_reads_cached=this.blockStats[e*3+1]>>4,t.page_accesses=this.blockStats[e*3+1]&15,t.page_loads=this.blockStats[e*3+1]>>4,t}},TI=new TextEncoder,$o=class{constructor(e,t){this._instance=null,this._initPromise=null,this._initPromiseResolver=()=>{},this.onInstantiationProgress=[],this._logger=e,this._runtime=t,this._nextUDFId=1}get logger(){return this._logger}get mod(){return this._instance}get pthread(){return this.mod.PThread||null}async instantiate(e=t=>{}){return this._instance!=null?this:(this._initPromise!=null&&(this.onInstantiationProgress.push(e),await this._initPromise),this._initPromise=new Promise(t=>{this._initPromiseResolver=t}),this.onInstantiationProgress=[e],this._instance=await this.instantiateImpl({print:console.log.bind(console),printErr:console.log.bind(console),onRuntimeInitialized:this._initPromiseResolver}),await this._initPromise,this._initPromise=null,this.onInstantiationProgress=this.onInstantiationProgress.filter(t=>t!=e),this)}open(e){let[t,i,a]=yt(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==0)throw new Error(it(this.mod,i,a));jt(this.mod)}reset(){let[e,t,i]=yt(this.mod,"duckdb_web_reset",[],[]);if(e!==0)throw new Error(it(this.mod,t,i));jt(this.mod)}getVersion(){let[e,t,i]=yt(this.mod,"duckdb_web_get_version",[],[]);if(e!==0)throw new Error(it(this.mod,t,i));let a=it(this.mod,t,i);return jt(this.mod),a}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[t,i,a]=yt(this.mod,"duckdb_web_tokenize",["string"],[e]);if(t!==0)throw new Error(it(this.mod,i,a));let d=it(this.mod,i,a);return jt(this.mod),JSON.parse(d)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new Vo(this,e)}disconnect(e){if(this.mod.ccall("duckdb_web_disconnect",null,["number"],[e]),this.pthread)for(let t of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])t.postMessage({cmd:"dropUDFFunctions",connectionId:e})}runQuery(e,t){let[i,a,d]=yt(this.mod,"duckdb_web_query_run",["number","string"],[e,t]);if(i!==0)throw new Error(it(this.mod,a,d));let s=yr(this.mod,a,d);return jt(this.mod),s}startPendingQuery(e,t){let[i,a,d]=yt(this.mod,"duckdb_web_pending_query_start",["number","string"],[e,t]);if(i!==0)throw new Error(it(this.mod,a,d));if(a==0)return null;let s=yr(this.mod,a,d);return jt(this.mod),s}pollPendingQuery(e){let[t,i,a]=yt(this.mod,"duckdb_web_pending_query_poll",["number"],[e]);if(t!==0)throw new Error(it(this.mod,i,a));if(i==0)return null;let d=yr(this.mod,i,a);return jt(this.mod),d}cancelPendingQuery(e){return this.mod.ccall("duckdb_web_pending_query_cancel","boolean",["number"],[e])}fetchQueryResults(e){let[t,i,a]=yt(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(t!==0)throw new Error(it(this.mod,i,a));let d=yr(this.mod,i,a);return jt(this.mod),d}getTableNames(e,t){let[i,a,d]=yt(this.mod,"duckdb_web_get_tablenames",["number","string"],[e,t]);if(i!==0)throw new Error(it(this.mod,a,d));let s=it(this.mod,a,d);return jt(this.mod),JSON.parse(s)}createScalarFunction(e,t,i,a){let d={functionId:this._nextUDFId,name:t,returnType:Jr(i)},s={functionId:d.functionId,connectionId:e,name:t,returnType:i,func:a};this._nextUDFId+=1;let[b,_,g]=yt(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[e,JSON.stringify(d)]);if(b!==0)throw new Error(it(this.mod,_,g));if(jt(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(s.functionId,s),this.pthread)for(let A of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])A.postMessage({cmd:"registerUDFFunction",udf:s})}createPrepared(e,t){let[i,a,d]=yt(this.mod,"duckdb_web_prepared_create",["number","string"],[e,t]);if(i!==0)throw new Error(it(this.mod,a,d));return jt(this.mod),a}closePrepared(e,t){let[i,a,d]=yt(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(i!==0)throw new Error(it(this.mod,a,d));jt(this.mod)}runPrepared(e,t,i){let[a,d,s]=yt(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(i)]);if(a!==0)throw new Error(it(this.mod,d,s));let b=yr(this.mod,d,s);return jt(this.mod),b}sendPrepared(e,t,i){let[a,d,s]=yt(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(i)]);if(a!==0)throw new Error(it(this.mod,d,s));let b=yr(this.mod,d,s);return jt(this.mod),b}insertArrowFromIPCStream(e,t,i){if(t.length==0)return;let a=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(a,a+t.length).set(t);let d=i?JSON.stringify(i):"",[s,b,_]=yt(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,a,t.length,d]);if(s!==0)throw new Error(it(this.mod,b,_))}insertCSVFromPath(e,t,i){if(i.columns!==void 0){i.columnsFlat=[];for(let g in i.columns)i.columnsFlat.push(Lo(g,i.columns[g]))}let a={...i};a.columns=a.columnsFlat,delete a.columnsFlat;let d=JSON.stringify(a),[s,b,_]=yt(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,d]);if(s!==0)throw new Error(it(this.mod,b,_))}insertJSONFromPath(e,t,i){if(i.columns!==void 0){i.columnsFlat=[];for(let g in i.columns)i.columnsFlat.push(Lo(g,i.columns[g]))}let a={...i};a.columns=a.columnsFlat,delete a.columnsFlat;let d=JSON.stringify(a),[s,b,_]=yt(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,d]);if(s!==0)throw new Error(it(this.mod,b,_))}globFiles(e){let[t,i,a]=yt(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[e]);if(t!==0)throw new Error(it(this.mod,i,a));let d=it(this.mod,i,a);jt(this.mod);let s=JSON.parse(d);return s??[]}registerFileURL(e,t,i,a=!1){t===void 0&&(t=e);let[d,s,b]=yt(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,t,i,a]);if(d!==0)throw new Error(it(this.mod,s,b));jt(this.mod)}registerFileText(e,t){let i=TI.encode(t);this.registerFileBuffer(e,i)}registerFileBuffer(e,t){let i=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(i,i+t.length).set(t);let[a,d,s]=yt(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,i,t.length]);if(a!==0)throw new Error(it(this.mod,d,s));jt(this.mod)}registerFileHandle(e,t,i,a){let[d,s,b]=yt(this.mod,"duckdb_web_fs_register_file_url",["string","string","number","boolean"],[e,e,i,a]);if(d!==0)throw new Error(it(this.mod,s,b));if(jt(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,t),this.pthread){for(let _ of this.pthread.runningWorkers)_.postMessage({cmd:"registerFileHandle",fileName:e,fileHandle:t});for(let _ of this.pthread.unusedWorkers)_.postMessage({cmd:"dropFileHandle",fileName:e})}}dropFile(e){let[t,i,a]=yt(this.mod,"duckdb_web_fs_drop_file",["string"],[e]);if(t!==0)throw new Error(it(this.mod,i,a));jt(this.mod)}dropFiles(){let[e,t,i]=yt(this.mod,"duckdb_web_fs_drop_files",[],[]);if(e!==0)throw new Error(it(this.mod,t,i));jt(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[i,a,d]=yt(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(i!==0)throw new Error(it(this.mod,a,d));jt(this.mod)}copyFileToBuffer(e){let[t,i,a]=yt(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==0)throw new Error(it(this.mod,i,a));let d=this.mod.HEAPU8.subarray(i,i+a),s=new Uint8Array(d.length);return s.set(d),jt(this.mod),s}collectFileStatistics(e,t){let[i,a,d]=yt(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(i!==0)throw new Error(it(this.mod,a,d))}exportFileStatistics(e){let[t,i,a]=yt(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==0)throw new Error(it(this.mod,i,a));return new Wo(this.mod.HEAPU8.subarray(i,i+a))}},Yo=class extends $o{constructor(e,t,i,a){super(e,t),this.mainModuleURL=i,this.pthreadWorkerURL=a}locateFile(e,t){if(e.endsWith(".wasm"))return this.mainModuleURL;if(e.endsWith(".worker.js")){if(!this.pthreadWorkerURL)throw new Error("Missing DuckDB worker URL!");return this.pthreadWorkerURL}throw new Error("WASM instantiation requested unexpected file: prefix=".concat(t," path=").concat(e))}instantiateWasm(e,t){globalThis.DUCKDB_RUNTIME=this._runtime;let i=this.onInstantiationProgress;if(WebAssembly.instantiateStreaming)if(typeof TransformStream=="function"){let a=(async()=>{var d;let s=new Request(this.mainModuleURL),b=await fetch(s),_=b.headers.get("content-length"),g=_&&parseInt(_,10)||0,A=new Date,T={startedAt:A,updatedAt:A,bytesTotal:g||0,bytesLoaded:0},M={transform(x,W){T.bytesLoaded+=x.byteLength;let Ot=new Date;if(Ot.getTime()-T.updatedAt.getTime()<20){T.updatedAt=Ot,W.enqueue(x);return}for(let mt of i)mt(T);W.enqueue(x)}},U=new TransformStream(M);return new Response((d=b.body)==null?void 0:d.pipeThrough(U),b)})();WebAssembly.instantiateStreaming(a,e).then(d=>{t(d.instance,d.module)})}else{console.warn("instantiating without progress handler since transform streams are unavailable");let a=new Request(this.mainModuleURL);WebAssembly.instantiateStreaming(fetch(a),e).then(d=>{t(d.instance,d.module)})}else if(typeof XMLHttpRequest=="function"){let a=new XMLHttpRequest,d=this.mainModuleURL,s=new Date,b={startedAt:s,updatedAt:s,bytesTotal:0,bytesLoaded:0};a.open("GET",d),a.responseType="arraybuffer",a.onerror=_=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+_}),new Error(_.toString())},a.onprogress=_=>{b.bytesTotal=_.total,b.bytesLoaded=_.loaded;let g=new Date;if(g.getTime()-b.updatedAt.getTime()<20){b.updatedAt=g;return}for(let A of i)A(b)},a.onload=()=>{WebAssembly.instantiate(a.response,e).then(_=>{t(_.instance,_.module)}).catch(_=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+_}),new Error(_)})},a.send()}else console.warn("instantiating with manual fetch since streaming instantiation and xhrs are unavailable"),(async()=>{let a=new Request(this.mainModuleURL),d=await(await fetch(a)).arrayBuffer();WebAssembly.instantiate(d,e).then(s=>{t(s.instance,s.module)})})();return[]}},Xo=class extends Yo{constructor(e,t,i,a=null){super(e,t,i,a)}instantiateImpl(e){return(0,Np.default)({...e,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}},Ji=zf(Lp()),Pp=function(e,t,i){var a;if((a=e==null?void 0:e.endpoint)!=null&&a.startsWith("http")){let d="".concat(e==null?void 0:e.endpoint),s=d.indexOf("://")+3;return d.substring(s)}else return e!=null&&e.endpoint?"".concat(i,".").concat(e==null?void 0:e.endpoint):"".concat(i,".s3.amazonaws.com")};function DI(e,t,i){var a,d,s,b;let _=Vp(t),g=_.path;return Hp(e)&&(g="/".concat(_.bucket).concat(g)),{url:g,query:"",host:Pp(e,t,_.bucket),region:(a=e==null?void 0:e.region)!=null?a:"",service:"s3",method:i,accessKeyId:(d=e==null?void 0:e.accessKeyId)!=null?d:"",secretAccessKey:(s=e==null?void 0:e.secretAccessKey)!=null?s:"",sessionToken:(b=e==null?void 0:e.sessionToken)!=null?b:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function EI(e,t=!1){let i="0123456789ABCDEF",a="";for(let d=0;d="A"&&s<="Z"||s>="a"&&s<="z"||s>="0"&&s<="9"||s=="_"||s=="-"||s=="~"||s=="."?a+=s:s=="/"?t?a+="%2F":a+=s:(a+="%",a+=i[s.charCodeAt(0)>>4],a+=i[s.charCodeAt(0)&15])}return a}function kI(e,t=null){var i;let a=(i=t==null?void 0:t.contentHash)!=null?i:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",d=new Map;d.set("x-amz-date",e.datetimeNow),d.set("x-amz-content-sha256",a),e.sessionToken&&d.set("x-amz-security-token",e.sessionToken);let s="";t!=null&&t.contentType&&(s+="content-type;"),s+="host;x-amz-content-sha256;x-amz-date",e.sessionToken&&(s+=";x-amz-security-token");let b=e.method+` `+EI(e.url)+` `+e.query;t!=null&&t.contentType&&(b+=` content-type:`+(t==null?void 0:t.contentType)),b+=` host:`+e.host+` x-amz-content-sha256:`+a+` x-amz-date:`+e.datetimeNow,e.sessionToken&&e.sessionToken.length>0&&(b+=` x-amz-security-token:`+e.sessionToken),b+=` `+s+` `+a;let _=(0,Ji.sha256)(b),g=`AWS4-HMAC-SHA256 `+e.datetimeNow+` `+e.dateNow+"/"+e.region+"/"+e.service+`/aws4_request `+_,A="AWS4"+e.secretAccessKey,T=Ji.sha256.hmac.arrayBuffer(A,e.dateNow),M=Ji.sha256.hmac.arrayBuffer(T,e.region),U=Ji.sha256.hmac.arrayBuffer(M,e.service),x=Ji.sha256.hmac.arrayBuffer(U,"aws4_request"),W=Ji.sha256.hmac(x,g);return d.set("Authorization","AWS4-HMAC-SHA256 Credential="+e.accessKeyId+"/"+e.dateNow+"/"+e.region+"/"+e.service+"/aws4_request, SignedHeaders="+s+", Signature="+W),d}var OI=function(e,t,i,a=null,d=null){let s=DI(e,t,i),b={contentType:a,contentHash:d?Ji.sha256.hex(d):null};return kI(s,b)};function ni(e,t,i,a,d=null,s=null){(t!=null&&t.accessKeyId||t!=null&&t.sessionToken)&&(OI(t,i,a,d,s).forEach((b,_)=>{e.setRequestHeader(_,b)}),d&&e.setRequestHeader("content-type",d))}function Vp(e){if(e.indexOf("s3://")!=0)throw new Error("URL needs to start with s3://");let t=e.indexOf("/",5);if(t==-1)throw new Error("URL needs to contain a '/' after the host");let i=e.substring(5,t);if(!i)throw new Error("URL needs to contain a bucket name");let a=e.substring(t);if(!a)throw new Error("URL needs to contain key");return{bucket:i,path:a}}function Hp(e){var t;return!!((t=e==null?void 0:e.endpoint)!=null&&t.startsWith("http"))}function si(e,t){let i=Vp(t);return Hp(e)?"".concat(e==null?void 0:e.endpoint,"/").concat(i.bucket)+i.path:"https://"+Pp(e,t,i.bucket)+i.path}var ht={_files:new Map,_fileInfoCache:new Map,_udfFunctions:new Map,_globalFileInfo:null,getFileInfo(e,t){try{let i=ht._fileInfoCache.get(t),[a,d,s]=yt(e,"duckdb_web_fs_get_file_info_by_id",["number","number"],[t,(i==null?void 0:i.cacheEpoch)||0]);if(a!==0)return null;if(s===0)return i;let b=it(e,d,s);jt(e);let _=JSON.parse(b);if(_==null)return null;let g={..._,blob:null};return ht._fileInfoCache.set(t,g),g}catch(i){return console.log(i),null}},getGlobalFileInfo(e){var t;try{let[i,a,d]=yt(e,"duckdb_web_get_global_file_info",["number"],[((t=ht._globalFileInfo)==null?void 0:t.cacheEpoch)||0]);if(i!==0)return null;if(d===0)return ht._globalFileInfo;let s=it(e,a,d);jt(e);let b=JSON.parse(s);return b==null?null:(ht._globalFileInfo={...b,blob:null},ht._globalFileInfo)}catch(i){return console.log(i),null}},testPlatformFeature:(e,t)=>{switch(t){case 1:return typeof BigInt64Array<"u";default:return console.warn("test for unknown feature: ".concat(t)),!1}},getDefaultDataProtocol(e){return 2},openFile:(e,t,i)=>{var a;try{ht._fileInfoCache.delete(t);let d=ht.getFileInfo(e,t);switch(d==null?void 0:d.dataProtocol){case 4:case 5:{if(i&1&&i&2)throw new Error("Opening file ".concat(d.fileName," failed: cannot open file with both read and write flags set"));if(i&32)throw new Error("Opening file ".concat(d.fileName," failed: appending to HTTP/S3 files is not supported"));if(i&2){let _=new XMLHttpRequest;if(d.dataProtocol==5?(_.open("HEAD",si(d.s3Config,d.dataUrl),!1),ni(_,d.s3Config,d.dataUrl,"HEAD")):_.open("HEAD",d.dataUrl,!1),_.send(null),_.status!=200&&_.status!=404)throw new Error("Opening file ".concat(d.fileName," failed: Unexpected return status from server (").concat(_.status,")"));if(_.status==404&&!(i&8||i&16))throw new Error("Opening file ".concat(d.fileName," failed: Cannot write to non-existent file without FILE_FLAGS_FILE_CREATE or FILE_FLAGS_FILE_CREATE_NEW flag."));let g=e._malloc(1),A=new Uint8Array;e.HEAPU8.set(A,g);let T=e._malloc(2*8);return e.HEAPF64[(T>>3)+0]=1,e.HEAPF64[(T>>3)+1]=g,T}else if(i!=1)throw new Error("Opening file ".concat(d.fileName," failed: unsupported file flags: ").concat(i));let s=null,b=null;try{let _=new XMLHttpRequest;if(d.dataProtocol==5?(_.open("HEAD",si(d.s3Config,d.dataUrl),!1),ni(_,d.s3Config,d.dataUrl,"HEAD")):_.open("HEAD",d.dataUrl,!1),_.setRequestHeader("Range","bytes=0-"),_.send(null),s=_.getResponseHeader("Content-Length"),s!==null&&_.status==206){let g=e._malloc(16);return e.HEAPF64[(g>>3)+0]=+s,e.HEAPF64[(g>>3)+1]=0,g}}catch(_){b=_,console.warn("HEAD request with range header failed: ".concat(_))}if(d.allowFullHttpReads){if(s!==null&&+s>1){let g=new XMLHttpRequest;d.dataProtocol==5?(g.open("GET",si(d.s3Config,d.dataUrl),!1),ni(g,d.s3Config,d.dataUrl,"GET")):g.open("GET",d.dataUrl,!1),g.responseType="arraybuffer",g.setRequestHeader("Range","bytes=0-0"),g.send(null);let A=g.getResponseHeader("Content-Length");if(g.status==206&&A!==null&&+A==1){let T=e._malloc(16);return e.HEAPF64[(T>>3)+0]=+s,e.HEAPF64[(T>>3)+1]=0,T}if(g.status==200&&A!==null&&+A==+s){console.warn("fall back to full HTTP read for: ".concat(d.dataUrl));let T=e._malloc(g.response.byteLength),M=new Uint8Array(g.response,0,g.response.byteLength);e.HEAPU8.set(M,T);let U=e._malloc(2*8);return e.HEAPF64[(U>>3)+0]=g.response.byteLength,e.HEAPF64[(U>>3)+1]=T,U}}console.warn("falling back to full HTTP read for: ".concat(d.dataUrl));let _=new XMLHttpRequest;if(d.dataProtocol==5?(_.open("GET",si(d.s3Config,d.dataUrl),!1),ni(_,d.s3Config,d.dataUrl,"GET")):_.open("GET",d.dataUrl,!1),_.responseType="arraybuffer",_.send(null),_.status==200){let g=e._malloc(_.response.byteLength),A=new Uint8Array(_.response,0,_.response.byteLength);e.HEAPU8.set(A,g);let T=e._malloc(2*8);return e.HEAPF64[(T>>3)+0]=_.response.byteLength,e.HEAPF64[(T>>3)+1]=g,T}}if(b!=null)throw new Error("Reading file ".concat(d.fileName," failed with error: ").concat(b));return 0}case 2:{let s=(a=ht._files)==null?void 0:a.get(d.fileName);if(s){let g=e._malloc(16);return e.HEAPF64[(g>>3)+0]=s.size,e.HEAPF64[(g>>3)+1]=0,g}console.warn("Buffering missing file: ".concat(d.fileName));let b=e._malloc(2*8),_=e._malloc(1);return e.HEAPF64[(b>>3)+0]=1,e.HEAPF64[(b>>3)+1]=_,b}}}catch(d){console.error(d.toString()),Fe(e,d.toString())}return 0},glob:(e,t,i)=>{var a;try{let d=it(e,t,i);if(d.startsWith("http")||d.startsWith("s3://")){let s=new XMLHttpRequest;if(d.startsWith("s3://")){let b=ht.getGlobalFileInfo(e);s.open("HEAD",si(b==null?void 0:b.s3Config,d),!1),ni(s,b==null?void 0:b.s3Config,d,"HEAD")}else s.open("HEAD",d,!1);if(s.send(null),s.status!=200&&s.status!==206){if(!((a=ht.getGlobalFileInfo(e))!=null&&a.allowFullHttpReads)){Fe(e,"HEAD request failed: ".concat(d,", with full http reads are disabled"));return}let b=new XMLHttpRequest;if(d.startsWith("s3://")){let g=ht.getGlobalFileInfo(e);b.open("GET",si(g==null?void 0:g.s3Config,d),!1),ni(b,g==null?void 0:g.s3Config,d,"HEAD")}else b.open("GET",d,!1);if(b.setRequestHeader("Range","bytes=0-0"),b.send(null),b.status!=200&&b.status!==206){Fe(e,"HEAD and GET requests failed: ".concat(d));return}let _=b.getResponseHeader("Content-Length");_&&+_>1&&console.warn("Range request for ".concat(d," did not return a partial response: ").concat(b.status,' "').concat(b.statusText,'"'))}e.ccall("duckdb_web_fs_glob_add_path",null,["string"],[d])}}catch(d){return console.log(d),Fe(e,d.toString()),0}},checkFile:(e,t,i)=>{try{let a=it(e,t,i);if(a.startsWith("http")||a.startsWith("s3://")){let d=new XMLHttpRequest;if(a.startsWith("s3://")){let s=ht.getGlobalFileInfo(e);d.open("HEAD",si(s==null?void 0:s.s3Config,a),!1),ni(d,s==null?void 0:s.s3Config,a,"HEAD")}else d.open("HEAD",a,!1);return d.send(null),d.status==206||d.status==200}}catch(a){return console.log(a),!1}return!1},syncFile:(e,t)=>{},closeFile:(e,t)=>{var i;let a=ht.getFileInfo(e,t);switch(ht._fileInfoCache.delete(t),a==null?void 0:a.dataProtocol){case 0:case 4:case 5:break;case 1:case 2:return;case 3:{let d=(i=ht._files)==null?void 0:i.get(a.fileName);if(!d)throw new Error("No OPFS access handle registered with name: ".concat(a.fileName));return d.flush()}}},truncateFile:(e,t,i)=>{var a;let d=ht.getFileInfo(e,t);switch(d==null?void 0:d.dataProtocol){case 4:Fe(e,"Cannot truncate a http file");return;case 5:Fe(e,"Cannot truncate an s3 file");return;case 0:case 1:case 2:Fe(e,"truncateFile not implemented");return;case 3:{let s=(a=ht._files)==null?void 0:a.get(d.fileName);if(!s)throw new Error("No OPFS access handle registered with name: ".concat(d.fileName));return s.truncate(i)}}return 0},readFile(e,t,i,a,d){var s,b;if(a==0)return 0;try{let _=ht.getFileInfo(e,t);switch(_==null?void 0:_.dataProtocol){case 4:case 5:{if(!_.dataUrl)throw new Error("Missing data URL for file ".concat(t));try{let g=new XMLHttpRequest;if(_.dataProtocol==5?(g.open("GET",si(_==null?void 0:_.s3Config,_.dataUrl),!1),ni(g,_==null?void 0:_.s3Config,_.dataUrl,"GET")):g.open("GET",_.dataUrl,!1),g.responseType="arraybuffer",g.setRequestHeader("Range","bytes=".concat(d,"-").concat(d+a-1)),g.send(null),g.status==206||g.status==200&&a==g.response.byteLength&&d==0){let A=new Uint8Array(g.response,0,Math.min(g.response.byteLength,a));return e.HEAPU8.set(A,i),A.byteLength}else if(g.status==200){console.warn("Range request for ".concat(_.dataUrl," did not return a partial response: ").concat(g.status,' "').concat(g.statusText,'"'));let A=new Uint8Array(g.response,d,Math.min(g.response.byteLength-d,a));return e.HEAPU8.set(A,i),A.byteLength}else throw new Error("Range request for ".concat(_.dataUrl," did returned non-success status: ").concat(g.status,' "').concat(g.statusText,'"'))}catch(g){throw console.log(g),new Error("Range request for ".concat(_.dataUrl," failed with error: ").concat(g,'"'))}}case 2:{let g=(s=ht._files)==null?void 0:s.get(_.fileName);if(!g)throw new Error("No HTML5 file registered with name: ".concat(_.fileName));let A=g.slice(d,d+a),T=new Uint8Array(new FileReaderSync().readAsArrayBuffer(A));return e.HEAPU8.set(T,i),T.byteLength}case 3:{let g=(b=ht._files)==null?void 0:b.get(_.fileName);if(!g)throw new Error("No OPFS access handle registered with name: ".concat(_.fileName));let A=e.HEAPU8.subarray(i,i+a);return g.read(A,{at:d})}}return 0}catch(_){return console.log(_),Fe(e,_.toString()),0}},writeFile:(e,t,i,a,d)=>{var s;let b=ht.getFileInfo(e,t);switch(b==null?void 0:b.dataProtocol){case 4:return Fe(e,"Cannot write to HTTP file"),0;case 5:{let _=e.HEAPU8.subarray(i,i+a),g=new XMLHttpRequest;return g.open("PUT",si(b==null?void 0:b.s3Config,b.dataUrl),!1),ni(g,b==null?void 0:b.s3Config,b.dataUrl,"PUT","",_),g.send(_),g.status!==200?(Fe(e,"Failed writing file: HTTP "+g.status),0):a}case 2:return Fe(e,"cannot write using the html5 file reader api"),0;case 3:{let _=(s=ht._files)==null?void 0:s.get(b.fileName);if(!_)throw new Error("No OPFS access handle registered with name: ".concat(b.fileName));let g=e.HEAPU8.subarray(i,i+a);return _.write(g,{at:d})}}return 0},getLastFileModificationTime:(e,t)=>{var i;let a=ht.getFileInfo(e,t);switch(a==null?void 0:a.dataProtocol){case 2:{if(!((i=ht._files)!=null&&i.get(a.fileName)))throw Error("No handle available for file: ".concat(a.fileName));return 0}case 4:case 5:return new Date().getTime()}return 0},checkDirectory:(e,t,i)=>{let a=it(e,t,i);return console.log("checkDirectory: ".concat(a)),!1},createDirectory:(e,t,i)=>{let a=it(e,t,i);console.log("createDirectory: ".concat(a))},removeDirectory:(e,t,i)=>{let a=it(e,t,i);console.log("removeDirectory: ".concat(a))},listDirectoryEntries:(e,t,i)=>{let a=it(e,t,i);return console.log("listDirectoryEntries: ".concat(a)),!1},moveFile:(e,t,i,a,d)=>{var s,b;let _=it(e,t,i),g=it(e,a,d),A=(s=ht._files)==null?void 0:s.get(_);A!==void 0&&(ht._files.delete(A),ht._files.set(g,A));for(let[T,M]of((b=ht._fileInfoCache)==null?void 0:b.entries())||[])if(M.dataUrl==_){ht._fileInfoCache.delete(T);break}return!0},removeFile:(e,t,i)=>{},callScalarUDF:(e,t,i,a,d,s,b)=>{Up(ht,e,t,i,a,d,s,b)}},ll=class extends Po{postMessage(e,t){globalThis.postMessage(e,t)}async instantiate(e,t,i){return await new Xo(this,ht,e,t).instantiate(i)}};function zp(){let e=new ll;globalThis.onmessage=async t=>{await e.onMessage(t.data)}}return zp(),$w(RI)})()})();