@duckdb/duckdb-wasm 1.13.1-dev161.0 → 1.13.1-dev166.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/duckdb-browser-blocking.cjs +2 -2
- package/dist/duckdb-browser-blocking.cjs.map +1 -1
- package/dist/duckdb-browser-blocking.mjs +2 -2
- package/dist/duckdb-browser-blocking.mjs.map +1 -1
- package/dist/duckdb-browser-coi.pthread.worker.js +1 -1
- package/dist/duckdb-browser-coi.pthread.worker.js.map +2 -2
- package/dist/duckdb-browser-coi.worker.js +1 -1
- package/dist/duckdb-browser-coi.worker.js.map +2 -2
- package/dist/duckdb-browser-mvp.worker.js +1 -1
- package/dist/duckdb-browser-mvp.worker.js.map +1 -1
- package/dist/duckdb-browser.cjs +1 -1
- package/dist/duckdb-browser.mjs +1 -1
- package/dist/duckdb-coi.wasm +0 -0
- package/dist/duckdb-eh.wasm +0 -0
- package/dist/duckdb-mvp.wasm +0 -0
- package/dist/duckdb-node-blocking.cjs +2 -2
- package/dist/duckdb-node-blocking.cjs.map +1 -1
- package/dist/duckdb-node-eh.worker.cjs +1 -1
- package/dist/duckdb-node-eh.worker.cjs.map +1 -1
- package/dist/duckdb-node-mvp.worker.cjs +1 -1
- package/dist/duckdb-node-mvp.worker.cjs.map +1 -1
- package/dist/duckdb-node.cjs +1 -1
- package/dist/tests-browser.js +1 -1
- package/dist/tests-browser.js.map +1 -1
- package/dist/tests-node.cjs +25 -1
- package/dist/tests-node.cjs.map +3 -3
- package/package.json +3 -3
|
@@ -17,7 +17,7 @@ return true;`)}aa.createIsValidFunction=Xw;function Zw(r){return typeof r!="bigi
|
|
|
17
17
|
}`),this._dictionaries=[],this._recordBatches=[],super.close()}};Ar.RecordBatchJSONWriter=rc;function ed(r,e){let t=e;e instanceof Zl.Table&&(t=e.chunks,r.reset(void 0,e.schema));for(let n of t)r.write(n);return r.finish()}function td(r,e){var t,n,i,s;return vm.__awaiter(this,void 0,void 0,function*(){try{for(t=vm.__asyncValues(e);n=yield t.next(),!n.done;){let o=n.value;r.write(o)}}catch(o){i={error:o}}finally{try{n&&!n.done&&(s=t.return)&&(yield s.call(t))}finally{if(i)throw i.error}}return r.finish()})}function Tm({name:r,type:e,nullable:t}){let n=new PS.JSONTypeAssembler;return{name:r,nullable:t,type:n.visit(e),children:(e.children||[]).map(Tm),dictionary:RS.DataType.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function kS(r,e,t=!1){let n=new VS.Field(`${e}`,r.type,r.nullCount>0),i=Im.JSONVectorAssembler.assemble(new xS.Column(n,[r]));return JSON.stringify({id:e,isDelta:t,data:{count:r.length,columns:i}},null,2)}function CS(r){return JSON.stringify({count:r.length,columns:Im.JSONVectorAssembler.assemble(r)},null,2)}});var id=w(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.distributeVectorsIntoRecordBatches=On.distributeColumnsIntoRecordBatches=On.ensureSameLengthData=void 0;var Sm=Qt(),nd=nt(),jS=Tn(),qS=Wr(),rd=new Uint8Array(0),Am=r=>[rd,rd,new Uint8Array(r),rd];function HS(r,e,t=e.reduce((n,i)=>Math.max(n,i.length),0)){let n,i,s=-1,o=e.length,u=[...r.fields],a=[],h=(t+63&-64)>>3;for(;++s<o;)(n=e[s])&&n.length===t?a[s]=n:((i=u[s]).nullable||(u[s]=u[s].clone({nullable:!0})),a[s]=n?n._changeLengthAndBackfillNullBitmap(t):Sm.Data.new(i.type,0,t,t,Am(h)));return[new nd.Schema(u),t,a]}On.ensureSameLengthData=HS;function zS(r){return Fm(new nd.Schema(r.map(({field:e})=>e)),r)}On.distributeColumnsIntoRecordBatches=zS;function Fm(r,e){return WS(r,e.map(t=>t instanceof jS.Chunked?t.chunks.map(n=>n.data):[t.data]))}On.distributeVectorsIntoRecordBatches=Fm;function WS(r,e){let t=[...r.fields],n=[],i={numBatches:e.reduce((T,O)=>Math.max(T,O.length),0)},s=0,o=0,u=-1,a=e.length,h,_=[];for(;i.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,u=-1;++u<a;)_[u]=h=e[u].shift(),o=Math.min(o,h?h.length:o);isFinite(o)&&(_=YS(t,o,_,e,i),o>0&&(n[s++]=[o,_.slice()]))}return[r=new nd.Schema(t,r.metadata),n.map(T=>new qS.RecordBatch(r,...T))]}function YS(r,e,t,n,i){let s,o,u=0,a=-1,h=n.length,_=(e+63&-64)>>3;for(;++a<h;)(s=t[a])&&(u=s.length)>=e?u===e?t[a]=s:(t[a]=s.slice(0,e),s=s.slice(e,u-e),i.numBatches=Math.max(i.numBatches,n[a].unshift(s))):((o=r[a]).nullable||(r[a]=o.clone({nullable:!0})),t[a]=s?s._changeLengthAndBackfillNullBitmap(e):Sm.Data.new(o.type,0,e,e,Am(_)));return t}});var We=w(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.BaseVector=void 0;var GS=Be(),$S=Tn(),JS=Ws(),sd=He(),od=class extends sd.AbstractVector{constructor(e,t){super();this._children=t,this.numChildren=e.childData.length,this._bindDataAccessors(this.data=e)}get type(){return this.data.type}get typeId(){return this.data.typeId}get length(){return this.data.length}get offset(){return this.data.offset}get stride(){return this.data.stride}get nullCount(){return this.data.nullCount}get byteLength(){return this.data.byteLength}get VectorName(){return`${GS.Type[this.typeId]}Vector`}get ArrayType(){return this.type.ArrayType}get values(){return this.data.values}get typeIds(){return this.data.typeIds}get nullBitmap(){return this.data.nullBitmap}get valueOffsets(){return this.data.valueOffsets}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}clone(e,t=this._children){return sd.Vector.new(e,t)}concat(...e){return $S.Chunked.concat(this,...e)}slice(e,t){return JS.clampRange(this,e,t,this._sliceInternal)}isValid(e){if(this.nullCount>0){let t=this.offset+e;return(this.nullBitmap[t>>3]&1<<t%8)!==0}return!0}getChildAt(e){return e<0||e>=this.numChildren?null:(this._children||(this._children=[]))[e]||(this._children[e]=sd.Vector.new(this.data.childData[e]))}toJSON(){return[...this]}_sliceInternal(e,t,n){return e.clone(e.data.slice(t,n-t),null)}_bindDataAccessors(e){}};ic.BaseVector=od;od.prototype[Symbol.isConcatSpreadable]=!0});var ad=w(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.BinaryVector=void 0;var KS=He(),XS=We(),ZS=fe(),Dm=class extends XS.BaseVector{asUtf8(){return KS.Vector.new(this.data.clone(new ZS.Utf8))}};sc.BinaryVector=Dm});var cd=w(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.BoolVector=void 0;var QS=fe(),e1=We(),t1=Fr(),Om=class extends e1.BaseVector{static from(e){return t1.vectorFromValuesWithType(()=>new QS.Bool,e)}};oc.BoolVector=Om});var ld=w(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.DateMillisecondVector=Mn.DateDayVector=Mn.DateVector=void 0;var r1=Be(),n1=We(),Mm=Fr(),ud=fe(),ac=class extends n1.BaseVector{static from(...e){return e.length===2?Mm.vectorFromValuesWithType(()=>e[1]===r1.DateUnit.DAY?new ud.DateDay:new ud.DateMillisecond,e[0]):Mm.vectorFromValuesWithType(()=>new ud.DateMillisecond,e[0])}};Mn.DateVector=ac;var Em=class extends ac{};Mn.DateDayVector=Em;var Um=class extends ac{};Mn.DateMillisecondVector=Um});var dd=w(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.DecimalVector=void 0;var i1=We(),xm=class extends i1.BaseVector{};cc.DecimalVector=xm});var lc=w(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.DictionaryVector=void 0;var s1=Qt(),Rm=He(),o1=We(),a1=Fr(),c1=fe(),fd=class extends o1.BaseVector{constructor(e){super(e);this.indices=Rm.Vector.new(e.clone(this.type.indices))}static from(...e){if(e.length===3){let[t,n,i]=e,s=new c1.Dictionary(t.type,n,null,null);return Rm.Vector.new(s1.Data.Dictionary(s,0,i.length,0,null,i,t))}return a1.vectorFromValuesWithType(()=>e[0].type,e[0])}get dictionary(){return this.data.dictionary}reverseLookup(e){return this.dictionary.indexOf(e)}getKey(e){return this.indices.get(e)}getValue(e){return this.dictionary.get(e)}setKey(e,t){return this.indices.set(e,t)}setValue(e,t){return this.dictionary.set(e,t)}};uc.DictionaryVector=fd;fd.prototype.indices=null});var hd=w(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.FixedSizeBinaryVector=void 0;var u1=We(),Vm=class extends u1.BaseVector{};dc.FixedSizeBinaryVector=Vm});var pd=w(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.FixedSizeListVector=void 0;var l1=We(),Pm=class extends l1.BaseVector{};fc.FixedSizeListVector=Pm});var bd=w(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.Float64Vector=Dr.Float32Vector=Dr.Float16Vector=Dr.FloatVector=void 0;var d1=Qt(),f1=He(),h1=We(),p1=Fr(),li=fe(),eo=class extends h1.BaseVector{static from(e){let t=m1(this);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){let n=_1(e.constructor)||t;if(t===null&&(t=n),t&&t===n){let i=new t,s=e.byteLength/i.ArrayType.BYTES_PER_ELEMENT;if(!y1(t,e.constructor))return f1.Vector.new(d1.Data.Float(i,0,s,0,null,e))}}if(t)return p1.vectorFromValuesWithType(()=>new t,e);throw e instanceof DataView||e instanceof ArrayBuffer?new TypeError(`Cannot infer float type from instance of ${e.constructor.name}`):new TypeError("Unrecognized FloatVector input")}};Dr.FloatVector=eo;var yd=class extends eo{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}};Dr.Float16Vector=yd;var _d=class extends eo{};Dr.Float32Vector=_d;var md=class extends eo{};Dr.Float64Vector=md;var y1=(r,e)=>r===li.Float16&&e!==Uint16Array,_1=r=>{switch(r){case Uint16Array:return li.Float16;case Float32Array:return li.Float32;case Float64Array:return li.Float64;default:return null}},m1=r=>{switch(r){case yd:return li.Float16;case _d:return li.Float32;case md:return li.Float64;default:return null}}});var gd=w(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.IntervalYearMonthVector=En.IntervalDayTimeVector=En.IntervalVector=void 0;var b1=We(),hc=class extends b1.BaseVector{};En.IntervalVector=hc;var Lm=class extends hc{};En.IntervalDayTimeVector=Lm;var Nm=class extends hc{};En.IntervalYearMonthVector=Nm});var pc=w(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.Uint64Vector=Ke.Uint32Vector=Ke.Uint16Vector=Ke.Uint8Vector=Ke.Int64Vector=Ke.Int32Vector=Ke.Int16Vector=Ke.Int8Vector=Ke.IntVector=void 0;var g1=Qt(),v1=He(),w1=We(),B1=Fr(),km=ft(),Cm=Xe(),Ce=fe(),Or=class extends w1.BaseVector{static from(...e){let[t,n=!1]=e,i=S1(this,n);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){let s=T1(t.constructor,n)||i;if(i===null&&(i=s),i&&i===s){let o=new i,u=t.byteLength/o.ArrayType.BYTES_PER_ELEMENT;return I1(i,t.constructor)&&(u*=.5),v1.Vector.new(g1.Data.Int(o,0,u,0,null,t))}}if(i)return B1.vectorFromValuesWithType(()=>new i,t);throw t instanceof DataView||t instanceof ArrayBuffer?new TypeError(`Cannot infer integer type from instance of ${t.constructor.name}`):new TypeError("Unrecognized IntVector input")}};Ke.IntVector=Or;var vd=class extends Or{};Ke.Int8Vector=vd;var wd=class extends Or{};Ke.Int16Vector=wd;var Bd=class extends Or{};Ke.Int32Vector=Bd;var Id=class extends Or{toBigInt64Array(){return Cm.toBigInt64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}};Ke.Int64Vector=Id;var Td=class extends Or{};Ke.Uint8Vector=Td;var Sd=class extends Or{};Ke.Uint16Vector=Sd;var Ad=class extends Or{};Ke.Uint32Vector=Ad;var Fd=class extends Or{toBigUint64Array(){return Cm.toBigUint64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}};Ke.Uint64Vector=Fd;var I1=(r,e)=>(r===Ce.Int64||r===Ce.Uint64)&&(e===Int32Array||e===Uint32Array),T1=(r,e)=>{switch(r){case Int8Array:return Ce.Int8;case Int16Array:return Ce.Int16;case Int32Array:return e?Ce.Int64:Ce.Int32;case km.BigInt64Array:return Ce.Int64;case Uint8Array:return Ce.Uint8;case Uint16Array:return Ce.Uint16;case Uint32Array:return e?Ce.Uint64:Ce.Uint32;case km.BigUint64Array:return Ce.Uint64;default:return null}},S1=(r,e)=>{switch(r){case vd:return Ce.Int8;case wd:return Ce.Int16;case Bd:return e?Ce.Int64:Ce.Int32;case Id:return Ce.Int64;case Td:return Ce.Uint8;case Sd:return Ce.Uint16;case Ad:return e?Ce.Uint64:Ce.Uint32;case Fd:return Ce.Uint64;default:return null}}});var Dd=w(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.ListVector=void 0;var A1=We(),jm=class extends A1.BaseVector{};yc.ListVector=jm});var Od=w(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.MapVector=void 0;var F1=Hs(),D1=He(),O1=We(),M1=fe(),qm=class extends O1.BaseVector{asList(){let e=this.type.children[0];return D1.Vector.new(this.data.clone(new M1.List(e)))}bind(e){let t=this.getChildAt(0),{[e]:n,[e+1]:i}=this.valueOffsets;return new F1.MapRow(t.slice(n,i))}};_c.MapVector=qm});var Md=w(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.NullVector=void 0;var E1=We(),Hm=class extends E1.BaseVector{};mc.NullVector=Hm});var Ed=w(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.StructVector=void 0;var U1=Hs(),x1=We(),R1=Symbol.for("rowIndex"),zm=class extends x1.BaseVector{bind(e){let t=this._row||(this._row=new U1.StructRow(this)),n=Object.create(t);return n[R1]=e,n}};bc.StructVector=zm});var Ud=w(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.TimestampNanosecondVector=jt.TimestampMicrosecondVector=jt.TimestampMillisecondVector=jt.TimestampSecondVector=jt.TimestampVector=void 0;var V1=We(),Xi=class extends V1.BaseVector{};jt.TimestampVector=Xi;var Wm=class extends Xi{};jt.TimestampSecondVector=Wm;var Ym=class extends Xi{};jt.TimestampMillisecondVector=Ym;var Gm=class extends Xi{};jt.TimestampMicrosecondVector=Gm;var $m=class extends Xi{};jt.TimestampNanosecondVector=$m});var xd=w(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.TimeNanosecondVector=qt.TimeMicrosecondVector=qt.TimeMillisecondVector=qt.TimeSecondVector=qt.TimeVector=void 0;var P1=We(),Zi=class extends P1.BaseVector{};qt.TimeVector=Zi;var Jm=class extends Zi{};qt.TimeSecondVector=Jm;var Km=class extends Zi{};qt.TimeMillisecondVector=Km;var Xm=class extends Zi{};qt.TimeMicrosecondVector=Xm;var Zm=class extends Zi{};qt.TimeNanosecondVector=Zm});var Rd=w(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.SparseUnionVector=Un.DenseUnionVector=Un.UnionVector=void 0;var L1=We(),gc=class extends L1.BaseVector{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}};Un.UnionVector=gc;var Qm=class extends gc{get valueOffsets(){return this.data.valueOffsets}};Un.DenseUnionVector=Qm;var eb=class extends gc{};Un.SparseUnionVector=eb});var Vd=w(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.Utf8Vector=void 0;var N1=He(),k1=We(),tb=fe(),C1=Fr(),rb=class extends k1.BaseVector{static from(e){return C1.vectorFromValuesWithType(()=>new tb.Utf8,e)}asBinary(){return N1.Vector.new(this.data.clone(new tb.Binary))}};vc.Utf8Vector=rb});var nb=w(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.partial2=xn.partial1=xn.partial0=void 0;function j1(r){return function(){return r(this)}}xn.partial0=j1;function q1(r){return function(e){return r(this,e)}}xn.partial1=q1;function H1(r){return function(e,t){return r(this,e,t)}}xn.partial2=H1});var Nd=w(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.instance=Qi.GetVisitor=void 0;var wc=Ls(),z1=ct(),W1=Hn(),Y1=xs(),Ht=Be(),H=class extends z1.Visitor{};Qi.GetVisitor=H;var G1=(r,e)=>864e5*r[e],Pd=(r,e)=>4294967296*r[e+1]+(r[e]>>>0),$1=(r,e)=>4294967296*(r[e+1]/1e3)+(r[e]>>>0)/1e3,J1=(r,e)=>4294967296*(r[e+1]/1e6)+(r[e]>>>0)/1e6,ib=r=>new Date(r),K1=(r,e)=>ib(G1(r,e)),X1=(r,e)=>ib(Pd(r,e)),Z1=(r,e)=>null,sb=(r,e,t)=>{let{[t]:n,[t+1]:i}=e;return n!=null&&i!=null?r.subarray(n,i):null},Q1=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!==0},ob=({values:r},e)=>K1(r,e),ab=({values:r},e)=>X1(r,e*2),Mr=({stride:r,values:e},t)=>e[r*t],cb=({stride:r,values:e},t)=>Y1.uint16ToFloat64(e[r*t]),Ld=({stride:r,values:e,type:t},n)=>wc.BN.new(e.subarray(r*n,r*(n+1)),t.isSigned),eA=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),tA=({values:r,valueOffsets:e},t)=>sb(r,e,t),rA=({values:r,valueOffsets:e},t)=>{let n=sb(r,e,t);return n!==null?W1.decodeUtf8(n):null},nA=(r,e)=>r.type.bitWidth<64?Mr(r,e):Ld(r,e),iA=(r,e)=>r.type.precision!==Ht.Precision.HALF?Mr(r,e):cb(r,e),sA=(r,e)=>r.type.unit===Ht.DateUnit.DAY?ob(r,e):ab(r,e),ub=({values:r},e)=>1e3*Pd(r,e*2),lb=({values:r},e)=>Pd(r,e*2),db=({values:r},e)=>$1(r,e*2),fb=({values:r},e)=>J1(r,e*2),oA=(r,e)=>{switch(r.type.unit){case Ht.TimeUnit.SECOND:return ub(r,e);case Ht.TimeUnit.MILLISECOND:return lb(r,e);case Ht.TimeUnit.MICROSECOND:return db(r,e);case Ht.TimeUnit.NANOSECOND:return fb(r,e)}},hb=({values:r,stride:e},t)=>r[e*t],pb=({values:r,stride:e},t)=>r[e*t],yb=({values:r},e)=>wc.BN.signed(r.subarray(2*e,2*(e+1))),_b=({values:r},e)=>wc.BN.signed(r.subarray(2*e,2*(e+1))),aA=(r,e)=>{switch(r.type.unit){case Ht.TimeUnit.SECOND:return hb(r,e);case Ht.TimeUnit.MILLISECOND:return pb(r,e);case Ht.TimeUnit.MICROSECOND:return yb(r,e);case Ht.TimeUnit.NANOSECOND:return _b(r,e)}},cA=({values:r},e)=>wc.BN.decimal(r.subarray(4*e,4*(e+1))),uA=(r,e)=>{let t=r.getChildAt(0),{valueOffsets:n,stride:i}=r;return t.slice(n[e*i],n[e*i+1])},lA=(r,e)=>r.bind(e),dA=(r,e)=>r.bind(e),fA=(r,e)=>r.type.mode===Ht.UnionMode.Dense?mb(r,e):bb(r,e),mb=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(r.valueOffsets[e]):null},bb=(r,e)=>{let t=r.typeIdToChildIndex[r.typeIds[e]],n=r.getChildAt(t);return n?n.get(e):null},hA=(r,e)=>r.getValue(r.getKey(e)),pA=(r,e)=>r.type.unit===Ht.IntervalUnit.DAY_TIME?gb(r,e):vb(r,e),gb=({values:r},e)=>r.subarray(2*e,2*(e+1)),vb=({values:r},e)=>{let t=r[e],n=new Int32Array(2);return n[0]=t/12|0,n[1]=t%12|0,n},yA=(r,e)=>{let t=r.getChildAt(0),{stride:n}=r;return t.slice(e*n,(e+1)*n)};H.prototype.visitNull=Z1;H.prototype.visitBool=Q1;H.prototype.visitInt=nA;H.prototype.visitInt8=Mr;H.prototype.visitInt16=Mr;H.prototype.visitInt32=Mr;H.prototype.visitInt64=Ld;H.prototype.visitUint8=Mr;H.prototype.visitUint16=Mr;H.prototype.visitUint32=Mr;H.prototype.visitUint64=Ld;H.prototype.visitFloat=iA;H.prototype.visitFloat16=cb;H.prototype.visitFloat32=Mr;H.prototype.visitFloat64=Mr;H.prototype.visitUtf8=rA;H.prototype.visitBinary=tA;H.prototype.visitFixedSizeBinary=eA;H.prototype.visitDate=sA;H.prototype.visitDateDay=ob;H.prototype.visitDateMillisecond=ab;H.prototype.visitTimestamp=oA;H.prototype.visitTimestampSecond=ub;H.prototype.visitTimestampMillisecond=lb;H.prototype.visitTimestampMicrosecond=db;H.prototype.visitTimestampNanosecond=fb;H.prototype.visitTime=aA;H.prototype.visitTimeSecond=hb;H.prototype.visitTimeMillisecond=pb;H.prototype.visitTimeMicrosecond=yb;H.prototype.visitTimeNanosecond=_b;H.prototype.visitDecimal=cA;H.prototype.visitList=uA;H.prototype.visitStruct=dA;H.prototype.visitUnion=fA;H.prototype.visitDenseUnion=mb;H.prototype.visitSparseUnion=bb;H.prototype.visitDictionary=hA;H.prototype.visitInterval=pA;H.prototype.visitIntervalDayTime=gb;H.prototype.visitIntervalYearMonth=vb;H.prototype.visitFixedSizeList=yA;H.prototype.visitMap=lA;Qi.instance=new H});var Tb=w(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.instance=es.IndexOfVisitor=void 0;var _A=ct(),wb=_r(),Bb=Ws(),z=class extends _A.Visitor{};es.IndexOfVisitor=z;function mA(r,e){return e===null&&r.length>0?0:-1}function bA(r,e){let{nullBitmap:t}=r.data;if(!t||r.nullCount<=0)return-1;let n=0;for(let i of new wb.BitIterator(t,r.data.offset+(e||0),r.length,t,wb.getBool)){if(!i)return n;++n}return-1}function ne(r,e,t){if(e===void 0)return-1;if(e===null)return bA(r,t);let n=Bb.createElementComparator(e);for(let i=(t||0)-1,s=r.length;++i<s;)if(n(r.get(i)))return i;return-1}function Ib(r,e,t){let n=Bb.createElementComparator(e);for(let i=(t||0)-1,s=r.length;++i<s;)if(n(r.get(i)))return i;return-1}z.prototype.visitNull=mA;z.prototype.visitBool=ne;z.prototype.visitInt=ne;z.prototype.visitInt8=ne;z.prototype.visitInt16=ne;z.prototype.visitInt32=ne;z.prototype.visitInt64=ne;z.prototype.visitUint8=ne;z.prototype.visitUint16=ne;z.prototype.visitUint32=ne;z.prototype.visitUint64=ne;z.prototype.visitFloat=ne;z.prototype.visitFloat16=ne;z.prototype.visitFloat32=ne;z.prototype.visitFloat64=ne;z.prototype.visitUtf8=ne;z.prototype.visitBinary=ne;z.prototype.visitFixedSizeBinary=ne;z.prototype.visitDate=ne;z.prototype.visitDateDay=ne;z.prototype.visitDateMillisecond=ne;z.prototype.visitTimestamp=ne;z.prototype.visitTimestampSecond=ne;z.prototype.visitTimestampMillisecond=ne;z.prototype.visitTimestampMicrosecond=ne;z.prototype.visitTimestampNanosecond=ne;z.prototype.visitTime=ne;z.prototype.visitTimeSecond=ne;z.prototype.visitTimeMillisecond=ne;z.prototype.visitTimeMicrosecond=ne;z.prototype.visitTimeNanosecond=ne;z.prototype.visitDecimal=ne;z.prototype.visitList=ne;z.prototype.visitStruct=ne;z.prototype.visitUnion=ne;z.prototype.visitDenseUnion=Ib;z.prototype.visitSparseUnion=Ib;z.prototype.visitDictionary=ne;z.prototype.visitInterval=ne;z.prototype.visitIntervalDayTime=ne;z.prototype.visitIntervalYearMonth=ne;z.prototype.visitFixedSizeList=ne;z.prototype.visitMap=ne;es.instance=new z});var kd=w(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.instance=ts.IteratorVisitor=void 0;var Bc=Be(),gA=ct(),vA=_r(),Sb=Nd(),W=class extends gA.Visitor{};ts.IteratorVisitor=W;function wA(r){let e=Sb.instance.getVisitFn(r);return new vA.BitIterator(r.data.nullBitmap,r.data.offset,r.length,r,(t,n,i,s)=>(i&1<<s)!==0?e(t,n):null)}var Ab=class{constructor(e,t){this.vector=e,this.getFn=t,this.index=0}next(){return this.index<this.vector.length?{value:this.getFn(this.vector,this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};function Q(r){if(r.nullCount>0)return wA(r);let{type:e,typeId:t,length:n}=r;return r.stride===1&&(t===Bc.Type.Timestamp||t===Bc.Type.Int&&e.bitWidth!==64||t===Bc.Type.Time&&e.bitWidth!==64||t===Bc.Type.Float&&e.precision>0)?r.data.values.subarray(0,n)[Symbol.iterator]():new Ab(r,Sb.instance.getVisitFn(r))}W.prototype.visitNull=Q;W.prototype.visitBool=Q;W.prototype.visitInt=Q;W.prototype.visitInt8=Q;W.prototype.visitInt16=Q;W.prototype.visitInt32=Q;W.prototype.visitInt64=Q;W.prototype.visitUint8=Q;W.prototype.visitUint16=Q;W.prototype.visitUint32=Q;W.prototype.visitUint64=Q;W.prototype.visitFloat=Q;W.prototype.visitFloat16=Q;W.prototype.visitFloat32=Q;W.prototype.visitFloat64=Q;W.prototype.visitUtf8=Q;W.prototype.visitBinary=Q;W.prototype.visitFixedSizeBinary=Q;W.prototype.visitDate=Q;W.prototype.visitDateDay=Q;W.prototype.visitDateMillisecond=Q;W.prototype.visitTimestamp=Q;W.prototype.visitTimestampSecond=Q;W.prototype.visitTimestampMillisecond=Q;W.prototype.visitTimestampMicrosecond=Q;W.prototype.visitTimestampNanosecond=Q;W.prototype.visitTime=Q;W.prototype.visitTimeSecond=Q;W.prototype.visitTimeMillisecond=Q;W.prototype.visitTimeMicrosecond=Q;W.prototype.visitTimeNanosecond=Q;W.prototype.visitDecimal=Q;W.prototype.visitList=Q;W.prototype.visitStruct=Q;W.prototype.visitUnion=Q;W.prototype.visitDenseUnion=Q;W.prototype.visitSparseUnion=Q;W.prototype.visitDictionary=Q;W.prototype.visitInterval=Q;W.prototype.visitIntervalDayTime=Q;W.prototype.visitIntervalYearMonth=Q;W.prototype.visitFixedSizeList=Q;W.prototype.visitMap=Q;ts.instance=new W});var Fb=w(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.instance=rs.ToArrayVisitor=void 0;var to=Be(),BA=ct(),IA=kd(),Y=class extends BA.Visitor{};rs.ToArrayVisitor=Y;function ee(r){let{type:e,length:t,stride:n}=r;switch(e.typeId){case to.Type.Int:case to.Type.Float:case to.Type.Decimal:case to.Type.Time:case to.Type.Timestamp:return r.data.values.subarray(0,t*n)}return[...IA.instance.visit(r)]}Y.prototype.visitNull=ee;Y.prototype.visitBool=ee;Y.prototype.visitInt=ee;Y.prototype.visitInt8=ee;Y.prototype.visitInt16=ee;Y.prototype.visitInt32=ee;Y.prototype.visitInt64=ee;Y.prototype.visitUint8=ee;Y.prototype.visitUint16=ee;Y.prototype.visitUint32=ee;Y.prototype.visitUint64=ee;Y.prototype.visitFloat=ee;Y.prototype.visitFloat16=ee;Y.prototype.visitFloat32=ee;Y.prototype.visitFloat64=ee;Y.prototype.visitUtf8=ee;Y.prototype.visitBinary=ee;Y.prototype.visitFixedSizeBinary=ee;Y.prototype.visitDate=ee;Y.prototype.visitDateDay=ee;Y.prototype.visitDateMillisecond=ee;Y.prototype.visitTimestamp=ee;Y.prototype.visitTimestampSecond=ee;Y.prototype.visitTimestampMillisecond=ee;Y.prototype.visitTimestampMicrosecond=ee;Y.prototype.visitTimestampNanosecond=ee;Y.prototype.visitTime=ee;Y.prototype.visitTimeSecond=ee;Y.prototype.visitTimeMillisecond=ee;Y.prototype.visitTimeMicrosecond=ee;Y.prototype.visitTimeNanosecond=ee;Y.prototype.visitDecimal=ee;Y.prototype.visitList=ee;Y.prototype.visitStruct=ee;Y.prototype.visitUnion=ee;Y.prototype.visitDenseUnion=ee;Y.prototype.visitSparseUnion=ee;Y.prototype.visitDictionary=ee;Y.prototype.visitInterval=ee;Y.prototype.visitIntervalDayTime=ee;Y.prototype.visitIntervalYearMonth=ee;Y.prototype.visitFixedSizeList=ee;Y.prototype.visitMap=ee;rs.instance=new Y});var Db=w(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.instance=ns.ByteWidthVisitor=void 0;var TA=ct(),SA=Be(),ro=(r,e)=>r+e,Cd=r=>`Cannot compute the byte width of variable-width column ${r}`,jd=class extends TA.Visitor{visitNull(e){return 0}visitInt(e){return e.bitWidth/8}visitFloat(e){return e.ArrayType.BYTES_PER_ELEMENT}visitBinary(e){throw new Error(Cd(e))}visitUtf8(e){throw new Error(Cd(e))}visitBool(e){return 1/8}visitDecimal(e){return 16}visitDate(e){return(e.unit+1)*4}visitTime(e){return e.bitWidth/8}visitTimestamp(e){return e.unit===SA.TimeUnit.SECOND?4:8}visitInterval(e){return(e.unit+1)*4}visitList(e){throw new Error(Cd(e))}visitStruct(e){return this.visitFields(e.children).reduce(ro,0)}visitUnion(e){return this.visitFields(e.children).reduce(ro,0)}visitFixedSizeBinary(e){return e.byteWidth}visitFixedSizeList(e){return e.listSize*this.visitFields(e.children).reduce(ro,0)}visitMap(e){return this.visitFields(e.children).reduce(ro,0)}visitDictionary(e){return this.visit(e.indices)}visitFields(e){return(e||[]).map(t=>this.visit(t.type))}visitSchema(e){return this.visitFields(e.fields).reduce(ro,0)}};ns.ByteWidthVisitor=jd;ns.instance=new jd});var Ob=w(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.instance=is.GetVectorConstructor=void 0;var AA=ct(),FA=ad(),DA=cd(),qd=ld(),OA=dd(),MA=lc(),EA=hd(),UA=pd(),Ic=bd(),Hd=gd(),Yr=pc(),xA=Dd(),RA=Od(),VA=Md(),PA=Ed(),no=Ud(),io=xd(),zd=Rd(),LA=Vd(),Wd=class extends AA.Visitor{visitNull(){return VA.NullVector}visitBool(){return DA.BoolVector}visitInt(){return Yr.IntVector}visitInt8(){return Yr.Int8Vector}visitInt16(){return Yr.Int16Vector}visitInt32(){return Yr.Int32Vector}visitInt64(){return Yr.Int64Vector}visitUint8(){return Yr.Uint8Vector}visitUint16(){return Yr.Uint16Vector}visitUint32(){return Yr.Uint32Vector}visitUint64(){return Yr.Uint64Vector}visitFloat(){return Ic.FloatVector}visitFloat16(){return Ic.Float16Vector}visitFloat32(){return Ic.Float32Vector}visitFloat64(){return Ic.Float64Vector}visitUtf8(){return LA.Utf8Vector}visitBinary(){return FA.BinaryVector}visitFixedSizeBinary(){return EA.FixedSizeBinaryVector}visitDate(){return qd.DateVector}visitDateDay(){return qd.DateDayVector}visitDateMillisecond(){return qd.DateMillisecondVector}visitTimestamp(){return no.TimestampVector}visitTimestampSecond(){return no.TimestampSecondVector}visitTimestampMillisecond(){return no.TimestampMillisecondVector}visitTimestampMicrosecond(){return no.TimestampMicrosecondVector}visitTimestampNanosecond(){return no.TimestampNanosecondVector}visitTime(){return io.TimeVector}visitTimeSecond(){return io.TimeSecondVector}visitTimeMillisecond(){return io.TimeMillisecondVector}visitTimeMicrosecond(){return io.TimeMicrosecondVector}visitTimeNanosecond(){return io.TimeNanosecondVector}visitDecimal(){return OA.DecimalVector}visitList(){return xA.ListVector}visitStruct(){return PA.StructVector}visitUnion(){return zd.UnionVector}visitDenseUnion(){return zd.DenseUnionVector}visitSparseUnion(){return zd.SparseUnionVector}visitDictionary(){return MA.DictionaryVector}visitInterval(){return Hd.IntervalVector}visitIntervalDayTime(){return Hd.IntervalDayTimeVector}visitIntervalYearMonth(){return Hd.IntervalYearMonthVector}visitFixedSizeList(){return UA.FixedSizeListVector}visitMap(){return RA.MapVector}};is.GetVectorConstructor=Wd;is.instance=new Wd});var Fr=w(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.vectorFromValuesWithType=I.StructRow=I.MapRow=I.Utf8Vector=I.SparseUnionVector=I.DenseUnionVector=I.UnionVector=I.TimeNanosecondVector=I.TimeMicrosecondVector=I.TimeMillisecondVector=I.TimeSecondVector=I.TimeVector=I.TimestampNanosecondVector=I.TimestampMicrosecondVector=I.TimestampMillisecondVector=I.TimestampSecondVector=I.TimestampVector=I.StructVector=I.NullVector=I.MapVector=I.ListVector=I.Uint64Vector=I.Uint32Vector=I.Uint16Vector=I.Uint8Vector=I.Int64Vector=I.Int32Vector=I.Int16Vector=I.Int8Vector=I.IntVector=I.IntervalYearMonthVector=I.IntervalDayTimeVector=I.IntervalVector=I.Float64Vector=I.Float32Vector=I.Float16Vector=I.FloatVector=I.FixedSizeListVector=I.FixedSizeBinaryVector=I.DictionaryVector=I.DecimalVector=I.DateMillisecondVector=I.DateDayVector=I.DateVector=I.Chunked=I.BoolVector=I.BinaryVector=I.BaseVector=I.Vector=void 0;var Yd=dt(),NA=He();Object.defineProperty(I,"Vector",{enumerable:!0,get:function(){return NA.Vector}});var kA=We();Object.defineProperty(I,"BaseVector",{enumerable:!0,get:function(){return kA.BaseVector}});var CA=ad();Object.defineProperty(I,"BinaryVector",{enumerable:!0,get:function(){return CA.BinaryVector}});var jA=cd();Object.defineProperty(I,"BoolVector",{enumerable:!0,get:function(){return jA.BoolVector}});var qA=Tn();Object.defineProperty(I,"Chunked",{enumerable:!0,get:function(){return qA.Chunked}});var $d=ld();Object.defineProperty(I,"DateVector",{enumerable:!0,get:function(){return $d.DateVector}});Object.defineProperty(I,"DateDayVector",{enumerable:!0,get:function(){return $d.DateDayVector}});Object.defineProperty(I,"DateMillisecondVector",{enumerable:!0,get:function(){return $d.DateMillisecondVector}});var HA=dd();Object.defineProperty(I,"DecimalVector",{enumerable:!0,get:function(){return HA.DecimalVector}});var zA=lc();Object.defineProperty(I,"DictionaryVector",{enumerable:!0,get:function(){return zA.DictionaryVector}});var WA=hd();Object.defineProperty(I,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return WA.FixedSizeBinaryVector}});var YA=pd();Object.defineProperty(I,"FixedSizeListVector",{enumerable:!0,get:function(){return YA.FixedSizeListVector}});var Sc=bd();Object.defineProperty(I,"FloatVector",{enumerable:!0,get:function(){return Sc.FloatVector}});Object.defineProperty(I,"Float16Vector",{enumerable:!0,get:function(){return Sc.Float16Vector}});Object.defineProperty(I,"Float32Vector",{enumerable:!0,get:function(){return Sc.Float32Vector}});Object.defineProperty(I,"Float64Vector",{enumerable:!0,get:function(){return Sc.Float64Vector}});var Jd=gd();Object.defineProperty(I,"IntervalVector",{enumerable:!0,get:function(){return Jd.IntervalVector}});Object.defineProperty(I,"IntervalDayTimeVector",{enumerable:!0,get:function(){return Jd.IntervalDayTimeVector}});Object.defineProperty(I,"IntervalYearMonthVector",{enumerable:!0,get:function(){return Jd.IntervalYearMonthVector}});var Gr=pc();Object.defineProperty(I,"IntVector",{enumerable:!0,get:function(){return Gr.IntVector}});Object.defineProperty(I,"Int8Vector",{enumerable:!0,get:function(){return Gr.Int8Vector}});Object.defineProperty(I,"Int16Vector",{enumerable:!0,get:function(){return Gr.Int16Vector}});Object.defineProperty(I,"Int32Vector",{enumerable:!0,get:function(){return Gr.Int32Vector}});Object.defineProperty(I,"Int64Vector",{enumerable:!0,get:function(){return Gr.Int64Vector}});Object.defineProperty(I,"Uint8Vector",{enumerable:!0,get:function(){return Gr.Uint8Vector}});Object.defineProperty(I,"Uint16Vector",{enumerable:!0,get:function(){return Gr.Uint16Vector}});Object.defineProperty(I,"Uint32Vector",{enumerable:!0,get:function(){return Gr.Uint32Vector}});Object.defineProperty(I,"Uint64Vector",{enumerable:!0,get:function(){return Gr.Uint64Vector}});var GA=Dd();Object.defineProperty(I,"ListVector",{enumerable:!0,get:function(){return GA.ListVector}});var $A=Od();Object.defineProperty(I,"MapVector",{enumerable:!0,get:function(){return $A.MapVector}});var JA=Md();Object.defineProperty(I,"NullVector",{enumerable:!0,get:function(){return JA.NullVector}});var KA=Ed();Object.defineProperty(I,"StructVector",{enumerable:!0,get:function(){return KA.StructVector}});var oo=Ud();Object.defineProperty(I,"TimestampVector",{enumerable:!0,get:function(){return oo.TimestampVector}});Object.defineProperty(I,"TimestampSecondVector",{enumerable:!0,get:function(){return oo.TimestampSecondVector}});Object.defineProperty(I,"TimestampMillisecondVector",{enumerable:!0,get:function(){return oo.TimestampMillisecondVector}});Object.defineProperty(I,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return oo.TimestampMicrosecondVector}});Object.defineProperty(I,"TimestampNanosecondVector",{enumerable:!0,get:function(){return oo.TimestampNanosecondVector}});var ao=xd();Object.defineProperty(I,"TimeVector",{enumerable:!0,get:function(){return ao.TimeVector}});Object.defineProperty(I,"TimeSecondVector",{enumerable:!0,get:function(){return ao.TimeSecondVector}});Object.defineProperty(I,"TimeMillisecondVector",{enumerable:!0,get:function(){return ao.TimeMillisecondVector}});Object.defineProperty(I,"TimeMicrosecondVector",{enumerable:!0,get:function(){return ao.TimeMicrosecondVector}});Object.defineProperty(I,"TimeNanosecondVector",{enumerable:!0,get:function(){return ao.TimeNanosecondVector}});var Kd=Rd();Object.defineProperty(I,"UnionVector",{enumerable:!0,get:function(){return Kd.UnionVector}});Object.defineProperty(I,"DenseUnionVector",{enumerable:!0,get:function(){return Kd.DenseUnionVector}});Object.defineProperty(I,"SparseUnionVector",{enumerable:!0,get:function(){return Kd.SparseUnionVector}});var XA=Vd();Object.defineProperty(I,"Utf8Vector",{enumerable:!0,get:function(){return XA.Utf8Vector}});var Ub=Hs();Object.defineProperty(I,"MapRow",{enumerable:!0,get:function(){return Ub.MapRow}});Object.defineProperty(I,"StructRow",{enumerable:!0,get:function(){return Ub.StructRow}});var so=nb(),Gd=Be(),ss=He(),Mb=Tn(),di=We(),ZA=_r(),Tc=ft(),Eb=Le(),xb=Nd(),Rb=ul(),Vb=Tb(),Pb=Fb(),Lb=kd(),Nb=Db(),kb=Ob();ss.Vector.new=QA;ss.Vector.from=tF;function QA(r,...e){return new(kb.instance.getVisitFn(r)())(r,...e)}function eF(r,e){if(Tc.isIterable(e))return ss.Vector.from({nullValues:[null,void 0],type:r(),values:e});if(Tc.isAsyncIterable(e))return ss.Vector.from({nullValues:[null,void 0],type:r(),values:e});let{values:t=[],type:n=r(),nullValues:i=[null,void 0]}=Object.assign({},e);return Tc.isIterable(t)?ss.Vector.from(Object.assign(Object.assign({nullValues:i},e),{type:n})):ss.Vector.from(Object.assign(Object.assign({nullValues:i},e),{type:n}))}I.vectorFromValuesWithType=eF;function tF(r){let e=Object.assign({nullValues:[null,void 0]},r),{values:t=[]}=e,n=Yd.__rest(e,["values"]);if(Tc.isIterable(t)){let i=[...Eb.Builder.throughIterable(n)(t)];return i.length===1?i[0]:Mb.Chunked.concat(i)}return(i=>Yd.__awaiter(this,void 0,void 0,function*(){var s,o;let u=Eb.Builder.throughAsyncIterable(n);try{for(var a=Yd.__asyncValues(u(t)),h;h=yield a.next(),!h.done;){let _=h.value;i.push(_)}}catch(_){s={error:_}}finally{try{h&&!h.done&&(o=a.return)&&(yield o.call(a))}finally{if(s)throw s.error}}return i.length===1?i[0]:Mb.Chunked.concat(i)}))([])}di.BaseVector.prototype.get=function(e){return xb.instance.visit(this,e)};di.BaseVector.prototype.set=function(e,t){return Rb.instance.visit(this,e,t)};di.BaseVector.prototype.indexOf=function(e,t){return Vb.instance.visit(this,e,t)};di.BaseVector.prototype.toArray=function(){return Pb.instance.visit(this)};di.BaseVector.prototype.getByteWidth=function(){return Nb.instance.visit(this.type)};di.BaseVector.prototype[Symbol.iterator]=function(){return Lb.instance.visit(this)};di.BaseVector.prototype._bindDataAccessors=sF;Object.keys(Gd.Type).map(r=>Gd.Type[r]).filter(r=>typeof r=="number").filter(r=>r!==Gd.Type.NONE).forEach(r=>{let e=kb.instance.visit(r);e.prototype.get=so.partial1(xb.instance.getVisitFn(r)),e.prototype.set=so.partial2(Rb.instance.getVisitFn(r)),e.prototype.indexOf=so.partial2(Vb.instance.getVisitFn(r)),e.prototype.toArray=so.partial0(Pb.instance.getVisitFn(r)),e.prototype.getByteWidth=rF(Nb.instance.getVisitFn(r)),e.prototype[Symbol.iterator]=so.partial0(Lb.instance.getVisitFn(r))});function rF(r){return function(){return r(this.type)}}function nF(r){return function(e){return this.isValid(e)?r.call(this,e):null}}function iF(r){return function(e,t){ZA.setBool(this.nullBitmap,this.offset+e,t!=null)&&r.call(this,e,t)}}function sF(){let r=this.nullBitmap;r&&r.byteLength>0&&(this.get=nF(this.get),this.set=iF(this.set))}});var Qs=w(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.Table=void 0;var Ac=dt(),oF=Wi(),aF=co(),Cb=nc(),Xd=Wr(),jb=nt(),Qd=fe(),qb=ni(),Zd=ft(),Hb=id(),ef=Fr(),et=class extends ef.Chunked{constructor(...e){var t;let n=null;e[0]instanceof jb.Schema&&(n=e[0]);let i=e[0]instanceof et?e[0].chunks:qb.selectArgs(Xd.RecordBatch,e);if(!n&&!(n=(t=i[0])===null||t===void 0?void 0:t.schema))throw new TypeError("Table must be initialized with a Schema or at least one RecordBatch");i[0]||(i[0]=new Xd._InternalEmptyPlaceholderRecordBatch(n));super(new Qd.Struct(n.fields),i);this._schema=n,this._chunks=i}static empty(e=new jb.Schema([])){return new et(e,[])}static from(e){if(!e)return et.empty();if(typeof e=="object"){let n=Zd.isIterable(e.values)?cF(e):Zd.isAsyncIterable(e.values)?uF(e):null;if(n!==null)return n}let t=aF.RecordBatchReader.from(e);return Zd.isPromise(t)?(()=>Ac.__awaiter(this,void 0,void 0,function*(){return yield et.from(yield t)}))():t.isSync()&&(t=t.open())?t.schema?new et(t.schema,[...t]):et.empty():(n=>Ac.__awaiter(this,void 0,void 0,function*(){var i,s;let o=yield n,u=o.schema,a=[];if(u){try{for(var h=Ac.__asyncValues(o),_;_=yield h.next(),!_.done;){let T=_.value;a.push(T)}}catch(T){i={error:T}}finally{try{_&&!_.done&&(s=h.return)&&(yield s.call(h))}finally{if(i)throw i.error}}return new et(u,a)}return et.empty()}))(t.open())}static fromAsync(e){return Ac.__awaiter(this,void 0,void 0,function*(){return yield et.from(e)})}static fromStruct(e){return et.new(e.data.childData,e.type.children)}static new(...e){return new et(...Hb.distributeColumnsIntoRecordBatches(qb.selectColumnArgs(e)))}get schema(){return this._schema}get length(){return this._length}get chunks(){return this._chunks}get numCols(){return this._numChildren}clone(e=this._chunks){return new et(this._schema,e)}getColumn(e){return this.getColumnAt(this.getColumnIndex(e))}getColumnAt(e){return this.getChildAt(e)}getColumnIndex(e){return this._schema.fields.findIndex(t=>t.name===e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let t,n,i=this._schema.fields,s=this._children||(this._children=[]);if(n=s[e])return n;if(t=i[e]){let o=this._chunks.map(u=>u.getChildAt(e)).filter(u=>u!=null);if(o.length>0)return s[e]=new oF.Column(t,o)}return null}serialize(e="binary",t=!0){return(t?Cb.RecordBatchStreamWriter:Cb.RecordBatchFileWriter).writeAll(this).toUint8Array(!0)}count(){return this._length}select(...e){let t=this._schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e);return new et(t,this._chunks.map(({length:n,data:{childData:i}})=>new Xd.RecordBatch(t,n,e.map(s=>i[s]).filter(Boolean))))}assign(e){let t=this._schema.fields,[n,i]=e.schema.fields.reduce((u,a,h)=>{let[_,T]=u,O=t.findIndex(E=>E.name===a.name);return~O?T[O]=h:_.push(h),u},[[],[]]),s=this._schema.assign(e.schema),o=[...t.map((u,a,h,_=i[a])=>_===void 0?this.getColumnAt(a):e.getColumnAt(_)),...n.map(u=>e.getColumnAt(u))].filter(Boolean);return new et(...Hb.distributeVectorsIntoRecordBatches(s,o))}};Fc.Table=et;function cF(r){let{type:e}=r;return e instanceof Qd.Struct?et.fromStruct(ef.StructVector.from(r)):null}function uF(r){let{type:e}=r;return e instanceof Qd.Struct?ef.StructVector.from(r).then(t=>et.fromStruct(t)):null}});var Wr=w(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os._InternalEmptyPlaceholderRecordBatch=os.RecordBatch=void 0;var rf=Qt(),tf=Qs(),lF=He(),dF=ct(),fF=nt(),hF=ft(),pF=Tn(),yF=ni(),nf=fe(),_F=id(),mF=Fr(),Rn=class extends mF.StructVector{constructor(...e){let t,n=e[0],i;if(e[1]instanceof rf.Data)[,t,i]=e;else{let s=n.fields,[,o,u]=e;t=rf.Data.Struct(new nf.Struct(s),0,o,0,null,u)}super(t,i);this._schema=n}static from(e){return hF.isIterable(e.values),tf.Table.from(e)}static new(...e){let[t,n]=yF.selectFieldArgs(e),i=n.filter(s=>s instanceof lF.Vector);return new Rn(..._F.ensureSameLengthData(new fF.Schema(t),i.map(s=>s.data)))}clone(e,t=this._children){return new Rn(this._schema,e,t)}concat(...e){let t=this._schema,n=pF.Chunked.flatten(this,...e);return new tf.Table(t,n.map(({data:i})=>new Rn(t,i)))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=Dc.collect(this))}select(...e){let t=this._schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(...e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(...e){let t=this._schema.selectAt(...e),n=e.map(i=>this.data.childData[i]).filter(Boolean);return new Rn(t,this.length,n)}};os.RecordBatch=Rn;var zb=class extends Rn{constructor(e){super(e,0,e.fields.map(t=>rf.Data.new(t.type,0,0,0)))}};os._InternalEmptyPlaceholderRecordBatch=zb;var Dc=class extends dF.Visitor{constructor(){super(...arguments);this.dictionaries=new Map}static collect(e){return new Dc().visit(e.data,new nf.Struct(e.schema.fields)).dictionaries}visit(e,t){return nf.DataType.isDictionary(t)?this.visitDictionary(e,t):(e.childData.forEach((n,i)=>this.visit(n,t.children[i].type)),this)}visitDictionary(e,t){let n=e.dictionary;return n&&n.length>0&&this.dictionaries.set(t.id,n),this}}});var co=w(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.AsyncRecordBatchFileReader=Wt.RecordBatchFileReader=Wt.AsyncRecordBatchStreamReader=Wt.RecordBatchStreamReader=Wt.RecordBatchReader=void 0;var Ae=dt(),Wb=He(),Oc=Be(),Kb=vl(),Yb=Es(),Gb=vn(),uo=Il(),Xb=F_(),sf=Wr(),fi=bi(),Yt=Ya(),zt=ft(),Er=class extends fi.ReadableInterop{constructor(e){super();this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let t=this._impl.open(e);return zt.isPromise(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Yb.default.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Yb.default.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}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')}static from(e){return e instanceof Er?e:zt.isArrowJSON(e)?bF(e):zt.isFileHandle(e)?wF(e):zt.isPromise(e)?(()=>Ae.__awaiter(this,void 0,void 0,function*(){return yield Er.from(yield e)}))():zt.isFetchResponse(e)||zt.isReadableDOMStream(e)||zt.isReadableNodeStream(e)||zt.isAsyncIterable(e)?vF(new Gb.AsyncByteStream(e)):gF(new Gb.ByteStream(e))}static readAll(e){return e instanceof Er?e.isSync()?$b(e):Jb(e):zt.isArrowJSON(e)||ArrayBuffer.isView(e)||zt.isIterable(e)||zt.isIteratorResult(e)?$b(e):Jb(e)}};Wt.RecordBatchReader=Er;var as=class extends Er{constructor(e){super(e);this._impl=e}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Ae.__asyncGenerator(this,arguments,function*(){yield Ae.__await(yield*Ae.__asyncDelegator(Ae.__asyncValues(this[Symbol.iterator]())))})}};Wt.RecordBatchStreamReader=as;var cs=class extends Er{constructor(e){super(e);this._impl=e}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}};Wt.AsyncRecordBatchStreamReader=cs;var Mc=class extends as{constructor(e){super(e);this._impl=e}};Wt.RecordBatchFileReader=Mc;var of=class extends cs{constructor(e){super(e);this._impl=e}};Wt.AsyncRecordBatchFileReader=of;var af=class{constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}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){return new sf.RecordBatch(this.schema,e.length,this._loadVectors(e,t,this.schema.fields))}_loadDictionaryBatch(e,t){let{id:n,isDelta:i,data:s}=e,{dictionaries:o,schema:u}=this,a=o.get(n);if(i||!a){let h=u.dictionaries.get(n);return a&&i?a.concat(Wb.Vector.new(this._loadVectors(s,t,[h])[0])):Wb.Vector.new(this._loadVectors(s,t,[h])[0])}return a}_loadVectors(e,t,n){return new Xb.VectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}},lo=class extends af{constructor(e,t){super(t);this._reader=zt.isArrowJSON(e)?new Yt.JSONMessageReader(this._handle=e):new Yt.MessageReader(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=eg(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):fi.ITERATOR_DONE}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):fi.ITERATOR_DONE}next(){if(this.closed)return fi.ITERATOR_DONE;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),s=this._loadRecordBatch(n,i);return{done:!1,value:s}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=t.readMessageBody(e.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new sf._InternalEmptyPlaceholderRecordBatch(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},fo=class extends af{constructor(e,t){super(t);this._reader=new Yt.AsyncMessageReader(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Ae.__awaiter(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 Ae.__awaiter(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=eg(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return Ae.__awaiter(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):fi.ITERATOR_DONE})}return(e){return Ae.__awaiter(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):fi.ITERATOR_DONE})}next(){return Ae.__awaiter(this,void 0,void 0,function*(){if(this.closed)return fi.ITERATOR_DONE;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 n=e.header(),i=yield t.readMessageBody(e.bodyLength),s=this._loadRecordBatch(n,i);return{done:!1,value:s}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=yield t.readMessageBody(e.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new sf._InternalEmptyPlaceholderRecordBatch(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return Ae.__awaiter(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},cf=class extends lo{constructor(e,t){super(e instanceof uo.RandomAccessFile?e:new uo.RandomAccessFile(e),t)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}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){if(this.closed)return null;this._footer||this.open();let t=this._footer&&this._footer.getRecordBatch(e);if(t&&this._handle.seek(t.offset)){let n=this._reader.readMessage(Oc.MessageHeader.RecordBatch);if(n==null?void 0:n.isRecordBatch()){let i=n.header(),s=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,s)}}return null}_readDictionaryBatch(e){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&this._handle.seek(t.offset)){let n=this._reader.readMessage(Oc.MessageHeader.DictionaryBatch);if(n==null?void 0:n.isDictionaryBatch()){let i=n.header(),s=this._reader.readMessageBody(n.bodyLength),o=this._loadDictionaryBatch(i,s);this.dictionaries.set(i.id,o)}}}_readFooter(){let{_handle:e}=this,t=e.size-Yt.magicAndPadding,n=e.readInt32(t),i=e.readAt(t-n,n);return Kb.Footer.decode(i)}_readNextMessageAndValidate(e){if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer&&this._footer.getRecordBatch(this._recordBatchIndex);if(t&&this._handle.seek(t.offset))return this._reader.readMessage(e)}return null}},Zb=class extends fo{constructor(e,...t){let n=typeof t[0]!="number"?t.shift():void 0,i=t[0]instanceof Map?t.shift():void 0;super(e instanceof uo.AsyncRandomAccessFile?e:new uo.AsyncRandomAccessFile(e,n),i)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}open(e){let t=Object.create(null,{open:{get:()=>super.open}});return Ae.__awaiter(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return Ae.__awaiter(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());let t=this._footer&&this._footer.getRecordBatch(e);if(t&&(yield this._handle.seek(t.offset))){let n=yield this._reader.readMessage(Oc.MessageHeader.RecordBatch);if(n==null?void 0:n.isRecordBatch()){let i=n.header(),s=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,s)}}return null})}_readDictionaryBatch(e){return Ae.__awaiter(this,void 0,void 0,function*(){let t=this._footer&&this._footer.getDictionaryBatch(e);if(t&&(yield this._handle.seek(t.offset))){let n=yield this._reader.readMessage(Oc.MessageHeader.DictionaryBatch);if(n==null?void 0:n.isDictionaryBatch()){let i=n.header(),s=yield this._reader.readMessageBody(n.bodyLength),o=this._loadDictionaryBatch(i,s);this.dictionaries.set(i.id,o)}}})}_readFooter(){return Ae.__awaiter(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Yt.magicAndPadding,n=yield e.readInt32(t),i=yield e.readAt(t-n,n);return Kb.Footer.decode(i)})}_readNextMessageAndValidate(e){return Ae.__awaiter(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}},Qb=class extends lo{constructor(e,t){super(e,t)}_loadVectors(e,t,n){return new Xb.JSONVectorLoader(t,e.nodes,e.buffers,this.dictionaries).visitMany(n)}};function eg(r,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:r.autoDestroy}function*$b(r){let e=Er.from(r);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function Jb(r){return Ae.__asyncGenerator(this,arguments,function*(){let t=yield Ae.__await(Er.from(r));try{if(!(yield Ae.__await(t.open({autoDestroy:!1}))).closed)do yield yield Ae.__await(t);while(!(yield Ae.__await(t.reset().open())).closed)}finally{yield Ae.__await(t.cancel())}})}function bF(r){return new as(new Qb(r))}function gF(r){let e=r.peek(Yt.magicLength+7&-8);return e&&e.byteLength>=4?Yt.checkForMagicArrowString(e)?new Mc(new cf(r.read())):new as(new lo(r)):new as(new lo(function*(){}()))}function vF(r){return Ae.__awaiter(this,void 0,void 0,function*(){let e=yield r.peek(Yt.magicLength+7&-8);return e&&e.byteLength>=4?Yt.checkForMagicArrowString(e)?new Mc(new cf(yield r.read())):new cs(new fo(r)):new cs(new fo(function(){return Ae.__asyncGenerator(this,arguments,function*(){})}()))})}function wF(r){return Ae.__awaiter(this,void 0,void 0,function*(){let{size:e}=yield r.stat(),t=new uo.AsyncRandomAccessFile(r,e);return e>=Yt.magicX2AndPadding&&Yt.checkForMagicArrowString(yield t.readAt(0,Yt.magicLength+7&-8))?new of(new Zb(t)):new cs(new fo(t))})}});var ng=w(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.toDOMStream=void 0;var Ec=dt(),rg=Xe(),tg=ft();function BF(r,e){if(tg.isAsyncIterable(r))return TF(r,e);if(tg.isIterable(r))return IF(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}Uc.toDOMStream=BF;function IF(r,e){let t=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){s(o,t||(t=r[Symbol.iterator]()))},pull(o){t?s(o,t):o.close()},cancel(){((t==null?void 0:t.return)&&t.return()||!0)&&(t=null)}}),Object.assign({highWaterMark:n?i:void 0},e));function s(o,u){let a,h=null,_=o.desiredSize||null;for(;!(h=u.next(n?_:null)).done;)if(ArrayBuffer.isView(h.value)&&(a=rg.toUint8Array(h.value))&&(_!=null&&n&&(_=_-a.byteLength+1),h.value=a),o.enqueue(h.value),_!=null&&--_<=0)return;o.close()}}function TF(r,e){let t=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){return Ec.__awaiter(this,void 0,void 0,function*(){yield s(o,t||(t=r[Symbol.asyncIterator]()))})},pull(o){return Ec.__awaiter(this,void 0,void 0,function*(){t?yield s(o,t):o.close()})},cancel(){return Ec.__awaiter(this,void 0,void 0,function*(){((t==null?void 0:t.return)&&(yield t.return())||!0)&&(t=null)})}}),Object.assign({highWaterMark:n?i:void 0},e));function s(o,u){return Ec.__awaiter(this,void 0,void 0,function*(){let a,h=null,_=o.desiredSize||null;for(;!(h=yield u.next(n?_:null)).done;)if(ArrayBuffer.isView(h.value)&&(a=rg.toUint8Array(h.value))&&(_!=null&&n&&(_=_-a.byteLength+1),h.value=a),o.enqueue(h.value),_!=null&&--_<=0)return;o.close()})}}});var og=w(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.BuilderTransform=us.builderThroughDOMStream=void 0;var SF=dt(),AF=Ua();function FF(r){return new uf(r)}us.builderThroughDOMStream=FF;var uf=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=e,s=SF.__rest(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=AF.Builder.new(s),this._getSize=i!=="bytes"?ig:sg;let{["highWaterMark"]:o=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:u=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:a=>{this._maybeFlush(this._builder,this._controller=a)},start:a=>{this._maybeFlush(this._builder,this._controller=a)}},{highWaterMark:o,size:i!=="bytes"?ig:sg}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:u,size:a=>this._writeValueAndReturnChunkSize(a)})}_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)}};us.BuilderTransform=uf;var ig=r=>r.length,sg=r=>r.byteLength});var ag=w(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.recordBatchReaderThroughDOMStream=void 0;var ho=dt(),DF=vn(),OF=co();function MF(r,e){let t=new DF.AsyncByteQueue,n=null,i=new ReadableStream({cancel(){return ho.__awaiter(this,void 0,void 0,function*(){yield t.close()})},start(u){return ho.__awaiter(this,void 0,void 0,function*(){yield o(u,n||(n=yield s()))})},pull(u){return ho.__awaiter(this,void 0,void 0,function*(){n?yield o(u,n):u.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},r)),readable:i};function s(){return ho.__awaiter(this,void 0,void 0,function*(){return yield(yield OF.RecordBatchReader.from(t)).open(e)})}function o(u,a){return ho.__awaiter(this,void 0,void 0,function*(){let h=u.desiredSize,_=null;for(;!(_=yield a.next()).done;)if(u.enqueue(_.value),h!=null&&--h<=0)return;u.close()})}}xc.recordBatchReaderThroughDOMStream=MF});var cg=w(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.recordBatchWriterThroughDOMStream=void 0;var Rc=dt(),EF=vn();function UF(r,e){let t=new this(r),n=new EF.AsyncByteStream(t),i=new ReadableStream({type:"bytes",cancel(){return Rc.__awaiter(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return Rc.__awaiter(this,void 0,void 0,function*(){yield s(o)})},start(o){return Rc.__awaiter(this,void 0,void 0,function*(){yield s(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,r),readable:i};function s(o){return Rc.__awaiter(this,void 0,void 0,function*(){let u=null,a=o.desiredSize;for(;u=yield n.read(a||null);)if(o.enqueue(u),a!=null&&(a-=u.byteLength)<=0)return;o.close()})}}Vc.recordBatchWriterThroughDOMStream=UF});var yf=w(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.custom=oe.or=oe.and=oe.col=oe.lit=oe.CustomPredicate=oe.Not=oe.GTeq=oe.LTeq=oe.Equals=oe.Or=oe.And=oe.CombinationPredicate=oe.ComparisonPredicate=oe.Predicate=oe.Col=oe.Literal=oe.Value=void 0;var xF=lc(),Vn=class{eq(e){return e instanceof Vn||(e=new $r(e)),new df(this,e)}le(e){return e instanceof Vn||(e=new $r(e)),new ff(this,e)}ge(e){return e instanceof Vn||(e=new $r(e)),new hf(this,e)}lt(e){return new ls(this.ge(e))}gt(e){return new ls(this.le(e))}ne(e){return new ls(this.eq(e))}};oe.Value=Vn;var $r=class extends Vn{constructor(e){super();this.v=e}};oe.Literal=$r;var lf=class extends Vn{constructor(e){super();this.name=e}bind(e){if(!this.colidx){this.colidx=-1;let n=e.schema.fields;for(let i=-1;++i<n.length;)if(n[i].name===this.name){this.colidx=i;break}if(this.colidx<0)throw new Error(`Failed to bind Col "${this.name}"`)}let t=this.vector=e.getChildAt(this.colidx);return n=>t.get(n)}};oe.Col=lf;var ds=class{and(...e){return new fs(this,...e)}or(...e){return new hs(this,...e)}not(){return new ls(this)}};oe.Predicate=ds;var po=class extends ds{constructor(e,t){super();this.left=e,this.right=t}bind(e){return this.left instanceof $r?this.right instanceof $r?this._bindLitLit(e,this.left,this.right):this._bindLitCol(e,this.left,this.right):this.right instanceof $r?this._bindColLit(e,this.left,this.right):this._bindColCol(e,this.left,this.right)}};oe.ComparisonPredicate=po;var yo=class extends ds{constructor(...e){super();this.children=e}};oe.CombinationPredicate=yo;yo.prototype.children=Object.freeze([]);var fs=class extends yo{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof fs?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.every(s=>s(n,i))}};oe.And=fs;var hs=class extends yo{constructor(...e){e=e.reduce((t,n)=>t.concat(n instanceof hs?n.children:n),[]);super(...e)}bind(e){let t=this.children.map(n=>n.bind(e));return(n,i)=>t.some(s=>s(n,i))}};oe.Or=hs;var df=class extends po{_bindLitLit(e,t,n){let i=t.v==n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(o,u)=>i(o,u)==s(o,u)}_bindColLit(e,t,n){let i=t.bind(e);if(t.vector instanceof xF.DictionaryVector){let s,o=t.vector;return o.dictionary!==this.lastDictionary?(s=o.reverseLookup(n.v),this.lastDictionary=o.dictionary,this.lastKey=s):s=this.lastKey,s===-1?()=>!1:u=>o.getKey(u)===s}else return(s,o)=>i(s,o)==n.v}_bindLitCol(e,t,n){return this._bindColLit(e,n,t)}};oe.Equals=df;var ff=class extends po{_bindLitLit(e,t,n){let i=t.v<=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(o,u)=>i(o,u)<=s(o,u)}_bindColLit(e,t,n){let i=t.bind(e);return(s,o)=>i(s,o)<=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(s,o)=>t.v<=i(s,o)}};oe.LTeq=ff;var hf=class extends po{_bindLitLit(e,t,n){let i=t.v>=n.v;return()=>i}_bindColCol(e,t,n){let i=t.bind(e),s=n.bind(e);return(o,u)=>i(o,u)>=s(o,u)}_bindColLit(e,t,n){let i=t.bind(e);return(s,o)=>i(s,o)>=n.v}_bindLitCol(e,t,n){let i=n.bind(e);return(s,o)=>t.v>=i(s,o)}};oe.GTeq=hf;var ls=class extends ds{constructor(e){super();this.child=e}bind(e){let t=this.child.bind(e);return(n,i)=>!t(n,i)}};oe.Not=ls;var pf=class extends ds{constructor(e,t){super();this.next=e,this.bind_=t}bind(e){return this.bind_(e),this.next}};oe.CustomPredicate=pf;function RF(r){return new $r(r)}oe.lit=RF;function VF(r){return new lf(r)}oe.col=VF;function PF(...r){return new fs(...r)}oe.and=PF;function LF(...r){return new hs(...r)}oe.or=LF;function NF(r,e){return new pf(r,e)}oe.custom=NF});var pg=w(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.FilteredDataFrame=Pn.CountByResult=Pn.DataFrame=void 0;var ug=Qs(),lg=pc(),_f=nt(),dg=yf(),kF=Wr(),fg=fe(),mf=class extends ug.Table{filter(e){return new _o(this.chunks,e)}scan(e,t){let n=this.chunks,i=n.length;for(let s=-1;++s<i;){let o=n[s];t&&t(o);for(let u=-1,a=o.length;++u<a;)e(u,o)}}scanReverse(e,t){let n=this.chunks,i=n.length;for(let s=i;--s>=0;){let o=n[s];t&&t(o);for(let u=o.length;--u>=0;)e(u,o)}}countBy(e){let t=this.chunks,n=t.length,i=typeof e=="string"?new dg.Col(e):e;i.bind(t[n-1]);let s=i.vector;if(!fg.DataType.isDictionary(s.type))throw new Error("countBy currently only supports dictionary-encoded columns");let o=Math.ceil(Math.log(s.length)/Math.log(256)),u=o==4?Uint32Array:o>=2?Uint16Array:Uint8Array,a=new u(s.dictionary.length);for(let h=-1;++h<n;){let _=t[h];i.bind(_);let T=i.vector.indices;for(let O=-1,E=_.length;++O<E;){let re=T.get(O);re!==null&&a[re]++}}return new Pc(s.dictionary,lg.IntVector.from(a))}};Pn.DataFrame=mf;var Pc=class extends ug.Table{constructor(e,t){let n=new _f.Schema([new _f.Field("values",e.type),new _f.Field("counts",t.type)]);super(new kF.RecordBatch(n,t.length,[e,t]))}toJSON(){let e=this.getColumnAt(0),t=this.getColumnAt(1),n={};for(let i=-1;++i<this.length;)n[e.get(i)]=t.get(i);return n}};Pn.CountByResult=Pc;var hg=class{constructor(e,t){this.batches=e,this.predicate=t,this.batchIndex=0,this.index=0,this.batch=this.batches[this.batchIndex],this.predicateFunc=this.predicate.bind(this.batch)}next(){for(;this.batchIndex<this.batches.length;){for(;this.index<this.batch.length;){if(this.predicateFunc(this.index,this.batch))return{value:this.batch.get(this.index++)};this.index++}++this.batchIndex<this.batches.length&&(this.index=0,this.batch=this.batches[this.batchIndex],this.predicateFunc=this.predicate.bind(this.batch))}return{done:!0,value:null}}[Symbol.iterator](){return this}},_o=class extends mf{constructor(e,t){super(e);this._predicate=t}scan(e,t){let n=this._chunks,i=n.length;for(let s=-1;++s<i;){let o=n[s],u=this._predicate.bind(o),a=!1;for(let h=-1,_=o.length;++h<_;)u(h,o)&&(t&&!a&&(t(o),a=!0),e(h,o))}}scanReverse(e,t){let n=this._chunks,i=n.length;for(let s=i;--s>=0;){let o=n[s],u=this._predicate.bind(o),a=!1;for(let h=o.length;--h>=0;)u(h,o)&&(t&&!a&&(t(o),a=!0),e(h,o))}}count(){let e=0,t=this._chunks,n=t.length;for(let i=-1;++i<n;){let s=t[i],o=this._predicate.bind(s);for(let u=-1,a=s.length;++u<a;)o(u,s)&&++e}return e}[Symbol.iterator](){return new hg(this._chunks,this._predicate)}filter(e){return new _o(this._chunks,this._predicate.and(e))}countBy(e){let t=this._chunks,n=t.length,i=typeof e=="string"?new dg.Col(e):e;i.bind(t[n-1]);let s=i.vector;if(!fg.DataType.isDictionary(s.type))throw new Error("countBy currently only supports dictionary-encoded columns");let o=Math.ceil(Math.log(s.length)/Math.log(256)),u=o==4?Uint32Array:o>=2?Uint16Array:Uint8Array,a=new u(s.dictionary.length);for(let h=-1;++h<n;){let _=t[h],T=this._predicate.bind(_);i.bind(_);let O=i.vector.indices;for(let E=-1,re=_.length;++E<re;){let te=O.get(E);te!==null&&T(E,_)&&a[te]++}}return new Pc(s.dictionary,lg.IntVector.from(a))}};Pn.FilteredDataFrame=_o});var mg=w(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.isTypedArray=f.util=f.predicate=f.CountByResult=f.FilteredDataFrame=f.DataFrame=f.RecordBatch=f.Message=f.JSONMessageReader=f.AsyncMessageReader=f.MessageReader=f.RecordBatchJSONWriter=f.RecordBatchStreamWriter=f.RecordBatchFileWriter=f.RecordBatchWriter=f.AsyncRecordBatchStreamReader=f.AsyncRecordBatchFileReader=f.RecordBatchStreamReader=f.RecordBatchFileReader=f.RecordBatchReader=f.AsyncByteQueue=f.AsyncByteStream=f.ByteStream=f.Utf8Builder=f.SparseUnionBuilder=f.DenseUnionBuilder=f.UnionBuilder=f.TimeNanosecondBuilder=f.TimeMicrosecondBuilder=f.TimeMillisecondBuilder=f.TimeSecondBuilder=f.TimeBuilder=f.TimestampNanosecondBuilder=f.TimestampMicrosecondBuilder=f.TimestampMillisecondBuilder=f.TimestampSecondBuilder=f.TimestampBuilder=f.StructBuilder=f.NullBuilder=f.MapBuilder=f.ListBuilder=f.Uint64Builder=f.Uint32Builder=f.Uint16Builder=f.Uint8Builder=f.Int64Builder=f.Int32Builder=f.Int16Builder=f.Int8Builder=f.IntBuilder=f.IntervalYearMonthBuilder=f.IntervalDayTimeBuilder=f.IntervalBuilder=f.Float64Builder=f.Float32Builder=f.Float16Builder=f.FloatBuilder=f.FixedSizeListBuilder=f.FixedSizeBinaryBuilder=f.DictionaryBuilder=f.DecimalBuilder=f.DateMillisecondBuilder=f.DateDayBuilder=f.DateBuilder=f.BoolBuilder=f.BinaryBuilder=f.Builder=f.Utf8Vector=f.SparseUnionVector=f.DenseUnionVector=f.UnionVector=f.TimeNanosecondVector=f.TimeMicrosecondVector=f.TimeMillisecondVector=f.TimeSecondVector=f.TimeVector=f.TimestampNanosecondVector=f.TimestampMicrosecondVector=f.TimestampMillisecondVector=f.TimestampSecondVector=f.TimestampVector=f.StructVector=f.NullVector=f.MapVector=f.ListVector=f.Uint64Vector=f.Uint32Vector=f.Uint16Vector=f.Uint8Vector=f.Int64Vector=f.Int32Vector=f.Int16Vector=f.Int8Vector=f.IntVector=f.IntervalYearMonthVector=f.IntervalDayTimeVector=f.IntervalVector=f.Float64Vector=f.Float32Vector=f.Float16Vector=f.FloatVector=f.FixedSizeListVector=f.FixedSizeBinaryVector=f.DictionaryVector=f.DecimalVector=f.DateMillisecondVector=f.DateDayVector=f.DateVector=f.Chunked=f.BoolVector=f.BinaryVector=f.BaseVector=f.Vector=f.Field=f.Schema=f.Visitor=f.Column=f.Table=f.Map_=f.FixedSizeList=f.IntervalYearMonth=f.IntervalDayTime=f.Interval=f.Dictionary=f.SparseUnion=f.DenseUnion=f.Union=f.Struct=f.List=f.Decimal=f.TimeNanosecond=f.TimeMicrosecond=f.TimeMillisecond=f.TimeSecond=f.Time=f.TimestampNanosecond=f.TimestampMicrosecond=f.TimestampMillisecond=f.TimestampSecond=f.Timestamp=f.DateMillisecond=f.DateDay=f.Date_=f.FixedSizeBinary=f.Binary=f.Utf8=f.Float64=f.Float32=f.Float16=f.Float=f.Uint64=f.Uint32=f.Uint16=f.Uint8=f.Int64=f.Int32=f.Int16=f.Int8=f.Int=f.Bool=f.Null=f.DataType=f.Data=f.BufferType=f.Type=f.MessageHeader=f.MetadataVersion=f.IntervalUnit=f.UnionMode=f.Precision=f.TimeUnit=f.DateUnit=void 0;var ps=an();Object.defineProperty(f,"DateUnit",{enumerable:!0,get:function(){return ps.DateUnit}});Object.defineProperty(f,"TimeUnit",{enumerable:!0,get:function(){return ps.TimeUnit}});Object.defineProperty(f,"Precision",{enumerable:!0,get:function(){return ps.Precision}});Object.defineProperty(f,"UnionMode",{enumerable:!0,get:function(){return ps.UnionMode}});Object.defineProperty(f,"IntervalUnit",{enumerable:!0,get:function(){return ps.IntervalUnit}});Object.defineProperty(f,"MetadataVersion",{enumerable:!0,get:function(){return ps.MetadataVersion}});var CF=Yo();Object.defineProperty(f,"MessageHeader",{enumerable:!0,get:function(){return CF.MessageHeader}});var yg=Be();Object.defineProperty(f,"Type",{enumerable:!0,get:function(){return yg.Type}});Object.defineProperty(f,"BufferType",{enumerable:!0,get:function(){return yg.BufferType}});var jF=Qt();Object.defineProperty(f,"Data",{enumerable:!0,get:function(){return jF.Data}});var X=fe();Object.defineProperty(f,"DataType",{enumerable:!0,get:function(){return X.DataType}});Object.defineProperty(f,"Null",{enumerable:!0,get:function(){return X.Null}});Object.defineProperty(f,"Bool",{enumerable:!0,get:function(){return X.Bool}});Object.defineProperty(f,"Int",{enumerable:!0,get:function(){return X.Int}});Object.defineProperty(f,"Int8",{enumerable:!0,get:function(){return X.Int8}});Object.defineProperty(f,"Int16",{enumerable:!0,get:function(){return X.Int16}});Object.defineProperty(f,"Int32",{enumerable:!0,get:function(){return X.Int32}});Object.defineProperty(f,"Int64",{enumerable:!0,get:function(){return X.Int64}});Object.defineProperty(f,"Uint8",{enumerable:!0,get:function(){return X.Uint8}});Object.defineProperty(f,"Uint16",{enumerable:!0,get:function(){return X.Uint16}});Object.defineProperty(f,"Uint32",{enumerable:!0,get:function(){return X.Uint32}});Object.defineProperty(f,"Uint64",{enumerable:!0,get:function(){return X.Uint64}});Object.defineProperty(f,"Float",{enumerable:!0,get:function(){return X.Float}});Object.defineProperty(f,"Float16",{enumerable:!0,get:function(){return X.Float16}});Object.defineProperty(f,"Float32",{enumerable:!0,get:function(){return X.Float32}});Object.defineProperty(f,"Float64",{enumerable:!0,get:function(){return X.Float64}});Object.defineProperty(f,"Utf8",{enumerable:!0,get:function(){return X.Utf8}});Object.defineProperty(f,"Binary",{enumerable:!0,get:function(){return X.Binary}});Object.defineProperty(f,"FixedSizeBinary",{enumerable:!0,get:function(){return X.FixedSizeBinary}});Object.defineProperty(f,"Date_",{enumerable:!0,get:function(){return X.Date_}});Object.defineProperty(f,"DateDay",{enumerable:!0,get:function(){return X.DateDay}});Object.defineProperty(f,"DateMillisecond",{enumerable:!0,get:function(){return X.DateMillisecond}});Object.defineProperty(f,"Timestamp",{enumerable:!0,get:function(){return X.Timestamp}});Object.defineProperty(f,"TimestampSecond",{enumerable:!0,get:function(){return X.TimestampSecond}});Object.defineProperty(f,"TimestampMillisecond",{enumerable:!0,get:function(){return X.TimestampMillisecond}});Object.defineProperty(f,"TimestampMicrosecond",{enumerable:!0,get:function(){return X.TimestampMicrosecond}});Object.defineProperty(f,"TimestampNanosecond",{enumerable:!0,get:function(){return X.TimestampNanosecond}});Object.defineProperty(f,"Time",{enumerable:!0,get:function(){return X.Time}});Object.defineProperty(f,"TimeSecond",{enumerable:!0,get:function(){return X.TimeSecond}});Object.defineProperty(f,"TimeMillisecond",{enumerable:!0,get:function(){return X.TimeMillisecond}});Object.defineProperty(f,"TimeMicrosecond",{enumerable:!0,get:function(){return X.TimeMicrosecond}});Object.defineProperty(f,"TimeNanosecond",{enumerable:!0,get:function(){return X.TimeNanosecond}});Object.defineProperty(f,"Decimal",{enumerable:!0,get:function(){return X.Decimal}});Object.defineProperty(f,"List",{enumerable:!0,get:function(){return X.List}});Object.defineProperty(f,"Struct",{enumerable:!0,get:function(){return X.Struct}});Object.defineProperty(f,"Union",{enumerable:!0,get:function(){return X.Union}});Object.defineProperty(f,"DenseUnion",{enumerable:!0,get:function(){return X.DenseUnion}});Object.defineProperty(f,"SparseUnion",{enumerable:!0,get:function(){return X.SparseUnion}});Object.defineProperty(f,"Dictionary",{enumerable:!0,get:function(){return X.Dictionary}});Object.defineProperty(f,"Interval",{enumerable:!0,get:function(){return X.Interval}});Object.defineProperty(f,"IntervalDayTime",{enumerable:!0,get:function(){return X.IntervalDayTime}});Object.defineProperty(f,"IntervalYearMonth",{enumerable:!0,get:function(){return X.IntervalYearMonth}});Object.defineProperty(f,"FixedSizeList",{enumerable:!0,get:function(){return X.FixedSizeList}});Object.defineProperty(f,"Map_",{enumerable:!0,get:function(){return X.Map_}});var qF=Qs();Object.defineProperty(f,"Table",{enumerable:!0,get:function(){return qF.Table}});var HF=Wi();Object.defineProperty(f,"Column",{enumerable:!0,get:function(){return HF.Column}});var zF=ct();Object.defineProperty(f,"Visitor",{enumerable:!0,get:function(){return zF.Visitor}});var _g=nt();Object.defineProperty(f,"Schema",{enumerable:!0,get:function(){return _g.Schema}});Object.defineProperty(f,"Field",{enumerable:!0,get:function(){return _g.Field}});var G=Fr();Object.defineProperty(f,"Vector",{enumerable:!0,get:function(){return G.Vector}});Object.defineProperty(f,"BaseVector",{enumerable:!0,get:function(){return G.BaseVector}});Object.defineProperty(f,"BinaryVector",{enumerable:!0,get:function(){return G.BinaryVector}});Object.defineProperty(f,"BoolVector",{enumerable:!0,get:function(){return G.BoolVector}});Object.defineProperty(f,"Chunked",{enumerable:!0,get:function(){return G.Chunked}});Object.defineProperty(f,"DateVector",{enumerable:!0,get:function(){return G.DateVector}});Object.defineProperty(f,"DateDayVector",{enumerable:!0,get:function(){return G.DateDayVector}});Object.defineProperty(f,"DateMillisecondVector",{enumerable:!0,get:function(){return G.DateMillisecondVector}});Object.defineProperty(f,"DecimalVector",{enumerable:!0,get:function(){return G.DecimalVector}});Object.defineProperty(f,"DictionaryVector",{enumerable:!0,get:function(){return G.DictionaryVector}});Object.defineProperty(f,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return G.FixedSizeBinaryVector}});Object.defineProperty(f,"FixedSizeListVector",{enumerable:!0,get:function(){return G.FixedSizeListVector}});Object.defineProperty(f,"FloatVector",{enumerable:!0,get:function(){return G.FloatVector}});Object.defineProperty(f,"Float16Vector",{enumerable:!0,get:function(){return G.Float16Vector}});Object.defineProperty(f,"Float32Vector",{enumerable:!0,get:function(){return G.Float32Vector}});Object.defineProperty(f,"Float64Vector",{enumerable:!0,get:function(){return G.Float64Vector}});Object.defineProperty(f,"IntervalVector",{enumerable:!0,get:function(){return G.IntervalVector}});Object.defineProperty(f,"IntervalDayTimeVector",{enumerable:!0,get:function(){return G.IntervalDayTimeVector}});Object.defineProperty(f,"IntervalYearMonthVector",{enumerable:!0,get:function(){return G.IntervalYearMonthVector}});Object.defineProperty(f,"IntVector",{enumerable:!0,get:function(){return G.IntVector}});Object.defineProperty(f,"Int8Vector",{enumerable:!0,get:function(){return G.Int8Vector}});Object.defineProperty(f,"Int16Vector",{enumerable:!0,get:function(){return G.Int16Vector}});Object.defineProperty(f,"Int32Vector",{enumerable:!0,get:function(){return G.Int32Vector}});Object.defineProperty(f,"Int64Vector",{enumerable:!0,get:function(){return G.Int64Vector}});Object.defineProperty(f,"Uint8Vector",{enumerable:!0,get:function(){return G.Uint8Vector}});Object.defineProperty(f,"Uint16Vector",{enumerable:!0,get:function(){return G.Uint16Vector}});Object.defineProperty(f,"Uint32Vector",{enumerable:!0,get:function(){return G.Uint32Vector}});Object.defineProperty(f,"Uint64Vector",{enumerable:!0,get:function(){return G.Uint64Vector}});Object.defineProperty(f,"ListVector",{enumerable:!0,get:function(){return G.ListVector}});Object.defineProperty(f,"MapVector",{enumerable:!0,get:function(){return G.MapVector}});Object.defineProperty(f,"NullVector",{enumerable:!0,get:function(){return G.NullVector}});Object.defineProperty(f,"StructVector",{enumerable:!0,get:function(){return G.StructVector}});Object.defineProperty(f,"TimestampVector",{enumerable:!0,get:function(){return G.TimestampVector}});Object.defineProperty(f,"TimestampSecondVector",{enumerable:!0,get:function(){return G.TimestampSecondVector}});Object.defineProperty(f,"TimestampMillisecondVector",{enumerable:!0,get:function(){return G.TimestampMillisecondVector}});Object.defineProperty(f,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return G.TimestampMicrosecondVector}});Object.defineProperty(f,"TimestampNanosecondVector",{enumerable:!0,get:function(){return G.TimestampNanosecondVector}});Object.defineProperty(f,"TimeVector",{enumerable:!0,get:function(){return G.TimeVector}});Object.defineProperty(f,"TimeSecondVector",{enumerable:!0,get:function(){return G.TimeSecondVector}});Object.defineProperty(f,"TimeMillisecondVector",{enumerable:!0,get:function(){return G.TimeMillisecondVector}});Object.defineProperty(f,"TimeMicrosecondVector",{enumerable:!0,get:function(){return G.TimeMicrosecondVector}});Object.defineProperty(f,"TimeNanosecondVector",{enumerable:!0,get:function(){return G.TimeNanosecondVector}});Object.defineProperty(f,"UnionVector",{enumerable:!0,get:function(){return G.UnionVector}});Object.defineProperty(f,"DenseUnionVector",{enumerable:!0,get:function(){return G.DenseUnionVector}});Object.defineProperty(f,"SparseUnionVector",{enumerable:!0,get:function(){return G.SparseUnionVector}});Object.defineProperty(f,"Utf8Vector",{enumerable:!0,get:function(){return G.Utf8Vector}});var Z=Ua();Object.defineProperty(f,"Builder",{enumerable:!0,get:function(){return Z.Builder}});Object.defineProperty(f,"BinaryBuilder",{enumerable:!0,get:function(){return Z.BinaryBuilder}});Object.defineProperty(f,"BoolBuilder",{enumerable:!0,get:function(){return Z.BoolBuilder}});Object.defineProperty(f,"DateBuilder",{enumerable:!0,get:function(){return Z.DateBuilder}});Object.defineProperty(f,"DateDayBuilder",{enumerable:!0,get:function(){return Z.DateDayBuilder}});Object.defineProperty(f,"DateMillisecondBuilder",{enumerable:!0,get:function(){return Z.DateMillisecondBuilder}});Object.defineProperty(f,"DecimalBuilder",{enumerable:!0,get:function(){return Z.DecimalBuilder}});Object.defineProperty(f,"DictionaryBuilder",{enumerable:!0,get:function(){return Z.DictionaryBuilder}});Object.defineProperty(f,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return Z.FixedSizeBinaryBuilder}});Object.defineProperty(f,"FixedSizeListBuilder",{enumerable:!0,get:function(){return Z.FixedSizeListBuilder}});Object.defineProperty(f,"FloatBuilder",{enumerable:!0,get:function(){return Z.FloatBuilder}});Object.defineProperty(f,"Float16Builder",{enumerable:!0,get:function(){return Z.Float16Builder}});Object.defineProperty(f,"Float32Builder",{enumerable:!0,get:function(){return Z.Float32Builder}});Object.defineProperty(f,"Float64Builder",{enumerable:!0,get:function(){return Z.Float64Builder}});Object.defineProperty(f,"IntervalBuilder",{enumerable:!0,get:function(){return Z.IntervalBuilder}});Object.defineProperty(f,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return Z.IntervalDayTimeBuilder}});Object.defineProperty(f,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return Z.IntervalYearMonthBuilder}});Object.defineProperty(f,"IntBuilder",{enumerable:!0,get:function(){return Z.IntBuilder}});Object.defineProperty(f,"Int8Builder",{enumerable:!0,get:function(){return Z.Int8Builder}});Object.defineProperty(f,"Int16Builder",{enumerable:!0,get:function(){return Z.Int16Builder}});Object.defineProperty(f,"Int32Builder",{enumerable:!0,get:function(){return Z.Int32Builder}});Object.defineProperty(f,"Int64Builder",{enumerable:!0,get:function(){return Z.Int64Builder}});Object.defineProperty(f,"Uint8Builder",{enumerable:!0,get:function(){return Z.Uint8Builder}});Object.defineProperty(f,"Uint16Builder",{enumerable:!0,get:function(){return Z.Uint16Builder}});Object.defineProperty(f,"Uint32Builder",{enumerable:!0,get:function(){return Z.Uint32Builder}});Object.defineProperty(f,"Uint64Builder",{enumerable:!0,get:function(){return Z.Uint64Builder}});Object.defineProperty(f,"ListBuilder",{enumerable:!0,get:function(){return Z.ListBuilder}});Object.defineProperty(f,"MapBuilder",{enumerable:!0,get:function(){return Z.MapBuilder}});Object.defineProperty(f,"NullBuilder",{enumerable:!0,get:function(){return Z.NullBuilder}});Object.defineProperty(f,"StructBuilder",{enumerable:!0,get:function(){return Z.StructBuilder}});Object.defineProperty(f,"TimestampBuilder",{enumerable:!0,get:function(){return Z.TimestampBuilder}});Object.defineProperty(f,"TimestampSecondBuilder",{enumerable:!0,get:function(){return Z.TimestampSecondBuilder}});Object.defineProperty(f,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return Z.TimestampMillisecondBuilder}});Object.defineProperty(f,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return Z.TimestampMicrosecondBuilder}});Object.defineProperty(f,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return Z.TimestampNanosecondBuilder}});Object.defineProperty(f,"TimeBuilder",{enumerable:!0,get:function(){return Z.TimeBuilder}});Object.defineProperty(f,"TimeSecondBuilder",{enumerable:!0,get:function(){return Z.TimeSecondBuilder}});Object.defineProperty(f,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return Z.TimeMillisecondBuilder}});Object.defineProperty(f,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return Z.TimeMicrosecondBuilder}});Object.defineProperty(f,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return Z.TimeNanosecondBuilder}});Object.defineProperty(f,"UnionBuilder",{enumerable:!0,get:function(){return Z.UnionBuilder}});Object.defineProperty(f,"DenseUnionBuilder",{enumerable:!0,get:function(){return Z.DenseUnionBuilder}});Object.defineProperty(f,"SparseUnionBuilder",{enumerable:!0,get:function(){return Z.SparseUnionBuilder}});Object.defineProperty(f,"Utf8Builder",{enumerable:!0,get:function(){return Z.Utf8Builder}});var gf=vn();Object.defineProperty(f,"ByteStream",{enumerable:!0,get:function(){return gf.ByteStream}});Object.defineProperty(f,"AsyncByteStream",{enumerable:!0,get:function(){return gf.AsyncByteStream}});Object.defineProperty(f,"AsyncByteQueue",{enumerable:!0,get:function(){return gf.AsyncByteQueue}});var mo=co();Object.defineProperty(f,"RecordBatchReader",{enumerable:!0,get:function(){return mo.RecordBatchReader}});Object.defineProperty(f,"RecordBatchFileReader",{enumerable:!0,get:function(){return mo.RecordBatchFileReader}});Object.defineProperty(f,"RecordBatchStreamReader",{enumerable:!0,get:function(){return mo.RecordBatchStreamReader}});Object.defineProperty(f,"AsyncRecordBatchFileReader",{enumerable:!0,get:function(){return mo.AsyncRecordBatchFileReader}});Object.defineProperty(f,"AsyncRecordBatchStreamReader",{enumerable:!0,get:function(){return mo.AsyncRecordBatchStreamReader}});var Lc=nc();Object.defineProperty(f,"RecordBatchWriter",{enumerable:!0,get:function(){return Lc.RecordBatchWriter}});Object.defineProperty(f,"RecordBatchFileWriter",{enumerable:!0,get:function(){return Lc.RecordBatchFileWriter}});Object.defineProperty(f,"RecordBatchStreamWriter",{enumerable:!0,get:function(){return Lc.RecordBatchStreamWriter}});Object.defineProperty(f,"RecordBatchJSONWriter",{enumerable:!0,get:function(){return Lc.RecordBatchJSONWriter}});var vf=Ya();Object.defineProperty(f,"MessageReader",{enumerable:!0,get:function(){return vf.MessageReader}});Object.defineProperty(f,"AsyncMessageReader",{enumerable:!0,get:function(){return vf.AsyncMessageReader}});Object.defineProperty(f,"JSONMessageReader",{enumerable:!0,get:function(){return vf.JSONMessageReader}});var WF=oi();Object.defineProperty(f,"Message",{enumerable:!0,get:function(){return WF.Message}});var YF=Wr();Object.defineProperty(f,"RecordBatch",{enumerable:!0,get:function(){return YF.RecordBatch}});var wf=pg();Object.defineProperty(f,"DataFrame",{enumerable:!0,get:function(){return wf.DataFrame}});Object.defineProperty(f,"FilteredDataFrame",{enumerable:!0,get:function(){return wf.FilteredDataFrame}});Object.defineProperty(f,"CountByResult",{enumerable:!0,get:function(){return wf.CountByResult}});var GF=Ls(),$F=Sl(),JF=_r(),KF=xs(),XF=Xe(),ZF=Ws(),QF=yf();f.predicate=QF;var bf=Hl();f.util=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},GF),$F),JF),KF),XF),ZF),{compareSchemas:bf.compareSchemas,compareFields:bf.compareFields,compareTypes:bf.compareTypes});var eD=ni();Object.defineProperty(f,"isTypedArray",{enumerable:!0,get:function(){return eD.isTypedArray}})});var Tf=w(()=>{});var Ig=w(()=>{});var Tg=w(()=>{});var Sg=w(()=>{});var Ag=w(()=>{});var Mg=w((exports,module)=>{(function(){"use strict";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=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,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(r){return Object.prototype.toString.call(r)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(r){return typeof r=="object"&&r.buffer&&r.buffer.constructor===ArrayBuffer});var createOutputMethod=function(r,e){return function(t){return new Sha256(e,!0).update(t)[r]()}},createMethod=function(r){var e=createOutputMethod("hex",r);NODE_JS&&(e=nodeWrap(e,r)),e.create=function(){return new Sha256(r)},e.update=function(i){return e.create().update(i)};for(var t=0;t<OUTPUT_TYPES.length;++t){var n=OUTPUT_TYPES[t];e[n]=createOutputMethod(n,r)}return e},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(r){if(typeof r=="string")return crypto.createHash(algorithm).update(r,"utf8").digest("hex");if(r==null)throw new Error(ERROR);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(r)).digest("hex"):method(r)};return nodeMethod},createHmacOutputMethod=function(r,e){return function(t,n){return new HmacSha256(t,e,!0).update(n)[r]()}},createHmacMethod=function(r){var e=createHmacOutputMethod("hex",r);e.create=function(i){return new HmacSha256(i,r)},e.update=function(i,s){return e.create(i).update(s)};for(var t=0;t<OUTPUT_TYPES.length;++t){var n=OUTPUT_TYPES[t];e[n]=createHmacOutputMethod(n,r)}return e};function Sha256(r,e){e?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=r}Sha256.prototype.update=function(r){if(!this.finalized){var e,t=typeof r;if(t!=="string"){if(t==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);e=!0}for(var n,i=0,s,o=r.length,u=this.blocks;i<o;){if(this.hashed&&(this.hashed=!1,u[0]=this.block,u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0),e)for(s=this.start;i<o&&s<64;++i)u[s>>2]|=r[i]<<SHIFT[s++&3];else for(s=this.start;i<o&&s<64;++i)n=r.charCodeAt(i),n<128?u[s>>2]|=n<<SHIFT[s++&3]:n<2048?(u[s>>2]|=(192|n>>6)<<SHIFT[s++&3],u[s>>2]|=(128|n&63)<<SHIFT[s++&3]):n<55296||n>=57344?(u[s>>2]|=(224|n>>12)<<SHIFT[s++&3],u[s>>2]|=(128|n>>6&63)<<SHIFT[s++&3],u[s>>2]|=(128|n&63)<<SHIFT[s++&3]):(n=65536+((n&1023)<<10|r.charCodeAt(++i)&1023),u[s>>2]|=(240|n>>18)<<SHIFT[s++&3],u[s>>2]|=(128|n>>12&63)<<SHIFT[s++&3],u[s>>2]|=(128|n>>6&63)<<SHIFT[s++&3],u[s>>2]|=(128|n&63)<<SHIFT[s++&3]);this.lastByteIndex=s,this.bytes+=s-this.start,s>=64?(this.block=u[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 r=this.blocks,e=this.lastByteIndex;r[16]=this.block,r[e>>2]|=EXTRA[e&3],this.block=r[16],e>=56&&(this.hashed||this.hash(),r[0]=this.block,r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),r[14]=this.hBytes<<3|this.bytes>>>29,r[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var r=this.h0,e=this.h1,t=this.h2,n=this.h3,i=this.h4,s=this.h5,o=this.h6,u=this.h7,a=this.blocks,h,_,T,O,E,re,te,le,ge,Ie,L;for(h=16;h<64;++h)E=a[h-15],_=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3,E=a[h-2],T=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10,a[h]=a[h-16]+_+a[h-7]+T<<0;for(L=e&t,h=0;h<64;h+=4)this.first?(this.is224?(le=300032,E=a[0]-1413257819,u=E-150054599<<0,n=E+24177077<<0):(le=704751109,E=a[0]-210244248,u=E-1521486534<<0,n=E+143694565<<0),this.first=!1):(_=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),T=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),le=r&e,O=le^r&t^L,te=i&s^~i&o,E=u+T+te+K[h]+a[h],re=_+O,u=n+E<<0,n=E+re<<0),_=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),T=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7),ge=n&r,O=ge^n&e^le,te=u&i^~u&s,E=o+T+te+K[h+1]+a[h+1],re=_+O,o=t+E<<0,t=E+re<<0,_=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),T=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),Ie=t&n,O=Ie^t&r^ge,te=o&u^~o&i,E=s+T+te+K[h+2]+a[h+2],re=_+O,s=e+E<<0,e=E+re<<0,_=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),T=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),L=e&t,O=L^e&n^Ie,te=s&o^~s&u,E=i+T+te+K[h+3]+a[h+3],re=_+O,i=r+E<<0,r=E+re<<0;this.h0=this.h0+r<<0,this.h1=this.h1+e<<0,this.h2=this.h2+t<<0,this.h3=this.h3+n<<0,this.h4=this.h4+i<<0,this.h5=this.h5+s<<0,this.h6=this.h6+o<<0,this.h7=this.h7+u<<0},Sha256.prototype.hex=function(){this.finalize();var r=this.h0,e=this.h1,t=this.h2,n=this.h3,i=this.h4,s=this.h5,o=this.h6,u=this.h7,a=HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+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[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&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[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[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15];return this.is224||(a+=HEX_CHARS[u>>28&15]+HEX_CHARS[u>>24&15]+HEX_CHARS[u>>20&15]+HEX_CHARS[u>>16&15]+HEX_CHARS[u>>12&15]+HEX_CHARS[u>>8&15]+HEX_CHARS[u>>4&15]+HEX_CHARS[u&15]),a},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var r=this.h0,e=this.h1,t=this.h2,n=this.h3,i=this.h4,s=this.h5,o=this.h6,u=this.h7,a=[r>>24&255,r>>16&255,r>>8&255,r&255,e>>24&255,e>>16&255,e>>8&255,e&255,t>>24&255,t>>16&255,t>>8&255,t&255,n>>24&255,n>>16&255,n>>8&255,n&255,i>>24&255,i>>16&255,i>>8&255,i&255,s>>24&255,s>>16&255,s>>8&255,s&255,o>>24&255,o>>16&255,o>>8&255,o&255];return this.is224||a.push(u>>24&255,u>>16&255,u>>8&255,u&255),a},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var r=new ArrayBuffer(this.is224?28:32),e=new DataView(r);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),r};function HmacSha256(r,e,t){var n,i=typeof r;if(i==="string"){var s=[],o=r.length,u=0,a;for(n=0;n<o;++n)a=r.charCodeAt(n),a<128?s[u++]=a:a<2048?(s[u++]=192|a>>6,s[u++]=128|a&63):a<55296||a>=57344?(s[u++]=224|a>>12,s[u++]=128|a>>6&63,s[u++]=128|a&63):(a=65536+((a&1023)<<10|r.charCodeAt(++n)&1023),s[u++]=240|a>>18,s[u++]=128|a>>12&63,s[u++]=128|a>>6&63,s[u++]=128|a&63);r=s}else if(i==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);r.length>64&&(r=new Sha256(e,!0).update(r).array());var h=[],_=[];for(n=0;n<64;++n){var T=r[n]||0;h[n]=92^T,_[n]=54^T}Sha256.call(this,e,t),this.update(_),this.oKeyPad=h,this.inner=!0,this.sharedMemory=t}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var r=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(r),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,AMD&&define(function(){return exports}))})()});var dD={};yw(dD,{registerWorker:()=>Rg});var bg=lr(Es(),1),gg=lr(Ua(),1),ys=lr(co(),1),_s=lr(nc(),1),vg=lr(ng(),1),wg=lr(og(),1),Nc=lr(ag(),1),kc=lr(cg(),1),y=lr(mg(),1);bg.default.toDOMStream=vg.toDOMStream;gg.Builder.throughDOM=wg.builderThroughDOMStream;ys.RecordBatchReader.throughDOM=Nc.recordBatchReaderThroughDOMStream;ys.RecordBatchFileReader.throughDOM=Nc.recordBatchReaderThroughDOMStream;ys.RecordBatchStreamReader.throughDOM=Nc.recordBatchReaderThroughDOMStream;_s.RecordBatchWriter.throughDOM=kc.recordBatchWriterThroughDOMStream;_s.RecordBatchFileWriter.throughDOM=kc.recordBatchWriterThroughDOMStream;_s.RecordBatchStreamWriter.throughDOM=kc.recordBatchWriterThroughDOMStream;function Bf(r){switch(r.typeId){case y.Type.Binary:return{type:"binary"};case y.Type.Bool:return{type:"bool"};case y.Type.Date:return{type:"date"};case y.Type.DateDay:return{type:"date32[d]"};case y.Type.DateMillisecond:return{type:"date64[ms]"};case y.Type.Decimal:{let e=r;return{type:"decimal",precision:e.precision,scale:e.scale}}case y.Type.Float:return{type:"float"};case y.Type.Float16:return{type:"float16"};case y.Type.Float32:return{type:"float32"};case y.Type.Float64:return{type:"float64"};case y.Type.Int:return{type:"int32"};case y.Type.Int16:return{type:"int16"};case y.Type.Int32:return{type:"int32"};case y.Type.Int64:return{type:"int64"};case y.Type.Uint16:return{type:"uint16"};case y.Type.Uint32:return{type:"uint32"};case y.Type.Uint64:return{type:"uint64"};case y.Type.Uint8:return{type:"uint8"};case y.Type.IntervalDayTime:return{type:"interval[dt]"};case y.Type.IntervalYearMonth:return{type:"interval[m]"};case y.Type.List:{let e=r;return{type:"list",children:[bo(e.valueField.name,e.valueField.type)]}}case y.Type.FixedSizeBinary:return{type:"fixedsizebinary",byteWidth:r.byteWidth};case y.Type.Null:return{type:"null"};case y.Type.Utf8:return{type:"utf8"};case y.Type.Struct:return{type:"struct",children:r.children.map(t=>bo(t.name,t.type))};case y.Type.Time:return{type:"time[s]"};case y.Type.TimeMicrosecond:return{type:"time[us]"};case y.Type.TimeMillisecond:return{type:"time[ms]"};case y.Type.TimeNanosecond:return{type:"time[ns]"};case y.Type.TimeSecond:return{type:"time[s]"};case y.Type.Timestamp:return{type:"timestamp",timezone:r.timezone||void 0};case y.Type.TimestampSecond:return{type:"timestamp[s]",timezone:r.timezone||void 0};case y.Type.TimestampMicrosecond:return{type:"timestamp[us]",timezone:r.timezone||void 0};case y.Type.TimestampNanosecond:return{type:"timestamp[ns]",timezone:r.timezone||void 0};case y.Type.TimestampMillisecond:return{type:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error(`unsupported arrow type: ${r.toString()}`)}function bo(r,e){let t=Bf(e);return t.name=r,t}var If=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 n={name:t.name,message:t.message,stack:t.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"ERROR",data:n},[])}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){this._bindings=null,this.failWith(e,t)}return;default:break}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((n,i)=>i)},[]);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_START",data:t},[t.buffer]);break}case"SEND_QUERY":{let t=this._bindings.sendQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:"QUERY_START",data:t},[t.buffer]);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]),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]),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 this.failWith(e,t)}}};var Sf={},tD=(()=>{var r=Sf.url;return function(e){e=e||{};function t(){return Ue.buffer!=bt&&Kr(Ue.buffer),qf}function n(){return Ue.buffer!=bt&&Kr(Ue.buffer),Hf}function i(){return Ue.buffer!=bt&&Kr(Ue.buffer),zf}function s(){return Ue.buffer!=bt&&Kr(Ue.buffer),Wf}function o(){return Ue.buffer!=bt&&Kr(Ue.buffer),Yf}function u(){return Ue.buffer!=bt&&Kr(Ue.buffer),Gf}var a=typeof e<"u"?e:{},h=Object.assign,_,T;a.ready=new Promise(function(c,l){_=c,T=l});var O=h({},a),E=[],re="./this.program",te=(c,l)=>{throw l},le=typeof window=="object",ge=typeof importScripts=="function",Ie=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",L=a.ENVIRONMENT_IS_PTHREAD||!1,ot="";function vo(c){return a.locateFile?a.locateFile(c,ot):ot+c}var hi,pi,me,De;function sr(c){if(c instanceof As)return;tt("exiting due to exception: "+c)}var Gt,or,ar;if(Ie){ge?ot=Tf().dirname(ot)+"/":ot=__dirname+"/",ar=function(){or||(Gt=Ig(),or=Tf())},hi=function(d,p){return ar(),d=or.normalize(d),Gt.readFileSync(d,p?null:"utf8")},me=function(d){var p=hi(d,!0);return p.buffer||(p=new Uint8Array(p)),p},pi=function(d,p,m){ar(),d=or.normalize(d),Gt.readFile(d,function(v,B){v?m(v):p(B.buffer)})},process.argv.length>1&&(re=process.argv[1].replace(/\\/g,"/")),E=process.argv.slice(2),process.on("uncaughtException",function(l){if(!(l instanceof As))throw l}),process.on("unhandledRejection",function(l){throw l}),te=(l,d)=>{if(Bo())throw process.exitCode=l,d;sr(d),process.exit(l)},a.inspect=function(){return"[Emscripten Module object]"};let c;try{c=Tg()}catch(l){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),l}global.Worker=c.Worker}else(le||ge)&&(ge?ot=self.location.href:typeof document<"u"&&document.currentScript&&(ot=document.currentScript.src),r&&(ot=r),ot.indexOf("blob:")!==0?ot=ot.substr(0,ot.replace(/[?#].*/,"").lastIndexOf("/")+1):ot="",Ie||(hi=function(c){var l=new XMLHttpRequest;return l.open("GET",c,!1),l.send(null),l.responseText},ge&&(me=function(c){var l=new XMLHttpRequest;return l.open("GET",c,!1),l.responseType="arraybuffer",l.send(null),new Uint8Array(l.response)}),pi=function(c,l,d){var p=new XMLHttpRequest;p.open("GET",c,!0),p.responseType="arraybuffer",p.onload=function(){if(p.status==200||p.status==0&&p.response){l(p.response);return}d()},p.onerror=d,p.send(null)}),De=c=>document.title=c);Ie&&typeof performance>"u"&&(global.performance=Sg().performance);var Jr=console.log.bind(console),Oe=console.warn.bind(console);Ie&&(ar(),Jr=c=>Gt.writeSync(1,c+`
|
|
18
18
|
`),Oe=c=>Gt.writeSync(2,c+`
|
|
19
19
|
`));var xr=a.print||Jr,tt=a.printErr||Oe;h(a,O),O=null,a.arguments&&(E=a.arguments),a.thisProgram&&(re=a.thisProgram),a.quit&&(te=a.quit);function bs(c){bs.shown||(bs.shown={}),bs.shown[c]||(bs.shown[c]=1,tt(c))}var fD=Atomics.load,hD=Atomics.store,pD=Atomics.compareExchange,gs;a.wasmBinary&&(gs=a.wasmBinary);var xf=a.noExitRuntime||!0;typeof WebAssembly!="object"&&$t("no native wasm support detected");var Ue,Rf,Cc=!1,vs;function Vf(c,l){c||$t(l)}function Vg(c){var l=a["_"+c];return l}function Pg(c,l,d,p,m){var v={string:function(qe){var Jt=0;if(qe!=null&&qe!==0){var cr=(qe.length<<2)+1;Jt=yi(cr),wo(qe,Jt,cr)}return Jt},array:function(qe){var Jt=yi(qe.length);return jf(qe,Jt),Jt}};function B(qe){return l==="string"?Bt(qe):l==="boolean"?Boolean(qe):qe}var A=Vg(c),k=[],pe=0;if(p)for(var de=0;de<p.length;de++){var St=v[d[de]];St?(pe===0&&(pe=tu()),k[de]=St(p[de])):k[de]=p[de]}var Te=A.apply(null,k);function At(qe){return pe!==0&&Vo(pe),B(qe)}return Te=At(Te),Te}function Pf(c){var l=new TextDecoder(c);this.decode=d=>(d.buffer instanceof SharedArrayBuffer&&(d=new Uint8Array(d)),l.decode.call(l,d))}var Lf=typeof TextDecoder<"u"?new Pf("utf8"):void 0;function Nf(c,l,d){for(var p=l+d,m=l;c[m]&&!(m>=p);)++m;if(m-l>16&&c.subarray&&Lf)return Lf.decode(c.subarray(l,m));for(var v="";l<m;){var B=c[l++];if(!(B&128)){v+=String.fromCharCode(B);continue}var A=c[l++]&63;if((B&224)==192){v+=String.fromCharCode((B&31)<<6|A);continue}var k=c[l++]&63;if((B&240)==224?B=(B&15)<<12|A<<6|k:B=(B&7)<<18|A<<12|k<<6|c[l++]&63,B<65536)v+=String.fromCharCode(B);else{var pe=B-65536;v+=String.fromCharCode(55296|pe>>10,56320|pe&1023)}}return v}function Bt(c,l){return c?Nf(n(),c,l):""}function kf(c,l,d,p){if(!(p>0))return 0;for(var m=d,v=d+p-1,B=0;B<c.length;++B){var A=c.charCodeAt(B);if(A>=55296&&A<=57343){var k=c.charCodeAt(++B);A=65536+((A&1023)<<10)|k&1023}if(A<=127){if(d>=v)break;l[d++]=A}else if(A<=2047){if(d+1>=v)break;l[d++]=192|A>>6,l[d++]=128|A&63}else if(A<=65535){if(d+2>=v)break;l[d++]=224|A>>12,l[d++]=128|A>>6&63,l[d++]=128|A&63}else{if(d+3>=v)break;l[d++]=240|A>>18,l[d++]=128|A>>12&63,l[d++]=128|A>>6&63,l[d++]=128|A&63}}return l[d]=0,d-m}function wo(c,l,d){return kf(c,n(),l,d)}function Cf(c){for(var l=0,d=0;d<c.length;++d){var p=c.charCodeAt(d);p>=55296&&p<=57343&&(p=65536+((p&1023)<<10)|c.charCodeAt(++d)&1023),p<=127?++l:p<=2047?l+=2:p<=65535?l+=3:l+=4}return l}var yD=typeof TextDecoder<"u"?new Pf("utf-16le"):void 0;function jf(c,l){t().set(c,l)}function Lg(c,l,d){for(var p=0;p<c.length;++p)t()[l++>>0]=c.charCodeAt(p);d||(t()[l>>0]=0)}function Ng(c,l){return c%l>0&&(c+=l-c%l),c}var bt,qf,Hf,zf,Wf,Yf,kg,Cg,Gf;L&&(bt=a.buffer);function Kr(c){bt=c,a.HEAP8=qf=new Int8Array(c),a.HEAP16=zf=new Int16Array(c),a.HEAP32=Yf=new Int32Array(c),a.HEAPU8=Hf=new Uint8Array(c),a.HEAPU16=Wf=new Uint16Array(c),a.HEAPU32=kg=new Uint32Array(c),a.HEAPF32=Cg=new Float32Array(c),a.HEAPF64=Gf=new Float64Array(c)}var $f=a.INITIAL_MEMORY||16777216;if(L)Ue=a.wasmMemory,bt=a.buffer;else if(a.wasmMemory)Ue=a.wasmMemory;else if(Ue=new WebAssembly.Memory({initial:$f/65536,maximum:32768,shared:!0}),!(Ue.buffer instanceof SharedArrayBuffer))throw tt("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),Ie&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Ue&&(bt=Ue.buffer),$f=bt.byteLength,Kr(bt);var Jf,Kf=[],Xf=[],jg=[],qg=[],Zf=[],Hg=!1,zg=!1,Wg=0;function Bo(){return xf||Wg>0}function Yg(){if(a.preRun)for(typeof a.preRun=="function"&&(a.preRun=[a.preRun]);a.preRun.length;)Kg(a.preRun.shift());Io(Kf)}function Qf(){Hg=!0,!L&&Io(Xf)}function Gg(){L||Io(jg)}function $g(){L||(C.terminateAllThreads(),zg=!0)}function Jg(){if(!L){if(a.postRun)for(typeof a.postRun=="function"&&(a.postRun=[a.postRun]);a.postRun.length;)Zg(a.postRun.shift());Io(Zf)}}function Kg(c){Kf.unshift(c)}function Xg(c){Xf.unshift(c)}function Zg(c){Zf.unshift(c)}var jn=0,jc=null,ws=null;function Qg(c){jn++,a.monitorRunDependencies&&a.monitorRunDependencies(jn)}function e0(c){if(jn--,a.monitorRunDependencies&&a.monitorRunDependencies(jn),jn==0&&(jc!==null&&(clearInterval(jc),jc=null),ws)){var l=ws;ws=null,l()}}a.preloadedImages={},a.preloadedAudios={};function $t(c){L?postMessage({cmd:"onAbort",arg:c}):a.onAbort&&a.onAbort(c),c="Aborted("+c+")",tt(c),Cc=!0,vs=1,c+=". Build with -s ASSERTIONS=1 for more info.";var l=new WebAssembly.RuntimeError(c);throw T(l),l}var t0="data:application/octet-stream;base64,";function eh(c){return c.startsWith(t0)}var It;a.locateFile?(It="./duckdb-coi.wasm",eh(It)||(It=vo(It))):It=new URL("./duckdb-coi.wasm",Sf.url).toString();function th(c){try{if(c==It&&gs)return new Uint8Array(gs);if(me)return me(c);throw"both async and sync fetching of the wasm failed"}catch(l){$t(l)}}function r0(){return!gs&&(le||ge)&&typeof fetch=="function"?fetch(It,{credentials:"same-origin"}).then(function(c){if(!c.ok)throw"failed to load wasm binary file at '"+It+"'";return c.arrayBuffer()}).catch(function(){return th(It)}):Promise.resolve().then(function(){return th(It)})}function n0(){var c={a:yv};function l(B,A){var k=B.exports;if(a.asm=k,u0(a.asm.hb),Jf=a.asm.xa,Xg(a.asm.va),Rf=A,!L){var pe=C.unusedWorkers.length;C.unusedWorkers.forEach(function(de){C.loadWasmModuleToWorker(de,function(){--pe||e0("wasm-instantiate")})})}}L||Qg("wasm-instantiate");function d(B){l(B.instance,B.module)}function p(B){return r0().then(function(A){return WebAssembly.instantiate(A,c)}).then(function(A){return A}).then(B,function(A){tt("failed to asynchronously prepare wasm: "+A),$t(A)})}function m(){return!gs&&typeof WebAssembly.instantiateStreaming=="function"&&!eh(It)&&typeof fetch=="function"?fetch(It,{credentials:"same-origin"}).then(function(B){var A=WebAssembly.instantiateStreaming(B,c);return A.then(d,function(k){return tt("wasm streaming compile failed: "+k),tt("falling back to ArrayBuffer instantiation"),p(d)})}):p(d)}if(a.instantiateWasm)try{var v=a.instantiateWasm(c,l);return v}catch(B){return tt("Module.instantiateWasm callback failed with error: "+B),!1}return m().catch(T),{}}var i0={};function Io(c){for(;c.length>0;){var l=c.shift();if(typeof l=="function"){l(a);continue}var d=l.func;typeof d=="number"?l.arg===void 0?Hc(d)():Hc(d)(l.arg):d(l.arg===void 0?null:l.arg)}}function qc(c){var l=tu(),d=c();return Vo(l),d}function s0(c){o()[c>>2]=0;var l=C.pthreads[c];delete C.pthreads[c],l.worker.terminate(),eu(c),C.runningWorkers.splice(C.runningWorkers.indexOf(l.worker),1),l.worker.pthread=void 0}function o0(c){var l=C.pthreads[c];l.worker.postMessage({cmd:"cancel"})}function rh(c){var l=C.pthreads[c];if(l){o()[c>>2]=0;var d=l.worker;C.returnWorkerToPool(d)}}function nh(c,l){n().fill(0,c,c+l)}function ih(c){tp(c)}function sh(c){if(c instanceof As||c=="unwind")return vs;te(1,c)}var C={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThread:function(){for(var c=4,l=0;l<c;++l)C.allocateUnusedWorker()},initWorker:function(){},pthreads:{},setExitStatus:function(c){vs=c},terminateAllThreads:function(){for(var c in C.pthreads){var l=C.pthreads[c];l&&l.worker&&C.returnWorkerToPool(l.worker)}for(var d=0;d<C.unusedWorkers.length;++d){var p=C.unusedWorkers[d];p.terminate()}C.unusedWorkers=[]},returnWorkerToPool:function(c){C.runWithoutMainThreadQueuedCalls(function(){delete C.pthreads[c.pthread.threadInfoStruct],C.unusedWorkers.push(c),C.runningWorkers.splice(C.runningWorkers.indexOf(c),1),eu(c.pthread.threadInfoStruct),c.pthread=void 0})},runWithoutMainThreadQueuedCalls:function(c){o()[ep>>2]=0;try{c()}finally{o()[ep>>2]=1}},receiveObjectTransfer:function(c){},threadInit:function(){for(var c in C.tlsInitFunctions)C.tlsInitFunctions[c]()},loadWasmModuleToWorker:function(c,l){c.onmessage=function(d){var p=d.data,m=p.cmd;if(c.pthread&&(C.currentProxiedOperationCallerThread=c.pthread.threadInfoStruct),p.targetThread&&p.targetThread!=Ro()){var v=C.pthreads[p.targetThread];v?v.worker.postMessage(p,p.transferList):tt('Internal error! Worker sent a message "'+m+'" to target pthread '+p.targetThread+", but that thread no longer exists!"),C.currentProxiedOperationCallerThread=void 0;return}m==="processQueuedMainThreadWork"?Xc():m==="spawnThread"?ch(p):m==="cleanupThread"?rh(p.thread):m==="killThread"?s0(p.thread):m==="cancelThread"?o0(p.thread):m==="loaded"?(c.loaded=!0,l&&l(c),c.runPthread&&(c.runPthread(),delete c.runPthread)):m==="print"?xr("Thread "+p.threadId+": "+p.text):m==="printErr"?tt("Thread "+p.threadId+": "+p.text):m==="alert"?alert("Thread "+p.threadId+": "+p.text):m==="detachedExit"?C.returnWorkerToPool(c):p.target==="setimmediate"?c.postMessage(p):m==="onAbort"?a.onAbort&&a.onAbort(p.arg):tt("worker sent an unknown command "+m),C.currentProxiedOperationCallerThread=void 0},c.onerror=function(d){var p="worker sent an error!";throw tt(p+" "+d.filename+":"+d.lineno+": "+d.message),d},Ie&&(c.on("message",function(d){c.onmessage({data:d})}),c.on("error",function(d){c.onerror(d)}),c.on("detachedExit",function(){})),c.postMessage({cmd:"load",urlOrBlob:a.mainScriptUrlOrBlob,wasmMemory:Ue,wasmModule:Rf})},allocateUnusedWorker:function(){if(!a.locateFile){C.unusedWorkers.push(new Worker(new URL("duckdb_wasm.worker.js",Sf.url)));return}var c=vo("duckdb_wasm.worker.js");C.unusedWorkers.push(new Worker(c))},getNewWorker:function(){return C.unusedWorkers.length==0&&(C.allocateUnusedWorker(),C.loadWasmModuleToWorker(C.unusedWorkers[0])),C.unusedWorkers.pop()}};function a0(){var c=Ro(),l=o()[c+44>>2],d=o()[c+48>>2],p=l-d;Zh(l,p),Vo(l)}a.establishStackSpace=a0;function oh(c){if(L)return ue(1,0,c);try{ih(c)}catch(l){sh(l)}}var To=[];function Hc(c){var l=To[c];return l||(c>=To.length&&(To.length=c+1),To[c]=l=Jf.get(c)),l}function c0(c,l){return Hc(c)(l)}a.invokeEntryPoint=c0;function u0(c,l,d){C.tlsInitFunctions.push(c)}function l0(c,l,d,p){$t("Assertion failed: "+Bt(c)+", at: "+[l?Bt(l):"unknown filename",d,p?Bt(p):"unknown function"])}var Bs;Ie?Bs=()=>{var c=process.hrtime();return c[0]*1e3+c[1]/1e6}:L?Bs=()=>performance.now()-a.__performance_now_clock_drift:Bs=()=>performance.now();var d0=!0;function f0(c){return o()[$h()>>2]=c,c}function ah(c,l){var d;if(c===0)d=Date.now();else if((c===1||c===4)&&d0)d=Bs();else return f0(28),-1;return o()[l>>2]=d/1e3|0,o()[l+4>>2]=d%1e3*1e3*1e3|0,0}function h0(c,l){return ah(c,l)}function p0(c){Jh(c,!ge,1,!le),C.threadInit()}function y0(c){L?postMessage({cmd:"cleanupThread",thread:c}):rh(c)}function ch(c){var l=C.getNewWorker();if(!l)return 6;C.runningWorkers.push(l);var d=C.pthreads[c.pthread_ptr]={worker:l,threadInfoStruct:c.pthread_ptr};l.pthread=d;var p={cmd:"run",start_routine:c.startRoutine,arg:c.arg,threadInfoStruct:c.pthread_ptr};return l.runPthread=function(){p.time=performance.now(),l.postMessage(p,c.transferList)},l.loaded&&(l.runPthread(),delete l.runPthread),0}function _0(c,l,d,p){if(typeof SharedArrayBuffer>"u")return tt("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var m=[],v=0;if(L&&(m.length===0||v))return Kh(687865856,c,l,d,p);if(v)return v;var B={startRoutine:d,pthread_ptr:c,arg:p,transferList:m};return L?(B.cmd="spawnThread",postMessage(B,m),0):ch(B)}function m0(){postMessage({cmd:"detachedExit"})}var rt={mappings:{},buffers:[null,[],[]],printChar:function(c,l){var d=rt.buffers[c];l===0||l===10?((c===1?xr:tt)(Nf(d,0)),d.length=0):d.push(l)},varargs:void 0,get:function(){rt.varargs+=4;var c=o()[rt.varargs-4>>2];return c},getStr:function(c){var l=Bt(c);return l},get64:function(c,l){return c}};function uh(c,l,d,p,m){if(L)return ue(2,1,c,l,d,p,m)}function lh(c,l){return L?ue(3,1,c,l):(c=rt.getStr(c),rt.doAccess(c,l))}function b0(){tt("missing function: $SOCKFS"),$t(-1)}function dh(){tt("missing function: $FS"),$t(-1)}function Is(c){var l=b0.getSocket(c);if(!l)throw new dh.ErrnoError(8);return l}function zc(c){return(c&255)+"."+(c>>8&255)+"."+(c>>16&255)+"."+(c>>24&255)}function fh(c){var l="",d=0,p=0,m=0,v=0,B=0,A=0,k=[c[0]&65535,c[0]>>16,c[1]&65535,c[1]>>16,c[2]&65535,c[2]>>16,c[3]&65535,c[3]>>16],pe=!0,de="";for(A=0;A<5;A++)if(k[A]!==0){pe=!1;break}if(pe){if(de=zc(k[6]|k[7]<<16),k[5]===-1)return l="::ffff:",l+=de,l;if(k[5]===0)return l="::",de==="0.0.0.0"&&(de=""),de==="0.0.0.1"&&(de="1"),l+=de,l}for(d=0;d<8;d++)k[d]===0&&(d-m>1&&(B=0),m=d,B++),B>p&&(p=B,v=d-p+1);for(d=0;d<8;d++){if(p>1&&k[d]===0&&d>=v&&d<v+p){d===v&&(l+=":",v===0&&(l+=":"));continue}l+=Number(Qc(k[d]&65535)).toString(16),l+=d<7?":":""}return l}function hh(c,l){var d=i()[c>>1],p=Qc(s()[c+2>>1]),m;switch(d){case 2:if(l!==16)return{errno:28};m=o()[c+4>>2],m=zc(m);break;case 10:if(l!==28)return{errno:28};m=[o()[c+8>>2],o()[c+12>>2],o()[c+16>>2],o()[c+20>>2]],m=fh(m);break;default:return{errno:5}}return{family:d,addr:m,port:p}}function So(c){for(var l=c.split("."),d=0;d<4;d++){var p=Number(l[d]);if(isNaN(p))return null;l[d]=p}return(l[0]|l[1]<<8|l[2]<<16|l[3]<<24)>>>0}function Ao(c){return parseInt(c)}function Wc(c){var l,d,p,m,v=/^((?=.*::)(?!.*::.+::)(::)?([\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,B=[];if(!v.test(c))return null;if(c==="::")return[0,0,0,0,0,0,0,0];for(c.startsWith("::")?c=c.replace("::","Z:"):c=c.replace("::",":Z:"),c.indexOf(".")>0?(c=c.replace(new RegExp("[.]","g"),":"),l=c.split(":"),l[l.length-4]=Ao(l[l.length-4])+Ao(l[l.length-3])*256,l[l.length-3]=Ao(l[l.length-2])+Ao(l[l.length-1])*256,l=l.slice(0,l.length-2)):l=c.split(":"),p=0,m=0,d=0;d<l.length;d++)if(typeof l[d]=="string")if(l[d]==="Z"){for(m=0;m<8-l.length+1;m++)B[d+m]=0;p=m-1}else B[d+p]=xo(parseInt(l[d],16));else B[d+p]=l[d];return[B[1]<<16|B[0],B[3]<<16|B[2],B[5]<<16|B[4],B[7]<<16|B[6]]}var Tt={address_map:{id:1,addrs:{},names:{}},lookup_name:function(c){var l=So(c);if(l!==null||(l=Wc(c),l!==null))return c;var d;if(Tt.address_map.addrs[c])d=Tt.address_map.addrs[c];else{var p=Tt.address_map.id++;Vf(p<65535,"exceeded max address mappings of 65535"),d="172.29."+(p&255)+"."+(p&65280),Tt.address_map.names[d]=c,Tt.address_map.addrs[c]=d}return d},lookup_addr:function(c){return Tt.address_map.names[c]?Tt.address_map.names[c]:null}};function ph(c,l,d){if(d&&c===0)return null;var p=hh(c,l);if(p.errno)throw new dh.ErrnoError(p.errno);return p.addr=Tt.lookup_addr(p.addr)||p.addr,p}function yh(c,l,d){if(L)return ue(4,1,c,l,d);var p=Is(c),m=ph(l,d);return p.sock_ops.bind(p,m.addr,m.port),0}function _h(c,l,d){if(L)return ue(5,1,c,l,d);var p=Is(c),m=ph(l,d);return p.sock_ops.connect(p,m.addr,m.port),0}function mh(c,l,d){return L?ue(6,1,c,l,d):(rt.varargs=d,0)}function bh(c,l){if(L)return ue(7,1,c,l)}function gh(c,l,d,p){if(L)return ue(8,1,c,l,d,p)}function vh(c,l,d){if(L)return ue(9,1,c,l,d)}function wh(c,l,d){if(L)return ue(10,1,c,l,d)}function Yc(c,l,d,p,m){switch(l){case 2:d=So(d),nh(c,16),m&&(o()[m>>2]=16),i()[c>>1]=l,o()[c+4>>2]=d,i()[c+2>>1]=xo(p);break;case 10:d=Wc(d),nh(c,28),m&&(o()[m>>2]=28),o()[c>>2]=l,o()[c+8>>2]=d[0],o()[c+12>>2]=d[1],o()[c+16>>2]=d[2],o()[c+20>>2]=d[3],i()[c+2>>1]=xo(p);break;default:return 5}return 0}function Bh(c,l,d){if(L)return ue(11,1,c,l,d);var p=Is(c);if(!p.daddr)return-53;var m=Yc(l,p.family,Tt.lookup_name(p.daddr),p.dport,d);return 0}function Ih(c,l,d,p,m){if(L)return ue(12,1,c,l,d,p,m);var v=Is(c);return l===1&&d===4?(o()[p>>2]=v.error,o()[m>>2]=4,v.error=null,0):-50}function Th(c,l,d){return L?ue(13,1,c,l,d):(rt.varargs=d,0)}function Sh(c,l){if(L)return ue(14,1,c,l)}function Ah(c,l){return L?ue(15,1,c,l):(c=rt.getStr(c),rt.doMkdir(c,l))}function Fh(c,l,d){if(L)return ue(16,1,c,l,d);rt.varargs=d}function Dh(c,l,d,p,m,v){if(L)return ue(17,1,c,l,d,p,m,v);var B=Is(c),A=B.sock_ops.recvmsg(B,d);if(!A)return 0;if(m)var k=Yc(m,B.family,Tt.lookup_name(A.addr),A.port,v);return n().set(A.buffer,l),A.buffer.byteLength}function Oh(c,l){if(L)return ue(18,1,c,l)}function Mh(c){if(L)return ue(19,1,c)}function Eh(c,l,d,p,m,v){if(L)return ue(20,1,c,l,d,p,m,v)}function Uh(c,l,d){if(L)return ue(21,1,c,l,d)}function xh(c,l){if(L)return ue(22,1,c,l)}function Rh(c){if(L)return ue(23,1,c)}function g0(c,l){$t("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function v0(c,l){$t("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function w0(){return 2097152}function B0(c,l,d){for(var p=performance.now(),m=p+d,v=Atomics.exchange(o(),Po>>2,c);;){if(p=performance.now(),p>m)return v=Atomics.exchange(o(),Po>>2,0),-73;if(v=Atomics.exchange(o(),Po>>2,0),v==0)break;if(Xc(),Atomics.load(o(),c>>2)!=l)return-6;v=Atomics.exchange(o(),Po>>2,c)}return 0}function I0(c,l){if(c==l)postMessage({cmd:"processQueuedMainThreadWork"});else if(L)postMessage({targetThread:c,cmd:"processThreadQueue"});else{var d=C.pthreads[c],p=d&&d.worker;if(!p)return;p.postMessage({cmd:"processThreadQueue"})}return 1}function T0(){$t("")}function S0(c,l){return globalThis.DUCKDB_RUNTIME.createDirectory(a,c,l)}function A0(c,l){return globalThis.DUCKDB_RUNTIME.checkDirectory(a,c,l)}function F0(c,l){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(a,c,l)}function D0(c,l){return globalThis.DUCKDB_RUNTIME.removeDirectory(a,c,l)}function O0(c){return globalThis.DUCKDB_RUNTIME.closeFile(a,c)}function M0(c,l){return globalThis.DUCKDB_RUNTIME.checkFile(a,c,l)}function E0(c){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(a,c)}function U0(c,l,d,p){return globalThis.DUCKDB_RUNTIME.moveFile(a,c,l,d,p)}function x0(c,l){return globalThis.DUCKDB_RUNTIME.openFile(a,c,l)}function R0(c,l,d,p){return globalThis.DUCKDB_RUNTIME.readFile(a,c,l,d,p)}function V0(c,l){return globalThis.DUCKDB_RUNTIME.truncateFile(a,c,l)}function P0(c,l,d,p){return globalThis.DUCKDB_RUNTIME.writeFile(a,c,l,d,p)}function L0(c,l){return globalThis.DUCKDB_RUNTIME.glob(a,c,l)}function N0(c){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(a,c)}function k0(c,l,d,p,m,v){return globalThis.DUCKDB_RUNTIME.callScalarUDF(a,c,l,d,p,m,v)}function C0(){Ie||ge||bs("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function j0(){return 2147483648}function q0(c,l,d){n().copyWithin(c,l,l+d)}function H0(){return Ie?Ag().cpus().length:navigator.hardwareConcurrency}function ue(c,l){var d=arguments.length-2,p=arguments;return qc(function(){for(var m=d,v=yi(m*8),B=v>>3,A=0;A<d;A++){var k=p[2+A];u()[B+A]=k}return Xh(c,m,v,l)})}var Gc=[];function z0(c,l,d){Gc.length=l;for(var p=d>>3,m=0;m<l;m++)Gc[m]=u()[p+m];var v=c<0,B=v?i0[-c-1]:hv[c];return B.apply(null,Gc)}function W0(c){try{return Ue.grow(c-bt.byteLength+65535>>>16),Kr(Ue.buffer),1}catch(l){}}function Y0(c){var l=n().length;if(c=c>>>0,c<=l)return!1;var d=2147483648;if(c>d)return!1;for(var p=1;p<=4;p*=2){var m=l*(1+.2/p);m=Math.min(m,c+100663296);var v=Math.min(d,Ng(Math.max(c,m),65536)),B=W0(v);if(B)return!0}return!1}var se={inEventHandler:0,removeAllEventListeners:function(){for(var c=se.eventHandlers.length-1;c>=0;--c)se._removeHandler(c);se.eventHandlers=[],se.deferredCalls=[]},registerRemoveEventListeners:function(){se.removeEventListenersRegistered||(qg.push(se.removeAllEventListeners),se.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(c,l,d){function p(B,A){if(B.length!=A.length)return!1;for(var k in B)if(B[k]!=A[k])return!1;return!0}for(var m in se.deferredCalls){var v=se.deferredCalls[m];if(v.targetFunction==c&&p(v.argsList,d))return}se.deferredCalls.push({targetFunction:c,precedence:l,argsList:d}),se.deferredCalls.sort(function(B,A){return B.precedence<A.precedence})},removeDeferredCalls:function(c){for(var l=0;l<se.deferredCalls.length;++l)se.deferredCalls[l].targetFunction==c&&(se.deferredCalls.splice(l,1),--l)},canPerformEventHandlerRequests:function(){return se.inEventHandler&&se.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(!!se.canPerformEventHandlerRequests())for(var c=0;c<se.deferredCalls.length;++c){var l=se.deferredCalls[c];se.deferredCalls.splice(c,1),--c,l.targetFunction.apply(null,l.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(c,l){for(var d=0;d<se.eventHandlers.length;++d)se.eventHandlers[d].target==c&&(!l||l==se.eventHandlers[d].eventTypeString)&&se._removeHandler(d--)},_removeHandler:function(c){var l=se.eventHandlers[c];l.target.removeEventListener(l.eventTypeString,l.eventListenerFunc,l.useCapture),se.eventHandlers.splice(c,1)},registerOrRemoveHandler:function(c){var l=function(m){++se.inEventHandler,se.currentEventHandler=c,se.runDeferredCalls(),c.handlerFunc(m),se.runDeferredCalls(),--se.inEventHandler};if(c.callbackfunc)c.eventListenerFunc=l,c.target.addEventListener(c.eventTypeString,l,c.useCapture),se.eventHandlers.push(c),se.registerRemoveEventListeners();else for(var d=0;d<se.eventHandlers.length;++d)se.eventHandlers[d].target==c.target&&se.eventHandlers[d].eventTypeString==c.eventTypeString&&se._removeHandler(d--)},queueEventHandlerOnThread_iiii:function(c,l,d,p,m){qc(function(){var v=yi(12);o()[v>>2]=d,o()[v+4>>2]=p,o()[v+8>>2]=m,Zc(c,637534208,l,p,v)})},getTargetThreadForEventCallback:function(c){switch(c){case 1:return 0;case 2:return C.currentProxiedOperationCallerThread;default:return c}},getNodeNameForTarget:function(c){return c?c==window?"#window":c==screen?"#screen":c&&c.nodeName?c.nodeName:"":""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function G0(c){var l=Cf(c)+1,d=Ss(l);return wo(c,d,l),d}function $0(c,l,d,p){qc(function(){var m=yi(12),v=0;l&&(v=G0(l)),o()[m>>2]=v,o()[m+4>>2]=d,o()[m+8>>2]=p,Zc(c,657457152,0,v,m)})}function J0(c,l,d,p){l=l?Bt(l):"",$0(c,l,d,p)}function K0(c){return c>2?Bt(c):c}var X0=[0,typeof document<"u"?document:0,typeof window<"u"?window:0];function Z0(c){c=K0(c);var l=X0[c]||(typeof document<"u"?document.querySelector(c):void 0);return l}function $c(c){return Z0(c)}function Vh(c,l,d){var p=$c(c);if(!p)return-4;if(p.canvasSharedPtr&&(o()[p.canvasSharedPtr>>2]=l,o()[p.canvasSharedPtr+4>>2]=d),p.offscreenCanvas||!p.controlTransferredOffscreen){p.offscreenCanvas&&(p=p.offscreenCanvas);var m=!1;if(p.GLctxObject&&p.GLctxObject.GLctx){var v=p.GLctxObject.GLctx.getParameter(2978);m=v[0]===0&&v[1]===0&&v[2]===p.width&&v[3]===p.height}p.width=l,p.height=d,m&&p.GLctxObject.GLctx.viewport(0,0,l,d)}else if(p.canvasSharedPtr){var B=o()[p.canvasSharedPtr+8>>2];return J0(B,c,l,d),1}else return-4;return 0}function Ph(c,l,d){return L?ue(24,1,c,l,d):Vh(c,l,d)}function Q0(c,l,d){var p=$c(c);return p?Vh(c,l,d):Ph(c,l,d)}function ev(){throw"unwind"}function tv(c){var l=c.getExtension("ANGLE_instanced_arrays");if(l)return c.vertexAttribDivisor=function(d,p){l.vertexAttribDivisorANGLE(d,p)},c.drawArraysInstanced=function(d,p,m,v){l.drawArraysInstancedANGLE(d,p,m,v)},c.drawElementsInstanced=function(d,p,m,v,B){l.drawElementsInstancedANGLE(d,p,m,v,B)},1}function rv(c){var l=c.getExtension("OES_vertex_array_object");if(l)return c.createVertexArray=function(){return l.createVertexArrayOES()},c.deleteVertexArray=function(d){l.deleteVertexArrayOES(d)},c.bindVertexArray=function(d){l.bindVertexArrayOES(d)},c.isVertexArray=function(d){return l.isVertexArrayOES(d)},1}function nv(c){var l=c.getExtension("WEBGL_draw_buffers");if(l)return c.drawBuffers=function(d,p){l.drawBuffersWEBGL(d,p)},1}function iv(c){return!!(c.multiDrawWebgl=c.getExtension("WEBGL_multi_draw"))}var Re={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function(l){Re.lastError||(Re.lastError=l)},getNewId:function(c){for(var l=Re.counter++,d=c.length;d<l;d++)c[d]=null;return l},getSource:function(c,l,d,p){for(var m="",v=0;v<l;++v){var B=p?o()[p+v*4>>2]:-1;m+=Bt(o()[d+v*4>>2],B<0?void 0:B)}return m},createContext:function(c,l){c.getContextSafariWebGL2Fixed||(c.getContextSafariWebGL2Fixed=c.getContext,c.getContext=function(m,v){var B=c.getContextSafariWebGL2Fixed(m,v);return m=="webgl"==B instanceof WebGLRenderingContext?B:null});var d=c.getContext("webgl",l);if(!d)return 0;var p=Re.registerContext(d,l);return p},registerContext:function(c,l){var d=Ss(8);o()[d+4>>2]=Ro();var p={handle:d,attributes:l,version:l.majorVersion,GLctx:c};return c.canvas&&(c.canvas.GLctxObject=p),Re.contexts[d]=p,(typeof l.enableExtensionsByDefault>"u"||l.enableExtensionsByDefault)&&Re.initExtensions(p),d},makeContextCurrent:function(c){return Re.currentContext=Re.contexts[c],a.ctx=Gh=Re.currentContext&&Re.currentContext.GLctx,!(c&&!Gh)},getContext:function(c){return Re.contexts[c]},deleteContext:function(c){Re.currentContext===Re.contexts[c]&&(Re.currentContext=null),typeof se=="object"&&se.removeAllHandlersOnTarget(Re.contexts[c].GLctx.canvas),Re.contexts[c]&&Re.contexts[c].GLctx.canvas&&(Re.contexts[c].GLctx.canvas.GLctxObject=void 0),Qh(Re.contexts[c].handle),Re.contexts[c]=null},initExtensions:function(c){if(c||(c=Re.currentContext),!c.initExtensionsDone){c.initExtensionsDone=!0;var l=c.GLctx;tv(l),rv(l),nv(l),l.disjointTimerQueryExt=l.getExtension("EXT_disjoint_timer_query"),iv(l);var d=l.getSupportedExtensions()||[];d.forEach(function(p){!p.includes("lose_context")&&!p.includes("debug")&&l.getExtension(p)})}}},sv=["default","low-power","high-performance"];function ov(c,l){var d=l>>2,p=o()[d+6],m={alpha:!!o()[d+0],depth:!!o()[d+1],stencil:!!o()[d+2],antialias:!!o()[d+3],premultipliedAlpha:!!o()[d+4],preserveDrawingBuffer:!!o()[d+5],powerPreference:sv[p],failIfMajorPerformanceCaveat:!!o()[d+7],majorVersion:o()[d+8],minorVersion:o()[d+9],enableExtensionsByDefault:o()[d+10],explicitSwapControl:o()[d+11],proxyContextToMainThread:o()[d+12],renderViaOffscreenBackBuffer:o()[d+13]},v=$c(c);if(!v||m.explicitSwapControl)return 0;var B=Re.createContext(v,m);return B}function av(c,l){return ov(c,l)}var Jc={};function cv(){return re||"./this.program"}function Ts(){if(!Ts.strings){var c=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",l={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:c,_:cv()};for(var d in Jc)Jc[d]===void 0?delete l[d]:l[d]=Jc[d];var p=[];for(var d in l)p.push(d+"="+l[d]);Ts.strings=p}return Ts.strings}function Lh(c,l){if(L)return ue(25,1,c,l);var d=0;return Ts().forEach(function(p,m){var v=l+d;o()[c+m*4>>2]=v,Lg(p,v),d+=p.length+1}),0}function Nh(c,l){if(L)return ue(26,1,c,l);var d=Ts();o()[c>>2]=d.length;var p=0;return d.forEach(function(m){p+=m.length+1}),o()[l>>2]=p,0}function kh(c){return L?ue(27,1,c):0}function Ch(c,l,d,p,m,v){if(L)return ue(28,1,c,l,d,p,m,v);var B=rt.getStreamFromFD(c),A=rt.doReadv(B,l,d,p);return o()[v>>2]=A,0}function jh(c,l,d,p,m,v){if(L)return ue(29,1,c,l,d,p,m,v);var B=rt.getStreamFromFD(c),A=rt.doWritev(B,l,d,p);return o()[v>>2]=A,0}function qh(c,l,d,p){if(L)return ue(30,1,c,l,d,p);var m=rt.getStreamFromFD(c),v=rt.doReadv(m,l,d);return o()[p>>2]=v,0}function Hh(c,l,d,p,m){if(L)return ue(31,1,c,l,d,p,m)}function zh(c){if(L)return ue(32,1,c);var l=rt.getStreamFromFD(c);return l.stream_ops&&l.stream_ops.fsync?-l.stream_ops.fsync(l):0}function Wh(c,l,d,p){if(L)return ue(33,1,c,l,d,p);for(var m=0,v=0;v<d;v++){var B=o()[l>>2],A=o()[l+4>>2];l+=8;for(var k=0;k<A;k++)rt.printChar(c,n()[B+k]);m+=A}return o()[p>>2]=m,0}function Yh(c,l,d,p){if(L)return ue(34,1,c,l,d,p);var m=0,v=0,B=0,A=0,k=0,pe=0,de;function St(Te,At,qe,Jt,cr,Fs){var F,j,ye,be;return j=Te===10?28:16,cr=Te===10?fh(cr):zc(cr),F=Ss(j),be=Yc(F,Te,cr,Fs),Vf(!be),ye=Ss(32),o()[ye+4>>2]=Te,o()[ye+8>>2]=At,o()[ye+12>>2]=qe,o()[ye+24>>2]=Jt,o()[ye+20>>2]=F,Te===10?o()[ye+16>>2]=28:o()[ye+16>>2]=16,o()[ye+28>>2]=0,ye}if(d&&(B=o()[d>>2],A=o()[d+4>>2],k=o()[d+8>>2],pe=o()[d+12>>2]),k&&!pe&&(pe=k===2?17:6),!k&&pe&&(k=pe===17?2:1),pe===0&&(pe=6),k===0&&(k=1),!c&&!l)return-2;if(B&-1088||d!==0&&o()[d>>2]&2&&!c)return-1;if(B&32)return-2;if(k!==0&&k!==1&&k!==2)return-7;if(A!==0&&A!==2&&A!==10)return-6;if(l&&(l=Bt(l),v=parseInt(l,10),isNaN(v)))return B&1024?-2:-8;if(!c)return A===0&&(A=2),(B&1)===0&&(A===2?m=Uo(2130706433):m=[0,0,0,1]),de=St(A,k,pe,null,m,v),o()[p>>2]=de,0;if(c=Bt(c),m=So(c),m!==null)if(A===0||A===2)A=2;else if(A===10&&B&8)m=[0,0,Uo(65535),m],A=10;else return-2;else if(m=Wc(c),m!==null)if(A===0||A===10)A=10;else return-2;return m!=null?(de=St(A,k,pe,c,m,v),o()[p>>2]=de,0):B&4?-2:(c=Tt.lookup_name(c),m=So(c),A===0?A=2:A===10&&(m=[0,0,Uo(65535),m]),de=St(A,k,pe,null,m,v),o()[p>>2]=de,0)}function uv(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var c=new Uint8Array(1);return function(){return crypto.getRandomValues(c),c[0]}}else if(Ie)try{var l=pw("crypto");return function(){return l.randomBytes(1)[0]}}catch(d){}return function(){$t("randomDevice")}}function Fo(c,l){Fo.randomDevice||(Fo.randomDevice=uv());for(var d=0;d<l;d++)t()[c+d>>0]=Fo.randomDevice();return 0}function lv(c,l,d,p,m,v,B){var A=hh(c,l);if(A.errno)return-6;var k=A.port,pe=A.addr,de=!1;if(d&&p){var St;if(B&1||!(St=Tt.lookup_addr(pe))){if(B&8)return-2}else pe=St;var Te=wo(pe,d,p);Te+1>=p&&(de=!0)}if(m&&v){k=""+k;var Te=wo(k,m,v);Te+1>=v&&(de=!0)}return de?-12:0}function Do(c){return c%4===0&&(c%100!==0||c%400===0)}function Kc(c,l){for(var d=0,p=0;p<=l;d+=c[p++]);return d}var Oo=[31,29,31,30,31,30,31,31,30,31,30,31],Mo=[31,28,31,30,31,30,31,31,30,31,30,31];function Eo(c,l){for(var d=new Date(c.getTime());l>0;){var p=Do(d.getFullYear()),m=d.getMonth(),v=(p?Oo:Mo)[m];if(l>v-d.getDate())l-=v-d.getDate()+1,d.setDate(1),m<11?d.setMonth(m+1):(d.setMonth(0),d.setFullYear(d.getFullYear()+1));else return d.setDate(d.getDate()+l),d}return d}function dv(c,l,d,p){var m=o()[p+40>>2],v={tm_sec:o()[p>>2],tm_min:o()[p+4>>2],tm_hour:o()[p+8>>2],tm_mday:o()[p+12>>2],tm_mon:o()[p+16>>2],tm_year:o()[p+20>>2],tm_wday:o()[p+24>>2],tm_yday:o()[p+28>>2],tm_isdst:o()[p+32>>2],tm_gmtoff:o()[p+36>>2],tm_zone:m?Bt(m):""},B=Bt(d),A={"%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 k in A)B=B.replace(new RegExp(k,"g"),A[k]);var pe=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],de=["January","February","March","April","May","June","July","August","September","October","November","December"];function St(F,j,ye){for(var be=typeof F=="number"?F.toString():F||"";be.length<j;)be=ye[0]+be;return be}function Te(F,j){return St(F,j,"0")}function At(F,j){function ye(ur){return ur<0?-1:ur>0?1:0}var be;return(be=ye(F.getFullYear()-j.getFullYear()))===0&&(be=ye(F.getMonth()-j.getMonth()))===0&&(be=ye(F.getDate()-j.getDate())),be}function qe(F){switch(F.getDay()){case 0:return new Date(F.getFullYear()-1,11,29);case 1:return F;case 2:return new Date(F.getFullYear(),0,3);case 3:return new Date(F.getFullYear(),0,2);case 4:return new Date(F.getFullYear(),0,1);case 5:return new Date(F.getFullYear()-1,11,31);case 6:return new Date(F.getFullYear()-1,11,30)}}function Jt(F){var j=Eo(new Date(F.tm_year+1900,0,1),F.tm_yday),ye=new Date(j.getFullYear(),0,4),be=new Date(j.getFullYear()+1,0,4),ur=qe(ye),Xr=qe(be);return At(ur,j)<=0?At(Xr,j)<=0?j.getFullYear()+1:j.getFullYear():j.getFullYear()-1}var cr={"%a":function(F){return pe[F.tm_wday].substring(0,3)},"%A":function(F){return pe[F.tm_wday]},"%b":function(F){return de[F.tm_mon].substring(0,3)},"%B":function(F){return de[F.tm_mon]},"%C":function(F){var j=F.tm_year+1900;return Te(j/100|0,2)},"%d":function(F){return Te(F.tm_mday,2)},"%e":function(F){return St(F.tm_mday,2," ")},"%g":function(F){return Jt(F).toString().substring(2)},"%G":function(F){return Jt(F)},"%H":function(F){return Te(F.tm_hour,2)},"%I":function(F){var j=F.tm_hour;return j==0?j=12:j>12&&(j-=12),Te(j,2)},"%j":function(F){return Te(F.tm_mday+Kc(Do(F.tm_year+1900)?Oo:Mo,F.tm_mon-1),3)},"%m":function(F){return Te(F.tm_mon+1,2)},"%M":function(F){return Te(F.tm_min,2)},"%n":function(){return`
|
|
20
|
-
`},"%p":function(F){return F.tm_hour>=0&&F.tm_hour<12?"AM":"PM"},"%S":function(F){return Te(F.tm_sec,2)},"%t":function(){return" "},"%u":function(F){return F.tm_wday||7},"%U":function(F){var j=new Date(F.tm_year+1900,0,1),ye=j.getDay()===0?j:Eo(j,7-j.getDay()),be=new Date(F.tm_year+1900,F.tm_mon,F.tm_mday);if(At(ye,be)<0){var ur=Kc(Do(be.getFullYear())?Oo:Mo,be.getMonth()-1)-31,Xr=31-ye.getDate(),qn=Xr+ur+be.getDate();return Te(Math.ceil(qn/7),2)}return At(ye,j)===0?"01":"00"},"%V":function(F){var j=new Date(F.tm_year+1900,0,4),ye=new Date(F.tm_year+1901,0,4),be=qe(j),ur=qe(ye),Xr=Eo(new Date(F.tm_year+1900,0,1),F.tm_yday);if(At(Xr,be)<0)return"53";if(At(ur,Xr)<=0)return"01";var qn;return be.getFullYear()<F.tm_year+1900?qn=F.tm_yday+32-be.getDate():qn=F.tm_yday+1-be.getDate(),Te(Math.ceil(qn/7),2)},"%w":function(F){return F.tm_wday},"%W":function(F){var j=new Date(F.tm_year,0,1),ye=j.getDay()===1?j:Eo(j,j.getDay()===0?1:7-j.getDay()+1),be=new Date(F.tm_year+1900,F.tm_mon,F.tm_mday);if(At(ye,be)<0){var ur=Kc(Do(be.getFullYear())?Oo:Mo,be.getMonth()-1)-31,Xr=31-ye.getDate(),qn=Xr+ur+be.getDate();return Te(Math.ceil(qn/7),2)}return At(ye,j)===0?"01":"00"},"%y":function(F){return(F.tm_year+1900).toString().substring(2)},"%Y":function(F){return F.tm_year+1900},"%z":function(F){var j=F.tm_gmtoff,ye=j>=0;return j=Math.abs(j)/60,j=j/60*100+j%60,(ye?"+":"-")+String("0000"+j).slice(-4)},"%Z":function(F){return F.tm_zone},"%%":function(){return"%"}};for(var k in cr)B.includes(k)&&(B=B.replace(new RegExp(k,"g"),cr[k](v)));var Fs=pv(B,!1);return Fs.length>l?0:(jf(Fs,c),Fs.length-1)}function fv(c,l,d,p){return dv(c,l,d,p)}L||C.initMainThread();var Gh,hv=[null,oh,uh,lh,yh,_h,mh,bh,gh,vh,wh,Bh,Ih,Th,Sh,Ah,Fh,Dh,Oh,Mh,Eh,Uh,xh,Rh,Ph,Lh,Nh,kh,Ch,jh,qh,Hh,zh,Wh,Yh];function pv(c,l,d){var p=d>0?d:Cf(c)+1,m=new Array(p),v=kf(c,m,0,m.length);return l&&(m.length=v),m}var yv={b:l0,ua:h0,ra:p0,ka:y0,r:_0,_:m0,W:uh,P:lh,Y:yh,X:_h,c:mh,fa:bh,da:gh,aa:vh,ba:wh,R:Bh,V:Ih,ha:Th,ca:Sh,ga:Ah,s:Fh,T:Dh,N:Oh,p:Mh,U:Eh,l:Uh,ea:xh,q:Rh,n:g0,Z:v0,oa:w0,A:B0,w:I0,e:T0,o:ah,G:S0,H:A0,E:F0,F:D0,k:O0,C:M0,J:E0,D:U0,L:x0,g:R0,I:V0,h:P0,B:L0,j:N0,M:k0,u:C0,ia:j0,f:Bs,pa:q0,ja:H0,sa:z0,qa:Y0,ta:Q0,K:ev,v:av,ma:Lh,na:Nh,S:ih,d:kh,y:Ch,x:jh,t:qh,z:Hh,O:zh,i:Wh,m:Yh,$:Fo,Q:lv,a:Ue||a.wasmMemory,la:fv},_D=n0(),_v=a.___wasm_call_ctors=function(){return(_v=a.___wasm_call_ctors=a.asm.va).apply(null,arguments)},mv=a._main=function(){return(mv=a._main=a.asm.wa).apply(null,arguments)},bv=a._duckdb_web_fs_glob_add_path=function(){return(bv=a._duckdb_web_fs_glob_add_path=a.asm.ya).apply(null,arguments)},gv=a._duckdb_web_clear_response=function(){return(gv=a._duckdb_web_clear_response=a.asm.za).apply(null,arguments)},vv=a._duckdb_web_fail_with=function(){return(vv=a._duckdb_web_fail_with=a.asm.Aa).apply(null,arguments)},wv=a._duckdb_web_reset=function(){return(wv=a._duckdb_web_reset=a.asm.Ba).apply(null,arguments)},Bv=a._duckdb_web_connect=function(){return(Bv=a._duckdb_web_connect=a.asm.Ca).apply(null,arguments)},Iv=a._duckdb_web_disconnect=function(){return(Iv=a._duckdb_web_disconnect=a.asm.Da).apply(null,arguments)},Tv=a._duckdb_web_flush_files=function(){return(Tv=a._duckdb_web_flush_files=a.asm.Ea).apply(null,arguments)},Sv=a._duckdb_web_flush_file=function(){return(Sv=a._duckdb_web_flush_file=a.asm.Fa).apply(null,arguments)},Av=a._duckdb_web_open=function(){return(Av=a._duckdb_web_open=a.asm.Ga).apply(null,arguments)},Fv=a._duckdb_web_get_global_file_info=function(){return(Fv=a._duckdb_web_get_global_file_info=a.asm.Ha).apply(null,arguments)},Dv=a._duckdb_web_collect_file_stats=function(){return(Dv=a._duckdb_web_collect_file_stats=a.asm.Ia).apply(null,arguments)},Ov=a._duckdb_web_export_file_stats=function(){return(Ov=a._duckdb_web_export_file_stats=a.asm.Ja).apply(null,arguments)},Mv=a._duckdb_web_fs_drop_file=function(){return(Mv=a._duckdb_web_fs_drop_file=a.asm.Ka).apply(null,arguments)},Ev=a._duckdb_web_fs_drop_files=function(){return(Ev=a._duckdb_web_fs_drop_files=a.asm.La).apply(null,arguments)},Uv=a._duckdb_web_fs_glob_file_infos=function(){return(Uv=a._duckdb_web_fs_glob_file_infos=a.asm.Ma).apply(null,arguments)},xv=a._duckdb_web_fs_get_file_info_by_id=function(){return(xv=a._duckdb_web_fs_get_file_info_by_id=a.asm.Na).apply(null,arguments)},Rv=a._duckdb_web_fs_get_file_info_by_name=function(){return(Rv=a._duckdb_web_fs_get_file_info_by_name=a.asm.Oa).apply(null,arguments)},Vv=a._duckdb_web_fs_set_file_descriptor=function(){return(Vv=a._duckdb_web_fs_set_file_descriptor=a.asm.Pa).apply(null,arguments)},Pv=a._duckdb_web_fs_register_file_url=function(){return(Pv=a._duckdb_web_fs_register_file_url=a.asm.Qa).apply(null,arguments)},Lv=a._duckdb_web_fs_register_file_buffer=function(){return(Lv=a._duckdb_web_fs_register_file_buffer=a.asm.Ra).apply(null,arguments)},Nv=a._duckdb_web_copy_file_to_buffer=function(){return(Nv=a._duckdb_web_copy_file_to_buffer=a.asm.Sa).apply(null,arguments)},kv=a._duckdb_web_copy_file_to_path=function(){return(kv=a._duckdb_web_copy_file_to_path=a.asm.Ta).apply(null,arguments)},Cv=a._duckdb_web_get_version=function(){return(Cv=a._duckdb_web_get_version=a.asm.Ua).apply(null,arguments)},jv=a._duckdb_web_get_feature_flags=function(){return(jv=a._duckdb_web_get_feature_flags=a.asm.Va).apply(null,arguments)},qv=a._duckdb_web_tokenize=function(){return(qv=a._duckdb_web_tokenize=a.asm.Wa).apply(null,arguments)},Hv=a._duckdb_web_udf_scalar_create=function(){return(Hv=a._duckdb_web_udf_scalar_create=a.asm.Xa).apply(null,arguments)},zv=a._duckdb_web_prepared_create=function(){return(zv=a._duckdb_web_prepared_create=a.asm.Ya).apply(null,arguments)},Wv=a._duckdb_web_prepared_close=function(){return(Wv=a._duckdb_web_prepared_close=a.asm.Za).apply(null,arguments)},Yv=a._duckdb_web_prepared_run=function(){return(Yv=a._duckdb_web_prepared_run=a.asm._a).apply(null,arguments)},Gv=a._duckdb_web_prepared_send=function(){return(Gv=a._duckdb_web_prepared_send=a.asm.$a).apply(null,arguments)},$v=a._duckdb_web_query_run=function(){return($v=a._duckdb_web_query_run=a.asm.ab).apply(null,arguments)},Jv=a._duckdb_web_query_send=function(){return(Jv=a._duckdb_web_query_send=a.asm.bb).apply(null,arguments)},Kv=a._duckdb_web_query_fetch_results=function(){return(Kv=a._duckdb_web_query_fetch_results=a.asm.cb).apply(null,arguments)},Xv=a._duckdb_web_get_tablenames=function(){return(Xv=a._duckdb_web_get_tablenames=a.asm.db).apply(null,arguments)},Zv=a._duckdb_web_insert_arrow_from_ipc_stream=function(){return(Zv=a._duckdb_web_insert_arrow_from_ipc_stream=a.asm.eb).apply(null,arguments)},Qv=a._duckdb_web_insert_csv_from_path=function(){return(Qv=a._duckdb_web_insert_csv_from_path=a.asm.fb).apply(null,arguments)},ew=a._duckdb_web_insert_json_from_path=function(){return(ew=a._duckdb_web_insert_json_from_path=a.asm.gb).apply(null,arguments)},tw=a._emscripten_tls_init=function(){return(tw=a._emscripten_tls_init=a.asm.hb).apply(null,arguments)},$h=a.___errno_location=function(){return($h=a.___errno_location=a.asm.ib).apply(null,arguments)},Jh=a.__emscripten_thread_init=function(){return(Jh=a.__emscripten_thread_init=a.asm.jb).apply(null,arguments)},Uo=a._htonl=function(){return(Uo=a._htonl=a.asm.kb).apply(null,arguments)},xo=a._htons=function(){return(xo=a._htons=a.asm.lb).apply(null,arguments)},rw=a._emscripten_current_thread_process_queued_calls=function(){return(rw=a._emscripten_current_thread_process_queued_calls=a.asm.mb).apply(null,arguments)},Kh=a._emscripten_sync_run_in_main_thread_4=function(){return(Kh=a._emscripten_sync_run_in_main_thread_4=a.asm.nb).apply(null,arguments)},Xc=a._emscripten_main_thread_process_queued_calls=function(){return(Xc=a._emscripten_main_thread_process_queued_calls=a.asm.ob).apply(null,arguments)},Xh=a._emscripten_run_in_main_runtime_thread_js=function(){return(Xh=a._emscripten_run_in_main_runtime_thread_js=a.asm.pb).apply(null,arguments)},Zc=a._emscripten_dispatch_to_thread_=function(){return(Zc=a._emscripten_dispatch_to_thread_=a.asm.qb).apply(null,arguments)},Qc=a._ntohs=function(){return(Qc=a._ntohs=a.asm.rb).apply(null,arguments)},eu=a.__emscripten_thread_free_data=function(){return(eu=a.__emscripten_thread_free_data=a.asm.sb).apply(null,arguments)},nw=a.__emscripten_thread_exit=function(){return(nw=a.__emscripten_thread_exit=a.asm.tb).apply(null,arguments)},Ro=a._pthread_self=function(){return(Ro=a._pthread_self=a.asm.ub).apply(null,arguments)},Zh=a._emscripten_stack_set_limits=function(){return(Zh=a._emscripten_stack_set_limits=a.asm.vb).apply(null,arguments)},tu=a.stackSave=function(){return(tu=a.stackSave=a.asm.wb).apply(null,arguments)},Vo=a.stackRestore=function(){return(Vo=a.stackRestore=a.asm.xb).apply(null,arguments)},yi=a.stackAlloc=function(){return(yi=a.stackAlloc=a.asm.yb).apply(null,arguments)},Ss=a._malloc=function(){return(Ss=a._malloc=a.asm.zb).apply(null,arguments)},Qh=a._free=function(){return(Qh=a._free=a.asm.Ab).apply(null,arguments)},Po=a.__emscripten_main_thread_futex=1095808,ep=a.__emscripten_allow_main_runtime_queued_calls=986544;a.ccall=Pg,a.keepRuntimeAlive=Bo,a.PThread=C,a.PThread=C,a.wasmMemory=Ue,a.ExitStatus=As;var Lo;function As(c){this.name="ExitStatus",this.message="Program terminated with exit("+c+")",this.status=c}var iw=!1;ws=function c(){Lo||ru(),Lo||(ws=c)};function sw(c){var l=a._main,d=0,p=0;try{var m=l(d,p);return tp(m,!0),m}catch(v){return sh(v)}finally{iw=!0}}function ru(c){if(c=c||E,jn>0)return;if(L){_(a),Qf(),postMessage({cmd:"loaded"});return}if(Yg(),jn>0)return;function l(){Lo||(Lo=!0,a.calledRun=!0,!Cc&&(Qf(),Gg(),_(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),rp&&sw(c),Jg()))}a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1),l()},1)):l()}a.run=ru;function tp(c,l){if(vs=c,!l&&L)throw oh(c),"unwind";Bo()||$g(),ow(c)}function ow(c){vs=c,Bo()||(C.terminateAllThreads(),a.onExit&&a.onExit(c),Cc=!0),te(c,new As(c))}if(a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();var rp=!0;return a.noInitialRun&&(rp=!1),L&&(xf=!1,C.initWorker()),ru(),e.ready}})(),Fg=tD;var Af=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),n=y.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),y.Table.from(n)}send(e){let t=this._bindings.sendQuery(this._conn,e),n=new Ff(this._bindings,this._conn,t),i=y.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}getTableNames(e){return this._bindings.getTableNames(this._conn,e)}prepare(e){let t=this._bindings.createPrepared(this._conn,e);return new Dg(this._bindings,this._conn,t)}createScalarFunction(e,t,n){this._bindings.createScalarFunction(this._conn,e,t,n)}insertArrowTable(e,t){let n=e.serialize("binary",!0);this.insertArrowFromIPCStream(n,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)}},Ff=class{constructor(e,t,n){this.bindings=e;this.conn=t;this.header=n;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}},Dg=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...e){let t=this.bindings.runPrepared(this.connectionId,this.statementId,e),n=y.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),y.Table.from(n)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new Ff(this.bindings,this.connectionId,t),i=y.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}};var rD=new TextEncoder;function go(r,e,t){let n=rD.encode(t),i=r._malloc(n.byteLength),s=r.HEAPU8.subarray(i,i+n.byteLength);s.set(n),r.HEAPF64[(e>>3)+0]=1,r.HEAPF64[(e>>3)+1]=i,r.HEAPF64[(e>>3)+2]=s.byteLength}function Df(r){switch(r){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 Ln(r,e,t,n){let i=r.HEAPU8.subarray(e,e+n*Df(t));switch(t){case"UINT8":return new Uint8Array(i.buffer,i.byteOffset,n);case"INT8":return new Int8Array(i.buffer,i.byteOffset,n);case"INT32":return new Int32Array(i.buffer,i.byteOffset,n);case"FLOAT":return new Float32Array(i.buffer,i.byteOffset,n);case"DOUBLE":return new Float64Array(i.buffer,i.byteOffset,n);case"VARCHAR":return new Float64Array(i.buffer,i.byteOffset,n);default:return new Array(0)}}function Og(r,e,t,n,i,s,o,u){try{let a=r._udfFunctions.get(n);if(!a){go(e,t,"Unknown UDF with id: "+n);return}let h=new TextDecoder().decode(e.HEAPU8.subarray(i,i+s)),_=JSON.parse(h),T=Ln(e,o,"DOUBLE",u/8),O=[],E=[];for(let me in _.args){let De=_.args[me],sr=Ln(e,T[De.data_buffer],De.physical_type,_.rows),Gt=Ln(e,T[De.validity_buffer],"UINT8",_.rows);if(sr.length==0||Gt.length==0){go(e,t,"Can't create physical arrays for argument "+De.physical_type);return}if(O.push(Gt),De.physical_type=="VARCHAR"){let or=Ln(e,T[De.length_buffer],"DOUBLE",_.rows),ar=[],Jr=new TextDecoder;for(let Oe=0;Oe<_.rows;++Oe){if(!Gt[Oe]){ar.push(void 0);continue}let xr=e.HEAPU8.subarray(sr[Oe],sr[Oe]+or[Oe]),tt=Jr.decode(xr);ar.push(tt)}E.push(ar)}else E.push(sr)}let re=_.rows*Df(_.ret.physical_type),te=e._malloc(re),le=Ln(e,te,_.ret.physical_type,_.rows),ge=e._malloc(_.rows),Ie=Ln(e,ge,"UINT8",_.rows);if(le.length==0||Ie.length==0){go(e,t,"Can't create physical arrays for result");return}let L=le;switch(_.ret.physical_type=="VARCHAR"&&(le=new Array(_.rows)),_.args.length){case 0:for(let me=0;me<_.rows;++me){let De=a.func();le[me]=De,Ie[me]=De==null?0:1}break;case 1:for(let me=0;me<_.rows;++me){let De=a.func(O[0][me]?E[0][me]:void 0);le[me]=De,Ie[me]=De==null?0:1}break;case 2:for(let me=0;me<_.rows;++me){let De=a.func(O[0][me]?E[0][me]:void 0,O[1][me]?E[1][me]:void 0);le[me]=De,Ie[me]=De==null?0:1}break;default:go(e,t,"Can't deal with argument count: "+_.args.length);return}let ot=0;if(_.ret.physical_type=="VARCHAR"){let me=new TextEncoder,De=new Array(0),sr=0;ot=e._malloc(_.rows*Df("DOUBLE"));let Gt=Ln(e,ot,"DOUBLE",_.rows);for(let Oe=0;Oe<_.rows;++Oe)De[Oe]=me.encode(le[Oe]),sr+=De[Oe].length,Gt[Oe]=De[Oe].length;let or=e._malloc(sr),ar=e.HEAPU8.subarray(or,or+sr),Jr=0;le=L;for(let Oe=0;Oe<_.rows;++Oe){le[Oe]=or+Jr;for(let xr=0;xr<De[Oe].length;xr++)ar[Jr+xr]=De[Oe][xr];Jr+=De[Oe].length}}let vo=3*8,hi=e._malloc(vo),pi=Ln(e,hi,"DOUBLE",3);pi[0]=te,pi[1]=ge,pi[2]=ot,e.HEAPF64[(t>>3)+0]=0,e.HEAPF64[(t>>3)+1]=hi,e.HEAPF64[(t>>3)+2]=0}catch(a){go(e,t,a.toString())}}function iD(){let r=new TextDecoder;return e=>(typeof SharedArrayBuffer<"u"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),r.decode(e))}var sD=iD();function Ur(r,e){r.ccall("duckdb_web_fail_with",null,["string"],[e])}function ms(r,e,t){let n=r.HEAPU8.subarray(e,e+t),i=new Uint8Array(new ArrayBuffer(n.byteLength));return i.set(n),i}function ie(r,e,t){return sD(r.HEAPU8.subarray(e,e+t))}function _e(r,e,t,n){let i=r.stackSave(),s=r.stackAlloc(3*8);t.unshift("number"),n.unshift(s),r.ccall(e,null,t,n);let o=r.HEAPF64[(s>>3)+0],u=r.HEAPF64[(s>>3)+1],a=r.HEAPF64[(s>>3)+2];return r.stackRestore(i),[o,u,a]}function Fe(r){r.ccall("duckdb_web_clear_response",null,[],[])}var Of=class{constructor(e){let t=new Float64Array(e.buffer,e.byteOffset,e.byteLength/8),n=new Uint8Array(new ArrayBuffer(e.byteLength));n.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=n}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}};var oD=new TextEncoder;var Mf=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,n,i]=_e(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==0)throw new Error(ie(this.mod,n,i));Fe(this.mod)}reset(){let[e,t,n]=_e(this.mod,"duckdb_web_reset",[],[]);if(e!==0)throw new Error(ie(this.mod,t,n));Fe(this.mod)}getVersion(){let[e,t,n]=_e(this.mod,"duckdb_web_get_version",[],[]);if(e!==0)throw new Error(ie(this.mod,t,n));let i=ie(this.mod,t,n);return Fe(this.mod),i}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[t,n,i]=_e(this.mod,"duckdb_web_tokenize",["string"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));let s=ie(this.mod,n,i);return Fe(this.mod),JSON.parse(s)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new Af(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[n,i,s]=_e(this.mod,"duckdb_web_query_run",["number","string"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));let o=ms(this.mod,i,s);return Fe(this.mod),o}sendQuery(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_query_send",["number","string"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));let o=ms(this.mod,i,s);return Fe(this.mod),o}fetchQueryResults(e){let[t,n,i]=_e(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));let s=ms(this.mod,n,i);return Fe(this.mod),s}getTableNames(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_get_tablenames",["number","string"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));let o=ie(this.mod,i,s);return Fe(this.mod),JSON.parse(o)}createScalarFunction(e,t,n,i){let s={functionId:this._nextUDFId,name:t,returnType:Bf(n)},o={functionId:s.functionId,connectionId:e,name:t,returnType:n,func:i};this._nextUDFId+=1;let[u,a,h]=_e(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[e,JSON.stringify(s)]);if(u!==0)throw new Error(ie(this.mod,a,h));if(Fe(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(o.functionId,o),this.pthread)for(let _ of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])_.postMessage({cmd:"registerUDFFunction",udf:o})}createPrepared(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_prepared_create",["number","string"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));return Fe(this.mod),i}closePrepared(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));Fe(this.mod)}runPrepared(e,t,n){let[i,s,o]=_e(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==0)throw new Error(ie(this.mod,s,o));let u=ms(this.mod,s,o);return Fe(this.mod),u}sendPrepared(e,t,n){let[i,s,o]=_e(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==0)throw new Error(ie(this.mod,s,o));let u=ms(this.mod,s,o);return Fe(this.mod),u}insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let i=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(i,i+t.length).set(t);let o=n?JSON.stringify(n):"",[u,a,h]=_e(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,i,t.length,o]);if(u!==0)throw new Error(ie(this.mod,a,h))}insertCSVFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let h in n.columns)n.columnsFlat.push(bo(h,n.columns[h]))}let i=Zr({},n);i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[o,u,a]=_e(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,s]);if(o!==0)throw new Error(ie(this.mod,u,a))}insertJSONFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let h in n.columns)n.columnsFlat.push(bo(h,n.columns[h]))}let i=Zr({},n);i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[o,u,a]=_e(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,s]);if(o!==0)throw new Error(ie(this.mod,u,a))}globFiles(e){let[t,n,i]=_e(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));let s=ie(this.mod,n,i);Fe(this.mod);let o=JSON.parse(s);return o==null?[]:o}registerFileURL(e,t){t===void 0&&(t=e);let[n,i,s]=_e(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[e,t,-1]);if(n!==0)throw new Error(ie(this.mod,i,s));Fe(this.mod)}registerFileText(e,t){let n=oD.encode(t);this.registerFileBuffer(e,n)}registerFileBuffer(e,t){let n=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(n,n+t.length).set(t);let[s,o,u]=_e(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,n,t.length]);if(s!==0)throw new Error(ie(this.mod,o,u));Fe(this.mod)}registerFileHandle(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[e,e,-1]);if(n!==0)throw new Error(ie(this.mod,i,s));if(Fe(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,t),this.pthread){for(let o of this.pthread.runningWorkers)o.postMessage({cmd:"registerFileHandle",fileName:e,fileHandle:t});for(let o of this.pthread.unusedWorkers)o.postMessage({cmd:"dropFileHandle",fileName:e})}}dropFile(e){let[t,n,i]=_e(this.mod,"duckdb_web_fs_drop_file",["string"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));Fe(this.mod)}dropFiles(){let[e,t,n]=_e(this.mod,"duckdb_web_fs_drop_files",[],[]);if(e!==0)throw new Error(ie(this.mod,t,n));Fe(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));Fe(this.mod)}copyFileToBuffer(e){let[t,n,i]=_e(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));let s=this.mod.HEAPU8.subarray(n,n+i),o=new Uint8Array(s.length);return o.set(s),Fe(this.mod),o}collectFileStatistics(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s))}exportFileStatistics(e){let[t,n,i]=_e(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));return new Of(this.mod.HEAPU8.subarray(n,n+i))}};var Ef=class extends Mf{constructor(e,t,n,i){super(e,t);this.mainModuleURL=n,this.pthreadWorkerURL=i}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=${t} path=${e}`)}instantiateWasm(e,t){globalThis.DUCKDB_RUNTIME=this._runtime;let n=this.onInstantiationProgress;if(typeof TransformStream=="function"&&ReadableStream.prototype.pipeThrough&&WebAssembly.instantiateStreaming){let s=(async()=>{var re;let o=new Request(this.mainModuleURL),u=await fetch(o),a=u.headers.get("content-length"),h=a&&parseInt(a,10)||0,_=new Date,T={startedAt:_,updatedAt:_,bytesTotal:h||0,bytesLoaded:0},O={transform(te,le){T.bytesLoaded+=te.byteLength;let ge=new Date;if(ge.getTime()-T.updatedAt.getTime()<20){T.updatedAt=ge,le.enqueue(te);return}for(let Ie of n)Ie(T);le.enqueue(te)}},E=new TransformStream(O);return new Response((re=u.body)==null?void 0:re.pipeThrough(E),u)})();WebAssembly.instantiateStreaming(s,e).then(o=>{t(o.instance,o.module)})}else{let i=new XMLHttpRequest,s=this.mainModuleURL,o=new Date,u={startedAt:o,updatedAt:o,bytesTotal:0,bytesLoaded:0};i.open("GET",s),i.responseType="arraybuffer",i.onerror=a=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+a}),new Error(a.toString())},i.onprogress=a=>{u.bytesTotal=a.total,u.bytesLoaded=a.loaded;let h=new Date;if(h.getTime()-u.updatedAt.getTime()<20){u.updatedAt=h;return}for(let _ of n)_(u)},i.onload=()=>{WebAssembly.instantiate(i.response,e).then(a=>{t(a.instance,a.module)}).catch(a=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+a}),new Error(a)})},i.send()}return[]}};var Uf=class extends Ef{constructor(e,t,n,i=null){super(e,t,n,i)}instantiateImpl(e){return Fg(Os(Zr({},e),{instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)}))}};var Nn=lr(Mg()),Eg=function(r,e,t){var n;if((n=r==null?void 0:r.endpoint)==null?void 0:n.startsWith("http")){let i=`${r==null?void 0:r.endpoint}`,s=i.indexOf("://")+3;return i.substring(s)}else return(r==null?void 0:r.endpoint)?`${t}.${r==null?void 0:r.endpoint}`:`${t}.s3.amazonaws.com`};function aD(r,e,t){var i,s,o,u;let n=Ug(e);return{url:n.path,query:"",host:Eg(r,e,n.bucket),region:(i=r==null?void 0:r.region)!=null?i:"",service:"s3",method:t,accessKeyId:(s=r==null?void 0:r.accessKeyId)!=null?s:"",secretAccessKey:(o=r==null?void 0:r.secretAccessKey)!=null?o:"",sessionToken:(u=r==null?void 0:r.sessionToken)!=null?u:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function cD(r,e=!1){let t="0123456789ABCDEF",n="";for(let i=0;i<r.length;i++){let s=r[i];s>="A"&&s<="Z"||s>="a"&&s<="z"||s>="0"&&s<="9"||s=="_"||s=="-"||s=="~"||s=="."?n+=s:s=="/"?e?n+="%2F":n+=s:(n+="%",n+=t[s.charCodeAt(0)>>4],n+=t[s.charCodeAt(0)&15])}return n}function uD(r,e=null){var re;let t=(re=e==null?void 0:e.contentHash)!=null?re:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",n=new Map;n.set("x-amz-date",r.datetimeNow),n.set("x-amz-content-sha256",t),r.sessionToken&&n.set("x-amz-security-token",r.sessionToken);let i="";(e==null?void 0:e.contentType)&&(i+="content-type;"),i+="host;x-amz-content-sha256;x-amz-date",r.sessionToken&&(i+=";x-amz-security-token");let s=r.method+`
|
|
20
|
+
`},"%p":function(F){return F.tm_hour>=0&&F.tm_hour<12?"AM":"PM"},"%S":function(F){return Te(F.tm_sec,2)},"%t":function(){return" "},"%u":function(F){return F.tm_wday||7},"%U":function(F){var j=new Date(F.tm_year+1900,0,1),ye=j.getDay()===0?j:Eo(j,7-j.getDay()),be=new Date(F.tm_year+1900,F.tm_mon,F.tm_mday);if(At(ye,be)<0){var ur=Kc(Do(be.getFullYear())?Oo:Mo,be.getMonth()-1)-31,Xr=31-ye.getDate(),qn=Xr+ur+be.getDate();return Te(Math.ceil(qn/7),2)}return At(ye,j)===0?"01":"00"},"%V":function(F){var j=new Date(F.tm_year+1900,0,4),ye=new Date(F.tm_year+1901,0,4),be=qe(j),ur=qe(ye),Xr=Eo(new Date(F.tm_year+1900,0,1),F.tm_yday);if(At(Xr,be)<0)return"53";if(At(ur,Xr)<=0)return"01";var qn;return be.getFullYear()<F.tm_year+1900?qn=F.tm_yday+32-be.getDate():qn=F.tm_yday+1-be.getDate(),Te(Math.ceil(qn/7),2)},"%w":function(F){return F.tm_wday},"%W":function(F){var j=new Date(F.tm_year,0,1),ye=j.getDay()===1?j:Eo(j,j.getDay()===0?1:7-j.getDay()+1),be=new Date(F.tm_year+1900,F.tm_mon,F.tm_mday);if(At(ye,be)<0){var ur=Kc(Do(be.getFullYear())?Oo:Mo,be.getMonth()-1)-31,Xr=31-ye.getDate(),qn=Xr+ur+be.getDate();return Te(Math.ceil(qn/7),2)}return At(ye,j)===0?"01":"00"},"%y":function(F){return(F.tm_year+1900).toString().substring(2)},"%Y":function(F){return F.tm_year+1900},"%z":function(F){var j=F.tm_gmtoff,ye=j>=0;return j=Math.abs(j)/60,j=j/60*100+j%60,(ye?"+":"-")+String("0000"+j).slice(-4)},"%Z":function(F){return F.tm_zone},"%%":function(){return"%"}};for(var k in cr)B.includes(k)&&(B=B.replace(new RegExp(k,"g"),cr[k](v)));var Fs=pv(B,!1);return Fs.length>l?0:(jf(Fs,c),Fs.length-1)}function fv(c,l,d,p){return dv(c,l,d,p)}L||C.initMainThread();var Gh,hv=[null,oh,uh,lh,yh,_h,mh,bh,gh,vh,wh,Bh,Ih,Th,Sh,Ah,Fh,Dh,Oh,Mh,Eh,Uh,xh,Rh,Ph,Lh,Nh,kh,Ch,jh,qh,Hh,zh,Wh,Yh];function pv(c,l,d){var p=d>0?d:Cf(c)+1,m=new Array(p),v=kf(c,m,0,m.length);return l&&(m.length=v),m}var yv={b:l0,ua:h0,ra:p0,ka:y0,r:_0,_:m0,W:uh,P:lh,Y:yh,X:_h,c:mh,fa:bh,da:gh,aa:vh,ba:wh,R:Bh,V:Ih,ha:Th,ca:Sh,ga:Ah,s:Fh,T:Dh,N:Oh,p:Mh,U:Eh,l:Uh,ea:xh,q:Rh,n:g0,Z:v0,oa:w0,A:B0,w:I0,e:T0,o:ah,G:S0,H:A0,E:F0,F:D0,k:O0,C:M0,J:E0,D:U0,L:x0,g:R0,I:V0,h:P0,B:L0,j:N0,M:k0,u:C0,ia:j0,f:Bs,pa:q0,ja:H0,sa:z0,qa:Y0,ta:Q0,K:ev,v:av,ma:Lh,na:Nh,S:ih,d:kh,y:Ch,x:jh,t:qh,z:Hh,O:zh,i:Wh,m:Yh,$:Fo,Q:lv,a:Ue||a.wasmMemory,la:fv},_D=n0(),_v=a.___wasm_call_ctors=function(){return(_v=a.___wasm_call_ctors=a.asm.va).apply(null,arguments)},mv=a._main=function(){return(mv=a._main=a.asm.wa).apply(null,arguments)},bv=a._duckdb_web_fs_glob_add_path=function(){return(bv=a._duckdb_web_fs_glob_add_path=a.asm.ya).apply(null,arguments)},gv=a._duckdb_web_clear_response=function(){return(gv=a._duckdb_web_clear_response=a.asm.za).apply(null,arguments)},vv=a._duckdb_web_fail_with=function(){return(vv=a._duckdb_web_fail_with=a.asm.Aa).apply(null,arguments)},wv=a._duckdb_web_reset=function(){return(wv=a._duckdb_web_reset=a.asm.Ba).apply(null,arguments)},Bv=a._duckdb_web_connect=function(){return(Bv=a._duckdb_web_connect=a.asm.Ca).apply(null,arguments)},Iv=a._duckdb_web_disconnect=function(){return(Iv=a._duckdb_web_disconnect=a.asm.Da).apply(null,arguments)},Tv=a._duckdb_web_flush_files=function(){return(Tv=a._duckdb_web_flush_files=a.asm.Ea).apply(null,arguments)},Sv=a._duckdb_web_flush_file=function(){return(Sv=a._duckdb_web_flush_file=a.asm.Fa).apply(null,arguments)},Av=a._duckdb_web_open=function(){return(Av=a._duckdb_web_open=a.asm.Ga).apply(null,arguments)},Fv=a._duckdb_web_get_global_file_info=function(){return(Fv=a._duckdb_web_get_global_file_info=a.asm.Ha).apply(null,arguments)},Dv=a._duckdb_web_collect_file_stats=function(){return(Dv=a._duckdb_web_collect_file_stats=a.asm.Ia).apply(null,arguments)},Ov=a._duckdb_web_export_file_stats=function(){return(Ov=a._duckdb_web_export_file_stats=a.asm.Ja).apply(null,arguments)},Mv=a._duckdb_web_fs_drop_file=function(){return(Mv=a._duckdb_web_fs_drop_file=a.asm.Ka).apply(null,arguments)},Ev=a._duckdb_web_fs_drop_files=function(){return(Ev=a._duckdb_web_fs_drop_files=a.asm.La).apply(null,arguments)},Uv=a._duckdb_web_fs_glob_file_infos=function(){return(Uv=a._duckdb_web_fs_glob_file_infos=a.asm.Ma).apply(null,arguments)},xv=a._duckdb_web_fs_get_file_info_by_id=function(){return(xv=a._duckdb_web_fs_get_file_info_by_id=a.asm.Na).apply(null,arguments)},Rv=a._duckdb_web_fs_get_file_info_by_name=function(){return(Rv=a._duckdb_web_fs_get_file_info_by_name=a.asm.Oa).apply(null,arguments)},Vv=a._duckdb_web_fs_set_file_descriptor=function(){return(Vv=a._duckdb_web_fs_set_file_descriptor=a.asm.Pa).apply(null,arguments)},Pv=a._duckdb_web_fs_register_file_url=function(){return(Pv=a._duckdb_web_fs_register_file_url=a.asm.Qa).apply(null,arguments)},Lv=a._duckdb_web_fs_register_file_buffer=function(){return(Lv=a._duckdb_web_fs_register_file_buffer=a.asm.Ra).apply(null,arguments)},Nv=a._duckdb_web_copy_file_to_buffer=function(){return(Nv=a._duckdb_web_copy_file_to_buffer=a.asm.Sa).apply(null,arguments)},kv=a._duckdb_web_copy_file_to_path=function(){return(kv=a._duckdb_web_copy_file_to_path=a.asm.Ta).apply(null,arguments)},Cv=a._duckdb_web_get_version=function(){return(Cv=a._duckdb_web_get_version=a.asm.Ua).apply(null,arguments)},jv=a._duckdb_web_get_feature_flags=function(){return(jv=a._duckdb_web_get_feature_flags=a.asm.Va).apply(null,arguments)},qv=a._duckdb_web_tokenize=function(){return(qv=a._duckdb_web_tokenize=a.asm.Wa).apply(null,arguments)},Hv=a._duckdb_web_udf_scalar_create=function(){return(Hv=a._duckdb_web_udf_scalar_create=a.asm.Xa).apply(null,arguments)},zv=a._duckdb_web_prepared_create=function(){return(zv=a._duckdb_web_prepared_create=a.asm.Ya).apply(null,arguments)},Wv=a._duckdb_web_prepared_close=function(){return(Wv=a._duckdb_web_prepared_close=a.asm.Za).apply(null,arguments)},Yv=a._duckdb_web_prepared_run=function(){return(Yv=a._duckdb_web_prepared_run=a.asm._a).apply(null,arguments)},Gv=a._duckdb_web_prepared_send=function(){return(Gv=a._duckdb_web_prepared_send=a.asm.$a).apply(null,arguments)},$v=a._duckdb_web_query_run=function(){return($v=a._duckdb_web_query_run=a.asm.ab).apply(null,arguments)},Jv=a._duckdb_web_query_send=function(){return(Jv=a._duckdb_web_query_send=a.asm.bb).apply(null,arguments)},Kv=a._duckdb_web_query_fetch_results=function(){return(Kv=a._duckdb_web_query_fetch_results=a.asm.cb).apply(null,arguments)},Xv=a._duckdb_web_get_tablenames=function(){return(Xv=a._duckdb_web_get_tablenames=a.asm.db).apply(null,arguments)},Zv=a._duckdb_web_insert_arrow_from_ipc_stream=function(){return(Zv=a._duckdb_web_insert_arrow_from_ipc_stream=a.asm.eb).apply(null,arguments)},Qv=a._duckdb_web_insert_csv_from_path=function(){return(Qv=a._duckdb_web_insert_csv_from_path=a.asm.fb).apply(null,arguments)},ew=a._duckdb_web_insert_json_from_path=function(){return(ew=a._duckdb_web_insert_json_from_path=a.asm.gb).apply(null,arguments)},tw=a._emscripten_tls_init=function(){return(tw=a._emscripten_tls_init=a.asm.hb).apply(null,arguments)},$h=a.___errno_location=function(){return($h=a.___errno_location=a.asm.ib).apply(null,arguments)},Jh=a.__emscripten_thread_init=function(){return(Jh=a.__emscripten_thread_init=a.asm.jb).apply(null,arguments)},Uo=a._htonl=function(){return(Uo=a._htonl=a.asm.kb).apply(null,arguments)},xo=a._htons=function(){return(xo=a._htons=a.asm.lb).apply(null,arguments)},rw=a._emscripten_current_thread_process_queued_calls=function(){return(rw=a._emscripten_current_thread_process_queued_calls=a.asm.mb).apply(null,arguments)},Kh=a._emscripten_sync_run_in_main_thread_4=function(){return(Kh=a._emscripten_sync_run_in_main_thread_4=a.asm.nb).apply(null,arguments)},Xc=a._emscripten_main_thread_process_queued_calls=function(){return(Xc=a._emscripten_main_thread_process_queued_calls=a.asm.ob).apply(null,arguments)},Xh=a._emscripten_run_in_main_runtime_thread_js=function(){return(Xh=a._emscripten_run_in_main_runtime_thread_js=a.asm.pb).apply(null,arguments)},Zc=a._emscripten_dispatch_to_thread_=function(){return(Zc=a._emscripten_dispatch_to_thread_=a.asm.qb).apply(null,arguments)},Qc=a._ntohs=function(){return(Qc=a._ntohs=a.asm.rb).apply(null,arguments)},eu=a.__emscripten_thread_free_data=function(){return(eu=a.__emscripten_thread_free_data=a.asm.sb).apply(null,arguments)},nw=a.__emscripten_thread_exit=function(){return(nw=a.__emscripten_thread_exit=a.asm.tb).apply(null,arguments)},Ro=a._pthread_self=function(){return(Ro=a._pthread_self=a.asm.ub).apply(null,arguments)},Zh=a._emscripten_stack_set_limits=function(){return(Zh=a._emscripten_stack_set_limits=a.asm.vb).apply(null,arguments)},tu=a.stackSave=function(){return(tu=a.stackSave=a.asm.wb).apply(null,arguments)},Vo=a.stackRestore=function(){return(Vo=a.stackRestore=a.asm.xb).apply(null,arguments)},yi=a.stackAlloc=function(){return(yi=a.stackAlloc=a.asm.yb).apply(null,arguments)},Ss=a._malloc=function(){return(Ss=a._malloc=a.asm.zb).apply(null,arguments)},Qh=a._free=function(){return(Qh=a._free=a.asm.Ab).apply(null,arguments)},Po=a.__emscripten_main_thread_futex=1292224,ep=a.__emscripten_allow_main_runtime_queued_calls=1039808;a.ccall=Pg,a.keepRuntimeAlive=Bo,a.PThread=C,a.PThread=C,a.wasmMemory=Ue,a.ExitStatus=As;var Lo;function As(c){this.name="ExitStatus",this.message="Program terminated with exit("+c+")",this.status=c}var iw=!1;ws=function c(){Lo||ru(),Lo||(ws=c)};function sw(c){var l=a._main,d=0,p=0;try{var m=l(d,p);return tp(m,!0),m}catch(v){return sh(v)}finally{iw=!0}}function ru(c){if(c=c||E,jn>0)return;if(L){_(a),Qf(),postMessage({cmd:"loaded"});return}if(Yg(),jn>0)return;function l(){Lo||(Lo=!0,a.calledRun=!0,!Cc&&(Qf(),Gg(),_(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),rp&&sw(c),Jg()))}a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1),l()},1)):l()}a.run=ru;function tp(c,l){if(vs=c,!l&&L)throw oh(c),"unwind";Bo()||$g(),ow(c)}function ow(c){vs=c,Bo()||(C.terminateAllThreads(),a.onExit&&a.onExit(c),Cc=!0),te(c,new As(c))}if(a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();var rp=!0;return a.noInitialRun&&(rp=!1),L&&(xf=!1,C.initWorker()),ru(),e.ready}})(),Fg=tD;var Af=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),n=y.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),y.Table.from(n)}send(e){let t=this._bindings.sendQuery(this._conn,e),n=new Ff(this._bindings,this._conn,t),i=y.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}getTableNames(e){return this._bindings.getTableNames(this._conn,e)}prepare(e){let t=this._bindings.createPrepared(this._conn,e);return new Dg(this._bindings,this._conn,t)}createScalarFunction(e,t,n){this._bindings.createScalarFunction(this._conn,e,t,n)}insertArrowTable(e,t){let n=e.serialize("binary",!0);this.insertArrowFromIPCStream(n,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)}},Ff=class{constructor(e,t,n){this.bindings=e;this.conn=t;this.header=n;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}},Dg=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...e){let t=this.bindings.runPrepared(this.connectionId,this.statementId,e),n=y.RecordBatchReader.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),y.Table.from(n)}send(...e){let t=this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new Ff(this.bindings,this.connectionId,t),i=y.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}};var rD=new TextEncoder;function go(r,e,t){let n=rD.encode(t),i=r._malloc(n.byteLength),s=r.HEAPU8.subarray(i,i+n.byteLength);s.set(n),r.HEAPF64[(e>>3)+0]=1,r.HEAPF64[(e>>3)+1]=i,r.HEAPF64[(e>>3)+2]=s.byteLength}function Df(r){switch(r){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 Ln(r,e,t,n){let i=r.HEAPU8.subarray(e,e+n*Df(t));switch(t){case"UINT8":return new Uint8Array(i.buffer,i.byteOffset,n);case"INT8":return new Int8Array(i.buffer,i.byteOffset,n);case"INT32":return new Int32Array(i.buffer,i.byteOffset,n);case"FLOAT":return new Float32Array(i.buffer,i.byteOffset,n);case"DOUBLE":return new Float64Array(i.buffer,i.byteOffset,n);case"VARCHAR":return new Float64Array(i.buffer,i.byteOffset,n);default:return new Array(0)}}function Og(r,e,t,n,i,s,o,u){try{let a=r._udfFunctions.get(n);if(!a){go(e,t,"Unknown UDF with id: "+n);return}let h=new TextDecoder().decode(e.HEAPU8.subarray(i,i+s)),_=JSON.parse(h),T=Ln(e,o,"DOUBLE",u/8),O=[],E=[];for(let me in _.args){let De=_.args[me],sr=Ln(e,T[De.data_buffer],De.physical_type,_.rows),Gt=Ln(e,T[De.validity_buffer],"UINT8",_.rows);if(sr.length==0||Gt.length==0){go(e,t,"Can't create physical arrays for argument "+De.physical_type);return}if(O.push(Gt),De.physical_type=="VARCHAR"){let or=Ln(e,T[De.length_buffer],"DOUBLE",_.rows),ar=[],Jr=new TextDecoder;for(let Oe=0;Oe<_.rows;++Oe){if(!Gt[Oe]){ar.push(void 0);continue}let xr=e.HEAPU8.subarray(sr[Oe],sr[Oe]+or[Oe]),tt=Jr.decode(xr);ar.push(tt)}E.push(ar)}else E.push(sr)}let re=_.rows*Df(_.ret.physical_type),te=e._malloc(re),le=Ln(e,te,_.ret.physical_type,_.rows),ge=e._malloc(_.rows),Ie=Ln(e,ge,"UINT8",_.rows);if(le.length==0||Ie.length==0){go(e,t,"Can't create physical arrays for result");return}let L=le;switch(_.ret.physical_type=="VARCHAR"&&(le=new Array(_.rows)),_.args.length){case 0:for(let me=0;me<_.rows;++me){let De=a.func();le[me]=De,Ie[me]=De==null?0:1}break;case 1:for(let me=0;me<_.rows;++me){let De=a.func(O[0][me]?E[0][me]:void 0);le[me]=De,Ie[me]=De==null?0:1}break;case 2:for(let me=0;me<_.rows;++me){let De=a.func(O[0][me]?E[0][me]:void 0,O[1][me]?E[1][me]:void 0);le[me]=De,Ie[me]=De==null?0:1}break;default:go(e,t,"Can't deal with argument count: "+_.args.length);return}let ot=0;if(_.ret.physical_type=="VARCHAR"){let me=new TextEncoder,De=new Array(0),sr=0;ot=e._malloc(_.rows*Df("DOUBLE"));let Gt=Ln(e,ot,"DOUBLE",_.rows);for(let Oe=0;Oe<_.rows;++Oe)De[Oe]=me.encode(le[Oe]),sr+=De[Oe].length,Gt[Oe]=De[Oe].length;let or=e._malloc(sr),ar=e.HEAPU8.subarray(or,or+sr),Jr=0;le=L;for(let Oe=0;Oe<_.rows;++Oe){le[Oe]=or+Jr;for(let xr=0;xr<De[Oe].length;xr++)ar[Jr+xr]=De[Oe][xr];Jr+=De[Oe].length}}let vo=3*8,hi=e._malloc(vo),pi=Ln(e,hi,"DOUBLE",3);pi[0]=te,pi[1]=ge,pi[2]=ot,e.HEAPF64[(t>>3)+0]=0,e.HEAPF64[(t>>3)+1]=hi,e.HEAPF64[(t>>3)+2]=0}catch(a){go(e,t,a.toString())}}function iD(){let r=new TextDecoder;return e=>(typeof SharedArrayBuffer<"u"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),r.decode(e))}var sD=iD();function Ur(r,e){r.ccall("duckdb_web_fail_with",null,["string"],[e])}function ms(r,e,t){let n=r.HEAPU8.subarray(e,e+t),i=new Uint8Array(new ArrayBuffer(n.byteLength));return i.set(n),i}function ie(r,e,t){return sD(r.HEAPU8.subarray(e,e+t))}function _e(r,e,t,n){let i=r.stackSave(),s=r.stackAlloc(3*8);t.unshift("number"),n.unshift(s),r.ccall(e,null,t,n);let o=r.HEAPF64[(s>>3)+0],u=r.HEAPF64[(s>>3)+1],a=r.HEAPF64[(s>>3)+2];return r.stackRestore(i),[o,u,a]}function Fe(r){r.ccall("duckdb_web_clear_response",null,[],[])}var Of=class{constructor(e){let t=new Float64Array(e.buffer,e.byteOffset,e.byteLength/8),n=new Uint8Array(new ArrayBuffer(e.byteLength));n.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=n}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}};var oD=new TextEncoder;var Mf=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,n,i]=_e(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(t!==0)throw new Error(ie(this.mod,n,i));Fe(this.mod)}reset(){let[e,t,n]=_e(this.mod,"duckdb_web_reset",[],[]);if(e!==0)throw new Error(ie(this.mod,t,n));Fe(this.mod)}getVersion(){let[e,t,n]=_e(this.mod,"duckdb_web_get_version",[],[]);if(e!==0)throw new Error(ie(this.mod,t,n));let i=ie(this.mod,t,n);return Fe(this.mod),i}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[t,n,i]=_e(this.mod,"duckdb_web_tokenize",["string"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));let s=ie(this.mod,n,i);return Fe(this.mod),JSON.parse(s)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new Af(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[n,i,s]=_e(this.mod,"duckdb_web_query_run",["number","string"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));let o=ms(this.mod,i,s);return Fe(this.mod),o}sendQuery(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_query_send",["number","string"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));let o=ms(this.mod,i,s);return Fe(this.mod),o}fetchQueryResults(e){let[t,n,i]=_e(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));let s=ms(this.mod,n,i);return Fe(this.mod),s}getTableNames(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_get_tablenames",["number","string"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));let o=ie(this.mod,i,s);return Fe(this.mod),JSON.parse(o)}createScalarFunction(e,t,n,i){let s={functionId:this._nextUDFId,name:t,returnType:Bf(n)},o={functionId:s.functionId,connectionId:e,name:t,returnType:n,func:i};this._nextUDFId+=1;let[u,a,h]=_e(this.mod,"duckdb_web_udf_scalar_create",["number","string"],[e,JSON.stringify(s)]);if(u!==0)throw new Error(ie(this.mod,a,h));if(Fe(this.mod),globalThis.DUCKDB_RUNTIME._udfFunctions=(globalThis.DUCKDB_RUNTIME._udfFunctions||new Map).set(o.functionId,o),this.pthread)for(let _ of[...this.pthread.runningWorkers,...this.pthread.unusedWorkers])_.postMessage({cmd:"registerUDFFunction",udf:o})}createPrepared(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_prepared_create",["number","string"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));return Fe(this.mod),i}closePrepared(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_prepared_close",["number","number"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));Fe(this.mod)}runPrepared(e,t,n){let[i,s,o]=_e(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==0)throw new Error(ie(this.mod,s,o));let u=ms(this.mod,s,o);return Fe(this.mod),u}sendPrepared(e,t,n){let[i,s,o]=_e(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,t,JSON.stringify(n)]);if(i!==0)throw new Error(ie(this.mod,s,o));let u=ms(this.mod,s,o);return Fe(this.mod),u}insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let i=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(i,i+t.length).set(t);let o=n?JSON.stringify(n):"",[u,a,h]=_e(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,i,t.length,o]);if(u!==0)throw new Error(ie(this.mod,a,h))}insertCSVFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let h in n.columns)n.columnsFlat.push(bo(h,n.columns[h]))}let i=Zr({},n);i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[o,u,a]=_e(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,t,s]);if(o!==0)throw new Error(ie(this.mod,u,a))}insertJSONFromPath(e,t,n){if(n.columns!==void 0){n.columnsFlat=[];for(let h in n.columns)n.columnsFlat.push(bo(h,n.columns[h]))}let i=Zr({},n);i.columns=i.columnsFlat,delete i.columnsFlat;let s=JSON.stringify(i),[o,u,a]=_e(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,t,s]);if(o!==0)throw new Error(ie(this.mod,u,a))}globFiles(e){let[t,n,i]=_e(this.mod,"duckdb_web_fs_glob_file_infos",["string"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));let s=ie(this.mod,n,i);Fe(this.mod);let o=JSON.parse(s);return o==null?[]:o}registerFileURL(e,t){t===void 0&&(t=e);let[n,i,s]=_e(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[e,t,-1]);if(n!==0)throw new Error(ie(this.mod,i,s));Fe(this.mod)}registerFileText(e,t){let n=oD.encode(t);this.registerFileBuffer(e,n)}registerFileBuffer(e,t){let n=this.mod._malloc(t.length);this.mod.HEAPU8.subarray(n,n+t.length).set(t);let[s,o,u]=_e(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,n,t.length]);if(s!==0)throw new Error(ie(this.mod,o,u));Fe(this.mod)}registerFileHandle(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_fs_register_file_url",["string","string","number"],[e,e,-1]);if(n!==0)throw new Error(ie(this.mod,i,s));if(Fe(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,t),this.pthread){for(let o of this.pthread.runningWorkers)o.postMessage({cmd:"registerFileHandle",fileName:e,fileHandle:t});for(let o of this.pthread.unusedWorkers)o.postMessage({cmd:"dropFileHandle",fileName:e})}}dropFile(e){let[t,n,i]=_e(this.mod,"duckdb_web_fs_drop_file",["string"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));Fe(this.mod)}dropFiles(){let[e,t,n]=_e(this.mod,"duckdb_web_fs_drop_files",[],[]);if(e!==0)throw new Error(ie(this.mod,t,n));Fe(this.mod)}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s));Fe(this.mod)}copyFileToBuffer(e){let[t,n,i]=_e(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));let s=this.mod.HEAPU8.subarray(n,n+i),o=new Uint8Array(s.length);return o.set(s),Fe(this.mod),o}collectFileStatistics(e,t){let[n,i,s]=_e(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,t]);if(n!==0)throw new Error(ie(this.mod,i,s))}exportFileStatistics(e){let[t,n,i]=_e(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(t!==0)throw new Error(ie(this.mod,n,i));return new Of(this.mod.HEAPU8.subarray(n,n+i))}};var Ef=class extends Mf{constructor(e,t,n,i){super(e,t);this.mainModuleURL=n,this.pthreadWorkerURL=i}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=${t} path=${e}`)}instantiateWasm(e,t){globalThis.DUCKDB_RUNTIME=this._runtime;let n=this.onInstantiationProgress;if(typeof TransformStream=="function"&&ReadableStream.prototype.pipeThrough&&WebAssembly.instantiateStreaming){let s=(async()=>{var re;let o=new Request(this.mainModuleURL),u=await fetch(o),a=u.headers.get("content-length"),h=a&&parseInt(a,10)||0,_=new Date,T={startedAt:_,updatedAt:_,bytesTotal:h||0,bytesLoaded:0},O={transform(te,le){T.bytesLoaded+=te.byteLength;let ge=new Date;if(ge.getTime()-T.updatedAt.getTime()<20){T.updatedAt=ge,le.enqueue(te);return}for(let Ie of n)Ie(T);le.enqueue(te)}},E=new TransformStream(O);return new Response((re=u.body)==null?void 0:re.pipeThrough(E),u)})();WebAssembly.instantiateStreaming(s,e).then(o=>{t(o.instance,o.module)})}else{let i=new XMLHttpRequest,s=this.mainModuleURL,o=new Date,u={startedAt:o,updatedAt:o,bytesTotal:0,bytesLoaded:0};i.open("GET",s),i.responseType="arraybuffer",i.onerror=a=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to load WASM: "+a}),new Error(a.toString())},i.onprogress=a=>{u.bytesTotal=a.total,u.bytesLoaded=a.loaded;let h=new Date;if(h.getTime()-u.updatedAt.getTime()<20){u.updatedAt=h;return}for(let _ of n)_(u)},i.onload=()=>{WebAssembly.instantiate(i.response,e).then(a=>{t(a.instance,a.module)}).catch(a=>{throw this.logger.log({timestamp:new Date,level:4,origin:3,topic:5,event:2,value:"Failed to instantiate WASM: "+a}),new Error(a)})},i.send()}return[]}};var Uf=class extends Ef{constructor(e,t,n,i=null){super(e,t,n,i)}instantiateImpl(e){return Fg(Os(Zr({},e),{instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)}))}};var Nn=lr(Mg()),Eg=function(r,e,t){var n;if((n=r==null?void 0:r.endpoint)==null?void 0:n.startsWith("http")){let i=`${r==null?void 0:r.endpoint}`,s=i.indexOf("://")+3;return i.substring(s)}else return(r==null?void 0:r.endpoint)?`${t}.${r==null?void 0:r.endpoint}`:`${t}.s3.amazonaws.com`};function aD(r,e,t){var i,s,o,u;let n=Ug(e);return{url:n.path,query:"",host:Eg(r,e,n.bucket),region:(i=r==null?void 0:r.region)!=null?i:"",service:"s3",method:t,accessKeyId:(s=r==null?void 0:r.accessKeyId)!=null?s:"",secretAccessKey:(o=r==null?void 0:r.secretAccessKey)!=null?o:"",sessionToken:(u=r==null?void 0:r.sessionToken)!=null?u:"",dateNow:new Date().toISOString().replace(/-/g,"").split("T")[0],datetimeNow:new Date().toISOString().replace(/-/g,"").replace(/:/g,"").split(".")[0]+"Z"}}function cD(r,e=!1){let t="0123456789ABCDEF",n="";for(let i=0;i<r.length;i++){let s=r[i];s>="A"&&s<="Z"||s>="a"&&s<="z"||s>="0"&&s<="9"||s=="_"||s=="-"||s=="~"||s=="."?n+=s:s=="/"?e?n+="%2F":n+=s:(n+="%",n+=t[s.charCodeAt(0)>>4],n+=t[s.charCodeAt(0)&15])}return n}function uD(r,e=null){var re;let t=(re=e==null?void 0:e.contentHash)!=null?re:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",n=new Map;n.set("x-amz-date",r.datetimeNow),n.set("x-amz-content-sha256",t),r.sessionToken&&n.set("x-amz-security-token",r.sessionToken);let i="";(e==null?void 0:e.contentType)&&(i+="content-type;"),i+="host;x-amz-content-sha256;x-amz-date",r.sessionToken&&(i+=";x-amz-security-token");let s=r.method+`
|
|
21
21
|
`+cD(r.url)+`
|
|
22
22
|
`+r.query;(e==null?void 0:e.contentType)&&(s+=`
|
|
23
23
|
content-type:`+(e==null?void 0:e.contentType)),s+=`
|