@duckdb/duckdb-wasm 1.10.0 → 1.11.1-dev.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/README.md +94 -47
- package/dist/duckdb-browser-blocking.cjs +25 -0
- package/dist/duckdb-browser-blocking.cjs.map +7 -0
- package/dist/duckdb-browser-blocking.d.ts +1 -0
- package/dist/duckdb-browser-blocking.mjs +25 -0
- package/dist/duckdb-browser-blocking.mjs.map +7 -0
- package/dist/duckdb-browser-coi.pthread.worker.js +27 -0
- package/dist/duckdb-browser-coi.pthread.worker.js.map +7 -0
- package/dist/duckdb-browser-coi.worker.js +35 -0
- package/dist/duckdb-browser-coi.worker.js.map +7 -0
- package/dist/duckdb-browser-eh.worker.js +33 -0
- package/dist/duckdb-browser-eh.worker.js.map +7 -0
- package/dist/duckdb-browser-mvp.worker.js +33 -0
- package/dist/duckdb-browser-mvp.worker.js.map +7 -0
- package/dist/duckdb-browser.cjs +2 -0
- package/dist/duckdb-browser.cjs.map +7 -0
- package/dist/duckdb-browser.d.ts +1 -0
- package/dist/duckdb-browser.mjs +2 -0
- package/dist/duckdb-browser.mjs.map +7 -0
- package/dist/{duckdb-next-coi.wasm → duckdb-coi.wasm} +0 -0
- package/dist/{duckdb.wasm → duckdb-eh.wasm} +0 -0
- package/dist/duckdb-mvp.wasm +0 -0
- package/dist/duckdb-node-blocking.cjs +37 -0
- package/dist/duckdb-node-blocking.cjs.map +7 -0
- package/dist/duckdb-node-blocking.d.ts +1 -0
- package/dist/duckdb-node-eh.worker.cjs +37 -0
- package/dist/duckdb-node-eh.worker.cjs.map +7 -0
- package/dist/duckdb-node-mvp.worker.cjs +36 -0
- package/dist/duckdb-node-mvp.worker.cjs.map +7 -0
- package/dist/duckdb-node.cjs +2 -0
- package/dist/duckdb-node.cjs.map +7 -0
- package/dist/duckdb-node.d.ts +1 -0
- package/dist/img/duckdb.svg +6 -0
- package/dist/img/duckdb_version_badge.svg +1 -0
- package/dist/img/duckdb_wasm.svg +14 -0
- package/dist/tests-browser.js +20661 -19449
- package/dist/tests-browser.js.map +4 -4
- package/dist/tests-node.cjs +17258 -0
- package/dist/tests-node.cjs.map +7 -0
- package/dist/types/src/bindings/bindings_base.d.ts +30 -8
- package/dist/types/src/bindings/{bindings_browser_next.d.ts → bindings_browser_coi.d.ts} +0 -0
- package/dist/types/src/bindings/{bindings_browser_next_coi.d.ts → bindings_browser_eh.d.ts} +0 -0
- package/dist/types/src/bindings/{bindings_browser.d.ts → bindings_browser_mvp.d.ts} +0 -0
- package/dist/types/src/bindings/bindings_interface.d.ts +13 -5
- package/dist/types/src/bindings/{bindings_node_next.d.ts → bindings_node_eh.d.ts} +0 -0
- package/dist/types/src/bindings/{bindings_node.d.ts → bindings_node_mvp.d.ts} +0 -0
- package/dist/types/src/bindings/config.d.ts +43 -2
- package/dist/types/src/bindings/connection.d.ts +7 -7
- package/dist/types/src/bindings/index.d.ts +1 -1
- package/dist/types/src/bindings/insert_options.d.ts +3 -3
- package/dist/types/src/bindings/progress.d.ts +9 -0
- package/dist/types/src/bindings/runtime.d.ts +41 -10
- package/dist/types/src/bindings/runtime_browser.d.ts +5 -3
- package/dist/types/src/bindings/runtime_node.d.ts +2 -1
- package/dist/types/src/bindings/udf_function.d.ts +14 -0
- package/dist/types/src/bindings/udf_runtime.d.ts +3 -0
- package/dist/types/src/bindings/web_file.d.ts +11 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/json_typedef.d.ts +17 -0
- package/dist/types/src/log.d.ts +5 -2
- package/dist/types/src/parallel/async_bindings.d.ts +19 -6
- package/dist/types/src/parallel/async_bindings_interface.d.ts +6 -3
- package/dist/types/src/parallel/async_connection.d.ts +4 -6
- package/dist/types/src/parallel/worker_dispatcher.d.ts +2 -1
- package/dist/types/src/parallel/worker_request.d.ts +18 -7
- package/dist/types/src/platform.d.ts +6 -3
- package/dist/types/src/targets/duckdb-browser-blocking.d.ts +12 -0
- package/dist/types/src/targets/{duckdb-browser-async-next-coi.pthread.worker.d.ts → duckdb-browser-coi.pthread.worker.d.ts} +0 -0
- package/dist/types/src/targets/{duckdb-browser-async-next-coi.worker.d.ts → duckdb-browser-coi.worker.d.ts} +0 -0
- package/dist/types/src/targets/{duckdb-browser-async-next.worker.d.ts → duckdb-browser-eh.worker.d.ts} +0 -0
- package/dist/types/src/targets/{duckdb-browser-async.worker.d.ts → duckdb-browser-mvp.worker.d.ts} +0 -0
- package/dist/types/src/targets/duckdb-node-blocking.d.ts +13 -0
- package/dist/types/src/targets/{duckdb-node-async-next.worker.d.ts → duckdb-node-eh.worker.d.ts} +0 -0
- package/dist/types/src/targets/{duckdb-node-async.worker.d.ts → duckdb-node-mvp.worker.d.ts} +0 -0
- package/dist/types/src/targets/duckdb.d.ts +8 -0
- package/dist/types/src/utils/index.d.ts +1 -1
- package/dist/types/src/utils/s3_helper.d.ts +27 -0
- package/dist/types/src/worker.d.ts +1 -0
- package/package.json +108 -44
- package/dist/duckdb-browser-async-next-coi.d.ts +0 -1
- package/dist/duckdb-browser-async-next-coi.pthread.worker.js +0 -4
- package/dist/duckdb-browser-async-next-coi.pthread.worker.js.map +0 -7
- package/dist/duckdb-browser-async-next-coi.worker.js +0 -19
- package/dist/duckdb-browser-async-next-coi.worker.js.map +0 -7
- package/dist/duckdb-browser-async-next.d.ts +0 -1
- package/dist/duckdb-browser-async-next.worker.js +0 -19
- package/dist/duckdb-browser-async-next.worker.js.map +0 -7
- package/dist/duckdb-browser-async.d.ts +0 -1
- package/dist/duckdb-browser-async.js +0 -18
- package/dist/duckdb-browser-async.js.map +0 -7
- package/dist/duckdb-browser-async.worker.js +0 -19
- package/dist/duckdb-browser-async.worker.js.map +0 -7
- package/dist/duckdb-browser-sync-next.d.ts +0 -1
- package/dist/duckdb-browser-sync-next.js +0 -19
- package/dist/duckdb-browser-sync-next.js.map +0 -7
- package/dist/duckdb-browser-sync.d.ts +0 -1
- package/dist/duckdb-browser-sync.js +0 -19
- package/dist/duckdb-browser-sync.js.map +0 -7
- package/dist/duckdb-esm.d.ts +0 -1
- package/dist/duckdb-esm.js +0 -2
- package/dist/duckdb-esm.js.map +0 -7
- package/dist/duckdb-next.wasm +0 -0
- package/dist/duckdb-node-async-next.worker.js +0 -4
- package/dist/duckdb-node-async-next.worker.js.map +0 -7
- package/dist/duckdb-node-async.d.ts +0 -1
- package/dist/duckdb-node-async.js +0 -2
- package/dist/duckdb-node-async.js.map +0 -7
- package/dist/duckdb-node-async.worker.js +0 -3
- package/dist/duckdb-node-async.worker.js.map +0 -7
- package/dist/duckdb-node-sync-next.d.ts +0 -1
- package/dist/duckdb-node-sync-next.js +0 -4
- package/dist/duckdb-node-sync-next.js.map +0 -7
- package/dist/duckdb-node-sync.d.ts +0 -1
- package/dist/duckdb-node-sync.js +0 -3
- package/dist/duckdb-node-sync.js.map +0 -7
- package/dist/tests-node.js +0 -152
- package/dist/tests-node.js.map +0 -7
- package/dist/types/src/bindings/insert.d.ts +0 -7
- package/dist/types/src/flat_arrow.d.ts +0 -14
- package/dist/types/src/targets/duckdb-browser-async.d.ts +0 -4
- package/dist/types/src/targets/duckdb-browser-sync-next.d.ts +0 -6
- package/dist/types/src/targets/duckdb-browser-sync.d.ts +0 -6
- package/dist/types/src/targets/duckdb-esm.d.ts +0 -1
- package/dist/types/src/targets/duckdb-node-async.d.ts +0 -4
- package/dist/types/src/targets/duckdb-node-sync-next.d.ts +0 -6
- package/dist/types/src/targets/duckdb-node-sync.d.ts +0 -6
- package/dist/types/src/utils/ipc_buffer.d.ts +0 -4
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var duckdb=(()=>{var Pv=Object.create;var Js=Object.defineProperty;var Vv=Object.getOwnPropertyDescriptor;var kv=Object.getOwnPropertyNames;var Nv=Object.getPrototypeOf,Lv=Object.prototype.hasOwnProperty;var Kf=t=>Js(t,"__esModule",{value:!0});var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xv=(t,e)=>{Kf(t);for(var r in e)Js(t,r,{get:e[r],enumerable:!0})},Cv=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of kv(e))!Lv.call(t,n)&&n!=="default"&&Js(t,n,{get:()=>e[n],enumerable:!(r=Vv(e,n))||r.enumerable});return t},Ks=t=>Cv(Kf(Js(t!=null?Pv(Nv(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Rn=T(Qf=>{var _={};_.Offset;_.Table;_.SIZEOF_SHORT=2;_.SIZEOF_INT=4;_.FILE_IDENTIFIER_LENGTH=4;_.Encoding={UTF8_BYTES:1,UTF16_STRING:2};_.int32=new Int32Array(2);_.float32=new Float32Array(_.int32.buffer);_.float64=new Float64Array(_.int32.buffer);_.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;_.Long=function(t,e){this.low=t|0,this.high=e|0};_.Long.create=function(t,e){return t==0&&e==0?_.Long.ZERO:new _.Long(t,e)};_.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296};_.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high};_.Long.ZERO=new _.Long(0,0);_.Builder=function(t){if(t)var e=t;else var e=1024;this.bb=_.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1};_.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1};_.Builder.prototype.forceDefaults=function(t){this.force_defaults=t};_.Builder.prototype.dataBuffer=function(){return this.bb};_.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())};_.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var r=~(this.bb.capacity()-this.space+e)+1&t-1;this.space<r+t+e;){var n=this.bb.capacity();this.bb=_.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)};_.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)};_.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)};_.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)};_.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)};_.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)};_.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)};_.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)};_.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)};_.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)};_.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)};_.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)};_.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)};_.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)};_.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))};_.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))};_.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))};_.Builder.prototype.addFieldInt64=function(t,e,r){(this.force_defaults||!e.equals(r))&&(this.addInt64(e),this.slot(t))};_.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))};_.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))};_.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))};_.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))};_.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")};_.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")};_.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()};_.Builder.prototype.offset=function(){return this.bb.capacity()-this.space};_.Builder.growByteBuffer=function(t){var e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var r=e<<1,n=_.ByteBuffer.allocate(r);return n.setPosition(r-e),n.bytes().set(t.bytes(),r-e),n};_.Builder.prototype.addOffset=function(t){this.prep(_.SIZEOF_INT,0),this.writeInt32(this.offset()-t+_.SIZEOF_INT)};_.Builder.prototype.startObject=function(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()};_.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&this.vtable[e]==0;e--);for(var r=e+1;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);var n=2;this.addInt16(t-this.object_start);var i=(r+n)*_.SIZEOF_SHORT;this.addInt16(i);var a=0,u=this.space;e:for(e=0;e<this.vtables.length;e++){var o=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(o)){for(var p=_.SIZEOF_SHORT;p<i;p+=_.SIZEOF_SHORT)if(this.bb.readInt16(u+p)!=this.bb.readInt16(o+p))continue e;a=this.vtables[e];break}}return a?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,a-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t};_.Builder.prototype.finish=function(t,e){if(e){var r=e;if(this.prep(this.minalign,_.SIZEOF_INT+_.FILE_IDENTIFIER_LENGTH),r.length!=_.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+_.FILE_IDENTIFIER_LENGTH);for(var n=_.FILE_IDENTIFIER_LENGTH-1;n>=0;n--)this.writeInt8(r.charCodeAt(n))}this.prep(this.minalign,_.SIZEOF_INT),this.addOffset(t),this.bb.setPosition(this.space)};_.Builder.prototype.requiredField=function(t,e){var r=this.bb.capacity()-t,n=r-this.bb.readInt32(r),i=this.bb.readInt16(n+e)!=0;if(!i)throw new Error("FlatBuffers: field "+e+" must be set")};_.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(_.SIZEOF_INT,t*e),this.prep(r,t*e)};_.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()};_.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else for(var e=[],r=0;r<t.length;){var n,i=t.charCodeAt(r++);if(i<55296||i>=56320)n=i;else{var a=t.charCodeAt(r++);n=(i<<10)+a+(65536-(55296<<10)-56320)}n<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(n&63|128))}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(var r=0,u=this.space,o=this.bb.bytes();r<e.length;r++)o[u++]=e[r];return this.endVector()};_.Builder.prototype.createLong=function(t,e){return _.Long.create(t,e)};_.ByteBuffer=function(t){this.bytes_=t,this.position_=0};_.ByteBuffer.allocate=function(t){return new _.ByteBuffer(new Uint8Array(t))};_.ByteBuffer.prototype.clear=function(){this.position_=0};_.ByteBuffer.prototype.bytes=function(){return this.bytes_};_.ByteBuffer.prototype.position=function(){return this.position_};_.ByteBuffer.prototype.setPosition=function(t){this.position_=t};_.ByteBuffer.prototype.capacity=function(){return this.bytes_.length};_.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24};_.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]};_.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16};_.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8};_.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24};_.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0};_.ByteBuffer.prototype.readInt64=function(t){return new _.Long(this.readInt32(t),this.readInt32(t+4))};_.ByteBuffer.prototype.readUint64=function(t){return new _.Long(this.readUint32(t),this.readUint32(t+4))};_.ByteBuffer.prototype.readFloat32=function(t){return _.int32[0]=this.readInt32(t),_.float32[0]};_.ByteBuffer.prototype.readFloat64=function(t){return _.int32[_.isLittleEndian?0:1]=this.readInt32(t),_.int32[_.isLittleEndian?1:0]=this.readInt32(t+4),_.float64[0]};_.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e};_.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e};_.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8};_.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8};_.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24};_.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24};_.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)};_.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)};_.ByteBuffer.prototype.writeFloat32=function(t,e){_.float32[0]=e,this.writeInt32(t,_.int32[0])};_.ByteBuffer.prototype.writeFloat64=function(t,e){_.float64[0]=e,this.writeInt32(t,_.int32[_.isLittleEndian?0:1]),this.writeInt32(t+4,_.int32[_.isLittleEndian?1:0])};_.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+_.SIZEOF_INT+_.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<_.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+_.SIZEOF_INT+e));return t};_.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0};_.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t};_.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),n="",i=0;if(t+=_.SIZEOF_INT,e===_.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;i<r;){var a,u=this.readUint8(t+i++);if(u<192)a=u;else{var o=this.readUint8(t+i++);if(u<224)a=(u&31)<<6|o&63;else{var p=this.readUint8(t+i++);if(u<240)a=(u&15)<<12|(o&63)<<6|p&63;else{var s=this.readUint8(t+i++);a=(u&7)<<18|(o&63)<<12|(p&63)<<6|s&63}}}a<65536?n+=String.fromCharCode(a):(a-=65536,n+=String.fromCharCode((a>>10)+55296,(a&(1<<10)-1)+56320))}return n};_.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)};_.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+_.SIZEOF_INT};_.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))};_.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=_.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+_.FILE_IDENTIFIER_LENGTH);for(var e=0;e<_.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+_.SIZEOF_INT+e))return!1;return!0};_.ByteBuffer.prototype.createLong=function(t,e){return _.Long.create(t,e)};Qf.flatbuffers=_});var Xf=T(du=>{"use strict";function br(t,e,r){return e<=t&&t<=r}function Qs(t){if(t===void 0)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function jv(t){for(var e=String(t),r=e.length,n=0,i=[];n<r;){var a=e.charCodeAt(n);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var u=t.charCodeAt(n+1);if(56320<=u&&u<=57343){var o=a&1023,p=u&1023;i.push(65536+(o<<10)+p),n+=1}else i.push(65533)}n+=1}return i}function qv(t){for(var e="",r=0;r<t.length;++r){var n=t[r];n<=65535?e+=String.fromCharCode(n):(n-=65536,e+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return e}var Xs=-1;function cu(t){this.tokens=[].slice.call(t)}cu.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Xs},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.shift());else this.tokens.push(t)}};var Un=-1;function lu(t,e){if(t)throw TypeError("Decoder error");return e||65533}var Zs="utf-8";function ea(t,e){if(!(this instanceof ea))return new ea(t,e);if(t=t!==void 0?String(t).toLowerCase():Zs,t!==Zs)throw new Error("Encoding not supported. Only utf-8 is supported");e=Qs(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(e.fatal),this._ignoreBOM=Boolean(e.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}ea.prototype={decode:function(e,r){var n;typeof e=="object"&&e instanceof ArrayBuffer?n=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):n=new Uint8Array(0),r=Qs(r),this._streaming||(this._decoder=new Wv({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(r.stream);for(var i=new cu(n),a=[],u;!i.endOfStream()&&(u=this._decoder.handler(i,i.read()),u!==Un);)u!==null&&(Array.isArray(u)?a.push.apply(a,u):a.push(u));if(!this._streaming){do{if(u=this._decoder.handler(i,i.read()),u===Un)break;u!==null&&(Array.isArray(u)?a.push.apply(a,u):a.push(u))}while(!i.endOfStream());this._decoder=null}return a.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(a[0]===65279?(this._BOMseen=!0,a.shift()):this._BOMseen=!0),qv(a)}};function ta(t,e){if(!(this instanceof ta))return new ta(t,e);if(t=t!==void 0?String(t).toLowerCase():Zs,t!==Zs)throw new Error("Encoding not supported. Only utf-8 is supported");e=Qs(e),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(e.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}ta.prototype={encode:function(e,r){e=e?String(e):"",r=Qs(r),this._streaming||(this._encoder=new zv(this._options)),this._streaming=Boolean(r.stream);for(var n=[],i=new cu(jv(e)),a;!i.endOfStream()&&(a=this._encoder.handler(i,i.read()),a!==Un);)Array.isArray(a)?n.push.apply(n,a):n.push(a);if(!this._streaming){for(;a=this._encoder.handler(i,i.read()),a!==Un;)Array.isArray(a)?n.push.apply(n,a):n.push(a);this._encoder=null}return new Uint8Array(n)}};function Wv(t){var e=t.fatal,r=0,n=0,i=0,a=128,u=191;this.handler=function(o,p){if(p===Xs&&i!==0)return i=0,lu(e);if(p===Xs)return Un;if(i===0){if(br(p,0,127))return p;if(br(p,194,223))i=1,r=p-192;else if(br(p,224,239))p===224&&(a=160),p===237&&(u=159),i=2,r=p-224;else if(br(p,240,244))p===240&&(a=144),p===244&&(u=143),i=3,r=p-240;else return lu(e);return r=r<<6*i,null}if(!br(p,a,u))return r=i=n=0,a=128,u=191,o.prepend(p),lu(e);if(a=128,u=191,n+=1,r+=p-128<<6*(i-n),n!==i)return null;var s=r;return r=i=n=0,s}}function zv(t){var e=t.fatal;this.handler=function(r,n){if(n===Xs)return Un;if(br(n,0,127))return n;var i,a;br(n,128,2047)?(i=1,a=192):br(n,2048,65535)?(i=2,a=224):br(n,65536,1114111)&&(i=3,a=240);for(var u=[(n>>6*i)+a];i>0;){var o=n>>6*(i-1);u.push(128|o&63),i-=1}return u}}du.TextEncoder=ta;du.TextDecoder=ea});var dn=T(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.encodeUtf8=Mn.decodeUtf8=void 0;var Zf=Ee(),eh=Xf(),ra=typeof Buffer=="function"?Buffer:null,th=typeof TextDecoder=="function"&&typeof TextEncoder=="function";Mn.decodeUtf8=(t=>{if(th||!ra){let e=new t("utf-8");return r=>e.decode(r)}return e=>{let{buffer:r,byteOffset:n,length:i}=Zf.toUint8Array(e);return ra.from(r,n,i).toString()}})(typeof TextDecoder!="undefined"?TextDecoder:eh.TextDecoder);Mn.encodeUtf8=(t=>{if(th||!ra){let e=new t;return r=>e.encode(r)}return(e="")=>Zf.toUint8Array(ra.from(e,"utf8"))})(typeof TextEncoder!="undefined"?TextEncoder:eh.TextEncoder)});var Pn=T(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.AsyncQueue=dt.ReadableInterop=dt.ArrowJSON=dt.ITERATOR_DONE=void 0;var rh=Hi();dt.ITERATOR_DONE=Object.freeze({done:!0,value:void 0});var nh=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}};dt.ArrowJSON=nh;var fu=class{tee(){return this._getDOMStream().tee()}pipe(e,r){return this._getNodeStream().pipe(e,r)}pipeTo(e,r){return this._getDOMStream().pipeTo(e,r)}pipeThrough(e,r){return this._getDOMStream().pipeThrough(e,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}};dt.ReadableInterop=fu;var ih=class extends fu{constructor(){super();this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}async cancel(e){await this.return(e)}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(dt.ITERATOR_DONE);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return rh.default.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return rh.default.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}async throw(e){return await this.abort(e),dt.ITERATOR_DONE}async return(e){return await this.close(),dt.ITERATOR_DONE}async read(e){return(await this.next(e,"read")).value}async peek(e){return(await this.next(e,"peek")).value}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((r,n)=>{this.resolvers.push({resolve:r,reject:n})}):Promise.resolve(dt.ITERATOR_DONE)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error(`${this} is closed`)}};dt.AsyncQueue=ih});var st=T(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.isReadableNodeStream=U.isWritableNodeStream=U.isReadableDOMStream=U.isWritableDOMStream=U.isFetchResponse=U.isFSReadStream=U.isFileHandle=U.isUnderlyingSink=U.isIteratorResult=U.isArrayLike=U.isArrowJSON=U.isAsyncIterable=U.isIterable=U.isObservable=U.isPromise=U.isObject=U.BigUint64ArrayAvailable=U.BigUint64Array=U.BigInt64ArrayAvailable=U.BigInt64Array=U.BigIntAvailable=U.BigInt=void 0;var na=Pn(),[Hv,Yv]=(()=>{let t=()=>{throw new Error("BigInt is not available in this environment")};function e(){throw t()}return e.asIntN=()=>{throw t()},e.asUintN=()=>{throw t()},typeof BigInt!="undefined"?[BigInt,!0]:[e,!1]})();U.BigInt=Hv;U.BigIntAvailable=Yv;var[Gv,$v]=(()=>{let t=()=>{throw new Error("BigInt64Array is not available in this environment")};class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw t()}static from(){throw t()}constructor(){throw t()}}return typeof BigInt64Array!="undefined"?[BigInt64Array,!0]:[e,!1]})();U.BigInt64Array=Gv;U.BigInt64ArrayAvailable=$v;var[Jv,Kv]=(()=>{let t=()=>{throw new Error("BigUint64Array is not available in this environment")};class e{static get BYTES_PER_ELEMENT(){return 8}static of(){throw t()}static from(){throw t()}constructor(){throw t()}}return typeof BigUint64Array!="undefined"?[BigUint64Array,!0]:[e,!1]})();U.BigUint64Array=Jv;U.BigUint64ArrayAvailable=Kv;var hu=t=>typeof t=="number",sh=t=>typeof t=="boolean",Qe=t=>typeof t=="function";U.isObject=t=>t!=null&&Object(t)===t;U.isPromise=t=>U.isObject(t)&&Qe(t.then);U.isObservable=t=>U.isObject(t)&&Qe(t.subscribe);U.isIterable=t=>U.isObject(t)&&Qe(t[Symbol.iterator]);U.isAsyncIterable=t=>U.isObject(t)&&Qe(t[Symbol.asyncIterator]);U.isArrowJSON=t=>U.isObject(t)&&U.isObject(t.schema);U.isArrayLike=t=>U.isObject(t)&&hu(t.length);U.isIteratorResult=t=>U.isObject(t)&&"done"in t&&"value"in t;U.isUnderlyingSink=t=>U.isObject(t)&&Qe(t.abort)&&Qe(t.close)&&Qe(t.start)&&Qe(t.write);U.isFileHandle=t=>U.isObject(t)&&Qe(t.stat)&&hu(t.fd);U.isFSReadStream=t=>U.isReadableNodeStream(t)&&hu(t.bytesRead);U.isFetchResponse=t=>U.isObject(t)&&U.isReadableDOMStream(t.body);U.isWritableDOMStream=t=>U.isObject(t)&&Qe(t.abort)&&Qe(t.getWriter)&&!(t instanceof na.ReadableInterop);U.isReadableDOMStream=t=>U.isObject(t)&&Qe(t.cancel)&&Qe(t.getReader)&&!(t instanceof na.ReadableInterop);U.isWritableNodeStream=t=>U.isObject(t)&&Qe(t.end)&&Qe(t.write)&&sh(t.writable)&&!(t instanceof na.ReadableInterop);U.isReadableNodeStream=t=>U.isObject(t)&&Qe(t.read)&&Qe(t.pipe)&&sh(t.readable)&&!(t instanceof na.ReadableInterop)});var Ee=T(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.compareArrayLike=F.rebaseValueOffsets=F.toUint8ClampedArrayAsyncIterator=F.toFloat64ArrayAsyncIterator=F.toFloat32ArrayAsyncIterator=F.toUint32ArrayAsyncIterator=F.toUint16ArrayAsyncIterator=F.toUint8ArrayAsyncIterator=F.toInt32ArrayAsyncIterator=F.toInt16ArrayAsyncIterator=F.toInt8ArrayAsyncIterator=F.toArrayBufferViewAsyncIterator=F.toUint8ClampedArrayIterator=F.toFloat64ArrayIterator=F.toFloat32ArrayIterator=F.toUint32ArrayIterator=F.toUint16ArrayIterator=F.toUint8ArrayIterator=F.toInt32ArrayIterator=F.toInt16ArrayIterator=F.toInt8ArrayIterator=F.toArrayBufferViewIterator=F.toUint8ClampedArray=F.toFloat64Array=F.toFloat32Array=F.toBigUint64Array=F.toUint32Array=F.toUint16Array=F.toUint8Array=F.toBigInt64Array=F.toInt32Array=F.toInt16Array=F.toInt8Array=F.toArrayBufferView=F.joinUint8Arrays=F.memcpy=void 0;var Qv=Rn(),Xv=dn(),Zv=Qv.flatbuffers.ByteBuffer,fn=st(),pu=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:ArrayBuffer;function ew(t){let e=t[0]?[t[0]]:[],r,n,i,a;for(let u,o,p=0,s=0,l=t.length;++p<l;){if(u=e[s],o=t[p],!u||!o||u.buffer!==o.buffer||o.byteOffset<u.byteOffset){o&&(e[++s]=o);continue}if({byteOffset:r,byteLength:i}=u,{byteOffset:n,byteLength:a}=o,r+i<n||n+a<r){o&&(e[++s]=o);continue}e[s]=new Uint8Array(u.buffer,r,n-r+a)}return e}function yu(t,e,r=0,n=e.byteLength){let i=t.byteLength,a=new Uint8Array(t.buffer,t.byteOffset,i),u=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,i));return a.set(u,r),t}F.memcpy=yu;function tw(t,e){let r=ew(t),n=r.reduce((l,g)=>l+g.byteLength,0),i,a,u,o=0,p=-1,s=Math.min(e||1/0,n);for(let l=r.length;++p<l;){if(i=r[p],a=i.subarray(0,Math.min(i.length,s-o)),s<=o+a.length){a.length<i.length?r[p]=i.subarray(a.length):a.length===i.length&&p++,u?yu(u,a,o):u=a;break}yu(u||(u=new Uint8Array(s)),a,o),o+=a.length}return[u||new Uint8Array(0),r.slice(p),n-(u?u.byteLength:0)]}F.joinUint8Arrays=tw;function ut(t,e){let r=fn.isIteratorResult(e)?e.value:e;return r instanceof t?t===Uint8Array?new t(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=Xv.encodeUtf8(r)),r instanceof ArrayBuffer?new t(r):r instanceof pu?new t(r):r instanceof Zv?ut(t,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new t(0):new t(r.buffer,r.byteOffset,r.byteLength/t.BYTES_PER_ELEMENT):t.from(r)):new t(0)}F.toArrayBufferView=ut;F.toInt8Array=t=>ut(Int8Array,t);F.toInt16Array=t=>ut(Int16Array,t);F.toInt32Array=t=>ut(Int32Array,t);F.toBigInt64Array=t=>ut(fn.BigInt64Array,t);F.toUint8Array=t=>ut(Uint8Array,t);F.toUint16Array=t=>ut(Uint16Array,t);F.toUint32Array=t=>ut(Uint32Array,t);F.toBigUint64Array=t=>ut(fn.BigUint64Array,t);F.toFloat32Array=t=>ut(Float32Array,t);F.toFloat64Array=t=>ut(Float64Array,t);F.toUint8ClampedArray=t=>ut(Uint8ClampedArray,t);var mu=t=>(t.next(),t);function*Kt(t,e){let r=function*(i){yield i},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof pu?r(e):fn.isIterable(e)?e:r(e);return yield*mu(function*(i){let a=null;do a=i.next(yield ut(t,a));while(!a.done)}(n[Symbol.iterator]())),new t}F.toArrayBufferViewIterator=Kt;F.toInt8ArrayIterator=t=>Kt(Int8Array,t);F.toInt16ArrayIterator=t=>Kt(Int16Array,t);F.toInt32ArrayIterator=t=>Kt(Int32Array,t);F.toUint8ArrayIterator=t=>Kt(Uint8Array,t);F.toUint16ArrayIterator=t=>Kt(Uint16Array,t);F.toUint32ArrayIterator=t=>Kt(Uint32Array,t);F.toFloat32ArrayIterator=t=>Kt(Float32Array,t);F.toFloat64ArrayIterator=t=>Kt(Float64Array,t);F.toUint8ClampedArrayIterator=t=>Kt(Uint8ClampedArray,t);async function*Nt(t,e){if(fn.isPromise(e))return yield*Nt(t,await e);let r=async function*(a){yield await a},n=async function*(a){yield*mu(function*(u){let o=null;do o=u.next(yield o&&o.value);while(!o.done)}(a[Symbol.iterator]()))},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof pu?r(e):fn.isIterable(e)?n(e):fn.isAsyncIterable(e)?e:r(e);return yield*mu(async function*(a){let u=null;do u=await a.next(yield ut(t,u));while(!u.done)}(i[Symbol.asyncIterator]())),new t}F.toArrayBufferViewAsyncIterator=Nt;F.toInt8ArrayAsyncIterator=t=>Nt(Int8Array,t);F.toInt16ArrayAsyncIterator=t=>Nt(Int16Array,t);F.toInt32ArrayAsyncIterator=t=>Nt(Int32Array,t);F.toUint8ArrayAsyncIterator=t=>Nt(Uint8Array,t);F.toUint16ArrayAsyncIterator=t=>Nt(Uint16Array,t);F.toUint32ArrayAsyncIterator=t=>Nt(Uint32Array,t);F.toFloat32ArrayAsyncIterator=t=>Nt(Float32Array,t);F.toFloat64ArrayAsyncIterator=t=>Nt(Float64Array,t);F.toUint8ClampedArrayAsyncIterator=t=>Nt(Uint8ClampedArray,t);function rw(t,e,r){if(t!==0){r=r.slice(0,e+1);for(let n=-1;++n<=e;)r[n]+=t}return r}F.rebaseValueOffsets=rw;function nw(t,e){let r=0,n=t.length;if(n!==e.length)return!1;if(n>0)do if(t[r]!==e[r])return!1;while(++r<n);return!0}F.compareArrayLike=nw});var Hi=T(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});var ct=Ee();_u.default={fromIterable(t){return ia(iw(t))},fromAsyncIterable(t){return ia(sw(t))},fromDOMStream(t){return ia(aw(t))},fromNodeStream(t){return ia(ow(t))},toDOMStream(t,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(t,e){throw new Error('"toNodeStream" not available in this environment')}};var ia=t=>(t.next(),t);function*iw(t){let e,r=!1,n=[],i,a,u,o=0;function p(){return a==="peek"?ct.joinUint8Arrays(n,u)[0]:([i,n,o]=ct.joinUint8Arrays(n,u),i)}({cmd:a,size:u}=yield null);let s=ct.toUint8ArrayIterator(t)[Symbol.iterator]();try{do if({done:e,value:i}=isNaN(u-o)?s.next(void 0):s.next(u-o),!e&&i.byteLength>0&&(n.push(i),o+=i.byteLength),e||u<=o)do({cmd:a,size:u}=yield p());while(u<o);while(!e)}catch(l){(r=!0)&&typeof s.throw=="function"&&s.throw(l)}finally{r===!1&&typeof s.return=="function"&&s.return(null)}return null}async function*sw(t){let e,r=!1,n=[],i,a,u,o=0;function p(){return a==="peek"?ct.joinUint8Arrays(n,u)[0]:([i,n,o]=ct.joinUint8Arrays(n,u),i)}({cmd:a,size:u}=yield null);let s=ct.toUint8ArrayAsyncIterator(t)[Symbol.asyncIterator]();try{do if({done:e,value:i}=isNaN(u-o)?await s.next(void 0):await s.next(u-o),!e&&i.byteLength>0&&(n.push(i),o+=i.byteLength),e||u<=o)do({cmd:a,size:u}=yield p());while(u<o);while(!e)}catch(l){(r=!0)&&typeof s.throw=="function"&&await s.throw(l)}finally{r===!1&&typeof s.return=="function"&&await s.return(new Uint8Array(0))}return null}async function*aw(t){let e=!1,r=!1,n=[],i,a,u,o=0;function p(){return a==="peek"?ct.joinUint8Arrays(n,u)[0]:([i,n,o]=ct.joinUint8Arrays(n,u),i)}({cmd:a,size:u}=yield null);let s=new ah(t);try{do if({done:e,value:i}=isNaN(u-o)?await s.read(void 0):await s.read(u-o),!e&&i.byteLength>0&&(n.push(ct.toUint8Array(i)),o+=i.byteLength),e||u<=o)do({cmd:a,size:u}=yield p());while(u<o);while(!e)}catch(l){(r=!0)&&await s.cancel(l)}finally{r===!1?await s.cancel():t.locked&&s.releaseLock()}return null}var ah=class{constructor(e){this.source=e,this.byobReader=null,this.defaultReader=null;try{this.supportsBYOB=!!(this.reader=this.getBYOBReader())}catch{this.supportsBYOB=!(this.reader=this.getDefaultReader())}}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=this.byobReader=this.defaultReader=null}async cancel(e){let{reader:r,source:n}=this;r&&await r.cancel(e).catch(()=>{}),n&&n.locked&&this.releaseLock()}async read(e){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=!this.supportsBYOB||typeof e!="number"?await this.getDefaultReader().read():await this.readFromBYOBReader(e);return!r.done&&(r.value=ct.toUint8Array(r)),r}getDefaultReader(){return this.byobReader&&this.releaseLock(),this.defaultReader||(this.defaultReader=this.source.getReader(),this.defaultReader.closed.catch(()=>{})),this.reader=this.defaultReader}getBYOBReader(){return this.defaultReader&&this.releaseLock(),this.byobReader||(this.byobReader=this.source.getReader({mode:"byob"}),this.byobReader.closed.catch(()=>{})),this.reader=this.byobReader}async readFromBYOBReader(e){return await oh(this.getBYOBReader(),new ArrayBuffer(e),0,e)}};async function oh(t,e,r,n){if(r>=n)return{done:!1,value:new Uint8Array(e,0,n)};let{done:i,value:a}=await t.read(new Uint8Array(e,r,n-r));return(r+=a.byteLength)<n&&!i?await oh(t,a.buffer,r,n):{done:i,value:new Uint8Array(a.buffer,0,r)}}var bu=(t,e)=>{let r=i=>n([e,i]),n;return[e,r,new Promise(i=>(n=i)&&t.once(e,r))]};async function*ow(t){let e=[],r="error",n=!1,i=null,a,u,o=0,p=[],s;function l(){return a==="peek"?ct.joinUint8Arrays(p,u)[0]:([s,p,o]=ct.joinUint8Arrays(p,u),s)}if({cmd:a,size:u}=yield null,t.isTTY)return yield new Uint8Array(0),null;try{e[0]=bu(t,"end"),e[1]=bu(t,"error");do{if(e[2]=bu(t,"readable"),[r,i]=await Promise.race(e.map(L=>L[2])),r==="error")break;if((n=r==="end")||(isFinite(u-o)?(s=ct.toUint8Array(t.read(u-o)),s.byteLength<u-o&&(s=ct.toUint8Array(t.read(void 0)))):s=ct.toUint8Array(t.read(void 0)),s.byteLength>0&&(p.push(s),o+=s.byteLength)),n||u<=o)do({cmd:a,size:u}=yield l());while(u<o)}while(!n)}finally{await g(e,r==="error"?i:null)}return null;function g(L,oe){return s=p=null,new Promise(async(Je,Ht)=>{for(let[nt,x]of L)t.off(nt,x);try{let nt=t.destroy;nt&&nt.call(t,oe),oe=void 0}catch(nt){oe=nt||oe}finally{oe!=null?Ht(oe):Je()}})}}});var De=T(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.Vector=Vn.AbstractVector=void 0;var sa=class{};Vn.AbstractVector=sa;Vn.Vector=sa;sa.prototype.data=null});var kn=T(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.org=void 0;var se;(function(t){var e;(function(r){var n;(function(i){var a;(function(u){let o;(function(p){p[p.V1=0]="V1",p[p.V2=1]="V2",p[p.V3=2]="V3",p[p.V4=3]="V4"})(o=u.MetadataVersion||(u.MetadataVersion={}))})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){let o;(function(p){p[p.Sparse=0]="Sparse",p[p.Dense=1]="Dense"})(o=u.UnionMode||(u.UnionMode={}))})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){let o;(function(p){p[p.HALF=0]="HALF",p[p.SINGLE=1]="SINGLE",p[p.DOUBLE=2]="DOUBLE"})(o=u.Precision||(u.Precision={}))})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){let o;(function(p){p[p.DAY=0]="DAY",p[p.MILLISECOND=1]="MILLISECOND"})(o=u.DateUnit||(u.DateUnit={}))})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){let o;(function(p){p[p.SECOND=0]="SECOND",p[p.MILLISECOND=1]="MILLISECOND",p[p.MICROSECOND=2]="MICROSECOND",p[p.NANOSECOND=3]="NANOSECOND"})(o=u.TimeUnit||(u.TimeUnit={}))})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){let o;(function(p){p[p.YEAR_MONTH=0]="YEAR_MONTH",p[p.DAY_TIME=1]="DAY_TIME"})(o=u.IntervalUnit||(u.IntervalUnit={}))})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){let o;(function(p){p[p.NONE=0]="NONE",p[p.Null=1]="Null",p[p.Int=2]="Int",p[p.FloatingPoint=3]="FloatingPoint",p[p.Binary=4]="Binary",p[p.Utf8=5]="Utf8",p[p.Bool=6]="Bool",p[p.Decimal=7]="Decimal",p[p.Date=8]="Date",p[p.Time=9]="Time",p[p.Timestamp=10]="Timestamp",p[p.Interval=11]="Interval",p[p.List=12]="List",p[p.Struct_=13]="Struct_",p[p.Union=14]="Union",p[p.FixedSizeBinary=15]="FixedSizeBinary",p[p.FixedSizeList=16]="FixedSizeList",p[p.Map=17]="Map",p[p.Duration=18]="Duration",p[p.LargeBinary=19]="LargeBinary",p[p.LargeUtf8=20]="LargeUtf8",p[p.LargeList=21]="LargeList"})(o=u.Type||(u.Type={}))})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){let o;(function(p){p[p.Little=0]="Little",p[p.Big=1]="Big"})(o=u.Endianness||(u.Endianness={}))})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsNull(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}static startNull(s){s.startObject(0)}static endNull(s){return s.endObject()}static createNull(s){return o.startNull(s),o.endNull(s)}}u.Null=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsStruct_(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}static startStruct_(s){s.startObject(0)}static endStruct_(s){return s.endObject()}static createStruct_(s){return o.startStruct_(s),o.endStruct_(s)}}u.Struct_=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsList(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}static startList(s){s.startObject(0)}static endList(s){return s.endObject()}static createList(s){return o.startList(s),o.endList(s)}}u.List=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsLargeList(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}static startLargeList(s){s.startObject(0)}static endLargeList(s){return s.endObject()}static createLargeList(s){return o.startLargeList(s),o.endLargeList(s)}}u.LargeList=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsFixedSizeList(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}listSize(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}static startFixedSizeList(s){s.startObject(1)}static addListSize(s,l){s.addFieldInt32(0,l,0)}static endFixedSizeList(s){return s.endObject()}static createFixedSizeList(s,l){return o.startFixedSizeList(s),o.addListSize(s,l),o.endFixedSizeList(s)}}u.FixedSizeList=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsMap(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}keysSorted(){let s=this.bb.__offset(this.bb_pos,4);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startMap(s){s.startObject(1)}static addKeysSorted(s,l){s.addFieldInt8(0,+l,0)}static endMap(s){return s.endObject()}static createMap(s,l){return o.startMap(s),o.addKeysSorted(s,l),o.endMap(s)}}u.Map=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsUnion(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}mode(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):t.apache.arrow.flatbuf.UnionMode.Sparse}typeIds(s){let l=this.bb.__offset(this.bb_pos,6);return l?this.bb.readInt32(this.bb.__vector(this.bb_pos+l)+s*4):0}typeIdsLength(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__vector_len(this.bb_pos+s):0}typeIdsArray(){let s=this.bb.__offset(this.bb_pos,6);return s?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+s),this.bb.__vector_len(this.bb_pos+s)):null}static startUnion(s){s.startObject(2)}static addMode(s,l){s.addFieldInt16(0,l,t.apache.arrow.flatbuf.UnionMode.Sparse)}static addTypeIds(s,l){s.addFieldOffset(1,l,0)}static createTypeIdsVector(s,l){s.startVector(4,l.length,4);for(let g=l.length-1;g>=0;g--)s.addInt32(l[g]);return s.endVector()}static startTypeIdsVector(s,l){s.startVector(4,l,4)}static endUnion(s){return s.endObject()}static createUnion(s,l,g){return o.startUnion(s),o.addMode(s,l),o.addTypeIds(s,g),o.endUnion(s)}}u.Union=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsInt(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}bitWidth(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}isSigned(){let s=this.bb.__offset(this.bb_pos,6);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startInt(s){s.startObject(2)}static addBitWidth(s,l){s.addFieldInt32(0,l,0)}static addIsSigned(s,l){s.addFieldInt8(1,+l,0)}static endInt(s){return s.endObject()}static createInt(s,l,g){return o.startInt(s),o.addBitWidth(s,l),o.addIsSigned(s,g),o.endInt(s)}}u.Int=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsFloatingPoint(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}precision(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):t.apache.arrow.flatbuf.Precision.HALF}static startFloatingPoint(s){s.startObject(1)}static addPrecision(s,l){s.addFieldInt16(0,l,t.apache.arrow.flatbuf.Precision.HALF)}static endFloatingPoint(s){return s.endObject()}static createFloatingPoint(s,l){return o.startFloatingPoint(s),o.addPrecision(s,l),o.endFloatingPoint(s)}}u.FloatingPoint=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsUtf8(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}static startUtf8(s){s.startObject(0)}static endUtf8(s){return s.endObject()}static createUtf8(s){return o.startUtf8(s),o.endUtf8(s)}}u.Utf8=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsBinary(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}static startBinary(s){s.startObject(0)}static endBinary(s){return s.endObject()}static createBinary(s){return o.startBinary(s),o.endBinary(s)}}u.Binary=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsLargeUtf8(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}static startLargeUtf8(s){s.startObject(0)}static endLargeUtf8(s){return s.endObject()}static createLargeUtf8(s){return o.startLargeUtf8(s),o.endLargeUtf8(s)}}u.LargeUtf8=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsLargeBinary(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}static startLargeBinary(s){s.startObject(0)}static endLargeBinary(s){return s.endObject()}static createLargeBinary(s){return o.startLargeBinary(s),o.endLargeBinary(s)}}u.LargeBinary=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsFixedSizeBinary(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}byteWidth(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}static startFixedSizeBinary(s){s.startObject(1)}static addByteWidth(s,l){s.addFieldInt32(0,l,0)}static endFixedSizeBinary(s){return s.endObject()}static createFixedSizeBinary(s,l){return o.startFixedSizeBinary(s),o.addByteWidth(s,l),o.endFixedSizeBinary(s)}}u.FixedSizeBinary=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsBool(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}static startBool(s){s.startObject(0)}static endBool(s){return s.endObject()}static createBool(s){return o.startBool(s),o.endBool(s)}}u.Bool=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsDecimal(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}precision(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt32(this.bb_pos+s):0}scale(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.readInt32(this.bb_pos+s):0}static startDecimal(s){s.startObject(2)}static addPrecision(s,l){s.addFieldInt32(0,l,0)}static addScale(s,l){s.addFieldInt32(1,l,0)}static endDecimal(s){return s.endObject()}static createDecimal(s,l,g){return o.startDecimal(s),o.addPrecision(s,l),o.addScale(s,g),o.endDecimal(s)}}u.Decimal=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsDate(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):t.apache.arrow.flatbuf.DateUnit.MILLISECOND}static startDate(s){s.startObject(1)}static addUnit(s,l){s.addFieldInt16(0,l,t.apache.arrow.flatbuf.DateUnit.MILLISECOND)}static endDate(s){return s.endObject()}static createDate(s,l){return o.startDate(s),o.addUnit(s,l),o.endDate(s)}}u.Date=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsTime(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):t.apache.arrow.flatbuf.TimeUnit.MILLISECOND}bitWidth(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.readInt32(this.bb_pos+s):32}static startTime(s){s.startObject(2)}static addUnit(s,l){s.addFieldInt16(0,l,t.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static addBitWidth(s,l){s.addFieldInt32(1,l,32)}static endTime(s){return s.endObject()}static createTime(s,l,g){return o.startTime(s),o.addUnit(s,l),o.addBitWidth(s,g),o.endTime(s)}}u.Time=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsTimestamp(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):t.apache.arrow.flatbuf.TimeUnit.SECOND}timezone(s){let l=this.bb.__offset(this.bb_pos,6);return l?this.bb.__string(this.bb_pos+l,s):null}static startTimestamp(s){s.startObject(2)}static addUnit(s,l){s.addFieldInt16(0,l,t.apache.arrow.flatbuf.TimeUnit.SECOND)}static addTimezone(s,l){s.addFieldOffset(1,l,0)}static endTimestamp(s){return s.endObject()}static createTimestamp(s,l,g){return o.startTimestamp(s),o.addUnit(s,l),o.addTimezone(s,g),o.endTimestamp(s)}}u.Timestamp=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsInterval(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):t.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH}static startInterval(s){s.startObject(1)}static addUnit(s,l){s.addFieldInt16(0,l,t.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH)}static endInterval(s){return s.endObject()}static createInterval(s,l){return o.startInterval(s),o.addUnit(s,l),o.endInterval(s)}}u.Interval=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsDuration(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}unit(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):t.apache.arrow.flatbuf.TimeUnit.MILLISECOND}static startDuration(s){s.startObject(1)}static addUnit(s,l){s.addFieldInt16(0,l,t.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static endDuration(s){return s.endObject()}static createDuration(s,l){return o.startDuration(s),o.addUnit(s,l),o.endDuration(s)}}u.Duration=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsKeyValue(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}key(s){let l=this.bb.__offset(this.bb_pos,4);return l?this.bb.__string(this.bb_pos+l,s):null}value(s){let l=this.bb.__offset(this.bb_pos,6);return l?this.bb.__string(this.bb_pos+l,s):null}static startKeyValue(s){s.startObject(2)}static addKey(s,l){s.addFieldOffset(0,l,0)}static addValue(s,l){s.addFieldOffset(1,l,0)}static endKeyValue(s){return s.endObject()}static createKeyValue(s,l,g){return o.startKeyValue(s),o.addKey(s,l),o.addValue(s,g),o.endKeyValue(s)}}u.KeyValue=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsDictionaryEncoding(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}id(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}indexType(s){let l=this.bb.__offset(this.bb_pos,6);return l?(s||new t.apache.arrow.flatbuf.Int).__init(this.bb.__indirect(this.bb_pos+l),this.bb):null}isOrdered(){let s=this.bb.__offset(this.bb_pos,8);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startDictionaryEncoding(s){s.startObject(3)}static addId(s,l){s.addFieldInt64(0,l,s.createLong(0,0))}static addIndexType(s,l){s.addFieldOffset(1,l,0)}static addIsOrdered(s,l){s.addFieldInt8(2,+l,0)}static endDictionaryEncoding(s){return s.endObject()}static createDictionaryEncoding(s,l,g,L){return o.startDictionaryEncoding(s),o.addId(s,l),o.addIndexType(s,g),o.addIsOrdered(s,L),o.endDictionaryEncoding(s)}}u.DictionaryEncoding=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsField(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}name(s){let l=this.bb.__offset(this.bb_pos,4);return l?this.bb.__string(this.bb_pos+l,s):null}nullable(){let s=this.bb.__offset(this.bb_pos,6);return s?!!this.bb.readInt8(this.bb_pos+s):!1}typeType(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.readUint8(this.bb_pos+s):t.apache.arrow.flatbuf.Type.NONE}type(s){let l=this.bb.__offset(this.bb_pos,10);return l?this.bb.__union(s,this.bb_pos+l):null}dictionary(s){let l=this.bb.__offset(this.bb_pos,12);return l?(s||new t.apache.arrow.flatbuf.DictionaryEncoding).__init(this.bb.__indirect(this.bb_pos+l),this.bb):null}children(s,l){let g=this.bb.__offset(this.bb_pos,14);return g?(l||new t.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+g)+s*4),this.bb):null}childrenLength(){let s=this.bb.__offset(this.bb_pos,14);return s?this.bb.__vector_len(this.bb_pos+s):0}customMetadata(s,l){let g=this.bb.__offset(this.bb_pos,16);return g?(l||new t.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+g)+s*4),this.bb):null}customMetadataLength(){let s=this.bb.__offset(this.bb_pos,16);return s?this.bb.__vector_len(this.bb_pos+s):0}static startField(s){s.startObject(7)}static addName(s,l){s.addFieldOffset(0,l,0)}static addNullable(s,l){s.addFieldInt8(1,+l,0)}static addTypeType(s,l){s.addFieldInt8(2,l,t.apache.arrow.flatbuf.Type.NONE)}static addType(s,l){s.addFieldOffset(3,l,0)}static addDictionary(s,l){s.addFieldOffset(4,l,0)}static addChildren(s,l){s.addFieldOffset(5,l,0)}static createChildrenVector(s,l){s.startVector(4,l.length,4);for(let g=l.length-1;g>=0;g--)s.addOffset(l[g]);return s.endVector()}static startChildrenVector(s,l){s.startVector(4,l,4)}static addCustomMetadata(s,l){s.addFieldOffset(6,l,0)}static createCustomMetadataVector(s,l){s.startVector(4,l.length,4);for(let g=l.length-1;g>=0;g--)s.addOffset(l[g]);return s.endVector()}static startCustomMetadataVector(s,l){s.startVector(4,l,4)}static endField(s){return s.endObject()}static createField(s,l,g,L,oe,Je,Ht,nt){return o.startField(s),o.addName(s,l),o.addNullable(s,g),o.addTypeType(s,L),o.addType(s,oe),o.addDictionary(s,Je),o.addChildren(s,Ht),o.addCustomMetadata(s,nt),o.endField(s)}}u.Field=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static createBuffer(s,l,g){return s.prep(8,16),s.writeInt64(g),s.writeInt64(l),s.offset()}}u.Buffer=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsSchema(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}endianness(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):t.apache.arrow.flatbuf.Endianness.Little}fields(s,l){let g=this.bb.__offset(this.bb_pos,6);return g?(l||new t.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+g)+s*4),this.bb):null}fieldsLength(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__vector_len(this.bb_pos+s):0}customMetadata(s,l){let g=this.bb.__offset(this.bb_pos,8);return g?(l||new t.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+g)+s*4),this.bb):null}customMetadataLength(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__vector_len(this.bb_pos+s):0}static startSchema(s){s.startObject(3)}static addEndianness(s,l){s.addFieldInt16(0,l,t.apache.arrow.flatbuf.Endianness.Little)}static addFields(s,l){s.addFieldOffset(1,l,0)}static createFieldsVector(s,l){s.startVector(4,l.length,4);for(let g=l.length-1;g>=0;g--)s.addOffset(l[g]);return s.endVector()}static startFieldsVector(s,l){s.startVector(4,l,4)}static addCustomMetadata(s,l){s.addFieldOffset(2,l,0)}static createCustomMetadataVector(s,l){s.startVector(4,l.length,4);for(let g=l.length-1;g>=0;g--)s.addOffset(l[g]);return s.endVector()}static startCustomMetadataVector(s,l){s.startVector(4,l,4)}static endSchema(s){return s.endObject()}static finishSchemaBuffer(s,l){s.finish(l)}static createSchema(s,l,g,L){return o.startSchema(s),o.addEndianness(s,l),o.addFields(s,g),o.addCustomMetadata(s,L),o.endSchema(s)}}u.Schema=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(se=E.org||(E.org={}))});var gu=T(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.org=void 0;var Yi=kn(),Nn;(function(t){var e;(function(r){var n;(function(i){var a;(function(u){u.Schema=Yi.org.apache.arrow.flatbuf.Schema})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(Nn=lt.org||(lt.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){let o;(function(p){p[p.NONE=0]="NONE",p[p.Schema=1]="Schema",p[p.DictionaryBatch=2]="DictionaryBatch",p[p.RecordBatch=3]="RecordBatch",p[p.Tensor=4]="Tensor",p[p.SparseTensor=5]="SparseTensor"})(o=u.MessageHeader||(u.MessageHeader={}))})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(Nn=lt.org||(lt.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static createFieldNode(s,l,g){return s.prep(8,16),s.writeInt64(g),s.writeInt64(l),s.offset()}}u.FieldNode=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(Nn=lt.org||(lt.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsRecordBatch(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}length(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}nodes(s,l){let g=this.bb.__offset(this.bb_pos,6);return g?(l||new t.apache.arrow.flatbuf.FieldNode).__init(this.bb.__vector(this.bb_pos+g)+s*16,this.bb):null}nodesLength(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__vector_len(this.bb_pos+s):0}buffers(s,l){let g=this.bb.__offset(this.bb_pos,8);return g?(l||new Yi.org.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos+g)+s*16,this.bb):null}buffersLength(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__vector_len(this.bb_pos+s):0}static startRecordBatch(s){s.startObject(3)}static addLength(s,l){s.addFieldInt64(0,l,s.createLong(0,0))}static addNodes(s,l){s.addFieldOffset(1,l,0)}static startNodesVector(s,l){s.startVector(16,l,8)}static addBuffers(s,l){s.addFieldOffset(2,l,0)}static startBuffersVector(s,l){s.startVector(16,l,8)}static endRecordBatch(s){return s.endObject()}static createRecordBatch(s,l,g,L){return o.startRecordBatch(s),o.addLength(s,l),o.addNodes(s,g),o.addBuffers(s,L),o.endRecordBatch(s)}}u.RecordBatch=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(Nn=lt.org||(lt.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsDictionaryBatch(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}id(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}data(s){let l=this.bb.__offset(this.bb_pos,6);return l?(s||new t.apache.arrow.flatbuf.RecordBatch).__init(this.bb.__indirect(this.bb_pos+l),this.bb):null}isDelta(){let s=this.bb.__offset(this.bb_pos,8);return s?!!this.bb.readInt8(this.bb_pos+s):!1}static startDictionaryBatch(s){s.startObject(3)}static addId(s,l){s.addFieldInt64(0,l,s.createLong(0,0))}static addData(s,l){s.addFieldOffset(1,l,0)}static addIsDelta(s,l){s.addFieldInt8(2,+l,0)}static endDictionaryBatch(s){return s.endObject()}static createDictionaryBatch(s,l,g,L){return o.startDictionaryBatch(s),o.addId(s,l),o.addData(s,g),o.addIsDelta(s,L),o.endDictionaryBatch(s)}}u.DictionaryBatch=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(Nn=lt.org||(lt.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsMessage(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}version(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):Yi.org.apache.arrow.flatbuf.MetadataVersion.V1}headerType(){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.readUint8(this.bb_pos+s):t.apache.arrow.flatbuf.MessageHeader.NONE}header(s){let l=this.bb.__offset(this.bb_pos,8);return l?this.bb.__union(s,this.bb_pos+l):null}bodyLength(){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.readInt64(this.bb_pos+s):this.bb.createLong(0,0)}customMetadata(s,l){let g=this.bb.__offset(this.bb_pos,12);return g?(l||new Yi.org.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+g)+s*4),this.bb):null}customMetadataLength(){let s=this.bb.__offset(this.bb_pos,12);return s?this.bb.__vector_len(this.bb_pos+s):0}static startMessage(s){s.startObject(5)}static addVersion(s,l){s.addFieldInt16(0,l,Yi.org.apache.arrow.flatbuf.MetadataVersion.V1)}static addHeaderType(s,l){s.addFieldInt8(1,l,t.apache.arrow.flatbuf.MessageHeader.NONE)}static addHeader(s,l){s.addFieldOffset(2,l,0)}static addBodyLength(s,l){s.addFieldInt64(3,l,s.createLong(0,0))}static addCustomMetadata(s,l){s.addFieldOffset(4,l,0)}static createCustomMetadataVector(s,l){s.startVector(4,l.length,4);for(let g=l.length-1;g>=0;g--)s.addOffset(l[g]);return s.endVector()}static startCustomMetadataVector(s,l){s.startVector(4,l,4)}static endMessage(s){return s.endObject()}static finishMessageBuffer(s,l){s.finish(l)}static createMessage(s,l,g,L,oe,Je){return o.startMessage(s),o.addVersion(s,l),o.addHeaderType(s,g),o.addHeader(s,L),o.addBodyLength(s,oe),o.addCustomMetadata(s,Je),o.endMessage(s)}}u.Message=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(Nn=lt.org||(lt.org={}))});var pe=T(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.BufferType=be.Type=be.MetadataVersion=be.MessageHeader=be.IntervalUnit=be.UnionMode=be.Precision=be.TimeUnit=be.DateUnit=be.ArrowType=void 0;var hn=kn(),uw=gu();be.ArrowType=hn.org.apache.arrow.flatbuf.Type;be.DateUnit=hn.org.apache.arrow.flatbuf.DateUnit;be.TimeUnit=hn.org.apache.arrow.flatbuf.TimeUnit;be.Precision=hn.org.apache.arrow.flatbuf.Precision;be.UnionMode=hn.org.apache.arrow.flatbuf.UnionMode;be.IntervalUnit=hn.org.apache.arrow.flatbuf.IntervalUnit;be.MessageHeader=uw.org.apache.arrow.flatbuf.MessageHeader;be.MetadataVersion=hn.org.apache.arrow.flatbuf.MetadataVersion;var cw;(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"})(cw=be.Type||(be.Type={}));var lw;(function(t){t[t.OFFSET=0]="OFFSET",t[t.DATA=1]="DATA",t[t.VALIDITY=2]="VALIDITY",t[t.TYPE=3]="TYPE"})(lw=be.BufferType||(be.BufferType={}))});var Qt=T(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.popcnt_uint32=Re.popcnt_array=Re.popcnt_bit_range=Re.iterateBits=Re.packBools=Re.truncateBitmap=Re.setBool=Re.getBit=Re.getBool=void 0;function uh(t,e,r,n){return(r&1<<n)!=0}Re.getBool=uh;function ch(t,e,r,n){return(r&1<<n)>>n}Re.getBit=ch;function dw(t,e,r){return r?!!(t[e>>3]|=1<<e%8)||!0:!(t[e>>3]&=~(1<<e%8))&&!1}Re.setBool=dw;function fw(t,e,r){let n=r.byteLength+7&~7;if(t>0||r.byteLength<n){let i=new Uint8Array(n);return i.set(t%8==0?r.subarray(t>>3):lh(vu(r,t,e,null,uh)).subarray(0,n)),i}return r}Re.truncateBitmap=fw;function lh(t){let e=[],r=0,n=0,i=0;for(let u of t)u&&(i|=1<<n),++n==8&&(e[r++]=i,i=n=0);(r===0||n>0)&&(e[r++]=i);let a=new Uint8Array(e.length+7&~7);return a.set(e),a}Re.packBools=lh;function*vu(t,e,r,n,i){let a=e%8,u=e>>3,o=0,p=r;for(;p>0;a=0){let s=t[u++];do yield i(n,o++,s,a);while(--p>0&&++a<8)}}Re.iterateBits=vu;function wu(t,e,r){if(r-e<=0)return 0;if(r-e<8){let a=0;for(let u of vu(t,e,r-e,t,ch))a+=u;return a}let n=r>>3<<3,i=e+(e%8==0?0:8-e%8);return wu(t,e,i)+wu(t,n,r)+dh(t,i>>3,n-i>>3)}Re.popcnt_bit_range=wu;function dh(t,e,r){let n=0,i=e|0,a=new DataView(t.buffer,t.byteOffset,t.byteLength),u=r===void 0?t.byteLength:i+r;for(;u-i>=4;)n+=aa(a.getUint32(i)),i+=4;for(;u-i>=2;)n+=aa(a.getUint16(i)),i+=2;for(;u-i>=1;)n+=aa(a.getUint8(i)),i+=1;return n}Re.popcnt_array=dh;function aa(t){let e=t|0;return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}Re.popcnt_uint32=aa});var Xe=T(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.Visitor=void 0;var hw=Lt(),pw=De(),v=pe(),yw=ce(),fe=class{visitMany(e,...r){return e.map((n,i)=>this.visit(n,...r.map(a=>a[i])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,r=!0){return mw(this,e,r)}visitNull(e,...r){return null}visitBool(e,...r){return null}visitInt(e,...r){return null}visitFloat(e,...r){return null}visitUtf8(e,...r){return null}visitBinary(e,...r){return null}visitFixedSizeBinary(e,...r){return null}visitDate(e,...r){return null}visitTimestamp(e,...r){return null}visitTime(e,...r){return null}visitDecimal(e,...r){return null}visitList(e,...r){return null}visitStruct(e,...r){return null}visitUnion(e,...r){return null}visitDictionary(e,...r){return null}visitInterval(e,...r){return null}visitFixedSizeList(e,...r){return null}visitMap(e,...r){return null}};oa.Visitor=fe;function mw(t,e,r=!0){let n=null,i=v.Type.NONE;switch(e instanceof hw.Data||e instanceof pw.Vector?i=Tu(e.type):e instanceof yw.DataType?i=Tu(e):typeof(i=e)!="number"&&(i=v.Type[e]),i){case v.Type.Null:n=t.visitNull;break;case v.Type.Bool:n=t.visitBool;break;case v.Type.Int:n=t.visitInt;break;case v.Type.Int8:n=t.visitInt8||t.visitInt;break;case v.Type.Int16:n=t.visitInt16||t.visitInt;break;case v.Type.Int32:n=t.visitInt32||t.visitInt;break;case v.Type.Int64:n=t.visitInt64||t.visitInt;break;case v.Type.Uint8:n=t.visitUint8||t.visitInt;break;case v.Type.Uint16:n=t.visitUint16||t.visitInt;break;case v.Type.Uint32:n=t.visitUint32||t.visitInt;break;case v.Type.Uint64:n=t.visitUint64||t.visitInt;break;case v.Type.Float:n=t.visitFloat;break;case v.Type.Float16:n=t.visitFloat16||t.visitFloat;break;case v.Type.Float32:n=t.visitFloat32||t.visitFloat;break;case v.Type.Float64:n=t.visitFloat64||t.visitFloat;break;case v.Type.Utf8:n=t.visitUtf8;break;case v.Type.Binary:n=t.visitBinary;break;case v.Type.FixedSizeBinary:n=t.visitFixedSizeBinary;break;case v.Type.Date:n=t.visitDate;break;case v.Type.DateDay:n=t.visitDateDay||t.visitDate;break;case v.Type.DateMillisecond:n=t.visitDateMillisecond||t.visitDate;break;case v.Type.Timestamp:n=t.visitTimestamp;break;case v.Type.TimestampSecond:n=t.visitTimestampSecond||t.visitTimestamp;break;case v.Type.TimestampMillisecond:n=t.visitTimestampMillisecond||t.visitTimestamp;break;case v.Type.TimestampMicrosecond:n=t.visitTimestampMicrosecond||t.visitTimestamp;break;case v.Type.TimestampNanosecond:n=t.visitTimestampNanosecond||t.visitTimestamp;break;case v.Type.Time:n=t.visitTime;break;case v.Type.TimeSecond:n=t.visitTimeSecond||t.visitTime;break;case v.Type.TimeMillisecond:n=t.visitTimeMillisecond||t.visitTime;break;case v.Type.TimeMicrosecond:n=t.visitTimeMicrosecond||t.visitTime;break;case v.Type.TimeNanosecond:n=t.visitTimeNanosecond||t.visitTime;break;case v.Type.Decimal:n=t.visitDecimal;break;case v.Type.List:n=t.visitList;break;case v.Type.Struct:n=t.visitStruct;break;case v.Type.Union:n=t.visitUnion;break;case v.Type.DenseUnion:n=t.visitDenseUnion||t.visitUnion;break;case v.Type.SparseUnion:n=t.visitSparseUnion||t.visitUnion;break;case v.Type.Dictionary:n=t.visitDictionary;break;case v.Type.Interval:n=t.visitInterval;break;case v.Type.IntervalDayTime:n=t.visitIntervalDayTime||t.visitInterval;break;case v.Type.IntervalYearMonth:n=t.visitIntervalYearMonth||t.visitInterval;break;case v.Type.FixedSizeList:n=t.visitFixedSizeList;break;case v.Type.Map:n=t.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error(`Unrecognized type '${v.Type[i]}'`)}function Tu(t){switch(t.typeId){case v.Type.Null:return v.Type.Null;case v.Type.Int:let{bitWidth:e,isSigned:r}=t;switch(e){case 8:return r?v.Type.Int8:v.Type.Uint8;case 16:return r?v.Type.Int16:v.Type.Uint16;case 32:return r?v.Type.Int32:v.Type.Uint32;case 64:return r?v.Type.Int64:v.Type.Uint64}return v.Type.Int;case v.Type.Float:switch(t.precision){case v.Precision.HALF:return v.Type.Float16;case v.Precision.SINGLE:return v.Type.Float32;case v.Precision.DOUBLE:return v.Type.Float64}return v.Type.Float;case v.Type.Binary:return v.Type.Binary;case v.Type.Utf8:return v.Type.Utf8;case v.Type.Bool:return v.Type.Bool;case v.Type.Decimal:return v.Type.Decimal;case v.Type.Time:switch(t.unit){case v.TimeUnit.SECOND:return v.Type.TimeSecond;case v.TimeUnit.MILLISECOND:return v.Type.TimeMillisecond;case v.TimeUnit.MICROSECOND:return v.Type.TimeMicrosecond;case v.TimeUnit.NANOSECOND:return v.Type.TimeNanosecond}return v.Type.Time;case v.Type.Timestamp:switch(t.unit){case v.TimeUnit.SECOND:return v.Type.TimestampSecond;case v.TimeUnit.MILLISECOND:return v.Type.TimestampMillisecond;case v.TimeUnit.MICROSECOND:return v.Type.TimestampMicrosecond;case v.TimeUnit.NANOSECOND:return v.Type.TimestampNanosecond}return v.Type.Timestamp;case v.Type.Date:switch(t.unit){case v.DateUnit.DAY:return v.Type.DateDay;case v.DateUnit.MILLISECOND:return v.Type.DateMillisecond}return v.Type.Date;case v.Type.Interval:switch(t.unit){case v.IntervalUnit.DAY_TIME:return v.Type.IntervalDayTime;case v.IntervalUnit.YEAR_MONTH:return v.Type.IntervalYearMonth}return v.Type.Interval;case v.Type.Map:return v.Type.Map;case v.Type.List:return v.Type.List;case v.Type.Struct:return v.Type.Struct;case v.Type.Union:switch(t.mode){case v.UnionMode.Dense:return v.Type.DenseUnion;case v.UnionMode.Sparse:return v.Type.SparseUnion}return v.Type.Union;case v.Type.FixedSizeBinary:return v.Type.FixedSizeBinary;case v.Type.FixedSizeList:return v.Type.FixedSizeList;case v.Type.Dictionary:return v.Type.Dictionary}throw new Error(`Unrecognized type '${v.Type[t.typeId]}'`)}fe.prototype.visitInt8=null;fe.prototype.visitInt16=null;fe.prototype.visitInt32=null;fe.prototype.visitInt64=null;fe.prototype.visitUint8=null;fe.prototype.visitUint16=null;fe.prototype.visitUint32=null;fe.prototype.visitUint64=null;fe.prototype.visitFloat16=null;fe.prototype.visitFloat32=null;fe.prototype.visitFloat64=null;fe.prototype.visitDateDay=null;fe.prototype.visitDateMillisecond=null;fe.prototype.visitTimestampSecond=null;fe.prototype.visitTimestampMillisecond=null;fe.prototype.visitTimestampMicrosecond=null;fe.prototype.visitTimestampNanosecond=null;fe.prototype.visitTimeSecond=null;fe.prototype.visitTimeMillisecond=null;fe.prototype.visitTimeMicrosecond=null;fe.prototype.visitTimeNanosecond=null;fe.prototype.visitDenseUnion=null;fe.prototype.visitSparseUnion=null;fe.prototype.visitIntervalDayTime=null;fe.prototype.visitIntervalYearMonth=null});var Ou=T(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.instance=at.TypeComparator=void 0;var bw=Xe(),j=class extends bw.Visitor{compareSchemas(e,r){return e===r||r instanceof e.constructor&&at.instance.compareFields(e.fields,r.fields)}compareFields(e,r){return e===r||Array.isArray(e)&&Array.isArray(r)&&e.length===r.length&&e.every((n,i)=>at.instance.compareField(n,r[i]))}compareField(e,r){return e===r||r instanceof e.constructor&&e.name===r.name&&e.nullable===r.nullable&&at.instance.visit(e.type,r.type)}};at.TypeComparator=j;function ft(t,e){return e instanceof t.constructor}function Gi(t,e){return t===e||ft(t,e)}function _r(t,e){return t===e||ft(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function ua(t,e){return t===e||ft(t,e)&&t.precision===e.precision}function _w(t,e){return t===e||ft(t,e)&&t.byteWidth===e.byteWidth}function Bu(t,e){return t===e||ft(t,e)&&t.unit===e.unit}function $i(t,e){return t===e||ft(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function Ji(t,e){return t===e||ft(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function gw(t,e){return t===e||ft(t,e)&&t.children.length===e.children.length&&at.instance.compareFields(t.children,e.children)}function vw(t,e){return t===e||ft(t,e)&&t.children.length===e.children.length&&at.instance.compareFields(t.children,e.children)}function Iu(t,e){return t===e||ft(t,e)&&t.mode===e.mode&&t.typeIds.every((r,n)=>r===e.typeIds[n])&&at.instance.compareFields(t.children,e.children)}function ww(t,e){return t===e||ft(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&at.instance.visit(t.indices,e.indices)&&at.instance.visit(t.dictionary,e.dictionary)}function Su(t,e){return t===e||ft(t,e)&&t.unit===e.unit}function Tw(t,e){return t===e||ft(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&at.instance.compareFields(t.children,e.children)}function Bw(t,e){return t===e||ft(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&at.instance.compareFields(t.children,e.children)}j.prototype.visitNull=Gi;j.prototype.visitBool=Gi;j.prototype.visitInt=_r;j.prototype.visitInt8=_r;j.prototype.visitInt16=_r;j.prototype.visitInt32=_r;j.prototype.visitInt64=_r;j.prototype.visitUint8=_r;j.prototype.visitUint16=_r;j.prototype.visitUint32=_r;j.prototype.visitUint64=_r;j.prototype.visitFloat=ua;j.prototype.visitFloat16=ua;j.prototype.visitFloat32=ua;j.prototype.visitFloat64=ua;j.prototype.visitUtf8=Gi;j.prototype.visitBinary=Gi;j.prototype.visitFixedSizeBinary=_w;j.prototype.visitDate=Bu;j.prototype.visitDateDay=Bu;j.prototype.visitDateMillisecond=Bu;j.prototype.visitTimestamp=$i;j.prototype.visitTimestampSecond=$i;j.prototype.visitTimestampMillisecond=$i;j.prototype.visitTimestampMicrosecond=$i;j.prototype.visitTimestampNanosecond=$i;j.prototype.visitTime=Ji;j.prototype.visitTimeSecond=Ji;j.prototype.visitTimeMillisecond=Ji;j.prototype.visitTimeMicrosecond=Ji;j.prototype.visitTimeNanosecond=Ji;j.prototype.visitDecimal=Gi;j.prototype.visitList=gw;j.prototype.visitStruct=vw;j.prototype.visitUnion=Iu;j.prototype.visitDenseUnion=Iu;j.prototype.visitSparseUnion=Iu;j.prototype.visitDictionary=ww;j.prototype.visitInterval=Su;j.prototype.visitIntervalDayTime=Su;j.prototype.visitIntervalYearMonth=Su;j.prototype.visitFixedSizeList=Tw;j.prototype.visitMap=Bw;at.instance=new j});var ce=T(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.strideForType=S.Dictionary=S.Map_=S.FixedSizeList=S.FixedSizeBinary=S.SparseUnion=S.DenseUnion=S.Union=S.Struct=S.List=S.IntervalYearMonth=S.IntervalDayTime=S.Interval=S.TimestampNanosecond=S.TimestampMicrosecond=S.TimestampMillisecond=S.TimestampSecond=S.Timestamp=S.TimeNanosecond=S.TimeMicrosecond=S.TimeMillisecond=S.TimeSecond=S.Time=S.DateMillisecond=S.DateDay=S.Date_=S.Decimal=S.Bool=S.Utf8=S.Binary=S.Float64=S.Float32=S.Float16=S.Float=S.Uint64=S.Uint32=S.Uint16=S.Uint8=S.Int64=S.Int32=S.Int16=S.Int8=S.Int=S.Null=S.DataType=void 0;var Iw=Ou(),R=pe(),Be=class{static isNull(e){return e&&e.typeId===R.Type.Null}static isInt(e){return e&&e.typeId===R.Type.Int}static isFloat(e){return e&&e.typeId===R.Type.Float}static isBinary(e){return e&&e.typeId===R.Type.Binary}static isUtf8(e){return e&&e.typeId===R.Type.Utf8}static isBool(e){return e&&e.typeId===R.Type.Bool}static isDecimal(e){return e&&e.typeId===R.Type.Decimal}static isDate(e){return e&&e.typeId===R.Type.Date}static isTime(e){return e&&e.typeId===R.Type.Time}static isTimestamp(e){return e&&e.typeId===R.Type.Timestamp}static isInterval(e){return e&&e.typeId===R.Type.Interval}static isList(e){return e&&e.typeId===R.Type.List}static isStruct(e){return e&&e.typeId===R.Type.Struct}static isUnion(e){return e&&e.typeId===R.Type.Union}static isFixedSizeBinary(e){return e&&e.typeId===R.Type.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===R.Type.FixedSizeList}static isMap(e){return e&&e.typeId===R.Type.Map}static isDictionary(e){return e&&e.typeId===R.Type.Dictionary}get typeId(){return R.Type.NONE}compareTo(e){return Iw.instance.visit(this,e)}};S.DataType=Be;Be[Symbol.toStringTag]=(t=>(t.children=null,t.ArrayType=Array,t[Symbol.toStringTag]="DataType"))(Be.prototype);var ca=class extends Be{toString(){return"Null"}get typeId(){return R.Type.Null}};S.Null=ca;ca[Symbol.toStringTag]=(t=>t[Symbol.toStringTag]="Null")(ca.prototype);var Bt=class extends Be{constructor(e,r){super();this.isSigned=e,this.bitWidth=r}get typeId(){return R.Type.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?Int32Array:Uint32Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};S.Int=Bt;Bt[Symbol.toStringTag]=(t=>(t.isSigned=null,t.bitWidth=null,t[Symbol.toStringTag]="Int"))(Bt.prototype);var Au=class extends Bt{constructor(){super(!0,8)}};S.Int8=Au;var Du=class extends Bt{constructor(){super(!0,16)}};S.Int16=Du;var Fu=class extends Bt{constructor(){super(!0,32)}};S.Int32=Fu;var Eu=class extends Bt{constructor(){super(!0,64)}};S.Int64=Eu;var Ru=class extends Bt{constructor(){super(!1,8)}};S.Uint8=Ru;var Uu=class extends Bt{constructor(){super(!1,16)}};S.Uint16=Uu;var Mu=class extends Bt{constructor(){super(!1,32)}};S.Uint32=Mu;var Pu=class extends Bt{constructor(){super(!1,64)}};S.Uint64=Pu;Object.defineProperty(Au.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Du.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Fu.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Eu.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Ru.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Uu.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Mu.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Pu.prototype,"ArrayType",{value:Uint32Array});var pn=class extends Be{constructor(e){super();this.precision=e}get typeId(){return R.Type.Float}get ArrayType(){switch(this.precision){case R.Precision.HALF:return Uint16Array;case R.Precision.SINGLE:return Float32Array;case R.Precision.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};S.Float=pn;pn[Symbol.toStringTag]=(t=>(t.precision=null,t[Symbol.toStringTag]="Float"))(pn.prototype);var Vu=class extends pn{constructor(){super(R.Precision.HALF)}};S.Float16=Vu;var ku=class extends pn{constructor(){super(R.Precision.SINGLE)}};S.Float32=ku;var Nu=class extends pn{constructor(){super(R.Precision.DOUBLE)}};S.Float64=Nu;Object.defineProperty(Vu.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(ku.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Nu.prototype,"ArrayType",{value:Float64Array});var la=class extends Be{constructor(){super()}get typeId(){return R.Type.Binary}toString(){return"Binary"}};S.Binary=la;la[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Binary"))(la.prototype);var da=class extends Be{constructor(){super()}get typeId(){return R.Type.Utf8}toString(){return"Utf8"}};S.Utf8=da;da[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8"))(da.prototype);var fa=class extends Be{constructor(){super()}get typeId(){return R.Type.Bool}toString(){return"Bool"}};S.Bool=fa;fa[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Bool"))(fa.prototype);var ha=class extends Be{constructor(e,r){super();this.scale=e,this.precision=r}get typeId(){return R.Type.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};S.Decimal=ha;ha[Symbol.toStringTag]=(t=>(t.scale=null,t.precision=null,t.ArrayType=Uint32Array,t[Symbol.toStringTag]="Decimal"))(ha.prototype);var Ln=class extends Be{constructor(e){super();this.unit=e}get typeId(){return R.Type.Date}toString(){return`Date${(this.unit+1)*32}<${R.DateUnit[this.unit]}>`}};S.Date_=Ln;Ln[Symbol.toStringTag]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Date"))(Ln.prototype);var fh=class extends Ln{constructor(){super(R.DateUnit.DAY)}};S.DateDay=fh;var hh=class extends Ln{constructor(){super(R.DateUnit.MILLISECOND)}};S.DateMillisecond=hh;var Fr=class extends Be{constructor(e,r){super();this.unit=e,this.bitWidth=r}get typeId(){return R.Type.Time}toString(){return`Time${this.bitWidth}<${R.TimeUnit[this.unit]}>`}};S.Time=Fr;Fr[Symbol.toStringTag]=(t=>(t.unit=null,t.bitWidth=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Time"))(Fr.prototype);var ph=class extends Fr{constructor(){super(R.TimeUnit.SECOND,32)}};S.TimeSecond=ph;var yh=class extends Fr{constructor(){super(R.TimeUnit.MILLISECOND,32)}};S.TimeMillisecond=yh;var mh=class extends Fr{constructor(){super(R.TimeUnit.MICROSECOND,64)}};S.TimeMicrosecond=mh;var bh=class extends Fr{constructor(){super(R.TimeUnit.NANOSECOND,64)}};S.TimeNanosecond=bh;var Er=class extends Be{constructor(e,r){super();this.unit=e,this.timezone=r}get typeId(){return R.Type.Timestamp}toString(){return`Timestamp<${R.TimeUnit[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};S.Timestamp=Er;Er[Symbol.toStringTag]=(t=>(t.unit=null,t.timezone=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Timestamp"))(Er.prototype);var _h=class extends Er{constructor(e){super(R.TimeUnit.SECOND,e)}};S.TimestampSecond=_h;var gh=class extends Er{constructor(e){super(R.TimeUnit.MILLISECOND,e)}};S.TimestampMillisecond=gh;var vh=class extends Er{constructor(e){super(R.TimeUnit.MICROSECOND,e)}};S.TimestampMicrosecond=vh;var wh=class extends Er{constructor(e){super(R.TimeUnit.NANOSECOND,e)}};S.TimestampNanosecond=wh;var xn=class extends Be{constructor(e){super();this.unit=e}get typeId(){return R.Type.Interval}toString(){return`Interval<${R.IntervalUnit[this.unit]}>`}};S.Interval=xn;xn[Symbol.toStringTag]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Interval"))(xn.prototype);var Th=class extends xn{constructor(){super(R.IntervalUnit.DAY_TIME)}};S.IntervalDayTime=Th;var Bh=class extends xn{constructor(){super(R.IntervalUnit.YEAR_MONTH)}};S.IntervalYearMonth=Bh;var pa=class extends Be{constructor(e){super();this.children=[e]}get typeId(){return R.Type.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};S.List=pa;pa[Symbol.toStringTag]=(t=>(t.children=null,t[Symbol.toStringTag]="List"))(pa.prototype);var ya=class extends Be{constructor(e){super();this.children=e}get typeId(){return R.Type.Struct}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};S.Struct=ya;ya[Symbol.toStringTag]=(t=>(t.children=null,t[Symbol.toStringTag]="Struct"))(ya.prototype);var Cn=class extends Be{constructor(e,r,n){super();this.mode=e,this.children=n,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((i,a,u)=>(i[a]=u)&&i||i,Object.create(null))}get typeId(){return R.Type.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};S.Union=Cn;Cn[Symbol.toStringTag]=(t=>(t.mode=null,t.typeIds=null,t.children=null,t.typeIdToChildIndex=null,t.ArrayType=Int8Array,t[Symbol.toStringTag]="Union"))(Cn.prototype);var Ih=class extends Cn{constructor(e,r){super(R.UnionMode.Dense,e,r)}};S.DenseUnion=Ih;var Sh=class extends Cn{constructor(e,r){super(R.UnionMode.Sparse,e,r)}};S.SparseUnion=Sh;var ma=class extends Be{constructor(e){super();this.byteWidth=e}get typeId(){return R.Type.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};S.FixedSizeBinary=ma;ma[Symbol.toStringTag]=(t=>(t.byteWidth=null,t.ArrayType=Uint8Array,t[Symbol.toStringTag]="FixedSizeBinary"))(ma.prototype);var ba=class extends Be{constructor(e,r){super();this.listSize=e,this.children=[r]}get typeId(){return R.Type.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};S.FixedSizeList=ba;ba[Symbol.toStringTag]=(t=>(t.children=null,t.listSize=null,t[Symbol.toStringTag]="FixedSizeList"))(ba.prototype);var _a=class extends Be{constructor(e,r=!1){super();this.children=[e],this.keysSorted=r}get typeId(){return R.Type.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};S.Map_=_a;_a[Symbol.toStringTag]=(t=>(t.children=null,t.keysSorted=null,t[Symbol.toStringTag]="Map_"))(_a.prototype);var Sw=(t=>()=>++t)(-1),ga=class extends Be{constructor(e,r,n,i){super();this.indices=r,this.dictionary=e,this.isOrdered=i||!1,this.id=n==null?Sw():typeof n=="number"?n:n.low}get typeId(){return R.Type.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};S.Dictionary=ga;ga[Symbol.toStringTag]=(t=>(t.id=null,t.indices=null,t.isOrdered=null,t.dictionary=null,t[Symbol.toStringTag]="Dictionary"))(ga.prototype);function Ow(t){let e=t;switch(t.typeId){case R.Type.Decimal:return 4;case R.Type.Timestamp:return 2;case R.Type.Date:return 1+e.unit;case R.Type.Interval:return 1+e.unit;case R.Type.Int:return 1+ +(e.bitWidth>32);case R.Type.Time:return 1+ +(e.bitWidth>32);case R.Type.FixedSizeList:return e.listSize;case R.Type.FixedSizeBinary:return e.byteWidth;default:return 1}}S.strideForType=Ow});var Lt=T(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.Data=yn.kUnknownNullCount=void 0;var Aw=Qt(),Dw=Qt(),M=pe(),Fw=ce(),ne=Ee();yn.kUnknownNullCount=-1;var G=class{constructor(e,r,n,i,a,u,o){this.type=e,this.dictionary=o,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1)),this.childData=(u||[]).map(s=>s instanceof G?s:s.data);let p;a instanceof G?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=Fw.strideForType(e),a&&((p=a[0])&&(this.valueOffsets=p),(p=a[1])&&(this.values=p),(p=a[2])&&(this.nullBitmap=p),(p=a[3])&&(this.typeIds=p)))}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let e=0,{valueOffsets:r,values:n,nullBitmap:i,typeIds:a}=this;return r&&(e+=r.byteLength),n&&(e+=n.byteLength),i&&(e+=i.byteLength),a&&(e+=a.byteLength),this.childData.reduce((u,o)=>u+o.byteLength,e)}get nullCount(){let e=this._nullCount,r;return e<=yn.kUnknownNullCount&&(r=this.nullBitmap)&&(this._nullCount=e=this.length-Dw.popcnt_bit_range(r,this.offset,this.offset+this.length)),e}clone(e,r=this.offset,n=this.length,i=this._nullCount,a=this,u=this.childData){return new G(e,r,n,i,a,u,this.dictionary)}slice(e,r){let{stride:n,typeId:i,childData:a}=this,u=+(this._nullCount===0)-1,o=i===16?n:1,p=this._sliceBuffers(e,r,n,i);return this.clone(this.type,this.offset+e,r,u,p,!a.length||this.valueOffsets?a:this._sliceChildren(a,o*e,o*r))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===M.Type.Null)return this.clone(this.type,0,e,0);let{length:r,nullCount:n}=this,i=new Uint8Array((e+63&~63)>>3).fill(255,0,r>>3);i[r>>3]=(1<<r-(r&~7))-1,n>0&&i.set(Aw.truncateBitmap(this.offset,r,this.nullBitmap),0);let a=this.buffers;return a[M.BufferType.VALIDITY]=i,this.clone(this.type,0,e,n+(e-r),a)}_sliceBuffers(e,r,n,i){let a,{buffers:u}=this;return(a=u[M.BufferType.TYPE])&&(u[M.BufferType.TYPE]=a.subarray(e,e+r)),(a=u[M.BufferType.OFFSET])&&(u[M.BufferType.OFFSET]=a.subarray(e,e+r+1))||(a=u[M.BufferType.DATA])&&(u[M.BufferType.DATA]=i===6?a:a.subarray(n*e,n*(e+r))),u}_sliceChildren(e,r,n){return e.map(i=>i.slice(r,n))}static new(e,r,n,i,a,u,o){switch(a instanceof G?a=a.buffers:a||(a=[]),e.typeId){case M.Type.Null:return G.Null(e,r,n);case M.Type.Int:return G.Int(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.DATA]||[]);case M.Type.Dictionary:return G.Dictionary(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.DATA]||[],o);case M.Type.Float:return G.Float(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.DATA]||[]);case M.Type.Bool:return G.Bool(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.DATA]||[]);case M.Type.Decimal:return G.Decimal(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.DATA]||[]);case M.Type.Date:return G.Date(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.DATA]||[]);case M.Type.Time:return G.Time(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.DATA]||[]);case M.Type.Timestamp:return G.Timestamp(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.DATA]||[]);case M.Type.Interval:return G.Interval(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.DATA]||[]);case M.Type.FixedSizeBinary:return G.FixedSizeBinary(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.DATA]||[]);case M.Type.Binary:return G.Binary(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.OFFSET]||[],a[M.BufferType.DATA]||[]);case M.Type.Utf8:return G.Utf8(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.OFFSET]||[],a[M.BufferType.DATA]||[]);case M.Type.List:return G.List(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.OFFSET]||[],(u||[])[0]);case M.Type.FixedSizeList:return G.FixedSizeList(e,r,n,i||0,a[M.BufferType.VALIDITY],(u||[])[0]);case M.Type.Struct:return G.Struct(e,r,n,i||0,a[M.BufferType.VALIDITY],u||[]);case M.Type.Map:return G.Map(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.OFFSET]||[],(u||[])[0]);case M.Type.Union:return G.Union(e,r,n,i||0,a[M.BufferType.VALIDITY],a[M.BufferType.TYPE]||[],a[M.BufferType.OFFSET]||u,u)}throw new Error(`Unrecognized typeId ${e.typeId}`)}static Null(e,r,n){return new G(e,r,n,0)}static Int(e,r,n,i,a,u){return new G(e,r,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,u),ne.toUint8Array(a)])}static Dictionary(e,r,n,i,a,u,o){return new G(e,r,n,i,[void 0,ne.toArrayBufferView(e.indices.ArrayType,u),ne.toUint8Array(a)],[],o)}static Float(e,r,n,i,a,u){return new G(e,r,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,u),ne.toUint8Array(a)])}static Bool(e,r,n,i,a,u){return new G(e,r,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,u),ne.toUint8Array(a)])}static Decimal(e,r,n,i,a,u){return new G(e,r,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,u),ne.toUint8Array(a)])}static Date(e,r,n,i,a,u){return new G(e,r,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,u),ne.toUint8Array(a)])}static Time(e,r,n,i,a,u){return new G(e,r,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,u),ne.toUint8Array(a)])}static Timestamp(e,r,n,i,a,u){return new G(e,r,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,u),ne.toUint8Array(a)])}static Interval(e,r,n,i,a,u){return new G(e,r,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,u),ne.toUint8Array(a)])}static FixedSizeBinary(e,r,n,i,a,u){return new G(e,r,n,i,[void 0,ne.toArrayBufferView(e.ArrayType,u),ne.toUint8Array(a)])}static Binary(e,r,n,i,a,u,o){return new G(e,r,n,i,[ne.toInt32Array(u),ne.toUint8Array(o),ne.toUint8Array(a)])}static Utf8(e,r,n,i,a,u,o){return new G(e,r,n,i,[ne.toInt32Array(u),ne.toUint8Array(o),ne.toUint8Array(a)])}static List(e,r,n,i,a,u,o){return new G(e,r,n,i,[ne.toInt32Array(u),void 0,ne.toUint8Array(a)],o?[o]:[])}static FixedSizeList(e,r,n,i,a,u){return new G(e,r,n,i,[void 0,void 0,ne.toUint8Array(a)],u?[u]:[])}static Struct(e,r,n,i,a,u){return new G(e,r,n,i,[void 0,void 0,ne.toUint8Array(a)],u)}static Map(e,r,n,i,a,u,o){return new G(e,r,n,i,[ne.toInt32Array(u),void 0,ne.toUint8Array(a)],o?[o]:[])}static Union(e,r,n,i,a,u,o,p){let s=[void 0,void 0,ne.toUint8Array(a),ne.toArrayBufferView(e.ArrayType,u)];return e.mode===M.UnionMode.Sparse?new G(e,r,n,i,s,o):(s[M.BufferType.OFFSET]=ne.toInt32Array(o),new G(e,r,n,i,s,p))}};yn.Data=G;G.prototype.childData=Object.freeze([])});var Lu=T(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.valueToString=void 0;var Ew=void 0;function Rw(t){if(t===null)return"null";if(t===Ew)return"undefined";switch(typeof t){case"number":return`${t}`;case"bigint":return`${t}`;case"string":return`"${t}"`}return typeof t[Symbol.toPrimitive]=="function"?t[Symbol.toPrimitive]("string"):ArrayBuffer.isView(t)?`[${t}]`:JSON.stringify(t)}va.valueToString=Rw});var Oh=T(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.createIsValidFunction=void 0;var xu=Lu(),Uw=st();function Mw(t){if(!t||t.length<=0)return function(i){return!0};let e="",r=t.filter(n=>n===n);return r.length>0&&(e=`
|
|
2
|
-
switch (x) {${r.map(n=>`
|
|
3
|
-
case ${Pw(n)}:`).join("")}
|
|
4
|
-
return false;
|
|
5
|
-
}`),t.length!==r.length&&(e=`if (x !== x) return false;
|
|
6
|
-
${e}`),new Function("x",`${e}
|
|
7
|
-
return true;`)}wa.createIsValidFunction=Mw;function Pw(t){return typeof t!="bigint"?xu.valueToString(t):Uw.BigIntAvailable?`${xu.valueToString(t)}n`:`"${xu.valueToString(t)}"`}});var Rr=T(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.WideBufferBuilder=It.OffsetsBufferBuilder=It.BitmapBufferBuilder=It.DataBufferBuilder=It.BufferBuilder=void 0;var Ah=Ee(),Cu=st(),ju=(t,e)=>(t*e+63&~63||64)/e,Vw=(t,e=0)=>t.length>=e?t.subarray(0,e):Ah.memcpy(new t.constructor(e),t,0),Ki=class{constructor(e,r=1){this.buffer=e,this.stride=r,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e.constructor,this._resize(this.length=e.length/r|0)}get byteLength(){return this.length*this.stride*this.BYTES_PER_ELEMENT|0}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,r){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let r=this.stride,n=this.length*r,i=this.buffer.length;n>=i&&this._resize(i===0?ju(n*1,this.BYTES_PER_ELEMENT):ju(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=ju(e*this.stride,this.BYTES_PER_ELEMENT);let r=Vw(this.buffer,e);return this.clear(),r}clear(){return this.length=0,this._resize(0),this}_resize(e){return this.buffer=Ah.memcpy(new this.ArrayType(e),this.buffer)}};It.BufferBuilder=Ki;Ki.prototype.offset=0;var Ta=class extends Ki{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,r){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=r,this}};It.DataBufferBuilder=Ta;var Dh=class extends Ta{constructor(e=new Uint8Array(0)){super(e,1/8);this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,r){let{buffer:n}=this.reserve(e-this.length+1),i=e>>3,a=e%8,u=n[i]>>a&1;return r?u===0&&(n[i]|=1<<a,++this.numValid):u===1&&(n[i]&=~(1<<a),--this.numValid),this}clear(){return this.numValid=0,super.clear()}};It.BitmapBufferBuilder=Dh;var Fh=class extends Ta{constructor(e=new Int32Array(1)){super(e,1)}append(e){return this.set(this.length-1,e)}set(e,r){let n=this.length-1,i=this.reserve(e-n+1).buffer;return n<e++&&i.fill(i[n],n,e),i[e]=i[e-1]+r,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,0),super.flush(e+1)}};It.OffsetsBufferBuilder=Fh;var Eh=class extends Ki{get ArrayType64(){return this._ArrayType64||(this._ArrayType64=this.buffer instanceof Int32Array?Cu.BigInt64Array:Cu.BigUint64Array)}set(e,r){switch(this.reserve(e-this.length+1),typeof r){case"bigint":this.buffer64[e]=r;break;case"number":this.buffer[e*this.stride]=r;break;default:this.buffer.set(r,e*this.stride)}return this}_resize(e){let r=super._resize(e),n=r.byteLength/(this.BYTES_PER_ELEMENT*this.stride);return Cu.BigIntAvailable&&(this.buffer64=new this.ArrayType64(r.buffer,r.byteOffset,n)),r}};It.WideBufferBuilder=Eh});var Ie=T(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.VariableWidthBuilder=Ur.FixedWidthBuilder=Ur.Builder=void 0;var kw=De(),jn=pe(),Nw=Lt(),Lw=Oh(),qu=Rr(),xw=ce(),St=class{constructor({type:e,nullValues:r}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=r,this.stride=xw.strideForType(e),this._nulls=new qu.BitmapBufferBuilder,r&&r.length>0&&(this._isValid=Lw.createIsValidFunction(r))}static new(e){}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}static throughIterable(e){return Cw(e)}static throughAsyncIterable(e){return jw(e)}toVector(){return kw.Vector.new(this.flush())}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),this._typeIds&&(e+=this._typeIds.byteLength),this.children.reduce((r,n)=>r+n.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((r,n)=>r+n.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,r){return this.setValid(e,this.isValid(r))&&this.setValue(e,r),this}setValue(e,r){this._setValue(this,e,r)}setValid(e,r){return this.length=this._nulls.set(e,+r).length,r}addChild(e,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(e){return this.children[e]||null}flush(){let e=[],r=this._values,n=this._offsets,i=this._typeIds,{length:a,nullCount:u}=this;i?(e[jn.BufferType.TYPE]=i.flush(a),n&&(e[jn.BufferType.OFFSET]=n.flush(a))):n?(r&&(e[jn.BufferType.DATA]=r.flush(n.last())),e[jn.BufferType.OFFSET]=n.flush(a)):r&&(e[jn.BufferType.DATA]=r.flush(a)),u>0&&(e[jn.BufferType.VALIDITY]=this._nulls.flush(a));let o=Nw.Data.new(this.type,0,a,u,e,this.children.map(p=>p.flush()));return this.clear(),o}finish(){return this.finished=!0,this.children.forEach(e=>e.finish()),this}clear(){return this.length=0,this._offsets&&this._offsets.clear(),this._values&&this._values.clear(),this._nulls&&this._nulls.clear(),this._typeIds&&this._typeIds.clear(),this.children.forEach(e=>e.clear()),this}};Ur.Builder=St;St.prototype.length=1;St.prototype.stride=1;St.prototype.children=null;St.prototype.finished=!1;St.prototype.nullValues=null;St.prototype._isValid=()=>!0;var Rh=class extends St{constructor(e){super(e);this._values=new qu.DataBufferBuilder(new this.ArrayType(0),this.stride)}setValue(e,r){let n=this._values;return n.reserve(e-n.length+1),super.setValue(e,r)}};Ur.FixedWidthBuilder=Rh;var Uh=class extends St{constructor(e){super(e);this._pendingLength=0,this._offsets=new qu.OffsetsBufferBuilder}setValue(e,r){let n=this._pending||(this._pending=new Map),i=n.get(e);i&&(this._pendingLength-=i.length),this._pendingLength+=r.length,n.set(e,r)}setValid(e,r){return super.setValid(e,r)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,r),this}};Ur.VariableWidthBuilder=Uh;function Cw(t){let{["queueingStrategy"]:e="count"}=t,{["highWaterMark"]:r=e!=="bytes"?1e3:2**14}=t,n=e!=="bytes"?"length":"byteLength";return function*(i){let a=0,u=St.new(t);for(let o of i)u.append(o)[n]>=r&&++a&&(yield u.toVector());(u.finish().length>0||a===0)&&(yield u.toVector())}}function jw(t){let{["queueingStrategy"]:e="count"}=t,{["highWaterMark"]:r=e!=="bytes"?1e3:2**14}=t,n=e!=="bytes"?"length":"byteLength";return async function*(i){let a=0,u=St.new(t);for await(let o of i)u.append(o)[n]>=r&&++a&&(yield u.toVector());(u.finish().length>0||a===0)&&(yield u.toVector())}}});var Wu=T(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.BoolBuilder=void 0;var qw=Rr(),Ww=Ie(),Mh=class extends Ww.Builder{constructor(e){super(e);this._values=new qw.BitmapBufferBuilder}setValue(e,r){this._values.set(e,+r)}};Ba.BoolBuilder=Mh});var zu=T(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.NullBuilder=void 0;var zw=Ie(),Ph=class extends zw.Builder{setValue(e,r){}setValid(e,r){return this.length=Math.max(e+1,this.length),r}};Ia.NullBuilder=Ph});var Hu=T(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.DateMillisecondBuilder=Mr.DateDayBuilder=Mr.DateBuilder=void 0;var Hw=Ie(),Sa=class extends Hw.FixedWidthBuilder{};Mr.DateBuilder=Sa;var Vh=class extends Sa{};Mr.DateDayBuilder=Vh;var kh=class extends Sa{};Mr.DateMillisecondBuilder=kh});var Yu=T(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.DecimalBuilder=void 0;var Yw=Ie(),Nh=class extends Yw.FixedWidthBuilder{};Oa.DecimalBuilder=Nh});var $u=T(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.DictionaryBuilder=void 0;var Gw=ce(),Gu=Ie(),Lh=class extends Gu.Builder{constructor({type:e,nullValues:r,dictionaryHashFunction:n}){super({type:new Gw.Dictionary(e.dictionary,e.indices,e.id,e.isOrdered)});this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Gu.Builder.new({type:this.type.indices,nullValues:r}),this.dictionary=Gu.Builder.new({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,r){let n=this.indices;return r=n.setValid(e,r),this.length=n.length,r}setValue(e,r){let n=this._keysToIndices,i=this.valueToKey(r),a=n[i];return a===void 0&&(n[i]=a=this._dictionaryOffset+this.dictionary.append(r).length-1),this.indices.setValue(e,a)}flush(){let e=this.type,r=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(e);return i.dictionary=r?r.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:`${e}`}};Aa.DictionaryBuilder=Lh});var Ju=T(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.FixedSizeBinaryBuilder=void 0;var $w=Ie(),xh=class extends $w.FixedWidthBuilder{};Da.FixedSizeBinaryBuilder=xh});var Qi=T(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.float64ToUint16=Wn.uint16ToFloat64=void 0;var Ch=new Float64Array(1),qn=new Uint32Array(Ch.buffer);function Jw(t){let e=(t&31744)>>10,r=(t&1023)/1024,n=(-1)**((t&32768)>>15);switch(e){case 31:return n*(r?NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*2**(e-15)*(1+r)}Wn.uint16ToFloat64=Jw;function Kw(t){if(t!==t)return 32256;Ch[0]=t;let e=(qn[1]&2147483648)>>16&65535,r=qn[1]&2146435072,n=0;return r>=1089470464?qn[0]>0?r=31744:(r=(r&2080374784)>>16,n=(qn[1]&1048575)>>10):r<=1056964608?(n=1048576+(qn[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(qn[1]&1048575)+512>>10),e|r|n&65535}Wn.float64ToUint16=Kw});var Ku=T(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.Float64Builder=Xt.Float32Builder=Xt.Float16Builder=Xt.FloatBuilder=void 0;var Qw=Qi(),Xw=Ie(),Xi=class extends Xw.FixedWidthBuilder{};Xt.FloatBuilder=Xi;var jh=class extends Xi{setValue(e,r){this._values.set(e,Qw.float64ToUint16(r))}};Xt.Float16Builder=jh;var qh=class extends Xi{setValue(e,r){this._values.set(e,r)}};Xt.Float32Builder=qh;var Wh=class extends Xi{setValue(e,r){this._values.set(e,r)}};Xt.Float64Builder=Wh});var ts=T(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.BN=xe.bignumToBigInt=xe.bignumToString=xe.isArrowBigNumSymbol=void 0;var Zw=Ee(),Zi=st();xe.isArrowBigNumSymbol=Symbol.for("isArrowBigNum");function xt(t,...e){return e.length===0?Object.setPrototypeOf(Zw.toArrayBufferView(this.TypedArray,t),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(t,...e),this.constructor.prototype)}xt.prototype[xe.isArrowBigNumSymbol]=!0;xt.prototype.toJSON=function(){return`"${xe.bignumToString(this)}"`};xt.prototype.valueOf=function(){return zh(this)};xt.prototype.toString=function(){return xe.bignumToString(this)};xt.prototype[Symbol.toPrimitive]=function(t="default"){switch(t){case"number":return zh(this);case"string":return xe.bignumToString(this);case"default":return xe.bignumToBigInt(this)}return xe.bignumToString(this)};function zn(...t){return xt.apply(this,t)}function Hn(...t){return xt.apply(this,t)}function es(...t){return xt.apply(this,t)}Object.setPrototypeOf(zn.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Hn.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(es.prototype,Object.create(Uint32Array.prototype));Object.assign(zn.prototype,xt.prototype,{constructor:zn,signed:!0,TypedArray:Int32Array,BigIntArray:Zi.BigInt64Array});Object.assign(Hn.prototype,xt.prototype,{constructor:Hn,signed:!1,TypedArray:Uint32Array,BigIntArray:Zi.BigUint64Array});Object.assign(es.prototype,xt.prototype,{constructor:es,signed:!0,TypedArray:Uint32Array,BigIntArray:Zi.BigUint64Array});function zh(t){let{buffer:e,byteOffset:r,length:n,signed:i}=t,a=new Int32Array(e,r,n),u=0,o=0,p=a.length,s,l;for(;o<p;)l=a[o++],s=a[o++],i||(s=s>>>0),u+=(l>>>0)+s*o**32;return u}Zi.BigIntAvailable?(xe.bignumToBigInt=t=>t.byteLength===8?new t.BigIntArray(t.buffer,t.byteOffset,1)[0]:Qu(t),xe.bignumToString=t=>t.byteLength===8?`${new t.BigIntArray(t.buffer,t.byteOffset,1)[0]}`:Qu(t)):(xe.bignumToString=Qu,xe.bignumToBigInt=xe.bignumToString);function Qu(t){let e="",r=new Uint32Array(2),n=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),a=-1,u=n.length-1;do{for(r[0]=n[a=0];a<u;)n[a++]=r[1]=r[0]/10,r[0]=(r[0]-r[1]*10<<16)+n[a];n[a]=r[1]=r[0]/10,r[0]=r[0]-r[1]*10,e=`${r[0]}${e}`}while(i[0]||i[1]||i[2]||i[3]);return e||"0"}var Fa=class{static new(e,r){switch(r){case!0:return new zn(e);case!1:return new Hn(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case Zi.BigInt64Array:return new zn(e)}return e.byteLength===16?new es(e):new Hn(e)}static signed(e){return new zn(e)}static unsigned(e){return new Hn(e)}static decimal(e){return new es(e)}constructor(e,r){return Fa.new(e,r)}};xe.BN=Fa});var Xu=T(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.Uint64Builder=Ue.Uint32Builder=Ue.Uint16Builder=Ue.Uint8Builder=Ue.Int64Builder=Ue.Int32Builder=Ue.Int16Builder=Ue.Int8Builder=Ue.IntBuilder=void 0;var eT=ts(),Hh=Rr(),tT=st(),rT=Ie(),Zt=class extends rT.FixedWidthBuilder{setValue(e,r){this._values.set(e,r)}};Ue.IntBuilder=Zt;var Yh=class extends Zt{};Ue.Int8Builder=Yh;var Gh=class extends Zt{};Ue.Int16Builder=Gh;var $h=class extends Zt{};Ue.Int32Builder=$h;var Jh=class extends Zt{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(Ea));super(e);this._values=new Hh.WideBufferBuilder(new Int32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(Ea(e))}};Ue.Int64Builder=Jh;var Kh=class extends Zt{};Ue.Uint8Builder=Kh;var Qh=class extends Zt{};Ue.Uint16Builder=Qh;var Xh=class extends Zt{};Ue.Uint32Builder=Xh;var Zh=class extends Zt{constructor(e){e.nullValues&&(e.nullValues=e.nullValues.map(Ea));super(e);this._values=new Hh.WideBufferBuilder(new Uint32Array(0),2)}get values64(){return this._values.buffer64}isValid(e){return super.isValid(Ea(e))}};Ue.Uint64Builder=Zh;var Ea=(t=>e=>(ArrayBuffer.isView(e)&&(t.buffer=e.buffer,t.byteOffset=e.byteOffset,t.byteLength=e.byteLength,e=eT.bignumToBigInt(t),t.buffer=null),e))({BigIntArray:tT.BigInt64Array})});var Zu=T(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.TimeNanosecondBuilder=Ot.TimeMicrosecondBuilder=Ot.TimeMillisecondBuilder=Ot.TimeSecondBuilder=Ot.TimeBuilder=void 0;var nT=Ie(),Yn=class extends nT.FixedWidthBuilder{};Ot.TimeBuilder=Yn;var ep=class extends Yn{};Ot.TimeSecondBuilder=ep;var tp=class extends Yn{};Ot.TimeMillisecondBuilder=tp;var rp=class extends Yn{};Ot.TimeMicrosecondBuilder=rp;var np=class extends Yn{};Ot.TimeNanosecondBuilder=np});var ec=T(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.TimestampNanosecondBuilder=At.TimestampMicrosecondBuilder=At.TimestampMillisecondBuilder=At.TimestampSecondBuilder=At.TimestampBuilder=void 0;var iT=Ie(),Gn=class extends iT.FixedWidthBuilder{};At.TimestampBuilder=Gn;var ip=class extends Gn{};At.TimestampSecondBuilder=ip;var sp=class extends Gn{};At.TimestampMillisecondBuilder=sp;var ap=class extends Gn{};At.TimestampMicrosecondBuilder=ap;var op=class extends Gn{};At.TimestampNanosecondBuilder=op});var tc=T(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.IntervalYearMonthBuilder=Pr.IntervalDayTimeBuilder=Pr.IntervalBuilder=void 0;var sT=Ie(),Ra=class extends sT.FixedWidthBuilder{};Pr.IntervalBuilder=Ra;var up=class extends Ra{};Pr.IntervalDayTimeBuilder=up;var cp=class extends Ra{};Pr.IntervalYearMonthBuilder=cp});var Ma=T(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.BinaryBuilder=void 0;var aT=Ee(),oT=Rr(),uT=Ie(),lp=class extends uT.VariableWidthBuilder{constructor(e){super(e);this._values=new oT.BufferBuilder(new Uint8Array(0))}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,aT.toUint8Array(r))}_flushPending(e,r){let n=this._offsets,i=this._values.reserve(r).buffer,a=0,u=0,o=0,p;for([a,p]of e)p===void 0?n.set(a,0):(u=p.length,i.set(p,o),n.set(a,u),o+=u)}};Ua.BinaryBuilder=lp});var Va=T(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.Utf8Builder=void 0;var cT=dn(),lT=Ma(),dT=Rr(),fT=Ie(),rc=class extends fT.VariableWidthBuilder{constructor(e){super(e);this._values=new dT.BufferBuilder(new Uint8Array(0))}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,cT.encodeUtf8(r))}_flushPending(e,r){}};Pa.Utf8Builder=rc;rc.prototype._flushPending=lT.BinaryBuilder.prototype._flushPending});var nc=T(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.Run=void 0;var hT=De(),dp=class{get length(){return this._values.length}get(e){return this._values[e]}clear(){return this._values=null,this}bind(e){return e instanceof hT.Vector?e:(this._values=e,this)}};ka.Run=dp});var rs=T(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.StructRow=Jn.MapRow=void 0;var fp=Lu(),Ze=Symbol.for("parent"),$n=Symbol.for("rowIndex"),yt=Symbol.for("keyToIdx"),mt=Symbol.for("idxToVal"),ic=Symbol.for("nodejs.util.inspect.custom"),er=class{constructor(e,r){this[Ze]=e,this.size=r}entries(){return this[Symbol.iterator]()}has(e){return this.get(e)!==void 0}get(e){let r;if(e!=null){let n=this[yt]||(this[yt]=new Map),i=n.get(e);if(i!==void 0){let a=this[mt]||(this[mt]=new Array(this.size));(r=a[i])!==void 0||(a[i]=r=this.getValue(i))}else if((i=this.getIndex(e))>-1){n.set(e,i);let a=this[mt]||(this[mt]=new Array(this.size));(r=a[i])!==void 0||(a[i]=r=this.getValue(i))}}return r}set(e,r){if(e!=null){let n=this[yt]||(this[yt]=new Map),i=n.get(e);if(i===void 0&&n.set(e,i=this.getIndex(e)),i>-1){let a=this[mt]||(this[mt]=new Array(this.size));a[i]=this.setValue(i,r)}}return this}clear(){throw new Error(`Clearing ${this[Symbol.toStringTag]} not supported.`)}delete(e){throw new Error(`Deleting ${this[Symbol.toStringTag]} values not supported.`)}*[Symbol.iterator](){let e=this.keys(),r=this.values(),n=this[yt]||(this[yt]=new Map),i=this[mt]||(this[mt]=new Array(this.size));for(let a,u,o=0,p,s;!((p=e.next()).done||(s=r.next()).done);++o)a=p.value,u=s.value,i[o]=u,n.has(a)||n.set(a,o),yield[a,u]}forEach(e,r){let n=this.keys(),i=this.values(),a=r===void 0?e:(p,s,l)=>e.call(r,p,s,l),u=this[yt]||(this[yt]=new Map),o=this[mt]||(this[mt]=new Array(this.size));for(let p,s,l=0,g,L;!((g=n.next()).done||(L=i.next()).done);++l)p=g.value,s=L.value,o[l]=s,u.has(p)||u.set(p,l),a(s,p,this)}toArray(){return[...this.values()]}toJSON(){let e={};return this.forEach((r,n)=>e[n]=r),e}inspect(){return this.toString()}[ic](){return this.toString()}toString(){let e=[];return this.forEach((r,n)=>{n=fp.valueToString(n),r=fp.valueToString(r),e.push(`${n}: ${r}`)}),`{ ${e.join(", ")} }`}};er[Symbol.toStringTag]=(t=>(Object.defineProperties(t,{size:{writable:!0,enumerable:!1,configurable:!1,value:0},[Ze]:{writable:!0,enumerable:!1,configurable:!1,value:null},[$n]:{writable:!0,enumerable:!1,configurable:!1,value:-1}}),t[Symbol.toStringTag]="Row"))(er.prototype);var hp=class extends er{constructor(e){super(e,e.length);return pT(this)}keys(){return this[Ze].getChildAt(0)[Symbol.iterator]()}values(){return this[Ze].getChildAt(1)[Symbol.iterator]()}getKey(e){return this[Ze].getChildAt(0).get(e)}getIndex(e){return this[Ze].getChildAt(0).indexOf(e)}getValue(e){return this[Ze].getChildAt(1).get(e)}setValue(e,r){this[Ze].getChildAt(1).set(e,r)}};Jn.MapRow=hp;var pp=class extends er{constructor(e){super(e,e.type.children.length);return yp(this)}*keys(){for(let e of this[Ze].type.children)yield e.name}*values(){for(let e of this[Ze].type.children)yield this[e.name]}getKey(e){return this[Ze].type.children[e].name}getIndex(e){return this[Ze].type.children.findIndex(r=>r.name===e)}getValue(e){return this[Ze].getChildAt(e).get(this[$n])}setValue(e,r){return this[Ze].getChildAt(e).set(this[$n],r)}};Jn.StructRow=pp;Object.setPrototypeOf(er.prototype,Map.prototype);var yp=(()=>{let t={enumerable:!0,configurable:!1,get:null,set:null};return e=>{let r=-1,n=e[yt]||(e[yt]=new Map),i=u=>function(){return this.get(u)},a=u=>function(o){return this.set(u,o)};for(let u of e.keys())n.set(u,++r),t.get=i(u),t.set=a(u),e.hasOwnProperty(u)||(t.enumerable=!0,Object.defineProperty(e,u,t)),e.hasOwnProperty(r)||(t.enumerable=!1,Object.defineProperty(e,r,t));return t.get=t.set=null,e}})(),pT=(()=>{if(typeof Proxy=="undefined")return yp;let t=er.prototype.has,e=er.prototype.get,r=er.prototype.set,n=er.prototype.getKey,i={isExtensible(){return!1},deleteProperty(){return!1},preventExtensions(){return!0},ownKeys(a){return[...a.keys()].map(u=>`${u}`)},has(a,u){switch(u){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case Ze:case $n:case mt:case yt:case ic:return!0}return typeof u=="number"&&!a.has(u)&&(u=a.getKey(u)),a.has(u)},get(a,u,o){switch(u){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case Ze:case $n:case mt:case yt:case ic:return Reflect.get(a,u,o)}return typeof u=="number"&&!t.call(o,u)&&(u=n.call(o,u)),e.call(o,u)},set(a,u,o,p){switch(u){case Ze:case $n:case mt:case yt:return Reflect.set(a,u,o,p);case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:return!1}return typeof u=="number"&&!t.call(p,u)&&(u=n.call(p,u)),t.call(p,u)?!!r.call(p,u,o):!1}};return a=>new Proxy(a,i)})()});var is=T(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.createElementComparator=Vr.clampRange=Vr.clampIndex=void 0;var mp=De(),bp=rs(),yT=Ee(),_p=st();function mT(t,e,r){let n=t.length,i=e>-1?e:n+e%n;return r?r(t,i):i}Vr.clampIndex=mT;var gp;function bT(t,e,r,n){let{length:i=0}=t,a=typeof e!="number"?0:e,u=typeof r!="number"?i:r;return a<0&&(a=(a%i+i)%i),u<0&&(u=(u%i+i)%i),u<a&&(gp=a,a=u,u=gp),u>i&&(u=i),n?n(t,a,u):[a,u]}Vr.clampRange=bT;var _T=_p.BigIntAvailable?_p.BigInt(0):0,vp=t=>t!==t;function ns(t){let e=typeof t;if(e!=="object"||t===null)return vp(t)?vp:e!=="bigint"?r=>r===t:r=>_T+r===t;if(t instanceof Date){let r=t.valueOf();return n=>n instanceof Date?n.valueOf()===r:!1}return ArrayBuffer.isView(t)?r=>r?yT.compareArrayLike(t,r):!1:t instanceof Map?vT(t):Array.isArray(t)?gT(t):t instanceof mp.Vector?wT(t):TT(t)}Vr.createElementComparator=ns;function gT(t){let e=[];for(let r=-1,n=t.length;++r<n;)e[r]=ns(t[r]);return Na(e)}function vT(t){let e=-1,r=[];return t.forEach(n=>r[++e]=ns(n)),Na(r)}function wT(t){let e=[];for(let r=-1,n=t.length;++r<n;)e[r]=ns(t.get(r));return Na(e)}function TT(t){let e=Object.keys(t);if(e.length===0)return()=>!1;let r=[];for(let n=-1,i=e.length;++n<i;)r[n]=ns(t[e[n]]);return Na(r,e)}function Na(t,e){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return BT(t,r);case Map:case bp.MapRow:case bp.StructRow:return wp(t,r,r.keys());case Object:case void 0:return wp(t,r,e||Object.keys(r))}return r instanceof mp.Vector?IT(t,r):!1}}function BT(t,e){let r=t.length;if(e.length!==r)return!1;for(let n=-1;++n<r;)if(!t[n](e[n]))return!1;return!0}function IT(t,e){let r=t.length;if(e.length!==r)return!1;for(let n=-1;++n<r;)if(!t[n](e.get(n)))return!1;return!0}function wp(t,e,r){let n=r[Symbol.iterator](),i=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),a=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),u=0,o=t.length,p=a.next(),s=n.next(),l=i.next();for(;u<o&&!s.done&&!l.done&&!p.done&&!(s.value!==l.value||!t[u](p.value));++u,s=n.next(),l=i.next(),p=a.next());return u===o&&s.done&&l.done&&p.done?!0:(n.return&&n.return(),i.return&&i.return(),a.return&&a.return(),!1)}});var kr=T(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.Chunked=void 0;var ST=is(),Tp=ce(),OT=Nr(),Bp=De(),gr=class extends Bp.AbstractVector{constructor(e,r=[],n=AT(r)){super();this._nullCount=-1,this._type=e,this._chunks=r,this._chunkOffsets=n,this._length=n[n.length-1],this._numChildren=(this._type.children||[]).length}static flatten(...e){return OT.selectChunkArgs(Bp.Vector,e)}static concat(...e){let r=gr.flatten(...e);return new gr(r[0].type,r)}get type(){return this._type}get length(){return this._length}get chunks(){return this._chunks}get typeId(){return this._type.typeId}get VectorName(){return`Chunked<${this._type}>`}get data(){return this._chunks[0]?this._chunks[0].data:null}get ArrayType(){return this._type.ArrayType}get numChildren(){return this._numChildren}get stride(){return this._chunks[0]?this._chunks[0].stride:1}get byteLength(){return this._chunks.reduce((e,r)=>e+r.byteLength,0)}get nullCount(){let e=this._nullCount;return e<0&&(this._nullCount=e=this._chunks.reduce((r,{nullCount:n})=>r+n,0)),e}get indices(){if(Tp.DataType.isDictionary(this._type)){if(!this._indices){let e=this._chunks;this._indices=e.length===1?e[0].indices:gr.concat(...e.map(r=>r.indices))}return this._indices}return null}get dictionary(){return Tp.DataType.isDictionary(this._type)?this._chunks[this._chunks.length-1].data.dictionary:null}*[Symbol.iterator](){for(let e of this._chunks)yield*e}clone(e=this._chunks){return new gr(this._type,e)}concat(...e){return this.clone(gr.flatten(this,...e))}slice(e,r){return ST.clampRange(this,e,r,this._sliceInternal)}getChildAt(e){if(e<0||e>=this._numChildren)return null;let r=this._children||(this._children=[]),n,i,a;return(n=r[e])?n:(i=(this._type.children||[])[e])&&(a=this._chunks.map(u=>u.getChildAt(e)).filter(u=>u!=null),a.length>0)?r[e]=new gr(i.type,a):null}search(e,r){let n=e,i=this._chunkOffsets,a=i.length-1;if(n<0||n>=i[a])return null;if(a<=1)return r?r(this,0,n):[0,n];let u=0,o=0,p=0;do{if(u+1===a)return r?r(this,u,n-o):[u,n-o];p=u+(a-u)/2|0,n>=i[p]?u=p:a=p}while(n<i[a]&&n>=(o=i[u]));return null}isValid(e){return!!this.search(e,this.isValidInternal)}get(e){return this.search(e,this.getInternal)}set(e,r){this.search(e,({chunks:n},i,a)=>n[i].set(a,r))}indexOf(e,r){return r&&typeof r=="number"?this.search(r,(n,i,a)=>this.indexOfInternal(n,i,a,e)):this.indexOfInternal(this,0,Math.max(0,r||0),e)}toArray(){let{chunks:e}=this,r=e.length,n=this._type.ArrayType;if(r<=0)return new n(0);if(r<=1)return e[0].toArray();let i=0,a=new Array(r);for(let p=-1;++p<r;)i+=(a[p]=e[p].toArray()).length;n!==a[0].constructor&&(n=a[0].constructor);let u=new n(i),o=n===Array?FT:DT;for(let p=-1,s=0;++p<r;)s=o(a[p],u,s);return u}getInternal({_chunks:e},r,n){return e[r].get(n)}isValidInternal({_chunks:e},r,n){return e[r].isValid(n)}indexOfInternal({_chunks:e},r,n,i){let a=r-1,u=e.length,o=n,p=0,s=-1;for(;++a<u;){if(~(s=e[a].indexOf(i,o)))return p+s;o=0,p+=e[a].length}return-1}_sliceInternal(e,r,n){let i=[],{chunks:a,_chunkOffsets:u}=e;for(let o=-1,p=a.length;++o<p;){let s=a[o],l=s.length,g=u[o];if(g>=n)break;if(r>=g+l)continue;if(g>=r&&g+l<=n){i.push(s);continue}let L=Math.max(0,r-g),oe=Math.min(n-g,l);i.push(s.slice(L,oe))}return e.clone(i)}};La.Chunked=gr;function AT(t){let e=new Uint32Array((t||[]).length+1),r=e[0]=0,n=e.length;for(let i=0;++i<n;)e[i]=r+=t[i-1].length;return e}var DT=(t,e,r)=>(e.set(t,r),r+t.length),FT=(t,e,r)=>{let n=r;for(let i=-1,a=t.length;++i<a;)e[n++]=t[i];return n}});var Kn=T(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.Column=void 0;var Ip=He(),Sp=De(),sc=kr(),mn=class extends sc.Chunked{constructor(e,r=[],n){r=sc.Chunked.flatten(...r);super(e.type,r,n);if(this._field=e,r.length===1&&!(this instanceof ac))return new ac(e,r[0],this._chunkOffsets)}static new(...e){let[r,n,...i]=e;typeof r!="string"&&!(r instanceof Ip.Field)&&(n=r,r="");let a=sc.Chunked.flatten(Array.isArray(n)?[...n,...i]:n instanceof Sp.Vector?[n,...i]:[Sp.Vector.new(n,...i)]);if(typeof r=="string"){let u=a[0].data.type;r=new Ip.Field(r,u,!0)}else!r.nullable&&a.some(({nullCount:u})=>u>0)&&(r=r.clone({nullable:!0}));return new mn(r,a)}get field(){return this._field}get name(){return this._field.name}get nullable(){return this._field.nullable}get metadata(){return this._field.metadata}clone(e=this._chunks){return new mn(this._field,e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let r=this._children||(this._children=[]),n,i,a;return(n=r[e])?n:(i=(this.type.children||[])[e])&&(a=this._chunks.map(u=>u.getChildAt(e)).filter(u=>u!=null),a.length>0)?r[e]=new mn(i,a):null}};xa.Column=mn;var ac=class extends mn{constructor(e,r,n){super(e,[r],n);this._chunk=r}search(e,r){return r?r(this,0,e):[0,e]}isValid(e){return this._chunk.isValid(e)}get(e){return this._chunk.get(e)}set(e,r){this._chunk.set(e,r)}indexOf(e,r){return this._chunk.indexOf(e,r)}}});var Nr=T(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.selectColumnChildrenArgs=ht.selectVectorChildrenArgs=ht.selectChunkArgs=ht.selectFieldArgs=ht.selectColumnArgs=ht.selectArgs=void 0;var Op=Lt(),Ap=He(),Lr=Kn(),ss=De(),Dp=ce(),ET=kr(),xr=Array.isArray;ht.selectArgs=(t,e)=>Ca(t,e,[],0);ht.selectColumnArgs=t=>{let[e,r]=uc(t,[[],[]]);return r.map((n,i)=>n instanceof Lr.Column?Lr.Column.new(n.field.clone(e[i]),n):n instanceof ss.Vector?Lr.Column.new(e[i],n):Lr.Column.new(e[i],[]))};ht.selectFieldArgs=t=>uc(t,[[],[]]);ht.selectChunkArgs=(t,e)=>oc(t,e,[],0);ht.selectVectorChildrenArgs=(t,e)=>Fp(t,e,[],0);ht.selectColumnChildrenArgs=(t,e)=>Ep(t,e,[],0);function Ca(t,e,r,n){let i,a=n,u=-1,o=e.length;for(;++u<o;)xr(i=e[u])?a=Ca(t,i,r,a).length:i instanceof t&&(r[a++]=i);return r}function oc(t,e,r,n){let i,a=n,u=-1,o=e.length;for(;++u<o;)xr(i=e[u])?a=oc(t,i,r,a).length:i instanceof ET.Chunked?a=oc(t,i.chunks,r,a).length:i instanceof t&&(r[a++]=i);return r}function Fp(t,e,r,n){let i,a=n,u=-1,o=e.length;for(;++u<o;)xr(i=e[u])?a=Fp(t,i,r,a).length:i instanceof t?a=Ca(ss.Vector,i.schema.fields.map((p,s)=>i.getChildAt(s)),r,a).length:i instanceof ss.Vector&&(r[a++]=i);return r}function Ep(t,e,r,n){let i,a=n,u=-1,o=e.length;for(;++u<o;)xr(i=e[u])?a=Ep(t,i,r,a).length:i instanceof t?a=Ca(Lr.Column,i.schema.fields.map((p,s)=>Lr.Column.new(p,i.getChildAt(s))),r,a).length:i instanceof Lr.Column&&(r[a++]=i);return r}var RT=(t,[e,r],n)=>(t[0][n]=e,t[1][n]=r,t);function uc(t,e){let r,n;switch(n=t.length){case 0:return e;case 1:if(r=e[0],!t[0])return e;if(xr(t[0]))return uc(t[0],e);t[0]instanceof Op.Data||t[0]instanceof ss.Vector||t[0]instanceof Dp.DataType||([r,t]=Object.entries(t[0]).reduce(RT,e));break;default:xr(r=t[n-1])?t=xr(t[0])?t[0]:t.slice(0,n-1):(t=xr(t[0])?t[0]:t,r=[])}let i=-1,a=-1,u=-1,o=t.length,p,s,[l,g]=e;for(;++u<o;)s=t[u],s instanceof Lr.Column&&(g[++a]=s)?l[++i]=s.field.clone(r[u],s.type,!0):({[u]:p=u}=r,s instanceof Dp.DataType&&(g[++a]=s)?l[++i]=Ap.Field.new(p,s,!0):s&&s.type&&(g[++a]=s)&&(s instanceof Op.Data&&(g[a]=s=ss.Vector.new(s)),l[++i]=Ap.Field.new(p,s.type,!0)));return e}});var He=T(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.Field=Qn.Schema=void 0;var UT=ce(),MT=Nr(),PT=Nr(),Rp=Ou(),bt=class{constructor(e=[],r,n){this.fields=e||[],this.metadata=r||new Map,n||(n=cc(e)),this.dictionaries=n}static from(...e){return bt.new(e[0],e[1])}static new(...e){return new bt(PT.selectFieldArgs(e)[0])}get[Symbol.toStringTag](){return"Schema"}toString(){return`Schema<{ ${this.fields.map((e,r)=>`${r}: ${e}`).join(", ")} }>`}compareTo(e){return Rp.instance.compareSchemas(this,e)}select(...e){let r=e.reduce((n,i)=>(n[i]=!0)&&n,Object.create(null));return new bt(this.fields.filter(n=>r[n.name]),this.metadata)}selectAt(...e){return new bt(e.map(r=>this.fields[r]).filter(Boolean),this.metadata)}assign(...e){let r=e[0]instanceof bt?e[0]:new bt(MT.selectArgs(tr,e)),n=[...this.fields],i=ja(ja(new Map,this.metadata),r.metadata),a=r.fields.filter(o=>{let p=n.findIndex(s=>s.name===o.name);return~p?(n[p]=o.clone({metadata:ja(ja(new Map,n[p].metadata),o.metadata)}))&&!1:!0}),u=cc(a,new Map);return new bt([...n,...a],i,new Map([...this.dictionaries,...u]))}};Qn.Schema=bt;var tr=class{constructor(e,r,n=!1,i){this.name=e,this.type=r,this.nullable=n,this.metadata=i||new Map}static new(...e){let[r,n,i,a]=e;return e[0]&&typeof e[0]=="object"&&({name:r}=e[0],n===void 0&&(n=e[0].type),i===void 0&&(i=e[0].nullable),a===void 0&&(a=e[0].metadata)),new tr(`${r}`,n,i,a)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}compareTo(e){return Rp.instance.compareField(this,e)}clone(...e){let[r,n,i,a]=e;return!e[0]||typeof e[0]!="object"?[r=this.name,n=this.type,i=this.nullable,a=this.metadata]=e:{name:r=this.name,type:n=this.type,nullable:i=this.nullable,metadata:a=this.metadata}=e[0],tr.new(r,n,i,a)}};Qn.Field=tr;function ja(t,e){return new Map([...t||new Map,...e||new Map])}function cc(t,e=new Map){for(let r=-1,n=t.length;++r<n;){let a=t[r].type;if(UT.DataType.isDictionary(a)){if(!e.has(a.id))e.set(a.id,a.dictionary);else if(e.get(a.id)!==a.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}a.children&&a.children.length>0&&cc(a.children,e)}return e}bt.prototype.fields=null;bt.prototype.metadata=null;bt.prototype.dictionaries=null;tr.prototype.type=null;tr.prototype.name=null;tr.prototype.nullable=null;tr.prototype.metadata=null});var lc=T(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.ListBuilder=void 0;var VT=nc(),kT=He(),NT=ce(),LT=Rr(),xT=Ie(),Up=class extends xT.VariableWidthBuilder{constructor(e){super(e);this._run=new VT.Run,this._offsets=new LT.OffsetsBufferBuilder}addChild(e,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new NT.List(new kT.Field(r,e.type,!0)),this.numChildren-1}clear(){return this._run.clear(),super.clear()}_flushPending(e){let r=this._run,n=this._offsets,i=this._setValue,a=0,u;for([a,u]of e)u===void 0?n.set(a,0):(n.set(a,u.length),i(this,a,r.bind(u)))}};qa.ListBuilder=Up});var dc=T(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.FixedSizeListBuilder=void 0;var CT=nc(),jT=He(),qT=Ie(),WT=ce(),Mp=class extends qT.Builder{constructor(){super(...arguments);this._run=new CT.Run}setValue(e,r){super.setValue(e,this._run.bind(r))}addChild(e,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(e);return this.type=new WT.FixedSizeList(this.type.listSize,new jT.Field(r,e.type,!0)),n}clear(){return this._run.clear(),super.clear()}};Wa.FixedSizeListBuilder=Mp});var fc=T(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.MapBuilder=void 0;var zT=He(),HT=ce(),YT=Ie(),Pp=class extends YT.VariableWidthBuilder{set(e,r){return super.set(e,r)}setValue(e,r){r=r instanceof Map?r:new Map(Object.entries(r));let n=this._pending||(this._pending=new Map),i=n.get(e);i&&(this._pendingLength-=i.size),this._pendingLength+=r.size,n.set(e,r)}addChild(e,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new HT.Map_(new zT.Field(r,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let r=this._offsets,n=this._setValue;e.forEach((i,a)=>{i===void 0?r.set(a,0):(r.set(a,i.size),n(this,a,i))})}};za.MapBuilder=Pp});var hc=T(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.StructBuilder=void 0;var GT=He(),$T=Ie(),JT=ce(),Vp=class extends $T.Builder{addChild(e,r=`${this.numChildren}`){let n=this.children.push(e);return this.type=new JT.Struct([...this.type.children,new GT.Field(r,e.type,!0)]),n}};Ha.StructBuilder=Vp});var pc=T(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.DenseUnionBuilder=Cr.SparseUnionBuilder=Cr.UnionBuilder=void 0;var KT=He(),kp=Rr(),QT=Ie(),XT=ce(),Ya=class extends QT.Builder{constructor(e){super(e);this._typeIds=new kp.DataBufferBuilder(new Int8Array(0),1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,r){return this.set(this.length,e,r)}set(e,r,n){return n===void 0&&(n=this._valueToChildTypeId(this,r,e)),this.setValid(e,this.isValid(r))&&this.setValue(e,r,n),this}setValue(e,r,n){this._typeIds.set(e,n),super.setValue(e,r)}addChild(e,r=`${this.children.length}`){let n=this.children.push(e),{type:{children:i,mode:a,typeIds:u}}=this,o=[...i,new KT.Field(r,e.type)];return this.type=new XT.Union(a,[...u,n],o),n}_valueToChildTypeId(e,r,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}};Cr.UnionBuilder=Ya;var Np=class extends Ya{};Cr.SparseUnionBuilder=Np;var Lp=class extends Ya{constructor(e){super(e);this._offsets=new kp.DataBufferBuilder(new Int32Array(0))}setValue(e,r,n){let i=this.type.typeIdToChildIndex[n];return this._offsets.set(e,this.getChildAt(i).length),super.setValue(e,r,n)}};Cr.DenseUnionBuilder=Lp});var bc=T(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.instance=Xn.SetVisitor=void 0;var ZT=De(),eB=Xe(),tB=dn(),rB=Qi(),nB=Ee(),Dt=pe(),$=class extends eB.Visitor{};Xn.SetVisitor=$;var iB=(t,e,r)=>{t[e]=r/864e5|0},yc=(t,e,r)=>{t[e]=r%4294967296|0,t[e+1]=r/4294967296|0},sB=(t,e,r)=>{t[e]=r*1e3%4294967296|0,t[e+1]=r*1e3/4294967296|0},aB=(t,e,r)=>{t[e]=r*1e6%4294967296|0,t[e+1]=r*1e6/4294967296|0},xp=(t,e,r,n)=>{let{[r]:i,[r+1]:a}=e;i!=null&&a!=null&&t.set(n.subarray(0,a-i),i)},oB=({offset:t,values:e},r,n)=>{let i=t+r;n?e[i>>3]|=1<<i%8:e[i>>3]&=~(1<<i%8)},Cp=({values:t},e,r)=>{iB(t,e,r.valueOf())},jp=({values:t},e,r)=>{yc(t,e*2,r.valueOf())},rr=({stride:t,values:e},r,n)=>{e[t*r]=n},qp=({stride:t,values:e},r,n)=>{e[t*r]=rB.float64ToUint16(n)},mc=(t,e,r)=>{switch(typeof r){case"bigint":t.values64[e]=r;break;case"number":t.values[e*t.stride]=r;break;default:let n=r,{stride:i,ArrayType:a}=t,u=nB.toArrayBufferView(a,n);t.values.set(u.subarray(0,i),i*e)}},uB=({stride:t,values:e},r,n)=>{e.set(n.subarray(0,t),t*r)},cB=({values:t,valueOffsets:e},r,n)=>xp(t,e,r,n),lB=({values:t,valueOffsets:e},r,n)=>{xp(t,e,r,tB.encodeUtf8(n))},dB=(t,e,r)=>{t.type.bitWidth<64?rr(t,e,r):mc(t,e,r)},fB=(t,e,r)=>{t.type.precision!==Dt.Precision.HALF?rr(t,e,r):qp(t,e,r)},hB=(t,e,r)=>{t.type.unit===Dt.DateUnit.DAY?Cp(t,e,r):jp(t,e,r)},Wp=({values:t},e,r)=>yc(t,e*2,r/1e3),zp=({values:t},e,r)=>yc(t,e*2,r),Hp=({values:t},e,r)=>sB(t,e*2,r),Yp=({values:t},e,r)=>aB(t,e*2,r),pB=(t,e,r)=>{switch(t.type.unit){case Dt.TimeUnit.SECOND:return Wp(t,e,r);case Dt.TimeUnit.MILLISECOND:return zp(t,e,r);case Dt.TimeUnit.MICROSECOND:return Hp(t,e,r);case Dt.TimeUnit.NANOSECOND:return Yp(t,e,r)}},Gp=({values:t,stride:e},r,n)=>{t[e*r]=n},$p=({values:t,stride:e},r,n)=>{t[e*r]=n},Jp=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},Kp=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},yB=(t,e,r)=>{switch(t.type.unit){case Dt.TimeUnit.SECOND:return Gp(t,e,r);case Dt.TimeUnit.MILLISECOND:return $p(t,e,r);case Dt.TimeUnit.MICROSECOND:return Jp(t,e,r);case Dt.TimeUnit.NANOSECOND:return Kp(t,e,r)}},mB=({values:t},e,r)=>{t.set(r.subarray(0,4),4*e)},bB=(t,e,r)=>{let n=t.getChildAt(0),i=t.valueOffsets;for(let a=-1,u=i[e],o=i[e+1];u<o;)n.set(u++,r.get(++a))},_B=(t,e,r)=>{let n=t.getChildAt(0),i=t.valueOffsets,a=r instanceof Map?[...r]:Object.entries(r);for(let u=-1,o=i[e],p=i[e+1];o<p;)n.set(o++,a[++u])},gB=(t,e)=>(r,n,i)=>r&&r.set(t,e[i]),vB=(t,e)=>(r,n,i)=>r&&r.set(t,e.get(i)),wB=(t,e)=>(r,n,i)=>r&&r.set(t,e.get(n.name)),TB=(t,e)=>(r,n,i)=>r&&r.set(t,e[n.name]),BB=(t,e,r)=>{let n=r instanceof Map?wB(e,r):r instanceof ZT.Vector?vB(e,r):Array.isArray(r)?gB(e,r):TB(e,r);t.type.children.forEach((i,a)=>n(t.getChildAt(a),i,a))},IB=(t,e,r)=>{t.type.mode===Dt.UnionMode.Dense?Qp(t,e,r):Xp(t,e,r)},Qp=(t,e,r)=>{let n=t.typeIdToChildIndex[t.typeIds[e]],i=t.getChildAt(n);i&&i.set(t.valueOffsets[e],r)},Xp=(t,e,r)=>{let n=t.typeIdToChildIndex[t.typeIds[e]],i=t.getChildAt(n);i&&i.set(e,r)},SB=(t,e,r)=>{let n=t.getKey(e);n!==null&&t.setValue(n,r)},OB=(t,e,r)=>{t.type.unit===Dt.IntervalUnit.DAY_TIME?Zp(t,e,r):ey(t,e,r)},Zp=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},ey=({values:t},e,r)=>{t[e]=r[0]*12+r[1]%12},AB=(t,e,r)=>{let n=t.getChildAt(0),{stride:i}=t;for(let a=-1,u=e*i;++a<i;)n.set(u+a,r.get(a))};$.prototype.visitBool=oB;$.prototype.visitInt=dB;$.prototype.visitInt8=rr;$.prototype.visitInt16=rr;$.prototype.visitInt32=rr;$.prototype.visitInt64=mc;$.prototype.visitUint8=rr;$.prototype.visitUint16=rr;$.prototype.visitUint32=rr;$.prototype.visitUint64=mc;$.prototype.visitFloat=fB;$.prototype.visitFloat16=qp;$.prototype.visitFloat32=rr;$.prototype.visitFloat64=rr;$.prototype.visitUtf8=lB;$.prototype.visitBinary=cB;$.prototype.visitFixedSizeBinary=uB;$.prototype.visitDate=hB;$.prototype.visitDateDay=Cp;$.prototype.visitDateMillisecond=jp;$.prototype.visitTimestamp=pB;$.prototype.visitTimestampSecond=Wp;$.prototype.visitTimestampMillisecond=zp;$.prototype.visitTimestampMicrosecond=Hp;$.prototype.visitTimestampNanosecond=Yp;$.prototype.visitTime=yB;$.prototype.visitTimeSecond=Gp;$.prototype.visitTimeMillisecond=$p;$.prototype.visitTimeMicrosecond=Jp;$.prototype.visitTimeNanosecond=Kp;$.prototype.visitDecimal=mB;$.prototype.visitList=bB;$.prototype.visitStruct=BB;$.prototype.visitUnion=IB;$.prototype.visitDenseUnion=Qp;$.prototype.visitSparseUnion=Xp;$.prototype.visitDictionary=SB;$.prototype.visitInterval=OB;$.prototype.visitIntervalDayTime=Zp;$.prototype.visitIntervalYearMonth=ey;$.prototype.visitFixedSizeList=AB;$.prototype.visitMap=_B;Xn.instance=new $});var ty=T(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.instance=Zn.GetBuilderCtor=void 0;var DB=Xe(),FB=Ma(),EB=Wu(),_c=Hu(),RB=Yu(),UB=$u(),MB=Ju(),PB=dc(),Ga=Ku(),gc=tc(),vr=Xu(),VB=lc(),kB=fc(),NB=zu(),LB=hc(),as=ec(),os=Zu(),vc=pc(),xB=Va(),wc=class extends DB.Visitor{visitNull(){return NB.NullBuilder}visitBool(){return EB.BoolBuilder}visitInt(){return vr.IntBuilder}visitInt8(){return vr.Int8Builder}visitInt16(){return vr.Int16Builder}visitInt32(){return vr.Int32Builder}visitInt64(){return vr.Int64Builder}visitUint8(){return vr.Uint8Builder}visitUint16(){return vr.Uint16Builder}visitUint32(){return vr.Uint32Builder}visitUint64(){return vr.Uint64Builder}visitFloat(){return Ga.FloatBuilder}visitFloat16(){return Ga.Float16Builder}visitFloat32(){return Ga.Float32Builder}visitFloat64(){return Ga.Float64Builder}visitUtf8(){return xB.Utf8Builder}visitBinary(){return FB.BinaryBuilder}visitFixedSizeBinary(){return MB.FixedSizeBinaryBuilder}visitDate(){return _c.DateBuilder}visitDateDay(){return _c.DateDayBuilder}visitDateMillisecond(){return _c.DateMillisecondBuilder}visitTimestamp(){return as.TimestampBuilder}visitTimestampSecond(){return as.TimestampSecondBuilder}visitTimestampMillisecond(){return as.TimestampMillisecondBuilder}visitTimestampMicrosecond(){return as.TimestampMicrosecondBuilder}visitTimestampNanosecond(){return as.TimestampNanosecondBuilder}visitTime(){return os.TimeBuilder}visitTimeSecond(){return os.TimeSecondBuilder}visitTimeMillisecond(){return os.TimeMillisecondBuilder}visitTimeMicrosecond(){return os.TimeMicrosecondBuilder}visitTimeNanosecond(){return os.TimeNanosecondBuilder}visitDecimal(){return RB.DecimalBuilder}visitList(){return VB.ListBuilder}visitStruct(){return LB.StructBuilder}visitUnion(){return vc.UnionBuilder}visitDenseUnion(){return vc.DenseUnionBuilder}visitSparseUnion(){return vc.SparseUnionBuilder}visitDictionary(){return UB.DictionaryBuilder}visitInterval(){return gc.IntervalBuilder}visitIntervalDayTime(){return gc.IntervalDayTimeBuilder}visitIntervalYearMonth(){return gc.IntervalYearMonthBuilder}visitFixedSizeList(){return PB.FixedSizeListBuilder}visitMap(){return kB.MapBuilder}};Zn.GetBuilderCtor=wc;Zn.instance=new wc});var Ja=T(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.DenseUnionBuilder=A.SparseUnionBuilder=A.UnionBuilder=A.StructBuilder=A.MapBuilder=A.FixedSizeListBuilder=A.ListBuilder=A.BinaryBuilder=A.Utf8Builder=A.IntervalYearMonthBuilder=A.IntervalDayTimeBuilder=A.IntervalBuilder=A.TimestampNanosecondBuilder=A.TimestampMicrosecondBuilder=A.TimestampMillisecondBuilder=A.TimestampSecondBuilder=A.TimestampBuilder=A.TimeNanosecondBuilder=A.TimeMicrosecondBuilder=A.TimeMillisecondBuilder=A.TimeSecondBuilder=A.TimeBuilder=A.Uint64Builder=A.Uint32Builder=A.Uint16Builder=A.Uint8Builder=A.Int64Builder=A.Int32Builder=A.Int16Builder=A.Int8Builder=A.IntBuilder=A.Float64Builder=A.Float32Builder=A.Float16Builder=A.FloatBuilder=A.FixedSizeBinaryBuilder=A.DictionaryBuilder=A.DecimalBuilder=A.DateMillisecondBuilder=A.DateDayBuilder=A.DateBuilder=A.NullBuilder=A.BoolBuilder=A.Builder=void 0;var CB=Ie();Object.defineProperty(A,"Builder",{enumerable:!0,get:function(){return CB.Builder}});var jB=Wu();Object.defineProperty(A,"BoolBuilder",{enumerable:!0,get:function(){return jB.BoolBuilder}});var qB=zu();Object.defineProperty(A,"NullBuilder",{enumerable:!0,get:function(){return qB.NullBuilder}});var Tc=Hu();Object.defineProperty(A,"DateBuilder",{enumerable:!0,get:function(){return Tc.DateBuilder}});Object.defineProperty(A,"DateDayBuilder",{enumerable:!0,get:function(){return Tc.DateDayBuilder}});Object.defineProperty(A,"DateMillisecondBuilder",{enumerable:!0,get:function(){return Tc.DateMillisecondBuilder}});var WB=Yu();Object.defineProperty(A,"DecimalBuilder",{enumerable:!0,get:function(){return WB.DecimalBuilder}});var zB=$u();Object.defineProperty(A,"DictionaryBuilder",{enumerable:!0,get:function(){return zB.DictionaryBuilder}});var HB=Ju();Object.defineProperty(A,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return HB.FixedSizeBinaryBuilder}});var $a=Ku();Object.defineProperty(A,"FloatBuilder",{enumerable:!0,get:function(){return $a.FloatBuilder}});Object.defineProperty(A,"Float16Builder",{enumerable:!0,get:function(){return $a.Float16Builder}});Object.defineProperty(A,"Float32Builder",{enumerable:!0,get:function(){return $a.Float32Builder}});Object.defineProperty(A,"Float64Builder",{enumerable:!0,get:function(){return $a.Float64Builder}});var wr=Xu();Object.defineProperty(A,"IntBuilder",{enumerable:!0,get:function(){return wr.IntBuilder}});Object.defineProperty(A,"Int8Builder",{enumerable:!0,get:function(){return wr.Int8Builder}});Object.defineProperty(A,"Int16Builder",{enumerable:!0,get:function(){return wr.Int16Builder}});Object.defineProperty(A,"Int32Builder",{enumerable:!0,get:function(){return wr.Int32Builder}});Object.defineProperty(A,"Int64Builder",{enumerable:!0,get:function(){return wr.Int64Builder}});Object.defineProperty(A,"Uint8Builder",{enumerable:!0,get:function(){return wr.Uint8Builder}});Object.defineProperty(A,"Uint16Builder",{enumerable:!0,get:function(){return wr.Uint16Builder}});Object.defineProperty(A,"Uint32Builder",{enumerable:!0,get:function(){return wr.Uint32Builder}});Object.defineProperty(A,"Uint64Builder",{enumerable:!0,get:function(){return wr.Uint64Builder}});var us=Zu();Object.defineProperty(A,"TimeBuilder",{enumerable:!0,get:function(){return us.TimeBuilder}});Object.defineProperty(A,"TimeSecondBuilder",{enumerable:!0,get:function(){return us.TimeSecondBuilder}});Object.defineProperty(A,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return us.TimeMillisecondBuilder}});Object.defineProperty(A,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return us.TimeMicrosecondBuilder}});Object.defineProperty(A,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return us.TimeNanosecondBuilder}});var cs=ec();Object.defineProperty(A,"TimestampBuilder",{enumerable:!0,get:function(){return cs.TimestampBuilder}});Object.defineProperty(A,"TimestampSecondBuilder",{enumerable:!0,get:function(){return cs.TimestampSecondBuilder}});Object.defineProperty(A,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return cs.TimestampMillisecondBuilder}});Object.defineProperty(A,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return cs.TimestampMicrosecondBuilder}});Object.defineProperty(A,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return cs.TimestampNanosecondBuilder}});var Bc=tc();Object.defineProperty(A,"IntervalBuilder",{enumerable:!0,get:function(){return Bc.IntervalBuilder}});Object.defineProperty(A,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return Bc.IntervalDayTimeBuilder}});Object.defineProperty(A,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return Bc.IntervalYearMonthBuilder}});var YB=Va();Object.defineProperty(A,"Utf8Builder",{enumerable:!0,get:function(){return YB.Utf8Builder}});var GB=Ma();Object.defineProperty(A,"BinaryBuilder",{enumerable:!0,get:function(){return GB.BinaryBuilder}});var $B=lc();Object.defineProperty(A,"ListBuilder",{enumerable:!0,get:function(){return $B.ListBuilder}});var JB=dc();Object.defineProperty(A,"FixedSizeListBuilder",{enumerable:!0,get:function(){return JB.FixedSizeListBuilder}});var KB=fc();Object.defineProperty(A,"MapBuilder",{enumerable:!0,get:function(){return KB.MapBuilder}});var QB=hc();Object.defineProperty(A,"StructBuilder",{enumerable:!0,get:function(){return QB.StructBuilder}});var Ic=pc();Object.defineProperty(A,"UnionBuilder",{enumerable:!0,get:function(){return Ic.UnionBuilder}});Object.defineProperty(A,"SparseUnionBuilder",{enumerable:!0,get:function(){return Ic.SparseUnionBuilder}});Object.defineProperty(A,"DenseUnionBuilder",{enumerable:!0,get:function(){return Ic.DenseUnionBuilder}});var Sc=pe(),XB=Va(),ZB=Ie(),ry=bc(),ny=ty();ZB.Builder.new=iy;function iy(t){let e=t.type,r=new(ny.instance.getVisitFn(e)())(t);if(e.children&&e.children.length>0){let n=t.children||[],i={nullValues:t.nullValues},a=Array.isArray(n)?(u,o)=>n[o]||i:({name:u})=>n[u]||i;e.children.forEach((u,o)=>{let{type:p}=u,s=a(u,o);r.children.push(iy({...s,type:p}))})}return r}Object.keys(Sc.Type).map(t=>Sc.Type[t]).filter(t=>typeof t=="number"&&t!==Sc.Type.NONE).forEach(t=>{let e=ny.instance.visit(t);e.prototype._setValue=ry.instance.getVisitFn(t)});XB.Utf8Builder.prototype._setValue=ry.instance.visitBinary});var ay=T(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.org=void 0;var Oc=kn(),sy;(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}static getRootAsFooter(s,l){return(l||new o).__init(s.readInt32(s.position())+s.position(),s)}version(){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.readInt16(this.bb_pos+s):Oc.org.apache.arrow.flatbuf.MetadataVersion.V1}schema(s){let l=this.bb.__offset(this.bb_pos,6);return l?(s||new Oc.org.apache.arrow.flatbuf.Schema).__init(this.bb.__indirect(this.bb_pos+l),this.bb):null}dictionaries(s,l){let g=this.bb.__offset(this.bb_pos,8);return g?(l||new t.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+g)+s*24,this.bb):null}dictionariesLength(){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__vector_len(this.bb_pos+s):0}recordBatches(s,l){let g=this.bb.__offset(this.bb_pos,10);return g?(l||new t.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+g)+s*24,this.bb):null}recordBatchesLength(){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.__vector_len(this.bb_pos+s):0}static startFooter(s){s.startObject(4)}static addVersion(s,l){s.addFieldInt16(0,l,Oc.org.apache.arrow.flatbuf.MetadataVersion.V1)}static addSchema(s,l){s.addFieldOffset(1,l,0)}static addDictionaries(s,l){s.addFieldOffset(2,l,0)}static startDictionariesVector(s,l){s.startVector(24,l,8)}static addRecordBatches(s,l){s.addFieldOffset(3,l,0)}static startRecordBatchesVector(s,l){s.startVector(24,l,8)}static endFooter(s){return s.endObject()}static finishFooterBuffer(s,l){s.finish(l)}static createFooter(s,l,g,L,oe){return o.startFooter(s),o.addVersion(s,l),o.addSchema(s,g),o.addDictionaries(s,L),o.addRecordBatches(s,oe),o.endFooter(s)}}u.Footer=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(sy=bn.org||(bn.org={}));(function(t){var e;(function(r){var n;(function(i){var a;(function(u){class o{constructor(){this.bb=null,this.bb_pos=0}__init(s,l){return this.bb_pos=s,this.bb=l,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static createBlock(s,l,g,L){return s.prep(8,24),s.writeInt64(L),s.pad(4),s.writeInt32(g),s.writeInt64(l),s.offset()}}u.Block=o})(a=i.flatbuf||(i.flatbuf={}))})(n=r.arrow||(r.arrow={}))})(e=t.apache||(t.apache={}))})(sy=bn.org||(bn.org={}))});var Fc=T(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.FileBlock=ei.Footer=void 0;var oy=ay(),Ac=Rn(),uy=Ac.flatbuffers.Long,eI=Ac.flatbuffers.Builder,tI=Ac.flatbuffers.ByteBuffer,rI=oy.org.apache.arrow.flatbuf.Block,nr=oy.org.apache.arrow.flatbuf.Footer,cy=He(),ly=pe(),nI=Ee(),Dc=class{constructor(e,r=ly.MetadataVersion.V4,n,i){this.schema=e,this.version=r,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}static decode(e){e=new tI(nI.toUint8Array(e));let r=nr.getRootAsFooter(e),n=cy.Schema.decode(r.schema());return new dy(n,r)}static encode(e){let r=new eI,n=cy.Schema.encode(r,e.schema);nr.startRecordBatchesVector(r,e.numRecordBatches),[...e.recordBatches()].slice().reverse().forEach(u=>jr.encode(r,u));let i=r.endVector();nr.startDictionariesVector(r,e.numDictionaries),[...e.dictionaryBatches()].slice().reverse().forEach(u=>jr.encode(r,u));let a=r.endVector();return nr.startFooter(r),nr.addSchema(r,n),nr.addVersion(r,ly.MetadataVersion.V4),nr.addRecordBatches(r,i),nr.addDictionaries(r,a),nr.finishFooterBuffer(r,nr.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let e,r=-1,n=this.numRecordBatches;++r<n;)(e=this.getRecordBatch(r))&&(yield e)}*dictionaryBatches(){for(let e,r=-1,n=this.numDictionaries;++r<n;)(e=this.getDictionaryBatch(r))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}};ei.Footer=Dc;var dy=class extends Dc{constructor(e,r){super(e,r.version());this._footer=r}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let r=this._footer.recordBatches(e);if(r)return jr.decode(r)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let r=this._footer.dictionaries(e);if(r)return jr.decode(r)}return null}},jr=class{constructor(e,r,n){this.metaDataLength=e,this.offset=typeof n=="number"?n:n.low,this.bodyLength=typeof r=="number"?r:r.low}static decode(e){return new jr(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,r){let{metaDataLength:n}=r,i=new uy(r.offset,0),a=new uy(r.bodyLength,0);return rI.createBlock(e,i,n,a)}};ei.FileBlock=jr});var Hr=T(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.AsyncByteStream=zr.ByteStream=zr.AsyncByteQueue=void 0;var qr=Hi(),fy=dn(),ls=Pn(),Ec=Ee(),ti=st(),Rc=class extends ls.AsyncQueue{write(e){if((e=Ec.toUint8Array(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?fy.decodeUtf8(this.toUint8Array(!0)):this.toUint8Array(!1).then(fy.decodeUtf8)}toUint8Array(e=!1){return e?Ec.joinUint8Arrays(this._values)[0]:(async()=>{let r=[],n=0;for await(let i of this)r.push(i),n+=i.byteLength;return Ec.joinUint8Arrays(r,n)[0]})()}};zr.AsyncByteQueue=Rc;var hy=class{constructor(e){e&&(this.source=new py(qr.default.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}};zr.ByteStream=hy;var Ka=class{constructor(e){e instanceof Ka?this.source=e.source:e instanceof Rc?this.source=new Wr(qr.default.fromAsyncIterable(e)):ti.isReadableNodeStream(e)?this.source=new Wr(qr.default.fromNodeStream(e)):ti.isReadableDOMStream(e)?this.source=new Wr(qr.default.fromDOMStream(e)):ti.isFetchResponse(e)?this.source=new Wr(qr.default.fromDOMStream(e.body)):ti.isIterable(e)?this.source=new Wr(qr.default.fromIterable(e)):ti.isPromise(e)?this.source=new Wr(qr.default.fromAsyncIterable(e)):ti.isAsyncIterable(e)&&(this.source=new Wr(qr.default.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}};zr.AsyncByteStream=Ka;var py=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,r="read"){return this.source.next({cmd:r,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||ls.ITERATOR_DONE)}return(e){return Object.create(this.source.return&&this.source.return(e)||ls.ITERATOR_DONE)}},Wr=class{constructor(e){this.source=e,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}async cancel(e){await this.return(e)}get closed(){return this._closedPromise}async read(e){return(await this.next(e,"read")).value}async peek(e){return(await this.next(e,"peek")).value}async next(e,r="read"){return await this.source.next({cmd:r,size:e})}async throw(e){let r=this.source.throw&&await this.source.throw(e)||ls.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)}async return(e){let r=this.source.return&&await this.source.return(e)||ls.ITERATOR_DONE;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)}}});var Uc=T(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.AsyncRandomAccessFile=ri.RandomAccessFile=void 0;var yy=Hr(),iI=Ee(),my=class extends yy.ByteStream{constructor(e,r){super();this.position=0,this.buffer=iI.toUint8Array(e),this.size=typeof r=="undefined"?this.buffer.byteLength:r}readInt32(e){let{buffer:r,byteOffset:n}=this.readAt(e,4);return new DataView(r,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){let{buffer:r,size:n,position:i}=this;return r&&i<n?(typeof e!="number"&&(e=1/0),this.position=Math.min(n,i+Math.min(n-i,e)),r.subarray(i,this.position)):null}readAt(e,r){let n=this.buffer,i=Math.min(this.size,e+r);return n?n.subarray(e,i):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}};ri.RandomAccessFile=my;var by=class extends yy.AsyncByteStream{constructor(e,r){super();this.position=0,this._handle=e,typeof r=="number"?this.size=r:this._pending=(async()=>{this.size=(await e.stat()).size,delete this._pending})()}async readInt32(e){let{buffer:r,byteOffset:n}=await this.readAt(e,4);return new DataView(r,n).getInt32(0,!0)}async seek(e){return this._pending&&await this._pending,this.position=Math.min(e,this.size),e<this.size}async read(e){this._pending&&await this._pending;let{_handle:r,size:n,position:i}=this;if(r&&i<n){typeof e!="number"&&(e=1/0);let a=i,u=0,o=0,p=Math.min(n,a+Math.min(n-a,e)),s=new Uint8Array(Math.max(0,(this.position=p)-a));for(;(a+=o)<p&&(u+=o)<s.byteLength;)({bytesRead:o}=await r.read(s,u,s.byteLength-u,a));return s}return null}async readAt(e,r){this._pending&&await this._pending;let{_handle:n,size:i}=this;if(n&&e+r<i){let a=Math.min(i,e+r),u=new Uint8Array(a-e);return(await n.read(u,0,r,e)).buffer}return new Uint8Array(r)}async close(){let e=this._handle;this._handle=null,e&&await e.close()}async throw(e){return await this.close(),{done:!0,value:e}}async return(e){return await this.close(),{done:!0,value:e}}};ri.AsyncRandomAccessFile=by});var Pc=T(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.Int128=ir.Int64=ir.Uint64=ir.BaseInt64=void 0;var sI=1<<16;function ni(t){return t<0&&(t=4294967295+t+1),`0x${t.toString(16)}`}var ii=8,Mc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Qa=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),i=r[3]*n[3];this.buffer[0]=i&65535;let a=i>>>16;return i=r[2]*n[3],a+=i,i=r[3]*n[2]>>>0,a+=i,this.buffer[0]+=a<<16,this.buffer[1]=a>>>0<i?sI:0,this.buffer[1]+=a>>>16,this.buffer[1]+=r[1]*n[3]+r[2]*n[2]+r[3]*n[1],this.buffer[1]+=r[0]*n[3]+r[1]*n[2]+r[2]*n[1]+r[3]*n[0]<<16,this}_plus(e){let r=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${ni(this.buffer[1])} ${ni(this.buffer[0])}`}};ir.BaseInt64=Qa;var le=class extends Qa{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,r=new Uint32Array(2)){return le.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(2)){return le.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(2)){let n=e.length,i=new le(r);for(let a=0;a<n;){let u=ii<n-a?ii:n-a,o=new le(new Uint32Array([parseInt(e.substr(a,u),10),0])),p=new le(new Uint32Array([Mc[u],0]));i.times(p),i.plus(o),a+=u}return i}static convertArray(e){let r=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)le.from(e[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(e,r){return new le(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new le(new Uint32Array(e.buffer)).plus(r)}};ir.Uint64=le;var _t=class extends Qa{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let r=this.buffer[1]<<0,n=e.buffer[1]<<0;return r<n||r===n&&this.buffer[0]<e.buffer[0]}static from(e,r=new Uint32Array(2)){return _t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(2)){return _t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(2)){let n=e.startsWith("-"),i=e.length,a=new _t(r);for(let u=n?1:0;u<i;){let o=ii<i-u?ii:i-u,p=new _t(new Uint32Array([parseInt(e.substr(u,o),10),0])),s=new _t(new Uint32Array([Mc[o],0]));a.times(s),a.plus(p),u+=o}return n?a.negate():a}static convertArray(e){let r=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)_t.from(e[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(e,r){return new _t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new _t(new Uint32Array(e.buffer)).plus(r)}};ir.Int64=_t;var Ct=class{constructor(e){this.buffer=e}high(){return new _t(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new _t(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(e){let r=new le(new Uint32Array([this.buffer[3],0])),n=new le(new Uint32Array([this.buffer[2],0])),i=new le(new Uint32Array([this.buffer[1],0])),a=new le(new Uint32Array([this.buffer[0],0])),u=new le(new Uint32Array([e.buffer[3],0])),o=new le(new Uint32Array([e.buffer[2],0])),p=new le(new Uint32Array([e.buffer[1],0])),s=new le(new Uint32Array([e.buffer[0],0])),l=le.multiply(a,s);this.buffer[0]=l.low();let g=new le(new Uint32Array([l.high(),0]));return l=le.multiply(i,s),g.plus(l),l=le.multiply(a,p),g.plus(l),this.buffer[1]=g.low(),this.buffer[3]=g.lessThan(l)?1:0,this.buffer[2]=g.high(),new le(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(le.multiply(n,s)).plus(le.multiply(i,p)).plus(le.multiply(a,o)),this.buffer[3]+=le.multiply(r,s).plus(le.multiply(n,p)).plus(le.multiply(i,o)).plus(le.multiply(a,u)).low(),this}plus(e){let r=new Uint32Array(4);return r[3]=this.buffer[3]+e.buffer[3]>>>0,r[2]=this.buffer[2]+e.buffer[2]>>>0,r[1]=this.buffer[1]+e.buffer[1]>>>0,r[0]=this.buffer[0]+e.buffer[0]>>>0,r[0]<this.buffer[0]>>>0&&++r[1],r[1]<this.buffer[1]>>>0&&++r[2],r[2]<this.buffer[2]>>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return`${ni(this.buffer[3])} ${ni(this.buffer[2])} ${ni(this.buffer[1])} ${ni(this.buffer[0])}`}static multiply(e,r){return new Ct(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new Ct(new Uint32Array(e.buffer)).plus(r)}static from(e,r=new Uint32Array(4)){return Ct.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(4)){return Ct.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(4)){let n=e.startsWith("-"),i=e.length,a=new Ct(r);for(let u=n?1:0;u<i;){let o=ii<i-u?ii:i-u,p=new Ct(new Uint32Array([parseInt(e.substr(u,o),10),0,0,0])),s=new Ct(new Uint32Array([Mc[o],0,0,0]));a.times(s),a.plus(p),u+=o}return n?a.negate():a}static convertArray(e){let r=new Uint32Array(e.length*4);for(let n=-1,i=e.length;++n<i;)Ct.from(e[n],new Uint32Array(r.buffer,r.byteOffset+4*4*n,4));return r}};ir.Int128=Ct});var wy=T(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.JSONVectorLoader=si.VectorLoader=void 0;var Ce=Lt(),aI=He(),Tr=ce(),oI=Xe(),_y=Qt(),uI=dn(),Xa=Pc(),gy=pe(),sr=Ee(),Vc=class extends oI.Visitor{constructor(e,r,n,i){super();this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=e,this.nodes=r,this.buffers=n,this.dictionaries=i}visit(e){return super.visit(e instanceof aI.Field?e.type:e)}visitNull(e,{length:r}=this.nextFieldNode()){return Ce.Data.Null(e,0,r)}visitBool(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Bool(e,0,r,n,this.readNullBitmap(e,n),this.readData(e))}visitInt(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Int(e,0,r,n,this.readNullBitmap(e,n),this.readData(e))}visitFloat(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Float(e,0,r,n,this.readNullBitmap(e,n),this.readData(e))}visitUtf8(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Utf8(e,0,r,n,this.readNullBitmap(e,n),this.readOffsets(e),this.readData(e))}visitBinary(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Binary(e,0,r,n,this.readNullBitmap(e,n),this.readOffsets(e),this.readData(e))}visitFixedSizeBinary(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.FixedSizeBinary(e,0,r,n,this.readNullBitmap(e,n),this.readData(e))}visitDate(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Date(e,0,r,n,this.readNullBitmap(e,n),this.readData(e))}visitTimestamp(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Timestamp(e,0,r,n,this.readNullBitmap(e,n),this.readData(e))}visitTime(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Time(e,0,r,n,this.readNullBitmap(e,n),this.readData(e))}visitDecimal(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Decimal(e,0,r,n,this.readNullBitmap(e,n),this.readData(e))}visitList(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.List(e,0,r,n,this.readNullBitmap(e,n),this.readOffsets(e),this.visit(e.children[0]))}visitStruct(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Struct(e,0,r,n,this.readNullBitmap(e,n),this.visitMany(e.children))}visitUnion(e){return e.mode===gy.UnionMode.Sparse?this.visitSparseUnion(e):this.visitDenseUnion(e)}visitDenseUnion(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Union(e,0,r,n,this.readNullBitmap(e,n),this.readTypeIds(e),this.readOffsets(e),this.visitMany(e.children))}visitSparseUnion(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Union(e,0,r,n,this.readNullBitmap(e,n),this.readTypeIds(e),this.visitMany(e.children))}visitDictionary(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Dictionary(e,0,r,n,this.readNullBitmap(e,n),this.readData(e.indices),this.readDictionary(e))}visitInterval(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Interval(e,0,r,n,this.readNullBitmap(e,n),this.readData(e))}visitFixedSizeList(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.FixedSizeList(e,0,r,n,this.readNullBitmap(e,n),this.visit(e.children[0]))}visitMap(e,{length:r,nullCount:n}=this.nextFieldNode()){return Ce.Data.Map(e,0,r,n,this.readNullBitmap(e,n),this.readOffsets(e),this.visit(e.children[0]))}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,r,n=this.nextBufferRange()){return r>0&&this.readData(e,n)||new Uint8Array(0)}readOffsets(e,r){return this.readData(e,r)}readTypeIds(e,r){return this.readData(e,r)}readData(e,{length:r,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+r)}readDictionary(e){return this.dictionaries.get(e.id)}};si.VectorLoader=Vc;var vy=class extends Vc{constructor(e,r,n,i){super(new Uint8Array(0),r,n,i);this.sources=e}readNullBitmap(e,r,{offset:n}=this.nextBufferRange()){return r<=0?new Uint8Array(0):_y.packBools(this.sources[n])}readOffsets(e,{offset:r}=this.nextBufferRange()){return sr.toArrayBufferView(Uint8Array,sr.toArrayBufferView(Int32Array,this.sources[r]))}readTypeIds(e,{offset:r}=this.nextBufferRange()){return sr.toArrayBufferView(Uint8Array,sr.toArrayBufferView(e.ArrayType,this.sources[r]))}readData(e,{offset:r}=this.nextBufferRange()){let{sources:n}=this;return Tr.DataType.isTimestamp(e)||(Tr.DataType.isInt(e)||Tr.DataType.isTime(e))&&e.bitWidth===64||Tr.DataType.isDate(e)&&e.unit===gy.DateUnit.MILLISECOND?sr.toArrayBufferView(Uint8Array,Xa.Int64.convertArray(n[r])):Tr.DataType.isDecimal(e)?sr.toArrayBufferView(Uint8Array,Xa.Int128.convertArray(n[r])):Tr.DataType.isBinary(e)||Tr.DataType.isFixedSizeBinary(e)?cI(n[r]):Tr.DataType.isBool(e)?_y.packBools(n[r]):Tr.DataType.isUtf8(e)?uI.encodeUtf8(n[r].join("")):sr.toArrayBufferView(Uint8Array,sr.toArrayBufferView(e.ArrayType,n[r].map(i=>+i)))}};si.JSONVectorLoader=vy;function cI(t){let e=t.join(""),r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n>>1]=parseInt(e.substr(n,2),16);return r}});var Dy=T(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.instance=oi.TypeAssembler=void 0;var lI=Rn(),dI=lI.flatbuffers.Long,Ye=kn(),fI=Xe(),Ty=Ye.org.apache.arrow.flatbuf.Null,Za=Ye.org.apache.arrow.flatbuf.Int,kc=Ye.org.apache.arrow.flatbuf.FloatingPoint,By=Ye.org.apache.arrow.flatbuf.Binary,Iy=Ye.org.apache.arrow.flatbuf.Bool,Sy=Ye.org.apache.arrow.flatbuf.Utf8,eo=Ye.org.apache.arrow.flatbuf.Decimal,Nc=Ye.org.apache.arrow.flatbuf.Date,to=Ye.org.apache.arrow.flatbuf.Time,ro=Ye.org.apache.arrow.flatbuf.Timestamp,Lc=Ye.org.apache.arrow.flatbuf.Interval,Oy=Ye.org.apache.arrow.flatbuf.List,Ay=Ye.org.apache.arrow.flatbuf.Struct_,ai=Ye.org.apache.arrow.flatbuf.Union,ds=Ye.org.apache.arrow.flatbuf.DictionaryEncoding,xc=Ye.org.apache.arrow.flatbuf.FixedSizeBinary,Cc=Ye.org.apache.arrow.flatbuf.FixedSizeList,jc=Ye.org.apache.arrow.flatbuf.Map,qc=class extends fI.Visitor{visit(e,r){return e==null||r==null?void 0:super.visit(e,r)}visitNull(e,r){return Ty.startNull(r),Ty.endNull(r)}visitInt(e,r){return Za.startInt(r),Za.addBitWidth(r,e.bitWidth),Za.addIsSigned(r,e.isSigned),Za.endInt(r)}visitFloat(e,r){return kc.startFloatingPoint(r),kc.addPrecision(r,e.precision),kc.endFloatingPoint(r)}visitBinary(e,r){return By.startBinary(r),By.endBinary(r)}visitBool(e,r){return Iy.startBool(r),Iy.endBool(r)}visitUtf8(e,r){return Sy.startUtf8(r),Sy.endUtf8(r)}visitDecimal(e,r){return eo.startDecimal(r),eo.addScale(r,e.scale),eo.addPrecision(r,e.precision),eo.endDecimal(r)}visitDate(e,r){return Nc.startDate(r),Nc.addUnit(r,e.unit),Nc.endDate(r)}visitTime(e,r){return to.startTime(r),to.addUnit(r,e.unit),to.addBitWidth(r,e.bitWidth),to.endTime(r)}visitTimestamp(e,r){let n=e.timezone&&r.createString(e.timezone)||void 0;return ro.startTimestamp(r),ro.addUnit(r,e.unit),n!==void 0&&ro.addTimezone(r,n),ro.endTimestamp(r)}visitInterval(e,r){return Lc.startInterval(r),Lc.addUnit(r,e.unit),Lc.endInterval(r)}visitList(e,r){return Oy.startList(r),Oy.endList(r)}visitStruct(e,r){return Ay.startStruct_(r),Ay.endStruct_(r)}visitUnion(e,r){ai.startTypeIdsVector(r,e.typeIds.length);let n=ai.createTypeIdsVector(r,e.typeIds);return ai.startUnion(r),ai.addMode(r,e.mode),ai.addTypeIds(r,n),ai.endUnion(r)}visitDictionary(e,r){let n=this.visit(e.indices,r);return ds.startDictionaryEncoding(r),ds.addId(r,new dI(e.id,0)),ds.addIsOrdered(r,e.isOrdered),n!==void 0&&ds.addIndexType(r,n),ds.endDictionaryEncoding(r)}visitFixedSizeBinary(e,r){return xc.startFixedSizeBinary(r),xc.addByteWidth(r,e.byteWidth),xc.endFixedSizeBinary(r)}visitFixedSizeList(e,r){return Cc.startFixedSizeList(r),Cc.addListSize(r,e.listSize),Cc.endFixedSizeList(r)}visitMap(e,r){return jc.startMap(r),jc.addKeysSorted(r,e.keysSorted),jc.endMap(r)}};oi.TypeAssembler=qc;oi.instance=new qc});var Vy=T(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.fieldFromJSON=ar.dictionaryBatchFromJSON=ar.recordBatchFromJSON=ar.schemaFromJSON=void 0;var ui=He(),_e=ce(),_n=gn(),ci=pe();function hI(t,e=new Map){return new ui.Schema(yI(t,e),no(t.customMetadata),e)}ar.schemaFromJSON=hI;function Fy(t){return new _n.RecordBatch(t.count,Ry(t.columns),Uy(t.columns))}ar.recordBatchFromJSON=Fy;function pI(t){return new _n.DictionaryBatch(Fy(t.data),t.id,t.isDelta)}ar.dictionaryBatchFromJSON=pI;function yI(t,e){return(t.fields||[]).filter(Boolean).map(r=>ui.Field.fromJSON(r,e))}function Ey(t,e){return(t.children||[]).filter(Boolean).map(r=>ui.Field.fromJSON(r,e))}function Ry(t){return(t||[]).reduce((e,r)=>[...e,new _n.FieldNode(r.count,mI(r.VALIDITY)),...Ry(r.children)],[])}function Uy(t,e=[]){for(let r=-1,n=(t||[]).length;++r<n;){let i=t[r];i.VALIDITY&&e.push(new _n.BufferRegion(e.length,i.VALIDITY.length)),i.TYPE&&e.push(new _n.BufferRegion(e.length,i.TYPE.length)),i.OFFSET&&e.push(new _n.BufferRegion(e.length,i.OFFSET.length)),i.DATA&&e.push(new _n.BufferRegion(e.length,i.DATA.length)),e=Uy(i.children,e)}return e}function mI(t){return(t||[]).reduce((e,r)=>e+ +(r===0),0)}function bI(t,e){let r,n,i,a,u,o;return!e||!(a=t.dictionary)?(u=Py(t,Ey(t,e)),i=new ui.Field(t.name,u,t.nullable,no(t.customMetadata))):e.has(r=a.id)?(n=(n=a.indexType)?My(n):new _e.Int32,o=new _e.Dictionary(e.get(r),n,r,a.isOrdered),i=new ui.Field(t.name,o,t.nullable,no(t.customMetadata))):(n=(n=a.indexType)?My(n):new _e.Int32,e.set(r,u=Py(t,Ey(t,e))),o=new _e.Dictionary(u,n,r,a.isOrdered),i=new ui.Field(t.name,o,t.nullable,no(t.customMetadata))),i||null}ar.fieldFromJSON=bI;function no(t){return new Map(Object.entries(t||{}))}function My(t){return new _e.Int(t.isSigned,t.bitWidth)}function Py(t,e){let r=t.type.name;switch(r){case"NONE":return new _e.Null;case"null":return new _e.Null;case"binary":return new _e.Binary;case"utf8":return new _e.Utf8;case"bool":return new _e.Bool;case"list":return new _e.List((e||[])[0]);case"struct":return new _e.Struct(e||[]);case"struct_":return new _e.Struct(e||[])}switch(r){case"int":{let n=t.type;return new _e.Int(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=t.type;return new _e.Float(ci.Precision[n.precision])}case"decimal":{let n=t.type;return new _e.Decimal(n.scale,n.precision)}case"date":{let n=t.type;return new _e.Date_(ci.DateUnit[n.unit])}case"time":{let n=t.type;return new _e.Time(ci.TimeUnit[n.unit],n.bitWidth)}case"timestamp":{let n=t.type;return new _e.Timestamp(ci.TimeUnit[n.unit],n.timezone)}case"interval":{let n=t.type;return new _e.Interval(ci.IntervalUnit[n.unit])}case"union":{let n=t.type;return new _e.Union(ci.UnionMode[n.mode],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=t.type;return new _e.FixedSizeBinary(n.byteWidth)}case"fixedsizelist":{let n=t.type;return new _e.FixedSizeList(n.listSize,(e||[])[0])}case"map":{let n=t.type;return new _e.Map_((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}});var gn=T(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.FieldNode=Et.BufferRegion=Et.DictionaryBatch=Et.RecordBatch=Et.Message=void 0;var Wc=Rn(),et=kn(),io=gu(),Ge=He(),_I=Ee(),Se=pe(),zc=Dy(),so=Vy(),vn=Wc.flatbuffers.Long,gI=Wc.flatbuffers.Builder,vI=Wc.flatbuffers.ByteBuffer,je=et.org.apache.arrow.flatbuf.Type,jt=et.org.apache.arrow.flatbuf.Field,Br=et.org.apache.arrow.flatbuf.Schema,wI=et.org.apache.arrow.flatbuf.Buffer,Yr=io.org.apache.arrow.flatbuf.Message,Gr=et.org.apache.arrow.flatbuf.KeyValue,TI=io.org.apache.arrow.flatbuf.FieldNode,ky=et.org.apache.arrow.flatbuf.Endianness,$r=io.org.apache.arrow.flatbuf.RecordBatch,li=io.org.apache.arrow.flatbuf.DictionaryBatch,ge=ce(),Jr=class{constructor(e,r,n,i){this._version=r,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=typeof e=="number"?e:e.low}static fromJSON(e,r){let n=new Jr(0,Se.MetadataVersion.V4,r);return n._createHeader=BI(e,r),n}static decode(e){e=new vI(_I.toUint8Array(e));let r=Yr.getRootAsMessage(e),n=r.bodyLength(),i=r.version(),a=r.headerType(),u=new Jr(n,i,a);return u._createHeader=II(r,a),u}static encode(e){let r=new gI,n=-1;return e.isSchema()?n=Ge.Schema.encode(r,e.header()):e.isRecordBatch()?n=Ft.encode(r,e.header()):e.isDictionaryBatch()&&(n=or.encode(r,e.header())),Yr.startMessage(r),Yr.addVersion(r,Se.MetadataVersion.V4),Yr.addHeader(r,n),Yr.addHeaderType(r,e.headerType),Yr.addBodyLength(r,new vn(e.bodyLength,0)),Yr.finishMessageBuffer(r,Yr.endMessage(r)),r.asUint8Array()}static from(e,r=0){if(e instanceof Ge.Schema)return new Jr(0,Se.MetadataVersion.V4,Se.MessageHeader.Schema,e);if(e instanceof Ft)return new Jr(r,Se.MetadataVersion.V4,Se.MessageHeader.RecordBatch,e);if(e instanceof or)return new Jr(r,Se.MetadataVersion.V4,Se.MessageHeader.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===Se.MessageHeader.Schema}isRecordBatch(){return this.headerType===Se.MessageHeader.RecordBatch}isDictionaryBatch(){return this.headerType===Se.MessageHeader.DictionaryBatch}};Et.Message=Jr;var Ft=class{constructor(e,r,n){this._nodes=r,this._buffers=n,this._length=typeof e=="number"?e:e.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}};Et.RecordBatch=Ft;var or=class{constructor(e,r,n=!1){this._data=e,this._isDelta=n,this._id=typeof r=="number"?r:r.low}get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}};Et.DictionaryBatch=or;var wn=class{constructor(e,r){this.offset=typeof e=="number"?e:e.low,this.length=typeof r=="number"?r:r.low}};Et.BufferRegion=wn;var Tn=class{constructor(e,r){this.length=typeof e=="number"?e:e.low,this.nullCount=typeof r=="number"?r:r.low}};Et.FieldNode=Tn;function BI(t,e){return()=>{switch(e){case Se.MessageHeader.Schema:return Ge.Schema.fromJSON(t);case Se.MessageHeader.RecordBatch:return Ft.fromJSON(t);case Se.MessageHeader.DictionaryBatch:return or.fromJSON(t)}throw new Error(`Unrecognized Message type: { name: ${Se.MessageHeader[e]}, type: ${e} }`)}}function II(t,e){return()=>{switch(e){case Se.MessageHeader.Schema:return Ge.Schema.decode(t.header(new Br));case Se.MessageHeader.RecordBatch:return Ft.decode(t.header(new $r),t.version());case Se.MessageHeader.DictionaryBatch:return or.decode(t.header(new li),t.version())}throw new Error(`Unrecognized Message type: { name: ${Se.MessageHeader[e]}, type: ${e} }`)}}Ge.Field.encode=VI;Ge.Field.decode=MI;Ge.Field.fromJSON=so.fieldFromJSON;Ge.Schema.encode=PI;Ge.Schema.decode=SI;Ge.Schema.fromJSON=so.schemaFromJSON;Ft.encode=kI;Ft.decode=OI;Ft.fromJSON=so.recordBatchFromJSON;or.encode=NI;or.decode=AI;or.fromJSON=so.dictionaryBatchFromJSON;Tn.encode=LI;Tn.decode=FI;wn.encode=xI;wn.decode=DI;function SI(t,e=new Map){let r=UI(t,e);return new Ge.Schema(r,ao(t),e)}function OI(t,e=Se.MetadataVersion.V4){return new Ft(t.length(),EI(t),RI(t,e))}function AI(t,e=Se.MetadataVersion.V4){return new or(Ft.decode(t.data(),e),t.id(),t.isDelta())}function DI(t){return new wn(t.offset(),t.length())}function FI(t){return new Tn(t.length(),t.nullCount())}function EI(t){let e=[];for(let r,n=-1,i=-1,a=t.nodesLength();++n<a;)(r=t.nodes(n))&&(e[++i]=Tn.decode(r));return e}function RI(t,e){let r=[];for(let n,i=-1,a=-1,u=t.buffersLength();++i<u;)(n=t.buffers(i))&&(e<Se.MetadataVersion.V4&&(n.bb_pos+=8*(i+1)),r[++a]=wn.decode(n));return r}function UI(t,e){let r=[];for(let n,i=-1,a=-1,u=t.fieldsLength();++i<u;)(n=t.fields(i))&&(r[++a]=Ge.Field.decode(n,e));return r}function Ny(t,e){let r=[];for(let n,i=-1,a=-1,u=t.childrenLength();++i<u;)(n=t.children(i))&&(r[++a]=Ge.Field.decode(n,e));return r}function MI(t,e){let r,n,i,a,u,o;return!e||!(o=t.dictionary())?(i=xy(t,Ny(t,e)),n=new Ge.Field(t.name(),i,t.nullable(),ao(t))):e.has(r=o.id().low)?(a=(a=o.indexType())?Ly(a):new ge.Int32,u=new ge.Dictionary(e.get(r),a,r,o.isOrdered()),n=new Ge.Field(t.name(),u,t.nullable(),ao(t))):(a=(a=o.indexType())?Ly(a):new ge.Int32,e.set(r,i=xy(t,Ny(t,e))),u=new ge.Dictionary(i,a,r,o.isOrdered()),n=new Ge.Field(t.name(),u,t.nullable(),ao(t))),n||null}function ao(t){let e=new Map;if(t)for(let r,n,i=-1,a=t.customMetadataLength()|0;++i<a;)(r=t.customMetadata(i))&&(n=r.key())!=null&&e.set(n,r.value());return e}function Ly(t){return new ge.Int(t.isSigned(),t.bitWidth())}function xy(t,e){let r=t.typeType();switch(r){case je.NONE:return new ge.Null;case je.Null:return new ge.Null;case je.Binary:return new ge.Binary;case je.Utf8:return new ge.Utf8;case je.Bool:return new ge.Bool;case je.List:return new ge.List((e||[])[0]);case je.Struct_:return new ge.Struct(e||[])}switch(r){case je.Int:{let n=t.type(new et.org.apache.arrow.flatbuf.Int);return new ge.Int(n.isSigned(),n.bitWidth())}case je.FloatingPoint:{let n=t.type(new et.org.apache.arrow.flatbuf.FloatingPoint);return new ge.Float(n.precision())}case je.Decimal:{let n=t.type(new et.org.apache.arrow.flatbuf.Decimal);return new ge.Decimal(n.scale(),n.precision())}case je.Date:{let n=t.type(new et.org.apache.arrow.flatbuf.Date);return new ge.Date_(n.unit())}case je.Time:{let n=t.type(new et.org.apache.arrow.flatbuf.Time);return new ge.Time(n.unit(),n.bitWidth())}case je.Timestamp:{let n=t.type(new et.org.apache.arrow.flatbuf.Timestamp);return new ge.Timestamp(n.unit(),n.timezone())}case je.Interval:{let n=t.type(new et.org.apache.arrow.flatbuf.Interval);return new ge.Interval(n.unit())}case je.Union:{let n=t.type(new et.org.apache.arrow.flatbuf.Union);return new ge.Union(n.mode(),n.typeIdsArray()||[],e||[])}case je.FixedSizeBinary:{let n=t.type(new et.org.apache.arrow.flatbuf.FixedSizeBinary);return new ge.FixedSizeBinary(n.byteWidth())}case je.FixedSizeList:{let n=t.type(new et.org.apache.arrow.flatbuf.FixedSizeList);return new ge.FixedSizeList(n.listSize(),(e||[])[0])}case je.Map:{let n=t.type(new et.org.apache.arrow.flatbuf.Map);return new ge.Map_((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${je[r]}" (${r})`)}function PI(t,e){let r=e.fields.map(a=>Ge.Field.encode(t,a));Br.startFieldsVector(t,r.length);let n=Br.createFieldsVector(t,r),i=e.metadata&&e.metadata.size>0?Br.createCustomMetadataVector(t,[...e.metadata].map(([a,u])=>{let o=t.createString(`${a}`),p=t.createString(`${u}`);return Gr.startKeyValue(t),Gr.addKey(t,o),Gr.addValue(t,p),Gr.endKeyValue(t)})):-1;return Br.startSchema(t),Br.addFields(t,n),Br.addEndianness(t,CI?ky.Little:ky.Big),i!==-1&&Br.addCustomMetadata(t,i),Br.endSchema(t)}function VI(t,e){let r=-1,n=-1,i=-1,a=e.type,u=e.typeId;ge.DataType.isDictionary(a)?(u=a.dictionary.typeId,i=zc.instance.visit(a,t),n=zc.instance.visit(a.dictionary,t)):n=zc.instance.visit(a,t);let o=(a.children||[]).map(l=>Ge.Field.encode(t,l)),p=jt.createChildrenVector(t,o),s=e.metadata&&e.metadata.size>0?jt.createCustomMetadataVector(t,[...e.metadata].map(([l,g])=>{let L=t.createString(`${l}`),oe=t.createString(`${g}`);return Gr.startKeyValue(t),Gr.addKey(t,L),Gr.addValue(t,oe),Gr.endKeyValue(t)})):-1;return e.name&&(r=t.createString(e.name)),jt.startField(t),jt.addType(t,n),jt.addTypeType(t,u),jt.addChildren(t,p),jt.addNullable(t,!!e.nullable),r!==-1&&jt.addName(t,r),i!==-1&&jt.addDictionary(t,i),s!==-1&&jt.addCustomMetadata(t,s),jt.endField(t)}function kI(t,e){let r=e.nodes||[],n=e.buffers||[];$r.startNodesVector(t,r.length),r.slice().reverse().forEach(u=>Tn.encode(t,u));let i=t.endVector();$r.startBuffersVector(t,n.length),n.slice().reverse().forEach(u=>wn.encode(t,u));let a=t.endVector();return $r.startRecordBatch(t),$r.addLength(t,new vn(e.length,0)),$r.addNodes(t,i),$r.addBuffers(t,a),$r.endRecordBatch(t)}function NI(t,e){let r=Ft.encode(t,e.data);return li.startDictionaryBatch(t),li.addId(t,new vn(e.id,0)),li.addIsDelta(t,e.isDelta),li.addData(t,r),li.endDictionaryBatch(t)}function LI(t,e){return TI.createFieldNode(t,new vn(e.length,0),new vn(e.nullCount,0))}function xI(t,e){return wI.createBuffer(t,new vn(e.offset,0),new vn(e.length,0))}var CI=function(){let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),new Int16Array(t)[0]===256}()});var uo=T(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.magicX2AndPadding=ie.magicAndPadding=ie.magicLength=ie.checkForMagicArrowString=ie.MAGIC=ie.MAGIC_STR=ie.PADDING=ie.JSONMessageReader=ie.AsyncMessageReader=ie.MessageReader=void 0;var Kr=pe(),jI=Rn(),Cy=jI.flatbuffers.ByteBuffer,fs=gn(),qI=st(),WI=Uc(),jy=Ee(),oo=Hr(),qt=Pn(),Hc=t=>`Expected ${Kr.MessageHeader[t]} Message in stream, but was null or length 0.`,Yc=t=>`Header pointer of flatbuffer-encoded ${Kr.MessageHeader[t]} Message is null or length 0.`,qy=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,Wy=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,Gc=class{constructor(e){this.source=e instanceof oo.ByteStream?e:new oo.ByteStream(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?qt.ITERATOR_DONE:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Hc(e));return r.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let r=jy.toUint8Array(this.source.read(e));if(r.byteLength<e)throw new Error(Wy(e,r.byteLength));return r.byteOffset%8==0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(e=!1){let r=Kr.MessageHeader.Schema,n=this.readMessage(r),i=n&&n.header();if(e&&!i)throw new Error(Yc(r));return i}readMetadataLength(){let e=this.source.read(ie.PADDING),r=e&&new Cy(e),n=r&&r.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(e){let r=this.source.read(e);if(!r)return qt.ITERATOR_DONE;if(r.byteLength<e)throw new Error(qy(e,r.byteLength));return{done:!1,value:fs.Message.decode(r)}}};ie.MessageReader=Gc;var zy=class{constructor(e,r){this.source=e instanceof oo.AsyncByteStream?e:qI.isFileHandle(e)?new WI.AsyncRandomAccessFile(e,r):new oo.AsyncByteStream(e)}[Symbol.asyncIterator](){return this}async next(){let e;return(e=await this.readMetadataLength()).done||e.value===-1&&(e=await this.readMetadataLength()).done||(e=await this.readMetadata(e.value)).done?qt.ITERATOR_DONE:e}async throw(e){return await this.source.throw(e)}async return(e){return await this.source.return(e)}async readMessage(e){let r;if((r=await this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Hc(e));return r.value}async readMessageBody(e){if(e<=0)return new Uint8Array(0);let r=jy.toUint8Array(await this.source.read(e));if(r.byteLength<e)throw new Error(Wy(e,r.byteLength));return r.byteOffset%8==0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}async readSchema(e=!1){let r=Kr.MessageHeader.Schema,n=await this.readMessage(r),i=n&&n.header();if(e&&!i)throw new Error(Yc(r));return i}async readMetadataLength(){let e=await this.source.read(ie.PADDING),r=e&&new Cy(e),n=r&&r.readInt32(0)||0;return{done:n===0,value:n}}async readMetadata(e){let r=await this.source.read(e);if(!r)return qt.ITERATOR_DONE;if(r.byteLength<e)throw new Error(qy(e,r.byteLength));return{done:!1,value:fs.Message.decode(r)}}};ie.AsyncMessageReader=zy;var Hy=class extends Gc{constructor(e){super(new Uint8Array(0));this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof qt.ArrowJSON?e:new qt.ArrowJSON(e)}next(){let{_json:e}=this;if(!this._schema){this._schema=!0;let r=fs.Message.fromJSON(e.schema,Kr.MessageHeader.Schema);return{done:!1,value:r}}if(this._dictionaryIndex<e.dictionaries.length){let r=e.dictionaries[this._dictionaryIndex++];this._body=r.data.columns;let n=fs.Message.fromJSON(r,Kr.MessageHeader.DictionaryBatch);return{done:!1,value:n}}if(this._batchIndex<e.batches.length){let r=e.batches[this._batchIndex++];this._body=r.columns;let n=fs.Message.fromJSON(r,Kr.MessageHeader.RecordBatch);return{done:!1,value:n}}return this._body=[],qt.ITERATOR_DONE}readMessageBody(e){return r(this._body);function r(n){return(n||[]).reduce((i,a)=>[...i,...a.VALIDITY&&[a.VALIDITY]||[],...a.TYPE&&[a.TYPE]||[],...a.OFFSET&&[a.OFFSET]||[],...a.DATA&&[a.DATA]||[],...r(a.children)],[])}}readMessage(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Hc(e));return r.value}readSchema(){let e=Kr.MessageHeader.Schema,r=this.readMessage(e),n=r&&r.header();if(!r||!n)throw new Error(Yc(e));return n}};ie.JSONMessageReader=Hy;ie.PADDING=4;ie.MAGIC_STR="ARROW1";ie.MAGIC=new Uint8Array(ie.MAGIC_STR.length);for(let t=0;t<ie.MAGIC_STR.length;t+=1|0)ie.MAGIC[t]=ie.MAGIC_STR.charCodeAt(t);function zI(t,e=0){for(let r=-1,n=ie.MAGIC.length;++r<n;)if(ie.MAGIC[r]!==t[e+r])return!1;return!0}ie.checkForMagicArrowString=zI;ie.magicLength=ie.MAGIC.length;ie.magicAndPadding=ie.magicLength+ie.PADDING;ie.magicX2AndPadding=ie.magicLength*2+ie.PADDING});var Ky=T(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.VectorAssembler=void 0;var HI=Xe(),Yy=pe(),YI=Ir(),$c=Ee(),Jc=Qt(),GI=Nr(),Gy=gn(),$y=ce(),Me=class extends HI.Visitor{constructor(){super();this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...e){let r=new Me,n=GI.selectVectorChildrenArgs(YI.RecordBatch,e),[i=r]=r.visitMany(n);return i}visit(e){if(!$y.DataType.isDictionary(e.type)){let{data:r,length:n,nullCount:i}=e;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");$y.DataType.isNull(e.type)||Wt.call(this,i<=0?new Uint8Array(0):Jc.truncateBitmap(r.offset,n,r.nullBitmap)),this.nodes.push(new Gy.FieldNode(n,i))}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.indices)}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};co.VectorAssembler=Me;function Wt(t){let e=t.byteLength+7&~7;return this.buffers.push(t),this.bufferRegions.push(new Gy.BufferRegion(this._byteLength,e)),this._byteLength+=e,this}function $I(t){let{type:e,length:r,typeIds:n,valueOffsets:i}=t;if(Wt.call(this,n),e.mode===Yy.UnionMode.Sparse)return Qc.call(this,t);if(e.mode===Yy.UnionMode.Dense){if(t.offset<=0)return Wt.call(this,i),Qc.call(this,t);{let a=n.reduce((l,g)=>Math.max(l,g),n[0]),u=new Int32Array(a+1),o=new Int32Array(a+1).fill(-1),p=new Int32Array(r),s=$c.rebaseValueOffsets(-i[0],r,i);for(let l,g,L=-1;++L<r;)(g=o[l=n[L]])===-1&&(g=o[l]=s[l]),p[L]=s[L]-g,++u[l];Wt.call(this,p);for(let l,g=-1,L=e.children.length;++g<L;)if(l=t.getChildAt(g)){let oe=e.typeIds[g],Je=Math.min(r,u[oe]);this.visit(l.slice(o[oe],Je))}}}return this}function JI(t){let e;return t.nullCount>=t.length?Wt.call(this,new Uint8Array(0)):(e=t.values)instanceof Uint8Array?Wt.call(this,Jc.truncateBitmap(t.offset,t.length,e)):Wt.call(this,Jc.packBools(t))}function Qr(t){return Wt.call(this,t.values.subarray(0,t.length*t.stride))}function Jy(t){let{length:e,values:r,valueOffsets:n}=t,i=n[0],a=n[e],u=Math.min(a-i,r.byteLength-i);return Wt.call(this,$c.rebaseValueOffsets(-n[0],e,n)),Wt.call(this,r.subarray(i,i+u)),this}function Kc(t){let{length:e,valueOffsets:r}=t;return r&&Wt.call(this,$c.rebaseValueOffsets(r[0],e,r)),this.visit(t.getChildAt(0))}function Qc(t){return this.visitMany(t.type.children.map((e,r)=>t.getChildAt(r)).filter(Boolean))[0]}Me.prototype.visitBool=JI;Me.prototype.visitInt=Qr;Me.prototype.visitFloat=Qr;Me.prototype.visitUtf8=Jy;Me.prototype.visitBinary=Jy;Me.prototype.visitFixedSizeBinary=Qr;Me.prototype.visitDate=Qr;Me.prototype.visitTimestamp=Qr;Me.prototype.visitTime=Qr;Me.prototype.visitDecimal=Qr;Me.prototype.visitList=Kc;Me.prototype.visitStruct=Qc;Me.prototype.visitUnion=$I;Me.prototype.visitInterval=Qr;Me.prototype.visitFixedSizeList=Kc;Me.prototype.visitMap=Kc});var Xy=T(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.JSONTypeAssembler=void 0;var KI=Xe(),we=pe(),Qy=class extends KI.Visitor{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:we.ArrowType[e].toLowerCase()}}visitInt({typeId:e,bitWidth:r,isSigned:n}){return{name:we.ArrowType[e].toLowerCase(),bitWidth:r,isSigned:n}}visitFloat({typeId:e,precision:r}){return{name:we.ArrowType[e].toLowerCase(),precision:we.Precision[r]}}visitBinary({typeId:e}){return{name:we.ArrowType[e].toLowerCase()}}visitBool({typeId:e}){return{name:we.ArrowType[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:we.ArrowType[e].toLowerCase()}}visitDecimal({typeId:e,scale:r,precision:n}){return{name:we.ArrowType[e].toLowerCase(),scale:r,precision:n}}visitDate({typeId:e,unit:r}){return{name:we.ArrowType[e].toLowerCase(),unit:we.DateUnit[r]}}visitTime({typeId:e,unit:r,bitWidth:n}){return{name:we.ArrowType[e].toLowerCase(),unit:we.TimeUnit[r],bitWidth:n}}visitTimestamp({typeId:e,timezone:r,unit:n}){return{name:we.ArrowType[e].toLowerCase(),unit:we.TimeUnit[n],timezone:r}}visitInterval({typeId:e,unit:r}){return{name:we.ArrowType[e].toLowerCase(),unit:we.IntervalUnit[r]}}visitList({typeId:e}){return{name:we.ArrowType[e].toLowerCase()}}visitStruct({typeId:e}){return{name:we.ArrowType[e].toLowerCase()}}visitUnion({typeId:e,mode:r,typeIds:n}){return{name:we.ArrowType[e].toLowerCase(),mode:we.UnionMode[r],typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:r}){return{name:we.ArrowType[e].toLowerCase(),byteWidth:r}}visitFixedSizeList({typeId:e,listSize:r}){return{name:we.ArrowType[e].toLowerCase(),listSize:r}}visitMap({typeId:e,keysSorted:r}){return{name:we.ArrowType[e].toLowerCase(),keysSorted:r}}};lo.JSONTypeAssembler=Qy});var tm=T(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.JSONVectorAssembler=void 0;var QI=ts(),hs=Kn(),XI=De(),ZI=Xe(),eS=pe(),tS=Ir(),Xc=pe(),fo=Qt(),rS=Nr(),Zy=ce(),ho=class extends ZI.Visitor{static assemble(...e){return new ho().visitMany(rS.selectColumnChildrenArgs(tS.RecordBatch,e))}visit(e){let{data:r,name:n,length:i}=e,{offset:a,nullCount:u,nullBitmap:o}=r,p=Zy.DataType.isDictionary(e.type)?e.type.indices:e.type,s=Object.assign([],r.buffers,{[eS.BufferType.VALIDITY]:void 0});return{name:n,count:i,VALIDITY:Zy.DataType.isNull(p)?void 0:u<=0?Array.from({length:i},()=>1):[...fo.iterateBits(o,a,i,null,fo.getBit)],...super.visit(XI.Vector.new(r.clone(p,a,i,0,s)))}}visitNull(){return{}}visitBool({values:e,offset:r,length:n}){return{DATA:[...fo.iterateBits(e,r,n,null,fo.getBool)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...ps(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...e],OFFSET:[...e.valueOffsets]}}visitBinary(e){return{DATA:[...em(e)],OFFSET:[...e.valueOffsets]}}visitFixedSizeBinary(e){return{DATA:[...em(e)]}}visitDate(e){return{DATA:e.type.unit===Xc.DateUnit.DAY?[...e.values]:[...ps(e.values,2)]}}visitTimestamp(e){return{DATA:[...ps(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<Xc.TimeUnit.MICROSECOND?[...e.values]:[...ps(e.values,2)]}}visitDecimal(e){return{DATA:[...ps(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((r,n)=>this.visit(new hs.Column(r,[e.getChildAt(n)])))}}visitStruct(e){return{children:e.type.children.map((r,n)=>this.visit(new hs.Column(r,[e.getChildAt(n)])))}}visitUnion(e){return{TYPE:[...e.typeIds],OFFSET:e.type.mode===Xc.UnionMode.Dense?[...e.valueOffsets]:void 0,children:e.type.children.map((r,n)=>this.visit(new hs.Column(r,[e.getChildAt(n)])))}}visitInterval(e){return{DATA:[...e.values]}}visitFixedSizeList(e){return{children:e.type.children.map((r,n)=>this.visit(new hs.Column(r,[e.getChildAt(n)])))}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:e.type.children.map((r,n)=>this.visit(new hs.Column(r,[e.getChildAt(n)])))}}};po.JSONVectorAssembler=ho;function*em(t){for(let e of t)yield e.reduce((r,n)=>`${r}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*ps(t,e){for(let r=-1,n=t.length/e;++r<n;)yield`${QI.BN.new(t.subarray((r+0)*e,(r+1)*e),!1)}`}});var go=T(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.RecordBatchJSONWriter=cr.RecordBatchFileWriter=cr.RecordBatchStreamWriter=cr.RecordBatchWriter=void 0;var Zc=ms(),nS=uo(),iS=Kn(),sS=ce(),aS=He(),yo=gn(),el=gn(),di=Fc(),tl=pe(),rl=Hr(),rm=Ky(),oS=Xy(),nm=tm(),uS=Ee(),nl=Ir(),cS=Pn(),ur=st(),ys=class extends cS.ReadableInterop{constructor(e){super();this._position=0,this._started=!1,this._sink=new rl.AsyncByteQueue,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,ur.isObject(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,r){throw new Error('"throughDOM" not available in this environment')}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return ur.isPromise(e)?e.then(r=>this.writeAll(r)):ur.isAsyncIterable(e)?sl(this,e):il(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,r=null){return e===this._sink||e instanceof rl.AsyncByteQueue?this._sink=e:(this._sink=new rl.AsyncByteQueue,e&&ur.isWritableDOMStream(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&ur.isWritableNodeStream(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!r||!r.compareTo(this._schema))&&(r===null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(e){let r=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof Zc.Table&&!(r=e.schema))return this.finish()&&void 0;if(e instanceof nl.RecordBatch&&!(r=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!r.compareTo(this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}e instanceof nl.RecordBatch?e instanceof nl._InternalEmptyPlaceholderRecordBatch||this._writeRecordBatch(e):e instanceof Zc.Table?this.writeAll(e.chunks):ur.isIterable(e)&&this.writeAll(e)}_writeMessage(e,r=8){let n=r-1,i=yo.Message.encode(e),a=i.byteLength,u=this._writeLegacyIpcFormat?4:8,o=a+u+n&~n,p=o-a-u;return e.headerType===tl.MessageHeader.RecordBatch?this._recordBatchBlocks.push(new di.FileBlock(o,e.bodyLength,this._position)):e.headerType===tl.MessageHeader.DictionaryBatch&&this._dictionaryBlocks.push(new di.FileBlock(o,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(o-u)),a>0&&this._write(i),this._writePadding(p)}_write(e){if(this._started){let r=uS.toUint8Array(e);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(e){return this._writeMessage(yo.Message.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(nS.MAGIC)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:r,nodes:n,bufferRegions:i,buffers:a}=rm.VectorAssembler.assemble(e),u=new el.RecordBatch(e.length,n,i),o=yo.Message.from(u,r);return this._writeDictionaries(e)._writeMessage(o)._writeBodyBuffers(a)}_writeDictionaryBatch(e,r,n=!1){this._dictionaryDeltaOffsets.set(r,e.length+(this._dictionaryDeltaOffsets.get(r)||0));let{byteLength:i,nodes:a,bufferRegions:u,buffers:o}=rm.VectorAssembler.assemble(e),p=new el.RecordBatch(e.length,a,u),s=new el.DictionaryBatch(p,r,n),l=yo.Message.from(s,i);return this._writeMessage(l)._writeBodyBuffers(o)}_writeBodyBuffers(e){let r,n,i;for(let a=-1,u=e.length;++a<u;)(r=e[a])&&(n=r.byteLength)>0&&(this._write(r),(i=(n+7&~7)-n)>0&&this._writePadding(i));return this}_writeDictionaries(e){for(let[r,n]of e.dictionaries){let i=this._dictionaryDeltaOffsets.get(r)||0;if(i===0||(n=n.slice(i)).length>0){let a="chunks"in n?n.chunks:[n];for(let u of a)this._writeDictionaryBatch(u,r,i>0),i+=u.length}}return this}};cr.RecordBatchWriter=ys;var mo=class extends ys{static writeAll(e,r){let n=new mo(r);return ur.isPromise(e)?e.then(i=>n.writeAll(i)):ur.isAsyncIterable(e)?sl(n,e):il(n,e)}};cr.RecordBatchStreamWriter=mo;var bo=class extends ys{static writeAll(e){let r=new bo;return ur.isPromise(e)?e.then(n=>r.writeAll(n)):ur.isAsyncIterable(e)?sl(r,e):il(r,e)}constructor(){super();this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeFooter(e){let r=di.Footer.encode(new di.Footer(e,tl.MetadataVersion.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}};cr.RecordBatchFileWriter=bo;var _o=class extends ys{constructor(){super();this._autoDestroy=!0,this._recordBatches=[],this._dictionaries=[]}static writeAll(e){return new _o().writeAll(e)}_writeMessage(){return this}_writeFooter(e){return this}_writeSchema(e){return this._write(`{
|
|
8
|
-
"schema": ${JSON.stringify({fields:e.fields.map(im)},null,2)}`)}_writeDictionaries(e){return e.dictionaries.size>0&&this._dictionaries.push(e),this}_writeDictionaryBatch(e,r,n=!1){return this._dictionaryDeltaOffsets.set(r,e.length+(this._dictionaryDeltaOffsets.get(r)||0)),this._write(this._dictionaryBlocks.length===0?" ":`,
|
|
9
|
-
`),this._write(`${lS(e,r,n)}`),this._dictionaryBlocks.push(new di.FileBlock(0,0,0)),this}_writeRecordBatch(e){return this._writeDictionaries(e),this._recordBatches.push(e),this}close(){if(this._dictionaries.length>0){this._write(`,
|
|
10
|
-
"dictionaries": [
|
|
11
|
-
`);for(let e of this._dictionaries)super._writeDictionaries(e);this._write(`
|
|
12
|
-
]`)}if(this._recordBatches.length>0){for(let e=-1,r=this._recordBatches.length;++e<r;)this._write(e===0?`,
|
|
13
|
-
"batches": [
|
|
14
|
-
`:`,
|
|
15
|
-
`),this._write(`${dS(this._recordBatches[e])}`),this._recordBatchBlocks.push(new di.FileBlock(0,0,0));this._write(`
|
|
16
|
-
]`)}return this._schema&&this._write(`
|
|
17
|
-
}`),this._dictionaries=[],this._recordBatches=[],super.close()}};cr.RecordBatchJSONWriter=_o;function il(t,e){let r=e;e instanceof Zc.Table&&(r=e.chunks,t.reset(void 0,e.schema));for(let n of r)t.write(n);return t.finish()}async function sl(t,e){for await(let r of e)t.write(r);return t.finish()}function im({name:t,type:e,nullable:r}){let n=new oS.JSONTypeAssembler;return{name:t,nullable:r,type:n.visit(e),children:(e.children||[]).map(im),dictionary:sS.DataType.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function lS(t,e,r=!1){let n=new aS.Field(`${e}`,t.type,t.nullCount>0),i=nm.JSONVectorAssembler.assemble(new iS.Column(n,[t]));return JSON.stringify({id:e,isDelta:r,data:{count:t.length,columns:i}},null,2)}function dS(t){return JSON.stringify({count:t.length,columns:nm.JSONVectorAssembler.assemble(t)},null,2)}});var ul=T(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.distributeVectorsIntoRecordBatches=Xr.distributeColumnsIntoRecordBatches=Xr.ensureSameLengthData=void 0;var sm=Lt(),al=He(),fS=kr(),hS=Ir(),ol=new Uint8Array(0),am=t=>[ol,ol,new Uint8Array(t),ol];function pS(t,e,r=e.reduce((n,i)=>Math.max(n,i.length),0)){let n,i,a=-1,u=e.length,o=[...t.fields],p=[],s=(r+63&~63)>>3;for(;++a<u;)(n=e[a])&&n.length===r?p[a]=n:((i=o[a]).nullable||(o[a]=o[a].clone({nullable:!0})),p[a]=n?n._changeLengthAndBackfillNullBitmap(r):sm.Data.new(i.type,0,r,r,am(s)));return[new al.Schema(o),r,p]}Xr.ensureSameLengthData=pS;function yS(t){return om(new al.Schema(t.map(({field:e})=>e)),t)}Xr.distributeColumnsIntoRecordBatches=yS;function om(t,e){return mS(t,e.map(r=>r instanceof fS.Chunked?r.chunks.map(n=>n.data):[r.data]))}Xr.distributeVectorsIntoRecordBatches=om;function mS(t,e){let r=[...t.fields],n=[],i={numBatches:e.reduce((g,L)=>Math.max(g,L.length),0)},a=0,u=0,o=-1,p=e.length,s,l=[];for(;i.numBatches-- >0;){for(u=Number.POSITIVE_INFINITY,o=-1;++o<p;)l[o]=s=e[o].shift(),u=Math.min(u,s?s.length:u);isFinite(u)&&(l=bS(r,u,l,e,i),u>0&&(n[a++]=[u,l.slice()]))}return[t=new al.Schema(r,t.metadata),n.map(g=>new hS.RecordBatch(t,...g))]}function bS(t,e,r,n,i){let a,u,o=0,p=-1,s=n.length,l=(e+63&~63)>>3;for(;++p<s;)(a=r[p])&&(o=a.length)>=e?o===e?r[p]=a:(r[p]=a.slice(0,e),a=a.slice(e,o-e),i.numBatches=Math.max(i.numBatches,n[p].unshift(a))):((u=t[p]).nullable||(t[p]=u.clone({nullable:!0})),r[p]=a?a._changeLengthAndBackfillNullBitmap(e):sm.Data.new(u.type,0,e,e,am(l)));return r}});var Fe=T(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.BaseVector=void 0;var _S=pe(),gS=kr(),vS=is(),cl=De(),ll=class extends cl.AbstractVector{constructor(e,r){super();this._children=r,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`${_S.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,r=this._children){return cl.Vector.new(e,r)}concat(...e){return gS.Chunked.concat(this,...e)}slice(e,r){return vS.clampRange(this,e,r,this._sliceInternal)}isValid(e){if(this.nullCount>0){let r=this.offset+e;return(this.nullBitmap[r>>3]&1<<r%8)!==0}return!0}getChildAt(e){return e<0||e>=this.numChildren?null:(this._children||(this._children=[]))[e]||(this._children[e]=cl.Vector.new(this.data.childData[e]))}toJSON(){return[...this]}_sliceInternal(e,r,n){return e.clone(e.data.slice(r,n-r),null)}_bindDataAccessors(e){}};vo.BaseVector=ll;ll.prototype[Symbol.isConcatSpreadable]=!0});var dl=T(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.BinaryVector=void 0;var wS=De(),TS=Fe(),BS=ce(),um=class extends TS.BaseVector{asUtf8(){return wS.Vector.new(this.data.clone(new BS.Utf8))}};wo.BinaryVector=um});var fl=T(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.BoolVector=void 0;var IS=ce(),SS=Fe(),OS=lr(),cm=class extends SS.BaseVector{static from(e){return OS.vectorFromValuesWithType(()=>new IS.Bool,e)}};To.BoolVector=cm});var pl=T(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.DateMillisecondVector=Zr.DateDayVector=Zr.DateVector=void 0;var AS=pe(),DS=Fe(),lm=lr(),hl=ce(),Bo=class extends DS.BaseVector{static from(...e){return e.length===2?lm.vectorFromValuesWithType(()=>e[1]===AS.DateUnit.DAY?new hl.DateDay:new hl.DateMillisecond,e[0]):lm.vectorFromValuesWithType(()=>new hl.DateMillisecond,e[0])}};Zr.DateVector=Bo;var dm=class extends Bo{};Zr.DateDayVector=dm;var fm=class extends Bo{};Zr.DateMillisecondVector=fm});var yl=T(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.DecimalVector=void 0;var FS=Fe(),hm=class extends FS.BaseVector{};Io.DecimalVector=hm});var Oo=T(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.DictionaryVector=void 0;var ES=Lt(),pm=De(),RS=Fe(),US=lr(),MS=ce(),ml=class extends RS.BaseVector{constructor(e){super(e);this.indices=pm.Vector.new(e.clone(this.type.indices))}static from(...e){if(e.length===3){let[r,n,i]=e,a=new MS.Dictionary(r.type,n,null,null);return pm.Vector.new(ES.Data.Dictionary(a,0,i.length,0,null,i,r))}return US.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,r){return this.indices.set(e,r)}setValue(e,r){return this.dictionary.set(e,r)}};So.DictionaryVector=ml;ml.prototype.indices=null});var bl=T(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.FixedSizeBinaryVector=void 0;var PS=Fe(),ym=class extends PS.BaseVector{};Ao.FixedSizeBinaryVector=ym});var _l=T(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.FixedSizeListVector=void 0;var VS=Fe(),mm=class extends VS.BaseVector{};Do.FixedSizeListVector=mm});var Tl=T(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.Float64Vector=dr.Float32Vector=dr.Float16Vector=dr.FloatVector=void 0;var kS=Lt(),NS=De(),LS=Fe(),xS=lr(),Bn=ce(),bs=class extends LS.BaseVector{static from(e){let r=qS(this);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)){let n=jS(e.constructor)||r;if(r===null&&(r=n),r&&r===n){let i=new r,a=e.byteLength/i.ArrayType.BYTES_PER_ELEMENT;if(!CS(r,e.constructor))return NS.Vector.new(kS.Data.Float(i,0,a,0,null,e))}}if(r)return xS.vectorFromValuesWithType(()=>new r,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=bs;var gl=class extends bs{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}};dr.Float16Vector=gl;var vl=class extends bs{};dr.Float32Vector=vl;var wl=class extends bs{};dr.Float64Vector=wl;var CS=(t,e)=>t===Bn.Float16&&e!==Uint16Array,jS=t=>{switch(t){case Uint16Array:return Bn.Float16;case Float32Array:return Bn.Float32;case Float64Array:return Bn.Float64;default:return null}},qS=t=>{switch(t){case gl:return Bn.Float16;case vl:return Bn.Float32;case wl:return Bn.Float64;default:return null}}});var Bl=T(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.IntervalYearMonthVector=en.IntervalDayTimeVector=en.IntervalVector=void 0;var WS=Fe(),Fo=class extends WS.BaseVector{};en.IntervalVector=Fo;var bm=class extends Fo{};en.IntervalDayTimeVector=bm;var _m=class extends Fo{};en.IntervalYearMonthVector=_m});var Eo=T(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.Uint64Vector=Pe.Uint32Vector=Pe.Uint16Vector=Pe.Uint8Vector=Pe.Int64Vector=Pe.Int32Vector=Pe.Int16Vector=Pe.Int8Vector=Pe.IntVector=void 0;var zS=Lt(),HS=De(),YS=Fe(),GS=lr(),gm=st(),vm=Ee(),Oe=ce(),fr=class extends YS.BaseVector{static from(...e){let[r,n=!1]=e,i=KS(this,n);if(r instanceof ArrayBuffer||ArrayBuffer.isView(r)){let a=JS(r.constructor,n)||i;if(i===null&&(i=a),i&&i===a){let u=new i,o=r.byteLength/u.ArrayType.BYTES_PER_ELEMENT;return $S(i,r.constructor)&&(o*=.5),HS.Vector.new(zS.Data.Int(u,0,o,0,null,r))}}if(i)return GS.vectorFromValuesWithType(()=>new i,r);throw r instanceof DataView||r instanceof ArrayBuffer?new TypeError(`Cannot infer integer type from instance of ${r.constructor.name}`):new TypeError("Unrecognized IntVector input")}};Pe.IntVector=fr;var Il=class extends fr{};Pe.Int8Vector=Il;var Sl=class extends fr{};Pe.Int16Vector=Sl;var Ol=class extends fr{};Pe.Int32Vector=Ol;var Al=class extends fr{toBigInt64Array(){return vm.toBigInt64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}};Pe.Int64Vector=Al;var Dl=class extends fr{};Pe.Uint8Vector=Dl;var Fl=class extends fr{};Pe.Uint16Vector=Fl;var El=class extends fr{};Pe.Uint32Vector=El;var Rl=class extends fr{toBigUint64Array(){return vm.toBigUint64Array(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}};Pe.Uint64Vector=Rl;var $S=(t,e)=>(t===Oe.Int64||t===Oe.Uint64)&&(e===Int32Array||e===Uint32Array),JS=(t,e)=>{switch(t){case Int8Array:return Oe.Int8;case Int16Array:return Oe.Int16;case Int32Array:return e?Oe.Int64:Oe.Int32;case gm.BigInt64Array:return Oe.Int64;case Uint8Array:return Oe.Uint8;case Uint16Array:return Oe.Uint16;case Uint32Array:return e?Oe.Uint64:Oe.Uint32;case gm.BigUint64Array:return Oe.Uint64;default:return null}},KS=(t,e)=>{switch(t){case Il:return Oe.Int8;case Sl:return Oe.Int16;case Ol:return e?Oe.Int64:Oe.Int32;case Al:return Oe.Int64;case Dl:return Oe.Uint8;case Fl:return Oe.Uint16;case El:return e?Oe.Uint64:Oe.Uint32;case Rl:return Oe.Uint64;default:return null}}});var Ul=T(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.ListVector=void 0;var QS=Fe(),wm=class extends QS.BaseVector{};Ro.ListVector=wm});var Ml=T(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.MapVector=void 0;var XS=rs(),ZS=De(),e0=Fe(),t0=ce(),Tm=class extends e0.BaseVector{asList(){let e=this.type.children[0];return ZS.Vector.new(this.data.clone(new t0.List(e)))}bind(e){let r=this.getChildAt(0),{[e]:n,[e+1]:i}=this.valueOffsets;return new XS.MapRow(r.slice(n,i))}};Uo.MapVector=Tm});var Pl=T(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.NullVector=void 0;var r0=Fe(),Bm=class extends r0.BaseVector{};Mo.NullVector=Bm});var Vl=T(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.StructVector=void 0;var n0=rs(),i0=Fe(),s0=Symbol.for("rowIndex"),Im=class extends i0.BaseVector{bind(e){let r=this._row||(this._row=new n0.StructRow(this)),n=Object.create(r);return n[s0]=e,n}};Po.StructVector=Im});var kl=T(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.TimestampNanosecondVector=Rt.TimestampMicrosecondVector=Rt.TimestampMillisecondVector=Rt.TimestampSecondVector=Rt.TimestampVector=void 0;var a0=Fe(),fi=class extends a0.BaseVector{};Rt.TimestampVector=fi;var Sm=class extends fi{};Rt.TimestampSecondVector=Sm;var Om=class extends fi{};Rt.TimestampMillisecondVector=Om;var Am=class extends fi{};Rt.TimestampMicrosecondVector=Am;var Dm=class extends fi{};Rt.TimestampNanosecondVector=Dm});var Nl=T(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.TimeNanosecondVector=Ut.TimeMicrosecondVector=Ut.TimeMillisecondVector=Ut.TimeSecondVector=Ut.TimeVector=void 0;var o0=Fe(),hi=class extends o0.BaseVector{};Ut.TimeVector=hi;var Fm=class extends hi{};Ut.TimeSecondVector=Fm;var Em=class extends hi{};Ut.TimeMillisecondVector=Em;var Rm=class extends hi{};Ut.TimeMicrosecondVector=Rm;var Um=class extends hi{};Ut.TimeNanosecondVector=Um});var Ll=T(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.SparseUnionVector=tn.DenseUnionVector=tn.UnionVector=void 0;var u0=Fe(),Vo=class extends u0.BaseVector{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}};tn.UnionVector=Vo;var Mm=class extends Vo{get valueOffsets(){return this.data.valueOffsets}};tn.DenseUnionVector=Mm;var Pm=class extends Vo{};tn.SparseUnionVector=Pm});var xl=T(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.Utf8Vector=void 0;var c0=De(),l0=Fe(),Vm=ce(),d0=lr(),km=class extends l0.BaseVector{static from(e){return d0.vectorFromValuesWithType(()=>new Vm.Utf8,e)}asBinary(){return c0.Vector.new(this.data.clone(new Vm.Binary))}};ko.Utf8Vector=km});var Nm=T(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.partial2=rn.partial1=rn.partial0=void 0;function f0(t){return function(){return t(this)}}rn.partial0=f0;function h0(t){return function(e){return t(this,e)}}rn.partial1=h0;function p0(t){return function(e,r){return t(this,e,r)}}rn.partial2=p0});var ql=T(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.instance=pi.GetVisitor=void 0;var No=ts(),y0=Xe(),m0=dn(),b0=Qi(),Mt=pe(),q=class extends y0.Visitor{};pi.GetVisitor=q;var _0=(t,e)=>864e5*t[e],Cl=(t,e)=>4294967296*t[e+1]+(t[e]>>>0),g0=(t,e)=>4294967296*(t[e+1]/1e3)+(t[e]>>>0)/1e3,v0=(t,e)=>4294967296*(t[e+1]/1e6)+(t[e]>>>0)/1e6,Lm=t=>new Date(t),w0=(t,e)=>Lm(_0(t,e)),T0=(t,e)=>Lm(Cl(t,e)),B0=(t,e)=>null,xm=(t,e,r)=>{let{[r]:n,[r+1]:i}=e;return n!=null&&i!=null?t.subarray(n,i):null},I0=({offset:t,values:e},r)=>{let n=t+r;return(e[n>>3]&1<<n%8)!=0},Cm=({values:t},e)=>w0(t,e),jm=({values:t},e)=>T0(t,e*2),hr=({stride:t,values:e},r)=>e[t*r],qm=({stride:t,values:e},r)=>b0.uint16ToFloat64(e[t*r]),jl=({stride:t,values:e,type:r},n)=>No.BN.new(e.subarray(t*n,t*(n+1)),r.isSigned),S0=({stride:t,values:e},r)=>e.subarray(t*r,t*(r+1)),O0=({values:t,valueOffsets:e},r)=>xm(t,e,r),A0=({values:t,valueOffsets:e},r)=>{let n=xm(t,e,r);return n!==null?m0.decodeUtf8(n):null},D0=(t,e)=>t.type.bitWidth<64?hr(t,e):jl(t,e),F0=(t,e)=>t.type.precision!==Mt.Precision.HALF?hr(t,e):qm(t,e),E0=(t,e)=>t.type.unit===Mt.DateUnit.DAY?Cm(t,e):jm(t,e),Wm=({values:t},e)=>1e3*Cl(t,e*2),zm=({values:t},e)=>Cl(t,e*2),Hm=({values:t},e)=>g0(t,e*2),Ym=({values:t},e)=>v0(t,e*2),R0=(t,e)=>{switch(t.type.unit){case Mt.TimeUnit.SECOND:return Wm(t,e);case Mt.TimeUnit.MILLISECOND:return zm(t,e);case Mt.TimeUnit.MICROSECOND:return Hm(t,e);case Mt.TimeUnit.NANOSECOND:return Ym(t,e)}},Gm=({values:t,stride:e},r)=>t[e*r],$m=({values:t,stride:e},r)=>t[e*r],Jm=({values:t},e)=>No.BN.signed(t.subarray(2*e,2*(e+1))),Km=({values:t},e)=>No.BN.signed(t.subarray(2*e,2*(e+1))),U0=(t,e)=>{switch(t.type.unit){case Mt.TimeUnit.SECOND:return Gm(t,e);case Mt.TimeUnit.MILLISECOND:return $m(t,e);case Mt.TimeUnit.MICROSECOND:return Jm(t,e);case Mt.TimeUnit.NANOSECOND:return Km(t,e)}},M0=({values:t},e)=>No.BN.decimal(t.subarray(4*e,4*(e+1))),P0=(t,e)=>{let r=t.getChildAt(0),{valueOffsets:n,stride:i}=t;return r.slice(n[e*i],n[e*i+1])},V0=(t,e)=>t.bind(e),k0=(t,e)=>t.bind(e),N0=(t,e)=>t.type.mode===Mt.UnionMode.Dense?Qm(t,e):Xm(t,e),Qm=(t,e)=>{let r=t.typeIdToChildIndex[t.typeIds[e]],n=t.getChildAt(r);return n?n.get(t.valueOffsets[e]):null},Xm=(t,e)=>{let r=t.typeIdToChildIndex[t.typeIds[e]],n=t.getChildAt(r);return n?n.get(e):null},L0=(t,e)=>t.getValue(t.getKey(e)),x0=(t,e)=>t.type.unit===Mt.IntervalUnit.DAY_TIME?Zm(t,e):eb(t,e),Zm=({values:t},e)=>t.subarray(2*e,2*(e+1)),eb=({values:t},e)=>{let r=t[e],n=new Int32Array(2);return n[0]=r/12|0,n[1]=r%12|0,n},C0=(t,e)=>{let r=t.getChildAt(0),{stride:n}=t;return r.slice(e*n,(e+1)*n)};q.prototype.visitNull=B0;q.prototype.visitBool=I0;q.prototype.visitInt=D0;q.prototype.visitInt8=hr;q.prototype.visitInt16=hr;q.prototype.visitInt32=hr;q.prototype.visitInt64=jl;q.prototype.visitUint8=hr;q.prototype.visitUint16=hr;q.prototype.visitUint32=hr;q.prototype.visitUint64=jl;q.prototype.visitFloat=F0;q.prototype.visitFloat16=qm;q.prototype.visitFloat32=hr;q.prototype.visitFloat64=hr;q.prototype.visitUtf8=A0;q.prototype.visitBinary=O0;q.prototype.visitFixedSizeBinary=S0;q.prototype.visitDate=E0;q.prototype.visitDateDay=Cm;q.prototype.visitDateMillisecond=jm;q.prototype.visitTimestamp=R0;q.prototype.visitTimestampSecond=Wm;q.prototype.visitTimestampMillisecond=zm;q.prototype.visitTimestampMicrosecond=Hm;q.prototype.visitTimestampNanosecond=Ym;q.prototype.visitTime=U0;q.prototype.visitTimeSecond=Gm;q.prototype.visitTimeMillisecond=$m;q.prototype.visitTimeMicrosecond=Jm;q.prototype.visitTimeNanosecond=Km;q.prototype.visitDecimal=M0;q.prototype.visitList=P0;q.prototype.visitStruct=k0;q.prototype.visitUnion=N0;q.prototype.visitDenseUnion=Qm;q.prototype.visitSparseUnion=Xm;q.prototype.visitDictionary=L0;q.prototype.visitInterval=x0;q.prototype.visitIntervalDayTime=Zm;q.prototype.visitIntervalYearMonth=eb;q.prototype.visitFixedSizeList=C0;q.prototype.visitMap=V0;pi.instance=new q});var ib=T(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.instance=yi.IndexOfVisitor=void 0;var j0=Xe(),tb=Qt(),rb=is(),W=class extends j0.Visitor{};yi.IndexOfVisitor=W;function q0(t,e){return e===null&&t.length>0?0:-1}function W0(t,e){let{nullBitmap:r}=t.data;if(!r||t.nullCount<=0)return-1;let n=0;for(let i of tb.iterateBits(r,t.data.offset+(e||0),t.length,r,tb.getBool)){if(!i)return n;++n}return-1}function Z(t,e,r){if(e===void 0)return-1;if(e===null)return W0(t,r);let n=rb.createElementComparator(e);for(let i=(r||0)-1,a=t.length;++i<a;)if(n(t.get(i)))return i;return-1}function nb(t,e,r){let n=rb.createElementComparator(e);for(let i=(r||0)-1,a=t.length;++i<a;)if(n(t.get(i)))return i;return-1}W.prototype.visitNull=q0;W.prototype.visitBool=Z;W.prototype.visitInt=Z;W.prototype.visitInt8=Z;W.prototype.visitInt16=Z;W.prototype.visitInt32=Z;W.prototype.visitInt64=Z;W.prototype.visitUint8=Z;W.prototype.visitUint16=Z;W.prototype.visitUint32=Z;W.prototype.visitUint64=Z;W.prototype.visitFloat=Z;W.prototype.visitFloat16=Z;W.prototype.visitFloat32=Z;W.prototype.visitFloat64=Z;W.prototype.visitUtf8=Z;W.prototype.visitBinary=Z;W.prototype.visitFixedSizeBinary=Z;W.prototype.visitDate=Z;W.prototype.visitDateDay=Z;W.prototype.visitDateMillisecond=Z;W.prototype.visitTimestamp=Z;W.prototype.visitTimestampSecond=Z;W.prototype.visitTimestampMillisecond=Z;W.prototype.visitTimestampMicrosecond=Z;W.prototype.visitTimestampNanosecond=Z;W.prototype.visitTime=Z;W.prototype.visitTimeSecond=Z;W.prototype.visitTimeMillisecond=Z;W.prototype.visitTimeMicrosecond=Z;W.prototype.visitTimeNanosecond=Z;W.prototype.visitDecimal=Z;W.prototype.visitList=Z;W.prototype.visitStruct=Z;W.prototype.visitUnion=Z;W.prototype.visitDenseUnion=nb;W.prototype.visitSparseUnion=nb;W.prototype.visitDictionary=Z;W.prototype.visitInterval=Z;W.prototype.visitIntervalDayTime=Z;W.prototype.visitIntervalYearMonth=Z;W.prototype.visitFixedSizeList=Z;W.prototype.visitMap=Z;yi.instance=new W});var Wl=T(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.instance=mi.IteratorVisitor=void 0;var Lo=pe(),z0=Xe(),H0=Qt(),sb=ql(),z=class extends z0.Visitor{};mi.IteratorVisitor=z;function Y0(t){let e=sb.instance.getVisitFn(t);return H0.iterateBits(t.data.nullBitmap,t.data.offset,t.length,t,(r,n,i,a)=>(i&1<<a)!=0?e(r,n):null)}function Q(t){if(t.nullCount>0)return Y0(t);let{type:e,typeId:r,length:n}=t;return t.stride===1&&(r===Lo.Type.Timestamp||r===Lo.Type.Int&&e.bitWidth!==64||r===Lo.Type.Time&&e.bitWidth!==64||r===Lo.Type.Float&&e.precision>0)?t.data.values.subarray(0,n)[Symbol.iterator]():function*(i){for(let a=-1;++a<n;)yield i(t,a)}(sb.instance.getVisitFn(t))}z.prototype.visitNull=Q;z.prototype.visitBool=Q;z.prototype.visitInt=Q;z.prototype.visitInt8=Q;z.prototype.visitInt16=Q;z.prototype.visitInt32=Q;z.prototype.visitInt64=Q;z.prototype.visitUint8=Q;z.prototype.visitUint16=Q;z.prototype.visitUint32=Q;z.prototype.visitUint64=Q;z.prototype.visitFloat=Q;z.prototype.visitFloat16=Q;z.prototype.visitFloat32=Q;z.prototype.visitFloat64=Q;z.prototype.visitUtf8=Q;z.prototype.visitBinary=Q;z.prototype.visitFixedSizeBinary=Q;z.prototype.visitDate=Q;z.prototype.visitDateDay=Q;z.prototype.visitDateMillisecond=Q;z.prototype.visitTimestamp=Q;z.prototype.visitTimestampSecond=Q;z.prototype.visitTimestampMillisecond=Q;z.prototype.visitTimestampMicrosecond=Q;z.prototype.visitTimestampNanosecond=Q;z.prototype.visitTime=Q;z.prototype.visitTimeSecond=Q;z.prototype.visitTimeMillisecond=Q;z.prototype.visitTimeMicrosecond=Q;z.prototype.visitTimeNanosecond=Q;z.prototype.visitDecimal=Q;z.prototype.visitList=Q;z.prototype.visitStruct=Q;z.prototype.visitUnion=Q;z.prototype.visitDenseUnion=Q;z.prototype.visitSparseUnion=Q;z.prototype.visitDictionary=Q;z.prototype.visitInterval=Q;z.prototype.visitIntervalDayTime=Q;z.prototype.visitIntervalYearMonth=Q;z.prototype.visitFixedSizeList=Q;z.prototype.visitMap=Q;mi.instance=new z});var ab=T(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.instance=bi.ToArrayVisitor=void 0;var _s=pe(),G0=Xe(),$0=Wl(),H=class extends G0.Visitor{};bi.ToArrayVisitor=H;function X(t){let{type:e,length:r,stride:n}=t;switch(e.typeId){case _s.Type.Int:case _s.Type.Float:case _s.Type.Decimal:case _s.Type.Time:case _s.Type.Timestamp:return t.data.values.subarray(0,r*n)}return[...$0.instance.visit(t)]}H.prototype.visitNull=X;H.prototype.visitBool=X;H.prototype.visitInt=X;H.prototype.visitInt8=X;H.prototype.visitInt16=X;H.prototype.visitInt32=X;H.prototype.visitInt64=X;H.prototype.visitUint8=X;H.prototype.visitUint16=X;H.prototype.visitUint32=X;H.prototype.visitUint64=X;H.prototype.visitFloat=X;H.prototype.visitFloat16=X;H.prototype.visitFloat32=X;H.prototype.visitFloat64=X;H.prototype.visitUtf8=X;H.prototype.visitBinary=X;H.prototype.visitFixedSizeBinary=X;H.prototype.visitDate=X;H.prototype.visitDateDay=X;H.prototype.visitDateMillisecond=X;H.prototype.visitTimestamp=X;H.prototype.visitTimestampSecond=X;H.prototype.visitTimestampMillisecond=X;H.prototype.visitTimestampMicrosecond=X;H.prototype.visitTimestampNanosecond=X;H.prototype.visitTime=X;H.prototype.visitTimeSecond=X;H.prototype.visitTimeMillisecond=X;H.prototype.visitTimeMicrosecond=X;H.prototype.visitTimeNanosecond=X;H.prototype.visitDecimal=X;H.prototype.visitList=X;H.prototype.visitStruct=X;H.prototype.visitUnion=X;H.prototype.visitDenseUnion=X;H.prototype.visitSparseUnion=X;H.prototype.visitDictionary=X;H.prototype.visitInterval=X;H.prototype.visitIntervalDayTime=X;H.prototype.visitIntervalYearMonth=X;H.prototype.visitFixedSizeList=X;H.prototype.visitMap=X;bi.instance=new H});var ob=T(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.instance=_i.ByteWidthVisitor=void 0;var J0=Xe(),K0=pe(),gs=(t,e)=>t+e,zl=t=>`Cannot compute the byte width of variable-width column ${t}`,Hl=class extends J0.Visitor{visitNull(e){return 0}visitInt(e){return e.bitWidth/8}visitFloat(e){return e.ArrayType.BYTES_PER_ELEMENT}visitBinary(e){throw new Error(zl(e))}visitUtf8(e){throw new Error(zl(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===K0.TimeUnit.SECOND?4:8}visitInterval(e){return(e.unit+1)*4}visitList(e){throw new Error(zl(e))}visitStruct(e){return this.visitFields(e.children).reduce(gs,0)}visitUnion(e){return this.visitFields(e.children).reduce(gs,0)}visitFixedSizeBinary(e){return e.byteWidth}visitFixedSizeList(e){return e.listSize*this.visitFields(e.children).reduce(gs,0)}visitMap(e){return this.visitFields(e.children).reduce(gs,0)}visitDictionary(e){return this.visit(e.indices)}visitFields(e){return(e||[]).map(r=>this.visit(r.type))}visitSchema(e){return this.visitFields(e.fields).reduce(gs,0)}};_i.ByteWidthVisitor=Hl;_i.instance=new Hl});var ub=T(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.instance=gi.GetVectorConstructor=void 0;var Q0=Xe(),X0=dl(),Z0=fl(),Yl=pl(),eO=yl(),tO=Oo(),rO=bl(),nO=_l(),xo=Tl(),Gl=Bl(),Sr=Eo(),iO=Ul(),sO=Ml(),aO=Pl(),oO=Vl(),vs=kl(),ws=Nl(),$l=Ll(),uO=xl(),Jl=class extends Q0.Visitor{visitNull(){return aO.NullVector}visitBool(){return Z0.BoolVector}visitInt(){return Sr.IntVector}visitInt8(){return Sr.Int8Vector}visitInt16(){return Sr.Int16Vector}visitInt32(){return Sr.Int32Vector}visitInt64(){return Sr.Int64Vector}visitUint8(){return Sr.Uint8Vector}visitUint16(){return Sr.Uint16Vector}visitUint32(){return Sr.Uint32Vector}visitUint64(){return Sr.Uint64Vector}visitFloat(){return xo.FloatVector}visitFloat16(){return xo.Float16Vector}visitFloat32(){return xo.Float32Vector}visitFloat64(){return xo.Float64Vector}visitUtf8(){return uO.Utf8Vector}visitBinary(){return X0.BinaryVector}visitFixedSizeBinary(){return rO.FixedSizeBinaryVector}visitDate(){return Yl.DateVector}visitDateDay(){return Yl.DateDayVector}visitDateMillisecond(){return Yl.DateMillisecondVector}visitTimestamp(){return vs.TimestampVector}visitTimestampSecond(){return vs.TimestampSecondVector}visitTimestampMillisecond(){return vs.TimestampMillisecondVector}visitTimestampMicrosecond(){return vs.TimestampMicrosecondVector}visitTimestampNanosecond(){return vs.TimestampNanosecondVector}visitTime(){return ws.TimeVector}visitTimeSecond(){return ws.TimeSecondVector}visitTimeMillisecond(){return ws.TimeMillisecondVector}visitTimeMicrosecond(){return ws.TimeMicrosecondVector}visitTimeNanosecond(){return ws.TimeNanosecondVector}visitDecimal(){return eO.DecimalVector}visitList(){return iO.ListVector}visitStruct(){return oO.StructVector}visitUnion(){return $l.UnionVector}visitDenseUnion(){return $l.DenseUnionVector}visitSparseUnion(){return $l.SparseUnionVector}visitDictionary(){return tO.DictionaryVector}visitInterval(){return Gl.IntervalVector}visitIntervalDayTime(){return Gl.IntervalDayTimeVector}visitIntervalYearMonth(){return Gl.IntervalYearMonthVector}visitFixedSizeList(){return nO.FixedSizeListVector}visitMap(){return sO.MapVector}};gi.GetVectorConstructor=Jl;gi.instance=new Jl});var lr=T(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.vectorFromValuesWithType=B.StructRow=B.MapRow=B.Utf8Vector=B.SparseUnionVector=B.DenseUnionVector=B.UnionVector=B.TimeNanosecondVector=B.TimeMicrosecondVector=B.TimeMillisecondVector=B.TimeSecondVector=B.TimeVector=B.TimestampNanosecondVector=B.TimestampMicrosecondVector=B.TimestampMillisecondVector=B.TimestampSecondVector=B.TimestampVector=B.StructVector=B.NullVector=B.MapVector=B.ListVector=B.Uint64Vector=B.Uint32Vector=B.Uint16Vector=B.Uint8Vector=B.Int64Vector=B.Int32Vector=B.Int16Vector=B.Int8Vector=B.IntVector=B.IntervalYearMonthVector=B.IntervalDayTimeVector=B.IntervalVector=B.Float64Vector=B.Float32Vector=B.Float16Vector=B.FloatVector=B.FixedSizeListVector=B.FixedSizeBinaryVector=B.DictionaryVector=B.DecimalVector=B.DateMillisecondVector=B.DateDayVector=B.DateVector=B.Chunked=B.BoolVector=B.BinaryVector=B.BaseVector=B.Vector=void 0;var cO=De();Object.defineProperty(B,"Vector",{enumerable:!0,get:function(){return cO.Vector}});var lO=Fe();Object.defineProperty(B,"BaseVector",{enumerable:!0,get:function(){return lO.BaseVector}});var dO=dl();Object.defineProperty(B,"BinaryVector",{enumerable:!0,get:function(){return dO.BinaryVector}});var fO=fl();Object.defineProperty(B,"BoolVector",{enumerable:!0,get:function(){return fO.BoolVector}});var hO=kr();Object.defineProperty(B,"Chunked",{enumerable:!0,get:function(){return hO.Chunked}});var Kl=pl();Object.defineProperty(B,"DateVector",{enumerable:!0,get:function(){return Kl.DateVector}});Object.defineProperty(B,"DateDayVector",{enumerable:!0,get:function(){return Kl.DateDayVector}});Object.defineProperty(B,"DateMillisecondVector",{enumerable:!0,get:function(){return Kl.DateMillisecondVector}});var pO=yl();Object.defineProperty(B,"DecimalVector",{enumerable:!0,get:function(){return pO.DecimalVector}});var yO=Oo();Object.defineProperty(B,"DictionaryVector",{enumerable:!0,get:function(){return yO.DictionaryVector}});var mO=bl();Object.defineProperty(B,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return mO.FixedSizeBinaryVector}});var bO=_l();Object.defineProperty(B,"FixedSizeListVector",{enumerable:!0,get:function(){return bO.FixedSizeListVector}});var Co=Tl();Object.defineProperty(B,"FloatVector",{enumerable:!0,get:function(){return Co.FloatVector}});Object.defineProperty(B,"Float16Vector",{enumerable:!0,get:function(){return Co.Float16Vector}});Object.defineProperty(B,"Float32Vector",{enumerable:!0,get:function(){return Co.Float32Vector}});Object.defineProperty(B,"Float64Vector",{enumerable:!0,get:function(){return Co.Float64Vector}});var Ql=Bl();Object.defineProperty(B,"IntervalVector",{enumerable:!0,get:function(){return Ql.IntervalVector}});Object.defineProperty(B,"IntervalDayTimeVector",{enumerable:!0,get:function(){return Ql.IntervalDayTimeVector}});Object.defineProperty(B,"IntervalYearMonthVector",{enumerable:!0,get:function(){return Ql.IntervalYearMonthVector}});var Or=Eo();Object.defineProperty(B,"IntVector",{enumerable:!0,get:function(){return Or.IntVector}});Object.defineProperty(B,"Int8Vector",{enumerable:!0,get:function(){return Or.Int8Vector}});Object.defineProperty(B,"Int16Vector",{enumerable:!0,get:function(){return Or.Int16Vector}});Object.defineProperty(B,"Int32Vector",{enumerable:!0,get:function(){return Or.Int32Vector}});Object.defineProperty(B,"Int64Vector",{enumerable:!0,get:function(){return Or.Int64Vector}});Object.defineProperty(B,"Uint8Vector",{enumerable:!0,get:function(){return Or.Uint8Vector}});Object.defineProperty(B,"Uint16Vector",{enumerable:!0,get:function(){return Or.Uint16Vector}});Object.defineProperty(B,"Uint32Vector",{enumerable:!0,get:function(){return Or.Uint32Vector}});Object.defineProperty(B,"Uint64Vector",{enumerable:!0,get:function(){return Or.Uint64Vector}});var _O=Ul();Object.defineProperty(B,"ListVector",{enumerable:!0,get:function(){return _O.ListVector}});var gO=Ml();Object.defineProperty(B,"MapVector",{enumerable:!0,get:function(){return gO.MapVector}});var vO=Pl();Object.defineProperty(B,"NullVector",{enumerable:!0,get:function(){return vO.NullVector}});var wO=Vl();Object.defineProperty(B,"StructVector",{enumerable:!0,get:function(){return wO.StructVector}});var Ts=kl();Object.defineProperty(B,"TimestampVector",{enumerable:!0,get:function(){return Ts.TimestampVector}});Object.defineProperty(B,"TimestampSecondVector",{enumerable:!0,get:function(){return Ts.TimestampSecondVector}});Object.defineProperty(B,"TimestampMillisecondVector",{enumerable:!0,get:function(){return Ts.TimestampMillisecondVector}});Object.defineProperty(B,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return Ts.TimestampMicrosecondVector}});Object.defineProperty(B,"TimestampNanosecondVector",{enumerable:!0,get:function(){return Ts.TimestampNanosecondVector}});var Bs=Nl();Object.defineProperty(B,"TimeVector",{enumerable:!0,get:function(){return Bs.TimeVector}});Object.defineProperty(B,"TimeSecondVector",{enumerable:!0,get:function(){return Bs.TimeSecondVector}});Object.defineProperty(B,"TimeMillisecondVector",{enumerable:!0,get:function(){return Bs.TimeMillisecondVector}});Object.defineProperty(B,"TimeMicrosecondVector",{enumerable:!0,get:function(){return Bs.TimeMicrosecondVector}});Object.defineProperty(B,"TimeNanosecondVector",{enumerable:!0,get:function(){return Bs.TimeNanosecondVector}});var Xl=Ll();Object.defineProperty(B,"UnionVector",{enumerable:!0,get:function(){return Xl.UnionVector}});Object.defineProperty(B,"DenseUnionVector",{enumerable:!0,get:function(){return Xl.DenseUnionVector}});Object.defineProperty(B,"SparseUnionVector",{enumerable:!0,get:function(){return Xl.SparseUnionVector}});var TO=xl();Object.defineProperty(B,"Utf8Vector",{enumerable:!0,get:function(){return TO.Utf8Vector}});var cb=rs();Object.defineProperty(B,"MapRow",{enumerable:!0,get:function(){return cb.MapRow}});Object.defineProperty(B,"StructRow",{enumerable:!0,get:function(){return cb.StructRow}});var Is=Nm(),Zl=pe(),vi=De(),lb=kr(),In=Fe(),BO=Qt(),jo=st(),db=Ie(),fb=ql(),hb=bc(),pb=ib(),yb=ab(),mb=Wl(),bb=ob(),_b=ub();vi.Vector.new=IO;vi.Vector.from=OO;function IO(t,...e){return new(_b.instance.getVisitFn(t)())(t,...e)}function SO(t,e){if(jo.isIterable(e))return vi.Vector.from({nullValues:[null,void 0],type:t(),values:e});if(jo.isAsyncIterable(e))return vi.Vector.from({nullValues:[null,void 0],type:t(),values:e});let{values:r=[],type:n=t(),nullValues:i=[null,void 0]}={...e};return jo.isIterable(r)?vi.Vector.from({nullValues:i,...e,type:n}):vi.Vector.from({nullValues:i,...e,type:n})}B.vectorFromValuesWithType=SO;function OO(t){let{values:e=[],...r}={nullValues:[null,void 0],...t};if(jo.isIterable(e)){let n=[...db.Builder.throughIterable(r)(e)];return n.length===1?n[0]:lb.Chunked.concat(n)}return(async n=>{let i=db.Builder.throughAsyncIterable(r);for await(let a of i(e))n.push(a);return n.length===1?n[0]:lb.Chunked.concat(n)})([])}In.BaseVector.prototype.get=function(e){return fb.instance.visit(this,e)};In.BaseVector.prototype.set=function(e,r){return hb.instance.visit(this,e,r)};In.BaseVector.prototype.indexOf=function(e,r){return pb.instance.visit(this,e,r)};In.BaseVector.prototype.toArray=function(){return yb.instance.visit(this)};In.BaseVector.prototype.getByteWidth=function(){return bb.instance.visit(this.type)};In.BaseVector.prototype[Symbol.iterator]=function(){return mb.instance.visit(this)};In.BaseVector.prototype._bindDataAccessors=EO;Object.keys(Zl.Type).map(t=>Zl.Type[t]).filter(t=>typeof t=="number").filter(t=>t!==Zl.Type.NONE).forEach(t=>{let e=_b.instance.visit(t);e.prototype.get=Is.partial1(fb.instance.getVisitFn(t)),e.prototype.set=Is.partial2(hb.instance.getVisitFn(t)),e.prototype.indexOf=Is.partial2(pb.instance.getVisitFn(t)),e.prototype.toArray=Is.partial0(yb.instance.getVisitFn(t)),e.prototype.getByteWidth=AO(bb.instance.getVisitFn(t)),e.prototype[Symbol.iterator]=Is.partial0(mb.instance.getVisitFn(t))});function AO(t){return function(){return t(this.type)}}function DO(t){return function(e){return this.isValid(e)?t.call(this,e):null}}function FO(t){return function(e,r){BO.setBool(this.nullBitmap,this.offset+e,r!=null)&&t.call(this,e,r)}}function EO(){let t=this.nullBitmap;t&&t.byteLength>0&&(this.get=DO(this.get),this.set=FO(this.set))}});var ms=T(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.Table=void 0;var RO=Kn(),gb=He(),ed=Ir(),UO=Ss(),td=ce(),vb=Nr(),rd=st(),wb=go(),Tb=ul(),nd=lr(),$e=class extends nd.Chunked{constructor(...e){let r=null;e[0]instanceof gb.Schema&&(r=e.shift());let n=vb.selectArgs(ed.RecordBatch,e);if(!r&&!(r=n[0]&&n[0].schema))throw new TypeError("Table must be initialized with a Schema or at least one RecordBatch");n[0]||(n[0]=new ed._InternalEmptyPlaceholderRecordBatch(r));super(new td.Struct(r.fields),n);this._schema=r,this._chunks=n}static empty(e=new gb.Schema([])){return new $e(e,[])}static from(e){if(!e)return $e.empty();if(typeof e=="object"){let n=rd.isIterable(e.values)?MO(e):rd.isAsyncIterable(e.values)?PO(e):null;if(n!==null)return n}let r=UO.RecordBatchReader.from(e);return rd.isPromise(r)?(async()=>await $e.from(await r))():r.isSync()&&(r=r.open())?r.schema?new $e(r.schema,[...r]):$e.empty():(async n=>{let i=await n,a=i.schema,u=[];if(a){for await(let o of i)u.push(o);return new $e(a,u)}return $e.empty()})(r.open())}static async fromAsync(e){return await $e.from(e)}static fromStruct(e){return $e.new(e.data.childData,e.type.children)}static new(...e){return new $e(...Tb.distributeColumnsIntoRecordBatches(vb.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 $e(this._schema,e)}getColumn(e){return this.getColumnAt(this.getColumnIndex(e))}getColumnAt(e){return this.getChildAt(e)}getColumnIndex(e){return this._schema.fields.findIndex(r=>r.name===e)}getChildAt(e){if(e<0||e>=this.numChildren)return null;let r,n,i=this._schema.fields,a=this._children||(this._children=[]);if(n=a[e])return n;if(r=i[e]){let u=this._chunks.map(o=>o.getChildAt(e)).filter(o=>o!=null);if(u.length>0)return a[e]=new RO.Column(r,u)}return null}serialize(e="binary",r=!0){return(r?wb.RecordBatchStreamWriter:wb.RecordBatchFileWriter).writeAll(this).toUint8Array(!0)}count(){return this._length}select(...e){let r=this._schema.fields.reduce((n,i,a)=>n.set(i.name,a),new Map);return this.selectAt(...e.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(...e){let r=this._schema.selectAt(...e);return new $e(r,this._chunks.map(({length:n,data:{childData:i}})=>new ed.RecordBatch(r,n,e.map(a=>i[a]).filter(Boolean))))}assign(e){let r=this._schema.fields,[n,i]=e.schema.fields.reduce((o,p,s)=>{let[l,g]=o,L=r.findIndex(oe=>oe.name===p.name);return~L?g[L]=s:l.push(s),o},[[],[]]),a=this._schema.assign(e.schema),u=[...r.map((o,p,s,l=i[p])=>l===void 0?this.getColumnAt(p):e.getColumnAt(l)),...n.map(o=>e.getColumnAt(o))].filter(Boolean);return new $e(...Tb.distributeVectorsIntoRecordBatches(a,u))}};qo.Table=$e;function MO(t){let{type:e}=t;return e instanceof td.Struct?$e.fromStruct(nd.StructVector.from(t)):null}function PO(t){let{type:e}=t;return e instanceof td.Struct?nd.StructVector.from(t).then(r=>$e.fromStruct(r)):null}});var Ir=T(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi._InternalEmptyPlaceholderRecordBatch=wi.RecordBatch=void 0;var id=Lt(),sd=ms(),VO=De(),kO=Xe(),NO=He(),LO=st(),xO=kr(),CO=Nr(),ad=ce(),jO=ul(),qO=lr(),nn=class extends qO.StructVector{constructor(...e){let r,n=e[0],i;if(e[1]instanceof id.Data)[,r,i]=e;else{let a=n.fields,[,u,o]=e;r=id.Data.Struct(new ad.Struct(a),0,u,0,null,o)}super(r,i);this._schema=n}static from(e){return LO.isIterable(e.values),sd.Table.from(e)}static new(...e){let[r,n]=CO.selectFieldArgs(e),i=n.filter(a=>a instanceof VO.Vector);return new nn(...jO.ensureSameLengthData(new NO.Schema(r),i.map(a=>a.data)))}clone(e,r=this._children){return new nn(this._schema,e,r)}concat(...e){let r=this._schema,n=xO.Chunked.flatten(this,...e);return new sd.Table(r,n.map(({data:i})=>new nn(r,i)))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=Wo.collect(this))}select(...e){let r=this._schema.fields.reduce((n,i,a)=>n.set(i.name,a),new Map);return this.selectAt(...e.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(...e){let r=this._schema.selectAt(...e),n=e.map(i=>this.data.childData[i]).filter(Boolean);return new nn(r,this.length,n)}};wi.RecordBatch=nn;var Bb=class extends nn{constructor(e){super(e,0,e.fields.map(r=>id.Data.new(r.type,0,0,0)))}};wi._InternalEmptyPlaceholderRecordBatch=Bb;var Wo=class extends kO.Visitor{constructor(){super(...arguments);this.dictionaries=new Map}static collect(e){return new Wo().visit(e.data,new ad.Struct(e.schema.fields)).dictionaries}visit(e,r){return ad.DataType.isDictionary(r)?this.visitDictionary(e,r):(e.childData.forEach((n,i)=>this.visit(n,r.children[i].type)),this)}visitDictionary(e,r){let n=e.dictionary;return n&&n.length>0&&this.dictionaries.set(r.id,n),this}}});var Ss=T(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.AsyncRecordBatchFileReader=kt.RecordBatchFileReader=kt.AsyncRecordBatchStreamReader=kt.RecordBatchStreamReader=kt.RecordBatchReader=void 0;var Ib=De(),zo=pe(),Sb=Fc(),Ob=Hi(),Ab=Hr(),Os=Uc(),Db=wy(),od=Ir(),Sn=Pn(),Pt=uo(),Vt=st(),pr=class extends Sn.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 r=this._impl.open(e);return Vt.isPromise(r)?r.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 Ob.default.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Ob.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,r){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof pr?e:Vt.isArrowJSON(e)?WO(e):Vt.isFileHandle(e)?YO(e):Vt.isPromise(e)?(async()=>await pr.from(await e))():Vt.isFetchResponse(e)||Vt.isReadableDOMStream(e)||Vt.isReadableNodeStream(e)||Vt.isAsyncIterable(e)?HO(new Ab.AsyncByteStream(e)):zO(new Ab.ByteStream(e))}static readAll(e){return e instanceof pr?e.isSync()?Ub(e):Mb(e):Vt.isArrowJSON(e)||ArrayBuffer.isView(e)||Vt.isIterable(e)||Vt.isIteratorResult(e)?Ub(e):Mb(e)}};kt.RecordBatchReader=pr;var Ti=class extends pr{constructor(e){super(e);this._impl=e}[Symbol.iterator](){return this._impl[Symbol.iterator]()}async*[Symbol.asyncIterator](){yield*this[Symbol.iterator]()}};kt.RecordBatchStreamReader=Ti;var Bi=class extends pr{constructor(e){super(e);this._impl=e}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}};kt.AsyncRecordBatchStreamReader=Bi;var Ho=class extends Ti{constructor(e){super(e);this._impl=e}};kt.RecordBatchFileReader=Ho;var ud=class extends Bi{constructor(e){super(e);this._impl=e}};kt.AsyncRecordBatchFileReader=ud;var cd=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,r){return new od.RecordBatch(this.schema,e.length,this._loadVectors(e,r,this.schema.fields))}_loadDictionaryBatch(e,r){let{id:n,isDelta:i,data:a}=e,{dictionaries:u,schema:o}=this,p=u.get(n);if(i||!p){let s=o.dictionaries.get(n);return p&&i?p.concat(Ib.Vector.new(this._loadVectors(a,r,[s])[0])):Ib.Vector.new(this._loadVectors(a,r,[s])[0])}return p}_loadVectors(e,r,n){return new Db.VectorLoader(r,e.nodes,e.buffers,this.dictionaries).visitMany(n)}},As=class extends cd{constructor(e,r){super(r);this._reader=Vt.isArrowJSON(e)?new Pt.JSONMessageReader(this._handle=e):new Pt.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=Rb(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):Sn.ITERATOR_DONE}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Sn.ITERATOR_DONE}next(){if(this.closed)return Sn.ITERATOR_DONE;let e,{_reader:r}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=r.readMessageBody(e.bodyLength),a=this._loadRecordBatch(n,i);return{done:!1,value:a}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=r.readMessageBody(e.bodyLength),a=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,a)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new od._InternalEmptyPlaceholderRecordBatch(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Ds=class extends cd{constructor(e,r){super(r);this._reader=new Pt.AsyncMessageReader(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}async cancel(){!this.closed&&(this.closed=!0)&&(await this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}async open(e){return this.closed||(this.autoDestroy=Rb(this,e),this.schema||(this.schema=await this._reader.readSchema())||await this.cancel()),this}async throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.throw(e):Sn.ITERATOR_DONE}async return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.return(e):Sn.ITERATOR_DONE}async next(){if(this.closed)return Sn.ITERATOR_DONE;let e,{_reader:r}=this;for(;e=await this._readNextMessageAndValidate();)if(e.isSchema())await this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=await r.readMessageBody(e.bodyLength),a=this._loadRecordBatch(n,i);return{done:!1,value:a}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=await r.readMessageBody(e.bodyLength),a=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,a)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new od._InternalEmptyPlaceholderRecordBatch(this.schema)}):await this.return()}async _readNextMessageAndValidate(e){return await this._reader.readMessage(e)}},ld=class extends As{constructor(e,r){super(e instanceof Os.RandomAccessFile?e:new Os.RandomAccessFile(e),r)}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 r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){if(this.closed)return null;this._footer||this.open();let r=this._footer&&this._footer.getRecordBatch(e);if(r&&this._handle.seek(r.offset)){let n=this._reader.readMessage(zo.MessageHeader.RecordBatch);if(n&&n.isRecordBatch()){let i=n.header(),a=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,a)}}return null}_readDictionaryBatch(e){let r=this._footer&&this._footer.getDictionaryBatch(e);if(r&&this._handle.seek(r.offset)){let n=this._reader.readMessage(zo.MessageHeader.DictionaryBatch);if(n&&n.isDictionaryBatch()){let i=n.header(),a=this._reader.readMessageBody(n.bodyLength),u=this._loadDictionaryBatch(i,a);this.dictionaries.set(i.id,u)}}}_readFooter(){let{_handle:e}=this,r=e.size-Pt.magicAndPadding,n=e.readInt32(r),i=e.readAt(r-n,n);return Sb.Footer.decode(i)}_readNextMessageAndValidate(e){if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer&&this._footer.getRecordBatch(this._recordBatchIndex);if(r&&this._handle.seek(r.offset))return this._reader.readMessage(e)}return null}},Fb=class extends Ds{constructor(e,...r){let n=typeof r[0]!="number"?r.shift():void 0,i=r[0]instanceof Map?r.shift():void 0;super(e instanceof Os.AsyncRandomAccessFile?e:new Os.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}async open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=await this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&await this._readDictionaryBatch(this._dictionaryIndex++)}return await super.open(e)}async readRecordBatch(e){if(this.closed)return null;this._footer||await this.open();let r=this._footer&&this._footer.getRecordBatch(e);if(r&&await this._handle.seek(r.offset)){let n=await this._reader.readMessage(zo.MessageHeader.RecordBatch);if(n&&n.isRecordBatch()){let i=n.header(),a=await this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(i,a)}}return null}async _readDictionaryBatch(e){let r=this._footer&&this._footer.getDictionaryBatch(e);if(r&&await this._handle.seek(r.offset)){let n=await this._reader.readMessage(zo.MessageHeader.DictionaryBatch);if(n&&n.isDictionaryBatch()){let i=n.header(),a=await this._reader.readMessageBody(n.bodyLength),u=this._loadDictionaryBatch(i,a);this.dictionaries.set(i.id,u)}}}async _readFooter(){let{_handle:e}=this;e._pending&&await e._pending;let r=e.size-Pt.magicAndPadding,n=await e.readInt32(r),i=await e.readAt(r-n,n);return Sb.Footer.decode(i)}async _readNextMessageAndValidate(e){if(this._footer||await this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer.getRecordBatch(this._recordBatchIndex);if(r&&await this._handle.seek(r.offset))return await this._reader.readMessage(e)}return null}},Eb=class extends As{constructor(e,r){super(e,r)}_loadVectors(e,r,n){return new Db.JSONVectorLoader(r,e.nodes,e.buffers,this.dictionaries).visitMany(n)}};function Rb(t,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:t.autoDestroy}function*Ub(t){let e=pr.from(t);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}async function*Mb(t){let e=await pr.from(t);try{if(!(await e.open({autoDestroy:!1})).closed)do yield e;while(!(await e.reset().open()).closed)}finally{await e.cancel()}}function WO(t){return new Ti(new Eb(t))}function zO(t){let e=t.peek(Pt.magicLength+7&~7);return e&&e.byteLength>=4?Pt.checkForMagicArrowString(e)?new Ho(new ld(t.read())):new Ti(new As(t)):new Ti(new As(function*(){}()))}async function HO(t){let e=await t.peek(Pt.magicLength+7&~7);return e&&e.byteLength>=4?Pt.checkForMagicArrowString(e)?new Ho(new ld(await t.read())):new Bi(new Ds(t)):new Bi(new Ds(async function*(){}()))}async function YO(t){let{size:e}=await t.stat(),r=new Os.AsyncRandomAccessFile(t,e);return e>=Pt.magicX2AndPadding&&Pt.checkForMagicArrowString(await r.readAt(0,Pt.magicLength+7&~7))?new ud(new Fb(r)):new Bi(new Ds(r))}});var kb=T(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.toDOMStream=void 0;var Pb=Ee(),Vb=st();function GO(t,e){if(Vb.isAsyncIterable(t))return JO(t,e);if(Vb.isIterable(t))return $O(t,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}Yo.toDOMStream=GO;function $O(t,e){let r=null,n=e&&e.type==="bytes"||!1,i=e&&e.highWaterMark||2**24;return new ReadableStream({...e,start(u){a(u,r||(r=t[Symbol.iterator]()))},pull(u){r?a(u,r):u.close()},cancel(){(r&&r.return&&r.return()||!0)&&(r=null)}},{highWaterMark:n?i:void 0,...e});function a(u,o){let p,s=null,l=u.desiredSize||null;for(;!(s=o.next(n?l:null)).done;)if(ArrayBuffer.isView(s.value)&&(p=Pb.toUint8Array(s.value))&&(l!=null&&n&&(l=l-p.byteLength+1),s.value=p),u.enqueue(s.value),l!=null&&--l<=0)return;u.close()}}function JO(t,e){let r=null,n=e&&e.type==="bytes"||!1,i=e&&e.highWaterMark||2**24;return new ReadableStream({...e,async start(u){await a(u,r||(r=t[Symbol.asyncIterator]()))},async pull(u){r?await a(u,r):u.close()},async cancel(){(r&&r.return&&await r.return()||!0)&&(r=null)}},{highWaterMark:n?i:void 0,...e});async function a(u,o){let p,s=null,l=u.desiredSize||null;for(;!(s=await o.next(n?l:null)).done;)if(ArrayBuffer.isView(s.value)&&(p=Pb.toUint8Array(s.value))&&(l!=null&&n&&(l=l-p.byteLength+1),s.value=p),u.enqueue(s.value),l!=null&&--l<=0)return;u.close()}}});var xb=T(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.BuilderTransform=Ii.builderThroughDOMStream=void 0;var KO=Ja();function QO(t){return new dd(t)}Ii.builderThroughDOMStream=QO;var dd=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:i="count",...a}=e;this._controller=null,this._builder=KO.Builder.new(a),this._getSize=i!=="bytes"?Nb:Lb;let{["highWaterMark"]:u=i==="bytes"?2**14:1e3}={...r},{["highWaterMark"]:o=i==="bytes"?2**14:1e3}={...n};this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:p=>{this._maybeFlush(this._builder,this._controller=p)},start:p=>{this._maybeFlush(this._builder,this._controller=p)}},{highWaterMark:u,size:i!=="bytes"?Nb:Lb}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:o,size:p=>this._writeValueAndReturnChunkSize(p)})}_writeValueAndReturnChunkSize(e){let r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-r}_maybeFlush(e,r){r!==null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(e,r){this._bufferedSize=0,this._controller=null,r===null?e.close():e.enqueue(r)}};Ii.BuilderTransform=dd;var Nb=t=>t.length,Lb=t=>t.byteLength});var Cb=T(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.recordBatchReaderThroughDOMStream=void 0;var XO=Hr(),ZO=Ss();function eA(t,e){let r=new XO.AsyncByteQueue,n=null,i=new ReadableStream({async cancel(){await r.close()},async start(o){await u(o,n||(n=await a()))},async pull(o){n?await u(o,n):o.close()}});return{writable:new WritableStream(r,{highWaterMark:2**14,...t}),readable:i};async function a(){return await(await ZO.RecordBatchReader.from(r)).open(e)}async function u(o,p){let s=o.desiredSize,l=null;for(;!(l=await p.next()).done;)if(o.enqueue(l.value),s!=null&&--s<=0)return;o.close()}}Go.recordBatchReaderThroughDOMStream=eA});var jb=T($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.recordBatchWriterThroughDOMStream=void 0;var tA=Hr();function rA(t,e){let r=new this(t),n=new tA.AsyncByteStream(r),i=new ReadableStream({type:"bytes",async cancel(){await n.cancel()},async pull(u){await a(u)},async start(u){await a(u)}},{highWaterMark:2**14,...e});return{writable:new WritableStream(r,t),readable:i};async function a(u){let o=null,p=u.desiredSize;for(;o=await n.read(p||null);)if(u.enqueue(o),p!=null&&(p-=o.byteLength)<=0)return;u.close()}}$o.recordBatchWriterThroughDOMStream=rA});var bd=T(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.custom=te.or=te.and=te.col=te.lit=te.CustomPredicate=te.Not=te.GTeq=te.LTeq=te.Equals=te.Or=te.And=te.CombinationPredicate=te.ComparisonPredicate=te.Predicate=te.Col=te.Literal=te.Value=void 0;var nA=Oo(),sn=class{eq(e){return e instanceof sn||(e=new Ar(e)),new hd(this,e)}le(e){return e instanceof sn||(e=new Ar(e)),new pd(this,e)}ge(e){return e instanceof sn||(e=new Ar(e)),new yd(this,e)}lt(e){return new Di(this.ge(e))}gt(e){return new Di(this.le(e))}ne(e){return new Di(this.eq(e))}};te.Value=sn;var Ar=class extends sn{constructor(e){super();this.v=e}};te.Literal=Ar;var fd=class extends sn{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 r=this.vector=e.getChildAt(this.colidx);return n=>r.get(n)}};te.Col=fd;var Si=class{and(...e){return new Oi(this,...e)}or(...e){return new Ai(this,...e)}not(){return new Di(this)}};te.Predicate=Si;var Fs=class extends Si{constructor(e,r){super();this.left=e,this.right=r}bind(e){return this.left instanceof Ar?this.right instanceof Ar?this._bindLitLit(e,this.left,this.right):this._bindLitCol(e,this.left,this.right):this.right instanceof Ar?this._bindColLit(e,this.left,this.right):this._bindColCol(e,this.left,this.right)}};te.ComparisonPredicate=Fs;var Es=class extends Si{constructor(...e){super();this.children=e}};te.CombinationPredicate=Es;Es.prototype.children=Object.freeze([]);var Oi=class extends Es{constructor(...e){e=e.reduce((r,n)=>r.concat(n instanceof Oi?n.children:n),[]);super(...e)}bind(e){let r=this.children.map(n=>n.bind(e));return(n,i)=>r.every(a=>a(n,i))}};te.And=Oi;var Ai=class extends Es{constructor(...e){e=e.reduce((r,n)=>r.concat(n instanceof Ai?n.children:n),[]);super(...e)}bind(e){let r=this.children.map(n=>n.bind(e));return(n,i)=>r.some(a=>a(n,i))}};te.Or=Ai;var hd=class extends Fs{_bindLitLit(e,r,n){let i=r.v==n.v;return()=>i}_bindColCol(e,r,n){let i=r.bind(e),a=n.bind(e);return(u,o)=>i(u,o)==a(u,o)}_bindColLit(e,r,n){let i=r.bind(e);if(r.vector instanceof nA.DictionaryVector){let a,u=r.vector;return u.dictionary!==this.lastDictionary?(a=u.reverseLookup(n.v),this.lastDictionary=u.dictionary,this.lastKey=a):a=this.lastKey,a===-1?()=>!1:o=>u.getKey(o)===a}else return(a,u)=>i(a,u)==n.v}_bindLitCol(e,r,n){return this._bindColLit(e,n,r)}};te.Equals=hd;var pd=class extends Fs{_bindLitLit(e,r,n){let i=r.v<=n.v;return()=>i}_bindColCol(e,r,n){let i=r.bind(e),a=n.bind(e);return(u,o)=>i(u,o)<=a(u,o)}_bindColLit(e,r,n){let i=r.bind(e);return(a,u)=>i(a,u)<=n.v}_bindLitCol(e,r,n){let i=n.bind(e);return(a,u)=>r.v<=i(a,u)}};te.LTeq=pd;var yd=class extends Fs{_bindLitLit(e,r,n){let i=r.v>=n.v;return()=>i}_bindColCol(e,r,n){let i=r.bind(e),a=n.bind(e);return(u,o)=>i(u,o)>=a(u,o)}_bindColLit(e,r,n){let i=r.bind(e);return(a,u)=>i(a,u)>=n.v}_bindLitCol(e,r,n){let i=n.bind(e);return(a,u)=>r.v>=i(a,u)}};te.GTeq=yd;var Di=class extends Si{constructor(e){super();this.child=e}bind(e){let r=this.child.bind(e);return(n,i)=>!r(n,i)}};te.Not=Di;var md=class extends Si{constructor(e,r){super();this.next=e,this.bind_=r}bind(e){return this.bind_(e),this.next}};te.CustomPredicate=md;function iA(t){return new Ar(t)}te.lit=iA;function sA(t){return new fd(t)}te.col=sA;function aA(...t){return new Oi(...t)}te.and=aA;function oA(...t){return new Ai(...t)}te.or=oA;function uA(t,e){return new md(t,e)}te.custom=uA});var Hb=T(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.FilteredDataFrame=an.CountByResult=an.DataFrame=void 0;var Fi=ms(),qb=Eo(),_d=He(),Wb=bd(),cA=Ir(),zb=ce();Fi.Table.prototype.countBy=function(t){return new On(this.chunks).countBy(t)};Fi.Table.prototype.scan=function(t,e){return new On(this.chunks).scan(t,e)};Fi.Table.prototype.scanReverse=function(t,e){return new On(this.chunks).scanReverse(t,e)};Fi.Table.prototype.filter=function(t){return new On(this.chunks).filter(t)};var On=class extends Fi.Table{filter(e){return new Rs(this.chunks,e)}scan(e,r){let n=this.chunks,i=n.length;for(let a=-1;++a<i;){let u=n[a];r&&r(u);for(let o=-1,p=u.length;++o<p;)e(o,u)}}scanReverse(e,r){let n=this.chunks,i=n.length;for(let a=i;--a>=0;){let u=n[a];r&&r(u);for(let o=u.length;--o>=0;)e(o,u)}}countBy(e){let r=this.chunks,n=r.length,i=typeof e=="string"?new Wb.Col(e):e;i.bind(r[n-1]);let a=i.vector;if(!zb.DataType.isDictionary(a.type))throw new Error("countBy currently only supports dictionary-encoded columns");let u=Math.ceil(Math.log(a.length)/Math.log(256)),o=u==4?Uint32Array:u>=2?Uint16Array:Uint8Array,p=new o(a.dictionary.length);for(let s=-1;++s<n;){let l=r[s];i.bind(l);let g=i.vector.indices;for(let L=-1,oe=l.length;++L<oe;){let Je=g.get(L);Je!==null&&p[Je]++}}return new Jo(a.dictionary,qb.IntVector.from(p))}};an.DataFrame=On;var Jo=class extends Fi.Table{constructor(e,r){let n=new _d.Schema([new _d.Field("values",e.type),new _d.Field("counts",r.type)]);super(new cA.RecordBatch(n,r.length,[e,r]))}toJSON(){let e=this.getColumnAt(0),r=this.getColumnAt(1),n={};for(let i=-1;++i<this.length;)n[e.get(i)]=r.get(i);return n}};an.CountByResult=Jo;var Rs=class extends On{constructor(e,r){super(e);this._predicate=r}scan(e,r){let n=this._chunks,i=n.length;for(let a=-1;++a<i;){let u=n[a],o=this._predicate.bind(u),p=!1;for(let s=-1,l=u.length;++s<l;)o(s,u)&&(r&&!p&&(r(u),p=!0),e(s,u))}}scanReverse(e,r){let n=this._chunks,i=n.length;for(let a=i;--a>=0;){let u=n[a],o=this._predicate.bind(u),p=!1;for(let s=u.length;--s>=0;)o(s,u)&&(r&&!p&&(r(u),p=!0),e(s,u))}}count(){let e=0,r=this._chunks,n=r.length;for(let i=-1;++i<n;){let a=r[i],u=this._predicate.bind(a);for(let o=-1,p=a.length;++o<p;)u(o,a)&&++e}return e}*[Symbol.iterator](){let e=this._chunks,r=e.length;for(let n=-1;++n<r;){let i=e[n],a=this._predicate.bind(i);for(let u=-1,o=i.length;++u<o;)a(u,i)&&(yield i.get(u))}}filter(e){return new Rs(this._chunks,this._predicate.and(e))}countBy(e){let r=this._chunks,n=r.length,i=typeof e=="string"?new Wb.Col(e):e;i.bind(r[n-1]);let a=i.vector;if(!zb.DataType.isDictionary(a.type))throw new Error("countBy currently only supports dictionary-encoded columns");let u=Math.ceil(Math.log(a.length)/Math.log(256)),o=u==4?Uint32Array:u>=2?Uint16Array:Uint8Array,p=new o(a.dictionary.length);for(let s=-1;++s<n;){let l=r[s],g=this._predicate.bind(l);i.bind(l);let L=i.vector.indices;for(let oe=-1,Je=l.length;++oe<Je;){let Ht=L.get(oe);Ht!==null&&g(oe,l)&&p[Ht]++}}return new Jo(a.dictionary,qb.IntVector.from(p))}};an.FilteredDataFrame=Rs});var Gb=T(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});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.UnionMode=f.Type=f.TimeUnit=f.Precision=f.MetadataVersion=f.MessageHeader=f.IntervalUnit=f.DateUnit=f.ArrowType=void 0;var yr=pe();Object.defineProperty(f,"ArrowType",{enumerable:!0,get:function(){return yr.ArrowType}});Object.defineProperty(f,"DateUnit",{enumerable:!0,get:function(){return yr.DateUnit}});Object.defineProperty(f,"IntervalUnit",{enumerable:!0,get:function(){return yr.IntervalUnit}});Object.defineProperty(f,"MessageHeader",{enumerable:!0,get:function(){return yr.MessageHeader}});Object.defineProperty(f,"MetadataVersion",{enumerable:!0,get:function(){return yr.MetadataVersion}});Object.defineProperty(f,"Precision",{enumerable:!0,get:function(){return yr.Precision}});Object.defineProperty(f,"TimeUnit",{enumerable:!0,get:function(){return yr.TimeUnit}});Object.defineProperty(f,"Type",{enumerable:!0,get:function(){return yr.Type}});Object.defineProperty(f,"UnionMode",{enumerable:!0,get:function(){return yr.UnionMode}});Object.defineProperty(f,"BufferType",{enumerable:!0,get:function(){return yr.BufferType}});var lA=Lt();Object.defineProperty(f,"Data",{enumerable:!0,get:function(){return lA.Data}});var J=ce();Object.defineProperty(f,"DataType",{enumerable:!0,get:function(){return J.DataType}});Object.defineProperty(f,"Null",{enumerable:!0,get:function(){return J.Null}});Object.defineProperty(f,"Bool",{enumerable:!0,get:function(){return J.Bool}});Object.defineProperty(f,"Int",{enumerable:!0,get:function(){return J.Int}});Object.defineProperty(f,"Int8",{enumerable:!0,get:function(){return J.Int8}});Object.defineProperty(f,"Int16",{enumerable:!0,get:function(){return J.Int16}});Object.defineProperty(f,"Int32",{enumerable:!0,get:function(){return J.Int32}});Object.defineProperty(f,"Int64",{enumerable:!0,get:function(){return J.Int64}});Object.defineProperty(f,"Uint8",{enumerable:!0,get:function(){return J.Uint8}});Object.defineProperty(f,"Uint16",{enumerable:!0,get:function(){return J.Uint16}});Object.defineProperty(f,"Uint32",{enumerable:!0,get:function(){return J.Uint32}});Object.defineProperty(f,"Uint64",{enumerable:!0,get:function(){return J.Uint64}});Object.defineProperty(f,"Float",{enumerable:!0,get:function(){return J.Float}});Object.defineProperty(f,"Float16",{enumerable:!0,get:function(){return J.Float16}});Object.defineProperty(f,"Float32",{enumerable:!0,get:function(){return J.Float32}});Object.defineProperty(f,"Float64",{enumerable:!0,get:function(){return J.Float64}});Object.defineProperty(f,"Utf8",{enumerable:!0,get:function(){return J.Utf8}});Object.defineProperty(f,"Binary",{enumerable:!0,get:function(){return J.Binary}});Object.defineProperty(f,"FixedSizeBinary",{enumerable:!0,get:function(){return J.FixedSizeBinary}});Object.defineProperty(f,"Date_",{enumerable:!0,get:function(){return J.Date_}});Object.defineProperty(f,"DateDay",{enumerable:!0,get:function(){return J.DateDay}});Object.defineProperty(f,"DateMillisecond",{enumerable:!0,get:function(){return J.DateMillisecond}});Object.defineProperty(f,"Timestamp",{enumerable:!0,get:function(){return J.Timestamp}});Object.defineProperty(f,"TimestampSecond",{enumerable:!0,get:function(){return J.TimestampSecond}});Object.defineProperty(f,"TimestampMillisecond",{enumerable:!0,get:function(){return J.TimestampMillisecond}});Object.defineProperty(f,"TimestampMicrosecond",{enumerable:!0,get:function(){return J.TimestampMicrosecond}});Object.defineProperty(f,"TimestampNanosecond",{enumerable:!0,get:function(){return J.TimestampNanosecond}});Object.defineProperty(f,"Time",{enumerable:!0,get:function(){return J.Time}});Object.defineProperty(f,"TimeSecond",{enumerable:!0,get:function(){return J.TimeSecond}});Object.defineProperty(f,"TimeMillisecond",{enumerable:!0,get:function(){return J.TimeMillisecond}});Object.defineProperty(f,"TimeMicrosecond",{enumerable:!0,get:function(){return J.TimeMicrosecond}});Object.defineProperty(f,"TimeNanosecond",{enumerable:!0,get:function(){return J.TimeNanosecond}});Object.defineProperty(f,"Decimal",{enumerable:!0,get:function(){return J.Decimal}});Object.defineProperty(f,"List",{enumerable:!0,get:function(){return J.List}});Object.defineProperty(f,"Struct",{enumerable:!0,get:function(){return J.Struct}});Object.defineProperty(f,"Union",{enumerable:!0,get:function(){return J.Union}});Object.defineProperty(f,"DenseUnion",{enumerable:!0,get:function(){return J.DenseUnion}});Object.defineProperty(f,"SparseUnion",{enumerable:!0,get:function(){return J.SparseUnion}});Object.defineProperty(f,"Dictionary",{enumerable:!0,get:function(){return J.Dictionary}});Object.defineProperty(f,"Interval",{enumerable:!0,get:function(){return J.Interval}});Object.defineProperty(f,"IntervalDayTime",{enumerable:!0,get:function(){return J.IntervalDayTime}});Object.defineProperty(f,"IntervalYearMonth",{enumerable:!0,get:function(){return J.IntervalYearMonth}});Object.defineProperty(f,"FixedSizeList",{enumerable:!0,get:function(){return J.FixedSizeList}});Object.defineProperty(f,"Map_",{enumerable:!0,get:function(){return J.Map_}});var dA=ms();Object.defineProperty(f,"Table",{enumerable:!0,get:function(){return dA.Table}});var fA=Kn();Object.defineProperty(f,"Column",{enumerable:!0,get:function(){return fA.Column}});var hA=Xe();Object.defineProperty(f,"Visitor",{enumerable:!0,get:function(){return hA.Visitor}});var Yb=He();Object.defineProperty(f,"Schema",{enumerable:!0,get:function(){return Yb.Schema}});Object.defineProperty(f,"Field",{enumerable:!0,get:function(){return Yb.Field}});var Y=lr();Object.defineProperty(f,"Vector",{enumerable:!0,get:function(){return Y.Vector}});Object.defineProperty(f,"BaseVector",{enumerable:!0,get:function(){return Y.BaseVector}});Object.defineProperty(f,"BinaryVector",{enumerable:!0,get:function(){return Y.BinaryVector}});Object.defineProperty(f,"BoolVector",{enumerable:!0,get:function(){return Y.BoolVector}});Object.defineProperty(f,"Chunked",{enumerable:!0,get:function(){return Y.Chunked}});Object.defineProperty(f,"DateVector",{enumerable:!0,get:function(){return Y.DateVector}});Object.defineProperty(f,"DateDayVector",{enumerable:!0,get:function(){return Y.DateDayVector}});Object.defineProperty(f,"DateMillisecondVector",{enumerable:!0,get:function(){return Y.DateMillisecondVector}});Object.defineProperty(f,"DecimalVector",{enumerable:!0,get:function(){return Y.DecimalVector}});Object.defineProperty(f,"DictionaryVector",{enumerable:!0,get:function(){return Y.DictionaryVector}});Object.defineProperty(f,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return Y.FixedSizeBinaryVector}});Object.defineProperty(f,"FixedSizeListVector",{enumerable:!0,get:function(){return Y.FixedSizeListVector}});Object.defineProperty(f,"FloatVector",{enumerable:!0,get:function(){return Y.FloatVector}});Object.defineProperty(f,"Float16Vector",{enumerable:!0,get:function(){return Y.Float16Vector}});Object.defineProperty(f,"Float32Vector",{enumerable:!0,get:function(){return Y.Float32Vector}});Object.defineProperty(f,"Float64Vector",{enumerable:!0,get:function(){return Y.Float64Vector}});Object.defineProperty(f,"IntervalVector",{enumerable:!0,get:function(){return Y.IntervalVector}});Object.defineProperty(f,"IntervalDayTimeVector",{enumerable:!0,get:function(){return Y.IntervalDayTimeVector}});Object.defineProperty(f,"IntervalYearMonthVector",{enumerable:!0,get:function(){return Y.IntervalYearMonthVector}});Object.defineProperty(f,"IntVector",{enumerable:!0,get:function(){return Y.IntVector}});Object.defineProperty(f,"Int8Vector",{enumerable:!0,get:function(){return Y.Int8Vector}});Object.defineProperty(f,"Int16Vector",{enumerable:!0,get:function(){return Y.Int16Vector}});Object.defineProperty(f,"Int32Vector",{enumerable:!0,get:function(){return Y.Int32Vector}});Object.defineProperty(f,"Int64Vector",{enumerable:!0,get:function(){return Y.Int64Vector}});Object.defineProperty(f,"Uint8Vector",{enumerable:!0,get:function(){return Y.Uint8Vector}});Object.defineProperty(f,"Uint16Vector",{enumerable:!0,get:function(){return Y.Uint16Vector}});Object.defineProperty(f,"Uint32Vector",{enumerable:!0,get:function(){return Y.Uint32Vector}});Object.defineProperty(f,"Uint64Vector",{enumerable:!0,get:function(){return Y.Uint64Vector}});Object.defineProperty(f,"ListVector",{enumerable:!0,get:function(){return Y.ListVector}});Object.defineProperty(f,"MapVector",{enumerable:!0,get:function(){return Y.MapVector}});Object.defineProperty(f,"NullVector",{enumerable:!0,get:function(){return Y.NullVector}});Object.defineProperty(f,"StructVector",{enumerable:!0,get:function(){return Y.StructVector}});Object.defineProperty(f,"TimestampVector",{enumerable:!0,get:function(){return Y.TimestampVector}});Object.defineProperty(f,"TimestampSecondVector",{enumerable:!0,get:function(){return Y.TimestampSecondVector}});Object.defineProperty(f,"TimestampMillisecondVector",{enumerable:!0,get:function(){return Y.TimestampMillisecondVector}});Object.defineProperty(f,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return Y.TimestampMicrosecondVector}});Object.defineProperty(f,"TimestampNanosecondVector",{enumerable:!0,get:function(){return Y.TimestampNanosecondVector}});Object.defineProperty(f,"TimeVector",{enumerable:!0,get:function(){return Y.TimeVector}});Object.defineProperty(f,"TimeSecondVector",{enumerable:!0,get:function(){return Y.TimeSecondVector}});Object.defineProperty(f,"TimeMillisecondVector",{enumerable:!0,get:function(){return Y.TimeMillisecondVector}});Object.defineProperty(f,"TimeMicrosecondVector",{enumerable:!0,get:function(){return Y.TimeMicrosecondVector}});Object.defineProperty(f,"TimeNanosecondVector",{enumerable:!0,get:function(){return Y.TimeNanosecondVector}});Object.defineProperty(f,"UnionVector",{enumerable:!0,get:function(){return Y.UnionVector}});Object.defineProperty(f,"DenseUnionVector",{enumerable:!0,get:function(){return Y.DenseUnionVector}});Object.defineProperty(f,"SparseUnionVector",{enumerable:!0,get:function(){return Y.SparseUnionVector}});Object.defineProperty(f,"Utf8Vector",{enumerable:!0,get:function(){return Y.Utf8Vector}});var K=Ja();Object.defineProperty(f,"Builder",{enumerable:!0,get:function(){return K.Builder}});Object.defineProperty(f,"BinaryBuilder",{enumerable:!0,get:function(){return K.BinaryBuilder}});Object.defineProperty(f,"BoolBuilder",{enumerable:!0,get:function(){return K.BoolBuilder}});Object.defineProperty(f,"DateBuilder",{enumerable:!0,get:function(){return K.DateBuilder}});Object.defineProperty(f,"DateDayBuilder",{enumerable:!0,get:function(){return K.DateDayBuilder}});Object.defineProperty(f,"DateMillisecondBuilder",{enumerable:!0,get:function(){return K.DateMillisecondBuilder}});Object.defineProperty(f,"DecimalBuilder",{enumerable:!0,get:function(){return K.DecimalBuilder}});Object.defineProperty(f,"DictionaryBuilder",{enumerable:!0,get:function(){return K.DictionaryBuilder}});Object.defineProperty(f,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return K.FixedSizeBinaryBuilder}});Object.defineProperty(f,"FixedSizeListBuilder",{enumerable:!0,get:function(){return K.FixedSizeListBuilder}});Object.defineProperty(f,"FloatBuilder",{enumerable:!0,get:function(){return K.FloatBuilder}});Object.defineProperty(f,"Float16Builder",{enumerable:!0,get:function(){return K.Float16Builder}});Object.defineProperty(f,"Float32Builder",{enumerable:!0,get:function(){return K.Float32Builder}});Object.defineProperty(f,"Float64Builder",{enumerable:!0,get:function(){return K.Float64Builder}});Object.defineProperty(f,"IntervalBuilder",{enumerable:!0,get:function(){return K.IntervalBuilder}});Object.defineProperty(f,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return K.IntervalDayTimeBuilder}});Object.defineProperty(f,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return K.IntervalYearMonthBuilder}});Object.defineProperty(f,"IntBuilder",{enumerable:!0,get:function(){return K.IntBuilder}});Object.defineProperty(f,"Int8Builder",{enumerable:!0,get:function(){return K.Int8Builder}});Object.defineProperty(f,"Int16Builder",{enumerable:!0,get:function(){return K.Int16Builder}});Object.defineProperty(f,"Int32Builder",{enumerable:!0,get:function(){return K.Int32Builder}});Object.defineProperty(f,"Int64Builder",{enumerable:!0,get:function(){return K.Int64Builder}});Object.defineProperty(f,"Uint8Builder",{enumerable:!0,get:function(){return K.Uint8Builder}});Object.defineProperty(f,"Uint16Builder",{enumerable:!0,get:function(){return K.Uint16Builder}});Object.defineProperty(f,"Uint32Builder",{enumerable:!0,get:function(){return K.Uint32Builder}});Object.defineProperty(f,"Uint64Builder",{enumerable:!0,get:function(){return K.Uint64Builder}});Object.defineProperty(f,"ListBuilder",{enumerable:!0,get:function(){return K.ListBuilder}});Object.defineProperty(f,"MapBuilder",{enumerable:!0,get:function(){return K.MapBuilder}});Object.defineProperty(f,"NullBuilder",{enumerable:!0,get:function(){return K.NullBuilder}});Object.defineProperty(f,"StructBuilder",{enumerable:!0,get:function(){return K.StructBuilder}});Object.defineProperty(f,"TimestampBuilder",{enumerable:!0,get:function(){return K.TimestampBuilder}});Object.defineProperty(f,"TimestampSecondBuilder",{enumerable:!0,get:function(){return K.TimestampSecondBuilder}});Object.defineProperty(f,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return K.TimestampMillisecondBuilder}});Object.defineProperty(f,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return K.TimestampMicrosecondBuilder}});Object.defineProperty(f,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return K.TimestampNanosecondBuilder}});Object.defineProperty(f,"TimeBuilder",{enumerable:!0,get:function(){return K.TimeBuilder}});Object.defineProperty(f,"TimeSecondBuilder",{enumerable:!0,get:function(){return K.TimeSecondBuilder}});Object.defineProperty(f,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return K.TimeMillisecondBuilder}});Object.defineProperty(f,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return K.TimeMicrosecondBuilder}});Object.defineProperty(f,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return K.TimeNanosecondBuilder}});Object.defineProperty(f,"UnionBuilder",{enumerable:!0,get:function(){return K.UnionBuilder}});Object.defineProperty(f,"DenseUnionBuilder",{enumerable:!0,get:function(){return K.DenseUnionBuilder}});Object.defineProperty(f,"SparseUnionBuilder",{enumerable:!0,get:function(){return K.SparseUnionBuilder}});Object.defineProperty(f,"Utf8Builder",{enumerable:!0,get:function(){return K.Utf8Builder}});var gd=Hr();Object.defineProperty(f,"ByteStream",{enumerable:!0,get:function(){return gd.ByteStream}});Object.defineProperty(f,"AsyncByteStream",{enumerable:!0,get:function(){return gd.AsyncByteStream}});Object.defineProperty(f,"AsyncByteQueue",{enumerable:!0,get:function(){return gd.AsyncByteQueue}});var Us=Ss();Object.defineProperty(f,"RecordBatchReader",{enumerable:!0,get:function(){return Us.RecordBatchReader}});Object.defineProperty(f,"RecordBatchFileReader",{enumerable:!0,get:function(){return Us.RecordBatchFileReader}});Object.defineProperty(f,"RecordBatchStreamReader",{enumerable:!0,get:function(){return Us.RecordBatchStreamReader}});Object.defineProperty(f,"AsyncRecordBatchFileReader",{enumerable:!0,get:function(){return Us.AsyncRecordBatchFileReader}});Object.defineProperty(f,"AsyncRecordBatchStreamReader",{enumerable:!0,get:function(){return Us.AsyncRecordBatchStreamReader}});var Ko=go();Object.defineProperty(f,"RecordBatchWriter",{enumerable:!0,get:function(){return Ko.RecordBatchWriter}});Object.defineProperty(f,"RecordBatchFileWriter",{enumerable:!0,get:function(){return Ko.RecordBatchFileWriter}});Object.defineProperty(f,"RecordBatchStreamWriter",{enumerable:!0,get:function(){return Ko.RecordBatchStreamWriter}});Object.defineProperty(f,"RecordBatchJSONWriter",{enumerable:!0,get:function(){return Ko.RecordBatchJSONWriter}});var vd=uo();Object.defineProperty(f,"MessageReader",{enumerable:!0,get:function(){return vd.MessageReader}});Object.defineProperty(f,"AsyncMessageReader",{enumerable:!0,get:function(){return vd.AsyncMessageReader}});Object.defineProperty(f,"JSONMessageReader",{enumerable:!0,get:function(){return vd.JSONMessageReader}});var pA=gn();Object.defineProperty(f,"Message",{enumerable:!0,get:function(){return pA.Message}});var yA=Ir();Object.defineProperty(f,"RecordBatch",{enumerable:!0,get:function(){return yA.RecordBatch}});var wd=Hb();Object.defineProperty(f,"DataFrame",{enumerable:!0,get:function(){return wd.DataFrame}});Object.defineProperty(f,"FilteredDataFrame",{enumerable:!0,get:function(){return wd.FilteredDataFrame}});Object.defineProperty(f,"CountByResult",{enumerable:!0,get:function(){return wd.CountByResult}});var mA=ts(),bA=Pc(),_A=Qt(),gA=Qi(),vA=Ee(),wA=is(),TA=bd();f.predicate=TA;f.util={...mA,...bA,..._A,...gA,...vA,...wA}});var Ms=T(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0});h.Utf8Builder=h.SparseUnionBuilder=h.DenseUnionBuilder=h.UnionBuilder=h.TimeNanosecondBuilder=h.TimeMicrosecondBuilder=h.TimeMillisecondBuilder=h.TimeSecondBuilder=h.TimeBuilder=h.TimestampNanosecondBuilder=h.TimestampMicrosecondBuilder=h.TimestampMillisecondBuilder=h.TimestampSecondBuilder=h.TimestampBuilder=h.StructBuilder=h.NullBuilder=h.MapBuilder=h.ListBuilder=h.Uint64Builder=h.Uint32Builder=h.Uint16Builder=h.Uint8Builder=h.Int64Builder=h.Int32Builder=h.Int16Builder=h.Int8Builder=h.IntBuilder=h.IntervalYearMonthBuilder=h.IntervalDayTimeBuilder=h.IntervalBuilder=h.Float64Builder=h.Float32Builder=h.Float16Builder=h.FloatBuilder=h.FixedSizeListBuilder=h.FixedSizeBinaryBuilder=h.DictionaryBuilder=h.DecimalBuilder=h.DateMillisecondBuilder=h.DateDayBuilder=h.DateBuilder=h.BoolBuilder=h.BinaryBuilder=h.Builder=h.util=h.predicate=h.CountByResult=h.FilteredDataFrame=h.DataFrame=h.RecordBatch=h.Message=h.JSONMessageReader=h.AsyncMessageReader=h.MessageReader=h.RecordBatchJSONWriter=h.RecordBatchStreamWriter=h.RecordBatchFileWriter=h.RecordBatchWriter=h.AsyncRecordBatchStreamReader=h.AsyncRecordBatchFileReader=h.RecordBatchStreamReader=h.RecordBatchFileReader=h.RecordBatchReader=h.AsyncByteQueue=h.AsyncByteStream=h.ByteStream=h.Utf8Vector=h.SparseUnionVector=h.DenseUnionVector=h.UnionVector=h.TimeNanosecondVector=h.TimeMicrosecondVector=h.TimeMillisecondVector=h.TimeSecondVector=h.TimeVector=h.TimestampNanosecondVector=h.TimestampMicrosecondVector=h.TimestampMillisecondVector=h.TimestampSecondVector=h.TimestampVector=h.StructVector=h.NullVector=h.MapVector=h.ListVector=h.Uint64Vector=h.Uint32Vector=h.Uint16Vector=h.Uint8Vector=h.Int64Vector=h.Int32Vector=h.Int16Vector=h.Int8Vector=h.IntVector=h.IntervalYearMonthVector=h.IntervalDayTimeVector=h.IntervalVector=h.Float64Vector=h.Float32Vector=h.Float16Vector=h.FloatVector=h.FixedSizeListVector=h.FixedSizeBinaryVector=h.DictionaryVector=h.DecimalVector=h.DateMillisecondVector=h.DateDayVector=h.DateVector=h.Chunked=h.BoolVector=h.BinaryVector=h.BaseVector=h.Vector=h.Visitor=h.Field=h.Schema=h.Column=h.Table=h.Map_=h.FixedSizeList=h.IntervalYearMonth=h.IntervalDayTime=h.Interval=h.Dictionary=h.SparseUnion=h.DenseUnion=h.Union=h.Struct=h.List=h.Decimal=h.TimeNanosecond=h.TimeMicrosecond=h.TimeMillisecond=h.TimeSecond=h.Time=h.TimestampNanosecond=h.TimestampMicrosecond=h.TimestampMillisecond=h.TimestampSecond=h.Timestamp=h.DateMillisecond=h.DateDay=h.Date_=h.FixedSizeBinary=h.Binary=h.Utf8=h.Float64=h.Float32=h.Float16=h.Float=h.Uint64=h.Uint32=h.Uint16=h.Uint8=h.Int64=h.Int32=h.Int16=h.Int8=h.Int=h.Bool=h.Null=h.DataType=h.Data=h.BufferType=h.UnionMode=h.Type=h.TimeUnit=h.Precision=h.MetadataVersion=h.MessageHeader=h.IntervalUnit=h.DateUnit=h.ArrowType=void 0;var BA=Hi(),IA=Ja(),SA=Ss(),OA=go(),AA=kb(),DA=xb(),FA=Cb(),EA=jb();BA.default.toDOMStream=AA.toDOMStream;IA.Builder.throughDOM=DA.builderThroughDOMStream;SA.RecordBatchReader.throughDOM=FA.recordBatchReaderThroughDOMStream;OA.RecordBatchWriter.throughDOM=EA.recordBatchWriterThroughDOMStream;var b=Gb();Object.defineProperty(h,"ArrowType",{enumerable:!0,get:function(){return b.ArrowType}});Object.defineProperty(h,"DateUnit",{enumerable:!0,get:function(){return b.DateUnit}});Object.defineProperty(h,"IntervalUnit",{enumerable:!0,get:function(){return b.IntervalUnit}});Object.defineProperty(h,"MessageHeader",{enumerable:!0,get:function(){return b.MessageHeader}});Object.defineProperty(h,"MetadataVersion",{enumerable:!0,get:function(){return b.MetadataVersion}});Object.defineProperty(h,"Precision",{enumerable:!0,get:function(){return b.Precision}});Object.defineProperty(h,"TimeUnit",{enumerable:!0,get:function(){return b.TimeUnit}});Object.defineProperty(h,"Type",{enumerable:!0,get:function(){return b.Type}});Object.defineProperty(h,"UnionMode",{enumerable:!0,get:function(){return b.UnionMode}});Object.defineProperty(h,"BufferType",{enumerable:!0,get:function(){return b.BufferType}});Object.defineProperty(h,"Data",{enumerable:!0,get:function(){return b.Data}});Object.defineProperty(h,"DataType",{enumerable:!0,get:function(){return b.DataType}});Object.defineProperty(h,"Null",{enumerable:!0,get:function(){return b.Null}});Object.defineProperty(h,"Bool",{enumerable:!0,get:function(){return b.Bool}});Object.defineProperty(h,"Int",{enumerable:!0,get:function(){return b.Int}});Object.defineProperty(h,"Int8",{enumerable:!0,get:function(){return b.Int8}});Object.defineProperty(h,"Int16",{enumerable:!0,get:function(){return b.Int16}});Object.defineProperty(h,"Int32",{enumerable:!0,get:function(){return b.Int32}});Object.defineProperty(h,"Int64",{enumerable:!0,get:function(){return b.Int64}});Object.defineProperty(h,"Uint8",{enumerable:!0,get:function(){return b.Uint8}});Object.defineProperty(h,"Uint16",{enumerable:!0,get:function(){return b.Uint16}});Object.defineProperty(h,"Uint32",{enumerable:!0,get:function(){return b.Uint32}});Object.defineProperty(h,"Uint64",{enumerable:!0,get:function(){return b.Uint64}});Object.defineProperty(h,"Float",{enumerable:!0,get:function(){return b.Float}});Object.defineProperty(h,"Float16",{enumerable:!0,get:function(){return b.Float16}});Object.defineProperty(h,"Float32",{enumerable:!0,get:function(){return b.Float32}});Object.defineProperty(h,"Float64",{enumerable:!0,get:function(){return b.Float64}});Object.defineProperty(h,"Utf8",{enumerable:!0,get:function(){return b.Utf8}});Object.defineProperty(h,"Binary",{enumerable:!0,get:function(){return b.Binary}});Object.defineProperty(h,"FixedSizeBinary",{enumerable:!0,get:function(){return b.FixedSizeBinary}});Object.defineProperty(h,"Date_",{enumerable:!0,get:function(){return b.Date_}});Object.defineProperty(h,"DateDay",{enumerable:!0,get:function(){return b.DateDay}});Object.defineProperty(h,"DateMillisecond",{enumerable:!0,get:function(){return b.DateMillisecond}});Object.defineProperty(h,"Timestamp",{enumerable:!0,get:function(){return b.Timestamp}});Object.defineProperty(h,"TimestampSecond",{enumerable:!0,get:function(){return b.TimestampSecond}});Object.defineProperty(h,"TimestampMillisecond",{enumerable:!0,get:function(){return b.TimestampMillisecond}});Object.defineProperty(h,"TimestampMicrosecond",{enumerable:!0,get:function(){return b.TimestampMicrosecond}});Object.defineProperty(h,"TimestampNanosecond",{enumerable:!0,get:function(){return b.TimestampNanosecond}});Object.defineProperty(h,"Time",{enumerable:!0,get:function(){return b.Time}});Object.defineProperty(h,"TimeSecond",{enumerable:!0,get:function(){return b.TimeSecond}});Object.defineProperty(h,"TimeMillisecond",{enumerable:!0,get:function(){return b.TimeMillisecond}});Object.defineProperty(h,"TimeMicrosecond",{enumerable:!0,get:function(){return b.TimeMicrosecond}});Object.defineProperty(h,"TimeNanosecond",{enumerable:!0,get:function(){return b.TimeNanosecond}});Object.defineProperty(h,"Decimal",{enumerable:!0,get:function(){return b.Decimal}});Object.defineProperty(h,"List",{enumerable:!0,get:function(){return b.List}});Object.defineProperty(h,"Struct",{enumerable:!0,get:function(){return b.Struct}});Object.defineProperty(h,"Union",{enumerable:!0,get:function(){return b.Union}});Object.defineProperty(h,"DenseUnion",{enumerable:!0,get:function(){return b.DenseUnion}});Object.defineProperty(h,"SparseUnion",{enumerable:!0,get:function(){return b.SparseUnion}});Object.defineProperty(h,"Dictionary",{enumerable:!0,get:function(){return b.Dictionary}});Object.defineProperty(h,"Interval",{enumerable:!0,get:function(){return b.Interval}});Object.defineProperty(h,"IntervalDayTime",{enumerable:!0,get:function(){return b.IntervalDayTime}});Object.defineProperty(h,"IntervalYearMonth",{enumerable:!0,get:function(){return b.IntervalYearMonth}});Object.defineProperty(h,"FixedSizeList",{enumerable:!0,get:function(){return b.FixedSizeList}});Object.defineProperty(h,"Map_",{enumerable:!0,get:function(){return b.Map_}});Object.defineProperty(h,"Table",{enumerable:!0,get:function(){return b.Table}});Object.defineProperty(h,"Column",{enumerable:!0,get:function(){return b.Column}});Object.defineProperty(h,"Schema",{enumerable:!0,get:function(){return b.Schema}});Object.defineProperty(h,"Field",{enumerable:!0,get:function(){return b.Field}});Object.defineProperty(h,"Visitor",{enumerable:!0,get:function(){return b.Visitor}});Object.defineProperty(h,"Vector",{enumerable:!0,get:function(){return b.Vector}});Object.defineProperty(h,"BaseVector",{enumerable:!0,get:function(){return b.BaseVector}});Object.defineProperty(h,"BinaryVector",{enumerable:!0,get:function(){return b.BinaryVector}});Object.defineProperty(h,"BoolVector",{enumerable:!0,get:function(){return b.BoolVector}});Object.defineProperty(h,"Chunked",{enumerable:!0,get:function(){return b.Chunked}});Object.defineProperty(h,"DateVector",{enumerable:!0,get:function(){return b.DateVector}});Object.defineProperty(h,"DateDayVector",{enumerable:!0,get:function(){return b.DateDayVector}});Object.defineProperty(h,"DateMillisecondVector",{enumerable:!0,get:function(){return b.DateMillisecondVector}});Object.defineProperty(h,"DecimalVector",{enumerable:!0,get:function(){return b.DecimalVector}});Object.defineProperty(h,"DictionaryVector",{enumerable:!0,get:function(){return b.DictionaryVector}});Object.defineProperty(h,"FixedSizeBinaryVector",{enumerable:!0,get:function(){return b.FixedSizeBinaryVector}});Object.defineProperty(h,"FixedSizeListVector",{enumerable:!0,get:function(){return b.FixedSizeListVector}});Object.defineProperty(h,"FloatVector",{enumerable:!0,get:function(){return b.FloatVector}});Object.defineProperty(h,"Float16Vector",{enumerable:!0,get:function(){return b.Float16Vector}});Object.defineProperty(h,"Float32Vector",{enumerable:!0,get:function(){return b.Float32Vector}});Object.defineProperty(h,"Float64Vector",{enumerable:!0,get:function(){return b.Float64Vector}});Object.defineProperty(h,"IntervalVector",{enumerable:!0,get:function(){return b.IntervalVector}});Object.defineProperty(h,"IntervalDayTimeVector",{enumerable:!0,get:function(){return b.IntervalDayTimeVector}});Object.defineProperty(h,"IntervalYearMonthVector",{enumerable:!0,get:function(){return b.IntervalYearMonthVector}});Object.defineProperty(h,"IntVector",{enumerable:!0,get:function(){return b.IntVector}});Object.defineProperty(h,"Int8Vector",{enumerable:!0,get:function(){return b.Int8Vector}});Object.defineProperty(h,"Int16Vector",{enumerable:!0,get:function(){return b.Int16Vector}});Object.defineProperty(h,"Int32Vector",{enumerable:!0,get:function(){return b.Int32Vector}});Object.defineProperty(h,"Int64Vector",{enumerable:!0,get:function(){return b.Int64Vector}});Object.defineProperty(h,"Uint8Vector",{enumerable:!0,get:function(){return b.Uint8Vector}});Object.defineProperty(h,"Uint16Vector",{enumerable:!0,get:function(){return b.Uint16Vector}});Object.defineProperty(h,"Uint32Vector",{enumerable:!0,get:function(){return b.Uint32Vector}});Object.defineProperty(h,"Uint64Vector",{enumerable:!0,get:function(){return b.Uint64Vector}});Object.defineProperty(h,"ListVector",{enumerable:!0,get:function(){return b.ListVector}});Object.defineProperty(h,"MapVector",{enumerable:!0,get:function(){return b.MapVector}});Object.defineProperty(h,"NullVector",{enumerable:!0,get:function(){return b.NullVector}});Object.defineProperty(h,"StructVector",{enumerable:!0,get:function(){return b.StructVector}});Object.defineProperty(h,"TimestampVector",{enumerable:!0,get:function(){return b.TimestampVector}});Object.defineProperty(h,"TimestampSecondVector",{enumerable:!0,get:function(){return b.TimestampSecondVector}});Object.defineProperty(h,"TimestampMillisecondVector",{enumerable:!0,get:function(){return b.TimestampMillisecondVector}});Object.defineProperty(h,"TimestampMicrosecondVector",{enumerable:!0,get:function(){return b.TimestampMicrosecondVector}});Object.defineProperty(h,"TimestampNanosecondVector",{enumerable:!0,get:function(){return b.TimestampNanosecondVector}});Object.defineProperty(h,"TimeVector",{enumerable:!0,get:function(){return b.TimeVector}});Object.defineProperty(h,"TimeSecondVector",{enumerable:!0,get:function(){return b.TimeSecondVector}});Object.defineProperty(h,"TimeMillisecondVector",{enumerable:!0,get:function(){return b.TimeMillisecondVector}});Object.defineProperty(h,"TimeMicrosecondVector",{enumerable:!0,get:function(){return b.TimeMicrosecondVector}});Object.defineProperty(h,"TimeNanosecondVector",{enumerable:!0,get:function(){return b.TimeNanosecondVector}});Object.defineProperty(h,"UnionVector",{enumerable:!0,get:function(){return b.UnionVector}});Object.defineProperty(h,"DenseUnionVector",{enumerable:!0,get:function(){return b.DenseUnionVector}});Object.defineProperty(h,"SparseUnionVector",{enumerable:!0,get:function(){return b.SparseUnionVector}});Object.defineProperty(h,"Utf8Vector",{enumerable:!0,get:function(){return b.Utf8Vector}});Object.defineProperty(h,"ByteStream",{enumerable:!0,get:function(){return b.ByteStream}});Object.defineProperty(h,"AsyncByteStream",{enumerable:!0,get:function(){return b.AsyncByteStream}});Object.defineProperty(h,"AsyncByteQueue",{enumerable:!0,get:function(){return b.AsyncByteQueue}});Object.defineProperty(h,"RecordBatchReader",{enumerable:!0,get:function(){return b.RecordBatchReader}});Object.defineProperty(h,"RecordBatchFileReader",{enumerable:!0,get:function(){return b.RecordBatchFileReader}});Object.defineProperty(h,"RecordBatchStreamReader",{enumerable:!0,get:function(){return b.RecordBatchStreamReader}});Object.defineProperty(h,"AsyncRecordBatchFileReader",{enumerable:!0,get:function(){return b.AsyncRecordBatchFileReader}});Object.defineProperty(h,"AsyncRecordBatchStreamReader",{enumerable:!0,get:function(){return b.AsyncRecordBatchStreamReader}});Object.defineProperty(h,"RecordBatchWriter",{enumerable:!0,get:function(){return b.RecordBatchWriter}});Object.defineProperty(h,"RecordBatchFileWriter",{enumerable:!0,get:function(){return b.RecordBatchFileWriter}});Object.defineProperty(h,"RecordBatchStreamWriter",{enumerable:!0,get:function(){return b.RecordBatchStreamWriter}});Object.defineProperty(h,"RecordBatchJSONWriter",{enumerable:!0,get:function(){return b.RecordBatchJSONWriter}});Object.defineProperty(h,"MessageReader",{enumerable:!0,get:function(){return b.MessageReader}});Object.defineProperty(h,"AsyncMessageReader",{enumerable:!0,get:function(){return b.AsyncMessageReader}});Object.defineProperty(h,"JSONMessageReader",{enumerable:!0,get:function(){return b.JSONMessageReader}});Object.defineProperty(h,"Message",{enumerable:!0,get:function(){return b.Message}});Object.defineProperty(h,"RecordBatch",{enumerable:!0,get:function(){return b.RecordBatch}});Object.defineProperty(h,"DataFrame",{enumerable:!0,get:function(){return b.DataFrame}});Object.defineProperty(h,"FilteredDataFrame",{enumerable:!0,get:function(){return b.FilteredDataFrame}});Object.defineProperty(h,"CountByResult",{enumerable:!0,get:function(){return b.CountByResult}});Object.defineProperty(h,"predicate",{enumerable:!0,get:function(){return b.predicate}});Object.defineProperty(h,"util",{enumerable:!0,get:function(){return b.util}});Object.defineProperty(h,"Builder",{enumerable:!0,get:function(){return b.Builder}});Object.defineProperty(h,"BinaryBuilder",{enumerable:!0,get:function(){return b.BinaryBuilder}});Object.defineProperty(h,"BoolBuilder",{enumerable:!0,get:function(){return b.BoolBuilder}});Object.defineProperty(h,"DateBuilder",{enumerable:!0,get:function(){return b.DateBuilder}});Object.defineProperty(h,"DateDayBuilder",{enumerable:!0,get:function(){return b.DateDayBuilder}});Object.defineProperty(h,"DateMillisecondBuilder",{enumerable:!0,get:function(){return b.DateMillisecondBuilder}});Object.defineProperty(h,"DecimalBuilder",{enumerable:!0,get:function(){return b.DecimalBuilder}});Object.defineProperty(h,"DictionaryBuilder",{enumerable:!0,get:function(){return b.DictionaryBuilder}});Object.defineProperty(h,"FixedSizeBinaryBuilder",{enumerable:!0,get:function(){return b.FixedSizeBinaryBuilder}});Object.defineProperty(h,"FixedSizeListBuilder",{enumerable:!0,get:function(){return b.FixedSizeListBuilder}});Object.defineProperty(h,"FloatBuilder",{enumerable:!0,get:function(){return b.FloatBuilder}});Object.defineProperty(h,"Float16Builder",{enumerable:!0,get:function(){return b.Float16Builder}});Object.defineProperty(h,"Float32Builder",{enumerable:!0,get:function(){return b.Float32Builder}});Object.defineProperty(h,"Float64Builder",{enumerable:!0,get:function(){return b.Float64Builder}});Object.defineProperty(h,"IntervalBuilder",{enumerable:!0,get:function(){return b.IntervalBuilder}});Object.defineProperty(h,"IntervalDayTimeBuilder",{enumerable:!0,get:function(){return b.IntervalDayTimeBuilder}});Object.defineProperty(h,"IntervalYearMonthBuilder",{enumerable:!0,get:function(){return b.IntervalYearMonthBuilder}});Object.defineProperty(h,"IntBuilder",{enumerable:!0,get:function(){return b.IntBuilder}});Object.defineProperty(h,"Int8Builder",{enumerable:!0,get:function(){return b.Int8Builder}});Object.defineProperty(h,"Int16Builder",{enumerable:!0,get:function(){return b.Int16Builder}});Object.defineProperty(h,"Int32Builder",{enumerable:!0,get:function(){return b.Int32Builder}});Object.defineProperty(h,"Int64Builder",{enumerable:!0,get:function(){return b.Int64Builder}});Object.defineProperty(h,"Uint8Builder",{enumerable:!0,get:function(){return b.Uint8Builder}});Object.defineProperty(h,"Uint16Builder",{enumerable:!0,get:function(){return b.Uint16Builder}});Object.defineProperty(h,"Uint32Builder",{enumerable:!0,get:function(){return b.Uint32Builder}});Object.defineProperty(h,"Uint64Builder",{enumerable:!0,get:function(){return b.Uint64Builder}});Object.defineProperty(h,"ListBuilder",{enumerable:!0,get:function(){return b.ListBuilder}});Object.defineProperty(h,"MapBuilder",{enumerable:!0,get:function(){return b.MapBuilder}});Object.defineProperty(h,"NullBuilder",{enumerable:!0,get:function(){return b.NullBuilder}});Object.defineProperty(h,"StructBuilder",{enumerable:!0,get:function(){return b.StructBuilder}});Object.defineProperty(h,"TimestampBuilder",{enumerable:!0,get:function(){return b.TimestampBuilder}});Object.defineProperty(h,"TimestampSecondBuilder",{enumerable:!0,get:function(){return b.TimestampSecondBuilder}});Object.defineProperty(h,"TimestampMillisecondBuilder",{enumerable:!0,get:function(){return b.TimestampMillisecondBuilder}});Object.defineProperty(h,"TimestampMicrosecondBuilder",{enumerable:!0,get:function(){return b.TimestampMicrosecondBuilder}});Object.defineProperty(h,"TimestampNanosecondBuilder",{enumerable:!0,get:function(){return b.TimestampNanosecondBuilder}});Object.defineProperty(h,"TimeBuilder",{enumerable:!0,get:function(){return b.TimeBuilder}});Object.defineProperty(h,"TimeSecondBuilder",{enumerable:!0,get:function(){return b.TimeSecondBuilder}});Object.defineProperty(h,"TimeMillisecondBuilder",{enumerable:!0,get:function(){return b.TimeMillisecondBuilder}});Object.defineProperty(h,"TimeMicrosecondBuilder",{enumerable:!0,get:function(){return b.TimeMicrosecondBuilder}});Object.defineProperty(h,"TimeNanosecondBuilder",{enumerable:!0,get:function(){return b.TimeNanosecondBuilder}});Object.defineProperty(h,"UnionBuilder",{enumerable:!0,get:function(){return b.UnionBuilder}});Object.defineProperty(h,"DenseUnionBuilder",{enumerable:!0,get:function(){return b.DenseUnionBuilder}});Object.defineProperty(h,"SparseUnionBuilder",{enumerable:!0,get:function(){return b.SparseUnionBuilder}});Object.defineProperty(h,"Utf8Builder",{enumerable:!0,get:function(){return b.Utf8Builder}})});var Ri=T(()=>{});var Ps=T(()=>{});var Jb=T(()=>{});var Kb=T(()=>{});var Qb=T(()=>{});var Xb=T(()=>{});var kA={};xv(kA,{registerWorker:()=>n_});var Od=Ks(Ms());var $b=Ks(Ms()),Qo=class extends $b.AsyncByteQueue{flush(){let e=super.toUint8Array(!0);return this._values.length=0,e}};var Td;(function(a){a[a.NONE=0]="NONE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARNING=3]="WARNING",a[a.ERROR=4]="ERROR"})(Td||(Td={}));var Bd;(function(a){a[a.NONE=0]="NONE",a[a.CONNECT=1]="CONNECT",a[a.DISCONNECT=2]="DISCONNECT",a[a.OPEN=3]="OPEN",a[a.QUERY=4]="QUERY"})(Bd||(Bd={}));var Id;(function(u){u[u.NONE=0]="NONE",u[u.OK=1]="OK",u[u.ERROR=2]="ERROR",u[u.START=3]="START",u[u.RUN=4]="RUN",u[u.CAPTURE=5]="CAPTURE"})(Id||(Id={}));var Sd;(function(a){a[a.NONE=0]="NONE",a[a.WEB_WORKER=1]="WEB_WORKER",a[a.NODE_WORKER=2]="NODE_WORKER",a[a.BINDINGS=3]="BINDINGS",a[a.ASYNC_DUCKDB=4]="ASYNC_DUCKDB"})(Sd||(Sd={}));var RA=class{constructor(e,r,n){this.db=e;this.conn=r;this.header=n;this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e;return this._inFlight!=null?(e=await this._inFlight,this._inFlight=null):e=await this.db.fetchQueryResults(this.conn),this._depleted=e.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:e}}[Symbol.asyncIterator](){return this}};var ae;(function(P){P.CLOSE_PREPARED="CLOSE_PREPARED",P.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",P.CONNECT="CONNECT",P.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",P.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",P.CREATE_PREPARED="CREATE_PREPARED",P.DISCONNECT="DISCONNECT",P.DROP_FILE="DROP_FILE",P.DROP_FILES="DROP_FILES",P.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",P.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",P.FLUSH_FILES="FLUSH_FILES",P.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",P.GET_VERSION="GET_VERSION",P.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",P.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",P.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",P.INSTANTIATE="INSTANTIATE",P.OPEN="OPEN",P.PING="PING",P.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",P.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",P.REGISTER_FILE_URL="REGISTER_FILE_URL",P.RESET="RESET",P.RUN_PREPARED="RUN_PREPARED",P.RUN_QUERY="RUN_QUERY",P.SEND_PREPARED="SEND_PREPARED",P.SEND_QUERY="SEND_QUERY",P.TOKENIZE="TOKENIZE"})(ae||(ae={}));var Ve;(function(x){x.CONNECTION_INFO="CONNECTION_INFO",x.ERROR="ERROR",x.FEATURE_FLAGS="FEATURE_FLAGS",x.FILE_BUFFER="FILE_BUFFER",x.FILE_SIZE="FILE_SIZE",x.FILE_STATISTICS="FILE_STATISTICS",x.LOG="LOG",x.OK="OK",x.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",x.QUERY_PLAN="QUERY_PLAN",x.QUERY_RESULT="QUERY_RESULT",x.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",x.QUERY_START="QUERY_START",x.REGISTERED_FILE="REGISTERED_FILE",x.SCRIPT_TOKENS="SCRIPT_TOKENS",x.SUCCESS="SUCCESS",x.VERSION_STRING="VERSION_STRING"})(Ve||(Ve={}));var re=Ks(Ms());function Ei(t,e){switch(e.typeId){case re.Type.Binary:return{name:t,type:"binary"};case re.Type.Bool:return{name:t,type:"bool"};case re.Type.Date:return{name:t,type:"date"};case re.Type.DateDay:return{name:t,type:"date32[d]"};case re.Type.DateMillisecond:return{name:t,type:"date64[ms]"};case re.Type.Decimal:{let r=e;return{name:t,type:"decimal",precision:r.precision,scale:r.scale}}case re.Type.Float:return{name:t,type:"float"};case re.Type.Float16:return{name:t,type:"float16"};case re.Type.Float32:return{name:t,type:"float32"};case re.Type.Float64:return{name:t,type:"float64"};case re.Type.Int:return{name:t,type:"int32"};case re.Type.Int16:return{name:t,type:"int16"};case re.Type.Int32:return{name:t,type:"int32"};case re.Type.Int64:return{name:t,type:"int64"};case re.Type.Uint16:return{name:t,type:"uint16"};case re.Type.Uint32:return{name:t,type:"uint32"};case re.Type.Uint64:return{name:t,type:"uint64"};case re.Type.Uint8:return{name:t,type:"uint8"};case re.Type.IntervalDayTime:return{name:t,type:"interval[dt]"};case re.Type.IntervalYearMonth:return{name:t,type:"interval[m]"};case re.Type.List:{let r=e;return{name:t,type:"list",children:[Ei(r.valueField.name,r.valueField.type)]}}case re.Type.FixedSizeBinary:return{name:t,type:"fixedsizebinary",byteWidth:e.byteWidth};case re.Type.Null:return{name:t,type:"null"};case re.Type.Utf8:return{name:t,type:"utf8"};case re.Type.Struct:return{name:t,type:"struct",children:e.children.map(n=>Ei(n.name,n.type))};case re.Type.Time:return{name:t,type:"time[s]"};case re.Type.TimeMicrosecond:return{name:t,type:"time[us]"};case re.Type.TimeMillisecond:return{name:t,type:"time[ms]"};case re.Type.TimeNanosecond:return{name:t,type:"time[ns]"};case re.Type.TimeSecond:return{name:t,type:"time[s]"};case re.Type.Timestamp:return{name:t,type:"timestamp",timezone:e.timezone||void 0};case re.Type.TimestampSecond:return{name:t,type:"timestamp[s]",timezone:e.timezone||void 0};case re.Type.TimestampMicrosecond:return{name:t,type:"timestamp[us]",timezone:e.timezone||void 0};case re.Type.TimestampNanosecond:return{name:t,type:"timestamp[ns]",timezone:e.timezone||void 0};case re.Type.TimestampMillisecond:return{name:t,type:"timestamp[ms]",timezone:e.timezone||void 0}}throw new Error(`unsupported arrow type: ${e.toString()}`)}var s1=new TextEncoder;var Ad=class{constructor(){this._bindings=null;this._nextMessageId=0}log(e){this.postMessage({messageId:this._nextMessageId++,requestId:0,type:Ve.LOG,data:e},[])}sendOK(e){this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.OK,data:null},[])}failWith(e,r){let n={name:r.name,message:r.message,stack:r.stack||void 0};this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.ERROR,data:n},[])}async onMessage(e){switch(e.type){case ae.PING:this.sendOK(e);return;case ae.INSTANTIATE:this._bindings!=null&&this.failWith(e,new Error("duckdb already initialized"));try{this._bindings=await this.instantiate(e.data[0],e.data[1]),this.sendOK(e)}catch(r){this._bindings=null,this.failWith(e,r)}return;default:break}if(!this._bindings)return this.failWith(e,new Error("duckdb is not initialized"));try{switch(e.type){case ae.GET_VERSION:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.VERSION_STRING,data:this._bindings.getVersion()},[]);break;case ae.GET_FEATURE_FLAGS:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.FEATURE_FLAGS,data:this._bindings.getFeatureFlags()},[]);break;case ae.RESET:this._bindings.reset(),this.sendOK(e);break;case ae.OPEN:this._bindings.open(e.data),this.sendOK(e);break;case ae.DROP_FILE:this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.SUCCESS,data:this._bindings.dropFile(e.data)},[]);break;case ae.DROP_FILES:this._bindings.dropFiles(),this.sendOK(e);break;case ae.FLUSH_FILES:this._bindings.flushFiles(),this.sendOK(e);break;case ae.CONNECT:{let r=this._bindings.connect();this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.CONNECTION_INFO,data:r.useUnsafe((n,i)=>i)},[]);break}case ae.DISCONNECT:this._bindings.disconnect(e.data),this.sendOK(e);break;case ae.CREATE_PREPARED:{let r=this._bindings.createPrepared(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.PREPARED_STATEMENT_ID,data:r},[]);break}case ae.CLOSE_PREPARED:{this._bindings.closePrepared(e.data[0],e.data[1]),this.sendOK(e);break}case ae.RUN_PREPARED:{let r=this._bindings.runPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.QUERY_RESULT,data:r},[r.buffer]);break}case ae.RUN_QUERY:{let r=this._bindings.runQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.QUERY_RESULT,data:r},[r.buffer]);break}case ae.SEND_PREPARED:{let r=this._bindings.sendPrepared(e.data[0],e.data[1],e.data[2]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.QUERY_START,data:r},[r.buffer]);break}case ae.SEND_QUERY:{let r=this._bindings.sendQuery(e.data[0],e.data[1]);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.QUERY_START,data:r},[r.buffer]);break}case ae.FETCH_QUERY_RESULTS:{let r=this._bindings.fetchQueryResults(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.QUERY_RESULT_CHUNK,data:r},[r.buffer]);break}case ae.REGISTER_FILE_URL:this._bindings.registerFileURL(e.data[0],e.data[1]),this.sendOK(e);break;case ae.REGISTER_FILE_BUFFER:this._bindings.registerFileBuffer(e.data[0],e.data[1]),this.sendOK(e);break;case ae.REGISTER_FILE_HANDLE:this._bindings.registerFileHandle(e.data[0],e.data[1]),this.sendOK(e);break;case ae.COPY_FILE_TO_PATH:this._bindings.copyFileToPath(e.data[0],e.data[1]),this.sendOK(e);break;case ae.COPY_FILE_TO_BUFFER:{let r=this._bindings.copyFileToBuffer(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.FILE_BUFFER,data:r},[]);break}case ae.COLLECT_FILE_STATISTICS:this._bindings.collectFileStatistics(e.data[0],e.data[1]),this.sendOK(e);break;case ae.EXPORT_FILE_STATISTICS:{this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.FILE_STATISTICS,data:this._bindings.exportFileStatistics(e.data)},[]);break}case ae.INSERT_ARROW_FROM_IPC_STREAM:{this._bindings.insertArrowFromIPCStream(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case ae.INSERT_CSV_FROM_PATH:{this._bindings.insertCSVFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case ae.INSERT_JSON_FROM_PATH:{this._bindings.insertJSONFromPath(e.data[0],e.data[1],e.data[2]),this.sendOK(e);break}case ae.TOKENIZE:{let r=this._bindings.tokenize(e.data);this.postMessage({messageId:this._nextMessageId++,requestId:e.messageId,type:Ve.SCRIPT_TOKENS,data:r},[]);break}}}catch(r){return this.failWith(e,r)}}};var Dd={},UA=function(){var t=Dd.url;return function(e){e=e||{};function r(){return Ae.buffer!=wt&&un(Ae.buffer),Yd}function n(){return Ae.buffer!=wt&&un(Ae.buffer),Gd}function i(){return Ae.buffer!=wt&&un(Ae.buffer),$d}function a(){return Ae.buffer!=wt&&un(Ae.buffer),Jd}function u(){return Ae.buffer!=wt&&un(Ae.buffer),Kd}var o=typeof e!="undefined"?e:{},p,s;o.ready=new Promise(function(c,d){p=c,s=d});var l={},g;for(g in o)o.hasOwnProperty(g)&&(l[g]=o[g]);var L=[],oe="./this.program",Je=function(c,d){throw d},Ht=typeof window=="object",nt=typeof importScripts=="function",x=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",N=o.ENVIRONMENT_IS_PTHREAD||!1,pt="";function Vd(c){return o.locateFile?o.locateFile(c,pt):pt+c}var Mi,Xo,Pi,i_;function s_(c){if(!(c instanceof qi)){var d=c;ke("exiting due to exception: "+d)}}var gt,vt;if(x){nt?pt=Ri().dirname(pt)+"/":pt=__dirname+"/",Mi=function(d,y){return gt||(gt=Ps()),vt||(vt=Ri()),d=vt.normalize(d),gt.readFileSync(d,y?null:"utf8")},Pi=function(d){var y=Mi(d,!0);return y.buffer||(y=new Uint8Array(y)),ks(y.buffer),y},Xo=function(d,y,m){gt||(gt=Ps()),vt||(vt=Ri()),d=vt.normalize(d),gt.readFile(d,function(w,I){w?m(w):y(I.buffer)})},process.argv.length>1&&(oe=process.argv[1].replace(/\\/g,"/")),L=process.argv.slice(2),process.on("uncaughtException",function(c){if(!(c instanceof qi))throw c}),process.on("unhandledRejection",function(c){throw c}),Je=function(c,d){if(Ni())throw process.exitCode=c,d;s_(d),process.exit(c)},o.inspect=function(){return"[Emscripten Module object]"};var kd;try{kd=Jb()}catch(c){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),c}global.Worker=kd.Worker}else(Ht||nt)&&(nt?pt=self.location.href:typeof document!="undefined"&&document.currentScript&&(pt=document.currentScript.src),t&&(pt=t),pt.indexOf("blob:")!==0?pt=pt.substr(0,pt.replace(/[?#].*/,"").lastIndexOf("/")+1):pt="",x?(Mi=function(d,y){return gt||(gt=Ps()),vt||(vt=Ri()),d=vt.normalize(d),gt.readFileSync(d,y?null:"utf8")},Pi=function(d){var y=Mi(d,!0);return y.buffer||(y=new Uint8Array(y)),ks(y.buffer),y},Xo=function(d,y,m){gt||(gt=Ps()),vt||(vt=Ri()),d=vt.normalize(d),gt.readFile(d,function(w,I){w?m(w):y(I.buffer)})}):(Mi=function(c){var d=new XMLHttpRequest;return d.open("GET",c,!1),d.send(null),d.responseText},nt&&(Pi=function(c){var d=new XMLHttpRequest;return d.open("GET",c,!1),d.responseType="arraybuffer",d.send(null),new Uint8Array(d.response)}),Xo=function(c,d,y){var m=new XMLHttpRequest;m.open("GET",c,!0),m.responseType="arraybuffer",m.onload=function(){if(m.status==200||m.status==0&&m.response){d(m.response);return}y()},m.onerror=y,m.send(null)}),i_=function(c){document.title=c});x&&typeof performance=="undefined"&&(global.performance=Kb().performance);var P=o.print||console.log.bind(console),ke=o.printErr||console.warn.bind(console);for(g in l)l.hasOwnProperty(g)&&(o[g]=l[g]);l=null,o.arguments&&(L=o.arguments),o.thisProgram&&(oe=o.thisProgram),o.quit&&(Je=o.quit);function Vi(c){Vi.shown||(Vi.shown={}),Vi.shown[c]||(Vi.shown[c]=1,ke(c))}var NA=Atomics.load,LA=Atomics.store,xA=Atomics.compareExchange,ki;o.wasmBinary&&(ki=o.wasmBinary);var Nd=o.noExitRuntime||!0;typeof WebAssembly!="object"&&Gt("no native wasm support detected");var Ae,Ld,Vs=!1,on;function ks(c,d){c||Gt("Assertion failed: "+d)}function a_(c){var d=o["_"+c];return ks(d,"Cannot call unknown function "+c+", make sure it is exported"),d}function o_(c,d,y,m,w){var I={string:function(Ne){var mr=0;if(Ne!=null&&Ne!==0){var zi=(Ne.length<<2)+1;mr=Fn(zi),Wd(Ne,mr,zi)}return mr},array:function(Ne){var mr=Fn(Ne.length);return Hd(Ne,mr),mr}};function O(Ne){return d==="string"?Yt(Ne):d==="boolean"?Boolean(Ne):Ne}var V=a_(c),ue=[],Ke=0;if(m)for(var it=0;it<m.length;it++){var Wi=I[y[it]];Wi?(Ke===0&&(Ke=ji()),ue[it]=Wi(m[it])):ue[it]=m[it]}var ot=V.apply(null,ue);function $t(Ne){return Ke!==0&&Dn(Ke),O(Ne)}return ot=$t(ot),ot}function xd(c){var d=new TextDecoder(c);this.decode=function(y){return y.buffer instanceof SharedArrayBuffer&&(y=new Uint8Array(y)),d.decode.call(d,y)}}var Cd=typeof TextDecoder!="undefined"?new xd("utf8"):void 0;function jd(c,d,y){for(var m=d+y,w=d;c[w]&&!(w>=m);)++w;if(w-d>16&&c.subarray&&Cd)return Cd.decode(c.subarray(d,w));for(var I="";d<w;){var O=c[d++];if(!(O&128)){I+=String.fromCharCode(O);continue}var V=c[d++]&63;if((O&224)==192){I+=String.fromCharCode((O&31)<<6|V);continue}var ue=c[d++]&63;if((O&240)==224?O=(O&15)<<12|V<<6|ue:O=(O&7)<<18|V<<12|ue<<6|c[d++]&63,O<65536)I+=String.fromCharCode(O);else{var Ke=O-65536;I+=String.fromCharCode(55296|Ke>>10,56320|Ke&1023)}}return I}function Yt(c,d){return c?jd(n(),c,d):""}function qd(c,d,y,m){if(!(m>0))return 0;for(var w=y,I=y+m-1,O=0;O<c.length;++O){var V=c.charCodeAt(O);if(V>=55296&&V<=57343){var ue=c.charCodeAt(++O);V=65536+((V&1023)<<10)|ue&1023}if(V<=127){if(y>=I)break;d[y++]=V}else if(V<=2047){if(y+1>=I)break;d[y++]=192|V>>6,d[y++]=128|V&63}else if(V<=65535){if(y+2>=I)break;d[y++]=224|V>>12,d[y++]=128|V>>6&63,d[y++]=128|V&63}else{if(y+3>=I)break;d[y++]=240|V>>18,d[y++]=128|V>>12&63,d[y++]=128|V>>6&63,d[y++]=128|V&63}}return d[y]=0,y-w}function Wd(c,d,y){return qd(c,n(),d,y)}function zd(c){for(var d=0,y=0;y<c.length;++y){var m=c.charCodeAt(y);m>=55296&&m<=57343&&(m=65536+((m&1023)<<10)|c.charCodeAt(++y)&1023),m<=127?++d:m<=2047?d+=2:m<=65535?d+=3:d+=4}return d}var CA=typeof TextDecoder!="undefined"?new xd("utf-16le"):void 0;function Hd(c,d){r().set(c,d)}function u_(c,d,y){for(var m=0;m<c.length;++m)r()[d++>>0]=c.charCodeAt(m);y||(r()[d>>0]=0)}function c_(c,d){return c%d>0&&(c+=d-c%d),c}var wt,Yd,Gd,l_,d_,$d,Jd,f_,Kd;N&&(wt=o.buffer);function un(c){wt=c,o.HEAP8=Yd=new Int8Array(c),o.HEAP16=l_=new Int16Array(c),o.HEAP32=$d=new Int32Array(c),o.HEAPU8=Gd=new Uint8Array(c),o.HEAPU16=d_=new Uint16Array(c),o.HEAPU32=Jd=new Uint32Array(c),o.HEAPF32=f_=new Float32Array(c),o.HEAPF64=Kd=new Float64Array(c)}var Qd=o.INITIAL_MEMORY||16777216;if(N)Ae=o.wasmMemory,wt=o.buffer;else if(o.wasmMemory)Ae=o.wasmMemory;else if(Ae=new WebAssembly.Memory({initial:Qd/65536,maximum:2147483648/65536,shared:!0}),!(Ae.buffer instanceof SharedArrayBuffer))throw ke("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"),x&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Ae&&(wt=Ae.buffer),Qd=wt.byteLength,un(wt);var An,Xd=[],Zd=[],h_=[],p_=[],ef=[],y_=!1,m_=!1,Zo=0;function Ni(){return Nd||Zo>0}function b_(){if(!N){if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)w_(o.preRun.shift());Ns(Xd)}}function tf(){y_=!0,!N&&Ns(Zd)}function __(){N||Ns(h_)}function g_(){N||(k.terminateAllThreads(),m_=!0)}function v_(){if(!N){if(o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;)B_(o.postRun.shift());Ns(ef)}}function w_(c){Xd.unshift(c)}function T_(c){Zd.unshift(c)}function B_(c){ef.unshift(c)}var cn=0,eu=null,Li=null;function I_(c){cn++,o.monitorRunDependencies&&o.monitorRunDependencies(cn)}function S_(c){if(cn--,o.monitorRunDependencies&&o.monitorRunDependencies(cn),cn==0&&(eu!==null&&(clearInterval(eu),eu=null),Li)){var d=Li;Li=null,d()}}o.preloadedImages={},o.preloadedAudios={};function Gt(c){N?postMessage({cmd:"onAbort",arg:c}):o.onAbort&&o.onAbort(c),c="Aborted("+c+")",ke(c),Vs=!0,on=1,c+=". Build with -s ASSERTIONS=1 for more info.";var d=new WebAssembly.RuntimeError(c);throw s(d),d}var O_="data:application/octet-stream;base64,";function rf(c){return c.startsWith(O_)}var Tt;o.locateFile?(Tt="duckdb_wasm.wasm",rf(Tt)||(Tt=Vd(Tt))):Tt=new URL("duckdb_wasm.wasm",Dd.url).toString();function nf(c){try{if(c==Tt&&ki)return new Uint8Array(ki);if(Pi)return Pi(c);throw"both async and sync fetching of the wasm failed"}catch(d){Gt(d)}}function A_(){return!ki&&(Ht||nt)&&typeof fetch=="function"?fetch(Tt,{credentials:"same-origin"}).then(function(c){if(!c.ok)throw"failed to load wasm binary file at '"+Tt+"'";return c.arrayBuffer()}).catch(function(){return nf(Tt)}):Promise.resolve().then(function(){return nf(Tt)})}function D_(){var c={a:$g};function d(O,V){var ue=O.exports;if(o.asm=ue,P_(o.asm._a),An=o.asm.ta,T_(o.asm.ra),Ld=V,!N){var Ke=k.unusedWorkers.length;k.unusedWorkers.forEach(function(it){k.loadWasmModuleToWorker(it,function(){--Ke||S_("wasm-instantiate")})})}}N||I_("wasm-instantiate");function y(O){d(O.instance,O.module)}function m(O){return A_().then(function(V){return WebAssembly.instantiate(V,c)}).then(function(V){return V}).then(O,function(V){ke("failed to asynchronously prepare wasm: "+V),Gt(V)})}function w(){return!ki&&typeof WebAssembly.instantiateStreaming=="function"&&!rf(Tt)&&typeof fetch=="function"?fetch(Tt,{credentials:"same-origin"}).then(function(O){var V=WebAssembly.instantiateStreaming(O,c);return V.then(y,function(ue){return ke("wasm streaming compile failed: "+ue),ke("falling back to ArrayBuffer instantiation"),m(y)})}):m(y)}if(o.instantiateWasm)try{var I=o.instantiateWasm(c,d);return I}catch(O){return ke("Module.instantiateWasm callback failed with error: "+O),!1}return w().catch(s),{}}var F_={};function Ns(c){for(;c.length>0;){var d=c.shift();if(typeof d=="function"){d(o);continue}var y=d.func;typeof y=="number"?d.arg===void 0?An.get(y)():An.get(y)(d.arg):y(d.arg===void 0?null:d.arg)}}function sf(c,d){if(c<=0||c>r().length||c&!0||d<0)return-28;if(d==0)return 0;d>=2147483647&&(d=1/0);var y=Atomics.load(i(),En>>2),m=0;if(y==c){var w=Atomics.compareExchange(i(),En>>2,y,0);if(w==y&&(--d,m=1,d<=0))return 1}var I=Atomics.notify(i(),c>>2,d);if(I>=0)return I+m;throw"Atomics.notify returned an unexpected value "+I}o._emscripten_futex_wake=sf;function E_(c){i()[c+8>>2]=0;var d=k.pthreads[c];delete k.pthreads[c],d.worker.terminate(),of(d),k.runningWorkers.splice(k.runningWorkers.indexOf(d.worker),1),d.worker.pthread=void 0}function R_(c){var d=k.pthreads[c];d.worker.postMessage({cmd:"cancel"})}function af(c){var d=k.pthreads[c];if(d){i()[c+8>>2]=0;var y=d.worker;k.returnWorkerToPool(y)}}function of(c){!c||(c.threadInfoStruct&&Gs(c.threadInfoStruct),c.threadInfoStruct=0,c.allocatedOwnStack&&c.stackBase&&Gs(c.stackBase),c.stackBase=0,c.worker&&(c.worker.pthread=null))}function Ls(c){$f(c)}o._exit=Ls;function xs(c){if(c instanceof qi||c=="unwind")return on;Je(1,c)}var k={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){for(var c=4,d=0;d<c;++d)k.allocateUnusedWorker()},initWorker:function(){},pthreads:{},threadExitHandlers:[],setExitStatus:function(c){on=c},terminateAllThreads:function(){for(var c in k.pthreads){var d=k.pthreads[c];d&&d.worker&&k.returnWorkerToPool(d.worker)}for(var y=0;y<k.unusedWorkers.length;++y){var m=k.unusedWorkers[y];m.terminate()}k.unusedWorkers=[]},returnWorkerToPool:function(c){k.runWithoutMainThreadQueuedCalls(function(){delete k.pthreads[c.pthread.threadInfoStruct],k.unusedWorkers.push(c),k.runningWorkers.splice(k.runningWorkers.indexOf(c),1),of(c.pthread),c.pthread=void 0})},runWithoutMainThreadQueuedCalls:function(c){i()[Gf>>2]=0;try{c()}finally{i()[Gf>>2]=1}},receiveObjectTransfer:function(c){},threadInit:function(){for(var c in k.tlsInitFunctions)k.tlsInitFunctions[c]()},loadWasmModuleToWorker:function(c,d){c.onmessage=function(y){var m=y.data,w=m.cmd;if(c.pthread&&(k.currentProxiedOperationCallerThread=c.pthread.threadInfoStruct),m.targetThread&&m.targetThread!=Ys()){var I=k.pthreads[m.targetThread];I?I.worker.postMessage(m,m.transferList):ke('Internal error! Worker sent a message "'+w+'" to target pthread '+m.targetThread+", but that thread no longer exists!"),k.currentProxiedOperationCallerThread=void 0;return}w==="processQueuedMainThreadWork"?Hs():w==="spawnThread"?lf(m):w==="cleanupThread"?af(m.thread):w==="killThread"?E_(m.thread):w==="cancelThread"?R_(m.thread):w==="loaded"?(c.loaded=!0,d&&d(c),c.runPthread&&(c.runPthread(),delete c.runPthread)):w==="print"?P("Thread "+m.threadId+": "+m.text):w==="printErr"?ke("Thread "+m.threadId+": "+m.text):w==="alert"?alert("Thread "+m.threadId+": "+m.text):w==="detachedExit"||w==="cancelDone"?k.returnWorkerToPool(c):m.target==="setimmediate"?c.postMessage(m):w==="onAbort"?o.onAbort&&o.onAbort(m.arg):ke("worker sent an unknown command "+w),k.currentProxiedOperationCallerThread=void 0},c.onerror=function(y){throw ke("pthread sent an error! "+y.filename+":"+y.lineno+": "+y.message),y},x&&(c.on("message",function(y){c.onmessage({data:y})}),c.on("error",function(y){c.onerror(y)}),c.on("detachedExit",function(){})),c.postMessage({cmd:"load",urlOrBlob:o.mainScriptUrlOrBlob,wasmMemory:Ae,wasmModule:Ld})},allocateUnusedWorker:function(){if(!o.locateFile){k.unusedWorkers.push(new Worker(new URL("duckdb_wasm.worker.js",Dd.url)));return}var c=Vd("duckdb_wasm.worker.js");k.unusedWorkers.push(new Worker(c))},getNewWorker:function(){return k.unusedWorkers.length==0&&(k.allocateUnusedWorker(),k.loadWasmModuleToWorker(k.unusedWorkers[0])),k.unusedWorkers.pop()}};function U_(c,d){Hf(c,d),Dn(c)}o.establishStackSpace=U_;function uf(c){if(N)return me(1,0,c);try{Ls(c)}catch(d){xs(d)}}function M_(c,d){return An.get(c)(d)}o.invokeEntryPoint=M_;function P_(c,d,y){k.tlsInitFunctions.push(c)}function V_(c,d,y,m){Gt("Assertion failed: "+Yt(c)+", at: "+[d?Yt(d):"unknown filename",y,m?Yt(m):"unknown function"])}var xi;x?xi=function(){var c=process.hrtime();return c[0]*1e3+c[1]/1e6}:N?xi=function(){return performance.now()-o.__performance_now_clock_drift}:xi=function(){return performance.now()};var k_=!0;function N_(c){return i()[zf()>>2]=c,c}function cf(c,d){var y;if(c===0)y=Date.now();else if((c===1||c===4)&&k_)y=xi();else return N_(28),-1;return i()[d>>2]=y/1e3|0,i()[d+4>>2]=y%1e3*1e3*1e3|0,0}function L_(c,d){return cf(c,d)}function x_(c,d){if(N)return me(2,1,c,d)}function C_(c,d){k.threadExitHandlers.push(function(){An.get(c)(d)})}function j_(c){Wf(c,!nt,1),k.threadInit()}function lf(c){var d=k.getNewWorker();if(!d)return 6;k.runningWorkers.push(d);var y=c.stackBase+c.stackSize,m=k.pthreads[c.pthread_ptr]={worker:d,stackBase:c.stackBase,stackSize:c.stackSize,allocatedOwnStack:c.allocatedOwnStack,threadInfoStruct:c.pthread_ptr},w=m.threadInfoStruct>>2;Atomics.store(a(),w+(60>>2),c.detached),Atomics.store(a(),w+(76>>2),c.stackSize),Atomics.store(a(),w+(72>>2),y),Atomics.store(a(),w+(100>>2),c.stackSize),Atomics.store(a(),w+(100+8>>2),y),Atomics.store(a(),w+(100+12>>2),c.detached),d.pthread=m;var I={cmd:"run",start_routine:c.startRoutine,arg:c.arg,threadInfoStruct:c.pthread_ptr,stackBase:c.stackBase,stackSize:c.stackSize};return d.runPthread=function(){I.time=performance.now(),d.postMessage(I,c.transferList)},d.loaded&&(d.runPthread(),delete d.runPthread),0}function q_(c,d,y,m){if(typeof SharedArrayBuffer=="undefined")return ke("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var w=[],I=0;if(N&&(w.length===0||I))return xf(687865856,c,d,y,m);if(I)return I;var O=0,V=0,ue=0;d&&d!=-1?(O=i()[d>>2],O+=2097152,V=i()[d+8>>2],ue=i()[d+12>>2]!==0):O=2097152;var Ke=V==0;Ke?V=Yf(16,O):(V-=O,ks(V>0));var it={stackBase:V,stackSize:O,allocatedOwnStack:Ke,detached:ue,startRoutine:y,pthread_ptr:c,arg:m,transferList:w};return N?(it.cmd="spawnThread",postMessage(it,w),0):lf(it)}function W_(){postMessage({cmd:"detachedExit"})}function z_(c){for(;k.threadExitHandlers.length>0;)k.threadExitHandlers.pop()()}function df(c,d,y){if(c<=0||c>r().length||c&!0)return-28;if(Ht){if(Atomics.load(i(),c>>2)!=d)return-6;for(var w=performance.now(),I=w+y,O=Atomics.exchange(i(),En>>2,c);;){if(w=performance.now(),w>I)return O=Atomics.exchange(i(),En>>2,0),-73;if(O=Atomics.exchange(i(),En>>2,0),O==0)break;if(Hs(),Atomics.load(i(),c>>2)!=d)return-6;O=Atomics.exchange(i(),En>>2,c)}return 0}else{var m=Atomics.wait(i(),c>>2,d,y);if(m==="timed-out")return-73;if(m==="not-equal")return-6;if(m==="ok")return 0;throw"Atomics.wait returned an unexpected value "+m}}function ff(){x||nt||Vi("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function H_(c,d,y){if(!c)return ke("pthread_join attempted on a null thread pointer!"),71;if(N&&Ys()==c)return ke("PThread "+c+" is attempting to join to itself!"),16;if(!N&&Lf()==c)return ke("Main thread "+c+" is attempting to join to itself!"),16;var m=i()[c+8>>2];if(m!==c)return ke("pthread_join attempted on thread "+c+", which does not point to a valid thread, or does not exist anymore!"),71;var w=Atomics.load(a(),c+60>>2);if(w)return ke("Attempted to join thread "+c+", which was already detached!"),28;for(y&&ff();;){var I=Atomics.load(a(),c+0>>2);if(I==1){if(d){var O=Atomics.load(a(),c+88>>2);i()[d>>2]=O}return Atomics.store(a(),c+60>>2,1),N?postMessage({cmd:"cleanupThread",thread:c}):af(c),0}if(!y)return 10;qf(),N||Hs(),df(c+0,I,N?100:1)}}function Y_(c,d){return H_(c,d,!0)}var ze={mappings:{},buffers:[null,[],[]],printChar:function(c,d){var y=ze.buffers[c];d===0||d===10?((c===1?P:ke)(jd(y,0)),y.length=0):y.push(d)},varargs:void 0,get:function(){ze.varargs+=4;var c=i()[ze.varargs-4>>2];return c},getStr:function(c){var d=Yt(c);return d},get64:function(c,d){return c}};function hf(c,d){return N?me(3,1,c,d):(c=ze.getStr(c),ze.doAccess(c,d))}function pf(c,d,y){return N?me(4,1,c,d,y):(ze.varargs=y,0)}function yf(c,d){if(N)return me(5,1,c,d)}function mf(c,d,y,m){if(N)return me(6,1,c,d,y,m)}function bf(c,d,y){if(N)return me(7,1,c,d,y)}function G_(){return 42}function _f(c,d,y){return N?me(8,1,c,d,y):(ze.varargs=y,0)}function $_(c,d,y){return 0}function gf(c,d){return N?me(9,1,c,d):(c=ze.getStr(c),ze.doMkdir(c,d))}function vf(c,d,y){if(N)return me(10,1,c,d,y);ze.varargs=y}function wf(c,d){if(N)return me(11,1,c,d)}function Tf(c){if(N)return me(12,1,c)}function Bf(c,d){if(N)return me(13,1,c,d)}function If(c){if(N)return me(14,1,c)}function J_(c,d){Gt("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function K_(c,d){Gt("To use dlopen, you need to use Emscripten's linking support, see https://github.com/emscripten-core/emscripten/wiki/Linking")}function Q_(c,d){if(c==d)postMessage({cmd:"processQueuedMainThreadWork"});else if(N)postMessage({targetThread:c,cmd:"processThreadQueue"});else{var y=k.pthreads[c],m=y&&y.worker;if(!m)return;m.postMessage({cmd:"processThreadQueue"})}return 1}function X_(){Gt("")}function Z_(c,d){return globalThis.DUCKDB_RUNTIME.createDirectory(o,c,d)}function eg(c,d){return globalThis.DUCKDB_RUNTIME.checkDirectory(o,c,d)}function tg(c,d){return globalThis.DUCKDB_RUNTIME.listDirectoryEntries(o,c,d)}function rg(c,d){return globalThis.DUCKDB_RUNTIME.removeDirectory(o,c,d)}function ng(c){return globalThis.DUCKDB_RUNTIME.closeFile(o,c)}function ig(c,d){return globalThis.DUCKDB_RUNTIME.checkFile(o,c,d)}function sg(c){return globalThis.DUCKDB_RUNTIME.getLastFileModificationTime(o,c)}function ag(c){return globalThis.DUCKDB_RUNTIME.getFileSize(o,c)}function og(c,d,y,m){return globalThis.DUCKDB_RUNTIME.moveFile(o,c,d,y,m)}function ug(c){return globalThis.DUCKDB_RUNTIME.openFile(o,c)}function cg(c,d,y,m){return globalThis.DUCKDB_RUNTIME.readFile(o,c,d,y,m)}function lg(c,d){return globalThis.DUCKDB_RUNTIME.truncateFile(o,c,d)}function dg(c,d,y,m){return globalThis.DUCKDB_RUNTIME.writeFile(o,c,d,y,m)}function fg(c,d){return globalThis.DUCKDB_RUNTIME.glob(o,c,d)}function hg(c){return globalThis.DUCKDB_RUNTIME.testPlatformFeature(o,c)}function pg(c,d){}function yg(){return 2147483648}function mg(c,d,y){n().copyWithin(c,d,d+y)}function bg(){return x?Qb().cpus().length:navigator.hardwareConcurrency}function me(c,d){for(var y=arguments.length-2,m=ji(),w=y,I=Fn(w*8),O=I>>3,V=0;V<y;V++){var ue=arguments[2+V];u()[O+V]=ue}var Ke=Cf(c,w,I,d);return Dn(m),Ke}var tu=[];function _g(c,d,y){tu.length=d;for(var m=y>>3,w=0;w<d;w++)tu[w]=u()[m+w];var I=c<0,O=I?F_[-c-1]:Yg[c];return O.apply(null,tu)}function gg(c){try{return Ae.grow(c-wt.byteLength+65535>>>16),un(Ae.buffer),1}catch{}}function vg(c){var d=n().length;if(c=c>>>0,c<=d)return!1;var y=2147483648;if(c>y)return!1;for(var m=1;m<=4;m*=2){var w=d*(1+.2/m);w=Math.min(w,c+100663296);var I=Math.min(y,c_(Math.max(c,w),65536)),O=gg(I);if(O)return!0}return!1}var ee={inEventHandler:0,removeAllEventListeners:function(){for(var c=ee.eventHandlers.length-1;c>=0;--c)ee._removeHandler(c);ee.eventHandlers=[],ee.deferredCalls=[]},registerRemoveEventListeners:function(){ee.removeEventListenersRegistered||(p_.push(ee.removeAllEventListeners),ee.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(c,d,y){function m(O,V){if(O.length!=V.length)return!1;for(var ue in O)if(O[ue]!=V[ue])return!1;return!0}for(var w in ee.deferredCalls){var I=ee.deferredCalls[w];if(I.targetFunction==c&&m(I.argsList,y))return}ee.deferredCalls.push({targetFunction:c,precedence:d,argsList:y}),ee.deferredCalls.sort(function(O,V){return O.precedence<V.precedence})},removeDeferredCalls:function(c){for(var d=0;d<ee.deferredCalls.length;++d)ee.deferredCalls[d].targetFunction==c&&(ee.deferredCalls.splice(d,1),--d)},canPerformEventHandlerRequests:function(){return ee.inEventHandler&&ee.currentEventHandler.allowsDeferredCalls},runDeferredCalls:function(){if(!!ee.canPerformEventHandlerRequests())for(var c=0;c<ee.deferredCalls.length;++c){var d=ee.deferredCalls[c];ee.deferredCalls.splice(c,1),--c,d.targetFunction.apply(null,d.argsList)}},eventHandlers:[],removeAllHandlersOnTarget:function(c,d){for(var y=0;y<ee.eventHandlers.length;++y)ee.eventHandlers[y].target==c&&(!d||d==ee.eventHandlers[y].eventTypeString)&&ee._removeHandler(y--)},_removeHandler:function(c){var d=ee.eventHandlers[c];d.target.removeEventListener(d.eventTypeString,d.eventListenerFunc,d.useCapture),ee.eventHandlers.splice(c,1)},registerOrRemoveHandler:function(c){var d=function(w){++ee.inEventHandler,ee.currentEventHandler=c,ee.runDeferredCalls(),c.handlerFunc(w),ee.runDeferredCalls(),--ee.inEventHandler};if(c.callbackfunc)c.eventListenerFunc=d,c.target.addEventListener(c.eventTypeString,d,c.useCapture),ee.eventHandlers.push(c),ee.registerRemoveEventListeners();else for(var y=0;y<ee.eventHandlers.length;++y)ee.eventHandlers[y].target==c.target&&ee.eventHandlers[y].eventTypeString==c.eventTypeString&&ee._removeHandler(y--)},queueEventHandlerOnThread_iiii:function(c,d,y,m,w){var I=ji(),O=Fn(12);i()[O>>2]=y,i()[O+4>>2]=m,i()[O+8>>2]=w,su(0,c,637534208,d,m,O),Dn(I)},getTargetThreadForEventCallback:function(c){switch(c){case 1:return 0;case 2:return k.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 wg(c){var d=zd(c)+1,y=au(d);return Wd(c,y,d),y}function Tg(c,d,y,m){var w=ji(),I=Fn(12),O=0;d&&(O=wg(d)),i()[I>>2]=O,i()[I+4>>2]=y,i()[I+8>>2]=m,su(0,c,657457152,0,O,I),Dn(w)}function Bg(c,d,y,m){d=d?Yt(d):"",Tg(c,d,y,m)}function Ig(c){return c>2?Yt(c):c}var Sg=[0,typeof document!="undefined"?document:0,typeof window!="undefined"?window:0];function Og(c){c=Ig(c);var d=Sg[c]||(typeof document!="undefined"?document.querySelector(c):void 0);return d}function ru(c){return Og(c)}function Sf(c,d,y){var m=ru(c);if(!m)return-4;if(m.canvasSharedPtr&&(i()[m.canvasSharedPtr>>2]=d,i()[m.canvasSharedPtr+4>>2]=y),m.offscreenCanvas||!m.controlTransferredOffscreen){m.offscreenCanvas&&(m=m.offscreenCanvas);var w=!1;if(m.GLctxObject&&m.GLctxObject.GLctx){var I=m.GLctxObject.GLctx.getParameter(2978);w=I[0]===0&&I[1]===0&&I[2]===m.width&&I[3]===m.height}m.width=d,m.height=y,w&&m.GLctxObject.GLctx.viewport(0,0,d,y)}else if(m.canvasSharedPtr){var O=i()[m.canvasSharedPtr+8>>2];return Bg(O,c,d,y),1}else return-4;return 0}function Of(c,d,y){return N?me(15,1,c,d,y):Sf(c,d,y)}function Ag(c,d,y){var m=ru(c);return m?Sf(c,d,y):Of(c,d,y)}function Dg(c){}function Fg(){if(!Ni())try{N?jf(on):Ls(on)}catch(c){xs(c)}}function Eg(c,d){if(!Vs){if(d){c();return}try{c(),N&&Fg()}catch(y){xs(y)}}}function Rg(){Zo+=1}function Ug(){Zo-=1}function Mg(c,d,y){return Rg(),setTimeout(function(){Ug(),Eg(function(){An.get(c)(y)})},d)}function Pg(){throw"unwind"}function Vg(c){var d=c.getExtension("ANGLE_instanced_arrays");if(d)return c.vertexAttribDivisor=function(y,m){d.vertexAttribDivisorANGLE(y,m)},c.drawArraysInstanced=function(y,m,w,I){d.drawArraysInstancedANGLE(y,m,w,I)},c.drawElementsInstanced=function(y,m,w,I,O){d.drawElementsInstancedANGLE(y,m,w,I,O)},1}function kg(c){var d=c.getExtension("OES_vertex_array_object");if(d)return c.createVertexArray=function(){return d.createVertexArrayOES()},c.deleteVertexArray=function(y){d.deleteVertexArrayOES(y)},c.bindVertexArray=function(y){d.bindVertexArrayOES(y)},c.isVertexArray=function(y){return d.isVertexArrayOES(y)},1}function Ng(c){var d=c.getExtension("WEBGL_draw_buffers");if(d)return c.drawBuffers=function(y,m){d.drawBuffersWEBGL(y,m)},1}function Lg(c){return!!(c.multiDrawWebgl=c.getExtension("WEBGL_multi_draw"))}var Te={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function(d){Te.lastError||(Te.lastError=d)},getNewId:function(c){for(var d=Te.counter++,y=c.length;y<d;y++)c[y]=null;return d},getSource:function(c,d,y,m){for(var w="",I=0;I<d;++I){var O=m?i()[m+I*4>>2]:-1;w+=Yt(i()[y+I*4>>2],O<0?void 0:O)}return w},createContext:function(c,d){c.getContextSafariWebGL2Fixed||(c.getContextSafariWebGL2Fixed=c.getContext,c.getContext=function(w,I){var O=c.getContextSafariWebGL2Fixed(w,I);return w=="webgl"==O instanceof WebGLRenderingContext?O:null});var y=c.getContext("webgl",d);if(!y)return 0;var m=Te.registerContext(y,d);return m},registerContext:function(c,d){var y=au(8);i()[y+4>>2]=Ys();var m={handle:y,attributes:d,version:d.majorVersion,GLctx:c};return c.canvas&&(c.canvas.GLctxObject=m),Te.contexts[y]=m,(typeof d.enableExtensionsByDefault=="undefined"||d.enableExtensionsByDefault)&&Te.initExtensions(m),y},makeContextCurrent:function(c){return Te.currentContext=Te.contexts[c],o.ctx=Nf=Te.currentContext&&Te.currentContext.GLctx,!(c&&!Nf)},getContext:function(c){return Te.contexts[c]},deleteContext:function(c){Te.currentContext===Te.contexts[c]&&(Te.currentContext=null),typeof ee=="object"&&ee.removeAllHandlersOnTarget(Te.contexts[c].GLctx.canvas),Te.contexts[c]&&Te.contexts[c].GLctx.canvas&&(Te.contexts[c].GLctx.canvas.GLctxObject=void 0),Gs(Te.contexts[c].handle),Te.contexts[c]=null},initExtensions:function(c){if(c||(c=Te.currentContext),!c.initExtensionsDone){c.initExtensionsDone=!0;var d=c.GLctx;Vg(d),kg(d),Ng(d),d.disjointTimerQueryExt=d.getExtension("EXT_disjoint_timer_query"),Lg(d);var y=d.getSupportedExtensions()||[];y.forEach(function(m){!m.includes("lose_context")&&!m.includes("debug")&&d.getExtension(m)})}}},xg=["default","low-power","high-performance"];function Cg(c,d){var y=d>>2,m=i()[y+(24>>2)],w={alpha:!!i()[y+(0>>2)],depth:!!i()[y+(4>>2)],stencil:!!i()[y+(8>>2)],antialias:!!i()[y+(12>>2)],premultipliedAlpha:!!i()[y+(16>>2)],preserveDrawingBuffer:!!i()[y+(20>>2)],powerPreference:xg[m],failIfMajorPerformanceCaveat:!!i()[y+(28>>2)],majorVersion:i()[y+(32>>2)],minorVersion:i()[y+(36>>2)],enableExtensionsByDefault:i()[y+(40>>2)],explicitSwapControl:i()[y+(44>>2)],proxyContextToMainThread:i()[y+(48>>2)],renderViaOffscreenBackBuffer:i()[y+(52>>2)]},I=ru(c);if(!I||w.explicitSwapControl)return 0;var O=Te.createContext(I,w);return O}function jg(c,d){return Cg(c,d)}var nu={};function qg(){return oe||"./this.program"}function Ci(){if(!Ci.strings){var c=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",d={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:c,_:qg()};for(var y in nu)nu[y]===void 0?delete d[y]:d[y]=nu[y];var m=[];for(var y in d)m.push(y+"="+d[y]);Ci.strings=m}return Ci.strings}function Af(c,d){if(N)return me(16,1,c,d);var y=0;return Ci().forEach(function(m,w){var I=d+y;i()[c+w*4>>2]=I,u_(m,I),y+=m.length+1}),0}function Df(c,d){if(N)return me(17,1,c,d);var y=Ci();i()[c>>2]=y.length;var m=0;return y.forEach(function(w){m+=w.length+1}),i()[d>>2]=m,0}function Ff(c){return N?me(18,1,c):0}function Ef(c,d){if(N)return me(19,1,c,d);var y=c==1||c==2?2:Gt();return r()[d>>0]=y,0}function Rf(c,d,y,m,w,I){if(N)return me(20,1,c,d,y,m,w,I);var O=ze.getStreamFromFD(c),V=ze.doReadv(O,d,y,m);return i()[I>>2]=V,0}function Uf(c,d,y,m,w,I){if(N)return me(21,1,c,d,y,m,w,I);var O=ze.getStreamFromFD(c),V=ze.doWritev(O,d,y,m);return i()[I>>2]=V,0}function Mf(c,d,y,m){if(N)return me(22,1,c,d,y,m);var w=ze.getStreamFromFD(c),I=ze.doReadv(w,d,y);return i()[m>>2]=I,0}function Pf(c,d,y,m,w){if(N)return me(23,1,c,d,y,m,w)}function Vf(c){if(N)return me(24,1,c);var d=ze.getStreamFromFD(c);return d.stream_ops&&d.stream_ops.fsync?-d.stream_ops.fsync(d):0}function kf(c,d,y,m){if(N)return me(25,1,c,d,y,m);for(var w=0,I=0;I<y;I++){for(var O=i()[d+I*8>>2],V=i()[d+(I*8+4)>>2],ue=0;ue<V;ue++)ze.printChar(c,n()[O+ue]);w+=V}return i()[m>>2]=w,0}function Wg(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var c=new Uint8Array(1);return function(){return crypto.getRandomValues(c),c[0]}}else if(x)try{var d=Xb();return function(){return d.randomBytes(1)[0]}}catch{}return function(){Gt("randomDevice")}}function Cs(c,d){Cs.randomDevice||(Cs.randomDevice=Wg());for(var y=0;y<d;y++)r()[c+y>>0]=Cs.randomDevice();return 0}function js(c){return c%4==0&&(c%100!=0||c%400==0)}function iu(c,d){for(var y=0,m=0;m<=d;y+=c[m++]);return y}var qs=[31,29,31,30,31,30,31,31,30,31,30,31],Ws=[31,28,31,30,31,30,31,31,30,31,30,31];function zs(c,d){for(var y=new Date(c.getTime());d>0;){var m=js(y.getFullYear()),w=y.getMonth(),I=(m?qs:Ws)[w];if(d>I-y.getDate())d-=I-y.getDate()+1,y.setDate(1),w<11?y.setMonth(w+1):(y.setMonth(0),y.setFullYear(y.getFullYear()+1));else return y.setDate(y.getDate()+d),y}return y}function zg(c,d,y,m){var w=i()[m+40>>2],I={tm_sec:i()[m>>2],tm_min:i()[m+4>>2],tm_hour:i()[m+8>>2],tm_mday:i()[m+12>>2],tm_mon:i()[m+16>>2],tm_year:i()[m+20>>2],tm_wday:i()[m+24>>2],tm_yday:i()[m+28>>2],tm_isdst:i()[m+32>>2],tm_gmtoff:i()[m+36>>2],tm_zone:w?Yt(w):""},O=Yt(y),V={"%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 ue in V)O=O.replace(new RegExp(ue,"g"),V[ue]);var Ke=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],it=["January","February","March","April","May","June","July","August","September","October","November","December"];function Wi(D,C,Le){for(var he=typeof D=="number"?D.toString():D||"";he.length<C;)he=Le[0]+he;return he}function ot(D,C){return Wi(D,C,"0")}function $t(D,C){function Le(Jt){return Jt<0?-1:Jt>0?1:0}var he;return(he=Le(D.getFullYear()-C.getFullYear()))===0&&(he=Le(D.getMonth()-C.getMonth()))===0&&(he=Le(D.getDate()-C.getDate())),he}function Ne(D){switch(D.getDay()){case 0:return new Date(D.getFullYear()-1,11,29);case 1:return D;case 2:return new Date(D.getFullYear(),0,3);case 3:return new Date(D.getFullYear(),0,2);case 4:return new Date(D.getFullYear(),0,1);case 5:return new Date(D.getFullYear()-1,11,31);case 6:return new Date(D.getFullYear()-1,11,30)}}function mr(D){var C=zs(new Date(D.tm_year+1900,0,1),D.tm_yday),Le=new Date(C.getFullYear(),0,4),he=new Date(C.getFullYear()+1,0,4),Jt=Ne(Le),Dr=Ne(he);return $t(Jt,C)<=0?$t(Dr,C)<=0?C.getFullYear()+1:C.getFullYear():C.getFullYear()-1}var zi={"%a":function(D){return Ke[D.tm_wday].substring(0,3)},"%A":function(D){return Ke[D.tm_wday]},"%b":function(D){return it[D.tm_mon].substring(0,3)},"%B":function(D){return it[D.tm_mon]},"%C":function(D){var C=D.tm_year+1900;return ot(C/100|0,2)},"%d":function(D){return ot(D.tm_mday,2)},"%e":function(D){return Wi(D.tm_mday,2," ")},"%g":function(D){return mr(D).toString().substring(2)},"%G":function(D){return mr(D)},"%H":function(D){return ot(D.tm_hour,2)},"%I":function(D){var C=D.tm_hour;return C==0?C=12:C>12&&(C-=12),ot(C,2)},"%j":function(D){return ot(D.tm_mday+iu(js(D.tm_year+1900)?qs:Ws,D.tm_mon-1),3)},"%m":function(D){return ot(D.tm_mon+1,2)},"%M":function(D){return ot(D.tm_min,2)},"%n":function(){return`
|
|
18
|
-
`},"%p":function(D){return D.tm_hour>=0&&D.tm_hour<12?"AM":"PM"},"%S":function(D){return ot(D.tm_sec,2)},"%t":function(){return" "},"%u":function(D){return D.tm_wday||7},"%U":function(D){var C=new Date(D.tm_year+1900,0,1),Le=C.getDay()===0?C:zs(C,7-C.getDay()),he=new Date(D.tm_year+1900,D.tm_mon,D.tm_mday);if($t(Le,he)<0){var Jt=iu(js(he.getFullYear())?qs:Ws,he.getMonth()-1)-31,Dr=31-Le.getDate(),ln=Dr+Jt+he.getDate();return ot(Math.ceil(ln/7),2)}return $t(Le,C)===0?"01":"00"},"%V":function(D){var C=new Date(D.tm_year+1900,0,4),Le=new Date(D.tm_year+1901,0,4),he=Ne(C),Jt=Ne(Le),Dr=zs(new Date(D.tm_year+1900,0,1),D.tm_yday);if($t(Dr,he)<0)return"53";if($t(Jt,Dr)<=0)return"01";var ln;return he.getFullYear()<D.tm_year+1900?ln=D.tm_yday+32-he.getDate():ln=D.tm_yday+1-he.getDate(),ot(Math.ceil(ln/7),2)},"%w":function(D){return D.tm_wday},"%W":function(D){var C=new Date(D.tm_year,0,1),Le=C.getDay()===1?C:zs(C,C.getDay()===0?1:7-C.getDay()+1),he=new Date(D.tm_year+1900,D.tm_mon,D.tm_mday);if($t(Le,he)<0){var Jt=iu(js(he.getFullYear())?qs:Ws,he.getMonth()-1)-31,Dr=31-Le.getDate(),ln=Dr+Jt+he.getDate();return ot(Math.ceil(ln/7),2)}return $t(Le,C)===0?"01":"00"},"%y":function(D){return(D.tm_year+1900).toString().substring(2)},"%Y":function(D){return D.tm_year+1900},"%z":function(D){var C=D.tm_gmtoff,Le=C>=0;return C=Math.abs(C)/60,C=C/60*100+C%60,(Le?"+":"-")+String("0000"+C).slice(-4)},"%Z":function(D){return D.tm_zone},"%%":function(){return"%"}};for(var ue in zi)O.includes(ue)&&(O=O.replace(new RegExp(ue,"g"),zi[ue](I)));var uu=Gg(O,!1);return uu.length>d?0:(Hd(uu,c),uu.length-1)}function Hg(c,d,y,m){return zg(c,d,y,m)}N||k.initMainThreadBlock();var Nf,Yg=[null,uf,x_,hf,pf,yf,mf,bf,_f,gf,vf,wf,Tf,Bf,If,Of,Af,Df,Ff,Ef,Rf,Uf,Mf,Pf,Vf,kf];function Gg(c,d,y){var m=y>0?y:zd(c)+1,w=new Array(m),I=qd(c,w,0,w.length);return d&&(w.length=I),w}var $g={b:V_,qa:L_,fa:C_,ka:j_,v:q_,ja:W_,T:z_,ba:Y_,B:hf,i:pf,S:yf,R:mf,U:bf,q:G_,W:_f,Q:$_,V:gf,t:vf,z:wf,p:Tf,s:Bf,r:If,D:J_,C:K_,pa:Q_,e:X_,o:cf,J:Z_,K:eg,H:tg,I:rg,_:ng,F:ig,M:sg,N:ag,G:og,O:ug,h:cg,L:lg,m:dg,E:fg,l:hg,ca:ff,n:pg,d:df,c:sf,$:yg,g:xi,ea:mg,aa:bg,ma:_g,ga:vg,na:Ag,k:Dg,la:Mg,ha:Pg,oa:jg,Y:Af,Z:Df,ia:Ls,f:Ff,da:Ef,x:Rf,w:Uf,u:Mf,y:Pf,A:Vf,j:kf,P:Cs,a:Ae||o.wasmMemory,X:Hg},jA=D_(),Jg=o.___wasm_call_ctors=function(){return(Jg=o.___wasm_call_ctors=o.asm.ra).apply(null,arguments)},Kg=o._main=function(){return(Kg=o._main=o.asm.sa).apply(null,arguments)},Qg=o._duckdb_web_fs_glob_add_path=function(){return(Qg=o._duckdb_web_fs_glob_add_path=o.asm.ua).apply(null,arguments)},Xg=o._duckdb_web_clear_response=function(){return(Xg=o._duckdb_web_clear_response=o.asm.va).apply(null,arguments)},Zg=o._duckdb_web_fail_with=function(){return(Zg=o._duckdb_web_fail_with=o.asm.wa).apply(null,arguments)},ev=o._duckdb_web_reset=function(){return(ev=o._duckdb_web_reset=o.asm.xa).apply(null,arguments)},tv=o._duckdb_web_connect=function(){return(tv=o._duckdb_web_connect=o.asm.ya).apply(null,arguments)},rv=o._duckdb_web_disconnect=function(){return(rv=o._duckdb_web_disconnect=o.asm.za).apply(null,arguments)},nv=o._duckdb_web_flush_files=function(){return(nv=o._duckdb_web_flush_files=o.asm.Aa).apply(null,arguments)},iv=o._duckdb_web_flush_file=function(){return(iv=o._duckdb_web_flush_file=o.asm.Ba).apply(null,arguments)},sv=o._duckdb_web_open=function(){return(sv=o._duckdb_web_open=o.asm.Ca).apply(null,arguments)},av=o._duckdb_web_collect_file_stats=function(){return(av=o._duckdb_web_collect_file_stats=o.asm.Da).apply(null,arguments)},ov=o._duckdb_web_export_file_stats=function(){return(ov=o._duckdb_web_export_file_stats=o.asm.Ea).apply(null,arguments)},uv=o._duckdb_web_fs_drop_file=function(){return(uv=o._duckdb_web_fs_drop_file=o.asm.Fa).apply(null,arguments)},cv=o._duckdb_web_fs_drop_files=function(){return(cv=o._duckdb_web_fs_drop_files=o.asm.Ga).apply(null,arguments)},lv=o._duckdb_web_fs_get_file_info=function(){return(lv=o._duckdb_web_fs_get_file_info=o.asm.Ha).apply(null,arguments)},dv=o._duckdb_web_fs_set_file_descriptor=function(){return(dv=o._duckdb_web_fs_set_file_descriptor=o.asm.Ia).apply(null,arguments)},fv=o._duckdb_web_fs_register_file_url=function(){return(fv=o._duckdb_web_fs_register_file_url=o.asm.Ja).apply(null,arguments)},hv=o._duckdb_web_fs_register_file_buffer=function(){return(hv=o._duckdb_web_fs_register_file_buffer=o.asm.Ka).apply(null,arguments)},pv=o._duckdb_web_copy_file_to_buffer=function(){return(pv=o._duckdb_web_copy_file_to_buffer=o.asm.La).apply(null,arguments)},yv=o._duckdb_web_copy_file_to_path=function(){return(yv=o._duckdb_web_copy_file_to_path=o.asm.Ma).apply(null,arguments)},mv=o._duckdb_web_get_version=function(){return(mv=o._duckdb_web_get_version=o.asm.Na).apply(null,arguments)},bv=o._duckdb_web_get_feature_flags=function(){return(bv=o._duckdb_web_get_feature_flags=o.asm.Oa).apply(null,arguments)},_v=o._duckdb_web_tokenize=function(){return(_v=o._duckdb_web_tokenize=o.asm.Pa).apply(null,arguments)},gv=o._duckdb_web_prepared_create=function(){return(gv=o._duckdb_web_prepared_create=o.asm.Qa).apply(null,arguments)},vv=o._duckdb_web_prepared_close=function(){return(vv=o._duckdb_web_prepared_close=o.asm.Ra).apply(null,arguments)},wv=o._duckdb_web_prepared_run=function(){return(wv=o._duckdb_web_prepared_run=o.asm.Sa).apply(null,arguments)},Tv=o._duckdb_web_prepared_send=function(){return(Tv=o._duckdb_web_prepared_send=o.asm.Ta).apply(null,arguments)},Bv=o._duckdb_web_query_run=function(){return(Bv=o._duckdb_web_query_run=o.asm.Ua).apply(null,arguments)},Iv=o._duckdb_web_query_send=function(){return(Iv=o._duckdb_web_query_send=o.asm.Va).apply(null,arguments)},Sv=o._duckdb_web_query_fetch_results=function(){return(Sv=o._duckdb_web_query_fetch_results=o.asm.Wa).apply(null,arguments)},Ov=o._duckdb_web_insert_arrow_from_ipc_stream=function(){return(Ov=o._duckdb_web_insert_arrow_from_ipc_stream=o.asm.Xa).apply(null,arguments)},Av=o._duckdb_web_insert_csv_from_path=function(){return(Av=o._duckdb_web_insert_csv_from_path=o.asm.Ya).apply(null,arguments)},Dv=o._duckdb_web_insert_json_from_path=function(){return(Dv=o._duckdb_web_insert_json_from_path=o.asm.Za).apply(null,arguments)},Fv=o._emscripten_tls_init=function(){return(Fv=o._emscripten_tls_init=o.asm._a).apply(null,arguments)},Ev=o._emscripten_current_thread_process_queued_calls=function(){return(Ev=o._emscripten_current_thread_process_queued_calls=o.asm.$a).apply(null,arguments)},Lf=o._emscripten_main_browser_thread_id=function(){return(Lf=o._emscripten_main_browser_thread_id=o.asm.ab).apply(null,arguments)},xf=o._emscripten_sync_run_in_main_thread_4=function(){return(xf=o._emscripten_sync_run_in_main_thread_4=o.asm.bb).apply(null,arguments)},Hs=o._emscripten_main_thread_process_queued_calls=function(){return(Hs=o._emscripten_main_thread_process_queued_calls=o.asm.cb).apply(null,arguments)},Cf=o._emscripten_run_in_main_runtime_thread_js=function(){return(Cf=o._emscripten_run_in_main_runtime_thread_js=o.asm.db).apply(null,arguments)},su=o.__emscripten_call_on_thread=function(){return(su=o.__emscripten_call_on_thread=o.asm.eb).apply(null,arguments)},jf=o.__emscripten_thread_exit=function(){return(jf=o.__emscripten_thread_exit=o.asm.fb).apply(null,arguments)},qf=o._pthread_testcancel=function(){return(qf=o._pthread_testcancel=o.asm.gb).apply(null,arguments)},Wf=o.__emscripten_thread_init=function(){return(Wf=o.__emscripten_thread_init=o.asm.hb).apply(null,arguments)},zf=o.___errno_location=function(){return(zf=o.___errno_location=o.asm.ib).apply(null,arguments)},Ys=o._pthread_self=function(){return(Ys=o._pthread_self=o.asm.jb).apply(null,arguments)},ji=o.stackSave=function(){return(ji=o.stackSave=o.asm.kb).apply(null,arguments)},Dn=o.stackRestore=function(){return(Dn=o.stackRestore=o.asm.lb).apply(null,arguments)},Fn=o.stackAlloc=function(){return(Fn=o.stackAlloc=o.asm.mb).apply(null,arguments)},Hf=o._emscripten_stack_set_limits=function(){return(Hf=o._emscripten_stack_set_limits=o.asm.nb).apply(null,arguments)},au=o._malloc=function(){return(au=o._malloc=o.asm.ob).apply(null,arguments)},Gs=o._free=function(){return(Gs=o._free=o.asm.pb).apply(null,arguments)},Yf=o._memalign=function(){return(Yf=o._memalign=o.asm.qb).apply(null,arguments)},Gf=o.__emscripten_allow_main_runtime_queued_calls=938608,En=o.__emscripten_main_thread_futex=1037648;o.ccall=o_,o.keepRuntimeAlive=Ni,o.PThread=k,o.PThread=k,o.wasmMemory=Ae,o.ExitStatus=qi;var $s;function qi(c){this.name="ExitStatus",this.message="Program terminated with exit("+c+")",this.status=c}var Rv=!1;Li=function c(){$s||ou(),$s||(Li=c)};function Uv(c){var d=o._main,y=0,m=0;try{var w=d(y,m);return $f(w,!0),w}catch(I){return xs(I)}finally{Rv=!0}}function ou(c){if(c=c||L,cn>0)return;if(N){p(o),tf(),postMessage({cmd:"loaded"});return}if(b_(),cn>0)return;function d(){$s||($s=!0,o.calledRun=!0,!Vs&&(tf(),__(),p(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),Jf&&Uv(c),v_()))}o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),d()},1)):d()}o.run=ou;function $f(c,d){if(on=c,!d&&N)throw uf(c),"unwind";Ni()||g_(),Mv(c)}function Mv(c){on=c,Ni()||(k.terminateAllThreads(),o.onExit&&o.onExit(c),Vs=!0),Je(c,new qi(c))}if(o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();var Jf=!0;return o.noInitialRun&&(Jf=!1),N&&(Nd=!1,k.initWorker()),ou(),e.ready}}(),Zb=UA;var zt=Ks(Ms());var Fd=class{constructor(e,r){this._bindings=e,this._conn=r}close(){this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}query(e){let r=this._bindings.runQuery(this._conn,e),n=zt.RecordBatchReader.from(r);return console.assert(n.isSync()),console.assert(n.isFile()),zt.Table.from(n)}send(e){let r=this._bindings.sendQuery(this._conn,e),n=new Ed(this._bindings,this._conn,r),i=zt.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}prepare(e){let r=this._bindings.createPrepared(this._conn,e);return new e_(this._bindings,this._conn,r)}insertArrowVectors(e,r){this.insertArrowTable(zt.Table.new(e),r)}insertArrowTable(e,r){e.schema.fields.length==0&&console.warn("The schema is empty! If you used arrow.Table.from, consider constructing schema and batches manually"),this.insertArrowBatches(e.schema,e.chunks,r)}insertArrowBatches(e,r,n){e.fields.length==0&&console.warn("The schema is empty! If you used arrow.Table.from, consider constructing schema and batches manually");let i=new Qo,a=new zt.RecordBatchStreamWriter().reset(i,e),u=!0;for(let o of r)u||this._bindings.insertArrowFromIPCStream(this._conn,i.flush(),n),u=!1,a.write(o);a.finish(),this._bindings.insertArrowFromIPCStream(this._conn,i.flush(),n)}insertArrowFromIPCStream(e,r){this._bindings.insertArrowFromIPCStream(this._conn,e,r)}insertCSVFromPath(e,r){this._bindings.insertCSVFromPath(this._conn,e,r)}insertJSONFromPath(e,r){this._bindings.insertJSONFromPath(this._conn,e,r)}},Ed=class{constructor(e,r,n){this.bindings=e;this.conn=r;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}},e_=class{constructor(e,r,n){this.bindings=e,this.connectionId=r,this.statementId=n}close(){this.bindings.closePrepared(this.connectionId,this.statementId)}query(...e){let r=this.bindings.runPrepared(this.connectionId,this.statementId,e),n=zt.RecordBatchReader.from(r);return console.assert(n.isSync()),console.assert(n.isFile()),zt.Table.from(n)}send(...e){let r=this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new Ed(this.bindings,this.connectionId,r),i=zt.RecordBatchReader.from(n);return console.assert(i.isSync()),console.assert(i.isStream()),i}};var ye;(function(e){e[e.SUCCESS=0]="SUCCESS"})(ye||(ye={}));function MA(){let t=new TextDecoder;return e=>(typeof SharedArrayBuffer!="undefined"&&e.buffer instanceof SharedArrayBuffer&&(e=new Uint8Array(e)),t.decode(e))}var PA=MA();function qe(t,e){console.error(e),t.ccall("duckdb_web_fail_with",null,["string"],[e])}function Ui(t,e,r){let n=t.HEAPU8.subarray(e,e+r),i=new Uint8Array(new ArrayBuffer(n.byteLength));return i.set(n),i}function de(t,e,r){return PA(t.HEAPU8.subarray(e,e+r))}var tt;(function(n){n[n.BUFFER=0]="BUFFER",n[n.NATIVE=1]="NATIVE",n[n.HTTP=3]="HTTP"})(tt||(tt={}));function ve(t,e,r,n){let i=t.stackSave(),a=t.stackAlloc(3*8);r.unshift("number"),n.unshift(a),t.ccall(e,null,r,n);let u=t.HEAPF64[(a>>3)+0],o=t.HEAPF64[(a>>3)+1],p=t.HEAPF64[(a>>3)+2];return t.stackRestore(i),[u,o,p]}function We(t){t.ccall("duckdb_web_clear_response",null,[],[])}var Rd=class{constructor(e){let r=new Float64Array(e.buffer,e.byteOffset,e.byteLength/8),n=new Uint8Array(new ArrayBuffer(e.byteLength));n.set(e.subarray(7*8)),this.totalFileReadsCold=r[0],this.totalFileReadsAhead=r[1],this.totalFileReadsCached=r[2],this.totalFileWrites=r[3],this.totalPageAccesses=r[4],this.totalPageLoads=r[5],this.blockSize=r[6],this.blockStats=n}getBlockStats(e,r){return r=r||{file_reads_cold:0,file_reads_ahead:0,file_reads_cached:0,file_writes:0,page_accesses:0,page_loads:0},r.file_writes=this.blockStats[e*3+0]&15,r.file_reads_cold=this.blockStats[e*3+0]>>4,r.file_reads_ahead=this.blockStats[e*3+1]&15,r.file_reads_cached=this.blockStats[e*3+1]>>4,r.page_accesses=this.blockStats[e*3+1]&15,r.page_loads=this.blockStats[e*3+1]>>4,r}};var VA=new TextEncoder,t_;(function(a){a[a.WASM_EXCEPTIONS=1]="WASM_EXCEPTIONS",a[a.WASM_THREADS=2]="WASM_THREADS",a[a.WASM_SIMD=4]="WASM_SIMD",a[a.WASM_BULK_MEMORY=8]="WASM_BULK_MEMORY",a[a.EMIT_BIGINT=16]="EMIT_BIGINT"})(t_||(t_={}));var Ud=class{constructor(e,r){this._instance=null;this._initPromise=null;this._initPromiseResolver=()=>{};this._logger=e,this._runtime=r}get logger(){return this._logger}get mod(){return this._instance}get pthread(){return this.mod.PThread||null}async instantiate(){return this._instance!=null?this:(this._initPromise!=null&&await this._initPromise,this._initPromise=new Promise(e=>{this._initPromiseResolver=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)}open(e){let[r,n,i]=ve(this.mod,"duckdb_web_open",["string"],[JSON.stringify(e)]);if(r!==ye.SUCCESS)throw new Error(de(this.mod,n,i));We(this.mod)}reset(){let[e,r,n]=ve(this.mod,"duckdb_web_reset",[],[]);if(e!==ye.SUCCESS)throw new Error(de(this.mod,r,n));We(this.mod)}getVersion(){let[e,r,n]=ve(this.mod,"duckdb_web_get_version",[],[]);if(e!==ye.SUCCESS)throw new Error(de(this.mod,r,n));let i=de(this.mod,r,n);return We(this.mod),i}getFeatureFlags(){return this.mod.ccall("duckdb_web_get_feature_flags","number",[],[])}tokenize(e){let[r,n,i]=ve(this.mod,"duckdb_web_tokenize",["string"],[e]);if(r!==ye.SUCCESS)throw new Error(de(this.mod,n,i));let a=de(this.mod,n,i);return We(this.mod),JSON.parse(a)}connect(){let e=this.mod.ccall("duckdb_web_connect","number",[],[]);return new Fd(this,e)}disconnect(e){this.mod.ccall("duckdb_web_disconnect",null,["number"],[e])}runQuery(e,r){let[n,i,a]=ve(this.mod,"duckdb_web_query_run",["number","string"],[e,r]);if(n!==ye.SUCCESS)throw new Error(de(this.mod,i,a));let u=Ui(this.mod,i,a);return We(this.mod),u}sendQuery(e,r){let[n,i,a]=ve(this.mod,"duckdb_web_query_send",["number","string"],[e,r]);if(n!==ye.SUCCESS)throw new Error(de(this.mod,i,a));let u=Ui(this.mod,i,a);return We(this.mod),u}fetchQueryResults(e){let[r,n,i]=ve(this.mod,"duckdb_web_query_fetch_results",["number"],[e]);if(r!==ye.SUCCESS)throw new Error(de(this.mod,n,i));let a=Ui(this.mod,n,i);return We(this.mod),a}createPrepared(e,r){let[n,i,a]=ve(this.mod,"duckdb_web_prepared_create",["number","string"],[e,r]);if(n!==ye.SUCCESS)throw new Error(de(this.mod,i,a));return We(this.mod),i}closePrepared(e,r){let[n,i,a]=ve(this.mod,"duckdb_web_prepared_close",["number","number"],[e,r]);if(n!==ye.SUCCESS)throw new Error(de(this.mod,i,a));We(this.mod)}runPrepared(e,r,n){let[i,a,u]=ve(this.mod,"duckdb_web_prepared_run",["number","number","string"],[e,r,JSON.stringify(n)]);if(i!==ye.SUCCESS)throw new Error(de(this.mod,a,u));let o=Ui(this.mod,a,u);return We(this.mod),o}sendPrepared(e,r,n){let[i,a,u]=ve(this.mod,"duckdb_web_prepared_send",["number","number","string"],[e,r,JSON.stringify(n)]);if(i!==ye.SUCCESS)throw new Error(de(this.mod,a,u));let o=Ui(this.mod,a,u);return We(this.mod),o}insertArrowFromIPCStream(e,r,n){let i=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(i,i+r.length).set(r);let u=n?JSON.stringify(n):"",[o,p,s]=ve(this.mod,"duckdb_web_insert_arrow_from_ipc_stream",["number","number","number","string"],[e,i,r.length,u]);if(o!==ye.SUCCESS)throw new Error(de(this.mod,p,s))}insertCSVFromPath(e,r,n){if(n.columns!==void 0){n.columnsFlat=[];for(let s in n.columns)n.columnsFlat.push(Ei(s,n.columns[s]))}let i={...n};i.columns=i.columnsFlat,delete i.columnsFlat;let a=JSON.stringify(i),[u,o,p]=ve(this.mod,"duckdb_web_insert_csv_from_path",["number","string","string"],[e,r,a]);if(u!==ye.SUCCESS)throw new Error(de(this.mod,o,p))}insertJSONFromPath(e,r,n){if(n.columns!==void 0){n.columnsFlat=[];for(let s in n.columns)n.columnsFlat.push(Ei(s,n.columns[s]))}let i={...n};i.columns=i.columnsFlat,delete i.columnsFlat;let a=JSON.stringify(i),[u,o,p]=ve(this.mod,"duckdb_web_insert_json_from_path",["number","string","string"],[e,r,a]);if(u!==ye.SUCCESS)throw new Error(de(this.mod,o,p))}registerFileURL(e,r){r===void 0&&(r=e);let[n,i,a]=ve(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,r]);if(n!==ye.SUCCESS)throw new Error(de(this.mod,i,a));We(this.mod)}registerFileText(e,r){let n=VA.encode(r);this.registerFileBuffer(e,n)}registerFileBuffer(e,r){let n=this.mod._malloc(r.length);this.mod.HEAPU8.subarray(n,n+r.length).set(r);let[a,u,o]=ve(this.mod,"duckdb_web_fs_register_file_buffer",["string","number","number"],[e,n,r.length]);if(a!==ye.SUCCESS)throw new Error(de(this.mod,u,o));We(this.mod)}registerFileHandle(e,r){let[n,i,a]=ve(this.mod,"duckdb_web_fs_register_file_url",["string","string"],[e,e]);if(n!==ye.SUCCESS)throw new Error(de(this.mod,i,a));if(We(this.mod),globalThis.DUCKDB_RUNTIME._files=(globalThis.DUCKDB_RUNTIME._files||new Map).set(e,r),this.pthread){for(let u of this.pthread.runningWorkers)u.postMessage({cmd:"registerFileHandle",fileName:e,fileHandle:r});for(let u of this.pthread.unusedWorkers)u.postMessage({cmd:"dropFileHandle",fileName:e})}}dropFile(e){return this.mod.ccall("duckdb_web_fs_drop_file","boolean",["string"],[e])}dropFiles(){this.mod.ccall("duckdb_web_fs_drop_files",null,[],[])}flushFiles(){this.mod.ccall("duckdb_web_flush_files",null,[],[])}copyFileToPath(e,r){let[n,i,a]=ve(this.mod,"duckdb_web_copy_file_to_path",["string","string"],[e,r]);if(n!==ye.SUCCESS)throw new Error(de(this.mod,i,a));We(this.mod)}copyFileToBuffer(e){let[r,n,i]=ve(this.mod,"duckdb_web_copy_file_to_buffer",["string"],[e]);if(r!==ye.SUCCESS)throw new Error(de(this.mod,n,i));let a=this.mod.HEAPU8.subarray(n,n+i),u=new Uint8Array(a.length);return u.set(a),We(this.mod),u}collectFileStatistics(e,r){let[n,i,a]=ve(this.mod,"duckdb_web_collect_file_stats",["string","boolean"],[e,r]);if(n!==ye.SUCCESS)throw new Error(de(this.mod,i,a))}exportFileStatistics(e){let[r,n,i]=ve(this.mod,"duckdb_web_export_file_stats",["string"],[e]);if(r!==ye.SUCCESS)throw new Error(de(this.mod,n,i));return new Rd(this.mod.HEAPU8.subarray(n,n+i))}};var Md=class extends Ud{constructor(e,r,n,i){super(e,r);this.mainModuleURL=n,this.pthreadWorkerURL=i}locateFile(e,r){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=${r} path=${e}`)}instantiateWasm(e,r){return globalThis.DUCKDB_RUNTIME=this._runtime,WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(fetch(this.mainModuleURL),e).then(n=>{r(n.instance,n.module)}):fetch(this.mainModuleURL).then(n=>n.arrayBuffer()).then(n=>WebAssembly.instantiate(n,e).then(i=>{r(i.instance,i.module)})).catch(n=>{console.error("Failed to instantiate WASM:",n)}),[]}};var Pd=class extends Md{constructor(e,r,n,i=null){super(e,r,n,i)}instantiateImpl(e){return Zb({...e,instantiateWasm:this.instantiateWasm.bind(this),locateFile:this.locateFile.bind(this)})}};var rt={fileInfoCache:new Map,getFileInfo(t,e){try{let r=rt.fileInfoCache.get(e);if(r)return r;let[n,i,a]=ve(t,"duckdb_web_fs_get_file_info",["number"],[e]);if(n!==ye.SUCCESS)throw new Error(de(t,i,a));let u=de(t,i,a);We(t);let o=JSON.parse(u);if(o==null)return null;let p={...o,blob:null};return rt.fileInfoCache.set(e,p),p}catch(r){return qe(t,r.toString()),null}},testPlatformFeature:(t,e)=>{switch(e){case 1:return typeof BigInt64Array!="undefined";default:return console.warn(`test for unknown feature: ${e}`),!1}},openFile:(t,e)=>{try{rt.fileInfoCache.delete(e);let r=rt.getFileInfo(t,e);switch(r?.data_protocol){case tt.HTTP:{let n=new XMLHttpRequest;n.open("HEAD",r.data_url,!1),n.setRequestHeader("Range","bytes=0-"),n.send(null);let i=!1;if(n.status==206?i=!0:n.status==200&&(i=n.getResponseHeader("Accept-Ranges")==="bytes"),!i)return qe(t,`File does not support range requests: ${r.file_name}`),0;break}case tt.NATIVE:{if(!rt._files?.get(r.file_name))return qe(t,`No handle available for file: ${r.file_name}`),0;break}}}catch(r){qe(t,r.toString())}return 0},glob:(t,e,r)=>{try{let n=de(t,e,r);if(n.startsWith("http")){let i=new XMLHttpRequest;i.open("HEAD",n,!1),i.setRequestHeader("Range","bytes=0-"),i.send(null);let a=!1;if(i.status==206)a=!0;else if(i.status==200)a=i.getResponseHeader("Accept-Ranges")==="bytes";else{qe(t,`HEAD request failed: ${n}`);return}if(!a){qe(t,`File does not support range requests: ${n}`);return}t.ccall("duckdb_web_fs_glob_add_path",null,["string"],[n])}}catch(n){return qe(t,n.toString()),0}},checkFile:(t,e,r)=>{try{let n=de(t,e,r);if(n.startsWith("http")){let i=new XMLHttpRequest;i.open("HEAD",n,!1),i.setRequestHeader("Range","bytes=0-"),i.send(null);let a=!1;if(i.status==206)a=!0;else if(i.status==200)a=i.getResponseHeader("Accept-Ranges")==="bytes";else return!1;return!!a}}catch{return!1}return!1},syncFile:(t,e)=>{},closeFile:(t,e)=>{let r=rt.getFileInfo(t,e);switch(rt.fileInfoCache.delete(e),r?.data_protocol){case tt.HTTP:break;case tt.NATIVE:return}},truncateFile:(t,e,r)=>{switch(rt.getFileInfo(t,e)?.data_protocol){case tt.HTTP:qe(t,"Cannot truncate a http file");return;case tt.NATIVE:qe(t,"truncateFile not implemented");return}return 0},readFile(t,e,r,n,i){try{let a=rt.getFileInfo(t,e);switch(a?.data_protocol){case tt.HTTP:{if(!a.data_url)return qe(t,`Missing data URL for file ${e}`),0;let u=new XMLHttpRequest;if(u.open("GET",a.data_url,!1),u.responseType="arraybuffer",u.setRequestHeader("Range",`bytes=${i}-${i+n-1}`),u.send(null),u.status==206||u.status==200&&n==u.response.byteLength&&i==0){let o=new Uint8Array(u.response,0,Math.min(u.response.byteLength,n));return t.HEAPU8.set(o,r),o.byteLength}else return u.status==200?(qe(t,`Range request for ${a.data_url} did not return a partial response: ${u.status} "${u.statusText}"`),0):(qe(t,`Range request for ${a.data_url} did returned non-success status: ${u.status} "${u.statusText}"`),0)}case tt.NATIVE:{let u=rt._files?.get(a.file_name);if(!u)return qe(t,`No handle available for file: ${a.file_name}`),0;let o=u.slice(i,i+n),p=new Uint8Array(new FileReaderSync().readAsArrayBuffer(o));return t.HEAPU8.set(p,r),p.byteLength}}return 0}catch(a){return qe(t,a.toString()),0}},writeFile:(t,e,r,n,i)=>{switch(rt.getFileInfo(t,e)?.data_protocol){case tt.HTTP:return qe(t,"Cannot write to HTTP file"),0;case tt.NATIVE:return qe(t,"writefile not implemented"),0}return 0},getFileSize:(t,e)=>{try{let r=rt.getFileInfo(t,e);switch(r?.data_protocol){case tt.NATIVE:{let n=rt._files?.get(r.file_name);return n?n.size:(qe(t,`No handle available for file: ${r.file_name}`),0)}case tt.HTTP:{if(!r.data_url)throw new Error(`Missing data URL for file ${e}`);let n=new XMLHttpRequest;if(n.open("HEAD",r.data_url,!1),n.send(null),n.status==200){let i=n.getResponseHeader("Content-Length");if(i)return parseInt(i);throw Error(`HEAD ${r.data_url} does not contain the HTTP header: Content-Length`)}else throw Error(`HEAD ${r.data_url} returned non-success status: ${n.status} "${n.statusText}"`)}}return 0}catch(r){return qe(t,r.toString()),0}},getLastFileModificationTime:(t,e)=>{let r=rt.getFileInfo(t,e);switch(r?.data_protocol){case tt.NATIVE:{if(!rt._files?.get(r.file_name))throw Error(`No handle available for file: ${r.file_name}`);return 0}case tt.HTTP:return new Date().getTime()}return 0},checkDirectory:(t,e,r)=>!1,createDirectory:(t,e,r)=>{},removeDirectory:(t,e,r)=>{},listDirectoryEntries:(t,e,r)=>!1,moveFile:(t,e,r,n,i)=>{},removeFile:(t,e,r)=>{}};var r_=class extends Ad{postMessage(e,r){globalThis.postMessage(e,r)}async instantiate(e,r){return await new Pd(this,rt,e,r).instantiate()}};function n_(){let t=new r_;globalThis.onmessage=async e=>{await t.onMessage(e.data)}}n_();return kA;})();
|
|
19
|
-
//# sourceMappingURL=duckdb-browser-async-next-coi.worker.js.map
|